All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
2 lines
31 KiB
JavaScript
2 lines
31 KiB
JavaScript
(()=>{var{defineProperty:V,getOwnPropertyNames:me,getOwnPropertyDescriptor:ge}=Object,ve=Object.prototype.hasOwnProperty;function be(t){return this[t]}var ye=(t)=>{var e=(Ut??=new WeakMap).get(t),a;if(e)return e;if(e=V({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function"){for(var s of me(t))if(!ve.call(e,s))V(e,s,{get:be.bind(t,s),enumerable:!(a=ge(t,s))||a.enumerable})}return Ut.set(t,e),e},Ut;var he=(t)=>t;function xe(t,e){this[t]=he.bind(null,e)}var f=(t,e)=>{for(var a in e)V(t,a,{get:e[a],enumerable:!0,configurable:!0,set:xe.bind(e,a)})};var Sn={};f(Sn,{Utils:()=>ie,Components:()=>re});var nt={};f(nt,{Accordion:()=>Ee});var E=(t)=>typeof t==="function",Q=(t)=>t&&typeof t==="object",z=Array.isArray,D=typeof document<"u"?document:null,Yt=(t)=>t?._isRuntime?t.container:t instanceof Node?t:D.createTextNode(t==null?"":String(t)),x=null,$=null,P=!1,j=0,q=new Set,Kt=new WeakMap,X=Symbol("iter"),G=new WeakMap,L=(t)=>{if(!t||t._disposed)return;t._disposed=!0;let e=[t];while(e.length){let a=e.pop();if(a._cleanups)a._cleanups.forEach((s)=>s()),a._cleanups.clear();if(a._children)a._children.forEach((s)=>e.push(s)),a._children.clear();if(a._deps)a._deps.forEach((s)=>s.delete(a)),a._deps.clear()}},we=(t)=>{if($)($._mounts||=[]).push(t)},I=(t)=>{if($)($._cleanups||=new Set).add(t)},$e=(t)=>{let e=x;x=null;try{return t()}finally{x=e}},W=(t,e=!1)=>{let a=()=>{if(a._disposed)return;if(a._deps)a._deps.forEach((r)=>r.delete(a));if(a._cleanups)a._cleanups.forEach((r)=>r()),a._cleanups.clear();let s=x,c=$;x=$=a;try{return a._result=t()}catch(r){console.error("[SigPro]",r)}finally{x=s,$=c}};if(a._deps=a._cleanups=a._children=null,a._disposed=!1,a._isComputed=e,a._depth=x?x._depth+1:0,a._mounts=[],a._parent=$,$)($._children||=new Set).add(a);return a},Vt=()=>{if(P)return;P=!0;let t=Array.from(q).sort((e,a)=>e._depth-a._depth);q.clear();for(let e of t)if(!e._disposed)e();P=!1},_e=(t)=>{j++;try{return t()}finally{if(j--,j===0&&q.size>0&&!P)Vt()}},C=(t,e=!1)=>{if(!e&&x&&!x._disposed)t.add(x),(x._deps||=new Set).add(t);else if(e&&t.size>0){let a=!1;for(let s of t){if(s===x||s._disposed)continue;if(s._isComputed){if(s._dirty=!0,s._subs)C(s._subs,!0)}else q.add(s),a=!0}if(a&&!P&&j===0)queueMicrotask(Vt)}},v=(t,e=null)=>{let a=new Set;if(E(t)){let s,c=()=>{if(c._dirty){let r=x;x=c;try{let o=t();if(!Object.is(s,o))s=o,C(a,!0)}finally{x=r}c._dirty=!1}return C(a),s};if(c._isComputed=!0,c._subs=a,c._dirty=!0,c._deps=null,c._disposed=!1,c.stop=()=>{},$)I(c.stop);return c}if(e)try{t=JSON.parse(localStorage.getItem(e))??t}catch(s){}return(...s)=>{if(s.length){let c=E(s[0])?s[0](t):s[0];if(!Object.is(t,c)){if(t=c,e)localStorage.setItem(e,JSON.stringify(t));C(a,!0)}}return C(a),t}},Xt=(t)=>{if(!Q(t))return t;let e=Kt.get(t);if(e)return e;let a=new Map,s=(c)=>{let r=a.get(c);if(!r)a.set(c,r=new Set);return r};return e=new Proxy(t,{get(c,r,o){if(typeof r!=="symbol")C(s(r));return Xt(Reflect.get(c,r,o))},set(c,r,o,l){let i=!Reflect.has(c,r),u=Reflect.get(c,r,l),g=Reflect.set(c,r,o,l);if(g&&!Object.is(u,o)){if(C(s(r),!0),i)C(s(X),!0)}return g},deleteProperty(c,r){let o=Reflect.deleteProperty(c,r);if(o)C(s(r),!0),C(s(X),!0);return o},ownKeys(c){return C(s(X)),Reflect.ownKeys(c)}}),Kt.set(t,e),e},k=(t,e)=>{if(e===void 0){let s=W(t);return s(),()=>L(s)}let a=W(()=>{let s=Array.isArray(t)?t.map((c)=>c()):t();$e(()=>e(s))});return a(),()=>L(a)},Z=(t)=>{if(t._cleanups)t._cleanups.forEach((e)=>e()),t._cleanups.clear();if(t._ownerEffect)L(t._ownerEffect);if(t.childNodes)t.childNodes.forEach(Z)},Te=/^\s*(javascript|data|vbscript):/i,ke=(t)=>t==="src"||t==="href"||t.startsWith("on"),Jt=(t,e)=>{if(e==null||e===!1)return null;if(ke(t)){let a=String(e);if(Te.test(a))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${t}`),"#"}return e},n=(t,e={},a=[])=>{if(e instanceof Node||z(e)||!Q(e))a=e,e={};if(E(t)){let o={_mounts:[],_cleanups:new Set},l=W(()=>{let d=t(e,{children:a,emit:(y,...h)=>e[`on${y[0].toUpperCase()}${y.slice(1)}`]?.(...h)});return l._result=d,d});l();let i=l._result;if(i==null)return null;let u=i instanceof Node||z(i)&&i.every((d)=>d instanceof Node)?i:D.createTextNode(String(i)),g=(d)=>{if(Q(d)&&!d._isRuntime)d._mounts=l._mounts||[],d._cleanups=l._cleanups||new Set,d._ownerEffect=l};return z(u)?u.forEach(g):g(u),u}let s=/^(svg|path|circle|rect|line|poly(line|gon)|g|defs|text(path)?|tspan|use|symbol|image|marker|ellipse)$/i.test(t),c=s?D.createElementNS("http://www.w3.org/2000/svg",t):D.createElement(t);c._cleanups=new Set;for(let o in e){if(!e.hasOwnProperty(o))continue;let l=e[o];if(o==="ref"){E(l)?l(c):l.current=c;continue}if(s&&o.startsWith("xlink:")){val==null?c.removeAttributeNS("http://www.w3.org/1999/xlink",o.slice(6)):c.setAttributeNS("http://www.w3.org/1999/xlink",o.slice(6),val);continue}if(o.startsWith("on")){let i=o.slice(2).toLowerCase();c.addEventListener(i,l);let u=()=>c.removeEventListener(i,l);c._cleanups.add(u),I(u)}else if(E(l)){let i=W(()=>{let u=Jt(o,l());if(o==="class")c.className=u||"";else if(u==null)c.removeAttribute(o);else if(o in c&&!s)c[o]=u;else c.setAttribute(o,u===!0?"":u)});if(i(),c._cleanups.add(()=>L(i)),I(()=>L(i)),/^(INPUT|TEXTAREA|SELECT)$/.test(c.tagName)&&(o==="value"||o==="checked")){let u=o==="checked"?"change":"input";c.addEventListener(u,(g)=>l(g.target[o]))}}else{let i=Jt(o,l);if(i!=null)if(o in c&&!s)c[o]=i;else c.setAttribute(o,i===!0?"":i)}}let r=(o)=>{if(z(o))return o.forEach(r);if(E(o)){let l=D.createTextNode("");c.appendChild(l);let i=[],u=W(()=>{let g=o(),d=(z(g)?g:[g]).map(Yt);i.forEach((h)=>{if(h._isRuntime)h.destroy();else Z(h);if(h.parentNode)h.remove()});let y=l;for(let h=d.length-1;h>=0;h--){let m=d[h];if(m.parentNode!==y.parentNode)y.parentNode?.insertBefore(m,y);if(m._mounts)m._mounts.forEach((b)=>b());y=m}i=d});u(),c._cleanups.add(()=>L(u)),I(()=>L(u))}else{let l=Yt(o);if(c.appendChild(l),l._mounts)l._mounts.forEach((i)=>i())}};return r(a),c},H=(t)=>{let e=new Set,a=[],s=$,c=x,r=D.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),$={_cleanups:e,_mounts:a},x=null;let o=(l)=>{if(!l)return;if(l._isRuntime)e.add(l.destroy),r.appendChild(l.container);else if(z(l))l.forEach(o);else r.appendChild(l instanceof Node?l:D.createTextNode(String(l==null?"":l)))};try{o(t({onCleanup:(l)=>e.add(l)}))}finally{$=s,x=c}return a.forEach((l)=>l()),{_isRuntime:!0,container:r,destroy:()=>{e.forEach((l)=>l()),Z(r),r.remove()}}},N=(t,e,a=null)=>{let s=D.createTextNode(""),c=n("div",{style:"display:contents"},[s]),r=null;return k(()=>!!(E(t)?t():t),(o)=>{if(r)r.destroy(),r=null;let l=o?e:a;if(l)r=H(()=>E(l)?l():l),c.insertBefore(r.container,s)}),I(()=>r?.destroy()),c},_=(t,e,a)=>{let s=D.createTextNode(""),c=n("div",{style:"display:contents"},[s]),r=new Map;return k(()=>(E(t)?t():t)||[],(o)=>{let l=new Map,i=[],u=o||[];for(let d=0;d<u.length;d++){let y=u[d],h=a?a(y,d):y?.id??d,m=r.get(h);if(!m)m=H(()=>e(y,d));else r.delete(h);l.set(h,m),i.push(m)}r.forEach((d)=>d.destroy());let g=s;for(let d=i.length-1;d>=0;d--){let y=i[d].container;if(y.nextSibling!==g)c.insertBefore(y,g);g=y}r=l}),c},O=(t)=>{let e=()=>window.location.hash.slice(1)||"/",a=v(e()),s=()=>a(e());window.addEventListener("hashchange",s),I(()=>window.removeEventListener("hashchange",s));let c=n("div",{class:"router-hook"}),r=null;return k([a],()=>{let o=a(),l=t.find((i)=>{let u=i.path.split("/").filter(Boolean),g=o.split("/").filter(Boolean);return u.length===g.length&&u.every((d,y)=>d[0]===":"||d===g[y])})||t.find((i)=>i.path==="*");if(l){r?.destroy();let i={};l.path.split("/").filter(Boolean).forEach((u,g)=>{if(u[0]===":")i[u.slice(1)]=o.split("/").filter(Boolean)[g]}),O.params(i),r=H(()=>E(l.component)?l.component(i):l.component),c.replaceChildren(r.container)}}),c};O.params=v({});O.to=(t)=>window.location.hash=t.replace(/^#?\/?/,"#/");O.back=()=>window.history.back();O.path=()=>window.location.hash.replace(/^#/,"")||"/";var Se=(t,e,{enter:a,leave:s}={})=>{let c=n("div",{style:"display:contents"}),r=null,o=(l,i)=>{let u=!1,g=()=>!u&&(u=!0,i());if(!l)return g();"transitionend animationend".split(" ").map((d)=>l.addEventListener(d,g,{once:!0})),setTimeout(g,500)};return k(t,(l)=>{if(l&&!r){let i=(r=H(e)).container.firstChild;if(c.appendChild(r.container),a&&i)i.classList.add(a),i.clientTop,i.classList.add(a+"-active"),o(i,()=>i.classList.remove(a,a+"-active"))}else if(!l&&r){let i=r.container.firstChild,u=()=>(r?.destroy(),r=null);s&&i?(i.classList.add(s),o(i,u)):u()}}),I(()=>r?.destroy()),c},M=(t,e)=>{let a=typeof e==="string"?D.querySelector(e):e;if(!a)return;if(G.has(a))G.get(a).destroy();let s=H(E(t)?t:()=>t);return a.replaceChildren(s.container),G.set(a,s),s},Ce=Object.freeze({$:v,$$:Xt,Watch:k,Tag:n,Render:H,If:N,For:_,Router:O,Mount:M,onMount:we,onUnmount:I,Anim:Se,Batch:_e});if(typeof window<"u")Object.assign(window,Ce),"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((t)=>{let e=t[0].toUpperCase()+t.slice(1);window[e]=(a,s)=>n(t,a,s)});var et={};f(et,{Collapse:()=>tt});var tt=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`collapse ${t.class??""}`},e)};var Ee=(t)=>{let e=t.name||`accordion-${Math.random().toString(36).slice(2,9)}`;return n("div",{class:`space-y-2 ${t.class??""}`},t.items.map((a)=>tt({...a,name:e,type:"radio",class:a.class},a.children)))};var at={};f(at,{Alert:()=>De});var De=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`alert ${t.class??""}`},e)};var st={};f(st,{Autocomplete:()=>Ae});var Ae=(t)=>{let e=v(""),a=v(!1),s=v(-1),c=v([]);k(()=>{return(typeof t.value==="function"?t.value():t.value)||""},(l)=>e(l)),k(()=>{let l=String(e()).toLowerCase(),i=typeof t.items==="function"?t.items():t.items,u=l?i.filter((g)=>(typeof g==="string"?g:g.label).toLowerCase().includes(l)):i;c(u)});let r=(l)=>{let i=typeof l==="string"?l:l.label,u=typeof l==="string"?l:l.value;if(e(i),typeof t.value==="function")t.value(u);t.onselect?.(l),a(!1),s(-1)},o=(l)=>{let i=c();if(l.key==="ArrowDown")l.preventDefault(),a(!0),s(Math.min(s()+1,i.length-1));else if(l.key==="ArrowUp")l.preventDefault(),s(Math.max(s()-1,0));else if(l.key==="Enter"&&s()>=0)l.preventDefault(),r(i[s()]);else if(l.key==="Escape")a(!1)};return n("div",{class:`relative w-full ${t.class??""}`},[n("label",{class:"input input-bordered w-full"},[n("span",{class:"icon-[lucide--search]"}),n("input",{...t,type:"text",class:"grow",value:e,placeholder:t.placeholder||"Buscar...",onfocus:()=>a(!0),onblur:()=>setTimeout(()=>a(!1),150),onkeydown:o,oninput:(l)=>{let i=l.target.value;if(e(i),typeof t.value==="function")t.value(i);a(!0),s(-1)}})]),n("ul",{class:"absolute 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:()=>`display: ${a()&&c().length?"block":"none"};`},[_(c,(l,i)=>n("li",{},[n("a",{class:()=>`block w-full ${s()===i?"active bg-primary text-primary-content":""}`,onclick:()=>r(l),onmouseenter:()=>s(i)},typeof l==="string"?l:l.label)]),(l,i)=>(typeof l==="string"?l:l.value)+i),()=>c().length===0?n("li",{class:"flex justify-center p-4 opacity-50"},n("span",{class:"icon-[lucide--search-x] text-2xl"})):null])])};var lt={};f(lt,{Badge:()=>Ne});var Ne=(t,e)=>{return e===void 0&&(e=t,t={}),n("span",{...t,class:`badge ${t.class??""}`},e)};var ct={};f(ct,{Button:()=>Ie});var Ie=(t,e)=>{return e===void 0&&(e=t,t={}),n("button",{...t,class:`btn ${t.class??""}`},e)};var rt={};f(rt,{Calendar:()=>ot});var ot=(t)=>{let e=v(new Date),a=v(null),s=v(0),c=v(0),r=()=>{return(typeof t.range==="function"?t.range():t.range)===!0},o=new Date,l=`${o.getFullYear()}-${String(o.getMonth()+1).padStart(2,"0")}-${String(o.getDate()).padStart(2,"0")}`,i=(m)=>{let b=m.getFullYear(),w=String(m.getMonth()+1).padStart(2,"0"),T=String(m.getDate()).padStart(2,"0");return`${b}-${w}-${T}`},u=()=>{return typeof t.value==="function"?t.value():t.value},g=(m)=>{let b=i(m),w=u();if(r())if(!w?.start||w.start&&w.end){let T={start:b,end:null,...t.hour&&{startHour:s()}};t.onChange?.(T)}else{let T=w.start,F;if(b<T)F={start:b,end:T};else F={start:T,end:b};if(t.hour)F.startHour=w.startHour!==void 0?w.startHour:s(),F.endHour=c();t.onChange?.(F)}else{let T=t.hour?`${b}T${String(s()).padStart(2,"0")}:00:00`:b;t.onChange?.(T)}},d=(m)=>{let b=e();e(new Date(b.getFullYear(),b.getMonth()+m,1))},y=(m)=>{let b=e();e(new Date(b.getFullYear()+m,b.getMonth(),1))},h=({value:m,onChange:b})=>{return n("div",{class:"flex-1"},[n("div",{class:"flex gap-2 items-center"},[n("input",{type:"range",min:0,max:23,value:m,class:"range range-xs flex-1",oninput:(w)=>b(parseInt(w.target.value))}),n("span",{class:"text-sm font-mono min-w-[48px] text-center"},()=>String(typeof m==="function"?m():m).padStart(2,"0")+":00")])])};return n("div",{class:`p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box w-80 select-none ${t.class??""}`.trim()},[n("div",{class:"flex justify-between items-center mb-4 gap-1"},[n("div",{class:"flex gap-0.5"},[n("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>y(-1)},n("span",{class:"icon-[lucide--chevrons-left]"})),n("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>d(-1)},n("span",{class:"icon-[lucide--chevron-left]"}))]),n("span",{class:"font-bold uppercase flex-1 text-center"},[()=>e().toLocaleString("es-ES",{month:"short",year:"numeric"})]),n("div",{class:"flex gap-0.5"},[n("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>d(1)},n("span",{class:"icon-[lucide--chevron-right]"})),n("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>y(1)},n("span",{class:"icon-[lucide--chevrons-right]"}))])]),n("div",{class:"grid grid-cols-7 gap-1",onmouseleave:()=>a(null)},[...["L","M","X","J","V","S","D"].map((m)=>n("div",{class:"text-[10px] opacity-40 font-bold text-center"},m)),()=>{let m=e(),b=m.getFullYear(),w=m.getMonth(),T=new Date(b,w,1).getDay(),F=T===0?6:T-1,ue=new Date(b,w+1,0).getDate(),U=[];for(let B=0;B<F;B++)U.push(n("div"));for(let B=1;B<=ue;B++){let qt=new Date(b,w,B),S=i(qt);U.push(n("button",{type:"button",class:()=>{let A=u(),Y=a(),fe=typeof A==="string"?A.split("T")[0]===S:A?.start===S,de=A?.end===S,K=!1;if(r()&&A?.start){let J=A.start;if(!A.end&&Y)K=S>J&&S<=Y||S<J&&S>=Y;else if(A.end)K=S>J&&S<A.end}return`${"btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative"} ${fe||de?"btn-primary z-10":K?"bg-primary/20 border-none rounded-none":"btn-ghost"} ${S===l?"ring-1 ring-primary ring-inset font-black text-primary":""}`.trim()},onmouseenter:()=>{if(r())a(S)},onclick:()=>g(qt)},B.toString()))}return U}]),t.hour?n("div",{class:"mt-3 pt-2 border-t border-base-300"},[r()?n("div",{class:"flex gap-4"},[h({value:s,onChange:(m)=>s(m)}),h({value:c,onChange:(m)=>c(m)})]):h({value:s,onChange:(m)=>s(m)})]):null])};var it={};f(it,{CardTitle:()=>Fe,CardBody:()=>Be,CardActions:()=>Le,Card:()=>Re});var Re=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`card ${t.class??""}`},e)},Fe=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`card-title ${t.class??""}`},e)},Be=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`card-body ${t.class??""}`},e)},Le=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`card-actions ${t.class??""}`},e)};var ut={};f(ut,{CarouselItem:()=>He,Carousel:()=>ze});var ze=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`carousel ${t.class??""}`},e)},He=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`carousel-item ${t.class??""}`},e)};var ft={};f(ft,{ChatMessage:()=>Oe,ChatImage:()=>Qt,ChatHeader:()=>Zt,ChatFooter:()=>Mt,ChatBubble:()=>te,Chat:()=>Gt});var Gt=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`chat ${t.class??""}`},e)},Qt=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`chat-image avatar ${t.class??""}`},n("div",{class:"w-10 rounded-full"},typeof e==="string"?n("img",{src:e,alt:"avatar"}):e))},Zt=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`chat-header ${t.class??""}`},e)},Mt=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`chat-footer ${t.class??""}`},e)},te=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`chat-bubble ${t.class??""}`},e)},Oe=(t)=>{let{position:e="start",avatar:a,header:s,message:c,footer:r,bubbleClass:o,...l}=t;return Gt({...l,class:`chat-${e} ${t.class??""}`},[a&&Qt(a),s&&Zt(s),te({class:o},c),r&&Mt(r)])};var dt={};f(dt,{Checkbox:()=>Pe});var Pe=(t)=>n("input",{...t,type:"checkbox",class:`checkbox ${t.class??""}`});var mt={};f(mt,{Colorpicker:()=>We});var We=(t)=>{let e=v(!1),a=["#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"],s=()=>{let c=t.value;return(typeof c==="function"?c():c)||"#000000"};return n("div",{class:`relative w-fit ${t.class??""}`},[n("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:(c)=>{c.stopPropagation(),e(!e())},...t},[n("div",{class:"size-5 rounded-sm shadow-inner border border-black/10 shrink-0",style:()=>`background-color: ${s()}`}),t.label?n("span",{class:"opacity-80"},t.label):null]),N(e,()=>n("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:(c)=>c.stopPropagation()},[n("div",{class:"grid grid-cols-8 gap-1"},a.map((c)=>n("button",{type:"button",style:`background-color: ${c}`,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 p-0 min-h-0 ${s().toLowerCase()===c.toLowerCase()?"ring-2 ring-offset-1 ring-primary z-10 scale-110":""}`},onclick:()=>{if(typeof t.value==="function")t.value(c);e(!1)}})))])),N(e,()=>n("div",{class:"fixed inset-0 z-[100]",onclick:()=>e(!1)}))])};var gt={};f(gt,{Datepicker:()=>pe});var pe=(t)=>{let e=v(!1),a=()=>{return(typeof t.range==="function"?t.range():t.range)===!0},s=v("");k(()=>{let o=typeof t.value==="function"?t.value():t.value;if(!o){s("");return}let l="";if(typeof o==="string")l=t.hour&&o.includes("T")?o.replace("T"," "):o;else if(o.start&&o.end){let i=t.hour&&o.startHour!==void 0?`${o.start} ${String(o.startHour).padStart(2,"0")}:00`:o.start,u=t.hour&&o.endHour!==void 0?`${o.end} ${String(o.endHour).padStart(2,"0")}:00`:o.end;l=`${i} - ${u}`}else if(o.start)l=`${t.hour&&o.startHour!==void 0?`${o.start} ${String(o.startHour).padStart(2,"0")}:00`:o.start}...`;s(l)});let c=(o)=>{if(typeof t.value==="function")t.value(o);if(!a()||o?.end!==void 0&&o?.end!==null)e(!1)},r=(o)=>{o.stopPropagation(),e(!e())};return n("div",{class:`relative w-full ${t.class??""}`},[n("label",{class:"input input-bordered w-full",onclick:r},[n("span",{class:"icon-[lucide--calendar]"}),n("input",{...t,type:"text",class:"grow",value:s,readonly:!0,placeholder:t.placeholder||(a()?"Seleccionar rango...":"Seleccionar fecha...")})]),N(e,()=>n("div",{class:"absolute left-0 mt-2 z-[100]",onclick:(o)=>o.stopPropagation()},[ot({value:t.value,range:a(),hour:t.hour,onChange:c})])),N(e,()=>n("div",{class:"fixed inset-0 z-[90]",onclick:()=>e(!1)}))])};var vt={};f(vt,{Sidebar:()=>qe,Drawer:()=>je});var je=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`drawer ${t.class??""}`},e)},qe=(t)=>{let e=t.id||`drawer-${Math.random().toString(36).slice(2,9)}`;return n("div",{...t,class:`drawer ${t.class??""}`},[n("input",{id:e,type:"checkbox",class:"drawer-toggle",checked:()=>typeof t.open==="function"?t.open():t.open,onchange:(a)=>typeof t.open==="function"&&t.open(a.target.checked)}),n("div",{class:"drawer-content"},t.children),n("div",{class:"drawer-side"},[n("label",{for:e,class:"drawer-overlay",onclick:()=>typeof t.open==="function"&&t.open(!1)}),n("div",{class:"min-h-full bg-base-200 w-80 p-4"},typeof t.content==="function"?t.content():t.content)])])};var bt={};f(bt,{Dropdown:()=>Ue});var R=null;if(typeof window<"u"&&!window.__dropdownHandlerRegistered)window.addEventListener("click",(t)=>{if(R&&!R.contains(t.target))R.open=!1,R=null}),window.__dropdownHandlerRegistered=!0;var Ue=(t)=>n("details",{...t,class:`dropdown ${t.class??""}`,onclick:(e)=>{let a=e.currentTarget;if(R&&R!==a)R.open=!1;setTimeout(()=>{R=a.open?a:null},0)}},t.children);var yt={};f(yt,{Fab:()=>Ye});var Ye=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`fab ${t.class??""}`},e)};var ht={};f(ht,{Fieldset:()=>Ke});var Ke=(t,e)=>n("fieldset",{...t,class:`fieldset ${t.class??""}`},[t.legend?n("legend",{class:"fieldset-legend"},t.legend):null,e]);var xt={};f(xt,{Fileinput:()=>Je});var Je=(t)=>{let e=v([]),a=v(!1),s=v(null),c=(t.max||2)*1024*1024,r=(l)=>{let i=Array.from(l);if(s(null),i.find((u)=>u.size>c)){s(`Máx ${t.max||2}MB`);return}e([...e(),...i]),t.onselect?.(e())},o=(l)=>{let i=e().filter((u,g)=>g!==l);e(i),t.onselect?.(i)};return n("div",{...t,class:`fieldset w-full p-0 ${t.class??""}`},[n("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 ${a()?"border-primary bg-primary/10":"border-base-content/20 bg-base-100 hover:bg-base-200"}`,ondragover:(l)=>{l.preventDefault(),a(!0)},ondragleave:()=>a(!1),ondrop:(l)=>{l.preventDefault(),a(!1),r(l.dataTransfer.files)}},[n("div",{class:"flex items-center gap-3 w-full"},[n("span",{class:"icon-[lucide--upload]"}),n("span",{class:"text-sm opacity-70 truncate grow text-left"},"Arrastra o selecciona archivos..."),n("span",{class:"text-[10px] opacity-40 shrink-0"},`Máx ${t.max||2}MB`)]),n("input",{type:"file",multiple:!0,accept:t.accept||"*",class:"hidden",onchange:(l)=>r(l.target.files)})]),()=>s()&&n("span",{class:"text-[10px] text-error mt-1 px-1 font-medium"},s()),N(()=>e().length>0,()=>n("ul",{class:"mt-2 space-y-1"},[_(e,(l,i)=>n("li",{class:"flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300"},[n("div",{class:"flex items-center gap-2 truncate"},[n("span",{class:"opacity-50"},"\uD83D\uDCC4"),n("span",{class:"truncate font-medium max-w-[200px]"},l.name),n("span",{class:"text-[9px] opacity-40"},`(${(l.size/1024).toFixed(0)} KB)`)]),n("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle",onclick:(u)=>{u.preventDefault(),o(i)}},n("span",{class:"icon-[lucide--x]"}))]),(l)=>l.name+l.lastModified)]))])};var wt={};f(wt,{Icon:()=>Ve});var Ve=(t,e)=>{if(typeof t==="string"){if(t.includes("icon-")||t.startsWith("lucide-"))return n("span",{class:t},e);return n("span",{class:"icon"},t)}if(!t)return null;let{class:a,...s}=t;return n("span",{...s,class:a},e)};var $t={};f($t,{Indicator:()=>Xe});var Xe=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`indicator ${t.class??""}`},[t.value?n("span",{class:`indicator-item badge ${t.class??""}`},t.value):null,e])};var _t={};f(_t,{Input:()=>Ge});var Ge=(t)=>n("input",{...t,class:`input ${t.class??""}`});var Tt={};f(Tt,{Kbd:()=>Qe});var Qe=(t,e)=>{return e===void 0&&(e=t,t={}),n("kbd",{...t,class:`kbd ${t.class??""}`},e)};var kt={};f(kt,{Loading:()=>Ze});var Ze=(t,e)=>{return e===void 0&&(e=t,t={}),n("span",{...t,class:`loading loading-spinner ${t.class??""}`},e)};var St={};f(St,{MenuItems:()=>ee,Menu:()=>Me});var Me=(t,e)=>{return e===void 0&&(e=t,t={}),n("ul",{...t,class:`menu ${t.class??""}`},e)},ee=(t)=>{let{items:e,keyFn:a=(r,o)=>r.id??o}=t;return _(typeof e==="function"?e:()=>e||[],(r)=>{if(r.children)return n("li",{},[n("details",{},[n("summary",{},r.label),n("ul",{},ee({items:r.children}))])]);return n("li",{},n("a",{href:r.href,onclick:r.onclick?(o)=>{if(!r.href)o.preventDefault();r.onclick(o)}:null},r.label))},a)};var Ct={};f(Ct,{Modal:()=>tn});var tn=(t)=>{let e=null;k(()=>{let s=typeof t.open==="function"?t.open():t.open;if(!e)return;s?e.showModal():e.close()});let a=()=>typeof t.open==="function"&&t.open(!1);return n("dialog",{...t,ref:(s)=>e=s,class:`modal ${t.class??""}`,onclose:a,oncancel:a},[n("div",{class:"modal-box"},[t.title&&n("h3",{class:"text-lg font-bold"},t.title),t.children,n("div",{class:"modal-action"},[t.actions||n("button",{class:"btn",onclick:a},"Cerrar")])]),n("form",{method:"dialog",class:"modal-backdrop"},[n("button",{},"close")])])};var Et={};f(Et,{Navbar:()=>en});var en=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`navbar ${t.class??""}`},e)};var Dt={};f(Dt,{Radial:()=>nn});var nn=(t,e)=>{e===void 0&&(e=t,t={});let a=t.value!=null?t.value/(t.max||100)*100:0,s=`--value: ${a}; --max: 100;`;return n("div",{...t,class:`radial-progress ${t.class??""}`,style:s,role:"progressbar","aria-valuenow":t.value,"aria-valuemin":0,"aria-valuemax":t.max||100},e||`${Math.round(a)}%`)};var At={};f(At,{Radio:()=>an});var an=(t)=>n("input",{...t,type:"radio",class:`radio ${t.class??""}`});var Nt={};f(Nt,{Range:()=>sn});var sn=(t)=>n("input",{...t,type:"range",class:`range ${t.class??""}`});var It={};f(It,{Rating:()=>ln});var ln=(t,e)=>{e===void 0&&(e=t,t={});let a=`rating-${Math.random().toString(36).slice(2,7)}`;return n("div",{...t,class:`rating ${t.class??""}`},e||Array.from({length:t.count||5},(s,c)=>{let r=c+1;return n("input",{type:"radio",name:a,class:`mask ${t.mask||"mask-star"}`,checked:()=>typeof t.value==="function"?t.value()===r:t.value===r,onchange:()=>{if(t.onchange)t.onchange(r);else if(typeof t.value==="function")t.value(r)}})}))};var Rt={};f(Rt,{SkeletonText:()=>on,Skeleton:()=>cn});var cn=(t)=>n("div",{...t,class:`skeleton ${t.class??""}`}),on=(t)=>{return n("div",{...t,class:"space-y-2"},Array.from({length:t.lines||3},()=>n("div",{class:`skeleton h-4 w-full ${t.class??""}`})))};var Ft={};f(Ft,{Select:()=>rn,Options:()=>un});var rn=(t,e)=>{return e===void 0&&(e=t,t={}),n("select",{...t,class:`select ${t.class??""}`},e)},un=(t)=>{let e=t.placeholder?n("option",{disabled:t.placeholderDisabled??!0,selected:!0},t.placeholder):null,a=_(()=>[...typeof t.items==="function"?t.items():t.items||[]],(s)=>{let c=typeof s==="string"?s:s.value,r=typeof s==="string"?s:s.label;return n("option",{value:c},r)},t.keyFn||((s)=>typeof s==="string"?s:s.value));return e?[e,a]:a};var Bt={};f(Bt,{Stack:()=>fn});var fn=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`stack ${t.class??""}`},e)};var p={};f(p,{Stats:()=>dn,Stat:()=>mn});var dn=(t,e)=>{e===void 0&&(e=t,t={});let a=t.vertical?"stats-vertical":"stats-horizontal";return n("div",{...t,class:`stats ${a} ${t.class??""}`.trim()},e)},mn=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`stat ${t.class??""}`},[t.icon&&n("div",{class:"stat-figure"},t.icon),t.label&&n("div",{class:"stat-title"},t.label),t.value&&n("div",{class:"stat-value"},t.value),t.desc&&n("div",{class:"stat-desc"},t.desc),t.actions&&n("div",{class:"stat-actions"},t.actions),e])};var Lt={};f(Lt,{Swap:()=>gn});var gn=(t)=>{return n("label",{...t,class:`swap ${t.class??""}`},[n("input",{type:"checkbox",checked:()=>typeof t.value==="function"?t.value():t.value,onchange:(e)=>typeof t.value==="function"&&t.value(e.target.checked)}),n("div",{class:"swap-on"},t.on),n("div",{class:"swap-off"},t.off)])};var zt={};f(zt,{Table:()=>vn,Rows:()=>bn});var vn=(t,e)=>{return e===void 0&&(e=t,t={}),n("table",{...t,class:`table ${t.class??""}`},e)},bn=(t)=>{let e=typeof t.items==="function"?t.items():t.items||[],a=t.header!==!1&&t.columns?.some((c)=>c.label)?n("thead",{},n("tr",{},t.columns.map((c)=>n("th",{class:c.class},c.label)))):null,s=n("tbody",{},[_(e,(c,r)=>n("tr",{},t.columns.map((o)=>{let l=o.render?o.render(c,r):c[o.key];return n("td",{class:o.class},l)})),t.keyFn||((c,r)=>c.id??r))]);return[a,s]};var Ht={};f(Ht,{Tabs:()=>yn,TabItems:()=>hn,TabContent:()=>ae,TabClose:()=>se,Tab:()=>ne});var yn=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`tabs ${t.class??""}`},e)},ne=(t,e)=>{return e===void 0&&(e=t,t={}),n("a",{...t,role:"tab",class:`tab ${t.class??""}`},e)},ae=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`tab-content ${t.class??""}`},e)},se=(t)=>n("a",{...t,role:"tab",class:`tab ${t.class??""}`},[n("span",{class:"flex items-center"},[t.label,n("span",{class:"icon-[lucide--x] w-3.5 h-3.5 ml-2 cursor-pointer hover:opacity-70",onclick:(e)=>{e.stopPropagation(),t.onClose?.(e)}})])]),hn=(t)=>{let e=typeof t.items==="function"?t.items:()=>t.items||[];return _(e,(a,s)=>{return[(a.closable?se:ne)({...a,class:()=>t.activeIndex()===s?`tab-active ${a.class??""}`:a.class,onclick:(r)=>{r.preventDefault(),t.activeIndex(s),a.onclick?.(r)},onClose:()=>t.onClose?.(s,a)}),ae({style:()=>`display: ${t.activeIndex()===s?"block":"none"};`},typeof a.content==="function"?a.content():a.content)]},(a,s)=>a.id??s)};var Ot={};f(Ot,{Textarea:()=>xn});var xn=(t)=>n("textarea",{...t,class:`textarea ${t.class??""}`});var Pt={};f(Pt,{TextRotate:()=>wn});var wn=(t)=>{let e=Array.isArray(t.words)?t.words:typeof t.words==="string"?t.words.split(","):[];return n("span",{...t,class:`text-rotate ${t.class??""}`},[n("span",{},e.map((a)=>n("span",{},a)))])};var Wt={};f(Wt,{Timeline:()=>$n});var $n=(t,e)=>{e===void 0&&(e=t,t={});let a=t.vertical!==!1,s=t.compact===!0;return n("ul",{...t,class:`timeline ${a?"timeline-vertical":"timeline-horizontal"} ${s?"timeline-compact":""} ${t.class??""}`.trim()},e)};var pt={};f(pt,{Toast:()=>_n});var _n=(t,e="alert-success",a=3500)=>{let s=document.getElementById("sigpro-toast-container");if(!s)s=n("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 c=n("div",{style:"display: contents"});s.appendChild(c);let r,o=()=>{clearTimeout(r);let u=c.firstElementChild;if(u&&!u.classList.contains("opacity-0"))u.classList.add("translate-x-full","opacity-0"),setTimeout(()=>{if(i.destroy(),c.remove(),!s.hasChildNodes())s.remove()},300);else i.destroy(),c.remove()},i=M(()=>{let u=n("span",{class:"icon-[lucide--x]"}),g=n("button",{class:"btn btn-xs btn-circle btn-ghost",onclick:o},u),d=n("div",{class:`alert alert-soft ${e} shadow-lg transition-all duration-300 translate-x-10 opacity-0 pointer-events-auto`},[n("span",{},typeof t==="function"?t():t),g]);return requestAnimationFrame(()=>d.classList.remove("translate-x-10","opacity-0")),d},c);if(a>0)r=setTimeout(o,a);return o};var jt={};f(jt,{Tooltip:()=>Tn});var Tn=(t,e)=>{return e===void 0&&(e=t,t={}),n("div",{...t,class:`tooltip ${t.class??""}`,"data-tip":t.tip},e)};var kn={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"}},le=v("es"),ce=(t)=>le(t),oe=(t)=>()=>kn[le()][t]||t;var re={...nt,...at,...st,...lt,...ct,...rt,...it,...ut,...ft,...dt,...et,...mt,...gt,...vt,...bt,...yt,...ht,...xt,...wt,...$t,..._t,...Tt,...kt,...St,...Ct,...Et,...Dt,...At,...Nt,...It,...Rt,...Ft,...Bt,...p,...p,...Lt,...zt,...Ht,...Ot,...Pt,...Wt,...pt,...jt},ie={Locale:ce,tt:oe};if(typeof window<"u")Object.entries({...re,...ie}).forEach(([t,e])=>{Object.defineProperty(window,t,{value:e,writable:!1,configurable:!0,enumerable:!0})}),console.log("SigProUI installed");})();
|