All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
8 lines
42 KiB
JavaScript
8 lines
42 KiB
JavaScript
(()=>{var{defineProperty:yt,getOwnPropertyNames:ie,getOwnPropertyDescriptor:ue}=Object,ae=Object.prototype.hasOwnProperty;function ce(t){return this[t]}var de=(t)=>{var n=(Bt??=new WeakMap).get(t),o;if(n)return n;if(n=yt({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function"){for(var s of ie(t))if(!ae.call(n,s))yt(n,s,{get:ce.bind(t,s),enumerable:!(o=ue(t,s))||o.enumerable})}return Bt.set(t,n),n},Bt;var _e=(t)=>t;function we(t,n){this[t]=_e.bind(null,n)}var Et=(t,n)=>{for(var o in n)yt(t,o,{get:n[o],enumerable:!0,configurable:!0,set:we.bind(n,o)})};var Xe={};Et(Xe,{Utils:()=>se,Tooltip:()=>pn,Toggle:()=>hn,Toast:()=>vn,Timeline:()=>Fn,Textrotate:()=>Hn,Textarea:()=>Dn,Tabs:()=>qn,TableItems:()=>Yn,Table:()=>Rn,SwapToggle:()=>gt,SwapOn:()=>$t,SwapOff:()=>Kt,Swap:()=>Xt,Steps:()=>Vn,Step:()=>xn,Stats:()=>In,Stat:()=>Zn,Stack:()=>Qn,SkeletonText:()=>Gn,Skeleton:()=>zn,Select:()=>Jn,RatingItems:()=>Bn,Rating:()=>Un,Range:()=>Mn,Radio:()=>Kn,Radial:()=>$n,Progress:()=>gn,Navbar:()=>Xn,Modal:()=>Pn,Menu:()=>Wn,Loading:()=>jn,ListRows:()=>kn,List:()=>Tn,Kbd:()=>mn,Input:()=>Pt,Indicator:()=>On,Icon:()=>p,Fileinput:()=>Ln,Fieldset:()=>An,Fab:()=>Cn,Editor:()=>te,DropdownContent:()=>nt,DropdownButton:()=>Wt,Dropdown:()=>tt,DrawerToggle:()=>yn,DrawerSide:()=>Nn,DrawerOverlay:()=>bn,DrawerContent:()=>En,Drawer:()=>wn,Divider:()=>Sn,Datepicker:()=>_n,Components:()=>re,Colorpicker:()=>dn,ColorPalette:()=>jt,Checkbox:()=>cn,ChatImage:()=>an,ChatHeader:()=>un,ChatFooter:()=>ln,ChatBubble:()=>fn,Chat:()=>sn,CarouselItem:()=>rn,Carousel:()=>on,CardTitle:()=>tn,CardBody:()=>nn,CardActions:()=>en,Card:()=>pt,Calendar:()=>kt,Button:()=>Tt,Badge:()=>ht,Autocomplete:()=>vt,Alert:()=>Ft,Accordion:()=>Ht});var g=(t)=>typeof t==="function",St=(t)=>t&&typeof t==="object",V=Array.isArray,K=typeof document<"u"?document:null,Jt=(t)=>t?._isRuntime?t.container:t instanceof Node?t:K.createTextNode(t==null?"":String(t)),m=null,P=null,R=!1,ot=0,rt=new Set,zt=new WeakMap,Nt=Symbol("iter"),bt=new WeakMap,ye="http://www.w3.org/2000/svg",Gt="http://www.w3.org/1999/xlink",Ee=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),et=null;var G=(t)=>{if(!t||t._disposed)return;t._disposed=!0;let n=[t];while(n.length){let o=n.pop();if(o._cleanups)o._cleanups.forEach((s)=>s()),o._cleanups.clear();if(o._children)o._children.forEach((s)=>n.push(s)),o._children.clear();if(o._deps)o._deps.forEach((s)=>s.delete(o)),o._deps.clear()}},Y=(t)=>{if(P)(P._cleanups||=new Set).add(t)},Ne=(t)=>{let n=m;m=null;try{return t()}finally{m=n}},q=(t,n=!1)=>{let o=()=>{if(o._disposed)return;if(o._deps)o._deps.forEach((i)=>i.delete(o));if(o._cleanups)o._cleanups.forEach((i)=>i()),o._cleanups.clear();let s=m,r=P;m=P=o;try{return o._result=t()}catch(i){console.error("[SigPro]",i)}finally{m=s,P=r}};if(o._deps=o._cleanups=o._children=null,o._disposed=!1,o._isComputed=n,o._depth=m?m._depth+1:0,o._mounts=[],o._parent=P,P)(P._children||=new Set).add(o);return o},Qt=()=>{if(R)return;R=!0;let t=Array.from(rt).sort((n,o)=>n._depth-o._depth);rt.clear();for(let n of t)if(!n._disposed)n();R=!1},It=(t)=>{ot++;try{return t()}finally{if(ot--,ot===0&&rt.size>0&&!R)Qt()}},X=(t,n=!1)=>{if(!n&&m&&!m._disposed)t.add(m),(m._deps||=new Set).add(t);else if(n&&t.size>0){let o=!1;for(let s of t){if(s===m||s._disposed)continue;if(s._isComputed){if(s._dirty=!0,s._subs)X(s._subs,!0)}else rt.add(s),o=!0}if(o&&!R&&ot===0)queueMicrotask(Qt)}},C=(t,n=null)=>{let o=new Set;if(g(t)){let s,r=()=>{if(r._dirty){let i=m;m=r;try{let f=t();if(!Object.is(s,f))s=f,X(o,!0)}finally{m=i}r._dirty=!1}return X(o),s};return r._isComputed=!0,r._subs=o,r._dirty=!0,r._deps=null,r._disposed=!1,r}if(n)try{t=JSON.parse(localStorage.getItem(n))??t}catch(s){}return(...s)=>{if(s.length){let r=g(s[0])?s[0](t):s[0];if(!Object.is(t,r)){if(t=r,n)localStorage.setItem(n,JSON.stringify(t));X(o,!0)}}return X(o),t}},Ct=(t)=>{if(!St(t))return t;let n=zt.get(t);if(n)return n;let o=new Map,s=(i)=>{let f=o.get(i);if(!f)o.set(i,f=new Set);return f},r=new Proxy(t,{get(i,f,u){if(typeof f!=="symbol")X(s(f));return Ct(Reflect.get(i,f,u))},set(i,f,u,l){let c=Reflect.has(i,f),a=Reflect.get(i,f,l),d=Reflect.set(i,f,u,l);if(d&&!Object.is(a,u)){if(X(s(f),!0),!c)X(s(Nt),!0)}return d},deleteProperty(i,f){let u=Reflect.deleteProperty(i,f);if(u)X(s(f),!0),X(s(Nt),!0);return u},ownKeys(i){return X(s(Nt)),Reflect.ownKeys(i)}});return zt.set(t,r),r},z=(t,n)=>{if(n===void 0){let s=q(t);return s(),()=>G(s)}let o=q(()=>{let s=Array.isArray(t)?t.map((r)=>r()):t();Ne(()=>n(s))});return o(),()=>G(o)},At=(t)=>{if(!t)return;if(t._cleanups)t._cleanups.forEach((n)=>n()),t._cleanups.clear();if(t._ownerEffect)G(t._ownerEffect);if(t.childNodes)t.childNodes.forEach((n)=>At(n))},e=(t,n={},o=[])=>{if(n instanceof Node||V(n)||!St(n))o=n,n={};if(g(t)){let f=q(()=>{let a=t(n,{children:o,emit:(d,...N)=>n[`on${d[0].toUpperCase()}${d.slice(1)}`]?.(...N)});return f._result=a,a});f();let u=f._result;if(u==null)return null;let l=u instanceof Node||V(u)&&u.every((a)=>a instanceof Node)?u:K.createTextNode(String(u)),c=(a)=>{if(St(a)&&!a._isRuntime)a._mounts=f._mounts||[],a._cleanups=f._cleanups||new Set,a._ownerEffect=f};return V(l)?l.forEach(c):c(l),l}let s=Ee.has(t),r=s?K.createElementNS(ye,t):K.createElement(t);r._cleanups=new Set;for(let f of Object.keys(n)){let u=n[f];if(f==="ref"){g(u)?u(r):u.current=r;continue}let l=et?et(f,u):u;if(s&&f.startsWith("xlink:")){l==null?r.removeAttributeNS(Gt,f.slice(6)):r.setAttributeNS(Gt,f.slice(6),l);continue}if(f.startsWith("on")){let c=f.slice(2).toLowerCase();r.addEventListener(c,l);let a=()=>r.removeEventListener(c,l);r._cleanups.add(a),Y(a)}else if(g(l)){let c=q(()=>{let a=l(),d=et?et(f,a):a;if(f==="class")r.className=d||"";else if(d==null)r.removeAttribute(f);else if(f in r&&!s)r[f]=d;else r.setAttribute(f,d===!0?"":d)});if(c(),r._cleanups.add(()=>G(c)),Y(()=>G(c)),/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName)&&(f==="value"||f==="checked")){let a=f==="checked"?"change":"input";r.addEventListener(a,(d)=>l(d.target[f]))}}else if(l!=null)if(f in r&&!s)r[f]=l;else r.setAttribute(f,l===!0?"":l)}let i=(f)=>{if(V(f))return f.forEach(i);if(g(f)){let u=K.createTextNode("");r.appendChild(u);let l=[],c=q(()=>{let a=f(),d=(V(a)?a:[a]).map(Jt);l.forEach((b)=>{if(b._isRuntime)b.destroy();else At(b);if(b.parentNode)b.remove()});let N=u;for(let b=d.length-1;b>=0;b--){let w=d[b];if(w.parentNode!==N.parentNode)N.parentNode?.insertBefore(w,N);if(w._mounts)w._mounts.forEach((E)=>E());N=w}l=d});c(),r._cleanups.add(()=>G(c)),Y(()=>G(c))}else{let u=Jt(f);if(r.appendChild(u),u._mounts)u._mounts.forEach((l)=>l())}};return i(o),r},st=(t)=>{let n=new Set,o=P,s=m,r=K.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),P={_cleanups:n},m=null;let i=(f)=>{if(!f)return;if(f._isRuntime)n.add(f.destroy),r.appendChild(f.container);else if(V(f))f.forEach(i);else r.appendChild(f instanceof Node?f:K.createTextNode(String(f==null?"":f)))};try{i(t({onCleanup:(f)=>n.add(f)}))}finally{P=o,m=s}return{_isRuntime:!0,container:r,destroy:()=>{n.forEach((f)=>f()),At(r),r.remove()}}},ft=(t,n,o=null)=>{let s=K.createTextNode(""),r=e("div",{style:"display:contents"},[s]),i=null;return z(()=>!!(g(t)?t():t),(f)=>{if(i)i.destroy(),i=null;let u=f?n:o;if(u)i=st(()=>g(u)?u():u),r.insertBefore(i.container,s)}),Y(()=>i?.destroy()),r},B=(t,n,o)=>{let s=K.createTextNode(""),r=e("div",{style:"display:contents"},[s]),i=new Map;return z(()=>(g(t)?t():t)||[],(f)=>{let u=new Map,l=[],c=f||[];for(let d=0;d<c.length;d++){let N=c[d],b=o?N?.[o]??d:N?.id??d,w=i.get(b);if(!w)w=st(()=>n(N,d));else i.delete(b);u.set(b,w),l.push(w)}i.forEach((d)=>d.destroy());let a=s;for(let d=l.length-1;d>=0;d--){let N=l[d].container;if(N.nextSibling!==a)r.insertBefore(N,a);a=N}i=u}),r},D=(t)=>{let n=()=>window.location.hash.slice(1)||"/",o=C(n()),s=()=>o(n());window.addEventListener("hashchange",s),Y(()=>window.removeEventListener("hashchange",s));let r=e("div",{class:"router-hook"}),i=null;return z([o],()=>{let f=o(),u=t.find((l)=>{let c=l.path.split("/").filter(Boolean),a=f.split("/").filter(Boolean);return c.length===a.length&&c.every((d,N)=>d[0]===":"||d===a[N])})||t.find((l)=>l.path==="*");if(u){i?.destroy();let l={};u.path.split("/").filter(Boolean).forEach((c,a)=>{if(c[0]===":")l[c.slice(1)]=f.split("/").filter(Boolean)[a]}),D.params(l),i=st(()=>g(u.component)?u.component(l):u.component),r.replaceChildren(i.container)}}),r};D.params=C({});D.to=(t)=>window.location.hash=t.replace(/^#?\/?/,"#/");D.back=()=>window.history.back();D.path=()=>window.location.hash.replace(/^#/,"")||"/";var lt=(t,n)=>{let o=typeof n==="string"?K.querySelector(n):n;if(!o)return;if(bt.has(o))bt.get(o).destroy();let s=st(g(t)?t:()=>t);return o.replaceChildren(s.container),bt.set(o,s),s};var Q=(t)=>typeof t==="function",Zt=(t)=>t&&typeof t==="object",x=Array.isArray,I=typeof document<"u"?document:null,Vt=(t)=>t?._isRuntime?t.container:t instanceof Node?t:I.createTextNode(t==null?"":String(t)),T=null,$=null,it=!1,be=0,Lt=new Set;var Be=Symbol("iter");var Se="http://www.w3.org/2000/svg",xt="http://www.w3.org/1999/xlink",Ce=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),H=null,Rt=(t)=>{H=t},Z=(t)=>{if(!t||t._disposed)return;t._disposed=!0;let n=[t];while(n.length){let o=n.pop();if(o._cleanups)o._cleanups.forEach((s)=>s()),o._cleanups.clear();if(o._children)o._children.forEach((s)=>n.push(s)),o._children.clear();if(o._deps)o._deps.forEach((s)=>s.delete(o)),o._deps.clear()}},ut=(t)=>{if($)($._cleanups||=new Set).add(t)},Ae=(t)=>{let n=T;T=null;try{return t()}finally{T=n}},v=(t,n=!1)=>{let o=()=>{if(o._disposed)return;if(o._deps)o._deps.forEach((i)=>i.delete(o));if(o._cleanups)o._cleanups.forEach((i)=>i()),o._cleanups.clear();let s=T,r=$;T=$=o;try{return o._result=t()}catch(i){console.error("[SigPro]",i)}finally{T=s,$=r}};if(o._deps=o._cleanups=o._children=null,o._disposed=!1,o._isComputed=n,o._depth=T?T._depth+1:0,o._mounts=[],o._parent=$,$)($._children||=new Set).add(o);return o},Le=()=>{if(it)return;it=!0;let t=Array.from(Lt).sort((n,o)=>n._depth-o._depth);Lt.clear();for(let n of t)if(!n._disposed)n();it=!1};var F=(t,n=!1)=>{if(!n&&T&&!T._disposed)t.add(T),(T._deps||=new Set).add(t);else if(n&&t.size>0){let o=!1;for(let s of t){if(s===T||s._disposed)continue;if(s._isComputed){if(s._dirty=!0,s._subs)F(s._subs,!0)}else Lt.add(s),o=!0}if(o&&!it&&be===0)queueMicrotask(Le)}},Yt=(t,n=null)=>{let o=new Set;if(Q(t)){let s,r=()=>{if(r._dirty){let i=T;T=r;try{let f=t();if(!Object.is(s,f))s=f,F(o,!0)}finally{T=i}r._dirty=!1}return F(o),s};return r._isComputed=!0,r._subs=o,r._dirty=!0,r._deps=null,r._disposed=!1,r}if(n)try{t=JSON.parse(localStorage.getItem(n))??t}catch(s){}return(...s)=>{if(s.length){let r=Q(s[0])?s[0](t):s[0];if(!Object.is(t,r)){if(t=r,n)localStorage.setItem(n,JSON.stringify(t));F(o,!0)}}return F(o),t}};var Oe=(t,n)=>{if(n===void 0){let s=v(t);return s(),()=>Z(s)}let o=v(()=>{let s=Array.isArray(t)?t.map((r)=>r()):t();Ae(()=>n(s))});return o(),()=>Z(o)},Ot=(t)=>{if(!t)return;if(t._cleanups)t._cleanups.forEach((n)=>n()),t._cleanups.clear();if(t._ownerEffect)Z(t._ownerEffect);if(t.childNodes)t.childNodes.forEach((n)=>Ot(n))},mt=(t,n={},o=[])=>{if(n instanceof Node||x(n)||!Zt(n))o=n,n={};if(Q(t)){let f=v(()=>{let a=t(n,{children:o,emit:(d,...N)=>n[`on${d[0].toUpperCase()}${d.slice(1)}`]?.(...N)});return f._result=a,a});f();let u=f._result;if(u==null)return null;let l=u instanceof Node||x(u)&&u.every((a)=>a instanceof Node)?u:I.createTextNode(String(u)),c=(a)=>{if(Zt(a)&&!a._isRuntime)a._mounts=f._mounts||[],a._cleanups=f._cleanups||new Set,a._ownerEffect=f};return x(l)?l.forEach(c):c(l),l}let s=Ce.has(t),r=s?I.createElementNS(Se,t):I.createElement(t);r._cleanups=new Set;for(let f of Object.keys(n)){let u=n[f];if(f==="ref"){Q(u)?u(r):u.current=r;continue}let l=H?H(f,u):u;if(s&&f.startsWith("xlink:")){l==null?r.removeAttributeNS(xt,f.slice(6)):r.setAttributeNS(xt,f.slice(6),l);continue}if(f.startsWith("on")){let c=f.slice(2).toLowerCase();r.addEventListener(c,l);let a=()=>r.removeEventListener(c,l);r._cleanups.add(a),ut(a)}else if(Q(l)){let c=v(()=>{let a=l(),d=H?H(f,a):a;if(f==="class")r.className=d||"";else if(d==null)r.removeAttribute(f);else if(f in r&&!s)r[f]=d;else r.setAttribute(f,d===!0?"":d)});if(c(),r._cleanups.add(()=>Z(c)),ut(()=>Z(c)),/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName)&&(f==="value"||f==="checked")){let a=f==="checked"?"change":"input";r.addEventListener(a,(d)=>l(d.target[f]))}}else if(l!=null)if(f in r&&!s)r[f]=l;else r.setAttribute(f,l===!0?"":l)}let i=(f)=>{if(x(f))return f.forEach(i);if(Q(f)){let u=I.createTextNode("");r.appendChild(u);let l=[],c=v(()=>{let a=f(),d=(x(a)?a:[a]).map(Vt);l.forEach((b)=>{if(b._isRuntime)b.destroy();else Ot(b);if(b.parentNode)b.remove()});let N=u;for(let b=d.length-1;b>=0;b--){let w=d[b];if(w.parentNode!==N.parentNode)N.parentNode?.insertBefore(w,N);if(w._mounts)w._mounts.forEach((E)=>E());N=w}l=d});c(),r._cleanups.add(()=>Z(c)),ut(()=>Z(c))}else{let u=Vt(f);if(r.appendChild(u),u._mounts)u._mounts.forEach((l)=>l())}};return i(o),r},me=(t)=>{let n=new Set,o=$,s=T,r=I.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),$={_cleanups:n},T=null;let i=(f)=>{if(!f)return;if(f._isRuntime)n.add(f.destroy),r.appendChild(f.container);else if(x(f))f.forEach(i);else r.appendChild(f instanceof Node?f:I.createTextNode(String(f==null?"":f)))};try{i(t({onCleanup:(f)=>n.add(f)}))}finally{$=o,T=s}return{_isRuntime:!0,container:r,destroy:()=>{n.forEach((f)=>f()),Ot(r),r.remove()}}};var h=(t)=>{let n=()=>window.location.hash.slice(1)||"/",o=Yt(n()),s=()=>o(n());window.addEventListener("hashchange",s),ut(()=>window.removeEventListener("hashchange",s));let r=mt("div",{class:"router-hook"}),i=null;return Oe([o],()=>{let f=o(),u=t.find((l)=>{let c=l.path.split("/").filter(Boolean),a=f.split("/").filter(Boolean);return c.length===a.length&&c.every((d,N)=>d[0]===":"||d===a[N])})||t.find((l)=>l.path==="*");if(u){i?.destroy();let l={};u.path.split("/").filter(Boolean).forEach((c,a)=>{if(c[0]===":")l[c.slice(1)]=f.split("/").filter(Boolean)[a]}),h.params(l),i=me(()=>Q(u.component)?u.component(l):u.component),r.replaceChildren(i.container)}}),r};h.params=Yt({});h.to=(t)=>window.location.hash=t.replace(/^#?\/?/,"#/");h.back=()=>window.history.back();h.path=()=>window.location.hash.replace(/^#/,"")||"/";var Te=/^\s*(javascript|data|vbscript):/i,ke=new Set(["src","href","formaction","action","background","code","archive"]),je=(t)=>ke.has(t)||t.startsWith("on"),We=(t,n)=>{if(n==null||n===!1)return null;if(je(t)){let o=String(n);if(Te.test(o))return console.warn(`[SigPro XSS] Locked ${t}`),"#"}return n};Rt(We);if(typeof window<"u")"a abbr article aside audio b blockquote br button canvas caption cite code col colgroup datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hr i iframe img input ins kbd label legend li main mark meter nav object ol optgroup option output p picture pre progress section select slot small source span strong sub summary sup svg table tbody td template textarea tfoot th thead time tr u ul video".split(" ").forEach((t)=>{window[t]=(n,o)=>mt(t,n,o)}),console.log("SigPro tags ready");var Mt={};Et(Mt,{Tooltip:()=>pn,Toggle:()=>hn,Toast:()=>vn,Timeline:()=>Fn,Textrotate:()=>Hn,Textarea:()=>Dn,Tabs:()=>qn,TableItems:()=>Yn,Table:()=>Rn,SwapToggle:()=>gt,SwapOn:()=>$t,SwapOff:()=>Kt,Swap:()=>Xt,Steps:()=>Vn,Step:()=>xn,Stats:()=>In,Stat:()=>Zn,Stack:()=>Qn,SkeletonText:()=>Gn,Skeleton:()=>zn,Select:()=>Jn,RatingItems:()=>Bn,Rating:()=>Un,Range:()=>Mn,Radio:()=>Kn,Radial:()=>$n,Progress:()=>gn,Navbar:()=>Xn,Modal:()=>Pn,Menu:()=>Wn,Loading:()=>jn,ListRows:()=>kn,List:()=>Tn,Kbd:()=>mn,Input:()=>Pt,Indicator:()=>On,Icon:()=>p,Fileinput:()=>Ln,Fieldset:()=>An,Fab:()=>Cn,DropdownContent:()=>nt,DropdownButton:()=>Wt,Dropdown:()=>tt,DrawerToggle:()=>yn,DrawerSide:()=>Nn,DrawerOverlay:()=>bn,DrawerContent:()=>En,Drawer:()=>wn,Divider:()=>Sn,Datepicker:()=>_n,Colorpicker:()=>dn,ColorPalette:()=>jt,Checkbox:()=>cn,ChatImage:()=>an,ChatHeader:()=>un,ChatFooter:()=>ln,ChatBubble:()=>fn,Chat:()=>sn,CarouselItem:()=>rn,Carousel:()=>on,CardTitle:()=>tn,CardBody:()=>nn,CardActions:()=>en,Card:()=>pt,Calendar:()=>kt,Button:()=>Tt,Badge:()=>ht,Autocomplete:()=>vt,Alert:()=>Ft,Accordion:()=>Ht});var A=(t)=>typeof t==="function"?t():t,J=(t,n="label")=>t&&typeof t==="object"?t[n]:t,_=(...t)=>t.filter(Boolean).join(" ").trim(),L=(t)=>typeof t==="function",qt=(t,n,o="label",s=String(n).toLowerCase())=>!n?A(t):A(t).filter((r)=>String(r&&typeof r==="object"?r[o]:r).toLowerCase().includes(s)),Dt=(t)=>`${t}-${Math.random().toString(36).slice(2,9)}`,at=()=>document.activeElement?.blur();var Ht=(t)=>{let n=t.name||Dt("acc");return B(t.items,(o)=>{return e("div",{class:_("collapse",t.class)},[e("input",{type:"radio",name:n,checked:o.open||void 0}),o.title?e("div",{class:_("collapse-title",`${o.classTitle??" font-semibold"}`)},o.title):null,o.content?e("div",{class:_("collapse-content text-sm",`${o.classContent??" font-semibold"}`)},o.content):null])})},Ft=(t,n)=>e("div",{...t,class:_("alert",t.class)},n),vt=({items:t,value:n,onselect:o,placeholder:s="...",...r})=>{let i=C(A(n)||""),f=C(()=>qt(t,i())),u=(l)=>{let c=J(l),a=typeof l==="string"?l:l.value;if(i(c),L(n))n(a);o?.(l),at()};return tt({class:"w-full"},[e("div",{tabindex:"0",role:"button",class:"w-full"},Pt({...r,placeholder:s,value:i,left:e("span",{class:"icon-[lucide--search]"}),oninput:(l)=>{if(i(l.target.value),L(n))n(l.target.value)}})),nt({class:"p-2 bg-base-100 rounded-box shadow-xl w-full max-h-60 overflow-y-auto border border-base-300 z-50"},e("ul",{class:"menu flex-col flex-nowrap w-full p-0"},[B(f,(l)=>e("li",{},[e("a",{onmousedown:(c)=>c.preventDefault(),onclick:()=>u(l)},J(l))]),(l)=>J(l)),()=>f().length===0?e("li",{class:"p-4 opacity-50 text-center"},"Sin resultados"):null]))])},ht=(t,n)=>e("span",{...t,class:_("badge",t.class)},n),Tt=(t,n)=>e("button",{...t,class:_("btn",t.class)},n),kt=(t)=>{let n=C(new Date),o=C(null),s=C(0),r=C(0),i=new Date,f=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`,u=(w)=>`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-${String(w.getDate()).padStart(2,"0")}`,l=()=>A(t.range)===!0,c=()=>A(t.value),a=(w)=>{let E=u(w),j=c();if(l())if(!j?.start||j.start&&j.end)t.onChange?.({start:E,end:null,...t.hour&&{startHour:s()}});else{let M=j.start,W=E<M?{start:E,end:M}:{start:M,end:E};if(t.hour)W.startHour=j.startHour??s(),W.endHour=r();t.onChange?.(W)}else t.onChange?.(t.hour?`${E}T${String(s()).padStart(2,"0")}:00:00`:E)},d=(w)=>{let E=n();n(new Date(E.getFullYear(),E.getMonth()+w,1))},N=(w)=>{let E=n();n(new Date(E.getFullYear()+w,E.getMonth(),1))},b=({value:w,onChange:E})=>e("div",{class:"flex-1"},[e("div",{class:"flex gap-2 items-center"},[e("input",{type:"range",min:0,max:23,value:w,class:"range range-xs flex-1",oninput:(j)=>E(+j.target.value)}),e("span",{class:"text-sm font-mono min-w-[48px] text-center"},()=>String(A(w)).padStart(2,"0")+":00")])]);return e("div",{class:_("p-4 bg-base-100 border border-base-300 shadow-2xl rounded-box w-80 select-none",t.class)},[e("div",{class:"flex justify-between items-center mb-4 gap-1"},[e("div",{class:"flex gap-0.5"},[e("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>N(-1)},e("span",{class:"icon-[lucide--chevrons-left]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>d(-1)},e("span",{class:"icon-[lucide--chevron-left]"}))]),e("span",{class:"font-bold uppercase flex-1 text-center"},()=>n().toLocaleString("es-ES",{month:"short",year:"numeric"})),e("div",{class:"flex gap-0.5"},[e("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>d(1)},e("span",{class:"icon-[lucide--chevron-right]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs px-1",onclick:()=>N(1)},e("span",{class:"icon-[lucide--chevrons-right]"}))])]),e("div",{class:"grid grid-cols-7 gap-1",onmouseleave:()=>o(null)},[...["L","M","X","J","V","S","D"].map((w)=>e("div",{class:"text-[10px] opacity-40 font-bold text-center"},w)),()=>{let w=n(),E=w.getFullYear(),j=w.getMonth(),M=new Date(E,j,1).getDay(),W=M===0?6:M-1,ct=new Date(E,j+1,0).getDate(),y=[];for(let S=0;S<W;S++)y.push(e("div"));for(let S=1;S<=ct;S++){let O=new Date(E,j,S),k=u(O);y.push(e("button",{type:"button",class:()=>{let U=c(),dt=o(),fe=typeof U==="string"?U.split("T")[0]===k:U?.start===k,le=U?.end===k,_t=!1;if(l()&&U?.start){let wt=U.start;if(!U.end&&dt)_t=k>wt&&k<=dt||k<wt&&k>=dt;else if(U.end)_t=k>wt&&k<U.end}return _("btn btn-xs p-0 aspect-square min-h-0 h-auto font-normal relative",fe||le?"btn-primary z-10":_t?"bg-primary/20 border-none rounded-none":"btn-ghost",k===f?"ring-1 ring-primary ring-inset font-black text-primary":"")},onmouseenter:()=>l()&&o(k),onclick:()=>a(O)},S.toString()))}return y}]),t.hour?e("div",{class:"mt-3 pt-2 border-t border-base-300"},l()?e("div",{class:"flex gap-4"},[b({value:s,onChange:(w)=>s(w)}),b({value:r,onChange:(w)=>r(w)})]):b({value:s,onChange:(w)=>s(w)})):null])},pt=(t,n)=>e("div",{...t,class:_("card",t.class)},n),tn=(t,n)=>e("div",{...t,class:_("card-title",t.class)},n),nn=(t,n)=>e("div",{...t,class:_("card-body",t.class)},n),en=(t,n)=>e("div",{...t,class:_("card-actions",t.class)},n),on=(t,n)=>e("div",{...t,class:_("carousel",t.class)},n),rn=(t,n)=>e("div",{...t,class:_("carousel-item",t.class)},n),sn=(t,n)=>e("div",{...t,class:_("chat",t.class)},n),fn=(t,n)=>e("div",{...t,class:_("chat-bubble",t.class)},n),ln=(t,n)=>e("div",{...t,class:_("chat-footer",t.class)},n),un=(t,n)=>e("div",{...t,class:_("chat-header",t.class)},n),an=(t,n)=>e("div",{...t,class:_("chat-image avatar",t.class)},e("div",{class:"w-10 rounded-full"},typeof n==="string"?e("img",{src:n,alt:"avatar"}):n)),cn=(t)=>e("input",{...t,type:"checkbox",class:_("checkbox",t.class)}),dn=(t)=>{let n=()=>A(t.value)||"#000000";return tt({},[Wt({class:"btn"},[e("div",{class:"size-5 rounded-sm",style:()=>`background-color: ${n()}`}),t.label&&e("span",{},t.label)]),nt({class:"p-3 bg-base-100 rounded-box shadow-xl w-64"},jt({value:t.value,onchange:(o)=>{L(t.value)?t.value(o):t.onchange?.(o)}}))])},jt=(t)=>{let n=()=>A(t.value)||"#000000",o=["#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=(r)=>L(t.value)?t.value(r):t.onchange?.(r);return e("div",{class:"grid grid-cols-8 gap-1"},o.map((r)=>e("button",{type:"button",style:`background-color: ${r}`,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 ${n().toLowerCase()===r.toLowerCase()?"ring-2 ring-offset-1 ring-primary z-10 scale-110":""}`},onclick:()=>{s(r),at()}})))},_n=(t)=>{let n=C(""),o=()=>A(t.range)===!0;z(()=>{let r=A(t.value);if(!r)return n("");let i="";if(typeof r==="string")i=t.hour&&r.includes("T")?r.replace("T"," "):r;else if(r.start&&r.end){let f=t.hour&&r.startHour!=null?`${r.start} ${String(r.startHour).padStart(2,"0")}:00`:r.start,u=t.hour&&r.endHour!=null?`${r.end} ${String(r.endHour).padStart(2,"0")}:00`:r.end;i=`${f} - ${u}`}else if(r.start)i=`${t.hour&&r.startHour!=null?`${r.start} ${String(r.startHour).padStart(2,"0")}:00`:r.start}...`;n(i)});let s=(r)=>{if(L(t.value))t.value(r);else t.onChange?.(r);if(!o()||r?.end!=null)at()};return tt({class:_("w-full",t.class)},[e("label",{tabindex:"0",role:"button",class:"input input-bordered flex items-center gap-2 cursor-pointer"},[e("span",{class:"icon-[lucide--calendar] shrink-0"}),e("span",{class:()=>`grow text-left truncate ${!n()?"opacity-50":""}`},()=>n()||t.placeholder||(o()?"Seleccionar rango...":"Seleccionar fecha...")),()=>n()?e("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle -mr-2",onmousedown:(r)=>{if(r.preventDefault(),r.stopPropagation(),L(t.value))t.value(null);else t.onChange?.(null);n("")}},e("span",{class:"icon-[lucide--x] opacity-50"})):null]),nt({class:"p-0 bg-base-100 rounded-box shadow-xl"},kt({value:t.value,range:o(),hour:t.hour,onChange:s}))])},wn=(t,n)=>div({...t,class:_("drawer",t.class)},n),yn=(t)=>input({...t,type:"checkbox",class:"drawer-toggle",checked:()=>A(t.checked),onchange:(n)=>L(t.checked)&&t.checked(n.target.checked)}),En=(t,n)=>div({...t,class:_("drawer-content",t.class)},n),Nn=(t,n)=>div({...t,class:_("drawer-side",t.class)},n),bn=(t)=>label({...t,for:t.for,class:_("drawer-overlay",t.class)}),Sn=(t)=>e("div",{...t,class:_("divider",t.class)}),tt=(t,n)=>e("div",{...t,class:_("dropdown",t.class)},n),Wt=(t,n)=>e("div",{...t,tabindex:"0",role:"button",class:_("btn",t.class)},n),nt=(t,n)=>e("div",{...t,tabindex:"0",class:_("dropdown-content",t.class)},n),Cn=(t,n)=>e("div",{class:"fab"},[e("div",{tabindex:"0",role:"button",class:_("btn",t.class)},p(t.icon)),n]),An=(t,n)=>e("fieldset",{class:_("fieldset",t.class)},[e("legend",{class:"fieldset-legend"},t.label),n]),Ln=(t)=>{let n=C([]),o=C(!1),s=C(null),r=(t.max||2)*1024*1024,i=(u)=>{let l=Array.from(u);if(s(null),l.some((a)=>a.size>r)){s(`Máx ${t.max||2}MB`);return}let c=[...n(),...l];if(n(c),L(t.onselect))t.onselect(c);else if(L(t.value))t.value(c)},f=(u)=>{let l=n().filter((c,a)=>a!==u);if(n(l),L(t.onselect))t.onselect(l);else if(L(t.value))t.value(l)};return e("div",{class:_("fieldset w-full p-0",t.class)},[e("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 ${o()?"border-primary bg-primary/10":"border-base-content/20 bg-base-100 hover:bg-base-200"}`,ondragover:(u)=>{u.preventDefault(),o(!0)},ondragleave:()=>o(!1),ondrop:(u)=>{u.preventDefault(),o(!1),i(u.dataTransfer.files)}},[e("div",{class:"flex items-center gap-3 w-full"},[e("span",{class:"icon-[lucide--upload]"}),e("span",{class:"text-sm opacity-70 truncate grow text-left"},"Arrastra o selecciona archivos..."),e("span",{class:"text-[10px] opacity-40 shrink-0"},`Máx ${t.max||2}MB`)]),e("input",{type:"file",multiple:!0,accept:t.accept||"*",class:"hidden",onchange:(u)=>i(u.target.files)})]),()=>s()&&e("span",{class:"text-[10px] text-error mt-1 px-1 font-medium"},s()),ft(()=>n().length>0,()=>e("ul",{class:"mt-2 space-y-1"},B(n,(u,l)=>e("li",{class:"flex items-center justify-between p-1.5 pl-3 text-xs bg-base-200/50 rounded-md border border-base-300"},[e("div",{class:"flex items-center gap-2 truncate"},[e("span",{class:"opacity-50"},"\uD83D\uDCC4"),e("span",{class:"truncate font-medium max-w-[200px]"},u.name),e("span",{class:"text-[9px] opacity-40"},`(${(u.size/1024).toFixed(0)} KB)`)]),e("button",{type:"button",class:"btn btn-ghost btn-xs btn-circle",onclick:(c)=>{c.preventDefault(),f(l)}},e("span",{class:"icon-[lucide--x]"}))]))))])},p=(t)=>e("span",{class:t.startsWith("icon-")?t:""},t.startsWith("icon-")?null:t),On=(t,n)=>e("div",{...t,class:_("indicator",t.class)},[t.value&&e("span",{class:_("indicator-item badge",t.class)},t.value),n]),Pt=(t)=>{let{label:n,icon:o,float:s,placeholder:r,value:i,left:f,right:u,rule:l,hint:c,content:a,...d}=t,N=C(!1),b=t.type==="password",w=l??null,E=()=>b?A(N)?"text":"password":t.type||"search";return e("label",{class:s?"floating-label":""},[s?e("span",{},n):null,e("label",{pattern:w,class:()=>_("input validator",t.class)},[n&&!s?e("span",{class:"label"},n):null,f??null,e("input",{...d,type:E,class:"grow",pattern:w,placeholder:r||n||" ",value:i}),u??null,b?Xt({class:"ml-2"},[gt({value:N,class:"swap-rotate"}),$t({},p("icon-[lucide--eye]")),Kt({},p("icon-[lucide--eye-off]"))]):null]),c?e("div",{class:"validator-hint"},c):null])},mn=(t,n)=>e("kbd",{...t,class:_("kbd",t.class)},n),Tn=(t,n)=>e("ul",{...t,class:_("list",t.class)},n),kn=(t)=>()=>(A(t.items)||[]).map((n,o)=>e("li",{class:_("list-row",t.class,n?.class)},typeof t.render==="function"?t.render(n,o):n)),jn=(t,n)=>e("span",{...t,class:_("loading loading-spinner",t.class)},n),Wn=(t)=>{if(t.children!==void 0)return e("ul",{class:_("menu",t.class),...t},t.children);let{items:n}=t,o=(s)=>s.children?e("li",{},e("details",{open:s.open||void 0},[e("summary",{},J(s)),e("ul",{},B(()=>A(s.children)||[],o))])):e("li",{},e("a",{href:s.href,onclick:s.onclick?(r)=>{if(!s.href)r.preventDefault();s.onclick(r)}:null},J(s)));return e("ul",{class:_("menu",t.class)},B(()=>A(n)||[],o))},Pn=(t)=>{let n=null;z(()=>{let s=A(t.open);if(!n)return;s?n.showModal():n.close()});let o=()=>L(t.open)&&t.open(!1);return e("dialog",{...t,ref:(s)=>n=s,class:_("modal",t.class),onclose:o,oncancel:o},[e("div",{class:"modal-box"},[t.title&&e("h3",{class:"text-lg font-bold"},t.title),t.children,e("div",{class:"modal-action"},[t.actions||Tt({class:"btn",onclick:o},"Cerrar")])]),e("form",{method:"dialog",class:"modal-backdrop"},[e("button",{},"close")])])},Xn=(t,n)=>e("div",{...t,class:_("navbar",t.class)},n),gn=(t)=>e("progress",{...t,class:_("progress",t.class)}),$n=(t,n)=>e("div",{...t,class:_("radial-progress",t.class),style:`--value:${t.value??0};${t.style??""}`,role:"progressbar","aria-valuenow":t.value??0},n??`${t.value??0}%`),Kn=(t)=>e("input",{...t,type:"radio",class:_("radio",t.class)}),Mn=(t)=>e("input",{...t,type:"range",class:_("range",t.class)}),Un=(t,n)=>e("div",{...t,class:"rating"},n),Bn=(t)=>[...Array(t.count)].map((n,o)=>e("input",{class:_("mask",t.class),name:t.name,type:"radio",checked:()=>A(t.value)===o,onchange:()=>L(t.value)?t.value(o):t.onchange?.(o)})),Jn=(t,n)=>{if(n!==void 0)return e("select",{class:_("select",t.class),...t},n);let{label:o,float:s,placeholder:r,placeholderDisabled:i=!0,value:f,left:u,right:l,hint:c,items:a,keyFn:d,...N}=t,b=()=>{let w=A(a)||[];return[...r?[{disabled:i,label:r,value:""}]:[],...w]};return e("label",{class:s?"floating-label":""},[s?e("span",{},o):null,e("label",{class:_("select",N.class)},[!s&&o?e("span",{class:"label"},o):null,u??null,e("select",{value:()=>A(f),onchange:(w)=>L(f)?f(w.target.value):N.onchange?.(w)},B(b,(w)=>{let E=J(w,w.value!==void 0?"value":void 0),j=J(w,"label");return e("option",{value:E,disabled:w.disabled||void 0},j)})),l??null]),c?e("div",{class:"validator-hint"},c):null])},zn=(t)=>e("div",{...t,class:_("skeleton",t.class)}),Gn=(t)=>e("span",{...t,class:_("skeleton skeleton-text",t.class)}),Qn=(t,n)=>e("div",{...t,class:_("stack",t.class)},n),In=(t,n)=>e("div",{...t,class:_("stats shadow",t.class)},n),Zn=(t)=>e("div",{...t,class:_("stat",t.class)},[t.title?e("div",{class:"stat-title"},t.title):null,t.value?e("div",{class:"stat-value"},t.value):null,t.desc?e("div",{class:"stat-desc"},t.desc):null]),Vn=(t,n)=>e("ul",{...t,class:_("steps",t.class)},n),xn=(t,n)=>e("li",{...t,class:_("step",t.class),"data-content":t.dataContent},n),Xt=(t,n)=>e("label",{...t,class:_("swap",t.class)},n),gt=(t)=>e("input",{type:"checkbox",checked:()=>A(t.value),onchange:(n)=>L(t.value)&&t.value(n.target.checked),class:t.class}),$t=(t,n)=>e("div",{...t,class:_("swap-on",t.class)},n),Kt=(t,n)=>e("div",{...t,class:_("swap-off",t.class)},n),Rn=(t,n)=>e("table",{...t,class:_("table",t.class)},n),Yn=({items:t,columns:n=[],header:o=!0})=>{let s=o!==!1&&n.some((i)=>i.label)?e("thead",{},e("tr",{},n.map((i)=>e("th",{class:i.class},i.label)))):null,r=e("tbody",{},()=>{return(A(t)||[]).map((f,u)=>e("tr",{},n.map((l)=>{let c=l.render?l.render(f,u):f[l.key];return e("td",{class:l.class},c)})))});return[s,r].filter(Boolean)},qn=(t,n)=>{if(!t.items){let{class:c,...a}=t;return e("div",{...a,class:_("tabs",c)},n)}let{items:o,activeIndex:s,onClose:r,class:i,...f}=t,u=(c)=>L(c)?c():c,l=r||(L(o)?(c,a)=>{let N=u(o).filter((b,w)=>w!==c);if(o(N),s()>=N.length)s(Math.max(0,N.length-1))}:null);return e("div",{...f,class:_("tabs",i)},()=>{return(u(o)||[]).flatMap((a,d)=>{let N=()=>s()===d,b=e("button",{class:()=>`tab ${N()?"tab-active":""} ${a.class||""}`,onclick:(E)=>{E.preventDefault(),s(d),a.onclick?.(E)}},[J(a),a.closable?e("span",{class:"ml-1 inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-base-300 text-base-content/60 hover:text-base-content cursor-pointer",onclick:(E)=>{E.stopPropagation(),l?.(d,a)}},e("span",{class:"icon-[lucide--x] w-3 h-3"})):null]),w=e("div",{class:"tab-content bg-base-100 border-base-300 p-6",style:()=>`display: ${N()?"block":"none"};`},L(a.content)?a.content():a.content);return[b,w]})})},Dn=(t)=>e("textarea",{...t,class:_("textarea",t.class)}),Hn=(t,n)=>e("span",{...t,class:_("text-rotate",t.class)},n),Fn=(t,n)=>e("ul",{...t,class:_("timeline",t.class)},n),vn=(t,n="alert-success",o=3500)=>{let s=document.getElementById("sigpro-toast-container");if(!s)s=e("div",{id:"sigpro-toast-container",class:"fixed top-0 right-0 z-[9999] p-4 flex flex-col items-end gap-2 pointer-events-none"}),document.body.appendChild(s);let r=e("div",{style:"display: contents"});s.appendChild(r);let i,f,u,c=lt(()=>{let a=C(!1),d=C(!1);i=()=>{if(d())return;clearTimeout(f),clearTimeout(u),d(!0),setTimeout(()=>{if(c.destroy(),r.remove(),!s.hasChildNodes())s.remove()},300)},u=setTimeout(()=>a(!0),0);let N=typeof t==="function"?A(t):t,b=typeof N==="string"?e("span",{},N):N;return e("div",{class:()=>{let w=`alert alert-soft ${n} shadow-lg transition-all duration-300 inline-flex w-auto whitespace-nowrap pointer-events-auto`;if(d())return`${w} translate-x-full opacity-0`;if(a())return`${w} translate-x-0 opacity-100`;return`${w} translate-x-10 opacity-0`}},[b,e("button",{class:"btn btn-xs btn-circle btn-ghost",onclick:i},e("span",{class:"icon-[lucide--x]"}))])},r);if(o>0)f=setTimeout(i,o);return i},hn=(t)=>e("input",{...t,type:"checkbox",class:_("toggle",t.class)}),pn=(t,n)=>e("div",{...t,class:_("tooltip",t.class),"data-tip":t.tip},n);var Ut={};Et(Ut,{Editor:()=>te});var te=(t)=>{let{value:n,class:o}=t,s=null,r=null,i=C(!1),f=C(""),u=C(0),l=C(0),c=C(!1),a=["\uD83D\uDE00","\uD83D\uDE0A","\uD83D\uDE09","\uD83E\uDDD0","\uD83D\uDE2E","\uD83E\uDD14","\uD83D\uDE05","\uD83D\uDE02","\uD83D\uDE0D","\uD83D\uDE18","\uD83E\uDD70","\uD83D\uDC4D","\uD83D\uDC4E","\uD83D\uDC4C","\uD83E\uDD1D","\uD83E\uDD1E","\uD83D\uDC4B","\uD83D\uDC4F","\uD83D\uDE4C","\uD83D\uDE4F","\uD83D\uDCAA","☝️","\uD83D\uDC47","\uD83D\uDC48","\uD83D\uDC49","\uD83D\uDD95","✅","⚠️","\uD83D\uDE80","\uD83D\uDCE2","✉️","❤️"],d=()=>{let y=window.getSelection();if(y.getRangeAt&&y.rangeCount)r=y.getRangeAt(0)},N=()=>{if(r){let y=window.getSelection();y.removeAllRanges(),y.addRange(r)}},b=()=>{if(l(l()+1),s)u(s.innerText.length)},w=()=>{if(!s)return;let y=s.innerHTML;if(L(n))n(y);else t.onchange?.(y);b()},E=(y,S=null)=>{if(!s)return;if(s.focus(),r)N();document.execCommand(y,!1,S),r=null,w()},j=(y)=>{let S=document.createElement("div");S.style="position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.9);z-index:9999;display:flex;align-items:center;justify-content:center;cursor:zoom-out;";let O=document.createElement("img");O.src=y,O.style="max-width:95%;max-height:95%;box-shadow:0 0 30px rgba(0,0,0,0.5);border-radius:4px;",S.onclick=()=>document.body.removeChild(S),S.appendChild(O),document.body.appendChild(S)},M=(y)=>{if(!y)return;let S=new FileReader;S.onload=(O)=>{if(y.type.startsWith("image/")){let k=`<div style="display:inline-block; resize:both; overflow:hidden; vertical-align:bottom; line-height:0; width:200px; height:auto; border:1px dashed #ccc; padding:2px; cursor:pointer;" class="resizable-img-container"><img src="${O.target.result}" style="width:100%; height:100%; object-fit:contain; pointer-events:none;"></div> `;E("insertHTML",k)}else{let k=`<a href="${O.target.result}" download="${y.name}" contenteditable="false" style="display:inline-flex; align-items:center; gap:5px; padding:4px 8px; border:1px solid #ccc; border-radius:4px; background:#f9f9f9; text-decoration:none; color:#333; font-size:12px; margin:2px; cursor:pointer;"><span class="icon-[lucide--paperclip] w-3 h-3"></span>${y.name}</a> `;E("insertHTML",k)}},S.readAsDataURL(y)},W=(y,S=null)=>{if(l(),!s||i())return!1;try{if(y==="formatBlock"){let O=window.getSelection().getRangeAt(0).commonAncestorContainer;while(O&&O!==s){if(O.nodeType===1&&O.tagName===S)return!0;O=O.parentNode}return!1}return document.queryCommandState(y)}catch(O){return!1}},ct=e("div",{class:"flex flex-wrap items-center gap-1 p-2 border-b border-base-300 bg-base-200 sticky top-0 z-20"},[e("div",{class:"flex flex-wrap gap-1 flex-1 items-center"},[e("button",{type:"button",class:()=>`btn btn-ghost btn-xs ${W("bold")?"btn-active bg-primary/20":""}`,onclick:()=>E("bold")},e("span",{class:"icon-[lucide--bold]"})),e("button",{type:"button",class:()=>`btn btn-ghost btn-xs ${W("italic")?"btn-active bg-primary/20":""}`,onclick:()=>E("italic")},e("span",{class:"icon-[lucide--italic]"})),e("button",{type:"button",class:()=>`btn btn-ghost btn-xs ${W("underline")?"btn-active bg-primary/20":""}`,onclick:()=>E("underline")},e("span",{class:"icon-[lucide--underline]"})),e("input",{type:"color",class:"w-5 h-5 p-0 border-0 bg-transparent cursor-pointer",oninput:(y)=>E("foreColor",y.target.value)}),e("span",{class:"w-px h-5 bg-base-300 mx-1"}),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("justifyLeft")},e("span",{class:"icon-[lucide--align-left]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("justifyCenter")},e("span",{class:"icon-[lucide--align-center]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("justifyRight")},e("span",{class:"icon-[lucide--align-right]"})),e("span",{class:"w-px h-5 bg-base-300 mx-1"}),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("insertUnorderedList")},e("span",{class:"icon-[lucide--list]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("insertOrderedList")},e("span",{class:"icon-[lucide--list-ordered]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("outdent")},e("span",{class:"icon-[lucide--indent-decrease]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("indent")},e("span",{class:"icon-[lucide--indent-increase]"})),e("button",{type:"button",class:()=>`btn btn-ghost btn-xs ${W("formatBlock","BLOCKQUOTE")?"btn-active":""}`,onclick:()=>E("formatBlock",W("formatBlock","BLOCKQUOTE")?"P":"BLOCKQUOTE")},e("span",{class:"icon-[lucide--quote]"})),e("span",{class:"w-px h-5 bg-base-300 mx-1"}),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>{let y=window.prompt("URL:");if(y)E("createLink",y)}},e("span",{class:"icon-[lucide--link]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>{let y=document.createElement("input");y.type="file",y.onchange=(S)=>M(S.target.files[0]),y.click()}},e("span",{class:"icon-[lucide--paperclip]"})),e("div",{class:"relative"},[e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:(y)=>{y.stopPropagation(),d(),c(!c())}},e("span",{class:"icon-[lucide--smile]"})),e("div",{class:"absolute top-full left-0 mt-1 p-2 bg-base-100 border border-base-300 shadow-xl rounded-box w-52 z-50 flex flex-wrap gap-1",style:()=>c()?"display:flex":"display:none"},a.map((y)=>e("span",{class:"cursor-pointer hover:bg-base-200 p-1 rounded text-lg",onclick:(S)=>{S.stopPropagation(),E("insertText",y),c(!1)}},y)))]),e("span",{class:"w-px h-5 bg-base-300 mx-1"}),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("undo")},e("span",{class:"icon-[lucide--undo-2]"})),e("button",{type:"button",class:"btn btn-ghost btn-xs",onclick:()=>E("redo")},e("span",{class:"icon-[lucide--redo-2]"}))]),e("button",{type:"button",class:()=>`btn btn-ghost btn-xs ${i()?"btn-active":""}`,onclick:()=>{if(!i())f(s?.innerHTML||"");else if(s)s.innerHTML=f(),w();i(!i())}},e("span",{class:"icon-[lucide--code-2]"}))]);if(typeof document<"u"&&!document.getElementById("editor-styles")){let y=document.createElement("style");y.id="editor-styles",y.textContent=`
|
|
[contenteditable="true"] div,
|
|
[contenteditable="true"] p {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
`,document.head.appendChild(y)}return e("div",{class:_("border border-base-300 rounded-box bg-base-100 overflow-hidden shadow-sm flex flex-col",o)},[ct,e("div",{class:"relative flex-1 flex flex-col",onclick:()=>c(!1)},[e("div",{ref:(y)=>{if(!s&&y)s=y,y.innerHTML=A(n)||"",document.execCommand("defaultParagraphSeparator",!1,"br"),y.addEventListener("click",(S)=>{let O=S.target.closest(".resizable-img-container");if(O){let k=O.querySelector("img");if(k)j(k.src)}})},style:()=>`min-height:22rem;${i()?"display:none":""}`,class:"p-4 outline-none text-base-content leading-relaxed [&>div]:m-0 [&>p]:m-0 [&>div]:min-h-[1em] [&_.resizable-img-container]:hover:border-primary [&_blockquote]:border-l-4 [&_blockquote]:border-base-300 [&_blockquote]:pl-4 [&_blockquote]:italic [&_ul]:list-disc [&_ul]:pl-8 [&_ol]:list-decimal [&_ol]:pl-8",contenteditable:"true",oninput:w,onkeydown:(y)=>{if(y.key==="Tab")y.preventDefault(),E("indent")},onkeyup:()=>{b(),d()},onclick:(y)=>{b(),d(),y.stopPropagation()},onmouseup:()=>{w(),d()},onpaste:(y)=>{y.preventDefault();let S=y.clipboardData.getData("text/plain");E("insertText",S)},ondragover:(y)=>y.preventDefault(),ondrop:(y)=>{y.preventDefault(),M(y.dataTransfer.files[0])}}),e("textarea",{class:"w-full flex-1 min-h-[22rem] p-4 outline-none font-mono text-sm bg-base-200 border-0",style:()=>i()?"":"display:none",value:f,oninput:(y)=>{if(f(y.target.value),s)s.innerHTML=y.target.value;t.onchange?.(y.target.value)}})]),e("div",{class:"px-3 py-1 border-t border-base-300 bg-base-100/50 text-[10px] text-right text-base-content/60 italic"},[e("span",()=>`${u()} caracteres`)])])};var Pe={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"}},ne=C("es"),ee=(t)=>ne(t),oe=(t)=>()=>Pe[ne()][t]||t;var re={...Mt,...Ut},se={Locale:ee,tt:oe};if(typeof window<"u")Object.entries({$:C,$$:Ct,watch:z,h:e,each:B,when:ft,mount:lt,batch:It}).forEach(([n,o])=>{Object.defineProperty(window,n,{value:o,writable:!0,configurable:!0,enumerable:!0})}),Object.entries({...re,...se}).forEach(([n,o])=>{Object.defineProperty(window,n,{value:o,writable:!1,configurable:!0,enumerable:!0})}),console.log("SigProUI DX installed");})();
|