bonsaif-ui 0.1.166 → 0.1.167

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.
@@ -1050,7 +1050,7 @@ function xn(e, t) {
1050
1050
  });
1051
1051
  return n.displayName = e, n;
1052
1052
  }
1053
- const sm = /* @__PURE__ */ r("path", { d: "M5 2.5h8.25L19 8.25V20.5A1.5 1.5 0 0 1 17.5 22h-11A1.5 1.5 0 0 1 5 20.5V2.5Z" }), cm = /* @__PURE__ */ r("path", { fill: "#fff", fillOpacity: 0.32, d: "M13.25 2.5V8.25H19Z" });
1053
+ const sm = /* @__PURE__ */ r("path", { d: "M3.5 1.75h9.25L20.5 7.75V20.75A1.5 1.5 0 0 1 19 22.25H5A1.5 1.5 0 0 1 3.5 20.75V1.75Z" }), cm = /* @__PURE__ */ r("path", { fill: "#fff", fillOpacity: 0.32, d: "M12.75 1.75V7.75H20.5Z" });
1054
1054
  function dm(e, t = 5.5) {
1055
1055
  const n = e.length > 3;
1056
1056
  return /* @__PURE__ */ r(
@@ -1,4 +1,4 @@
1
- (function(A,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("react/jsx-runtime"),require("react-icons/hi2"),require("react-dom"),require("recharts"),require("overlayscrollbars"),require("sonner"),require("overlayscrollbars-react"),require("react-day-picker"),require("react-day-picker/dist/style.css"),require("react-icons/fi")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-icons/hi2","react-dom","recharts","overlayscrollbars","sonner","overlayscrollbars-react","react-day-picker","react-day-picker/dist/style.css","react-icons/fi"],s):(A=typeof globalThis<"u"?globalThis:A||self,s(A.BonsaifUI={},A.React,A.jsxRuntime,A.ReactIconsHi2,A.ReactDOM,A.Recharts,A.OverlayScrollbarsGlobal,A.Sonner,A.OverlayScrollbarsReact,A.ReactDayPicker,A.ReactDayPickerStyles,A.ReactIconsFi))})(this,(function(A,s,t,F,bt,Oe,Ra,eo,As,to,mg,vd){"use strict";"use client";function Pe(...e){return e.filter(Boolean).join(" ")}function xd({variant:e="primary",className:r,type:n="button",children:a,...o}){return t.jsx("button",{className:Pe("bonsaif-ui-button",`bonsaif-ui-button--${e}`,r),type:n,...o,children:a})}function Ls({value:e,onChange:r,placeholder:n,className:a="",autoFocus:o=!1,forceExpanded:l=!1,onEscape:i,size:c="default",inputTabIndex:f}){const d=s.useRef(null),[h,b]=s.useState(!1),u=l||h||e.trim().length>0,p=c==="sm"?"h-9 rounded-md":"h-10 rounded-lg",g=a||"w-48 max-w-full sm:w-64 lg:w-72";s.useEffect(()=>{var v;o&&((v=d.current)==null||v.focus())},[o]);const w=()=>{var v;b(!0),(v=d.current)==null||v.focus()};return t.jsxs("div",{className:`relative min-w-0 max-w-full flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${u?g:"w-24 sm:w-28"}`,onMouseDown:v=>{u||(v.preventDefault(),w())},children:[t.jsx(F.HiMagnifyingGlass,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",style:{color:"var(--text-muted)",left:"var(--page-header-control-icon-left, 12px)"}}),t.jsx("input",{ref:d,type:"text",tabIndex:f,"aria-label":n,value:e,onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Escape"&&(i==null||i())},placeholder:u?n:"Buscar",className:`${p} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${u?"pl-9 pr-8":"cursor-pointer pl-9 pr-3"}`,style:{height:`var(--page-header-control-height, ${c==="sm"?"36px":"40px"})`,paddingLeft:"calc(var(--page-header-control-icon-left, 12px) + 24px)",paddingRight:u?"calc(var(--page-header-control-padding-x, 14px) + 18px)":"var(--page-header-control-padding-x, 14px)",background:"color-mix(in srgb, var(--bg-card) 86%, transparent)",border:"1px solid var(--border)",color:"var(--text-main)"},onFocus:v=>{b(!0),v.currentTarget.style.borderColor="var(--primary)",v.currentTarget.style.boxShadow="0 0 0 3px rgba(59,130,246,0.12)"},onBlur:v=>{b(!1),v.currentTarget.style.borderColor="var(--border)",v.currentTarget.style.boxShadow="none"}}),e&&t.jsx("button",{type:"button",onClick:()=>r(""),className:"absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",style:{color:"var(--text-muted)",right:"var(--page-header-control-padding-x, 8px)"},"aria-label":"Limpiar búsqueda",children:t.jsx(F.HiXMark,{className:"h-3.5 w-3.5 flex-shrink-0"})})]})}const $s=s.createContext({});let Ds=0;const Is="bonsaif-ui:hide-tooltips";function _n(e=700){Ds=Date.now()+e}function yd(){return Date.now()>Ds}function zn(e){if(typeof document>"u")return!1;const r=Array.from(document.querySelectorAll('[data-bonsaif-overlay="true"], [role="menu"], [role="dialog"][aria-modal="true"], [aria-hidden="false"] [aria-modal="true"]'));return e&&r.some(n=>n.contains(e))?!1:r.length>0}function wd(e){var a;const r=Array.from(e.querySelectorAll("*")).filter(o=>{var l;return o.scrollWidth>o.clientWidth&&!!((l=o.textContent)!=null&&l.trim())&&o.tagName.toLowerCase()!=="svg"&&!o.closest("svg")});return(e.scrollWidth>e.clientWidth||r.length>0)&&(((a=r[0])==null?void 0:a.textContent)??e.textContent??"").trim()||null}function Xt({children:e,content:r,onlyWhenOverflow:n=!1,interactive:a=!1,followCursor:o=!0,placement:l="bottom",showArrow:i=!1,className:c="",tooltipClassName:f="",style:d,tooltipStyle:h,as:b="div"}){const u=s.useRef(null),p=s.useRef(null),g=s.useRef(null),w=s.useRef(!1),[v,E]=s.useState(null),[y,T]=s.useState("");s.useEffect(()=>{const D=u.current;D&&(D.querySelectorAll("[title]").forEach(Z=>{const O=Z.getAttribute("title");O&&(Z.getAttribute("aria-label")||Z.setAttribute("aria-label",O),Z.removeAttribute("title"))}),D.querySelectorAll("svg title").forEach(Z=>Z.remove()))}),s.useLayoutEffect(()=>{if(!v)return;const D=p.current;if(!D)return;const Z=12,O=14,ne=D.getBoundingClientRect(),ee=window.innerWidth-ne.width-Z,fe=window.innerHeight-ne.height-Z;let J=v.mouseX+O,W=v.mouseY+O,R,$;if(!o&&u.current){const P=u.current.getBoundingClientRect(),ue=P.left+P.width/2,z=P.top+P.height/2;l==="top"?(J=ue-ne.width/2,W=P.top-ne.height-O,$=ne.height-1):l==="left"?(J=P.left-ne.width-O,W=z-ne.height/2,R=ne.width-1):l==="right"?(J=P.right+O,W=z-ne.height/2,R=-7):(J=ue-ne.width/2,W=P.bottom+O,$=-7)}if(o&&(J>ee&&(J=v.mouseX-ne.width-O),W>fe&&(W=v.mouseY-ne.height-O)),J=Math.min(Math.max(Z,J),Math.max(Z,ee)),W=Math.min(Math.max(Z,W),Math.max(Z,fe)),!o&&u.current){const P=u.current.getBoundingClientRect(),ue=P.left+P.width/2,z=P.top+P.height/2;l==="top"||l==="bottom"?R=Math.min(Math.max(14,ue-J),ne.width-14):$=Math.min(Math.max(14,z-W),ne.height-14)}(Math.abs(J-v.x)>.5||Math.abs(W-v.y)>.5||R!==v.arrowX||$!==v.arrowY)&&E(P=>P&&{...P,x:J,y:W,arrowX:R,arrowY:$})},[o,l,v]);const L=()=>{g.current&&(window.clearTimeout(g.current),g.current=null)},C=(D,Z)=>{if(!yd()||w.current)return;const O=u.current;if(O&&!zn(O)){if(n){const ne=wd(O);if(!ne)return;T(ne)}!n&&!r||E({mouseX:D,mouseY:Z,x:D+14,y:Z+14})}},m=()=>{const D=u.current;if(!D)return;const Z=D.getBoundingClientRect();C(Z.left+Z.width/2,Z.bottom)},S=()=>{L(),E(null)},N=()=>{if(!a){S();return}L(),g.current=window.setTimeout(()=>E(null),120)},_=()=>{_n(),w.current=!0,S()},U=()=>{w.current=!1};s.useEffect(()=>{if(!v)return;if(zn(u.current)){E(null);return}const D=()=>E(null),Z=()=>{_n(),w.current=!0,E(null)};document.addEventListener("pointerdown",Z,!0),document.addEventListener("click",Z,!0),document.addEventListener("scroll",D,!0),window.addEventListener("blur",D),document.addEventListener("visibilitychange",D),document.addEventListener("keydown",D,!0);const O=new MutationObserver(()=>{zn(u.current)&&E(null)});return O.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","aria-hidden","class"]}),()=>{document.removeEventListener("pointerdown",Z,!0),document.removeEventListener("click",Z,!0),document.removeEventListener("scroll",D,!0),window.removeEventListener("blur",D),document.removeEventListener("visibilitychange",D),document.removeEventListener("keydown",D,!0),O.disconnect()}},[v]),s.useEffect(()=>{const D=()=>_n(),Z=()=>{_n(),w.current=!0,E(null)};return document.addEventListener("pointerdown",D,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",D,!0),window.addEventListener(Is,Z),()=>{document.removeEventListener("pointerdown",D,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",D,!0),window.removeEventListener(Is,Z)}},[]);const K=n?y:r;return t.jsxs(t.Fragment,{children:[t.jsx(b,{ref:D=>{u.current=D},className:c,style:d,onMouseEnter:D=>{L(),U(),o?C(D.clientX,D.clientY):m()},onMouseMove:D=>{v&&o&&C(D.clientX,D.clientY)},onMouseDown:_,onClick:_,onMouseLeave:()=>{U(),N()},onFocus:m,onBlur:S,children:e}),v&&K&&!zn(u.current)?bt.createPortal(t.jsxs("div",{ref:p,role:"tooltip",className:f,onMouseEnter:a?L:void 0,onMouseLeave:a?N:void 0,style:{position:"fixed",top:v.y,left:v.x,zIndex:9999,background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:6,padding:"5px 10px",fontSize:12,color:"var(--text-main)",boxShadow:"0 4px 16px rgba(0,0,0,0.35)",pointerEvents:a?"auto":"none",maxWidth:"min(420px, calc(100vw - 24px))",whiteSpace:"normal",lineHeight:1.6,overflowWrap:"anywhere",...h},children:[i&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",width:12,height:12,background:(h==null?void 0:h.background)??"var(--bg-card)",borderLeft:l==="right"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderTop:l==="bottom"||l==="right"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderRight:l==="left"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderBottom:l==="top"||l==="left"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,transform:"rotate(45deg)",left:v.arrowX===void 0?void 0:v.arrowX-6,top:v.arrowY===void 0?void 0:v.arrowY-6,zIndex:-1}}),K]}),document.body):null]})}function Fs(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}const Nd="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg",kd={primary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",secondary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",danger:"border border-[var(--border)] text-[var(--danger)] hover:border-[var(--danger)] hover:bg-[var(--danger-bg)] active:scale-[0.98] transition-colors",ghost:"text-[var(--text-secondary)] hover:opacity-70",icon:"text-[var(--text-muted)] hover:text-[var(--primary)] hover:bg-primary/5"},Sd="border border-[var(--border)] text-[var(--text-muted)] shadow-sm shadow-black/5 hover:border-[var(--border)] hover:bg-[var(--bg-input)] hover:text-[var(--primary)] active:scale-[0.98] transition-colors",Cd={xs:"h-8 px-2.5 text-xs",sm:"h-9 px-3.5 text-xs",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-sm font-semibold"},Ed={xs:"h-8 w-8",sm:"h-9 w-9",md:"h-10 w-10",lg:"h-10 w-10"},Md={primary:{background:"var(--bg-card)"},secondary:{background:"var(--bg-card)"},danger:{background:"var(--bg-card)"},ghost:{},icon:{}};function ro(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(ro).join(" ").trim():s.isValidElement(e)?ro(e.props.children):""}function Td(e){return s.Children.toArray(e).find(s.isValidElement)??null}function Ke({variant:e="primary",size:r="md",loading:n=!1,icon:a,tooltip:o,iconOnly:l,height:i,padding:c,children:f,className:d="",disabled:h,style:b,...u}){const p=s.useContext($s),g=l??p.iconOnly??e==="icon",w=p.compact??!1,v=p.headerAction??!1,E=v&&r==="md"?"sm":w&&!v&&r==="md"?"xs":r,y=e==="icon"||g,T=v&&y,L=ro(f),C=o??u.title??u["aria-label"]??(g?L:void 0),m=C?void 0:u.title,S=u["aria-label"]??(typeof C=="string"?C:L||void 0),N=n?null:a??(g?Td(f):null),_=t.jsxs("button",{...u,title:m,"aria-label":S,"data-variant":e,"data-size":E,"data-icon":y?"true":void 0,disabled:h||n,className:`${Nd} ${T?Sd:kd[e]} ${y?Ed[E]:Cd[E]} ${w&&!y?"px-2.5":""} ${d}`,style:{...Md[e],height:Fs(i),padding:Fs(c),...b,...v&&!y?{height:"var(--page-header-control-height, 34px)",padding:"0 var(--page-header-control-padding-x, 10px)",borderRadius:"8px"}:null,...T?{width:"var(--page-header-control-height, 40px)",height:"var(--page-header-control-height, 40px)",padding:0,background:"var(--bg-card)",borderRadius:"8px"}:null},children:[n?t.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):N,!g&&f]});return C?t.jsx(Xt,{as:"span",content:C,className:"inline-flex shrink-0",children:_}):_}const St={background:"color-mix(in srgb, var(--text-muted) 26%, var(--bg-input))"};function Wn({rows:e=8,columns:r=7,showToolbar:n=!0,showPagination:a=!0,compact:o=!1,className:l=""}){const i=Math.max(3,Math.min(r,12)),c=Math.max(3,Math.min(e,20)),f=o?"px-2 py-2":"px-3 py-2.5",d=o?"px-2 py-2":"px-3 py-3";return t.jsxs("div",{className:`w-full min-w-0 overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${l}`,"aria-busy":"true","aria-label":"Cargando tabla",children:[n&&t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-3 py-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("div",{className:"h-7 w-14 shrink-0 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 max-w-md flex-1 animate-pulse rounded-md",style:St})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St})]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("div",{className:"min-w-full",style:{display:"grid",gridTemplateColumns:`repeat(${i}, minmax(96px, 1fr))`},children:[Array.from({length:i}).map((h,b)=>t.jsx("div",{className:`${d} border-b border-[var(--border)]`,style:{background:"color-mix(in srgb, var(--bg-input) 55%, transparent)"},children:t.jsx("div",{className:"h-3 animate-pulse rounded-md",style:{...St,width:`${48+b*17%40}%`}})},`h-${b}`)),Array.from({length:c}).map((h,b)=>Array.from({length:i}).map((u,p)=>t.jsx("div",{className:`${f} ${b<c-1?"border-b border-[var(--border)]":""}`,children:t.jsx("div",{className:"h-3.5 animate-pulse rounded-md",style:{...St,width:`${46+(b*13+p*11)%42}%`,minWidth:28}})},`c-${b}-${p}`)))]})}),a&&t.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-[var(--border)] px-3 py-2",style:{background:"color-mix(in srgb, var(--bg-input) 40%, transparent)"},children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-3 w-28 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 w-14 animate-pulse rounded-md",style:St})]}),t.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:4}).map((h,b)=>t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St},b))}),t.jsx("div",{className:"h-3 w-16 animate-pulse rounded-md",style:St})]})]})}function Ad({size:e="md"}){const r=e==="sm"?"h-7 w-7":"h-9 w-9";return t.jsx("div",{className:`${r} animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]`,"aria-hidden":!0})}function Ld({logoSrc:e,logoAlt:r}){return e?t.jsxs("span",{className:"relative flex h-16 w-16 items-center justify-center","aria-hidden":!1,children:[t.jsx("span",{className:"absolute inset-0 rounded-2xl opacity-40 blur-xl",style:{background:"radial-gradient(circle, color-mix(in srgb, var(--primary) 45%, transparent) 0%, transparent 70%)"}}),t.jsx("img",{src:e,alt:r,className:"relative h-14 w-14 rounded-2xl object-contain shadow-sm shadow-black/10"})]}):null}function Os({variant:e="page",title:r="Cargando...",description:n,logoSrc:a,logoAlt:o,appearance:l="card",rows:i=6,columns:c=7,children:f,className:d=""}){if(e==="table")return t.jsx(Wn,{rows:i,columns:c,className:d});if(e==="sections")return t.jsx($d,{rows:i});if(e==="cards")return t.jsx(Dd,{rows:i});const h=o||(typeof r=="string"?r:"Aplicación"),b=l==="bare",u=t.jsxs("div",{className:`flex flex-col items-center text-center ${b?"gap-5":"gap-3"}`,children:[a?t.jsx(Ld,{logoSrc:a,logoAlt:h}):null,t.jsx(Ad,{size:b?"md":"sm"}),t.jsxs("div",{className:b?"space-y-1.5":"",children:[t.jsx("p",{className:b?"text-base font-semibold tracking-tight text-[var(--text-main)]":"text-sm font-semibold text-[var(--text-main)]",children:r}),n?t.jsx("p",{className:b?"text-sm font-medium text-[var(--text-muted)]":"mt-1 text-xs text-[var(--text-muted)]",children:n}):null,f&&t.jsx("div",{className:"mt-1 text-xs text-[var(--text-muted)]",children:f})]})]});return b?t.jsx("div",{className:`flex min-h-[240px] w-full items-center justify-center p-8 ${d}`,role:"status","aria-live":"polite","aria-busy":"true",children:u}):t.jsx("div",{className:`flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 ${d}`,role:"status","aria-live":"polite","aria-busy":"true",children:u})}function $d({rows:e}){return t.jsx(Wn,{rows:e,columns:7})}function Dd({rows:e}){return t.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:e}).map((r,n)=>t.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"mt-3 h-3 w-full animate-pulse rounded-md",style:St}),t.jsx("div",{className:"mt-2 h-3 w-4/5 animate-pulse rounded-md",style:St})]},n))})}function Hs(e){const r=e.split("/").filter(Boolean);return(r[r.length-1]??e).replace(/^lv_/,"").split(/[-_]/).filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Bs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function Id(e){return[e.label,Hs(e.service),e.description,e.service].filter(Boolean).join(" ")}function Fd(e){return typeof e=="function"?e:e.default}function Od(e,r){return t.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 text-center",children:t.jsxs("div",{className:"max-w-md",children:[t.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:"No se pudo cargar este modulo"}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:e.message}),t.jsx(Ke,{className:"mt-4",height:36,padding:"0 14px",onClick:r,children:"Reintentar"})]})})}function Hd({parentPanel:e,parentPanelComponent:r,renderParentPanel:n,parent:a,context:o,links:l,moduleRegistry:i,loadModule:c,activeService:f,initialService:d,onActiveServiceChange:h,canAccess:b,keepAlive:u=!0,title:p,subtitle:g,emptyState:w,loadingState:v,errorState:E=Od,renderTabLabel:y,searchableTabs:T="auto",tabsSearchThreshold:L=6,tabsSearchPlaceholder:C="Buscar modulo...",tabsSearchValue:m,onTabsSearchChange:S,emptySearchState:N,showTabCount:_=!0,className:U="",parentClassName:K="",contentClassName:D="",tabsClassName:Z=""}){var we;const O=s.useMemo(()=>l.filter(ae=>!ae.hidden&&((b==null?void 0:b(ae,o))??!0)),[b,o,l]),ne=(we=O.find(ae=>!ae.disabled))==null?void 0:we.service,[ee,fe]=s.useState(d??ne??""),[J,W]=s.useState({}),[R,$]=s.useState({}),[P,ue]=s.useState(""),[z,se]=s.useState(!1),q=s.useRef(R),k=s.useRef(0),V=m??P,M=Bs(V),Y=T===!0||T==="auto"&&O.length>=L,ce=Y&&V.trim().length>0,X=s.useMemo(()=>M?O.filter(ae=>Bs(Id(ae)).includes(M)):O,[M,O]),G=f??ee,I=O.find(ae=>ae.service===G)??O.find(ae=>!ae.disabled);s.useEffect(()=>{!I&&ne&&fe(ne)},[ne,I]),s.useEffect(()=>{q.current=R},[R]);const le=ae=>{ae.disabled||(f||fe(ae.service),h==null||h(ae.service,ae))},be=ae=>{m===void 0&&ue(ae),S==null||S(ae)},ie=(ae,Fe)=>{const qe=X.filter(Ze=>!Ze.disabled),Je=qe.findIndex(Ze=>Ze.service===Fe.service);Je<0||((ae.key==="ArrowRight"||ae.key==="ArrowDown")&&(ae.preventDefault(),le(qe[(Je+1)%qe.length])),(ae.key==="ArrowLeft"||ae.key==="ArrowUp")&&(ae.preventDefault(),le(qe[(Je-1+qe.length)%qe.length])),ae.key==="Home"&&(ae.preventDefault(),le(qe[0])),ae.key==="End"&&(ae.preventDefault(),le(qe[qe.length-1])))},ge=s.useCallback(()=>{if(!I)return;const ae=I.service,Fe=q.current[ae];if(Fe!=null&&Fe.loading||Fe!=null&&Fe.component&&u)return;const qe=(i==null?void 0:i[ae])??c;if(!qe){$(Ze=>({...Ze,[ae]:{loading:!1,error:new Error(`No module loader found for service "${ae}".`)}}));return}const Je=++k.current;$(Ze=>({...Ze,[ae]:{...Ze[ae],loading:!0,error:void 0}})),qe(I,o).then(Ze=>{if(Je!==k.current&&!u)return;const Ue=Fd(Ze);$(tt=>({...tt,[ae]:{component:Ue,loading:!1}}))}).catch(Ze=>{const Ue=Ze instanceof Error?Ze:new Error(String(Ze));$(tt=>({...tt,[ae]:{...tt[ae],loading:!1,error:Ue}}))})},[o,u,c,i,I]);s.useEffect(ge,[ge]);const $e=I?J[I.service]??null:null,De=I?R[I.service]:void 0,kt=De==null?void 0:De.component,wt=ae=>{I&&W(Fe=>({...Fe,[I.service]:ae}))},re=()=>{I&&W(ae=>({...ae,[I.service]:null}))},xe={context:o,parent:a,links:l,visibleLinks:O,filteredLinks:X,selectedLink:I,selectedService:I==null?void 0:I.service,activeItemId:$e,tabsSearch:V,onSelectService:le,onOpenDetail:wt,onBackToList:re},oe=n?n(xe):r?t.jsx(r,{...xe}):e;return t.jsxs("section",{className:`grid min-h-[520px] gap-4 lg:grid-cols-[minmax(260px,360px)_minmax(0,1fr)] ${U}`,children:[t.jsx("aside",{className:`min-w-0 rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4 ${K}`,children:oe}),t.jsxs("div",{className:`relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${D}`,children:[(p||g||Y||_)&&t.jsx("div",{className:"relative border-b border-[var(--border)] px-4 py-3",children:t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[p&&t.jsx("h2",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:p}),g&&t.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-[var(--text-muted)]",children:g})]}),(Y||_)&&t.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-end gap-2",children:[_&&t.jsxs("span",{className:"hidden text-xs font-semibold text-[var(--text-muted)] transition-opacity duration-200 sm:inline",children:[X.length," / ",O.length]}),Y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${z?"w-[min(20rem,44vw)] translate-x-0 opacity-100":"w-0 translate-x-2 opacity-0"}`,"aria-hidden":!z,children:t.jsx(Ls,{value:V,onChange:be,placeholder:C,className:"w-full",autoFocus:z,forceExpanded:!0,onEscape:()=>se(!1),size:"sm",inputTabIndex:z?0:-1})}),t.jsx("button",{type:"button","aria-label":z?"Cerrar busqueda":"Buscar tabs","aria-expanded":z,onClick:()=>{z&&V&&be(""),se(ae=>!ae)},className:`inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${z||ce?"border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm":"border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,children:t.jsx("span",{className:"grid h-4 w-4 place-items-center transition-transform duration-200",children:z||ce?t.jsx(F.HiXMark,{className:"h-4 w-4"}):t.jsx(F.HiMagnifyingGlass,{className:"h-4 w-4"})})})]})]})]})}),t.jsx("div",{role:"tablist","aria-label":p??"Modulos relacionados",className:`flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${Z}`,children:X.length>0?X.map(ae=>{const Fe=ae.service===(I==null?void 0:I.service);return t.jsx("button",{type:"button",role:"tab","aria-selected":Fe,disabled:ae.disabled,onClick:()=>le(ae),onKeyDown:qe=>ie(qe,ae),className:`inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${Fe?"border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm":"border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,children:y?y(ae,Fe):t.jsxs(t.Fragment,{children:[ae.icon,t.jsx("span",{children:ae.label??Hs(ae.service)}),ae.badge&&t.jsx("span",{className:"rounded-full bg-[var(--bg-input)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:ae.badge})]})},ae.service)}):t.jsx("div",{className:"flex min-h-9 flex-1 items-center rounded-md border border-dashed border-[var(--border)] px-3 text-xs text-[var(--text-muted)]",children:N??"No hay modulos que coincidan con la busqueda."})}),(I==null?void 0:I.description)&&t.jsx("div",{className:"border-b border-[var(--border)] px-4 py-2 text-xs text-[var(--text-muted)]",children:I.description}),t.jsxs("div",{className:"min-h-[420px] p-4",children:[!I&&(w??t.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]",children:"No hay modulos disponibles."})),I&&(De==null?void 0:De.loading)&&(v??t.jsx(Os,{title:"Cargando modulo..."})),I&&(De==null?void 0:De.error)&&E(De.error,ge),I&&kt&&!(De!=null&&De.loading)&&!(De!=null&&De.error)&&t.jsx(kt,{context:o,parent:a,link:I,activeItemId:$e,onOpenDetail:wt,onBackToList:re})]})]})]})}const Bd={sm:16,md:20,lg:24,xl:32};function Ps(e){if(e!=null)return typeof e=="number"?e:Bd[e]}function _s(e,r){const n=Ps(e);return n==null?r:{width:n,height:n,...r}}function Pd(e,r){const n=s.forwardRef(function({className:o,title:l,size:i,style:c,...f},d){const h=i!=null;return t.jsxs("svg",{ref:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":l?void 0:!0,role:l?"img":void 0,className:Pe("block shrink-0",!h&&"h-[1em] w-[1em]",o),style:_s(i,c),...f,children:[l?t.jsx("title",{children:l}):null,r]})});return n.displayName=e,n}function xr(e,r){const n=s.forwardRef(function({className:o,title:l,size:i,style:c,...f},d){const h=i!=null;return t.jsxs("svg",{ref:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":l?void 0:!0,role:l?"img":void 0,className:Pe("block shrink-0",!h&&"h-[1em] w-[1em]",o),style:_s(i,c),...f,children:[l?t.jsx("title",{children:l}):null,r]})});return n.displayName=e,n}const _d=t.jsx("path",{d:"M5 2.5h8.25L19 8.25V20.5A1.5 1.5 0 0 1 17.5 22h-11A1.5 1.5 0 0 1 5 20.5V2.5Z"}),zd=t.jsx("path",{fill:"#fff",fillOpacity:.32,d:"M13.25 2.5V8.25H19Z"});function Wd(e,r=5.5){const n=e.length>3;return t.jsx("text",{x:"12",y:"16.75",textAnchor:"middle",fill:"#fff",fontSize:n?Math.min(r,4.6):r,fontWeight:700,fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",letterSpacing:n?"-0.06em":"0.01em",style:{userSelect:"none"},children:e})}function un(e){return t.jsxs(t.Fragment,{children:[_d,zd,e]})}function Qe(e,r,n){return xr(e,un(Wd(r,n)))}const zs=xr("FileFolderIcon",t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M3.25 8.1V7.1A1.6 1.6 0 0 1 4.85 5.5h4.05c.38 0 .74.13 1.03.37l1.02.85c.29.24.65.37 1.03.37h7.17A1.6 1.6 0 0 1 20.75 8.7v.4H3.25Z"}),t.jsx("path",{d:"M3.25 8.5h17.5v9A1.75 1.75 0 0 1 19 19.25H5A1.75 1.75 0 0 1 3.25 17.5v-9Z"})]})),Ws=Qe("FilePdfIcon","PDF",5.75),js=Qe("FileDocIcon","DOC",5.6),jn=Qe("FileDocxIcon","DOCX",4.7),qs=Qe("FileTxtIcon","TXT",5.6),jd=jn,Us=Qe("FileCsvIcon","CSV",5.6),Vs=Qe("FileXlsIcon","XLS",5.6),qn=Qe("FileXlsxIcon","XLSX",4.7),qd=qn,Xs=Qe("FilePptIcon","PPT",5.6),Un=Qe("FilePptxIcon","PPTX",4.7),Ud=Un,Ys=Qe("FileFigIcon","FIG",5.6),Gs=Qe("FileAiIcon","AI",5.75),Ks=Qe("FilePsdIcon","PSD",5.6),Zs=Qe("FileInddIcon","INDD",4.7),Qs=Qe("FileAepIcon","AEP",5.6),Js=Qe("FileSvgIcon","SVG",5.6),Rs=Qe("FileMp3Icon","MP3",5.6),el=Qe("FileWavIcon","WAV",5.6),tl=xr("FileAudioIcon",un(t.jsx("path",{fill:"#fff",d:"M10.2 10.4v6.2c0 .7-.55 1.25-1.25 1.25S7.7 17.3 7.7 16.6s.55-1.25 1.25-1.25c.2 0 .38.05.55.12V11.6l5.3-1.2v5.55c0 .7-.55 1.25-1.25 1.25s-1.25-.55-1.25-1.25.55-1.25 1.25-1.25c.2 0 .38.05.55.12V10.05l.2-.05-5.1 1.4Z"}))),rl=Qe("FileMp4Icon","MP4",5.6),nl=Qe("FileMpegIcon","MPEG",4.4),al=Qe("FileAviIcon","AVI",5.6),ol=Qe("FileMkvIcon","MKV",5.6),sl=xr("FileVideoIcon",un(t.jsx("path",{fill:"#fff",d:"M8.2 11.1h5.1c.55 0 1 .45 1 1v3.6c0 .55-.45 1-1 1H8.2c-.55 0-1-.45-1-1v-3.6c0-.55.45-1 1-1Zm7.05 1.05 2.55-1.35v5.2l-2.55-1.35v-2.5Z"}))),ll=Qe("FileZipIcon","ZIP",5.6),il=Qe("FileRarIcon","RAR",5.6),Vn=Qe("FileImgIcon","IMG",5.6),cl=Qe("FileJpgIcon","JPG",5.6),dl=Qe("FilePngIcon","PNG",5.6),Vd=Vn,ul=xr("FileCodeIcon",un(t.jsxs("g",{fill:"none",stroke:"#fff",strokeWidth:1.65,strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"m8.2 12.2-2.25 1.9 2.25 1.9"}),t.jsx("path",{d:"m15.8 12.2 2.25 1.9-2.25 1.9"}),t.jsx("path",{d:"m12.85 11.45-1.2 5.4"})]}))),fl=xr("FileDocfyIcon",un(t.jsxs(t.Fragment,{children:[t.jsx("path",{fill:"#fff",d:"M7.5 12h9v1.4H7.5z"}),t.jsx("path",{fill:"#fff",d:"M7.5 14.55h9v1.4H7.5z"}),t.jsx("path",{fill:"#fff",d:"M7.5 17.1h5.75v1.4H7.5z"})]}))),no=Qe("FileGenericIcon","FILE",4.8),bl={folder:"text-amber-500",pdf:"text-[#EA4335]",doc:"text-[#4285F4]",docx:"text-[#4285F4]",word:"text-[#4285F4]",txt:"text-[#5F6368]",csv:"text-[#34A853]",xls:"text-[#34A853]",xlsx:"text-[#34A853]",excel:"text-[#34A853]",ppt:"text-[#EA4335]",pptx:"text-[#EA4335]",powerpoint:"text-[#EA4335]",fig:"text-[#A142F4]",ai:"text-[#FF6D00]",psd:"text-[#304FFE]",indd:"text-[#C2185B]",aep:"text-[#9C27B0]",svg:"text-[#A142F4]",mp3:"text-[#E91E63]",wav:"text-[#E91E63]",audio:"text-[#E91E63]",mp4:"text-[#4285F4]",mpeg:"text-[#4285F4]",avi:"text-[#4285F4]",mkv:"text-[#4285F4]",video:"text-[#4285F4]",zip:"text-[#5F6368]",rar:"text-[#5F6368]",img:"text-[#5F6368]",jpg:"text-[#5F6368]",png:"text-[#5F6368]",image:"text-[#5F6368]",code:"text-[#3949AB]",docfy:"text-[#4285F4]",generic:"text-[#9AA0A6]"},Xd=["folder","pdf","doc","docx","txt","csv","xls","xlsx","ppt","pptx","fig","ai","psd","indd","aep","svg","mp3","wav","audio","mp4","mpeg","avi","mkv","video","zip","rar","img","jpg","png","code","docfy","generic"],Yd={folder:zs,pdf:Ws,doc:js,docx:jn,word:jn,txt:qs,csv:Us,xls:Vs,xlsx:qn,excel:qn,ppt:Xs,pptx:Un,powerpoint:Un,fig:Ys,ai:Gs,psd:Ks,indd:Zs,aep:Qs,svg:Js,mp3:Rs,wav:el,audio:tl,mp4:rl,mpeg:nl,avi:al,mkv:ol,video:sl,zip:ll,rar:il,img:Vn,jpg:cl,png:dl,image:Vn,code:ul,docfy:fl,generic:no};function Gd({kind:e,colored:r=!0,className:n="",size:a,...o}){const l=Yd[e]??no,c=[r?bl[e]:"",n].filter(Boolean).join(" ");return t.jsx(l,{className:c||void 0,size:a,...o})}const Kd={info:{color:"#2563eb",background:"rgba(59, 130, 246, 0.1)",border:"rgba(59, 130, 246, 0.24)",icon:t.jsx(F.HiInformationCircle,{className:"h-5 w-5"})},success:{color:"#047857",background:"rgba(16, 185, 129, 0.1)",border:"rgba(16, 185, 129, 0.24)",icon:t.jsx(F.HiCheckCircle,{className:"h-5 w-5"})},warning:{color:"#b45309",background:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)",icon:t.jsx(F.HiExclamationTriangle,{className:"h-5 w-5"})},danger:{color:"var(--danger)",background:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))",icon:t.jsx(F.HiExclamationCircle,{className:"h-5 w-5"})},neutral:{color:"var(--text-secondary)",background:"var(--bg-input)",border:"var(--border)",icon:t.jsx(F.HiInformationCircle,{className:"h-5 w-5"})}};function Zd({variant:e="info",title:r,children:n,icon:a,action:o,onDismiss:l,className:i=""}){const c=Kd[e];return t.jsxs("div",{role:e==="danger"||e==="warning"?"alert":"status",className:`flex items-start gap-3 rounded-lg border px-3 py-3 ${i}`,style:{background:c.background,borderColor:c.border},children:[t.jsx("div",{className:"mt-0.5 shrink-0",style:{color:c.color},children:a??c.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[r&&t.jsx("div",{className:"text-sm font-semibold text-[var(--text-main)]",children:r}),n&&t.jsx("div",{className:"mt-0.5 text-sm leading-5 text-[var(--text-secondary)]",children:n}),o&&t.jsx("div",{className:"mt-3",children:o})]}),l&&t.jsx(Ke,{variant:"icon",size:"xs","aria-label":"Cerrar alerta",onClick:l,className:"-mr-1 -mt-1",children:t.jsx(F.HiXMark,{className:"h-4 w-4"})})]})}const hl=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Qd=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Jd=["lu","ma","mi","ju","vi","sá","do"],pl=6;function ao(e,r,n){return`${e}-${String(r).padStart(2,"0")}-${String(n).padStart(2,"0")}`}function Rd(){const e=new Date;return ao(e.getFullYear(),e.getMonth()+1,e.getDate())}function oo(e){const[r,n,a]=e.split("-").map(Number);return{year:r,month:n,day:a}}function eu(e){if(!e)return"Seleccionar fecha";const{year:r,month:n,day:a}=oo(e);return!r||!n||!a?"Seleccionar fecha":`${String(a).padStart(2,"0")} ${hl[n-1]} ${r}`}function ml(e){const{year:r,month:n,day:a}=oo(e);if(!r||!n||!a)return!1;const o=new Date(r,n-1,a).getDay();return o===0||o===6}function tu({value:e,onChange:r,minDate:n,maxDate:a,disableWeekends:o=!1,displayMode:l="inline",className:i=""}){const c=Rd(),d=oo(e||c),h=l==="popover",[b,u]=s.useState(!1),p=s.useRef(null),[g,w]=s.useState({horizontal:"left",vertical:"bottom"}),[v,E]=s.useState(d.year),[y,T]=s.useState(d.month),[L,C]=s.useState("days"),m=16,[S,N]=s.useState(0),_=v-7+S,U=Array.from({length:m},(W,R)=>_+R);s.useEffect(()=>{if(!h||!b||!p.current)return;const W=p.current.getBoundingClientRect(),R=8,$=280,P=340,ue=W.left+$>window.innerWidth-R,z=W.right-$>=R,se=W.bottom+8+P>window.innerHeight-R,q=W.top-8-P>=R;w({horizontal:ue&&z?"right":"left",vertical:se&&q?"top":"bottom"})},[h,b]),s.useEffect(()=>{if(!h||!b)return;function W($){p.current&&(p.current.contains($.target)||u(!1))}function R($){$.key==="Escape"&&u(!1)}return document.addEventListener("mousedown",W),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("keydown",R)}},[h,b]);function K(){y===1?(E(W=>W-1),T(12)):T(W=>W-1)}function D(){y===12?(E(W=>W+1),T(1)):T(W=>W+1)}const Z=(new Date(v,y-1,1).getDay()+6)%7,O=new Date(v,y,0).getDate(),ne=[...Array(Z).fill(null),...Array.from({length:O},(W,R)=>R+1)];for(;ne.length<pl*7;)ne.push(null);const ee=ne.slice(0,pl*7);function fe(W){const R=ao(v,y,W);n&&R<n||a&&R>a||o&&ml(R)||(r(R),h&&u(!1))}const J=t.jsx("div",{className:`bonsaif-calendar bonsaif-calendar-picker ${i}`.trim(),children:t.jsxs("div",{className:"bonsaif-cal-shell",children:[t.jsx("div",{className:"bonsaif-cal-toolbar",children:L==="days"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:K,"aria-label":"Mes anterior",children:t.jsx(F.HiChevronLeft,{size:16})}),t.jsxs("button",{type:"button",className:"bonsaif-cal-title-btn",onClick:()=>{C("years"),N(0)},children:[t.jsxs("span",{className:"bonsaif-cal-title",children:[hl[y-1]," ",v]}),t.jsx(F.HiChevronDown,{size:13})]}),t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:D,"aria-label":"Mes siguiente",children:t.jsx(F.HiChevronRight,{size:16})})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:()=>N(W=>W-m),"aria-label":"Años anteriores",children:t.jsx(F.HiChevronLeft,{size:16})}),t.jsx("button",{type:"button",className:"bonsaif-cal-title-btn",onClick:()=>C("days"),children:t.jsxs("span",{className:"bonsaif-cal-title",children:[U[0]," – ",U[U.length-1]]})}),t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:()=>N(W=>W+m),"aria-label":"Años siguientes",children:t.jsx(F.HiChevronRight,{size:16})})]})}),L==="years"?t.jsxs("div",{className:"bonsaif-cal-picker-years",children:[t.jsx("div",{className:"bonsaif-cal-picker-months",children:Qd.map((W,R)=>{const $=R+1===y;return t.jsx("button",{type:"button",className:`bonsaif-cal-pill-btn${$?" is-active":""}`,onClick:()=>T(R+1),children:W},W)})}),t.jsx("div",{className:"bonsaif-cal-picker-year-grid",children:U.map(W=>{const R=W===v,$=W===new Date().getFullYear();return t.jsx("button",{type:"button",className:`bonsaif-cal-pill-btn${R?" is-active":""}${$&&!R?" is-today":""}`,onClick:()=>{E(W),C("days")},children:W},W)})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bonsaif-multi-weekdays bonsaif-cal-picker-weekdays",children:Jd.map(W=>t.jsx("div",{className:"bonsaif-multi-weekday",children:W},W))}),t.jsx("div",{className:"bonsaif-cal-picker-days",children:ee.map((W,R)=>{if(W===null)return t.jsx("div",{className:"bonsaif-multi-day bonsaif-multi-day-hidden"},R);const $=ao(v,y,W),P=$===e,ue=$===c,z=!!(n&&$<n)||!!(a&&$>a)||o&&ml($);return t.jsx("div",{className:`bonsaif-multi-day${P?" bonsaif-multi-day-selected":""}${ue?" bonsaif-multi-day-today":""}${z?" bonsaif-multi-day-disabled":""}`,children:t.jsx("button",{type:"button",className:"bonsaif-multi-day-btn",disabled:z,"aria-pressed":P,onClick:()=>!z&&fe(W),children:W})},R)})})]})]})});return h?t.jsxs("div",{ref:p,className:`relative w-full ${i}`.trim(),children:[t.jsxs("button",{type:"button",onClick:()=>u(W=>!W),className:"bonsaif-cal-trigger","data-open":b?"true":"false",children:[t.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[t.jsx(F.HiCalendarDays,{className:"w-4 h-4 text-[var(--text-muted)]"}),t.jsx("span",{className:"truncate",children:eu(e)})]}),t.jsx(F.HiChevronDown,{className:`w-4 h-4 text-[var(--text-muted)] transition-transform ${b?"rotate-180":""}`})]}),b&&t.jsx("div",{className:"absolute z-50",style:{...g.horizontal==="left"?{left:0}:{right:0},...g.vertical==="bottom"?{top:"calc(100% + 8px)"}:{bottom:"calc(100% + 8px)"}},children:J})]}):J}function er({children:e,className:r="",style:n,as:a="span",followCursor:o=!1,placement:l="top"}){return t.jsx(Xt,{onlyWhenOverflow:!0,as:a,followCursor:o,placement:l,showArrow:!o,className:r,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,...n},children:e})}function so(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function lo(e){return e.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").toLowerCase()}function ru(e,r){if(!r.trim())return!0;const n=lo(r);return lo(e.label).includes(n)||!!(e.sublabel&&lo(e.sublabel).includes(n))}function yr({value:e,onChange:r,options:n,status:a="default",ariaLabel:o,triggerVariant:l="default",showSelectedSublabel:i=!0,placeholder:c="Seleccionar…",emptyLabel:f,disabled:d=!1,className:h="",style:b,dropdownMinWidth:u,dropdownZIndex:p=9999,height:g=40,padding:w="0 10px",searchable:v=!0,minOptionsForSearch:E=6}){const[y,T]=s.useState(!1),[L,C]=s.useState(""),[m,S]=s.useState(-1),[N,_]=s.useState(!1),[U,K]=s.useState({}),D=s.useRef(null),Z=s.useRef(null),O=s.useRef(null),ne=s.useRef(null),ee=v&&n.length>=E,fe=n.find(M=>M.value===e)??null,J=l==="ghost",W=a==="error"?"var(--danger)":y?"var(--primary)":"var(--border)",R=ee&&L.trim()?n.filter(M=>ru(M,L)):n,$=s.useCallback(()=>{const M=D.current;if(!(M!=null&&M.isConnected))return;const Y=M.getBoundingClientRect();if(Y.width<1&&Y.height<1||Y.bottom<0||Y.top>window.innerHeight)return;const ce=ee?272:212,X=window.innerHeight-Y.bottom,G=X<ce&&Y.top>X,I=8,le=Math.max(Y.width,0),be=Math.max(I,window.innerWidth-le-I),ie=Math.min(Math.max(I,Y.left),be);K({position:"fixed",left:ie,top:G?void 0:Y.bottom+4,bottom:G?window.innerHeight-Y.top+4:void 0,width:Y.width,minWidth:so(u),zIndex:p})},[u,p,ee]);s.useEffect(()=>_(!0),[]),s.useEffect(()=>{if(!y)return;function M(Y){var X,G;const ce=Y.target;!((X=D.current)!=null&&X.contains(ce))&&!((G=Z.current)!=null&&G.contains(ce))&&(T(!1),C(""))}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y]),s.useEffect(()=>{y&&(S(-1),$(),ee&&setTimeout(()=>{var M;return(M=O.current)==null?void 0:M.focus()},0))},[y,ee,$]),s.useEffect(()=>{if(y)return window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[y,$]),s.useEffect(()=>{if(m<0||!ne.current)return;const M=ne.current.children[m];M==null||M.scrollIntoView({block:"nearest"})},[m]);const P=s.useCallback(M=>{r(M),T(!1),C("")},[r]),ue=s.useRef(y);ue.current=y;const z=s.useRef(R);z.current=R;const se=s.useRef(m);se.current=m;const q=s.useRef(f);q.current=f;const k=s.useRef(P);k.current=P,s.useEffect(()=>{function M(Y){var I,le;const ce=document.activeElement,X=((I=D.current)==null?void 0:I.contains(ce))??!1,G=((le=Z.current)==null?void 0:le.contains(ce))??!1;if(!(!X&&!G)){if(!ue.current){(Y.key==="Enter"||Y.key===" "||Y.key==="ArrowDown")&&(Y.preventDefault(),T(!0));return}switch(Y.key){case"ArrowDown":Y.preventDefault(),S(be=>Math.min(be+1,z.current.length-1));break;case"ArrowUp":Y.preventDefault(),S(be=>Math.max(be-1,q.current?-1:0));break;case"Enter":{Y.preventDefault();const be=se.current,ie=z.current;be===-1&&q.current?k.current(""):ie[be]&&!ie[be].disabled&&k.current(ie[be].value);break}case"Escape":Y.preventDefault(),Y.stopPropagation(),T(!1),C("");break}}}return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const V=t.jsxs("div",{ref:Z,"data-bonsaif-select-dropdown":"true",className:"rounded-xl shadow-xl overflow-hidden",style:{...U,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[ee&&t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[t.jsx(F.HiMagnifyingGlass,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),t.jsx("input",{ref:O,value:L,onChange:M=>{C(M.target.value),S(-1)},placeholder:"Buscar…",className:"min-w-0 flex-1 text-sm bg-transparent outline-none",style:{color:"var(--text-main)"}}),L&&t.jsx("button",{type:"button",onMouseDown:M=>{M.preventDefault(),C("")},children:t.jsx(F.HiXMark,{className:"w-3.5 h-3.5",style:{color:"var(--text-muted)"}})})]}),t.jsxs("ul",{ref:ne,role:"listbox",className:"overflow-y-auto",style:{maxHeight:ee?220:180,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[f&&t.jsx("li",{role:"option","aria-selected":e==="",onMouseDown:M=>{M.preventDefault(),P("")},onMouseEnter:()=>S(-1),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:m===-1&&!L.trim()?"var(--bg-hover)":"transparent",color:"var(--text-muted)",fontStyle:"italic"},children:f}),R.map((M,Y)=>{const X=Y===m,G=M.value===e;return t.jsxs("li",{role:"option","aria-selected":G,onMouseDown:I=>{I.preventDefault(),M.disabled||P(M.value)},onMouseEnter:()=>!M.disabled&&S(Y),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:X?"var(--bg-hover)":G?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:M.disabled?"var(--text-muted)":"var(--text-main)",cursor:M.disabled?"not-allowed":"pointer",boxShadow:G?"inset 2px 0 0 var(--primary)":void 0},children:[M.color&&t.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:M.color}}),t.jsxs("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:[t.jsx(er,{className:"min-w-0 flex-1",children:M.label}),M.sublabel&&t.jsx(er,{className:"min-w-0 flex-shrink",style:{color:"var(--text-muted)",fontSize:12},children:M.sublabel})]}),M.badge&&t.jsx("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:M.badge})]},M.value)}),R.length===0&&t.jsx("li",{className:"px-3 py-4 text-sm text-center",style:{color:"var(--text-muted)"},children:"Sin resultados"})]})]});return t.jsxs("div",{ref:D,className:`relative ${h||"w-full"}`,style:b,children:[t.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&T(M=>!M),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{height:so(g),padding:so(w),background:J?"transparent":"var(--bg-input)",color:fe?"var(--text-main)":"var(--text-muted)",border:J?"1px solid transparent":`1px solid ${W}`,opacity:d?.5:1,cursor:d?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":y,"aria-label":o,children:[(fe==null?void 0:fe.color)&&t.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:fe.color}}),t.jsx("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:fe?t.jsxs(t.Fragment,{children:[t.jsx(er,{className:"min-w-0 flex-1",children:fe.label}),i&&fe.sublabel&&t.jsx(er,{className:"min-w-0 flex-shrink",style:{color:"var(--text-muted)",fontSize:12},children:fe.sublabel})]}):t.jsx(er,{className:"min-w-0 flex-1",children:c})}),fe&&f?t.jsx("span",{role:"button",tabIndex:-1,onMouseDown:M=>{M.preventDefault(),M.stopPropagation(),P("")},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:t.jsx(F.HiXMark,{className:"w-3 h-3"})}):t.jsx(F.HiChevronDown,{className:"flex-shrink-0 w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:y?"rotate(180deg)":"rotate(0deg)"}})]}),y&&N&&bt.createPortal(V,document.body)]})}const nu={sm:"h-4 w-4",md:"h-5 w-5"};function au(e,r){if(typeof e=="function"){e(r);return}e&&(e.current=r)}const Xn=s.forwardRef(function({label:r,description:n,error:a,size:o="md",indeterminate:l=!1,className:i="",containerClassName:c="",disabled:f,...d},h){const b=s.useRef(null);return s.useEffect(()=>{b.current&&(b.current.indeterminate=l)},[l]),t.jsxs("label",{className:`group inline-flex items-start gap-2.5 ${f?"cursor-not-allowed opacity-60":"cursor-pointer"} ${c}`,children:[t.jsxs("span",{className:"relative mt-0.5 inline-flex shrink-0",children:[t.jsx("input",{...d,ref:u=>{b.current=u,au(h,u)},type:"checkbox",disabled:f,"aria-checked":l?"mixed":d["aria-checked"],"aria-invalid":!!a||d["aria-invalid"],className:`peer ${nu[o]} appearance-none rounded border border-[var(--border)] bg-[var(--bg-input)] transition-colors checked:border-[var(--primary)] checked:bg-[var(--primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40 ${i}`}),t.jsx(F.HiCheck,{className:"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 scale-75 text-[var(--primary-fg)] opacity-0 transition peer-checked:scale-100 peer-checked:opacity-100 peer-aria-checked:mixed:scale-100 peer-aria-checked:mixed:opacity-100"})]}),(r||n||a)&&t.jsxs("span",{className:"min-w-0",children:[r&&t.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:r}),n&&!a&&t.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:n}),a&&t.jsx("span",{className:"block text-xs leading-5 text-[var(--danger)]",children:a})]})]})}),gl=32767;function Yn(e){let r=String(e??"");return r=r.split("\0").join(""),r.length<=gl?r:`${r.slice(0,gl-1)}…`}const Gn=[25,50,100,200,500];let _t={dataTable:{pageSizeOptions:[...Gn]}};function ou(){if(typeof window>"u")return;const r=window.__BONSAIF_DATA_TABLE_PREFERENCES_ENDPOINT__;return typeof r=="string"&&r.trim().length>0?r.trim().replace(/\/+$/,""):void 0}function io(){const e=_t.dataTable.preferencesEndpoint,r=ou();return e&&e.trim().length>0?e.trim().replace(/\/+$/,""):r}function su(e){if(!Array.isArray(e))return[...Gn];const r=Array.from(new Set(e.map(n=>typeof n=="number"?Math.floor(n):Number.NaN).filter(n=>Number.isFinite(n)&&n>0)));return r.length>0?r:[...Gn]}function vl(e){if(typeof e!="string")return;const r=e.trim();if(r)return r.replace(/\/+$/,"")}function lu(e){if(!e||typeof e!="object"||!e.dataTable)return;const r=vl(e.dataTable.preferencesEndpoint);_t={..._t,dataTable:{..._t.dataTable,pageSizeOptions:su(e.dataTable.pageSizeOptions),preferencesEndpoint:r??_t.dataTable.preferencesEndpoint}}}function iu(){return{dataTable:{pageSizeOptions:[..._t.dataTable.pageSizeOptions]}}}function fn(){return[..._t.dataTable.pageSizeOptions]}function cu(){_t={dataTable:{pageSizeOptions:[...Gn]}}}function du(e){_t={..._t,dataTable:{..._t.dataTable,preferencesEndpoint:vl(e)}}}const Kn=[{value:"equals",label:"Igual a",valueMode:"single"},{value:"notEquals",label:"No es igual a",valueMode:"single"},{value:"greaterThan",label:"Mayor que",valueMode:"single"},{value:"greaterThanOrEqual",label:"Mayor o igual que",valueMode:"single"},{value:"lessThan",label:"Menor que",valueMode:"single"},{value:"lessThanOrEqual",label:"Menor o igual que",valueMode:"single"},{value:"between",label:"Entre",valueMode:"between"},{value:"top10",label:"10 superiores",valueMode:"none"},{value:"bottom10",label:"10 inferiores",valueMode:"none"},{value:"aboveAverage",label:"Sobre promedio",valueMode:"none"},{value:"belowAverage",label:"Bajo promedio",valueMode:"none"}],uu=Kn.map(e=>({value:e.value,label:e.label})),fu=12,bu={layout:!0,filters:!1,sort:!1,bql:!1,pagination:!0},xl={layout:!0,filters:!0,sort:!0,bql:!0,pagination:!0},hu="bonsaif-ui:datatable:",pu="[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0",mu=[],gu=52;function tr(e){if(!e)return 150;const r=parseInt(e,10);return isNaN(r)||r<=0?150:r}function yl(e){return!!(e&&(Array.isArray(e.columnOrder)&&e.columnOrder.length>0||e.columnWidths&&Object.keys(e.columnWidths).length>0||Array.isArray(e.hiddenColumnKeys)&&e.hiddenColumnKeys.length>0||e.filters&&Object.keys(e.filters).length>0||e.conditionFilters&&Object.keys(e.conditionFilters).length>0||e.filterOptionValues&&Object.keys(e.filterOptionValues).length>0||e.sort||typeof e.bql=="string"||Array.isArray(e.bqlHistory)&&e.bqlHistory.length>0||typeof e.pageSize=="number"))}function wl(e){return`${hu}${e}`}function Zn(e){try{const r=window.localStorage.getItem(wl(e));if(!r)return null;const n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}}function vu(e,r){try{window.localStorage.setItem(wl(e),JSON.stringify(r))}catch{}}function xu(e,r){if(e===!0)return{...xl};if(e===!1)return{layout:!1,filters:!1,sort:!1,bql:!1,pagination:!1};if(r&&e==null)return{...xl};const n={...bu,...e??{}};return r&&(typeof e!="object"||e.pagination!==!1)&&(n.pagination=!0),n}function Nl(...e){return e.reduce((r,n)=>({...r,...n??{}}),{})}function co(e,r,n){return typeof e!="number"||e<=0?n:gn(r).includes(e)?e:n}function bn(e){if(!e||typeof e!="object")return!1;const r=e;return typeof r.key=="string"&&(r.dir==="asc"||r.dir==="desc")}function hn(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!Array.isArray(o))return[];const l=o.filter(i=>typeof i=="string");return l.length>0?[[a,l]]:[]});return Object.fromEntries(n)}function yu(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!Array.isArray(o))return[];const l=[...new Set(o.filter(i=>typeof i=="string"&&i.trim().length>0))];return l.length>0?[[a,l]]:[]});return Object.fromEntries(n)}function wu(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!o||typeof o!="object")return[];const l=Object.fromEntries(Object.entries(o).flatMap(([i,c])=>typeof i=="string"&&i.trim()&&typeof c=="string"&&c.trim()?[[i,c]]:[]));return Object.keys(l).length>0?[[a,l]]:[]});return Object.fromEntries(n)}function pn(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=new Set(Kn.map(o=>o.value)),a=Object.entries(e).flatMap(([o,l])=>{if(!r.has(o)||!l||typeof l!="object")return[];const i=l;return!i.operator||!n.has(i.operator)?[]:[[o,{operator:i.operator,value:typeof i.value=="string"?i.value:"",valueTo:typeof i.valueTo=="string"?i.valueTo:""}]]});return Object.fromEntries(a)}function Tt(e,r){if(wr(e))return gu;const n=e.minWidth??80,a=e.maxWidth??1/0;return Math.min(a,Math.max(n,r))}function Nu(e){const r=window.getComputedStyle(e);return parseFloat(r.paddingLeft)+parseFloat(r.paddingRight)}function wr(e){return e.key==="actions"||e.key==="acciones"?!0:typeof e.header=="string"&&e.header.trim().toLowerCase()==="acciones"}function uo(e){return e.sticky===!0}function kl(e){return!(e.reorderable===!1||e.sticky&&e.reorderable!==!0)}function Qn(e,r){const a=[...e.filter(o=>r.includes(o))];for(let o=0;o<r.length;o+=1){const l=r[o];if(a.includes(l))continue;let i=a.length;for(let c=o-1;c>=0;c-=1){const f=r[c],d=a.indexOf(f);if(d!==-1){i=d+1;break}}if(i===a.length)for(let c=o+1;c<r.length;c+=1){const f=r[c],d=a.indexOf(f);if(d!==-1){i=d;break}}a.splice(i,0,l)}return a}function sr(e,r){const n=r.filter(uo).map(i=>i.key);if(n.length===0)return e;const a=new Set(n),o=n.filter(i=>e.includes(i)),l=e.filter(i=>!a.has(i));return[...o,...l]}function ku(e,r){if(r<=7)return Array.from({length:r},(a,o)=>o+1);const n=[1];e>3&&n.push("...");for(let a=Math.max(2,e-1);a<=Math.min(r-1,e+1);a++)n.push(a);return e<r-2&&n.push("..."),n.push(r),n}function lr(e,r){var i;const n=new Set(r.filter(c=>c.hideable!==!1).map(c=>c.key)),a=Array.from(new Set(e??[])).filter(c=>n.has(c));if(r.filter(c=>!a.includes(c.key)).length>0)return a;const l=(i=r.find(c=>c.hideable!==!1))==null?void 0:i.key;return l?a.filter(c=>c!==l):[]}function Su(e){return e==null||e===""?"(Vacio)":e instanceof Date?e.toLocaleDateString():String(e)}function Or(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Or).join(" ").trim():s.isValidElement(e)?Or(e.props.children):""}function Jn(e,r){const n=e.filterValue?e.filterValue(r):e.sortKey?r[e.sortKey]:e.cell(r);return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||n===null||n===void 0||n instanceof Date?Su(n):Or(n).trim()}function mn(e){const r=e.replace(/,/g,"").trim();if(!r)return null;const n=Number(r);return Number.isFinite(n)?n:null}function Hr(e,r){const n=mn(e),a=mn(r);return n!==null&&a!==null?n-a:e.localeCompare(r,void 0,{numeric:!0,sensitivity:"base"})}function gn(e){const r=Array.from(new Set(e.map(n=>Math.floor(n)).filter(n=>Number.isFinite(n)&&n>0)));return r.length>0?r:fn()}function Cu(e,r,n){var i,c;const a=((i=r.value)==null?void 0:i.trim())??"",o=((c=r.valueTo)==null?void 0:c.trim())??"",l=Kn.find(f=>f.value===r.operator);if((l==null?void 0:l.valueMode)==="single"&&!a||(l==null?void 0:l.valueMode)==="between"&&(!a||!o))return!0;switch(r.operator){case"equals":return e.toLowerCase()===a.toLowerCase();case"notEquals":return e.toLowerCase()!==a.toLowerCase();case"greaterThan":return Hr(e,a)>0;case"greaterThanOrEqual":return Hr(e,a)>=0;case"lessThan":return Hr(e,a)<0;case"lessThanOrEqual":return Hr(e,a)<=0;case"between":return Hr(e,a)>=0&&Hr(e,o)<=0;case"top10":case"bottom10":{const d=n.map(b=>({value:b,number:mn(b)})).filter(b=>b.number!==null).sort((b,u)=>b.number-u.number).map(b=>b.value);return(r.operator==="top10"?d.slice(-10):d.slice(0,10)).includes(e)}case"aboveAverage":case"belowAverage":{const f=n.map(mn).filter(b=>b!==null);if(f.length===0)return!1;const d=f.reduce((b,u)=>b+u,0)/f.length,h=mn(e);return h===null?!1:r.operator==="aboveAverage"?h>d:h<d}default:return!0}}function Sl({children:e,className:r="",style:n}){return t.jsx(Xt,{onlyWhenOverflow:!0,className:r,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,...n},children:e})}function fo({columns:e,data:r,getRowId:n,loading:a=!1,skeletonRows:o=8,emptyIcon:l,emptyText:i="Sin resultados",initialEmptyDelay:c=450,onRowClick:f,renderExpandedRow:d,getRowCanExpand:h,expandedRowIds:b,defaultExpandedRowIds:u=[],onExpandedRowIdsChange:p,expandOnRowClick:g=!1,selected:w,onToggleOne:v,onToggleAll:E,getRowSelectable:y,highlightSelected:T=!0,rowClassName:L,getRowCategory:C,stickyHeader:m=!0,pageSize:S=25,pageSizeOptions:N,pageSizeSelectWidth:_=62,pageSizeSelectHeight:U=30,pageSizeSelectPadding:K="0 7px",totalRows:D,page:Z,onPageChange:O,onPageSizeChange:ne,storageKey:ee,stickyFirstColumn:fe=!1,bottomOffset:J=0,compact:W=!0,restrictHeight:R=!0,maxHeight:$,minTableWidth:P,enableColumnVisibility:ue=!0,enableColumnFilters:z=!0,hiddenColumnKeys:se,defaultHiddenColumnKeys:q=mu,onHiddenColumnKeysChange:k,columnVisibilityLabel:V="Columnas",enableBql:M=!1,bqlValue:Y,defaultBqlValue:ce="",onBqlChange:X,bqlDescription:G="Filtra registros con Bonsaif Query Language",bqlPlaceholder:I=`status = activo
1
+ (function(A,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react"),require("react/jsx-runtime"),require("react-icons/hi2"),require("react-dom"),require("recharts"),require("overlayscrollbars"),require("sonner"),require("overlayscrollbars-react"),require("react-day-picker"),require("react-day-picker/dist/style.css"),require("react-icons/fi")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-icons/hi2","react-dom","recharts","overlayscrollbars","sonner","overlayscrollbars-react","react-day-picker","react-day-picker/dist/style.css","react-icons/fi"],s):(A=typeof globalThis<"u"?globalThis:A||self,s(A.BonsaifUI={},A.React,A.jsxRuntime,A.ReactIconsHi2,A.ReactDOM,A.Recharts,A.OverlayScrollbarsGlobal,A.Sonner,A.OverlayScrollbarsReact,A.ReactDayPicker,A.ReactDayPickerStyles,A.ReactIconsFi))})(this,(function(A,s,t,F,bt,Oe,Ra,eo,As,to,mg,vd){"use strict";"use client";function Pe(...e){return e.filter(Boolean).join(" ")}function xd({variant:e="primary",className:r,type:n="button",children:a,...o}){return t.jsx("button",{className:Pe("bonsaif-ui-button",`bonsaif-ui-button--${e}`,r),type:n,...o,children:a})}function Ls({value:e,onChange:r,placeholder:n,className:a="",autoFocus:o=!1,forceExpanded:l=!1,onEscape:i,size:c="default",inputTabIndex:f}){const d=s.useRef(null),[h,b]=s.useState(!1),u=l||h||e.trim().length>0,p=c==="sm"?"h-9 rounded-md":"h-10 rounded-lg",g=a||"w-48 max-w-full sm:w-64 lg:w-72";s.useEffect(()=>{var v;o&&((v=d.current)==null||v.focus())},[o]);const w=()=>{var v;b(!0),(v=d.current)==null||v.focus()};return t.jsxs("div",{className:`relative min-w-0 max-w-full flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${u?g:"w-24 sm:w-28"}`,onMouseDown:v=>{u||(v.preventDefault(),w())},children:[t.jsx(F.HiMagnifyingGlass,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",style:{color:"var(--text-muted)",left:"var(--page-header-control-icon-left, 12px)"}}),t.jsx("input",{ref:d,type:"text",tabIndex:f,"aria-label":n,value:e,onChange:v=>r(v.target.value),onKeyDown:v=>{v.key==="Escape"&&(i==null||i())},placeholder:u?n:"Buscar",className:`${p} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${u?"pl-9 pr-8":"cursor-pointer pl-9 pr-3"}`,style:{height:`var(--page-header-control-height, ${c==="sm"?"36px":"40px"})`,paddingLeft:"calc(var(--page-header-control-icon-left, 12px) + 24px)",paddingRight:u?"calc(var(--page-header-control-padding-x, 14px) + 18px)":"var(--page-header-control-padding-x, 14px)",background:"color-mix(in srgb, var(--bg-card) 86%, transparent)",border:"1px solid var(--border)",color:"var(--text-main)"},onFocus:v=>{b(!0),v.currentTarget.style.borderColor="var(--primary)",v.currentTarget.style.boxShadow="0 0 0 3px rgba(59,130,246,0.12)"},onBlur:v=>{b(!1),v.currentTarget.style.borderColor="var(--border)",v.currentTarget.style.boxShadow="none"}}),e&&t.jsx("button",{type:"button",onClick:()=>r(""),className:"absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",style:{color:"var(--text-muted)",right:"var(--page-header-control-padding-x, 8px)"},"aria-label":"Limpiar búsqueda",children:t.jsx(F.HiXMark,{className:"h-3.5 w-3.5 flex-shrink-0"})})]})}const $s=s.createContext({});let Ds=0;const Is="bonsaif-ui:hide-tooltips";function _n(e=700){Ds=Date.now()+e}function yd(){return Date.now()>Ds}function zn(e){if(typeof document>"u")return!1;const r=Array.from(document.querySelectorAll('[data-bonsaif-overlay="true"], [role="menu"], [role="dialog"][aria-modal="true"], [aria-hidden="false"] [aria-modal="true"]'));return e&&r.some(n=>n.contains(e))?!1:r.length>0}function wd(e){var a;const r=Array.from(e.querySelectorAll("*")).filter(o=>{var l;return o.scrollWidth>o.clientWidth&&!!((l=o.textContent)!=null&&l.trim())&&o.tagName.toLowerCase()!=="svg"&&!o.closest("svg")});return(e.scrollWidth>e.clientWidth||r.length>0)&&(((a=r[0])==null?void 0:a.textContent)??e.textContent??"").trim()||null}function Xt({children:e,content:r,onlyWhenOverflow:n=!1,interactive:a=!1,followCursor:o=!0,placement:l="bottom",showArrow:i=!1,className:c="",tooltipClassName:f="",style:d,tooltipStyle:h,as:b="div"}){const u=s.useRef(null),p=s.useRef(null),g=s.useRef(null),w=s.useRef(!1),[v,E]=s.useState(null),[y,T]=s.useState("");s.useEffect(()=>{const D=u.current;D&&(D.querySelectorAll("[title]").forEach(Z=>{const O=Z.getAttribute("title");O&&(Z.getAttribute("aria-label")||Z.setAttribute("aria-label",O),Z.removeAttribute("title"))}),D.querySelectorAll("svg title").forEach(Z=>Z.remove()))}),s.useLayoutEffect(()=>{if(!v)return;const D=p.current;if(!D)return;const Z=12,O=14,ne=D.getBoundingClientRect(),ee=window.innerWidth-ne.width-Z,fe=window.innerHeight-ne.height-Z;let J=v.mouseX+O,W=v.mouseY+O,R,$;if(!o&&u.current){const P=u.current.getBoundingClientRect(),ue=P.left+P.width/2,z=P.top+P.height/2;l==="top"?(J=ue-ne.width/2,W=P.top-ne.height-O,$=ne.height-1):l==="left"?(J=P.left-ne.width-O,W=z-ne.height/2,R=ne.width-1):l==="right"?(J=P.right+O,W=z-ne.height/2,R=-7):(J=ue-ne.width/2,W=P.bottom+O,$=-7)}if(o&&(J>ee&&(J=v.mouseX-ne.width-O),W>fe&&(W=v.mouseY-ne.height-O)),J=Math.min(Math.max(Z,J),Math.max(Z,ee)),W=Math.min(Math.max(Z,W),Math.max(Z,fe)),!o&&u.current){const P=u.current.getBoundingClientRect(),ue=P.left+P.width/2,z=P.top+P.height/2;l==="top"||l==="bottom"?R=Math.min(Math.max(14,ue-J),ne.width-14):$=Math.min(Math.max(14,z-W),ne.height-14)}(Math.abs(J-v.x)>.5||Math.abs(W-v.y)>.5||R!==v.arrowX||$!==v.arrowY)&&E(P=>P&&{...P,x:J,y:W,arrowX:R,arrowY:$})},[o,l,v]);const L=()=>{g.current&&(window.clearTimeout(g.current),g.current=null)},C=(D,Z)=>{if(!yd()||w.current)return;const O=u.current;if(O&&!zn(O)){if(n){const ne=wd(O);if(!ne)return;T(ne)}!n&&!r||E({mouseX:D,mouseY:Z,x:D+14,y:Z+14})}},m=()=>{const D=u.current;if(!D)return;const Z=D.getBoundingClientRect();C(Z.left+Z.width/2,Z.bottom)},S=()=>{L(),E(null)},N=()=>{if(!a){S();return}L(),g.current=window.setTimeout(()=>E(null),120)},_=()=>{_n(),w.current=!0,S()},U=()=>{w.current=!1};s.useEffect(()=>{if(!v)return;if(zn(u.current)){E(null);return}const D=()=>E(null),Z=()=>{_n(),w.current=!0,E(null)};document.addEventListener("pointerdown",Z,!0),document.addEventListener("click",Z,!0),document.addEventListener("scroll",D,!0),window.addEventListener("blur",D),document.addEventListener("visibilitychange",D),document.addEventListener("keydown",D,!0);const O=new MutationObserver(()=>{zn(u.current)&&E(null)});return O.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["role","aria-modal","aria-hidden","class"]}),()=>{document.removeEventListener("pointerdown",Z,!0),document.removeEventListener("click",Z,!0),document.removeEventListener("scroll",D,!0),window.removeEventListener("blur",D),document.removeEventListener("visibilitychange",D),document.removeEventListener("keydown",D,!0),O.disconnect()}},[v]),s.useEffect(()=>{const D=()=>_n(),Z=()=>{_n(),w.current=!0,E(null)};return document.addEventListener("pointerdown",D,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",D,!0),window.addEventListener(Is,Z),()=>{document.removeEventListener("pointerdown",D,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",D,!0),window.removeEventListener(Is,Z)}},[]);const K=n?y:r;return t.jsxs(t.Fragment,{children:[t.jsx(b,{ref:D=>{u.current=D},className:c,style:d,onMouseEnter:D=>{L(),U(),o?C(D.clientX,D.clientY):m()},onMouseMove:D=>{v&&o&&C(D.clientX,D.clientY)},onMouseDown:_,onClick:_,onMouseLeave:()=>{U(),N()},onFocus:m,onBlur:S,children:e}),v&&K&&!zn(u.current)?bt.createPortal(t.jsxs("div",{ref:p,role:"tooltip",className:f,onMouseEnter:a?L:void 0,onMouseLeave:a?N:void 0,style:{position:"fixed",top:v.y,left:v.x,zIndex:9999,background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:6,padding:"5px 10px",fontSize:12,color:"var(--text-main)",boxShadow:"0 4px 16px rgba(0,0,0,0.35)",pointerEvents:a?"auto":"none",maxWidth:"min(420px, calc(100vw - 24px))",whiteSpace:"normal",lineHeight:1.6,overflowWrap:"anywhere",...h},children:[i&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",width:12,height:12,background:(h==null?void 0:h.background)??"var(--bg-card)",borderLeft:l==="right"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderTop:l==="bottom"||l==="right"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderRight:l==="left"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,borderBottom:l==="top"||l==="left"?(h==null?void 0:h.border)??"1px solid var(--border)":void 0,transform:"rotate(45deg)",left:v.arrowX===void 0?void 0:v.arrowX-6,top:v.arrowY===void 0?void 0:v.arrowY-6,zIndex:-1}}),K]}),document.body):null]})}function Fs(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}const Nd="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg",kd={primary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",secondary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",danger:"border border-[var(--border)] text-[var(--danger)] hover:border-[var(--danger)] hover:bg-[var(--danger-bg)] active:scale-[0.98] transition-colors",ghost:"text-[var(--text-secondary)] hover:opacity-70",icon:"text-[var(--text-muted)] hover:text-[var(--primary)] hover:bg-primary/5"},Sd="border border-[var(--border)] text-[var(--text-muted)] shadow-sm shadow-black/5 hover:border-[var(--border)] hover:bg-[var(--bg-input)] hover:text-[var(--primary)] active:scale-[0.98] transition-colors",Cd={xs:"h-8 px-2.5 text-xs",sm:"h-9 px-3.5 text-xs",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-sm font-semibold"},Ed={xs:"h-8 w-8",sm:"h-9 w-9",md:"h-10 w-10",lg:"h-10 w-10"},Md={primary:{background:"var(--bg-card)"},secondary:{background:"var(--bg-card)"},danger:{background:"var(--bg-card)"},ghost:{},icon:{}};function ro(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(ro).join(" ").trim():s.isValidElement(e)?ro(e.props.children):""}function Td(e){return s.Children.toArray(e).find(s.isValidElement)??null}function Ke({variant:e="primary",size:r="md",loading:n=!1,icon:a,tooltip:o,iconOnly:l,height:i,padding:c,children:f,className:d="",disabled:h,style:b,...u}){const p=s.useContext($s),g=l??p.iconOnly??e==="icon",w=p.compact??!1,v=p.headerAction??!1,E=v&&r==="md"?"sm":w&&!v&&r==="md"?"xs":r,y=e==="icon"||g,T=v&&y,L=ro(f),C=o??u.title??u["aria-label"]??(g?L:void 0),m=C?void 0:u.title,S=u["aria-label"]??(typeof C=="string"?C:L||void 0),N=n?null:a??(g?Td(f):null),_=t.jsxs("button",{...u,title:m,"aria-label":S,"data-variant":e,"data-size":E,"data-icon":y?"true":void 0,disabled:h||n,className:`${Nd} ${T?Sd:kd[e]} ${y?Ed[E]:Cd[E]} ${w&&!y?"px-2.5":""} ${d}`,style:{...Md[e],height:Fs(i),padding:Fs(c),...b,...v&&!y?{height:"var(--page-header-control-height, 34px)",padding:"0 var(--page-header-control-padding-x, 10px)",borderRadius:"8px"}:null,...T?{width:"var(--page-header-control-height, 40px)",height:"var(--page-header-control-height, 40px)",padding:0,background:"var(--bg-card)",borderRadius:"8px"}:null},children:[n?t.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):N,!g&&f]});return C?t.jsx(Xt,{as:"span",content:C,className:"inline-flex shrink-0",children:_}):_}const St={background:"color-mix(in srgb, var(--text-muted) 26%, var(--bg-input))"};function Wn({rows:e=8,columns:r=7,showToolbar:n=!0,showPagination:a=!0,compact:o=!1,className:l=""}){const i=Math.max(3,Math.min(r,12)),c=Math.max(3,Math.min(e,20)),f=o?"px-2 py-2":"px-3 py-2.5",d=o?"px-2 py-2":"px-3 py-3";return t.jsxs("div",{className:`w-full min-w-0 overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${l}`,"aria-busy":"true","aria-label":"Cargando tabla",children:[n&&t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-3 py-2",children:[t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.jsx("div",{className:"h-7 w-14 shrink-0 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 max-w-md flex-1 animate-pulse rounded-md",style:St})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St})]})]}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("div",{className:"min-w-full",style:{display:"grid",gridTemplateColumns:`repeat(${i}, minmax(96px, 1fr))`},children:[Array.from({length:i}).map((h,b)=>t.jsx("div",{className:`${d} border-b border-[var(--border)]`,style:{background:"color-mix(in srgb, var(--bg-input) 55%, transparent)"},children:t.jsx("div",{className:"h-3 animate-pulse rounded-md",style:{...St,width:`${48+b*17%40}%`}})},`h-${b}`)),Array.from({length:c}).map((h,b)=>Array.from({length:i}).map((u,p)=>t.jsx("div",{className:`${f} ${b<c-1?"border-b border-[var(--border)]":""}`,children:t.jsx("div",{className:"h-3.5 animate-pulse rounded-md",style:{...St,width:`${46+(b*13+p*11)%42}%`,minWidth:28}})},`c-${b}-${p}`)))]})}),a&&t.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-[var(--border)] px-3 py-2",style:{background:"color-mix(in srgb, var(--bg-input) 40%, transparent)"},children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"h-3 w-28 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"h-7 w-14 animate-pulse rounded-md",style:St})]}),t.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:4}).map((h,b)=>t.jsx("div",{className:"h-7 w-7 animate-pulse rounded-md",style:St},b))}),t.jsx("div",{className:"h-3 w-16 animate-pulse rounded-md",style:St})]})]})}function Ad({size:e="md"}){const r=e==="sm"?"h-7 w-7":"h-9 w-9";return t.jsx("div",{className:`${r} animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]`,"aria-hidden":!0})}function Ld({logoSrc:e,logoAlt:r}){return e?t.jsxs("span",{className:"relative flex h-16 w-16 items-center justify-center","aria-hidden":!1,children:[t.jsx("span",{className:"absolute inset-0 rounded-2xl opacity-40 blur-xl",style:{background:"radial-gradient(circle, color-mix(in srgb, var(--primary) 45%, transparent) 0%, transparent 70%)"}}),t.jsx("img",{src:e,alt:r,className:"relative h-14 w-14 rounded-2xl object-contain shadow-sm shadow-black/10"})]}):null}function Os({variant:e="page",title:r="Cargando...",description:n,logoSrc:a,logoAlt:o,appearance:l="card",rows:i=6,columns:c=7,children:f,className:d=""}){if(e==="table")return t.jsx(Wn,{rows:i,columns:c,className:d});if(e==="sections")return t.jsx($d,{rows:i});if(e==="cards")return t.jsx(Dd,{rows:i});const h=o||(typeof r=="string"?r:"Aplicación"),b=l==="bare",u=t.jsxs("div",{className:`flex flex-col items-center text-center ${b?"gap-5":"gap-3"}`,children:[a?t.jsx(Ld,{logoSrc:a,logoAlt:h}):null,t.jsx(Ad,{size:b?"md":"sm"}),t.jsxs("div",{className:b?"space-y-1.5":"",children:[t.jsx("p",{className:b?"text-base font-semibold tracking-tight text-[var(--text-main)]":"text-sm font-semibold text-[var(--text-main)]",children:r}),n?t.jsx("p",{className:b?"text-sm font-medium text-[var(--text-muted)]":"mt-1 text-xs text-[var(--text-muted)]",children:n}):null,f&&t.jsx("div",{className:"mt-1 text-xs text-[var(--text-muted)]",children:f})]})]});return b?t.jsx("div",{className:`flex min-h-[240px] w-full items-center justify-center p-8 ${d}`,role:"status","aria-live":"polite","aria-busy":"true",children:u}):t.jsx("div",{className:`flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 ${d}`,role:"status","aria-live":"polite","aria-busy":"true",children:u})}function $d({rows:e}){return t.jsx(Wn,{rows:e,columns:7})}function Dd({rows:e}){return t.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:e}).map((r,n)=>t.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded-md",style:St}),t.jsx("div",{className:"mt-3 h-3 w-full animate-pulse rounded-md",style:St}),t.jsx("div",{className:"mt-2 h-3 w-4/5 animate-pulse rounded-md",style:St})]},n))})}function Hs(e){const r=e.split("/").filter(Boolean);return(r[r.length-1]??e).replace(/^lv_/,"").split(/[-_]/).filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Bs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function Id(e){return[e.label,Hs(e.service),e.description,e.service].filter(Boolean).join(" ")}function Fd(e){return typeof e=="function"?e:e.default}function Od(e,r){return t.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 text-center",children:t.jsxs("div",{className:"max-w-md",children:[t.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:"No se pudo cargar este modulo"}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:e.message}),t.jsx(Ke,{className:"mt-4",height:36,padding:"0 14px",onClick:r,children:"Reintentar"})]})})}function Hd({parentPanel:e,parentPanelComponent:r,renderParentPanel:n,parent:a,context:o,links:l,moduleRegistry:i,loadModule:c,activeService:f,initialService:d,onActiveServiceChange:h,canAccess:b,keepAlive:u=!0,title:p,subtitle:g,emptyState:w,loadingState:v,errorState:E=Od,renderTabLabel:y,searchableTabs:T="auto",tabsSearchThreshold:L=6,tabsSearchPlaceholder:C="Buscar modulo...",tabsSearchValue:m,onTabsSearchChange:S,emptySearchState:N,showTabCount:_=!0,className:U="",parentClassName:K="",contentClassName:D="",tabsClassName:Z=""}){var we;const O=s.useMemo(()=>l.filter(ae=>!ae.hidden&&((b==null?void 0:b(ae,o))??!0)),[b,o,l]),ne=(we=O.find(ae=>!ae.disabled))==null?void 0:we.service,[ee,fe]=s.useState(d??ne??""),[J,W]=s.useState({}),[R,$]=s.useState({}),[P,ue]=s.useState(""),[z,se]=s.useState(!1),q=s.useRef(R),k=s.useRef(0),V=m??P,M=Bs(V),Y=T===!0||T==="auto"&&O.length>=L,ce=Y&&V.trim().length>0,X=s.useMemo(()=>M?O.filter(ae=>Bs(Id(ae)).includes(M)):O,[M,O]),G=f??ee,I=O.find(ae=>ae.service===G)??O.find(ae=>!ae.disabled);s.useEffect(()=>{!I&&ne&&fe(ne)},[ne,I]),s.useEffect(()=>{q.current=R},[R]);const le=ae=>{ae.disabled||(f||fe(ae.service),h==null||h(ae.service,ae))},be=ae=>{m===void 0&&ue(ae),S==null||S(ae)},ie=(ae,Fe)=>{const qe=X.filter(Ze=>!Ze.disabled),Je=qe.findIndex(Ze=>Ze.service===Fe.service);Je<0||((ae.key==="ArrowRight"||ae.key==="ArrowDown")&&(ae.preventDefault(),le(qe[(Je+1)%qe.length])),(ae.key==="ArrowLeft"||ae.key==="ArrowUp")&&(ae.preventDefault(),le(qe[(Je-1+qe.length)%qe.length])),ae.key==="Home"&&(ae.preventDefault(),le(qe[0])),ae.key==="End"&&(ae.preventDefault(),le(qe[qe.length-1])))},ge=s.useCallback(()=>{if(!I)return;const ae=I.service,Fe=q.current[ae];if(Fe!=null&&Fe.loading||Fe!=null&&Fe.component&&u)return;const qe=(i==null?void 0:i[ae])??c;if(!qe){$(Ze=>({...Ze,[ae]:{loading:!1,error:new Error(`No module loader found for service "${ae}".`)}}));return}const Je=++k.current;$(Ze=>({...Ze,[ae]:{...Ze[ae],loading:!0,error:void 0}})),qe(I,o).then(Ze=>{if(Je!==k.current&&!u)return;const Ue=Fd(Ze);$(tt=>({...tt,[ae]:{component:Ue,loading:!1}}))}).catch(Ze=>{const Ue=Ze instanceof Error?Ze:new Error(String(Ze));$(tt=>({...tt,[ae]:{...tt[ae],loading:!1,error:Ue}}))})},[o,u,c,i,I]);s.useEffect(ge,[ge]);const $e=I?J[I.service]??null:null,De=I?R[I.service]:void 0,kt=De==null?void 0:De.component,wt=ae=>{I&&W(Fe=>({...Fe,[I.service]:ae}))},re=()=>{I&&W(ae=>({...ae,[I.service]:null}))},xe={context:o,parent:a,links:l,visibleLinks:O,filteredLinks:X,selectedLink:I,selectedService:I==null?void 0:I.service,activeItemId:$e,tabsSearch:V,onSelectService:le,onOpenDetail:wt,onBackToList:re},oe=n?n(xe):r?t.jsx(r,{...xe}):e;return t.jsxs("section",{className:`grid min-h-[520px] gap-4 lg:grid-cols-[minmax(260px,360px)_minmax(0,1fr)] ${U}`,children:[t.jsx("aside",{className:`min-w-0 rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4 ${K}`,children:oe}),t.jsxs("div",{className:`relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${D}`,children:[(p||g||Y||_)&&t.jsx("div",{className:"relative border-b border-[var(--border)] px-4 py-3",children:t.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[p&&t.jsx("h2",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:p}),g&&t.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-[var(--text-muted)]",children:g})]}),(Y||_)&&t.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-end gap-2",children:[_&&t.jsxs("span",{className:"hidden text-xs font-semibold text-[var(--text-muted)] transition-opacity duration-200 sm:inline",children:[X.length," / ",O.length]}),Y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:`origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${z?"w-[min(20rem,44vw)] translate-x-0 opacity-100":"w-0 translate-x-2 opacity-0"}`,"aria-hidden":!z,children:t.jsx(Ls,{value:V,onChange:be,placeholder:C,className:"w-full",autoFocus:z,forceExpanded:!0,onEscape:()=>se(!1),size:"sm",inputTabIndex:z?0:-1})}),t.jsx("button",{type:"button","aria-label":z?"Cerrar busqueda":"Buscar tabs","aria-expanded":z,onClick:()=>{z&&V&&be(""),se(ae=>!ae)},className:`inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${z||ce?"border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm":"border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,children:t.jsx("span",{className:"grid h-4 w-4 place-items-center transition-transform duration-200",children:z||ce?t.jsx(F.HiXMark,{className:"h-4 w-4"}):t.jsx(F.HiMagnifyingGlass,{className:"h-4 w-4"})})})]})]})]})}),t.jsx("div",{role:"tablist","aria-label":p??"Modulos relacionados",className:`flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${Z}`,children:X.length>0?X.map(ae=>{const Fe=ae.service===(I==null?void 0:I.service);return t.jsx("button",{type:"button",role:"tab","aria-selected":Fe,disabled:ae.disabled,onClick:()=>le(ae),onKeyDown:qe=>ie(qe,ae),className:`inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${Fe?"border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm":"border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,children:y?y(ae,Fe):t.jsxs(t.Fragment,{children:[ae.icon,t.jsx("span",{children:ae.label??Hs(ae.service)}),ae.badge&&t.jsx("span",{className:"rounded-full bg-[var(--bg-input)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:ae.badge})]})},ae.service)}):t.jsx("div",{className:"flex min-h-9 flex-1 items-center rounded-md border border-dashed border-[var(--border)] px-3 text-xs text-[var(--text-muted)]",children:N??"No hay modulos que coincidan con la busqueda."})}),(I==null?void 0:I.description)&&t.jsx("div",{className:"border-b border-[var(--border)] px-4 py-2 text-xs text-[var(--text-muted)]",children:I.description}),t.jsxs("div",{className:"min-h-[420px] p-4",children:[!I&&(w??t.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]",children:"No hay modulos disponibles."})),I&&(De==null?void 0:De.loading)&&(v??t.jsx(Os,{title:"Cargando modulo..."})),I&&(De==null?void 0:De.error)&&E(De.error,ge),I&&kt&&!(De!=null&&De.loading)&&!(De!=null&&De.error)&&t.jsx(kt,{context:o,parent:a,link:I,activeItemId:$e,onOpenDetail:wt,onBackToList:re})]})]})]})}const Bd={sm:16,md:20,lg:24,xl:32};function Ps(e){if(e!=null)return typeof e=="number"?e:Bd[e]}function _s(e,r){const n=Ps(e);return n==null?r:{width:n,height:n,...r}}function Pd(e,r){const n=s.forwardRef(function({className:o,title:l,size:i,style:c,...f},d){const h=i!=null;return t.jsxs("svg",{ref:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":l?void 0:!0,role:l?"img":void 0,className:Pe("block shrink-0",!h&&"h-[1em] w-[1em]",o),style:_s(i,c),...f,children:[l?t.jsx("title",{children:l}):null,r]})});return n.displayName=e,n}function xr(e,r){const n=s.forwardRef(function({className:o,title:l,size:i,style:c,...f},d){const h=i!=null;return t.jsxs("svg",{ref:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":l?void 0:!0,role:l?"img":void 0,className:Pe("block shrink-0",!h&&"h-[1em] w-[1em]",o),style:_s(i,c),...f,children:[l?t.jsx("title",{children:l}):null,r]})});return n.displayName=e,n}const _d=t.jsx("path",{d:"M3.5 1.75h9.25L20.5 7.75V20.75A1.5 1.5 0 0 1 19 22.25H5A1.5 1.5 0 0 1 3.5 20.75V1.75Z"}),zd=t.jsx("path",{fill:"#fff",fillOpacity:.32,d:"M12.75 1.75V7.75H20.5Z"});function Wd(e,r=5.5){const n=e.length>3;return t.jsx("text",{x:"12",y:"16.75",textAnchor:"middle",fill:"#fff",fontSize:n?Math.min(r,4.6):r,fontWeight:700,fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",letterSpacing:n?"-0.06em":"0.01em",style:{userSelect:"none"},children:e})}function un(e){return t.jsxs(t.Fragment,{children:[_d,zd,e]})}function Qe(e,r,n){return xr(e,un(Wd(r,n)))}const zs=xr("FileFolderIcon",t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M3.25 8.1V7.1A1.6 1.6 0 0 1 4.85 5.5h4.05c.38 0 .74.13 1.03.37l1.02.85c.29.24.65.37 1.03.37h7.17A1.6 1.6 0 0 1 20.75 8.7v.4H3.25Z"}),t.jsx("path",{d:"M3.25 8.5h17.5v9A1.75 1.75 0 0 1 19 19.25H5A1.75 1.75 0 0 1 3.25 17.5v-9Z"})]})),Ws=Qe("FilePdfIcon","PDF",5.75),js=Qe("FileDocIcon","DOC",5.6),jn=Qe("FileDocxIcon","DOCX",4.7),qs=Qe("FileTxtIcon","TXT",5.6),jd=jn,Us=Qe("FileCsvIcon","CSV",5.6),Vs=Qe("FileXlsIcon","XLS",5.6),qn=Qe("FileXlsxIcon","XLSX",4.7),qd=qn,Xs=Qe("FilePptIcon","PPT",5.6),Un=Qe("FilePptxIcon","PPTX",4.7),Ud=Un,Ys=Qe("FileFigIcon","FIG",5.6),Gs=Qe("FileAiIcon","AI",5.75),Ks=Qe("FilePsdIcon","PSD",5.6),Zs=Qe("FileInddIcon","INDD",4.7),Qs=Qe("FileAepIcon","AEP",5.6),Js=Qe("FileSvgIcon","SVG",5.6),Rs=Qe("FileMp3Icon","MP3",5.6),el=Qe("FileWavIcon","WAV",5.6),tl=xr("FileAudioIcon",un(t.jsx("path",{fill:"#fff",d:"M10.2 10.4v6.2c0 .7-.55 1.25-1.25 1.25S7.7 17.3 7.7 16.6s.55-1.25 1.25-1.25c.2 0 .38.05.55.12V11.6l5.3-1.2v5.55c0 .7-.55 1.25-1.25 1.25s-1.25-.55-1.25-1.25.55-1.25 1.25-1.25c.2 0 .38.05.55.12V10.05l.2-.05-5.1 1.4Z"}))),rl=Qe("FileMp4Icon","MP4",5.6),nl=Qe("FileMpegIcon","MPEG",4.4),al=Qe("FileAviIcon","AVI",5.6),ol=Qe("FileMkvIcon","MKV",5.6),sl=xr("FileVideoIcon",un(t.jsx("path",{fill:"#fff",d:"M8.2 11.1h5.1c.55 0 1 .45 1 1v3.6c0 .55-.45 1-1 1H8.2c-.55 0-1-.45-1-1v-3.6c0-.55.45-1 1-1Zm7.05 1.05 2.55-1.35v5.2l-2.55-1.35v-2.5Z"}))),ll=Qe("FileZipIcon","ZIP",5.6),il=Qe("FileRarIcon","RAR",5.6),Vn=Qe("FileImgIcon","IMG",5.6),cl=Qe("FileJpgIcon","JPG",5.6),dl=Qe("FilePngIcon","PNG",5.6),Vd=Vn,ul=xr("FileCodeIcon",un(t.jsxs("g",{fill:"none",stroke:"#fff",strokeWidth:1.65,strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"m8.2 12.2-2.25 1.9 2.25 1.9"}),t.jsx("path",{d:"m15.8 12.2 2.25 1.9-2.25 1.9"}),t.jsx("path",{d:"m12.85 11.45-1.2 5.4"})]}))),fl=xr("FileDocfyIcon",un(t.jsxs(t.Fragment,{children:[t.jsx("path",{fill:"#fff",d:"M7.5 12h9v1.4H7.5z"}),t.jsx("path",{fill:"#fff",d:"M7.5 14.55h9v1.4H7.5z"}),t.jsx("path",{fill:"#fff",d:"M7.5 17.1h5.75v1.4H7.5z"})]}))),no=Qe("FileGenericIcon","FILE",4.8),bl={folder:"text-amber-500",pdf:"text-[#EA4335]",doc:"text-[#4285F4]",docx:"text-[#4285F4]",word:"text-[#4285F4]",txt:"text-[#5F6368]",csv:"text-[#34A853]",xls:"text-[#34A853]",xlsx:"text-[#34A853]",excel:"text-[#34A853]",ppt:"text-[#EA4335]",pptx:"text-[#EA4335]",powerpoint:"text-[#EA4335]",fig:"text-[#A142F4]",ai:"text-[#FF6D00]",psd:"text-[#304FFE]",indd:"text-[#C2185B]",aep:"text-[#9C27B0]",svg:"text-[#A142F4]",mp3:"text-[#E91E63]",wav:"text-[#E91E63]",audio:"text-[#E91E63]",mp4:"text-[#4285F4]",mpeg:"text-[#4285F4]",avi:"text-[#4285F4]",mkv:"text-[#4285F4]",video:"text-[#4285F4]",zip:"text-[#5F6368]",rar:"text-[#5F6368]",img:"text-[#5F6368]",jpg:"text-[#5F6368]",png:"text-[#5F6368]",image:"text-[#5F6368]",code:"text-[#3949AB]",docfy:"text-[#4285F4]",generic:"text-[#9AA0A6]"},Xd=["folder","pdf","doc","docx","txt","csv","xls","xlsx","ppt","pptx","fig","ai","psd","indd","aep","svg","mp3","wav","audio","mp4","mpeg","avi","mkv","video","zip","rar","img","jpg","png","code","docfy","generic"],Yd={folder:zs,pdf:Ws,doc:js,docx:jn,word:jn,txt:qs,csv:Us,xls:Vs,xlsx:qn,excel:qn,ppt:Xs,pptx:Un,powerpoint:Un,fig:Ys,ai:Gs,psd:Ks,indd:Zs,aep:Qs,svg:Js,mp3:Rs,wav:el,audio:tl,mp4:rl,mpeg:nl,avi:al,mkv:ol,video:sl,zip:ll,rar:il,img:Vn,jpg:cl,png:dl,image:Vn,code:ul,docfy:fl,generic:no};function Gd({kind:e,colored:r=!0,className:n="",size:a,...o}){const l=Yd[e]??no,c=[r?bl[e]:"",n].filter(Boolean).join(" ");return t.jsx(l,{className:c||void 0,size:a,...o})}const Kd={info:{color:"#2563eb",background:"rgba(59, 130, 246, 0.1)",border:"rgba(59, 130, 246, 0.24)",icon:t.jsx(F.HiInformationCircle,{className:"h-5 w-5"})},success:{color:"#047857",background:"rgba(16, 185, 129, 0.1)",border:"rgba(16, 185, 129, 0.24)",icon:t.jsx(F.HiCheckCircle,{className:"h-5 w-5"})},warning:{color:"#b45309",background:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)",icon:t.jsx(F.HiExclamationTriangle,{className:"h-5 w-5"})},danger:{color:"var(--danger)",background:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))",icon:t.jsx(F.HiExclamationCircle,{className:"h-5 w-5"})},neutral:{color:"var(--text-secondary)",background:"var(--bg-input)",border:"var(--border)",icon:t.jsx(F.HiInformationCircle,{className:"h-5 w-5"})}};function Zd({variant:e="info",title:r,children:n,icon:a,action:o,onDismiss:l,className:i=""}){const c=Kd[e];return t.jsxs("div",{role:e==="danger"||e==="warning"?"alert":"status",className:`flex items-start gap-3 rounded-lg border px-3 py-3 ${i}`,style:{background:c.background,borderColor:c.border},children:[t.jsx("div",{className:"mt-0.5 shrink-0",style:{color:c.color},children:a??c.icon}),t.jsxs("div",{className:"min-w-0 flex-1",children:[r&&t.jsx("div",{className:"text-sm font-semibold text-[var(--text-main)]",children:r}),n&&t.jsx("div",{className:"mt-0.5 text-sm leading-5 text-[var(--text-secondary)]",children:n}),o&&t.jsx("div",{className:"mt-3",children:o})]}),l&&t.jsx(Ke,{variant:"icon",size:"xs","aria-label":"Cerrar alerta",onClick:l,className:"-mr-1 -mt-1",children:t.jsx(F.HiXMark,{className:"h-4 w-4"})})]})}const hl=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Qd=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Jd=["lu","ma","mi","ju","vi","sá","do"],pl=6;function ao(e,r,n){return`${e}-${String(r).padStart(2,"0")}-${String(n).padStart(2,"0")}`}function Rd(){const e=new Date;return ao(e.getFullYear(),e.getMonth()+1,e.getDate())}function oo(e){const[r,n,a]=e.split("-").map(Number);return{year:r,month:n,day:a}}function eu(e){if(!e)return"Seleccionar fecha";const{year:r,month:n,day:a}=oo(e);return!r||!n||!a?"Seleccionar fecha":`${String(a).padStart(2,"0")} ${hl[n-1]} ${r}`}function ml(e){const{year:r,month:n,day:a}=oo(e);if(!r||!n||!a)return!1;const o=new Date(r,n-1,a).getDay();return o===0||o===6}function tu({value:e,onChange:r,minDate:n,maxDate:a,disableWeekends:o=!1,displayMode:l="inline",className:i=""}){const c=Rd(),d=oo(e||c),h=l==="popover",[b,u]=s.useState(!1),p=s.useRef(null),[g,w]=s.useState({horizontal:"left",vertical:"bottom"}),[v,E]=s.useState(d.year),[y,T]=s.useState(d.month),[L,C]=s.useState("days"),m=16,[S,N]=s.useState(0),_=v-7+S,U=Array.from({length:m},(W,R)=>_+R);s.useEffect(()=>{if(!h||!b||!p.current)return;const W=p.current.getBoundingClientRect(),R=8,$=280,P=340,ue=W.left+$>window.innerWidth-R,z=W.right-$>=R,se=W.bottom+8+P>window.innerHeight-R,q=W.top-8-P>=R;w({horizontal:ue&&z?"right":"left",vertical:se&&q?"top":"bottom"})},[h,b]),s.useEffect(()=>{if(!h||!b)return;function W($){p.current&&(p.current.contains($.target)||u(!1))}function R($){$.key==="Escape"&&u(!1)}return document.addEventListener("mousedown",W),document.addEventListener("keydown",R),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("keydown",R)}},[h,b]);function K(){y===1?(E(W=>W-1),T(12)):T(W=>W-1)}function D(){y===12?(E(W=>W+1),T(1)):T(W=>W+1)}const Z=(new Date(v,y-1,1).getDay()+6)%7,O=new Date(v,y,0).getDate(),ne=[...Array(Z).fill(null),...Array.from({length:O},(W,R)=>R+1)];for(;ne.length<pl*7;)ne.push(null);const ee=ne.slice(0,pl*7);function fe(W){const R=ao(v,y,W);n&&R<n||a&&R>a||o&&ml(R)||(r(R),h&&u(!1))}const J=t.jsx("div",{className:`bonsaif-calendar bonsaif-calendar-picker ${i}`.trim(),children:t.jsxs("div",{className:"bonsaif-cal-shell",children:[t.jsx("div",{className:"bonsaif-cal-toolbar",children:L==="days"?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:K,"aria-label":"Mes anterior",children:t.jsx(F.HiChevronLeft,{size:16})}),t.jsxs("button",{type:"button",className:"bonsaif-cal-title-btn",onClick:()=>{C("years"),N(0)},children:[t.jsxs("span",{className:"bonsaif-cal-title",children:[hl[y-1]," ",v]}),t.jsx(F.HiChevronDown,{size:13})]}),t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:D,"aria-label":"Mes siguiente",children:t.jsx(F.HiChevronRight,{size:16})})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:()=>N(W=>W-m),"aria-label":"Años anteriores",children:t.jsx(F.HiChevronLeft,{size:16})}),t.jsx("button",{type:"button",className:"bonsaif-cal-title-btn",onClick:()=>C("days"),children:t.jsxs("span",{className:"bonsaif-cal-title",children:[U[0]," – ",U[U.length-1]]})}),t.jsx("button",{type:"button",className:"bonsaif-cal-nav-btn",onClick:()=>N(W=>W+m),"aria-label":"Años siguientes",children:t.jsx(F.HiChevronRight,{size:16})})]})}),L==="years"?t.jsxs("div",{className:"bonsaif-cal-picker-years",children:[t.jsx("div",{className:"bonsaif-cal-picker-months",children:Qd.map((W,R)=>{const $=R+1===y;return t.jsx("button",{type:"button",className:`bonsaif-cal-pill-btn${$?" is-active":""}`,onClick:()=>T(R+1),children:W},W)})}),t.jsx("div",{className:"bonsaif-cal-picker-year-grid",children:U.map(W=>{const R=W===v,$=W===new Date().getFullYear();return t.jsx("button",{type:"button",className:`bonsaif-cal-pill-btn${R?" is-active":""}${$&&!R?" is-today":""}`,onClick:()=>{E(W),C("days")},children:W},W)})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bonsaif-multi-weekdays bonsaif-cal-picker-weekdays",children:Jd.map(W=>t.jsx("div",{className:"bonsaif-multi-weekday",children:W},W))}),t.jsx("div",{className:"bonsaif-cal-picker-days",children:ee.map((W,R)=>{if(W===null)return t.jsx("div",{className:"bonsaif-multi-day bonsaif-multi-day-hidden"},R);const $=ao(v,y,W),P=$===e,ue=$===c,z=!!(n&&$<n)||!!(a&&$>a)||o&&ml($);return t.jsx("div",{className:`bonsaif-multi-day${P?" bonsaif-multi-day-selected":""}${ue?" bonsaif-multi-day-today":""}${z?" bonsaif-multi-day-disabled":""}`,children:t.jsx("button",{type:"button",className:"bonsaif-multi-day-btn",disabled:z,"aria-pressed":P,onClick:()=>!z&&fe(W),children:W})},R)})})]})]})});return h?t.jsxs("div",{ref:p,className:`relative w-full ${i}`.trim(),children:[t.jsxs("button",{type:"button",onClick:()=>u(W=>!W),className:"bonsaif-cal-trigger","data-open":b?"true":"false",children:[t.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[t.jsx(F.HiCalendarDays,{className:"w-4 h-4 text-[var(--text-muted)]"}),t.jsx("span",{className:"truncate",children:eu(e)})]}),t.jsx(F.HiChevronDown,{className:`w-4 h-4 text-[var(--text-muted)] transition-transform ${b?"rotate-180":""}`})]}),b&&t.jsx("div",{className:"absolute z-50",style:{...g.horizontal==="left"?{left:0}:{right:0},...g.vertical==="bottom"?{top:"calc(100% + 8px)"}:{bottom:"calc(100% + 8px)"}},children:J})]}):J}function er({children:e,className:r="",style:n,as:a="span",followCursor:o=!1,placement:l="top"}){return t.jsx(Xt,{onlyWhenOverflow:!0,as:a,followCursor:o,placement:l,showArrow:!o,className:r,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,...n},children:e})}function so(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function lo(e){return e.normalize("NFD").replace(new RegExp("\\p{M}","gu"),"").toLowerCase()}function ru(e,r){if(!r.trim())return!0;const n=lo(r);return lo(e.label).includes(n)||!!(e.sublabel&&lo(e.sublabel).includes(n))}function yr({value:e,onChange:r,options:n,status:a="default",ariaLabel:o,triggerVariant:l="default",showSelectedSublabel:i=!0,placeholder:c="Seleccionar…",emptyLabel:f,disabled:d=!1,className:h="",style:b,dropdownMinWidth:u,dropdownZIndex:p=9999,height:g=40,padding:w="0 10px",searchable:v=!0,minOptionsForSearch:E=6}){const[y,T]=s.useState(!1),[L,C]=s.useState(""),[m,S]=s.useState(-1),[N,_]=s.useState(!1),[U,K]=s.useState({}),D=s.useRef(null),Z=s.useRef(null),O=s.useRef(null),ne=s.useRef(null),ee=v&&n.length>=E,fe=n.find(M=>M.value===e)??null,J=l==="ghost",W=a==="error"?"var(--danger)":y?"var(--primary)":"var(--border)",R=ee&&L.trim()?n.filter(M=>ru(M,L)):n,$=s.useCallback(()=>{const M=D.current;if(!(M!=null&&M.isConnected))return;const Y=M.getBoundingClientRect();if(Y.width<1&&Y.height<1||Y.bottom<0||Y.top>window.innerHeight)return;const ce=ee?272:212,X=window.innerHeight-Y.bottom,G=X<ce&&Y.top>X,I=8,le=Math.max(Y.width,0),be=Math.max(I,window.innerWidth-le-I),ie=Math.min(Math.max(I,Y.left),be);K({position:"fixed",left:ie,top:G?void 0:Y.bottom+4,bottom:G?window.innerHeight-Y.top+4:void 0,width:Y.width,minWidth:so(u),zIndex:p})},[u,p,ee]);s.useEffect(()=>_(!0),[]),s.useEffect(()=>{if(!y)return;function M(Y){var X,G;const ce=Y.target;!((X=D.current)!=null&&X.contains(ce))&&!((G=Z.current)!=null&&G.contains(ce))&&(T(!1),C(""))}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[y]),s.useEffect(()=>{y&&(S(-1),$(),ee&&setTimeout(()=>{var M;return(M=O.current)==null?void 0:M.focus()},0))},[y,ee,$]),s.useEffect(()=>{if(y)return window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[y,$]),s.useEffect(()=>{if(m<0||!ne.current)return;const M=ne.current.children[m];M==null||M.scrollIntoView({block:"nearest"})},[m]);const P=s.useCallback(M=>{r(M),T(!1),C("")},[r]),ue=s.useRef(y);ue.current=y;const z=s.useRef(R);z.current=R;const se=s.useRef(m);se.current=m;const q=s.useRef(f);q.current=f;const k=s.useRef(P);k.current=P,s.useEffect(()=>{function M(Y){var I,le;const ce=document.activeElement,X=((I=D.current)==null?void 0:I.contains(ce))??!1,G=((le=Z.current)==null?void 0:le.contains(ce))??!1;if(!(!X&&!G)){if(!ue.current){(Y.key==="Enter"||Y.key===" "||Y.key==="ArrowDown")&&(Y.preventDefault(),T(!0));return}switch(Y.key){case"ArrowDown":Y.preventDefault(),S(be=>Math.min(be+1,z.current.length-1));break;case"ArrowUp":Y.preventDefault(),S(be=>Math.max(be-1,q.current?-1:0));break;case"Enter":{Y.preventDefault();const be=se.current,ie=z.current;be===-1&&q.current?k.current(""):ie[be]&&!ie[be].disabled&&k.current(ie[be].value);break}case"Escape":Y.preventDefault(),Y.stopPropagation(),T(!1),C("");break}}}return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[]);const V=t.jsxs("div",{ref:Z,"data-bonsaif-select-dropdown":"true",className:"rounded-xl shadow-xl overflow-hidden",style:{...U,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[ee&&t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[t.jsx(F.HiMagnifyingGlass,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),t.jsx("input",{ref:O,value:L,onChange:M=>{C(M.target.value),S(-1)},placeholder:"Buscar…",className:"min-w-0 flex-1 text-sm bg-transparent outline-none",style:{color:"var(--text-main)"}}),L&&t.jsx("button",{type:"button",onMouseDown:M=>{M.preventDefault(),C("")},children:t.jsx(F.HiXMark,{className:"w-3.5 h-3.5",style:{color:"var(--text-muted)"}})})]}),t.jsxs("ul",{ref:ne,role:"listbox",className:"overflow-y-auto",style:{maxHeight:ee?220:180,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[f&&t.jsx("li",{role:"option","aria-selected":e==="",onMouseDown:M=>{M.preventDefault(),P("")},onMouseEnter:()=>S(-1),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:m===-1&&!L.trim()?"var(--bg-hover)":"transparent",color:"var(--text-muted)",fontStyle:"italic"},children:f}),R.map((M,Y)=>{const X=Y===m,G=M.value===e;return t.jsxs("li",{role:"option","aria-selected":G,onMouseDown:I=>{I.preventDefault(),M.disabled||P(M.value)},onMouseEnter:()=>!M.disabled&&S(Y),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:X?"var(--bg-hover)":G?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:M.disabled?"var(--text-muted)":"var(--text-main)",cursor:M.disabled?"not-allowed":"pointer",boxShadow:G?"inset 2px 0 0 var(--primary)":void 0},children:[M.color&&t.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:M.color}}),t.jsxs("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:[t.jsx(er,{className:"min-w-0 flex-1",children:M.label}),M.sublabel&&t.jsx(er,{className:"min-w-0 flex-shrink",style:{color:"var(--text-muted)",fontSize:12},children:M.sublabel})]}),M.badge&&t.jsx("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:M.badge})]},M.value)}),R.length===0&&t.jsx("li",{className:"px-3 py-4 text-sm text-center",style:{color:"var(--text-muted)"},children:"Sin resultados"})]})]});return t.jsxs("div",{ref:D,className:`relative ${h||"w-full"}`,style:b,children:[t.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&T(M=>!M),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{height:so(g),padding:so(w),background:J?"transparent":"var(--bg-input)",color:fe?"var(--text-main)":"var(--text-muted)",border:J?"1px solid transparent":`1px solid ${W}`,opacity:d?.5:1,cursor:d?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":y,"aria-label":o,children:[(fe==null?void 0:fe.color)&&t.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:fe.color}}),t.jsx("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:fe?t.jsxs(t.Fragment,{children:[t.jsx(er,{className:"min-w-0 flex-1",children:fe.label}),i&&fe.sublabel&&t.jsx(er,{className:"min-w-0 flex-shrink",style:{color:"var(--text-muted)",fontSize:12},children:fe.sublabel})]}):t.jsx(er,{className:"min-w-0 flex-1",children:c})}),fe&&f?t.jsx("span",{role:"button",tabIndex:-1,onMouseDown:M=>{M.preventDefault(),M.stopPropagation(),P("")},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:t.jsx(F.HiXMark,{className:"w-3 h-3"})}):t.jsx(F.HiChevronDown,{className:"flex-shrink-0 w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:y?"rotate(180deg)":"rotate(0deg)"}})]}),y&&N&&bt.createPortal(V,document.body)]})}const nu={sm:"h-4 w-4",md:"h-5 w-5"};function au(e,r){if(typeof e=="function"){e(r);return}e&&(e.current=r)}const Xn=s.forwardRef(function({label:r,description:n,error:a,size:o="md",indeterminate:l=!1,className:i="",containerClassName:c="",disabled:f,...d},h){const b=s.useRef(null);return s.useEffect(()=>{b.current&&(b.current.indeterminate=l)},[l]),t.jsxs("label",{className:`group inline-flex items-start gap-2.5 ${f?"cursor-not-allowed opacity-60":"cursor-pointer"} ${c}`,children:[t.jsxs("span",{className:"relative mt-0.5 inline-flex shrink-0",children:[t.jsx("input",{...d,ref:u=>{b.current=u,au(h,u)},type:"checkbox",disabled:f,"aria-checked":l?"mixed":d["aria-checked"],"aria-invalid":!!a||d["aria-invalid"],className:`peer ${nu[o]} appearance-none rounded border border-[var(--border)] bg-[var(--bg-input)] transition-colors checked:border-[var(--primary)] checked:bg-[var(--primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40 ${i}`}),t.jsx(F.HiCheck,{className:"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 scale-75 text-[var(--primary-fg)] opacity-0 transition peer-checked:scale-100 peer-checked:opacity-100 peer-aria-checked:mixed:scale-100 peer-aria-checked:mixed:opacity-100"})]}),(r||n||a)&&t.jsxs("span",{className:"min-w-0",children:[r&&t.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:r}),n&&!a&&t.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:n}),a&&t.jsx("span",{className:"block text-xs leading-5 text-[var(--danger)]",children:a})]})]})}),gl=32767;function Yn(e){let r=String(e??"");return r=r.split("\0").join(""),r.length<=gl?r:`${r.slice(0,gl-1)}…`}const Gn=[25,50,100,200,500];let _t={dataTable:{pageSizeOptions:[...Gn]}};function ou(){if(typeof window>"u")return;const r=window.__BONSAIF_DATA_TABLE_PREFERENCES_ENDPOINT__;return typeof r=="string"&&r.trim().length>0?r.trim().replace(/\/+$/,""):void 0}function io(){const e=_t.dataTable.preferencesEndpoint,r=ou();return e&&e.trim().length>0?e.trim().replace(/\/+$/,""):r}function su(e){if(!Array.isArray(e))return[...Gn];const r=Array.from(new Set(e.map(n=>typeof n=="number"?Math.floor(n):Number.NaN).filter(n=>Number.isFinite(n)&&n>0)));return r.length>0?r:[...Gn]}function vl(e){if(typeof e!="string")return;const r=e.trim();if(r)return r.replace(/\/+$/,"")}function lu(e){if(!e||typeof e!="object"||!e.dataTable)return;const r=vl(e.dataTable.preferencesEndpoint);_t={..._t,dataTable:{..._t.dataTable,pageSizeOptions:su(e.dataTable.pageSizeOptions),preferencesEndpoint:r??_t.dataTable.preferencesEndpoint}}}function iu(){return{dataTable:{pageSizeOptions:[..._t.dataTable.pageSizeOptions]}}}function fn(){return[..._t.dataTable.pageSizeOptions]}function cu(){_t={dataTable:{pageSizeOptions:[...Gn]}}}function du(e){_t={..._t,dataTable:{..._t.dataTable,preferencesEndpoint:vl(e)}}}const Kn=[{value:"equals",label:"Igual a",valueMode:"single"},{value:"notEquals",label:"No es igual a",valueMode:"single"},{value:"greaterThan",label:"Mayor que",valueMode:"single"},{value:"greaterThanOrEqual",label:"Mayor o igual que",valueMode:"single"},{value:"lessThan",label:"Menor que",valueMode:"single"},{value:"lessThanOrEqual",label:"Menor o igual que",valueMode:"single"},{value:"between",label:"Entre",valueMode:"between"},{value:"top10",label:"10 superiores",valueMode:"none"},{value:"bottom10",label:"10 inferiores",valueMode:"none"},{value:"aboveAverage",label:"Sobre promedio",valueMode:"none"},{value:"belowAverage",label:"Bajo promedio",valueMode:"none"}],uu=Kn.map(e=>({value:e.value,label:e.label})),fu=12,bu={layout:!0,filters:!1,sort:!1,bql:!1,pagination:!0},xl={layout:!0,filters:!0,sort:!0,bql:!0,pagination:!0},hu="bonsaif-ui:datatable:",pu="[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0",mu=[],gu=52;function tr(e){if(!e)return 150;const r=parseInt(e,10);return isNaN(r)||r<=0?150:r}function yl(e){return!!(e&&(Array.isArray(e.columnOrder)&&e.columnOrder.length>0||e.columnWidths&&Object.keys(e.columnWidths).length>0||Array.isArray(e.hiddenColumnKeys)&&e.hiddenColumnKeys.length>0||e.filters&&Object.keys(e.filters).length>0||e.conditionFilters&&Object.keys(e.conditionFilters).length>0||e.filterOptionValues&&Object.keys(e.filterOptionValues).length>0||e.sort||typeof e.bql=="string"||Array.isArray(e.bqlHistory)&&e.bqlHistory.length>0||typeof e.pageSize=="number"))}function wl(e){return`${hu}${e}`}function Zn(e){try{const r=window.localStorage.getItem(wl(e));if(!r)return null;const n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}}function vu(e,r){try{window.localStorage.setItem(wl(e),JSON.stringify(r))}catch{}}function xu(e,r){if(e===!0)return{...xl};if(e===!1)return{layout:!1,filters:!1,sort:!1,bql:!1,pagination:!1};if(r&&e==null)return{...xl};const n={...bu,...e??{}};return r&&(typeof e!="object"||e.pagination!==!1)&&(n.pagination=!0),n}function Nl(...e){return e.reduce((r,n)=>({...r,...n??{}}),{})}function co(e,r,n){return typeof e!="number"||e<=0?n:gn(r).includes(e)?e:n}function bn(e){if(!e||typeof e!="object")return!1;const r=e;return typeof r.key=="string"&&(r.dir==="asc"||r.dir==="desc")}function hn(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!Array.isArray(o))return[];const l=o.filter(i=>typeof i=="string");return l.length>0?[[a,l]]:[]});return Object.fromEntries(n)}function yu(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!Array.isArray(o))return[];const l=[...new Set(o.filter(i=>typeof i=="string"&&i.trim().length>0))];return l.length>0?[[a,l]]:[]});return Object.fromEntries(n)}function wu(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=Object.entries(e).flatMap(([a,o])=>{if(!r.has(a)||!o||typeof o!="object")return[];const l=Object.fromEntries(Object.entries(o).flatMap(([i,c])=>typeof i=="string"&&i.trim()&&typeof c=="string"&&c.trim()?[[i,c]]:[]));return Object.keys(l).length>0?[[a,l]]:[]});return Object.fromEntries(n)}function pn(e,r){if(!e||typeof e!="object"||Array.isArray(e))return{};const n=new Set(Kn.map(o=>o.value)),a=Object.entries(e).flatMap(([o,l])=>{if(!r.has(o)||!l||typeof l!="object")return[];const i=l;return!i.operator||!n.has(i.operator)?[]:[[o,{operator:i.operator,value:typeof i.value=="string"?i.value:"",valueTo:typeof i.valueTo=="string"?i.valueTo:""}]]});return Object.fromEntries(a)}function Tt(e,r){if(wr(e))return gu;const n=e.minWidth??80,a=e.maxWidth??1/0;return Math.min(a,Math.max(n,r))}function Nu(e){const r=window.getComputedStyle(e);return parseFloat(r.paddingLeft)+parseFloat(r.paddingRight)}function wr(e){return e.key==="actions"||e.key==="acciones"?!0:typeof e.header=="string"&&e.header.trim().toLowerCase()==="acciones"}function uo(e){return e.sticky===!0}function kl(e){return!(e.reorderable===!1||e.sticky&&e.reorderable!==!0)}function Qn(e,r){const a=[...e.filter(o=>r.includes(o))];for(let o=0;o<r.length;o+=1){const l=r[o];if(a.includes(l))continue;let i=a.length;for(let c=o-1;c>=0;c-=1){const f=r[c],d=a.indexOf(f);if(d!==-1){i=d+1;break}}if(i===a.length)for(let c=o+1;c<r.length;c+=1){const f=r[c],d=a.indexOf(f);if(d!==-1){i=d;break}}a.splice(i,0,l)}return a}function sr(e,r){const n=r.filter(uo).map(i=>i.key);if(n.length===0)return e;const a=new Set(n),o=n.filter(i=>e.includes(i)),l=e.filter(i=>!a.has(i));return[...o,...l]}function ku(e,r){if(r<=7)return Array.from({length:r},(a,o)=>o+1);const n=[1];e>3&&n.push("...");for(let a=Math.max(2,e-1);a<=Math.min(r-1,e+1);a++)n.push(a);return e<r-2&&n.push("..."),n.push(r),n}function lr(e,r){var i;const n=new Set(r.filter(c=>c.hideable!==!1).map(c=>c.key)),a=Array.from(new Set(e??[])).filter(c=>n.has(c));if(r.filter(c=>!a.includes(c.key)).length>0)return a;const l=(i=r.find(c=>c.hideable!==!1))==null?void 0:i.key;return l?a.filter(c=>c!==l):[]}function Su(e){return e==null||e===""?"(Vacio)":e instanceof Date?e.toLocaleDateString():String(e)}function Or(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Or).join(" ").trim():s.isValidElement(e)?Or(e.props.children):""}function Jn(e,r){const n=e.filterValue?e.filterValue(r):e.sortKey?r[e.sortKey]:e.cell(r);return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||n===null||n===void 0||n instanceof Date?Su(n):Or(n).trim()}function mn(e){const r=e.replace(/,/g,"").trim();if(!r)return null;const n=Number(r);return Number.isFinite(n)?n:null}function Hr(e,r){const n=mn(e),a=mn(r);return n!==null&&a!==null?n-a:e.localeCompare(r,void 0,{numeric:!0,sensitivity:"base"})}function gn(e){const r=Array.from(new Set(e.map(n=>Math.floor(n)).filter(n=>Number.isFinite(n)&&n>0)));return r.length>0?r:fn()}function Cu(e,r,n){var i,c;const a=((i=r.value)==null?void 0:i.trim())??"",o=((c=r.valueTo)==null?void 0:c.trim())??"",l=Kn.find(f=>f.value===r.operator);if((l==null?void 0:l.valueMode)==="single"&&!a||(l==null?void 0:l.valueMode)==="between"&&(!a||!o))return!0;switch(r.operator){case"equals":return e.toLowerCase()===a.toLowerCase();case"notEquals":return e.toLowerCase()!==a.toLowerCase();case"greaterThan":return Hr(e,a)>0;case"greaterThanOrEqual":return Hr(e,a)>=0;case"lessThan":return Hr(e,a)<0;case"lessThanOrEqual":return Hr(e,a)<=0;case"between":return Hr(e,a)>=0&&Hr(e,o)<=0;case"top10":case"bottom10":{const d=n.map(b=>({value:b,number:mn(b)})).filter(b=>b.number!==null).sort((b,u)=>b.number-u.number).map(b=>b.value);return(r.operator==="top10"?d.slice(-10):d.slice(0,10)).includes(e)}case"aboveAverage":case"belowAverage":{const f=n.map(mn).filter(b=>b!==null);if(f.length===0)return!1;const d=f.reduce((b,u)=>b+u,0)/f.length,h=mn(e);return h===null?!1:r.operator==="aboveAverage"?h>d:h<d}default:return!0}}function Sl({children:e,className:r="",style:n}){return t.jsx(Xt,{onlyWhenOverflow:!0,className:r,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,...n},children:e})}function fo({columns:e,data:r,getRowId:n,loading:a=!1,skeletonRows:o=8,emptyIcon:l,emptyText:i="Sin resultados",initialEmptyDelay:c=450,onRowClick:f,renderExpandedRow:d,getRowCanExpand:h,expandedRowIds:b,defaultExpandedRowIds:u=[],onExpandedRowIdsChange:p,expandOnRowClick:g=!1,selected:w,onToggleOne:v,onToggleAll:E,getRowSelectable:y,highlightSelected:T=!0,rowClassName:L,getRowCategory:C,stickyHeader:m=!0,pageSize:S=25,pageSizeOptions:N,pageSizeSelectWidth:_=62,pageSizeSelectHeight:U=30,pageSizeSelectPadding:K="0 7px",totalRows:D,page:Z,onPageChange:O,onPageSizeChange:ne,storageKey:ee,stickyFirstColumn:fe=!1,bottomOffset:J=0,compact:W=!0,restrictHeight:R=!0,maxHeight:$,minTableWidth:P,enableColumnVisibility:ue=!0,enableColumnFilters:z=!0,hiddenColumnKeys:se,defaultHiddenColumnKeys:q=mu,onHiddenColumnKeysChange:k,columnVisibilityLabel:V="Columnas",enableBql:M=!1,bqlValue:Y,defaultBqlValue:ce="",onBqlChange:X,bqlDescription:G="Filtra registros con Bonsaif Query Language",bqlPlaceholder:I=`status = activo
2
2
  rol IN (admin, employee)`,bqlQuickFilters:le=[],bqlExamples:be=[],bqlSuggestions:ie=[],bqlActiveFilters:ge,bqlError:$e,onQueryChange:De,persistState:kt,onPreferencesReady:wt,enableExport:re=!1,exportFilename:xe="datos",onExportCsv:oe,onExportPdf:we}){var md;const ae=xu(kt,ee),Fe=Object.values(ae).some(Boolean),qe=e.map(x=>x.key).join(","),Je=q.join(","),Ze=s.useRef(e),Ue=s.useRef(q);Ze.current=e,Ue.current=q;const[tt,Ct]=s.useState(!ee||!Fe),xt=s.useRef(null),Et=s.useRef(!ee),ve=s.useRef(!1),ke=s.useRef(wt);ke.current=wt;const _e=s.useRef(!ee||!Fe?ee??"__none__":null),je=se!==void 0,[Re,ot]=s.useState(()=>lr(q,e)),lt=lr(je?se:Re,e),[rt,dt]=s.useState(!1),[st,Sr]=s.useState("filter"),[ht,Cr]=s.useState(null),[Ft,Ye]=s.useState(""),[pt,hr]=s.useState({}),[Mt,qt]=s.useState({}),Er=s.useRef({}),pr=s.useRef({});function tn(x,H){if(!x)return;const Q=yu(x.filterOptionValues,H),B=wu(x.filterOptionLabels,H);Object.keys(Q).length>0&&(Er.current={...Er.current,...Q}),Object.keys(B).length>0&&(pr.current={...pr.current,...B})}const j=b!==void 0,[te,me]=s.useState(u),pe=Y!==void 0,[ye,Se]=s.useState(ce),ze=pe?Y:ye,[Te,it]=s.useState(ze),[Ve,mt]=s.useState(!1),[ut,gt]=s.useState(!1),[nr,Ut]=s.useState(!1),[Ot,ar]=s.useState([]),mr=s.useRef(null),Ht=s.useRef(null),yt=s.useRef(null),Qt=s.useRef(X);Qt.current=X;const Da=s.useRef(S);Da.current=S;const Ia=s.useRef(N);Ia.current=N;const $m=Array.isArray(N)?N.join(","):"",us=s.useRef(null),jc=s.useRef(null),fs=s.useRef(null),qc=s.useRef(0),[Dm,Im]=s.useState({}),[Fm,Om]=s.useState({}),[Dn,Fa]=s.useState(!1),bs=s.useRef(null),Oa=s.useRef(null),[Hm,Bm]=s.useState({}),Uc=s.useRef(null),In=s.useRef(null),[hs,Vc]=s.useState(r.length>0||a||c===!1),Xc=(x,H)=>50+(x*17+H*13+7)%40,Bt=s.useRef(null),[Pm,_m]=s.useState(void 0),[Yc,zm]=s.useState(0),[Wm,jm]=s.useState(!1);s.useEffect(()=>{function x(){jm(window.innerWidth<640)}if(!R||$!==void 0)return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x);const Q=S!==!1?48:0,B=12;function de(){if(x(),!Bt.current)return;const Ee=Bt.current.getBoundingClientRect().top;_m(Math.max(120,window.innerHeight-Ee-Q-B-J))}de(),window.addEventListener("resize",de);const he=typeof ResizeObserver<"u"&&Bt.current?new ResizeObserver(()=>de()):null;return Bt.current&&he&&he.observe(Bt.current),()=>{window.removeEventListener("resize",de),he==null||he.disconnect()}},[a,S,J,R,$,tt,r.length]);const Gc=R?$??Pm:void 0;s.useEffect(()=>{const x=Bt.current;if(!x)return;const H=()=>zm(x.clientWidth);if(H(),typeof ResizeObserver>"u")return window.addEventListener("resize",H),()=>window.removeEventListener("resize",H);const Q=new ResizeObserver(H);return Q.observe(x),()=>Q.disconnect()},[a,tt,r.length]),s.useEffect(()=>{if(c===!1||a||r.length>0){Vc(!0);return}if(hs)return;const x=window.setTimeout(()=>{Vc(!0)},c);return()=>window.clearTimeout(x)},[r.length,c,hs,a]);const[rn,nn]=s.useState(()=>sr(e.map(x=>x.key),e)),[Mr,an]=s.useState(()=>Object.fromEntries(e.map(x=>[x.key,Tt(x,tr(x.width))]))),[nt,Tr]=s.useState(null),[qm,Ha]=s.useState(1),[Ba,Pa]=s.useState(S===!1?0:S);s.useEffect(()=>{var Be;const x=Ze.current,H=Ue.current,Q=x.map(Ae=>Ae.key),B=new Set(Q),de=()=>{var Ae;ve.current||(ve.current=!0,(Ae=ke.current)==null||Ae.call(ke))};if(!ee||!Fe){ae.layout&&nn(sr(Q,x)),je||ot(lr(H,x)),Et.current=!1,Ct(!0),de();return}let he=!1;const Ee=_e.current===ee;Ee||(Et.current=!1,Ct(!1),ve.current=!1);const Ie=Zn(ee);if(yl(Ie)&&!Ee){const Ae=Ie,Me=gn(Ia.current??fn()),Le=Da.current,$r=Le===!1?0:Le,vr=ae.layout?Ae==null?void 0:Ae.columnOrder:void 0,Dr=Array.isArray(vr)?vr.filter(et=>Q.includes(et)):[],Ir=sr(Dr.length>0?Qn(Dr,Q):Q,x),Fr=Object.fromEntries(x.map(et=>[et.key,Tt(et,tr(et.width))])),ln=ae.layout?(Ae==null?void 0:Ae.columnWidths)??{}:{},Pn=Object.fromEntries(x.map(et=>[et.key,Tt(et,ln[et.key]??Fr[et.key])])),cn=lr(ae.layout?(Ae==null?void 0:Ae.hiddenColumnKeys)??H:H,x);if(ae.layout&&(nn(Ir),an(Pn)),je||ot(cn),ae.filters&&Ht.current!==ee&&(Ht.current=ee,tn(Ae,B),hr(hn(Ae==null?void 0:Ae.filters,B)),qt(pn(Ae==null?void 0:Ae.conditionFilters,B))),ae.sort){const et=bn(Ae==null?void 0:Ae.sort)?Ae.sort:null;Tr(et&&B.has(et.key)?et:null)}if(ae.bql){if(mr.current!==ee){mr.current=ee;const et=typeof(Ae==null?void 0:Ae.bql)=="string"?Ae.bql:ce;pe?(Be=Qt.current)==null||Be.call(Qt,et):Se(et)}ar(Array.isArray(Ae==null?void 0:Ae.bqlHistory)?Ae.bqlHistory.filter(et=>typeof et=="string"):[])}ae.pagination&&yt.current!==ee&&(yt.current=ee,Pa(co(Ae==null?void 0:Ae.pageSize,Me,$r))),_e.current=ee,Ct(!0),de()}const He=`${io()??"/api/user/preferences/datatables"}?key=${encodeURIComponent(ee)}`,Ge=new AbortController,Ce=window.setTimeout(()=>Ge.abort(),2500);return fetch(He,{cache:"no-store",signal:Ge.signal}).then(Ae=>Ae.ok?Ae.json():null).then(Ae=>{var gd;if(he)return;const Me=Zn(ee),Le=Nl(yl(Ae==null?void 0:Ae.settings)?Ae==null?void 0:Ae.settings:null,Me),$r=gn(Ia.current??fn()),vr=Da.current,Dr=vr===!1?0:vr,Ir=ae.layout?Le==null?void 0:Le.columnOrder:void 0,Fr=Array.isArray(Ir)?Ir.filter(ft=>Q.includes(ft)):[],ln=sr(Fr.length>0?Qn(Fr,Q):Q,x),Pn=Object.fromEntries(x.map(ft=>[ft.key,Tt(ft,tr(ft.width))])),cn=ae.layout?(Le==null?void 0:Le.columnWidths)??{}:{},et=Object.fromEntries(x.map(ft=>[ft.key,Tt(ft,cn[ft.key]??Pn[ft.key])])),dn=lr(ae.layout?(Le==null?void 0:Le.hiddenColumnKeys)??H:H,x);if(ae.layout&&(nn(ln),an(et)),je||ot(dn),ae.filters&&Ht.current!==ee&&(Ht.current=ee,tn(Le,B),hr(hn(Le==null?void 0:Le.filters,B)),qt(pn(Le==null?void 0:Le.conditionFilters,B))),ae.sort){const ft=bn(Le==null?void 0:Le.sort)?Le.sort:null;Tr(ft&&B.has(ft.key)?ft:null)}if(ae.bql){if(mr.current!==ee){mr.current=ee;const ft=typeof(Le==null?void 0:Le.bql)=="string"?Le.bql:ce;pe?(gd=Qt.current)==null||gd.call(Qt,ft):Se(ft)}ar(Array.isArray(Le==null?void 0:Le.bqlHistory)?Le.bqlHistory.filter(ft=>typeof ft=="string"):[])}let at;ae.pagination&&(at=co(Le==null?void 0:Le.pageSize,$r,Dr),yt.current!==ee&&(yt.current=ee,Pa(at))),xt.current=JSON.stringify({columnOrder:ln,columnWidths:et,hiddenColumnKeys:dn,filters:hn(Le==null?void 0:Le.filters,B),conditionFilters:pn(Le==null?void 0:Le.conditionFilters,B),sort:bn(Le==null?void 0:Le.sort)?Le.sort:null,bql:typeof(Le==null?void 0:Le.bql)=="string"?Le.bql:"",bqlHistory:Array.isArray(Le==null?void 0:Le.bqlHistory)?Le.bqlHistory:[],pageSize:ae.pagination&&vr!==!1?at:void 0}),Et.current=!0}).catch(()=>{var Ae;if(!he){const Me=Zn(ee),Le=gn(Ia.current??fn()),$r=Da.current,vr=$r===!1?0:$r,Dr=ae.layout?Me==null?void 0:Me.columnOrder:void 0,Ir=Array.isArray(Dr)?Dr.filter(at=>Q.includes(at)):[],Fr=sr(Ir.length>0?Qn(Ir,Q):Q,x),ln=Object.fromEntries(x.map(at=>[at.key,Tt(at,tr(at.width))])),Pn=ae.layout?(Me==null?void 0:Me.columnWidths)??{}:{},cn=Object.fromEntries(x.map(at=>[at.key,Tt(at,Pn[at.key]??ln[at.key])]));ae.layout&&(nn(Fr),an(cn));const et=lr(ae.layout?(Me==null?void 0:Me.hiddenColumnKeys)??H:H,x);if(je||ot(et),ae.filters&&Ht.current!==ee&&(Ht.current=ee,tn(Me,B),hr(hn(Me==null?void 0:Me.filters,B)),qt(pn(Me==null?void 0:Me.conditionFilters,B))),ae.sort){const at=bn(Me==null?void 0:Me.sort)?Me.sort:null;Tr(at&&B.has(at.key)?at:null)}if(ae.bql){if(mr.current!==ee){mr.current=ee;const at=typeof(Me==null?void 0:Me.bql)=="string"?Me.bql:ce;pe?(Ae=Qt.current)==null||Ae.call(Qt,at):Se(at)}ar(Array.isArray(Me==null?void 0:Me.bqlHistory)?Me.bqlHistory.filter(at=>typeof at=="string"):[])}let dn;ae.pagination&&(dn=co(Me==null?void 0:Me.pageSize,Le,vr),yt.current!==ee&&(yt.current=ee,Pa(dn))),xt.current=JSON.stringify({columnOrder:Fr,columnWidths:cn,hiddenColumnKeys:et,filters:hn(Me==null?void 0:Me.filters,B),conditionFilters:pn(Me==null?void 0:Me.conditionFilters,B),sort:bn(Me==null?void 0:Me.sort)?Me.sort:null,bql:typeof(Me==null?void 0:Me.bql)=="string"?Me.bql:"",bqlHistory:Array.isArray(Me==null?void 0:Me.bqlHistory)?Me.bqlHistory:[],pageSize:ae.pagination&&$r!==!1?dn:void 0}),Et.current=!0}}).finally(()=>{window.clearTimeout(Ce),he||(_e.current=ee,Ct(!0),de())}),()=>{he=!0,Ge.abort(),window.clearTimeout(Ce)}},[ee,Fe,qe,Je,je,ae.layout,ae.filters,ae.sort,ae.bql,ae.pagination,pe,ce,$m]),s.useEffect(()=>{if(!ee||!tt||!Fe||!Et.current)return;const x={};ae.layout&&(x.columnOrder=rn,x.columnWidths=Mr,x.hiddenColumnKeys=lt),ae.filters&&(x.filters=pt,x.conditionFilters=Mt,x.filterOptionValues=Er.current,x.filterOptionLabels=pr.current),ae.sort&&(x.sort=nt),ae.bql&&(x.bql=ze,x.bqlHistory=Ot),ae.pagination&&S!==!1&&(x.pageSize=Ba);const H=Zn(ee),Q=Nl(H,x),B=JSON.stringify(Q);if(B===xt.current)return;vu(ee,Q),xt.current=B;const de=window.setTimeout(()=>{const he=io()??"/api/user/preferences/datatables";fetch(he,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:ee,settings:Q})}).then(()=>{}).catch(()=>{})},300);return()=>window.clearTimeout(de)},[rn,Mr,lt,pt,Mt,nt,ze,Ot,Ba,S,ee,tt,Fe,ae.layout,ae.filters,ae.sort,ae.bql,ae.pagination,r]),s.useEffect(()=>{nn(x=>{const H=e.map(Q=>Q.key);return sr(Qn(x,H),e)})},[qe,e]);const Kc=sr(rn,e).map(x=>e.find(H=>H.key===x)).filter(x=>!!x),Pt=Kc.filter(x=>!lt.includes(x.key)),Zc=e.some(uo),Um=Object.keys(pt).length,Vm=Object.keys(Mt).length,ps=Um+Vm;function ms(x){var Ie;const H=!!(O&&ne),Q=new Map,B=(Ne,We)=>{const He=Ne.trim();if(!He)return;const Ge=(We??He).trim()||He;Q.has(He)?We!=null&&We.trim()&&Q.get(He)===He&&Q.set(He,Ge):Q.set(He,Ge)};for(const Ne of x.filterOptions??[])typeof Ne=="string"?B(Ne):Ne!=null&&Ne.value&&B(Ne.value,Ne.label);if(H){const Ne=pr.current[x.key]??{};for(const We of Er.current[x.key]??[])B(We,Ne[We])}for(const Ne of r){const We=Jn(x,Ne),He=((Ie=x.filterOptionLabel)==null?void 0:Ie.call(x,Ne))??void 0;B(We,He??void 0)}for(const Ne of pt[x.key]??[])B(Ne);const de=Ne=>/^[a-f\d]{24}$/i.test(Ne.trim()),he=new Map;for(const[Ne,We]of Q){const He=We.trim().toLowerCase(),Ge=he.get(He)??[];Ge.push(Ne),he.set(He,Ge)}for(const Ne of he.values()){if(Ne.length<2)continue;const We=Ne.find(de)??Ne.slice().sort((He,Ge)=>He.localeCompare(Ge))[0];for(const He of Ne)He!==We&&Q.delete(He)}const Ee=Array.from(Q.keys()).sort((Ne,We)=>{const He=Q.get(Ne)??Ne,Ge=Q.get(We)??We;return He.localeCompare(Ge,void 0,{numeric:!0,sensitivity:"base"})});return H&&(Er.current[x.key]=Ee,pr.current[x.key]=Object.fromEntries(Q.entries())),Ee.map(Ne=>({value:Ne,label:Q.get(Ne)??Ne}))}function Xm(){const x=e.find(H=>H.key===ht);return x?ms(x):[]}function Ym(x){return!!(z&&!wr(x)&&(x.filterValue||x.sortKey||ms(x).length>0))}function gs(x,H){hr(Q=>{const B={...Q};return B[x]=H,B})}function Gm(x,H,Q,B){const de=pt[x]??[],he=B?de.includes(H)?de.filter(Ie=>Ie!==H):[...de,H]:[H];Q.length>0&&he.length===Q.length&&Q.every(Ie=>he.includes(Ie))?_a(x):gs(x,he)}function _a(x){hr(H=>{const Q={...H};return delete Q[x],Q})}function za(x,H){qt(Q=>{const B={...Q};return H?B[x]=H:delete B[x],B})}function Qc(x){za(x,null)}function Km(){hr({}),qt({})}function Zm(x){pe||Se(x),X==null||X(x)}function Jc(x){const H=x.trim();it(H),(X==null?void 0:X(H))!==!1&&(pe||Se(H),mt(!1),gt(!1),Ut(!1),H&&ar(B=>[H,...B.filter(de=>de!==H)].slice(0,fu)))}function Rc(){it(""),Zm(""),mt(!1),gt(!1),Ut(!1)}function vs(x,H){it(x),H&&(H.style.height="auto",H.style.height=`${Math.min(H.scrollHeight,180)}px`)}function Wa(x){const H=x.trim();if(!H)return;qc.current=Date.now()+500;const Q=Te.replace(/\s+$/u,""),B=Q.length===0?H:Q.split(`
3
3
  `).map(de=>de.trim()).includes(H)?Q:`${Q}
4
4
  ${H}`;vs(B,fs.current??void 0),requestAnimationFrame(()=>{const de=fs.current;if(!de)return;de.focus();const he=de.value.length;de.setSelectionRange(he,he),vs(de.value,de)})}s.useEffect(()=>{it(ze)},[ze]);const ja=s.useCallback(()=>{const x=us.current;if(!x)return;const H=x.getBoundingClientRect(),Q=12,B=8,de=Math.min(780,Math.max(320,window.innerWidth-32)),he=Math.max(Q,window.innerWidth-de-Q),Ee=Math.min(Math.max(Q,H.left),he),Ie=H.bottom+B,Ne=window.innerHeight-H.top+B,We=window.innerHeight-Ie-Q,He=H.top-Q-B,Ge=We<280&&He>We,Ce=Math.max(240,Ge?He:We);Im({position:"fixed",zIndex:1e4,left:Ee,top:Ge?void 0:Ie,bottom:Ge?Ne:void 0,width:de,maxWidth:"calc(100vw - 24px)",maxHeight:Ce,overflowY:"auto"})},[]);s.useEffect(()=>{if(!Ve)return;function x(B){var he,Ee;if(Date.now()<qc.current)return;const de=B.target;(he=us.current)!=null&&he.contains(de)||(Ee=jc.current)!=null&&Ee.contains(de)||(mt(!1),gt(!1),Ut(!1))}function H(B){B.key==="Escape"&&(mt(!1),gt(!1),Ut(!1))}function Q(){ja()}return ja(),document.addEventListener("mousedown",x),window.addEventListener("keydown",H),window.addEventListener("resize",Q),window.addEventListener("scroll",Q,!0),()=>{document.removeEventListener("mousedown",x),window.removeEventListener("keydown",H),window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q,!0)}},[Ve,ja]);function ed(x){const H=lr(x,e);je||ot(H),k==null||k(H)}function Qm(x){ed(lt.includes(x)?lt.filter(H=>H!==x):[...lt,x])}function Jm(){ed([])}const qa=s.useCallback(x=>{var de;if(x!=null&&x.isConnected)return x;if(!ht)return null;const Q=`[role="columnheader"][data-dt-column-key="${typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(ht):ht.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"] button[aria-haspopup="menu"]`,B=((de=Bt.current)==null?void 0:de.querySelector(Q))??document.querySelector(Q);return B&&(In.current=B),B},[ht]),Fn=s.useCallback((x=In.current)=>{const H=qa(x);if(!H)return;const B=(H.closest("th")??H.closest("[role='columnheader']")??H.closest("[data-dt-column-key]")??H).getBoundingClientRect();if(B.width<1&&B.height<1||B.bottom<0||B.top>window.innerHeight)return;const de=Math.min(292,Math.max(240,window.innerWidth-16)),he=8,Ee=Math.max(he,window.innerWidth-de-he),Ie=Math.min(Math.max(he,B.left),Ee),Ne=window.innerHeight-B.bottom,We=B.bottom+6,He=window.innerHeight-B.top+6,Ce=Ne<360&&B.top>Ne?void 0:We,Be=Ce===void 0?He:void 0,Ae=Math.max(220,Ce===void 0?B.top-16:window.innerHeight-We-8),Me={position:"fixed",zIndex:9999,left:Ie,top:Ce,bottom:Be,width:de,maxWidth:"calc(100vw - 16px)",maxHeight:Ae,"--dt-column-menu-max-height":`${Ae}px`};Om(Me)},[qa]);function td(x,H,Q=null){x.preventDefault(),x.stopPropagation();const B=In.current===x.currentTarget&&st===H&&ht===Q;if(rt&&B){dt(!1),Cr(null);return}if(In.current=x.currentTarget,Sr(H),Cr(Q),Ye(""),H==="filter"&&Q){const de=e.find(Ee=>Ee.key===Q),he=pt[Q];if(de&&(he!=null&&he.length)){const Ee=ms(de),Ie=new Map(Ee.map(He=>[He.label.trim().toLowerCase(),He.value])),Ne=[...new Set(he.map(He=>Ee.some(Ge=>Ge.value===He)?He:Ie.get(He.trim().toLowerCase())??He))];(Ne.length!==he.length||Ne.some((He,Ge)=>He!==he[Ge]))&&(Ee.length>0&&Ne.length===Ee.length&&Ee.every(He=>Ne.includes(He.value))?_a(Q):gs(Q,Ne))}}Fn(x.currentTarget),dt(!0)}function Rm(x){if(wr(x))return;const H=Bt.current;if(!H)return;const B=Array.from(H.querySelectorAll("[data-dt-column-key]")).filter(de=>de.dataset.dtColumnKey===x.key).reduce((de,he)=>{const Ee=he.querySelector("[data-dt-autofit-content]"),Ie=Ee?Ee.scrollWidth:Math.max(he.scrollWidth,he.offsetWidth);return Math.max(de,Math.ceil(Ie+Nu(he)))},0);B<=0||an(de=>({...de,[x.key]:Tt(x,B+12)}))}s.useEffect(()=>{an(x=>{const H=Object.fromEntries(e.map(Q=>[Q.key,Tt(Q,tr(Q.width))]));return Object.fromEntries(e.map(Q=>[Q.key,Tt(Q,x[Q.key]??H[Q.key])]))})},[qe,e]),s.useEffect(()=>{je||ot(x=>lr(x,e))},[qe,e,je]),s.useEffect(()=>{function x(B){var Ie;const de=B.target,he=B.target;if(he!=null&&he.closest("[data-bonsaif-select-dropdown='true']"))return;const Ee=qa(In.current);!((Ie=Uc.current)!=null&&Ie.contains(de))&&!(Ee!=null&&Ee.contains(de))&&(dt(!1),Cr(null))}function H(B){B.key==="Escape"&&(dt(!1),Cr(null))}function Q(){Fn()}return rt&&(document.addEventListener("mousedown",x),window.addEventListener("keydown",H),window.addEventListener("resize",Q),window.addEventListener("scroll",Q,!0)),()=>{document.removeEventListener("mousedown",x),window.removeEventListener("keydown",H),window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q,!0)}},[rt,qa,Fn]),s.useLayoutEffect(()=>{!rt||!ht||Fn()},[rt,ht,pt,Mt,r,Fn]);const On=s.useRef(null);s.useEffect(()=>{function x(Q){const B=On.current;if(!B)return;const de=Q.clientX-B.startX,he=e.find(Ee=>Ee.key===B.colKey);he&&an(Ee=>({...Ee,[B.colKey]:Tt(he,B.startWidth+de)}))}function H(){On.current&&(On.current=null,document.body.style.cursor="",document.body.style.userSelect="")}return document.addEventListener("pointermove",x),document.addEventListener("pointerup",H),()=>{document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",H)}},[e]);const Hn=s.useRef(null),[rd,xs]=s.useState(null);function eg(x,H){const Q=e.find(B=>B.key===x);if(!Q||!kl(Q)){H.preventDefault();return}Hn.current=rn.indexOf(x),H.dataTransfer.effectAllowed="move"}function tg(x,H){H.preventDefault(),H.dataTransfer.dropEffect="move";const Q=rn.indexOf(x);rd!==Q&&xs(Q)}function rg(x,H){H.preventDefault();const Q=Hn.current,B=rn.indexOf(x);Q!==null&&Q!==B&&nn(de=>{const he=[...de],[Ee]=he.splice(Q,1);return he.splice(B,0,Ee),sr(he,e)}),Hn.current=null,xs(null)}function ng(){Hn.current=null,xs(null)}function ag(x){x.sortKey&&Tr(H=>(H==null?void 0:H.key)===x.key?{key:x.key,dir:H.dir==="asc"?"desc":"asc"}:{key:x.key,dir:"asc"})}s.useEffect(()=>{Ha(1)},[r]),s.useEffect(()=>{Ha(1)},[Mt,pt]);const Jt=!!(O&&ne),gr=S!==!1,ys=s.useMemo(()=>gn(N??fn()),[N]),Nt=Jt?Z??1:qm,nd=gr&&Ba<1?typeof S=="number"&&S>0?S:ys[0]??25:Ba,Rt=Jt||gr?nd:r.length,Vt=!!w&&!!v&&!!E,ws=s.useMemo(()=>y?r.filter(x=>y(x)):r,[r,y]),on=!!d,ad=s.useMemo(()=>new Set(j?Array.from(b??[]):te),[j,b,te]),og=(on?40:0)+(Vt?40:0),Ns=!Wm&&(Zc||fe),Ua=(()=>{if(!Ns)return{};let x=og;const H={};return Pt.forEach((Q,B)=>{(uo(Q)||!Zc&&fe&&B===0)&&(H[Q.key]=x,x+=Mr[Q.key]??Tt(Q,tr(Q.width)))}),H})(),ks=Object.keys(Ua),Ss=ks.length>0?ks[ks.length-1]:null,od=Vt&&ws.length>0&&ws.every(x=>w.has(n(x))),sg=Vt&&w.size>0&&ws.some(x=>w.has(n(x)))&&!od,Va=s.useMemo(()=>{if(Jt)return r;const x=Object.entries(pt),H=Object.entries(Mt);return x.length===0&&H.length===0?r:r.filter(Q=>x.every(([B,de])=>{const he=e.find(Ee=>Ee.key===B);return he?de.includes(Jn(he,Q)):!0})&&H.every(([B,de])=>{const he=e.find(Ie=>Ie.key===B);if(!he)return!0;const Ee=r.map(Ie=>Jn(he,Ie));return Cu(Jn(he,Q),de,Ee)}))},[Mt,pt,e,r,Jt]),Ar=s.useMemo(()=>{if(!nt)return Va;const x=e.find(H=>H.key===nt.key&&H.sortKey);return x!=null&&x.sortKey?[...Va].sort((H,Q)=>{const B=H[x.sortKey],de=Q[x.sortKey],he=B===de?0:B==null?1:de==null||B<de?-1:1;return nt.dir==="asc"?he:-he}):Va},[Va,nt,e]),sd=s.useMemo(()=>{if(Jt||!gr)return Ar;const x=(Nt-1)*Rt;return Ar.slice(x,x+Rt)},[Ar,Jt,gr,Nt,Rt]),or=Jt?D??r.length:Ar.length,Cs=gr?Math.max(1,Math.ceil(or/Rt)):1,lg=Math.min(...ys),ig=gr&&(or>Rt||or>lg),cg=gr?(Nt-1)*Rt+1:1,dg=gr?Math.min(Nt*Rt,or):or;function Es(x){if(a)return;const H=Math.max(1,Math.min(x,Cs));Jt?O(H):Ha(H)}function ug(x){a||(ee&&(yt.current=ee),Pa(x),Jt?(ne(x),O(1)):(Ha(1),ne==null||ne(x)))}function ld(x){const H=new Set(ad);H.has(x)?H.delete(x):H.add(x);const Q=Array.from(H);j||me(Q),p==null||p(Q)}s.useEffect(()=>{De==null||De({bql:ze,filters:pt,conditionFilters:Mt,sort:nt,page:Nt,pageSize:Rt,hiddenColumnKeys:lt})},[ze,pt,Mt,nt,Nt,Rt,lt,De]);const id=x=>x==="center"?"justify-center text-center":x==="right"?"justify-end text-right":"justify-start text-left",fg="color-mix(in srgb, var(--primary) 6%, var(--bg-card))",Ms="linear-gradient(180deg, color-mix(in srgb, var(--bg-input) 90%, var(--bg-card)) 0%, color-mix(in srgb, var(--bg-input) 70%, var(--bg-card)) 100%)",Xe="color-mix(in srgb, var(--border) 62%, var(--bg-card))",Lr="color-mix(in srgb, var(--primary) 24%, var(--border))",Xa=`inset 0 0 0 1px ${Xe}`,cd=Pt.reduce((x,H)=>x+(Mr[H.key]??tr(H.width)),(on?40:0)+(Vt?40:0)),dd=typeof P=="number"?P:typeof P=="string"?Number(((md=P.match(/^(\d+(?:\.\d+)?)px$/))==null?void 0:md[1])??NaN):NaN,Bn=Number.isFinite(dd)?Math.max(cd,dd,Yc):Math.max(cd,Yc),Ya=P??Bn,sn=`${on?"40px ":""}${Vt?"40px ":""}${Pt.map(x=>`${Mr[x.key]??tr(x.width)}px`).join(" ")}`;s.useEffect(()=>{nt&&lt.includes(nt.key)&&Tr(null)},[lt,nt]);function ud(x){return x?typeof x=="string"?{key:x,label:x}:x:null}const Ga=()=>t.jsxs("div",{role:"row",className:"grid",style:{gridTemplateColumns:sn,background:Ms,borderBottom:`1px solid ${Lr}`},children:[on&&t.jsx("div",{role:"columnheader",className:`${W?"px-2 py-1.5":"px-3 py-2.5"} w-10`,style:{borderBottom:`1px solid ${Lr}`,borderRight:`1px solid ${Xe}`}}),Vt&&t.jsx("div",{role:"columnheader",className:`${W?"px-2 py-1.5":"px-3 py-2.5"} flex w-10 items-center justify-center`,style:Ns?{position:"sticky",left:0,zIndex:12,background:Ms,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:`inset 0 -1px 0 ${Lr}`,borderRight:`1px solid ${Xe}`}:{borderBottom:`1px solid ${Lr}`,borderRight:`1px solid ${Xe}`},children:t.jsx(Xn,{size:"sm",checked:od,indeterminate:sg,onChange:E,"aria-label":"Seleccionar todos",containerClassName:"items-center",className:"cursor-pointer"})}),Pt.map((x,H)=>{const Q=(nt==null?void 0:nt.key)===x.key,B=!!x.sortKey,de=wr(x),he=Ua[x.key],Ee=he!==void 0,Ie=x.key===Ss,Ne=kl(x),We=rd===H,Ge=(Mr[x.key]??tr(x.width))<120,Ce=Object.prototype.hasOwnProperty.call(pt,x.key)||Object.prototype.hasOwnProperty.call(Mt,x.key);return t.jsxs("div",{role:"columnheader","data-dt-column-key":x.key,className:`group select-none ${Ge?"text-left":id(x.align)}`,style:{...Ee?{position:"sticky",left:he,zIndex:12,background:Ms,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:Ie?`3px 0 6px -2px rgba(0,0,0,0.10), inset 0 -1px 0 ${Lr}`:`inset 0 -1px 0 ${Lr}`,borderRight:`1px solid ${Xe}`}:{position:"relative",borderBottom:`1px solid ${Lr}`,borderRight:`1px solid ${Xe}`},color:Q?"var(--primary)":"var(--text-muted)",whiteSpace:"nowrap",transition:"color 0.15s",borderLeft:We?"2px solid var(--primary)":"2px solid transparent",cursor:"default",padding:de?W?"7px 6px":"9px 8px":W?"8px 6px 10px":"10px 8px 12px"},onDragOver:Be=>{(Ne||Hn.current!==null)&&tg(x.key,Be)},onDrop:Be=>rg(x.key,Be),children:[t.jsxs("div",{className:`flex min-w-0 items-center gap-1 ${de?"justify-center":Ge?"justify-start":x.align==="center"?"justify-center":x.align==="right"?"justify-end":"justify-start"}`,children:[Ne?t.jsx("span",{draggable:!0,onDragStart:Be=>{Be.stopPropagation(),eg(x.key,Be)},onDragEnd:Be=>{Be.stopPropagation(),ng()},onClick:Be=>Be.stopPropagation(),title:"Arrastrar para mover columna","aria-label":"Arrastrar para mover columna",className:`absolute left-0 top-0 z-10 inline-flex h-full w-3 shrink-0 rounded-sm transition-colors duration-150 hover:bg-[var(--primary)]/15 ${We?"bg-[var(--primary)]/20":""}`,style:{cursor:"grab"}}):null,de?t.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-md text-[var(--text-muted)]",title:"Acciones","aria-label":"Acciones",children:t.jsx(F.HiCog6Tooth,{className:"h-3.5 w-3.5"})}):t.jsx(Sl,{className:"min-w-0 flex-1",children:t.jsx("span",{"data-dt-autofit-content":!0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wider ${W?"text-[11px]":"text-xs"}`,children:t.jsx("span",{className:"min-w-0 truncate",children:x.header})})}),B&&t.jsx("button",{type:"button","aria-label":`Ordenar por ${String(x.header)}`,title:"Ordenar",onClick:Be=>{Be.stopPropagation(),ag(x)},"data-dt-sort-button":!0,className:`absolute -bottom-2 left-1/2 z-20 inline-flex h-4 w-4 -translate-x-1/2 items-center justify-center rounded-full bg-[var(--primary)] text-[var(--primary-fg)] shadow-[0_1px_3px_rgba(15,23,42,0.22)] transition-[opacity,transform] duration-150 hover:scale-105 focus:scale-105 focus:opacity-100 focus:outline-none ${Q?"opacity-100":"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,style:{bottom:"-0.5rem",top:"auto"},children:Q?nt.dir==="asc"?t.jsx(F.HiChevronUp,{className:"h-3 w-3"}):t.jsx(F.HiChevronDown,{className:"h-3 w-3"}):t.jsx(F.HiChevronUpDown,{className:"h-3 w-3"})}),z&&!de&&Ym(x)&&t.jsx("button",{type:"button","aria-haspopup":"menu","aria-expanded":rt&&ht===x.key,"aria-label":`Filtrar ${String(x.header)}`,title:"Filtrar",onClick:Be=>td(Be,"filter",x.key),className:`inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm bg-transparent text-[var(--text-muted)] opacity-0 transition-[opacity,color,background-color] duration-150 hover:bg-[var(--bg-card)] hover:text-[var(--primary)] focus:bg-[var(--bg-card)] focus:text-[var(--primary)] focus:opacity-100 group-hover:opacity-100 ${rt&&st==="filter"&&ht===x.key?"bg-[var(--bg-card)] text-[var(--primary)] opacity-100":Ce?"text-[var(--primary)] opacity-100":""}`,children:Ce?t.jsx(F.HiFunnel,{className:"h-3.5 w-3.5"}):t.jsx(F.HiEllipsisVertical,{className:"h-3.5 w-3.5"})})]}),!de&&t.jsx("span",{role:"separator","aria-orientation":"vertical",title:"Arrastrar para redimensionar. Doble click para autoajustar",onPointerDown:Be=>{Be.preventDefault(),Be.stopPropagation(),On.current={colKey:x.key,startX:Be.clientX,startWidth:Mr[x.key]??150},document.body.style.cursor="col-resize",document.body.style.userSelect="none"},onDoubleClick:Be=>{Be.preventDefault(),Be.stopPropagation(),On.current=null,document.body.style.cursor="",document.body.style.userSelect="",Rm(x)},onClick:Be=>Be.stopPropagation(),className:"absolute top-0 flex h-full items-center justify-center opacity-0 transition-opacity duration-200 hover:opacity-100",style:{right:0,width:12,cursor:"col-resize",zIndex:6,transform:"translateX(50%)"},children:t.jsxs("span",{style:{display:"flex",gap:4,alignItems:"center",height:"calc(100% - 8px)"},children:[t.jsx("span",{style:{width:2,height:"100%",borderRadius:2,background:"var(--primary)",display:"block"}}),t.jsx("span",{style:{width:2,height:"100%",borderRadius:2,background:"var(--primary)",display:"block"}})]})})]},x.key)})]}),Ka=()=>{if(!rt||typeof document>"u"||st==="visibility"&&!ue||st==="filter"&&!z)return null;const x=e.find(Ce=>Ce.key===ht),H=Xm(),Q=x?Object.prototype.hasOwnProperty.call(pt,x.key):!1,B=x?Mt[x.key]:void 0,de=Kn.find(Ce=>Ce.value===(B==null?void 0:B.operator)),he=x?pt[x.key]??[]:[],Ee=Ft.trim().toLowerCase(),Ie=Ee?H.filter(Ce=>Ce.label.toLowerCase().includes(Ee)):H,Ne=x&&H.length>0&&(!Q||he.length===H.length),We=x&&Q&&he.length>0&&he.length<H.length,He=lt.length,Ge=()=>{x&&(_a(x.key),Qc(x.key))};return bt.createPortal(t.jsx("div",{ref:Uc,role:"menu",className:"overflow-hidden rounded-lg border p-1 shadow-xl",style:{...Fm,borderColor:"var(--border)",background:"var(--bg-card)"},children:st==="visibility"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-2 py-1.5",children:[t.jsx("span",{className:"min-w-0 truncate text-xs font-semibold uppercase text-[var(--text-muted)]",children:He>0?`${Pt.length} de ${e.length} visibles`:`${e.length} visibles`}),t.jsx("button",{type:"button",onClick:Jm,disabled:He===0,className:"rounded px-1.5 py-0.5 text-xs font-medium text-[var(--primary)] transition-colors hover:bg-[var(--bg-input)] disabled:opacity-40",children:"Mostrar todas"})]}),t.jsx("div",{className:"max-h-72 overflow-auto py-1",children:Kc.map(Ce=>{const Be=!lt.includes(Ce.key),Me=!(Ce.hideable!==!1)||Be&&Pt.length<=1;return t.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":Be,disabled:Me,onClick:()=>Qm(Ce.key),className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",style:{color:"var(--text-main)"},children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded border",style:{borderColor:Be?"var(--primary)":"var(--border)",background:Be?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:Be&&t.jsx(F.HiCheck,{className:"h-3 w-3"})}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:Ce.header})]},Ce.key)})})]}):x?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-2 py-1.5",children:[t.jsxs("span",{className:"min-w-0 truncate text-xs font-semibold uppercase text-[var(--text-muted)]",children:["Filtrar ",x.header]}),t.jsx("button",{type:"button",onClick:Ge,disabled:!Q&&!B,className:"rounded px-1.5 py-0.5 text-xs font-medium text-[var(--primary)] transition-colors hover:bg-[var(--bg-input)] disabled:opacity-40",children:"Limpiar"})]}),x.sortKey&&t.jsxs("div",{className:"grid grid-cols-2 gap-1 border-b border-[var(--border)] p-1",children:[t.jsxs("button",{type:"button",onClick:()=>Tr({key:x.key,dir:"asc"}),className:"flex min-w-0 items-center justify-between rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-[var(--bg-input)]",style:{color:"var(--text-main)"},children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 truncate",children:[t.jsx(F.HiChevronUp,{className:"h-4 w-4 shrink-0 text-[var(--primary)]"}),t.jsx("span",{className:"truncate",children:"Ascendente"})]}),(nt==null?void 0:nt.key)===x.key&&nt.dir==="asc"&&t.jsx(F.HiCheck,{className:"h-4 w-4 shrink-0 text-[var(--primary)]"})]}),t.jsxs("button",{type:"button",onClick:()=>Tr({key:x.key,dir:"desc"}),className:"flex min-w-0 items-center justify-between rounded-md px-2 py-1.5 text-left text-sm transition-colors hover:bg-[var(--bg-input)]",style:{color:"var(--text-main)"},children:[t.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 truncate",children:[t.jsx(F.HiChevronDown,{className:"h-4 w-4 shrink-0 text-[var(--primary)]"}),t.jsx("span",{className:"truncate",children:"Descendente"})]}),(nt==null?void 0:nt.key)===x.key&&nt.dir==="desc"&&t.jsx(F.HiCheck,{className:"h-4 w-4 shrink-0 text-[var(--primary)]"})]})]}),t.jsxs("div",{className:"border-b border-[var(--border)] p-2",children:[t.jsxs("div",{className:"grid grid-cols-[minmax(0,1.05fr)_minmax(0,0.95fr)] gap-2",children:[t.jsx(yr,{value:(B==null?void 0:B.operator)??"",onChange:Ce=>{if(!Ce){Qc(x.key);return}za(x.key,{operator:Ce,value:(B==null?void 0:B.value)??"",valueTo:(B==null?void 0:B.valueTo)??""})},options:uu,placeholder:"Opcion",emptyLabel:"Sin condicion",ariaLabel:"Operador de filtro",searchable:!1,height:34,padding:"0 9px",dropdownMinWidth:260,className:"min-w-0 [&>button]:rounded-md [&>button]:text-sm [&>button]:font-medium"}),(de==null?void 0:de.valueMode)!=="none"?t.jsx("input",{value:(B==null?void 0:B.value)??"",onChange:Ce=>{B&&za(x.key,{...B,value:Ce.target.value})},disabled:!B,placeholder:"Valor",className:"min-w-0 rounded-md border px-2 py-1.5 text-sm outline-none transition-colors placeholder:text-[var(--text-muted)] focus:border-[var(--primary)] disabled:opacity-50",style:{borderColor:"var(--border)",background:"var(--bg-input)",color:"var(--text-main)"}}):t.jsx("div",{className:"min-h-8 rounded-md border px-2 py-1.5 text-sm text-[var(--text-muted)]",style:{borderColor:"var(--border)",background:"var(--bg-input)"},children:"Automatico"})]}),(de==null?void 0:de.valueMode)==="between"&&t.jsx("input",{value:(B==null?void 0:B.valueTo)??"",onChange:Ce=>{B&&za(x.key,{...B,valueTo:Ce.target.value})},placeholder:"Valor final",className:"mt-2 w-full rounded-md border px-2 py-1.5 text-xs outline-none transition-colors placeholder:text-[var(--text-muted)] focus:border-[var(--primary)]",style:{borderColor:"var(--border)",background:"var(--bg-input)",color:"var(--text-main)"}})]}),t.jsx("div",{className:"border-b border-[var(--border)] p-2",children:t.jsxs("div",{className:"flex items-center gap-1 rounded-md border px-2 py-1.5 text-sm",style:{borderColor:"var(--border)",background:"var(--bg-input)"},children:[t.jsx(F.HiMagnifyingGlass,{className:"h-4 w-4 shrink-0 text-[var(--text-muted)]"}),t.jsx("input",{value:Ft,onChange:Ce=>Ye(Ce.target.value),placeholder:"Buscar",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-[var(--text-muted)]",style:{color:"var(--text-main)"}})]})}),t.jsxs("div",{className:"overflow-auto py-1",style:{maxHeight:"max(96px, calc(var(--dt-column-menu-max-height, 520px) - 236px))"},children:[t.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":We?"mixed":!!Ne,onClick:()=>{x&&(Ne?gs(x.key,[]):_a(x.key))},className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)]",style:{color:"var(--text-main)"},children:[t.jsxs("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded border",style:{borderColor:Ne||We?"var(--primary)":"var(--border)",background:Ne||We?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:[We&&t.jsx(F.HiMinus,{className:"h-3 w-3"}),Ne&&!We&&t.jsx(F.HiCheck,{className:"h-3 w-3"})]}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:"Seleccionar todo"})]}),Ie.map(Ce=>{const Be=!Q||he.includes(Ce.value);return t.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":Be,onClick:()=>Gm(x.key,Ce.value,H.map(Ae=>Ae.value),Q),className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)]",style:{color:"var(--text-main)"},children:[t.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded border",style:{borderColor:Be?"var(--primary)":"var(--border)",background:Be?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:Be&&t.jsx(F.HiCheck,{className:"h-3 w-3"})}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:Ce.label})]},Ce.value)}),Ie.length===0&&t.jsx("div",{className:"px-3 py-3 text-sm text-[var(--text-muted)]",children:"Sin valores"})]})]}):null}),document.body)};s.useEffect(()=>{if(!Dn)return;function x(H){bs.current&&!bs.current.contains(H.target)&&Oa.current&&!Oa.current.contains(H.target)&&Fa(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[Dn]);function fd(x,H){if(x.filterValue){const Q=x.filterValue(H);return Q==null||Q===""?"":Yn(Q)}return Yn(Or(x.cell(H)))}function bd(x){return`"${Yn(x).replace(/"/g,'""')}"`}function Za(x){return Yn(x).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function hd(){return Jt&&or>Ar.length&&eo.toast.warning(`Exportando ${Ar.length.toLocaleString("es-MX")} de ${or.toLocaleString("es-MX")} (página actual). Usa exportación completa si está disponible.`),Ar}function bg(){const x=Pt.filter(Ne=>!wr(Ne)),H=hd(),Q=x.map(Ne=>bd(Or(Ne.header))).join(","),B=H.map(Ne=>x.map(We=>bd(fd(We,Ne))).join(",")).join(`
@@ -1 +1 @@
1
- {"version":3,"file":"fileIcons.d.ts","sourceRoot":"","sources":["../../../src/components/icons/fileIcons.tsx"],"names":[],"mappings":"AAgDA,8CAA8C;AAC9C,eAAO,MAAM,cAAc,gJAM1B,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAwC,CAAC;AACjE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,wCAAwC;AACxC,eAAO,MAAM,YAAY,gJAAe,CAAC;AAGzC,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,wCAAwC;AACxC,eAAO,MAAM,aAAa,gJAAe,CAAC;AAG1C,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,gJAAe,CAAC;AAG/C,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,UAAU,gJAAsC,CAAC;AAC9D,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAGhE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,aAAa,gJAQzB,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,aAAa,gJAQzB,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAGhE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,uCAAuC;AACvC,eAAO,MAAM,aAAa,gJAAc,CAAC;AAGzC,eAAO,MAAM,YAAY,gJAexB,CAAC;AAEF,eAAO,MAAM,aAAa,gJASzB,CAAC;AAEF,eAAO,MAAM,eAAe,gJAA4C,CAAC"}
1
+ {"version":3,"file":"fileIcons.d.ts","sourceRoot":"","sources":["../../../src/components/icons/fileIcons.tsx"],"names":[],"mappings":"AAiDA,8CAA8C;AAC9C,eAAO,MAAM,cAAc,gJAM1B,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAwC,CAAC;AACjE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,wCAAwC;AACxC,eAAO,MAAM,YAAY,gJAAe,CAAC;AAGzC,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,wCAAwC;AACxC,eAAO,MAAM,aAAa,gJAAe,CAAC;AAG1C,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,gJAAe,CAAC;AAG/C,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,UAAU,gJAAsC,CAAC;AAC9D,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAGhE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,aAAa,gJAQzB,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,YAAY,gJAAyC,CAAC;AACnE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,aAAa,gJAQzB,CAAC;AAGF,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAGhE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,eAAO,MAAM,WAAW,gJAAuC,CAAC;AAChE,uCAAuC;AACvC,eAAO,MAAM,aAAa,gJAAc,CAAC;AAGzC,eAAO,MAAM,YAAY,gJAexB,CAAC;AAEF,eAAO,MAAM,aAAa,gJASzB,CAAC;AAEF,eAAO,MAAM,eAAe,gJAA4C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonsaif-ui",
3
- "version": "0.1.166",
3
+ "version": "0.1.167",
4
4
  "description": "Reusable Bonsaif UI components for Bonsaif applications.",
5
5
  "type": "module",
6
6
  "author": "Bonsaif",