(()=>{var{defineProperty:C,getOwnPropertyNames:I,getOwnPropertyDescriptor:M}=Object,R=Object.prototype.hasOwnProperty;var B=new WeakMap,j=(s)=>{var t=B.get(s),c;if(t)return t;if(t=C({},"__esModule",{value:!0}),s&&typeof s==="object"||typeof s==="function")I(s).map((o)=>!R.call(t,o)&&C(t,o,{get:()=>s[o],enumerable:!(c=M(s,o))||c.enumerable}));return B.set(s,t),t};var W=(s,t)=>{for(var c in t)C(s,c,{get:t[c],enumerable:!0,configurable:!0,set:(o)=>t[c]=()=>o})};var z={};W(z,{$watch:()=>_,$router:()=>v,$mount:()=>P,$if:()=>A,$html:()=>g,$for:()=>$,$:()=>x});var p=null,w=null,b=new Set,S=!1,O=new WeakMap,q=()=>{if(S)return;S=!0;while(b.size>0){let s=Array.from(b).sort((t,c)=>(t.depth||0)-(c.depth||0));b.clear();for(let t of s)if(!t._deleted)t()}S=!1},L=(s)=>{if(p&&!p._deleted)s.add(p),p._deps.add(s)},T=(s)=>{for(let t of s){if(t===p||t._deleted)continue;if(t._isComputed){if(t.markDirty(),t._subs)T(t._subs)}else b.add(t)}if(!S)queueMicrotask(q)},k=(s)=>{if(s._cleanups)s._cleanups.forEach((t)=>t()),s._cleanups.clear();s.childNodes?.forEach(k)},N=(s)=>{let t=new Set,c=w,o=document.createElement("div");o.style.display="contents",w={cleanups:t};try{let i=s({onCleanup:(e)=>t.add(e)}),r=(e)=>{if(!e)return;if(e._isRuntime)t.add(e.destroy),o.appendChild(e.container);else if(Array.isArray(e))e.forEach(r);else o.appendChild(e instanceof Node?e:document.createTextNode(String(e)))};r(i)}finally{w=c}return{_isRuntime:!0,container:o,destroy:()=>{t.forEach((i)=>i()),k(o),o.remove()}}},x=(s,t=null)=>{if(typeof s==="function"){let i=new Set,r,e=!0,a=()=>{if(a._deleted)return;a._deps.forEach((n)=>n.delete(a)),a._deps.clear();let f=p;p=a;try{let n=s();if(!Object.is(r,n)||e)r=n,e=!1,T(i)}finally{p=f}};if(a._deps=new Set,a._isComputed=!0,a._subs=i,a._deleted=!1,a.markDirty=()=>e=!0,a.stop=()=>{a._deleted=!0,a._deps.forEach((f)=>f.delete(a)),i.clear()},w)w.cleanups.add(a.stop);return()=>{if(e)a();return L(i),r}}let c=s;if(t)try{let i=localStorage.getItem(t);if(i!==null)c=JSON.parse(i)}catch(i){console.warn("SigPro: LocalStorage locked",i)}let o=new Set;return(...i)=>{if(i.length){let r=typeof i[0]==="function"?i[0](c):i[0];if(!Object.is(c,r)){if(c=r,t)localStorage.setItem(t,JSON.stringify(c));T(o)}}return L(o),c}};var _=(s,t)=>{let c=Array.isArray(s),o=c?t:s,i=c?s:null;if(typeof o!=="function")return()=>{};let r=w,e=()=>{if(e._deleted)return;e._deps.forEach((n)=>n.delete(e)),e._deps.clear(),e._cleanups.forEach((n)=>n()),e._cleanups.clear();let a=p,f=w;p=e,w={cleanups:e._cleanups},e.depth=a?a.depth+1:0;try{if(c)p=null,o(),p=e,i.forEach((n)=>typeof n==="function"&&n());else o()}finally{p=a,w=f}};if(e._deps=new Set,e._cleanups=new Set,e._deleted=!1,e.stop=()=>{if(e._deleted)return;if(e._deleted=!0,b.delete(e),e._deps.forEach((a)=>a.delete(e)),e._cleanups.forEach((a)=>a()),r)r.cleanups.delete(e.stop)},r)r.cleanups.add(e.stop);return e(),e.stop},g=(s,t={},c=[])=>{if(t instanceof Node||Array.isArray(t)||typeof t!=="object")c=t,t={};let i=["svg","path","circle","rect","line","polyline","polygon","g","defs","text","tspan","use"].includes(s),r=i?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s),e=(n,d)=>(n==="src"||n==="href")&&String(d).toLowerCase().includes("javascript:")?"#":d;r._cleanups=new Set;let a=["disabled","checked","required","readonly","selected","multiple","autofocus"];for(let[n,d]of Object.entries(t)){if(n==="ref"){typeof d==="function"?d(r):d.current=r;continue}let m=typeof d==="function";if(["INPUT","TEXTAREA","SELECT"].includes(r.tagName)&&(n==="value"||n==="checked")&&m){r._cleanups.add(_(()=>{let E=d();if(r[n]!==E)r[n]=E}));let l=n==="checked"?"change":"input",y=(E)=>d(E.target[n]);r.addEventListener(l,y),r._cleanups.add(()=>r.removeEventListener(l,y))}else if(n.startsWith("on")){let l=n.slice(2).toLowerCase().split(".")[0],y=(E)=>d(E);r.addEventListener(l,y),r._cleanups.add(()=>r.removeEventListener(l,y))}else if(m)r._cleanups.add(_(()=>{let l=e(n,d());if(n==="class")r.className=l||"";else if(a.includes(n))if(l)r.setAttribute(n,""),r[n]=!0;else r.removeAttribute(n),r[n]=!1;else if(l==null)r.removeAttribute(n);else if(i&&typeof l==="number")r.setAttribute(n,l);else r.setAttribute(n,l)}));else if(a.includes(n))if(d)r.setAttribute(n,""),r[n]=!0;else r.removeAttribute(n),r[n]=!1;else r.setAttribute(n,e(n,d))}let f=(n)=>{if(Array.isArray(n))return n.forEach(f);if(n instanceof Node)r.appendChild(n);else if(typeof n==="function"){let d=document.createTextNode("");r.appendChild(d);let m=[];r._cleanups.add(_(()=>{let u=n(),h=(Array.isArray(u)?u:[u]).map((l)=>l?._isRuntime?l.container:l instanceof Node?l:document.createTextNode(l??""));m.forEach((l)=>{k?.(l),l.remove()}),h.forEach((l)=>d.parentNode?.insertBefore(l,d)),m=h}))}else r.appendChild(document.createTextNode(n??""))};return f(c),r},A=(s,t,c=null,o=null)=>{let i=document.createTextNode(""),r=g("div",{style:"display:contents"},[i]),e=null,a=null;return _(()=>{let f=!!(typeof s==="function"?s():s);if(f===a)return;if(a=f,e&&!f&&o?.out)o.out(e.container,()=>{e.destroy(),e=null});else{if(e)e.destroy();e=null}if(f||!f&&c){let n=f?t:c;if(n){if(e=N(()=>typeof n==="function"?n():n),r.insertBefore(e.container,i),f&&o?.in)o.in(e.container)}}}),r};A.not=(s,t,c)=>A(()=>!(typeof s==="function"?s():s),t,c);var $=(s,t,c,o="div",i={style:"display:contents"})=>{let r=document.createTextNode(""),e=g(o,i,[r]),a=new Map;return _(()=>{let f=(typeof s==="function"?s():s)||[],n=new Map,d=[];for(let u=0;ut(h,u));else a.delete(l);n.set(l,y),d.push(l)}a.forEach((u)=>{u.destroy(),u.container.remove()});let m=r;for(let u=d.length-1;u>=0;u--){let h=n.get(d[u]);if(h.container.nextSibling!==m)e.insertBefore(h.container,m);m=h.container}a=n}),e},v=(s)=>{let t=x(window.location.hash.replace(/^#/,"")||"/");window.addEventListener("hashchange",()=>t(window.location.hash.replace(/^#/,"")||"/"));let c=g("div",{class:"router-outlet"}),o=null;return _([t],async()=>{let i=t(),r=s.find((e)=>{let a=e.path.split("/").filter(Boolean),f=i.split("/").filter(Boolean);return a.length===f.length&&a.every((n,d)=>n.startsWith(":")||n===f[d])})||s.find((e)=>e.path==="*");if(r){let e=r.component;if(typeof e==="function"&&e.toString().includes("import"))e=(await e()).default||await e();let a={};if(r.path.split("/").filter(Boolean).forEach((f,n)=>{if(f.startsWith(":"))a[f.slice(1)]=i.split("/").filter(Boolean)[n]}),o)o.destroy();if(v.params)v.params(a);o=N(()=>{try{return typeof e==="function"?e(a):e}catch(f){return g("div",{class:"p-4 text-error"},"Error loading view")}}),c.appendChild(o.container)}}),c};v.params=x({});v.to=(s)=>window.location.hash=s.replace(/^#?\/?/,"#/");v.back=()=>window.history.back();v.path=()=>window.location.hash.replace(/^#/,"")||"/";var P=(s,t)=>{let c=typeof t==="string"?document.querySelector(t):t;if(!c)return;if(O.has(c))O.get(c).destroy();let o=N(typeof s==="function"?s:()=>s);return c.replaceChildren(o.container),O.set(c,o),o},D={$:x,$watch:_,$html:g,$if:A,$for:$,$router:v,$mount:P};if(typeof window<"u")((t)=>{Object.keys(t).forEach((o)=>{window[o]=t[o]}),"div span p h1 h2 h3 h4 h5 h6 br hr section article aside nav main header footer address ul ol li dl dt dd a em strong small i b u mark time sub sup pre code blockquote details summary dialog form label input textarea select button option fieldset legend table thead tbody tfoot tr th td caption img video audio canvas svg iframe picture source progress meter".split(/\s+/).forEach((o)=>{let i=o.charAt(0).toUpperCase()+o.slice(1);if(!(i in window))window[i]=(r,e)=>g(o,r,e)}),window.SigPro=Object.freeze(t)})(D);})();