From f66c51dc80d8adb6b8e097a2ed2eefccc994edd7 Mon Sep 17 00:00:00 2001
From: Kevin Bulteel <kb@koalasoft.de>
Date: Fri, 12 Jan 2024 11:05:12 +0100
Subject: [PATCH] rebuild

---
 packages/@hec.js/ui/dist/hec.esm.min.js | 2 +-
 packages/@hec.js/ui/dist/hec.min.js     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/@hec.js/ui/dist/hec.esm.min.js b/packages/@hec.js/ui/dist/hec.esm.min.js
index 4db1efe..f6b2ef5 100644
--- a/packages/@hec.js/ui/dist/hec.esm.min.js
+++ b/packages/@hec.js/ui/dist/hec.esm.min.js
@@ -1 +1 @@
-function j(t){let n=t.matchAll(/([^ {}\s]+)/g),o={meta:{},text:t,prop:null};for(let e of n)if(e[1].includes("=")){let r=e[1].split("=");o.meta[r[0]]=r[1].replaceAll(/'|"/g,"")}else o.prop=e[1];return o}var E={};var S=new WeakMap,P=t=>S.get(t),z=t=>S.delete(t),W=t=>S.has(t),L=(t,n)=>{let o=P(t);o&&typeof o=="object"?S.set(t,Object.assign(o,n)):S.set(t,n)},p=t=>typeof t=="function"?p(t()):t;function h(t,n){let o=n.split(".");if(!n)return t;for(let e of o){if(["loading","error"].includes(e)&&t?.loading&&t?.error)return t[e];if(m(t)){let r=t()?.[e];if(m(r)){let i=new AbortController,a=b(r());r.subscribe({next:a},{signal:i.signal});let s=l=>{i.abort(),m(l[e])?(i=new AbortController,l[e].subscribe({next:a},{signal:i.signal}),a(l[e]())):a(l[e])};t.subscribe({next:s}),t=a}else t=t.map(i=>i&&i[e])}else if(typeof t=="function")t=p(t);else if(typeof t[e]<"u")typeof t[e]=="function"&&!m(t[e])?t=t[e].bind(t):t=t[e];else return null}return t}function R(t,n){let o=n.split(".");if(!n)return!1;for(let e of o){if(["loading","error"].includes(e)&&t?.loading&&t?.error)return t[e];if(typeof t=="function")t=p(t);else if(typeof t[e]<"u")t=t[e];else return!1}return!0}function b(t=null,n={}){let o=[],e=a=>{t=a;for(let s of o)s.next(t)};function r(){return arguments.length&&t!==arguments[0]&&e(arguments[0]),t}let i=(a,s=null)=>{o.push(a),s?.signal.addEventListener("abort",()=>{let l=o.indexOf(a);l>-1&&o.splice(l,1)},{once:!0})};return Object.assign(r,{signal:n.name??"",toString:()=>t.toString(),set:a=>t=a,update:e,subscribe:i,map:a=>{let s=b(a(t)),l=new AbortController,c=s.subscribe;return i({next:u=>s(a(u))},{signal:l.signal}),Object.assign(s,{set:()=>null,subscribe:(u,d)=>{c(u,d),d?.signal.addEventListener("abort",()=>l.abort())}})},filter:a=>{let s=b(a(t)?t:null);return i({next:l=>a(l)?s(l):null}),Object.assign(s,{set:()=>null})}})}function et(t,n=[],o=null){for(let e of n)e.subscribe({next:()=>o=t(o)});return t(o)}function pt(t,n=[],o=null){let e=b(null);return e(et(r=>e(t(r)),n,o)),e}function nt(t,n=null){let o=b(n),e=b(!0),r=b(null),i=async()=>{try{o(await t()),e(!1)}catch(a){a(a)}return o()};return i(),Object.assign(o,{loading:e,error:r,refetch:i})}function dt(t,n,o=null){let e=nt(()=>n(p(t)),o);return m(t)&&t.subscribe({next:()=>e.refetch()}),e}var m=t=>t&&t.subscribe;var rt=b({}),A=b(location.pathname);var y=document.querySelector('head meta[name="route"]');y||(y=document.createElement("meta"),y.name="route",y.content=location.pathname,document.head.append(y));var k=()=>{y.content="",A(location.pathname),rt(Object.fromEntries(new URLSearchParams(location.search))),y.content=y.content||location.pathname};window.addEventListener("popstate",k);window.addEventListener("hashchange",k);var ot=window.history.pushState,at=window.history.replaceState;window.history.pushState=function(n,o,e){ot.call(window.history,n,o,e),k()};window.history.replaceState=function(n,o,e){at.call(window.history,n,o,e),k()};var O=new WeakMap,st=new MutationObserver(t=>{for(let n of t)O.has(n.target)&&O.get(n.target)()}),B={select:"[data-match]",run:t=>{let n=t.dataset.match,o=i=>i.replace(/index\.*[a-z0-9]*$/gm,"");function e(){return o(new URL(t.dataset.route||t.getAttribute("href"),location.href).pathname)}let r=()=>{e()==o(location.pathname)?t.classList.add(n):t.classList.remove(n)};A.subscribe({next:r}),O.set(t,r),st.observe(t,{attributes:!0,attributeFilter:["href","data-route"]}),r(),t.removeAttribute("data-match")}};var T={number:t=>t.valueAsNumber,date:t=>t.valueAsDate,text:t=>t.value,checkbox:t=>t.checked,"":t=>t.value},q={select:"[data-bind],[name]",run:(t,n)=>{let o=t.getAttribute("name")||t.dataset.bind,e=h(n,o);if(e){let r=i=>{t.type=="checkbox"?t.checked=i:t.value=i};r(p(e)),m(e)&&(e.subscribe({next:r}),t.addEventListener("input",()=>e(T[t.type]?.(t)??t.value)),t.addEventListener("change",()=>e(T[t.type]?.(t)??t.value)))}}};var N=new WeakMap,H=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting&&N.has(n.target)){for(let o of N.get(n.target))o();N.delete(n.target),H.unobserve(n.target)}},{rootMargin:"256px"});function w(t){return new Promise(n=>{let o=N.get(t)??[];o.push(n),N.set(t,o),H.observe(t)})}var C=new WeakSet,_={select:"[data-include]",run:(t,n)=>{if(C.has(t)||t.children.length)return;C.add(t);let o=t.hasAttribute("data-lazy")&&t.closest("[hidden]"),e=async()=>{t.dispatchEvent(new CustomEvent("::load",{bubbles:!0}));let r=await fetch(t.dataset.include,{headers:{accept:"text/html,text/*"}});if(r.ok){let i=await r.text();t.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),t.innerHTML=i;for(let a of t.childNodes)g(a,n);t.removeAttribute("data-include"),t.removeAttribute("data-lazy")}};t.hasAttribute("data-lazy")?w(t).then(e):e()}};var I=new WeakSet,U={select:"[data-for]",run:(t,n,o)=>{if(I.has(t))return;let e=t.dataset.for.replace("let","").split("of"),r=e[0].split(","),i=e.at(-1).trim(),a=r[0].trim()==i?"__e":r[0].trim(),s=r[1]?.trim()??"__i",l=h(n,i),c=document.createComment(t.dataset.for);t.replaceWith(c),C.add(t);let u=()=>{let f=c;for(;(f=f.nextSibling)&&(f instanceof HTMLElement&&f.dataset.for==t.dataset.for);)f=f.previousSibling,f.nextSibling.remove()},d=f=>{u();for(let x=0,v=c;x<f.length;x++){let M=t.cloneNode(!0),tt=Object.assign({},n,{[a]:f[x],[s]:x});I.add(M),v.after(g(M,tt)),v=v.nextSibling}};d(p(l)),m(l)&&l.subscribe({next:d}),o()}};var F={select:"[data-if]",run:(t,n)=>{let o=h(n,t.dataset.if),e=document.createComment("if: "+t.dataset.if);t.replaceWith(e);let r=i=>{!t.parentNode&&i?(t.hidden=!1,e.after(t)):t.localName!="link"&&t.remove()};r(p(o)),m(o)&&o.subscribe({next:r})}};var V=new WeakSet,$={select:"[data-lazy]",run:(t,n,o)=>{if(V.has(t)||!t.childNodes.length)return;V.add(t);let e=t.closest("[hidden]"),r=t.dataset.lazy,i=()=>{for(let a of t.childNodes)g(a,n);t.removeAttribute("data-lazy")};r&&(t.addEventListener("::load",()=>t.classList.add(r),{once:!0}),t.addEventListener("::loaded",()=>t.classList.remove(r),{once:!0})),w(t).then(i),o()}};var D={select:"[data-on]",run:(t,n)=>{let o=e=>{let r=e.split(":"),i=r[0].trim(),a=r.at(-1).trim(),s=h(n,a);s&&t.addEventListener(i,s)};for(let e of t.dataset.on.split(","))o(e)}};var K=t=>{let n=document.createElement("link");Object.assign(n,t),n.rel="preload",document.head.append(n)};var G=new WeakSet,J={select:"[data-preload]",run:t=>{if(G.has(t)||t.hidden)return;G.add(t);let n=()=>{let o=t.dataset.preload.split(",");for(let e of o){let r=e.split(":");K({href:r[0],as:r[1]??"fetch"})}};t.hasAttribute("data-lazy")?w(t).then(n):n()}};var it=t=>{let n=t.dataset.route;for(;t=t.parentElement;)t.dataset.route&&(n=t.dataset.route+n);return n.replaceAll(/\/+/g,"/")},Q={select:"[data-route]",run:async t=>{"URLPattern"in window||await import("https://kevinblt.github.io/hec/packages/@hec.js/ui/lib/src/plugins.js");let n=it(t),o=new URLPattern({pathname:n}),e=document.createComment("route: "+n);t.replaceWith(e);let r=()=>{let i=location.href.replace(/index\.*[a-z0-9]*$/gm,"");if(!t.parentNode&&o.test(i)){t.hidden=!1,e.after(t);let a=document.querySelector('head meta[name="route"]');a&&(a.content=o.pathname)}else t.localName!="link"&&t.remove()};A.subscribe({next:r}),r()}};var X=[U,F,Q,J,_,D,q,B,$];var Y={};function ie(t,n={}){t instanceof URL&&(t=t.host==location.host?t.pathname:t.toString());let o=document.querySelector(`template[name="${t}"]`);if(!o){let e=document.querySelector('head meta[name="template-path"]');return Y[t]??=new Promise(async r=>{o=document.createElement("template"),o.setAttribute("id",t.toString()),o.innerHTML=await fetch(e?.content?.replaceAll("[name]",t.toString())??t).then(s=>s.text());let i=o.content.querySelectorAll('link[rel="stylesheet"][href]'),a=[];for(let s of i)a.push(fetch(s.href).then(l=>l.text()).then(l=>{let c=document.createElement("style");c.innerHTML=l,s.replaceWith(c)}));await Promise.all(a),document.body.append(o),r(o)}),Y[t].then(r=>g(r.content.cloneNode(!0),n))}return g(o.content.cloneNode(!0),n)}function le(t,n={}){let o=document.createElement("template");return o.dataset.name="anonymous",o.innerHTML=t,g(o.content.cloneNode(!0),n)}function g(t,n={}){let o=(r,i)=>{let a=r.match(/{{[^}]+}}/g).map(j),s=r,l=()=>{r=s;for(let c of a){let u=p(c.value);r=r.replace(c.text,u??"<null>")}return r};for(let c of a){let u=h(n,c.prop);if(m(u)){let d=u;for(let f in c.meta)if(E[f]){let x=E[f];d=d.map(v=>x({value:v,key:c.prop,param:c.meta[f],options:c.meta}))}c.value=d,d.subscribe({next:()=>i(l())})}else{let d=u;for(let f in c.meta)if(E[f]){let x=E[f];d=x({value:p(u),key:c.prop,param:c.meta[f],options:c.meta})}c.value=()=>d}}i(l())},e=r=>{let i=!1;if(!W(r)){if(r.nodeName=="#document-fragment"&&L(r,n),r instanceof HTMLElement){let a=r.getAttributeNames();L(r,n);for(let s of X)r.matches(s.select)&&s.run(r,n,()=>i=!0);if(i)return;for(let s of a){let l=r.getAttribute(s);l?.includes("{{")?o(l,c=>{c=c.trim().replace(/ +/," "),c==="<null>"?r.removeAttribute(s):r.setAttribute(s,c)}):r.localName.includes("-")&&R(n,l)&&r.setAttribute(s,`@parent.${l}`)}}else if(r instanceof Text&&r.textContent.includes("{{")){let a=r.textContent.split(/{{|}}/g);for(let s=0,l=r,c;s<a.length;s++)c=document.createTextNode(a[s]),s%2!=0&&o(`{{${a[s]}}}`,u=>c.data=u.replaceAll("<null>","")),l.after(c),l=c;r.remove()}for(let a of r.childNodes)e(a)}};return e(t),t}function pe(t,n,o){customElements.define(t,class extends HTMLElement{static observedAttributes=Object.keys(n).map(e=>e.toLowerCase());#e=Object.fromEntries(Object.entries(n).map(e=>[e[0],b(e[1])]));#t={};#n=!1;on(e,r,i=null){this.addEventListener(e,r,i)}querySelector(e){return this.shadowRoot.querySelector(e)}querySelectorAll(e){return this.shadowRoot.querySelectorAll(e)}async connectedCallback(){if(this.hasAttribute("data-lazy")&&await w(this),this.dispatchEvent(new CustomEvent("::load",{bubbles:!0})),this.#n){this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),this.dispatchEvent(new CustomEvent("::mount"));return}let e=this.shadowRoot??this.attachShadow({mode:"open"}),r=o(this.#e,this);(a=>{L(this,P(a)),this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),e.append(a),this.#n=!0,this.#t["::attributes"]=new AbortController;for(let s in n)this.hasAttribute(s)||this.setAttribute(s,n[s].toString()),this.#e[s].subscribe({next:l=>this.setAttribute(s,l.toString())},{signal:this.#t["::attributes"].signal});this.dispatchEvent(new CustomEvent("::mount"))})(r instanceof Promise?await r:r)}disconnectedCallback(){z(this);for(let e in this.#t)this.#t[e].abort(),delete this.#t[e];this.dispatchEvent(new CustomEvent("::unmount"))}#r(e=""){e=e.toLowerCase();for(let r in this.#e)if(r.toLowerCase()==e)return[n[r],this.#e[r]];return[null,null]}attributeChangedCallback(e,r,i){let[a,s]=this.#r(e);if(i.startsWith("@parent.")){let l=this.parentNode.host||this.parentNode,c=i.slice(8),u=h(P(l),c)??h(P(this),c);m(u)?(this.#t[a]?.abort(),this.#t[a]=new AbortController,s(p(u)),u.subscribe({next:s},{signal:this.#t[a].signal})):s(u)}else s(typeof a=="number"?parseFloat(i):i)}})}var Z=new WeakMap;function be(t,n=null){document.dispatchEvent(new CustomEvent(t,{detail:n}))}function ge(t,n){let o=e=>n(e.detail);Z.set(n,o),document.addEventListener(t,o)}function xe(t){return new Promise(n=>{let o=e=>n(e.detail);document.addEventListener(t,o,{once:!0})})}function ye(t,n){document.removeEventListener(t,Z.get(n))}export{pe as component,z as deletePropsOf,et as effect,be as emit,j as expression,p as f,R as hasProp,W as hasProps,m as isSignal,pt as memo,ye as off,ge as on,xe as once,E as pipes,X as plugins,h as prop,P as propsOf,nt as resource,dt as resourceBy,L as setPropsOf,b as signal,ie as templateByName,g as templateByNode,le as templateByString};
+function j(t){let n=t.matchAll(/([^ {}\s]+)/g),o={meta:{},text:t,prop:null};for(let e of n)if(e[1].includes("=")){let r=e[1].split("=");o.meta[r[0]]=r[1].replaceAll(/'|"/g,"")}else o.prop=e[1];return o}var E={};var S=new WeakMap,P=t=>S.get(t),z=t=>S.delete(t),W=t=>S.has(t),L=(t,n)=>{let o=P(t);o&&typeof o=="object"?S.set(t,Object.assign(o,n)):S.set(t,n)},p=t=>typeof t=="function"?p(t()):t;function h(t,n){let o=n.split(".");if(!n)return t;for(let e of o){if(["loading","error"].includes(e)&&t?.loading&&t?.error)return t[e];if(m(t)){let r=t()?.[e];if(m(r)){let i=new AbortController,a=b(r());r.subscribe({next:a},{signal:i.signal});let s=l=>{i.abort(),m(l[e])?(i=new AbortController,l[e].subscribe({next:a},{signal:i.signal}),a(l[e]())):a(l[e])};t.subscribe({next:s}),t=a}else t=t.map(i=>i&&i[e])}else if(typeof t=="function")t=p(t);else if(typeof t[e]<"u")typeof t[e]=="function"&&!m(t[e])?t=t[e].bind(t):t=t[e];else return null}return t}function R(t,n){let o=n.split(".");if(!n)return!1;for(let e of o){if(["loading","error"].includes(e)&&t?.loading&&t?.error)return t[e];if(typeof t=="function")t=p(t);else if(typeof t[e]<"u")t=t[e];else return!1}return!0}function b(t=null,n={}){let o=[],e=a=>{t=a;for(let s of o)s.next(t)};function r(){return arguments.length&&t!==arguments[0]&&e(arguments[0]),t}let i=(a,s=null)=>{o.push(a),s?.signal.addEventListener("abort",()=>{let l=o.indexOf(a);l>-1&&o.splice(l,1)},{once:!0})};return Object.assign(r,{signal:n.name??"",toString:()=>t.toString(),set:a=>t=a,update:e,subscribe:i,map:a=>{let s=b(a(t)),l=new AbortController,c=s.subscribe;return i({next:u=>s(a(u))},{signal:l.signal}),Object.assign(s,{set:()=>null,subscribe:(u,d)=>{c(u,d),d?.signal.addEventListener("abort",()=>l.abort())}})},filter:a=>{let s=b(a(t)?t:null);return i({next:l=>a(l)?s(l):null}),Object.assign(s,{set:()=>null})}})}function et(t,n=[],o=null){for(let e of n)e.subscribe({next:()=>o=t(o)});return t(o)}function pt(t,n=[],o=null){let e=b(null);return e(et(r=>e(t(r)),n,o)),e}function nt(t,n=null){let o=b(n),e=b(!0),r=b(null),i=async()=>{try{o(await t()),e(!1)}catch(a){a(a)}return o()};return i(),Object.assign(o,{loading:e,error:r,refetch:i})}function dt(t,n,o=null){let e=nt(()=>n(p(t)),o);return m(t)&&t.subscribe({next:()=>e.refetch()}),e}var m=t=>t&&t.subscribe;var rt=b({}),A=b(location.pathname);var y=document.querySelector('head meta[name="route"]');y||(y=document.createElement("meta"),y.name="route",y.content=location.pathname,document.head.append(y));var k=()=>{y.content="",A(location.pathname),rt(Object.fromEntries(new URLSearchParams(location.search))),y.content=y.content||location.pathname};window.addEventListener("popstate",k);window.addEventListener("hashchange",k);var ot=window.history.pushState,at=window.history.replaceState;window.history.pushState=function(n,o,e){ot.call(window.history,n,o,e),k()};window.history.replaceState=function(n,o,e){at.call(window.history,n,o,e),k()};var O=new WeakMap,st=new MutationObserver(t=>{for(let n of t)O.has(n.target)&&O.get(n.target)()}),B={select:"[data-match]",run:t=>{let n=t.dataset.match,o=i=>i.replace(/index\.*[a-z0-9]*$/gm,"");function e(){return o(new URL(t.dataset.route||t.getAttribute("href"),location.href).pathname)}let r=()=>{e()==o(location.pathname)?t.classList.add(n):t.classList.remove(n)};A.subscribe({next:r}),O.set(t,r),st.observe(t,{attributes:!0,attributeFilter:["href","data-route"]}),r(),t.removeAttribute("data-match")}};var T={number:t=>t.valueAsNumber,date:t=>t.valueAsDate,text:t=>t.value,checkbox:t=>t.checked,"":t=>t.value},q={select:"[data-bind],[name]",run:(t,n)=>{let o=t.getAttribute("name")||t.dataset.bind,e=h(n,o);if(e){let r=i=>{t.type=="checkbox"?t.checked=i:t.value=i};r(p(e)),m(e)&&(e.subscribe({next:r}),t.addEventListener("input",()=>e(T[t.type]?.(t)??t.value)),t.addEventListener("change",()=>e(T[t.type]?.(t)??t.value)))}}};var N=new WeakMap,H=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting&&N.has(n.target)){for(let o of N.get(n.target))o();N.delete(n.target),H.unobserve(n.target)}},{rootMargin:"256px"});function w(t){return new Promise(n=>{let o=N.get(t)??[];o.push(n),N.set(t,o),H.observe(t)})}var C=new WeakSet,_={select:"[data-include]",run:(t,n)=>{if(C.has(t)||t.children.length)return;C.add(t);let o=t.hasAttribute("data-lazy")&&t.closest("[hidden]"),e=async()=>{t.dispatchEvent(new CustomEvent("::load",{bubbles:!0}));let r=await fetch(t.dataset.include,{headers:{accept:"text/html,text/*"}});if(r.ok){let i=await r.text();t.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),t.innerHTML=i;for(let a of t.childNodes)g(a,n);t.removeAttribute("data-include"),t.removeAttribute("data-lazy")}};t.hasAttribute("data-lazy")?w(t).then(e):e()}};var I=new WeakSet,U={select:"[data-for]",run:(t,n,o)=>{if(I.has(t))return;let e=t.dataset.for.replace("let","").split("of"),r=e[0].split(","),i=e.at(-1).trim(),a=r[0].trim()==i?"__e":r[0].trim(),s=r[1]?.trim()??"__i",l=h(n,i),c=document.createComment(t.dataset.for);t.replaceWith(c),C.add(t);let u=()=>{let f=c;for(;(f=f.nextSibling)&&(f instanceof HTMLElement&&f.dataset.for==t.dataset.for);)f=f.previousSibling,f.nextSibling.remove()},d=f=>{u();for(let x=0,v=c;x<f.length;x++){let M=t.cloneNode(!0),tt=Object.assign({},n,{[a]:f[x],[s]:x});I.add(M),v.after(g(M,tt)),v=v.nextSibling}};d(p(l)),m(l)&&l.subscribe({next:d}),o()}};var F={select:"[data-if]",run:(t,n)=>{let o=h(n,t.dataset.if),e=document.createComment("if: "+t.dataset.if);t.replaceWith(e);let r=i=>{!t.parentNode&&i?(t.hidden=!1,e.after(t)):t.localName!="link"&&t.remove()};r(p(o)),m(o)&&o.subscribe({next:r})}};var V=new WeakSet,$={select:"[data-lazy]",run:(t,n,o)=>{if(V.has(t)||!t.childNodes.length)return;V.add(t);let e=t.closest("[hidden]"),r=t.dataset.lazy,i=()=>{for(let a of t.childNodes)g(a,n);t.removeAttribute("data-lazy")};r&&(t.addEventListener("::load",()=>t.classList.add(r),{once:!0}),t.addEventListener("::loaded",()=>t.classList.remove(r),{once:!0})),w(t).then(i),o()}};var D={select:"[data-on]",run:(t,n)=>{let o=e=>{let r=e.split(":"),i=r[0].trim(),a=r.at(-1).trim(),s=h(n,a);s&&t.addEventListener(i,s)};for(let e of t.dataset.on.split(","))o(e)}};var K=t=>{let n=document.createElement("link");Object.assign(n,t),n.rel="preload",document.head.append(n)};var G=new WeakSet,J={select:"[data-preload]",run:t=>{if(G.has(t)||t.hidden)return;G.add(t);let n=()=>{let o=t.dataset.preload.split(",");for(let e of o){let r=e.split(":");K({href:r[0],as:r[1]??"fetch"})}};t.hasAttribute("data-lazy")?w(t).then(n):n()}};var it=t=>{let n=t.dataset.route;for(;t=t.parentElement;)t.dataset.route&&(n=t.dataset.route+n);return n.replaceAll(/\/+/g,"/")},Q={select:"[data-route]",run:async t=>{"URLPattern"in window||await import("https://kevinblt.github.io/hec/packages/@hec.js/ui/dist/urlpattnern.min.js");let n=it(t),o=new URLPattern({pathname:n}),e=document.createComment("route: "+n);t.replaceWith(e);let r=()=>{let i=location.href.replace(/index\.*[a-z0-9]*$/gm,"");if(!t.parentNode&&o.test(i)){t.hidden=!1,e.after(t);let a=document.querySelector('head meta[name="route"]');a&&(a.content=o.pathname)}else t.localName!="link"&&t.remove()};A.subscribe({next:r}),r()}};var X=[U,F,Q,J,_,D,q,B,$];var Y={};function ie(t,n={}){t instanceof URL&&(t=t.host==location.host?t.pathname:t.toString());let o=document.querySelector(`template[name="${t}"]`);if(!o){let e=document.querySelector('head meta[name="template-path"]');return Y[t]??=new Promise(async r=>{o=document.createElement("template"),o.setAttribute("id",t.toString()),o.innerHTML=await fetch(e?.content?.replaceAll("[name]",t.toString())??t).then(s=>s.text());let i=o.content.querySelectorAll('link[rel="stylesheet"][href]'),a=[];for(let s of i)a.push(fetch(s.href).then(l=>l.text()).then(l=>{let c=document.createElement("style");c.innerHTML=l,s.replaceWith(c)}));await Promise.all(a),document.body.append(o),r(o)}),Y[t].then(r=>g(r.content.cloneNode(!0),n))}return g(o.content.cloneNode(!0),n)}function le(t,n={}){let o=document.createElement("template");return o.dataset.name="anonymous",o.innerHTML=t,g(o.content.cloneNode(!0),n)}function g(t,n={}){let o=(r,i)=>{let a=r.match(/{{[^}]+}}/g).map(j),s=r,l=()=>{r=s;for(let c of a){let u=p(c.value);r=r.replace(c.text,u??"<null>")}return r};for(let c of a){let u=h(n,c.prop);if(m(u)){let d=u;for(let f in c.meta)if(E[f]){let x=E[f];d=d.map(v=>x({value:v,key:c.prop,param:c.meta[f],options:c.meta}))}c.value=d,d.subscribe({next:()=>i(l())})}else{let d=u;for(let f in c.meta)if(E[f]){let x=E[f];d=x({value:p(u),key:c.prop,param:c.meta[f],options:c.meta})}c.value=()=>d}}i(l())},e=r=>{let i=!1;if(!W(r)){if(r.nodeName=="#document-fragment"&&L(r,n),r instanceof HTMLElement){let a=r.getAttributeNames();L(r,n);for(let s of X)r.matches(s.select)&&s.run(r,n,()=>i=!0);if(i)return;for(let s of a){let l=r.getAttribute(s);l?.includes("{{")?o(l,c=>{c=c.trim().replace(/ +/," "),c==="<null>"?r.removeAttribute(s):r.setAttribute(s,c)}):r.localName.includes("-")&&R(n,l)&&r.setAttribute(s,`@parent.${l}`)}}else if(r instanceof Text&&r.textContent.includes("{{")){let a=r.textContent.split(/{{|}}/g);for(let s=0,l=r,c;s<a.length;s++)c=document.createTextNode(a[s]),s%2!=0&&o(`{{${a[s]}}}`,u=>c.data=u.replaceAll("<null>","")),l.after(c),l=c;r.remove()}for(let a of r.childNodes)e(a)}};return e(t),t}function pe(t,n,o){customElements.define(t,class extends HTMLElement{static observedAttributes=Object.keys(n).map(e=>e.toLowerCase());#e=Object.fromEntries(Object.entries(n).map(e=>[e[0],b(e[1])]));#t={};#n=!1;on(e,r,i=null){this.addEventListener(e,r,i)}querySelector(e){return this.shadowRoot.querySelector(e)}querySelectorAll(e){return this.shadowRoot.querySelectorAll(e)}async connectedCallback(){if(this.hasAttribute("data-lazy")&&await w(this),this.dispatchEvent(new CustomEvent("::load",{bubbles:!0})),this.#n){this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),this.dispatchEvent(new CustomEvent("::mount"));return}let e=this.shadowRoot??this.attachShadow({mode:"open"}),r=o(this.#e,this);(a=>{L(this,P(a)),this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),e.append(a),this.#n=!0,this.#t["::attributes"]=new AbortController;for(let s in n)this.hasAttribute(s)||this.setAttribute(s,n[s].toString()),this.#e[s].subscribe({next:l=>this.setAttribute(s,l.toString())},{signal:this.#t["::attributes"].signal});this.dispatchEvent(new CustomEvent("::mount"))})(r instanceof Promise?await r:r)}disconnectedCallback(){z(this);for(let e in this.#t)this.#t[e].abort(),delete this.#t[e];this.dispatchEvent(new CustomEvent("::unmount"))}#r(e=""){e=e.toLowerCase();for(let r in this.#e)if(r.toLowerCase()==e)return[n[r],this.#e[r]];return[null,null]}attributeChangedCallback(e,r,i){let[a,s]=this.#r(e);if(i.startsWith("@parent.")){let l=this.parentNode.host||this.parentNode,c=i.slice(8),u=h(P(l),c)??h(P(this),c);m(u)?(this.#t[a]?.abort(),this.#t[a]=new AbortController,s(p(u)),u.subscribe({next:s},{signal:this.#t[a].signal})):s(u)}else s(typeof a=="number"?parseFloat(i):i)}})}var Z=new WeakMap;function be(t,n=null){document.dispatchEvent(new CustomEvent(t,{detail:n}))}function ge(t,n){let o=e=>n(e.detail);Z.set(n,o),document.addEventListener(t,o)}function xe(t){return new Promise(n=>{let o=e=>n(e.detail);document.addEventListener(t,o,{once:!0})})}function ye(t,n){document.removeEventListener(t,Z.get(n))}export{pe as component,z as deletePropsOf,et as effect,be as emit,j as expression,p as f,R as hasProp,W as hasProps,m as isSignal,pt as memo,ye as off,ge as on,xe as once,E as pipes,X as plugins,h as prop,P as propsOf,nt as resource,dt as resourceBy,L as setPropsOf,b as signal,ie as templateByName,g as templateByNode,le as templateByString};
diff --git a/packages/@hec.js/ui/dist/hec.min.js b/packages/@hec.js/ui/dist/hec.min.js
index 47a6471..33229a5 100644
--- a/packages/@hec.js/ui/dist/hec.min.js
+++ b/packages/@hec.js/ui/dist/hec.min.js
@@ -1 +1 @@
-(()=>{var at=Object.create;var M=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ut=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ft=(t,e)=>{for(var r in e)M(t,r,{get:e[r],enumerable:!0})},mt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of it(e))!ct.call(t,o)&&o!==r&&M(t,o,{get:()=>e[o],enumerable:!(n=st(e,o))||n.enumerable});return t};var pt=(t,e,r)=>(r=t!=null?at(lt(t)):{},mt(e||!t||!t.__esModule?M(r,"default",{value:t,enumerable:!0}):r,t));var O={};ft(O,{component:()=>St,deletePropsOf:()=>z,effect:()=>H,emit:()=>Pt,expression:()=>j,f:()=>p,hasProp:()=>R,hasProps:()=>W,isSignal:()=>m,memo:()=>dt,off:()=>kt,on:()=>Lt,once:()=>At,pipes:()=>v,plugins:()=>B,prop:()=>d,propsOf:()=>E,resource:()=>_,resourceBy:()=>ht,setPropsOf:()=>S,signal:()=>h,templateByName:()=>vt,templateByNode:()=>g,templateByString:()=>Et});function j(t){let e=t.matchAll(/([^ {}\s]+)/g),r={meta:{},text:t,prop:null};for(let n of e)if(n[1].includes("=")){let o=n[1].split("=");r.meta[o[0]]=o[1].replaceAll(/'|"/g,"")}else r.prop=n[1];return r}var v={};var L=new WeakMap,E=t=>L.get(t),z=t=>L.delete(t),W=t=>L.has(t),S=(t,e)=>{let r=E(t);r&&typeof r=="object"?L.set(t,Object.assign(r,e)):L.set(t,e)},p=t=>typeof t=="function"?p(t()):t;function d(t,e){let r=e.split(".");if(!e)return t;for(let n of r){if(["loading","error"].includes(n)&&t?.loading&&t?.error)return t[n];if(m(t)){let o=t()?.[n];if(m(o)){let i=new AbortController,a=h(o());o.subscribe({next:a},{signal:i.signal});let s=l=>{i.abort(),m(l[n])?(i=new AbortController,l[n].subscribe({next:a},{signal:i.signal}),a(l[n]())):a(l[n])};t.subscribe({next:s}),t=a}else t=t.map(i=>i&&i[n])}else if(typeof t=="function")t=p(t);else if(typeof t[n]<"u")typeof t[n]=="function"&&!m(t[n])?t=t[n].bind(t):t=t[n];else return null}return t}function R(t,e){let r=e.split(".");if(!e)return!1;for(let n of r){if(["loading","error"].includes(n)&&t?.loading&&t?.error)return t[n];if(typeof t=="function")t=p(t);else if(typeof t[n]<"u")t=t[n];else return!1}return!0}function h(t=null,e={}){let r=[],n=a=>{t=a;for(let s of r)s.next(t)};function o(){return arguments.length&&t!==arguments[0]&&n(arguments[0]),t}let i=(a,s=null)=>{r.push(a),s?.signal.addEventListener("abort",()=>{let l=r.indexOf(a);l>-1&&r.splice(l,1)},{once:!0})};return Object.assign(o,{signal:e.name??"",toString:()=>t.toString(),set:a=>t=a,update:n,subscribe:i,map:a=>{let s=h(a(t)),l=new AbortController,c=s.subscribe;return i({next:u=>s(a(u))},{signal:l.signal}),Object.assign(s,{set:()=>null,subscribe:(u,b)=>{c(u,b),b?.signal.addEventListener("abort",()=>l.abort())}})},filter:a=>{let s=h(a(t)?t:null);return i({next:l=>a(l)?s(l):null}),Object.assign(s,{set:()=>null})}})}function H(t,e=[],r=null){for(let n of e)n.subscribe({next:()=>r=t(r)});return t(r)}function dt(t,e=[],r=null){let n=h(null);return n(H(o=>n(t(o)),e,r)),n}function _(t,e=null){let r=h(e),n=h(!0),o=h(null),i=async()=>{try{r(await t()),n(!1)}catch(a){a(a)}return r()};return i(),Object.assign(r,{loading:n,error:o,refetch:i})}function ht(t,e,r=null){let n=_(()=>e(p(t)),r);return m(t)&&t.subscribe({next:()=>n.refetch()}),n}var m=t=>t&&t.subscribe;var bt=h({}),A=h(location.pathname);var y=document.querySelector('head meta[name="route"]');y||(y=document.createElement("meta"),y.name="route",y.content=location.pathname,document.head.append(y));var N=()=>{y.content="",A(location.pathname),bt(Object.fromEntries(new URLSearchParams(location.search))),y.content=y.content||location.pathname};window.addEventListener("popstate",N);window.addEventListener("hashchange",N);var gt=window.history.pushState,xt=window.history.replaceState;window.history.pushState=function(e,r,n){gt.call(window.history,e,r,n),N()};window.history.replaceState=function(e,r,n){xt.call(window.history,e,r,n),N()};var T=new WeakMap,yt=new MutationObserver(t=>{for(let e of t)T.has(e.target)&&T.get(e.target)()}),I={select:"[data-match]",run:t=>{let e=t.dataset.match,r=i=>i.replace(/index\.*[a-z0-9]*$/gm,"");function n(){return r(new URL(t.dataset.route||t.getAttribute("href"),location.href).pathname)}let o=()=>{n()==r(location.pathname)?t.classList.add(e):t.classList.remove(e)};A.subscribe({next:o}),T.set(t,o),yt.observe(t,{attributes:!0,attributeFilter:["href","data-route"]}),o(),t.removeAttribute("data-match")}};var U={number:t=>t.valueAsNumber,date:t=>t.valueAsDate,text:t=>t.value,checkbox:t=>t.checked,"":t=>t.value},F={select:"[data-bind],[name]",run:(t,e)=>{let r=t.getAttribute("name")||t.dataset.bind,n=d(e,r);if(n){let o=i=>{t.type=="checkbox"?t.checked=i:t.value=i};o(p(n)),m(n)&&(n.subscribe({next:o}),t.addEventListener("input",()=>n(U[t.type]?.(t)??t.value)),t.addEventListener("change",()=>n(U[t.type]?.(t)??t.value)))}}};var k=new WeakMap,V=new IntersectionObserver(t=>{for(let e of t)if(e.isIntersecting&&k.has(e.target)){for(let r of k.get(e.target))r();k.delete(e.target),V.unobserve(e.target)}},{rootMargin:"256px"});function w(t){return new Promise(e=>{let r=k.get(t)??[];r.push(e),k.set(t,r),V.observe(t)})}var C=new WeakSet,$={select:"[data-include]",run:(t,e)=>{if(C.has(t)||t.children.length)return;C.add(t);let r=t.hasAttribute("data-lazy")&&t.closest("[hidden]"),n=async()=>{t.dispatchEvent(new CustomEvent("::load",{bubbles:!0}));let o=await fetch(t.dataset.include,{headers:{accept:"text/html,text/*"}});if(o.ok){let i=await o.text();t.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),t.innerHTML=i;for(let a of t.childNodes)g(a,e);t.removeAttribute("data-include"),t.removeAttribute("data-lazy")}};t.hasAttribute("data-lazy")?w(t).then(n):n()}};var D=new WeakSet,K={select:"[data-for]",run:(t,e,r)=>{if(D.has(t))return;let n=t.dataset.for.replace("let","").split("of"),o=n[0].split(","),i=n.at(-1).trim(),a=o[0].trim()==i?"__e":o[0].trim(),s=o[1]?.trim()??"__i",l=d(e,i),c=document.createComment(t.dataset.for);t.replaceWith(c),C.add(t);let u=()=>{let f=c;for(;(f=f.nextSibling)&&(f instanceof HTMLElement&&f.dataset.for==t.dataset.for);)f=f.previousSibling,f.nextSibling.remove()},b=f=>{u();for(let x=0,P=c;x<f.length;x++){let q=t.cloneNode(!0),ot=Object.assign({},e,{[a]:f[x],[s]:x});D.add(q),P.after(g(q,ot)),P=P.nextSibling}};b(p(l)),m(l)&&l.subscribe({next:b}),r()}};var G={select:"[data-if]",run:(t,e)=>{let r=d(e,t.dataset.if),n=document.createComment("if: "+t.dataset.if);t.replaceWith(n);let o=i=>{!t.parentNode&&i?(t.hidden=!1,n.after(t)):t.localName!="link"&&t.remove()};o(p(r)),m(r)&&r.subscribe({next:o})}};var J=new WeakSet,Q={select:"[data-lazy]",run:(t,e,r)=>{if(J.has(t)||!t.childNodes.length)return;J.add(t);let n=t.closest("[hidden]"),o=t.dataset.lazy,i=()=>{for(let a of t.childNodes)g(a,e);t.removeAttribute("data-lazy")};o&&(t.addEventListener("::load",()=>t.classList.add(o),{once:!0}),t.addEventListener("::loaded",()=>t.classList.remove(o),{once:!0})),w(t).then(i),r()}};var X={select:"[data-on]",run:(t,e)=>{let r=n=>{let o=n.split(":"),i=o[0].trim(),a=o.at(-1).trim(),s=d(e,a);s&&t.addEventListener(i,s)};for(let n of t.dataset.on.split(","))r(n)}};var Y=t=>{let e=document.createElement("link");Object.assign(e,t),e.rel="preload",document.head.append(e)};var Z=new WeakSet,tt={select:"[data-preload]",run:t=>{if(Z.has(t)||t.hidden)return;Z.add(t);let e=()=>{let r=t.dataset.preload.split(",");for(let n of r){let o=n.split(":");Y({href:o[0],as:o[1]??"fetch"})}};t.hasAttribute("data-lazy")?w(t).then(e):e()}};var wt=t=>{let e=t.dataset.route;for(;t=t.parentElement;)t.dataset.route&&(e=t.dataset.route+e);return e.replaceAll(/\/+/g,"/")},et={select:"[data-route]",run:async t=>{"URLPattern"in window||await import("https://kevinblt.github.io/hec/packages/@hec.js/ui/lib/src/plugins.js");let e=wt(t),r=new URLPattern({pathname:e}),n=document.createComment("route: "+e);t.replaceWith(n);let o=()=>{let i=location.href.replace(/index\.*[a-z0-9]*$/gm,"");if(!t.parentNode&&r.test(i)){t.hidden=!1,n.after(t);let a=document.querySelector('head meta[name="route"]');a&&(a.content=r.pathname)}else t.localName!="link"&&t.remove()};A.subscribe({next:o}),o()}};var B=[K,G,et,tt,$,X,F,I,Q];var nt={};function vt(t,e={}){t instanceof URL&&(t=t.host==location.host?t.pathname:t.toString());let r=document.querySelector(`template[name="${t}"]`);if(!r){let n=document.querySelector('head meta[name="template-path"]');return nt[t]??=new Promise(async o=>{r=document.createElement("template"),r.setAttribute("id",t.toString()),r.innerHTML=await fetch(n?.content?.replaceAll("[name]",t.toString())??t).then(s=>s.text());let i=r.content.querySelectorAll('link[rel="stylesheet"][href]'),a=[];for(let s of i)a.push(fetch(s.href).then(l=>l.text()).then(l=>{let c=document.createElement("style");c.innerHTML=l,s.replaceWith(c)}));await Promise.all(a),document.body.append(r),o(r)}),nt[t].then(o=>g(o.content.cloneNode(!0),e))}return g(r.content.cloneNode(!0),e)}function Et(t,e={}){let r=document.createElement("template");return r.dataset.name="anonymous",r.innerHTML=t,g(r.content.cloneNode(!0),e)}function g(t,e={}){let r=(o,i)=>{let a=o.match(/{{[^}]+}}/g).map(j),s=o,l=()=>{o=s;for(let c of a){let u=p(c.value);o=o.replace(c.text,u??"<null>")}return o};for(let c of a){let u=d(e,c.prop);if(m(u)){let b=u;for(let f in c.meta)if(v[f]){let x=v[f];b=b.map(P=>x({value:P,key:c.prop,param:c.meta[f],options:c.meta}))}c.value=b,b.subscribe({next:()=>i(l())})}else{let b=u;for(let f in c.meta)if(v[f]){let x=v[f];b=x({value:p(u),key:c.prop,param:c.meta[f],options:c.meta})}c.value=()=>b}}i(l())},n=o=>{let i=!1;if(!W(o)){if(o.nodeName=="#document-fragment"&&S(o,e),o instanceof HTMLElement){let a=o.getAttributeNames();S(o,e);for(let s of B)o.matches(s.select)&&s.run(o,e,()=>i=!0);if(i)return;for(let s of a){let l=o.getAttribute(s);l?.includes("{{")?r(l,c=>{c=c.trim().replace(/ +/," "),c==="<null>"?o.removeAttribute(s):o.setAttribute(s,c)}):o.localName.includes("-")&&R(e,l)&&o.setAttribute(s,`@parent.${l}`)}}else if(o instanceof Text&&o.textContent.includes("{{")){let a=o.textContent.split(/{{|}}/g);for(let s=0,l=o,c;s<a.length;s++)c=document.createTextNode(a[s]),s%2!=0&&r(`{{${a[s]}}}`,u=>c.data=u.replaceAll("<null>","")),l.after(c),l=c;o.remove()}for(let a of o.childNodes)n(a)}};return n(t),t}function St(t,e,r){customElements.define(t,class extends HTMLElement{static observedAttributes=Object.keys(e).map(n=>n.toLowerCase());#e=Object.fromEntries(Object.entries(e).map(n=>[n[0],h(n[1])]));#t={};#n=!1;on(n,o,i=null){this.addEventListener(n,o,i)}querySelector(n){return this.shadowRoot.querySelector(n)}querySelectorAll(n){return this.shadowRoot.querySelectorAll(n)}async connectedCallback(){if(this.hasAttribute("data-lazy")&&await w(this),this.dispatchEvent(new CustomEvent("::load",{bubbles:!0})),this.#n){this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),this.dispatchEvent(new CustomEvent("::mount"));return}let n=this.shadowRoot??this.attachShadow({mode:"open"}),o=r(this.#e,this);(a=>{S(this,E(a)),this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),n.append(a),this.#n=!0,this.#t["::attributes"]=new AbortController;for(let s in e)this.hasAttribute(s)||this.setAttribute(s,e[s].toString()),this.#e[s].subscribe({next:l=>this.setAttribute(s,l.toString())},{signal:this.#t["::attributes"].signal});this.dispatchEvent(new CustomEvent("::mount"))})(o instanceof Promise?await o:o)}disconnectedCallback(){z(this);for(let n in this.#t)this.#t[n].abort(),delete this.#t[n];this.dispatchEvent(new CustomEvent("::unmount"))}#r(n=""){n=n.toLowerCase();for(let o in this.#e)if(o.toLowerCase()==n)return[e[o],this.#e[o]];return[null,null]}attributeChangedCallback(n,o,i){let[a,s]=this.#r(n);if(i.startsWith("@parent.")){let l=this.parentNode.host||this.parentNode,c=i.slice(8),u=d(E(l),c)??d(E(this),c);m(u)?(this.#t[a]?.abort(),this.#t[a]=new AbortController,s(p(u)),u.subscribe({next:s},{signal:this.#t[a].signal})):s(u)}else s(typeof a=="number"?parseFloat(i):i)}})}var rt=new WeakMap;function Pt(t,e=null){document.dispatchEvent(new CustomEvent(t,{detail:e}))}function Lt(t,e){let r=n=>e(n.detail);rt.set(e,r),document.addEventListener(t,r)}function At(t){return new Promise(e=>{let r=n=>e(n.detail);document.addEventListener(t,r,{once:!0})})}function kt(t,e){document.removeEventListener(t,rt.get(e))}for(let t in O)globalThis[t]=O[t];})();
+(()=>{var at=Object.create;var M=Object.defineProperty;var st=Object.getOwnPropertyDescriptor;var it=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var ut=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ft=(t,e)=>{for(var r in e)M(t,r,{get:e[r],enumerable:!0})},mt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of it(e))!ct.call(t,o)&&o!==r&&M(t,o,{get:()=>e[o],enumerable:!(n=st(e,o))||n.enumerable});return t};var pt=(t,e,r)=>(r=t!=null?at(lt(t)):{},mt(e||!t||!t.__esModule?M(r,"default",{value:t,enumerable:!0}):r,t));var O={};ft(O,{component:()=>St,deletePropsOf:()=>z,effect:()=>H,emit:()=>Pt,expression:()=>j,f:()=>p,hasProp:()=>R,hasProps:()=>W,isSignal:()=>m,memo:()=>dt,off:()=>kt,on:()=>Lt,once:()=>At,pipes:()=>v,plugins:()=>B,prop:()=>d,propsOf:()=>E,resource:()=>_,resourceBy:()=>ht,setPropsOf:()=>S,signal:()=>h,templateByName:()=>vt,templateByNode:()=>g,templateByString:()=>Et});function j(t){let e=t.matchAll(/([^ {}\s]+)/g),r={meta:{},text:t,prop:null};for(let n of e)if(n[1].includes("=")){let o=n[1].split("=");r.meta[o[0]]=o[1].replaceAll(/'|"/g,"")}else r.prop=n[1];return r}var v={};var L=new WeakMap,E=t=>L.get(t),z=t=>L.delete(t),W=t=>L.has(t),S=(t,e)=>{let r=E(t);r&&typeof r=="object"?L.set(t,Object.assign(r,e)):L.set(t,e)},p=t=>typeof t=="function"?p(t()):t;function d(t,e){let r=e.split(".");if(!e)return t;for(let n of r){if(["loading","error"].includes(n)&&t?.loading&&t?.error)return t[n];if(m(t)){let o=t()?.[n];if(m(o)){let i=new AbortController,a=h(o());o.subscribe({next:a},{signal:i.signal});let s=l=>{i.abort(),m(l[n])?(i=new AbortController,l[n].subscribe({next:a},{signal:i.signal}),a(l[n]())):a(l[n])};t.subscribe({next:s}),t=a}else t=t.map(i=>i&&i[n])}else if(typeof t=="function")t=p(t);else if(typeof t[n]<"u")typeof t[n]=="function"&&!m(t[n])?t=t[n].bind(t):t=t[n];else return null}return t}function R(t,e){let r=e.split(".");if(!e)return!1;for(let n of r){if(["loading","error"].includes(n)&&t?.loading&&t?.error)return t[n];if(typeof t=="function")t=p(t);else if(typeof t[n]<"u")t=t[n];else return!1}return!0}function h(t=null,e={}){let r=[],n=a=>{t=a;for(let s of r)s.next(t)};function o(){return arguments.length&&t!==arguments[0]&&n(arguments[0]),t}let i=(a,s=null)=>{r.push(a),s?.signal.addEventListener("abort",()=>{let l=r.indexOf(a);l>-1&&r.splice(l,1)},{once:!0})};return Object.assign(o,{signal:e.name??"",toString:()=>t.toString(),set:a=>t=a,update:n,subscribe:i,map:a=>{let s=h(a(t)),l=new AbortController,c=s.subscribe;return i({next:u=>s(a(u))},{signal:l.signal}),Object.assign(s,{set:()=>null,subscribe:(u,b)=>{c(u,b),b?.signal.addEventListener("abort",()=>l.abort())}})},filter:a=>{let s=h(a(t)?t:null);return i({next:l=>a(l)?s(l):null}),Object.assign(s,{set:()=>null})}})}function H(t,e=[],r=null){for(let n of e)n.subscribe({next:()=>r=t(r)});return t(r)}function dt(t,e=[],r=null){let n=h(null);return n(H(o=>n(t(o)),e,r)),n}function _(t,e=null){let r=h(e),n=h(!0),o=h(null),i=async()=>{try{r(await t()),n(!1)}catch(a){a(a)}return r()};return i(),Object.assign(r,{loading:n,error:o,refetch:i})}function ht(t,e,r=null){let n=_(()=>e(p(t)),r);return m(t)&&t.subscribe({next:()=>n.refetch()}),n}var m=t=>t&&t.subscribe;var bt=h({}),A=h(location.pathname);var y=document.querySelector('head meta[name="route"]');y||(y=document.createElement("meta"),y.name="route",y.content=location.pathname,document.head.append(y));var N=()=>{y.content="",A(location.pathname),bt(Object.fromEntries(new URLSearchParams(location.search))),y.content=y.content||location.pathname};window.addEventListener("popstate",N);window.addEventListener("hashchange",N);var gt=window.history.pushState,xt=window.history.replaceState;window.history.pushState=function(e,r,n){gt.call(window.history,e,r,n),N()};window.history.replaceState=function(e,r,n){xt.call(window.history,e,r,n),N()};var T=new WeakMap,yt=new MutationObserver(t=>{for(let e of t)T.has(e.target)&&T.get(e.target)()}),I={select:"[data-match]",run:t=>{let e=t.dataset.match,r=i=>i.replace(/index\.*[a-z0-9]*$/gm,"");function n(){return r(new URL(t.dataset.route||t.getAttribute("href"),location.href).pathname)}let o=()=>{n()==r(location.pathname)?t.classList.add(e):t.classList.remove(e)};A.subscribe({next:o}),T.set(t,o),yt.observe(t,{attributes:!0,attributeFilter:["href","data-route"]}),o(),t.removeAttribute("data-match")}};var U={number:t=>t.valueAsNumber,date:t=>t.valueAsDate,text:t=>t.value,checkbox:t=>t.checked,"":t=>t.value},F={select:"[data-bind],[name]",run:(t,e)=>{let r=t.getAttribute("name")||t.dataset.bind,n=d(e,r);if(n){let o=i=>{t.type=="checkbox"?t.checked=i:t.value=i};o(p(n)),m(n)&&(n.subscribe({next:o}),t.addEventListener("input",()=>n(U[t.type]?.(t)??t.value)),t.addEventListener("change",()=>n(U[t.type]?.(t)??t.value)))}}};var k=new WeakMap,V=new IntersectionObserver(t=>{for(let e of t)if(e.isIntersecting&&k.has(e.target)){for(let r of k.get(e.target))r();k.delete(e.target),V.unobserve(e.target)}},{rootMargin:"256px"});function w(t){return new Promise(e=>{let r=k.get(t)??[];r.push(e),k.set(t,r),V.observe(t)})}var C=new WeakSet,$={select:"[data-include]",run:(t,e)=>{if(C.has(t)||t.children.length)return;C.add(t);let r=t.hasAttribute("data-lazy")&&t.closest("[hidden]"),n=async()=>{t.dispatchEvent(new CustomEvent("::load",{bubbles:!0}));let o=await fetch(t.dataset.include,{headers:{accept:"text/html,text/*"}});if(o.ok){let i=await o.text();t.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),t.innerHTML=i;for(let a of t.childNodes)g(a,e);t.removeAttribute("data-include"),t.removeAttribute("data-lazy")}};t.hasAttribute("data-lazy")?w(t).then(n):n()}};var D=new WeakSet,K={select:"[data-for]",run:(t,e,r)=>{if(D.has(t))return;let n=t.dataset.for.replace("let","").split("of"),o=n[0].split(","),i=n.at(-1).trim(),a=o[0].trim()==i?"__e":o[0].trim(),s=o[1]?.trim()??"__i",l=d(e,i),c=document.createComment(t.dataset.for);t.replaceWith(c),C.add(t);let u=()=>{let f=c;for(;(f=f.nextSibling)&&(f instanceof HTMLElement&&f.dataset.for==t.dataset.for);)f=f.previousSibling,f.nextSibling.remove()},b=f=>{u();for(let x=0,P=c;x<f.length;x++){let q=t.cloneNode(!0),ot=Object.assign({},e,{[a]:f[x],[s]:x});D.add(q),P.after(g(q,ot)),P=P.nextSibling}};b(p(l)),m(l)&&l.subscribe({next:b}),r()}};var G={select:"[data-if]",run:(t,e)=>{let r=d(e,t.dataset.if),n=document.createComment("if: "+t.dataset.if);t.replaceWith(n);let o=i=>{!t.parentNode&&i?(t.hidden=!1,n.after(t)):t.localName!="link"&&t.remove()};o(p(r)),m(r)&&r.subscribe({next:o})}};var J=new WeakSet,Q={select:"[data-lazy]",run:(t,e,r)=>{if(J.has(t)||!t.childNodes.length)return;J.add(t);let n=t.closest("[hidden]"),o=t.dataset.lazy,i=()=>{for(let a of t.childNodes)g(a,e);t.removeAttribute("data-lazy")};o&&(t.addEventListener("::load",()=>t.classList.add(o),{once:!0}),t.addEventListener("::loaded",()=>t.classList.remove(o),{once:!0})),w(t).then(i),r()}};var X={select:"[data-on]",run:(t,e)=>{let r=n=>{let o=n.split(":"),i=o[0].trim(),a=o.at(-1).trim(),s=d(e,a);s&&t.addEventListener(i,s)};for(let n of t.dataset.on.split(","))r(n)}};var Y=t=>{let e=document.createElement("link");Object.assign(e,t),e.rel="preload",document.head.append(e)};var Z=new WeakSet,tt={select:"[data-preload]",run:t=>{if(Z.has(t)||t.hidden)return;Z.add(t);let e=()=>{let r=t.dataset.preload.split(",");for(let n of r){let o=n.split(":");Y({href:o[0],as:o[1]??"fetch"})}};t.hasAttribute("data-lazy")?w(t).then(e):e()}};var wt=t=>{let e=t.dataset.route;for(;t=t.parentElement;)t.dataset.route&&(e=t.dataset.route+e);return e.replaceAll(/\/+/g,"/")},et={select:"[data-route]",run:async t=>{"URLPattern"in window||await import("https://kevinblt.github.io/hec/packages/@hec.js/ui/dist/urlpattnern.min.js");let e=wt(t),r=new URLPattern({pathname:e}),n=document.createComment("route: "+e);t.replaceWith(n);let o=()=>{let i=location.href.replace(/index\.*[a-z0-9]*$/gm,"");if(!t.parentNode&&r.test(i)){t.hidden=!1,n.after(t);let a=document.querySelector('head meta[name="route"]');a&&(a.content=r.pathname)}else t.localName!="link"&&t.remove()};A.subscribe({next:o}),o()}};var B=[K,G,et,tt,$,X,F,I,Q];var nt={};function vt(t,e={}){t instanceof URL&&(t=t.host==location.host?t.pathname:t.toString());let r=document.querySelector(`template[name="${t}"]`);if(!r){let n=document.querySelector('head meta[name="template-path"]');return nt[t]??=new Promise(async o=>{r=document.createElement("template"),r.setAttribute("id",t.toString()),r.innerHTML=await fetch(n?.content?.replaceAll("[name]",t.toString())??t).then(s=>s.text());let i=r.content.querySelectorAll('link[rel="stylesheet"][href]'),a=[];for(let s of i)a.push(fetch(s.href).then(l=>l.text()).then(l=>{let c=document.createElement("style");c.innerHTML=l,s.replaceWith(c)}));await Promise.all(a),document.body.append(r),o(r)}),nt[t].then(o=>g(o.content.cloneNode(!0),e))}return g(r.content.cloneNode(!0),e)}function Et(t,e={}){let r=document.createElement("template");return r.dataset.name="anonymous",r.innerHTML=t,g(r.content.cloneNode(!0),e)}function g(t,e={}){let r=(o,i)=>{let a=o.match(/{{[^}]+}}/g).map(j),s=o,l=()=>{o=s;for(let c of a){let u=p(c.value);o=o.replace(c.text,u??"<null>")}return o};for(let c of a){let u=d(e,c.prop);if(m(u)){let b=u;for(let f in c.meta)if(v[f]){let x=v[f];b=b.map(P=>x({value:P,key:c.prop,param:c.meta[f],options:c.meta}))}c.value=b,b.subscribe({next:()=>i(l())})}else{let b=u;for(let f in c.meta)if(v[f]){let x=v[f];b=x({value:p(u),key:c.prop,param:c.meta[f],options:c.meta})}c.value=()=>b}}i(l())},n=o=>{let i=!1;if(!W(o)){if(o.nodeName=="#document-fragment"&&S(o,e),o instanceof HTMLElement){let a=o.getAttributeNames();S(o,e);for(let s of B)o.matches(s.select)&&s.run(o,e,()=>i=!0);if(i)return;for(let s of a){let l=o.getAttribute(s);l?.includes("{{")?r(l,c=>{c=c.trim().replace(/ +/," "),c==="<null>"?o.removeAttribute(s):o.setAttribute(s,c)}):o.localName.includes("-")&&R(e,l)&&o.setAttribute(s,`@parent.${l}`)}}else if(o instanceof Text&&o.textContent.includes("{{")){let a=o.textContent.split(/{{|}}/g);for(let s=0,l=o,c;s<a.length;s++)c=document.createTextNode(a[s]),s%2!=0&&r(`{{${a[s]}}}`,u=>c.data=u.replaceAll("<null>","")),l.after(c),l=c;o.remove()}for(let a of o.childNodes)n(a)}};return n(t),t}function St(t,e,r){customElements.define(t,class extends HTMLElement{static observedAttributes=Object.keys(e).map(n=>n.toLowerCase());#e=Object.fromEntries(Object.entries(e).map(n=>[n[0],h(n[1])]));#t={};#n=!1;on(n,o,i=null){this.addEventListener(n,o,i)}querySelector(n){return this.shadowRoot.querySelector(n)}querySelectorAll(n){return this.shadowRoot.querySelectorAll(n)}async connectedCallback(){if(this.hasAttribute("data-lazy")&&await w(this),this.dispatchEvent(new CustomEvent("::load",{bubbles:!0})),this.#n){this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),this.dispatchEvent(new CustomEvent("::mount"));return}let n=this.shadowRoot??this.attachShadow({mode:"open"}),o=r(this.#e,this);(a=>{S(this,E(a)),this.dispatchEvent(new CustomEvent("::loaded",{bubbles:!0})),n.append(a),this.#n=!0,this.#t["::attributes"]=new AbortController;for(let s in e)this.hasAttribute(s)||this.setAttribute(s,e[s].toString()),this.#e[s].subscribe({next:l=>this.setAttribute(s,l.toString())},{signal:this.#t["::attributes"].signal});this.dispatchEvent(new CustomEvent("::mount"))})(o instanceof Promise?await o:o)}disconnectedCallback(){z(this);for(let n in this.#t)this.#t[n].abort(),delete this.#t[n];this.dispatchEvent(new CustomEvent("::unmount"))}#r(n=""){n=n.toLowerCase();for(let o in this.#e)if(o.toLowerCase()==n)return[e[o],this.#e[o]];return[null,null]}attributeChangedCallback(n,o,i){let[a,s]=this.#r(n);if(i.startsWith("@parent.")){let l=this.parentNode.host||this.parentNode,c=i.slice(8),u=d(E(l),c)??d(E(this),c);m(u)?(this.#t[a]?.abort(),this.#t[a]=new AbortController,s(p(u)),u.subscribe({next:s},{signal:this.#t[a].signal})):s(u)}else s(typeof a=="number"?parseFloat(i):i)}})}var rt=new WeakMap;function Pt(t,e=null){document.dispatchEvent(new CustomEvent(t,{detail:e}))}function Lt(t,e){let r=n=>e(n.detail);rt.set(e,r),document.addEventListener(t,r)}function At(t){return new Promise(e=>{let r=n=>e(n.detail);document.addEventListener(t,r,{once:!0})})}function kt(t,e){document.removeEventListener(t,rt.get(e))}for(let t in O)globalThis[t]=O[t];})();