corekit-ui 0.1.27 → 0.1.29
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/dist/index.d.ts +7 -2
- package/dist/index.js +9714 -6723
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +659 -6
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +4 -2
package/dist/index.umd.cjs
CHANGED
|
@@ -1,10 +1,663 @@
|
|
|
1
|
-
(function(Z,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],s):(Z=typeof globalThis<"u"?globalThis:Z||self,s(Z.CoreKitUI={},Z.jsxRuntime,Z.React,Z.ReactDOM))})(this,(function(Z,s,m,pn){"use strict";function Hr(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 M=Hr(m),Do=Hr(pn);function Gr(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=Gr(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function K(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Gr(e))&&(o&&(o+=" "),o+=n);return o}const Wr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kr=K,Pa=(e,n)=>t=>{var o;if(n?.variants==null)return Kr(e,t?.class,t?.className);const{variants:r,defaultVariants:i}=n,a=Object.keys(r).map(u=>{const _=t?.[u],g=i?.[u];if(_===null)return null;const f=Wr(_)||Wr(g);return r[u][f]}),l=t&&Object.entries(t).reduce((u,_)=>{let[g,f]=_;return f===void 0||(u[g]=f),u},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,_)=>{let{class:g,className:f,...c}=_;return Object.entries(c).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,f]:u},[]);return Kr(e,a,d,t?.class,t?.className)},ke={boton:"_boton_18943_1",animated:"_animated_18943_59",disabled:"_disabled_18943_59",loading:"_loading_18943_59",content:"_content_18943_67",spinner:"_spinner_18943_69",start_content:"_start_content_18943_71",end_content:"_end_content_18943_73",content_item:"_content_item_18943_101",spinner_icon:"_spinner_icon_18943_123",ripple:"_ripple_18943_159",solid:"_solid_18943_211",bordered:"_bordered_18943_231",ghost:"_ghost_18943_251",light:"_light_18943_275",faded:"_faded_18943_295",shadow:"_shadow_18943_315",only_loading:"_only_loading_18943_367",sm:"_sm_18943_385",md:"_md_18943_401",lg:"_lg_18943_417",full_width:"_full_width_18943_433",icon_only:"_icon_only_18943_441",radius_none:"_radius_none_18943_483",radius_sm:"_radius_sm_18943_551",radius_md:"_radius_md_18943_559",radius_lg:"_radius_lg_18943_567",radius_full:"_radius_full_18943_575",primary:"_primary_18943_583",secondary:"_secondary_18943_593",success:"_success_18943_603",warning:"_warning_18943_613",danger:"_danger_18943_623",default:"_default_18943_633"},Ta=Pa(ke.boton,{variants:{variant:{solid:ke.solid,bordered:ke.bordered,ghost:ke.ghost,light:ke.light,faded:ke.faded,shadow:ke.shadow},color:{default:ke.default,primary:ke.primary,secondary:ke.secondary,success:ke.success,warning:ke.warning,danger:ke.danger},size:{sm:ke.sm,md:ke.md,lg:ke.lg},radius:{none:ke.radius_none,sm:ke.radius_sm,md:ke.radius_md,lg:ke.radius_lg,full:ke.radius_full},fullWidth:{true:ke.full_width},isIconOnly:{true:ke.icon_only},isLoading:{true:ke.loading},onlyLoading:{true:ke.only_loading},isDisabled:{true:ke.disabled},disableAnimation:{false:ke.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),nt=m.forwardRef(({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:_=!0,customColor:g,startContent:f,endContent:c,spinner:h,spinnerPlacement:p="end",permisos:v,permiso:w,children:y,className:x,onClick:E,style:A,type:D="button","aria-label":N,...T},L)=>{const I=w&&v?!v.includes(w):!1,O=l||i||I,V=F=>{if(O){F.preventDefault();return}if(E?.(F),u||O||!(F.currentTarget instanceof HTMLElement))return;const C=F.currentTarget,k=document.createElement("span"),z=C.getBoundingClientRect(),q=Math.max(z.width,z.height);k.className=ke.ripple,k.style.width=`${q}px`,k.style.height=`${q}px`,k.style.left=`${F.clientX-z.left}px`,k.style.top=`${F.clientY-z.top}px`,k.addEventListener("animationend",()=>k.remove(),{once:!0}),C.appendChild(k)},$=g?{"--btn-color":g,"--btn-text-color":g,...A}:A,b=Ta({variant:e,color:g?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:a,isDisabled:O,disableAnimation:_}),S=i&&s.jsx("span",{className:ke.spinner,"aria-hidden":a?void 0:"true",children:h||s.jsx("span",{className:ke.spinner_icon})}),P=a&&!N?"Cargando":N;return s.jsxs("button",{...T,ref:L,type:D,"aria-label":P,"aria-busy":i,className:K(b,x),disabled:O,onClick:V,style:$,children:[p==="start"&&S,f&&!a&&s.jsx("span",{className:K(ke.start_content,ke.content_item),children:f}),y&&!a&&s.jsx("span",{className:ke.content,children:y}),c&&!a&&s.jsx("span",{className:K(ke.end_content,ke.content_item),children:c}),p==="end"&&S]})});nt.displayName="Boton";const Ct={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},Oa=()=>s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:s.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Ur=({variant:e="solid",color:n="default",size:t="md",radius:o="md",children:r,startIcon:i,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:_,className:g="",onClick:f})=>{const c=!!f,h=m.useMemo(()=>{if(!_)return;const w=_,y=`color-mix(in oklab, ${w} 15%, transparent)`;return{solid:{"--badge-custom-bg":w,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":y,"--badge-custom-text":w,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":w,"--badge-custom-border":w},soft:{"--badge-custom-bg":`color-mix(in oklab, ${w} 10%, var(--surface-first))`,"--badge-custom-text":w,"--badge-custom-border":"transparent"}}[e]},[_,e]),p=[Ct.badge,Ct[`size_${t}`],Ct[`radius_${o}`],Ct[`variant_${e}`],!_&&Ct[`color_${n}`],_&&Ct.badge_custom,c&&Ct.badge_clickable,g].filter(Boolean).join(" "),v=m.useMemo(()=>_||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[n],[n,_]);return s.jsxs("span",{className:p,style:h,onClick:f,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&s.jsx("span",{className:Ct.dot,style:{backgroundColor:v}}),i&&s.jsx("span",{className:Ct.icon,children:i}),r,a&&s.jsx("span",{className:Ct.icon,children:a}),d&&s.jsx("button",{type:"button",className:Ct.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:s.jsx(Oa,{})})]})},Oe={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},zo=m.forwardRef(({isSelected:e,defaultSelected:n=!1,onChange:t,label:o,description:r,size:i="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:v=!1,children:w,className:y="",...x},E)=>{const[A,D]=m.useState(n),N=m.useId(),T=x.id||N,L=e!==void 0?e:A,I=F=>{if(u||_)return;const C=F.target.checked;e===void 0&&D(C),t&&t(C)},O=w||o,V=[Oe.contenedor_toggle,Oe[`tam_${i}`],!l&&Oe[`color_${a}`],Oe[`variante_${d}`],Oe[`label_${h}`],Oe[`posicion_${p}`],L&&Oe.seleccionado,u&&Oe.deshabilitado,_&&Oe.solo_lectura,g&&Oe.invalido,c&&Oe.con_iconos,v&&Oe.justify_end,y].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>O?s.jsxs("div",{className:Oe.contenedor_label,children:[s.jsxs("span",{className:Oe.texto_label,children:[O,f&&s.jsx("span",{className:Oe.marca_requerido,children:" *"})]}),r&&s.jsx("span",{className:Oe.texto_descripcion,children:r})]}):null,S=()=>d!=="moon"?null:s.jsx("div",{className:Oe.icono_moon,children:s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:s.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),P=()=>!c||d==="moon"?null:s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:Oe.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"2,6 5,9 10,3"})}),s.jsxs("svg",{className:Oe.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return s.jsxs("div",{className:V,style:$,children:[p==="top"&&b(),s.jsxs("label",{className:Oe.envoltorio_toggle,htmlFor:T,children:[p==="inline"&&h==="left"&&b(),s.jsxs("div",{className:Oe.pista_toggle,children:[s.jsx("input",{ref:E,type:"checkbox",id:T,checked:L,disabled:u,readOnly:_,required:f,"aria-invalid":g,className:Oe.input,onChange:I,...x}),s.jsx("div",{className:Oe.fondo_pista,children:s.jsxs("div",{className:Oe.pulgar_toggle,children:[S(),P()]})})]}),p==="inline"&&h==="right"&&b()]})]})});zo.displayName="Toggle";const Va=({className:e})=>s.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Yr=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),ja=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),qa=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Ba=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Ha=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),s.jsx("path",{d:"M15 19h6"}),s.jsx("path",{d:"M18 16v6"})]}),Ga=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),se={backdrop:"_backdrop_155e9_1",visible:"_visible_155e9_37",modal:"_modal_155e9_61",cuerpo_modal:"_cuerpo_modal_155e9_103",encabezado:"_encabezado_155e9_145",titulo:"_titulo_155e9_159",boton_cerrar:"_boton_cerrar_155e9_173",texto_esc:"_texto_esc_155e9_209",icono_x:"_icono_x_155e9_223",contenedor_lienzo:"_contenedor_lienzo_155e9_233",area_firma:"_area_firma_155e9_243",superficie_lienzo:"_superficie_lienzo_155e9_257",lienzo:"_lienzo_155e9_265",lienzo_deshabilitado:"_lienzo_deshabilitado_155e9_295",barra_acciones:"_barra_acciones_155e9_305",grupo_izquierda:"_grupo_izquierda_155e9_325",grupo_derecha:"_grupo_derecha_155e9_337",separador:"_separador_155e9_349",boton_accion:"_boton_accion_155e9_361",contenedor_guardar:"_contenedor_guardar_155e9_417",boton_texto_con_icono:"_boton_texto_con_icono_155e9_429",accion_texto:"_accion_texto_155e9_441",icono_boton_accion:"_icono_boton_accion_155e9_451",icono:"_icono_155e9_223",contenedor_consentimiento:"_contenedor_consentimiento_155e9_477",texto_consentimiento:"_texto_consentimiento_155e9_491",consentimiento_fila:"_consentimiento_fila_155e9_507",toggle_consentimiento:"_toggle_consentimiento_155e9_521",contenedor_subir_oculto:"_contenedor_subir_oculto_155e9_529",boton_adjuntar:"_boton_adjuntar_155e9_541",input_archivo:"_input_archivo_155e9_577",input_validacion_firma:"_input_validacion_firma_155e9_585",bloque_firma:"_bloque_firma_155e9_613",bloque_encabezado:"_bloque_encabezado_155e9_635",bloque_titulo:"_bloque_titulo_155e9_647",marca_requerido:"_marca_requerido_155e9_663",bloque_preview:"_bloque_preview_155e9_673",bloque_preview_imagen:"_bloque_preview_imagen_155e9_701",bloque_preview_placeholder:"_bloque_preview_placeholder_155e9_715",bloque_acciones:"_bloque_acciones_155e9_729",accion_agregar_firma:"_accion_agregar_firma_155e9_743",accion_eliminar_firma:"_accion_eliminar_firma_155e9_745"},Wa=8,Ka=1.2,Kt=4.2,Ua=1.8,Rr=(e,n,t)=>Math.max(n,Math.min(t,e)),Ya=(e,n)=>{const t=n.x-e.x,o=n.y-e.y;return Math.sqrt(t*t+o*o)},Xr=e=>Number.isFinite(e)?e:performance.now(),Ra=()=>{const e=m.useRef(null),[n,t]=m.useState(!0),[o,r]=m.useState(!1),[i,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),_=m.useRef([]),g=m.useRef(0),f=m.useRef(Kt),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),p=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const $=e.current,b=h();$&&b&&b.clearRect(0,0,$.width,$.height),t(!0),l.current=[],a([]),_.current=[],u.current=null,f.current=Kt,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,t(!1)},[]),y=m.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),F=Ya($,b)/S,k=(Kt-F*Ua)*Rr(b.pressure||.5,.35,1),z=Rr(k,Ka,Kt),j=f.current+(z-f.current)*.25;return f.current=j,j},[]),x=m.useCallback(($,b)=>{$.strokeStyle=d.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),E=m.useCallback(($,b)=>{const S=p();if(!S)return;const P=y($,b);x(S,P),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),t(!1)},[y,p,x]),A=m.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),P=b.width/S.width,F=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*P,y:($.clientY-S.top)*F}},[]),D=m.useCallback($=>{if(!d.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=A($);r(!0),u.current=S,_.current=[S],g.current=Xr($.timeStamp)},[A]),N=m.useCallback($=>{if(!o||!d.current.enabled)return;$.preventDefault();const b=Xr($.timeStamp);if(b-g.current<Wa)return;g.current=b;const S=A($),P=u.current;P&&(E(P,S),u.current=S,_.current.push(S))},[E,o,A]),T=m.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,a(b)}r(!1),u.current=null,_.current=[]},[o]),L=m.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let P=1;P<b.puntos.length;P++){const F=b.puntos[P-1],C=b.puntos[P],k=y(F,C);$.strokeStyle=S??d.current.color,$.lineWidth=k,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(F.x,F.y),$.quadraticCurveTo(F.x,F.y,C.x,C.y),$.stroke()}},[y]),I=m.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,a($);const b=e.current;if(!b)return;const S=h();S&&(S.clearRect(0,0,b.width,b.height),f.current=Kt,$.forEach(P=>L(S,P)),t($.length===0&&!c.current))},[h,L]),O=m.useCallback(($={})=>{const b=e.current;if(!b||n&&l.current.length===0&&!c.current)return null;const{backgroundColor:S,format:P,quality:F,strokeColor:C}=$;if(!S&&!C)return b.toDataURL("image/png");const k=document.createElement("canvas");k.width=b.width,k.height=b.height;const z=k.getContext("2d");if(!z)return null;S&&(z.fillStyle=S,z.fillRect(0,0,k.width,k.height)),C&&l.current.length>0&&!c.current?(f.current=Kt,l.current.forEach(H=>L(z,H,C))):z.drawImage(b,0,0);const q=P??"image/png",j=F??.85;return q==="image/png"?k.toDataURL(q):k.toDataURL(q,j)},[n,L]),V=m.useCallback($=>{const b=e.current,S=h();if(!b||!S)return;if(d.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const P=z=>D(z),F=z=>N(z),C=z=>T(z),k=z=>T(z);return b.addEventListener("pointerdown",P,{passive:!1}),b.addEventListener("pointermove",F,{passive:!1}),b.addEventListener("pointerup",C,{passive:!1}),b.addEventListener("pointerleave",C,{passive:!1}),b.addEventListener("pointercancel",k,{passive:!1}),()=>{b.removeEventListener("pointerdown",P),b.removeEventListener("pointermove",F),b.removeEventListener("pointerup",C),b.removeEventListener("pointerleave",C),b.removeEventListener("pointercancel",k)}},[T,D,N,h]);return m.useEffect(()=>{f.current=Kt},[i.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:I,estaVacio:n,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:O,puedeDeshacer:i.length>0}},Zr=m.forwardRef(({alto:e=200,ancho:n=700,aspectRatio:t,className:o,closeOnBackdropClick:r=!1,firmaInicial:i=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:y="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:E="Pendiente",textoGuardar:A="Guardar firma",textoLimpiar:D="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:T="Reemplazar firma",textoSolicitarFirma:L="Agregar firma",tituloBloque:I="Firma del responsable",titulo:O="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:$=!0},b)=>{const{canvasRef:S,configurarCanvas:P,deshacerUltimoTrazo:F,estaVacio:C,limpiarCanvas:k,marcarConContenido:z,obtenerDatosFirma:q,puedeDeshacer:j}=Ra(),H=m.useRef(null),J=m.useRef(null),U=m.useRef(null),ae=m.useId(),ie=`${ae}-toggle`,le=`${ae}-texto`,he=`${ae}-dialog-title`,_e=`${ae}-dialog-description`,[ge,R]=m.useState(!!a),[te,ne]=m.useState(!1),[ce,be]=m.useState(i),[ee,Ce]=m.useState(n),[xe,de]=m.useState(!1),[ye,W]=m.useState(!!i),[B,G]=m.useState(!1),pe=Math.round(ee*e/Math.max(1,n)),Q=f||c&&ye,ve=!f&&!(c&&ye),Xe=m.useCallback(re=>{const Se=S.current,Je=Se?.getContext("2d");if(!Se||!Je)return;const Ue=new Image;Ue.onload=()=>{Je.clearRect(0,0,Se.width,Se.height);const vt=Se.width/Se.height,ft=Ue.width/Ue.height;let bt=Se.width,zn=Se.height,gn=0,Fo=0;ft>vt?(zn=Se.width/ft,Fo=(Se.height-zn)/2):(bt=Se.height*ft,gn=(Se.width-bt)/2),Je.drawImage(Ue,gn,Fo,bt,zn),z(),G(!0)},Ue.src=re},[S,z]),Ye=m.useCallback(()=>{Q||(k(),be(null),G(!1),W(!1))},[Q,k]),tt=m.useCallback(()=>{f||(k(),W(!1),G(!1),de(!1))},[k,f]),Te=m.useCallback(re=>{if(Q)return;const Se=re.target.files?.[0];if(!Se)return;const Je=new FileReader;Je.onload=Ue=>{const vt=Ue.target?.result;typeof vt=="string"&&(k(),Xe(vt))},Je.readAsDataURL(Se)},[Q,Xe,k]),Ze=m.useCallback(()=>{Q||H.current?.click()},[Q]),Ge=m.useCallback(()=>{de(!1),G(!1),k()},[k]),me=m.useCallback(re=>{te||(ne(!0),setTimeout(()=>{R(!1),ne(!1),re?.()},650))},[te]),we=m.useCallback(()=>{me(()=>{Ge(),_?.()})},[me,Ge,_]),Pe=m.useCallback(()=>{if(Q||te)return;const re=q({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});!re||!xe||me(()=>{be(re),W(!0),g?.(re),Ge(),_?.()})},[xe,Q,me,Ge,q,_,g,te]);m.useEffect(()=>{a&&(R(!0),ne(!1))},[a]),m.useEffect(()=>{be(i),W(!!i)},[i]),m.useEffect(()=>{if(!ge)return;const re=()=>{const Se=U.current;Se&&Ce(Math.max(1,Math.floor(Se.clientWidth)))};return re(),window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[n,ge]),m.useImperativeHandle(b,()=>({limpiar:k,obtenerDatosFirma:q,estaVacio:()=>C}),[C,k,q]),m.useEffect(()=>{if(!ge)return;const re=P({color:"#111827",enabled:!Q});return()=>{re?.()}},[Q,P,ge]),m.useEffect(()=>{if(!ge){document.body.style.overflow="";return}const re=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",re>0&&(document.body.style.paddingRight=`${re}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[ge]),m.useEffect(()=>{ge||Ge()},[Ge,ge]),m.useEffect(()=>{if(!ge)return;const re=Se=>{if(Se.key==="Escape"){we();return}if(Se.ctrlKey&&Se.key.toLowerCase()==="z"){Se.preventDefault(),!Q&&j&&F();return}Se.ctrlKey&&Se.key==="Enter"&&(Se.preventDefault(),Q||Pe())};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[Q,F,we,Pe,ge,j]),m.useEffect(()=>{const re=J.current;if(!re)return;if(l&&!!!ce){re.setCustomValidity(h);return}re.setCustomValidity("")},[ce,l,h]);const Ne=m.useCallback(re=>{te||!r||re.target===re.currentTarget&&we()},[r,te,we]),_t=Q,oe=Q||B,Me=Q||!ye&&(C&&!B||!xe),Be=()=>{f||(ce&&tt(),ne(!1),R(!0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${se.bloque_firma} ${o||""}`,children:[s.jsxs("div",{className:se.bloque_encabezado,children:[s.jsxs("span",{className:se.bloque_titulo,children:[I,l&&s.jsx("span",{className:se.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx(Ur,{color:ce?"success":"warning",size:"sm",variant:"outline",children:ce?x:E})]}),s.jsxs("div",{className:se.bloque_preview,style:t?{aspectRatio:t}:void 0,children:[(l||u)&&s.jsx("input",{ref:J,className:se.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:ce?"signed":"",onChange:()=>{},onInvalid:re=>{l&&!ce&&re.currentTarget.setCustomValidity(h)},onInput:re=>{re.currentTarget.setCustomValidity("")}}),ce?s.jsx("img",{src:ce,alt:"Firma guardada",className:se.bloque_preview_imagen}):s.jsx("span",{className:se.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||$&&!!ce)&&s.jsxs("div",{className:se.bloque_acciones,children:[V&&s.jsx(nt,{color:"primary",size:"sm",variant:"solid",onClick:Be,className:se.accion_agregar_firma,isDisabled:Q||te,children:s.jsxs("span",{className:se.boton_texto_con_icono,children:[ce?s.jsx(Ba,{className:se.icono_boton_accion}):s.jsx(Ha,{className:se.icono_boton_accion}),s.jsx("span",{className:se.accion_texto,children:ce?T:L})]})}),$&&ce&&s.jsx(nt,{color:"default",size:"sm",variant:"bordered",onClick:Ye,className:se.accion_eliminar_firma,isDisabled:Q||te,children:s.jsxs("span",{className:se.boton_texto_con_icono,children:[s.jsx(Yr,{className:se.icono_boton_accion}),s.jsx("span",{className:se.accion_texto,children:y})]})})]})]}),ge&&s.jsx("div",{className:`${se.backdrop} ${te?"":se.visible}`,onClick:Ne,children:s.jsxs("div",{className:`${se.modal} ${te?"":se.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":he,"aria-describedby":_e,children:[s.jsxs("header",{className:se.encabezado,children:[s.jsx("h2",{id:he,className:se.titulo,children:O}),s.jsxs("button",{className:se.boton_cerrar,onClick:we,type:"button","aria-label":"Cerrar",children:[s.jsx("span",{className:se.texto_esc,children:"ESC"}),s.jsx(Va,{className:se.icono_x})]})]}),s.jsxs("div",{className:se.cuerpo_modal,children:[s.jsx("div",{className:se.contenedor_lienzo,ref:U,children:s.jsxs("div",{className:se.area_firma,children:[s.jsx("div",{className:se.superficie_lienzo,children:s.jsx("canvas",{ref:S,className:`${se.lienzo} ${_t?se.lienzo_deshabilitado:""}`,width:ee,height:pe,style:{height:`${pe}px`,pointerEvents:oe?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),ve&&s.jsxs("div",{className:se.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[s.jsxs("div",{className:se.grupo_izquierda,children:[s.jsxs("button",{className:se.boton_accion,onClick:F,type:"button",disabled:!j||_t,"aria-label":w,children:[s.jsx(ja,{className:se.icono,"aria-hidden":"true"}),s.jsx("span",{children:w})]}),s.jsx("span",{className:se.separador,"aria-hidden":"true",children:"|"}),s.jsxs("button",{className:se.boton_accion,onClick:Ye,type:"button",disabled:C&&!B||_t,"aria-label":D,children:[s.jsx(Yr,{className:se.icono,"aria-hidden":"true"}),s.jsx("span",{children:D})]})]}),d&&s.jsx("div",{className:se.grupo_derecha,children:s.jsxs("button",{className:se.boton_adjuntar,onClick:Ze,type:"button",disabled:Q,children:[s.jsx(qa,{className:se.icono,"aria-hidden":"true"}),p]})})]})]})}),ve&&s.jsxs(s.Fragment,{children:[s.jsx("div",{id:_e,className:se.contenedor_consentimiento,children:s.jsxs("div",{className:se.consentimiento_fila,children:[s.jsx(zo,{id:ie,isSelected:xe,onChange:de,color:"primary",size:"md",isDisabled:Q,"aria-describedby":le,className:se.toggle_consentimiento}),s.jsx("label",{htmlFor:ie,id:le,className:se.texto_consentimiento,children:v})]})}),s.jsx("div",{className:se.contenedor_guardar,children:s.jsx(nt,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:ye&&!c?tt:Pe,type:"button",isDisabled:Me,startContent:s.jsx(Ga,{className:se.icono,"aria-hidden":"true"}),children:ye&&!c?N:A})})]}),ve&&d&&s.jsx("div",{className:se.contenedor_subir_oculto,children:s.jsx("input",{ref:H,type:"file",accept:"image/*",className:se.input_archivo,onChange:Te,"aria-label":"Subir imagen de firma"})})]})]})})]})});Zr.displayName="Signature";const Xa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Pn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=Xa[t[e]&63];return n};const Za=({size:e="1em",...n})=>s.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:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Ja=({size:e="1em",...n})=>s.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:[s.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"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Qa=({size:e="1em",...n})=>s.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:[s.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"}),s.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),s.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"}),s.jsx("path",{d:"m2 2 20 20"})]}),Ve={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Jr=m.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,endContent:v,isRequired:w=!1,isReadOnly:y=!1,isDisabled:x=!1,isClearable:E=!1,isInvalid:A,validationState:D,validate:N,className:T,classNames:L,style:I,onChange:O,onClear:V,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:P,id:F,name:C,autoComplete:k,autoFocus:z,maxLength:q,minLength:j,pattern:H,...J}=e,U=m.useRef(null),ie=m.useRef(F??`input-text-${Pn(8)}`).current;m.useImperativeHandle(n,()=>U.current);const le=o!==void 0,[he,_e]=m.useState(r??""),ge=le?o:he,[R,te]=m.useState(!1),[ne,ce]=m.useState(!1),be=m.useMemo(()=>{if(!N)return null;const we=N(ge);return we===!0||we==null?null:typeof we=="string"?we:typeof we=="object"&&"message"in we?we.message??"Entrada inválida":"Entrada inválida"},[ge,N]),ee=m.useMemo(()=>A!==void 0?A:D==="invalid"?!0:D==="valid"?!1:!!be,[A,D,be]),Ce=D==="valid"&&!ee,xe={invalido:ee,mensaje:be},de=ge.length>0,ye=t==="password",W=ye&&ne?"text":t,B=E&&de&&!y&&!x,G=m.useCallback(we=>{if(x||y)return;const Pe=we.target.value;le||_e(Pe),O?.(Pe),$?.(Pe)},[le,x,y,O,$]),pe=m.useCallback(we=>{te(!0),b?.(we)},[b]),Q=m.useCallback(we=>{te(!1),S?.(we)},[S]),ve=m.useCallback(()=>{x||y||(le||_e(""),O?.(""),$?.(""),V?.(),U.current?.focus())},[le,x,y,O,$,V]),Xe=m.useCallback(we=>{we.key==="Escape"&&E&&de&&ve(),P?.(we)},[E,de,ve,P]),Ye=m.useCallback(()=>{ce(we=>!we),requestAnimationFrame(()=>U.current?.focus())},[]),tt=c?`${ie}-desc`:void 0,Te=ee?`${ie}-err`:void 0,Ze=[tt,Te].filter(Boolean).join(" ")||void 0,Ge=typeof h=="function"?h(xe):h??be,me=K(Ve.contenedor_base,Ve[`variante_${a}`],Ve[`tam_${d}`],Ve[`radio_${u}`],Ve[`color_${l}`],{[Ve.ancho_total]:_,[Ve.sin_animacion]:g,[Ve.deshabilitado]:x,[Ve.solo_lectura]:y,[Ve.invalido]:ee,[Ve.valido]:Ce,[Ve.enfocado]:R,[Ve.tiene_contenido]:de},T,L?.base);return s.jsxs("div",{className:me,style:I,children:[f&&s.jsxs("label",{className:K(Ve.etiqueta,L?.label),htmlFor:ie,children:[f,w&&s.jsx("span",{className:Ve.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Ve.envoltorio_input,L?.inputWrapper),children:[p&&s.jsx("span",{className:Ve.contenido_inicio,children:p}),s.jsx("div",{className:K(Ve.envoltorio_interno,L?.innerWrapper),children:s.jsx("input",{...J,ref:U,id:ie,name:C,type:W,value:le?ge:void 0,defaultValue:le?void 0:r,placeholder:i,disabled:x,readOnly:y,required:w,autoComplete:k,autoFocus:z,maxLength:q,minLength:j,pattern:H,"aria-invalid":ee||void 0,"aria-describedby":Ze,"aria-required":w,className:K(Ve.entrada,L?.input),onChange:G,onFocus:pe,onBlur:Q,onKeyDown:Xe})}),B&&s.jsx("button",{type:"button",className:K(Ve.boton_limpiar,L?.clearButton),onClick:ve,tabIndex:-1,"aria-label":"Limpiar campo",children:s.jsx(Za,{size:"0.75em"})}),ye&&s.jsx("button",{type:"button",className:Ve.boton_password,onClick:Ye,tabIndex:-1,"aria-label":ne?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":ne,children:ne?s.jsx(Qa,{}):s.jsx(Ja,{})}),v&&s.jsx("span",{className:Ve.contenido_final,children:v})]}),c&&!ee&&s.jsx("div",{id:tt,className:K(Ve.descripcion,L?.description),children:c}),ee&&Ge&&s.jsx("div",{id:Te,className:K(Ve.mensaje_error,L?.errorMessage),role:"alert",children:Ge})]})});Jr.displayName="InputText";function Tn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hn(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:a="",sufijo:l=""}=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,_]=d.split(".");let g=u;if(t){const c=typeof t=="string"?t:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let f=g;return _!==void 0?f+=o+_:i&&r&&r>0&&(f+=o+"0".repeat(r)),`${a}${f}${l}`}function Qr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:a=!0}=n;let l=e;if(r&&(l=l.replace(new RegExp(`^${Tn(r)}`),"")),i&&(l=l.replace(new RegExp(`${Tn(i)}$`),"")),t){const u=typeof t=="string"?t:",";l=l.replace(new RegExp(Tn(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Tn(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function On(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function ei(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 ti(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const el=e=>s.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:[s.jsx("path",{d:"M5 12h14"}),s.jsx("path",{d:"M12 5v14"})]}),tl=e=>s.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:s.jsx("path",{d:"M5 12h14"})}),je={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},ni=m.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:c,startContent:h,endContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:E,validate:A,className:D,classNames:N,style:T,min:L,max:I,step:O=1,decimalScale:V,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:P="",suffix:F="",allowNegative:C=!0,allowDecimal:k=!0,hideControls:z=!1,clampBehavior:q="blur",onChange:j,onValueChange:H,onFocus:J,onBlur:U,onKeyDown:ae,id:ie,name:le,...he}=e,_e=m.useRef(null),R=m.useRef(ie??`input-numeric-${Pn(8)}`).current;m.useImperativeHandle(n,()=>_e.current);const te=t!==void 0,[ne,ce]=m.useState(o!==void 0?o:void 0),[be,ee]=m.useState(""),[Ce,xe]=m.useState(!1),de=te?t===""?void 0:t:ne,ye=m.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:k?V:0,decimalesFijos:$,prefijo:P,sufijo:F,permitirNegativo:C}),[b,S,V,$,P,F,C,k]),W=m.useMemo(()=>{if(!A)return null;const oe=ei(A(de));return oe.invalido?oe.mensaje:null},[de,A]),B=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!W,[x,E,W]),G=E==="valid"&&!B,pe={invalido:B,mensaje:W},Q=m.useCallback(oe=>{te||ce(oe),j?.(oe),H?.(hn(oe,ye),oe)},[te,j,H,ye]),ve=m.useCallback(oe=>{let Be=(de??0)+O*oe;q!=="none"&&(Be=On(Be,L,I)),V!==void 0&&(Be=ti(Be,V)),Q(Be),ee(hn(Be,ye))},[de,O,L,I,q,V,Q,ye]),Xe=m.useCallback(oe=>{if(y||w)return;const Me=oe.target.value,Be=S===","?",":".";let re="0-9";k&&(re+=Be),C&&(re+="-");const Se=new RegExp(`[^${re}]`,"g");let Ue=Me.replace(Se,"");if(k){const ft=Ue.split(Be);ft.length>2&&(Ue=ft[0]+Be+ft.slice(1).join(""))}if(C&&Ue.includes("-")){const ft=Ue.replace(/-/g,"");Ue=Ue.startsWith("-")?"-"+ft:ft}ee(Ue);const vt=Qr(Ue,ye);if(q==="strict"&&vt!==void 0){const ft=On(vt,L,I);Q(ft)}else Q(vt)},[y,w,ye,q,L,I,Q,S,C,k]),Ye=m.useCallback(oe=>{if(xe(!0),de!==void 0){let Me=String(de);S!=="."&&(Me=Me.replace(".",S)),ee(Me)}J?.(oe)},[de,S,J]),tt=m.useCallback(oe=>{if(xe(!1),q==="blur"&&de!==void 0){const Me=On(de,L,I);Me!==de&&Q(Me)}ee(hn(de,ye)),U?.(oe)},[de,q,L,I,Q,ye,U]),Te=m.useCallback(oe=>{oe.key==="ArrowUp"?(oe.preventDefault(),ve(1)):oe.key==="ArrowDown"&&(oe.preventDefault(),ve(-1));const Me=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],Be=oe.ctrlKey||oe.metaKey,re=k&&(oe.key===S||oe.key==="."||oe.key===","),Se=oe.key==="-"&&C,Je=/^[0-9]$/.test(oe.key);!Me.includes(oe.key)&&!Be&&!re&&!Se&&!Je&&oe.preventDefault(),ae?.(oe)},[ve,ae,S,C,k]);m.useEffect(()=>{Ce||ee(hn(de,ye))},[de,Ce,ye]);const Ze=f?`${R}-desc`:void 0,Ge=B?`${R}-err`:void 0,me=[Ze,Ge].filter(Boolean).join(" ")||void 0,we=typeof c=="function"?c(pe):c??W,Pe=I===void 0||(de??0)<I,Ne=L===void 0||(de??0)>L,_t=K(je.contenedor_base,je[`variante_${i}`],je[`tam_${l}`],je[`radio_${d}`],je[`color_${a}`],{[je.ancho_total]:u,[je.sin_animacion]:_,[je.deshabilitado]:y,[je.solo_lectura]:w,[je.invalido]:B,[je.valido]:G,[je.enfocado]:Ce},D,N?.base);return s.jsxs("div",{className:_t,style:T,children:[g&&s.jsxs("label",{className:K(je.etiqueta,N?.label),htmlFor:R,children:[g,v&&s.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(je.envoltorio_input,N?.inputWrapper),children:[s.jsxs("div",{className:K(je.envoltorio_interno,N?.innerWrapper),children:[h&&s.jsx("span",{className:je.contenido_inicio,children:h}),s.jsx("input",{...he,ref:_e,id:R,name:le,type:"text",inputMode:"decimal",value:be,placeholder:r,disabled:y,readOnly:w,required:v,"aria-invalid":B||void 0,"aria-describedby":me,"aria-required":v,className:K(je.entrada,N?.input),onChange:Xe,onFocus:Ye,onBlur:tt,onKeyDown:Te}),p&&s.jsx("span",{className:je.contenido_final,children:p})]}),!z&&!w&&!y&&s.jsxs("div",{className:K(je.controles,N?.controls),children:[s.jsx("button",{type:"button",tabIndex:-1,className:K(je.boton_control,N?.controlButton),disabled:!Ne,onClick:()=>ve(-1),"aria-label":"Decrementar valor",children:s.jsx(tl,{})}),s.jsx("button",{type:"button",tabIndex:-1,className:K(je.boton_control,N?.controlButton),disabled:!Pe,onClick:()=>ve(1),"aria-label":"Incrementar valor",children:s.jsx(el,{})})]})]}),f&&!B&&s.jsx("div",{id:Ze,className:K(je.descripcion,N?.description),children:f}),B&&we&&s.jsx("div",{id:Ge,className:K(je.mensaje_error,N?.errorMessage),role:"alert",children:we})]})});ni.displayName="InputNumeric";function nl(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 Lo(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 ol(){return new Date().toISOString().split("T")[0]}function rl(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 He={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},il=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),sl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M8 2v4"}),s.jsx("path",{d:"M16 2v4"}),s.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"M3 10h18"}),s.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),al=()=>s.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),ll=({tipo:e,onClick:n,onMouseDown:t})=>s.jsx("button",{type:"button",tabIndex:-1,className:He.boton_icono,onMouseDown:t,onClick:n,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?s.jsx(il,{}):s.jsx(sl,{})}),oi=m.forwardRef((e,n)=>{const{type:t="date",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:c,errorMessage:h,startContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:y=!1,isInvalid:x,validationState:E,validate:A,className:D,classNames:N,style:T,min:L,max:I,isClearable:O=!1,onChange:V,onFocus:$,onBlur:b,id:S,name:P,...F}=e,C=m.useRef(null),z=m.useRef(S??`input-date-${Pn(8)}`).current;m.useImperativeHandle(n,()=>C.current);const q=o!==void 0,[j,H]=m.useState(r??""),J=q?o:j,[U,ae]=m.useState(!1),ie=m.useRef(!1),le=m.useMemo(()=>{if(J&&t!=="time"&&(L||I)){if(L&&J<L)return`La fecha debe ser ${t==="date"?Lo(L):L} o posterior`;if(I&&J>I)return`La fecha debe ser ${t==="date"?Lo(I):I} o anterior`}if(!A)return null;const B=nl(A(J));return B.invalido?B.mensaje:null},[J,A,L,I,t]),he=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!le,[x,E,le]),_e=E==="valid"&&!he,ge={invalido:he,mensaje:le},R=m.useCallback(B=>{if(y||w)return;ie.current=!1;const G=B.target.value;q||H(G),V?.(G)},[q,y,w,V]),te=m.useCallback(B=>{ae(!0),$?.(B)},[$]),ne=m.useCallback(B=>{ae(!1),ie.current=!1,b?.(B)},[b]),ce=m.useCallback(B=>{B.preventDefault()},[]),be=m.useCallback(B=>{if(B.preventDefault(),B.stopPropagation(),!(!C.current||y||w)){if(ie.current){ie.current=!1,C.current.blur();return}C.current.focus();try{C.current.showPicker?.(),ie.current=!0}catch{}}},[y,w]),ee=m.useCallback(B=>{B.preventDefault(),B.stopPropagation(),ie.current=!1,q||H(""),V?.(""),C.current?.focus()},[q,V]),Ce=c?`${z}-desc`:void 0,xe=he?`${z}-err`:void 0,de=[Ce,xe].filter(Boolean).join(" ")||void 0,ye=typeof h=="function"?h(ge):h??le,W=K(He.contenedor_base,He[`variante_${a}`],He[`tam_${d}`],He[`radio_${u}`],He[`color_${l}`],{[He.ancho_total]:_,[He.sin_animacion]:g,[He.deshabilitado]:y,[He.solo_lectura]:w,[He.invalido]:he,[He.valido]:_e,[He.enfocado]:U},D,N?.base);return s.jsxs("div",{className:W,style:T,children:[f&&s.jsxs("label",{className:K(He.etiqueta,N?.label),htmlFor:z,children:[f,v&&s.jsx("span",{className:He.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx("div",{className:K(He.envoltorio_input,N?.inputWrapper),children:s.jsxs("div",{className:K(He.envoltorio_interno,N?.innerWrapper),children:[p&&s.jsx("span",{className:He.contenido_inicio,children:p}),s.jsx("input",{...F,ref:C,id:z,name:P,type:t,value:q?J:void 0,defaultValue:q?void 0:r,placeholder:i,disabled:y,readOnly:w,required:v,min:L,max:I,"aria-invalid":he||void 0,"aria-describedby":de,"aria-required":v,className:K(He.entrada,N?.input),onChange:R,onFocus:te,onBlur:ne}),O&&J&&!y&&!w&&s.jsx("button",{type:"button",tabIndex:-1,className:K(He.boton_limpiar,N?.clearButton),onMouseDown:B=>B.preventDefault(),onClick:ee,"aria-label":"Limpiar fecha",children:s.jsx(al,{})}),s.jsx(ll,{tipo:t,onClick:be,onMouseDown:ce})]})}),c&&!he&&s.jsx("div",{id:Ce,className:K(He.descripcion,N?.description),children:c}),he&&ye&&s.jsx("div",{id:xe,className:K(He.mensaje_error,N?.errorMessage),role:"alert",children:ye})]})});oi.displayName="InputDate";const cl={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Vn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,a]=m.useState(e),[l,d]=m.useState(e?"entrada":null);e&&!i?(a(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(a(!1),d(null))};if(!i)return null;const _=cl[t||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return s.jsx("div",{...r,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:n})}const Et={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 Po(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:s.jsxs("g",{fill:"currentColor",children:[s.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),s.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 To(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:s.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 ri(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),s.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 Oo({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return s.jsxs("span",{className:K(Et.badge_voz,r?Et.badge_mic:Et.badge_tts,Et[`badge_${t}`],o&&Et.badge_estirada),"data-tipo":e,children:[s.jsx("span",{className:Et.badge_icono,children:r?s.jsx(Po,{}):s.jsx(To,{})}),s.jsx("span",{className:Et.badge_texto,children:n}),r?s.jsxs("span",{className:Et.badge_ondas,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}):s.jsxs("span",{className:Et.badge_eq,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})]})}function ii({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[_,g]=m.useState(null),f=m.useRef(null),c=m.useRef(null),h=m.useRef(null),p=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),y=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),v&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[v]),x=m.useCallback(()=>{if(!v||!e)return;if(y(),f.current){try{f.current.stop()}catch(N){console.error("Error stopping recognition:",N)}f.current=null,u(!1)}const D=new SpeechSynthesisUtterance(e);D.lang=i,D.onstart=()=>l(!0),D.onend=()=>{l(!1),c.current=null},D.onerror=()=>{l(!1),c.current=null},c.current=D,window.speechSynthesis.speak(D)},[v,e,i,y]),E=m.useCallback(()=>{if(f.current)try{f.current.stop()}catch(D){console.error("Error stopping recognition:",D)}u(!1),g(null)},[]),A=m.useCallback(()=>{if(!w||t||o)return;y();const D=window,N=D.SpeechRecognition||D.webkitSpeechRecognition;if(!N){g("Navegador no compatible");return}try{const T=new N;T.continuous=!0,T.interimResults=!0,T.lang=i,T.onstart=()=>{u(!0),g(null),p.current=e||""},T.onend=()=>{u(!1),f.current=null,r?.()},T.onerror=L=>{L.error!=="no-speech"&&(u(!1),f.current=null,L.error!=="aborted"&&g("Error al reconocer voz"))},T.onresult=L=>{try{let I="";for(let $=0;$<L.results.length;$++)I+=L.results[$][0].transcript;const O=p.current&&I?" ":"",V=p.current+O+I;n(V)}catch{g("Error procesando dictado")}},f.current=T,T.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[w,t,o,e,n,i,y,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:_,escuchar:x,detenerHablar:y,dictar:A,detenerDictado:E}}function dl({size:e="1em",className:n}){return s.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:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const De={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},si=m.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:_,errorMessage:g,value:f,defaultValue:c,placeholder:h,isRequired:p=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:y=!1,isInvalid:x,validationState:E,validate:A,minRows:D=4,maxRows:N=10,disableAutosize:T=!1,hideVoiceActions:L=!1,className:I,classNames:O,style:V,onChange:$,onClear:b,onFocus:S,onBlur:P,id:F,name:C,rows:k,...z}=e,q=m.useRef(null),H=m.useRef(F??`textarea-${Pn(8)}`).current;m.useImperativeHandle(n,()=>q.current);const J=f!==void 0,[U,ae]=m.useState(c??""),ie=J?f:U,[le,he]=m.useState(!1),_e=m.useMemo(()=>{if(!A)return null;const oe=A(ie);return oe===!0||oe==null?null:typeof oe=="string"?oe:typeof oe=="object"&&"message"in oe?oe.message??"Entrada inválida":"Entrada inválida"},[ie,A]),ge=m.useMemo(()=>x!==void 0?x:E==="invalid"?!0:E==="valid"?!1:!!_e,[x,E,_e]),R=E==="valid"&&!ge,te={invalido:ge,mensaje:_e},ne=ie.length>0,ce=m.useCallback(()=>{if(!q.current||T)return;const oe=q.current,Me=window.getComputedStyle(oe),Be=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.5,re=parseFloat(Me.paddingTop)||0,Se=parseFloat(Me.paddingBottom)||0,Je=parseFloat(Me.borderTopWidth)||0,Ue=parseFloat(Me.borderBottomWidth)||0,vt=D*Be+re+Se+Je+Ue,ft=N*Be+re+Se+Je+Ue;oe.style.height="auto";const bt=oe.scrollHeight;oe.style.height=`${Math.min(Math.max(bt,vt),ft)}px`},[T,D,N]);m.useEffect(()=>{T||ce()},[ie,ce,T]);const be=m.useCallback(oe=>{J||ae(oe),$?.(oe)},[J,$]),{puedeHablar:ee,hablando:Ce,escuchar:xe,detenerHablar:de,puedeEscuchar:ye,escuchando:W,errorDictado:B,dictar:G,detenerDictado:pe}=ii({isDisabled:w||L,isReadOnly:v,value:ie,onChange:be}),Q=m.useCallback(oe=>{if(w||v)return;const Me=oe.target.value;J||ae(Me),$?.(Me)},[J,w,v,$]),ve=m.useCallback(oe=>{he(!0),S?.(oe)},[S]),Xe=m.useCallback(oe=>{he(!1),P?.(oe)},[P]),Ye=m.useCallback(()=>{w||v||(J||ae(""),$?.(""),b?.(),q.current?.focus())},[J,w,v,$,b]),tt=m.useCallback(()=>{Ce?de():xe()},[Ce,xe,de]),Te=m.useCallback(()=>{W?pe():G()},[W,G,pe]),Ze=_?`${H}-desc`:void 0,Ge=ge||B?`${H}-err`:void 0,me=[Ze,Ge].filter(Boolean).join(" ")||void 0,we=typeof g=="function"?g(te):g??_e,Pe=y&&ne&&!v&&!w,Ne=!L||Pe,_t=K(De.contenedor_base,De[`variante_${o}`],De[`tam_${i}`],De[`radio_${a}`],De[`color_${r}`],{[De.ancho_total]:l,[De.sin_animacion]:d,[De.deshabilitado]:w,[De.solo_lectura]:v,[De.invalido]:ge,[De.valido]:R,[De.enfocado]:le},I,O?.base);return s.jsxs("div",{className:_t,style:V,children:[u&&s.jsxs("label",{className:K(De.etiqueta,O?.label),htmlFor:H,children:[u,p&&s.jsx("span",{className:De.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(De.envoltorio_input,O?.inputWrapper),children:[s.jsx("textarea",{...z,ref:q,id:H,name:C,placeholder:h,value:J?ie:void 0,defaultValue:J?void 0:c,onChange:Q,onFocus:ve,onBlur:Xe,className:K(De.entrada,T&&De.sin_autosize,O?.input),readOnly:v,disabled:w,rows:k??D,"aria-invalid":ge||void 0,"aria-describedby":me,"aria-required":p,required:p}),Ne&&s.jsxs("div",{className:K(De.barra_acciones,O?.actions),children:[s.jsxs("div",{className:De.badges_contenedor,"aria-live":"polite",role:"status",children:[s.jsx(Vn,{mostrar:W,children:s.jsx(Oo,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),s.jsx(Vn,{mostrar:Ce,children:s.jsx(Oo,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),s.jsxs("div",{className:De.botones_grupo,children:[!L&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:K(De.boton_accion,Ce&&De.boton_activo_tts),onClick:tt,disabled:!ee||!Ce&&(!ie||W),title:Ce?"Detener lectura":"Leer texto","aria-pressed":Ce,"aria-label":Ce?"Detener lectura":"Leer texto",children:s.jsx(To,{})}),ye&&s.jsx("button",{type:"button",className:K(De.boton_accion,W&&De.boton_activo_mic),onClick:Te,disabled:w||v||Ce,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?s.jsx(ri,{}):s.jsx(Po,{})})]}),Pe&&s.jsx("button",{type:"button",className:De.boton_limpiar,onClick:Ye,title:"Limpiar campo","aria-label":"Limpiar campo",children:s.jsx(dl,{size:"0.75em"})})]})]})]}),_&&!ge&&s.jsx("div",{id:Ze,className:K(De.descripcion,O?.description),children:_}),ge&&we||B?s.jsxs("div",{id:Ge,className:K(De.mensaje_error,O?.errorMessage),role:"alert",children:[we,we&&B&&s.jsx("br",{}),B&&s.jsxs("span",{children:["Error de voz: ",B]})]}):null,t]})});si.displayName="TextArea";function jn(){return typeof window<"u"}function Tt(e){return Vo(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function St(e){var n;return(n=(Vo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Vo(e){return jn()?e instanceof Node||e instanceof gt(e).Node:!1}function ze(e){return jn()?e instanceof Element||e instanceof gt(e).Element:!1}function We(e){return jn()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function qn(e){return!jn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}const ul=new Set(["inline","contents"]);function mn(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=pt(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!ul.has(r)}const fl=new Set(["table","td","th"]);function _l(e){return fl.has(Tt(e))}const gl=[":popover-open",":modal"];function Bn(e){return gl.some(n=>{try{return e.matches(n)}catch{return!1}})}const pl=["transform","translate","scale","rotate","perspective"],hl=["transform","translate","scale","rotate","perspective","filter"],ml=["paint","layout","strict","content"];function jo(e){const n=Hn(),t=ze(e)?pt(e):e;return pl.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)||hl.some(o=>(t.willChange||"").includes(o))||ml.some(o=>(t.contain||"").includes(o))}function vl(e){let n=Nt(e);for(;We(n)&&!Mt(n);){if(jo(n))return n;if(Bn(n))return null;n=Nt(n)}return null}function Hn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bl=new Set(["html","body","#document"]);function Mt(e){return bl.has(Tt(e))}function pt(e){return gt(e).getComputedStyle(e)}function Gn(e){return ze(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nt(e){if(Tt(e)==="html")return e;const n=e.assignedSlot||e.parentNode||qn(e)&&e.host||St(e);return qn(n)?n.host:n}function ai(e){const n=Nt(e);return Mt(n)?e.ownerDocument?e.ownerDocument.body:e.body:We(n)&&mn(n)?n:ai(n)}function Ot(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=ai(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=gt(r);if(i){const l=qo(a);return n.concat(a,a.visualViewport||[],mn(r)?r:[],l&&t?Ot(l):[])}return n.concat(r,Ot(r,[],t))}function qo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Vt=Math.min,ht=Math.max,Wn=Math.round,nn=Math.floor,$t=e=>({x:e,y:e}),wl={left:"right",right:"left",bottom:"top",top:"bottom"},yl={start:"end",end:"start"};function Bo(e,n,t){return ht(e,Vt(n,t))}function on(e,n){return typeof e=="function"?e(n):e}function jt(e){return e.split("-")[0]}function rn(e){return e.split("-")[1]}function li(e){return e==="x"?"y":"x"}function Ho(e){return e==="y"?"height":"width"}const Cl=new Set(["top","bottom"]);function Ft(e){return Cl.has(jt(e))?"y":"x"}function Go(e){return li(Ft(e))}function xl(e,n,t){t===void 0&&(t=!1);const o=rn(e),r=Go(e),i=Ho(r);let a=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(a=Kn(a)),[a,Kn(a)]}function Sl(e){const n=Kn(e);return[Wo(e),n,Wo(n)]}function Wo(e){return e.replace(/start|end/g,n=>yl[n])}const ci=["left","right"],di=["right","left"],$l=["top","bottom"],kl=["bottom","top"];function Il(e,n,t){switch(e){case"top":case"bottom":return t?n?di:ci:n?ci:di;case"left":case"right":return n?$l:kl;default:return[]}}function El(e,n,t,o){const r=rn(e);let i=Il(jt(e),t==="start",o);return r&&(i=i.map(a=>a+"-"+r),n&&(i=i.concat(i.map(Wo)))),i}function Kn(e){return e.replace(/left|right|bottom|top/g,n=>wl[n])}function Ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function ui(e){return typeof e!="number"?Ml(e):{top:e,right:e,bottom:e,left:e}}function Un(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(Q,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],a):(Q=typeof globalThis<"u"?globalThis:Q||self,a(Q.CoreKitUI={},Q.jsxRuntime,Q.React,Q.ReactDOM))})(this,(function(Q,a,v,Dn){"use strict";function Vs(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Vs(v),dr=Vs(Dn);function js(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=js(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function W(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=js(e))&&(o&&(o+=" "),o+=t);return o}const qs=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hs=W,wc=(e,t)=>n=>{var o;if(t?.variants==null)return Hs(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const _=n?.[d],g=s?.[d];if(_===null)return null;const f=qs(_)||qs(g);return r[d][f]}),l=n&&Object.entries(n).reduce((d,_)=>{let[g,f]=_;return f===void 0||(d[g]=f),d},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,_)=>{let{class:g,className:f,...u}=_;return Object.entries(u).every(p=>{let[h,m]=p;return Array.isArray(m)?m.includes({...s,...l}[h]):{...s,...l}[h]===m})?[...d,g,f]:d},[]);return Hs(e,i,c,n?.class,n?.className)},Ie={boton:"_boton_18943_1",animated:"_animated_18943_59",disabled:"_disabled_18943_59",loading:"_loading_18943_59",content:"_content_18943_67",spinner:"_spinner_18943_69",start_content:"_start_content_18943_71",end_content:"_end_content_18943_73",content_item:"_content_item_18943_101",spinner_icon:"_spinner_icon_18943_123",ripple:"_ripple_18943_159",solid:"_solid_18943_211",bordered:"_bordered_18943_231",ghost:"_ghost_18943_251",light:"_light_18943_275",faded:"_faded_18943_295",shadow:"_shadow_18943_315",only_loading:"_only_loading_18943_367",sm:"_sm_18943_385",md:"_md_18943_401",lg:"_lg_18943_417",full_width:"_full_width_18943_433",icon_only:"_icon_only_18943_441",radius_none:"_radius_none_18943_483",radius_sm:"_radius_sm_18943_551",radius_md:"_radius_md_18943_559",radius_lg:"_radius_lg_18943_567",radius_full:"_radius_full_18943_575",primary:"_primary_18943_583",secondary:"_secondary_18943_593",success:"_success_18943_603",warning:"_warning_18943_613",danger:"_danger_18943_623",default:"_default_18943_633"},yc=wc(Ie.boton,{variants:{variant:{solid:Ie.solid,bordered:Ie.bordered,ghost:Ie.ghost,light:Ie.light,faded:Ie.faded,shadow:Ie.shadow},color:{default:Ie.default,primary:Ie.primary,secondary:Ie.secondary,success:Ie.success,warning:Ie.warning,danger:Ie.danger},size:{sm:Ie.sm,md:Ie.md,lg:Ie.lg},radius:{none:Ie.radius_none,sm:Ie.radius_sm,md:Ie.radius_md,lg:Ie.radius_lg,full:Ie.radius_full},fullWidth:{true:Ie.full_width},isIconOnly:{true:Ie.icon_only},isLoading:{true:Ie.loading},onlyLoading:{true:Ie.only_loading},isDisabled:{true:Ie.disabled},disableAnimation:{false:Ie.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),st=v.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:s=!1,onlyLoading:i=!1,isDisabled:l=!1,isIconOnly:c=!1,disableRipple:d=!1,disableAnimation:_=!0,customColor:g,startContent:f,endContent:u,spinner:p,spinnerPlacement:h="end",permisos:m,permiso:y,children:w,className:C,onClick:k,style:A,type:T="button","aria-label":M,...P},L)=>{const E=y&&m?!m.includes(y):!1,B=l||s||E,V=D=>{if(B){D.preventDefault();return}if(k?.(D),d||B||!(D.currentTarget instanceof HTMLElement))return;const x=D.currentTarget,I=document.createElement("span"),F=x.getBoundingClientRect(),j=Math.max(F.width,F.height);I.className=Ie.ripple,I.style.width=`${j}px`,I.style.height=`${j}px`,I.style.left=`${D.clientX-F.left}px`,I.style.top=`${D.clientY-F.top}px`,I.addEventListener("animationend",()=>I.remove(),{once:!0}),x.appendChild(I)},$=g?{"--btn-color":g,"--btn-text-color":g,...A}:A,b=yc({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:c,isLoading:s,onlyLoading:i,isDisabled:B,disableAnimation:_}),S=s&&a.jsx("span",{className:Ie.spinner,"aria-hidden":i?void 0:"true",children:p||a.jsx("span",{className:Ie.spinner_icon})}),O=i&&!M?"Cargando":M;return a.jsxs("button",{...P,ref:L,type:T,"aria-label":O,"aria-busy":s,className:W(b,C),disabled:B,onClick:V,style:$,children:[h==="start"&&S,f&&!i&&a.jsx("span",{className:W(Ie.start_content,Ie.content_item),children:f}),w&&!i&&a.jsx("span",{className:Ie.content,children:w}),u&&!i&&a.jsx("span",{className:W(Ie.end_content,Ie.content_item),children:u}),h==="end"&&S]})});st.displayName="Boton";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/const Cc=()=>{};/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2017 Google LLC
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/const Rs=function(e){const t=[];let n=0;for(let o=0;o<e.length;o++){let r=e.charCodeAt(o);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=r&63|128):(r&64512)===55296&&o+1<e.length&&(e.charCodeAt(o+1)&64512)===56320?(r=65536+((r&1023)<<10)+(e.charCodeAt(++o)&1023),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=r&63|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=r&63|128)}return t},xc=function(e){const t=[];let n=0,o=0;for(;n<e.length;){const r=e[n++];if(r<128)t[o++]=String.fromCharCode(r);else if(r>191&&r<224){const s=e[n++];t[o++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){const s=e[n++],i=e[n++],l=e[n++],c=((r&7)<<18|(s&63)<<12|(i&63)<<6|l&63)-65536;t[o++]=String.fromCharCode(55296+(c>>10)),t[o++]=String.fromCharCode(56320+(c&1023))}else{const s=e[n++],i=e[n++];t[o++]=String.fromCharCode((r&15)<<12|(s&63)<<6|i&63)}}return t.join("")},Us={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let r=0;r<e.length;r+=3){const s=e[r],i=r+1<e.length,l=i?e[r+1]:0,c=r+2<e.length,d=c?e[r+2]:0,_=s>>2,g=(s&3)<<4|l>>4;let f=(l&15)<<2|d>>6,u=d&63;c||(u=64,i||(f=64)),o.push(n[_],n[g],n[f],n[u])}return o.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Rs(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):xc(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let r=0;r<e.length;){const s=n[e.charAt(r++)],l=r<e.length?n[e.charAt(r)]:0;++r;const d=r<e.length?n[e.charAt(r)]:64;++r;const g=r<e.length?n[e.charAt(r)]:64;if(++r,s==null||l==null||d==null||g==null)throw new Sc;const f=s<<2|l>>4;if(o.push(f),d!==64){const u=l<<4&240|d>>2;if(o.push(u),g!==64){const p=d<<6&192|g;o.push(p)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class Sc extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const $c=function(e){const t=Rs(e);return Us.encodeByteArray(t,!0)},io=function(e){return $c(e).replace(/\./g,"")},kc=function(e){try{return Us.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2022 Google LLC
|
|
34
|
+
*
|
|
35
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
* you may not use this file except in compliance with the License.
|
|
37
|
+
* You may obtain a copy of the License at
|
|
38
|
+
*
|
|
39
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
40
|
+
*
|
|
41
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
42
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
43
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
|
+
* See the License for the specific language governing permissions and
|
|
45
|
+
* limitations under the License.
|
|
46
|
+
*/function Ec(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
|
|
47
|
+
* @license
|
|
48
|
+
* Copyright 2022 Google LLC
|
|
49
|
+
*
|
|
50
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
* you may not use this file except in compliance with the License.
|
|
52
|
+
* You may obtain a copy of the License at
|
|
53
|
+
*
|
|
54
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
*
|
|
56
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
* See the License for the specific language governing permissions and
|
|
60
|
+
* limitations under the License.
|
|
61
|
+
*/const Ic=()=>Ec().__FIREBASE_DEFAULTS__,Nc=()=>{if(typeof process>"u"||typeof process.env>"u")return;const e=process.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Mc=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&kc(e[1]);return t&&JSON.parse(t)},Ws=()=>{try{return Cc()||Ic()||Nc()||Mc()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},Ac=e=>Ws()?.emulatorHosts?.[e],Dc=e=>{const t=Ac(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const o=parseInt(t.substring(n+1),10);return t[0]==="["?[t.substring(1,n-1),o]:[t.substring(0,n),o]},Gs=()=>Ws()?.config;/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2017 Google LLC
|
|
64
|
+
*
|
|
65
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
66
|
+
* you may not use this file except in compliance with the License.
|
|
67
|
+
* You may obtain a copy of the License at
|
|
68
|
+
*
|
|
69
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
72
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
73
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
+
* See the License for the specific language governing permissions and
|
|
75
|
+
* limitations under the License.
|
|
76
|
+
*/class Tc{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,o)=>{n?this.reject(n):this.resolve(o),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,o))}}}/**
|
|
77
|
+
* @license
|
|
78
|
+
* Copyright 2025 Google LLC
|
|
79
|
+
*
|
|
80
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
81
|
+
* you may not use this file except in compliance with the License.
|
|
82
|
+
* You may obtain a copy of the License at
|
|
83
|
+
*
|
|
84
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
85
|
+
*
|
|
86
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
87
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
88
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
89
|
+
* See the License for the specific language governing permissions and
|
|
90
|
+
* limitations under the License.
|
|
91
|
+
*/function ur(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Fc(e){return(await fetch(e,{credentials:"include"})).ok}/**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2021 Google LLC
|
|
94
|
+
*
|
|
95
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
96
|
+
* you may not use this file except in compliance with the License.
|
|
97
|
+
* You may obtain a copy of the License at
|
|
98
|
+
*
|
|
99
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
100
|
+
*
|
|
101
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
102
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
103
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104
|
+
* See the License for the specific language governing permissions and
|
|
105
|
+
* limitations under the License.
|
|
106
|
+
*/function Pc(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},o=t||"demo-project",r=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i={iss:`https://securetoken.google.com/${o}`,aud:o,iat:r,exp:r+3600,auth_time:r,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}},...e};return[io(JSON.stringify(n)),io(JSON.stringify(i)),""].join(".")}const Tn={};function Lc(){const e={prod:[],emulator:[]};for(const t of Object.keys(Tn))Tn[t]?e.emulator.push(t):e.prod.push(t);return e}function Oc(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Ks=!1;function zc(e,t){if(typeof window>"u"||typeof document>"u"||!ur(window.location.host)||Tn[e]===t||Tn[e]||Ks)return;Tn[e]=t;function n(f){return`__firebase__banner__${f}`}const o="__firebase__banner",s=Lc().prod.length>0;function i(){const f=document.getElementById(o);f&&f.remove()}function l(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function c(f,u){f.setAttribute("width","24"),f.setAttribute("id",u),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function d(){const f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" ×",f.onclick=()=>{Ks=!0,i()},f}function _(f,u){f.setAttribute("id",u),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function g(){const f=Oc(o),u=n("text"),p=document.getElementById(u)||document.createElement("span"),h=n("learnmore"),m=document.getElementById(h)||document.createElement("a"),y=n("preprendIcon"),w=document.getElementById(y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){const C=f.element;l(C),_(m,h);const k=d();c(w,y),C.append(w,p,m,k),document.body.appendChild(C)}s?(p.innerText="Preview backend disconnected.",w.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
107
|
+
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
108
|
+
</g>
|
|
109
|
+
<defs>
|
|
110
|
+
<clipPath id="clip0_6013_33858">
|
|
111
|
+
<rect width="24" height="24" fill="white"/>
|
|
112
|
+
</clipPath>
|
|
113
|
+
</defs>`):(w.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
114
|
+
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
115
|
+
</g>
|
|
116
|
+
<defs>
|
|
117
|
+
<clipPath id="clip0_6083_34804">
|
|
118
|
+
<rect width="24" height="24" fill="white"/>
|
|
119
|
+
</clipPath>
|
|
120
|
+
</defs>`,p.innerText="Preview backend running in this workspace."),p.setAttribute("id",u)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",g):g()}function Bc(){try{return typeof indexedDB=="object"}catch{return!1}}function Vc(){return new Promise((e,t)=>{try{let n=!0;const o="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(o);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(o),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{t(r.error?.message||"")}}catch(n){t(n)}})}/**
|
|
121
|
+
* @license
|
|
122
|
+
* Copyright 2017 Google LLC
|
|
123
|
+
*
|
|
124
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
125
|
+
* you may not use this file except in compliance with the License.
|
|
126
|
+
* You may obtain a copy of the License at
|
|
127
|
+
*
|
|
128
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
129
|
+
*
|
|
130
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
131
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
132
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
133
|
+
* See the License for the specific language governing permissions and
|
|
134
|
+
* limitations under the License.
|
|
135
|
+
*/const jc="FirebaseError";class vn extends Error{constructor(t,n,o){super(n),this.code=t,this.customData=o,this.name=jc,Object.setPrototypeOf(this,vn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Xs.prototype.create)}}class Xs{constructor(t,n,o){this.service=t,this.serviceName=n,this.errors=o}create(t,...n){const o=n[0]||{},r=`${this.service}/${t}`,s=this.errors[t],i=s?qc(s,o):"Error",l=`${this.serviceName}: ${i} (${r}).`;return new vn(r,l,o)}}function qc(e,t){return e.replace(Hc,(n,o)=>{const r=t[o];return r!=null?String(r):`<${o}?>`})}const Hc=/\{\$([^}]+)}/g;function fr(e,t){if(e===t)return!0;const n=Object.keys(e),o=Object.keys(t);for(const r of n){if(!o.includes(r))return!1;const s=e[r],i=t[r];if(Ys(s)&&Ys(i)){if(!fr(s,i))return!1}else if(s!==i)return!1}for(const r of o)if(!n.includes(r))return!1;return!0}function Ys(e){return e!==null&&typeof e=="object"}/**
|
|
136
|
+
* @license
|
|
137
|
+
* Copyright 2021 Google LLC
|
|
138
|
+
*
|
|
139
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
140
|
+
* you may not use this file except in compliance with the License.
|
|
141
|
+
* You may obtain a copy of the License at
|
|
142
|
+
*
|
|
143
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
144
|
+
*
|
|
145
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
146
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
147
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
148
|
+
* See the License for the specific language governing permissions and
|
|
149
|
+
* limitations under the License.
|
|
150
|
+
*/function ao(e){return e&&e._delegate?e._delegate:e}class Fn{constructor(t,n,o){this.name=t,this.instanceFactory=n,this.type=o,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
|
|
151
|
+
* @license
|
|
152
|
+
* Copyright 2019 Google LLC
|
|
153
|
+
*
|
|
154
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
155
|
+
* you may not use this file except in compliance with the License.
|
|
156
|
+
* You may obtain a copy of the License at
|
|
157
|
+
*
|
|
158
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
159
|
+
*
|
|
160
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
161
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
162
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
163
|
+
* See the License for the specific language governing permissions and
|
|
164
|
+
* limitations under the License.
|
|
165
|
+
*/const rn="[DEFAULT]";/**
|
|
166
|
+
* @license
|
|
167
|
+
* Copyright 2019 Google LLC
|
|
168
|
+
*
|
|
169
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
170
|
+
* you may not use this file except in compliance with the License.
|
|
171
|
+
* You may obtain a copy of the License at
|
|
172
|
+
*
|
|
173
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
174
|
+
*
|
|
175
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
176
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
177
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
178
|
+
* See the License for the specific language governing permissions and
|
|
179
|
+
* limitations under the License.
|
|
180
|
+
*/class Rc{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const o=new Tc;if(this.instancesDeferred.set(n,o),this.isInitialized(n)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:n});r&&o.resolve(r)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(t){const n=this.normalizeInstanceIdentifier(t?.identifier),o=t?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(r){if(o)return null;throw r}else{if(o)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(Wc(t))try{this.getOrInitializeService({instanceIdentifier:rn})}catch{}for(const[n,o]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:r});o.resolve(s)}catch{}}}}clearInstance(t=rn){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=rn){return this.instances.has(t)}getOptions(t=rn){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,o=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(o))throw Error(`${this.name}(${o}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:o,options:n});for(const[s,i]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(s);o===l&&i.resolve(r)}return r}onInit(t,n){const o=this.normalizeInstanceIdentifier(n),r=this.onInitCallbacks.get(o)??new Set;r.add(t),this.onInitCallbacks.set(o,r);const s=this.instances.get(o);return s&&t(s,o),()=>{r.delete(t)}}invokeOnInitCallbacks(t,n){const o=this.onInitCallbacks.get(n);if(o)for(const r of o)try{r(t,n)}catch{}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let o=this.instances.get(t);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:Uc(t),options:n}),this.instances.set(t,o),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(o,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,o)}catch{}return o||null}normalizeInstanceIdentifier(t=rn){return this.component?this.component.multipleInstances?t:rn:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function Uc(e){return e===rn?void 0:e}function Wc(e){return e.instantiationMode==="EAGER"}/**
|
|
181
|
+
* @license
|
|
182
|
+
* Copyright 2019 Google LLC
|
|
183
|
+
*
|
|
184
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
185
|
+
* you may not use this file except in compliance with the License.
|
|
186
|
+
* You may obtain a copy of the License at
|
|
187
|
+
*
|
|
188
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
189
|
+
*
|
|
190
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
191
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
192
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
193
|
+
* See the License for the specific language governing permissions and
|
|
194
|
+
* limitations under the License.
|
|
195
|
+
*/class Gc{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new Rc(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
196
|
+
* @license
|
|
197
|
+
* Copyright 2017 Google LLC
|
|
198
|
+
*
|
|
199
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
200
|
+
* you may not use this file except in compliance with the License.
|
|
201
|
+
* You may obtain a copy of the License at
|
|
202
|
+
*
|
|
203
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
204
|
+
*
|
|
205
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
206
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
207
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
208
|
+
* See the License for the specific language governing permissions and
|
|
209
|
+
* limitations under the License.
|
|
210
|
+
*/var Be;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Be||(Be={}));const Kc={debug:Be.DEBUG,verbose:Be.VERBOSE,info:Be.INFO,warn:Be.WARN,error:Be.ERROR,silent:Be.SILENT},Xc=Be.INFO,Yc={[Be.DEBUG]:"log",[Be.VERBOSE]:"log",[Be.INFO]:"info",[Be.WARN]:"warn",[Be.ERROR]:"error"},Zc=(e,t,...n)=>{if(t<e.logLevel)return;const o=new Date().toISOString(),r=Yc[t];if(r)console[r](`[${o}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class Jc{constructor(t){this.name=t,this._logLevel=Xc,this._logHandler=Zc,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Be))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?Kc[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Be.DEBUG,...t),this._logHandler(this,Be.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Be.VERBOSE,...t),this._logHandler(this,Be.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Be.INFO,...t),this._logHandler(this,Be.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Be.WARN,...t),this._logHandler(this,Be.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Be.ERROR,...t),this._logHandler(this,Be.ERROR,...t)}}const Qc=(e,t)=>t.some(n=>e instanceof n);let Zs,Js;function ed(){return Zs||(Zs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function td(){return Js||(Js=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Qs=new WeakMap,_r=new WeakMap,ei=new WeakMap,gr=new WeakMap,hr=new WeakMap;function nd(e){const t=new Promise((n,o)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",i)},s=()=>{n(Wt(e.result)),r()},i=()=>{o(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&Qs.set(n,e)}).catch(()=>{}),hr.set(t,e),t}function od(e){if(_r.has(e))return;const t=new Promise((n,o)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",i),e.removeEventListener("abort",i)},s=()=>{n(),r()},i=()=>{o(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",i),e.addEventListener("abort",i)});_r.set(e,t)}let pr={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return _r.get(e);if(t==="objectStoreNames")return e.objectStoreNames||ei.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wt(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function rd(e){pr=e(pr)}function sd(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const o=e.call(mr(this),t,...n);return ei.set(o,t.sort?t.sort():[t]),Wt(o)}:td().includes(e)?function(...t){return e.apply(mr(this),t),Wt(Qs.get(this))}:function(...t){return Wt(e.apply(mr(this),t))}}function id(e){return typeof e=="function"?sd(e):(e instanceof IDBTransaction&&od(e),Qc(e,ed())?new Proxy(e,pr):e)}function Wt(e){if(e instanceof IDBRequest)return nd(e);if(gr.has(e))return gr.get(e);const t=id(e);return t!==e&&(gr.set(e,t),hr.set(t,e)),t}const mr=e=>hr.get(e);function ad(e,t,{blocked:n,upgrade:o,blocking:r,terminated:s}={}){const i=indexedDB.open(e,t),l=Wt(i);return o&&i.addEventListener("upgradeneeded",c=>{o(Wt(i.result),c.oldVersion,c.newVersion,Wt(i.transaction),c)}),n&&i.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),l.then(c=>{s&&c.addEventListener("close",()=>s()),r&&c.addEventListener("versionchange",d=>r(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}const ld=["get","getKey","getAll","getAllKeys","count"],cd=["put","add","delete","clear"],vr=new Map;function ti(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(vr.get(t))return vr.get(t);const n=t.replace(/FromIndex$/,""),o=t!==n,r=cd.includes(n);if(!(n in(o?IDBIndex:IDBObjectStore).prototype)||!(r||ld.includes(n)))return;const s=async function(i,...l){const c=this.transaction(i,r?"readwrite":"readonly");let d=c.store;return o&&(d=d.index(l.shift())),(await Promise.all([d[n](...l),r&&c.done]))[0]};return vr.set(t,s),s}rd(e=>({...e,get:(t,n,o)=>ti(t,n)||e.get(t,n,o),has:(t,n)=>!!ti(t,n)||e.has(t,n)}));/**
|
|
211
|
+
* @license
|
|
212
|
+
* Copyright 2019 Google LLC
|
|
213
|
+
*
|
|
214
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
215
|
+
* you may not use this file except in compliance with the License.
|
|
216
|
+
* You may obtain a copy of the License at
|
|
217
|
+
*
|
|
218
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
219
|
+
*
|
|
220
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
221
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
222
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
223
|
+
* See the License for the specific language governing permissions and
|
|
224
|
+
* limitations under the License.
|
|
225
|
+
*/class dd{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(ud(n)){const o=n.getImmediate();return`${o.library}/${o.version}`}else return null}).filter(n=>n).join(" ")}}function ud(e){return e.getComponent()?.type==="VERSION"}const br="@firebase/app",ni="0.14.9";/**
|
|
226
|
+
* @license
|
|
227
|
+
* Copyright 2019 Google LLC
|
|
228
|
+
*
|
|
229
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
230
|
+
* you may not use this file except in compliance with the License.
|
|
231
|
+
* You may obtain a copy of the License at
|
|
232
|
+
*
|
|
233
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
234
|
+
*
|
|
235
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
236
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
237
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
238
|
+
* See the License for the specific language governing permissions and
|
|
239
|
+
* limitations under the License.
|
|
240
|
+
*/const Lt=new Jc("@firebase/app"),fd="@firebase/app-compat",_d="@firebase/analytics-compat",gd="@firebase/analytics",hd="@firebase/app-check-compat",pd="@firebase/app-check",md="@firebase/auth",vd="@firebase/auth-compat",bd="@firebase/database",wd="@firebase/data-connect",yd="@firebase/database-compat",Cd="@firebase/functions",xd="@firebase/functions-compat",Sd="@firebase/installations",$d="@firebase/installations-compat",kd="@firebase/messaging",Ed="@firebase/messaging-compat",Id="@firebase/performance",Nd="@firebase/performance-compat",Md="@firebase/remote-config",Ad="@firebase/remote-config-compat",Dd="@firebase/storage",Td="@firebase/storage-compat",Fd="@firebase/firestore",Pd="@firebase/ai",Ld="@firebase/firestore-compat",Od="firebase",zd="12.10.0";/**
|
|
241
|
+
* @license
|
|
242
|
+
* Copyright 2019 Google LLC
|
|
243
|
+
*
|
|
244
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
245
|
+
* you may not use this file except in compliance with the License.
|
|
246
|
+
* You may obtain a copy of the License at
|
|
247
|
+
*
|
|
248
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
249
|
+
*
|
|
250
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
251
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
252
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
253
|
+
* See the License for the specific language governing permissions and
|
|
254
|
+
* limitations under the License.
|
|
255
|
+
*/const wr="[DEFAULT]",Bd={[br]:"fire-core",[fd]:"fire-core-compat",[gd]:"fire-analytics",[_d]:"fire-analytics-compat",[pd]:"fire-app-check",[hd]:"fire-app-check-compat",[md]:"fire-auth",[vd]:"fire-auth-compat",[bd]:"fire-rtdb",[wd]:"fire-data-connect",[yd]:"fire-rtdb-compat",[Cd]:"fire-fn",[xd]:"fire-fn-compat",[Sd]:"fire-iid",[$d]:"fire-iid-compat",[kd]:"fire-fcm",[Ed]:"fire-fcm-compat",[Id]:"fire-perf",[Nd]:"fire-perf-compat",[Md]:"fire-rc",[Ad]:"fire-rc-compat",[Dd]:"fire-gcs",[Td]:"fire-gcs-compat",[Fd]:"fire-fst",[Ld]:"fire-fst-compat",[Pd]:"fire-vertex","fire-js":"fire-js",[Od]:"fire-js-all"};/**
|
|
256
|
+
* @license
|
|
257
|
+
* Copyright 2019 Google LLC
|
|
258
|
+
*
|
|
259
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
260
|
+
* you may not use this file except in compliance with the License.
|
|
261
|
+
* You may obtain a copy of the License at
|
|
262
|
+
*
|
|
263
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
264
|
+
*
|
|
265
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
266
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
267
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
268
|
+
* See the License for the specific language governing permissions and
|
|
269
|
+
* limitations under the License.
|
|
270
|
+
*/const lo=new Map,Vd=new Map,yr=new Map;function oi(e,t){try{e.container.addComponent(t)}catch(n){Lt.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function co(e){const t=e.name;if(yr.has(t))return Lt.debug(`There were multiple attempts to register component ${t}.`),!1;yr.set(t,e);for(const n of lo.values())oi(n,e);for(const n of Vd.values())oi(n,e);return!0}function jd(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function qd(e){return e==null?!1:e.settings!==void 0}/**
|
|
271
|
+
* @license
|
|
272
|
+
* Copyright 2019 Google LLC
|
|
273
|
+
*
|
|
274
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
275
|
+
* you may not use this file except in compliance with the License.
|
|
276
|
+
* You may obtain a copy of the License at
|
|
277
|
+
*
|
|
278
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
279
|
+
*
|
|
280
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
281
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
282
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
283
|
+
* See the License for the specific language governing permissions and
|
|
284
|
+
* limitations under the License.
|
|
285
|
+
*/const Hd={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Gt=new Xs("app","Firebase",Hd);/**
|
|
286
|
+
* @license
|
|
287
|
+
* Copyright 2019 Google LLC
|
|
288
|
+
*
|
|
289
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
290
|
+
* you may not use this file except in compliance with the License.
|
|
291
|
+
* You may obtain a copy of the License at
|
|
292
|
+
*
|
|
293
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
294
|
+
*
|
|
295
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
296
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
297
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
298
|
+
* See the License for the specific language governing permissions and
|
|
299
|
+
* limitations under the License.
|
|
300
|
+
*/class Rd{constructor(t,n,o){this._isDeleted=!1,this._options={...t},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=o,this.container.addComponent(new Fn("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Gt.create("app-deleted",{appName:this._name})}}/**
|
|
301
|
+
* @license
|
|
302
|
+
* Copyright 2019 Google LLC
|
|
303
|
+
*
|
|
304
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
305
|
+
* you may not use this file except in compliance with the License.
|
|
306
|
+
* You may obtain a copy of the License at
|
|
307
|
+
*
|
|
308
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
309
|
+
*
|
|
310
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
311
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
312
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
313
|
+
* See the License for the specific language governing permissions and
|
|
314
|
+
* limitations under the License.
|
|
315
|
+
*/const Ud=zd;function Wd(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const o={name:wr,automaticDataCollectionEnabled:!0,...t},r=o.name;if(typeof r!="string"||!r)throw Gt.create("bad-app-name",{appName:String(r)});if(n||(n=Gs()),!n)throw Gt.create("no-options");const s=lo.get(r);if(s){if(fr(n,s.options)&&fr(o,s.config))return s;throw Gt.create("duplicate-app",{appName:r})}const i=new Gc(r);for(const c of yr.values())i.addComponent(c);const l=new Rd(n,o,i);return lo.set(r,l),l}function Gd(e=wr){const t=lo.get(e);if(!t&&e===wr&&Gs())return Wd();if(!t)throw Gt.create("no-app",{appName:e});return t}function Pn(e,t,n){let o=Bd[e]??e;n&&(o+=`-${n}`);const r=o.match(/\s|\//),s=t.match(/\s|\//);if(r||s){const i=[`Unable to register library "${o}" with version "${t}":`];r&&i.push(`library name "${o}" contains illegal characters (whitespace or "/")`),r&&s&&i.push("and"),s&&i.push(`version name "${t}" contains illegal characters (whitespace or "/")`),Lt.warn(i.join(" "));return}co(new Fn(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}/**
|
|
316
|
+
* @license
|
|
317
|
+
* Copyright 2021 Google LLC
|
|
318
|
+
*
|
|
319
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
320
|
+
* you may not use this file except in compliance with the License.
|
|
321
|
+
* You may obtain a copy of the License at
|
|
322
|
+
*
|
|
323
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
324
|
+
*
|
|
325
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
326
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
327
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
328
|
+
* See the License for the specific language governing permissions and
|
|
329
|
+
* limitations under the License.
|
|
330
|
+
*/const Kd="firebase-heartbeat-database",Xd=1,Ln="firebase-heartbeat-store";let Cr=null;function ri(){return Cr||(Cr=ad(Kd,Xd,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Ln)}catch(n){console.warn(n)}}}}).catch(e=>{throw Gt.create("idb-open",{originalErrorMessage:e.message})})),Cr}async function Yd(e){try{const n=(await ri()).transaction(Ln),o=await n.objectStore(Ln).get(ii(e));return await n.done,o}catch(t){if(t instanceof vn)Lt.warn(t.message);else{const n=Gt.create("idb-get",{originalErrorMessage:t?.message});Lt.warn(n.message)}}}async function si(e,t){try{const o=(await ri()).transaction(Ln,"readwrite");await o.objectStore(Ln).put(t,ii(e)),await o.done}catch(n){if(n instanceof vn)Lt.warn(n.message);else{const o=Gt.create("idb-set",{originalErrorMessage:n?.message});Lt.warn(o.message)}}}function ii(e){return`${e.name}!${e.options.appId}`}/**
|
|
331
|
+
* @license
|
|
332
|
+
* Copyright 2021 Google LLC
|
|
333
|
+
*
|
|
334
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
335
|
+
* you may not use this file except in compliance with the License.
|
|
336
|
+
* You may obtain a copy of the License at
|
|
337
|
+
*
|
|
338
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
339
|
+
*
|
|
340
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
341
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
342
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
343
|
+
* See the License for the specific language governing permissions and
|
|
344
|
+
* limitations under the License.
|
|
345
|
+
*/const Zd=1024,Jd=30;class Qd{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new tu(n),this._heartbeatsCachePromise=this._storage.read().then(o=>(this._heartbeatsCache=o,o))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=ai();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(r=>r.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:n}),this._heartbeatsCache.heartbeats.length>Jd){const r=nu(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(r,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(t){Lt.warn(t)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=ai(),{heartbeatsToSend:n,unsentEntries:o}=eu(this._heartbeatsCache.heartbeats),r=io(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}catch(t){return Lt.warn(t),""}}}function ai(){return new Date().toISOString().substring(0,10)}function eu(e,t=Zd){const n=[];let o=e.slice();for(const r of e){const s=n.find(i=>i.agent===r.agent);if(s){if(s.dates.push(r.date),li(n)>t){s.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),li(n)>t){n.pop();break}o=o.slice(1)}return{heartbeatsToSend:n,unsentEntries:o}}class tu{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Bc()?Vc().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await Yd(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const o=await this.read();return si(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??o.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const o=await this.read();return si(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...t.heartbeats]})}else return}}function li(e){return io(JSON.stringify({version:2,heartbeats:e})).length}function nu(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let o=1;o<e.length;o++)e[o].date<n&&(n=e[o].date,t=o);return t}/**
|
|
346
|
+
* @license
|
|
347
|
+
* Copyright 2019 Google LLC
|
|
348
|
+
*
|
|
349
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
350
|
+
* you may not use this file except in compliance with the License.
|
|
351
|
+
* You may obtain a copy of the License at
|
|
352
|
+
*
|
|
353
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
354
|
+
*
|
|
355
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
356
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
357
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
358
|
+
* See the License for the specific language governing permissions and
|
|
359
|
+
* limitations under the License.
|
|
360
|
+
*/function ou(e){co(new Fn("platform-logger",t=>new dd(t),"PRIVATE")),co(new Fn("heartbeat",t=>new Qd(t),"PRIVATE")),Pn(br,ni,e),Pn(br,ni,"esm2020"),Pn("fire-js","")}ou("");/**
|
|
361
|
+
* @license
|
|
362
|
+
* Copyright 2017 Google LLC
|
|
363
|
+
*
|
|
364
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
365
|
+
* you may not use this file except in compliance with the License.
|
|
366
|
+
* You may obtain a copy of the License at
|
|
367
|
+
*
|
|
368
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
369
|
+
*
|
|
370
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
371
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
372
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
373
|
+
* See the License for the specific language governing permissions and
|
|
374
|
+
* limitations under the License.
|
|
375
|
+
*/const ci="firebasestorage.googleapis.com",di="storageBucket",ru=120*1e3,su=600*1e3;/**
|
|
376
|
+
* @license
|
|
377
|
+
* Copyright 2017 Google LLC
|
|
378
|
+
*
|
|
379
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
380
|
+
* you may not use this file except in compliance with the License.
|
|
381
|
+
* You may obtain a copy of the License at
|
|
382
|
+
*
|
|
383
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
384
|
+
*
|
|
385
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
386
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
387
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
388
|
+
* See the License for the specific language governing permissions and
|
|
389
|
+
* limitations under the License.
|
|
390
|
+
*/class We extends vn{constructor(t,n,o=0){super(xr(t),`Firebase Storage: ${n} (${xr(t)})`),this.status_=o,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,We.prototype)}get status(){return this.status_}set status(t){this.status_=t}_codeEquals(t){return xr(t)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(t){this.customData.serverResponse=t,this.customData.serverResponse?this.message=`${this._baseMessage}
|
|
391
|
+
${this.customData.serverResponse}`:this.message=this._baseMessage}}var Ge;(function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Ge||(Ge={}));function xr(e){return"storage/"+e}function Sr(){const e="An unknown error occurred, please check the error payload for server response.";return new We(Ge.UNKNOWN,e)}function iu(e){return new We(Ge.OBJECT_NOT_FOUND,"Object '"+e+"' does not exist.")}function au(e){return new We(Ge.QUOTA_EXCEEDED,"Quota for bucket '"+e+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function lu(){const e="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new We(Ge.UNAUTHENTICATED,e)}function cu(){return new We(Ge.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function du(e){return new We(Ge.UNAUTHORIZED,"User does not have permission to access '"+e+"'.")}function uu(){return new We(Ge.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function fu(){return new We(Ge.CANCELED,"User canceled the upload/download.")}function _u(e){return new We(Ge.INVALID_URL,"Invalid URL '"+e+"'.")}function gu(e){return new We(Ge.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+e+"'.")}function hu(){return new We(Ge.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+di+"' property when initializing the app?")}function pu(){return new We(Ge.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function mu(){return new We(Ge.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function vu(e){return new We(Ge.UNSUPPORTED_ENVIRONMENT,`${e} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function $r(e){return new We(Ge.INVALID_ARGUMENT,e)}function ui(){return new We(Ge.APP_DELETED,"The Firebase app was deleted.")}function bu(e){return new We(Ge.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function On(e,t){return new We(Ge.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function zn(e){throw new We(Ge.INTERNAL_ERROR,"Internal error: "+e)}/**
|
|
392
|
+
* @license
|
|
393
|
+
* Copyright 2017 Google LLC
|
|
394
|
+
*
|
|
395
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
396
|
+
* you may not use this file except in compliance with the License.
|
|
397
|
+
* You may obtain a copy of the License at
|
|
398
|
+
*
|
|
399
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
400
|
+
*
|
|
401
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
402
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
403
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
404
|
+
* See the License for the specific language governing permissions and
|
|
405
|
+
* limitations under the License.
|
|
406
|
+
*/class Ct{constructor(t,n){this.bucket=t,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(t,n){let o;try{o=Ct.makeFromUrl(t,n)}catch{return new Ct(t,"")}if(o.path==="")return o;throw gu(t)}static makeFromUrl(t,n){let o=null;const r="([A-Za-z0-9.\\-_]+)";function s(k){k.path.charAt(k.path.length-1)==="/"&&(k.path_=k.path_.slice(0,-1))}const i="(/(.*))?$",l=new RegExp("^gs://"+r+i,"i"),c={bucket:1,path:3};function d(k){k.path_=decodeURIComponent(k.path)}const _="v[A-Za-z0-9_]+",g=n.replace(/[.]/g,"\\."),f="(/([^?#]*).*)?$",u=new RegExp(`^https?://${g}/${_}/b/${r}/o${f}`,"i"),p={bucket:1,path:3},h=n===ci?"(?:storage.googleapis.com|storage.cloud.google.com)":n,m="([^?#]*)",y=new RegExp(`^https?://${h}/${r}/${m}`,"i"),C=[{regex:l,indices:c,postModify:s},{regex:u,indices:p,postModify:d},{regex:y,indices:{bucket:1,path:2},postModify:d}];for(let k=0;k<C.length;k++){const A=C[k],T=A.regex.exec(t);if(T){const M=T[A.indices.bucket];let P=T[A.indices.path];P||(P=""),o=new Ct(M,P),A.postModify(o);break}}if(o==null)throw _u(t);return o}}class wu{constructor(t){this.promise_=Promise.reject(t)}getPromise(){return this.promise_}cancel(t=!1){}}/**
|
|
407
|
+
* @license
|
|
408
|
+
* Copyright 2017 Google LLC
|
|
409
|
+
*
|
|
410
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
411
|
+
* you may not use this file except in compliance with the License.
|
|
412
|
+
* You may obtain a copy of the License at
|
|
413
|
+
*
|
|
414
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
415
|
+
*
|
|
416
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
417
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
418
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
419
|
+
* See the License for the specific language governing permissions and
|
|
420
|
+
* limitations under the License.
|
|
421
|
+
*/function yu(e,t,n){let o=1,r=null,s=null,i=!1,l=0;function c(){return l===2}let d=!1;function _(...m){d||(d=!0,t.apply(null,m))}function g(m){r=setTimeout(()=>{r=null,e(u,c())},m)}function f(){s&&clearTimeout(s)}function u(m,...y){if(d){f();return}if(m){f(),_.call(null,m,...y);return}if(c()||i){f(),_.call(null,m,...y);return}o<64&&(o*=2);let C;l===1?(l=2,C=0):C=(o+Math.random())*1e3,g(C)}let p=!1;function h(m){p||(p=!0,f(),!d&&(r!==null?(m||(l=2),clearTimeout(r),g(0)):m||(l=1)))}return g(0),s=setTimeout(()=>{i=!0,h(!0)},n),h}function Cu(e){e(!1)}/**
|
|
422
|
+
* @license
|
|
423
|
+
* Copyright 2017 Google LLC
|
|
424
|
+
*
|
|
425
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
426
|
+
* you may not use this file except in compliance with the License.
|
|
427
|
+
* You may obtain a copy of the License at
|
|
428
|
+
*
|
|
429
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
430
|
+
*
|
|
431
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
432
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
433
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
434
|
+
* See the License for the specific language governing permissions and
|
|
435
|
+
* limitations under the License.
|
|
436
|
+
*/function xu(e){return e!==void 0}function Su(e){return typeof e=="object"&&!Array.isArray(e)}function kr(e){return typeof e=="string"||e instanceof String}function fi(e){return Er()&&e instanceof Blob}function Er(){return typeof Blob<"u"}function _i(e,t,n,o){if(o<t)throw $r(`Invalid value for '${e}'. Expected ${t} or greater.`);if(o>n)throw $r(`Invalid value for '${e}'. Expected ${n} or less.`)}/**
|
|
437
|
+
* @license
|
|
438
|
+
* Copyright 2017 Google LLC
|
|
439
|
+
*
|
|
440
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
441
|
+
* you may not use this file except in compliance with the License.
|
|
442
|
+
* You may obtain a copy of the License at
|
|
443
|
+
*
|
|
444
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
445
|
+
*
|
|
446
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
447
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
448
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
449
|
+
* See the License for the specific language governing permissions and
|
|
450
|
+
* limitations under the License.
|
|
451
|
+
*/function Ir(e,t,n){let o=t;return n==null&&(o=`https://${t}`),`${n}://${o}/v0${e}`}function gi(e){const t=encodeURIComponent;let n="?";for(const o in e)if(e.hasOwnProperty(o)){const r=t(o)+"="+t(e[o]);n=n+r+"&"}return n=n.slice(0,-1),n}var sn;(function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"})(sn||(sn={}));/**
|
|
452
|
+
* @license
|
|
453
|
+
* Copyright 2022 Google LLC
|
|
454
|
+
*
|
|
455
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
456
|
+
* you may not use this file except in compliance with the License.
|
|
457
|
+
* You may obtain a copy of the License at
|
|
458
|
+
*
|
|
459
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
460
|
+
*
|
|
461
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
462
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
463
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
464
|
+
* See the License for the specific language governing permissions and
|
|
465
|
+
* limitations under the License.
|
|
466
|
+
*/function $u(e,t){const n=e>=500&&e<600,r=[408,429].indexOf(e)!==-1,s=t.indexOf(e)!==-1;return n||r||s}/**
|
|
467
|
+
* @license
|
|
468
|
+
* Copyright 2017 Google LLC
|
|
469
|
+
*
|
|
470
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
471
|
+
* you may not use this file except in compliance with the License.
|
|
472
|
+
* You may obtain a copy of the License at
|
|
473
|
+
*
|
|
474
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
475
|
+
*
|
|
476
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
477
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
478
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
479
|
+
* See the License for the specific language governing permissions and
|
|
480
|
+
* limitations under the License.
|
|
481
|
+
*/class ku{constructor(t,n,o,r,s,i,l,c,d,_,g,f=!0,u=!1){this.url_=t,this.method_=n,this.headers_=o,this.body_=r,this.successCodes_=s,this.additionalRetryCodes_=i,this.callback_=l,this.errorCallback_=c,this.timeout_=d,this.progressCallback_=_,this.connectionFactory_=g,this.retry=f,this.isUsingEmulator=u,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,h)=>{this.resolve_=p,this.reject_=h,this.start_()})}start_(){const t=(o,r)=>{if(r){o(!1,new uo(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const i=l=>{const c=l.loaded,d=l.lengthComputable?l.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,d)};this.progressCallback_!==null&&s.addUploadProgressListener(i),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(i),this.pendingConnection_=null;const l=s.getErrorCode()===sn.NO_ERROR,c=s.getStatus();if(!l||$u(c,this.additionalRetryCodes_)&&this.retry){const _=s.getErrorCode()===sn.ABORT;o(!1,new uo(!1,null,_));return}const d=this.successCodes_.indexOf(c)!==-1;o(!0,new uo(d,s))})},n=(o,r)=>{const s=this.resolve_,i=this.reject_,l=r.connection;if(r.wasSuccessCode)try{const c=this.callback_(l,l.getResponse());xu(c)?s(c):s()}catch(c){i(c)}else if(l!==null){const c=Sr();c.serverResponse=l.getErrorText(),this.errorCallback_?i(this.errorCallback_(l,c)):i(c)}else if(r.canceled){const c=this.appDelete_?ui():fu();i(c)}else{const c=uu();i(c)}};this.canceled_?n(!1,new uo(!1,null,!0)):this.backoffId_=yu(t,n,this.timeout_)}getPromise(){return this.promise_}cancel(t){this.canceled_=!0,this.appDelete_=t||!1,this.backoffId_!==null&&Cu(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class uo{constructor(t,n,o){this.wasSuccessCode=t,this.connection=n,this.canceled=!!o}}function Eu(e,t){t!==null&&t.length>0&&(e.Authorization="Firebase "+t)}function Iu(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(t??"AppManager")}function Nu(e,t){t&&(e["X-Firebase-GMPID"]=t)}function Mu(e,t){t!==null&&(e["X-Firebase-AppCheck"]=t)}function Au(e,t,n,o,r,s,i=!0,l=!1){const c=gi(e.urlParams),d=e.url+c,_=Object.assign({},e.headers);return Nu(_,t),Eu(_,n),Iu(_,s),Mu(_,o),new ku(d,e.method,_,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,r,i,l)}/**
|
|
482
|
+
* @license
|
|
483
|
+
* Copyright 2017 Google LLC
|
|
484
|
+
*
|
|
485
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
486
|
+
* you may not use this file except in compliance with the License.
|
|
487
|
+
* You may obtain a copy of the License at
|
|
488
|
+
*
|
|
489
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
490
|
+
*
|
|
491
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
492
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
493
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
494
|
+
* See the License for the specific language governing permissions and
|
|
495
|
+
* limitations under the License.
|
|
496
|
+
*/function Du(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function Tu(...e){const t=Du();if(t!==void 0){const n=new t;for(let o=0;o<e.length;o++)n.append(e[o]);return n.getBlob()}else{if(Er())return new Blob(e);throw new We(Ge.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function Fu(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}/**
|
|
497
|
+
* @license
|
|
498
|
+
* Copyright 2021 Google LLC
|
|
499
|
+
*
|
|
500
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
501
|
+
* you may not use this file except in compliance with the License.
|
|
502
|
+
* You may obtain a copy of the License at
|
|
503
|
+
*
|
|
504
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
505
|
+
*
|
|
506
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
507
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
508
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
509
|
+
* See the License for the specific language governing permissions and
|
|
510
|
+
* limitations under the License.
|
|
511
|
+
*/function Pu(e){if(typeof atob>"u")throw vu("base-64");return atob(e)}/**
|
|
512
|
+
* @license
|
|
513
|
+
* Copyright 2017 Google LLC
|
|
514
|
+
*
|
|
515
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
516
|
+
* you may not use this file except in compliance with the License.
|
|
517
|
+
* You may obtain a copy of the License at
|
|
518
|
+
*
|
|
519
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
520
|
+
*
|
|
521
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
522
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
523
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
524
|
+
* See the License for the specific language governing permissions and
|
|
525
|
+
* limitations under the License.
|
|
526
|
+
*/const It={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class Nr{constructor(t,n){this.data=t,this.contentType=n||null}}function hi(e,t){switch(e){case It.RAW:return new Nr(pi(t));case It.BASE64:case It.BASE64URL:return new Nr(mi(e,t));case It.DATA_URL:return new Nr(Ou(t),zu(t))}throw Sr()}function pi(e){const t=[];for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o<=127)t.push(o);else if(o<=2047)t.push(192|o>>6,128|o&63);else if((o&64512)===55296)if(!(n<e.length-1&&(e.charCodeAt(n+1)&64512)===56320))t.push(239,191,189);else{const s=o,i=e.charCodeAt(++n);o=65536|(s&1023)<<10|i&1023,t.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63)}else(o&64512)===56320?t.push(239,191,189):t.push(224|o>>12,128|o>>6&63,128|o&63)}return new Uint8Array(t)}function Lu(e){let t;try{t=decodeURIComponent(e)}catch{throw On(It.DATA_URL,"Malformed data URL.")}return pi(t)}function mi(e,t){switch(e){case It.BASE64:{const r=t.indexOf("-")!==-1,s=t.indexOf("_")!==-1;if(r||s)throw On(e,"Invalid character '"+(r?"-":"_")+"' found: is it base64url encoded?");break}case It.BASE64URL:{const r=t.indexOf("+")!==-1,s=t.indexOf("/")!==-1;if(r||s)throw On(e,"Invalid character '"+(r?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=Pu(t)}catch(r){throw r.message.includes("polyfill")?r:On(e,"Invalid character found")}const o=new Uint8Array(n.length);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return o}class vi{constructor(t){this.base64=!1,this.contentType=null;const n=t.match(/^data:([^,]+)?,/);if(n===null)throw On(It.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const o=n[1]||null;o!=null&&(this.base64=Bu(o,";base64"),this.contentType=this.base64?o.substring(0,o.length-7):o),this.rest=t.substring(t.indexOf(",")+1)}}function Ou(e){const t=new vi(e);return t.base64?mi(It.BASE64,t.rest):Lu(t.rest)}function zu(e){return new vi(e).contentType}function Bu(e,t){return e.length>=t.length?e.substring(e.length-t.length)===t:!1}/**
|
|
527
|
+
* @license
|
|
528
|
+
* Copyright 2017 Google LLC
|
|
529
|
+
*
|
|
530
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
531
|
+
* you may not use this file except in compliance with the License.
|
|
532
|
+
* You may obtain a copy of the License at
|
|
533
|
+
*
|
|
534
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
535
|
+
*
|
|
536
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
537
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
538
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
539
|
+
* See the License for the specific language governing permissions and
|
|
540
|
+
* limitations under the License.
|
|
541
|
+
*/class Kt{constructor(t,n){let o=0,r="";fi(t)?(this.data_=t,o=t.size,r=t.type):t instanceof ArrayBuffer?(n?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),o=this.data_.length):t instanceof Uint8Array&&(n?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),o=t.length),this.size_=o,this.type_=r}size(){return this.size_}type(){return this.type_}slice(t,n){if(fi(this.data_)){const o=this.data_,r=Fu(o,t,n);return r===null?null:new Kt(r)}else{const o=new Uint8Array(this.data_.buffer,t,n-t);return new Kt(o,!0)}}static getBlob(...t){if(Er()){const n=t.map(o=>o instanceof Kt?o.data_:o);return new Kt(Tu.apply(null,n))}else{const n=t.map(i=>kr(i)?hi(It.RAW,i).data:i.data_);let o=0;n.forEach(i=>{o+=i.byteLength});const r=new Uint8Array(o);let s=0;return n.forEach(i=>{for(let l=0;l<i.length;l++)r[s++]=i[l]}),new Kt(r,!0)}}uploadData(){return this.data_}}/**
|
|
542
|
+
* @license
|
|
543
|
+
* Copyright 2017 Google LLC
|
|
544
|
+
*
|
|
545
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
546
|
+
* you may not use this file except in compliance with the License.
|
|
547
|
+
* You may obtain a copy of the License at
|
|
548
|
+
*
|
|
549
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
550
|
+
*
|
|
551
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
552
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
553
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
554
|
+
* See the License for the specific language governing permissions and
|
|
555
|
+
* limitations under the License.
|
|
556
|
+
*/function bi(e){let t;try{t=JSON.parse(e)}catch{return null}return Su(t)?t:null}/**
|
|
557
|
+
* @license
|
|
558
|
+
* Copyright 2017 Google LLC
|
|
559
|
+
*
|
|
560
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
561
|
+
* you may not use this file except in compliance with the License.
|
|
562
|
+
* You may obtain a copy of the License at
|
|
563
|
+
*
|
|
564
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
565
|
+
*
|
|
566
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
567
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
568
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
569
|
+
* See the License for the specific language governing permissions and
|
|
570
|
+
* limitations under the License.
|
|
571
|
+
*/function Vu(e){if(e.length===0)return null;const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function ju(e,t){const n=t.split("/").filter(o=>o.length>0).join("/");return e.length===0?n:e+"/"+n}function wi(e){const t=e.lastIndexOf("/",e.length-2);return t===-1?e:e.slice(t+1)}/**
|
|
572
|
+
* @license
|
|
573
|
+
* Copyright 2017 Google LLC
|
|
574
|
+
*
|
|
575
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
576
|
+
* you may not use this file except in compliance with the License.
|
|
577
|
+
* You may obtain a copy of the License at
|
|
578
|
+
*
|
|
579
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
580
|
+
*
|
|
581
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
582
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
583
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
584
|
+
* See the License for the specific language governing permissions and
|
|
585
|
+
* limitations under the License.
|
|
586
|
+
*/function qu(e,t){return t}class ht{constructor(t,n,o,r){this.server=t,this.local=n||t,this.writable=!!o,this.xform=r||qu}}let fo=null;function Hu(e){return!kr(e)||e.length<2?e:wi(e)}function yi(){if(fo)return fo;const e=[];e.push(new ht("bucket")),e.push(new ht("generation")),e.push(new ht("metageneration")),e.push(new ht("name","fullPath",!0));function t(s,i){return Hu(i)}const n=new ht("name");n.xform=t,e.push(n);function o(s,i){return i!==void 0?Number(i):i}const r=new ht("size");return r.xform=o,e.push(r),e.push(new ht("timeCreated")),e.push(new ht("updated")),e.push(new ht("md5Hash",null,!0)),e.push(new ht("cacheControl",null,!0)),e.push(new ht("contentDisposition",null,!0)),e.push(new ht("contentEncoding",null,!0)),e.push(new ht("contentLanguage",null,!0)),e.push(new ht("contentType",null,!0)),e.push(new ht("metadata","customMetadata",!0)),fo=e,fo}function Ru(e,t){function n(){const o=e.bucket,r=e.fullPath,s=new Ct(o,r);return t._makeStorageReference(s)}Object.defineProperty(e,"ref",{get:n})}function Uu(e,t,n){const o={};o.type="file";const r=n.length;for(let s=0;s<r;s++){const i=n[s];o[i.local]=i.xform(o,t[i.server])}return Ru(o,e),o}function Ci(e,t,n){const o=bi(t);return o===null?null:Uu(e,o,n)}function Wu(e,t,n,o){const r=bi(t);if(r===null||!kr(r.downloadTokens))return null;const s=r.downloadTokens;if(s.length===0)return null;const i=encodeURIComponent;return s.split(",").map(d=>{const _=e.bucket,g=e.fullPath,f="/b/"+i(_)+"/o/"+i(g),u=Ir(f,n,o),p=gi({alt:"media",token:d});return u+p})[0]}function Gu(e,t){const n={},o=t.length;for(let r=0;r<o;r++){const s=t[r];s.writable&&(n[s.server]=e[s.local])}return JSON.stringify(n)}class xi{constructor(t,n,o,r){this.url=t,this.method=n,this.handler=o,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
|
|
587
|
+
* @license
|
|
588
|
+
* Copyright 2017 Google LLC
|
|
589
|
+
*
|
|
590
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
591
|
+
* you may not use this file except in compliance with the License.
|
|
592
|
+
* You may obtain a copy of the License at
|
|
593
|
+
*
|
|
594
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
595
|
+
*
|
|
596
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
597
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
598
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
599
|
+
* See the License for the specific language governing permissions and
|
|
600
|
+
* limitations under the License.
|
|
601
|
+
*/function Si(e){if(!e)throw Sr()}function Ku(e,t){function n(o,r){const s=Ci(e,r,t);return Si(s!==null),s}return n}function Xu(e,t){function n(o,r){const s=Ci(e,r,t);return Si(s!==null),Wu(s,r,e.host,e._protocol)}return n}function $i(e){function t(n,o){let r;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?r=cu():r=lu():n.getStatus()===402?r=au(e.bucket):n.getStatus()===403?r=du(e.path):r=o,r.status=n.getStatus(),r.serverResponse=o.serverResponse,r}return t}function Yu(e){const t=$i(e);function n(o,r){let s=t(o,r);return o.getStatus()===404&&(s=iu(e.path)),s.serverResponse=r.serverResponse,s}return n}function Zu(e,t,n){const o=t.fullServerUrl(),r=Ir(o,e.host,e._protocol),s="GET",i=e.maxOperationRetryTime,l=new xi(r,s,Xu(e,n),i);return l.errorHandler=Yu(t),l}function Ju(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}function Qu(e,t,n){const o=Object.assign({},n);return o.fullPath=e.path,o.size=t.size(),o.contentType||(o.contentType=Ju(null,t)),o}function ef(e,t,n,o,r){const s=t.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function l(){let C="";for(let k=0;k<2;k++)C=C+Math.random().toString().slice(2);return C}const c=l();i["Content-Type"]="multipart/related; boundary="+c;const d=Qu(t,o,r),_=Gu(d,n),g="--"+c+`\r
|
|
602
|
+
Content-Type: application/json; charset=utf-8\r
|
|
603
|
+
\r
|
|
604
|
+
`+_+`\r
|
|
605
|
+
--`+c+`\r
|
|
606
|
+
Content-Type: `+d.contentType+`\r
|
|
607
|
+
\r
|
|
608
|
+
`,f=`\r
|
|
609
|
+
--`+c+"--",u=Kt.getBlob(g,o,f);if(u===null)throw pu();const p={name:d.fullPath},h=Ir(s,e.host,e._protocol),m="POST",y=e.maxUploadRetryTime,w=new xi(h,m,Ku(e,n),y);return w.urlParams=p,w.headers=i,w.body=u.uploadData(),w.errorHandler=$i(t),w}class tf{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=sn.NO_ERROR,this.sendPromise_=new Promise(t=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=sn.ABORT,t()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=sn.NETWORK_ERROR,t()}),this.xhr_.addEventListener("load",()=>{t()})})}send(t,n,o,r,s){if(this.sent_)throw zn("cannot .send() more than once");if(ur(t)&&o&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(n,t,!0),s!==void 0)for(const i in s)s.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,s[i].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw zn("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw zn("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw zn("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw zn("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(t){return this.xhr_.getResponseHeader(t)}addUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",t)}removeUploadProgressListener(t){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",t)}}class nf extends tf{initXhr(){this.xhr_.responseType="text"}}function ki(){return new nf}/**
|
|
610
|
+
* @license
|
|
611
|
+
* Copyright 2019 Google LLC
|
|
612
|
+
*
|
|
613
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
614
|
+
* you may not use this file except in compliance with the License.
|
|
615
|
+
* You may obtain a copy of the License at
|
|
616
|
+
*
|
|
617
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
618
|
+
*
|
|
619
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
620
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
621
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
622
|
+
* See the License for the specific language governing permissions and
|
|
623
|
+
* limitations under the License.
|
|
624
|
+
*/class an{constructor(t,n){this._service=t,n instanceof Ct?this._location=n:this._location=Ct.makeFromUrl(n,t.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(t,n){return new an(t,n)}get root(){const t=new Ct(this._location.bucket,"");return this._newRef(this._service,t)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return wi(this._location.path)}get storage(){return this._service}get parent(){const t=Vu(this._location.path);if(t===null)return null;const n=new Ct(this._location.bucket,t);return new an(this._service,n)}_throwIfRoot(t){if(this._location.path==="")throw bu(t)}}function of(e,t,n){e._throwIfRoot("uploadBytes");const o=ef(e.storage,e._location,yi(),new Kt(t,!0),n);return e.storage.makeRequestWithTokens(o,ki).then(r=>({metadata:r,ref:e}))}function rf(e,t,n=It.RAW,o){e._throwIfRoot("uploadString");const r=hi(n,t),s={...o};return s.contentType==null&&r.contentType!=null&&(s.contentType=r.contentType),of(e,r.data,s)}function sf(e){e._throwIfRoot("getDownloadURL");const t=Zu(e.storage,e._location,yi());return e.storage.makeRequestWithTokens(t,ki).then(n=>{if(n===null)throw mu();return n})}function af(e,t){const n=ju(e._location.path,t),o=new Ct(e._location.bucket,n);return new an(e.storage,o)}/**
|
|
625
|
+
* @license
|
|
626
|
+
* Copyright 2017 Google LLC
|
|
627
|
+
*
|
|
628
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
629
|
+
* you may not use this file except in compliance with the License.
|
|
630
|
+
* You may obtain a copy of the License at
|
|
631
|
+
*
|
|
632
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
633
|
+
*
|
|
634
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
635
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
636
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
637
|
+
* See the License for the specific language governing permissions and
|
|
638
|
+
* limitations under the License.
|
|
639
|
+
*/function lf(e){return/^[A-Za-z]+:\/\//.test(e)}function cf(e,t){return new an(e,t)}function Ei(e,t){if(e instanceof Mr){const n=e;if(n._bucket==null)throw hu();const o=new an(n,n._bucket);return t!=null?Ei(o,t):o}else return t!==void 0?af(e,t):e}function df(e,t){if(t&&lf(t)){if(e instanceof Mr)return cf(e,t);throw $r("To use ref(service, url), the first argument must be a Storage instance.")}else return Ei(e,t)}function Ii(e,t){const n=t?.[di];return n==null?null:Ct.makeFromBucketSpec(n,e)}function uf(e,t,n,o={}){e.host=`${t}:${n}`;const r=ur(t);r&&(Fc(`https://${e.host}/b`),zc("Storage",!0)),e._isUsingEmulator=!0,e._protocol=r?"https":"http";const{mockUserToken:s}=o;s&&(e._overrideAuthToken=typeof s=="string"?s:Pc(s,e.app.options.projectId))}class Mr{constructor(t,n,o,r,s,i=!1){this.app=t,this._authProvider=n,this._appCheckProvider=o,this._url=r,this._firebaseVersion=s,this._isUsingEmulator=i,this._bucket=null,this._host=ci,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ru,this._maxUploadRetryTime=su,this._requests=new Set,r!=null?this._bucket=Ct.makeFromBucketSpec(r,this._host):this._bucket=Ii(this._host,this.app.options)}get host(){return this._host}set host(t){this._host=t,this._url!=null?this._bucket=Ct.makeFromBucketSpec(this._url,t):this._bucket=Ii(t,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(t){_i("time",0,Number.POSITIVE_INFINITY,t),this._maxUploadRetryTime=t}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(t){_i("time",0,Number.POSITIVE_INFINITY,t),this._maxOperationRetryTime=t}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const t=this._authProvider.getImmediate({optional:!0});if(t){const n=await t.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(qd(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=this._appCheckProvider.getImmediate({optional:!0});return t?(await t.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(t=>t.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(t){return new an(this,t)}_makeRequest(t,n,o,r,s=!0){if(this._deleted)return new wu(ui());{const i=Au(t,this._appId,o,r,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(t,n){const[o,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(t,n,o,r).getPromise()}}const Ni="@firebase/storage",Mi="0.14.1";/**
|
|
640
|
+
* @license
|
|
641
|
+
* Copyright 2020 Google LLC
|
|
642
|
+
*
|
|
643
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
644
|
+
* you may not use this file except in compliance with the License.
|
|
645
|
+
* You may obtain a copy of the License at
|
|
646
|
+
*
|
|
647
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
648
|
+
*
|
|
649
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
650
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
651
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
652
|
+
* See the License for the specific language governing permissions and
|
|
653
|
+
* limitations under the License.
|
|
654
|
+
*/const Ai="storage";function ff(e,t,n,o){return e=ao(e),rf(e,t,n,o)}function _f(e){return e=ao(e),sf(e)}function gf(e,t){return e=ao(e),df(e,t)}function hf(e=Gd(),t){e=ao(e);const o=jd(e,Ai).getImmediate({identifier:t}),r=Dc("storage");return r&&pf(o,...r),o}function pf(e,t,n,o={}){uf(e,t,n,o)}function mf(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),o=e.getProvider("auth-internal"),r=e.getProvider("app-check-internal");return new Mr(n,o,r,t,Ud)}function vf(){co(new Fn(Ai,mf,"PUBLIC").setMultipleInstances(!0)),Pn(Ni,Mi,""),Pn(Ni,Mi,"esm2020")}vf();const Nt={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},bf=()=>a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:a.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Di=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:s,endIcon:i,dot:l,dismissible:c,onDismiss:d,customColor:_,className:g="",onClick:f})=>{const u=!!f,p=v.useMemo(()=>{if(!_)return;const y=_,w=`color-mix(in oklab, ${y} 15%, transparent)`;return{solid:{"--badge-custom-bg":y,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":y,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":y,"--badge-custom-border":y},soft:{"--badge-custom-bg":`color-mix(in oklab, ${y} 10%, var(--surface-first))`,"--badge-custom-text":y,"--badge-custom-border":"transparent"}}[e]},[_,e]),h=[Nt.badge,Nt[`size_${n}`],Nt[`radius_${o}`],Nt[`variant_${e}`],!_&&Nt[`color_${t}`],_&&Nt.badge_custom,u&&Nt.badge_clickable,g].filter(Boolean).join(" "),m=v.useMemo(()=>_||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[t],[t,_]);return a.jsxs("span",{className:h,style:p,onClick:f,role:u?"button":void 0,tabIndex:u?0:void 0,children:[l&&a.jsx("span",{className:Nt.dot,style:{backgroundColor:m}}),s&&a.jsx("span",{className:Nt.icon,children:s}),r,i&&a.jsx("span",{className:Nt.icon,children:i}),c&&a.jsx("button",{type:"button",className:Nt.dismiss_button,onClick:y=>{y.stopPropagation(),d?.()},"aria-label":"Eliminar badge",children:a.jsx(bf,{})})]})},Ve={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Ar=v.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:s="md",color:i="primary",customColor:l,variant:c="default",isDisabled:d=!1,isReadOnly:_=!1,isInvalid:g=!1,isRequired:f=!1,showIcons:u=!1,labelPlacement:p="right",labelPosition:h="inline",justifyEnd:m=!1,children:y,className:w="",...C},k)=>{const[A,T]=v.useState(t),M=v.useId(),P=C.id||M,L=e!==void 0?e:A,E=D=>{if(d||_)return;const x=D.target.checked;e===void 0&&T(x),n&&n(x)},B=y||o,V=[Ve.contenedor_toggle,Ve[`tam_${s}`],!l&&Ve[`color_${i}`],Ve[`variante_${c}`],Ve[`label_${p}`],Ve[`posicion_${h}`],L&&Ve.seleccionado,d&&Ve.deshabilitado,_&&Ve.solo_lectura,g&&Ve.invalido,u&&Ve.con_iconos,m&&Ve.justify_end,w].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>B?a.jsxs("div",{className:Ve.contenedor_label,children:[a.jsxs("span",{className:Ve.texto_label,children:[B,f&&a.jsx("span",{className:Ve.marca_requerido,children:" *"})]}),r&&a.jsx("span",{className:Ve.texto_descripcion,children:r})]}):null,S=()=>c!=="moon"?null:a.jsx("div",{className:Ve.icono_moon,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:a.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),O=()=>!u||c==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:Ve.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"2,6 5,9 10,3"})}),a.jsxs("svg",{className:Ve.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),a.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return a.jsxs("div",{className:V,style:$,children:[h==="top"&&b(),a.jsxs("label",{className:Ve.envoltorio_toggle,htmlFor:P,children:[h==="inline"&&p==="left"&&b(),a.jsxs("div",{className:Ve.pista_toggle,children:[a.jsx("input",{ref:k,type:"checkbox",id:P,checked:L,disabled:d,readOnly:_,required:f,"aria-invalid":g,className:Ve.input,onChange:E,...C}),a.jsx("div",{className:Ve.fondo_pista,children:a.jsxs("div",{className:Ve.pulgar_toggle,children:[S(),O()]})})]}),h==="inline"&&p==="right"&&b()]})]})});Ar.displayName="Toggle";const wf=({className:e})=>a.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Ti=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),yf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Cf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),xf=({className:e})=>a.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Sf=({className:e})=>a.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),a.jsx("path",{d:"M15 19h6"}),a.jsx("path",{d:"M18 16v6"})]}),$f=({className:e})=>a.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),se={backdrop:"_backdrop_155e9_1",visible:"_visible_155e9_37",modal:"_modal_155e9_61",cuerpo_modal:"_cuerpo_modal_155e9_103",encabezado:"_encabezado_155e9_145",titulo:"_titulo_155e9_159",boton_cerrar:"_boton_cerrar_155e9_173",texto_esc:"_texto_esc_155e9_209",icono_x:"_icono_x_155e9_223",contenedor_lienzo:"_contenedor_lienzo_155e9_233",area_firma:"_area_firma_155e9_243",superficie_lienzo:"_superficie_lienzo_155e9_257",lienzo:"_lienzo_155e9_265",lienzo_deshabilitado:"_lienzo_deshabilitado_155e9_295",barra_acciones:"_barra_acciones_155e9_305",grupo_izquierda:"_grupo_izquierda_155e9_325",grupo_derecha:"_grupo_derecha_155e9_337",separador:"_separador_155e9_349",boton_accion:"_boton_accion_155e9_361",contenedor_guardar:"_contenedor_guardar_155e9_417",boton_texto_con_icono:"_boton_texto_con_icono_155e9_429",accion_texto:"_accion_texto_155e9_441",icono_boton_accion:"_icono_boton_accion_155e9_451",icono:"_icono_155e9_223",contenedor_consentimiento:"_contenedor_consentimiento_155e9_477",texto_consentimiento:"_texto_consentimiento_155e9_491",consentimiento_fila:"_consentimiento_fila_155e9_507",toggle_consentimiento:"_toggle_consentimiento_155e9_521",contenedor_subir_oculto:"_contenedor_subir_oculto_155e9_529",boton_adjuntar:"_boton_adjuntar_155e9_541",input_archivo:"_input_archivo_155e9_577",input_validacion_firma:"_input_validacion_firma_155e9_585",bloque_firma:"_bloque_firma_155e9_613",bloque_encabezado:"_bloque_encabezado_155e9_635",bloque_titulo:"_bloque_titulo_155e9_647",marca_requerido:"_marca_requerido_155e9_663",bloque_preview:"_bloque_preview_155e9_673",bloque_preview_imagen:"_bloque_preview_imagen_155e9_701",bloque_preview_placeholder:"_bloque_preview_placeholder_155e9_715",bloque_acciones:"_bloque_acciones_155e9_729",accion_agregar_firma:"_accion_agregar_firma_155e9_743",accion_eliminar_firma:"_accion_eliminar_firma_155e9_745"},kf=8,Ef=1.2,ln=4.2,If=1.8,Fi=(e,t,n)=>Math.max(t,Math.min(n,e)),Nf=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Pi=e=>Number.isFinite(e)?e:performance.now(),Mf=()=>{const e=v.useRef(null),[t,n]=v.useState(!0),[o,r]=v.useState(!1),[s,i]=v.useState([]),l=v.useRef([]),c=v.useRef({color:"#111827",enabled:!0}),d=v.useRef(null),_=v.useRef([]),g=v.useRef(0),f=v.useRef(ln),u=v.useRef(!1),p=v.useCallback(()=>e.current?.getContext("2d")??null,[]),h=v.useCallback(()=>p(),[p]),m=v.useCallback(()=>{const $=e.current,b=p();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],i([]),_.current=[],d.current=null,f.current=ln,u.current=!1},[p]),y=v.useCallback(()=>{u.current=!0,n(!1)},[]),w=v.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),D=Nf($,b)/S,I=(ln-D*If)*Fi(b.pressure||.5,.35,1),F=Fi(I,Ef,ln),z=f.current+(F-f.current)*.25;return f.current=z,z},[]),C=v.useCallback(($,b)=>{$.strokeStyle=c.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),k=v.useCallback(($,b)=>{const S=h();if(!S)return;const O=w($,b);C(S,O),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[w,h,C]),A=v.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),O=b.width/S.width,D=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*O,y:($.clientY-S.top)*D}},[]),T=v.useCallback($=>{if(!c.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=A($);r(!0),d.current=S,_.current=[S],g.current=Pi($.timeStamp)},[A]),M=v.useCallback($=>{if(!o||!c.current.enabled)return;$.preventDefault();const b=Pi($.timeStamp);if(b-g.current<kf)return;g.current=b;const S=A($),O=d.current;O&&(k(O,S),d.current=S,_.current.push(S))},[k,o,A]),P=v.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&_.current.length>0){const b=[...l.current,{puntos:[..._.current]}];l.current=b,i(b)}r(!1),d.current=null,_.current=[]},[o]),L=v.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let O=1;O<b.puntos.length;O++){const D=b.puntos[O-1],x=b.puntos[O],I=w(D,x);$.strokeStyle=S??c.current.color,$.lineWidth=I,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(D.x,D.y),$.quadraticCurveTo(D.x,D.y,x.x,x.y),$.stroke()}},[w]),E=v.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,i($);const b=e.current;if(!b)return;const S=p();S&&(S.clearRect(0,0,b.width,b.height),f.current=ln,$.forEach(O=>L(S,O)),n($.length===0&&!u.current))},[p,L]),B=v.useCallback(($={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!u.current)return null;const{backgroundColor:S,format:O,quality:D,strokeColor:x}=$;if(!S&&!x)return b.toDataURL("image/png");const I=document.createElement("canvas");I.width=b.width,I.height=b.height;const F=I.getContext("2d");if(!F)return null;S&&(F.fillStyle=S,F.fillRect(0,0,I.width,I.height)),x&&l.current.length>0&&!u.current?(f.current=ln,l.current.forEach(H=>L(F,H,x))):F.drawImage(b,0,0);const j=O??"image/png",z=D??.85;return j==="image/png"?I.toDataURL(j):I.toDataURL(j,z)},[t,L]),V=v.useCallback($=>{const b=e.current,S=p();if(!b||!S)return;if(c.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!c.current.enabled)return()=>{};const O=F=>T(F),D=F=>M(F),x=F=>P(F),I=F=>P(F);return b.addEventListener("pointerdown",O,{passive:!1}),b.addEventListener("pointermove",D,{passive:!1}),b.addEventListener("pointerup",x,{passive:!1}),b.addEventListener("pointerleave",x,{passive:!1}),b.addEventListener("pointercancel",I,{passive:!1}),()=>{b.removeEventListener("pointerdown",O),b.removeEventListener("pointermove",D),b.removeEventListener("pointerup",x),b.removeEventListener("pointerleave",x),b.removeEventListener("pointercancel",I)}},[P,T,M,p]);return v.useEffect(()=>{f.current=ln},[s.length]),{canvasRef:e,configurarCanvas:V,deshacerUltimoTrazo:E,estaVacio:t,limpiarCanvas:m,marcarConContenido:y,obtenerDatosFirma:B,puedeDeshacer:s.length>0}},Li=v.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:s=null,isOpen:i=!1,isRequired:l=!1,mostrarBotonSubir:c=!0,name:d,onClose:_,onConfirm:g,readonly:f=!1,readonlyPostGuardado:u=!1,requiredMessage:p="Se debe registrar una firma para continuar",textoAdjuntar:h="Adjuntar firma",textoConsentimiento:m="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:y="Deshacer",textoEliminarFirma:w="Eliminar firma",textoEstadoGuardada:C="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:A="Guardar firma",textoLimpiar:T="Limpiar",textoModificar:M="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:L="Agregar firma",tituloBloque:E="Firma del responsable",titulo:B="Firmar el contrato",mostrarBotonAgregarFirma:V=!0,mostrarBotonEliminarFirma:$=!0,firebasePath:b,onFirebaseUploadSuccess:S,onFirebaseUploadError:O},D)=>{const{canvasRef:x,configurarCanvas:I,deshacerUltimoTrazo:F,estaVacio:j,limpiarCanvas:z,marcarConContenido:H,obtenerDatosFirma:X,puedeDeshacer:G}=Mf(),ue=v.useRef(null),oe=v.useRef(null),ie=v.useRef(null),_e=v.useId(),ge=`${_e}-toggle`,ke=`${_e}-texto`,J=`${_e}-dialog-title`,re=`${_e}-dialog-description`,[Y,ye]=v.useState(!!i),[ce,ee]=v.useState(!1),[ne,xe]=v.useState(s),[de,Se]=v.useState(t),[U,q]=v.useState(!1),[R,fe]=v.useState(!!s),[he,pe]=v.useState(!1),[Ue,Je]=v.useState(!1),nt=Math.round(de*e/Math.max(1,t)),ve=f||u&&R,Ze=!f&&!(u&&R),ot=v.useCallback(me=>{const we=x.current,vt=we?.getContext("2d");if(!we||!vt)return;const yt=new Image;yt.onload=()=>{vt.clearRect(0,0,we.width,we.height);const Mn=we.width/we.height,oo=yt.width/yt.height;let An=we.width,ro=we.height,ar=0,lr=0;oo>Mn?(ro=we.width/oo,lr=(we.height-ro)/2):(An=we.height*oo,ar=(we.width-An)/2),vt.drawImage(yt,ar,lr,An,ro),H(),pe(!0)},yt.src=me},[x,H]),be=v.useCallback(()=>{ve||(z(),xe(null),pe(!1),fe(!1))},[ve,z]),Ce=v.useCallback(()=>{f||(z(),fe(!1),pe(!1),q(!1))},[z,f]),Re=v.useCallback(me=>{if(ve)return;const we=me.target.files?.[0];if(!we)return;const vt=new FileReader;vt.onload=yt=>{const Mn=yt.target?.result;typeof Mn=="string"&&(z(),ot(Mn))},vt.readAsDataURL(we)},[ve,ot,z]),Ae=v.useCallback(()=>{ve||ue.current?.click()},[ve]),rt=v.useCallback(()=>{q(!1),pe(!1),z()},[z]),te=v.useCallback(me=>{ce||(ee(!0),setTimeout(()=>{ye(!1),ee(!1),me?.()},650))},[ce]),Ee=v.useCallback(()=>{te(()=>{rt(),_?.()})},[te,rt,_]),ze=v.useCallback(async()=>{if(ve||ce||Ue)return;const me=X({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});if(!me||!U)return;let we=me;try{if(b){Je(!0);const vt=hf(),yt=gf(vt,b);await ff(yt,me,"data_url"),we=await _f(yt),S?.(we)}te(()=>{xe(we),fe(!0),g?.(we),rt(),_?.()})}catch(vt){console.error("Error al subir la firma a Firebase:",vt),O?.(vt instanceof Error?vt:new Error(String(vt)))}finally{b&&Je(!1)}},[U,ve,te,b,rt,X,_,g,O,S,ce,Ue]);v.useEffect(()=>{i&&(ye(!0),ee(!1))},[i]),v.useEffect(()=>{xe(s),fe(!!s)},[s]),v.useEffect(()=>{if(!Y)return;const me=()=>{const we=ie.current;we&&Se(Math.max(1,Math.floor(we.clientWidth)))};return me(),window.addEventListener("resize",me),()=>window.removeEventListener("resize",me)},[t,Y]),v.useImperativeHandle(D,()=>({limpiar:z,obtenerDatosFirma:X,estaVacio:()=>j}),[j,z,X]),v.useEffect(()=>{if(!Y)return;const me=I({color:"#111827",enabled:!ve});return()=>{me?.()}},[ve,I,Y]),v.useEffect(()=>{if(!Y){document.body.style.overflow="";return}const me=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",me>0&&(document.body.style.paddingRight=`${me}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[Y]),v.useEffect(()=>{Y||rt()},[rt,Y]),v.useEffect(()=>{if(!Y)return;const me=we=>{if(we.key==="Escape"){Ee();return}if(we.ctrlKey&&we.key.toLowerCase()==="z"){we.preventDefault(),!ve&&G&&F();return}we.ctrlKey&&we.key==="Enter"&&(we.preventDefault(),ve||ze())};return document.addEventListener("keydown",me),()=>document.removeEventListener("keydown",me)},[ve,F,Ee,ze,Y,G]),v.useEffect(()=>{const me=oe.current;if(!me)return;if(l&&!!!ne){me.setCustomValidity(p);return}me.setCustomValidity("")},[ne,l,p]);const Oe=v.useCallback(me=>{ce||!r||me.target===me.currentTarget&&Ee()},[r,ce,Ee]),pt=ve,wt=ve||he,mt=ve||!R&&(j&&!he||!U),Pt=()=>{f||(ne&&Ce(),ee(!1),ye(!0))};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`${se.bloque_firma} ${o||""}`,children:[a.jsxs("div",{className:se.bloque_encabezado,children:[a.jsxs("span",{className:se.bloque_titulo,children:[E,l&&a.jsx("span",{className:se.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx(Di,{color:ne?"success":"warning",size:"sm",variant:"outline",children:ne?C:k})]}),a.jsxs("div",{className:se.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||d)&&a.jsx("input",{ref:oe,className:se.input_validacion_firma,"aria-hidden":"true",name:d,required:l,tabIndex:-1,type:"text",value:ne?"signed":"",onChange:()=>{},onInvalid:me=>{l&&!ne&&me.currentTarget.setCustomValidity(p)},onInput:me=>{me.currentTarget.setCustomValidity("")}}),ne?a.jsx("img",{src:ne,alt:"Firma guardada",className:se.bloque_preview_imagen}):a.jsx("span",{className:se.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!f&&(V||$&&!!ne)&&a.jsxs("div",{className:se.bloque_acciones,children:[V&&a.jsx(st,{color:"primary",size:"sm",variant:"solid",onClick:Pt,className:se.accion_agregar_firma,isDisabled:ve||ce,children:a.jsxs("span",{className:se.boton_texto_con_icono,children:[ne?a.jsx(xf,{className:se.icono_boton_accion}):a.jsx(Sf,{className:se.icono_boton_accion}),a.jsx("span",{className:se.accion_texto,children:ne?P:L})]})}),$&&ne&&a.jsx(st,{color:"default",size:"sm",variant:"bordered",onClick:be,className:se.accion_eliminar_firma,isDisabled:ve||ce,children:a.jsxs("span",{className:se.boton_texto_con_icono,children:[a.jsx(Ti,{className:se.icono_boton_accion}),a.jsx("span",{className:se.accion_texto,children:w})]})})]})]}),Y&&a.jsx("div",{className:`${se.backdrop} ${ce?"":se.visible}`,onClick:Oe,children:a.jsxs("div",{className:`${se.modal} ${ce?"":se.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":J,"aria-describedby":re,children:[a.jsxs("header",{className:se.encabezado,children:[a.jsx("h2",{id:J,className:se.titulo,children:B}),a.jsxs("button",{className:se.boton_cerrar,onClick:Ee,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:se.texto_esc,children:"ESC"}),a.jsx(wf,{className:se.icono_x})]})]}),a.jsxs("div",{className:se.cuerpo_modal,children:[a.jsx("div",{className:se.contenedor_lienzo,ref:ie,children:a.jsxs("div",{className:se.area_firma,children:[a.jsx("div",{className:se.superficie_lienzo,children:a.jsx("canvas",{ref:x,className:`${se.lienzo} ${pt?se.lienzo_deshabilitado:""}`,width:de,height:nt,style:{height:`${nt}px`,pointerEvents:wt?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Ze&&a.jsxs("div",{className:se.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:se.grupo_izquierda,children:[a.jsxs("button",{className:se.boton_accion,onClick:F,type:"button",disabled:!G||pt,"aria-label":y,children:[a.jsx(yf,{className:se.icono,"aria-hidden":"true"}),a.jsx("span",{children:y})]}),a.jsx("span",{className:se.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:se.boton_accion,onClick:be,type:"button",disabled:j&&!he||pt,"aria-label":T,children:[a.jsx(Ti,{className:se.icono,"aria-hidden":"true"}),a.jsx("span",{children:T})]})]}),c&&a.jsx("div",{className:se.grupo_derecha,children:a.jsxs("button",{className:se.boton_adjuntar,onClick:Ae,type:"button",disabled:ve,children:[a.jsx(Cf,{className:se.icono,"aria-hidden":"true"}),h]})})]})]})}),Ze&&a.jsxs(a.Fragment,{children:[a.jsx("div",{id:re,className:se.contenedor_consentimiento,children:a.jsxs("div",{className:se.consentimiento_fila,children:[a.jsx(Ar,{id:ge,isSelected:U,onChange:q,color:"primary",size:"md",isDisabled:ve,"aria-describedby":ke,className:se.toggle_consentimiento}),a.jsx("label",{htmlFor:ge,id:ke,className:se.texto_consentimiento,children:m})]})}),a.jsx("div",{className:se.contenedor_guardar,children:a.jsx(st,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:R&&!u?Ce:ze,type:"button",isLoading:Ue,isDisabled:mt||Ue,startContent:Ue?void 0:a.jsx($f,{className:se.icono,"aria-hidden":"true"}),children:Ue?"Guardando...":R&&!u?M:A})})]}),Ze&&c&&a.jsx("div",{className:se.contenedor_subir_oculto,children:a.jsx("input",{ref:ue,type:"file",accept:"image/*",className:se.input_archivo,onChange:Re,"aria-label":"Subir imagen de firma"})})]})]})})]})});Li.displayName="Signature";const Af="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let _o=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Af[n[e]&63];return t};const Df=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Tf=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Ff=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),a.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),a.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),a.jsx("path",{d:"m2 2 20 20"})]}),je={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Oi=v.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:s,variant:i="bordered",color:l="default",size:c="md",radius:d="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:p,startContent:h,endContent:m,isRequired:y=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:k=!1,isInvalid:A,validationState:T,validate:M,className:P,classNames:L,style:E,onChange:B,onClear:V,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:O,id:D,name:x,autoComplete:I,autoFocus:F,maxLength:j,minLength:z,pattern:H,...X}=e,G=v.useRef(null),oe=v.useRef(D??`input-text-${_o(8)}`).current;v.useImperativeHandle(t,()=>G.current);const ie=o!==void 0,[_e,ge]=v.useState(r??""),ke=ie?o:_e,[J,re]=v.useState(!1),[Y,ye]=v.useState(!1),ce=v.useMemo(()=>{if(!M)return null;const Ce=M(ke);return Ce===!0||Ce==null?null:typeof Ce=="string"?Ce:typeof Ce=="object"&&"message"in Ce?Ce.message??"Entrada inválida":"Entrada inválida"},[ke,M]),ee=v.useMemo(()=>A!==void 0?A:T==="invalid"?!0:T==="valid"?!1:!!ce,[A,T,ce]),ne=T==="valid"&&!ee,xe={invalido:ee,mensaje:ce},de=ke.length>0,Se=n==="password",U=Se&&Y?"text":n,q=k&&de&&!w&&!C,R=v.useCallback(Ce=>{if(C||w)return;const Re=Ce.target.value;ie||ge(Re),B?.(Re),$?.(Re)},[ie,C,w,B,$]),fe=v.useCallback(Ce=>{re(!0),b?.(Ce)},[b]),he=v.useCallback(Ce=>{re(!1),S?.(Ce)},[S]),pe=v.useCallback(()=>{C||w||(ie||ge(""),B?.(""),$?.(""),V?.(),G.current?.focus())},[ie,C,w,B,$,V]),Ue=v.useCallback(Ce=>{Ce.key==="Escape"&&k&&de&&pe(),O?.(Ce)},[k,de,pe,O]),Je=v.useCallback(()=>{ye(Ce=>!Ce),requestAnimationFrame(()=>G.current?.focus())},[]),nt=u?`${oe}-desc`:void 0,ve=ee?`${oe}-err`:void 0,Ze=[nt,ve].filter(Boolean).join(" ")||void 0,ot=typeof p=="function"?p(xe):p??ce,be=W(je.contenedor_base,je[`variante_${i}`],je[`tam_${c}`],je[`radio_${d}`],je[`color_${l}`],{[je.ancho_total]:_,[je.sin_animacion]:g,[je.deshabilitado]:C,[je.solo_lectura]:w,[je.invalido]:ee,[je.valido]:ne,[je.enfocado]:J,[je.tiene_contenido]:de},P,L?.base);return a.jsxs("div",{className:be,style:E,children:[f&&a.jsxs("label",{className:W(je.etiqueta,L?.label),htmlFor:oe,children:[f,y&&a.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(je.envoltorio_input,L?.inputWrapper),children:[h&&a.jsx("span",{className:je.contenido_inicio,children:h}),a.jsx("div",{className:W(je.envoltorio_interno,L?.innerWrapper),children:a.jsx("input",{...X,ref:G,id:oe,name:x,type:U,value:ie?ke:void 0,defaultValue:ie?void 0:r,placeholder:s,disabled:C,readOnly:w,required:y,autoComplete:I,autoFocus:F,maxLength:j,minLength:z,pattern:H,"aria-invalid":ee||void 0,"aria-describedby":Ze,"aria-required":y,className:W(je.entrada,L?.input),onChange:R,onFocus:fe,onBlur:he,onKeyDown:Ue})}),q&&a.jsx("button",{type:"button",className:W(je.boton_limpiar,L?.clearButton),onClick:pe,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Df,{size:"0.75em"})}),Se&&a.jsx("button",{type:"button",className:je.boton_password,onClick:Je,tabIndex:-1,"aria-label":Y?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":Y,children:Y?a.jsx(Ff,{}):a.jsx(Tf,{})}),m&&a.jsx("span",{className:je.contenido_final,children:m})]}),u&&!ee&&a.jsx("div",{id:nt,className:W(je.descripcion,L?.description),children:u}),ee&&ot&&a.jsx("div",{id:ve,className:W(je.mensaje_error,L?.errorMessage),role:"alert",children:ot})]})});Oi.displayName="InputText";function go(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bn(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:s=!1,prefijo:i="",sufijo:l=""}=t;let c;r!==void 0?c=s?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):c=String(e);const[d,_]=c.split(".");let g=d;if(n){const u=typeof n=="string"?n:",";g=d.replace(/\B(?=(\d{3})+(?!\d))/g,u)}let f=g;return _!==void 0?f+=o+_:s&&r&&r>0&&(f+=o+"0".repeat(r)),`${i}${f}${l}`}function zi(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:s="",permitirNegativo:i=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${go(r)}`),"")),s&&(l=l.replace(new RegExp(`${go(s)}$`),"")),n){const d=typeof n=="string"?n:",";l=l.replace(new RegExp(go(d),"g"),"")}o!=="."&&(l=l.replace(new RegExp(go(o)),".")),i||(l=l.replace(/-/g,""));const c=parseFloat(l);return Number.isNaN(c)?void 0:c}function ho(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function Bi(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 Vi(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Pf=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"M12 5v14"})]}),Lf=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:a.jsx("path",{d:"M5 12h14"})}),qe={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},ji=v.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:s="bordered",color:i="default",size:l="md",radius:c="md",fullWidth:d=!0,disableAnimation:_=!1,label:g,description:f,errorMessage:u,startContent:p,endContent:h,isRequired:m=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:A,className:T,classNames:M,style:P,min:L,max:E,step:B=1,decimalScale:V,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:O="",suffix:D="",allowNegative:x=!0,allowDecimal:I=!0,hideControls:F=!1,clampBehavior:j="blur",onChange:z,onValueChange:H,onFocus:X,onBlur:G,onKeyDown:ue,id:oe,name:ie,..._e}=e,ge=v.useRef(null),J=v.useRef(oe??`input-numeric-${_o(8)}`).current;v.useImperativeHandle(t,()=>ge.current);const re=n!==void 0,[Y,ye]=v.useState(o!==void 0?o:void 0),[ce,ee]=v.useState(""),[ne,xe]=v.useState(!1),de=re?n===""?void 0:n:Y,Se=v.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:I?V:0,decimalesFijos:$,prefijo:O,sufijo:D,permitirNegativo:x}),[b,S,V,$,O,D,x,I]),U=v.useMemo(()=>{if(!A)return null;const te=Bi(A(de));return te.invalido?te.mensaje:null},[de,A]),q=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!U,[C,k,U]),R=k==="valid"&&!q,fe={invalido:q,mensaje:U},he=v.useCallback(te=>{re||ye(te),z?.(te),H?.(Bn(te,Se),te)},[re,z,H,Se]),pe=v.useCallback(te=>{let ze=(de??0)+B*te;j!=="none"&&(ze=ho(ze,L,E)),V!==void 0&&(ze=Vi(ze,V)),he(ze),ee(Bn(ze,Se))},[de,B,L,E,j,V,he,Se]),Ue=v.useCallback(te=>{if(w||y)return;const Ee=te.target.value,ze=S===","?",":".";let Oe="0-9";I&&(Oe+=ze),x&&(Oe+="-");const pt=new RegExp(`[^${Oe}]`,"g");let mt=Ee.replace(pt,"");if(I){const me=mt.split(ze);me.length>2&&(mt=me[0]+ze+me.slice(1).join(""))}if(x&&mt.includes("-")){const me=mt.replace(/-/g,"");mt=mt.startsWith("-")?"-"+me:me}ee(mt);const Pt=zi(mt,Se);if(j==="strict"&&Pt!==void 0){const me=ho(Pt,L,E);he(me)}else he(Pt)},[w,y,Se,j,L,E,he,S,x,I]),Je=v.useCallback(te=>{if(xe(!0),de!==void 0){let Ee=String(de);S!=="."&&(Ee=Ee.replace(".",S)),ee(Ee)}X?.(te)},[de,S,X]),nt=v.useCallback(te=>{if(xe(!1),j==="blur"&&de!==void 0){const Ee=ho(de,L,E);Ee!==de&&he(Ee)}ee(Bn(de,Se)),G?.(te)},[de,j,L,E,he,Se,G]),ve=v.useCallback(te=>{te.key==="ArrowUp"?(te.preventDefault(),pe(1)):te.key==="ArrowDown"&&(te.preventDefault(),pe(-1));const Ee=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],ze=te.ctrlKey||te.metaKey,Oe=I&&(te.key===S||te.key==="."||te.key===","),pt=te.key==="-"&&x,wt=/^[0-9]$/.test(te.key);!Ee.includes(te.key)&&!ze&&!Oe&&!pt&&!wt&&te.preventDefault(),ue?.(te)},[pe,ue,S,x,I]);v.useEffect(()=>{ne||ee(Bn(de,Se))},[de,ne,Se]);const Ze=f?`${J}-desc`:void 0,ot=q?`${J}-err`:void 0,be=[Ze,ot].filter(Boolean).join(" ")||void 0,Ce=typeof u=="function"?u(fe):u??U,Re=E===void 0||(de??0)<E,Ae=L===void 0||(de??0)>L,rt=W(qe.contenedor_base,qe[`variante_${s}`],qe[`tam_${l}`],qe[`radio_${c}`],qe[`color_${i}`],{[qe.ancho_total]:d,[qe.sin_animacion]:_,[qe.deshabilitado]:w,[qe.solo_lectura]:y,[qe.invalido]:q,[qe.valido]:R,[qe.enfocado]:ne},T,M?.base);return a.jsxs("div",{className:rt,style:P,children:[g&&a.jsxs("label",{className:W(qe.etiqueta,M?.label),htmlFor:J,children:[g,m&&a.jsx("span",{className:qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(qe.envoltorio_input,M?.inputWrapper),children:[a.jsxs("div",{className:W(qe.envoltorio_interno,M?.innerWrapper),children:[p&&a.jsx("span",{className:qe.contenido_inicio,children:p}),a.jsx("input",{..._e,ref:ge,id:J,name:ie,type:"text",inputMode:"decimal",value:ce,placeholder:r,disabled:w,readOnly:y,required:m,"aria-invalid":q||void 0,"aria-describedby":be,"aria-required":m,className:W(qe.entrada,M?.input),onChange:Ue,onFocus:Je,onBlur:nt,onKeyDown:ve}),h&&a.jsx("span",{className:qe.contenido_final,children:h})]}),!F&&!y&&!w&&a.jsxs("div",{className:W(qe.controles,M?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:W(qe.boton_control,M?.controlButton),disabled:!Ae,onClick:()=>pe(-1),"aria-label":"Decrementar valor",children:a.jsx(Lf,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:W(qe.boton_control,M?.controlButton),disabled:!Re,onClick:()=>pe(1),"aria-label":"Incrementar valor",children:a.jsx(Pf,{})})]})]}),f&&!q&&a.jsx("div",{id:Ze,className:W(qe.descripcion,M?.description),children:f}),q&&Ce&&a.jsx("div",{id:ot,className:W(qe.mensaje_error,M?.errorMessage),role:"alert",children:Ce})]})});ji.displayName="InputNumeric";function Of(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 Dr(e,t="es-CO"){if(!e)return"";const n=new Date(e+"T00:00:00");return Number.isNaN(n.getTime())?"":n.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function zf(){return new Date().toISOString().split("T")[0]}function Bf(e,t,n){if(!e)return!0;const o=new Date(e).getTime();return!(t&&o<new Date(t).getTime()||n&&o>new Date(n).getTime())}const Ke={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},Vf=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}),jf=()=>a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 2v4"}),a.jsx("path",{d:"M16 2v4"}),a.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),a.jsx("path",{d:"M3 10h18"}),a.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),qf=()=>a.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Hf=({tipo:e,onClick:t,onMouseDown:n})=>a.jsx("button",{type:"button",tabIndex:-1,className:Ke.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?a.jsx(Vf,{}):a.jsx(jf,{})}),qi=v.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:s,variant:i="bordered",color:l="default",size:c="md",radius:d="md",fullWidth:_=!0,disableAnimation:g=!1,label:f,description:u,errorMessage:p,startContent:h,isRequired:m=!1,isReadOnly:y=!1,isDisabled:w=!1,isInvalid:C,validationState:k,validate:A,className:T,classNames:M,style:P,min:L,max:E,isClearable:B=!1,onChange:V,onFocus:$,onBlur:b,id:S,name:O,...D}=e,x=v.useRef(null),F=v.useRef(S??`input-date-${_o(8)}`).current;v.useImperativeHandle(t,()=>x.current);const j=o!==void 0,[z,H]=v.useState(r??""),X=j?o:z,[G,ue]=v.useState(!1),oe=v.useRef(!1),ie=v.useMemo(()=>{if(X&&n!=="time"&&(L||E)){if(L&&X<L)return`La fecha debe ser ${n==="date"?Dr(L):L} o posterior`;if(E&&X>E)return`La fecha debe ser ${n==="date"?Dr(E):E} o anterior`}if(!A)return null;const q=Of(A(X));return q.invalido?q.mensaje:null},[X,A,L,E,n]),_e=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ie,[C,k,ie]),ge=k==="valid"&&!_e,ke={invalido:_e,mensaje:ie},J=v.useCallback(q=>{if(w||y)return;oe.current=!1;const R=q.target.value;j||H(R),V?.(R)},[j,w,y,V]),re=v.useCallback(q=>{ue(!0),$?.(q)},[$]),Y=v.useCallback(q=>{ue(!1),oe.current=!1,b?.(q)},[b]),ye=v.useCallback(q=>{q.preventDefault()},[]),ce=v.useCallback(q=>{if(q.preventDefault(),q.stopPropagation(),!(!x.current||w||y)){if(oe.current){oe.current=!1,x.current.blur();return}x.current.focus();try{x.current.showPicker?.(),oe.current=!0}catch{}}},[w,y]),ee=v.useCallback(q=>{q.preventDefault(),q.stopPropagation(),oe.current=!1,j||H(""),V?.(""),x.current?.focus()},[j,V]),ne=u?`${F}-desc`:void 0,xe=_e?`${F}-err`:void 0,de=[ne,xe].filter(Boolean).join(" ")||void 0,Se=typeof p=="function"?p(ke):p??ie,U=W(Ke.contenedor_base,Ke[`variante_${i}`],Ke[`tam_${c}`],Ke[`radio_${d}`],Ke[`color_${l}`],{[Ke.ancho_total]:_,[Ke.sin_animacion]:g,[Ke.deshabilitado]:w,[Ke.solo_lectura]:y,[Ke.invalido]:_e,[Ke.valido]:ge,[Ke.enfocado]:G},T,M?.base);return a.jsxs("div",{className:U,style:P,children:[f&&a.jsxs("label",{className:W(Ke.etiqueta,M?.label),htmlFor:F,children:[f,m&&a.jsx("span",{className:Ke.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:W(Ke.envoltorio_input,M?.inputWrapper),children:a.jsxs("div",{className:W(Ke.envoltorio_interno,M?.innerWrapper),children:[h&&a.jsx("span",{className:Ke.contenido_inicio,children:h}),a.jsx("input",{...D,ref:x,id:F,name:O,type:n,value:j?X:void 0,defaultValue:j?void 0:r,placeholder:s,disabled:w,readOnly:y,required:m,min:L,max:E,"aria-invalid":_e||void 0,"aria-describedby":de,"aria-required":m,className:W(Ke.entrada,M?.input),onChange:J,onFocus:re,onBlur:Y}),B&&X&&!w&&!y&&a.jsx("button",{type:"button",tabIndex:-1,className:W(Ke.boton_limpiar,M?.clearButton),onMouseDown:q=>q.preventDefault(),onClick:ee,"aria-label":"Limpiar fecha",children:a.jsx(qf,{})}),a.jsx(Hf,{tipo:n,onClick:ce,onMouseDown:ye})]})}),u&&!_e&&a.jsx("div",{id:ne,className:W(Ke.descripcion,M?.description),children:u}),_e&&Se&&a.jsx("div",{id:xe,className:W(Ke.mensaje_error,M?.errorMessage),role:"alert",children:Se})]})});qi.displayName="InputDate";const Rf={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function po({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[s,i]=v.useState(e),[l,c]=v.useState(e?"entrada":null);e&&!s?(i(!0),c("entrada")):!e&&s&&l!=="salida"&&c("salida");const d=()=>{l==="entrada"?c(null):l==="salida"&&(i(!1),c(null))};if(!s)return null;const _=Rf[n||"desvanecer"],g=l?`transicion_${_}_${l}`:"";return a.jsx("div",{...r,onAnimationEnd:d,className:`${g} ${o||""}`.trim(),children:t})}const Ot={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 Tr(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),a.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Fr(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:a.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function Hi(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),a.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function Pr({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return a.jsxs("span",{className:W(Ot.badge_voz,r?Ot.badge_mic:Ot.badge_tts,Ot[`badge_${n}`],o&&Ot.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:Ot.badge_icono,children:r?a.jsx(Tr,{}):a.jsx(Fr,{})}),a.jsx("span",{className:Ot.badge_texto,children:t}),r?a.jsxs("span",{className:Ot.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:Ot.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function Ri({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:s="es-ES"}){const[i,l]=v.useState(!1),[c,d]=v.useState(!1),[_,g]=v.useState(null),f=v.useRef(null),u=v.useRef(null),p=v.useRef(null),h=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,y=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,l(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),f.current){try{f.current.stop()}catch(M){console.error("Error stopping recognition:",M)}f.current=null,d(!1)}const T=new SpeechSynthesisUtterance(e);T.lang=s,T.onstart=()=>l(!0),T.onend=()=>{l(!1),u.current=null},T.onerror=()=>{l(!1),u.current=null},u.current=T,window.speechSynthesis.speak(T)},[m,e,s,w]),k=v.useCallback(()=>{if(f.current)try{f.current.stop()}catch(T){console.error("Error stopping recognition:",T)}d(!1),g(null)},[]),A=v.useCallback(()=>{if(!y||n||o)return;w();const T=window,M=T.SpeechRecognition||T.webkitSpeechRecognition;if(!M){g("Navegador no compatible");return}try{const P=new M;P.continuous=!0,P.interimResults=!0,P.lang=s,P.onstart=()=>{d(!0),g(null),h.current=e||""},P.onend=()=>{d(!1),f.current=null,r?.()},P.onerror=L=>{L.error!=="no-speech"&&(d(!1),f.current=null,L.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=L=>{try{let E="";for(let $=0;$<L.results.length;$++)E+=L.results[$][0].transcript;const B=h.current&&E?" ":"",V=h.current+B+E;t(V)}catch{g("Error procesando dictado")}},f.current=P,P.start()}catch{g("No se pudo iniciar dictado"),d(!1)}},[y,n,o,e,t,s,w,r]);return v.useEffect(()=>()=>{p.current&&clearTimeout(p.current),m&&window.speechSynthesis.cancel(),f.current&&f.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:y,hablando:i,escuchando:c,errorDictado:_,escuchar:C,detenerHablar:w,dictar:A,detenerDictado:k}}function Uf({size:e="1em",className:t}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Fe={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},Ui=v.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:s="md",radius:i="md",fullWidth:l=!0,disableAnimation:c=!1,label:d,description:_,errorMessage:g,value:f,defaultValue:u,placeholder:p,isRequired:h=!1,isReadOnly:m=!1,isDisabled:y=!1,isClearable:w=!1,isInvalid:C,validationState:k,validate:A,minRows:T=4,maxRows:M=10,disableAutosize:P=!1,hideVoiceActions:L=!1,className:E,classNames:B,style:V,onChange:$,onClear:b,onFocus:S,onBlur:O,id:D,name:x,rows:I,...F}=e,j=v.useRef(null),H=v.useRef(D??`textarea-${_o(8)}`).current;v.useImperativeHandle(t,()=>j.current);const X=f!==void 0,[G,ue]=v.useState(u??""),oe=X?f:G,[ie,_e]=v.useState(!1),ge=v.useMemo(()=>{if(!A)return null;const te=A(oe);return te===!0||te==null?null:typeof te=="string"?te:typeof te=="object"&&"message"in te?te.message??"Entrada inválida":"Entrada inválida"},[oe,A]),ke=v.useMemo(()=>C!==void 0?C:k==="invalid"?!0:k==="valid"?!1:!!ge,[C,k,ge]),J=k==="valid"&&!ke,re={invalido:ke,mensaje:ge},Y=oe.length>0,ye=v.useCallback(()=>{if(!j.current||P)return;const te=j.current,Ee=window.getComputedStyle(te),ze=parseFloat(Ee.lineHeight)||parseFloat(Ee.fontSize)*1.5,Oe=parseFloat(Ee.paddingTop)||0,pt=parseFloat(Ee.paddingBottom)||0,wt=parseFloat(Ee.borderTopWidth)||0,mt=parseFloat(Ee.borderBottomWidth)||0,Pt=T*ze+Oe+pt+wt+mt,me=M*ze+Oe+pt+wt+mt;te.style.height="auto";const we=te.scrollHeight;te.style.height=`${Math.min(Math.max(we,Pt),me)}px`},[P,T,M]);v.useEffect(()=>{P||ye()},[oe,ye,P]);const ce=v.useCallback(te=>{X||ue(te),$?.(te)},[X,$]),{puedeHablar:ee,hablando:ne,escuchar:xe,detenerHablar:de,puedeEscuchar:Se,escuchando:U,errorDictado:q,dictar:R,detenerDictado:fe}=Ri({isDisabled:y||L,isReadOnly:m,value:oe,onChange:ce}),he=v.useCallback(te=>{if(y||m)return;const Ee=te.target.value;X||ue(Ee),$?.(Ee)},[X,y,m,$]),pe=v.useCallback(te=>{_e(!0),S?.(te)},[S]),Ue=v.useCallback(te=>{_e(!1),O?.(te)},[O]),Je=v.useCallback(()=>{y||m||(X||ue(""),$?.(""),b?.(),j.current?.focus())},[X,y,m,$,b]),nt=v.useCallback(()=>{ne?de():xe()},[ne,xe,de]),ve=v.useCallback(()=>{U?fe():R()},[U,R,fe]),Ze=_?`${H}-desc`:void 0,ot=ke||q?`${H}-err`:void 0,be=[Ze,ot].filter(Boolean).join(" ")||void 0,Ce=typeof g=="function"?g(re):g??ge,Re=w&&Y&&!m&&!y,Ae=!L||Re,rt=W(Fe.contenedor_base,Fe[`variante_${o}`],Fe[`tam_${s}`],Fe[`radio_${i}`],Fe[`color_${r}`],{[Fe.ancho_total]:l,[Fe.sin_animacion]:c,[Fe.deshabilitado]:y,[Fe.solo_lectura]:m,[Fe.invalido]:ke,[Fe.valido]:J,[Fe.enfocado]:ie},E,B?.base);return a.jsxs("div",{className:rt,style:V,children:[d&&a.jsxs("label",{className:W(Fe.etiqueta,B?.label),htmlFor:H,children:[d,h&&a.jsx("span",{className:Fe.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:W(Fe.envoltorio_input,B?.inputWrapper),children:[a.jsx("textarea",{...F,ref:j,id:H,name:x,placeholder:p,value:X?oe:void 0,defaultValue:X?void 0:u,onChange:he,onFocus:pe,onBlur:Ue,className:W(Fe.entrada,P&&Fe.sin_autosize,B?.input),readOnly:m,disabled:y,rows:I??T,"aria-invalid":ke||void 0,"aria-describedby":be,"aria-required":h,required:h}),Ae&&a.jsxs("div",{className:W(Fe.barra_acciones,B?.actions),children:[a.jsxs("div",{className:Fe.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(po,{mostrar:U,children:a.jsx(Pr,{tipo:"mic",texto:"Escuchando...",size:s==="lg"?"md":"sm"})}),a.jsx(po,{mostrar:ne,children:a.jsx(Pr,{tipo:"tts",texto:"Leyendo...",size:s==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Fe.botones_grupo,children:[!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:W(Fe.boton_accion,ne&&Fe.boton_activo_tts),onClick:nt,disabled:!ee||!ne&&(!oe||U),title:ne?"Detener lectura":"Leer texto","aria-pressed":ne,"aria-label":ne?"Detener lectura":"Leer texto",children:a.jsx(Fr,{})}),Se&&a.jsx("button",{type:"button",className:W(Fe.boton_accion,U&&Fe.boton_activo_mic),onClick:ve,disabled:y||m||ne,title:U?"Detener dictado":"Dictar texto","aria-pressed":U,"aria-label":U?"Detener dictado":"Dictar texto",children:U?a.jsx(Hi,{}):a.jsx(Tr,{})})]}),Re&&a.jsx("button",{type:"button",className:Fe.boton_limpiar,onClick:Je,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(Uf,{size:"0.75em"})})]})]})]}),_&&!ke&&a.jsx("div",{id:Ze,className:W(Fe.descripcion,B?.description),children:_}),ke&&Ce||q?a.jsxs("div",{id:ot,className:W(Fe.mensaje_error,B?.errorMessage),role:"alert",children:[Ce,Ce&&q&&a.jsx("br",{}),q&&a.jsxs("span",{children:["Error de voz: ",q]})]}):null,n]})});Ui.displayName="TextArea";function mo(){return typeof window<"u"}function Xt(e){return Lr(e)?(e.nodeName||"").toLowerCase():"#document"}function bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(Lr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lr(e){return mo()?e instanceof Node||e instanceof bt(e).Node:!1}function Pe(e){return mo()?e instanceof Element||e instanceof bt(e).Element:!1}function Xe(e){return mo()?e instanceof HTMLElement||e instanceof bt(e).HTMLElement:!1}function vo(e){return!mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bt(e).ShadowRoot}const Wf=new Set(["inline","contents"]);function Vn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Wf.has(r)}const Gf=new Set(["table","td","th"]);function Kf(e){return Gf.has(Xt(e))}const Xf=[":popover-open",":modal"];function bo(e){return Xf.some(t=>{try{return e.matches(t)}catch{return!1}})}const Yf=["transform","translate","scale","rotate","perspective"],Zf=["transform","translate","scale","rotate","perspective","filter"],Jf=["paint","layout","strict","content"];function Or(e){const t=wo(),n=Pe(e)?xt(e):e;return Yf.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Zf.some(o=>(n.willChange||"").includes(o))||Jf.some(o=>(n.contain||"").includes(o))}function Qf(e){let t=Bt(e);for(;Xe(t)&&!zt(t);){if(Or(t))return t;if(bo(t))return null;t=Bt(t)}return null}function wo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const e_=new Set(["html","body","#document"]);function zt(e){return e_.has(Xt(e))}function xt(e){return bt(e).getComputedStyle(e)}function yo(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vo(e)&&e.host||At(e);return vo(t)?t.host:t}function Wi(e){const t=Bt(e);return zt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&Vn(t)?t:Wi(t)}function Yt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Wi(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=bt(r);if(s){const l=zr(i);return t.concat(i,i.visualViewport||[],Vn(r)?r:[],l&&n?Yt(l):[])}return t.concat(r,Yt(r,[],n))}function zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Zt=Math.min,St=Math.max,Co=Math.round,bn=Math.floor,Dt=e=>({x:e,y:e}),t_={left:"right",right:"left",bottom:"top",top:"bottom"},n_={start:"end",end:"start"};function Br(e,t,n){return St(e,Zt(t,n))}function wn(e,t){return typeof e=="function"?e(t):e}function Jt(e){return e.split("-")[0]}function yn(e){return e.split("-")[1]}function Gi(e){return e==="x"?"y":"x"}function Vr(e){return e==="y"?"height":"width"}const o_=new Set(["top","bottom"]);function Vt(e){return o_.has(Jt(e))?"y":"x"}function jr(e){return Gi(Vt(e))}function r_(e,t,n){n===void 0&&(n=!1);const o=yn(e),r=jr(e),s=Vr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=xo(i)),[i,xo(i)]}function s_(e){const t=xo(e);return[qr(e),t,qr(t)]}function qr(e){return e.replace(/start|end/g,t=>n_[t])}const Ki=["left","right"],Xi=["right","left"],i_=["top","bottom"],a_=["bottom","top"];function l_(e,t,n){switch(e){case"top":case"bottom":return n?t?Xi:Ki:t?Ki:Xi;case"left":case"right":return t?i_:a_;default:return[]}}function c_(e,t,n,o){const r=yn(e);let s=l_(Jt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(qr)))),s}function xo(e){return e.replace(/left|right|bottom|top/g,t=>t_[t])}function d_(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e!="number"?d_(e):{top:e,right:e,bottom:e,left:e}}function So(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
|
|
2
655
|
* tabbable 6.3.0
|
|
3
656
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var Nl=["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])"],Yn=Nl.join(","),fi=typeof Element>"u",sn=fi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rn=!fi&&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},vn=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",a=i||t&&n&&vn(n.parentNode);return a},Fl=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},_i=function(n,t,o){if(vn(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(Yn));return t&&sn.call(n,Yn)&&r.unshift(n),r=r.filter(o),r},Xn=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!vn(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=Xn(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var _=sn.call(a,Yn);_&&o.filter(a)&&(t||!n.includes(a))&&r.push(a);var g=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!vn(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(g&&f){var c=Xn(g===!0?a.children:g.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else i.unshift.apply(i,a.children)}}return r},gi=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},pi=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||Fl(n))&&!gi(n)?0:n.tabIndex},Al=function(n,t){var o=pi(n);return o<0&&t&&!gi(n)?0:o},Dl=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},hi=function(n){return n.tagName==="INPUT"},zl=function(n){return hi(n)&&n.type==="hidden"},Ll=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},Pl=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},Tl=function(n){if(!n.name)return!0;var t=n.form||Rn(n),o=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},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(a){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",a.message),!1}var i=Pl(r,n.form);return!i||i===n},Ol=function(n){return hi(n)&&n.type==="radio"},Vl=function(n){return Ol(n)&&!Tl(n)},jl=function(n){var t,o=n&&Rn(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var a,l,d;for(i=!!((a=r)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var u,_,g;o=Rn(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((_=r)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return i},mi=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},ql=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 a=sn.call(n,"details>summary:first-of-type"),l=a?n.parentElement:n;if(sn.call(l,"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,_=Rn(n);if(u&&!u.shadowRoot&&r(u)===!0)return mi(n);n.assignedSlot?n=n.assignedSlot:!u&&_!==n.ownerDocument?n=_.host:n=u}n=d}if(jl(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return mi(n);return!1},Bl=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 sn.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},Ko=function(n,t){return!(t.disabled||vn(t)||zl(t)||ql(t,n)||Ll(t)||Bl(t))},Uo=function(n,t){return!(Vl(t)||pi(t)<0||!Ko(n,t))},Hl=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},vi=function(n){var t=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Al(l,a),u=a?vi(r.candidates):l;d===0?a?t.push.apply(t,u):t.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:a,content:u})}),o.sort(Dl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},Zn=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Xn([n],t.includeContainer,{filter:Uo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Hl}):o=_i(n,t.includeContainer,Uo.bind(null,t)),vi(o)},Gl=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Xn([n],t.includeContainer,{filter:Ko.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=_i(n,t.includeContainer,Ko.bind(null,t)),o},bi=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return sn.call(n,Yn)===!1?!1:Uo(t,n)};function wi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yi(){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 Ci(){return/apple/i.test(navigator.vendor)}function Yo(){const e=/android/i;return e.test(wi())||e.test(yi())}function Wl(){return wi().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function xi(){return yi().includes("jsdom/")}const Si="data-floating-ui-focusable",Kl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ro="ArrowLeft",Xo="ArrowRight",Ul="ArrowUp",Yl="ArrowDown";function kt(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 ot(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&qn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function At(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zo(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 Rl(e){return e.matches("html,body")}function rt(e){return e?.ownerDocument||document}function Jo(e){return We(e)&&e.matches(Kl)}function Qo(e){return e?e.getAttribute("role")==="combobox"&&Jo(e):!1}function Xl(e){if(!e||xi())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Jn(e){return e?e.hasAttribute(Si)?e:e.querySelector("["+Si+"]")||e:null}function Ut(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,...Ut(e,r.id,t)])}function Zl(e,n){let t,o=-1;function r(i,a){a>o&&(t=i,o=a),Ut(e,i).forEach(d=>{r(d.id,a+1)})}return r(n,0),e.find(i=>i.id===t)}function $i(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(a=>a.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function it(e){e.preventDefault(),e.stopPropagation()}function Jl(e){return"nativeEvent"in e}function ki(e){return e.mozInputSource===0&&e.isTrusted?!0:Yo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ii(e){return xi()?!1:!Yo()&&e.width===0&&e.height===0||Yo()&&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 bn(e,n){const t=["mouse","pen"];return n||t.push("",void 0),t.includes(e)}var Ql=typeof document<"u",ec=function(){},Le=Ql?m.useLayoutEffect:ec;const tc={...M};function Qe(e){const n=M.useRef(e);return Le(()=>{n.current=e}),n}const nc=tc.useInsertionEffect||(e=>e());function Ke(e){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return nc(()=>{n.current=e}),M.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 Qn(e,n,t){return Math.floor(e/n)!==t}function wn(e,n){return n<0||n>=e.current.length}function er(e,n){return lt(e,{disabledIndices:n})}function Ei(e,n){return lt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function lt(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,a=t;do a+=o?-i:i;while(a>=0&&a<=e.current.length-1&&eo(e,a,r));return a}function oc(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:_,stopEvent:g=!1}=n,f=_;if(t.key===Ul){if(g&&it(t),_===-1)f=u;else if(f=lt(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:l}),r&&(_-a<d||f<0)){const c=_%a,h=u%a,p=u-(h-c);h===c?f=u:f=h>c?p:p-a}wn(e,f)&&(f=_)}if(t.key===Yl&&(g&&it(t),_===-1?f=d:(f=lt(e,{startingIndex:_,amount:a,disabledIndices:l}),r&&_+a>u&&(f=lt(e,{startingIndex:_%a-a,amount:a,disabledIndices:l}))),wn(e,f)&&(f=_)),o==="both"){const c=nn(_/a);t.key===(i?Ro:Xo)&&(g&&it(t),_%a!==a-1?(f=lt(e,{startingIndex:_,disabledIndices:l}),r&&Qn(f,a,c)&&(f=lt(e,{startingIndex:_-_%a-1,disabledIndices:l}))):r&&(f=lt(e,{startingIndex:_-_%a-1,disabledIndices:l})),Qn(f,a,c)&&(f=_)),t.key===(i?Xo:Ro)&&(g&&it(t),_%a!==0?(f=lt(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&Qn(f,a,c)&&(f=lt(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l}))):r&&(f=lt(e,{startingIndex:_+(a-_%a),decrement:!0,disabledIndices:l})),Qn(f,a,c)&&(f=_));const h=nn(u/a)===c;wn(e,f)&&(r&&h?f=t.key===(i?Xo:Ro)?u:lt(e,{startingIndex:_-_%a-1,disabledIndices:l}):f=_)}return f}function rc(e,n,t){const o=[];let r=0;return e.forEach((i,a)=>{let{width:l,height:d}=i;if(l>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+a+" is greater than grid columns");let u=!1;for(t&&(r=0);!u;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<d;f++)_.push(r+g+f*n);r%n+l<=n&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=a}),u=!0):r++}}),[...o]}function ic(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),a=n[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function sc(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function eo(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 yn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Mi(e,n){const t=Zn(e,yn()),o=t.length;if(o===0)return;const r=kt(rt(e)),i=t.indexOf(r),a=i===-1?n===1?0:o-1:i+n;return t[a]}function Ni(e){return Mi(rt(e).body,1)||e}function Fi(e){return Mi(rt(e).body,-1)||e}function Cn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!ot(t,o)}function ac(e){Zn(e,yn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Ai(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 Di(e,n,t){let{reference:o,floating:r}=e;const i=Ft(n),a=Go(n),l=Ho(a),d=jt(n),u=i==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:_,y:o.y-r.height};break;case"bottom":c={x:_,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:g};break;case"left":c={x:o.x-r.width,y:g};break;default:c={x:o.x,y:o.y}}switch(rn(n)){case"start":c[a]-=f*(t&&u?-1:1);break;case"end":c[a]+=f*(t&&u?-1:1);break}return c}const lc=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=t,l=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(n));let u=await a.getElementRects({reference:e,floating:n,strategy:r}),{x:_,y:g}=Di(u,o,d),f=o,c={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:w}=l[p],{x:y,y:x,data:E,reset:A}=await w({x:_,y:g,initialPlacement:o,placement:f,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:n}});_=y??_,g=x??g,c={...c,[v]:{...c[v],...E}},A&&h<=50&&(h++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(u=A.rects===!0?await a.getElementRects({reference:e,floating:n,strategy:r}):A.rects),{x:_,y:g}=Di(u,f,d)),p=-1)}return{x:_,y:g,placement:f,strategy:r,middlewareData:c}};async function tr(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:c=0}=on(n,e),h=ui(c),v=l[f?g==="floating"?"reference":"floating":g],w=Un(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(v)))==null||t?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:_,strategy:d})),y=g==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),E=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},A=Un(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:d}):y);return{top:(w.top-A.top+h.top)/E.y,bottom:(A.bottom-w.bottom+h.bottom)/E.y,left:(w.left-A.left+h.left)/E.x,right:(A.right-w.right+h.right)/E.x}}const cc=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:r,rects:i,platform:a,elements:l,middlewareData:d}=n,{element:u,padding:_=0}=on(e,n)||{};if(u==null)return{};const g=ui(_),f={x:t,y:o},c=Go(r),h=Ho(c),p=await a.getDimensions(u),v=c==="y",w=v?"top":"left",y=v?"bottom":"right",x=v?"clientHeight":"clientWidth",E=i.reference[h]+i.reference[c]-f[c]-i.floating[h],A=f[c]-i.reference[c],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let N=D?D[x]:0;(!N||!await(a.isElement==null?void 0:a.isElement(D)))&&(N=l.floating[x]||i.floating[h]);const T=E/2-A/2,L=N/2-p[h]/2-1,I=Vt(g[w],L),O=Vt(g[y],L),V=I,$=N-p[h]-O,b=N/2-p[h]/2+T,S=Bo(V,b,$),P=!d.arrow&&rn(r)!=null&&b!==S&&i.reference[h]/2-(b<V?I:O)-p[h]/2<0,F=P?b<V?b-V:b-$:0;return{[c]:f[c]+F,data:{[c]:S,centerOffset:b-S-F,...P&&{alignmentOffset:F}},reset:P}}}),dc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:d,elements:u}=n,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=on(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const w=jt(r),y=Ft(l),x=jt(l)===l,E=await(d.isRTL==null?void 0:d.isRTL(u.floating)),A=f||(x||!p?[Kn(l)]:Sl(l)),D=h!=="none";!f&&D&&A.push(...El(l,p,h,E));const N=[l,...A],T=await tr(n,v),L=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(_&&L.push(T[w]),g){const b=xl(r,a,E);L.push(T[b[0]],T[b[1]])}if(I=[...I,{placement:r,overflows:L}],!L.every(b=>b<=0)){var O,V;const b=(((O=i.flip)==null?void 0:O.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?y!==Ft(S):!1)||I.every(C=>Ft(C.placement)===y?C.overflows[0]>0:!0)))return{data:{index:b,overflows:I},reset:{placement:S}};let P=(V=I.filter(F=>F.overflows[0]<=0).sort((F,C)=>F.overflows[1]-C.overflows[1])[0])==null?void 0:V.placement;if(!P)switch(c){case"bestFit":{var $;const F=($=I.filter(C=>{if(D){const k=Ft(C.placement);return k===y||k==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(k=>k>0).reduce((k,z)=>k+z,0)]).sort((C,k)=>C[1]-k[1])[0])==null?void 0:$[0];F&&(P=F);break}case"initialPlacement":P=l;break}if(r!==P)return{reset:{placement:P}}}return{}}}},uc=new Set(["left","top"]);async function fc(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=jt(t),l=rn(t),d=Ft(t)==="y",u=uc.has(a)?-1:1,_=i&&d?-1:1,g=on(n,e);let{mainAxis:f,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*_,y:f*u}:{x:f*u,y:c*_}}const _c=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:a,middlewareData:l}=n,d=await fc(n,e);return a===((t=l.offset)==null?void 0:t.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:a}}}}},gc=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:a=!1,limiter:l={fn:v=>{let{x:w,y}=v;return{x:w,y}}},...d}=on(e,n),u={x:t,y:o},_=await tr(n,d),g=Ft(jt(r)),f=li(g);let c=u[f],h=u[g];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",y=c+_[v],x=c-_[w];c=Bo(y,c,x)}if(a){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",y=h+_[v],x=h-_[w];h=Bo(y,h,x)}const p=l.fn({...n,[f]:c,[g]:h});return{...p,data:{x:p.x-t,y:p.y-o,enabled:{[f]:i,[g]:a}}}}}},pc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:a,elements:l}=n,{apply:d=()=>{},...u}=on(e,n),_=await tr(n,u),g=jt(r),f=rn(r),c=Ft(r)==="y",{width:h,height:p}=i.floating;let v,w;g==="top"||g==="bottom"?(v=g,w=f===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,v=f==="end"?"top":"bottom");const y=p-_.top-_.bottom,x=h-_.left-_.right,E=Vt(p-_[v],y),A=Vt(h-_[w],x),D=!n.middlewareData.shift;let N=E,T=A;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(T=x),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(N=y),D&&!f){const I=ht(_.left,0),O=ht(_.right,0),V=ht(_.top,0),$=ht(_.bottom,0);c?T=h-2*(I!==0||O!==0?I+O:ht(_.left,_.right)):N=p-2*(V!==0||$!==0?V+$:ht(_.top,_.bottom))}await d({...n,availableWidth:T,availableHeight:N});const L=await a.getDimensions(l.floating);return h!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function zi(e){const n=pt(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=We(e),i=r?e.offsetWidth:t,a=r?e.offsetHeight:o,l=Wn(t)!==i||Wn(o)!==a;return l&&(t=i,o=a),{width:t,height:o,$:l}}function nr(e){return ze(e)?e:e.contextElement}function an(e){const n=nr(e);if(!We(n))return $t(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=zi(n);let a=(i?Wn(t.width):t.width)/o,l=(i?Wn(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const hc=$t(0);function Li(e){const n=gt(e);return!Hn()||!n.visualViewport?hc:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function mc(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==gt(e)?!1:n}function Yt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=nr(e);let a=$t(1);n&&(o?ze(o)&&(a=an(o)):a=an(e));const l=mc(i,t,o)?Li(i):$t(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,_=r.width/a.x,g=r.height/a.y;if(i){const f=gt(i),c=o&&ze(o)?gt(o):o;let h=f,p=qo(h);for(;p&&o&&c!==h;){const v=an(p),w=p.getBoundingClientRect(),y=pt(p),x=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*v.x,E=w.top+(p.clientTop+parseFloat(y.paddingTop))*v.y;d*=v.x,u*=v.y,_*=v.x,g*=v.y,d+=x,u+=E,h=gt(p),p=qo(h)}}return Un({width:_,height:g,x:d,y:u})}function to(e,n){const t=Gn(e).scrollLeft;return n?n.left+t:Yt(St(e)).left+t}function Pi(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-to(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function vc(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=St(o),l=n?Bn(n.floating):!1;if(o===a||l&&i)return t;let d={scrollLeft:0,scrollTop:0},u=$t(1);const _=$t(0),g=We(o);if((g||!g&&!i)&&((Tt(o)!=="body"||mn(a))&&(d=Gn(o)),We(o))){const c=Yt(o);u=an(o),_.x=c.x+o.clientLeft,_.y=c.y+o.clientTop}const f=a&&!g&&!i?Pi(a,d):$t(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-d.scrollLeft*u.x+_.x+f.x,y:t.y*u.y-d.scrollTop*u.y+_.y+f.y}}function bc(e){return Array.from(e.getClientRects())}function wc(e){const n=St(e),t=Gn(e),o=e.ownerDocument.body,r=ht(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ht(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let a=-t.scrollLeft+to(e);const l=-t.scrollTop;return pt(o).direction==="rtl"&&(a+=ht(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:l}}const Ti=25;function yc(e,n){const t=gt(e),o=St(e),r=t.visualViewport;let i=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){i=r.width,a=r.height;const _=Hn();(!_||_&&n==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=to(o);if(u<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),c=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-c);h<=Ti&&(i-=h)}else u<=Ti&&(i+=u);return{width:i,height:a,x:l,y:d}}const Cc=new Set(["absolute","fixed"]);function xc(e,n){const t=Yt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=We(e)?an(e):$t(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:a,height:l,x:d,y:u}}function Oi(e,n,t){let o;if(n==="viewport")o=yc(e,t);else if(n==="document")o=wc(St(e));else if(ze(n))o=xc(n,t);else{const r=Li(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Un(o)}function Vi(e,n){const t=Nt(e);return t===n||!ze(t)||Mt(t)?!1:pt(t).position==="fixed"||Vi(t,n)}function Sc(e,n){const t=n.get(e);if(t)return t;let o=Ot(e,[],!1).filter(l=>ze(l)&&Tt(l)!=="body"),r=null;const i=pt(e).position==="fixed";let a=i?Nt(e):e;for(;ze(a)&&!Mt(a);){const l=pt(a),d=jo(a);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&Cc.has(r.position)||mn(a)&&!d&&Vi(e,a))?o=o.filter(_=>_!==a):r=l,a=Nt(a)}return n.set(e,o),o}function $c(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const a=[...t==="clippingAncestors"?Bn(n)?[]:Sc(n,this._c):[].concat(t),o],l=a[0],d=a.reduce((u,_)=>{const g=Oi(n,_,r);return u.top=ht(g.top,u.top),u.right=Vt(g.right,u.right),u.bottom=Vt(g.bottom,u.bottom),u.left=ht(g.left,u.left),u},Oi(n,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function kc(e){const{width:n,height:t}=zi(e);return{width:n,height:t}}function Ic(e,n,t){const o=We(n),r=St(n),i=t==="fixed",a=Yt(e,!0,i,n);let l={scrollLeft:0,scrollTop:0};const d=$t(0);function u(){d.x=to(r)}if(o||!o&&!i)if((Tt(n)!=="body"||mn(r))&&(l=Gn(n)),o){const c=Yt(n,!0,i,n);d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}else r&&u();i&&!o&&r&&u();const _=r&&!o&&!i?Pi(r,l):$t(0),g=a.left+l.scrollLeft-d.x-_.x,f=a.top+l.scrollTop-d.y-_.y;return{x:g,y:f,width:a.width,height:a.height}}function or(e){return pt(e).position==="static"}function ji(e,n){if(!We(e)||pt(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return St(e)===t&&(t=t.ownerDocument.body),t}function qi(e,n){const t=gt(e);if(Bn(e))return t;if(!We(e)){let r=Nt(e);for(;r&&!Mt(r);){if(ze(r)&&!or(r))return r;r=Nt(r)}return t}let o=ji(e,n);for(;o&&_l(o)&&or(o);)o=ji(o,n);return o&&Mt(o)&&or(o)&&!jo(o)?t:o||vl(e)||t}const Ec=async function(e){const n=this.getOffsetParent||qi,t=this.getDimensions,o=await t(e.floating);return{reference:Ic(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Mc(e){return pt(e).direction==="rtl"}const Nc={convertOffsetParentRelativeRectToViewportRelativeRect:vc,getDocumentElement:St,getClippingRect:$c,getOffsetParent:qi,getElementRects:Ec,getClientRects:bc,getDimensions:kc,getScale:an,isElement:ze,isRTL:Mc};function Bi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Fc(e,n){let t=null,o;const r=St(e);function i(){var l;clearTimeout(o),(l=t)==null||l.disconnect(),t=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:_,top:g,width:f,height:c}=u;if(l||n(),!f||!c)return;const h=nn(g),p=nn(r.clientWidth-(_+f)),v=nn(r.clientHeight-(g+c)),w=nn(_),x={rootMargin:-h+"px "+-p+"px "+-v+"px "+-w+"px",threshold:ht(0,Vt(1,d))||1};let E=!0;function A(D){const N=D[0].intersectionRatio;if(N!==d){if(!E)return a();N?a(!1,N):o=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!Bi(u,e.getBoundingClientRect())&&a(),E=!1}try{t=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{t=new IntersectionObserver(A,x)}t.observe(e)}return a(!0),i}function no(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=nr(e),_=r||i?[...u?Ot(u):[],...Ot(n)]:[];_.forEach(w=>{r&&w.addEventListener("scroll",t,{passive:!0}),i&&w.addEventListener("resize",t)});const g=u&&l?Fc(u,t):null;let f=-1,c=null;a&&(c=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&c&&(c.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(n)})),t()}),u&&!d&&c.observe(u),c.observe(n));let h,p=d?Yt(e):null;d&&v();function v(){const w=Yt(e);p&&!Bi(p,w)&&t(),p=w,h=requestAnimationFrame(v)}return t(),()=>{var w;_.forEach(y=>{r&&y.removeEventListener("scroll",t),i&&y.removeEventListener("resize",t)}),g?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Ac=_c,Dc=gc,zc=dc,Lc=pc,Hi=cc,Pc=(e,n,t)=>{const o=new Map,r={platform:Nc,...t},i={...r.platform,_c:o};return lc(e,n,{...r,platform:i})};var Tc=typeof document<"u",Oc=function(){},oo=Tc?m.useLayoutEffect:Oc;function ro(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(!ro(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)&&!ro(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Gi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wi(e,n){const t=Gi(e);return Math.round(n*t)/t}function rr(e){const n=M.useRef(e);return oo(()=>{n.current=e}),n}function Vc(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[_,g]=M.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[f,c]=M.useState(o);ro(f,o)||c(o);const[h,p]=M.useState(null),[v,w]=M.useState(null),y=M.useCallback(C=>{C!==D.current&&(D.current=C,p(C))},[]),x=M.useCallback(C=>{C!==N.current&&(N.current=C,w(C))},[]),E=i||h,A=a||v,D=M.useRef(null),N=M.useRef(null),T=M.useRef(_),L=d!=null,I=rr(d),O=rr(r),V=rr(u),$=M.useCallback(()=>{if(!D.current||!N.current)return;const C={placement:n,strategy:t,middleware:f};O.current&&(C.platform=O.current),Pc(D.current,N.current,C).then(k=>{const z={...k,isPositioned:V.current!==!1};b.current&&!ro(T.current,z)&&(T.current=z,Do.flushSync(()=>{g(z)}))})},[f,n,t,O,V]);oo(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,g(C=>({...C,isPositioned:!1})))},[u]);const b=M.useRef(!1);oo(()=>(b.current=!0,()=>{b.current=!1}),[]),oo(()=>{if(E&&(D.current=E),A&&(N.current=A),E&&A){if(I.current)return I.current(E,A,$);$()}},[E,A,$,I,L]);const S=M.useMemo(()=>({reference:D,floating:N,setReference:y,setFloating:x}),[y,x]),P=M.useMemo(()=>({reference:E,floating:A}),[E,A]),F=M.useMemo(()=>{const C={position:t,left:0,top:0};if(!P.floating)return C;const k=Wi(P.floating,_.x),z=Wi(P.floating,_.y);return l?{...C,transform:"translate("+k+"px, "+z+"px)",...Gi(P.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:k,top:z}},[t,l,P.floating,_.x,_.y]);return M.useMemo(()=>({..._,update:$,refs:S,elements:P,floatingStyles:F}),[_,$,S,P,F])}const jc=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?Hi({element:o.current,padding:r}).fn(t):{}:o?Hi({element:o,padding:r}).fn(t):{}}}},io=(e,n)=>({...Ac(e),options:[e,n]}),so=(e,n)=>({...Dc(e),options:[e,n]}),ao=(e,n)=>({...zc(e),options:[e,n]}),Ki=(e,n)=>({...Lc(e),options:[e,n]}),qc=(e,n)=>({...jc(e),options:[e,n]});function Ui(e){const n=M.useRef(void 0),t=M.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=t(o))},e)}const Bc="data-floating-ui-focusable",Yi="active",Ri="selected",xn="ArrowLeft",Sn="ArrowRight",Xi="ArrowUp",lo="ArrowDown",Hc={...M};let Zi=!1,Gc=0;const Ji=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Gc++;function Wc(){const[e,n]=M.useState(()=>Zi?Ji():void 0);return Le(()=>{e==null&&n(Ji())},[]),M.useEffect(()=>{Zi=!0},[]),e}const $n=Hc.useId||Wc;let kn;process.env.NODE_ENV!=="production"&&(kn=new Set);function co(){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=kn)!=null&&e.has(r))){var i;(i=kn)==null||i.add(r),console.warn(r)}}function Kc(){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=kn)!=null&&e.has(r))){var i;(i=kn)==null||i.add(r),console.error(r)}}const Uc=M.forwardRef(function(n,t){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:_=0,staticOffset:g,stroke:f,d:c,style:{transform:h,...p}={},...v}=n;process.env.NODE_ENV!=="production"&&(t||co("The `ref` prop is required for `FloatingArrow`."));const w=$n(),[y,x]=M.useState(!1);if(Le(()=>{if(!r)return;pt(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[E,A]=o.split("-"),D=E==="top"||E==="bottom";let N=g;(D&&a!=null&&a.x||!D&&a!=null&&a.y)&&(N=null);const T=_*2,L=T/2,I=l/2*(u/-8+1),O=d/2*u/4,V=!!c,$=N&&A==="end"?"bottom":"top";let b=N&&A==="end"?"right":"left";N&&y&&(b=A==="end"?"left":"right");const S=i?.x!=null?N||i.x:"",P=i?.y!=null?N||i.y:"",F=c||"M0,0"+(" H"+l)+(" L"+(l-I)+","+(d-O))+(" Q"+l/2+","+d+" "+I+","+(d-O))+" Z",C={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[E];return s.jsxs("svg",{...v,"aria-hidden":!0,ref:t,width:V?l:l+T,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:P,[E]:D||V?"100%":"calc(100% - "+T/2+"px)",transform:[C,h].filter(k=>!!k).join(" "),...p},children:[T>0&&s.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:T+(c?0:1),d:F}),s.jsx("path",{stroke:T&&!c?v.fill:"none",d:F}),s.jsx("clipPath",{id:w,children:s.jsx("rect",{x:-L,y:L*(V?-1:1),width:l+T,height:l})})]})});function Qi(){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 es=M.createContext(null),ts=M.createContext(null),ln=()=>{var e;return((e=M.useContext(es))==null?void 0:e.id)||null},Rt=()=>M.useContext(ts);function ns(e){const n=$n(),t=Rt(),r=ln();return Le(()=>{if(!n)return;const i={id:n,parentId:r};return t?.addNode(i),()=>{t?.removeNode(i)}},[t,n,r]),n}function os(e){const{children:n,id:t}=e,o=ln();return s.jsx(es.Provider,{value:M.useMemo(()=>({id:t,parentId:o}),[t,o]),children:n})}function Yc(e){const{children:n}=e,t=M.useRef([]),o=M.useCallback(a=>{t.current=[...t.current,a]},[]),r=M.useCallback(a=>{t.current=t.current.filter(l=>l!==a)},[]),[i]=M.useState(()=>Qi());return s.jsx(ts.Provider,{value:M.useMemo(()=>({nodesRef:t,addNode:o,removeNode:r,events:i}),[o,r,i]),children:n})}function Xt(e){return"data-floating-ui-"+e}function st(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const rs=Xt("safe-polygon");function ir(e,n,t){if(t&&!bn(t))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[n]}return e?.[n]}function sr(e){return typeof e=="function"?e():e}function ar(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,events:i,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=n,c=Rt(),h=ln(),p=Qe(u),v=Qe(d),w=Qe(t),y=Qe(g),x=M.useRef(),E=M.useRef(-1),A=M.useRef(),D=M.useRef(-1),N=M.useRef(!0),T=M.useRef(!1),L=M.useRef(()=>{}),I=M.useRef(!1),O=Ke(()=>{var F;const C=(F=r.current.openEvent)==null?void 0:F.type;return C?.includes("mouse")&&C!=="mousedown"});M.useEffect(()=>{if(!l)return;function F(C){let{open:k}=C;k||(st(E),st(D),N.current=!0,I.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),M.useEffect(()=>{if(!l||!p.current||!t)return;function F(k){O()&&o(!1,k,"hover")}const C=rt(a.floating).documentElement;return C.addEventListener("mouseleave",F),()=>{C.removeEventListener("mouseleave",F)}},[a.floating,t,o,l,p,O]);const V=M.useCallback(function(F,C,k){C===void 0&&(C=!0),k===void 0&&(k="hover");const z=ir(v.current,"close",x.current);z&&!A.current?(st(E),E.current=window.setTimeout(()=>o(!1,F,k),z)):C&&(st(E),o(!1,F,k))},[v,o]),$=Ke(()=>{L.current(),A.current=void 0}),b=Ke(()=>{if(T.current){const F=rt(a.floating).body;F.style.pointerEvents="",F.removeAttribute(rs),T.current=!1}}),S=Ke(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function F(j){if(st(E),N.current=!1,_&&!bn(x.current)||sr(y.current)>0&&!ir(v.current,"open"))return;const H=ir(v.current,"open",x.current);H?E.current=window.setTimeout(()=>{w.current||o(!0,j,"hover")},H):t||o(!0,j,"hover")}function C(j){if(S()){b();return}L.current();const H=rt(a.floating);if(st(D),I.current=!1,p.current&&r.current.floatingContext){t||st(E),A.current=p.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){b(),$(),S()||V(j,!0,"safe-polygon")}});const U=A.current;H.addEventListener("mousemove",U),L.current=()=>{H.removeEventListener("mousemove",U)};return}(x.current==="touch"?!ot(a.floating,j.relatedTarget):!0)&&V(j)}function k(j){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){b(),$(),S()||V(j)}})(j))}function z(){st(E)}function q(j){S()||V(j,!1)}if(ze(a.domReference)){const j=a.domReference,H=a.floating;return t&&j.addEventListener("mouseleave",k),f&&j.addEventListener("mousemove",F,{once:!0}),j.addEventListener("mouseenter",F),j.addEventListener("mouseleave",C),H&&(H.addEventListener("mouseleave",k),H.addEventListener("mouseenter",z),H.addEventListener("mouseleave",q)),()=>{t&&j.removeEventListener("mouseleave",k),f&&j.removeEventListener("mousemove",F),j.removeEventListener("mouseenter",F),j.removeEventListener("mouseleave",C),H&&(H.removeEventListener("mouseleave",k),H.removeEventListener("mouseenter",z),H.removeEventListener("mouseleave",q))}}},[a,l,e,_,f,V,$,b,o,t,w,c,v,p,r,S,y]),Le(()=>{var F;if(l&&t&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&O()){T.current=!0;const k=a.floating;if(ze(a.domReference)&&k){var C;const z=rt(a.floating).body;z.setAttribute(rs,"");const q=a.domReference,j=c==null||(C=c.nodesRef.current.find(H=>H.id===h))==null||(C=C.context)==null?void 0:C.elements.floating;return j&&(j.style.pointerEvents=""),z.style.pointerEvents="none",q.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{z.style.pointerEvents="",q.style.pointerEvents="",k.style.pointerEvents=""}}}},[l,t,h,a,c,p,O]),Le(()=>{t||(x.current=void 0,I.current=!1,$(),b())},[t,$,b]),M.useEffect(()=>()=>{$(),st(E),st(D),b()},[l,a.domReference,$,b]);const P=M.useMemo(()=>{function F(C){x.current=C.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(C){const{nativeEvent:k}=C;function z(){!N.current&&!w.current&&o(!0,k,"hover")}_&&!bn(x.current)||t||sr(y.current)===0||I.current&&C.movementX**2+C.movementY**2<2||(st(D),x.current==="touch"?z():(I.current=!0,D.current=window.setTimeout(z,sr(y.current))))}}},[_,o,t,w,y]);return M.useMemo(()=>l?{reference:P}:{},[l,P])}let is=0;function Zt(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(is);const i=()=>e?.focus({preventScroll:t});r?i():is=requestAnimationFrame(i)}function lr(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&qn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Rc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Xc(e){return e?.ownerDocument||document}const cn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ss(e){return e==="inert"?cn.inert:e==="aria-hidden"?cn["aria-hidden"]:cn.none}let uo=new WeakSet,fo={},cr=0;const Zc=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,as=e=>e&&(e.host||as(e.parentNode)),Jc=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=as(t);return e.contains(o)?o:null}).filter(t=>t!=null);function Qc(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,a=Jc(n,e),l=new Set,d=new Set(a),u=[];fo[r]||(fo[r]=new WeakMap);const _=fo[r];a.forEach(g),f(n),l.clear();function g(c){!c||l.has(c)||(l.add(c),c.parentNode&&g(c.parentNode))}function f(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Tt(h)!=="script")if(l.has(h))f(h);else{const p=i?h.getAttribute(i):null,v=p!==null&&p!=="false",w=ss(i),y=(w.get(h)||0)+1,x=(_.get(h)||0)+1;w.set(h,y),_.set(h,x),u.push(h),y===1&&v&&uo.add(h),x===1&&h.setAttribute(r,""),!v&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return cr++,()=>{u.forEach(c=>{const h=ss(i),v=(h.get(c)||0)-1,w=(_.get(c)||0)-1;h.set(c,v),_.set(c,w),v||(!uo.has(c)&&i&&c.removeAttribute(i),uo.delete(c)),w||c.removeAttribute(r)}),cr--,cr||(cn.inert=new WeakMap,cn["aria-hidden"]=new WeakMap,cn.none=new WeakMap,uo=new WeakSet,fo={})}}function ls(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=Xc(e[0]).body;return Qc(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const _o={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},go=M.forwardRef(function(n,t){const[o,r]=M.useState();Le(()=>{Ci()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Xt("focus-guard")]:"",style:_o};return s.jsx("span",{...n,...i})}),cs=M.createContext(null),ds=Xt("portal");function ed(e){e===void 0&&(e={});const{id:n,root:t}=e,o=$n(),r=us(),[i,a]=M.useState(null),l=M.useRef(null);return Le(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Le(()=>{if(!o||l.current)return;const d=n?document.getElementById(n):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(ds,""),d.appendChild(u),l.current=u,a(u)},[n,o]),Le(()=>{if(t===null||!o||l.current)return;let d=t||r?.portalNode;d&&!Vo(d)&&(d=d.current),d=d||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,d.appendChild(u));const _=document.createElement("div");_.id=o,_.setAttribute(ds,""),d=u||d,d.appendChild(_),l.current=_,a(_)},[n,t,o,r]),i}function po(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=ed({id:t,root:o}),[a,l]=M.useState(null),d=M.useRef(null),u=M.useRef(null),_=M.useRef(null),g=M.useRef(null),f=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||i);return M.useEffect(()=>{if(!i||!r||f)return;function p(v){i&&Cn(v)&&(v.type==="focusin"?Ai:ac)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,r,f]),M.useEffect(()=>{i&&(c||Ai(i))},[c,i]),s.jsxs(cs.Provider,{value:M.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:_,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&s.jsx(go,{"data-type":"outside",ref:d,onFocus:p=>{if(Cn(p,i)){var v;(v=_.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Fi(w);y?.focus()}}}),h&&i&&s.jsx("span",{"aria-owns":i.id,style:_o}),i&&Do.createPortal(n,i),h&&i&&s.jsx(go,{"data-type":"outside",ref:u,onFocus:p=>{if(Cn(p,i)){var v;(v=g.current)==null||v.focus()}else{const w=a?a.domReference:null,y=Ni(w);y?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const us=()=>M.useContext(cs);function fs(e){return M.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const td=20;let qt=[];function dr(){qt=qt.filter(e=>e.isConnected)}function nd(e){dr(),e&&Tt(e)!=="body"&&(qt.push(e),qt.length>td&&(qt=qt.slice(-20)))}function _s(){return dr(),qt[qt.length-1]}function od(e){const n=yn();return bi(e,n)?e:Zn(e,n)[0]||e}function gs(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=yn(),i=Gl(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return bi(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),a=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const rd=M.forwardRef(function(n,t){return s.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:_o})});function ur(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:p,events:v,dataRef:w,elements:{domReference:y,floating:x}}=n,E=Ke(()=>{var R;return(R=w.current.floatingContext)==null?void 0:R.nodeId}),A=Ke(c),D=typeof a=="number"&&a<0,N=Qo(y)&&D,T=Zc(),L=T?i:!0,I=!L||T&&f,O=Qe(r),V=Qe(a),$=Qe(l),b=Rt(),S=us(),P=M.useRef(null),F=M.useRef(null),C=M.useRef(!1),k=M.useRef(!1),z=M.useRef(-1),q=M.useRef(-1),j=S!=null,H=Jn(x),J=Ke(function(R){return R===void 0&&(R=H),R?Zn(R,yn()):[]}),U=Ke(R=>{const te=J(R);return O.current.map(ne=>y&&ne==="reference"?y:H&&ne==="floating"?H:te).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function R(ne){if(ne.key==="Tab"){ot(H,kt(rt(H)))&&J().length===0&&!N&&it(ne);const ce=U(),be=At(ne);O.current[0]==="reference"&&be===y&&(it(ne),ne.shiftKey?Zt(ce[ce.length-1]):Zt(ce[1])),O.current[1]==="floating"&&be===H&&ne.shiftKey&&(it(ne),Zt(ce[0]))}}const te=rt(H);return te.addEventListener("keydown",R),()=>{te.removeEventListener("keydown",R)}},[o,y,H,u,O,N,J,U]),M.useEffect(()=>{if(o||!x)return;function R(te){const ne=At(te),be=J().indexOf(ne);be!==-1&&(z.current=be)}return x.addEventListener("focusin",R),()=>{x.removeEventListener("focusin",R)}},[o,x,J]),M.useEffect(()=>{if(o||!g)return;function R(){k.current=!0,setTimeout(()=>{k.current=!1})}function te(be){const ee=be.relatedTarget,Ce=be.currentTarget,xe=At(be);queueMicrotask(()=>{const de=E(),ye=!(ot(y,ee)||ot(x,ee)||ot(ee,x)||ot(S?.portalNode,ee)||ee!=null&&ee.hasAttribute(Xt("focus-guard"))||b&&(Ut(b.nodesRef.current,de).find(W=>{var B,G;return ot((B=W.context)==null?void 0:B.elements.floating,ee)||ot((G=W.context)==null?void 0:G.elements.domReference,ee)})||$i(b.nodesRef.current,de).find(W=>{var B,G,pe;return[(B=W.context)==null?void 0:B.elements.floating,Jn((G=W.context)==null?void 0:G.elements.floating)].includes(ee)||((pe=W.context)==null?void 0:pe.elements.domReference)===ee})));if(Ce===y&&H&&gs(H,O),d&&Ce!==y&&!(xe!=null&&xe.isConnected)&&kt(rt(H))===rt(H).body){We(H)&&H.focus();const W=z.current,B=J(),G=B[W]||B[B.length-1]||H;We(G)&&G.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!u)&&ee&&ye&&!k.current&&ee!==_s()&&(C.current=!0,p(!1,be,"focus-out"))})}const ne=!!(!b&&S);function ce(){st(q),w.current.insideReactTree=!0,q.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&We(y))return y.addEventListener("focusout",te),y.addEventListener("pointerdown",R),x.addEventListener("focusout",te),ne&&x.addEventListener("focusout",ce,!0),()=>{y.removeEventListener("focusout",te),y.removeEventListener("pointerdown",R),x.removeEventListener("focusout",te),ne&&x.removeEventListener("focusout",ce,!0)}},[o,y,x,H,u,b,S,p,g,d,J,N,E,O,w]);const ae=M.useRef(null),ie=M.useRef(null),le=fs([ae,S?.beforeInsideRef]),he=fs([ie,S?.afterInsideRef]);M.useEffect(()=>{var R,te;if(o||!x)return;const ne=Array.from((S==null||(R=S.portalNode)==null?void 0:R.querySelectorAll("["+Xt("portal")+"]"))||[]),be=(te=(b?$i(b.nodesRef.current,E()):[]).find(xe=>{var de;return Qo(((de=xe.context)==null?void 0:de.elements.domReference)||null)}))==null||(te=te.context)==null?void 0:te.elements.domReference,ee=[x,be,...ne,...A(),P.current,F.current,ae.current,ie.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,O.current.includes("reference")||N?y:null].filter(xe=>xe!=null),Ce=u||N?ls(ee,!I,I):ls(ee);return()=>{Ce()}},[o,y,x,u,O,S,N,L,I,b,E,A]),Le(()=>{if(o||!We(H))return;const R=rt(H),te=kt(R);queueMicrotask(()=>{const ne=U(H),ce=V.current,be=(typeof ce=="number"?ne[ce]:ce.current)||H,ee=ot(H,te);!D&&!ee&&h&&Zt(be,{preventScroll:be===H})})},[o,h,H,D,U,V]),Le(()=>{if(o||!H)return;const R=rt(H),te=kt(R);nd(te);function ne(ee){let{reason:Ce,event:xe,nested:de}=ee;if(["hover","safe-polygon"].includes(Ce)&&xe.type==="mouseleave"&&(C.current=!0),Ce==="outside-press")if(de)C.current=!1;else if(ki(xe)||Ii(xe))C.current=!1;else{let ye=!1;document.createElement("div").focus({get preventScroll(){return ye=!0,!1}}),ye?C.current=!1:C.current=!0}}v.on("openchange",ne);const ce=R.createElement("span");ce.setAttribute("tabindex","-1"),ce.setAttribute("aria-hidden","true"),Object.assign(ce.style,_o),j&&y&&y.insertAdjacentElement("afterend",ce);function be(){if(typeof $.current=="boolean"){const ee=y||_s();return ee&&ee.isConnected?ee:ce}return $.current.current||ce}return()=>{v.off("openchange",ne);const ee=kt(R),Ce=ot(x,ee)||b&&Ut(b.nodesRef.current,E(),!1).some(de=>{var ye;return ot((ye=de.context)==null?void 0:ye.elements.floating,ee)}),xe=be();queueMicrotask(()=>{const de=od(xe);$.current&&!C.current&&We(de)&&(!(de!==ee&&ee!==R.body)||Ce)&&de.focus({preventScroll:!0}),ce.remove()})}},[o,x,H,$,w,v,b,j,y,E]),M.useEffect(()=>(queueMicrotask(()=>{C.current=!1}),()=>{queueMicrotask(dr)}),[o]),Le(()=>{if(!o&&S)return S.setFocusManagerState({modal:u,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:y}),()=>{S.setFocusManagerState(null)}},[o,S,u,h,p,g,y]),Le(()=>{o||H&&gs(H,O)},[o,H,O]);function _e(R){return o||!_||!u?null:s.jsx(rd,{ref:R==="start"?P:F,onClick:te=>p(!1,te.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const ge=!o&&L&&(u?!N:!0)&&(j||u);return s.jsxs(s.Fragment,{children:[ge&&s.jsx(go,{"data-type":"inside",ref:le,onFocus:R=>{if(u){const ne=U();Zt(r[0]==="reference"?ne[0]:ne[ne.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(C.current=!1,Cn(R,S.portalNode)){const ne=Ni(y);ne?.focus()}else{var te;(te=S.beforeOutsideRef.current)==null||te.focus()}}}),!N&&_e("start"),t,_e("end"),ge&&s.jsx(go,{"data-type":"inside",ref:he,onFocus:R=>{if(u)Zt(U()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(C.current=!0),Cn(R,S.portalNode)){const ne=Fi(y);ne?.focus()}else{var te;(te=S.afterOutsideRef.current)==null||te.focus()}}})]})}function ps(e){return We(e.target)&&e.target.tagName==="BUTTON"}function id(e){return We(e.target)&&e.target.tagName==="A"}function hs(e){return Jo(e)}function ms(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=n,f=M.useRef(),c=M.useRef(!1),h=M.useMemo(()=>({onPointerDown(p){f.current=p.pointerType},onMouseDown(p){const v=f.current;p.button===0&&l!=="click"&&(bn(v,!0)&&u||(t&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}bn(v,!0)&&u||(t&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!_||ps(p))&&(p.key===" "&&!hs(i)&&(p.preventDefault(),c.current=!0),!id(p)&&p.key==="Enter"&&o(!(t&&d),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!_||ps(p)||hs(i)||p.key===" "&&c.current&&(c.current=!1,o(!(t&&d),p.nativeEvent,"click"))}}),[r,i,l,u,_,o,t,g,d]);return M.useMemo(()=>a?{reference:h}:{},[a,h])}const sd={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ad={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},vs=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 ho(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:c,capture:h}=n,p=Rt(),v=Ke(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,y=M.useRef(!1),{escapeKey:x,outsidePress:E}=vs(c),{escapeKey:A,outsidePress:D}=vs(h),N=M.useRef(!1),T=Ke(b=>{var S;if(!t||!a||!l||b.key!=="Escape"||N.current)return;const P=(S=i.current.floatingContext)==null?void 0:S.nodeId,F=p?Ut(p.nodesRef.current,P):[];if(!x&&(b.stopPropagation(),F.length>0)){let C=!0;if(F.forEach(k=>{var z;if((z=k.context)!=null&&z.open&&!k.context.dataRef.current.__escapeKeyBubbles){C=!1;return}}),!C)return}o(!1,Jl(b)?b.nativeEvent:b,"escape-key")}),L=Ke(b=>{var S;const P=()=>{var F;T(b),(F=At(b))==null||F.removeEventListener("keydown",P)};(S=At(b))==null||S.addEventListener("keydown",P)}),I=Ke(b=>{var S;const P=i.current.insideReactTree;i.current.insideReactTree=!1;const F=y.current;if(y.current=!1,u==="click"&&F||P||typeof w=="function"&&!w(b))return;const C=At(b),k="["+Xt("inert")+"]",z=rt(r.floating).querySelectorAll(k);let q=ze(C)?C:null;for(;q&&!Mt(q);){const U=Nt(q);if(Mt(U)||!ze(U))break;q=U}if(z.length&&ze(C)&&!Rl(C)&&!ot(C,r.floating)&&Array.from(z).every(U=>!ot(q,U)))return;if(We(C)&&$){const U=Mt(C),ae=pt(C),ie=/auto|scroll/,le=U||ie.test(ae.overflowX),he=U||ie.test(ae.overflowY),_e=le&&C.clientWidth>0&&C.scrollWidth>C.clientWidth,ge=he&&C.clientHeight>0&&C.scrollHeight>C.clientHeight,R=ae.direction==="rtl",te=ge&&(R?b.offsetX<=C.offsetWidth-C.clientWidth:b.offsetX>C.clientWidth),ne=_e&&b.offsetY>C.clientHeight;if(te||ne)return}const j=(S=i.current.floatingContext)==null?void 0:S.nodeId,H=p&&Ut(p.nodesRef.current,j).some(U=>{var ae;return Zo(b,(ae=U.context)==null?void 0:ae.elements.floating)});if(Zo(b,r.floating)||Zo(b,r.domReference)||H)return;const J=p?Ut(p.nodesRef.current,j):[];if(J.length>0){let U=!0;if(J.forEach(ae=>{var ie;if((ie=ae.context)!=null&&ie.open&&!ae.context.dataRef.current.__outsidePressBubbles){U=!1;return}}),!U)return}o(!1,b,"outside-press")}),O=Ke(b=>{var S;const P=()=>{var F;I(b),(F=At(b))==null||F.removeEventListener(u,P)};(S=At(b))==null||S.addEventListener(u,P)});M.useEffect(()=>{if(!t||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=E;let b=-1;function S(z){o(!1,z,"ancestor-scroll")}function P(){window.clearTimeout(b),N.current=!0}function F(){b=window.setTimeout(()=>{N.current=!1},Hn()?5:0)}const C=rt(r.floating);l&&(C.addEventListener("keydown",A?L:T,A),C.addEventListener("compositionstart",P),C.addEventListener("compositionend",F)),w&&C.addEventListener(u,D?O:I,D);let k=[];return f&&(ze(r.domReference)&&(k=Ot(r.domReference)),ze(r.floating)&&(k=k.concat(Ot(r.floating))),!ze(r.reference)&&r.reference&&r.reference.contextElement&&(k=k.concat(Ot(r.reference.contextElement)))),k=k.filter(z=>{var q;return z!==((q=C.defaultView)==null?void 0:q.visualViewport)}),k.forEach(z=>{z.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(C.removeEventListener("keydown",A?L:T,A),C.removeEventListener("compositionstart",P),C.removeEventListener("compositionend",F)),w&&C.removeEventListener(u,D?O:I,D),k.forEach(z=>{z.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[i,r,l,w,u,t,o,f,a,x,E,T,A,L,I,D,O]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,w,u]);const V=M.useMemo(()=>({onKeyDown:T,..._&&{[sd[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[T,o,_,g]),$=M.useMemo(()=>({onKeyDown:T,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[ad[u]]:()=>{i.current.insideReactTree=!0}}),[T,u,i]);return M.useMemo(()=>a?{reference:V,floating:$}:{},[a,V,$])}function ld(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=$n(),i=M.useRef({}),[a]=M.useState(()=>Qi()),l=ln()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!ze(c)&&Kc("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]=M.useState(o.reference),_=Ke((c,h,p)=>{i.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:p,nested:l}),t?.(c,h,p)}),g=M.useMemo(()=>({setPositionReference:u}),[]),f=M.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:n,onOpenChange:_,elements:f,events:a,floatingId:r,refs:g}),[n,_,f,a,r,g])}function mo(e){e===void 0&&(e={});const{nodeId:n}=e,t=ld({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,a]=M.useState(null),[l,d]=M.useState(null),_=r?.domReference||i,g=M.useRef(null),f=Rt();Le(()=>{_&&(g.current=_)},[_]);const c=Vc({...e,elements:{...r,...l&&{reference:l}}}),h=M.useCallback(x=>{const E=ze(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(E),c.refs.setReference(E)},[c.refs]),p=M.useCallback(x=>{(ze(x)||x===null)&&(g.current=x,a(x)),(ze(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!ze(x))&&c.refs.setReference(x)},[c.refs]),v=M.useMemo(()=>({...c.refs,setReference:p,setPositionReference:h,domReference:g}),[c.refs,p,h]),w=M.useMemo(()=>({...c.elements,domReference:_}),[c.elements,_]),y=M.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:n}),[c,v,w,n,o]);return Le(()=>{o.dataRef.current.floatingContext=y;const x=f?.nodesRef.current.find(E=>E.id===n);x&&(x.context=y)}),M.useMemo(()=>({...c,context:y,refs:v,elements:w}),[c,v,w,y])}function fr(){return Wl()&&Ci()}function cd(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,events:r,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=n,u=M.useRef(!1),_=M.useRef(-1),g=M.useRef(!0);M.useEffect(()=>{if(!l)return;const c=gt(a.domReference);function h(){!t&&We(a.domReference)&&a.domReference===kt(rt(a.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return c.addEventListener("blur",h),fr()&&(c.addEventListener("keydown",p,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),fr()&&(c.removeEventListener("keydown",p,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,t,l]),M.useEffect(()=>{if(!l)return;function c(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),M.useEffect(()=>()=>{st(_)},[]);const f=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=At(c.nativeEvent);if(d&&ze(h)){if(fr()&&!c.relatedTarget){if(!g.current&&!Jo(h))return}else if(!Xl(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,p=c.nativeEvent,v=ze(h)&&h.hasAttribute(Xt("focus-guard"))&&h.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var w;const y=kt(a.domReference?a.domReference.ownerDocument:document);!h&&y===a.domReference||ot((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,y)||ot(a.domReference,y)||v||o(!1,p,"focus")})}}),[i,a.domReference,o,d]);return M.useMemo(()=>l?{reference:f}:{},[l,f])}function _r(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Yi]:a,[Ri]:l,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[Bc]:""},...i,...n.map(a=>{const l=a?a[t]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(d=>{let[u,_]=d;if(!(r&&[Yi,Ri].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof _=="function"){var g;(g=o.get(u))==null||g.push(_),a[u]=function(){for(var f,c=arguments.length,h=new Array(c),p=0;p<c;p++)h[p]=arguments[p];return(f=o.get(u))==null?void 0:f.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=_}),a),{})}}function vo(e){e===void 0&&(e=[]);const n=e.map(l=>l?.reference),t=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=M.useCallback(l=>_r(l,e,"reference"),n),i=M.useCallback(l=>_r(l,e,"floating"),t),a=M.useCallback(l=>_r(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:a}),[r,i,a])}const dd="Escape";function bo(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function wo(e,n){return bo(n,e===Xi||e===lo,e===xn||e===Sn)}function gr(e,n,t){return bo(n,e===lo,t?e===xn:e===Sn)||e==="Enter"||e===" "||e===""}function bs(e,n,t){return bo(n,t?e===xn:e===Sn,e===lo)}function ws(e,n,t,o){const r=t?e===Sn:e===xn,i=e===Xi;return n==="both"||n==="horizontal"&&o&&o>1?e===dd:bo(n,r,i)}function pr(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:c=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:x=void 0,orientation:E="vertical",parentOrientation:A,cols:D=1,scrollItemIntoView:N=!0,virtualItemRef:T,itemSizes:L,dense:I=!1}=n;process.env.NODE_ENV!=="production"&&(g&&(f||co("`useListNavigation` looping must be enabled to allow escaping."),p||co("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&D>1&&co("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const O=Jn(r.floating),V=Qe(O),$=ln(),b=Rt();Le(()=>{e.dataRef.current.orientation=E},[e,E]);const S=Ke(()=>{d(C.current===-1?null:C.current)}),P=Qo(r.domReference),F=M.useRef(v),C=M.useRef(_??-1),k=M.useRef(null),z=M.useRef(!0),q=M.useRef(S),j=M.useRef(!!r.floating),H=M.useRef(t),J=M.useRef(!1),U=M.useRef(!1),ae=Qe(x),ie=Qe(t),le=Qe(N),he=Qe(_),[_e,ge]=M.useState(),[R,te]=M.useState(),ne=Ke(()=>{function W(Q){if(p){var ve;(ve=Q.id)!=null&&ve.endsWith("-fui-option")&&(Q.id=i+"-"+Math.random().toString(16).slice(2,10)),ge(Q.id),b?.events.emit("virtualfocus",Q),T&&(T.current=Q)}else Zt(Q,{sync:J.current,preventScroll:!0})}const B=a.current[C.current],G=U.current;B&&W(B),(J.current?Q=>Q():requestAnimationFrame)(()=>{const Q=a.current[C.current]||B;if(!Q)return;B||W(Q);const ve=le.current;ve&&be&&(G||!z.current)&&(Q.scrollIntoView==null||Q.scrollIntoView(typeof ve=="boolean"?{block:"nearest",inline:"nearest"}:ve))})});Le(()=>{u&&(t&&r.floating?F.current&&_!=null&&(U.current=!0,C.current=_,S()):j.current&&(C.current=-1,q.current()))},[u,t,r.floating,_,S]),Le(()=>{if(u&&t&&r.floating)if(l==null){if(J.current=!1,he.current!=null)return;if(j.current&&(C.current=-1,ne()),(!H.current||!j.current)&&F.current&&(k.current!=null||F.current===!0&&k.current==null)){let W=0;const B=()=>{a.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(B),W++):(C.current=k.current==null||gr(k.current,E,h)||c?er(a,ae.current):Ei(a,ae.current),k.current=null,S())};B()}}else wn(a,l)||(C.current=l,ne(),U.current=!1)},[u,t,r.floating,l,he,c,a,E,h,S,ne,ae]),Le(()=>{var W;if(!u||r.floating||!b||p||!j.current)return;const B=b.nodesRef.current,G=(W=B.find(ve=>ve.id===$))==null||(W=W.context)==null?void 0:W.elements.floating,pe=kt(rt(r.floating)),Q=B.some(ve=>ve.context&&ot(ve.context.elements.floating,pe));G&&!Q&&z.current&&G.focus({preventScroll:!0})},[u,r.floating,b,$,p]),Le(()=>{if(!u||!b||!p||$)return;function W(B){te(B.id),T&&(T.current=B)}return b.events.on("virtualfocus",W),()=>{b.events.off("virtualfocus",W)}},[u,b,p,$,T]),Le(()=>{q.current=S,H.current=t,j.current=!!r.floating}),Le(()=>{t||(k.current=null,F.current=v)},[t,v]);const ce=l!=null,be=M.useMemo(()=>{function W(G){if(!ie.current)return;const pe=a.current.indexOf(G);pe!==-1&&C.current!==pe&&(C.current=pe,S())}return{onFocus(G){let{currentTarget:pe}=G;J.current=!0,W(pe)},onClick:G=>{let{currentTarget:pe}=G;return pe.focus({preventScroll:!0})},onMouseMove(G){let{currentTarget:pe}=G;J.current=!0,U.current=!1,w&&W(pe)},onPointerLeave(G){let{pointerType:pe}=G;if(!(!z.current||pe==="touch")&&(J.current=!0,!!w&&(C.current=-1,S(),!p))){var Q;(Q=V.current)==null||Q.focus({preventScroll:!0})}}}},[ie,V,w,a,S,p]),ee=M.useCallback(()=>{var W;return A??(b==null||(W=b.nodesRef.current.find(B=>B.id===$))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[$,b,A]),Ce=Ke(W=>{if(z.current=!1,J.current=!0,W.which===229||!ie.current&&W.currentTarget===V.current)return;if(c&&ws(W.key,E,h,D)){wo(W.key,ee())||it(W),o(!1,W.nativeEvent,"list-navigation"),We(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const B=C.current,G=er(a,x),pe=Ei(a,x);if(P||(W.key==="Home"&&(it(W),C.current=G,S()),W.key==="End"&&(it(W),C.current=pe,S())),D>1){const Q=L||Array.from({length:a.current.length},()=>({width:1,height:1})),ve=rc(Q,D,I),Xe=ve.findIndex(Te=>Te!=null&&!eo(a,Te,x)),Ye=ve.reduce((Te,Ze,Ge)=>Ze!=null&&!eo(a,Ze,x)?Ge:Te,-1),tt=ve[oc({current:ve.map(Te=>Te!=null?a.current[Te]:null)},{event:W,orientation:E,loop:f,rtl:h,cols:D,disabledIndices:sc([...(typeof x!="function"?x:null)||a.current.map((Te,Ze)=>eo(a,Ze,x)?Ze:void 0),void 0],ve),minIndex:Xe,maxIndex:Ye,prevIndex:ic(C.current>pe?G:C.current,Q,ve,D,W.key===lo?"bl":W.key===(h?xn:Sn)?"tr":"tl"),stopEvent:!0})];if(tt!=null&&(C.current=tt,S()),E==="both")return}if(wo(W.key,E)){if(it(W),t&&!p&&kt(W.currentTarget.ownerDocument)===W.currentTarget){C.current=gr(W.key,E,h)?G:pe,S();return}gr(W.key,E,h)?f?C.current=B>=pe?g&&B!==a.current.length?-1:G:lt(a,{startingIndex:B,disabledIndices:x}):C.current=Math.min(pe,lt(a,{startingIndex:B,disabledIndices:x})):f?C.current=B<=G?g&&B!==-1?a.current.length:pe:lt(a,{startingIndex:B,decrement:!0,disabledIndices:x}):C.current=Math.max(G,lt(a,{startingIndex:B,decrement:!0,disabledIndices:x})),wn(a,C.current)&&(C.current=-1),S()}}),xe=M.useMemo(()=>p&&t&&ce&&{"aria-activedescendant":R||_e},[p,t,ce,R,_e]),de=M.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...P?{}:xe,onKeyDown:Ce,onPointerMove(){z.current=!0}}),[xe,Ce,E,P]),ye=M.useMemo(()=>{function W(G){v==="auto"&&ki(G.nativeEvent)&&(F.current=!0)}function B(G){F.current=v,v==="auto"&&Ii(G.nativeEvent)&&(F.current=!0)}return{...xe,onKeyDown(G){z.current=!1;const pe=G.key.startsWith("Arrow"),Q=["Home","End"].includes(G.key),ve=pe||Q,Xe=bs(G.key,E,h),Ye=ws(G.key,E,h,D),tt=bs(G.key,ee(),h),Te=wo(G.key,E),Ze=(c?tt:Te)||G.key==="Enter"||G.key.trim()==="";if(p&&t){const Pe=b?.nodesRef.current.find(_t=>_t.parentId==null),Ne=b&&Pe?Zl(b.nodesRef.current,Pe.id):null;if(ve&&Ne&&T){const _t=new KeyboardEvent("keydown",{key:G.key,bubbles:!0});if(Xe||Ye){var Ge,me;const oe=((Ge=Ne.context)==null?void 0:Ge.elements.domReference)===G.currentTarget,Me=Ye&&!oe?(me=Ne.context)==null?void 0:me.elements.domReference:Xe?a.current.find(Be=>Be?.id===_e):null;Me&&(it(G),Me.dispatchEvent(_t),te(void 0))}if((Te||Q)&&Ne.context&&Ne.context.open&&Ne.parentId&&G.currentTarget!==Ne.context.elements.domReference){var we;it(G),(we=Ne.context.elements.domReference)==null||we.dispatchEvent(_t);return}}return Ce(G)}if(!(!t&&!y&&pe)){if(Ze){const Pe=wo(G.key,ee());k.current=c&&Pe?null:G.key}if(c){tt&&(it(G),t?(C.current=er(a,ae.current),S()):o(!0,G.nativeEvent,"list-navigation"));return}Te&&(_!=null&&(C.current=_),it(G),!t&&y?o(!0,G.nativeEvent,"list-navigation"):Ce(G),t&&S())}},onFocus(){t&&!p&&(C.current=-1,S())},onPointerDown:B,onPointerEnter:B,onMouseDown:W,onClick:W}},[_e,xe,D,Ce,ae,v,a,c,S,o,t,y,E,ee,h,_,b,p,T]);return M.useMemo(()=>u?{reference:ye,floating:de,item:be}:{},[u,ye,de,be])}const ud=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function yo(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:a}=e,{enabled:l=!0,role:d="dialog"}=n,u=$n(),_=((t=i.domReference)==null?void 0:t.id)||u,g=M.useMemo(()=>{var y;return((y=Jn(i.floating))==null?void 0:y.id)||a},[i.floating,a]),f=(o=ud.get(d))!=null?o:d,h=ln()!=null,p=M.useMemo(()=>f==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[f,g,h,r,_,d]),v=M.useMemo(()=>{const y={id:g,...f&&{role:f}};return f==="tooltip"||d==="label"?y:{...y,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,d]),w=M.useCallback(y=>{let{active:x,selected:E}=y;const A={role:"option",...x&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...A,"aria-selected":E}}return{}},[g,d]);return M.useMemo(()=>l?{reference:p,floating:v,item:w}:{},[l,p,v,w])}const ys=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function dn(e,n){return typeof e=="function"?e(n):e}function fd(e,n){const[t,o]=M.useState(e);return e&&!t&&o(!0),M.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function _d(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,a=(typeof r=="number"?r:r.close)||0,[l,d]=M.useState("unmounted"),u=fd(t,a);return!u&&l==="close"&&d("unmounted"),Le(()=>{if(o){if(t){d("initial");const _=requestAnimationFrame(()=>{Do.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(_)}}d("close")}},[t,o]),{isMounted:u,status:l}}function Co(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:a=250}=n,l=e.placement,d=l.split("-")[0],u=M.useMemo(()=>({side:d,placement:l}),[d,l]),_=typeof a=="number",g=(_?a:a.open)||0,f=(_?a:a.close)||0,[c,h]=M.useState(()=>({...dn(i,u),...dn(t,u)})),{isMounted:p,status:v}=_d(e,{duration:a}),w=Qe(t),y=Qe(o),x=Qe(r),E=Qe(i);return Le(()=>{const A=dn(w.current,u),D=dn(x.current,u),N=dn(E.current,u),T=dn(y.current,u)||Object.keys(A).reduce((L,I)=>(L[I]="",L),{});if(v==="initial"&&h(L=>({transitionProperty:L.transitionProperty,...N,...A})),v==="open"&&h({transitionProperty:Object.keys(T).map(ys).join(","),transitionDuration:g+"ms",...N,...T}),v==="close"){const L=D||A;h({transitionProperty:Object.keys(L).map(ys).join(","),transitionDuration:f+"ms",...N,...L})}},[f,x,w,y,E,g,v,u]),{isMounted:p,styles:c}}function Cs(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:c=null}=n,h=M.useRef(-1),p=M.useRef(""),v=M.useRef((t=c??a)!=null?t:-1),w=M.useRef(null),y=Ke(l),x=Ke(d),E=Qe(_),A=Qe(f);Le(()=>{o&&(st(h),w.current=null,p.current="")},[o]),Le(()=>{if(o&&p.current===""){var I;v.current=(I=c??a)!=null?I:-1}},[o,c,a]);const D=Ke(I=>{I?r.current.typing||(r.current.typing=I,x(I)):r.current.typing&&(r.current.typing=I,x(I))}),N=Ke(I=>{function O(P,F,C){const k=E.current?E.current(F,C):F.find(z=>z?.toLocaleLowerCase().indexOf(C.toLocaleLowerCase())===0);return k?P.indexOf(k):-1}const V=i.current;if(p.current.length>0&&p.current[0]!==" "&&(O(V,V,p.current)===-1?D(!1):I.key===" "&&it(I)),V==null||A.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(it(I),D(!0)),V.every(P=>{var F,C;return P?((F=P[0])==null?void 0:F.toLocaleLowerCase())!==((C=P[1])==null?void 0:C.toLocaleLowerCase()):!0})&&p.current===I.key&&(p.current="",v.current=w.current),p.current+=I.key,st(h),h.current=window.setTimeout(()=>{p.current="",v.current=w.current,D(!1)},g);const b=v.current,S=O(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],p.current);S!==-1?(y(S),w.current=S):I.key!==" "&&(p.current="",D(!1))}),T=M.useMemo(()=>({onKeyDown:N}),[N]),L=M.useMemo(()=>({onKeyDown:N,onKeyUp(I){I.key===" "&&D(!1)}}),[N,D]);return M.useMemo(()=>u?{reference:T,floating:L}:{},[u,T,L])}function xs(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,...xs(e,r.id,t)])}function Ss(e,n){const[t,o]=e;let r=!1;const i=n.length;for(let a=0,l=i-1;a<i;l=a++){const[d,u]=n[a]||[0,0],[_,g]=n[l]||[0,0];u>=o!=g>=o&&t<=(_-d)*(o-u)/(g-u)+d&&(r=!r)}return r}function gd(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}function $s(e){e===void 0&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(g,f){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=g,l=f,d=c,null;const p=g-a,v=f-l,y=Math.sqrt(p*p+v*v)/h;return a=g,l=f,d=c,y}const _=g=>{let{x:f,y:c,placement:h,elements:p,onClose:v,nodeId:w,tree:y}=g;return function(E){function A(){st(r),v()}if(st(r),!p.domReference||!p.floating||h==null||f==null||c==null)return;const{clientX:D,clientY:N}=E,T=[D,N],L=Rc(E),I=E.type==="mouseleave",O=lr(p.floating,L),V=lr(p.domReference,L),$=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],P=f>b.right-b.width/2,F=c>b.bottom-b.height/2,C=gd(T,$),k=b.width>$.width,z=b.height>$.height,q=(k?$:b).left,j=(k?$:b).right,H=(z?$:b).top,J=(z?$:b).bottom;if(O&&(i=!0,!I))return;if(V&&(i=!1),V&&!I){i=!0;return}if(I&&ze(E.relatedTarget)&&lr(p.floating,E.relatedTarget)||y&&xs(y.nodesRef.current,w).length)return;if(S==="top"&&c>=$.bottom-1||S==="bottom"&&c<=$.top+1||S==="left"&&f>=$.right-1||S==="right"&&f<=$.left+1)return A();let U=[];switch(S){case"top":U=[[q,$.top+1],[q,b.bottom-1],[j,b.bottom-1],[j,$.top+1]];break;case"bottom":U=[[q,b.top+1],[q,$.bottom-1],[j,$.bottom-1],[j,b.top+1]];break;case"left":U=[[b.right-1,J],[b.right-1,H],[$.left+1,H],[$.left+1,J]];break;case"right":U=[[$.right-1,J],[$.right-1,H],[b.left+1,H],[b.left+1,J]];break}function ae(ie){let[le,he]=ie;switch(S){case"top":{const _e=[k?le+n/2:P?le+n*4:le-n*4,he+n+1],ge=[k?le-n/2:P?le+n*4:le-n*4,he+n+1],R=[[b.left,P||k?b.bottom-n:b.top],[b.right,P?k?b.bottom-n:b.top:b.bottom-n]];return[_e,ge,...R]}case"bottom":{const _e=[k?le+n/2:P?le+n*4:le-n*4,he-n],ge=[k?le-n/2:P?le+n*4:le-n*4,he-n],R=[[b.left,P||k?b.top+n:b.bottom],[b.right,P?k?b.top+n:b.bottom:b.top+n]];return[_e,ge,...R]}case"left":{const _e=[le+n+1,z?he+n/2:F?he+n*4:he-n*4],ge=[le+n+1,z?he-n/2:F?he+n*4:he-n*4];return[...[[F||z?b.right-n:b.left,b.top],[F?z?b.right-n:b.left:b.right-n,b.bottom]],_e,ge]}case"right":{const _e=[le-n,z?he+n/2:F?he+n*4:he-n*4],ge=[le-n,z?he-n/2:F?he+n*4:he-n*4],R=[[F||z?b.left+n:b.right,b.top],[F?z?b.left+n:b.right:b.left+n,b.bottom]];return[_e,ge,...R]}}}if(!Ss([D,N],U)){if(i&&!C)return A();if(!I&&o){const ie=u(E.clientX,E.clientY);if(ie!==null&&ie<.1)return A()}Ss([D,N],ae([f,c]))?!i&&o&&(r.current=window.setTimeout(A,40)):A()}}};return _.__options={blockPointerEvents:t},_}function un(e,n,t){let o=t.initialDeps??[],r;function i(){var a,l,d,u;let _;t.key&&((a=t.debug)!=null&&a.call(t))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((h,p)=>o[p]!==h)))return r;o=g;let c;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(c=Date.now()),r=n(...g),t.key&&((d=t.debug)!=null&&d.call(t))){const h=Math.round((Date.now()-_)*100)/100,p=Math.round((Date.now()-c)*100)/100,v=p/16,w=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
|
|
657
|
+
*/var u_=["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])"],$o=u_.join(","),Zi=typeof Element>"u",Cn=Zi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ko=!Zi&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},jn=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&jn(t.parentNode);return i},f_=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Ji=function(t,n,o){if(jn(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll($o));return n&&Cn.call(t,$o)&&r.unshift(t),r=r.filter(o),r},Eo=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!jn(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),c=l.length?l:i.children,d=Eo(c,!0,o);o.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else{var _=Cn.call(i,$o);_&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var g=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),f=!jn(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(g&&f){var u=Eo(g===!0?i.children:g.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:i,candidates:u})}else s.unshift.apply(s,i.children)}}return r},Qi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ea=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||f_(t))&&!Qi(t)?0:t.tabIndex},__=function(t,n){var o=ea(t);return o<0&&n&&!Qi(t)?0:o},g_=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ta=function(t){return t.tagName==="INPUT"},h_=function(t){return ta(t)&&t.type==="hidden"},p_=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},m_=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},v_=function(t){if(!t.name)return!0;var n=t.form||ko(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=m_(r,t.form);return!s||s===t},b_=function(t){return ta(t)&&t.type==="radio"},w_=function(t){return b_(t)&&!v_(t)},y_=function(t){var n,o=t&&ko(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,l,c;for(s=!!((i=r)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(c=t.ownerDocument)!==null&&c!==void 0&&c.contains(t));!s&&r;){var d,_,g;o=ko(r),r=(d=o)===null||d===void 0?void 0:d.host,s=!!((_=r)!==null&&_!==void 0&&(g=_.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return s},na=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},C_=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Cn.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(Cn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var c=t;t;){var d=t.parentElement,_=ko(t);if(d&&!d.shadowRoot&&r(d)===!0)return na(t);t.assignedSlot?t=t.assignedSlot:!d&&_!==t.ownerDocument?t=_.host:t=d}t=c}if(y_(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return na(t);return!1},x_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return Cn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Hr=function(t,n){return!(n.disabled||jn(n)||h_(n)||C_(n,t)||p_(n)||x_(n))},Rr=function(t,n){return!(w_(n)||ea(n)<0||!Hr(t,n))},S_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},oa=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,l=i?r.scopeParent:r,c=__(l,i),d=i?oa(r.candidates):l;c===0?i?n.push.apply(n,d):n.push(l):o.push({documentOrder:s,tabIndex:c,item:r,isScope:i,content:d})}),o.sort(g_).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Io=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Eo([t],n.includeContainer,{filter:Rr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:S_}):o=Ji(t,n.includeContainer,Rr.bind(null,n)),oa(o)},$_=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Eo([t],n.includeContainer,{filter:Hr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Ji(t,n.includeContainer,Hr.bind(null,n)),o},ra=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Cn.call(t,$o)===!1?!1:Rr(n,t)};function sa(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ia(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function aa(){return/apple/i.test(navigator.vendor)}function Ur(){const e=/android/i;return e.test(sa())||e.test(ia())}function k_(){return sa().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function la(){return ia().includes("jsdom/")}const ca="data-floating-ui-focusable",E_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wr="ArrowLeft",Gr="ArrowRight",I_="ArrowUp",N_="ArrowDown";function Tt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function it(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&vo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function jt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Kr(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function M_(e){return e.matches("html,body")}function at(e){return e?.ownerDocument||document}function Xr(e){return Xe(e)&&e.matches(E_)}function Yr(e){return e?e.getAttribute("role")==="combobox"&&Xr(e):!1}function A_(e){if(!e||la())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function No(e){return e?e.hasAttribute(ca)?e:e.querySelector("["+ca+"]")||e:null}function cn(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...cn(e,r.id,n)])}function D_(e,t){let n,o=-1;function r(s,i){i>o&&(n=s,o=i),cn(e,s).forEach(c=>{r(c.id,i+1)})}return r(t,0),e.find(s=>s.id===n)}function da(e,t){var n;let o=[],r=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;r;){const s=e.find(i=>i.id===r);r=s?.parentId,s&&(o=o.concat(s))}return o}function lt(e){e.preventDefault(),e.stopPropagation()}function T_(e){return"nativeEvent"in e}function ua(e){return e.mozInputSource===0&&e.isTrusted?!0:Ur()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function fa(e){return la()?!1:!Ur()&&e.width===0&&e.height===0||Ur()&&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 qn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var F_=typeof document<"u",P_=function(){},Le=F_?v.useLayoutEffect:P_;const L_={...N};function et(e){const t=N.useRef(e);return Le(()=>{t.current=e}),t}const O_=L_.useInsertionEffect||(e=>e());function Ye(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return O_(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Mo(e,t,n){return Math.floor(e/t)!==n}function Hn(e,t){return t<0||t>=e.current.length}function Zr(e,t){return ut(e,{disabledIndices:t})}function _a(e,t){return ut(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ut(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:s=1}=t===void 0?{}:t,i=n;do i+=o?-s:s;while(i>=0&&i<=e.current.length-1&&Ao(e,i,r));return i}function z_(e,t){let{event:n,orientation:o,loop:r,rtl:s,cols:i,disabledIndices:l,minIndex:c,maxIndex:d,prevIndex:_,stopEvent:g=!1}=t,f=_;if(n.key===I_){if(g&<(n),_===-1)f=d;else if(f=ut(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:l}),r&&(_-i<c||f<0)){const u=_%i,p=d%i,h=d-(p-u);p===u?f=d:f=p>u?h:h-i}Hn(e,f)&&(f=_)}if(n.key===N_&&(g&<(n),_===-1?f=c:(f=ut(e,{startingIndex:_,amount:i,disabledIndices:l}),r&&_+i>d&&(f=ut(e,{startingIndex:_%i-i,amount:i,disabledIndices:l}))),Hn(e,f)&&(f=_)),o==="both"){const u=bn(_/i);n.key===(s?Wr:Gr)&&(g&<(n),_%i!==i-1?(f=ut(e,{startingIndex:_,disabledIndices:l}),r&&Mo(f,i,u)&&(f=ut(e,{startingIndex:_-_%i-1,disabledIndices:l}))):r&&(f=ut(e,{startingIndex:_-_%i-1,disabledIndices:l})),Mo(f,i,u)&&(f=_)),n.key===(s?Gr:Wr)&&(g&<(n),_%i!==0?(f=ut(e,{startingIndex:_,decrement:!0,disabledIndices:l}),r&&Mo(f,i,u)&&(f=ut(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l}))):r&&(f=ut(e,{startingIndex:_+(i-_%i),decrement:!0,disabledIndices:l})),Mo(f,i,u)&&(f=_));const p=bn(d/i)===u;Hn(e,f)&&(r&&p?f=n.key===(s?Gr:Wr)?d:ut(e,{startingIndex:_-_%i-1,disabledIndices:l}):f=_)}return f}function B_(e,t,n){const o=[];let r=0;return e.forEach((s,i)=>{let{width:l,height:c}=s;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let d=!1;for(n&&(r=0);!d;){const _=[];for(let g=0;g<l;g++)for(let f=0;f<c;f++)_.push(r+g+f*t);r%t+l<=t&&_.every(g=>o[g]==null)?(_.forEach(g=>{o[g]=i}),d=!0):r++}}),[...o]}function V_(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e)}}function j_(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Ao(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Rn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ga(e,t){const n=Io(e,Rn()),o=n.length;if(o===0)return;const r=Tt(at(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function ha(e){return ga(at(e).body,1)||e}function pa(e){return ga(at(e).body,-1)||e}function Un(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!it(n,o)}function q_(e){Io(e,Rn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ma(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function va(e,t,n){let{reference:o,floating:r}=e;const s=Vt(t),i=jr(t),l=Vr(i),c=Jt(t),d=s==="y",_=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,f=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:_,y:o.y-r.height};break;case"bottom":u={x:_,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:g};break;case"left":u={x:o.x-r.width,y:g};break;default:u={x:o.x,y:o.y}}switch(yn(t)){case"start":u[i]-=f*(n&&d?-1:1);break;case"end":u[i]+=f*(n&&d?-1:1);break}return u}const H_=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:_,y:g}=va(d,o,c),f=o,u={},p=0;for(let h=0;h<l.length;h++){const{name:m,fn:y}=l[h],{x:w,y:C,data:k,reset:A}=await y({x:_,y:g,initialPlacement:o,placement:f,strategy:r,middlewareData:u,rects:d,platform:i,elements:{reference:e,floating:t}});_=w??_,g=C??g,u={...u,[m]:{...u[m],...k}},A&&p<=50&&(p++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(d=A.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):A.rects),{x:_,y:g}=va(d,f,c)),h=-1)}return{x:_,y:g,placement:f,strategy:r,middlewareData:u}};async function Jr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:_="viewport",elementContext:g="floating",altBoundary:f=!1,padding:u=0}=wn(t,e),p=Yi(u),m=l[f?g==="floating"?"reference":"floating":g],y=So(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:_,strategy:c})),w=g==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},A=So(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:c}):w);return{top:(y.top-A.top+p.top)/k.y,bottom:(A.bottom-y.bottom+p.bottom)/k.y,left:(y.left-A.left+p.left)/k.x,right:(A.right-y.right+p.right)/k.x}}const R_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:l,middlewareData:c}=t,{element:d,padding:_=0}=wn(e,t)||{};if(d==null)return{};const g=Yi(_),f={x:n,y:o},u=jr(r),p=Vr(u),h=await i.getDimensions(d),m=u==="y",y=m?"top":"left",w=m?"bottom":"right",C=m?"clientHeight":"clientWidth",k=s.reference[p]+s.reference[u]-f[u]-s.floating[p],A=f[u]-s.reference[u],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let M=T?T[C]:0;(!M||!await(i.isElement==null?void 0:i.isElement(T)))&&(M=l.floating[C]||s.floating[p]);const P=k/2-A/2,L=M/2-h[p]/2-1,E=Zt(g[y],L),B=Zt(g[w],L),V=E,$=M-h[p]-B,b=M/2-h[p]/2+P,S=Br(V,b,$),O=!c.arrow&&yn(r)!=null&&b!==S&&s.reference[p]/2-(b<V?E:B)-h[p]/2<0,D=O?b<V?b-V:b-$:0;return{[u]:f[u]+D,data:{[u]:S,centerOffset:b-S-D,...O&&{alignmentOffset:D}},reset:O}}}),U_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:_=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...m}=wn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Jt(r),w=Vt(l),C=Jt(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),A=f||(C||!h?[xo(l)]:s_(l)),T=p!=="none";!f&&T&&A.push(...c_(l,h,p,k));const M=[l,...A],P=await Jr(t,m),L=[];let E=((o=s.flip)==null?void 0:o.overflows)||[];if(_&&L.push(P[y]),g){const b=r_(r,i,k);L.push(P[b[0]],P[b[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(b=>b<=0)){var B,V;const b=(((B=s.flip)==null?void 0:B.index)||0)+1,S=M[b];if(S&&(!(g==="alignment"?w!==Vt(S):!1)||E.every(x=>Vt(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:b,overflows:E},reset:{placement:S}};let O=(V=E.filter(D=>D.overflows[0]<=0).sort((D,x)=>D.overflows[1]-x.overflows[1])[0])==null?void 0:V.placement;if(!O)switch(u){case"bestFit":{var $;const D=($=E.filter(x=>{if(T){const I=Vt(x.placement);return I===w||I==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(I=>I>0).reduce((I,F)=>I+F,0)]).sort((x,I)=>x[1]-I[1])[0])==null?void 0:$[0];D&&(O=D);break}case"initialPlacement":O=l;break}if(r!==O)return{reset:{placement:O}}}return{}}}},W_=new Set(["left","top"]);async function G_(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=Jt(n),l=yn(n),c=Vt(n)==="y",d=W_.has(i)?-1:1,_=s&&c?-1:1,g=wn(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),c?{x:u*_,y:f*d}:{x:f*d,y:u*_}}const K_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await G_(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},X_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:m=>{let{x:y,y:w}=m;return{x:y,y:w}}},...c}=wn(e,t),d={x:n,y:o},_=await Jr(t,c),g=Vt(Jt(r)),f=Gi(g);let u=d[f],p=d[g];if(s){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=u+_[m],C=u-_[y];u=Br(w,u,C)}if(i){const m=g==="y"?"top":"left",y=g==="y"?"bottom":"right",w=p+_[m],C=p-_[y];p=Br(w,p,C)}const h=l.fn({...t,[f]:u,[g]:p});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:s,[g]:i}}}}}},Y_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=wn(e,t),_=await Jr(t,d),g=Jt(r),f=yn(r),u=Vt(r)==="y",{width:p,height:h}=s.floating;let m,y;g==="top"||g==="bottom"?(m=g,y=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=g,m=f==="end"?"top":"bottom");const w=h-_.top-_.bottom,C=p-_.left-_.right,k=Zt(h-_[m],w),A=Zt(p-_[y],C),T=!t.middlewareData.shift;let M=k,P=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(M=w),T&&!f){const E=St(_.left,0),B=St(_.right,0),V=St(_.top,0),$=St(_.bottom,0);u?P=p-2*(E!==0||B!==0?E+B:St(_.left,_.right)):M=h-2*(V!==0||$!==0?V+$:St(_.top,_.bottom))}await c({...t,availableWidth:P,availableHeight:M});const L=await i.getDimensions(l.floating);return p!==L.width||h!==L.height?{reset:{rects:!0}}:{}}}};function ba(e){const t=xt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Xe(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,l=Co(n)!==s||Co(o)!==i;return l&&(n=s,o=i),{width:n,height:o,$:l}}function Qr(e){return Pe(e)?e:e.contextElement}function xn(e){const t=Qr(e);if(!Xe(t))return Dt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=ba(t);let i=(s?Co(n.width):n.width)/o,l=(s?Co(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Z_=Dt(0);function wa(e){const t=bt(e);return!wo()||!t.visualViewport?Z_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bt(e)?!1:t}function dn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Qr(e);let i=Dt(1);t&&(o?Pe(o)&&(i=xn(o)):i=xn(e));const l=J_(s,n,o)?wa(s):Dt(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,_=r.width/i.x,g=r.height/i.y;if(s){const f=bt(s),u=o&&Pe(o)?bt(o):o;let p=f,h=zr(p);for(;h&&o&&u!==p;){const m=xn(h),y=h.getBoundingClientRect(),w=xt(h),C=y.left+(h.clientLeft+parseFloat(w.paddingLeft))*m.x,k=y.top+(h.clientTop+parseFloat(w.paddingTop))*m.y;c*=m.x,d*=m.y,_*=m.x,g*=m.y,c+=C,d+=k,p=bt(h),h=zr(p)}}return So({width:_,height:g,x:c,y:d})}function Do(e,t){const n=yo(e).scrollLeft;return t?t.left+n:dn(At(e)).left+n}function ya(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Do(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Q_(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=At(o),l=t?bo(t.floating):!1;if(o===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Dt(1);const _=Dt(0),g=Xe(o);if((g||!g&&!s)&&((Xt(o)!=="body"||Vn(i))&&(c=yo(o)),Xe(o))){const u=dn(o);d=xn(o),_.x=u.x+o.clientLeft,_.y=u.y+o.clientTop}const f=i&&!g&&!s?ya(i,c):Dt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+_.x+f.x,y:n.y*d.y-c.scrollTop*d.y+_.y+f.y}}function eg(e){return Array.from(e.getClientRects())}function tg(e){const t=At(e),n=yo(e),o=e.ownerDocument.body,r=St(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=St(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Do(e);const l=-n.scrollTop;return xt(o).direction==="rtl"&&(i+=St(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ca=25;function ng(e,t){const n=bt(e),o=At(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const _=wo();(!_||_&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Do(o);if(d<=0){const _=o.ownerDocument,g=_.body,f=getComputedStyle(g),u=_.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(o.clientWidth-g.clientWidth-u);p<=Ca&&(s-=p)}else d<=Ca&&(s+=d);return{width:s,height:i,x:l,y:c}}const og=new Set(["absolute","fixed"]);function rg(e,t){const n=dn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Xe(e)?xn(e):Dt(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=o*s.y;return{width:i,height:l,x:c,y:d}}function xa(e,t,n){let o;if(t==="viewport")o=ng(e,n);else if(t==="document")o=tg(At(e));else if(Pe(t))o=rg(t,n);else{const r=wa(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return So(o)}function Sa(e,t){const n=Bt(e);return n===t||!Pe(n)||zt(n)?!1:xt(n).position==="fixed"||Sa(n,t)}function sg(e,t){const n=t.get(e);if(n)return n;let o=Yt(e,[],!1).filter(l=>Pe(l)&&Xt(l)!=="body"),r=null;const s=xt(e).position==="fixed";let i=s?Bt(e):e;for(;Pe(i)&&!zt(i);){const l=xt(i),c=Or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&og.has(r.position)||Vn(i)&&!c&&Sa(e,i))?o=o.filter(_=>_!==i):r=l,i=Bt(i)}return t.set(e,o),o}function ig(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?bo(t)?[]:sg(t,this._c):[].concat(n),o],l=i[0],c=i.reduce((d,_)=>{const g=xa(t,_,r);return d.top=St(g.top,d.top),d.right=Zt(g.right,d.right),d.bottom=Zt(g.bottom,d.bottom),d.left=St(g.left,d.left),d},xa(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ag(e){const{width:t,height:n}=ba(e);return{width:t,height:n}}function lg(e,t,n){const o=Xe(t),r=At(t),s=n==="fixed",i=dn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=Dt(0);function d(){c.x=Do(r)}if(o||!o&&!s)if((Xt(t)!=="body"||Vn(r))&&(l=yo(t)),o){const u=dn(t,!0,s,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else r&&d();s&&!o&&r&&d();const _=r&&!o&&!s?ya(r,l):Dt(0),g=i.left+l.scrollLeft-c.x-_.x,f=i.top+l.scrollTop-c.y-_.y;return{x:g,y:f,width:i.width,height:i.height}}function es(e){return xt(e).position==="static"}function $a(e,t){if(!Xe(e)||xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function ka(e,t){const n=bt(e);if(bo(e))return n;if(!Xe(e)){let r=Bt(e);for(;r&&!zt(r);){if(Pe(r)&&!es(r))return r;r=Bt(r)}return n}let o=$a(e,t);for(;o&&Kf(o)&&es(o);)o=$a(o,t);return o&&zt(o)&&es(o)&&!Or(o)?n:o||Qf(e)||n}const cg=async function(e){const t=this.getOffsetParent||ka,n=this.getDimensions,o=await n(e.floating);return{reference:lg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function dg(e){return xt(e).direction==="rtl"}const ug={convertOffsetParentRelativeRectToViewportRelativeRect:Q_,getDocumentElement:At,getClippingRect:ig,getOffsetParent:ka,getElementRects:cg,getClientRects:eg,getDimensions:ag,getScale:xn,isElement:Pe,isRTL:dg};function Ea(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fg(e,t){let n=null,o;const r=At(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:_,top:g,width:f,height:u}=d;if(l||t(),!f||!u)return;const p=bn(g),h=bn(r.clientWidth-(_+f)),m=bn(r.clientHeight-(g+u)),y=bn(_),C={rootMargin:-p+"px "+-h+"px "+-m+"px "+-y+"px",threshold:St(0,Zt(1,c))||1};let k=!0;function A(T){const M=T[0].intersectionRatio;if(M!==c){if(!k)return i();M?i(!1,M):o=setTimeout(()=>{i(!1,1e-7)},1e3)}M===1&&!Ea(d,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(A,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,C)}n.observe(e)}return i(!0),s}function To(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Qr(e),_=r||s?[...d?Yt(d):[],...Yt(t)]:[];_.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const g=d&&l?fg(d,n):null;let f=-1,u=null;i&&(u=new ResizeObserver(y=>{let[w]=y;w&&w.target===d&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=u)==null||C.observe(t)})),n()}),d&&!c&&u.observe(d),u.observe(t));let p,h=c?dn(e):null;c&&m();function m(){const y=dn(e);h&&!Ea(h,y)&&n(),h=y,p=requestAnimationFrame(m)}return n(),()=>{var y;_.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),g?.(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(p)}}const _g=K_,gg=X_,hg=U_,pg=Y_,Ia=R_,mg=(e,t,n)=>{const o=new Map,r={platform:ug,...n},s={...r.platform,_c:o};return H_(e,t,{...r,platform:s})};var vg=typeof document<"u",bg=function(){},Fo=vg?v.useLayoutEffect:bg;function Po(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Po(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Po(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Na(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ma(e,t){const n=Na(e);return Math.round(t*n)/n}function ts(e){const t=N.useRef(e);return Fo(()=>{t.current=e}),t}function wg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[_,g]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,u]=N.useState(o);Po(f,o)||u(o);const[p,h]=N.useState(null),[m,y]=N.useState(null),w=N.useCallback(x=>{x!==T.current&&(T.current=x,h(x))},[]),C=N.useCallback(x=>{x!==M.current&&(M.current=x,y(x))},[]),k=s||p,A=i||m,T=N.useRef(null),M=N.useRef(null),P=N.useRef(_),L=c!=null,E=ts(c),B=ts(r),V=ts(d),$=N.useCallback(()=>{if(!T.current||!M.current)return;const x={placement:t,strategy:n,middleware:f};B.current&&(x.platform=B.current),mg(T.current,M.current,x).then(I=>{const F={...I,isPositioned:V.current!==!1};b.current&&!Po(P.current,F)&&(P.current=F,dr.flushSync(()=>{g(F)}))})},[f,t,n,B,V]);Fo(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(x=>({...x,isPositioned:!1})))},[d]);const b=N.useRef(!1);Fo(()=>(b.current=!0,()=>{b.current=!1}),[]),Fo(()=>{if(k&&(T.current=k),A&&(M.current=A),k&&A){if(E.current)return E.current(k,A,$);$()}},[k,A,$,E,L]);const S=N.useMemo(()=>({reference:T,floating:M,setReference:w,setFloating:C}),[w,C]),O=N.useMemo(()=>({reference:k,floating:A}),[k,A]),D=N.useMemo(()=>{const x={position:n,left:0,top:0};if(!O.floating)return x;const I=Ma(O.floating,_.x),F=Ma(O.floating,_.y);return l?{...x,transform:"translate("+I+"px, "+F+"px)",...Na(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:F}},[n,l,O.floating,_.x,_.y]);return N.useMemo(()=>({..._,update:$,refs:S,elements:O,floatingStyles:D}),[_,$,S,O,D])}const yg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Ia({element:o.current,padding:r}).fn(n):{}:o?Ia({element:o,padding:r}).fn(n):{}}}},Lo=(e,t)=>({..._g(e),options:[e,t]}),Oo=(e,t)=>({...gg(e),options:[e,t]}),zo=(e,t)=>({...hg(e),options:[e,t]}),Aa=(e,t)=>({...pg(e),options:[e,t]}),Cg=(e,t)=>({...yg(e),options:[e,t]});function Da(e){const t=N.useRef(void 0),n=N.useCallback(o=>{const r=e.map(s=>{if(s!=null){if(typeof s=="function"){const i=s,l=i(o);return typeof l=="function"?l:()=>{i(null)}}return s.current=o,()=>{s.current=null}}});return()=>{r.forEach(s=>s?.())}},e);return N.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const xg="data-floating-ui-focusable",Ta="active",Fa="selected",Wn="ArrowLeft",Gn="ArrowRight",Pa="ArrowUp",Bo="ArrowDown",Sg={...N};let La=!1,$g=0;const Oa=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+$g++;function kg(){const[e,t]=N.useState(()=>La?Oa():void 0);return Le(()=>{e==null&&t(Oa())},[]),N.useEffect(()=>{La=!0},[]),e}const Kn=Sg.useId||kg;let Xn;process.env.NODE_ENV!=="production"&&(Xn=new Set);function Vo(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Xn)!=null&&e.has(r))){var s;(s=Xn)==null||s.add(r),console.warn(r)}}function Eg(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Xn)!=null&&e.has(r))){var s;(s=Xn)==null||s.add(r),console.error(r)}}const Ig=N.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:s,shift:i}},width:l=14,height:c=7,tipRadius:d=0,strokeWidth:_=0,staticOffset:g,stroke:f,d:u,style:{transform:p,...h}={},...m}=t;process.env.NODE_ENV!=="production"&&(n||Vo("The `ref` prop is required for `FloatingArrow`."));const y=Kn(),[w,C]=N.useState(!1);if(Le(()=>{if(!r)return;xt(r).direction==="rtl"&&C(!0)},[r]),!r)return null;const[k,A]=o.split("-"),T=k==="top"||k==="bottom";let M=g;(T&&i!=null&&i.x||!T&&i!=null&&i.y)&&(M=null);const P=_*2,L=P/2,E=l/2*(d/-8+1),B=c/2*d/4,V=!!u,$=M&&A==="end"?"bottom":"top";let b=M&&A==="end"?"right":"left";M&&w&&(b=A==="end"?"left":"right");const S=s?.x!=null?M||s.x:"",O=s?.y!=null?M||s.y:"",D=u||"M0,0"+(" H"+l)+(" L"+(l-E)+","+(c-B))+(" Q"+l/2+","+c+" "+E+","+(c-B))+" Z",x={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[k];return a.jsxs("svg",{...m,"aria-hidden":!0,ref:n,width:V?l:l+P,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:O,[k]:T||V?"100%":"calc(100% - "+P/2+"px)",transform:[x,p].filter(I=>!!I).join(" "),...h},children:[P>0&&a.jsx("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:P+(u?0:1),d:D}),a.jsx("path",{stroke:P&&!u?m.fill:"none",d:D}),a.jsx("clipPath",{id:y,children:a.jsx("rect",{x:-L,y:L*(V?-1:1),width:l+P,height:l})})]})});function za(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const Ba=N.createContext(null),Va=N.createContext(null),Sn=()=>{var e;return((e=N.useContext(Ba))==null?void 0:e.id)||null},un=()=>N.useContext(Va);function ja(e){const t=Kn(),n=un(),r=Sn();return Le(()=>{if(!t)return;const s={id:t,parentId:r};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,r]),t}function qa(e){const{children:t,id:n}=e,o=Sn();return a.jsx(Ba.Provider,{value:N.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Ng(e){const{children:t}=e,n=N.useRef([]),o=N.useCallback(i=>{n.current=[...n.current,i]},[]),r=N.useCallback(i=>{n.current=n.current.filter(l=>l!==i)},[]),[s]=N.useState(()=>za());return a.jsx(Va.Provider,{value:N.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:s}),[o,r,s]),children:t})}function fn(e){return"data-floating-ui-"+e}function ct(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Ha=fn("safe-polygon");function ns(e,t,n){if(n&&!qn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function os(e){return typeof e=="function"?e():e}function rs(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:s,elements:i}=e,{enabled:l=!0,delay:c=0,handleClose:d=null,mouseOnly:_=!1,restMs:g=0,move:f=!0}=t,u=un(),p=Sn(),h=et(d),m=et(c),y=et(n),w=et(g),C=N.useRef(),k=N.useRef(-1),A=N.useRef(),T=N.useRef(-1),M=N.useRef(!0),P=N.useRef(!1),L=N.useRef(()=>{}),E=N.useRef(!1),B=Ye(()=>{var D;const x=(D=r.current.openEvent)==null?void 0:D.type;return x?.includes("mouse")&&x!=="mousedown"});N.useEffect(()=>{if(!l)return;function D(x){let{open:I}=x;I||(ct(k),ct(T),M.current=!0,E.current=!1)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[l,s]),N.useEffect(()=>{if(!l||!h.current||!n)return;function D(I){B()&&o(!1,I,"hover")}const x=at(i.floating).documentElement;return x.addEventListener("mouseleave",D),()=>{x.removeEventListener("mouseleave",D)}},[i.floating,n,o,l,h,B]);const V=N.useCallback(function(D,x,I){x===void 0&&(x=!0),I===void 0&&(I="hover");const F=ns(m.current,"close",C.current);F&&!A.current?(ct(k),k.current=window.setTimeout(()=>o(!1,D,I),F)):x&&(ct(k),o(!1,D,I))},[m,o]),$=Ye(()=>{L.current(),A.current=void 0}),b=Ye(()=>{if(P.current){const D=at(i.floating).body;D.style.pointerEvents="",D.removeAttribute(Ha),P.current=!1}}),S=Ye(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);N.useEffect(()=>{if(!l)return;function D(z){if(ct(k),M.current=!1,_&&!qn(C.current)||os(w.current)>0&&!ns(m.current,"open"))return;const H=ns(m.current,"open",C.current);H?k.current=window.setTimeout(()=>{y.current||o(!0,z,"hover")},H):n||o(!0,z,"hover")}function x(z){if(S()){b();return}L.current();const H=at(i.floating);if(ct(T),E.current=!1,h.current&&r.current.floatingContext){n||ct(k),A.current=h.current({...r.current.floatingContext,tree:u,x:z.clientX,y:z.clientY,onClose(){b(),$(),S()||V(z,!0,"safe-polygon")}});const G=A.current;H.addEventListener("mousemove",G),L.current=()=>{H.removeEventListener("mousemove",G)};return}(C.current==="touch"?!it(i.floating,z.relatedTarget):!0)&&V(z)}function I(z){S()||r.current.floatingContext&&(h.current==null||h.current({...r.current.floatingContext,tree:u,x:z.clientX,y:z.clientY,onClose(){b(),$(),S()||V(z)}})(z))}function F(){ct(k)}function j(z){S()||V(z,!1)}if(Pe(i.domReference)){const z=i.domReference,H=i.floating;return n&&z.addEventListener("mouseleave",I),f&&z.addEventListener("mousemove",D,{once:!0}),z.addEventListener("mouseenter",D),z.addEventListener("mouseleave",x),H&&(H.addEventListener("mouseleave",I),H.addEventListener("mouseenter",F),H.addEventListener("mouseleave",j)),()=>{n&&z.removeEventListener("mouseleave",I),f&&z.removeEventListener("mousemove",D),z.removeEventListener("mouseenter",D),z.removeEventListener("mouseleave",x),H&&(H.removeEventListener("mouseleave",I),H.removeEventListener("mouseenter",F),H.removeEventListener("mouseleave",j))}}},[i,l,e,_,f,V,$,b,o,n,y,u,m,h,r,S,w]),Le(()=>{var D;if(l&&n&&(D=h.current)!=null&&(D=D.__options)!=null&&D.blockPointerEvents&&B()){P.current=!0;const I=i.floating;if(Pe(i.domReference)&&I){var x;const F=at(i.floating).body;F.setAttribute(Ha,"");const j=i.domReference,z=u==null||(x=u.nodesRef.current.find(H=>H.id===p))==null||(x=x.context)==null?void 0:x.elements.floating;return z&&(z.style.pointerEvents=""),F.style.pointerEvents="none",j.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{F.style.pointerEvents="",j.style.pointerEvents="",I.style.pointerEvents=""}}}},[l,n,p,i,u,h,B]),Le(()=>{n||(C.current=void 0,E.current=!1,$(),b())},[n,$,b]),N.useEffect(()=>()=>{$(),ct(k),ct(T),b()},[l,i.domReference,$,b]);const O=N.useMemo(()=>{function D(x){C.current=x.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(x){const{nativeEvent:I}=x;function F(){!M.current&&!y.current&&o(!0,I,"hover")}_&&!qn(C.current)||n||os(w.current)===0||E.current&&x.movementX**2+x.movementY**2<2||(ct(T),C.current==="touch"?F():(E.current=!0,T.current=window.setTimeout(F,os(w.current))))}}},[_,o,n,y,w]);return N.useMemo(()=>l?{reference:O}:{},[l,O])}let Ra=0;function _n(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Ra);const s=()=>e?.focus({preventScroll:n});r?s():Ra=requestAnimationFrame(s)}function ss(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&vo(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Mg(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ag(e){return e?.ownerDocument||document}const $n={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Ua(e){return e==="inert"?$n.inert:e==="aria-hidden"?$n["aria-hidden"]:$n.none}let jo=new WeakSet,qo={},is=0;const Dg=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Wa=e=>e&&(e.host||Wa(e.parentNode)),Tg=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Wa(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Fg(e,t,n,o){const r="data-floating-ui-inert",s=o?"inert":n?"aria-hidden":null,i=Tg(t,e),l=new Set,c=new Set(i),d=[];qo[r]||(qo[r]=new WeakMap);const _=qo[r];i.forEach(g),f(t),l.clear();function g(u){!u||l.has(u)||(l.add(u),u.parentNode&&g(u.parentNode))}function f(u){!u||c.has(u)||[].forEach.call(u.children,p=>{if(Xt(p)!=="script")if(l.has(p))f(p);else{const h=s?p.getAttribute(s):null,m=h!==null&&h!=="false",y=Ua(s),w=(y.get(p)||0)+1,C=(_.get(p)||0)+1;y.set(p,w),_.set(p,C),d.push(p),w===1&&m&&jo.add(p),C===1&&p.setAttribute(r,""),!m&&s&&p.setAttribute(s,s==="inert"?"":"true")}})}return is++,()=>{d.forEach(u=>{const p=Ua(s),m=(p.get(u)||0)-1,y=(_.get(u)||0)-1;p.set(u,m),_.set(u,y),m||(!jo.has(u)&&s&&u.removeAttribute(s),jo.delete(u)),y||u.removeAttribute(r)}),is--,is||($n.inert=new WeakMap,$n["aria-hidden"]=new WeakMap,$n.none=new WeakMap,jo=new WeakSet,qo={})}}function Ga(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ag(e[0]).body;return Fg(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const Ho={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},Ro=N.forwardRef(function(t,n){const[o,r]=N.useState();Le(()=>{aa()&&r("button")},[]);const s={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[fn("focus-guard")]:"",style:Ho};return a.jsx("span",{...t,...s})}),Ka=N.createContext(null),Xa=fn("portal");function Pg(e){e===void 0&&(e={});const{id:t,root:n}=e,o=Kn(),r=Ya(),[s,i]=N.useState(null),l=N.useRef(null);return Le(()=>()=>{s?.remove(),queueMicrotask(()=>{l.current=null})},[s]),Le(()=>{if(!o||l.current)return;const c=t?document.getElementById(t):null;if(!c)return;const d=document.createElement("div");d.id=o,d.setAttribute(Xa,""),c.appendChild(d),l.current=d,i(d)},[t,o]),Le(()=>{if(n===null||!o||l.current)return;let c=n||r?.portalNode;c&&!Lr(c)&&(c=c.current),c=c||document.body;let d=null;t&&(d=document.createElement("div"),d.id=t,c.appendChild(d));const _=document.createElement("div");_.id=o,_.setAttribute(Xa,""),c=d||c,c.appendChild(_),l.current=_,i(_)},[t,n,o,r]),s}function Uo(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,s=Pg({id:n,root:o}),[i,l]=N.useState(null),c=N.useRef(null),d=N.useRef(null),_=N.useRef(null),g=N.useRef(null),f=i?.modal,u=i?.open,p=!!i&&!i.modal&&i.open&&r&&!!(o||s);return N.useEffect(()=>{if(!s||!r||f)return;function h(m){s&&Un(m)&&(m.type==="focusin"?ma:q_)(s)}return s.addEventListener("focusin",h,!0),s.addEventListener("focusout",h,!0),()=>{s.removeEventListener("focusin",h,!0),s.removeEventListener("focusout",h,!0)}},[s,r,f]),N.useEffect(()=>{s&&(u||ma(s))},[u,s]),a.jsxs(Ka.Provider,{value:N.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:_,afterInsideRef:g,portalNode:s,setFocusManagerState:l}),[r,s]),children:[p&&s&&a.jsx(Ro,{"data-type":"outside",ref:c,onFocus:h=>{if(Un(h,s)){var m;(m=_.current)==null||m.focus()}else{const y=i?i.domReference:null,w=pa(y);w?.focus()}}}),p&&s&&a.jsx("span",{"aria-owns":s.id,style:Ho}),s&&dr.createPortal(t,s),p&&s&&a.jsx(Ro,{"data-type":"outside",ref:d,onFocus:h=>{if(Un(h,s)){var m;(m=g.current)==null||m.focus()}else{const y=i?i.domReference:null,w=ha(y);w?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,h.nativeEvent,"focus-out")}}})]})}const Ya=()=>N.useContext(Ka);function Za(e){return N.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Lg=20;let Qt=[];function as(){Qt=Qt.filter(e=>e.isConnected)}function Og(e){as(),e&&Xt(e)!=="body"&&(Qt.push(e),Qt.length>Lg&&(Qt=Qt.slice(-20)))}function Ja(){return as(),Qt[Qt.length-1]}function zg(e){const t=Rn();return ra(e,t)?e:Io(e,t)[0]||e}function Qa(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=Rn(),s=$_(e,o).filter(l=>{const c=l.getAttribute("data-tabindex")||"";return ra(l,o)||l.hasAttribute("data-tabindex")&&!c.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Bg=N.forwardRef(function(t,n){return a.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Ho})});function ls(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:s=!0,initialFocus:i=0,returnFocus:l=!0,restoreFocus:c=!1,modal:d=!0,visuallyHiddenDismiss:_=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:u=()=>[]}=e,{open:p,onOpenChange:h,events:m,dataRef:y,elements:{domReference:w,floating:C}}=t,k=Ye(()=>{var J;return(J=y.current.floatingContext)==null?void 0:J.nodeId}),A=Ye(u),T=typeof i=="number"&&i<0,M=Yr(w)&&T,P=Dg(),L=P?s:!0,E=!L||P&&f,B=et(r),V=et(i),$=et(l),b=un(),S=Ya(),O=N.useRef(null),D=N.useRef(null),x=N.useRef(!1),I=N.useRef(!1),F=N.useRef(-1),j=N.useRef(-1),z=S!=null,H=No(C),X=Ye(function(J){return J===void 0&&(J=H),J?Io(J,Rn()):[]}),G=Ye(J=>{const re=X(J);return B.current.map(Y=>w&&Y==="reference"?w:H&&Y==="floating"?H:re).filter(Boolean).flat()});N.useEffect(()=>{if(o||!d)return;function J(Y){if(Y.key==="Tab"){it(H,Tt(at(H)))&&X().length===0&&!M&<(Y);const ye=G(),ce=jt(Y);B.current[0]==="reference"&&ce===w&&(lt(Y),Y.shiftKey?_n(ye[ye.length-1]):_n(ye[1])),B.current[1]==="floating"&&ce===H&&Y.shiftKey&&(lt(Y),_n(ye[0]))}}const re=at(H);return re.addEventListener("keydown",J),()=>{re.removeEventListener("keydown",J)}},[o,w,H,d,B,M,X,G]),N.useEffect(()=>{if(o||!C)return;function J(re){const Y=jt(re),ce=X().indexOf(Y);ce!==-1&&(F.current=ce)}return C.addEventListener("focusin",J),()=>{C.removeEventListener("focusin",J)}},[o,C,X]),N.useEffect(()=>{if(o||!g)return;function J(){I.current=!0,setTimeout(()=>{I.current=!1})}function re(ce){const ee=ce.relatedTarget,ne=ce.currentTarget,xe=jt(ce);queueMicrotask(()=>{const de=k(),Se=!(it(w,ee)||it(C,ee)||it(ee,C)||it(S?.portalNode,ee)||ee!=null&&ee.hasAttribute(fn("focus-guard"))||b&&(cn(b.nodesRef.current,de).find(U=>{var q,R;return it((q=U.context)==null?void 0:q.elements.floating,ee)||it((R=U.context)==null?void 0:R.elements.domReference,ee)})||da(b.nodesRef.current,de).find(U=>{var q,R,fe;return[(q=U.context)==null?void 0:q.elements.floating,No((R=U.context)==null?void 0:R.elements.floating)].includes(ee)||((fe=U.context)==null?void 0:fe.elements.domReference)===ee})));if(ne===w&&H&&Qa(H,B),c&&ne!==w&&!(xe!=null&&xe.isConnected)&&Tt(at(H))===at(H).body){Xe(H)&&H.focus();const U=F.current,q=X(),R=q[U]||q[q.length-1]||H;Xe(R)&&R.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(M||!d)&&ee&&Se&&!I.current&&ee!==Ja()&&(x.current=!0,h(!1,ce,"focus-out"))})}const Y=!!(!b&&S);function ye(){ct(j),y.current.insideReactTree=!0,j.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(C&&Xe(w))return w.addEventListener("focusout",re),w.addEventListener("pointerdown",J),C.addEventListener("focusout",re),Y&&C.addEventListener("focusout",ye,!0),()=>{w.removeEventListener("focusout",re),w.removeEventListener("pointerdown",J),C.removeEventListener("focusout",re),Y&&C.removeEventListener("focusout",ye,!0)}},[o,w,C,H,d,b,S,h,g,c,X,M,k,B,y]);const ue=N.useRef(null),oe=N.useRef(null),ie=Za([ue,S?.beforeInsideRef]),_e=Za([oe,S?.afterInsideRef]);N.useEffect(()=>{var J,re;if(o||!C)return;const Y=Array.from((S==null||(J=S.portalNode)==null?void 0:J.querySelectorAll("["+fn("portal")+"]"))||[]),ce=(re=(b?da(b.nodesRef.current,k()):[]).find(xe=>{var de;return Yr(((de=xe.context)==null?void 0:de.elements.domReference)||null)}))==null||(re=re.context)==null?void 0:re.elements.domReference,ee=[C,ce,...Y,...A(),O.current,D.current,ue.current,oe.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,B.current.includes("reference")||M?w:null].filter(xe=>xe!=null),ne=d||M?Ga(ee,!E,E):Ga(ee);return()=>{ne()}},[o,w,C,d,B,S,M,L,E,b,k,A]),Le(()=>{if(o||!Xe(H))return;const J=at(H),re=Tt(J);queueMicrotask(()=>{const Y=G(H),ye=V.current,ce=(typeof ye=="number"?Y[ye]:ye.current)||H,ee=it(H,re);!T&&!ee&&p&&_n(ce,{preventScroll:ce===H})})},[o,p,H,T,G,V]),Le(()=>{if(o||!H)return;const J=at(H),re=Tt(J);Og(re);function Y(ee){let{reason:ne,event:xe,nested:de}=ee;if(["hover","safe-polygon"].includes(ne)&&xe.type==="mouseleave"&&(x.current=!0),ne==="outside-press")if(de)x.current=!1;else if(ua(xe)||fa(xe))x.current=!1;else{let Se=!1;document.createElement("div").focus({get preventScroll(){return Se=!0,!1}}),Se?x.current=!1:x.current=!0}}m.on("openchange",Y);const ye=J.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,Ho),z&&w&&w.insertAdjacentElement("afterend",ye);function ce(){if(typeof $.current=="boolean"){const ee=w||Ja();return ee&&ee.isConnected?ee:ye}return $.current.current||ye}return()=>{m.off("openchange",Y);const ee=Tt(J),ne=it(C,ee)||b&&cn(b.nodesRef.current,k(),!1).some(de=>{var Se;return it((Se=de.context)==null?void 0:Se.elements.floating,ee)}),xe=ce();queueMicrotask(()=>{const de=zg(xe);$.current&&!x.current&&Xe(de)&&(!(de!==ee&&ee!==J.body)||ne)&&de.focus({preventScroll:!0}),ye.remove()})}},[o,C,H,$,y,m,b,z,w,k]),N.useEffect(()=>(queueMicrotask(()=>{x.current=!1}),()=>{queueMicrotask(as)}),[o]),Le(()=>{if(!o&&S)return S.setFocusManagerState({modal:d,closeOnFocusOut:g,open:p,onOpenChange:h,domReference:w}),()=>{S.setFocusManagerState(null)}},[o,S,d,p,h,g,w]),Le(()=>{o||H&&Qa(H,B)},[o,H,B]);function ge(J){return o||!_||!d?null:a.jsx(Bg,{ref:J==="start"?O:D,onClick:re=>h(!1,re.nativeEvent),children:typeof _=="string"?_:"Dismiss"})}const ke=!o&&L&&(d?!M:!0)&&(z||d);return a.jsxs(a.Fragment,{children:[ke&&a.jsx(Ro,{"data-type":"inside",ref:ie,onFocus:J=>{if(d){const Y=G();_n(r[0]==="reference"?Y[0]:Y[Y.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(x.current=!1,Un(J,S.portalNode)){const Y=ha(w);Y?.focus()}else{var re;(re=S.beforeOutsideRef.current)==null||re.focus()}}}),!M&&ge("start"),n,ge("end"),ke&&a.jsx(Ro,{"data-type":"inside",ref:_e,onFocus:J=>{if(d)_n(G()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(x.current=!0),Un(J,S.portalNode)){const Y=pa(w);Y?.focus()}else{var re;(re=S.afterOutsideRef.current)==null||re.focus()}}})]})}function el(e){return Xe(e.target)&&e.target.tagName==="BUTTON"}function Vg(e){return Xe(e.target)&&e.target.tagName==="A"}function tl(e){return Xr(e)}function nl(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:s}}=e,{enabled:i=!0,event:l="click",toggle:c=!0,ignoreMouse:d=!1,keyboardHandlers:_=!0,stickIfOpen:g=!0}=t,f=N.useRef(),u=N.useRef(!1),p=N.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const m=f.current;h.button===0&&l!=="click"&&(qn(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,h.nativeEvent,"click"):(h.preventDefault(),o(!0,h.nativeEvent,"click"))))},onClick(h){const m=f.current;if(l==="mousedown"&&f.current){f.current=void 0;return}qn(m,!0)&&d||(n&&c&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,h.nativeEvent,"click"):o(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!_||el(h))&&(h.key===" "&&!tl(s)&&(h.preventDefault(),u.current=!0),!Vg(h)&&h.key==="Enter"&&o(!(n&&c),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!_||el(h)||tl(s)||h.key===" "&&u.current&&(u.current=!1,o(!(n&&c),h.nativeEvent,"click"))}}),[r,s,l,d,_,o,n,g,c]);return N.useMemo(()=>i?{reference:p}:{},[i,p])}const jg={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qg={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ol=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function Wo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:s}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:d="pointerdown",referencePress:_=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:u,capture:p}=t,h=un(),m=Ye(typeof c=="function"?c:()=>!1),y=typeof c=="function"?m:c,w=N.useRef(!1),{escapeKey:C,outsidePress:k}=ol(u),{escapeKey:A,outsidePress:T}=ol(p),M=N.useRef(!1),P=Ye(b=>{var S;if(!n||!i||!l||b.key!=="Escape"||M.current)return;const O=(S=s.current.floatingContext)==null?void 0:S.nodeId,D=h?cn(h.nodesRef.current,O):[];if(!C&&(b.stopPropagation(),D.length>0)){let x=!0;if(D.forEach(I=>{var F;if((F=I.context)!=null&&F.open&&!I.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}o(!1,T_(b)?b.nativeEvent:b,"escape-key")}),L=Ye(b=>{var S;const O=()=>{var D;P(b),(D=jt(b))==null||D.removeEventListener("keydown",O)};(S=jt(b))==null||S.addEventListener("keydown",O)}),E=Ye(b=>{var S;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const D=w.current;if(w.current=!1,d==="click"&&D||O||typeof y=="function"&&!y(b))return;const x=jt(b),I="["+fn("inert")+"]",F=at(r.floating).querySelectorAll(I);let j=Pe(x)?x:null;for(;j&&!zt(j);){const G=Bt(j);if(zt(G)||!Pe(G))break;j=G}if(F.length&&Pe(x)&&!M_(x)&&!it(x,r.floating)&&Array.from(F).every(G=>!it(j,G)))return;if(Xe(x)&&$){const G=zt(x),ue=xt(x),oe=/auto|scroll/,ie=G||oe.test(ue.overflowX),_e=G||oe.test(ue.overflowY),ge=ie&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,ke=_e&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,J=ue.direction==="rtl",re=ke&&(J?b.offsetX<=x.offsetWidth-x.clientWidth:b.offsetX>x.clientWidth),Y=ge&&b.offsetY>x.clientHeight;if(re||Y)return}const z=(S=s.current.floatingContext)==null?void 0:S.nodeId,H=h&&cn(h.nodesRef.current,z).some(G=>{var ue;return Kr(b,(ue=G.context)==null?void 0:ue.elements.floating)});if(Kr(b,r.floating)||Kr(b,r.domReference)||H)return;const X=h?cn(h.nodesRef.current,z):[];if(X.length>0){let G=!0;if(X.forEach(ue=>{var oe;if((oe=ue.context)!=null&&oe.open&&!ue.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,b,"outside-press")}),B=Ye(b=>{var S;const O=()=>{var D;E(b),(D=jt(b))==null||D.removeEventListener(d,O)};(S=jt(b))==null||S.addEventListener(d,O)});N.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=C,s.current.__outsidePressBubbles=k;let b=-1;function S(F){o(!1,F,"ancestor-scroll")}function O(){window.clearTimeout(b),M.current=!0}function D(){b=window.setTimeout(()=>{M.current=!1},wo()?5:0)}const x=at(r.floating);l&&(x.addEventListener("keydown",A?L:P,A),x.addEventListener("compositionstart",O),x.addEventListener("compositionend",D)),y&&x.addEventListener(d,T?B:E,T);let I=[];return f&&(Pe(r.domReference)&&(I=Yt(r.domReference)),Pe(r.floating)&&(I=I.concat(Yt(r.floating))),!Pe(r.reference)&&r.reference&&r.reference.contextElement&&(I=I.concat(Yt(r.reference.contextElement)))),I=I.filter(F=>{var j;return F!==((j=x.defaultView)==null?void 0:j.visualViewport)}),I.forEach(F=>{F.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(x.removeEventListener("keydown",A?L:P,A),x.removeEventListener("compositionstart",O),x.removeEventListener("compositionend",D)),y&&x.removeEventListener(d,T?B:E,T),I.forEach(F=>{F.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[s,r,l,y,d,n,o,f,i,C,k,P,A,L,E,T,B]),N.useEffect(()=>{s.current.insideReactTree=!1},[s,y,d]);const V=N.useMemo(()=>({onKeyDown:P,..._&&{[jg[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,_,g]),$=N.useMemo(()=>({onKeyDown:P,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[qg[d]]:()=>{s.current.insideReactTree=!0}}),[P,d,s]);return N.useMemo(()=>i?{reference:V,floating:$}:{},[i,V,$])}function Hg(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Kn(),s=N.useRef({}),[i]=N.useState(()=>za()),l=Sn()!=null;if(process.env.NODE_ENV!=="production"){const u=o.reference;u&&!Pe(u)&&Eg("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,d]=N.useState(o.reference),_=Ye((u,p,h)=>{s.current.openEvent=u?p:void 0,i.emit("openchange",{open:u,event:p,reason:h,nested:l}),n?.(u,p,h)}),g=N.useMemo(()=>({setPositionReference:d}),[]),f=N.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return N.useMemo(()=>({dataRef:s,open:t,onOpenChange:_,elements:f,events:i,floatingId:r,refs:g}),[t,_,f,i,r,g])}function Go(e){e===void 0&&(e={});const{nodeId:t}=e,n=Hg({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[s,i]=N.useState(null),[l,c]=N.useState(null),_=r?.domReference||s,g=N.useRef(null),f=un();Le(()=>{_&&(g.current=_)},[_]);const u=wg({...e,elements:{...r,...l&&{reference:l}}}),p=N.useCallback(C=>{const k=Pe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;c(k),u.refs.setReference(k)},[u.refs]),h=N.useCallback(C=>{(Pe(C)||C===null)&&(g.current=C,i(C)),(Pe(u.refs.reference.current)||u.refs.reference.current===null||C!==null&&!Pe(C))&&u.refs.setReference(C)},[u.refs]),m=N.useMemo(()=>({...u.refs,setReference:h,setPositionReference:p,domReference:g}),[u.refs,h,p]),y=N.useMemo(()=>({...u.elements,domReference:_}),[u.elements,_]),w=N.useMemo(()=>({...u,...o,refs:m,elements:y,nodeId:t}),[u,m,y,t,o]);return Le(()=>{o.dataRef.current.floatingContext=w;const C=f?.nodesRef.current.find(k=>k.id===t);C&&(C.context=w)}),N.useMemo(()=>({...u,context:w,refs:m,elements:y}),[u,m,y,w])}function cs(){return k_()&&aa()}function Rg(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:s,elements:i}=e,{enabled:l=!0,visibleOnly:c=!0}=t,d=N.useRef(!1),_=N.useRef(-1),g=N.useRef(!0);N.useEffect(()=>{if(!l)return;const u=bt(i.domReference);function p(){!n&&Xe(i.domReference)&&i.domReference===Tt(at(i.domReference))&&(d.current=!0)}function h(){g.current=!0}function m(){g.current=!1}return u.addEventListener("blur",p),cs()&&(u.addEventListener("keydown",h,!0),u.addEventListener("pointerdown",m,!0)),()=>{u.removeEventListener("blur",p),cs()&&(u.removeEventListener("keydown",h,!0),u.removeEventListener("pointerdown",m,!0))}},[i.domReference,n,l]),N.useEffect(()=>{if(!l)return;function u(p){let{reason:h}=p;(h==="reference-press"||h==="escape-key")&&(d.current=!0)}return r.on("openchange",u),()=>{r.off("openchange",u)}},[r,l]),N.useEffect(()=>()=>{ct(_)},[]);const f=N.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(u){if(d.current)return;const p=jt(u.nativeEvent);if(c&&Pe(p)){if(cs()&&!u.relatedTarget){if(!g.current&&!Xr(p))return}else if(!A_(p))return}o(!0,u.nativeEvent,"focus")},onBlur(u){d.current=!1;const p=u.relatedTarget,h=u.nativeEvent,m=Pe(p)&&p.hasAttribute(fn("focus-guard"))&&p.getAttribute("data-type")==="outside";_.current=window.setTimeout(()=>{var y;const w=Tt(i.domReference?i.domReference.ownerDocument:document);!p&&w===i.domReference||it((y=s.current.floatingContext)==null?void 0:y.refs.floating.current,w)||it(i.domReference,w)||m||o(!1,h,"focus")})}}),[s,i.domReference,o,c]);return N.useMemo(()=>l?{reference:f}:{},[l,f])}function ds(e,t,n){const o=new Map,r=n==="item";let s=e;if(r&&e){const{[Ta]:i,[Fa]:l,...c}=e;s=c}return{...n==="floating"&&{tabIndex:-1,[xg]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(c=>{let[d,_]=c;if(!(r&&[Ta,Fa].includes(d)))if(d.indexOf("on")===0){if(o.has(d)||o.set(d,[]),typeof _=="function"){var g;(g=o.get(d))==null||g.push(_),i[d]=function(){for(var f,u=arguments.length,p=new Array(u),h=0;h<u;h++)p[h]=arguments[h];return(f=o.get(d))==null?void 0:f.map(m=>m(...p)).find(m=>m!==void 0)}}}else i[d]=_}),i),{})}}function Ko(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=N.useCallback(l=>ds(l,e,"reference"),t),s=N.useCallback(l=>ds(l,e,"floating"),n),i=N.useCallback(l=>ds(l,e,"item"),o);return N.useMemo(()=>({getReferenceProps:r,getFloatingProps:s,getItemProps:i}),[r,s,i])}const Ug="Escape";function Xo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Yo(e,t){return Xo(t,e===Pa||e===Bo,e===Wn||e===Gn)}function us(e,t,n){return Xo(t,e===Bo,n?e===Wn:e===Gn)||e==="Enter"||e===" "||e===""}function rl(e,t,n){return Xo(t,n?e===Wn:e===Gn,e===Bo)}function sl(e,t,n,o){const r=n?e===Gn:e===Wn,s=e===Pa;return t==="both"||t==="horizontal"&&o&&o>1?e===Ug:Xo(t,r,s)}function fs(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:s}=e,{listRef:i,activeIndex:l,onNavigate:c=()=>{},enabled:d=!0,selectedIndex:_=null,allowEscape:g=!1,loop:f=!1,nested:u=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:m="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:k="vertical",parentOrientation:A,cols:T=1,scrollItemIntoView:M=!0,virtualItemRef:P,itemSizes:L,dense:E=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||Vo("`useListNavigation` looping must be enabled to allow escaping."),h||Vo("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&T>1&&Vo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const B=No(r.floating),V=et(B),$=Sn(),b=un();Le(()=>{e.dataRef.current.orientation=k},[e,k]);const S=Ye(()=>{c(x.current===-1?null:x.current)}),O=Yr(r.domReference),D=N.useRef(m),x=N.useRef(_??-1),I=N.useRef(null),F=N.useRef(!0),j=N.useRef(S),z=N.useRef(!!r.floating),H=N.useRef(n),X=N.useRef(!1),G=N.useRef(!1),ue=et(C),oe=et(n),ie=et(M),_e=et(_),[ge,ke]=N.useState(),[J,re]=N.useState(),Y=Ye(()=>{function U(he){if(h){var pe;(pe=he.id)!=null&&pe.endsWith("-fui-option")&&(he.id=s+"-"+Math.random().toString(16).slice(2,10)),ke(he.id),b?.events.emit("virtualfocus",he),P&&(P.current=he)}else _n(he,{sync:X.current,preventScroll:!0})}const q=i.current[x.current],R=G.current;q&&U(q),(X.current?he=>he():requestAnimationFrame)(()=>{const he=i.current[x.current]||q;if(!he)return;q||U(he);const pe=ie.current;pe&&ce&&(R||!F.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof pe=="boolean"?{block:"nearest",inline:"nearest"}:pe))})});Le(()=>{d&&(n&&r.floating?D.current&&_!=null&&(G.current=!0,x.current=_,S()):z.current&&(x.current=-1,j.current()))},[d,n,r.floating,_,S]),Le(()=>{if(d&&n&&r.floating)if(l==null){if(X.current=!1,_e.current!=null)return;if(z.current&&(x.current=-1,Y()),(!H.current||!z.current)&&D.current&&(I.current!=null||D.current===!0&&I.current==null)){let U=0;const q=()=>{i.current[0]==null?(U<2&&(U?requestAnimationFrame:queueMicrotask)(q),U++):(x.current=I.current==null||us(I.current,k,p)||u?Zr(i,ue.current):_a(i,ue.current),I.current=null,S())};q()}}else Hn(i,l)||(x.current=l,Y(),G.current=!1)},[d,n,r.floating,l,_e,u,i,k,p,S,Y,ue]),Le(()=>{var U;if(!d||r.floating||!b||h||!z.current)return;const q=b.nodesRef.current,R=(U=q.find(pe=>pe.id===$))==null||(U=U.context)==null?void 0:U.elements.floating,fe=Tt(at(r.floating)),he=q.some(pe=>pe.context&&it(pe.context.elements.floating,fe));R&&!he&&F.current&&R.focus({preventScroll:!0})},[d,r.floating,b,$,h]),Le(()=>{if(!d||!b||!h||$)return;function U(q){re(q.id),P&&(P.current=q)}return b.events.on("virtualfocus",U),()=>{b.events.off("virtualfocus",U)}},[d,b,h,$,P]),Le(()=>{j.current=S,H.current=n,z.current=!!r.floating}),Le(()=>{n||(I.current=null,D.current=m)},[n,m]);const ye=l!=null,ce=N.useMemo(()=>{function U(R){if(!oe.current)return;const fe=i.current.indexOf(R);fe!==-1&&x.current!==fe&&(x.current=fe,S())}return{onFocus(R){let{currentTarget:fe}=R;X.current=!0,U(fe)},onClick:R=>{let{currentTarget:fe}=R;return fe.focus({preventScroll:!0})},onMouseMove(R){let{currentTarget:fe}=R;X.current=!0,G.current=!1,y&&U(fe)},onPointerLeave(R){let{pointerType:fe}=R;if(!(!F.current||fe==="touch")&&(X.current=!0,!!y&&(x.current=-1,S(),!h))){var he;(he=V.current)==null||he.focus({preventScroll:!0})}}}},[oe,V,y,i,S,h]),ee=N.useCallback(()=>{var U;return A??(b==null||(U=b.nodesRef.current.find(q=>q.id===$))==null||(U=U.context)==null||(U=U.dataRef)==null?void 0:U.current.orientation)},[$,b,A]),ne=Ye(U=>{if(F.current=!1,X.current=!0,U.which===229||!oe.current&&U.currentTarget===V.current)return;if(u&&sl(U.key,k,p,T)){Yo(U.key,ee())||lt(U),o(!1,U.nativeEvent,"list-navigation"),Xe(r.domReference)&&(h?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const q=x.current,R=Zr(i,C),fe=_a(i,C);if(O||(U.key==="Home"&&(lt(U),x.current=R,S()),U.key==="End"&&(lt(U),x.current=fe,S())),T>1){const he=L||Array.from({length:i.current.length},()=>({width:1,height:1})),pe=B_(he,T,E),Ue=pe.findIndex(ve=>ve!=null&&!Ao(i,ve,C)),Je=pe.reduce((ve,Ze,ot)=>Ze!=null&&!Ao(i,Ze,C)?ot:ve,-1),nt=pe[z_({current:pe.map(ve=>ve!=null?i.current[ve]:null)},{event:U,orientation:k,loop:f,rtl:p,cols:T,disabledIndices:j_([...(typeof C!="function"?C:null)||i.current.map((ve,Ze)=>Ao(i,Ze,C)?Ze:void 0),void 0],pe),minIndex:Ue,maxIndex:Je,prevIndex:V_(x.current>fe?R:x.current,he,pe,T,U.key===Bo?"bl":U.key===(p?Wn:Gn)?"tr":"tl"),stopEvent:!0})];if(nt!=null&&(x.current=nt,S()),k==="both")return}if(Yo(U.key,k)){if(lt(U),n&&!h&&Tt(U.currentTarget.ownerDocument)===U.currentTarget){x.current=us(U.key,k,p)?R:fe,S();return}us(U.key,k,p)?f?x.current=q>=fe?g&&q!==i.current.length?-1:R:ut(i,{startingIndex:q,disabledIndices:C}):x.current=Math.min(fe,ut(i,{startingIndex:q,disabledIndices:C})):f?x.current=q<=R?g&&q!==-1?i.current.length:fe:ut(i,{startingIndex:q,decrement:!0,disabledIndices:C}):x.current=Math.max(R,ut(i,{startingIndex:q,decrement:!0,disabledIndices:C})),Hn(i,x.current)&&(x.current=-1),S()}}),xe=N.useMemo(()=>h&&n&&ye&&{"aria-activedescendant":J||ge},[h,n,ye,J,ge]),de=N.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...O?{}:xe,onKeyDown:ne,onPointerMove(){F.current=!0}}),[xe,ne,k,O]),Se=N.useMemo(()=>{function U(R){m==="auto"&&ua(R.nativeEvent)&&(D.current=!0)}function q(R){D.current=m,m==="auto"&&fa(R.nativeEvent)&&(D.current=!0)}return{...xe,onKeyDown(R){F.current=!1;const fe=R.key.startsWith("Arrow"),he=["Home","End"].includes(R.key),pe=fe||he,Ue=rl(R.key,k,p),Je=sl(R.key,k,p,T),nt=rl(R.key,ee(),p),ve=Yo(R.key,k),Ze=(u?nt:ve)||R.key==="Enter"||R.key.trim()==="";if(h&&n){const Re=b?.nodesRef.current.find(rt=>rt.parentId==null),Ae=b&&Re?D_(b.nodesRef.current,Re.id):null;if(pe&&Ae&&P){const rt=new KeyboardEvent("keydown",{key:R.key,bubbles:!0});if(Ue||Je){var ot,be;const te=((ot=Ae.context)==null?void 0:ot.elements.domReference)===R.currentTarget,Ee=Je&&!te?(be=Ae.context)==null?void 0:be.elements.domReference:Ue?i.current.find(ze=>ze?.id===ge):null;Ee&&(lt(R),Ee.dispatchEvent(rt),re(void 0))}if((ve||he)&&Ae.context&&Ae.context.open&&Ae.parentId&&R.currentTarget!==Ae.context.elements.domReference){var Ce;lt(R),(Ce=Ae.context.elements.domReference)==null||Ce.dispatchEvent(rt);return}}return ne(R)}if(!(!n&&!w&&fe)){if(Ze){const Re=Yo(R.key,ee());I.current=u&&Re?null:R.key}if(u){nt&&(lt(R),n?(x.current=Zr(i,ue.current),S()):o(!0,R.nativeEvent,"list-navigation"));return}ve&&(_!=null&&(x.current=_),lt(R),!n&&w?o(!0,R.nativeEvent,"list-navigation"):ne(R),n&&S())}},onFocus(){n&&!h&&(x.current=-1,S())},onPointerDown:q,onPointerEnter:q,onMouseDown:U,onClick:U}},[ge,xe,T,ne,ue,m,i,u,S,o,n,w,k,ee,p,_,b,h,P]);return N.useMemo(()=>d?{reference:Se,floating:de,item:ce}:{},[d,Se,de,ce])}const Wg=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Zo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:s,floatingId:i}=e,{enabled:l=!0,role:c="dialog"}=t,d=Kn(),_=((n=s.domReference)==null?void 0:n.id)||d,g=N.useMemo(()=>{var w;return((w=No(s.floating))==null?void 0:w.id)||i},[s.floating,i]),f=(o=Wg.get(c))!=null?o:c,p=Sn()!=null,h=N.useMemo(()=>f==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":r?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:_},...f==="menu"&&p&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[f,g,p,r,_,c]),m=N.useMemo(()=>{const w={id:g,...f&&{role:f}};return f==="tooltip"||c==="label"?w:{...w,...f==="menu"&&{"aria-labelledby":_}}},[f,g,_,c]),y=N.useCallback(w=>{let{active:C,selected:k}=w;const A={role:"option",...C&&{id:g+"-fui-option"}};switch(c){case"select":case"combobox":return{...A,"aria-selected":k}}return{}},[g,c]);return N.useMemo(()=>l?{reference:h,floating:m,item:y}:{},[l,h,m,y])}const il=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function kn(e,t){return typeof e=="function"?e(t):e}function Gg(e,t){const[n,o]=N.useState(e);return e&&!n&&o(!0),N.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function Kg(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,i=(typeof r=="number"?r:r.close)||0,[l,c]=N.useState("unmounted"),d=Gg(n,i);return!d&&l==="close"&&c("unmounted"),Le(()=>{if(o){if(n){c("initial");const _=requestAnimationFrame(()=>{dr.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(_)}}c("close")}},[n,o]),{isMounted:d,status:l}}function Jo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:s,duration:i=250}=t,l=e.placement,c=l.split("-")[0],d=N.useMemo(()=>({side:c,placement:l}),[c,l]),_=typeof i=="number",g=(_?i:i.open)||0,f=(_?i:i.close)||0,[u,p]=N.useState(()=>({...kn(s,d),...kn(n,d)})),{isMounted:h,status:m}=Kg(e,{duration:i}),y=et(n),w=et(o),C=et(r),k=et(s);return Le(()=>{const A=kn(y.current,d),T=kn(C.current,d),M=kn(k.current,d),P=kn(w.current,d)||Object.keys(A).reduce((L,E)=>(L[E]="",L),{});if(m==="initial"&&p(L=>({transitionProperty:L.transitionProperty,...M,...A})),m==="open"&&p({transitionProperty:Object.keys(P).map(il).join(","),transitionDuration:g+"ms",...M,...P}),m==="close"){const L=T||A;p({transitionProperty:Object.keys(L).map(il).join(","),transitionDuration:f+"ms",...M,...L})}},[f,C,y,w,k,g,m,d]),{isMounted:h,styles:u}}function al(e,t){var n;const{open:o,dataRef:r}=e,{listRef:s,activeIndex:i,onMatch:l,onTypingChange:c,enabled:d=!0,findMatch:_=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:u=null}=t,p=N.useRef(-1),h=N.useRef(""),m=N.useRef((n=u??i)!=null?n:-1),y=N.useRef(null),w=Ye(l),C=Ye(c),k=et(_),A=et(f);Le(()=>{o&&(ct(p),y.current=null,h.current="")},[o]),Le(()=>{if(o&&h.current===""){var E;m.current=(E=u??i)!=null?E:-1}},[o,u,i]);const T=Ye(E=>{E?r.current.typing||(r.current.typing=E,C(E)):r.current.typing&&(r.current.typing=E,C(E))}),M=Ye(E=>{function B(O,D,x){const I=k.current?k.current(D,x):D.find(F=>F?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return I?O.indexOf(I):-1}const V=s.current;if(h.current.length>0&&h.current[0]!==" "&&(B(V,V,h.current)===-1?T(!1):E.key===" "&<(E)),V==null||A.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;o&&E.key!==" "&&(lt(E),T(!0)),V.every(O=>{var D,x;return O?((D=O[0])==null?void 0:D.toLocaleLowerCase())!==((x=O[1])==null?void 0:x.toLocaleLowerCase()):!0})&&h.current===E.key&&(h.current="",m.current=y.current),h.current+=E.key,ct(p),p.current=window.setTimeout(()=>{h.current="",m.current=y.current,T(!1)},g);const b=m.current,S=B(V,[...V.slice((b||0)+1),...V.slice(0,(b||0)+1)],h.current);S!==-1?(w(S),y.current=S):E.key!==" "&&(h.current="",T(!1))}),P=N.useMemo(()=>({onKeyDown:M}),[M]),L=N.useMemo(()=>({onKeyDown:M,onKeyUp(E){E.key===" "&&T(!1)}}),[M,T]);return N.useMemo(()=>d?{reference:P,floating:L}:{},[d,P,L])}function ll(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var s;return r.parentId===t&&(!n||((s=r.context)==null?void 0:s.open))}).flatMap(r=>[r,...ll(e,r.id,n)])}function cl(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,l=s-1;i<s;l=i++){const[c,d]=t[i]||[0,0],[_,g]=t[l]||[0,0];d>=o!=g>=o&&n<=(_-c)*(o-d)/(g-d)+c&&(r=!r)}return r}function Xg(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function dl(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let s=!1,i=null,l=null,c=typeof performance<"u"?performance.now():0;function d(g,f){const u=performance.now(),p=u-c;if(i===null||l===null||p===0)return i=g,l=f,c=u,null;const h=g-i,m=f-l,w=Math.sqrt(h*h+m*m)/p;return i=g,l=f,c=u,w}const _=g=>{let{x:f,y:u,placement:p,elements:h,onClose:m,nodeId:y,tree:w}=g;return function(k){function A(){ct(r),m()}if(ct(r),!h.domReference||!h.floating||p==null||f==null||u==null)return;const{clientX:T,clientY:M}=k,P=[T,M],L=Mg(k),E=k.type==="mouseleave",B=ss(h.floating,L),V=ss(h.domReference,L),$=h.domReference.getBoundingClientRect(),b=h.floating.getBoundingClientRect(),S=p.split("-")[0],O=f>b.right-b.width/2,D=u>b.bottom-b.height/2,x=Xg(P,$),I=b.width>$.width,F=b.height>$.height,j=(I?$:b).left,z=(I?$:b).right,H=(F?$:b).top,X=(F?$:b).bottom;if(B&&(s=!0,!E))return;if(V&&(s=!1),V&&!E){s=!0;return}if(E&&Pe(k.relatedTarget)&&ss(h.floating,k.relatedTarget)||w&&ll(w.nodesRef.current,y).length)return;if(S==="top"&&u>=$.bottom-1||S==="bottom"&&u<=$.top+1||S==="left"&&f>=$.right-1||S==="right"&&f<=$.left+1)return A();let G=[];switch(S){case"top":G=[[j,$.top+1],[j,b.bottom-1],[z,b.bottom-1],[z,$.top+1]];break;case"bottom":G=[[j,b.top+1],[j,$.bottom-1],[z,$.bottom-1],[z,b.top+1]];break;case"left":G=[[b.right-1,X],[b.right-1,H],[$.left+1,H],[$.left+1,X]];break;case"right":G=[[$.right-1,X],[$.right-1,H],[b.left+1,H],[b.left+1,X]];break}function ue(oe){let[ie,_e]=oe;switch(S){case"top":{const ge=[I?ie+t/2:O?ie+t*4:ie-t*4,_e+t+1],ke=[I?ie-t/2:O?ie+t*4:ie-t*4,_e+t+1],J=[[b.left,O||I?b.bottom-t:b.top],[b.right,O?I?b.bottom-t:b.top:b.bottom-t]];return[ge,ke,...J]}case"bottom":{const ge=[I?ie+t/2:O?ie+t*4:ie-t*4,_e-t],ke=[I?ie-t/2:O?ie+t*4:ie-t*4,_e-t],J=[[b.left,O||I?b.top+t:b.bottom],[b.right,O?I?b.top+t:b.bottom:b.top+t]];return[ge,ke,...J]}case"left":{const ge=[ie+t+1,F?_e+t/2:D?_e+t*4:_e-t*4],ke=[ie+t+1,F?_e-t/2:D?_e+t*4:_e-t*4];return[...[[D||F?b.right-t:b.left,b.top],[D?F?b.right-t:b.left:b.right-t,b.bottom]],ge,ke]}case"right":{const ge=[ie-t,F?_e+t/2:D?_e+t*4:_e-t*4],ke=[ie-t,F?_e-t/2:D?_e+t*4:_e-t*4],J=[[D||F?b.left+t:b.right,b.top],[D?F?b.left+t:b.right:b.left+t,b.bottom]];return[ge,ke,...J]}}}if(!cl([T,M],G)){if(s&&!x)return A();if(!E&&o){const oe=d(k.clientX,k.clientY);if(oe!==null&&oe<.1)return A()}cl([T,M],ue([f,u]))?!s&&o&&(r.current=window.setTimeout(A,40)):A()}}};return _.__options={blockPointerEvents:n},_}function En(e,t,n){let o=n.initialDeps??[],r;function s(){var i,l,c,d;let _;n.key&&((i=n.debug)!=null&&i.call(n))&&(_=Date.now());const g=e();if(!(g.length!==o.length||g.some((p,h)=>o[h]!==p)))return r;o=g;let u;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(u=Date.now()),r=t(...g),n.key&&((c=n.debug)!=null&&c.call(n))){const p=Math.round((Date.now()-_)*100)/100,h=Math.round((Date.now()-u)*100)/100,m=h/16,y=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${y(h,5)} /${y(p,5)} ms`,`
|
|
5
658
|
font-size: .6rem;
|
|
6
659
|
font-weight: bold;
|
|
7
|
-
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,r),r}return i.updateDeps=a=>{o=a},i}function ks(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const pd=(e,n)=>Math.abs(e-n)<1.01,hd=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},Is=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},md=e=>e,vd=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},bd=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=a=>{const{width:l,height:d}=a;n({width:Math.round(l),height:Math.round(d)})};if(r(Is(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(a=>{const l=()=>{const d=a[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(Is(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},Es={passive:!0},Ms=typeof window>"u"?!0:"onscrollend"in window,wd=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&Ms?()=>{}:hd(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),a=_=>()=>{const{horizontal:g,isRtl:f}=e.options;r=g?t.scrollLeft*(f&&-1||1):t.scrollTop,i(),n(r,_)},l=a(!0),d=a(!1);d(),t.addEventListener("scroll",l,Es);const u=e.options.useScrollendEvent&&Ms;return u&&t.addEventListener("scrollend",d,Es),()=>{t.removeEventListener("scroll",l),u&&t.removeEventListener("scrollend",d)}},yd=(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"]},Cd=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const a=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:t})};class xd{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 a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));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:md,rangeExtractor:vd,onChange:()=>{},measureElement:yd,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=un(()=>(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 a=o-1;a>=0;a--){const l=t[a];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=un(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=un(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let _=d;_<t;_++){const g=i(_),f=this.options.lanes===1?u[_-1]:this.getFurthestMeasurement(u,_),c=f?f.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(_),v=c+p,w=f?f.lane:_%this.options.lanes;u[_]={index:_,start:c,size:p,end:v,key:g,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=un(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?Sd({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=un(()=>{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,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,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 a=i.key,l=this.elementsCache.get(a);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(a,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,a=o-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,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=un(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,a=t.length;i<a;i++){const l=t[i],d=o[l];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 ks(o[Ns(0,o.length-1,r=>ks(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=t>=a+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,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(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=a+this.options.scrollPaddingStart)o="start";else return[a,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,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 a=10,l=u=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(t,u);if(!_){console.warn("Failed to get offset for index:",t);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(t,f);if(!h){console.warn("Failed to get offset for index:",t);return}pd(h[0],c)||d(f)})},d=u=>{this.targetWindow&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${t} after ${a} attempts.`))};l(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 a=o.length-1;for(;a>=0&&i.some(l=>l===null);){const l=o[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}r=Math.max(...i.filter(l=>l!==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 Ns=(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 Sd({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 a=Ns(0,r,i,t),l=a;if(o===1)for(;l<r&&e[l].end<t+n;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(_=>_<t+n);){const _=e[l];d[_.lane]=_.end,l++}const u=Array(o).fill(t+n);for(;a>=0&&u.some(_=>_>=t);){const _=e[a];u[_.lane]=_.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const Fs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function $d(e){const n=M.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var a;i?pn.flushSync(n):n(),(a=e.onChange)==null||a.call(e,r,i)}},[o]=M.useState(()=>new xd(t));return o.setOptions(t),Fs(()=>o._didMount(),[]),Fs(()=>o._willUpdate()),o}function kd(e){return $d({observeElementRect:bd,observeElementOffset:wd,scrollToFn:Cd,...e})}function Id(e,n){const[t,o]=M.useState(e);return M.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function xo(e){const n=M.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 M.useSyncExternalStore(n,t,o)}function hr(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function In(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function So(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function As(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ds(e,n,t,o){if(!n.trim())return e;const r=As(n.trim());return o?e.filter(i=>o(i,n)):e.filter(i=>As(hr(i,t)).includes(r))}function Ed(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 Md(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 Nd(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:Ds(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function Fd(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&So(n.datos)?t:null).filter(n=>n!==null)}function Ad(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 Dd(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function zd(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function Ld(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const zs=({size:e="1em",...n})=>s.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:s.jsx("path",{d:"m6 9 6 6 6-6"})}),Ls=({size:e="1em",...n})=>s.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:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Pd=({size:e="1em",...n})=>s.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:s.jsx("path",{d:"M20 6 9 17l-5-5"})});function Td(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.5 18a8.5 8.5 0 1 0 0-17a8.5 8.5 0 0 0 0 17m0-3a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11m4.205 3l3.032 5h3.51l-3.034-5z",clipRule:"evenodd"})})}const Od=({size:e="1em",...n})=>s.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:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),X={contenedor_base:"_contenedor_base_kbtyg_1",tam_sm:"_tam_sm_kbtyg_41",tam_lg:"_tam_lg_kbtyg_55",radio_none:"_radio_none_kbtyg_69",radio_sm:"_radio_sm_kbtyg_77",radio_md:"_radio_md_kbtyg_85",radio_lg:"_radio_lg_kbtyg_93",radio_full:"_radio_full_kbtyg_101",color_default:"_color_default_kbtyg_109",color_primary:"_color_primary_kbtyg_111",color_secondary:"_color_secondary_kbtyg_119",color_success:"_color_success_kbtyg_127",color_warning:"_color_warning_kbtyg_135",color_danger:"_color_danger_kbtyg_143",etiqueta:"_etiqueta_kbtyg_151",marca_requerido:"_marca_requerido_kbtyg_167",trigger:"_trigger_kbtyg_177",trigger_expandido:"_trigger_expandido_kbtyg_213",variante_bordered:"_variante_bordered_kbtyg_223",variante_faded:"_variante_faded_kbtyg_233",variante_underlined:"_variante_underlined_kbtyg_243",variante_ghost:"_variante_ghost_kbtyg_259",deshabilitado:"_deshabilitado_kbtyg_271",solo_lectura:"_solo_lectura_kbtyg_291",valor_texto:"_valor_texto_kbtyg_307",abierto:"_abierto_kbtyg_335",valido:"_valido_kbtyg_343",invalido:"_invalido_kbtyg_351",contenido_inicio:"_contenido_inicio_kbtyg_403",contenido_final:"_contenido_final_kbtyg_405",valor_wrapper:"_valor_wrapper_kbtyg_423",mostrar_todos:"_mostrar_todos_kbtyg_443",valor_wrapper_expandido:"_valor_wrapper_expandido_kbtyg_453",placeholder:"_placeholder_kbtyg_469",chip_multi:"_chip_multi_kbtyg_479",chip_texto:"_chip_texto_kbtyg_513",chip_cerrar:"_chip_cerrar_kbtyg_525",contador_multi:"_contador_multi_kbtyg_565",acciones:"_acciones_kbtyg_579",boton_limpiar:"_boton_limpiar_kbtyg_593",tiene_valor:"_tiene_valor_kbtyg_645",icono_chevron:"_icono_chevron_kbtyg_655",icono_spinner:"_icono_spinner_kbtyg_677",girarSpinner:"_girarSpinner_kbtyg_1",menu:"_menu_kbtyg_711",buscador_wrapper:"_buscador_wrapper_kbtyg_739",buscador_interno:"_buscador_interno_kbtyg_753",icono_buscar:"_icono_buscar_kbtyg_801",input_busqueda:"_input_busqueda_kbtyg_823",lista_opciones:"_lista_opciones_kbtyg_871",lista_virtual:"_lista_virtual_kbtyg_903",contenedor_virtual:"_contenedor_virtual_kbtyg_919",encabezado_grupo:"_encabezado_grupo_kbtyg_927",opcion:"_opcion_kbtyg_959",opcion_virtual:"_opcion_virtual_kbtyg_985",activo:"_activo_kbtyg_993",seleccionado:"_seleccionado_kbtyg_1003",opcion_check:"_opcion_check_kbtyg_1037",opcion_contenido:"_opcion_contenido_kbtyg_1065",sin_resultados:"_sin_resultados_kbtyg_1081",descripcion:"_descripcion_kbtyg_1105",mensaje_error:"_mensaje_error_kbtyg_1117",ancho_total:"_ancho_total_kbtyg_1129",sin_animacion:"_sin_animacion_kbtyg_1137",contenedor_nativo:"_contenedor_nativo_kbtyg_1147",select_nativo:"_select_nativo_kbtyg_1155",input_validacion:"_input_validacion_kbtyg_1183"};function Vd(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:_,isRequired:g=!1,isInvalid:f,id:c,name:h,classNames:p,startContent:v,endContent:w,esInvalido:y,estaDeshabilitadoReal:x,clasesBase:E,renderizarValorMostrado:A}=e,D=m.useId(),N=c??`select-nativo-${D}`,T=u?`${N}-desc`:void 0,L=y?`${N}-err`:void 0,I=m.useCallback(P=>hr(P,i),[i]),O=m.useCallback(P=>In(P,a),[a]),V=m.useCallback(P=>{o?.(P),r?.(P)},[o,r]),$=m.useCallback(P=>{const F=P.target.value;if(!F){V(null);return}const C=n.find(k=>O(k)===F);C&&V(C)},[n,O,V]),b=typeof f=="string"?f:null,S=typeof _=="function"?_({invalido:y,mensaje:b}):_??b;return s.jsxs("div",{className:E,children:[l&&s.jsxs("label",{className:K(X.etiqueta,p?.label),htmlFor:N,children:[l,g&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{className:X.contenedor_nativo,children:[s.jsxs("div",{className:K(X.trigger,p?.trigger),children:[v&&s.jsx("span",{className:X.contenido_inicio,children:v}),s.jsx("div",{className:K(X.valor_wrapper,p?.value),children:A()}),s.jsxs("div",{className:X.acciones,children:[w&&s.jsx("span",{className:X.contenido_final,children:w}),s.jsx("span",{className:X.icono_chevron,children:s.jsx(zs,{size:"1em"})})]})]}),s.jsxs("select",{id:N,name:h,className:X.select_nativo,value:t?O(t):"",onChange:$,disabled:x,required:g,children:[s.jsx("option",{value:"",children:d}),n.map(P=>s.jsx("option",{value:O(P),disabled:So(P),children:I(P)},O(P)))]})]}),u&&!y&&s.jsx("div",{id:T,className:K(X.descripcion,p?.description),children:u}),y&&S&&s.jsx("div",{id:L,className:K(X.mensaje_error,p?.errorMessage),children:S})]})}const jd="(max-width: 768px)",qd=40,Bd=480,mr=100,Hd=200,Gd=5;function Wd(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:_,variant:g="bordered",color:f="default",size:c="md",radius:h="md",fullWidth:p=!0,disableAnimation:v=!1,label:w,placeholder:y="",description:x,errorMessage:E,emptyMessage:A="No hay opciones",noResultsMessage:D="Sin resultados",isRequired:N=!1,isDisabled:T=!1,isReadOnly:L=!1,isLoading:I=!1,isClearable:O=!0,isInvalid:V,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:P,isVirtualized:F=!1,estimatedOptionHeight:C=qd,filterFn:k,validate:z,onOpen:q,onClose:j,onSearchChange:H,onClear:J,onFocus:U,onBlur:ae,id:ie,name:le,className:he,classNames:_e,style:ge,startContent:R,endContent:te,menuZIndex:ne,portalContainer:ce}=e,be=m.useRef(null),ee=m.useRef([]),Ce=m.useRef(null),xe=m.useRef(null),de=m.useId(),ye=ie??`select-${de}`,W=xo(jd),B=P!==!1&&t.length>4,G=W&&!b,[pe,Q]=m.useState(!1),[ve,Xe]=m.useState(null),[Ye,tt]=m.useState(""),Te=o!==void 0,[Ze,Ge]=m.useState(r??null),me=Te?o:Ze,we=T||I,Pe=m.useCallback(Y=>hr(Y,l),[l]),Ne=m.useCallback(Y=>In(Y,d),[d]),_t=m.useMemo(()=>{const Y=new Set;if(!me)return Y;try{if(b&&Array.isArray(me))for(const Fe of me)Y.add(In(Fe,d));else me&&Y.add(In(me,d))}catch{}return Y},[me,b,d]),oe=m.useCallback(Y=>{try{return _t.has(In(Y,d))}catch{return!1}},[_t,d]),Me=m.useMemo(()=>Ed(t),[t]),Be=m.useMemo(()=>{if(!B||!Ye.trim())return t;try{return Me?Nd(t,Ye,l,k):Ds(t,Ye,l,k)}catch{return t}},[t,Ye,B,k,l,Me]),re=m.useMemo(()=>Me?Md(Be):Be.map((Y,Fe)=>({tipo:"opcion",datos:Y,indice:Fe})),[Be,Me]),Se=m.useMemo(()=>Ad(me,z),[me,z]),Je=m.useMemo(()=>Dd(V,$,Se),[V,$,Se]),Ue=$==="valid"&&!Je,{refs:vt,floatingStyles:ft,context:bt,placement:zn}=mo({open:pe,onOpenChange:Y=>{we||L||(Q(Y),Y?(q?.(),tt(""),Xe(null)):j?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[io(4),ao({padding:8}),so({padding:8}),Ki({apply({availableHeight:Y,rects:Fe,elements:yt}){const at=Math.max(Math.min(Y,Bd),150);Object.assign(yt.floating.style,{width:`${Fe.reference.width}px`,maxHeight:`${at}px`,display:"flex",flexDirection:"column"})},padding:8})],whileElementsMounted:no}),gn=zn.startsWith("top"),{isMounted:Fo,styles:Of}=Co(bt,{duration:v||re.length>Hd?0:200,initial:{opacity:0,transform:gn?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:gn?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:gn?"bottom":"top"}}),ka=kd({count:re.length,getScrollElement:()=>Ce.current,estimateSize:()=>C,overscan:Gd,enabled:F&&pe&&re.length>mr}),Vf=ms(bt,{enabled:!we&&!L}),jf=ho(bt),qf=yo(bt,{role:"listbox"}),Bf=m.useMemo(()=>{try{return Fd(re)}catch{return[]}},[re]),Hf=pr(bt,{listRef:ee,activeIndex:ve,onNavigate:Xe,loop:!0,virtual:F,disabledIndices:Bf,focusItemOnHover:!1}),Ia=m.useRef([]);m.useEffect(()=>{Ia.current=re.map(Y=>Y.tipo==="opcion"&&Y.datos?Pe(Y.datos):null)},[re,Pe]);const Gf=Cs(bt,{listRef:Ia,activeIndex:ve,onMatch:pe?Xe:void 0,enabled:!B}),{getReferenceProps:Wf,getFloatingProps:Kf,getItemProps:Ea}=vo([Vf,jf,qf,Hf,Gf]),Wt=m.useCallback(Y=>{Te||Ge(Y),i?.(Y),a?.(Y)},[Te,i,a]),Ao=m.useCallback(Y=>{if(!So(Y))if(b){const Fe=Array.isArray(me)?me:[],yt=Fe.some(at=>Ne(at)===Ne(Y));Wt(yt?Fe.filter(at=>Ne(at)!==Ne(Y)):[...Fe,Y])}else Wt(Y),Q(!1)},[b,me,Ne,Wt]),Uf=m.useCallback(Y=>{Y.stopPropagation(),Wt(b?[]:null),J?.(),be.current?.focus()},[b,Wt,J]),Ma=m.useCallback((Y,Fe)=>{Fe.stopPropagation(),!(!b||!Array.isArray(me))&&Wt(me.filter(yt=>Ne(yt)!==Ne(Y)))},[b,me,Ne,Wt]),Yf=m.useCallback(Y=>{const Fe=Y.target.value;tt(Fe),H?.(Fe),Xe(0)},[H]),Rf=m.useCallback(Y=>{if(Y.key==="Enter"&&ve!==null){Y.preventDefault();const Fe=re[ve];Fe?.tipo==="opcion"&&Fe.datos&&Ao(Fe.datos)}},[ve,re,Ao]);m.useEffect(()=>{pe&&B&&requestAnimationFrame(()=>{xe.current?.focus({preventScroll:!0})})},[pe,B]),m.useEffect(()=>()=>{ee.current=[]},[re.length]),m.useImperativeHandle(n,()=>({focus:()=>be.current?.focus(),blur:()=>be.current?.blur(),open:()=>Q(!0),close:()=>Q(!1),clear:()=>Wt(b?[]:null)}));const Ln=b?Array.isArray(me)&&me.length>0:me!=null&&me!=="",Na=m.useCallback(()=>{if(_)return _(me??null);if(!Ln)return s.jsx("span",{className:X.placeholder,children:y});if(b&&Array.isArray(me)){if(me.length===0)return s.jsx("span",{className:X.placeholder,children:y});const Y=S?me:me.slice(0,2),Fe=S?0:Math.max(0,me.length-2);return s.jsxs(s.Fragment,{children:[Y.map(yt=>s.jsxs("span",{className:X.chip_multi,children:[s.jsx("span",{className:X.chip_texto,children:Pe(yt)}),!L&&!we&&s.jsx("button",{type:"button",className:X.chip_cerrar,onClick:at=>Ma(yt,at),children:s.jsx(Ls,{size:"1em"})})]},Ne(yt))),Fe>0&&s.jsxs("span",{className:X.contador_multi,children:["+",Fe]})]})}return s.jsx("span",{className:X.valor_texto,children:Pe(me)})},[_,me,Ln,y,b,S,L,we,Ne,Pe,Ma]),Fa=m.useCallback((Y,Fe,yt)=>{try{if(Y.tipo==="grupo")return s.jsx("li",{className:K(X.encabezado_grupo,F&&X.opcion_virtual),style:yt,children:Y.nombreGrupo},`grupo-${Y.nombreGrupo}`);const at=Y.datos;if(!at)return null;const za=oe(at),La=ve===Fe,Xf=So(at),Zf=u?u(at,{isSelected:za,isActive:La}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:X.opcion_check,children:s.jsx(Pd,{size:"1em"})}),s.jsx("span",{className:X.opcion_contenido,children:Pe(at)})]}),Jf=Ne(at);return s.jsx("li",{ref:Qf=>{ee.current[Fe]=Qf},className:K(X.opcion,F&&X.opcion_virtual,{[X.activo]:La,[X.seleccionado]:za,[X.deshabilitado]:Xf},_e?.option),style:yt,...Ea({onClick:()=>Ao(at)}),children:Zf},Jf)}catch(at){return console.error("Error rendering select item:",at),null}},[F,ve,oe,u,Pe,Ne,_e?.option,Ea,Ao]),Aa=typeof E=="function"?E({invalido:Je,mensaje:Se}):E??Se,Da=K(X.contenedor_base,X[`variante_${g}`],X[`tam_${c}`],X[`radio_${h}`],X[`color_${f}`],{[X.ancho_total]:p,[X.sin_animacion]:v,[X.deshabilitado]:we,[X.solo_lectura]:L,[X.invalido]:Je,[X.valido]:Ue,[X.abierto]:pe,[X.tiene_valor]:Ln},_e?.base,he);return G&&!Me?s.jsx(Vd,{...e,esInvalido:Je,estaDeshabilitadoReal:we,clasesBase:Da,renderizarValorMostrado:Na}):s.jsxs("div",{className:Da,style:ge,children:[w&&s.jsxs("label",{id:`${ye}-label`,className:K(X.etiqueta,_e?.label),children:[w,N&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{ref:Y=>{vt.setReference(Y),be.current=Y},id:ye,tabIndex:we?-1:0,className:K(X.trigger,S&&b&&X.trigger_expandido,_e?.trigger),"aria-labelledby":w?`${ye}-label`:void 0,onFocus:U,onBlur:ae,...Wf(),children:[R&&s.jsx("span",{className:X.contenido_inicio,children:R}),s.jsx("div",{className:K(X.valor_wrapper,S&&b&&X.mostrar_todos,S&&b&&X.valor_wrapper_expandido,_e?.value),children:Na()}),s.jsxs("div",{className:X.acciones,children:[O&&Ln&&!L&&!we&&s.jsx("button",{type:"button",className:K(X.boton_limpiar,_e?.clearButton),onClick:Uf,tabIndex:-1,children:s.jsx(Ls,{size:"1em"})}),te&&s.jsx("span",{className:X.contenido_final,children:te}),I?s.jsx("span",{className:X.icono_spinner,children:s.jsx(Od,{size:"1em"})}):s.jsx("span",{className:X.icono_chevron,children:s.jsx(zs,{size:"1em"})})]})]}),(le||N)&&s.jsxs("select",{"aria-hidden":!0,tabIndex:-1,name:le,required:N,value:b&&Array.isArray(me)?me.map(Y=>String(Ne(Y))):me?String(Ne(me)):b?[]:"",onChange:()=>{},onFocus:Y=>Y.target.blur(),className:X.input_validacion,multiple:b,"data-testid":`select-native-${ye}`,children:[!b&&(O||!Ln)&&s.jsxs("option",{value:"",children:["— ",y||"Seleccionar"]}),re.map(Y=>Y.datos!==null&&s.jsx("option",{value:String(Ne(Y.datos)),children:Pe(Y.datos)},`opcion-${Ne(Y.datos)}`))]}),Fo&&s.jsx(po,{root:ce,children:s.jsx(ur,{context:bt,modal:!1,initialFocus:B?xe:-1,children:s.jsxs("div",{ref:vt.setFloating,style:{...ft,...Of,zIndex:ne??"var(--z-popover)"},className:K(X.menu,_e?.menu),...Kf(),children:[B&&s.jsx("div",{className:X.buscador_wrapper,children:s.jsxs("div",{className:X.buscador_interno,children:[s.jsx("span",{className:X.icono_buscar,children:s.jsx(Td,{})}),s.jsx("input",{ref:xe,type:"text",className:K(X.input_busqueda,_e?.searchInput),placeholder:"Buscar...",value:Ye,onChange:Yf,onKeyDown:Rf})]})}),s.jsx("ul",{ref:Ce,className:K(X.lista_opciones,F&&X.lista_virtual),style:{flex:1,maxHeight:"100%",overflowY:"auto",position:F&&re.length>mr?"relative":void 0},children:re.length===0?s.jsx("li",{className:X.sin_resultados,children:Ye?D:A}):F&&re.length>mr?s.jsx(s.Fragment,{children:s.jsx("div",{style:{height:`${ka.getTotalSize()}px`,position:"relative",width:"100%"},children:ka.getVirtualItems().map(Y=>{const Fe=re[Y.index];return Fe?s.jsx("div",{style:{position:"absolute",top:0,left:"var(--gaps-1)",right:"var(--gaps-1)",width:"auto",height:`${Math.max(Y.size-2,1)}px`,transform:`translateY(${Y.start+1}px)`},children:Fa(Fe,Y.index)},`virtual-${Y.index}`):null})})}):re.map((Y,Fe)=>Fa(Y,Fe))})]})})}),x&&!Je&&s.jsx("div",{className:K(X.descripcion,_e?.description),children:x}),Je&&Aa&&s.jsx("div",{className:K(X.mensaje_error,_e?.errorMessage),children:Aa})]})}const Kd=m.forwardRef(Wd),Ps=m.memo(Kd);Ps.displayName="SelectBase";function Ud(e,n){const{options:t=[],value:o,onChange:r,onValueChange:i,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,..._}=e,g=m.useMemo(()=>t.length>0&&typeof t[0]=="object",[t]),f=m.useMemo(()=>{if(!g||!a)return null;const p=new Map;for(const v of t)p.set(String(v[a]),v);return p},[t,a,g]),c=m.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>f?.get(String(v));return d&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,f,d,u,g]),h=m.useCallback(p=>{const v=r||i;if(!v)return;if(p===null){v(d?[]:u||!g?null:"");return}if(u||!g){v(p);return}const w=y=>typeof y=="string"?y:y[a];v(d&&Array.isArray(p)?p.map(w):w(p))},[r,i,u,d,a,g]);return s.jsx(Ps,{..._,ref:n,options:t,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Ts=m.forwardRef(Ud);Ts.displayName="Select";const En={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function Jt({content:e,children:n,placement:t="top",variant:o="default",size:r="md",offset:i=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:c,onClose:h,isOpen:p,onOpenChange:v}){const[w,y]=m.useState(!1),x=m.useRef(null),E=p!==void 0?p:w,A=m.useCallback(z=>{d||(v?v(z):y(z),z?c?.():h?.())},[d,v,c,h]),{refs:D,floatingStyles:N,context:T,isPositioned:L}=mo({open:E,onOpenChange:A,placement:t,strategy:"fixed",middleware:[io(i+(u?8:0)),ao({fallbackAxisSideDirection:"start",padding:8}),so({padding:8}),u?qc({element:x}):void 0].filter(Boolean),whileElementsMounted:no}),I=ar(T,{delay:{open:a,close:g?200:l||100},enabled:!d,move:!1,handleClose:null}),O=cd(T,{enabled:!d}),V=ho(T,{enabled:!d}),$=yo(T,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=vo([I,O,V,$]),{isMounted:P,styles:F}=Co(T,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),C=m.useMemo(()=>[En.tooltip,En[`size_${r}`],En[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),k=m.useMemo(()=>m.cloneElement(n,b({ref:D.setReference,...n.props})),[n,b,D.setReference]);return!e||d?n:s.jsxs(s.Fragment,{children:[k,P&&s.jsx(po,{children:s.jsx("div",{ref:D.setFloating,className:En.tooltip_positioner,style:{...N,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:s.jsxs("div",{className:C,style:{...F,pointerEvents:g?"auto":"none",visibility:L||!E?"visible":"hidden"},...S(),children:[e,u&&s.jsx(Uc,{ref:x,context:T,className:En.arrow})]})})})]})}/**
|
|
660
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return(d=n?.onChange)==null||d.call(n,r),r}return s.updateDeps=i=>{o=i},s}function ul(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Yg=(e,t)=>Math.abs(e-t)<1.01,Zg=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},fl=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jg=e=>e,Qg=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=t;r<=n;r++)o.push(r);return o},eh=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const r=i=>{const{width:l,height:c}=i;t({width:Math.round(l),height:Math.round(c)})};if(r(fl(n)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(i=>{const l=()=>{const c=i[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){r({width:d.inlineSize,height:d.blockSize});return}}r(fl(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},_l={passive:!0},gl=typeof window>"u"?!0:"onscrollend"in window,th=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const s=e.options.useScrollendEvent&&gl?()=>{}:Zg(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),i=_=>()=>{const{horizontal:g,isRtl:f}=e.options;r=g?n.scrollLeft*(f&&-1||1):n.scrollTop,s(),t(r,_)},l=i(!0),c=i(!1);c(),n.addEventListener("scroll",l,_l);const d=e.options.useScrollendEvent&≷return d&&n.addEventListener("scrollend",c,_l),()=>{n.removeEventListener("scroll",l),d&&n.removeEventListener("scrollend",c)}},nh=(e,t,n)=>{if(t?.borderBoxSize){const o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},oh=(e,{adjustments:t=0,behavior:n},o)=>{var r,s;const i=e+t;(s=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[o.options.horizontal?"left":"top"]:i,behavior:n})};class rh{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(s=>{const i=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var s;return(s=o())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=o())==null?void 0:s.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jg,rangeExtractor:Qg,onChange:()=>{},measureElement:nh,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,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=En(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{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(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;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=((n=this.scrollElement)==null?void 0:n.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,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,s=new Map;for(let i=o-1;i>=0;i--){const l=n[i];if(r.has(l.lane))continue;const c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,l)=>i.end===l.end?i.index-l.index:i.end-l.end)[0]:void 0},this.getMeasurementOptions=En(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,s,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:i}),{key:!1}),this.getMeasurements=En(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:s,enabled:i},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,c);for(let _=c;_<n;_++){const g=s(_),f=this.options.lanes===1?d[_-1]:this.getFurthestMeasurement(d,_),u=f?f.end+this.options.gap:o+r,p=l.get(g),h=typeof p=="number"?p:this.options.estimateSize(_),m=u+h,y=f?f.lane:_%this.options.lanes;d[_]={index:_,start:u,size:h,end:m,key:g,lane:y}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=En(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,s)=>this.range=n.length>0&&o>0?sh({measurements:n,outerSize:o,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=En(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),s=this.measurementsCache[r];if(!s)return;const i=s.key,l=this.elementsCache.get(i);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const s=this.itemSizeCache.get(r.key)??r.size,i=o-s;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=En(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let s=0,i=n.length;s<i;s++){const l=n[s],c=o[l];r.push(c)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return ul(o[hl(0,o.length-1,r=>ul(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const s=this.getSize(),i=this.getScrollOffset();o==="auto"&&(o=n>=i+s?"end":"start"),o==="center"?n+=(r-s)/2:o==="end"&&(n-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const s=this.getSize(),i=this.getScrollOffset();if(o==="auto")if(r.end>=i+s-this.options.scrollPaddingEnd)o="end";else if(r.start<=i+this.options.scrollPaddingStart)o="start";else return[i,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{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(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let s=0;const i=10,l=d=>{if(!this.targetWindow)return;const _=this.getOffsetForIndex(n,d);if(!_){console.warn("Failed to get offset for index:",n);return}const[g,f]=_;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const u=this.getScrollOffset(),p=this.getOffsetForIndex(n,f);if(!p){console.warn("Failed to get offset for index:",n);return}Yg(p[0],u)||c(f)})},c=d=>{this.targetWindow&&(s++,s<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,i),this.targetWindow.requestAnimationFrame(()=>l(d))):console.warn(`Failed to scroll to index ${n} after ${i} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const s=Array(this.options.lanes).fill(null);let i=o.length-1;for(;i>=0&&s.some(l=>l===null);){const l=o[i];s[l.lane]===null&&(s[l.lane]=l.end),i--}r=Math.max(...s.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const hl=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,s=n(r);if(s<o)e=r+1;else if(s>o)t=r-1;else return r}return e>0?e-1:0};function sh({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,s=c=>e[c].start;if(e.length<=o)return{startIndex:0,endIndex:r};let i=hl(0,r,s,n),l=i;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const c=Array(o).fill(0);for(;l<r&&c.some(_=>_<n+t);){const _=e[l];c[_.lane]=_.end,l++}const d=Array(o).fill(n+t);for(;i>=0&&d.some(_=>_>=n);){const _=e[i];d[_.lane]=_.start,i--}i=Math.max(0,i-i%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:i,endIndex:l}}const pl=typeof document<"u"?N.useLayoutEffect:N.useEffect;function ih(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(r,s)=>{var i;s?Dn.flushSync(t):t(),(i=e.onChange)==null||i.call(e,r,s)}},[o]=N.useState(()=>new rh(n));return o.setOptions(n),pl(()=>o._didMount(),[]),pl(()=>o._willUpdate()),o}function ah(e){return ih({observeElementRect:eh,observeElementOffset:th,scrollToFn:oh,...e})}function lh(e,t){const[n,o]=N.useState(e);return N.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function Qo(e){const t=N.useCallback(r=>{const s=window.matchMedia(e);return s.addEventListener("change",r),()=>{s.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return N.useSyncExternalStore(t,n,o)}function _s(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Yn(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function er(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function ml(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function vl(e,t,n,o){if(!t.trim())return e;const r=ml(t.trim());return o?e.filter(s=>o(s,t)):e.filter(s=>ml(_s(s,n)).includes(r))}function ch(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function dh(e){const t=[];let n=0;for(const o of e){t.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:n++});for(const r of o.opciones)t.push({tipo:"opcion",datos:r,indice:n++})}return t}function uh(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:vl(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function fh(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&er(t.datos)?n:null).filter(t=>t!==null)}function _h(e,t){if(!t)return null;const n=t(e);return n===!0||n==null?null:typeof n=="string"?n:typeof n=="object"&&"message"in n?n.message??"Selección inválida":"Selección inválida"}function gh(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function hh(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function ph(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const bl=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),wl=({size:e="1em",...t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),mh=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M20 6 9 17l-5-5"})});function vh(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.5 18a8.5 8.5 0 1 0 0-17a8.5 8.5 0 0 0 0 17m0-3a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11m4.205 3l3.032 5h3.51l-3.034-5z",clipRule:"evenodd"})})}const bh=({size:e="1em",...t})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Z={contenedor_base:"_contenedor_base_kbtyg_1",tam_sm:"_tam_sm_kbtyg_41",tam_lg:"_tam_lg_kbtyg_55",radio_none:"_radio_none_kbtyg_69",radio_sm:"_radio_sm_kbtyg_77",radio_md:"_radio_md_kbtyg_85",radio_lg:"_radio_lg_kbtyg_93",radio_full:"_radio_full_kbtyg_101",color_default:"_color_default_kbtyg_109",color_primary:"_color_primary_kbtyg_111",color_secondary:"_color_secondary_kbtyg_119",color_success:"_color_success_kbtyg_127",color_warning:"_color_warning_kbtyg_135",color_danger:"_color_danger_kbtyg_143",etiqueta:"_etiqueta_kbtyg_151",marca_requerido:"_marca_requerido_kbtyg_167",trigger:"_trigger_kbtyg_177",trigger_expandido:"_trigger_expandido_kbtyg_213",variante_bordered:"_variante_bordered_kbtyg_223",variante_faded:"_variante_faded_kbtyg_233",variante_underlined:"_variante_underlined_kbtyg_243",variante_ghost:"_variante_ghost_kbtyg_259",deshabilitado:"_deshabilitado_kbtyg_271",solo_lectura:"_solo_lectura_kbtyg_291",valor_texto:"_valor_texto_kbtyg_307",abierto:"_abierto_kbtyg_335",valido:"_valido_kbtyg_343",invalido:"_invalido_kbtyg_351",contenido_inicio:"_contenido_inicio_kbtyg_403",contenido_final:"_contenido_final_kbtyg_405",valor_wrapper:"_valor_wrapper_kbtyg_423",mostrar_todos:"_mostrar_todos_kbtyg_443",valor_wrapper_expandido:"_valor_wrapper_expandido_kbtyg_453",placeholder:"_placeholder_kbtyg_469",chip_multi:"_chip_multi_kbtyg_479",chip_texto:"_chip_texto_kbtyg_513",chip_cerrar:"_chip_cerrar_kbtyg_525",contador_multi:"_contador_multi_kbtyg_565",acciones:"_acciones_kbtyg_579",boton_limpiar:"_boton_limpiar_kbtyg_593",tiene_valor:"_tiene_valor_kbtyg_645",icono_chevron:"_icono_chevron_kbtyg_655",icono_spinner:"_icono_spinner_kbtyg_677",girarSpinner:"_girarSpinner_kbtyg_1",menu:"_menu_kbtyg_711",buscador_wrapper:"_buscador_wrapper_kbtyg_739",buscador_interno:"_buscador_interno_kbtyg_753",icono_buscar:"_icono_buscar_kbtyg_801",input_busqueda:"_input_busqueda_kbtyg_823",lista_opciones:"_lista_opciones_kbtyg_871",lista_virtual:"_lista_virtual_kbtyg_903",contenedor_virtual:"_contenedor_virtual_kbtyg_919",encabezado_grupo:"_encabezado_grupo_kbtyg_927",opcion:"_opcion_kbtyg_959",opcion_virtual:"_opcion_virtual_kbtyg_985",activo:"_activo_kbtyg_993",seleccionado:"_seleccionado_kbtyg_1003",opcion_check:"_opcion_check_kbtyg_1037",opcion_contenido:"_opcion_contenido_kbtyg_1065",sin_resultados:"_sin_resultados_kbtyg_1081",descripcion:"_descripcion_kbtyg_1105",mensaje_error:"_mensaje_error_kbtyg_1117",ancho_total:"_ancho_total_kbtyg_1129",sin_animacion:"_sin_animacion_kbtyg_1137",contenedor_nativo:"_contenedor_nativo_kbtyg_1147",select_nativo:"_select_nativo_kbtyg_1155",input_validacion:"_input_validacion_kbtyg_1183"};function wh(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:s="label",optionValueKey:i="id",label:l,placeholder:c="Seleccione una opción",description:d,errorMessage:_,isRequired:g=!1,isInvalid:f,id:u,name:p,classNames:h,startContent:m,endContent:y,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:k,renderizarValorMostrado:A}=e,T=v.useId(),M=u??`select-nativo-${T}`,P=d?`${M}-desc`:void 0,L=w?`${M}-err`:void 0,E=v.useCallback(O=>_s(O,s),[s]),B=v.useCallback(O=>Yn(O,i),[i]),V=v.useCallback(O=>{o?.(O),r?.(O)},[o,r]),$=v.useCallback(O=>{const D=O.target.value;if(!D){V(null);return}const x=t.find(I=>B(I)===D);x&&V(x)},[t,B,V]),b=typeof f=="string"?f:null,S=typeof _=="function"?_({invalido:w,mensaje:b}):_??b;return a.jsxs("div",{className:k,children:[l&&a.jsxs("label",{className:W(Z.etiqueta,h?.label),htmlFor:M,children:[l,g&&a.jsx("span",{className:Z.marca_requerido,children:"*"})]}),a.jsxs("div",{className:Z.contenedor_nativo,children:[a.jsxs("div",{className:W(Z.trigger,h?.trigger),children:[m&&a.jsx("span",{className:Z.contenido_inicio,children:m}),a.jsx("div",{className:W(Z.valor_wrapper,h?.value),children:A()}),a.jsxs("div",{className:Z.acciones,children:[y&&a.jsx("span",{className:Z.contenido_final,children:y}),a.jsx("span",{className:Z.icono_chevron,children:a.jsx(bl,{size:"1em"})})]})]}),a.jsxs("select",{id:M,name:p,className:Z.select_nativo,value:n?B(n):"",onChange:$,disabled:C,required:g,children:[a.jsx("option",{value:"",children:c}),t.map(O=>a.jsx("option",{value:B(O),disabled:er(O),children:E(O)},B(O)))]})]}),d&&!w&&a.jsx("div",{id:P,className:W(Z.descripcion,h?.description),children:d}),w&&S&&a.jsx("div",{id:L,className:W(Z.mensaje_error,h?.errorMessage),children:S})]})}const yh="(max-width: 768px)",Ch=40,xh=480,gs=100,Sh=200,$h=5;function kh(e,t){const{options:n=[],value:o,defaultValue:r,onChange:s,onValueChange:i,optionLabelKey:l="label",optionValueKey:c="id",renderOption:d,renderValue:_,variant:g="bordered",color:f="default",size:u="md",radius:p="md",fullWidth:h=!0,disableAnimation:m=!1,label:y,placeholder:w="",description:C,errorMessage:k,emptyMessage:A="No hay opciones",noResultsMessage:T="Sin resultados",isRequired:M=!1,isDisabled:P=!1,isReadOnly:L=!1,isLoading:E=!1,isClearable:B=!0,isInvalid:V,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:O,isVirtualized:D=!1,estimatedOptionHeight:x=Ch,filterFn:I,validate:F,onOpen:j,onClose:z,onSearchChange:H,onClear:X,onFocus:G,onBlur:ue,id:oe,name:ie,className:_e,classNames:ge,style:ke,startContent:J,endContent:re,menuZIndex:Y,portalContainer:ye}=e,ce=v.useRef(null),ee=v.useRef([]),ne=v.useRef(null),xe=v.useRef(null),de=v.useId(),Se=oe??`select-${de}`,U=Qo(yh),q=O!==!1&&n.length>4,R=U&&!b,[fe,he]=v.useState(!1),[pe,Ue]=v.useState(null),[Je,nt]=v.useState(""),ve=o!==void 0,[Ze,ot]=v.useState(r??null),be=ve?o:Ze,Ce=P||E,Re=v.useCallback(K=>_s(K,l),[l]),Ae=v.useCallback(K=>Yn(K,c),[c]),rt=v.useMemo(()=>{const K=new Set;if(!be)return K;try{if(b&&Array.isArray(be))for(const De of be)K.add(Yn(De,c));else be&&K.add(Yn(be,c))}catch{}return K},[be,b,c]),te=v.useCallback(K=>{try{return rt.has(Yn(K,c))}catch{return!1}},[rt,c]),Ee=v.useMemo(()=>ch(n),[n]),ze=v.useMemo(()=>{if(!q||!Je.trim())return n;try{return Ee?uh(n,Je,l,I):vl(n,Je,l,I)}catch{return n}},[n,Je,q,I,l,Ee]),Oe=v.useMemo(()=>Ee?dh(ze):ze.map((K,De)=>({tipo:"opcion",datos:K,indice:De})),[ze,Ee]),pt=v.useMemo(()=>_h(be,F),[be,F]),wt=v.useMemo(()=>gh(V,$,pt),[V,$,pt]),mt=$==="valid"&&!wt,{refs:Pt,floatingStyles:me,context:we,placement:vt}=Go({open:fe,onOpenChange:K=>{Ce||L||(he(K),K?(j?.(),nt(""),Ue(null)):z?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[Lo(4),zo({padding:8}),Oo({padding:8}),Aa({apply({availableHeight:K,rects:De,elements:Et}){const dt=Math.max(Math.min(K,xh),150);Object.assign(Et.floating.style,{width:`${De.reference.width}px`,maxHeight:`${dt}px`,display:"flex",flexDirection:"column"})},padding:8})],whileElementsMounted:To}),yt=vt.startsWith("top"),{isMounted:Mn,styles:oo}=Jo(we,{duration:m||Oe.length>Sh?0:200,initial:{opacity:0,transform:yt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:yt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:yt?"bottom":"top"}}),An=ah({count:Oe.length,getScrollElement:()=>ne.current,estimateSize:()=>x,overscan:$h,enabled:D&&fe&&Oe.length>gs}),ro=nl(we,{enabled:!Ce&&!L}),ar=Wo(we),lr=Zo(we,{role:"listbox"}),vm=v.useMemo(()=>{try{return fh(Oe)}catch{return[]}},[Oe]),bm=fs(we,{listRef:ee,activeIndex:pe,onNavigate:Ue,loop:!0,virtual:D,disabledIndices:vm,focusItemOnHover:!1}),uc=v.useRef([]);v.useEffect(()=>{uc.current=Oe.map(K=>K.tipo==="opcion"&&K.datos?Re(K.datos):null)},[Oe,Re]);const wm=al(we,{listRef:uc,activeIndex:pe,onMatch:fe?Ue:void 0,enabled:!q}),{getReferenceProps:ym,getFloatingProps:Cm,getItemProps:fc}=Ko([ro,ar,lr,bm,wm]),on=v.useCallback(K=>{ve||ot(K),s?.(K),i?.(K)},[ve,s,i]),cr=v.useCallback(K=>{if(!er(K))if(b){const De=Array.isArray(be)?be:[],Et=De.some(dt=>Ae(dt)===Ae(K));on(Et?De.filter(dt=>Ae(dt)!==Ae(K)):[...De,K])}else on(K),he(!1)},[b,be,Ae,on]),xm=v.useCallback(K=>{K.stopPropagation(),on(b?[]:null),X?.(),ce.current?.focus()},[b,on,X]),_c=v.useCallback((K,De)=>{De.stopPropagation(),!(!b||!Array.isArray(be))&&on(be.filter(Et=>Ae(Et)!==Ae(K)))},[b,be,Ae,on]),Sm=v.useCallback(K=>{const De=K.target.value;nt(De),H?.(De),Ue(0)},[H]),$m=v.useCallback(K=>{if(K.key==="Enter"&&pe!==null){K.preventDefault();const De=Oe[pe];De?.tipo==="opcion"&&De.datos&&cr(De.datos)}},[pe,Oe,cr]);v.useEffect(()=>{fe&&q&&requestAnimationFrame(()=>{xe.current?.focus({preventScroll:!0})})},[fe,q]),v.useEffect(()=>()=>{ee.current=[]},[Oe.length]),v.useImperativeHandle(t,()=>({focus:()=>ce.current?.focus(),blur:()=>ce.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>on(b?[]:null)}));const so=b?Array.isArray(be)&&be.length>0:be!=null&&be!=="",gc=v.useCallback(()=>{if(_)return _(be??null);if(!so)return a.jsx("span",{className:Z.placeholder,children:w});if(b&&Array.isArray(be)){if(be.length===0)return a.jsx("span",{className:Z.placeholder,children:w});const K=S?be:be.slice(0,2),De=S?0:Math.max(0,be.length-2);return a.jsxs(a.Fragment,{children:[K.map(Et=>a.jsxs("span",{className:Z.chip_multi,children:[a.jsx("span",{className:Z.chip_texto,children:Re(Et)}),!L&&!Ce&&a.jsx("button",{type:"button",className:Z.chip_cerrar,onClick:dt=>_c(Et,dt),children:a.jsx(wl,{size:"1em"})})]},Ae(Et))),De>0&&a.jsxs("span",{className:Z.contador_multi,children:["+",De]})]})}return a.jsx("span",{className:Z.valor_texto,children:Re(be)})},[_,be,so,w,b,S,L,Ce,Ae,Re,_c]),hc=v.useCallback((K,De,Et)=>{try{if(K.tipo==="grupo")return a.jsx("li",{className:W(Z.encabezado_grupo,D&&Z.opcion_virtual),style:Et,children:K.nombreGrupo},`grupo-${K.nombreGrupo}`);const dt=K.datos;if(!dt)return null;const vc=te(dt),bc=pe===De,km=er(dt),Em=d?d(dt,{isSelected:vc,isActive:bc}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:Z.opcion_check,children:a.jsx(mh,{size:"1em"})}),a.jsx("span",{className:Z.opcion_contenido,children:Re(dt)})]}),Im=Ae(dt);return a.jsx("li",{ref:Nm=>{ee.current[De]=Nm},className:W(Z.opcion,D&&Z.opcion_virtual,{[Z.activo]:bc,[Z.seleccionado]:vc,[Z.deshabilitado]:km},ge?.option),style:Et,...fc({onClick:()=>cr(dt)}),children:Em},Im)}catch(dt){return console.error("Error rendering select item:",dt),null}},[D,pe,te,d,Re,Ae,ge?.option,fc,cr]),pc=typeof k=="function"?k({invalido:wt,mensaje:pt}):k??pt,mc=W(Z.contenedor_base,Z[`variante_${g}`],Z[`tam_${u}`],Z[`radio_${p}`],Z[`color_${f}`],{[Z.ancho_total]:h,[Z.sin_animacion]:m,[Z.deshabilitado]:Ce,[Z.solo_lectura]:L,[Z.invalido]:wt,[Z.valido]:mt,[Z.abierto]:fe,[Z.tiene_valor]:so},ge?.base,_e);return R&&!Ee?a.jsx(wh,{...e,esInvalido:wt,estaDeshabilitadoReal:Ce,clasesBase:mc,renderizarValorMostrado:gc}):a.jsxs("div",{className:mc,style:ke,children:[y&&a.jsxs("label",{id:`${Se}-label`,className:W(Z.etiqueta,ge?.label),children:[y,M&&a.jsx("span",{className:Z.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:K=>{Pt.setReference(K),ce.current=K},id:Se,tabIndex:Ce?-1:0,className:W(Z.trigger,S&&b&&Z.trigger_expandido,ge?.trigger),"aria-labelledby":y?`${Se}-label`:void 0,onFocus:G,onBlur:ue,...ym(),children:[J&&a.jsx("span",{className:Z.contenido_inicio,children:J}),a.jsx("div",{className:W(Z.valor_wrapper,S&&b&&Z.mostrar_todos,S&&b&&Z.valor_wrapper_expandido,ge?.value),children:gc()}),a.jsxs("div",{className:Z.acciones,children:[B&&so&&!L&&!Ce&&a.jsx("button",{type:"button",className:W(Z.boton_limpiar,ge?.clearButton),onClick:xm,tabIndex:-1,children:a.jsx(wl,{size:"1em"})}),re&&a.jsx("span",{className:Z.contenido_final,children:re}),E?a.jsx("span",{className:Z.icono_spinner,children:a.jsx(bh,{size:"1em"})}):a.jsx("span",{className:Z.icono_chevron,children:a.jsx(bl,{size:"1em"})})]})]}),(ie||M)&&a.jsxs("select",{"aria-hidden":!0,tabIndex:-1,name:ie,required:M,value:b&&Array.isArray(be)?be.map(K=>String(Ae(K))):be?String(Ae(be)):b?[]:"",onChange:()=>{},onFocus:K=>K.target.blur(),className:Z.input_validacion,multiple:b,"data-testid":`select-native-${Se}`,children:[!b&&(B||!so)&&a.jsxs("option",{value:"",children:["— ",w||"Seleccionar"]}),Oe.map(K=>K.datos!==null&&a.jsx("option",{value:String(Ae(K.datos)),children:Re(K.datos)},`opcion-${Ae(K.datos)}`))]}),Mn&&a.jsx(Uo,{root:ye,children:a.jsx(ls,{context:we,modal:!1,initialFocus:q?xe:-1,children:a.jsxs("div",{ref:Pt.setFloating,style:{...me,...oo,zIndex:Y??"var(--z-popover)"},className:W(Z.menu,ge?.menu),...Cm(),children:[q&&a.jsx("div",{className:Z.buscador_wrapper,children:a.jsxs("div",{className:Z.buscador_interno,children:[a.jsx("span",{className:Z.icono_buscar,children:a.jsx(vh,{})}),a.jsx("input",{ref:xe,type:"text",className:W(Z.input_busqueda,ge?.searchInput),placeholder:"Buscar...",value:Je,onChange:Sm,onKeyDown:$m})]})}),a.jsx("ul",{ref:ne,className:W(Z.lista_opciones,D&&Z.lista_virtual),style:{flex:1,maxHeight:"100%",overflowY:"auto",position:D&&Oe.length>gs?"relative":void 0},children:Oe.length===0?a.jsx("li",{className:Z.sin_resultados,children:Je?T:A}):D&&Oe.length>gs?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${An.getTotalSize()}px`,position:"relative",width:"100%"},children:An.getVirtualItems().map(K=>{const De=Oe[K.index];return De?a.jsx("div",{style:{position:"absolute",top:0,left:"var(--gaps-1)",right:"var(--gaps-1)",width:"auto",height:`${Math.max(K.size-2,1)}px`,transform:`translateY(${K.start+1}px)`},children:hc(De,K.index)},`virtual-${K.index}`):null})})}):Oe.map((K,De)=>hc(K,De))})]})})}),C&&!wt&&a.jsx("div",{className:W(Z.descripcion,ge?.description),children:C}),wt&&pc&&a.jsx("div",{className:W(Z.mensaje_error,ge?.errorMessage),children:pc})]})}const Eh=v.forwardRef(kh),yl=v.memo(Eh);yl.displayName="SelectBase";function Ih(e,t){const{options:n=[],value:o,onChange:r,onValueChange:s,optionValueKey:i,optionLabelKey:l="label",isMultiple:c=!1,devolverObjeto:d=!1,..._}=e,g=v.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),f=v.useMemo(()=>{if(!g||!i)return null;const h=new Map;for(const m of n)h.set(String(m[i]),m);return h},[n,i,g]),u=v.useMemo(()=>{if(o==null||!g||d)return o;const h=m=>f?.get(String(m));return c&&Array.isArray(o)?o.map(h).filter(m=>m!==void 0):h(o)??null},[o,f,c,d,g]),p=v.useCallback(h=>{const m=r||s;if(!m)return;if(h===null){m(c?[]:d||!g?null:"");return}if(d||!g){m(h);return}const y=w=>typeof w=="string"?w:w[i];m(c&&Array.isArray(h)?h.map(y):y(h))},[r,s,d,c,i,g]);return a.jsx(yl,{..._,ref:t,options:n,value:u,onChange:p,optionValueKey:i,optionLabelKey:l,isMultiple:c})}const Cl=v.forwardRef(Ih);Cl.displayName="Select";const Zn={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function gn({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:s=8,delayShow:i=100,delayHide:l=0,isDisabled:c=!1,showArrow:d=!1,maxWidth:_="320px",isInteractive:g=!1,className:f="",onOpen:u,onClose:p,isOpen:h,onOpenChange:m}){const[y,w]=v.useState(!1),C=v.useRef(null),k=h!==void 0?h:y,A=v.useCallback(F=>{c||(m?m(F):w(F),F?u?.():p?.())},[c,m,u,p]),{refs:T,floatingStyles:M,context:P,isPositioned:L}=Go({open:k,onOpenChange:A,placement:n,strategy:"fixed",middleware:[Lo(s+(d?8:0)),zo({fallbackAxisSideDirection:"start",padding:8}),Oo({padding:8}),d?Cg({element:C}):void 0].filter(Boolean),whileElementsMounted:To}),E=rs(P,{delay:{open:i,close:g?200:l||100},enabled:!c,move:!1,handleClose:null}),B=Rg(P,{enabled:!c}),V=Wo(P,{enabled:!c}),$=Zo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=Ko([E,B,V,$]),{isMounted:O,styles:D}=Jo(P,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=v.useMemo(()=>[Zn.tooltip,Zn[`size_${r}`],Zn[`variant_${o}`],f].filter(Boolean).join(" "),[r,o,f]),I=v.useMemo(()=>v.cloneElement(t,b({ref:T.setReference,...t.props})),[t,b,T.setReference]);return!e||c?t:a.jsxs(a.Fragment,{children:[I,O&&a.jsx(Uo,{children:a.jsx("div",{ref:T.setFloating,className:Zn.tooltip_positioner,style:{...M,maxWidth:_,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:x,style:{...D,pointerEvents:g?"auto":"none",visibility:L||!k?"visible":"hidden"},...S(),children:[e,d&&a.jsx(Ig,{ref:C,context:P,className:Zn.arrow})]})})})]})}/**
|
|
8
661
|
* table-core
|
|
9
662
|
*
|
|
10
663
|
* Copyright (c) TanStack
|
|
@@ -13,10 +666,10 @@
|
|
|
13
666
|
* LICENSE.md file in the root directory of this source tree.
|
|
14
667
|
*
|
|
15
668
|
* @license MIT
|
|
16
|
-
*/function
|
|
669
|
+
*/function en(e,t){return typeof e=="function"?e(t):e}function $t(e,t){return n=>{t.setState(o=>({...o,[e]:en(n,o[e])}))}}function tr(e){return e instanceof Function}function Nh(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Mh(e,t){const n=[],o=r=>{r.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&o(i)})};return o(e),n}function ae(e,t,n){let o=[],r;return s=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(s);if(!(l.length!==o.length||l.some((_,g)=>o[g]!==_)))return r;o=l;let d;if(n.key&&n.debug&&(d=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const _=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-d)*100)/100,f=g/16,u=(p,h)=>{for(p=String(p);p.length<h;)p=" "+p;return p};console.info(`%c⏱ ${u(g,5)} /${u(_,5)} ms`,`
|
|
17
670
|
font-size: .6rem;
|
|
18
671
|
font-weight: bold;
|
|
19
|
-
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,t?.key)}return r}}function fe(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 Xd(e,n,t,o){const r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:ue(()=>[e,t,n,i],(a,l,d,u)=>({table:a,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),fe(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,t,n,e)},{}),i}function Zd(e,n,t,o){var r,i;const l={...e._getDefaultColumnDef(),...n},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:d&&(d.includes(".")?_=f=>{let c=f;for(const p of d.split(".")){var h;c=(h=c)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:_=f=>f[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:_,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:ue(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(c=>c.getFlatColumns())]},fe(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ue(()=>[e._getOrderColumnsFn()],f=>{var c;if((c=g.columns)!=null&&c.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return f(h)}return[g]},fe(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const ct="debugHeaders";function Os(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 a=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(i),a},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const Jd={createTable:e=>{e.getHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,a;const l=(i=o?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=(a=r?.map(g=>t.find(f=>f.id===g)).filter(Boolean))!=null?a:[],u=t.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return ko(n,[...l,...u,...d],e)},fe(e.options,ct,"getHeaderGroups")),e.getCenterHeaderGroups=ue(()=>[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))),ko(n,t,e,"center")),fe(e.options,ct,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o?.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return ko(n,i,e,"left")},fe(e.options,ct,"getLeftHeaderGroups")),e.getRightHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o?.map(a=>t.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return ko(n,i,e,"right")},fe(e.options,ct,"getRightHeaderGroups")),e.getFooterGroups=ue(()=>[e.getHeaderGroups()],n=>[...n].reverse(),fe(e.options,ct,"getFooterGroups")),e.getLeftFooterGroups=ue(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),fe(e.options,ct,"getLeftFooterGroups")),e.getCenterFooterGroups=ue(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),fe(e.options,ct,"getCenterFooterGroups")),e.getRightFooterGroups=ue(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),fe(e.options,ct,"getRightFooterGroups")),e.getFlatHeaders=ue(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),fe(e.options,ct,"getFlatHeaders")),e.getLeftFlatHeaders=ue(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),fe(e.options,ct,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ue(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),fe(e.options,ct,"getCenterFlatHeaders")),e.getRightFlatHeaders=ue(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),fe(e.options,ct,"getRightFlatHeaders")),e.getCenterLeafHeaders=ue(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),fe(e.options,ct,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ue(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),fe(e.options,ct,"getLeftLeafHeaders")),e.getRightLeafHeaders=ue(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),fe(e.options,ct,"getRightLeafHeaders")),e.getLeafHeaders=ue(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,a,l,d,u;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=t[0])==null?void 0:l.headers)!=null?a:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(_=>_.getLeafHeaders()).flat()},fe(e.options,ct,"getLeafHeaders"))}};function ko(e,n,t,o){var r,i;let a=0;const l=function(f,c){c===void 0&&(c=1),a=Math.max(a,c),f.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(f,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const w=[...p].reverse()[0],y=v.column.depth===h.depth;let x,E=!1;if(y&&v.column.parent?x=v.column.parent:(x=v.column,E=!0),w&&w?.column===x)w.subHeaders.push(v);else{const A=Os(t,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:E,placeholderId:E?`${p.filter(D=>D.column===x).length}`:void 0,depth:c,index:p.length});A.subHeaders.push(v),p.push(A)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(p,c-1)},_=n.map((f,c)=>Os(t,f,{depth:a,index:c}));u(_,a-1),d.reverse();const g=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:E,rowSpan:A}=x;p+=E,w.push(A)})):p=1;const y=Math.min(...w);return v=v+y,h.colSpan=p,h.rowSpan=v,{colSpan:p,rowSpan:v}});return g((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const vr=(e,n,t,o,r,i,a)=>{let l={id:n,index:o,original:t,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Rd(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const _=u.getParentRow();if(!_)break;d.push(_),u=_}return d.reverse()},getAllCells:ue(()=>[e.getAllLeafColumns()],d=>d.map(u=>Xd(e,l,u,u.id)),fe(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ue(()=>[l.getAllCells()],d=>d.reduce((u,_)=>(u[_.column.id]=_,u),{}),fe(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(l,e)}return l},Qd={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()}}},Vs=(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))};Vs.autoRemove=e=>xt(e);const js=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};js.autoRemove=e=>xt(e);const qs=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};qs.autoRemove=e=>xt(e);const Bs=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Bs.autoRemove=e=>xt(e);const Hs=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Hs.autoRemove=e=>xt(e)||!(e!=null&&e.length);const Gs=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Gs.autoRemove=e=>xt(e)||!(e!=null&&e.length);const Ws=(e,n,t)=>e.getValue(n)===t;Ws.autoRemove=e=>xt(e);const Ks=(e,n,t)=>e.getValue(n)==t;Ks.autoRemove=e=>xt(e);const br=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};br.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,a=t===null||Number.isNaN(r)?1/0:r;if(i>a){const l=i;i=a,a=l}return[i,a]},br.autoRemove=e=>xt(e)||xt(e[0])&&xt(e[1]);const Dt={includesString:Vs,includesStringSensitive:js,equalsString:qs,arrIncludes:Bs,arrIncludesAll:Hs,arrIncludesSome:Gs,equals:Ws,weakEquals:Ks,inNumberRange:br};function xt(e){return e==null||e===""}const eu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:mt("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"?Dt.includesString:typeof o=="number"?Dt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Dt.equals:Array.isArray(o)?Dt.arrIncludes:Dt.weakEquals},e.getFilterFn=()=>{var t,o;return $o(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:Dt[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(_=>_.id===e.id),a=Bt(t,i?i.value:void 0);if(Us(r,a,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(i){var u;return(u=o?.map(_=>_.id===e.id?d:_))!=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=Bt(n,r))==null?void 0:i.filter(a=>{const l=t.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(Us(d,a.value,l))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 Us(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const wr={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 a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[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(!Yd(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,a)=>i-a);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},tu={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:mt("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 wr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return wr.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return $o(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:wr[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 nu(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(a=>a.id===i)).filter(Boolean),...o]}const ou={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:mt("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=ue(t=>[Mn(n,t)],t=>t.findIndex(o=>o.id===e.id),fe(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=Mn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=Mn(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=ue(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const a=[...n],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(_=>_.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return nu(i,t,o)},fe(e.options,"debugTable","_getOrderColumnsFn"))}},yr=()=>({left:[],right:[]}),ru={getInitialState:e=>({columnPinning:yr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:mt("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,a;if(t==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((d=r?.right)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(t==="left"){var u,_;return{left:[...((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=r?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((a=r?.right)!=null?a:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=n.options.enableColumnPinning)!=null?a:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(l=>o?.includes(l)),a=t.some(l=>r?.includes(l));return i?"left":a?"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=ue(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(a=>!i.includes(a.column.id))},fe(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ue(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),fe(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ue(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),fe(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?yr():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:yr())},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=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),fe(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),fe(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ue(()=>[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))},fe(e.options,"debugColumns","getCenterLeafColumns"))}};function iu(e){return e||(typeof document<"u"?document:null)}const Io={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Cr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),su={getDefaultColumnDef:()=>Io,getInitialState:e=>({columnSizing:{},columnSizingInfo:Cr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:mt("columnSizing",e),onColumnSizingInfoChange:mt("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:Io.minSize,(o=i??e.columnDef.size)!=null?o:Io.size),(r=e.columnDef.maxSize)!=null?r:Io.maxSize)},e.getStart=ue(t=>[t,Mn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),fe(n.options,"debugColumns","getStart")),e.getAfter=ue(t=>[t,Mn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),fe(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(),xr(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],d=xr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},_=(w,y)=>{typeof y=="number"&&(n.setColumnSizingInfo(x=>{var E,A;const D=n.options.columnResizeDirection==="rtl"?-1:1,N=(y-((E=x?.startOffset)!=null?E:0))*D,T=Math.max(N/((A=x?.startSize)!=null?A:0),-.999999);return x.columnSizingStart.forEach(L=>{let[I,O]=L;u[I]=Math.round(Math.max(O+O*T,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:T}}),(n.options.columnResizeMode==="onChange"||w==="end")&&n.setColumnSizing(x=>({...x,...u})))},g=w=>_("move",w),f=w=>{_("end",w),n.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=iu(t),h={moveHandler:w=>g(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var y;c?.removeEventListener("touchmove",p.moveHandler),c?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((y=w.touches[0])==null?void 0:y.clientX)}},v=au()?{passive:!1}:!1;xr(i)?(c?.addEventListener("touchmove",p.moveHandler,v),c?.addEventListener("touchend",p.upHandler,v)):(c?.addEventListener("mousemove",h.moveHandler,v),c?.addEventListener("mouseup",h.upHandler,v)),n.setColumnSizingInfo(w=>({...w,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,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?Cr():(t=e.initialState.columnSizingInfo)!=null?t:Cr())},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 Eo=null;function au(){if(typeof Eo=="boolean")return Eo;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 Eo=e,Eo}function xr(e){return e.type==="touchstart"}const lu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:mt("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=ue(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),fe(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ue(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],fe(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>ue(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),fe(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 Mn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const cu={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()}}},du={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:mt("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=()=>Dt.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return $o(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:Dt[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},uu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:mt("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 a=i.split(".");o=Math.max(o,a.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 a={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,t=(r=t)!=null?r:!i,!i&&t)return{...a,[e.id]:!0};if(i&&!t){const{[e.id]:l,...d}=a;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()}}}},Sr=0,$r=10,kr=()=>({pageIndex:Sr,pageSize:$r}),fu={getInitialState:e=>({...e,pagination:{...kr(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:mt("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=>Bt(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?kr():(r=e.initialState.pagination)!=null?r:kr())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Bt(o,r.pageIndex);const a=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,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Sr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Sr)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?$r:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:$r)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Bt(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=Bt(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=ue(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},fe(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}}},Ir=()=>({top:[],bottom:[]}),_u={getInitialState:e=>({rowPinning:Ir(),...e}),getDefaultOptions:e=>({onRowPinningChange:mt("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],a=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...a,e.id,...i]);n.setRowPinning(d=>{var u,_;if(t==="bottom"){var g,f;return{top:((g=d?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((f=d?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(t==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=d?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((_=d?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p)))}})},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(l=>o?.includes(l)),a=t.some(l=>r?.includes(l));return i?"top":a?"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(a=>{let{id:l}=a;return l});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?Ir():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:Ir())},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(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(a=>n.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),fe(e.options,"debugRows","getTopRows")),e.getBottomRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),fe(e.options,"debugRows","getBottomRows")),e.getCenterRows=ue(()=>[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))},fe(e.options,"debugRows","getCenterRows"))}},gu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:mt("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=>{Er(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?Mr(e,t):{rows:[],flatRows:[],rowsById:{}},fe(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?Mr(e,t):{rows:[],flatRows:[],rowsById:{}},fe(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?Mr(e,t):{rows:[],flatRows:[],rowsById:{}},fe(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 a;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const l={...i};return Er(l,e.id,t,(a=o?.selectChildren)!=null?a:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return Nr(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return Fr(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return Fr(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)}}}},Er=(e,n,t,o,r)=>{var i;const a=r.getRow(n,!0);t?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Er(e,l.id,t,o,r))};function Mr(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(d=>{var u;const _=Nr(d,t);if(_&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),_)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function Nr(e,n){var t;return(t=n[e.id])!=null?t:!1}function Fr(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(Nr(a,n)?i=!0:r=!1),a.subRows&&a.subRows.length)){const l=Fr(a,n);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Ar=/([0-9]+)/gm,pu=(e,n,t)=>Ys(Ht(e.getValue(t)).toLowerCase(),Ht(n.getValue(t)).toLowerCase()),hu=(e,n,t)=>Ys(Ht(e.getValue(t)),Ht(n.getValue(t))),mu=(e,n,t)=>Dr(Ht(e.getValue(t)).toLowerCase(),Ht(n.getValue(t)).toLowerCase()),vu=(e,n,t)=>Dr(Ht(e.getValue(t)),Ht(n.getValue(t))),bu=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},wu=(e,n,t)=>Dr(e.getValue(t),n.getValue(t));function Dr(e,n){return e===n?0:e>n?1:-1}function Ht(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ys(e,n){const t=e.split(Ar).filter(Boolean),o=n.split(Ar).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),d=[a,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return t.length-o.length}const Nn={alphanumeric:pu,alphanumericCaseSensitive:hu,text:mu,textCaseSensitive:vu,datetime:bu,basic:wu},yu=[Jd,lu,ou,ru,Qd,eu,cu,du,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:mt("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 Nn.datetime;if(typeof i=="string"&&(o=!0,i.split(Ar).length>1))return Nn.alphanumeric}return o?Nn.text:Nn.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 $o(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:Nn[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(a=>{const l=a?.find(c=>c.id===e.id),d=a?.findIndex(c=>c.id===e.id);let u=[],_,g=i?t:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":a!=null&&a.length&&d!==a.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(i||r||(_="remove")),_==="add"){var f;u=[...a,{id:e.id,desc:g}],u.splice(0,u.length-((f=n.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:g}:c):_==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:g}];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(),a=e.getIsSorted();return a?a!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:a==="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())}},tu,uu,fu,_u,gu,su];function Cu(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...yu,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((f,c)=>Object.assign(f,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=f=>r.options.mergeOptions?r.options.mergeOptions(i,f):{...i,...f};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(f=>{var c;d=(c=f.getInitialState==null?void 0:f.getInitialState(d))!=null?c:d});const u=[];let _=!1;const g={_features:o,options:{...i,...e},initialState:d,_queue:f=>{u.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();_=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const c=Bt(f,r.options);r.options=a(c)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,c,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(f,c,h))!=null?p:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(f,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!h&&(h=r.getCoreRowModel().rowsById[f],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return h},_getDefaultColumnDef:ue(()=>[r.options.defaultColumn],f=>{var c;return f=(c=f)!=null?c:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},fe(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ue(()=>[r._getColumnDefs()],f=>{const c=function(h,p,v){return v===void 0&&(v=0),h.map(w=>{const y=Zd(r,w,v,p),x=w;return y.columns=x.columns?c(x.columns,y,v+1):[],y})};return c(f)},fe(e,"debugColumns","getAllColumns")),getAllFlatColumns:ue(()=>[r.getAllColumns()],f=>f.flatMap(c=>c.getFlatColumns()),fe(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ue(()=>[r.getAllFlatColumns()],f=>f.reduce((c,h)=>(c[h.id]=h,c),{}),fe(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ue(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,c)=>{let h=f.flatMap(p=>p.getLeafColumns());return c(h)},fe(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const c=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${f}' does not exist.`),c}};Object.assign(r,g);for(let f=0;f<r._features.length;f++){const c=r._features[f];c==null||c.createTable==null||c.createTable(r)}return r}function xu(){return e=>ue(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const _=vr(e,e._getRowId(r[u],u,a),r[u],u,i,void 0,a?.id);if(t.flatRows.push(_),t.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var d;_.originalSubRows=e.options.getSubRows(r[u],u),(d=_.originalSubRows)!=null&&d.length&&(_.subRows=o(_.originalSubRows,i+1,_))}}return l};return t.rows=o(n),t},fe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Su(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 $u(e,n,t){return t.options.filterFromLeafRows?ku(e,n,t):Iu(e,n,t)}function ku(e,n,t){var o;const r=[],i={},a=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){var g;let c=d[f];const h=vr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(g=c.subRows)!=null&&g.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,n(c)&&!h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}if(n(c)||h.subRows.length){_.push(c),i[c.id]=c,r.push(c);continue}}else c=h,n(c)&&(_.push(c),i[c.id]=c,r.push(c))}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Iu(e,n,t){var o;const r=[],i={},a=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const _=[];for(let f=0;f<d.length;f++){let c=d[f];if(n(c)){var g;if((g=c.subRows)!=null&&g.length&&u<a){const p=vr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=l(c.subRows,u+1),c=p}_.push(c),r.push(c),i[c.id]=c}}return _};return{rows:l(e),flatRows:r,rowsById:i}}function Eu(){return e=>ue(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let f=0;f<n.flatRows.length;f++)n.flatRows[f].columnFilters={},n.flatRows[f].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(f=>{var c;const h=e.getColumn(f.id);if(!h)return;const p=h.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}r.push({id:f.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?c:f.value})});const a=(t??[]).map(f=>f.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&d.length&&(a.push("__global__"),d.forEach(f=>{var c;i.push({id:f.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,_;for(let f=0;f<n.flatRows.length;f++){const c=n.flatRows[f];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,v=>{c.columnFiltersMeta[p]=v})}if(i.length){for(let h=0;h<i.length;h++){_=i[h];const p=_.id;if(_.filterFn(c,p,_.resolvedValue,v=>{c.columnFiltersMeta[p]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const g=f=>{for(let c=0;c<a.length;c++)if(f.columnFilters[a[c]]===!1)return!1;return!0};return $u(n.rows,g,e)},fe(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Mu(e){return n=>ue(()=>[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:a,flatRows:l,rowsById:d}=o;const u=r*i,_=u+r;a=a.slice(u,_);let g;n.options.paginateExpandedRows?g={rows:a,flatRows:l,rowsById:d}:g=Su({rows:a,flatRows:l,rowsById:d}),g.flatRows=[];const f=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(f)};return g.rows.forEach(f),g},fe(n.options,"debugTable","getPaginationRowModel"))}function Nu(){return e=>ue(()=>[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()}),a={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(a[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(_=>({..._}));return u.sort((_,g)=>{for(let c=0;c<i.length;c+=1){var f;const h=i[c],p=a[h.id],v=p.sortUndefined,w=(f=h?.desc)!=null?f:!1;let y=0;if(v){const x=_.getValue(h.id),E=g.getValue(h.id),A=x===void 0,D=E===void 0;if(A||D){if(v==="first")return A?-1:1;if(v==="last")return A?1:-1;y=A&&D?0:A?v:-v}}if(y===0&&(y=p.sortingFn(_,g,h.id)),y!==0)return w&&(y*=-1),p.invertSorting&&(y*=-1),y}return _.index-g.index}),u.forEach(_=>{var g;r.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),u};return{rows:l(t.rows),flatRows:r,rowsById:t.rowsById}},fe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
672
|
+
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n?.key)}return r}}function le(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function Ah(e,t,n,o){const r=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ae(()=>[e,n,t,s],(i,l,c,d)=>({table:i,column:l,row:c,cell:d,getValue:d.getValue,renderValue:d.renderValue}),le(e.options,"debugCells","cell.getContext"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function Dh(e,t,n,o){var r,s;const l={...e._getDefaultColumnDef(),...t},c=l.accessorKey;let d=(r=(s=l.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,_;if(l.accessorFn?_=l.accessorFn:c&&(c.includes(".")?_=f=>{let u=f;for(const h of c.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 "${c}" returned undefined.`)}return u}:_=f=>f[l.accessorKey]),!d)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(d)}`,accessorFn:_,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ae(()=>[!0],()=>{var f;return[g,...(f=g.columns)==null?void 0:f.flatMap(u=>u.getFlatColumns())]},le(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ae(()=>[e._getOrderColumnsFn()],f=>{var u;if((u=g.columns)!=null&&u.length){let p=g.columns.flatMap(h=>h.getLeafColumns());return f(p)}return[g]},le(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(g,e);return g}const ft="debugHeaders";function xl(e,t,n){var o;let s={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(l),i.push(c)};return l(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const Th={createTable:e=>{e.getHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var s,i;const l=(s=o?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?s:[],c=(i=r?.map(g=>n.find(f=>f.id===g)).filter(Boolean))!=null?i:[],d=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return nr(t,[...l,...d,...c],e)},le(e.options,ft,"getHeaderGroups")),e.getCenterHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(s=>!(o!=null&&o.includes(s.id))&&!(r!=null&&r.includes(s.id))),nr(t,n,e,"center")),le(e.options,ft,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const s=(r=o?.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return nr(t,s,e,"left")},le(e.options,ft,"getLeftHeaderGroups")),e.getRightHeaderGroups=ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const s=(r=o?.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?r:[];return nr(t,s,e,"right")},le(e.options,ft,"getRightHeaderGroups")),e.getFooterGroups=ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getFooterGroups")),e.getLeftFooterGroups=ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getLeftFooterGroups")),e.getCenterFooterGroups=ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getCenterFooterGroups")),e.getRightFooterGroups=ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),le(e.options,ft,"getRightFooterGroups")),e.getFlatHeaders=ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getFlatHeaders")),e.getLeftFlatHeaders=ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getCenterFlatHeaders")),e.getRightFlatHeaders=ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),le(e.options,ft,"getRightFlatHeaders")),e.getCenterLeafHeaders=ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getLeftLeafHeaders")),e.getRightLeafHeaders=ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),le(e.options,ft,"getRightLeafHeaders")),e.getLeafHeaders=ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,s,i,l,c,d;return[...(r=(s=t[0])==null?void 0:s.headers)!=null?r:[],...(i=(l=n[0])==null?void 0:l.headers)!=null?i:[],...(c=(d=o[0])==null?void 0:d.headers)!=null?c:[]].map(_=>_.getLeafHeaders()).flat()},le(e.options,ft,"getLeafHeaders"))}};function nr(e,t,n,o){var r,s;let i=0;const l=function(f,u){u===void 0&&(u=1),i=Math.max(i,u),f.filter(p=>p.getIsVisible()).forEach(p=>{var h;(h=p.columns)!=null&&h.length&&l(p.columns,u+1)},0)};l(e);let c=[];const d=(f,u)=>{const p={depth:u,id:[o,`${u}`].filter(Boolean).join("_"),headers:[]},h=[];f.forEach(m=>{const y=[...h].reverse()[0],w=m.column.depth===p.depth;let C,k=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,k=!0),y&&y?.column===C)y.subHeaders.push(m);else{const A=xl(n,C,{id:[o,u,C.id,m?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${h.filter(T=>T.column===C).length}`:void 0,depth:u,index:h.length});A.subHeaders.push(m),h.push(A)}p.headers.push(m),m.headerGroup=p}),c.push(p),u>0&&d(h,u-1)},_=t.map((f,u)=>xl(n,f,{depth:i,index:u}));d(_,i-1),c.reverse();const g=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let h=0,m=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],g(p.subHeaders).forEach(C=>{let{colSpan:k,rowSpan:A}=C;h+=k,y.push(A)})):h=1;const w=Math.min(...y);return m=m+w,p.colSpan=h,p.rowSpan=m,{colSpan:h,rowSpan:m}});return g((r=(s=c[0])==null?void 0:s.headers)!=null?r:[]),c}const hs=(e,t,n,o,r,s,i)=>{let l={id:t,index:o,original:n,depth:r,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(l._valuesCache.hasOwnProperty(c))return l._valuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return l._valuesCache[c]=d.accessorFn(l.original,o),l._valuesCache[c]},getUniqueValues:c=>{if(l._uniqueValuesCache.hasOwnProperty(c))return l._uniqueValuesCache[c];const d=e.getColumn(c);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[c]=d.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[c]):(l._uniqueValuesCache[c]=[l.getValue(c)],l._uniqueValuesCache[c])},renderValue:c=>{var d;return(d=l.getValue(c))!=null?d:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Mh(l.subRows,c=>c.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let c=[],d=l;for(;;){const _=d.getParentRow();if(!_)break;c.push(_),d=_}return c.reverse()},getAllCells:ae(()=>[e.getAllLeafColumns()],c=>c.map(d=>Ah(e,l,d,d.id)),le(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ae(()=>[l.getAllCells()],c=>c.reduce((d,_)=>(d[_.column.id]=_,d),{}),le(e.options,"debugRows","getAllCellsByColumnId"))};for(let c=0;c<e._features.length;c++){const d=e._features[c];d==null||d.createRow==null||d.createRow(l,e)}return l},Fh={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Sl=(e,t,n)=>{var o,r;const s=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};Sl.autoRemove=e=>Mt(e);const $l=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};$l.autoRemove=e=>Mt(e);const kl=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};kl.autoRemove=e=>Mt(e);const El=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};El.autoRemove=e=>Mt(e);const Il=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Il.autoRemove=e=>Mt(e)||!(e!=null&&e.length);const Nl=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Nl.autoRemove=e=>Mt(e)||!(e!=null&&e.length);const Ml=(e,t,n)=>e.getValue(t)===n;Ml.autoRemove=e=>Mt(e);const Al=(e,t,n)=>e.getValue(t)==n;Al.autoRemove=e=>Mt(e);const ps=(e,t,n)=>{let[o,r]=n;const s=e.getValue(t);return s>=o&&s<=r};ps.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(o)?-1/0:o,i=n===null||Number.isNaN(r)?1/0:r;if(s>i){const l=s;s=i,i=l}return[s,i]},ps.autoRemove=e=>Mt(e)||Mt(e[0])&&Mt(e[1]);const qt={includesString:Sl,includesStringSensitive:$l,equalsString:kl,arrIncludes:El,arrIncludesAll:Il,arrIncludesSome:Nl,equals:Ml,weakEquals:Al,inNumberRange:ps};function Mt(e){return e==null||e===""}const Ph={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$t("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?qt.includesString:typeof o=="number"?qt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?qt.equals:Array.isArray(o)?qt.arrIncludes:qt.weakEquals},e.getFilterFn=()=>{var n,o;return tr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:qt[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),s=o?.find(_=>_.id===e.id),i=en(n,s?s.value:void 0);if(Dl(r,i,e)){var l;return(l=o?.filter(_=>_.id!==e.id))!=null?l:[]}const c={id:e.id,value:i};if(s){var d;return(d=o?.map(_=>_.id===e.id?c:_))!=null?d:[]}return o!=null&&o.length?[...o,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var s;return(s=en(t,r))==null?void 0:s.filter(i=>{const l=n.find(c=>c.id===i.id);if(l){const c=l.getFilterFn();if(Dl(c,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},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 Dl(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ms={sum:(e,t,n)=>n.reduce((o,r)=>{const s=r.getValue(e);return o+(typeof s=="number"?s:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o>s||o===void 0&&s>=s)&&(o=s)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const s=r.getValue(e);s!=null&&(o<s||o===void 0&&s>=s)&&(o=s)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(o===void 0?i>=i&&(o=r=i):(o>i&&(o=i),r<i&&(r=i)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let s=r.getValue(e);s!=null&&(s=+s)>=s&&(++n,o+=s)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Nh(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((s,i)=>s-i);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},Lh={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$t("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return ms.sum;if(Object.prototype.toString.call(o)==="[object Date]")return ms.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return tr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:ms[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function Oh(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(s=>!t.includes(s.id));return n==="remove"?o:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...o]}const zh={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$t("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ae(n=>[Jn(t,n)],n=>n.findIndex(o=>o.id===e.id),le(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Jn(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Jn(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let s=[];if(!(t!=null&&t.length))s=r;else{const i=[...t],l=[...r];for(;l.length&&i.length;){const c=i.shift(),d=l.findIndex(_=>_.id===c);d>-1&&s.push(l.splice(d,1)[0])}s=[...s,...l]}return Oh(s,n,o)},le(e.options,"debugTable","_getOrderColumnsFn"))}},vs=()=>({left:[],right:[]}),Bh={getInitialState:e=>({columnPinning:vs(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$t("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var s,i;if(n==="right"){var l,c;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((c=r?.right)!=null?c:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var d,_;return{left:[...((d=r?.left)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((_=r?.right)!=null?_:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((s=r?.left)!=null?s:[]).filter(g=>!(o!=null&&o.includes(g))),right:((i=r?.right)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,s,i;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,s=n.some(l=>o?.includes(l)),i=n.some(l=>r?.includes(l));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const s=[...o??[],...r??[]];return n.filter(i=>!s.includes(i.column.id))},le(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),le(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),le(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?vs():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:vs())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,s;return!!((r=o.left)!=null&&r.length||(s=o.right)!=null&&s.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),le(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(s=>!r.includes(s.id))},le(e.options,"debugColumns","getCenterLeafColumns"))}};function Vh(e){return e||(typeof document<"u"?document:null)}const or={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},bs=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),jh={getDefaultColumnDef:()=>or,getInitialState:e=>({columnSizing:{},columnSizingInfo:bs(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$t("columnSizing",e),onColumnSizingInfoChange:$t("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:or.minSize,(o=s??e.columnDef.size)!=null?o:or.size),(r=e.columnDef.maxSize)!=null?r:or.maxSize)},e.getStart=ae(n=>[n,Jn(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,s)=>r+s.getSize(),0),le(t.options,"debugColumns","getStart")),e.getAfter=ae(n=>[n,Jn(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,s)=>r+s.getSize(),0),le(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var s;n+=(s=r.column.getSize())!=null?s:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return s=>{if(!o||!r||(s.persist==null||s.persist(),ws(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[o.id,o.getSize()]],c=ws(s)?Math.round(s.touches[0].clientX):s.clientX,d={},_=(y,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(C=>{var k,A;const T=t.options.columnResizeDirection==="rtl"?-1:1,M=(w-((k=C?.startOffset)!=null?k:0))*T,P=Math.max(M/((A=C?.startSize)!=null?A:0),-.999999);return C.columnSizingStart.forEach(L=>{let[E,B]=L;d[E]=Math.round(Math.max(B+B*P,0)*100)/100}),{...C,deltaOffset:M,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(C=>({...C,...d})))},g=y=>_("move",y),f=y=>{_("end",y),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},u=Vh(n),p={moveHandler:y=>g(y.clientX),upHandler:y=>{u?.removeEventListener("mousemove",p.moveHandler),u?.removeEventListener("mouseup",p.upHandler),f(y.clientX)}},h={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),g(y.touches[0].clientX),!1),upHandler:y=>{var w;u?.removeEventListener("touchmove",h.moveHandler),u?.removeEventListener("touchend",h.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((w=y.touches[0])==null?void 0:w.clientX)}},m=qh()?{passive:!1}:!1;ws(s)?(u?.addEventListener("touchmove",h.moveHandler,m),u?.addEventListener("touchend",h.upHandler,m)):(u?.addEventListener("mousemove",p.moveHandler,m),u?.addEventListener("mouseup",p.upHandler,m)),t.setColumnSizingInfo(y=>({...y,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?bs():(n=e.initialState.columnSizingInfo)!=null?n:bs())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let rr=null;function qh(){if(typeof rr=="boolean")return rr;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return rr=e,rr}function ws(e){return e.type==="touchstart"}const Hh={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$t("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(s=>s.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),le(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],le(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ae(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),le(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,s)=>({...r,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Jn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Rh={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()}}},Uh={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$t("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return tr(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:qt[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Wh={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$t("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!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,s;e.setExpanded(o?{}:(r=(s=e.initialState)==null?void 0:s.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(s=>{const i=s.split(".");o=Math.max(o,i.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,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const s=o===!0?!0:!!(o!=null&&o[e.id]);let i={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=o,n=(r=n)!=null?r:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:l,...c}=i;return c}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ys=0,Cs=10,xs=()=>({pageIndex:ys,pageSize:Cs}),Gh={getInitialState:e=>({...e,pagination:{...xs(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$t("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=s=>en(o,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?xs():(r=e.initialState.pagination)!=null?r:xs())},e.setPageIndex=o=>{e.setPagination(r=>{let s=en(o,r.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...r,pageIndex:s}})},e.resetPageIndex=o=>{var r,s;e.setPageIndex(o?ys:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?r:ys)},e.resetPageSize=o=>{var r,s;e.setPageSize(o?Cs:(r=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?r:Cs)},e.setPageSize=o=>{e.setPagination(r=>{const s=Math.max(1,en(o,r.pageSize)),i=r.pageSize*r.pageIndex,l=Math.floor(i/s);return{...r,pageIndex:l,pageSize:s}})},e.setPageCount=o=>e.setPagination(r=>{var s;let i=en(o,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...r,pageCount:i}}),e.getPageOptions=ae(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((s,i)=>i)),r},le(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}}},Ss=()=>({top:[],bottom:[]}),Kh={getInitialState:e=>({rowPinning:Ss(),...e}),getDefaultOptions:e=>({onRowPinningChange:$t("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const s=o?e.getLeafRows().map(c=>{let{id:d}=c;return d}):[],i=r?e.getParentRows().map(c=>{let{id:d}=c;return d}):[],l=new Set([...i,e.id,...s]);t.setRowPinning(c=>{var d,_;if(n==="bottom"){var g,f;return{top:((g=c?.top)!=null?g:[]).filter(h=>!(l!=null&&l.has(h))),bottom:[...((f=c?.bottom)!=null?f:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)]}}if(n==="top"){var u,p;return{top:[...((u=c?.top)!=null?u:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)],bottom:((p=c?.bottom)!=null?p:[]).filter(h=>!(l!=null&&l.has(h)))}}return{top:((d=c?.top)!=null?d:[]).filter(h=>!(l!=null&&l.has(h))),bottom:((_=c?.bottom)!=null?_:[]).filter(h=>!(l!=null&&l.has(h)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,s=n.some(l=>o?.includes(l)),i=n.some(l=>r?.includes(l));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const s=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:l}=i;return l});return(o=s?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Ss():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Ss())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,s;return!!((r=o.top)!=null&&r.length||(s=o.bottom)!=null&&s.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:o}))},e.getTopRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),le(e.options,"debugRows","getTopRows")),e.getBottomRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),le(e.options,"debugRows","getBottomRows")),e.getCenterRows=ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(s=>!r.has(s.id))},le(e.options,"debugRows","getCenterRows"))}},Xh={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$t("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(s=>{s.getCanSelect()&&(o[s.id]=!0)}):r.forEach(s=>{delete o[s.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(s=>{$s(r,s.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ks(e,n):{rows:[],flatRows:[],rowsById:{}},le(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return s;const l={...s};return $s(l,e.id,n,(i=o?.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Es(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Is(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Is(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},$s=(e,t,n,o,r)=>{var s;const i=r.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>$s(e,l.id,n,o,r))};function ks(e,t){const n=e.getState().rowSelection,o=[],r={},s=function(i,l){return i.map(c=>{var d;const _=Es(c,n);if(_&&(o.push(c),r[c.id]=c),(d=c.subRows)!=null&&d.length&&(c={...c,subRows:s(c.subRows)}),_)return c}).filter(Boolean)};return{rows:s(t.rows),flatRows:o,rowsById:r}}function Es(e,t){var n;return(n=t[e.id])!=null?n:!1}function Is(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!r)&&(i.getCanSelect()&&(Es(i,t)?s=!0:r=!1),i.subRows&&i.subRows.length)){const l=Is(i,t);l==="all"?s=!0:(l==="some"&&(s=!0),r=!1)}}),r?"all":s?"some":!1}const Ns=/([0-9]+)/gm,Yh=(e,t,n)=>Tl(tn(e.getValue(n)).toLowerCase(),tn(t.getValue(n)).toLowerCase()),Zh=(e,t,n)=>Tl(tn(e.getValue(n)),tn(t.getValue(n))),Jh=(e,t,n)=>Ms(tn(e.getValue(n)).toLowerCase(),tn(t.getValue(n)).toLowerCase()),Qh=(e,t,n)=>Ms(tn(e.getValue(n)),tn(t.getValue(n))),ep=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},tp=(e,t,n)=>Ms(e.getValue(n),t.getValue(n));function Ms(e,t){return e===t?0:e>t?1:-1}function tn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Tl(e,t){const n=e.split(Ns).filter(Boolean),o=t.split(Ns).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),s=o.shift(),i=parseInt(r,10),l=parseInt(s,10),c=[i,l].sort();if(isNaN(c[0])){if(r>s)return 1;if(s>r)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return n.length-o.length}const Qn={alphanumeric:Yh,alphanumericCaseSensitive:Zh,text:Jh,textCaseSensitive:Qh,datetime:ep,basic:tp},np=[Th,Hh,zh,Bh,Fh,Ph,Rh,Uh,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$t("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const s=r?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return Qn.datetime;if(typeof s=="string"&&(o=!0,s.split(Ns).length>1))return Qn.alphanumeric}return o?Qn.text:Qn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return tr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Qn[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i?.find(u=>u.id===e.id),c=i?.findIndex(u=>u.id===e.id);let d=[],_,g=s?n:r==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&o?l?_="toggle":_="add":i!=null&&i.length&&c!==i.length-1?_="replace":l?_="toggle":_="replace",_==="toggle"&&(s||r||(_="remove")),_==="add"){var f;d=[...i,{id:e.id,desc:g}],d.splice(0,d.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else _==="toggle"?d=i.map(u=>u.id===e.id?{...u,desc:g}:u):_==="remove"?d=i.filter(u=>u.id!==e.id):d=[{id:e.id,desc:g}];return d})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},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())}},Lh,Wh,Gh,Kh,Xh,jh];function op(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...np,...(t=e._features)!=null?t:[]];let r={_features:o};const s=r._features.reduce((f,u)=>Object.assign(f,u.getDefaultOptions==null?void 0:u.getDefaultOptions(r)),{}),i=f=>r.options.mergeOptions?r.options.mergeOptions(s,f):{...s,...f};let c={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(f=>{var u;c=(u=f.getInitialState==null?void 0:f.getInitialState(c))!=null?u:c});const d=[];let _=!1;const g={_features:o,options:{...s,...e},initialState:c,_queue:f=>{d.push(f),_||(_=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();_=!1}).catch(u=>setTimeout(()=>{throw u})))},reset:()=>{r.setState(r.initialState)},setOptions:f=>{const u=en(f,r.options);r.options=i(u)},getState:()=>r.options.state,setState:f=>{r.options.onStateChange==null||r.options.onStateChange(f)},_getRowId:(f,u,p)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(f,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:(f,u)=>{let p=(u?r.getPrePaginationRowModel():r.getRowModel()).rowsById[f];if(!p&&(p=r.getCoreRowModel().rowsById[f],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return p},_getDefaultColumnDef:ae(()=>[r.options.defaultColumn],f=>{var u;return f=(u=f)!=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()),{}),...f}},le(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ae(()=>[r._getColumnDefs()],f=>{const u=function(p,h,m){return m===void 0&&(m=0),p.map(y=>{const w=Dh(r,y,m,h),C=y;return w.columns=C.columns?u(C.columns,w,m+1):[],w})};return u(f)},le(e,"debugColumns","getAllColumns")),getAllFlatColumns:ae(()=>[r.getAllColumns()],f=>f.flatMap(u=>u.getFlatColumns()),le(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ae(()=>[r.getAllFlatColumns()],f=>f.reduce((u,p)=>(u[p.id]=p,u),{}),le(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ae(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(f,u)=>{let p=f.flatMap(h=>h.getLeafColumns());return u(p)},le(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const u=r._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!u&&console.error(`[Table] Column with id '${f}' does not exist.`),u}};Object.assign(r,g);for(let f=0;f<r._features.length;f++){const u=r._features[f];u==null||u.createTable==null||u.createTable(r)}return r}function rp(){return e=>ae(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,s,i){s===void 0&&(s=0);const l=[];for(let d=0;d<r.length;d++){const _=hs(e,e._getRowId(r[d],d,i),r[d],d,s,void 0,i?.id);if(n.flatRows.push(_),n.rowsById[_.id]=_,l.push(_),e.options.getSubRows){var c;_.originalSubRows=e.options.getSubRows(r[d],d),(c=_.originalSubRows)!=null&&c.length&&(_.subRows=o(_.originalSubRows,s+1,_))}}return l};return n.rows=o(t),n},le(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function sp(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function ip(e,t,n){return n.options.filterFromLeafRows?ap(e,t,n):lp(e,t,n)}function ap(e,t,n){var o;const r=[],s={},i=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,d){d===void 0&&(d=0);const _=[];for(let f=0;f<c.length;f++){var g;let u=c[f];const p=hs(n,u.id,u.original,u.index,u.depth,void 0,u.parentId);if(p.columnFilters=u.columnFilters,(g=u.subRows)!=null&&g.length&&d<i){if(p.subRows=l(u.subRows,d+1),u=p,t(u)&&!p.subRows.length){_.push(u),s[u.id]=u,r.push(u);continue}if(t(u)||p.subRows.length){_.push(u),s[u.id]=u,r.push(u);continue}}else u=p,t(u)&&(_.push(u),s[u.id]=u,r.push(u))}return _};return{rows:l(e),flatRows:r,rowsById:s}}function lp(e,t,n){var o;const r=[],s={},i=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(c,d){d===void 0&&(d=0);const _=[];for(let f=0;f<c.length;f++){let u=c[f];if(t(u)){var g;if((g=u.subRows)!=null&&g.length&&d<i){const h=hs(n,u.id,u.original,u.index,u.depth,void 0,u.parentId);h.subRows=l(u.subRows,d+1),u=h}_.push(u),r.push(u),s[u.id]=u}}return _};return{rows:l(e),flatRows:r,rowsById:s}}function cp(){return e=>ae(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const r=[],s=[];(n??[]).forEach(f=>{var u;const p=e.getColumn(f.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:f.id,filterFn:h,resolvedValue:(u=h.resolveFilterValue==null?void 0:h.resolveFilterValue(f.value))!=null?u:f.value})});const i=(n??[]).map(f=>f.id),l=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());o&&l&&c.length&&(i.push("__global__"),c.forEach(f=>{var u;s.push({id:f.id,filterFn:l,resolvedValue:(u=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?u:o})}));let d,_;for(let f=0;f<t.flatRows.length;f++){const u=t.flatRows[f];if(u.columnFilters={},r.length)for(let p=0;p<r.length;p++){d=r[p];const h=d.id;u.columnFilters[h]=d.filterFn(u,h,d.resolvedValue,m=>{u.columnFiltersMeta[h]=m})}if(s.length){for(let p=0;p<s.length;p++){_=s[p];const h=_.id;if(_.filterFn(u,h,_.resolvedValue,m=>{u.columnFiltersMeta[h]=m})){u.columnFilters.__global__=!0;break}}u.columnFilters.__global__!==!0&&(u.columnFilters.__global__=!1)}}const g=f=>{for(let u=0;u<i.length;u++)if(f.columnFilters[i[u]]===!1)return!1;return!0};return ip(t.rows,g,e)},le(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function dp(e){return t=>ae(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:s}=n;let{rows:i,flatRows:l,rowsById:c}=o;const d=r*s,_=d+r;i=i.slice(d,_);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:l,rowsById:c}:g=sp({rows:i,flatRows:l,rowsById:c}),g.flatRows=[];const f=u=>{g.flatRows.push(u),u.subRows.length&&u.subRows.forEach(f)};return g.rows.forEach(f),g},le(t.options,"debugTable","getPaginationRowModel"))}function up(){return e=>ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],s=o.filter(c=>{var d;return(d=e.getColumn(c.id))==null?void 0:d.getCanSort()}),i={};s.forEach(c=>{const d=e.getColumn(c.id);d&&(i[c.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const l=c=>{const d=c.map(_=>({..._}));return d.sort((_,g)=>{for(let u=0;u<s.length;u+=1){var f;const p=s[u],h=i[p.id],m=h.sortUndefined,y=(f=p?.desc)!=null?f:!1;let w=0;if(m){const C=_.getValue(p.id),k=g.getValue(p.id),A=C===void 0,T=k===void 0;if(A||T){if(m==="first")return A?-1:1;if(m==="last")return A?1:-1;w=A&&T?0:A?m:-m}}if(w===0&&(w=h.sortingFn(_,g,p.id)),w!==0)return y&&(w*=-1),h.invertSorting&&(w*=-1),w}return _.index-g.index}),d.forEach(_=>{var g;r.push(_),(g=_.subRows)!=null&&g.length&&(_.subRows=l(_.subRows))}),d};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},le(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
20
673
|
* react-table
|
|
21
674
|
*
|
|
22
675
|
* Copyright (c) TanStack
|
|
@@ -25,5 +678,5 @@
|
|
|
25
678
|
* LICENSE.md file in the root directory of this source tree.
|
|
26
679
|
*
|
|
27
680
|
* @license MIT
|
|
28
|
-
*/function fn(e,n){return e?Fu(e)?M.createElement(e,n):e:null}function Fu(e){return Au(e)||typeof e=="function"||Du(e)}function Au(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function Du(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function zu(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=M.useState(()=>({current:Cu(n)})),[o,r]=M.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),t.current}const Ee={checkbox_container:"_checkbox_container_17g3o_1",checkbox_wrapper:"_checkbox_wrapper_17g3o_13",label_text:"_label_text_17g3o_33",hint_text:"_hint_text_17g3o_51",checkbox:"_checkbox_17g3o_1",input:"_input_17g3o_99",checkbox_svg:"_checkbox_svg_17g3o_153",custom_icon:"_custom_icon_17g3o_195",checked:"_checked_17g3o_225",indeterminate:"_indeterminate_17g3o_227",radius_none:"_radius_none_17g3o_235",radius_sm:"_radius_sm_17g3o_243",radius_md:"_radius_md_17g3o_251",radius_lg:"_radius_lg_17g3o_259",radius_full:"_radius_full_17g3o_267",sm:"_sm_17g3o_275",lg:"_lg_17g3o_301",secondary:"_secondary_17g3o_327",success:"_success_17g3o_335",warning:"_warning_17g3o_343",danger:"_danger_17g3o_351",solid:"_solid_17g3o_377",outline:"_outline_17g3o_391",disabled:"_disabled_17g3o_439",readonly:"_readonly_17g3o_521",no_animation:"_no_animation_17g3o_597",line_through:"_line_through_17g3o_615",lineThrough:"_lineThrough_17g3o_1",checkbox_group:"_checkbox_group_17g3o_659",label:"_label_17g3o_33",marca_requerido:"_marca_requerido_17g3o_689",description:"_description_17g3o_697",checkboxes:"_checkboxes_17g3o_711",vertical:"_vertical_17g3o_721",horizontal:"_horizontal_17g3o_729",error_message:"_error_message_17g3o_739",input_validacion:"_input_validacion_17g3o_795"},Rs=m.createContext(null),Xs=()=>m.useContext(Rs),Zs=m.forwardRef((e,n)=>{const{children:t,label:o,hint:r,isSelected:i,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:c=!1,customCheckIcon:h,size:p="md",color:v="primary",customColor:w,radius:y="md",variant:x="solid",className:E="",classNames:A={},onChange:D,value:N,name:T,...L}=e,I=Xs(),O=m.useId(),V=m.useRef(null),$=i!==void 0,[b,S]=m.useState(a??!1),P=!!I,F=P&&N?I.value.includes(N):!1,C=P?F:$?i:b,k=d||I?.isDisabled,z=u||I?.isReadOnly,q=_||I?.isRequired,j=T||I?.name,H=P?!1:q;m.useEffect(()=>{V.current&&(V.current.indeterminate=l)},[l]);const J=ae=>{if(k||z)return;const ie=ae.target.checked;P&&N?I.onChange(N):($||S(ie),D?.(ie))},U=o||t;return s.jsxs("div",{className:K(Ee.checkbox_container,{[Ee.disabled]:k,[Ee.readonly]:z},A.base,E),children:[s.jsxs("label",{className:K(Ee.checkbox_wrapper,Ee[p],!w&&Ee[v],Ee[x],Ee[`radius_${y}`],{[Ee.checked]:C,[Ee.indeterminate]:l,[Ee.disabled]:k,[Ee.readonly]:z,[Ee.line_through]:g&&C,[Ee.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[s.jsxs("span",{className:Ee.checkbox,children:[s.jsx("input",{ref:ae=>{V.current=ae,typeof n=="function"?n(ae):n&&(n.current=ae)},id:O,type:"checkbox",className:Ee.input,checked:C,onChange:J,disabled:k,readOnly:z,required:H,value:N,name:j,...L}),h?s.jsx("span",{className:Ee.custom_icon,children:h}):s.jsx("svg",{className:Ee.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:s.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&U&&s.jsx("span",{className:K(Ee.label_text,A.label),children:U})]}),r&&s.jsx("span",{className:K(Ee.hint_text,A.label),children:r})]})});Zs.displayName="Checkbox";const Fn=m.memo(Zs),Js=({label:e,children:n,description:t,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,name:c,justifyContent:h="flex-start",options:p,optionValueKey:v,optionLabelKey:w,optionDisabledKey:y,optionDescriptionKey:x})=>{const E=l!==void 0,[A,D]=m.useState(d),N=E?l:A,T=f&&N.length===0,L=r||T,I=T&&!o?"Selecciona al menos una opción":o,O=$=>{if(_||g)return;const b=N.includes($)?N.filter(S=>S!==$):[...N,$];E||D(b),u?.(b)},V=h==="center"?"center":h==="flex-end"?"right":"left";return s.jsxs("div",{className:K(Ee.checkbox_group,Ee[i],{[Ee.invalid]:L,[Ee.disabled]:_,[Ee.readonly]:g},a),role:"group","aria-required":f,"aria-invalid":L,style:{textAlign:V},children:[e&&s.jsxs("div",{className:Ee.label,children:[e,f&&s.jsx("span",{className:Ee.marca_requerido,children:" *"})]}),t&&s.jsx("div",{className:Ee.description,children:t}),s.jsx(Rs.Provider,{value:{value:N,onChange:O,isDisabled:_,isReadOnly:g,isRequired:f,name:c},children:s.jsx("div",{className:K(Ee.checkboxes,Ee[i]),style:{justifyContent:h},children:p&&p.length>0?p.map(($,b)=>{let S,P,F=!1,C;if(typeof $=="object"&&$!==null){const k=v??"value",z=w??"label",q=y??"isDisabled",j=x??"description",H=$[k],J=$[z];S=String(H!==void 0?H:b),P=J;const U=$[q];F=typeof U=="boolean"?U:!1;const ae=$[j];C=typeof ae=="string"?ae:void 0}else S=String($),P=$;return s.jsx(Fn,{value:S,isDisabled:F,hint:C,children:P},S)}):n})}),f&&s.jsx("input",{type:"checkbox",required:f,checked:N.length>0,readOnly:!0,tabIndex:-1,"aria-hidden":"true",className:Ee.input_validacion}),I&&L&&s.jsx("div",{className:Ee.error_message,children:I})]})};Js.displayName="CheckboxGroup";const qe={contenedor:"_contenedor_kj261_1",contenedor_superior:"_contenedor_superior_kj261_17",input_con_icono:"_input_con_icono_kj261_35",icono_busqueda:"_icono_busqueda_kj261_49",input_busqueda:"_input_busqueda_kj261_75",contenedor_acciones_botones:"_contenedor_acciones_botones_kj261_147",contenedor_acciones:"_contenedor_acciones_kj261_147",columna:"_columna_kj261_183",encabezados:"_encabezados_kj261_201",boton_basico:"_boton_basico_kj261_265",texto_filtros:"_texto_filtros_kj261_289",menu_configuraciones:"_menu_configuraciones_kj261_321",boton_excel:"_boton_excel_kj261_349",contenedor_tabla:"_contenedor_tabla_kj261_369",contenedor_datos:"_contenedor_datos_kj261_387",datos:"_datos_kj261_395",seleccionada:"_seleccionada_kj261_431",boton_acciones:"_boton_acciones_kj261_475"};function Lu(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},(a,l)=>r+l)}function Pu(e,n){return n===0?0:e>=n?n-1:e<0?0:e}function Tu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function _n(e,n){const t=new Map;n.getFlatHeaders().forEach(a=>t.set(a.column.id,a));const o=t.get(e);if(o)return fn(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(a=>a.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function Qs(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?fn(t.column.columnDef.cell,t.getContext()):null}function ea(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function Ou(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function Vu(e,n){if(n===0)return"";if(n===1)return zr(e[0].nombre.toLowerCase());if(n===2)return`${zr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${zr(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function zr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function ta(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const na=m.createContext(null),Lr=na;function ju({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_=[],sinDatosProps:g,...f}){const[c,h]=m.useState(""),p=Id(c,200),v=xo("only screen and (max-width: 830px)"),[w,y]=m.useState({pageIndex:0,pageSize:a}),[x,E]=m.useState({}),A=m.useMemo(()=>{const k=[];if(_.length>0&&!v){const z={id:"select",header:({table:q})=>s.jsx(Fn,{color:"secondary",isSelected:q.getIsAllPageRowsSelected(),isIndeterminate:q.getIsSomePageRowsSelected()&&!q.getIsAllPageRowsSelected(),onChange:j=>q.toggleAllPageRowsSelected(!!j)}),cell:({row:q})=>s.jsx(Fn,{color:"primary",isSelected:q.getIsSelected(),isDisabled:!q.getCanSelect(),onChange:j=>q.toggleSelected(j)}),enableSorting:!1,enableHiding:!1};k.push(z)}if(k.push(...t),o?.length){const z={id:"actions",header:"Acciones",cell:q=>s.jsx("div",{className:qe.contenedor_acciones,children:o.map(j=>"contenido"in j?s.jsx(Jt,{content:j.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx("span",{children:j.contenido(q.row.original,qe.boton_acciones)},j.id)},j.id):s.jsx(Jt,{content:j.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx(nt,{id:j.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>j.evento(q.row.original),className:qe.boton_acciones,children:j.icono})},j.id))}),enableSorting:!1,enableHiding:!1};k.push(z)}return k},[t,o,_,v]),D=m.useMemo(()=>{const k=A.map(q=>"accessorKey"in q?String(q.accessorKey):"id"in q?String(q.id):"").filter(Boolean),z=k.indexOf("actions");return z>-1&&z<k.length-1&&(k.splice(z,1),k.push("actions")),k},[A]),[N,T]=m.useState(D),L=m.useCallback((k,z,q)=>{if(!q)return!0;const j=ta(q),H=k.getValue(z);return H==null?!1:ta(String(H)).includes(j)},[]),I=zu({data:n,columns:A,state:{pagination:w,globalFilter:p,columnOrder:N,rowSelection:x},globalFilterFn:L,enableRowSelection:_.length>0,onRowSelectionChange:E,onPaginationChange:y,onColumnOrderChange:T,getCoreRowModel:xu(),getSortedRowModel:Nu(),getFilteredRowModel:Eu(),getPaginationRowModel:Mu(),autoResetPageIndex:!1}),O=I.getPageCount();m.useEffect(()=>{const k=Pu(w.pageIndex,O);k!==w.pageIndex&&y(z=>({...z,pageIndex:k}))},[O]),m.useEffect(()=>{p!==void 0&&I.setPageIndex(0)},[p]);const V=m.useMemo(()=>I.getAllLeafColumns().filter(k=>k.id!=="actions"&&k.id!=="select"&&k.getCanHide?.()),[I]),$=m.useCallback(k=>{const q=t.find(j=>"accessorKey"in j?j.accessorKey===k:j.id===k)?.header;return typeof q=="string"||typeof q=="number"?String(q):k},[t]),b=m.useCallback(()=>{I.setColumnVisibility({}),I.setPageSize(a),I.setPageIndex(0),I.resetRowSelection(),T(D)},[I,a,D]),S=m.useCallback(k=>{const z=Math.max(1,Math.min(200,k));I.setPageSize(z),I.setPageIndex(0)},[I]),P=m.useCallback(k=>{T(z=>typeof k=="function"?k(z):k)},[]),C={state:{ordenColumnas:N,table:I,columns:A,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:c,setInputBusqueda:h,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:_,sinDatosProps:g,...f},todasLasColumnas:V,etiquetaColumna:$,restaurarConfiguracion:b,cambiarPageSize:S,cambiarOrdenColumnas:P};return s.jsx(na.Provider,{value:C,children:e})}function qu(){const e=m.useContext(Lr);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Gt(){const e=m.useContext(Lr);return e||null}const zt={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function oa(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function ra(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Bu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Hu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Gu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Wu(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[s.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"}),s.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 Ku(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.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 Uu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.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 Yu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[s.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Ru(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Xu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function Zu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Ju(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.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 Qu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.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 ef(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",children:[s.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function tf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function nf(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:s.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const of=({titulo:e,onBack:n})=>s.jsxs("header",{className:zt.header,children:[s.jsx(nt,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:s.jsx(oa,{})}),s.jsx("h3",{className:zt.titulo,children:e})]}),Qt={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 rf(){const e=Gt(),[n,t]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:a}=e,{ordenColumnas:l}=o,d=g=>f=>{t(g),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",g)},u=g=>f=>{f.preventDefault(),!(!n||n===g)&&a?.(c=>{const h=[...c],p=h.indexOf(n),v=h.indexOf(g);return p===-1||v===-1?c:(h.splice(p,1),h.splice(v,0,n),h)})},_=()=>t(null);return s.jsx("div",{className:Qt.contenedor,children:s.jsx("ul",{className:Qt.lista,children:l.map(g=>{const f=r.find(v=>v.id===g);if(!f)return null;const c=f.getCanHide?.()??!0,h=f.getIsVisible(),p=n===f.id;return s.jsxs("li",{className:`${Qt.item} ${p?Qt.item_dragging:""}`,draggable:!0,onDragStart:d(f.id),onDragOver:u(f.id),onDrop:_,onDragEnd:_,children:[s.jsx("span",{className:Qt.icono_drag,"aria-label":"Arrastrar columna",children:s.jsx(Yu,{})}),s.jsx("span",{className:Qt.nombre,children:i(f.id)}),s.jsx(Fn,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:v=>f.toggleVisibility(v),className:Qt.checkbox})]},f.id)})})})}const An={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function sf(){const e=Gt(),[n,t]=m.useState(""),o=m.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(m.useEffect(()=>t(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,a=g=>Math.max(Pr,Math.min(Tr,g)),l=g=>{const f=r+g;f>=Pr&&f<=Tr&&i?.(f)},d=()=>{const g=parseInt(n,10),f=!isNaN(g)&&g>0?a(g):r;i?.(f),t(String(f))},u=g=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{t(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&t(f)};return s.jsxs("div",{className:An.contenido,children:[s.jsx("p",{className:An.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),s.jsxs("div",{className:An.control,children:[s.jsx(nt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Pr,children:s.jsx(Ju,{style:{fontSize:"var(--gaps-6)"}})}),s.jsx("div",{className:An.valor,children:s.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:_,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:An.input,"aria-label":"Número de filas por página"})}),s.jsx(nt,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Tr,children:s.jsx(Zu,{})})]})]})}const dt={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function af({navegar:e}){const n=Gt();return s.jsxs("div",{className:dt.contenedor,children:[s.jsx("nav",{className:dt.menu,children:df.map(({id:t,icono:o,nombre:r,descripcion:i})=>s.jsxs("button",{className:dt.item,onClick:()=>e(t),children:[s.jsx("div",{className:dt.icono_contenedor,children:s.jsx(o,{})}),s.jsxs("div",{className:dt.texto,children:[s.jsx("span",{className:dt.nombre,children:r}),s.jsx("span",{className:dt.descripcion,children:i})]}),s.jsx(ra,{className:dt.chevron})]},t))}),s.jsx("div",{className:dt.divider}),s.jsx("div",{className:dt.menu,children:s.jsxs("button",{className:dt.item,onClick:n?.restaurarConfiguracion,children:[s.jsx("div",{className:dt.icono_contenedor,children:s.jsx(Uu,{className:dt.icono_restaurar})}),s.jsxs("div",{className:dt.texto,children:[s.jsx("span",{className:dt.nombre,children:"Restaurar configuración"}),s.jsx("span",{className:dt.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Pr=1,Tr=200,ia=250,lf=200,cf={panelPrincipal:{component:af},panelColumnas:{component:rf,titulo:"Columnas visibles"},panelFilas:{component:sf,titulo:"Filas por página"}},df=[{id:"panelColumnas",icono:Ru,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Xu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function uf(e,n,t){const o=m.useRef(t);o.current=t;const r=m.useRef(e);r.current=e;const i=m.useCallback(a=>{const l=a.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);m.useEffect(()=>{if(!n)return;const a=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(a),document.removeEventListener("mousedown",i)}},[n,i])}function sa(e,n){m.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function ff(e,n,t,{width:o,offsetRight:r=0,offsetLeft:i=0,offsetTop:a=0,offsetBottom:l=0,shiftPadding:d=8}){const[u,_]=m.useState({top:0,left:0}),g=xo("only screen and (max-width: 480px)"),f=m.useCallback(()=>{if(!e.current)return{top:0,left:0};const c=e.current.getBoundingClientRect(),h=d;let p=c.bottom+a,v=0;g?v=c.right-o-i+r:v=c.right-o+r-i;const w=n.current?.offsetHeight||400;p+w>window.innerHeight-h&&(p=c.top-w-l,p<h&&(p=h));const y=h,x=window.innerWidth-o-h;return v=Math.max(y,Math.min(v,x)),{top:p,left:v}},[g,o,r,i,a,l,d,e,n]);return m.useEffect(()=>{if(!t||!e.current)return;const c=()=>{_(f())};return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[t,f,e]),u}function _f(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function gf(){const[e,n]=m.useState(!1),[t,o]=m.useState(!1),[r,i]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),_=m.useRef(null);_f(t),uf(()=>f(),t,[d,u]),sa(()=>f(),t);const g=ff(d,u,t,{width:ia,offsetRight:6,offsetTop:-2,shiftPadding:8});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){t&&(n(!1),_.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},lf))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const h=cf[r],p=h.component;return s.jsxs("div",{className:zt.contenedor,children:[s.jsx(nt,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(v=>!v),"aria-haspopup":"dialog","aria-expanded":e,children:s.jsx(Ku,{})}),t&&d.current&&pn.createPortal(s.jsx("div",{ref:u,className:`${zt.popover} ${e?zt.popover_entrada:zt.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:ia},children:s.jsx("div",{className:zt.ventana,children:s.jsxs("div",{className:K([zt.panel,zt[`panel_${a}`]]),children:[h.titulo&&s.jsx(of,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),s.jsx(p,{navegar:c})]},r)})}),document.body)]})}function pf(){const e=Gt();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,loading:r,filtros:i,actualizarTabla:a,descargarExcel:l,paginacion:d}=n,{abrirFiltros:u,filtrosAplicados:_=[]}=i||{},g=_?.length||0;return s.jsxs("section",{className:qe.contenedor_superior,children:[s.jsxs("div",{className:qe.input_con_icono,id:"buscador-tabla",children:[s.jsx(Bu,{className:qe.icono_busqueda}),s.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:t??"",onChange:f=>o&&o(f.target.value),className:qe.input_busqueda})]}),s.jsxs("div",{className:qe.contenedor_acciones_botones,children:[s.jsxs("div",{className:qe.contenedor_acciones,children:[d?.hayMasDatos&&s.jsxs(nt,{id:"cargar-mas-datos",variant:"light",className:qe.boton_basico,disabled:r,onClick:d.onCargarMasDatos,children:[s.jsx(ef,{}),r?"Actualizando...":"Más datos"]}),u!==void 0&&s.jsxs(nt,{id:"boton-filtros",onClick:u,variant:"light",className:qe.boton_basico,children:[s.jsx(Gu,{})," Filtros"]}),g>0?s.jsxs("div",{className:qe.texto_filtros,id:"filtros-aplicados",children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),s.jsx("p",{children:Vu(_,g)})]}):null]}),l!==void 0?s.jsxs(nt,{onClick:l,className:`${qe.boton_basico} ${qe.boton_excel}`,children:[s.jsx(Hu,{})," Excel"]}):null]}),s.jsxs("div",{className:qe.contenedor_acciones,children:[a!==void 0&&s.jsx(Jt,{content:"Actualiza los últimos datos guardados",children:s.jsx(nt,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:qe.boton_basico,disabled:a?.cargando,onClick:a?.onClick,children:s.jsx(Wu,{})})}),s.jsx("div",{className:qe.menu_configuraciones,id:"configuraciones-tabla",children:s.jsx(gf,{})})]})]})}const It={contenedor_paginacion:"_contenedor_paginacion_1l3vz_1",info_paginacion:"_info_paginacion_1l3vz_19",contenedor_botones:"_contenedor_botones_1l3vz_37",boton_paginacion:"_boton_paginacion_1l3vz_87",pagina_activa:"_pagina_activa_1l3vz_107",boton_num_paginacion:"_boton_num_paginacion_1l3vz_117"};function hf(){const e=Gt();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,a=i+1,l=Lu(a,r),d=t.getCanPreviousPage(),u=t.getCanNextPage(),_=r>1,g=i===0,f=i===r-1,c=()=>{d&&t.previousPage()},h=()=>{u&&t.nextPage()},p=y=>{t.setPageIndex(y-1)},v=()=>{g||t.firstPage()},w=()=>{f||t.lastPage()};return s.jsxs("section",{className:It.contenedor_paginacion,id:"paginacion-tabla",children:[s.jsxs("p",{className:It.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&s.jsxs("div",{className:It.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&s.jsx(tf,{id:"paginacion-flecha-inicio",onClick:v,"aria-label":"Ir a la primera página","aria-disabled":g,className:It.boton_paginacion}),d&&s.jsx(oa,{id:"paginacion-flecha-izq",onClick:c,"aria-disabled":!d,className:It.boton_paginacion}),s.jsx("div",{id:"paginacion-numero-pag",children:l.map(y=>s.jsx("button",{type:"button",onClick:()=>p(y),"aria-current":y===a?"page":void 0,className:y===a?It.pagina_activa:It.boton_num_paginacion,children:y},y))}),u&&s.jsx(ra,{id:"paginacion-flecha-der",onClick:h,"aria-disabled":!u,className:It.boton_paginacion}),!f&&s.jsx(nf,{id:"paginacion-flecha-fin",onClick:w,"aria-label":"Ir a la última página","aria-disabled":f,className:It.boton_paginacion})]}),s.jsxs("p",{className:It.info_paginacion,id:"paginacion-total-pags",children:["Página ",a," de ",r]})]})}const Ie={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function aa(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function la(e){if(e)return e.id??e.accessorKey}const Lt={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 mf({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const a=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return s.jsx("section",{className:Ie.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>s.jsxs("article",{className:Ie.contenedor_card,children:[s.jsxs("div",{className:Ie.contenedor_encabezado_card,children:[s.jsx("div",{className:Ie.contenedor_columna_card,children:o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ie.card_label,children:_n(o,t)}),s.jsx("div",{className:Ie.card_valor,children:s.jsx("div",{className:`${Lt.skeleton_elemento} ${Lt.skeleton_elemento_encabezado}`})})]})}),s.jsx("div",{className:Ie.contenedor_columna_card,children:r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ie.card_label,children:_n(r,t)}),s.jsx("div",{className:Ie.card_segundo_valor,children:s.jsx("div",{className:`${Lt.skeleton_elemento} ${Lt.skeleton_elemento_encabezado_segundo}`})})]})})]}),s.jsx("div",{className:Ie.contenedor_contenido_cards,children:a.map((_,g)=>s.jsxs("div",{className:Ie.contenedor_fila_card,children:[s.jsx("div",{className:Ie.card_fila_label,children:_n(_.id,t)}),s.jsx("div",{className:Ie.card_fila_valor,children:s.jsx("div",{className:`${Lt.skeleton_elemento} ${Lt.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),n>0&&s.jsx("div",{className:Ie.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((_,g)=>s.jsx("div",{className:Lt.skeleton_accion,children:s.jsx("div",{className:`${Lt.skeleton_elemento} ${Lt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const en={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function ca(){const e=m.useContext(Lr),{sinDatosProps:n}=e?.state||{},{botonAccion:t,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=n||{};return s.jsxs("div",{className:en.contenedor,children:[s.jsx(vf,{}),s.jsxs("div",{className:en.envolvedor_contenido,children:[s.jsx(bf,{}),s.jsx("h3",{className:en.titulo,children:o}),s.jsx("p",{className:en.descripcion,children:r}),t]})]})}function vf(){return s.jsx("div",{className:en.envolvedor_cuadricula,children:s.jsxs("svg",{className:en.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function bf(){return s.jsxs("svg",{className:en.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.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)"}),s.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"}),s.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),s.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const wf=({fila:e,controls:n})=>(n?.length??0)>0?s.jsx("div",{className:Ie.contenedor_acciones_card,children:n?.map(o=>"contenido"in o?s.jsxs("span",{className:`${Ie.boton_personalizado} ${Ie.boton_acciones} ${Ie.boton_card}`,onClick:r=>{const i=r.currentTarget.querySelector("button");i&&!i.contains(r.target)&&i.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):s.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ie.boton_acciones} ${Ie.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,yf=({columnasRestantes:e,table:n})=>e.length===0?null:s.jsx("div",{className:Ie.contenedor_contenido_cards,children:e.map(t=>s.jsxs("div",{className:Ie.contenedor_fila_card,children:[s.jsx("div",{className:Ie.card_fila_label,children:_n(t.column.id,n)}),s.jsx("div",{className:Ie.card_fila_valor,children:fn(t.column.columnDef.cell,t.getContext())})]},t.id))}),Cf=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=ea(e,t),i=ea(e,o);return s.jsxs("div",{className:Ie.contenedor_encabezado_card,children:[s.jsx("div",{className:Ie.contenedor_columna_card,children:t&&r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ie.card_label,children:_n(t,n)}),s.jsx("div",{className:Ie.card_valor,children:Qs(e,t)})]})}),s.jsx("div",{className:Ie.contenedor_columna_card,children:o&&i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ie.card_label,children:_n(o,n)}),s.jsx("div",{className:Ie.card_segundo_valor,children:Qs(e,o)})]})})]})};function xf(){const e=Gt();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:r,loading:i,columns:a}=n;if(!t)return null;const l=a&&r?aa(a,r[0]):void 0,d=a&&r?aa(a,r[1]):void 0,u=la(l),_=la(d);if(i)return s.jsx(mf,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:u,idSegundaColumna:_});const g=t.getRowModel().rows;return g.length===0?s.jsx("article",{className:Ie.contenedor_card,children:s.jsx(ca,{})}):s.jsx("section",{className:Ie.contenedor_tabla_cards,children:g.map(f=>{const c=Ou(f,u,_);return s.jsxs("article",{className:Ie.contenedor_card,children:[s.jsx(Cf,{fila:f,table:t,idPrimeraColumna:u,idSegundaColumna:_}),s.jsx(yf,{columnasRestantes:c,table:t}),s.jsx(wf,{fila:f,controls:o})]},f.id)})})}const da={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},Sf=({columnas:e,filas:n})=>s.jsx(s.Fragment,{children:Array.from({length:n}).map((t,o)=>s.jsx("tr",{className:da.filas,children:Array.from({length:e}).map((r,i)=>s.jsx("td",{className:da.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),tn={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 $f({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),_=e>0,g=m.useRef(null);return sa(o,_),m.useEffect(()=>{_&&(i(e),l(n),u(t))},[e,n,t,_]),s.jsx(Vn,{mostrar:_,tipo:"escalar",className:tn.contenedor,children:s.jsxs("div",{ref:g,className:tn.barra,children:[s.jsxs("div",{className:tn.info,children:[s.jsx(nt,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:tn.btn_cerrar,children:s.jsx(Qu,{})}),s.jsxs("p",{className:tn.contador,children:[r," filas seleccionadas"]})]}),s.jsx("div",{className:tn.separador}),s.jsx("div",{className:tn.acciones,children:a.map(f=>s.jsx("div",{children:f.componente(d)},f.id))})]})})}function kf(){const e=Gt();if(!e)return null;const{state:n}=e,{table:t,loading:o,columns:r,selectorFilas:i=[]}=n;if(!t)return null;const a=t.getHeaderGroups(),l=t.getRowModel().rows,d=r?.length??0,u=t.getSelectedRowModel().rows,_=u.length,g=()=>{t.resetRowSelection()};return s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:qe.contenedor_tabla,children:[s.jsx("thead",{children:a.map(f=>s.jsx("tr",{children:f.headers.map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("th",{className:qe.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?s.jsx("div",{children:fn(c.column.columnDef.header,c.getContext())}):s.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[fn(c.column.columnDef.header,c.getContext()),Tu(c.column.getIsSorted())]})},c.id)})},f.id))}),s.jsx("tbody",{className:qe.contenedor_datos,children:o?s.jsx(Sf,{columnas:d,filas:10}):l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:s.jsx(ca,{})})}):l.map(f=>s.jsx("tr",{className:`${qe.datos} ${f.getIsSelected()?qe.seleccionada:""}`,children:f.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("td",{className:qe.columna,style:h,"data-columna":c.column.id,children:fn(c.column.columnDef.cell,c.getContext())},c.id)})},f.id))})]}),i?.length>0?s.jsx($f,{totalSeleccionadas:_,acciones:i,filasSeleccionadas:u.map(f=>f.original),onLimpiarSeleccion:g}):null]})}function If({id:e}){const n=xo("only screen and (max-width: 830px)");return s.jsxs("main",{className:qe.contenedor,id:e,children:[s.jsx(pf,{}),n?s.jsx(xf,{}):s.jsx(kf,{}),s.jsx(hf,{})]})}function Ef({id:e,...n}){return s.jsx(ju,{...n,children:s.jsx(If,{id:e})})}const Ae={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},ua=m.createContext(void 0),Mf=()=>m.useContext(ua),Or=m.memo(m.forwardRef(({value:e,label:n,description:t,size:o="md",color:r="primary",customColor:i,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:_=!1,children:g,className:f="",onChange:c,...h},p)=>{const v=Mf(),w=m.useId(),y=h.id||w,x=v?.name||h.name,E=v?.size||o,A=v?.color||r,D=v?.customColor||i,N=v?.variant||a,T=v?.isDisabled||l,L=v?.isReadOnly||d,I=v?.isInvalid||u,O=v?.isRequired||_,V=v?.value!==void 0?v.value===e:void 0,$=g||n,b=F=>{T||L||(v?.onChange&&v.onChange(e),c&&c(F))},S=[Ae.contenedor_radio,Ae[`tam_${E}`],!D&&Ae[`color_${A}`],Ae[`variante_${N}`],T&&Ae.deshabilitado,L&&Ae.solo_lectura,I&&Ae.invalido,V&&Ae.seleccionado,f].filter(Boolean).join(" "),P=D?{"--radio-custom-color":D}:void 0;return s.jsx("div",{className:S,style:P,children:s.jsxs("label",{className:Ae.envoltorio_radio,htmlFor:y,children:[s.jsxs("div",{className:Ae.radio,children:[s.jsx("input",{ref:p,type:"radio",id:y,name:x,value:e,checked:V,disabled:T,readOnly:L,required:O,"aria-invalid":I,className:Ae.input,onChange:b,...h}),s.jsx("div",{className:Ae.circulo_radio,children:s.jsx("div",{className:Ae.punto_radio})})]})," ",$&&s.jsxs("div",{className:Ae.contenedor_label,children:[s.jsxs("span",{className:Ae.texto_label,children:[$,_&&!v&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),t&&s.jsx("span",{className:Ae.texto_descripcion,children:t})]})]})})}));Or.displayName="Radio";const fa=({name:e,value:n,defaultValue:t,onChange:o,orientation:r="horizontal",label:i,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:_=!1,errorMessage:g,size:f,color:c,customColor:h,variant:p,justifyContent:v="flex-start",children:w,className:y="",options:x,optionValueKey:E,optionLabelKey:A,optionDisabledKey:D,optionDescriptionKey:N})=>{const[T,L]=m.useState(String(t??"")),I=n!==void 0?String(n):T,V={name:e,value:I,onChange:S=>{l||d||(n===void 0&&L(S),o&&o(S))},size:f,color:c,customColor:h,variant:p,isDisabled:l,isReadOnly:d,isInvalid:_,isRequired:u},$=[Ae.grupo_radio,Ae[`orientacion_${r}`],_&&Ae.grupo_invalido,l&&Ae.grupo_deshabilitado,d&&Ae.grupo_solo_lectura,y].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return s.jsx(ua.Provider,{value:V,children:s.jsxs("div",{className:$,role:"radiogroup","aria-required":u,"aria-invalid":_,style:{textAlign:b},children:[i&&s.jsxs("div",{className:Ae.encabezado_grupo,children:[s.jsxs("label",{className:Ae.label_grupo,children:[i,u&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),a&&s.jsx("span",{className:Ae.descripcion_grupo,children:a})]}),s.jsx("div",{className:Ae.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map((S,P)=>{let F,C,k=!1,z;if(typeof S=="object"&&S!==null){const q=E??"value",j=A??"label",H=D??"isDisabled",J=N??"description",U=S[q],ae=S[j];F=String(U!==void 0?U:P),C=ae;const ie=S[H];k=typeof ie=="boolean"?ie:!1;const le=S[J];z=typeof le=="string"?le:void 0}else F=String(S),C=S;return s.jsx(Or,{value:F,isDisabled:k,description:z,children:C},F)}):w}),_&&g&&s.jsx("span",{className:Ae.mensaje_error,children:g})]})})};fa.displayName="RadioGroup";const ut={backdrop:"_backdrop_1fyqe_1",visible:"_visible_1fyqe_37",drawer:"_drawer_1fyqe_57",posicion_right:"_posicion_right_1fyqe_123",drawer_detras:"_drawer_detras_1fyqe_155",posicion_left:"_posicion_left_1fyqe_163",posicion_top:"_posicion_top_1fyqe_203",posicion_bottom:"_posicion_bottom_1fyqe_243",radio_none:"_radio_none_1fyqe_283",radio_sm:"_radio_sm_1fyqe_291",radio_md:"_radio_md_1fyqe_311",radio_lg:"_radio_lg_1fyqe_331",radio_xl:"_radio_xl_1fyqe_351",tamano_sm:"_tamano_sm_1fyqe_451",tamano_md:"_tamano_md_1fyqe_461",tamano_lg:"_tamano_lg_1fyqe_471",tamano_xl:"_tamano_xl_1fyqe_481",tamano_full:"_tamano_full_1fyqe_491",encabezado:"_encabezado_1fyqe_551",titulo:"_titulo_1fyqe_571",boton_cerrar:"_boton_cerrar_1fyqe_591",contenido:"_contenido_1fyqe_645",pie:"_pie_1fyqe_657",loading_overlay:"_loading_overlay_1fyqe_677",spinner:"_spinner_1fyqe_701",spin:"_spin_1fyqe_701",loading_text:"_loading_text_1fyqe_731",resize_handle:"_resize_handle_1fyqe_743"},_a=m.forwardRef(({isOpen:e,onClose:n,position:t="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:y,resizable:x=!1,zIndex:E,getContainer:A},D)=>{const N=m.useRef(null),[T,L]=m.useState(!1),I=m.useCallback(()=>{T||(L(!0),setTimeout(()=>{n?.(),L(!1)},650))},[n,T]);m.useEffect(()=>{e&&L(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const H=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",H>0&&(document.body.style.paddingRight=`${H}px`)}if(l){const H=J=>{J.key==="Escape"&&I()};return document.addEventListener("keydown",H),()=>{document.removeEventListener("keydown",H),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,I,l,d,v]);const O=H=>{a&&H.target===N.current&&I()},V=y?ut[`radio_${y}`]:void 0,$=e&&!T,b=[ut.drawer,ut[`posicion_${t}`],ut[`tamano_${o}`],$&&ut.visible,V,f].filter(Boolean).join(" "),S=[ut.contenido,c].filter(Boolean).join(" "),P=[ut.backdrop,$&&ut.visible].filter(Boolean).join(" "),F=E||500,C={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},k=C[w]||C.normal,{opacity:z}=k,q={background:`rgb(0 0 0 / ${z})`,zIndex:F,...A&&{position:"absolute"}},j=s.jsx("div",{className:P,ref:N,onClick:O,style:q,children:s.jsxs("div",{ref:D,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&s.jsx("div",{className:ut.encabezado,children:u||s.jsxs(s.Fragment,{children:[s.jsx("h2",{id:"drawer-title",className:ut.titulo,children:r}),i&&s.jsx("button",{type:"button",className:ut.boton_cerrar,onClick:I,"aria-label":"Cerrar",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),s.jsx("div",{className:S,children:g}),_&&s.jsx("div",{className:ut.pie,children:_}),h&&s.jsxs("div",{className:ut.loading_overlay,children:[s.jsx("div",{className:ut.spinner}),s.jsx("span",{className:ut.loading_text,children:p})]}),x&&s.jsx("div",{className:ut.resize_handle})]})});if(A){const H=typeof A=="function"?A():A;if(H&&H instanceof HTMLElement)return pn.createPortal(j,H)}return j});_a.displayName="Drawer";const et={backdrop:"_backdrop_1rfkw_1",visible:"_visible_1rfkw_37",centrado:"_centrado_1rfkw_61",modal:"_modal_1rfkw_69",tamano_sm:"_tamano_sm_1rfkw_143",tamano_md:"_tamano_md_1rfkw_151",tamano_lg:"_tamano_lg_1rfkw_159",tamano_xl:"_tamano_xl_1rfkw_167",tamano_formulario:"_tamano_formulario_1rfkw_175",tamano_full:"_tamano_full_1rfkw_183",tamano_auto:"_tamano_auto_1rfkw_191",encabezado:"_encabezado_1rfkw_201",encabezado_personalizado:"_encabezado_personalizado_1rfkw_221",contenedor_titulo_completo:"_contenedor_titulo_completo_1rfkw_233",header_extra:"_header_extra_1rfkw_243",contenedor_titulo_icono:"_contenedor_titulo_icono_1rfkw_261",icono_titulo:"_icono_titulo_1rfkw_273",titulo:"_titulo_1rfkw_287",contenido:"_contenido_1rfkw_307",pie:"_pie_1rfkw_319",loading_overlay:"_loading_overlay_1rfkw_339",spinner:"_spinner_1rfkw_363",spin:"_spin_1rfkw_363",loading_text:"_loading_text_1rfkw_393"},ga=m.forwardRef(({isOpen:e,onClose:n,size:t="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:_,children:g,className:f="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:y},x)=>{const E=m.useId(),A=m.useRef(null),D=m.useCallback(()=>{h||n?.()},[n,h]);m.useEffect(()=>{if(e){if(y?.(),l){const b=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",b>0&&(document.body.style.paddingRight=`${b}px`)}if(a){const b=S=>{S.key==="Escape"&&D()};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,D,a,l,y]);const N=b=>{i&&b.target===A.current&&D()},T=[et.backdrop,d&&et.centrado,e&&et.visible].filter(Boolean).join(" "),L=[et.modal,et[`tamano_${t}`],f].filter(Boolean).join(" "),I=[et.contenido,c].filter(Boolean).join(" "),O={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:V}=O[v]||O.normal,$={background:`rgb(0 0 0 / ${V})`};return s.jsx("div",{className:T,ref:A,onClick:N,style:$,children:s.jsxs("div",{ref:x,className:L,role:"dialog","aria-modal":"true","aria-labelledby":o?E:void 0,children:[(o||u)&&s.jsx("div",{className:[et.encabezado,u&&et.encabezado_personalizado].filter(Boolean).join(" "),children:u?s.jsx("div",{className:et.header_extra,children:u}):s.jsx("div",{className:et.contenedor_titulo_completo,children:s.jsxs("div",{className:et.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?s.jsx("span",{className:et.icono_titulo,children:r}):r),w&&r===void 0&&s.jsx("span",{className:et.icono_titulo,children:"📄"}),o&&s.jsx("h2",{id:E,className:et.titulo,children:o})]})})}),s.jsx("div",{className:I,children:g}),_&&s.jsx("div",{className:et.pie,children:_}),h&&s.jsxs("div",{className:et.loading_overlay,children:[s.jsx("div",{className:et.spinner}),s.jsx("span",{className:et.loading_text,children:p})]})]})})});ga.displayName="Modal";const wt={overlay:"_overlay_1jsdb_1",container:"_container_1jsdb_47",modal:"_modal_1jsdb_65",modal_closing:"_modal_closing_1jsdb_125",modal_detras:"_modal_detras_1jsdb_143",header:"_header_1jsdb_217",button_back:"_button_back_1jsdb_233",title_container:"_title_container_1jsdb_289",title_icon:"_title_icon_1jsdb_305",title:"_title_1jsdb_289",content:"_content_1jsdb_337",footer:"_footer_1jsdb_349"};function Nf({modals:e,onClose:n}){const[t,o]=m.useState([]),[r,i]=m.useState(!1);m.useEffect(()=>{const f=()=>{i(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const a=f=>{o(c=>[...c,f]),setTimeout(()=>{n(f),o(c=>c.filter(h=>h!==f))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,_=e.length*d+(e.length-1)*u,g=e.length>1?_/2-d/2-l*(d+u):0;return s.jsx("div",{className:wt.overlay,children:s.jsx("div",{className:wt.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((f,c)=>{const h=t.includes(f.id),p=c===e.length-1,v=[wt.modal,h&&wt.modal_closing,!p&&wt.modal_detras].filter(Boolean).join(" ");return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:wt.header,children:[s.jsx("button",{type:"button",className:wt.button_back,onClick:()=>a(f.id),"aria-label":"Volver",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{className:wt.title_container,children:[f.titleIcon&&s.jsx("span",{className:wt.title_icon,children:f.titleIcon}),s.jsx("h2",{className:wt.title,children:f.title})]})]}),s.jsx("div",{className:wt.content,children:f.content}),f.footer&&s.jsx("div",{className:wt.footer,children:f.footer})]},f.id)})})})}const Vr=m.createContext(null),jr=()=>{const e=m.useContext(Vr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Dn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,pa=e=>e.type==="checkbox",ha=e=>e.type==="radio",ma=e=>e.type==="separator",va=e=>e.type==="label",$e={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},Ff=()=>s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),Af=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Df=({marcado:e})=>s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&s.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),qr=m.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=jr();if(ma(e))return s.jsx("div",{className:K($e.separator,i.classNames?.separator),role:"separator"});if(va(e))return s.jsx("div",{className:K($e.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=n===t,l=pa(e),d=ha(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!Dn(e)&&i.cerrarMenu())},_=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},f=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,y="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,E="isLoading"in e?e.isLoading:!1,A="isDanger"in e?e.isDanger:!1,D="className"in e?e.className:void 0;return s.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?f:d?c:void 0,"aria-disabled":x||E,tabIndex:a?0:-1,className:K($e.item,$e[`size_${i.size}`],a&&$e.active,x&&$e.disabled,E&&$e.loading,A&&$e.danger,Dn(e)&&$e.has_submenu,D,i.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[E?s.jsx("span",{className:$e.indicator,children:s.jsx("span",{className:$e.spinner_item})}):(l||d)&&s.jsxs("span",{className:$e.indicator,children:[l&&f&&s.jsx(Ff,{}),d&&s.jsx(Df,{marcado:c})]}),!E&&w&&s.jsx("span",{className:$e.start_icon,children:w}),s.jsxs("span",{className:$e.content,children:[s.jsx("span",{className:$e.label_text,children:h}),p&&s.jsx("span",{className:$e.description,children:p})]}),v&&s.jsx("kbd",{className:$e.shortcut,children:v}),y&&s.jsx("span",{className:$e.end_icon,children:y}),Dn(e)&&s.jsx("span",{className:$e.submenu_arrow,children:s.jsx(Af,{})})]})});qr.displayName="MenuItem";const zf=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Mo=({items:e,activeIndex:n,getItemProps:t,listRef:o})=>s.jsx(s.Fragment,{children:e.map((r,i)=>Dn(r)?s.jsx(Br,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:n,getItemProps:t},r.id):s.jsx(qr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:n,getItemProps:t},r.id))});Mo.displayName="MenuList";const Br=m.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=jr(),[a,l]=m.useState(!1),d=Rt(),u=ns(),_=m.useRef([]),[g,f]=m.useState(null),{refs:c,floatingStyles:h,context:p,isPositioned:v}=mo({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[io({mainAxis:4,alignmentAxis:-4}),ao(),so({padding:8})],whileElementsMounted:no}),{isMounted:w,styles:y}=Co(p,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=ar(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:$s({blockPointerEvents:!0})}),E=yo(p,{role:"menu"}),A=ho(p,{bubbles:!0}),D=pr(p,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:N,getFloatingProps:T,getItemProps:L}=vo([x,E,A,D]);m.useEffect(()=>{if(!d)return;const V=()=>l(!1);return d.events.on("click",V),()=>{d.events.off("click",V)}},[d]);const I=n===t,O=Ui([c.setReference,r]);return s.jsxs(os,{id:u,children:[s.jsxs("div",{ref:O,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:I?0:-1,className:K($e.item,$e[`size_${i.size}`],I&&$e.active,e.isDisabled&&$e.disabled,e.isDanger&&$e.danger,$e.has_submenu,a&&$e.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&s.jsx("span",{className:$e.start_icon,children:e.startIcon}),s.jsxs("span",{className:$e.content,children:[s.jsx("span",{className:$e.label_text,children:e.label}),e.description&&s.jsx("span",{className:$e.description,children:e.description})]}),e.shortcut&&s.jsx("kbd",{className:$e.shortcut,children:e.shortcut}),s.jsx("span",{className:$e.submenu_arrow,children:s.jsx(zf,{})})]}),w&&s.jsx(po,{root:i.portalContainer,children:s.jsx(ur,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:s.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:s.jsx("div",{className:K($e.menu,$e[`variant_${i.variant}`],i.classNames?.menu),style:{...y,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...T(),children:s.jsx(Mo,{items:e.children,activeIndex:g,getItemProps:L,listRef:_})})})})})]})});Br.displayName="Submenu";const ba=m.forwardRef(({children:e,items:n,triggerAction:t="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:c=!0,className:h,classNames:p,style:v,onOpen:w,onClose:y,onOpenChange:x,onContextMenu:E,isOpen:A,zIndex:D,portalContainer:N,radioValue:T,onRadioChange:L},I)=>{const[O,V]=m.useState(!1),[$,b]=m.useState(null),[S,P]=m.useState(0),F=m.useRef([]),C=m.useRef([]),k=ns(),z=A!==void 0,q=z?A:O,j=m.useCallback(B=>{a&&B||(z||V(B),x?.(B),B?w?.():y?.())},[a,z,x,w,y]);m.useEffect(()=>{C.current=n.filter(B=>B.type!=="separator"&&B.type!=="label").map(B=>"label"in B&&typeof B.label=="string"?B.label:"")},[n]);const{refs:H,floatingStyles:J,context:U,isPositioned:ae}=mo({nodeId:k,open:q,onOpenChange:j,placement:o,strategy:"fixed",middleware:[io(l),ao({fallbackAxisSideDirection:"start",padding:8}),so({padding:8}),u?Ki({apply({rects:B,elements:G}){Object.assign(G.floating.style,{minWidth:`${B.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:no}),ie=ms(U,{enabled:!a&&(t==="click"||t==="both"),toggle:!0}),le=ar(U,{enabled:!a&&t==="hover",delay:{open:150,close:150},handleClose:$s()}),he=ho(U,{enabled:f||g,escapeKey:f,outsidePress:g}),_e=yo(U,{role:"menu"}),ge=pr(U,{listRef:F,activeIndex:$,onNavigate:b,loop:!0}),R=Cs(U,{listRef:C,activeIndex:$,onMatch:b,enabled:q}),{getReferenceProps:te,getFloatingProps:ne,getItemProps:ce}=vo([ie,le,he,_e,ge,R]),{isMounted:be,styles:ee}=Co(U,{duration:_?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});m.useImperativeHandle(I,()=>({open:()=>j(!0),close:()=>j(!1),toggle:()=>j(!q),isOpen:q}),[j,q]);const Ce=m.useMemo(()=>({radioValue:T,onRadioChange:L,cerrarMenu:()=>j(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:_,classNames:p,portalContainer:N,zIndex:D}),[T,L,j,c,i,r,_,p,N,D]),xe=m.isValidElement(e)?e:null,de=Ui([H.setReference,xe?.ref||null]);if(!xe)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ye=t==="contextmenu"||t==="both"?{onContextMenu:B=>{B.preventDefault();const G={x:B.clientX,y:B.clientY};E?.(B,G),j(!1),P(pe=>pe+1),requestAnimationFrame(()=>{H.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:G.x,y:G.y,top:G.y,left:G.x,right:G.x,bottom:G.y}}}),j(!0)})},onClick:()=>{q&&t==="contextmenu"&&j(!1)}}:{},W=m.cloneElement(e,te({...e.props,...ye,ref:de,"aria-haspopup":"menu","aria-expanded":q}));return s.jsx(Vr.Provider,{value:Ce,children:s.jsxs(os,{id:k,children:[W,be&&s.jsx(po,{root:N,children:s.jsx(ur,{context:U,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:H.setFloating,style:{...J,zIndex:D??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:s.jsx("div",{role:"menu","aria-orientation":"vertical",className:K($e.menu,$e[`variant_${r}`],$e[`size_${i}`],h,p?.menu),style:{...ee,minWidth:d,...v,transform:[ee.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ae||!q?"visible":"hidden"},...ne(),children:s.jsx(Mo,{items:n,activeIndex:$,getItemProps:ce,listRef:F})},S)})})})]})})});ba.displayName="DropdownMenuInner";const No=m.forwardRef((e,n)=>s.jsx(Yc,{children:s.jsx(ba,{...e,ref:n})}));No.displayName="DropdownMenu";const wa=m.forwardRef(({isEnabled:e=!0,children:n,...t},o)=>s.jsx(No,{...t,ref:o,triggerAction:"contextmenu",isDisabled:!e||t.isDisabled,children:n}));wa.displayName="ContextMenu";const Pt={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},Lf=({label:e,onClick:n,items:t,variant:o="solid",color:r="primary",size:i="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:_,fullWidth:g=!1,...f})=>{const[c,h]=m.useState(!1),p=K(Pt.group_button,Pt[`variant_${o}`],g&&Pt.full_width,_),v=()=>s.jsx("div",{className:K(Pt.chevron,c&&Pt.chevron_open),children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:s.jsx("path",{d:"m6 9 6 6 6-6"})})});return s.jsxs("div",{className:p,children:[s.jsx(nt,{variant:o,color:r,size:i,radius:a,isLoading:l,isDisabled:d,onClick:n,className:K(Pt.main_button,Pt.first_item),...f,children:e}),t&&s.jsx(No,{items:t,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:i,matchTriggerWidth:!1,children:s.jsx(nt,{variant:o,color:r,size:i,radius:a,isDisabled:d||l,isIconOnly:!0,className:K(Pt.dropdown_trigger,Pt.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},ya=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Ca=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),xa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),Sa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}),$a=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Re={overlay:"_overlay_1llsm_1",backdrop:"_backdrop_1llsm_25",visible:"_visible_1llsm_47",layout:"_layout_1llsm_71",columna_acciones:"_columna_acciones_1llsm_139",boton_flotante:"_boton_flotante_1llsm_159",boton_primario:"_boton_primario_1llsm_233",boton_peligro:"_boton_peligro_1llsm_243",panel:"_panel_1llsm_261",encabezado:"_encabezado_1llsm_289",titulo:"_titulo_1llsm_307",contenido:"_contenido_1llsm_323",paginacion:"_paginacion_1llsm_337",texto_paginacion:"_texto_paginacion_1llsm_363"},Pf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Tf=({isOpen:e,onClose:n,onApply:t,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[_,g]=m.useState(!1),[f,c]=m.useState(0),h=l||i==="transparente",p=m.useCallback(()=>{_||(g(!0),setTimeout(()=>{n(),g(!1),c(0)},650))},[n,_]);m.useEffect(()=>{e&&g(!1)},[e]),m.useEffect(()=>{if(!e)return;const I=O=>O.key==="Escape"&&p();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,p]);const v=m.useCallback(I=>{a&&I.target===I.currentTarget&&p()},[a,p]),w=m.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:y,totalPages:x,hasPagination:E}=m.useMemo(()=>{const I=Array.isArray(u)?u:[u];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[u]),{background:A}=Pf[i],D={background:A,pointerEvents:h?"none":"auto"},N=d?{position:"absolute"}:{},T=d?{position:"relative"}:{},L=s.jsxs("div",{className:Re.overlay,role:"dialog","aria-modal":"true",style:N,children:[s.jsx("div",{className:`${Re.backdrop} ${e&&!_?Re.visible:""}`,style:D,onClick:v}),s.jsxs("div",{className:`${Re.layout} ${e&&!_?Re.visible:""}`,style:T,children:[s.jsxs("aside",{className:Re.columna_acciones,children:[s.jsx(Jt,{content:"Cerrar",placement:"left",children:s.jsx("button",{className:Re.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:s.jsx(ya,{})})}),s.jsx(Jt,{content:"Aplicar filtros",placement:"left",children:s.jsx("button",{className:`${Re.boton_flotante} ${Re.boton_primario}`,onClick:()=>w(t),children:s.jsx(Ca,{})})}),s.jsx(Jt,{content:"Limpiar filtros",placement:"left",children:s.jsx("button",{className:`${Re.boton_flotante} ${Re.boton_peligro}`,onClick:()=>w(o),children:s.jsx(xa,{})})}),E&&s.jsxs("div",{className:Re.paginacion,children:[s.jsx("button",{className:Re.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.max(0,I-1)),disabled:f===0,"aria-label":"Página anterior",children:s.jsx(Sa,{})}),s.jsxs("span",{className:Re.texto_paginacion,children:[f+1," / ",x]}),s.jsx("button",{className:Re.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.min(x-1,I+1)),disabled:f===x-1,"aria-label":"Página siguiente",children:s.jsx($a,{})})]})]}),s.jsxs("main",{className:Re.panel,children:[s.jsx("header",{className:Re.encabezado,children:s.jsx("h2",{className:Re.titulo,children:r})}),s.jsx("div",{className:Re.contenido,children:s.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:y[f]},f)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return pn.createPortal(L,I)}return L};Z.Badge=Ur,Z.BadgeVoz=Oo,Z.Boton=nt,Z.Checkbox=Fn,Z.CheckboxGroup=Js,Z.ContextMenu=wa,Z.Drawer=_a,Z.DropdownContext=Vr,Z.DropdownMenu=No,Z.GrabacionIcono=ri,Z.GroupButton=Lf,Z.IconoCerrar=ya,Z.IconoDerecha=$a,Z.IconoFiltroAplicar=Ca,Z.IconoFiltroLimpiar=xa,Z.IconoIzquierda=Sa,Z.InputDate=oi,Z.InputNumeric=ni,Z.InputText=Jr,Z.MenuItem=qr,Z.MenuList=Mo,Z.MicrofonoIcono=Po,Z.Modal=ga,Z.ModalStack=Nf,Z.PanelFiltros=Tf,Z.Radio=Or,Z.RadioGroup=fa,Z.Select=Ts,Z.Signature=Zr,Z.SonidoIcono=To,Z.Submenu=Br,Z.TablaDatos=Ef,Z.TextArea=si,Z.Toggle=zo,Z.Tooltip=Jt,Z.Transicion=Vn,Z.esCheckbox=pa,Z.esLabel=va,Z.esRadio=ha,Z.esSeparador=ma,Z.fechaEnRango=rl,Z.formatearFecha=Lo,Z.formatearNumero=hn,Z.generarOpcionesAleatorias=zd,Z.generarUsuariosPrueba=Ld,Z.obtenerFechaHoy=ol,Z.parsearNumero=Qr,Z.procesarValidacion=ei,Z.redondearDecimales=ti,Z.restringirRango=On,Z.tieneHijos=Dn,Z.useCheckboxGroupContext=Xs,Z.useDropdownContext=jr,Z.useReconocimientoVoz=ii,Z.useTablaContext=qu,Z.useTablaContextSafe=Gt,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})}));
|
|
681
|
+
*/function In(e,t){return e?fp(e)?N.createElement(e,t):e:null}function fp(e){return _p(e)||typeof e=="function"||gp(e)}function _p(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function gp(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hp(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:op(t)})),[o,r]=N.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...o,...e.state},onStateChange:i=>{r(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const Me={checkbox_container:"_checkbox_container_17g3o_1",checkbox_wrapper:"_checkbox_wrapper_17g3o_13",label_text:"_label_text_17g3o_33",hint_text:"_hint_text_17g3o_51",checkbox:"_checkbox_17g3o_1",input:"_input_17g3o_99",checkbox_svg:"_checkbox_svg_17g3o_153",custom_icon:"_custom_icon_17g3o_195",checked:"_checked_17g3o_225",indeterminate:"_indeterminate_17g3o_227",radius_none:"_radius_none_17g3o_235",radius_sm:"_radius_sm_17g3o_243",radius_md:"_radius_md_17g3o_251",radius_lg:"_radius_lg_17g3o_259",radius_full:"_radius_full_17g3o_267",sm:"_sm_17g3o_275",lg:"_lg_17g3o_301",secondary:"_secondary_17g3o_327",success:"_success_17g3o_335",warning:"_warning_17g3o_343",danger:"_danger_17g3o_351",solid:"_solid_17g3o_377",outline:"_outline_17g3o_391",disabled:"_disabled_17g3o_439",readonly:"_readonly_17g3o_521",no_animation:"_no_animation_17g3o_597",line_through:"_line_through_17g3o_615",lineThrough:"_lineThrough_17g3o_1",checkbox_group:"_checkbox_group_17g3o_659",label:"_label_17g3o_33",marca_requerido:"_marca_requerido_17g3o_689",description:"_description_17g3o_697",checkboxes:"_checkboxes_17g3o_711",vertical:"_vertical_17g3o_721",horizontal:"_horizontal_17g3o_729",error_message:"_error_message_17g3o_739",input_validacion:"_input_validacion_17g3o_795"},Fl=v.createContext(null),Pl=()=>v.useContext(Fl),Ll=v.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:s,defaultChecked:i,isIndeterminate:l=!1,isDisabled:c=!1,isReadOnly:d=!1,isRequired:_=!1,lineThrough:g=!1,onlyIcon:f=!1,disableAnimation:u=!1,customCheckIcon:p,size:h="md",color:m="primary",customColor:y,radius:w="md",variant:C="solid",className:k="",classNames:A={},onChange:T,value:M,name:P,...L}=e,E=Pl(),B=v.useId(),V=v.useRef(null),$=s!==void 0,[b,S]=v.useState(i??!1),O=!!E,D=O&&M?E.value.includes(M):!1,x=O?D:$?s:b,I=c||E?.isDisabled,F=d||E?.isReadOnly,j=_||E?.isRequired,z=P||E?.name,H=O?!1:j;v.useEffect(()=>{V.current&&(V.current.indeterminate=l)},[l]);const X=ue=>{if(I||F)return;const oe=ue.target.checked;O&&M?E.onChange(M):($||S(oe),T?.(oe))},G=o||n;return a.jsxs("div",{className:W(Me.checkbox_container,{[Me.disabled]:I,[Me.readonly]:F},A.base,k),children:[a.jsxs("label",{className:W(Me.checkbox_wrapper,Me[h],!y&&Me[m],Me[C],Me[`radius_${w}`],{[Me.checked]:x,[Me.indeterminate]:l,[Me.disabled]:I,[Me.readonly]:F,[Me.line_through]:g&&x,[Me.no_animation]:u}),style:y?{"--checkbox-custom-color":y}:void 0,children:[a.jsxs("span",{className:Me.checkbox,children:[a.jsx("input",{ref:ue=>{V.current=ue,typeof t=="function"?t(ue):t&&(t.current=ue)},id:B,type:"checkbox",className:Me.input,checked:x,onChange:X,disabled:I,readOnly:F,required:H,value:M,name:z,...L}),p?a.jsx("span",{className:Me.custom_icon,children:p}):a.jsx("svg",{className:Me.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:a.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!f&&G&&a.jsx("span",{className:W(Me.label_text,A.label),children:G})]}),r&&a.jsx("span",{className:W(Me.hint_text,A.label),children:r})]})});Ll.displayName="Checkbox";const eo=v.memo(Ll),Ol=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:s="vertical",className:i,value:l,defaultValue:c=[],onChange:d,isDisabled:_=!1,isReadOnly:g=!1,isRequired:f=!1,name:u,justifyContent:p="flex-start",options:h,optionValueKey:m,optionLabelKey:y,optionDisabledKey:w,optionDescriptionKey:C})=>{const k=l!==void 0,[A,T]=v.useState(c),M=k?l:A,P=f&&M.length===0,L=r||P,E=P&&!o?"Selecciona al menos una opción":o,B=$=>{if(_||g)return;const b=M.includes($)?M.filter(S=>S!==$):[...M,$];k||T(b),d?.(b)},V=p==="center"?"center":p==="flex-end"?"right":"left";return a.jsxs("div",{className:W(Me.checkbox_group,Me[s],{[Me.invalid]:L,[Me.disabled]:_,[Me.readonly]:g},i),role:"group","aria-required":f,"aria-invalid":L,style:{textAlign:V},children:[e&&a.jsxs("div",{className:Me.label,children:[e,f&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),n&&a.jsx("div",{className:Me.description,children:n}),a.jsx(Fl.Provider,{value:{value:M,onChange:B,isDisabled:_,isReadOnly:g,isRequired:f,name:u},children:a.jsx("div",{className:W(Me.checkboxes,Me[s]),style:{justifyContent:p},children:h&&h.length>0?h.map(($,b)=>{let S,O,D=!1,x;if(typeof $=="object"&&$!==null){const I=m??"value",F=y??"label",j=w??"isDisabled",z=C??"description",H=$[I],X=$[F];S=String(H!==void 0?H:b),O=X;const G=$[j];D=typeof G=="boolean"?G:!1;const ue=$[z];x=typeof ue=="string"?ue:void 0}else S=String($),O=$;return a.jsx(eo,{value:S,isDisabled:D,hint:x,children:O},S)}):t})}),f&&a.jsx("input",{type:"checkbox",required:f,checked:M.length>0,readOnly:!0,tabIndex:-1,"aria-hidden":"true",className:Me.input_validacion}),E&&L&&a.jsx("div",{className:Me.error_message,children:E})]})};Ol.displayName="CheckboxGroup";const He={contenedor:"_contenedor_kj261_1",contenedor_superior:"_contenedor_superior_kj261_17",input_con_icono:"_input_con_icono_kj261_35",icono_busqueda:"_icono_busqueda_kj261_49",input_busqueda:"_input_busqueda_kj261_75",contenedor_acciones_botones:"_contenedor_acciones_botones_kj261_147",contenedor_acciones:"_contenedor_acciones_kj261_147",columna:"_columna_kj261_183",encabezados:"_encabezados_kj261_201",boton_basico:"_boton_basico_kj261_265",texto_filtros:"_texto_filtros_kj261_289",menu_configuraciones:"_menu_configuraciones_kj261_321",boton_excel:"_boton_excel_kj261_349",contenedor_tabla:"_contenedor_tabla_kj261_369",contenedor_datos:"_contenedor_datos_kj261_387",datos:"_datos_kj261_395",seleccionada:"_seleccionada_kj261_431",boton_acciones:"_boton_acciones_kj261_475"};function pp(e,t,n=3){const o=Math.floor(n/2);let r=e-o;r<1&&(r=1),r+n-1>t&&(r=Math.max(1,t-n+1));const s=Math.min(n,t);return Array.from({length:s},(i,l)=>r+l)}function mp(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function vp(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function Nn(e,t){const n=new Map;t.getFlatHeaders().forEach(i=>n.set(i.column.id,i));const o=n.get(e);if(o)return In(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(i=>i.id===e),s=r?.columnDef.header;return typeof s=="string"||typeof s=="number"?s:r?.id??e}function zl(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?In(n.column.columnDef.cell,n.getContext()):null}function Bl(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function bp(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function wp(e,t){if(t===0)return"";if(t===1)return As(e[0].nombre.toLowerCase());if(t===2)return`${As(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${As(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function As(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Vl(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const jl=v.createContext(null),Ds=jl;function yp({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:s,tamanioPaginaInicial:i=10,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_=[],sinDatosProps:g,...f}){const[u,p]=v.useState(""),h=lh(u,200),m=Qo("only screen and (max-width: 830px)"),[y,w]=v.useState({pageIndex:0,pageSize:i}),[C,k]=v.useState({}),A=v.useMemo(()=>{const I=[];if(_.length>0&&!m){const F={id:"select",header:({table:j})=>a.jsx(eo,{color:"secondary",isSelected:j.getIsAllPageRowsSelected(),isIndeterminate:j.getIsSomePageRowsSelected()&&!j.getIsAllPageRowsSelected(),onChange:z=>j.toggleAllPageRowsSelected(!!z)}),cell:({row:j})=>a.jsx(eo,{color:"primary",isSelected:j.getIsSelected(),isDisabled:!j.getCanSelect(),onChange:z=>j.toggleSelected(z)}),enableSorting:!1,enableHiding:!1};I.push(F)}if(I.push(...n),o?.length){const F={id:"actions",header:"Acciones",cell:j=>a.jsx("div",{className:He.contenedor_acciones,children:o.map(z=>"contenido"in z?a.jsx(gn,{content:z.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("span",{children:z.contenido(j.row.original,He.boton_acciones)},z.id)},z.id):a.jsx(gn,{content:z.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx(st,{id:z.id,size:"sm",radius:"md",variant:"light",isIconOnly:!0,onClick:()=>z.evento(j.row.original),className:He.boton_acciones,children:z.icono})},z.id))}),enableSorting:!1,enableHiding:!1};I.push(F)}return I},[n,o,_,m]),T=v.useMemo(()=>{const I=A.map(j=>"accessorKey"in j?String(j.accessorKey):"id"in j?String(j.id):"").filter(Boolean),F=I.indexOf("actions");return F>-1&&F<I.length-1&&(I.splice(F,1),I.push("actions")),I},[A]),[M,P]=v.useState(T),L=v.useCallback((I,F,j)=>{if(!j)return!0;const z=Vl(j),H=I.getValue(F);return H==null?!1:Vl(String(H)).includes(z)},[]),E=hp({data:t,columns:A,state:{pagination:y,globalFilter:h,columnOrder:M,rowSelection:C},globalFilterFn:L,enableRowSelection:_.length>0,onRowSelectionChange:k,onPaginationChange:w,onColumnOrderChange:P,getCoreRowModel:rp(),getSortedRowModel:up(),getFilteredRowModel:cp(),getPaginationRowModel:dp(),autoResetPageIndex:!1}),B=E.getPageCount();v.useEffect(()=>{const I=mp(y.pageIndex,B);I!==y.pageIndex&&w(F=>({...F,pageIndex:I}))},[B]),v.useEffect(()=>{h!==void 0&&E.setPageIndex(0)},[h]);const V=v.useMemo(()=>E.getAllLeafColumns().filter(I=>I.id!=="actions"&&I.id!=="select"&&I.getCanHide?.()),[E]),$=v.useCallback(I=>{const j=n.find(z=>"accessorKey"in z?z.accessorKey===I:z.id===I)?.header;return typeof j=="string"||typeof j=="number"?String(j):I},[n]),b=v.useCallback(()=>{E.setColumnVisibility({}),E.setPageSize(i),E.setPageIndex(0),E.resetRowSelection(),P(T)},[E,i,T]),S=v.useCallback(I=>{const F=Math.max(1,Math.min(200,I));E.setPageSize(F),E.setPageIndex(0)},[E]),O=v.useCallback(I=>{P(F=>typeof I=="function"?I(F):I)},[]),x={state:{ordenColumnas:M,table:E,columns:A,controls:o,loading:r,primerasColumnas:[String(s[0]),String(s[1])],inputBusqueda:u,setInputBusqueda:p,filtros:l,descargarExcel:c,actualizarTabla:d,selectorFilas:_,sinDatosProps:g,...f},todasLasColumnas:V,etiquetaColumna:$,restaurarConfiguracion:b,cambiarPageSize:S,cambiarOrdenColumnas:O};return a.jsx(jl.Provider,{value:x,children:e})}function Cp(){const e=v.useContext(Ds);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function nn(){const e=v.useContext(Ds);return e||null}const Ht={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function ql(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Hl(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function xp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function Sp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function $p(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"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 kp(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[a.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),a.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function Ep(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function Ip(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function Np(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[a.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Mp(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Ap(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function Dp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"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 Tp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"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 Fp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}function Pp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",children:[a.jsx("path",{fill:"currentColor",d:"M7.378 11.63h-.75zm0 .926l-.562.497a.75.75 0 0 0 1.08.044zm2.141-1.015a.75.75 0 0 0-1.038-1.082zm-2.958-1.038a.75.75 0 1 0-1.122.994zm8.37-1.494a.75.75 0 1 0 1.102-1.018zM12.045 6.25c-2.986 0-5.416 2.403-5.416 5.38h1.5c0-2.137 1.747-3.88 3.916-3.88zm-5.416 5.38v.926h1.5v-.926zm1.269 1.467l1.622-1.556l-1.038-1.082l-1.622 1.555zm.042-1.039l-1.378-1.555l-1.122.994l1.377 1.556zm8.094-4.067a5.42 5.42 0 0 0-3.99-1.741v1.5a3.92 3.92 0 0 1 2.889 1.26zm.585 3.453l.56-.498a.75.75 0 0 0-1.08-.043zm-2.139 1.014a.75.75 0 1 0 1.04 1.082zm2.96 1.04a.75.75 0 0 0 1.12-.997zm-8.393 1.507a.75.75 0 0 0-1.094 1.026zm2.888 2.745c2.993 0 5.434-2.4 5.434-5.38h-1.5c0 2.135-1.753 3.88-3.934 3.88zm5.434-5.38v-.926h-1.5v.926zm-1.27-1.467l-1.619 1.555l1.04 1.082l1.618-1.555zm-.04 1.04l1.38 1.554l1.122-.996l-1.381-1.555zM7.952 16.03a5.45 5.45 0 0 0 3.982 1.719v-1.5c-1.143 0-2.17-.48-2.888-1.245z"}),a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",opacity:".5"})]})})}function Lp(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})})}function Op(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"currentColor",role:"button",...e,children:a.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"})})}const zp=({titulo:e,onBack:t})=>a.jsxs("header",{className:Ht.header,children:[a.jsx(st,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:a.jsx(ql,{})}),a.jsx("h3",{className:Ht.titulo,children:e})]}),hn={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 Bp(){const e=nn(),[t,n]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:s,cambiarOrdenColumnas:i}=e,{ordenColumnas:l}=o,c=g=>f=>{n(g),f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",g)},d=g=>f=>{f.preventDefault(),!(!t||t===g)&&i?.(u=>{const p=[...u],h=p.indexOf(t),m=p.indexOf(g);return h===-1||m===-1?u:(p.splice(h,1),p.splice(m,0,t),p)})},_=()=>n(null);return a.jsx("div",{className:hn.contenedor,children:a.jsx("ul",{className:hn.lista,children:l.map(g=>{const f=r.find(m=>m.id===g);if(!f)return null;const u=f.getCanHide?.()??!0,p=f.getIsVisible(),h=t===f.id;return a.jsxs("li",{className:`${hn.item} ${h?hn.item_dragging:""}`,draggable:!0,onDragStart:c(f.id),onDragOver:d(f.id),onDrop:_,onDragEnd:_,children:[a.jsx("span",{className:hn.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(Np,{})}),a.jsx("span",{className:hn.nombre,children:s(f.id)}),a.jsx(eo,{size:"md",color:"primary",isSelected:p,isDisabled:!u,onChange:m=>f.toggleVisibility(m),className:hn.checkbox})]},f.id)})})})}const to={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Vp(){const e=nn(),[t,n]=v.useState(""),o=v.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(v.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:s}=e,i=g=>Math.max(Ts,Math.min(Fs,g)),l=g=>{const f=r+g;f>=Ts&&f<=Fs&&s?.(f)},c=()=>{const g=parseInt(t,10),f=!isNaN(g)&&g>0?i(g):r;s?.(f),n(String(f))},d=g=>{({Enter:()=>{c(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},_=g=>{const f=g.target.value;(f===""||/^\d+$/.test(f))&&n(f)};return a.jsxs("div",{className:to.contenido,children:[a.jsx("p",{className:to.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:to.control,children:[a.jsx(st,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Ts,children:a.jsx(Tp,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:to.valor,children:a.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:_,onKeyDown:d,onFocus:()=>o.current?.select(),onBlur:c,className:to.input,"aria-label":"Número de filas por página"})}),a.jsx(st,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Fs,children:a.jsx(Dp,{})})]})]})}const _t={contenedor:"_contenedor_1lwmx_1",menu:"_menu_1lwmx_11",item:"_item_1lwmx_25",icono_contenedor:"_icono_contenedor_1lwmx_111",icono_restaurar:"_icono_restaurar_1lwmx_143",texto:"_texto_1lwmx_153",nombre:"_nombre_1lwmx_165",descripcion:"_descripcion_1lwmx_183",chevron:"_chevron_1lwmx_201",divider:"_divider_1lwmx_227"};function jp({navegar:e}){const t=nn();return a.jsxs("div",{className:_t.contenedor,children:[a.jsx("nav",{className:_t.menu,children:Rp.map(({id:n,icono:o,nombre:r,descripcion:s})=>a.jsxs("button",{className:_t.item,onClick:()=>e(n),children:[a.jsx("div",{className:_t.icono_contenedor,children:a.jsx(o,{})}),a.jsxs("div",{className:_t.texto,children:[a.jsx("span",{className:_t.nombre,children:r}),a.jsx("span",{className:_t.descripcion,children:s})]}),a.jsx(Hl,{className:_t.chevron})]},n))}),a.jsx("div",{className:_t.divider}),a.jsx("div",{className:_t.menu,children:a.jsxs("button",{className:_t.item,onClick:t?.restaurarConfiguracion,children:[a.jsx("div",{className:_t.icono_contenedor,children:a.jsx(Ip,{className:_t.icono_restaurar})}),a.jsxs("div",{className:_t.texto,children:[a.jsx("span",{className:_t.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:_t.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Ts=1,Fs=200,Rl=250,qp=200,Hp={panelPrincipal:{component:jp},panelColumnas:{component:Bp,titulo:"Columnas visibles"},panelFilas:{component:Vp,titulo:"Filas por página"}},Rp=[{id:"panelColumnas",icono:Mp,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Ap,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Up(e,t,n){const o=v.useRef(n);o.current=n;const r=v.useRef(e);r.current=e;const s=v.useCallback(i=>{const l=i.target;o.current.some(d=>d.current?.contains(l))||r.current()},[]);v.useEffect(()=>{if(!t)return;const i=setTimeout(()=>{document.addEventListener("mousedown",s)},100);return()=>{clearTimeout(i),document.removeEventListener("mousedown",s)}},[t,s])}function Ul(e,t){v.useEffect(()=>{if(!t)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e])}function Wp(e,t,n,{width:o,offsetRight:r=0,offsetLeft:s=0,offsetTop:i=0,offsetBottom:l=0,shiftPadding:c=8}){const[d,_]=v.useState({top:0,left:0}),g=Qo("only screen and (max-width: 480px)"),f=v.useCallback(()=>{if(!e.current)return{top:0,left:0};const u=e.current.getBoundingClientRect(),p=c;let h=u.bottom+i,m=0;g?m=u.right-o-s+r:m=u.right-o+r-s;const y=t.current?.offsetHeight||400;h+y>window.innerHeight-p&&(h=u.top-y-l,h<p&&(h=p));const w=p,C=window.innerWidth-o-p;return m=Math.max(w,Math.min(m,C)),{top:h,left:m}},[g,o,r,s,i,l,c,e,t]);return v.useEffect(()=>{if(!n||!e.current)return;const u=()=>{_(f())};return u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,!0),()=>{window.removeEventListener("resize",u),window.removeEventListener("scroll",u,!0)}},[n,f,e]),d}function Gp(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function Kp(){const[e,t]=v.useState(!1),[n,o]=v.useState(!1),[r,s]=v.useState("panelPrincipal"),[i,l]=v.useState(null),c=v.useRef(null),d=v.useRef(null),_=v.useRef(null);Gp(n),Up(()=>f(),n,[c,d]),Ul(()=>f(),n);const g=Wp(c,d,n,{width:Rl,offsetRight:6,offsetTop:-2,shiftPadding:8});v.useEffect(()=>{e&&(o(!0),l(null))},[e]),v.useEffect(()=>()=>{_.current&&clearTimeout(_.current)},[]);function f(){n&&(t(!1),_.current=window.setTimeout(()=>{o(!1),s("panelPrincipal"),l(null)},qp))}function u(m){l(m==="panelPrincipal"?"backward":"forward"),s(m)}const p=Hp[r],h=p.component;return a.jsxs("div",{className:Ht.contenedor,children:[a.jsx(st,{isIconOnly:!0,ref:c,variant:"light",onClick:()=>t(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:a.jsx(Ep,{})}),n&&c.current&&Dn.createPortal(a.jsx("div",{ref:d,className:`${Ht.popover} ${e?Ht.popover_entrada:Ht.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:Rl},children:a.jsx("div",{className:Ht.ventana,children:a.jsxs("div",{className:W([Ht.panel,Ht[`panel_${i}`]]),children:[p.titulo&&a.jsx(zp,{titulo:p.titulo,onBack:()=>u("panelPrincipal")}),a.jsx(h,{navegar:u})]},r)})}),document.body)]})}function Xp(){const e=nn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,loading:r,filtros:s,actualizarTabla:i,descargarExcel:l,paginacion:c}=t,{abrirFiltros:d,filtrosAplicados:_=[]}=s||{},g=_?.length||0;return a.jsxs("section",{className:He.contenedor_superior,children:[a.jsxs("div",{className:He.input_con_icono,id:"buscador-tabla",children:[a.jsx(xp,{className:He.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:He.input_busqueda})]}),a.jsxs("div",{className:He.contenedor_acciones_botones,children:[a.jsxs("div",{className:He.contenedor_acciones,children:[c?.hayMasDatos&&a.jsxs(st,{id:"cargar-mas-datos",variant:"light",className:He.boton_basico,disabled:r,onClick:c.onCargarMasDatos,children:[a.jsx(Pp,{}),r?"Actualizando...":"Más datos"]}),d!==void 0&&a.jsxs(st,{id:"boton-filtros",onClick:d,variant:"light",className:He.boton_basico,children:[a.jsx($p,{})," Filtros"]}),g>0?a.jsxs("div",{className:He.texto_filtros,id:"filtros-aplicados",children:[a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:a.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),a.jsx("p",{children:wp(_,g)})]}):null]}),l!==void 0?a.jsxs(st,{onClick:l,className:`${He.boton_basico} ${He.boton_excel}`,children:[a.jsx(Sp,{})," Excel"]}):null]}),a.jsxs("div",{className:He.contenedor_acciones,children:[i!==void 0&&a.jsx(gn,{content:"Actualiza los últimos datos guardados",children:a.jsx(st,{id:"actualizar-tabla",variant:"light",isIconOnly:!0,className:He.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:a.jsx(kp,{})})}),a.jsx("div",{className:He.menu_configuraciones,id:"configuraciones-tabla",children:a.jsx(Kp,{})})]})]})}const Ft={contenedor_paginacion:"_contenedor_paginacion_1l3vz_1",info_paginacion:"_info_paginacion_1l3vz_19",contenedor_botones:"_contenedor_botones_1l3vz_37",boton_paginacion:"_boton_paginacion_1l3vz_87",pagina_activa:"_pagina_activa_1l3vz_107",boton_num_paginacion:"_boton_num_paginacion_1l3vz_117"};function Yp(){const e=nn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:s}=n.getState().pagination,i=s+1,l=pp(i,r),c=n.getCanPreviousPage(),d=n.getCanNextPage(),_=r>1,g=s===0,f=s===r-1,u=()=>{c&&n.previousPage()},p=()=>{d&&n.nextPage()},h=w=>{n.setPageIndex(w-1)},m=()=>{g||n.firstPage()},y=()=>{f||n.lastPage()};return a.jsxs("section",{className:Ft.contenedor_paginacion,id:"paginacion-tabla",children:[a.jsxs("p",{className:Ft.info_paginacion,id:"paginacion-total-documentos",children:["Documentos: ",o]}),_&&a.jsxs("div",{className:Ft.contenedor_botones,id:"paginacion-numerador-pags",children:[!g&&a.jsx(Lp,{id:"paginacion-flecha-inicio",onClick:m,"aria-label":"Ir a la primera página","aria-disabled":g,className:Ft.boton_paginacion}),c&&a.jsx(ql,{id:"paginacion-flecha-izq",onClick:u,"aria-disabled":!c,className:Ft.boton_paginacion}),a.jsx("div",{id:"paginacion-numero-pag",children:l.map(w=>a.jsx("button",{type:"button",onClick:()=>h(w),"aria-current":w===i?"page":void 0,className:w===i?Ft.pagina_activa:Ft.boton_num_paginacion,children:w},w))}),d&&a.jsx(Hl,{id:"paginacion-flecha-der",onClick:p,"aria-disabled":!d,className:Ft.boton_paginacion}),!f&&a.jsx(Op,{id:"paginacion-flecha-fin",onClick:y,"aria-label":"Ir a la última página","aria-disabled":f,className:Ft.boton_paginacion})]}),a.jsxs("p",{className:Ft.info_paginacion,id:"paginacion-total-pags",children:["Página ",i," de ",r]})]})}const Ne={contenedor_tabla_cards:"_contenedor_tabla_cards_zuvsb_1",contenedor_card:"_contenedor_card_zuvsb_11",contenedor_encabezado_card:"_contenedor_encabezado_card_zuvsb_25",contenedor_columna_card:"_contenedor_columna_card_zuvsb_47",card_label:"_card_label_zuvsb_57",card_valor:"_card_valor_zuvsb_69",card_segundo_valor:"_card_segundo_valor_zuvsb_83",contenedor_contenido_cards:"_contenedor_contenido_cards_zuvsb_93",contenedor_fila_card:"_contenedor_fila_card_zuvsb_105",card_fila_label:"_card_fila_label_zuvsb_119",card_fila_valor:"_card_fila_valor_zuvsb_137",contenedor_acciones_card:"_contenedor_acciones_card_zuvsb_153",boton_acciones:"_boton_acciones_zuvsb_171",boton_card:"_boton_card_zuvsb_207",boton_personalizado:"_boton_personalizado_zuvsb_237"};function Wl(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function Gl(e){if(e)return e.id??e.accessorKey}const Rt={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 Zp({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const i=n.getAllLeafColumns().filter(c=>c.id!=="actions"&&c.id!==o&&c.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return a.jsx("section",{className:Ne.contenedor_tabla_cards,children:Array.from({length:e}).map((c,d)=>a.jsxs("article",{className:Ne.contenedor_card,children:[a.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[a.jsx("div",{className:Ne.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(o,n)}),a.jsx("div",{className:Ne.card_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:Ne.contenedor_columna_card,children:r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(r,n)}),a.jsx("div",{className:Ne.card_segundo_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:Ne.contenedor_contenido_cards,children:i.map((_,g)=>a.jsxs("div",{className:Ne.contenedor_fila_card,children:[a.jsx("div",{className:Ne.card_fila_label,children:Nn(_.id,n)}),a.jsx("div",{className:Ne.card_fila_valor,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},_.id))}),t>0&&a.jsx("div",{className:Ne.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((_,g)=>a.jsx("div",{className:Rt.skeleton_accion,children:a.jsx("div",{className:`${Rt.skeleton_elemento} ${Rt.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${d}`))})}const pn={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129"};function Kl(){const e=v.useContext(Ds),{sinDatosProps:t}=e?.state||{},{botonAccion:n,titulo:o="No se encontraron coincidencias",descripcion:r='Usa el botón "Filtros" para ampliar tu búsqueda.'}=t||{};return a.jsxs("div",{className:pn.contenedor,children:[a.jsx(Jp,{}),a.jsxs("div",{className:pn.envolvedor_contenido,children:[a.jsx(Qp,{}),a.jsx("h3",{className:pn.titulo,children:o}),a.jsx("p",{className:pn.descripcion,children:r}),n]})]})}function Jp(){return a.jsx("div",{className:pn.envolvedor_cuadricula,children:a.jsxs("svg",{className:pn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("defs",{children:a.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:a.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Qp(){return a.jsxs("svg",{className:pn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),a.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),a.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),a.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const em=({fila:e,controls:t})=>(t?.length??0)>0?a.jsx("div",{className:Ne.contenedor_acciones_card,children:t?.map(o=>"contenido"in o?a.jsxs("span",{className:`${Ne.boton_personalizado} ${Ne.boton_acciones} ${Ne.boton_card}`,onClick:r=>{const s=r.currentTarget.querySelector("button");s&&!s.contains(r.target)&&s.click()},children:[o.contenido(e.original)," ",o.nombre]},o.id):a.jsxs("button",{id:o.id,type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ne.boton_acciones} ${Ne.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,tm=({columnasRestantes:e,table:t})=>e.length===0?null:a.jsx("div",{className:Ne.contenedor_contenido_cards,children:e.map(n=>a.jsxs("div",{className:Ne.contenedor_fila_card,children:[a.jsx("div",{className:Ne.card_fila_label,children:Nn(n.column.id,t)}),a.jsx("div",{className:Ne.card_fila_valor,children:In(n.column.columnDef.cell,n.getContext())})]},n.id))}),nm=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=Bl(e,n),s=Bl(e,o);return a.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[a.jsx("div",{className:Ne.contenedor_columna_card,children:n&&r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(n,t)}),a.jsx("div",{className:Ne.card_valor,children:zl(e,n)})]})}),a.jsx("div",{className:Ne.contenedor_columna_card,children:o&&s&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:Ne.card_label,children:Nn(o,t)}),a.jsx("div",{className:Ne.card_segundo_valor,children:zl(e,o)})]})})]})};function om(){const e=nn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:s,columns:i}=t;if(!n)return null;const l=i&&r?Wl(i,r[0]):void 0,c=i&&r?Wl(i,r[1]):void 0,d=Gl(l),_=Gl(c);if(s)return a.jsx(Zp,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:d,idSegundaColumna:_});const g=n.getRowModel().rows;return g.length===0?a.jsx("article",{className:Ne.contenedor_card,children:a.jsx(Kl,{})}):a.jsx("section",{className:Ne.contenedor_tabla_cards,children:g.map(f=>{const u=bp(f,d,_);return a.jsxs("article",{className:Ne.contenedor_card,children:[a.jsx(nm,{fila:f,table:n,idPrimeraColumna:d,idSegundaColumna:_}),a.jsx(tm,{columnasRestantes:u,table:n}),a.jsx(em,{fila:f,controls:o})]},f.id)})})}const Xl={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},rm=({columnas:e,filas:t})=>a.jsx(a.Fragment,{children:Array.from({length:t}).map((n,o)=>a.jsx("tr",{className:Xl.filas,children:Array.from({length:e}).map((r,s)=>a.jsx("td",{className:Xl.columnas},`sk-cell-${o}-${s}`))},`sk-row-${o}`))}),mn={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 sm({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,s]=v.useState(0),[i,l]=v.useState([]),[c,d]=v.useState([]),_=e>0,g=v.useRef(null);return Ul(o,_),v.useEffect(()=>{_&&(s(e),l(t),d(n))},[e,t,n,_]),a.jsx(po,{mostrar:_,tipo:"escalar",className:mn.contenedor,children:a.jsxs("div",{ref:g,className:mn.barra,children:[a.jsxs("div",{className:mn.info,children:[a.jsx(st,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:mn.btn_cerrar,children:a.jsx(Fp,{})}),a.jsxs("p",{className:mn.contador,children:[r," filas seleccionadas"]})]}),a.jsx("div",{className:mn.separador}),a.jsx("div",{className:mn.acciones,children:i.map(f=>a.jsx("div",{children:f.componente(c)},f.id))})]})})}function im(){const e=nn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:s=[]}=t;if(!n)return null;const i=n.getHeaderGroups(),l=n.getRowModel().rows,c=r?.length??0,d=n.getSelectedRowModel().rows,_=d.length,g=()=>{n.resetRowSelection()};return a.jsxs(a.Fragment,{children:[a.jsxs("table",{className:He.contenedor_tabla,children:[a.jsx("thead",{children:i.map(f=>a.jsx("tr",{children:f.headers.map(u=>{const p=u.column.columnDef.meta?.style;return a.jsx("th",{className:He.encabezados,style:p,"data-columna":u.id,children:u.id==="select"?a.jsx("div",{children:In(u.column.columnDef.header,u.getContext())}):a.jsxs("div",{onClick:u.column.getToggleSortingHandler(),children:[In(u.column.columnDef.header,u.getContext()),vp(u.column.getIsSorted())]})},u.id)})},f.id))}),a.jsx("tbody",{className:He.contenedor_datos,children:o?a.jsx(rm,{columnas:c,filas:10}):l.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:c,style:{backgroundColor:"var(--base)"},children:a.jsx(Kl,{})})}):l.map(f=>a.jsx("tr",{className:`${He.datos} ${f.getIsSelected()?He.seleccionada:""}`,children:f.getVisibleCells().map(u=>{const p=u.column.columnDef.meta?.style;return a.jsx("td",{className:He.columna,style:p,"data-columna":u.column.id,children:In(u.column.columnDef.cell,u.getContext())},u.id)})},f.id))})]}),s?.length>0?a.jsx(sm,{totalSeleccionadas:_,acciones:s,filasSeleccionadas:d.map(f=>f.original),onLimpiarSeleccion:g}):null]})}function am({id:e}){const t=Qo("only screen and (max-width: 830px)");return a.jsxs("main",{className:He.contenedor,id:e,children:[a.jsx(Xp,{}),t?a.jsx(om,{}):a.jsx(im,{}),a.jsx(Yp,{})]})}function lm({id:e,...t}){return a.jsx(yp,{...t,children:a.jsx(am,{id:e})})}const Te={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},Yl=v.createContext(void 0),cm=()=>v.useContext(Yl),Ps=v.memo(v.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:s,variant:i="default",isDisabled:l=!1,isReadOnly:c=!1,isInvalid:d=!1,isRequired:_=!1,children:g,className:f="",onChange:u,...p},h)=>{const m=cm(),y=v.useId(),w=p.id||y,C=m?.name||p.name,k=m?.size||o,A=m?.color||r,T=m?.customColor||s,M=m?.variant||i,P=m?.isDisabled||l,L=m?.isReadOnly||c,E=m?.isInvalid||d,B=m?.isRequired||_,V=m?.value!==void 0?m.value===e:void 0,$=g||t,b=D=>{P||L||(m?.onChange&&m.onChange(e),u&&u(D))},S=[Te.contenedor_radio,Te[`tam_${k}`],!T&&Te[`color_${A}`],Te[`variante_${M}`],P&&Te.deshabilitado,L&&Te.solo_lectura,E&&Te.invalido,V&&Te.seleccionado,f].filter(Boolean).join(" "),O=T?{"--radio-custom-color":T}:void 0;return a.jsx("div",{className:S,style:O,children:a.jsxs("label",{className:Te.envoltorio_radio,htmlFor:w,children:[a.jsxs("div",{className:Te.radio,children:[a.jsx("input",{ref:h,type:"radio",id:w,name:C,value:e,checked:V,disabled:P,readOnly:L,required:B,"aria-invalid":E,className:Te.input,onChange:b,...p}),a.jsx("div",{className:Te.circulo_radio,children:a.jsx("div",{className:Te.punto_radio})})]})," ",$&&a.jsxs("div",{className:Te.contenedor_label,children:[a.jsxs("span",{className:Te.texto_label,children:[$,_&&!m&&a.jsx("span",{className:Te.marca_requerido,children:" *"})]}),n&&a.jsx("span",{className:Te.texto_descripcion,children:n})]})]})})}));Ps.displayName="Radio";const Zl=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:s,description:i,isDisabled:l=!1,isReadOnly:c=!1,isRequired:d=!1,isInvalid:_=!1,errorMessage:g,size:f,color:u,customColor:p,variant:h,justifyContent:m="flex-start",children:y,className:w="",options:C,optionValueKey:k,optionLabelKey:A,optionDisabledKey:T,optionDescriptionKey:M})=>{const[P,L]=v.useState(String(n??"")),E=t!==void 0?String(t):P,V={name:e,value:E,onChange:S=>{l||c||(t===void 0&&L(S),o&&o(S))},size:f,color:u,customColor:p,variant:h,isDisabled:l,isReadOnly:c,isInvalid:_,isRequired:d},$=[Te.grupo_radio,Te[`orientacion_${r}`],_&&Te.grupo_invalido,l&&Te.grupo_deshabilitado,c&&Te.grupo_solo_lectura,w].filter(Boolean).join(" "),b=m==="center"?"center":m==="flex-end"?"right":"left";return a.jsx(Yl.Provider,{value:V,children:a.jsxs("div",{className:$,role:"radiogroup","aria-required":d,"aria-invalid":_,style:{textAlign:b},children:[s&&a.jsxs("div",{className:Te.encabezado_grupo,children:[a.jsxs("label",{className:Te.label_grupo,children:[s,d&&a.jsx("span",{className:Te.marca_requerido,children:" *"})]}),i&&a.jsx("span",{className:Te.descripcion_grupo,children:i})]}),a.jsx("div",{className:Te.contenedor_radios,style:{justifyContent:m},children:C&&C.length>0?C.map((S,O)=>{let D,x,I=!1,F;if(typeof S=="object"&&S!==null){const j=k??"value",z=A??"label",H=T??"isDisabled",X=M??"description",G=S[j],ue=S[z];D=String(G!==void 0?G:O),x=ue;const oe=S[H];I=typeof oe=="boolean"?oe:!1;const ie=S[X];F=typeof ie=="string"?ie:void 0}else D=String(S),x=S;return a.jsx(Ps,{value:D,isDisabled:I,description:F,children:x},D)}):y}),_&&g&&a.jsx("span",{className:Te.mensaje_error,children:g})]})})};Zl.displayName="RadioGroup";const gt={backdrop:"_backdrop_1fyqe_1",visible:"_visible_1fyqe_37",drawer:"_drawer_1fyqe_57",posicion_right:"_posicion_right_1fyqe_123",drawer_detras:"_drawer_detras_1fyqe_155",posicion_left:"_posicion_left_1fyqe_163",posicion_top:"_posicion_top_1fyqe_203",posicion_bottom:"_posicion_bottom_1fyqe_243",radio_none:"_radio_none_1fyqe_283",radio_sm:"_radio_sm_1fyqe_291",radio_md:"_radio_md_1fyqe_311",radio_lg:"_radio_lg_1fyqe_331",radio_xl:"_radio_xl_1fyqe_351",tamano_sm:"_tamano_sm_1fyqe_451",tamano_md:"_tamano_md_1fyqe_461",tamano_lg:"_tamano_lg_1fyqe_471",tamano_xl:"_tamano_xl_1fyqe_481",tamano_full:"_tamano_full_1fyqe_491",encabezado:"_encabezado_1fyqe_551",titulo:"_titulo_1fyqe_571",boton_cerrar:"_boton_cerrar_1fyqe_591",contenido:"_contenido_1fyqe_645",pie:"_pie_1fyqe_657",loading_overlay:"_loading_overlay_1fyqe_677",spinner:"_spinner_1fyqe_701",spin:"_spin_1fyqe_701",loading_text:"_loading_text_1fyqe_731",resize_handle:"_resize_handle_1fyqe_743"},Jl=v.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:s=!0,closeOnBackdropClick:i=!0,closeOnEscape:l=!0,preventScroll:c=!0,header:d,footer:_,children:g,className:f="",contentClassName:u="",isLoading:p=!1,loadingMessage:h="Cargando...",onOpen:m,backdropVariant:y="normal",borderRadius:w,resizable:C=!1,zIndex:k,getContainer:A},T)=>{const M=v.useRef(null),[P,L]=v.useState(!1),E=v.useCallback(()=>{P||(L(!0),setTimeout(()=>{t?.(),L(!1)},650))},[t,P]);v.useEffect(()=>{e&&L(!1)},[e]),v.useEffect(()=>{if(e){if(m?.(),c){const H=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",H>0&&(document.body.style.paddingRight=`${H}px`)}if(l){const H=X=>{X.key==="Escape"&&E()};return document.addEventListener("keydown",H),()=>{document.removeEventListener("keydown",H),c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{c&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,E,l,c,m]);const B=H=>{i&&H.target===M.current&&E()},V=w?gt[`radio_${w}`]:void 0,$=e&&!P,b=[gt.drawer,gt[`posicion_${n}`],gt[`tamano_${o}`],$&>.visible,V,f].filter(Boolean).join(" "),S=[gt.contenido,u].filter(Boolean).join(" "),O=[gt.backdrop,$&>.visible].filter(Boolean).join(" "),D=k||500,x={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},I=x[y]||x.normal,{opacity:F}=I,j={background:`rgb(0 0 0 / ${F})`,zIndex:D,...A&&{position:"absolute"}},z=a.jsx("div",{className:O,ref:M,onClick:B,style:j,children:a.jsxs("div",{ref:T,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||d)&&a.jsx("div",{className:gt.encabezado,children:d||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:"drawer-title",className:gt.titulo,children:r}),s&&a.jsx("button",{type:"button",className:gt.boton_cerrar,onClick:E,"aria-label":"Cerrar",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),a.jsx("div",{className:S,children:g}),_&&a.jsx("div",{className:gt.pie,children:_}),p&&a.jsxs("div",{className:gt.loading_overlay,children:[a.jsx("div",{className:gt.spinner}),a.jsx("span",{className:gt.loading_text,children:h})]}),C&&a.jsx("div",{className:gt.resize_handle})]})});if(A){const H=typeof A=="function"?A():A;if(H&&H instanceof HTMLElement)return Dn.createPortal(z,H)}return z});Jl.displayName="Drawer";const tt={backdrop:"_backdrop_1rfkw_1",visible:"_visible_1rfkw_37",centrado:"_centrado_1rfkw_61",modal:"_modal_1rfkw_69",tamano_sm:"_tamano_sm_1rfkw_143",tamano_md:"_tamano_md_1rfkw_151",tamano_lg:"_tamano_lg_1rfkw_159",tamano_xl:"_tamano_xl_1rfkw_167",tamano_formulario:"_tamano_formulario_1rfkw_175",tamano_full:"_tamano_full_1rfkw_183",tamano_auto:"_tamano_auto_1rfkw_191",encabezado:"_encabezado_1rfkw_201",encabezado_personalizado:"_encabezado_personalizado_1rfkw_221",contenedor_titulo_completo:"_contenedor_titulo_completo_1rfkw_233",header_extra:"_header_extra_1rfkw_243",contenedor_titulo_icono:"_contenedor_titulo_icono_1rfkw_261",icono_titulo:"_icono_titulo_1rfkw_273",titulo:"_titulo_1rfkw_287",contenido:"_contenido_1rfkw_307",pie:"_pie_1rfkw_319",loading_overlay:"_loading_overlay_1rfkw_339",spinner:"_spinner_1rfkw_363",spin:"_spin_1rfkw_363",loading_text:"_loading_text_1rfkw_393"},Ql=v.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:s=!1,closeOnEscape:i=!0,preventScroll:l=!0,isCentered:c=!0,header:d,footer:_,children:g,className:f="",contentClassName:u="",isLoading:p=!1,loadingMessage:h="Cargando...",backdropVariant:m="normal",showIconTitle:y=!1,onOpen:w},C)=>{const k=v.useId(),A=v.useRef(null),T=v.useCallback(()=>{p||t?.()},[t,p]);v.useEffect(()=>{if(e){if(w?.(),l){const b=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",b>0&&(document.body.style.paddingRight=`${b}px`)}if(i){const b=S=>{S.key==="Escape"&&T()};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,T,i,l,w]);const M=b=>{s&&b.target===A.current&&T()},P=[tt.backdrop,c&&tt.centrado,e&&tt.visible].filter(Boolean).join(" "),L=[tt.modal,tt[`tamano_${n}`],f].filter(Boolean).join(" "),E=[tt.contenido,u].filter(Boolean).join(" "),B={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:V}=B[m]||B.normal,$={background:`rgb(0 0 0 / ${V})`};return a.jsx("div",{className:P,ref:A,onClick:M,style:$,children:a.jsxs("div",{ref:C,className:L,role:"dialog","aria-modal":"true","aria-labelledby":o?k:void 0,children:[(o||d)&&a.jsx("div",{className:[tt.encabezado,d&&tt.encabezado_personalizado].filter(Boolean).join(" "),children:d?a.jsx("div",{className:tt.header_extra,children:d}):a.jsx("div",{className:tt.contenedor_titulo_completo,children:a.jsxs("div",{className:tt.contenedor_titulo_icono,children:[y&&r!==void 0&&(typeof r=="string"?a.jsx("span",{className:tt.icono_titulo,children:r}):r),y&&r===void 0&&a.jsx("span",{className:tt.icono_titulo,children:"📄"}),o&&a.jsx("h2",{id:k,className:tt.titulo,children:o})]})})}),a.jsx("div",{className:E,children:g}),_&&a.jsx("div",{className:tt.pie,children:_}),p&&a.jsxs("div",{className:tt.loading_overlay,children:[a.jsx("div",{className:tt.spinner}),a.jsx("span",{className:tt.loading_text,children:h})]})]})})});Ql.displayName="Modal";const kt={overlay:"_overlay_1jsdb_1",container:"_container_1jsdb_47",modal:"_modal_1jsdb_65",modal_closing:"_modal_closing_1jsdb_125",modal_detras:"_modal_detras_1jsdb_143",header:"_header_1jsdb_217",button_back:"_button_back_1jsdb_233",title_container:"_title_container_1jsdb_289",title_icon:"_title_icon_1jsdb_305",title:"_title_1jsdb_289",content:"_content_1jsdb_337",footer:"_footer_1jsdb_349"};function dm({modals:e,onClose:t}){const[n,o]=v.useState([]),[r,s]=v.useState(!1);v.useEffect(()=>{const f=()=>{s(window.innerWidth<=768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const i=f=>{o(u=>[...u,f]),setTimeout(()=>{t(f),o(u=>u.filter(p=>p!==f))},300)};if(e.length===0)return null;const l=e.length-1,c=500,d=24,_=e.length*c+(e.length-1)*d,g=e.length>1?_/2-c/2-l*(c+d):0;return a.jsx("div",{className:kt.overlay,children:a.jsx("div",{className:kt.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((f,u)=>{const p=n.includes(f.id),h=u===e.length-1,m=[kt.modal,p&&kt.modal_closing,!h&&kt.modal_detras].filter(Boolean).join(" ");return a.jsxs("div",{className:m,children:[a.jsxs("div",{className:kt.header,children:[a.jsx("button",{type:"button",className:kt.button_back,onClick:()=>i(f.id),"aria-label":"Volver",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),a.jsxs("div",{className:kt.title_container,children:[f.titleIcon&&a.jsx("span",{className:kt.title_icon,children:f.titleIcon}),a.jsx("h2",{className:kt.title,children:f.title})]})]}),a.jsx("div",{className:kt.content,children:f.content}),f.footer&&a.jsx("div",{className:kt.footer,children:f.footer})]},f.id)})})})}const Ls=v.createContext(null),Os=()=>{const e=v.useContext(Ls);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},no=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ec=e=>e.type==="checkbox",tc=e=>e.type==="radio",nc=e=>e.type==="separator",oc=e=>e.type==="label",$e={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},um=()=>a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),fm=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),_m=({marcado:e})=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&a.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),zs=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Os();if(nc(e))return a.jsx("div",{className:W($e.separator,s.classNames?.separator),role:"separator"});if(oc(e))return a.jsx("div",{className:W($e.label,s.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const i=t===n,l=ec(e),c=tc(e),d=M=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):c&&s.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(M),s.closeOnSelect&&!no(e)&&s.cerrarMenu())},_=M=>{d(M)},g=M=>{"isDisabled"in e&&e.isDisabled||(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),d(M))},f=l?e.isChecked:!1,u=c?s.radioValue===e.value:!1,p="label"in e?e.label:void 0,h="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,y="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,A="isDanger"in e?e.isDanger:!1,T="className"in e?e.className:void 0;return a.jsxs("div",{ref:r,role:l?"menuitemcheckbox":c?"menuitemradio":"menuitem","aria-checked":l?f:c?u:void 0,"aria-disabled":C||k,tabIndex:i?0:-1,className:W($e.item,$e[`size_${s.size}`],i&&$e.active,C&&$e.disabled,k&&$e.loading,A&&$e.danger,no(e)&&$e.has_submenu,T,s.classNames?.item),onClick:_,onKeyDown:g,...o(),children:[k?a.jsx("span",{className:$e.indicator,children:a.jsx("span",{className:$e.spinner_item})}):(l||c)&&a.jsxs("span",{className:$e.indicator,children:[l&&f&&a.jsx(um,{}),c&&a.jsx(_m,{marcado:u})]}),!k&&y&&a.jsx("span",{className:$e.start_icon,children:y}),a.jsxs("span",{className:$e.content,children:[a.jsx("span",{className:$e.label_text,children:p}),h&&a.jsx("span",{className:$e.description,children:h})]}),m&&a.jsx("kbd",{className:$e.shortcut,children:m}),w&&a.jsx("span",{className:$e.end_icon,children:w}),no(e)&&a.jsx("span",{className:$e.submenu_arrow,children:a.jsx(fm,{})})]})});zs.displayName="MenuItem";const gm=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),sr=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>a.jsx(a.Fragment,{children:e.map((r,s)=>no(r)?a.jsx(Bs,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id):a.jsx(zs,{ref:i=>{o.current[s]=i},item:r,index:s,activeIndex:t,getItemProps:n},r.id))});sr.displayName="MenuList";const Bs=v.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const s=Os(),[i,l]=v.useState(!1),c=un(),d=ja(),_=v.useRef([]),[g,f]=v.useState(null),{refs:u,floatingStyles:p,context:h,isPositioned:m}=Go({nodeId:d,open:i,onOpenChange:l,placement:"right-start",middleware:[Lo({mainAxis:4,alignmentAxis:-4}),zo(),Oo({padding:8})],whileElementsMounted:To}),{isMounted:y,styles:w}=Jo(h,{duration:s.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:s.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),C=rs(h,{enabled:!e.isDisabled,delay:{open:75},handleClose:dl({blockPointerEvents:!0})}),k=Zo(h,{role:"menu"}),A=Wo(h,{bubbles:!0}),T=fs(h,{listRef:_,activeIndex:g,onNavigate:f,nested:!0}),{getReferenceProps:M,getFloatingProps:P,getItemProps:L}=Ko([C,k,A,T]);v.useEffect(()=>{if(!c)return;const V=()=>l(!1);return c.events.on("click",V),()=>{c.events.off("click",V)}},[c]);const E=t===n,B=Da([u.setReference,r]);return a.jsxs(qa,{id:d,children:[a.jsxs("div",{ref:B,role:"menuitem","aria-haspopup":"menu","aria-expanded":i,"aria-disabled":e.isDisabled,tabIndex:E?0:-1,className:W($e.item,$e[`size_${s.size}`],E&&$e.active,e.isDisabled&&$e.disabled,e.isDanger&&$e.danger,$e.has_submenu,i&&$e.submenu_open,e.className,s.classNames?.item),...M(o()),children:[e.startIcon&&a.jsx("span",{className:$e.start_icon,children:e.startIcon}),a.jsxs("span",{className:$e.content,children:[a.jsx("span",{className:$e.label_text,children:e.label}),e.description&&a.jsx("span",{className:$e.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:$e.shortcut,children:e.shortcut}),a.jsx("span",{className:$e.submenu_arrow,children:a.jsx(gm,{})})]}),y&&a.jsx(Uo,{root:s.portalContainer,children:a.jsx(ls,{context:h,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:u.setFloating,style:{...p,pointerEvents:"none",zIndex:s.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:W($e.menu,$e[`variant_${s.variant}`],s.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:m||!i?"visible":"hidden"},...P(),children:a.jsx(sr,{items:e.children,activeIndex:g,getItemProps:L,listRef:_})})})})})]})});Bs.displayName="Submenu";const rc=v.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:s="md",isDisabled:i=!1,offset:l=4,minWidth:c="180px",matchTriggerWidth:d=!1,disableAnimation:_=!1,closeOnClickOutside:g=!0,closeOnEscape:f=!0,closeOnSelect:u=!0,className:p,classNames:h,style:m,onOpen:y,onClose:w,onOpenChange:C,onContextMenu:k,isOpen:A,zIndex:T,portalContainer:M,radioValue:P,onRadioChange:L},E)=>{const[B,V]=v.useState(!1),[$,b]=v.useState(null),[S,O]=v.useState(0),D=v.useRef([]),x=v.useRef([]),I=ja(),F=A!==void 0,j=F?A:B,z=v.useCallback(q=>{i&&q||(F||V(q),C?.(q),q?y?.():w?.())},[i,F,C,y,w]);v.useEffect(()=>{x.current=t.filter(q=>q.type!=="separator"&&q.type!=="label").map(q=>"label"in q&&typeof q.label=="string"?q.label:"")},[t]);const{refs:H,floatingStyles:X,context:G,isPositioned:ue}=Go({nodeId:I,open:j,onOpenChange:z,placement:o,strategy:"fixed",middleware:[Lo(l),zo({fallbackAxisSideDirection:"start",padding:8}),Oo({padding:8}),d?Aa({apply({rects:q,elements:R}){Object.assign(R.floating.style,{minWidth:`${q.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:To}),oe=nl(G,{enabled:!i&&(n==="click"||n==="both"),toggle:!0}),ie=rs(G,{enabled:!i&&n==="hover",delay:{open:150,close:150},handleClose:dl()}),_e=Wo(G,{enabled:f||g,escapeKey:f,outsidePress:g}),ge=Zo(G,{role:"menu"}),ke=fs(G,{listRef:D,activeIndex:$,onNavigate:b,loop:!0}),J=al(G,{listRef:x,activeIndex:$,onMatch:b,enabled:j}),{getReferenceProps:re,getFloatingProps:Y,getItemProps:ye}=Ko([oe,ie,_e,ge,ke,J]),{isMounted:ce,styles:ee}=Jo(G,{duration:_?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:_?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});v.useImperativeHandle(E,()=>({open:()=>z(!0),close:()=>z(!1),toggle:()=>z(!j),isOpen:j}),[z,j]);const ne=v.useMemo(()=>({radioValue:P,onRadioChange:L,cerrarMenu:()=>z(!1),closeOnSelect:u,size:s,variant:r,disableAnimation:_,classNames:h,portalContainer:M,zIndex:T}),[P,L,z,u,s,r,_,h,M,T]),xe=v.isValidElement(e)?e:null,de=Da([H.setReference,xe?.ref||null]);if(!xe)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Se=n==="contextmenu"||n==="both"?{onContextMenu:q=>{q.preventDefault();const R={x:q.clientX,y:q.clientY};k?.(q,R),z(!1),O(fe=>fe+1),requestAnimationFrame(()=>{H.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:R.x,y:R.y,top:R.y,left:R.x,right:R.x,bottom:R.y}}}),z(!0)})},onClick:()=>{j&&n==="contextmenu"&&z(!1)}}:{},U=v.cloneElement(e,re({...e.props,...Se,ref:de,"aria-haspopup":"menu","aria-expanded":j}));return a.jsx(Ls.Provider,{value:ne,children:a.jsxs(qa,{id:I,children:[U,ce&&a.jsx(Uo,{root:M,children:a.jsx(ls,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:H.setFloating,style:{...X,zIndex:T??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:W($e.menu,$e[`variant_${r}`],$e[`size_${s}`],p,h?.menu),style:{...ee,minWidth:c,...m,transform:[ee.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:ue||!j?"visible":"hidden"},...Y(),children:a.jsx(sr,{items:t,activeIndex:$,getItemProps:ye,listRef:D})},S)})})})]})})});rc.displayName="DropdownMenuInner";const ir=v.forwardRef((e,t)=>a.jsx(Ng,{children:a.jsx(rc,{...e,ref:t})}));ir.displayName="DropdownMenu";const sc=v.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>a.jsx(ir,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));sc.displayName="ContextMenu";const Ut={group_button:"_group_button_wgdis_1",full_width:"_full_width_wgdis_17",main_button:"_main_button_wgdis_27",dropdown_trigger:"_dropdown_trigger_wgdis_35",first_item:"_first_item_wgdis_45",last_item:"_last_item_wgdis_55",variant_bordered:"_variant_bordered_wgdis_65",variant_ghost:"_variant_ghost_wgdis_67",variant_faded:"_variant_faded_wgdis_69",disabled:"_disabled_wgdis_93",loading:"_loading_wgdis_93",chevron:"_chevron_wgdis_111",chevron_open:"_chevron_open_wgdis_123"},hm=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:s="md",radius:i="md",isLoading:l=!1,isDisabled:c=!1,dropdownIcon:d,className:_,fullWidth:g=!1,...f})=>{const[u,p]=v.useState(!1),h=W(Ut.group_button,Ut[`variant_${o}`],g&&Ut.full_width,_),m=()=>a.jsx("div",{className:W(Ut.chevron,u&&Ut.chevron_open),children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:a.jsx("path",{d:"m6 9 6 6 6-6"})})});return a.jsxs("div",{className:h,children:[a.jsx(st,{variant:o,color:r,size:s,radius:i,isLoading:l,isDisabled:c,onClick:t,className:W(Ut.main_button,Ut.first_item),...f,children:e}),n&&a.jsx(ir,{items:n,triggerAction:"click",onOpenChange:p,placement:"bottom-end",isDisabled:c||l,variant:"default",size:s,matchTriggerWidth:!1,children:a.jsx(st,{variant:o,color:r,size:s,radius:i,isDisabled:c||l,isIconOnly:!0,className:W(Ut.dropdown_trigger,Ut.last_item),"aria-label":"M�s acciones",children:d||m()})})]})},ic=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),ac=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),lc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),cc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),dc=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),Qe={overlay:"_overlay_1llsm_1",backdrop:"_backdrop_1llsm_25",visible:"_visible_1llsm_47",layout:"_layout_1llsm_71",columna_acciones:"_columna_acciones_1llsm_139",boton_flotante:"_boton_flotante_1llsm_159",boton_primario:"_boton_primario_1llsm_233",boton_peligro:"_boton_peligro_1llsm_243",panel:"_panel_1llsm_261",encabezado:"_encabezado_1llsm_289",titulo:"_titulo_1llsm_307",contenido:"_contenido_1llsm_323",paginacion:"_paginacion_1llsm_337",texto_paginacion:"_texto_paginacion_1llsm_363"},pm={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},mm=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:s="sutil",closeOnBackdropClick:i=!0,allowBackdropInteraction:l=!1,getContainer:c,children:d})=>{const[_,g]=v.useState(!1),[f,u]=v.useState(0),p=l||s==="transparente",h=v.useCallback(()=>{_||(g(!0),setTimeout(()=>{t(),g(!1),u(0)},650))},[t,_]);v.useEffect(()=>{e&&g(!1)},[e]),v.useEffect(()=>{if(!e)return;const E=B=>B.key==="Escape"&&h();return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,h]);const m=v.useCallback(E=>{i&&E.target===E.currentTarget&&h()},[i,h]),y=v.useCallback(E=>{document.activeElement?.blur(),E?.()},[]),{pages:w,totalPages:C,hasPagination:k}=v.useMemo(()=>{const E=Array.isArray(d)?d:[d];return{pages:E,totalPages:E.length,hasPagination:E.length>1}},[d]),{background:A}=pm[s],T={background:A,pointerEvents:p?"none":"auto"},M=c?{position:"absolute"}:{},P=c?{position:"relative"}:{},L=a.jsxs("div",{className:Qe.overlay,role:"dialog","aria-modal":"true",style:M,children:[a.jsx("div",{className:`${Qe.backdrop} ${e&&!_?Qe.visible:""}`,style:T,onClick:m}),a.jsxs("div",{className:`${Qe.layout} ${e&&!_?Qe.visible:""}`,style:P,children:[a.jsxs("aside",{className:Qe.columna_acciones,children:[a.jsx(gn,{content:"Cerrar",placement:"left",children:a.jsx("button",{className:Qe.boton_flotante,onClick:()=>y(h),"aria-label":"Cerrar panel",children:a.jsx(ic,{})})}),a.jsx(gn,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_primario}`,onClick:()=>y(n),children:a.jsx(ac,{})})}),a.jsx(gn,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{className:`${Qe.boton_flotante} ${Qe.boton_peligro}`,onClick:()=>y(o),children:a.jsx(lc,{})})}),k&&a.jsxs("div",{className:Qe.paginacion,children:[a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>u(E=>Math.max(0,E-1)),disabled:f===0,"aria-label":"Página anterior",children:a.jsx(cc,{})}),a.jsxs("span",{className:Qe.texto_paginacion,children:[f+1," / ",C]}),a.jsx("button",{className:Qe.boton_flotante,style:{width:36,height:36},onClick:()=>u(E=>Math.min(C-1,E+1)),disabled:f===C-1,"aria-label":"Página siguiente",children:a.jsx(dc,{})})]})]}),a.jsxs("main",{className:Qe.panel,children:[a.jsx("header",{className:Qe.encabezado,children:a.jsx("h2",{className:Qe.titulo,children:r})}),a.jsx("div",{className:Qe.contenido,children:a.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:w[f]},f)})]})]})]});if(c){const E=typeof c=="function"?c():c;if(E&&E instanceof HTMLElement)return Dn.createPortal(L,E)}return L};Q.Badge=Di,Q.BadgeVoz=Pr,Q.Boton=st,Q.Checkbox=eo,Q.CheckboxGroup=Ol,Q.ContextMenu=sc,Q.Drawer=Jl,Q.DropdownContext=Ls,Q.DropdownMenu=ir,Q.GrabacionIcono=Hi,Q.GroupButton=hm,Q.IconoCerrar=ic,Q.IconoDerecha=dc,Q.IconoFiltroAplicar=ac,Q.IconoFiltroLimpiar=lc,Q.IconoIzquierda=cc,Q.InputDate=qi,Q.InputNumeric=ji,Q.InputText=Oi,Q.MenuItem=zs,Q.MenuList=sr,Q.MicrofonoIcono=Tr,Q.Modal=Ql,Q.ModalStack=dm,Q.PanelFiltros=mm,Q.Radio=Ps,Q.RadioGroup=Zl,Q.Select=Cl,Q.Signature=Li,Q.SonidoIcono=Fr,Q.Submenu=Bs,Q.TablaDatos=lm,Q.TextArea=Ui,Q.Toggle=Ar,Q.Tooltip=gn,Q.Transicion=po,Q.esCheckbox=ec,Q.esLabel=oc,Q.esRadio=tc,Q.esSeparador=nc,Q.fechaEnRango=Bf,Q.formatearFecha=Dr,Q.formatearNumero=Bn,Q.generarOpcionesAleatorias=hh,Q.generarUsuariosPrueba=ph,Q.obtenerFechaHoy=zf,Q.parsearNumero=zi,Q.procesarValidacion=Bi,Q.redondearDecimales=Vi,Q.restringirRango=ho,Q.tieneHijos=no,Q.useCheckboxGroupContext=Pl,Q.useDropdownContext=Os,Q.useReconocimientoVoz=Ri,Q.useTablaContext=Cp,Q.useTablaContextSafe=nn,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"})}));
|
|
29
682
|
//# sourceMappingURL=index.umd.cjs.map
|