(()=>{var{defineProperty:L,getOwnPropertyNames:X,getOwnPropertyDescriptor:F}=Object,H=Object.prototype.hasOwnProperty;function Y(e){return this[e]}var Z=(e)=>{var s=(M??=new WeakMap).get(e),t;if(s)return s;if(s=L({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of X(e))if(!H.call(s,o))L(s,o,{get:Y.bind(e,o),enumerable:!(t=F(e,o))||t.enumerable})}return M.set(e,s),s},M;var ee=(e)=>e;function te(e,s){this[e]=ee.bind(null,s)}var ne=(e,s)=>{for(var t in s)L(e,t,{get:s[t],enumerable:!0,configurable:!0,set:te.bind(s,t)})};var ae={};ne(ae,{when:()=>K,watch:()=>O,router:()=>N,onUnmount:()=>S,mount:()=>J,isObj:()=>R,isFunc:()=>_,isArr:()=>b,h:()=>v,each:()=>z,batch:()=>q,$$:()=>V,$:()=>j});var _=(e)=>typeof e==="function",R=(e)=>e&&typeof e==="object",b=Array.isArray,E=typeof document<"u"?document:null,$=(e)=>e?._isRuntime?e.container:e instanceof Node?e:E.createTextNode(e==null?"":String(e)),d=null,m=null,x=!1,T=0,C=new Set,D=new WeakMap,B=Symbol("iter"),P=new WeakMap,se="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xlink",oe=new Set("svg,path,circle,rect,line,polyline,polygon,g,defs,text,textPath,tspan,use,symbol,image,marker,ellipse".split(",")),g=(e)=>{if(!e||e._disposed)return;e._disposed=!0;let s=[e];while(s.length){let t=s.pop();if(t._cleanups)t._cleanups.forEach((o)=>o()),t._cleanups.clear();if(t._children)t._children.forEach((o)=>s.push(o)),t._children.clear();if(t._deps)t._deps.forEach((o)=>o.delete(t)),t._deps.clear()}},S=(e)=>{if(m)(m._cleanups||=new Set).add(e)},re=(e)=>{let s=d;d=null;try{return e()}finally{d=s}},A=(e,s=!1)=>{let t=()=>{if(t._disposed)return;if(t._deps)t._deps.forEach((i)=>i.delete(t));if(t._cleanups)t._cleanups.forEach((i)=>i()),t._cleanups.clear();let o=d,r=m;d=m=t;try{return t._result=e()}catch(i){console.error("[SigPro]",i)}finally{d=o,m=r}};if(t._deps=t._cleanups=t._children=null,t._disposed=!1,t._isComputed=s,t._depth=d?d._depth+1:0,t._mounts=[],t._parent=m,m)(m._children||=new Set).add(t);return t},W=()=>{if(x)return;x=!0;let e=Array.from(C).sort((s,t)=>s._depth-t._depth);C.clear();for(let s of e)if(!s._disposed)s();x=!1},q=(e)=>{T++;try{return e()}finally{if(T--,T===0&&C.size>0&&!x)W()}},w=(e,s=!1)=>{if(!s&&d&&!d._disposed)e.add(d),(d._deps||=new Set).add(e);else if(s&&e.size>0){let t=!1;for(let o of e){if(o===d||o._disposed)continue;if(o._isComputed){if(o._dirty=!0,o._subs)w(o._subs,!0)}else C.add(o),t=!0}if(t&&!x&&T===0)queueMicrotask(W)}},j=(e,s=null)=>{let t=new Set;if(_(e)){let o,r=()=>{if(r._dirty){let i=d;d=r;try{let n=e();if(!Object.is(o,n))o=n,w(t,!0)}finally{d=i}r._dirty=!1}return w(t),o};return r._isComputed=!0,r._subs=t,r._dirty=!0,r._deps=null,r._disposed=!1,r}if(s)try{e=JSON.parse(localStorage.getItem(s))??e}catch(o){}return(...o)=>{if(o.length){let r=_(o[0])?o[0](e):o[0];if(!Object.is(e,r)){if(e=r,s)localStorage.setItem(s,JSON.stringify(e));w(t,!0)}}return w(t),e}},V=(e)=>{if(!R(e))return e;let s=D.get(e);if(s)return s;let t=new Map,o=(i)=>{let n=t.get(i);if(!n)t.set(i,n=new Set);return n},r=new Proxy(e,{get(i,n,c){if(typeof n!=="symbol")w(o(n));return V(Reflect.get(i,n,c))},set(i,n,c,l){let a=Reflect.has(i,n),f=Reflect.get(i,n,l),u=Reflect.set(i,n,c,l);if(u&&!Object.is(f,c)){if(w(o(n),!0),!a)w(o(B),!0)}return u},deleteProperty(i,n){let c=Reflect.deleteProperty(i,n);if(c)w(o(n),!0),w(o(B),!0);return c},ownKeys(i){return w(o(B)),Reflect.ownKeys(i)}});return D.set(e,r),r},O=(e,s)=>{if(s===void 0){let o=A(e);return o(),()=>g(o)}let t=A(()=>{let o=Array.isArray(e)?e.map((r)=>r()):e();re(()=>s(o))});return t(),()=>g(t)},I=(e)=>{if(!e)return;if(e._cleanups)e._cleanups.forEach((s)=>s()),e._cleanups.clear();if(e._ownerEffect)g(e._ownerEffect);if(e.childNodes)e.childNodes.forEach((s)=>I(s))},ce=/^\s*(javascript|data|vbscript):/i,ie=new Set(["src","href","formaction","action","background","code","archive"]),le=(e)=>ie.has(e)||e.startsWith("on"),U=(e,s)=>{if(s==null||s===!1)return null;if(le(e)){let t=String(s);if(ce.test(t))return console.warn(`[SigPro] Bloqueado protocolo peligroso en ${e}`),"#"}return s},v=(e,s={},t=[])=>{if(s instanceof Node||b(s)||!R(s))t=s,s={};if(_(e)){let n=A(()=>{let f=e(s,{children:t,emit:(u,...h)=>s[`on${u[0].toUpperCase()}${u.slice(1)}`]?.(...h)});return n._result=f,f});n();let c=n._result;if(c==null)return null;let l=c instanceof Node||b(c)&&c.every((f)=>f instanceof Node)?c:E.createTextNode(String(c)),a=(f)=>{if(R(f)&&!f._isRuntime)f._mounts=n._mounts||[],f._cleanups=n._cleanups||new Set,f._ownerEffect=n};return b(l)?l.forEach(a):a(l),l}let o=oe.has(e),r=o?E.createElementNS(se,e):E.createElement(e);r._cleanups=new Set;for(let n of Object.keys(s)){let c=s[n];if(n==="ref"){_(c)?c(r):c.current=r;continue}if(o&&n.startsWith("xlink:")){let l=U(n.slice(6),c);l==null?r.removeAttributeNS(G,n.slice(6)):r.setAttributeNS(G,n.slice(6),l);continue}if(n.startsWith("on")){let l=n.slice(2).toLowerCase();r.addEventListener(l,c);let a=()=>r.removeEventListener(l,c);r._cleanups.add(a),S(a)}else if(_(c)){let l=A(()=>{let a=U(n,c());if(n==="class")r.className=a||"";else if(a==null)r.removeAttribute(n);else if(n==="style"&&typeof a==="string")r.setAttribute("style",a);else if(n in r&&!o)r[n]=a;else r.setAttribute(n,a===!0?"":a)});if(l(),r._cleanups.add(()=>g(l)),S(()=>g(l)),/^(INPUT|TEXTAREA|SELECT)$/.test(r.tagName)&&(n==="value"||n==="checked")){let a=n==="checked"?"change":"input";r.addEventListener(a,(f)=>c(f.target[n]))}}else{let l=U(n,c);if(l!=null)if(n==="style"&&typeof l==="string")r.setAttribute("style",l);else if(n in r&&!o)r[n]=l;else r.setAttribute(n,l===!0?"":l)}}let i=(n)=>{if(b(n))return n.forEach(i);if(_(n)){let c=E.createTextNode("");r.appendChild(c);let l=[],a=A(()=>{let f=n(),u=(b(f)?f:[f]).map($);l.forEach((p)=>{if(p._isRuntime)p.destroy();else I(p);if(p.parentNode)p.remove()});let h=c;for(let p=u.length-1;p>=0;p--){let y=u[p];if(y.parentNode!==h.parentNode)h.parentNode?.insertBefore(y,h);if(y._mounts)y._mounts.forEach((Q)=>Q());h=y}l=u});a(),r._cleanups.add(()=>g(a)),S(()=>g(a))}else{let c=$(n);if(r.appendChild(c),c._mounts)c._mounts.forEach((l)=>l())}};return i(t),r},k=(e)=>{let s=new Set,t=m,o=d,r=E.createElement("div");r.style.display="contents",r.setAttribute("role","presentation"),m={_cleanups:s},d=null;let i=(n)=>{if(!n)return;if(n._isRuntime)s.add(n.destroy),r.appendChild(n.container);else if(b(n))n.forEach(i);else r.appendChild(n instanceof Node?n:E.createTextNode(String(n==null?"":n)))};try{i(e({onCleanup:(n)=>s.add(n)}))}finally{m=t,d=o}return{_isRuntime:!0,container:r,destroy:()=>{s.forEach((n)=>n()),I(r),r.remove()}}},K=(e,s,t=null)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=null;return O(()=>!!(_(e)?e():e),(n)=>{if(i)i.destroy(),i=null;let c=n?s:t;if(c)i=k(()=>_(c)?c():c),r.insertBefore(i.container,o)}),S(()=>i?.destroy()),r},z=(e,s,t)=>{let o=E.createTextNode(""),r=v("div",{style:"display:contents"},[o]),i=new Map;return O(()=>(_(e)?e():e)||[],(n)=>{let c=new Map,l=[],a=n||[];for(let u=0;us(h,u));else i.delete(p);c.set(p,y),l.push(y)}i.forEach((u)=>u.destroy());let f=o;for(let u=l.length-1;u>=0;u--){let p=l[u].container;if(p.nextSibling!==f)r.insertBefore(p,f);f=p}i=c}),r},N=(e)=>{let s=()=>window.location.hash.slice(1)||"/",t=j(s()),o=()=>t(s());window.addEventListener("hashchange",o),S(()=>window.removeEventListener("hashchange",o));let r=v("div",{class:"router-hook"}),i=null;return O([t],()=>{let n=t(),c=e.find((l)=>{let a=l.path.split("/").filter(Boolean),f=n.split("/").filter(Boolean);return a.length===f.length&&a.every((u,h)=>u[0]===":"||u===f[h])})||e.find((l)=>l.path==="*");if(c){i?.destroy();let l={};c.path.split("/").filter(Boolean).forEach((a,f)=>{if(a[0]===":")l[a.slice(1)]=n.split("/").filter(Boolean)[f]}),N.params(l),i=k(()=>_(c.component)?c.component(l):c.component),r.replaceChildren(i.container)}}),r};N.params=j({});N.to=(e)=>window.location.hash=e.replace(/^#?\/?/,"#/");N.back=()=>window.history.back();N.path=()=>window.location.hash.replace(/^#/,"")||"/";var J=(e,s)=>{let t=typeof s==="string"?E.querySelector(s):s;if(!t)return;if(P.has(t))P.get(t).destroy();let o=k(_(e)?e:()=>e);return t.replaceChildren(o.container),P.set(t,o),o};if(typeof window<"u")Object.assign(window,{$:j,$$:V,watch:O,h:v,when:K,each:z,router:N,mount:J,batch:q,onUnmount:S,isArr:b,isFunc:_,isObj:R}),"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((e)=>{window[e]=(s,t)=>v(e,s,t)});})();