@estjs/template 0.0.15-beta.11 → 0.0.15-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- 'use strict';var shared=require('@estjs/shared'),signals=require('@estjs/signals');var Et=Object.defineProperty;var De=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable;var we=(e,t,o)=>t in e?Et(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o,K=(e,t)=>{for(var o in t||(t={}))xt.call(t,o)&&we(e,o,t[o]);if(De)for(var o of De(t))_t.call(t,o)&&we(e,o,t[o]);return e};var Z=(e,t,o)=>new Promise((n,r)=>{var s=a=>{try{c(o.next(a));}catch(u){r(u);}},i=a=>{try{c(o.throw(a));}catch(u){r(u);}},c=a=>a.done?n(a.value):Promise.resolve(a.value).then(s,i);c((o=o.apply(e,t)).next());});var M=null,vt=0;function N(){return M}function Le(e){M=e;}function ee(e=M){let t={id:++vt,parent:e,children:null,provides:null,cleanup:null,onMount:null,onUpdate:null,onDestroy:null,isMounted:false,isDestroyed:false};return e&&(e.children||(e.children=new Set),e.children.add(t)),t}function D(e,t){let o=M;M=e;try{return t()}finally{M=o;}}function j(e){var t,o,n,r,s;if(!(!e||e.isDestroyed)){if(e.children)for(;e.children.size>0;){let i=e.children.values().next().value;i&&j(i);}if(e.onDestroy){for(let i of e.onDestroy)try{i();}catch(c){}e.onDestroy.clear();}if(e.cleanup){for(let i of e.cleanup)try{i();}catch(c){}e.cleanup.clear();}(t=e.parent)!=null&&t.children&&e.parent.children.delete(e),(o=e.children)==null||o.clear(),(n=e.provides)==null||n.clear(),(r=e.onMount)==null||r.clear(),(s=e.onUpdate)==null||s.clear(),Le(e.parent),e.parent=null,e.isDestroyed=true;}}function I(e){let t=M;t&&(t.cleanup||(t.cleanup=new Set),t.cleanup.add(e));}var Me="_$spread$";var Re="http://www.w3.org/2000/svg",te="http://www.w3.org/2000/xlink",oe="http://www.w3.org/2000/xmlns/";var ne=Symbol(""),re=Symbol(""),z=Symbol(""),ie=Symbol("");var He=1e3,Ke=new WeakMap;function Fe(e){let t=Ke.get(e);if(!t){let o=e.name||"anonymous",n=Oe(e.toString()).toString(36);t=`${o}_${n}`,Ke.set(e,t);}return t}function Oe(e){let t=0,o=e.length<100?e.length:100;for(let n=0;n<o;n++)t=Math.trunc((t<<5)-t+e.charCodeAt(n));return t<0?-t:t}var Ct=0;function ce(e){if(!shared.isFalsy(e)){if(shared.isString(e))return e.length<=He?e:`${e.slice(0,He-10)}_${Oe(e).toString(36)}`;if(shared.isNumber(e))return String(e);if(shared.isSymbol(e)){let t=Symbol.keyFor(e);if(t)return `_s.${t}`;let o=e.description;return o?`_s.${o}`:`${Ct++}`}return String(e)}}var se=Symbol("essor.key");function V(e,t){if(p(e)||!e||e.nodeType===Node.DOCUMENT_NODE)return;let o=ce(t);shared.isFalsy(o)?delete e[se]:e[se]=o;}function k(e){if(e)return p(e)?e.key:e[se]}function T(e){if(shared.isHTMLElement(e))return e;if(shared.isPrimitive(e)){let t=shared.isFalsy(e)?"":String(e);return document.createTextNode(t)}return e}function P(e,t){let o=k(e),n=k(t);if(o!==n)return false;let r=p(e),s=p(t);if(r&&s)return e.component===t.component;if(r!==s)return false;if(shared.isPrimitive(e)||shared.isPrimitive(t))return e===t;let i=e,c=t;return i.nodeType!==c.nodeType?false:i.nodeType===Node.ELEMENT_NODE?i.tagName===c.tagName:true}function ue(e,t){if(e===t)return true;if(shared.isNull(e)||shared.isNull(t)||!shared.isObject(e)||!shared.isObject(t)||shared.isArray(e)!==shared.isArray(t))return false;let o=e,n=t;for(let r in o)if(o[r]!==n[r])return false;for(let r in n)if(!(r in o))return false;return true}function x(e){if(e)try{if(p(e))e.destroy();else {let t=e;t.parentElement&&t.remove();}}catch(t){shared.error("Failed to remove node:",t);}}function y(e,t,o){if(!(!e||!t))try{let n=p(o)?o.firstChild:o;if(p(t)){t.mount(e,n);return}n?e.insertBefore(t,n):e.appendChild(t);}catch(n){shared.error("Failed to insert node:",n);}}function Y(e,t,o){if(!(!e||!t||!o||t===o))try{let n=p(o)?o.beforeNode:o.nextSibling;x(o),y(e,t,n);}catch(n){shared.error("Failed to replace node:",n);}}function _(e){if(e){if(p(e))return e.firstChild;if(!shared.isPrimitive(e))return e}}function Ye(e,t){if(p(e)||p(t))return;let o=k(e);o&&!k(t)&&V(t,o);}function w(e,t,o){if(o===t)return t;let n=shared.isHTMLElement(t);if(shared.isHTMLElement(o)&&n){if(o.isEqualNode(t))return t;if(t.tagName===o.tagName){let c=t.attributes,a=o.attributes;for(let u=c.length-1;u>=0;u--){let l=c[u].name;o.hasAttribute(l)||t.removeAttribute(l);}for(let u=0,l=a.length;u<l;u++){let f=a[u];t.getAttribute(f.name)!==f.value&&t.setAttribute(f.name,f.value);}return Ye(t,o),t}}if(shared.isTextNode(t)&&shared.isTextNode(o))return t.textContent!==o.textContent&&(t.textContent=o.textContent),Ye(t,o),t;let s=p(t),i=p(o);return s&&i&&t.component===o.component?o.update(t):(Y(e,o,t),o)}function Ge(e,t,o,n){let r=t.length,s=o.length;if(r===0&&s===0)return [];if(r===0){for(let i=0;i<s;i++)y(e,o[i],n);return o}if(s===0){for(let i=0;i<r;i++)x(t[i]);return []}if(r===1&&s===1){let i=t[0],c=o[0];return P(i,c)?(w(e,i,c),o[0]=i):Y(e,c,i),o}if(r===2&&s===2){let i=t[0],c=t[1],a=o[0],u=o[1];if(P(i,a)&&P(c,u))return w(e,i,a),w(e,c,u),o[0]=i,o[1]=c,o;if(P(i,u)&&P(c,a)){w(e,i,u),w(e,c,a);let l=_(c),f=_(i);return l&&f&&l.parentNode===e&&e.insertBefore(l,f),o[0]=c,o[1]=i,o}}return wt(e,t,o,n)}function wt(e,t,o,n){let r=0,s=0,i=t.length-1,c=o.length-1,a=t[0],u=t[i],l=o[0],f=o[c];for(;r<=i&&s<=c;)if(!a)a=t[++r];else if(!u)u=t[--i];else if(P(a,l))w(e,a,l),o[s]=a,a=t[++r],l=o[++s];else break;for(;r<=i&&s<=c;)if(!a)a=t[++r];else if(!u)u=t[--i];else if(P(u,f))w(e,u,f),o[c]=u,u=t[--i],f=o[--c];else break;if(r>i){if(s<=c){let m=c+1<o.length?_(o[c+1]):n;for(let S=s;S<=c;S++)y(e,o[S],m);}}else if(s>c)for(let m=r;m<=i;m++){let S=t[m];S&&x(S);}else Lt(e,t,o,r,i,s,c,n);return o}function Lt(e,t,o,n,r,s,i,c){let a=i-s+1,u;for(let h=s;h<=i;h++){let E=k(o[h]);E!==void 0&&(u||(u=Object.create(null)),u[E]=h);}let l=new Int32Array(a),f=false,m=0,S=0;for(let h=n;h<=r;h++){let E=t[h];if(!E)continue;if(S>=a){x(E);continue}let g,C=k(E);if(C!==void 0&&u&&C in u)g=u[C];else for(let H=s;H<=i;H++)if(l[H-s]===0&&C===void 0&&k(o[H])===void 0&&P(E,o[H])){g=H;break}g===void 0?x(E):(l[g-s]=h+1,g>=m?m=g:f=true,w(e,E,o[g]),o[g]=E,S++);}let A=f?Mt(l):[],R=A.length-1,b=c;for(let h=a-1;h>=0;h--){let E=s+h,g=o[E];if(l[h]===0)y(e,g,b),b=_(g)||b;else if(f)if(R<0||h!==A[R]){let C=_(g);C&&C.parentNode===e&&y(e,C,b),b=C||b;}else b=_(g)||b,R--;else b=_(g)||b;}}function Mt(e){let t=e.length;if(t===0)return [];if(t===1)return e[0]!==0?[0]:[];let o=[],n=new Int32Array(t),r,s,i,c,a;for(r=0;r<t;r++){let u=e[r];if(u!==0){if(s=o[o.length-1],o.length===0||e[s]<u){n[r]=s,o.push(r);continue}for(i=0,c=o.length-1;i<c;)a=i+c>>1,e[o[a]]<u?i=a+1:c=a;u<e[o[i]]&&(i>0&&(n[r]=o[i-1]),o[i]=r);}}for(i=o.length,c=o[i-1];i-- >0;)o[i]=c,c=n[c];return o}function v(e,t,o,n){e.addEventListener(t,o,n),I(()=>{e.removeEventListener(t,o,n);});}function Ot(e,t,o,n){shared.isHtmlInputElement(e)?Vt(e,n):shared.isHtmlSelectElement(e)?$t(e,n):shared.isHtmlTextAreaElement(e)&&v(e,"input",()=>{n(e.value);});}function Vt(e,t){switch(e.type){case "checkbox":v(e,"change",()=>{t(!!e.checked);});break;case "radio":v(e,"change",()=>{t(e.checked?e.value:"");});break;case "file":v(e,"change",()=>{t(e.files);});break;case "number":case "range":v(e,"input",()=>{t(e.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":v(e,"change",()=>{t(e.value||"");});break;default:v(e,"input",()=>{t(e.value);});break}}function $t(e,t){v(e,"change",()=>{if(e.multiple){let o=Array.from(e.options).filter(n=>n.selected).map(n=>n.value);t(o);}else t(e.value);});}function le(e,t,o){if(!e)return;let n=[],r=signals.effect(()=>{let s=shared.isFunction(t)?t():t,i=shared.coerceArray(s).map(c=>shared.isFunction(c)?c():c).flatMap(T);n=Ge(e,n,i,o);});return I(()=>{r(),n.forEach(s=>x(s)),n.length=0;}),n}function de(e,t){let o=t.length,n=new Array(o),r=new Set(t),s=1,i=0,c=a=>{if(a.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(r.has(s)&&(n[i++]=a,i===o))return true;s++;}let u=a.firstChild;for(;u;){if(c(u))return true;u=u.nextSibling;}return false};return c(e),n}function Ut(e){let t=N();if(t){if(t.isMounted){try{e();}catch(o){}return}t.onMount||(t.onMount=new Set),t.onMount.add(e);}}function jt(e){let t=N();t&&(t.onUpdate||(t.onUpdate=new Set),t.onUpdate.add(e));}function zt(e){let t=N();t&&(t.onDestroy||(t.onDestroy=new Set),t.onDestroy.add(e));}function We(e){!e||e.isDestroyed||e.isMounted||(e.isMounted=true,e.onMount&&D(e,()=>{for(let t of e.onMount)try{t();}catch(o){}}));}function pe(e){if(!(!e||e.isDestroyed)&&e.onUpdate)for(let t of e.onUpdate)try{t();}catch(o){}}function me(e){Ut(e);}function ye(e){zt(e);}function Yt(e){jt(e);}var Qe;Qe=ne;var X=class{constructor(t,o={}){this.component=t;this.props=o;this.renderedNodes=[];this.scope=null;this.parentNode=void 0;this.beforeNode=void 0;this.reactiveProps={};this._propSnapshots={};this.state=0;this.parentScope=null;this[Qe]=true;this.key=o.key?ce(o.key):Fe(t),this.reactiveProps=signals.shallowReactive(K({},o)),this.parentScope=N();for(let n in o){let r=o[n];shared.isObject(r)&&(this._propSnapshots[n]=shared.isArray(r)?[...r]:K({},r));}}get isConnected(){return this.state===2}get firstChild(){for(let t of this.renderedNodes){let o=_(t);if(o)return o}}mount(t,o){var s;if(this.parentNode=t,this.beforeNode=o,this.state=1,this.renderedNodes.length>0){for(let i of this.renderedNodes)y(t,i,o);return this.state=2,this.renderedNodes}let n=(s=this.parentScope)!=null?s:N();this.scope=ee(n);let r=D(this.scope,()=>{var c;let i=this.component(this.reactiveProps);return shared.isFunction(i)&&(i=i(this.reactiveProps)),(signals.isSignal(i)||signals.isComputed(i))&&(i=i.value),(c=le(t,i,o))!=null?c:[]});return this.renderedNodes=r,D(this.scope,()=>{this.applyProps(this.props);}),this.state=2,this.scope&&We(this.scope),this.renderedNodes}update(t){return this.key!==t.key?(this.mount(t.parentNode,t.beforeNode),this):(this.parentNode=t.parentNode,this.beforeNode=t.beforeNode,this.scope=t.scope,this.parentScope=t.parentScope,this.renderedNodes=t.renderedNodes,this.state=t.state,this.reactiveProps=t.reactiveProps,this._propSnapshots=t._propSnapshots,this._updateReactiveProps(this.props),!this.isConnected&&this.parentNode?(this.mount(this.parentNode,this.beforeNode),this):(this.scope&&(D(this.scope,()=>{this.applyProps(this.props);}),pe(this.scope)),this))}_updateReactiveProps(t){for(let o in t){if(o==="key")continue;let n=t[o],r=this.reactiveProps[o];if(n===r&&!this._propSnapshots[o])continue;if(shared.isObject(n)){let i=this._propSnapshots[o];if(i&&ue(n,i))continue;let c=shared.isArray(n)?[...n]:K({},n);this.reactiveProps[o]=c,this._propSnapshots[o]=c;}else shared.hasChanged(n,r)&&(this.reactiveProps[o]=n,this._propSnapshots[o]&&delete this._propSnapshots[o]);}}unwrapRenderResult(t){return shared.isFunction(t)&&(t=t(this.reactiveProps)),(signals.isSignal(t)||signals.isComputed(t))&&(t=t.value),p(t)&&(t=t.mount(this.parentNode,this.beforeNode)),shared.isPromise(t)&&(t=t.then(o=>this.unwrapRenderResult(o))),t}forceUpdate(){if(this.state===5||!this.parentNode||!this.scope)return;let t=[...this.renderedNodes];try{D(this.scope,()=>{let o=this.component(this.reactiveProps);shared.isFunction(o)&&(o=o(this.reactiveProps)),(signals.isSignal(o)||signals.isComputed(o))&&(o=o.value);let n=shared.coerceArray(o),r=this._getAnchorNode();if(this.parentNode){for(let s of this.renderedNodes)x(s);for(let s of n)y(this.parentNode,s,r);this.renderedNodes=n;}}),this.scope&&pe(this.scope);}catch(o){throw this.renderedNodes=t,o}}_getAnchorNode(){if(this.beforeNode)return this.beforeNode;if(this.renderedNodes.length>0){let t=this.renderedNodes[this.renderedNodes.length-1],o=_(t);if(o)return o.nextSibling}}destroy(){if(this.state===4||this.state===5)return;this.state=4;let t=this.scope;t&&(j(t),this.scope=null);for(let o of this.renderedNodes)x(o);this.renderedNodes=[],this.parentNode=void 0,this.beforeNode=void 0,this.parentScope=null,this.reactiveProps={},this.props={},this.state=5;}applyProps(t){if(!t)return;let o=this.firstChild;for(let[n,r]of Object.entries(t))if(shared.startsWith(n,"on")){if(!o||!shared.isHTMLElement(o))return;let s=n.slice("on".length).toLowerCase();v(o,s,r);}else n==="ref"&&signals.isSignal(r)&&(r.value=o);this.props=t;}};function p(e){return !!e&&!!e[ne]}function $(e,t){return p(e)?e:new X(e,t)}function Ne(e){let t,o=()=>{let n=document.createElement("template");n.innerHTML=e;let r=n.content.firstChild;if(!r)throw new Error("Invalid template: empty content");return r};return ()=>(t||(t=o())).cloneNode(true)}function eo(e,t){let o=shared.isString(t)?document.querySelector(t):t;if(!o){shared.error(`Target element not found: ${t}`);return}o.innerHTML&&(shared.error(`Target element is not empty, it will be delete: ${t}`),o.innerHTML="");let r=p(e)?e:$(e);return r.mount(o),r}function Se(e,t){let o=N();o&&(o.provides||(o.provides=new Map),o.provides.set(e,t));}function Ee(e,t){let o=N();if(!o)return t;let n=o;for(;n;){if(n.provides){let r=n.provides.get(e);if(r)return r}n=n.parent;}return t}function xe(e,t){Object.defineProperty(e,"target",{configurable:true,value:t});}function nt(e,t,o){let n=e[`_$${o}`];if(n&&shared.isFunction(n)&&!e.disabled){let r=e[`${o}Data`];if(r?n.call(e,r,t):n.call(e,t),t.cancelBubble)return false}return e.host&&!shared.isString(e.host)&&!e.host._$host&&shared.isFunction(e.contains)&&e.contains(t.target)&&xe(t,e.host),true}function tt(e,t,o){let n=e;for(;nt(n,t,o)&&(n=n._$host||n.parentNode||n.host););return n}function oo(e){let t=e.target,o=`${e.type}`,n=e.target,r=e.currentTarget;if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let s=e.composedPath();xe(e,s[0]);for(let i=0;i<s.length-2&&(t=s[i],!!nt(t,e,o));i++){if(t._$host){t=t._$host,t=tt(t,e,o);break}if(t.parentNode===r)break}}else t=tt(t,e,o);xe(e,n);}var ot=Symbol("_$EVENTS");function no(e,t=window.document){let o=t,n=o[ot]||(o[ot]=new Set);for(let r of e)n.has(r)||(n.add(r),t.addEventListener(r,oo));}function ro(e,t){let o=new Set(t);return new Proxy(e,{get(n,r){if(!o.has(r))return Reflect.get(n,r)},ownKeys(n){return Reflect.ownKeys(n).filter(r=>!o.has(r))},getOwnPropertyDescriptor(n,r){if(!o.has(r))return Reflect.getOwnPropertyDescriptor(n,r)},has(n,r){return o.has(r)?false:Reflect.has(n,r)}})}var _e=false;function W(){_e=true;}function U(){_e=false;}function L(){return _e}var rt=0;function q(){return `${rt++}`}function B(){rt=0;}var st=/^\d+-\d+$/;function ct(e){return ()=>{if(!shared.isBrowser())return null;let t=q(),o=document.querySelector(`[data-hk="${t}"]`);return o||Ne(e)()}}function at(e,t){let o=e.dataset.hk;if(!o)return de(e,t);let n=[],r=e.querySelectorAll(`[data-idx^="${o}"]`);r.length>0&&n.push(...Array.from(r).filter(a=>{let u=a.dataset.idx;return u!==null&&st.test(u)}).map(a=>{let u=a.dataset.idx||"",[l,f]=u.split("-");return {hk:l,idx:f,node:a}}));let s=[],i=a=>{if(a.nodeType===Node.COMMENT_NODE&&a.textContent&&st.test(a.textContent)){let[l,f]=a.textContent.split("-");s.push({hk:l,idx:f,node:a});}let u=a.firstChild;for(;u;)i(u),u=u.nextSibling;};i(e),n.push(...s);let c=[e];return t.forEach(a=>{let u=n.find(l=>l.idx===String(a));u&&c.push(u.node);}),c}function ut(e,t){W(),B();try{let o=shared.isString(t)?document.querySelector(t):t;if(!o){shared.error("Hydration error: Root element not found");return}let n=$(e);return n.mount(o),U(),n}catch(o){shared.error("Hydration error:",o),U();return}}function ft(e,t,o,n=false){if(t===o||L())return;let r=J(o),s=J(t);r&&s===r||(r?n?e.setAttribute("class",r):e.className=r:e.removeAttribute("class"));}function J(e){return shared.normalizeClassName(e)}var lt=/\s*!important$/,lo=["Webkit","Moz","ms"],ve={};function pt(e,t,o){let n=e.style,r=shared.isString(o);if(!L()){if(o&&r){t!==o&&(n.cssText=o);return}if(!o){t&&e.removeAttribute("style");return}if(t&&!shared.isString(t))for(let s in t)(!o||o[s]==null)&&O(n,s,"");else if(t&&shared.isString(t)){let s=t.split(";");for(let i of s){let c=i.indexOf(":");if(c>0){let a=i.slice(0,c).trim();o&&shared.isObject(o)&&o[a]==null&&O(n,a,"");}}}if(o&&!shared.isString(o))for(let s in o){let i=o[s];(!t||shared.isString(t)||t[s]!==i)&&i!=null&&O(n,s,i);}}}function O(e,t,o){if(shared.isArray(o)){for(let r of o)O(e,t,r);return}if((o==null||o==="")&&(o=""),t.startsWith("--")){e.setProperty(t,o);return}let n=po(e,t);shared.isString(o)&&lt.test(o)?e.setProperty(shared.camelCase(n),o.replace(lt,""),"important"):e[n]=o;}function po(e,t){let o=ve[t];if(o)return o;let n=shared.camelCase(t);if(n!=="filter"&&n in e)return ve[t]=n;n=shared.capitalize(n);for(let r of lo){let s=r+n;if(s in e)return ve[t]=s}return t}function Ae(e,t,o,n){if(t==="key"){n==null?V(e,void 0):V(e,String(n));return}if(t===Me){Object.keys(n).forEach(f=>{Ae(e,f,o==null?void 0:o[f],n==null?void 0:n[f]);});return}if(L())return;let r=(e==null?void 0:e.namespaceURI)===Re,s=r&&t.startsWith("xlink:"),i=r&&t.startsWith("xmlns:"),c=shared.isSpecialBooleanAttr(t)||shared.isBooleanAttr(t);if(o===n)return;let a=t.toLowerCase();if(a.length>2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110||a==="innerhtml")return;if(n==null){if(s)e.removeAttributeNS(te,t.slice(6));else if(i){let f=t.slice(6);e.removeAttributeNS(oe,f);}else e.removeAttribute(t);return}if(s){e.setAttributeNS(te,t,String(n));return}if(i){e.setAttributeNS(oe,t,String(n));return}if(c){shared.includeBooleanAttr(n)?e.setAttribute(t,""):e.removeAttribute(t);return}let u=shared.isSymbol(n)?String(n):n;if((a==="href"||a==="src"||a==="xlink:href")&&shared.isString(u)){let f=u.trim().toLowerCase();if(f.startsWith("javascript:")||f.startsWith("data:"))return}if(r)e.setAttribute(t,String(u));else if(t in e)try{e[t]=u;}catch(f){e.setAttribute(t,String(u));}else e.setAttribute(t,String(u));}function mt(e,t,o,n){if(!(n!=null&&n.delegate))return e.addEventListener(t,o,n),()=>e.removeEventListener(t,o,n);let r=n.delegate,s=c=>{let a=c.target;(a.matches(r)||a.closest(r))&&o.call(e,c);},i=K({},n);return i.delegate=void 0,e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i);}}function be(e){if(!(e!=null&&e.children))return shared.error("Fragment component requires children"),null;let{children:t}=e;return t}be[re]=true;function yt(e){return !!e&&!!e[re]}function Pe(e){let t=document.createComment("portal");t[z]=true;let o=e.children;if(o){let n=shared.isArray(o)?o:[o],r=[];me(()=>{let s=shared.isString(e.target)?document.querySelector(e.target):e.target;s&&(n.forEach(i=>{if(i!=null){let c=T(i);c&&(y(s,c),r.push(c));}}),I(()=>{r.forEach(i=>{!shared.isString(i)&&i.parentNode===s&&s.removeChild(i);});}));});}return t}Pe[z]=true;function gt(e){return !!e&&!!e[z]}var ke=Symbol("SuspenseContext");function Te(e){if(shared.isUndefined(document)){let f=e.fallback;return f?String(f||""):""}let t=document.createElement("div");t.style.display="contents";let o=true,n=0,r=false,s=null,i=()=>{if(!r){for(r=true;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let f=T(e.fallback);f&&y(t,f);}}},c=()=>{if(!(!r||!(s||e.children!=null&&!shared.isPromise(e.children)))){for(r=false;t.firstChild;)t.removeChild(t.firstChild);s?a(s):e.children!=null&&!shared.isPromise(e.children)&&a(e.children);}},a=f=>{for(;t.firstChild;)t.removeChild(t.firstChild);if(f==null)return;let m=N();if((shared.isArray(f)?f:[f]).forEach(A=>{if(A!=null){p(A)&&(A.parentContext=m);let R=T(A);R&&y(t,R);}}),r){for(;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let A=T(e.fallback);A&&y(t,A);}}},u={register:f=>{n++,i(),f.then(()=>{o&&(n--,n===0&&c());}).catch(m=>{o&&(n--,n===0&&c());});},increment:()=>{n++,i();},decrement:()=>{n--,n===0&&c();}};Se(ke,u);let l=e.children;return shared.isPromise(l)?(l.then(f=>{s=f;}).catch(()=>{}),u.register(l)):l!=null?a(l):i(),ye(()=>{for(o=false;t.firstChild;)t.removeChild(t.firstChild);}),t}Te[ie]=true;function Nt(e){return !!e&&!!e[ie]}function St(e,t){let o=signals.signal(t==null?void 0:t.initialValue),n=signals.signal(true),r=signals.signal(null),s=signals.signal("pending"),i=0,c=null,a=()=>Z(null,null,function*(){let f=++i;n.value=true,s.value="pending",r.value=null;try{let m=e();c=m.then(()=>{}).catch(()=>{});let S=yield m;f===i&&(o.value=S,s.value="ready",n.value=!1);}catch(m){f===i&&(r.value=m instanceof Error?m:new Error(String(m)),s.value="errored",n.value=false);}});a();let u=(()=>{if(n.value&&c){let f=Ee(ke,null);f&&f.register(c);}return o.value});return u.loading=n,u.error=r,u.state=s,[u,{mutate:f=>{o.value=f,s.value="ready",n.value=false,r.value=null;},refetch:()=>Z(null,null,function*(){yield a();})}]}
2
- exports.Component=X;exports.Fragment=be;exports.Portal=Pe;exports.Suspense=Te;exports.addEvent=mt;exports.addEventListener=v;exports.bindElement=Ot;exports.createApp=eo;exports.createComponent=$;exports.createResource=St;exports.createScope=ee;exports.delegateEvents=no;exports.disposeScope=j;exports.endHydration=U;exports.getActiveScope=N;exports.getFirstDOMNode=_;exports.getHydrationKey=q;exports.getRenderedElement=ct;exports.hydrate=ut;exports.inject=Ee;exports.insert=le;exports.insertNode=y;exports.isComponent=p;exports.isFragment=yt;exports.isHydrating=L;exports.isPortal=gt;exports.isSameNode=P;exports.isSuspense=Nt;exports.mapNodes=de;exports.mapSSRNodes=at;exports.normalizeClass=J;exports.normalizeNode=T;exports.omitProps=ro;exports.onCleanup=I;exports.onDestroy=ye;exports.onMount=me;exports.onUpdate=Yt;exports.patchAttr=Ae;exports.patchClass=ft;exports.patchStyle=pt;exports.provide=Se;exports.removeNode=x;exports.replaceNode=Y;exports.resetHydrationKey=B;exports.runWithScope=D;exports.setActiveScope=Le;exports.setStyle=O;exports.shallowCompare=ue;exports.startHydration=W;exports.template=Ne;//# sourceMappingURL=template.cjs.js.map
1
+ 'use strict';var shared=require('@estjs/shared'),signals=require('@estjs/signals');var Et=Object.defineProperty;var we=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;var De=(e,t,n)=>t in e?Et(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))vt.call(t,n)&&De(e,n,t[n]);if(we)for(var n of we(t))xt.call(t,n)&&De(e,n,t[n]);return e};var re=(e,t,n)=>new Promise((o,r)=>{var s=a=>{try{c(n.next(a));}catch(f){r(f);}},i=a=>{try{c(n.throw(a));}catch(f){r(f);}},c=a=>a.done?o(a.value):Promise.resolve(a.value).then(s,i);c((n=n.apply(e,t)).next());});var F=null,_t=0;function b(){return F}function M(e){F=e;}function j(e=F){let t={id:++_t,parent:e,children:null,provides:null,cleanup:null,onMount:null,onUpdate:null,onDestroy:null,isMounted:false,isDestroyed:false};return e&&(e.children||(e.children=new Set),e.children.add(t)),t}function K(e,t){let n=F;F=e;try{return t()}finally{F=n;}}function V(e){var t,n,o,r,s;if(!(!e||e.isDestroyed)){if(e.children)for(;e.children.size>0;){let i=e.children.values().next().value;i&&V(i);}if(e.onDestroy){for(let i of e.onDestroy)try{i();}catch(c){}e.onDestroy.clear();}if(e.cleanup){for(let i of e.cleanup)try{i();}catch(c){}e.cleanup.clear();}(t=e.parent)!=null&&t.children&&e.parent.children.delete(e),(n=e.children)==null||n.clear(),(o=e.provides)==null||o.clear(),(r=e.onMount)==null||r.clear(),(s=e.onUpdate)==null||s.clear(),M(e.parent),e.parent=null,e.isDestroyed=true;}}function R(e){let t=F;t&&(t.cleanup||(t.cleanup=new Set),t.cleanup.add(e));}var Le="_$spread$";var Me="http://www.w3.org/2000/svg",ie="http://www.w3.org/2000/xlink",se="http://www.w3.org/2000/xmlns/";var ce=Symbol(""),ae=Symbol(""),W=Symbol(""),fe=Symbol(""),Re=Symbol("");var He=1e3,Ie=new WeakMap;function Ke(e){let t=Ie.get(e);if(!t){let n=e.name||"anonymous",o=Oe(e.toString()).toString(36);t=`${n}_${o}`,Ie.set(e,t);}return t}function Oe(e){let t=0,n=e.length<100?e.length:100;for(let o=0;o<n;o++)t=Math.trunc((t<<5)-t+e.charCodeAt(o));return t<0?-t:t}var kt=0;function le(e){if(!shared.isFalsy(e)){if(shared.isString(e))return e.length<=He?e:`${e.slice(0,He-10)}_${Oe(e).toString(36)}`;if(shared.isNumber(e))return String(e);if(shared.isSymbol(e)){let t=Symbol.keyFor(e);if(t)return `_s.${t}`;let n=e.description;return n?`_s.${n}`:`${kt++}`}return String(e)}}var ue=Symbol("essor.key");function z(e,t){if(y(e)||!e||e.nodeType===Node.DOCUMENT_NODE)return;let n=le(t);shared.isFalsy(n)?delete e[ue]:e[ue]=n;}function D(e){if(e)return y(e)?e.key:e[ue]}function L(e){if(shared.isHTMLElement(e))return e;if(shared.isPrimitive(e)){let t=shared.isFalsy(e)?"":String(e);return document.createTextNode(t)}return e}function w(e,t){let n=D(e),o=D(t);if(n!==o)return false;let r=y(e),s=y(t);if(r&&s)return e.component===t.component;if(r!==s)return false;if(shared.isPrimitive(e)||shared.isPrimitive(t))return e===t;let i=e,c=t;return i.nodeType!==c.nodeType?false:i.nodeType===Node.ELEMENT_NODE?i.tagName===c.tagName:true}function pe(e,t){if(e===t)return true;if(shared.isNull(e)||shared.isNull(t)||!shared.isObject(e)||!shared.isObject(t)||shared.isArray(e)!==shared.isArray(t))return false;let n=e,o=t,r=Object.keys(n),s=Object.keys(o);if(r.length!==s.length)return false;for(let i of r)if(!(i in o)||n[i]!==o[i])return false;return true}function k(e){if(!e)return;if(y(e)){e.destroy();return}let t=e;t.parentElement&&t.remove();}function C(e,t,n){if(!e||!t)return;if(y(t)){let r=y(n)?n.firstChild:n;t.mount(e,r);return}let o=y(n)?n.firstChild:n;o?e.insertBefore(t,o):e.appendChild(t);}function X(e,t,n){if(!e||!t||!n||t===n)return;let o=y(n)?n.beforeNode:n.nextSibling;k(n),C(e,t,o);}function P(e){if(e){if(y(e))return e.firstChild;if(!shared.isPrimitive(e))return e}}function Ye(e,t){if(y(e)||y(t))return;let n=D(e);n&&!D(t)&&z(t,n);}function H(e,t,n){if(n===t)return t;let o=shared.isHTMLElement(t);if(shared.isHTMLElement(n)&&o){if(n.isEqualNode(t))return t;if(t.tagName===n.tagName){let c=t.attributes,a=n.attributes;for(let f=c.length-1;f>=0;f--){let p=c[f].name;n.hasAttribute(p)||t.removeAttribute(p);}for(let f=0,p=a.length;f<p;f++){let u=a[f];t.getAttribute(u.name)!==u.value&&t.setAttribute(u.name,u.value);}return Ye(t,n),t}}if(shared.isTextNode(t)&&shared.isTextNode(n))return t.textContent!==n.textContent&&(t.textContent=n.textContent),Ye(t,n),t;let s=y(t),i=y(n);return s&&i&&t.component===n.component?n.update(t):(X(e,n,t),n)}function Be(e,t,n,o){let r=t.length,s=n.length;if(r===0&&s===0)return [];if(r===0){for(let i=0;i<s;i++)C(e,n[i],o);return n}if(s===0){for(let i=0;i<r;i++)k(t[i]);return []}if(r===1&&s===1){let i=t[0],c=n[0];return w(i,c)?(H(e,i,c),n[0]=i):X(e,c,i),n}if(r===2&&s===2){let i=t[0],c=t[1],a=n[0],f=n[1];if(w(i,a)&&w(c,f))return H(e,i,a),H(e,c,f),n[0]=i,n[1]=c,n;if(w(i,f)&&w(c,a)){H(e,i,f),H(e,c,a);let p=P(c),u=P(i);return p&&u&&p.parentNode===e&&e.insertBefore(p,u),n[0]=c,n[1]=i,n}}return Dt(e,t,n,o)}function Dt(e,t,n,o){let r=0,s=0,i=t.length-1,c=n.length-1,a=t[0],f=t[i],p=n[0],u=n[c];for(;r<=i&&s<=c;)if(!a)a=t[++r];else if(!f)f=t[--i];else if(w(a,p))H(e,a,p),n[s]=a,a=t[++r],p=n[++s];else break;for(;r<=i&&s<=c;)if(!a)a=t[++r];else if(!f)f=t[--i];else if(w(f,u))H(e,f,u),n[c]=f,f=t[--i],u=n[--c];else break;if(r>i){if(s<=c){let l=c+1<n.length?P(n[c+1]):o;for(let m=s;m<=c;m++)C(e,n[m],l);}}else if(s>c)for(let l=r;l<=i;l++){let m=t[l];m&&k(m);}else Lt(e,t,n,r,i,s,c,o);return n}function Lt(e,t,n,o,r,s,i,c){let a=i-s+1,f;for(let N=s;N<=i;N++){let E=D(n[N]);E!==void 0&&(f||(f=Object.create(null)),f[E]=N);}let p=new Int32Array(a),u=false,l=0,m=0;for(let N=o;N<=r;N++){let E=t[N];if(!E)continue;if(m>=a){k(E);continue}let x,_=D(E);if(_!==void 0&&f&&_ in f)x=f[_];else for(let d=s;d<=i;d++)if(p[d-s]===0&&_===void 0&&D(n[d])===void 0&&w(E,n[d])){x=d;break}x===void 0?k(E):(p[x-s]=N+1,x>=l?l=x:u=true,H(e,E,n[x]),n[x]=E,m++);}let S=u?Mt(p):[],v=S.length-1,h=c;for(let N=a-1;N>=0;N--){let E=s+N,x=n[E];if(p[N]===0)C(e,x,h),h=P(x)||h;else if(u)if(v<0||N!==S[v]){let _=P(x);_&&_.parentNode===e&&C(e,_,h),h=_||h;}else h=P(x)||h,v--;else h=P(x)||h;}}function Mt(e){let t=e.length;if(t===0)return [];if(t===1)return e[0]!==0?[0]:[];let n=[],o=new Int32Array(t),r,s,i,c,a;for(r=0;r<t;r++){let f=e[r];if(f!==0){if(s=n[n.length-1],n.length===0||e[s]<f){o[r]=s,n.push(r);continue}for(i=0,c=n.length-1;i<c;)a=i+c>>1,e[n[a]]<f?i=a+1:c=a;f<e[n[i]]&&(i>0&&(o[r]=n[i-1]),n[i]=r);}}for(i=n.length,c=n[i-1];i-- >0;)n[i]=c,c=o[c];return n}function T(e,t,n,o){e.addEventListener(t,n,o),R(()=>{e.removeEventListener(t,n,o);});}function Ot(e,t,n,o){shared.isHtmlInputElement(e)?Vt(e,o):shared.isHtmlSelectElement(e)?$t(e,o):shared.isHtmlTextAreaElement(e)&&T(e,"input",()=>{o(e.value);});}function Vt(e,t){switch(e.type){case "checkbox":T(e,"change",()=>{t(!!e.checked);});break;case "radio":T(e,"change",()=>{t(e.checked?e.value:"");});break;case "file":T(e,"change",()=>{t(e.files);});break;case "number":case "range":T(e,"input",()=>{t(e.value||"");});break;case "date":case "datetime-local":case "month":case "time":case "week":T(e,"change",()=>{t(e.value||"");});break;default:T(e,"input",()=>{t(e.value);});break}}function $t(e,t){T(e,"change",()=>{if(e.multiple){let n=Array.from(e.options).filter(o=>o.selected).map(o=>o.value);t(n);}else t(e.value);});}function me(e,t,n){if(!e)return;let o=[],r=b(),s=signals.effect(()=>{let i=()=>{let c=shared.isFunction(t)?t():t,a=shared.coerceArray(c).map(f=>shared.isFunction(f)?f():f).flatMap(L);o=Be(e,o,a,n);};r?K(r,i):i();});return R(()=>{s(),o.forEach(i=>k(i)),o.length=0;}),o}function ye(e,t){let n=t.length,o=new Array(n),r=new Set(t),s=1,i=0,c=a=>{if(a.nodeType!==Node.DOCUMENT_FRAGMENT_NODE){if(r.has(s)&&(o[i++]=a,i===n))return true;s++;}let f=a.firstChild;for(;f;){if(c(f))return true;f=f.nextSibling;}return false};return c(e),o}function Ut(e){let t=b();if(t){if(t.isMounted){try{e();}catch(n){}return}t.onMount||(t.onMount=new Set),t.onMount.add(e);}}function jt(e){let t=b();t&&(t.onUpdate||(t.onUpdate=new Set),t.onUpdate.add(e));}function zt(e){let t=b();t&&(t.onDestroy||(t.onDestroy=new Set),t.onDestroy.add(e));}function We(e){!e||e.isDestroyed||e.isMounted||(e.isMounted=true,e.onMount&&K(e,()=>{for(let t of e.onMount)try{t();}catch(n){}}));}function he(e){if(!(!e||e.isDestroyed)&&e.onUpdate)for(let t of e.onUpdate)try{t();}catch(n){}}function ge(e){Ut(e);}function Ne(e){zt(e);}function Yt(e){jt(e);}var Qe;Qe=ce;var J=class{constructor(t,n={}){this.component=t;this.props=n;this.renderedNodes=[];this.scope=null;this.parentNode=void 0;this.beforeNode=void 0;this.reactiveProps={};this._propSnapshots={};this.state=0;this.parentScope=null;this[Qe]=true;this.key=n.key?le(n.key):Ke(t),this.reactiveProps=signals.shallowReactive(O({},n)),this.parentScope=b();for(let o in n){let r=n[o];shared.isObject(r)&&(this._propSnapshots[o]=shared.isArray(r)?[...r]:O({},r));}}get isConnected(){return this.state===2}get firstChild(){for(let t of this.renderedNodes){let n=P(t);if(n)return n}}mount(t,n){var i,c;if(this.parentNode=t,this.beforeNode=n,this.state=1,this.renderedNodes.length>0){for(let a of this.renderedNodes)C(t,a,n);return this.state=2,this.renderedNodes}let o=(i=this.parentScope)!=null?i:b();this.scope=j(o),M(this.scope);let r=this.component(this.reactiveProps);shared.isFunction(r)&&(r=r(this.reactiveProps)),(signals.isSignal(r)||signals.isComputed(r))&&(r=r.value);let s=(c=me(t,r,n))!=null?c:[];return this.renderedNodes=s,this.applyProps(this.props),this.state=2,We(this.scope),this.renderedNodes}update(t){return this.key!==t.key?(this.mount(t.parentNode,t.beforeNode),this):(this.parentNode=t.parentNode,this.beforeNode=t.beforeNode,this.scope=t.scope,this.parentScope=t.parentScope,this.renderedNodes=t.renderedNodes,this.state=t.state,this.reactiveProps=t.reactiveProps,this._propSnapshots=t._propSnapshots,this._updateReactiveProps(this.props),!this.isConnected&&this.parentNode?(this.mount(this.parentNode,this.beforeNode),this):(this.scope&&(M(this.scope),this.applyProps(this.props),he(this.scope)),this))}_updateReactiveProps(t){for(let n in t){if(n==="key")continue;let o=t[n],r=this.reactiveProps[n];if(o===r&&!this._propSnapshots[n])continue;if(shared.isObject(o)){let i=this._propSnapshots[n];if(i&&pe(o,i))continue;let c=shared.isArray(o)?[...o]:O({},o);this.reactiveProps[n]=c,this._propSnapshots[n]=c;}else shared.hasChanged(o,r)&&(this.reactiveProps[n]=o,this._propSnapshots[n]&&delete this._propSnapshots[n]);}}unwrapRenderResult(t){return shared.isFunction(t)&&(t=t(this.reactiveProps)),(signals.isSignal(t)||signals.isComputed(t))&&(t=t.value),y(t)&&(t=t.mount(this.parentNode,this.beforeNode)),shared.isPromise(t)&&(t=t.then(n=>this.unwrapRenderResult(n))),t}forceUpdate(){if(this.state===5||!this.parentNode||!this.scope)return;let t=[...this.renderedNodes];try{K(this.scope,()=>{let n=this.component(this.reactiveProps);shared.isFunction(n)&&(n=n(this.reactiveProps)),(signals.isSignal(n)||signals.isComputed(n))&&(n=n.value);let o=shared.coerceArray(n),r=this._getAnchorNode();if(this.parentNode){for(let s of this.renderedNodes)k(s);for(let s of o)C(this.parentNode,s,r);this.renderedNodes=o;}}),this.scope&&he(this.scope);}catch(n){throw this.renderedNodes=t,n}}_getAnchorNode(){if(this.beforeNode)return this.beforeNode;if(this.renderedNodes.length>0){let t=this.renderedNodes[this.renderedNodes.length-1],n=P(t);if(n)return n.nextSibling}}destroy(){if(this.state===4||this.state===5)return;this.state=4;for(let n of this.renderedNodes)k(n);let t=this.scope;t&&(V(t),this.scope=null),this.renderedNodes=[],this.parentNode=void 0,this.beforeNode=void 0,this.parentScope=null,this.reactiveProps={},this.props={},this.state=5;}applyProps(t){if(!t)return;let n=this.firstChild;for(let[o,r]of Object.entries(t))if(shared.startsWith(o,"on")){if(!n||!shared.isHTMLElement(n))return;let s=o.slice("on".length).toLowerCase();T(n,s,r);}else o==="ref"&&signals.isSignal(r)&&(r.value=n);this.props=t;}};function y(e){return !!e&&!!e[ce]}function Y(e,t){return y(e)?e:new J(e,t)}function ve(e){let t,n=()=>{let o=document.createElement("template");o.innerHTML=e;let r=o.content.firstChild;if(!r)throw new Error("Invalid template: empty content");return r};return ()=>(t||(t=n())).cloneNode(true)}function en(e,t){let n=shared.isString(t)?document.querySelector(t):t;if(!n){shared.error(`Target element not found: ${t}`);return}n.innerHTML&&(shared.error(`Target element is not empty, it will be delete: ${t}`),n.innerHTML="");let r=y(e)?e:Y(e);return r.mount(n),r}function xe(e,t){let n=b();n&&(n.provides||(n.provides=new Map),n.provides.set(e,t));}function _e(e,t){let n=b();if(!n)return t;let o=n;for(;o;){if(o.provides){let r=o.provides.get(e);if(r)return r}o=o.parent;}return t}function Ae(e,t){Object.defineProperty(e,"target",{configurable:true,value:t});}function ot(e,t,n){let o=e[`_$${n}`];if(o&&shared.isFunction(o)&&!e.disabled){let r=e[`${n}Data`];if(r?o.call(e,r,t):o.call(e,t),t.cancelBubble)return false}return e.host&&!shared.isString(e.host)&&!e.host._$host&&shared.isFunction(e.contains)&&e.contains(t.target)&&Ae(t,e.host),true}function tt(e,t,n){let o=e;for(;ot(o,t,n)&&(o=o._$host||o.parentNode||o.host););return o}function nn(e){let t=e.target,n=`${e.type}`,o=e.target,r=e.currentTarget;if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let s=e.composedPath();Ae(e,s[0]);for(let i=0;i<s.length-2&&(t=s[i],!!ot(t,e,n));i++){if(t._$host){t=t._$host,t=tt(t,e,n);break}if(t.parentNode===r)break}}else t=tt(t,e,n);Ae(e,o);}var nt=Symbol("_$EVENTS");function on(e,t=window.document){let n=t,o=n[nt]||(n[nt]=new Set);for(let r of e)o.has(r)||(o.add(r),t.addEventListener(r,nn));}function rn(e,t){let n=new Set(t);return new Proxy(e,{get(o,r){if(!n.has(r))return Reflect.get(o,r)},ownKeys(o){return Reflect.ownKeys(o).filter(r=>!n.has(r))},getOwnPropertyDescriptor(o,r){if(!n.has(r))return Reflect.getOwnPropertyDescriptor(o,r)},has(o,r){return n.has(r)?false:Reflect.has(o,r)}})}var be=false;function Q(){be=true;}function B(){be=false;}function I(){return be}var rt=0;function Z(){return `${rt++}`}function ee(){rt=0;}var st=/^\d+-\d+$/;function ct(e){return ()=>{if(!shared.isBrowser())return null;let t=Z(),n=document.querySelector(`[data-hk="${t}"]`);return n||ve(e)()}}function at(e,t){let n=e.dataset.hk;if(!n)return ye(e,t);let o=[],r=e.querySelectorAll(`[data-idx^="${n}"]`);r.length>0&&o.push(...Array.from(r).filter(a=>{let f=a.dataset.idx;return f!==null&&st.test(f)}).map(a=>{let f=a.dataset.idx||"",[p,u]=f.split("-");return {hk:p,idx:u,node:a}}));let s=[],i=a=>{if(a.nodeType===Node.COMMENT_NODE&&a.textContent&&st.test(a.textContent)){let[p,u]=a.textContent.split("-");s.push({hk:p,idx:u,node:a});}let f=a.firstChild;for(;f;)i(f),f=f.nextSibling;};i(e),o.push(...s);let c=[e];return t.forEach(a=>{let f=o.find(p=>p.idx===String(a));f&&c.push(f.node);}),c}function ft(e,t){Q(),ee();try{let n=shared.isString(t)?document.querySelector(t):t;if(!n){shared.error("Hydration error: Root element not found");return}let o=Y(e);return o.mount(n),B(),o}catch(n){shared.error("Hydration error:",n),B();return}}function ut(e,t,n,o=false){if(t===n||I())return;let r=te(n),s=te(t);r&&s===r||(r?o?e.setAttribute("class",r):e.className=r:e.removeAttribute("class"));}function te(e){return shared.normalizeClassName(e)}var lt=/\s*!important$/,dn=["Webkit","Moz","ms"],Ce={};function pt(e,t,n){let o=e.style,r=shared.isString(n);if(!I()){if(n&&r){t!==n&&(o.cssText=n);return}if(!n){t&&e.removeAttribute("style");return}if(t&&!shared.isString(t))for(let s in t)(!n||n[s]==null)&&U(o,s,"");else if(t&&shared.isString(t)){let s=t.split(";");for(let i of s){let c=i.indexOf(":");if(c>0){let a=i.slice(0,c).trim();n&&shared.isObject(n)&&n[a]==null&&U(o,a,"");}}}if(n&&!shared.isString(n))for(let s in n){let i=n[s];(!t||shared.isString(t)||t[s]!==i)&&i!=null&&U(o,s,i);}}}function U(e,t,n){if(shared.isArray(n)){for(let r of n)U(e,t,r);return}if((n==null||n==="")&&(n=""),t.startsWith("--")){e.setProperty(t,n);return}let o=pn(e,t);shared.isString(n)&&lt.test(n)?e.setProperty(shared.camelCase(o),n.replace(lt,""),"important"):e[o]=n;}function pn(e,t){let n=Ce[t];if(n)return n;let o=shared.camelCase(t);if(o!=="filter"&&o in e)return Ce[t]=o;o=shared.capitalize(o);for(let r of dn){let s=r+o;if(s in e)return Ce[t]=s}return t}function ke(e,t,n,o){if(t==="key"){o==null?z(e,void 0):z(e,String(o));return}if(t===Le){Object.keys(o).forEach(u=>{ke(e,u,n==null?void 0:n[u],o==null?void 0:o[u]);});return}if(I())return;let r=(e==null?void 0:e.namespaceURI)===Me,s=r&&t.startsWith("xlink:"),i=r&&t.startsWith("xmlns:"),c=shared.isSpecialBooleanAttr(t)||shared.isBooleanAttr(t);if(n===o)return;let a=t.toLowerCase();if(a.length>2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110||a==="innerhtml")return;if(o==null){if(s)e.removeAttributeNS(ie,t.slice(6));else if(i){let u=t.slice(6);e.removeAttributeNS(se,u);}else e.removeAttribute(t);return}if(s){e.setAttributeNS(ie,t,String(o));return}if(i){e.setAttributeNS(se,t,String(o));return}if(c){shared.includeBooleanAttr(o)?e.setAttribute(t,""):e.removeAttribute(t);return}let f=shared.isSymbol(o)?String(o):o;if((a==="href"||a==="src"||a==="xlink:href")&&shared.isString(f)){let u=f.trim().toLowerCase();if(u.startsWith("javascript:")||u.startsWith("data:"))return}if(r)e.setAttribute(t,String(f));else if(t in e)try{e[t]=f;}catch(u){e.setAttribute(t,String(f));}else e.setAttribute(t,String(f));}function mt(e,t,n,o){if(!(o!=null&&o.delegate))return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o);let r=o.delegate,s=c=>{let a=c.target;(a.matches(r)||a.closest(r))&&n.call(e,c);},i=O({},o);return i.delegate=void 0,e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i);}}function yt(e){if(!(e!=null&&e.children))return shared.error("Fragment component requires children"),null;let{children:t}=e;return t}yt[ae]=true;function vn(e){return !!e&&!!e[ae]}function gt(e){let t=document.createComment("portal");t[W]=true;let n=e.children;if(n){let o=shared.isArray(n)?n:[n],r=[];ge(()=>{let s=shared.isString(e.target)?document.querySelector(e.target):e.target;s&&(o.forEach(i=>{if(i!=null){let c=L(i);c&&(C(s,c),r.push(c));}}),R(()=>{r.forEach(i=>{!shared.isString(i)&&i.parentNode===s&&s.removeChild(i);});}));});}return t}gt[W]=true;function _n(e){return !!e&&!!e[W]}var Te=Symbol("SuspenseContext");function Nt(e){if(shared.isUndefined(document)){let u=e.fallback;return u?String(u||""):""}let t=document.createElement("div");t.style.display="contents";let n=true,o=0,r=false,s=null,i=()=>{if(!r){for(r=true;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let u=L(e.fallback);u&&C(t,u);}}},c=()=>{if(!(!r||!(s||e.children!=null&&!shared.isPromise(e.children)))){for(r=false;t.firstChild;)t.removeChild(t.firstChild);s?a(s):e.children!=null&&!shared.isPromise(e.children)&&a(e.children);}},a=u=>{for(;t.firstChild;)t.removeChild(t.firstChild);if(u==null)return;let l=b();if((shared.isArray(u)?u:[u]).forEach(S=>{if(S!=null){y(S)&&(S.parentContext=l);let v=L(S);v&&C(t,v);}}),r){for(;t.firstChild;)t.removeChild(t.firstChild);if(e.fallback!=null){let S=L(e.fallback);S&&C(t,S);}}},f={register:u=>{o++,i(),u.then(()=>{n&&(o--,o===0&&c());}).catch(l=>{n&&(o--,o===0&&c());});},increment:()=>{o++,i();},decrement:()=>{o--,o===0&&c();}};xe(Te,f);let p=e.children;return shared.isPromise(p)?(p.then(u=>{s=u;}).catch(()=>{}),f.register(p)):p!=null?a(p):i(),Ne(()=>{for(n=false;t.firstChild;)t.removeChild(t.firstChild);}),t}Nt[fe]=true;function Cn(e){return !!e&&!!e[fe]}function kn(e,t){let n=signals.signal(t==null?void 0:t.initialValue),o=signals.signal(true),r=signals.signal(null),s=signals.signal("pending"),i=0,c=null,a=()=>re(null,null,function*(){let u=++i;o.value=true,s.value="pending",r.value=null;try{let l=e();c=l.then(()=>{}).catch(()=>{});let m=yield l;u===i&&(n.value=m,s.value="ready",o.value=!1);}catch(l){u===i&&(r.value=l instanceof Error?l:new Error(String(l)),s.value="errored",o.value=false);}});a();let f=(()=>{if(o.value&&c){let u=_e(Te,null);u&&u.register(c);}return n.value});return f.loading=o,f.error=r,f.state=s,[f,{mutate:u=>{n.value=u,s.value="ready",o.value=false,r.value=null;},refetch:()=>re(null,null,function*(){yield a();})}]}function St(e){let t=document.createDocumentFragment(),n=document.createComment("");t.appendChild(n);let o=[],r=null,s=e.keyFn,i=e.children,c=()=>{var m,S;let l=e.each;return signals.isSignal(l)?(m=l.value)!=null?m:[]:typeof l=="function"?(S=l())!=null?S:[]:l!=null?l:[]},a=l=>s?s(l):l,f=(l,m,S,v)=>{var x;let h=b(),N=j(h);M(N);let E;try{let _=i(l,m);y(_)?(_.mount(S,v),E=(x=_.firstChild)!=null?x:document.createComment("empty")):(E=_,E.parentNode||(v?S.insertBefore(E,v):S.appendChild(E)));}finally{M(h);}return {key:a(l),node:E,scope:N}},p=l=>{V(l.scope),l.node.parentNode&&l.node.parentNode.removeChild(l.node);};signals.memoEffect(({prev:l})=>{var v;let m=c();if(l===m)return {prev:m};let S=n.parentNode;if(!S){if(m.length===0){if(e.fallback){let h=e.fallback();y(h)?(h.mount(t,n),r=(v=h.firstChild)!=null?v:document.createComment("empty")):(r=h,t.insertBefore(r,n));}return {prev:m}}o=new Array(m.length);for(let[h,N]of m.entries())o[h]=f(N,h,t,n);return {prev:m}}return signals.untrack(()=>u(S,m)),{prev:m}},{prev:[]});function u(l,m){var _;let S=o.length,v=m.length;if(v===0){for(let d=0;d<S;d++)p(o[d]);if(o=[],e.fallback&&!r){let d=e.fallback();y(d)?(d.mount(l,n),r=(_=d.firstChild)!=null?_:document.createComment("empty")):(r=d,l.insertBefore(r,n));}return}if(S===0||r){r&&(r.parentNode&&r.parentNode.removeChild(r),r=null),o=new Array(v);let d=document.createDocumentFragment();for(let A=0;A<v;A++)o[A]=f(m[A],A,d,null);l.insertBefore(d,n);return}let h=new Map;for(let d=0;d<S;d++){let A=o[d],G=h.get(A.key);G?G.push(A):h.set(A.key,[A]);}let N=new Array(v),E=[],x=document.createDocumentFragment();for(let d=0;d<v;d++){let A=m[d],G=a(A),oe=h.get(G);oe&&oe.length>0?N[d]=oe.shift():N[d]=f(A,d,x,null);}for(let d of h.values())for(let A of d)E.push(A);for(let d of E)p(d);for(let d=0;d<v;d++){let A=N[d].node;l.insertBefore(A,n);}o=N;}return R(()=>{for(let l of o)p(l);r&&r.parentNode&&r.parentNode.removeChild(r),n.parentNode&&n.parentNode.removeChild(n);}),t}St[Re]=true;
2
+ exports.Component=J;exports.For=St;exports.Fragment=yt;exports.Portal=gt;exports.Suspense=Nt;exports.addEvent=mt;exports.addEventListener=T;exports.bindElement=Ot;exports.createApp=en;exports.createComponent=Y;exports.createResource=kn;exports.createScope=j;exports.delegateEvents=on;exports.disposeScope=V;exports.endHydration=B;exports.getActiveScope=b;exports.getFirstDOMNode=P;exports.getHydrationKey=Z;exports.getRenderedElement=ct;exports.hydrate=ft;exports.inject=_e;exports.insert=me;exports.insertNode=C;exports.isComponent=y;exports.isFragment=vn;exports.isHydrating=I;exports.isPortal=_n;exports.isSameNode=w;exports.isSuspense=Cn;exports.mapNodes=ye;exports.mapSSRNodes=at;exports.normalizeClass=te;exports.normalizeNode=L;exports.omitProps=rn;exports.onCleanup=R;exports.onDestroy=Ne;exports.onMount=ge;exports.onUpdate=Yt;exports.patchAttr=ke;exports.patchClass=ut;exports.patchStyle=pt;exports.provide=xe;exports.removeNode=k;exports.replaceNode=X;exports.resetHydrationKey=ee;exports.runWithScope=K;exports.setActiveScope=M;exports.setStyle=U;exports.shallowCompare=pe;exports.startHydration=Q;exports.template=ve;//# sourceMappingURL=template.cjs.js.map
3
3
  //# sourceMappingURL=template.cjs.js.map