Files
sigpro-ui/docs/sigpro-ui.min.js
natxocc dfd358c950
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 3s
change components
2026-04-20 00:18:27 +02:00

8 lines
34 KiB
JavaScript

(()=>{var{defineProperty:Ef,getOwnPropertyNames:$_,getOwnPropertyDescriptor:E_}=Object,L_=Object.prototype.hasOwnProperty;function W_(f){return this[f]}var D_=(f)=>{var E=(mf??=new WeakMap).get(f),h;if(E)return E;if(E=Ef({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function"){for(var S of $_(f))if(!L_.call(E,S))Ef(E,S,{get:W_.bind(f,S),enumerable:!(h=E_(f,S))||h.enumerable})}return mf.set(f,E),E},mf;var H_=(f)=>f;function Y_(f,E){this[f]=H_.bind(null,E)}var B=(f,E)=>{for(var h in E)Ef(f,h,{get:E[h],enumerable:!0,configurable:!0,set:Y_.bind(E,h)})};var i_={};B(i_,{Utils:()=>__,Components:()=>f_});var Jf={};B(Jf,{Accordion:()=>y_});var u=(f)=>typeof f==="function",Df=(f)=>f&&typeof f==="object",t=Array.isArray,T=typeof document<"u"?document:null,cf=(f)=>f?._isRuntime?f.container:f instanceof Node?f:T.createTextNode(f==null?"":String(f)),U=null,O=null,i=!1,ff=0,_f=new Set,tf=new WeakMap,Lf=Symbol("iter"),Wf=new WeakMap,m=(f)=>{if(!f||f._disposed)return;f._disposed=!0;let E=[f];while(E.length){let h=E.pop();if(h._cleanups)h._cleanups.forEach((S)=>S()),h._cleanups.clear();if(h._children)h._children.forEach((S)=>E.push(S)),h._children.clear();if(h._deps)h._deps.forEach((S)=>S.delete(h)),h._deps.clear()}},J_=(f)=>{if(O)(O._mounts||=[]).push(f)},d=(f)=>{if(O)(O._cleanups||=new Set).add(f)},P_=(f)=>{let E=U;U=null;try{return f()}finally{U=E}},o=(f,E=!1)=>{let h=()=>{if(h._disposed)return;if(h._deps)h._deps.forEach((H)=>H.delete(h));if(h._cleanups)h._cleanups.forEach((H)=>H()),h._cleanups.clear();let S=U,L=O;U=O=h;try{return h._result=f()}catch(H){console.error("[SigPro]",H)}finally{U=S,O=L}};if(h._deps=h._cleanups=h._children=null,h._disposed=!1,h._isComputed=E,h._depth=U?U._depth+1:0,h._mounts=[],h._parent=O,O)(O._children||=new Set).add(h);return h},pf=()=>{if(i)return;i=!0;let f=Array.from(_f).sort((E,h)=>E._depth-h._depth);_f.clear();for(let E of f)if(!E._disposed)E();i=!1},A_=(f)=>{ff++;try{return f()}finally{if(ff--,ff===0&&_f.size>0&&!i)pf()}},v=(f,E=!1)=>{if(!E&&U&&!U._disposed)f.add(U),(U._deps||=new Set).add(f);else if(E&&f.size>0){let h=!1;for(let S of f){if(S===U||S._disposed)continue;if(S._isComputed){if(S._dirty=!0,S._subs)v(S._subs,!0)}else _f.add(S),h=!0}if(h&&!i&&ff===0)queueMicrotask(pf)}},z=(f,E=null)=>{let h=new Set;if(u(f)){let S,L=()=>{if(L._dirty){let H=U;U=L;try{let W=f();if(!Object.is(S,W))S=W,v(h,!0)}finally{U=H}L._dirty=!1}return v(h),S};if(L._isComputed=!0,L._subs=h,L._dirty=!0,L._deps=null,L._disposed=!1,L.stop=()=>{},O)d(L.stop);return L}if(E)try{f=JSON.parse(localStorage.getItem(E))??f}catch(S){}return(...S)=>{if(S.length){let L=u(S[0])?S[0](f):S[0];if(!Object.is(f,L)){if(f=L,E)localStorage.setItem(E,JSON.stringify(f));v(h,!0)}}return v(h),f}},lf=(f)=>{if(!Df(f))return f;let E=tf.get(f);if(E)return E;let h=new Map,S=(L)=>{let H=h.get(L);if(!H)h.set(L,H=new Set);return H};return E=new Proxy(f,{get(L,H,W){if(typeof H!=="symbol")v(S(H));return lf(Reflect.get(L,H,W))},set(L,H,W,D){let Y=!Reflect.has(L,H),J=Reflect.get(L,H,D),A=Reflect.set(L,H,W,D);if(A&&!Object.is(J,W)){if(v(S(H),!0),Y)v(S(Lf),!0)}return A},deleteProperty(L,H){let W=Reflect.deleteProperty(L,H);if(W)v(S(H),!0),v(S(Lf),!0);return W},ownKeys(L){return v(S(Lf)),Reflect.ownKeys(L)}}),tf.set(f,E),E},x=(f,E)=>{if(E===void 0){let S=o(f);return S(),()=>m(S)}let h=o(()=>{let S=Array.isArray(f)?f.map((L)=>L()):f();P_(()=>E(S))});return h(),()=>m(h)},Hf=(f)=>{if(f._cleanups)f._cleanups.forEach((E)=>E()),f._cleanups.clear();if(f._ownerEffect)m(f._ownerEffect);if(f.childNodes)f.childNodes.forEach(Hf)},X_=/^\s*(javascript|data|vbscript):/i,Q_=(f)=>f==="src"||f==="href"||f.startsWith("on"),gf=(f,E)=>{if(E==null||E===!1)return null;if(Q_(f)){let h=String(E);if(X_.test(h))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${f}`),"#"}return E},_=(f,E={},h=[])=>{if(E instanceof Node||t(E)||!Df(E))h=E,E={};if(u(f)){let W={_mounts:[],_cleanups:new Set},D=o(()=>{let P=f(E,{children:h,emit:(X,...Z)=>E[`on${X[0].toUpperCase()}${X.slice(1)}`]?.(...Z)});return D._result=P,P});D();let Y=D._result;if(Y==null)return null;let J=Y instanceof Node||t(Y)&&Y.every((P)=>P instanceof Node)?Y:T.createTextNode(String(Y)),A=(P)=>{if(Df(P)&&!P._isRuntime)P._mounts=D._mounts||[],P._cleanups=D._cleanups||new Set,P._ownerEffect=D};return t(J)?J.forEach(A):A(J),J}let S=/^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(f),L=S?T.createElementNS("http://www.w3.org/2000/svg",f):T.createElement(f);L._cleanups=new Set;for(let W in E){if(!E.hasOwnProperty(W))continue;let D=E[W];if(W==="ref"){u(D)?D(L):D.current=L;continue}if(S&&W.startsWith("xlink:")){val==null?L.removeAttributeNS("http://www.w3.org/1999/xlink",W.slice(6)):L.setAttributeNS("http://www.w3.org/1999/xlink",W.slice(6),val);continue}if(W.startsWith("on")){let Y=W.slice(2).toLowerCase();L.addEventListener(Y,D);let J=()=>L.removeEventListener(Y,D);L._cleanups.add(J),d(J)}else if(u(D)){let Y=o(()=>{let J=gf(W,D());if(W==="class")L.className=J||"";else if(J==null)L.removeAttribute(W);else if(W in L&&!S)L[W]=J;else L.setAttribute(W,J===!0?"":J)});if(Y(),L._cleanups.add(()=>m(Y)),d(()=>m(Y)),/^(INPUT|TEXTAREA|SELECT)$/.test(L.tagName)&&(W==="value"||W==="checked")){let J=W==="checked"?"change":"input";L.addEventListener(J,(A)=>D(A.target[W]))}}else{let Y=gf(W,D);if(Y!=null)if(W in L&&!S)L[W]=Y;else L.setAttribute(W,Y===!0?"":Y)}}let H=(W)=>{if(t(W))return W.forEach(H);if(u(W)){let D=T.createTextNode("");L.appendChild(D);let Y=[],J=o(()=>{let A=W(),P=(t(A)?A:[A]).map(cf);Y.forEach((Z)=>{if(Z._isRuntime)Z.destroy();else Hf(Z);if(Z.parentNode)Z.remove()});let X=D;for(let Z=P.length-1;Z>=0;Z--){let Q=P[Z];if(Q.parentNode!==X.parentNode)X.parentNode?.insertBefore(Q,X);if(Q._mounts)Q._mounts.forEach((y)=>y());X=Q}Y=P});J(),L._cleanups.add(()=>m(J)),d(()=>m(J))}else{let D=cf(W);if(L.appendChild(D),D._mounts)D._mounts.forEach((Y)=>Y())}};return H(h),L},g=(f)=>{let E=new Set,h=[],S=O,L=U,H=T.createElement("div");H.style.display="contents",H.setAttribute("role","presentation"),O={_cleanups:E,_mounts:h},U=null;let W=(D)=>{if(!D)return;if(D._isRuntime)E.add(D.destroy),H.appendChild(D.container);else if(t(D))D.forEach(W);else H.appendChild(D instanceof Node?D:T.createTextNode(String(D==null?"":D)))};try{W(f({onCleanup:(D)=>E.add(D)}))}finally{O=S,U=L}return h.forEach((D)=>D()),{_isRuntime:!0,container:H,destroy:()=>{E.forEach((D)=>D()),Hf(H),H.remove()}}},I=(f,E,h=null)=>{let S=T.createTextNode(""),L=_("div",{style:"display:contents"},[S]),H=null;return x(()=>!!(u(f)?f():f),(W)=>{if(H)H.destroy(),H=null;let D=W?E:h;if(D)H=g(()=>u(D)?D():D),L.insertBefore(H.container,S)}),d(()=>H?.destroy()),L},M=(f,E,h)=>{let S=T.createTextNode(""),L=_("div",{style:"display:contents"},[S]),H=new Map;return x(()=>(u(f)?f():f)||[],(W)=>{let D=new Map,Y=[],J=W||[];for(let P=0;P<J.length;P++){let X=J[P],Z=h?h(X,P):X?.id??P,Q=H.get(Z);if(!Q)Q=g(()=>E(X,P));else H.delete(Z);D.set(Z,Q),Y.push(Q)}H.forEach((P)=>P.destroy());let A=S;for(let P=Y.length-1;P>=0;P--){let X=Y[P].container;if(X.nextSibling!==A)L.insertBefore(X,A);A=X}H=D}),L},p=(f)=>{let E=()=>window.location.hash.slice(1)||"/",h=z(E()),S=()=>h(E());window.addEventListener("hashchange",S),d(()=>window.removeEventListener("hashchange",S));let L=_("div",{class:"router-hook"}),H=null;return x([h],()=>{let W=h(),D=f.find((Y)=>{let J=Y.path.split("/").filter(Boolean),A=W.split("/").filter(Boolean);return J.length===A.length&&J.every((P,X)=>P[0]===":"||P===A[X])})||f.find((Y)=>Y.path==="*");if(D){H?.destroy();let Y={};D.path.split("/").filter(Boolean).forEach((J,A)=>{if(J[0]===":")Y[J.slice(1)]=W.split("/").filter(Boolean)[A]}),p.params(Y),H=g(()=>u(D.component)?D.component(Y):D.component),L.replaceChildren(H.container)}}),L};p.params=z({});p.to=(f)=>window.location.hash=f.replace(/^#?\/?/,"#/");p.back=()=>window.history.back();p.path=()=>window.location.hash.replace(/^#/,"")||"/";var G_=(f,E,{enter:h,leave:S}={})=>{let L=_("div",{style:"display:contents"}),H=null,W=(D,Y)=>{let J=!1,A=()=>!J&&(J=!0,Y());if(!D)return A();"transitionend animationend".split(" ").map((P)=>D.addEventListener(P,A,{once:!0})),setTimeout(A,500)};return x(f,(D)=>{if(D&&!H){let Y=(H=g(E)).container.firstChild;if(L.appendChild(H.container),h&&Y)Y.classList.add(h),Y.clientTop,Y.classList.add(h+"-active"),W(Y,()=>Y.classList.remove(h,h+"-active"))}else if(!D&&H){let Y=H.container.firstChild,J=()=>(H?.destroy(),H=null);S&&Y?(Y.classList.add(S),W(Y,J)):J()}}),d(()=>H?.destroy()),L},Yf=(f,E)=>{let h=typeof E==="string"?T.querySelector(E):E;if(!h)return;if(Wf.has(h))Wf.get(h).destroy();let S=g(u(f)?f:()=>f);return h.replaceChildren(S.container),Wf.set(h,S),S},K_=Object.freeze({$:z,$$:lf,Watch:x,Tag:_,Render:g,If:I,For:M,Router:p,Mount:Yf,onMount:J_,onUnmount:d,Anim:G_,Batch:A_});if(typeof window<"u")Object.assign(window,K_),"div span p h1 h2 h3 h4 h5 h6 br hr section article aside nav main header footer ul ol li a em strong pre code form label input textarea select button img svg".split(" ").forEach((f)=>{let E=f[0].toUpperCase()+f.slice(1);window[E]=(h,S)=>_(f,h,S)});var G=(f)=>typeof f==="function"?f():f,K=(f,E)=>typeof E==="function"?()=>`${f} ${E()||""}`.trim():`${f} ${E||""}`.trim(),C=(f)=>{if(!f)return null;if(typeof f==="function")return _("span",{class:"mr-1"},f());if(typeof f==="object")return _("span",{class:"mr-1"},f);if(typeof f==="string"){let E=f.trim().split(/\s+/),h=E[E.length-1]==="right",S=h?E.slice(0,-1).join(" "):f,L=h?"ml-1":"mr-1";if(S&&!S.startsWith("icon-[")&&!S.includes("--"))return _("span",{class:L},S);return _("span",{class:`${S} ${L}`.trim()})}return null},Z_={es:{close:"Cerrar",confirm:"Confirmar",cancel:"Cancelar",search:"Buscar...",loading:"Cargando...",nodata:"Sin datos"},en:{close:"Close",confirm:"Confirm",cancel:"Cancel",search:"Search...",loading:"Loading...",nodata:"No data"}},of=z("es"),af=(f)=>of(f),sf=(f)=>()=>Z_[of()][f]||f;var y_=(f,E)=>{let{class:h,title:S,name:L,open:H,...W}=f;return _("div",{...W,class:K("collapse collapse-arrow bg-base-200 mb-2",h)},[_("input",{type:L?"radio":"checkbox",name:L,checked:G(H)}),_("div",{class:"collapse-title text-xl font-medium"},S),_("div",{class:"collapse-content"},E)])};var Pf={};B(Pf,{Alert:()=>B_});var B_=(f,E)=>{let{class:h,actions:S,type:L="info",soft:H=!0,...W}=f,D={info:"icon-[lucide--info]",success:"icon-[lucide--check-circle]",warning:"icon-[lucide--alert-triangle]",error:"icon-[lucide--alert-circle]"},A=[`alert-${L}`,H?"alert-soft":"",h].filter(Boolean).join(" "),P=E||f.message;return _("div",{...W,role:"alert",class:K("alert",A)},()=>[C(D[L]),_("div",{class:"flex-1"},[_("span",{},[typeof P==="function"?P():P])]),S?_("div",{class:"flex-none"},[typeof S==="function"?S():S]):null].filter(Boolean))};var Xf={};B(Xf,{Autocomplete:()=>q_});var Af={};B(Af,{Input:()=>a});var a=(f)=>{let{class:E,value:h,type:S="text",icon:L,oninput:H,placeholder:W,disabled:D,validate:Y,label:J,...A}=f,P=S==="password",X=$(!1),Z=$(null),Q={text:"icon-[lucide--text]",password:"icon-[lucide--lock]",date:"icon-[lucide--calendar]",number:"icon-[lucide--hash]",email:"icon-[lucide--mail]",search:"icon-[lucide--search]",tel:"icon-[lucide--phone]",url:"icon-[lucide--link]"},y=L?C(L):Q[S]?C(Q[S]):null,N=()=>C(X()?"icon-[lucide--eye-off]":"icon-[lucide--eye]"),k=y?"pl-10":"",q=P?"pr-10":"",R=()=>{if(E?.includes("input-xs"))return"btn-xs";if(E?.includes("input-sm"))return"btn-sm";if(E?.includes("input-lg"))return"btn-lg";return"btn-md"},w=(F)=>{let e=F.target.value;if(Y){let j=Y(e);Z(j||null)}H?.(F)},V=()=>Z()&&Z()!=="",l=_("input",{...A,type:()=>P?X()?"text":"password":S,placeholder:W||(J?" ":W),class:()=>{let F=`input w-full ${k} ${q}`;if(E)F+=` ${E}`;if(V())F+=" input-error";return F.trim()},value:h,oninput:w,disabled:()=>G(D),"aria-invalid":()=>V()?"true":"false"}),c=()=>[l,y?_("div",{class:"absolute left-3 inset-y-0 flex items-center pointer-events-none text-base-content/60"},y):null,P?_("button",{type:"button",class:K("absolute right-3 inset-y-0 flex items-center","btn btn-ghost btn-circle opacity-50 hover:opacity-100",R()),onclick:(F)=>{F.preventDefault(),X(!X())}},()=>N()):null,_("div",{class:"text-error text-xs mt-1 px-3 absolute -bottom-5 left-0"},()=>V()?Z():null)];if(J)return _("label",{class:K("floating-label w-full",E)},()=>[_("div",{class:"relative w-full"},c),_("span",{},G(J))]);return _("div",{class:"relative w-full"},c)};var q_=(f)=>{let{class:E,items:h=[],value:S,onselect:L,label:H,placeholder:W,...D}=f,Y=z(G(S)||""),J=z(!1),A=z(-1),P=z([]);Watch(()=>{let Q=String(Y()).toLowerCase(),y=G(h)||[],N=Q?y.filter((k)=>(typeof k==="string"?k:k.label).toLowerCase().includes(Q)):y;P(N)});let X=(Q)=>{let y=typeof Q==="string"?Q:Q.value,N=typeof Q==="string"?Q:Q.label;if(Y(N),typeof S==="function")S(y);L?.(Q),J(!1),A(-1)};return _("div",{class:"relative w-full"},[a({label:H,class:E,placeholder:W,value:Y,onfocus:()=>J(!0),onblur:()=>setTimeout(()=>J(!1),150),onkeydown:(Q)=>{let y=P();if(Q.key==="ArrowDown")Q.preventDefault(),J(!0),A(Math.min(A()+1,y.length-1));else if(Q.key==="ArrowUp")Q.preventDefault(),A(Math.max(A()-1,0));else if(Q.key==="Enter"&&A()>=0)Q.preventDefault(),X(y[A()]);else if(Q.key==="Escape")J(!1)},oninput:(Q)=>{let y=Q.target.value;if(Y(y),typeof S==="function")S(y);J(!0),A(-1)},...D}),_("ul",{class:"absolute dropdown-menu left-0 w-full menu bg-base-100 rounded-box mt-1 p-2 shadow-xl max-h-60 overflow-y-auto border border-base-300 z-50",style:()=>J()&&P().length?"display:block":"display:none"},[M(P,(Q,y)=>_("li",{},[_("a",{class:()=>`block w-full ${A()===y?"active bg-primary text-primary-content":""}`,onclick:()=>X(Q),onmouseenter:()=>A(y)},typeof Q==="string"?Q:Q.label)]),(Q,y)=>(typeof Q==="string"?Q:Q.value)+y),()=>P().length?null:_("li",{class:"p-2 text-center opacity-50"},"nodata")])])};var Qf={};B(Qf,{Badge:()=>C_});var C_=(f,E)=>{let{class:h,...S}=f;return _("span",{...S,class:K("badge",h)},E)};var Gf={};B(Gf,{Button:()=>s});var s=(f,E)=>{let{class:h,loading:S,icon:L,...H}=f,W=C(L);return _("button",{...H,class:K("btn",h),disabled:()=>G(S)||G(f.disabled)},()=>[G(S)&&_("span",{class:"loading loading-spinner"}),W,E].filter(Boolean))};var Kf={};B(Kf,{Checkbox:()=>z_});var z_=(f)=>{let{class:E,value:h,toggle:S,label:L,...H}=f,W=_("input",{...H,type:"checkbox",class:()=>K(G(S)?"toggle":"checkbox",E),checked:h});return _("label",{class:"label cursor-pointer justify-start gap-3"},[W,L?_("span",{class:"label-text"},L):null])};var Zf={};B(Zf,{Colorpicker:()=>R_});var R_=(f)=>{let{class:E,value:h,label:S,...L}=f,H=z(!1),W=["#000","#1A1A1A","#333","#4D4D4D","#666","#808080","#B3B3B3","#FFF","#450a0a","#7f1d1d","#991b1b","#b91c1c","#dc2626","#ef4444","#f87171","#fca5a5","#431407","#7c2d12","#9a3412","#c2410c","#ea580c","#f97316","#fb923c","#ffedd5","#713f12","#a16207","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#fff9c4","#064e3b","#065f46","#059669","#10b981","#34d399","#4ade80","#84cc16","#d9f99d","#082f49","#075985","#0284c7","#0ea5e9","#38bdf8","#7dd3fc","#22d3ee","#cffafe","#1e1b4b","#312e81","#4338ca","#4f46e5","#6366f1","#818cf8","#a5b4fc","#e0e7ff","#2e1065","#4c1d95","#6d28d9","#7c3aed","#8b5cf6","#a855f7","#d946ef","#fae8ff"],D=()=>G(h)||"#000000";return _("div",{class:K("relative w-fit",E)},[_("button",{type:"button",class:"btn px-3 bg-base-100 border-base-300 hover:border-primary/50 flex items-center gap-2 shadow-sm font-normal normal-case",onclick:(Y)=>{Y.stopPropagation(),H(!H())},...L},[_("div",{class:"size-5 rounded-sm shadow-inner border border-black/10 shrink-0",style:()=>`background-color: ${D()}`}),S?_("span",{class:"opacity-80"},S):null]),I(H,()=>_("div",{class:"absolute left-0 mt-2 p-3 bg-base-100 border border-base-300 shadow-2xl rounded-box z-[110] w-64 select-none",onclick:(Y)=>Y.stopPropagation()},[_("div",{class:"grid grid-cols-8 gap-1"},W.map((Y)=>_("button",{type:"button",style:`background-color: ${Y}`,class:()=>{return`size-6 rounded-sm cursor-pointer transition-all hover:scale-125 hover:z-10 active:scale-95 outline-none border border-black/5
${D().toLowerCase()===Y.toLowerCase()?"ring-2 ring-offset-1 ring-primary z-10 scale-110":""}`},onclick:()=>{if(typeof h==="function")h(Y);H(!1)}})))])),I(H,()=>_("div",{class:"fixed inset-0 z-[100]",onclick:()=>H(!1)}))])};var yf={};B(yf,{Datepicker:()=>V_});var ef=(f)=>{let{value:E,range:h=!1,hour:S=!1,onChange:L,class:H=""}=f,W=z(new Date),D=z(null),Y=z(0),J=z(0),A=()=>h===!0,P=new Date,X=`${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}-${String(P.getDate()).padStart(2,"0")}`,Z=(q)=>{let R=q.getFullYear(),w=String(q.getMonth()+1).padStart(2,"0"),V=String(q.getDate()).padStart(2,"0");return`${R}-${w}-${V}`},Q=(q)=>{let R=Z(q),w=G(E);if(A())if(!w?.start||w.start&&w.end){let V={start:R,end:null,...S&&{startHour:Y()}};L?.(V)}else{let V=w.start,n;if(R<V)n={start:R,end:V};else n={start:V,end:R};if(S)n.startHour=w.startHour!==void 0?w.startHour:Y(),n.endHour=J();L?.(n)}else{let V=S?`${R}T${String(Y()).padStart(2,"0")}:00:00`:R;L?.(V)}},y=(q)=>{let R=W();W(new Date(R.getFullYear(),R.getMonth()+q,1))},N=(q)=>{let R=W();W(new Date(R.getFullYear()+q,R.getMonth(),1))},k=({value:q,onChange:R})=>{return _("div",{class:"flex-1"},[_("div",{class:"flex gap-2 items-center"},[_("input",{type:"range",min:0,max:23,value:q,class:"range range-xs flex-1",oninput:(w)=>{let V=parseInt(w.target.value);R(V)}}),_("span",{class:"text-sm font-mono min-w-[48px] text-center"},()=>String(G(q)).padStart(2,"0")+":00")])])};return _("div",{class:`p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box w-80 select-none ${H}`},[_("div",{class:"flex justify-between items-center mb-4 gap-1"},[_("div",{class:"flex gap-0.5"},[_("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>N(-1)},C("icon-[lucide--chevrons-left]")),_("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>y(-1)},C("icon-[lucide--chevron-left]"))]),_("span",{class:"font-bold uppercase flex-1 text-center"},[()=>W().toLocaleString("es-ES",{month:"short",year:"numeric"})]),_("div",{class:"flex gap-0.5"},[_("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>y(1)},C("icon-[lucide--chevron-right]")),_("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>N(1)},C("icon-[lucide--chevrons-right]"))])]),_("div",{class:"grid grid-cols-7 gap-1",onmouseleave:()=>D(null)},[...["L","M","X","J","V","S","D"].map((q)=>_("div",{class:"text-[10px] opacity-40 font-bold text-center"},q)),()=>{let q=W(),R=q.getFullYear(),w=q.getMonth(),V=new Date(R,w,1).getDay(),n=V===0?6:V-1,l=new Date(R,w+1,0).getDate(),c=[];for(let F=0;F<n;F++)c.push(_("div"));for(let F=1;F<=l;F++){let e=new Date(R,w,F),j=Z(e);c.push(_("button",{type:"button",class:()=>{let b=G(E),hf=D(),h_=typeof b==="string"?b.split("T")[0]===j:b?.start===j,S_=b?.end===j,Sf=!1;if(A()&&b?.start){let $f=b.start;if(!b.end&&hf)Sf=j>$f&&j<=hf||j<$f&&j>=hf;else if(b.end)Sf=j>$f&&j<b.end}return`${"btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative"} ${h_||S_?"btn-primary z-10":Sf?"bg-primary/20 border-none rounded-none":"btn-ghost"} ${j===X?"ring-1 ring-primary ring-inset font-black text-primary":""}`},onmouseenter:()=>{if(A())D(j)},onclick:()=>Q(e)},[F.toString()]))}return c}]),S?_("div",{class:"mt-3 pt-2 border-t border-base-300"},[A()?_("div",{class:"flex gap-4"},[k({value:Y,onChange:(q)=>Y(q)}),k({value:J,onChange:(q)=>J(q)})]):k({value:Y,onChange:(q)=>Y(q)})]):null])};var V_=(f)=>{let{class:E,value:h,range:S,label:L,placeholder:H,hour:W=!1,...D}=f,Y=z(!1),J=()=>G(S)===!0,A=z("");x(()=>{let X=G(h);if(!X){A("");return}let Z="";if(typeof X==="string")Z=W&&X.includes("T")?X.replace("T"," "):X;else if(X.start&&X.end){let Q=W&&X.startHour!==void 0?`${X.start} ${String(X.startHour).padStart(2,"0")}:00`:X.start,y=W&&X.endHour!==void 0?`${X.end} ${String(X.endHour).padStart(2,"0")}:00`:X.end;Z=`${Q} - ${y}`}else if(X.start)Z=`${W&&X.startHour!==void 0?`${X.start} ${String(X.startHour).padStart(2,"0")}:00`:X.start}...`;A(Z)});let P=(X)=>{if(typeof h==="function")h(X);if(!J()||X?.end!==void 0&&X?.end!==null)Y(!1)};return _("div",{class:K("relative w-full",E)},[a({label:L,placeholder:H||(J()?"Seleccionar rango...":"Seleccionar fecha..."),value:A,readonly:!0,icon:C("icon-[lucide--calendar]"),onclick:(X)=>{X.stopPropagation(),Y(!Y())},...D}),I(Y,()=>_("div",{class:"absolute left-0 mt-2 z-[100]",onclick:(X)=>X.stopPropagation()},[ef({value:h,range:J(),hour:W,onChange:P})])),I(Y,()=>_("div",{class:"fixed inset-0 z-[90]",onclick:()=>Y(!1)}))])};var Bf={};B(Bf,{Drawer:()=>N_});var N_=(f,E)=>{let{class:h,id:S,open:L,side:H,content:W,...D}=f,Y=S||`drawer-${Math.random().toString(36).slice(2,9)}`;return _("div",{...D,class:K("drawer",h)},[_("input",{id:Y,type:"checkbox",class:"drawer-toggle",checked:()=>typeof L==="function"?L():L,onchange:(J)=>{if(typeof L==="function")L(J.target.checked)}}),_("div",{class:"drawer-content"},[typeof W==="function"?W():W]),_("div",{class:"drawer-side"},[_("label",{for:Y,class:"drawer-overlay",onclick:()=>{if(typeof L==="function")L(!1)}}),_("div",{class:"min-h-full bg-base-200 w-80"},[typeof H==="function"?H():H])])])};var qf={};B(qf,{Dropdown:()=>U_});var r=null;if(typeof window<"u"&&!window.__dropdownHandlerRegistered)window.addEventListener("click",(f)=>{if(r&&!r.contains(f.target))r.open=!1,r=null}),window.__dropdownHandlerRegistered=!0;var U_=(f)=>{let{class:E,label:h,icon:S,items:L,...H}=f;return _("details",{...H,class:K("dropdown",E)},[_("summary",{class:"btn m-1 flex items-center gap-2 list-none cursor-pointer",style:"display: inline-flex;",onclick:(W)=>{let D=W.currentTarget.closest("details");if(r&&r!==D)r.open=!1;setTimeout(()=>{r=D.open?D:null},0)}},[()=>S?typeof S==="function"?S():S:null,()=>h?typeof h==="function"?h():h:null]),_("ul",{tabindex:"-1",class:"dropdown-content z-[50] menu p-2 shadow bg-base-100 rounded-box w-52 border border-base-300"},[()=>{return(typeof L==="function"?L():L||[]).map((D)=>_("li",{},[_("a",{class:D.class||"",onclick:(Y)=>{if(D.onclick)D.onclick(Y);let J=Y.currentTarget.closest("details");if(J){if(J.open=!1,r===J)r=null}}},[D.icon?_("span",{},D.icon):null,_("span",{},D.label)])]))}])])};var Cf={};B(Cf,{Fab:()=>w_});var w_=(f)=>{let{class:E,icon:h,label:S,actions:L=[],position:H="bottom-6 right-6",...W}=f;return _("div",{...W,class:K(`fab absolute ${H} flex flex-col-reverse items-end gap-3 z-[100]`,E)},[_("div",{tabindex:0,role:"button",class:"btn btn-lg btn-circle btn-primary shadow-2xl"},[h?C(h):null,!h&&S?S:null]),...G(L).map((D)=>_("div",{class:"flex items-center gap-3 transition-all duration-300"},[D.label?_("span",{class:"badge badge-ghost shadow-sm whitespace-nowrap"},D.label):null,_("button",{type:"button",class:`btn btn-circle shadow-lg ${D.class||""}`,onclick:(Y)=>{Y.stopPropagation(),D.onclick?.(Y)}},[D.icon?C(D.icon):D.text||""])]))])};var zf={};B(zf,{Fieldset:()=>k_});var k_=(f,E)=>{let{class:h,legend:S,...L}=f;return _("fieldset",{...L,class:K("fieldset bg-base-200 border border-base-300 p-4 rounded-lg",h)},[()=>{let H=G(S);return H?_("legend",{class:"fieldset-legend font-bold"},[H]):null},E])};var Rf={};B(Rf,{Fileinput:()=>F_});var F_=(f)=>{let{class:E,tooltip:h,max:S=2,accept:L="*",onselect:H,...W}=f,D=z([]),Y=z(!1),J=z(null),A=S*1024*1024,P=(Z)=>{let Q=Array.from(Z);if(J(null),Q.find((N)=>N.size>A)){J(`Máx ${S}MB`);return}D([...D(),...Q]),H?.(D())},X=(Z)=>{let Q=D().filter((y,N)=>N!==Z);D(Q),H?.(Q)};return _("fieldset",{...W,class:K("fieldset w-full p-0",E)},[_("div",{class:()=>`w-full ${h?"tooltip tooltip-top before:z-50 after:z-50":""}`,"data-tip":h},[_("label",{class:()=>`
relative flex items-center justify-between w-full h-12 px-4
border-2 border-dashed rounded-lg cursor-pointer
transition-all duration-200
${Y()?"border-primary bg-primary/10":"border-base-content/20 bg-base-100 hover:bg-base-200"}
`,ondragover:(Z)=>{Z.preventDefault(),Y(!0)},ondragleave:()=>Y(!1),ondrop:(Z)=>{Z.preventDefault(),Y(!1),P(Z.dataTransfer.files)}},[_("div",{class:"flex items-center gap-3 w-full"},[C("icon-[lucide--upload]"),_("span",{class:"text-sm opacity-70 truncate grow text-left"},"Arrastra o selecciona archivos..."),_("span",{class:"text-[10px] opacity-40 shrink-0"},`Máx ${S}MB`)]),_("input",{type:"file",multiple:!0,accept:L,class:"hidden",onchange:(Z)=>P(Z.target.files)})])]),()=>J()?_("span",{class:"text-[10px] text-error mt-1 px-1 font-medium"},J()):null,I(()=>D().length>0,()=>_("ul",{class:"mt-2 space-y-1"},[M(D,(Z,Q)=>_("li",{class:"flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300"},[_("div",{class:"flex items-center gap-2 truncate"},[_("span",{class:"opacity-50"},"\uD83D\uDCC4"),_("span",{class:"truncate font-medium max-w-[200px]"},Z.name),_("span",{class:"text-[9px] opacity-40"},`(${(Z.size/1024).toFixed(0)} KB)`)]),_("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle",onclick:(y)=>{y.preventDefault(),y.stopPropagation(),X(Q)}},[C("icon-[lucide--x]")])]),(Z)=>Z.name+Z.lastModified)]))])};var Vf={};B(Vf,{Indicator:()=>O_});var O_=(f,E)=>{let{value:h,class:S,...L}=f;return _("div",{...L,class:"indicator"},()=>[h?_("span",{class:K("indicator-item badge",S)},()=>typeof h==="function"?h():h):null,E].filter(Boolean))};var Nf={};B(Nf,{Label:()=>M_});var M_=(f)=>{let{children:E,value:h,floating:S=!1,class:L,...H}=f;if(S)return _("label",{class:K("floating-label",L),...H},()=>[typeof E==="function"?E():E,h?_("span",{},G(h)):null]);return _("label",{class:K("label",L),...H},()=>[h?_("span",{class:"label-text"},G(h)):null,typeof E==="function"?E():E])};var Uf={};B(Uf,{List:()=>j_});var j_=(f)=>{let{class:E,items:h,header:S,render:L=(Y)=>Y,keyFn:H=(Y,J)=>Y.id??J,...W}=f,D=M(h,(Y,J)=>_("li",{class:"list-row",style:"width: 100%; display: block;"},[_("div",{style:"width: 100%;"},[L(Y,J)])]),H);return _("ul",{...W,style:"display: block; width: 100%;",class:K("list bg-base-100 rounded-box shadow-md",E)},S?[I(S,()=>_("li",{class:"p-4 pb-2 text-xs opacity-60",style:"width: 100%;"},[G(S)])),D]:D)};var wf={};B(wf,{Menu:()=>x_});var x_=(f)=>{let{class:E,items:h,...S}=f,L=(H)=>M(()=>H||[],(W)=>_("li",{},[W.children?_("details",{open:W.open},[_("summary",{},[W.icon&&_("span",{class:"mr-2"},W.icon),W.label]),_("ul",{},L(W.children))]):_("a",{class:()=>G(W.active)?"active":"",onclick:W.onclick},[W.icon&&_("span",{class:"mr-2"},W.icon),W.label])]),(W,D)=>W.label||D);return _("ul",{...S,class:K("menu bg-base-200 rounded-box",E)},L(h))};var kf={};B(kf,{Modal:()=>I_});var I_=(f,E)=>{let{class:h,title:S,buttons:L,open:H,...W}=f,D=null,Y=()=>{let A=typeof H==="function"?H():H;if(!D)return;if(A){if(!D.open)D.showModal()}else if(D.open)D.close()};x(()=>Y());let J=()=>{if(typeof H==="function")H(!1)};return _("dialog",{...W,ref:(A)=>{if(D=A,A)Y()},class:K("modal",h),onclose:J,oncancel:J},[_("div",{class:"modal-box"},[S?_("h3",{class:"text-lg font-bold mb-4"},()=>typeof S==="function"?S():S):null,_("div",{class:"py-2"},[typeof E==="function"?E():E]),_("div",{class:"modal-action"},[_("form",{method:"dialog",class:"flex gap-2"},[...(Array.isArray(L)?L:[L]).filter(Boolean),s({type:"submit"},"close")])])]),_("form",{method:"dialog",class:"modal-backdrop"},[_("button",{},"close")])])};var Ff={};B(Ff,{Navbar:()=>v_});var v_=(f,E)=>{let{class:h,...S}=f;return _("div",{...S,class:K("navbar bg-base-100 shadow-sm px-4",h)},E)};var Of={};B(Of,{Radio:()=>u_});var u_=(f)=>{let{class:E,label:h,tooltip:S,value:L,inputValue:H,name:W,...D}=f,Y=_("input",{...D,type:"radio",name:W,class:K("radio",E),checked:()=>G(L)===H,onclick:()=>{if(typeof L==="function")L(H)}});if(!h&&!S)return Y;let J=_("label",{class:"label cursor-pointer justify-start gap-3"},[Y,h?_("span",{class:"label-text"},h):null]);return S?_("div",{class:"tooltip","data-tip":S},J):J};var Mf={};B(Mf,{Range:()=>n_});var n_=(f)=>{let{class:E,label:h,tooltip:S,value:L,...H}=f,W=_("input",{...H,type:"range",class:K("range",E),value:L,disabled:()=>G(f.disabled)});if(!h&&!S)return W;let D=_("div",{class:"flex flex-col gap-2"},[h?_("span",{class:"label-text"},h):null,W]);return S?_("div",{class:"tooltip","data-tip":S},D):D};var jf={};B(jf,{Rating:()=>T_});var T_=(f)=>{let{class:E,value:h,count:S=5,mask:L="mask-star",readonly:H=!1,onchange:W,...D}=f,Y=`rating-${Math.random().toString(36).slice(2,7)}`;return _("div",{...D,class:()=>K(`rating ${G(H)?"pointer-events-none":""}`,E)},Array.from({length:G(S)},(J,A)=>{let P=A+1;return _("input",{type:"radio",name:Y,class:`mask ${L}`,checked:()=>Math.round(G(h))===P,onchange:()=>{if(!G(H)){if(typeof W==="function")W(P);else if(typeof h==="function")h(P)}}})}))};var xf={};B(xf,{Select:()=>r_});var r_=(f)=>{let{class:E,label:h,items:S,value:L,...H}=f,W=_("select",{...H,class:K("select select-bordered w-full",E),value:L},M(()=>G(S)||[],(D)=>_("option",{value:D.value,$selected:()=>String(G(L))===String(D.value)},D.label),(D)=>D.value));if(!h)return W;return _("label",{class:"fieldset-label flex flex-col gap-1"},[_("span",{},h),W])};var If={};B(If,{Stack:()=>b_});var b_=(f,E)=>{let{class:h,...S}=f;return _("div",{...S,class:K("stack",h)},E)};var vf={};B(vf,{Stat:()=>d_});var d_=(f)=>{let{class:E,icon:h,label:S,value:L,desc:H,...W}=f;return _("div",{...W,class:K("stat",E)},[h&&_("div",{class:"stat-figure text-secondary"},h),S&&_("div",{class:"stat-title"},S),_("div",{class:"stat-value"},()=>G(L)??L),H&&_("div",{class:"stat-desc"},H)])};var uf={};B(uf,{Swap:()=>m_});var m_=(f)=>{let{class:E,value:h,on:S,off:L,...H}=f;return _("label",{...H,class:K("swap",E)},[_("input",{type:"checkbox",checked:()=>G(h),onclick:(W)=>{if(typeof h==="function")h(W.target.checked)}}),_("div",{class:"swap-on"},S),_("div",{class:"swap-off"},L)])};var nf={};B(nf,{Table:()=>c_});var c_=(f)=>{let{class:E,items:h=[],columns:S=[],keyFn:L,zebra:H=!1,pinRows:W=!1,empty:D="nodata",...Y}=f,J=()=>{let P=G(H)?"table-zebra":"",X=G(W)?"table-pin-rows":"";return K("table",E,P,X)},A=L||((P,X)=>P.id||X);return _("div",{class:"overflow-x-auto w-full bg-base-100 rounded-box border border-base-300"},[_("table",{...Y,class:J},[_("thead",{},[_("tr",{},S.map((P)=>_("th",{class:P.class||""},P.label)))]),_("tbody",{},[M(h,(P,X)=>{let Z=()=>{let Q=G(h),y=A(P,X);return Q.find((N,k)=>A(N,k)===y)||P};return _("tr",{class:"hover"},S.map((Q)=>{let y=()=>{let N=Z();if(Q.render)return Q.render(N,X);return G(N[Q.key])};return _("td",{class:Q.class||""},[y])}))},A),I(()=>G(h).length===0,()=>_("tr",{},[_("td",{colspan:S.length,class:"text-center p-10 opacity-50"},[G(D)])]))])])])};var Tf={};B(Tf,{Tabs:()=>t_});var t_=(f)=>{let{items:E,class:h,onTabClose:S,...L}=f,H=typeof E==="function"?E:()=>E||[],W=z(0);x(()=>{let J=H().findIndex((A)=>G(A.active)===!0);if(J!==-1&&W()!==J)W(J)});let D=(Y,J)=>{if(J.onClose)J.onClose(J);if(S)S(J,Y);let P=H().filter((Q,y)=>y!==Y);if(!(typeof E==="function"&&!E._isComputed)){console.warn("Tabs: items must be a writable signal to support closable tabs");return}if(E(P),P.length===0)return;let Z=W();if(Y<Z)Z--;else if(Y===Z)Z=Math.min(Z,P.length-1);W(Z)};return _("div",{...L,class:K("tabs",h)},()=>{let Y=H(),J=[];for(let A=0;A<Y.length;A++){let P=Y[A],X=G(P.label),Z=X instanceof Node?X:document.createTextNode(String(X)),Q=[];if(P.closable){let V=C("icon-[lucide--x]");V.classList.add("w-3.5","h-3.5","ml-2","cursor-pointer","hover:opacity-70"),V.onclick=(l)=>{l.stopPropagation(),D(A,P)};let n=_("span",{class:"flex items-center"},[Z,V]);Q.push(n)}else Q.push(Z);let y=_("button",{class:()=>K("tab",W()===A?"tab-active":""),onclick:(V)=>{if(V.preventDefault(),!G(P.disabled)){if(P.onclick)P.onclick();W(A)}}},Q),N=P.tip?_("div",{class:"tooltip","data-tip":P.tip},y):y;J.push(N);let k,q=G(P.content);if(typeof q==="function")k=q();else if(q instanceof Node)k=q;else k=document.createTextNode(String(q));let R=_("div",{class:"tab-content-inner"},k),w=_("div",{class:"tab-content bg-base-100 border-base-300 p-6",style:()=>W()===A?"display: block":"display: none"},R);J.push(w)}return J})};var rf={};B(rf,{Timeline:()=>g_});var g_=(f)=>{let{class:E,items:h=[],vertical:S=!0,compact:L=!1,...H}=f,W={info:"icon-[lucide--info]",success:"icon-[lucide--check-circle]",warning:"icon-[lucide--alert-triangle]",error:"icon-[lucide--alert-circle]"};return _("ul",{...H,class:()=>K(`timeline ${G(S)?"timeline-vertical":"timeline-horizontal"} ${G(L)?"timeline-compact":""}`,E)},()=>{let D=(typeof h==="function"?h():h)||[];return D.map((Y,J)=>{let A=J===0,P=J===D.length-1,X=Y.type||"success",Z=()=>G(Y.completed),Q=()=>J>0&&G(D[J-1].completed),y=(N)=>typeof N==="function"?N():N;return _("li",{class:"flex-1"},[!A?_("hr",{class:()=>Q()?"bg-primary":""}):null,_("div",{class:"timeline-start"},[()=>y(Y.title)]),_("div",{class:"timeline-middle"},[()=>Y.icon?C(Y.icon):C(W[X]||W.success)]),_("div",{class:"timeline-end timeline-box shadow-sm"},[()=>y(Y.detail)]),!P?_("hr",{class:()=>Z()?"bg-primary":""}):null])})})};var bf={};B(bf,{Toast:()=>p_});var p_=(f,E="alert-success",h=3500)=>{let S=document.getElementById("sigpro-toast-container");if(!S)S=_("div",{id:"sigpro-toast-container",class:"fixed top-0 right-0 z-[9999] p-4 flex flex-col gap-2 pointer-events-none"}),document.body.appendChild(S);let L=_("div",{style:"display: contents"});S.appendChild(L);let H,W=()=>{clearTimeout(H);let J=L.firstElementChild;if(J&&!J.classList.contains("opacity-0"))J.classList.add("translate-x-full","opacity-0"),setTimeout(()=>{if(Y.destroy(),L.remove(),!S.hasChildNodes())S.remove()},300);else Y.destroy(),L.remove()},Y=Yf(()=>{let J=C("icon-[lucide--x]"),A=_("div",{class:`alert alert-soft ${E} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`},[_("span",{},[typeof f==="function"?f():f]),s({class:"btn-xs btn-circle btn-ghost",onclick:W},J)]);return requestAnimationFrame(()=>A.classList.remove("translate-x-10","opacity-0")),A},L);if(h>0)H=setTimeout(W,h);return W};var df={};B(df,{Tooltip:()=>l_});var l_=(f,E)=>_("div",{...f,class:()=>K("tooltip w-full",f.class),"data-tip":f.tip},E);var f_={...Jf,...Pf,...Xf,...Qf,...Gf,...Kf,...Zf,...yf,...Bf,...qf,...Cf,...zf,...Rf,...Vf,...Af,...Nf,...Uf,...wf,...kf,...Ff,...Of,...Mf,...jf,...xf,...If,...vf,...uf,...nf,...Tf,...rf,...bf,...df},__={Locale:af,tt:sf};if(typeof window<"u")Object.entries({...f_,...__}).forEach(([f,E])=>{Object.defineProperty(window,f,{value:E,writable:!1,configurable:!0,enumerable:!0})}),console.log("SigProUI installed");})();