@lipsjs/lips 0.0.13 → 0.0.15

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,4 +1,4 @@
1
- var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames:K8}=Object;var j8=Object.prototype.hasOwnProperty;var S1=(J,Z,W)=>{W=J!=null?Y8(M8(J)):{};const X=Z||!J||!J.__esModule?A1(W,"default",{value:J,enumerable:!0}):W;for(let q of K8(J))if(!j8.call(X,q))A1(X,q,{get:()=>J[q],enumerable:!0});return X};var O8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var d0=(J,Z)=>{for(var W in Z)A1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(X)=>Z[W]=()=>X})};var J1=O8((W5,H5)=>{(function(){var J=document,Z=window,W=J.documentElement,X=J.createElement.bind(J),q=X("div"),H=X("table"),B=X("tbody"),Y=X("tr"),G=Array.isArray,M=Array.prototype,j=M.concat,N=M.filter,b=M.indexOf,i=M.map,e=M.push,r=M.slice,H0=M.some,t=M.splice,J0=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,h=/<.+>/,u=/^\w+$/;function v(Q,z){var U=V(z);return!Q||!U&&!F(z)&&!S(z)?[]:!U&&d.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!U&&u.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var T=function(){function Q(z,U){if(!z)return;if(D(z))return z;var K=z;if(A(z)){var C=U||J;if(K=J0.test(z)&&F(C)?C.getElementById(z.slice(1).replace(/\\/g,"")):h.test(z)?i1(z):D(C)?C.find(z):A(C)?O(C).find(z):v(z,C),!K)return}else if(f(z))return this.ready(z);if(K.nodeType||K===Z)K=[K];this.length=K.length;for(var E=0,y=this.length;E<y;E++)this[E]=K[E]}return Q.prototype.init=function(z,U){return new Q(z,U)},Q}(),w=T.prototype,O=w.init;if(O.fn=O.prototype=w,w.length=0,w.splice=t,typeof Symbol==="function")w[Symbol.iterator]=M[Symbol.iterator];function D(Q){return Q instanceof T}function P(Q){return!!Q&&Q===Q.window}function F(Q){return!!Q&&Q.nodeType===9}function V(Q){return!!Q&&Q.nodeType===11}function S(Q){return!!Q&&Q.nodeType===1}function m(Q){return!!Q&&Q.nodeType===3}function c(Q){return typeof Q==="boolean"}function f(Q){return typeof Q==="function"}function A(Q){return typeof Q==="string"}function $(Q){return Q===void 0}function k(Q){return Q===null}function R(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function _(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}O.isWindow=P,O.isFunction=f,O.isArray=G,O.isNumeric=R,O.isPlainObject=_;function L(Q,z,U){if(U){var K=Q.length;while(K--)if(z.call(Q[K],K,Q[K])===!1)return Q}else if(_(Q)){var C=Object.keys(Q);for(var K=0,E=C.length;K<E;K++){var y=C[K];if(z.call(Q[y],y,Q[y])===!1)return Q}}else for(var K=0,E=Q.length;K<E;K++)if(z.call(Q[K],K,Q[K])===!1)return Q;return Q}O.each=L,w.each=function(Q){return L(this,Q)},w.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function g(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var U=c(Q[0])?Q.shift():!1,K=Q.shift(),C=Q.length;if(!K)return{};if(!C)return g(U,O,K);for(var E=0;E<C;E++){var y=Q[E];for(var l in y)if(U&&(G(y[l])||_(y[l]))){if(!K[l]||K[l].constructor!==y[l].constructor)K[l]=new y[l].constructor;g(U,K[l],y[l])}else K[l]=y[l]}return K}O.extend=g,w.extend=function(Q){return g(w,Q)};var I=/\S+/g;function x(Q){return A(Q)?Q.match(I)||[]:[]}w.toggleClass=function(Q,z){var U=x(Q),K=!$(z);return this.each(function(C,E){if(!S(E))return;L(U,function(y,l){if(K)z?E.classList.add(l):E.classList.remove(l);else E.classList.toggle(l)})})},w.addClass=function(Q){return this.toggleClass(Q,!0)},w.removeAttr=function(Q){var z=x(Q);return this.each(function(U,K){if(!S(K))return;L(z,function(C,E){K.removeAttribute(E)})})};function a(Q,z){if(!Q)return;if(A(Q)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var U=this[0].getAttribute(Q);return k(U)?void 0:U}if($(z))return this;if(k(z))return this.removeAttr(Q);return this.each(function(C,E){if(!S(E))return;E.setAttribute(Q,z)})}for(var K in Q)this.attr(K,Q[K]);return this}w.attr=a,w.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},w.hasClass=function(Q){return!!Q&&H0.call(this,function(z){return S(z)&&z.classList.contains(Q)})},w.get=function(Q){if($(Q))return r.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},w.eq=function(Q){return O(this.get(Q))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function n(Q){if($(Q))return this.get().map(function(z){return S(z)||m(z)?z.textContent:""}).join("");return this.each(function(z,U){if(!S(U))return;U.textContent=Q})}w.text=n;function p(Q,z,U){if(!S(Q))return;var K=Z.getComputedStyle(Q,null);return U?K.getPropertyValue(z)||void 0:K[z]||Q.style[z]}function s(Q,z){return parseInt(p(Q,z),10)||0}function o(Q,z){return s(Q,"border".concat(z?"Left":"Top","Width"))+s(Q,"padding".concat(z?"Left":"Top"))+s(Q,"padding".concat(z?"Right":"Bottom"))+s(Q,"border".concat(z?"Right":"Bottom","Width"))}var Q0={};function L0(Q){if(Q0[Q])return Q0[Q];var z=X(Q);J.body.insertBefore(z,null);var U=p(z,"display");return J.body.removeChild(z),Q0[Q]=U!=="none"?U:"block"}function g0(Q){return p(Q,"display")==="none"}function m1(Q,z){var U=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!U&&!!z&&U.call(Q,z)}function s0(Q){return A(Q)?function(z,U){return m1(U,Q)}:f(Q)?Q:D(Q)?function(z,U){return Q.is(U)}:!Q?function(){return!1}:function(z,U){return U===Q}}w.filter=function(Q){var z=s0(Q);return O(N.call(this,function(U,K){return z.call(U,K,U)}))};function R0(Q,z){return!z?Q:Q.filter(z)}w.detach=function(Q){return R0(this,Q).each(function(z,U){if(U.parentNode)U.parentNode.removeChild(U)}),this};var v5=/^\s*<(\w+)[^>]*>/,u5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d1={"*":q,tr:B,td:Y,th:Y,thead:H,tbody:H,tfoot:H};function i1(Q){if(!A(Q))return[];if(u5.test(Q))return[X(RegExp.$1)];var z=v5.test(Q)&&RegExp.$1,U=d1[z]||d1["*"];return U.innerHTML=Q,O(U.childNodes).detach().get()}O.parseHTML=i1,w.has=function(Q){var z=A(Q)?function(U,K){return v(Q,K).length}:function(U,K){return K.contains(Q)};return this.filter(z)},w.not=function(Q){var z=s0(Q);return this.filter(function(U,K){return(!A(Q)||S(K))&&!z.call(K,U,K)})};function I0(Q,z,U,K){var C=[],E=f(z),y=K&&s0(K);for(var l=0,j0=Q.length;l<j0;l++)if(E){var q0=z(Q[l]);if(q0.length)e.apply(C,q0)}else{var U0=Q[l][z];while(U0!=null){if(K&&y(-1,U0))break;C.push(U0),U0=U?U0[z]:null}}return C}function c1(Q){if(Q.multiple&&Q.options)return I0(N.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function m5(Q){if(!arguments.length)return this[0]&&c1(this[0]);return this.each(function(z,U){var K=U.multiple&&U.options;if(K||Z5.test(U.type)){var C=G(Q)?i.call(Q,String):k(Q)?[]:[String(Q)];if(K)L(U.options,function(E,y){y.selected=C.indexOf(y.value)>=0},!0);else U.checked=C.indexOf(U.value)>=0}else U.value=$(Q)||k(Q)?"":Q})}w.val=m5,w.is=function(Q){var z=s0(Q);return H0.call(this,function(U,K){return z.call(U,K,U)})},O.guid=1;function F0(Q){return Q.length>1?N.call(Q,function(z,U,K){return b.call(K,z)===U}):Q}O.unique=F0,w.add=function(Q,z){return O(F0(this.get().concat(O(Q,z).get())))},w.children=function(Q){return R0(O(F0(I0(this,function(z){return z.children}))),Q)},w.parent=function(Q){return R0(O(F0(I0(this,"parentNode"))),Q)},w.index=function(Q){var z=Q?O(Q)[0]:this[0],U=Q?this:O(z).parent().children();return b.call(U,z)},w.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var U=this.parent();if(!U.length)return z;return U.closest(Q)},w.siblings=function(Q){return R0(O(F0(I0(this,function(z){return O(z).parent().children().not(z)}))),Q)},w.find=function(Q){return O(F0(I0(this,function(z){return v(Q,z)})))};var d5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,i5=/^$|^module$|\/(java|ecma)script/i,c5=["type","src","nonce","noModule"];function p5(Q,z){var U=O(Q);U.filter("script").add(U.find("script")).each(function(K,C){if(i5.test(C.type)&&W.contains(C)){var E=X("script");E.text=C.textContent.replace(d5,""),L(c5,function(y,l){if(C[l])E[l]=C[l]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function s5(Q,z,U,K,C){if(K)Q.insertBefore(z,U?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,U?Q:Q.nextSibling);if(C)p5(z,Q.ownerDocument)}function E0(Q,z,U,K,C,E,y,l){return L(Q,function(j0,q0){L(O(q0),function(U0,A0){L(O(z),function(O0,o0){var $1=U?A0:o0,R1=U?o0:A0,w0=U?U0:O0;s5($1,!w0?R1:R1.cloneNode(!0),K,C,!w0)},l)},y)},E),z}w.after=function(){return E0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return E0(arguments,this,!1,!1,!0)};function l5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if($(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(U,K){if(!S(K))return;if(z)O(K).empty().append(Q);else K.innerHTML=Q})}w.html=l5,w.appendTo=function(Q){return E0(arguments,this,!0,!1,!0)},w.wrapInner=function(Q){return this.each(function(z,U){var K=O(U),C=K.contents();C.length?C.wrapAll(Q):K.append(Q)})},w.before=function(){return E0(arguments,this,!1,!0)},w.wrapAll=function(Q){var z=O(Q),U=z[0];while(U.children.length)U=U.firstElementChild;return this.first().before(z),this.appendTo(U)},w.wrap=function(Q){return this.each(function(z,U){var K=O(Q)[0];O(U).wrapAll(!z?K:K.cloneNode(!0))})},w.insertAfter=function(Q){return E0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Q){return E0(arguments,this,!0,!0)},w.prepend=function(){return E0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Q){return E0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return O(F0(I0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},w.next=function(Q,z,U){return R0(O(F0(I0(this,"nextElementSibling",z,U))),Q)},w.nextAll=function(Q){return this.next(Q,!0)},w.nextUntil=function(Q,z){return this.next(z,!0,Q)},w.parents=function(Q,z){return R0(O(F0(I0(this,"parentElement",!0,z))),Q)},w.parentsUntil=function(Q,z){return this.parents(z,Q)},w.prev=function(Q,z,U){return R0(O(F0(I0(this,"previousElementSibling",z,U))),Q)},w.prevAll=function(Q){return this.prev(Q,!0)},w.prevUntil=function(Q,z){return this.prev(z,!0,Q)},w.map=function(Q){return O(j.apply([],i.call(this,function(z,U){return Q.call(z,U,z)})))},w.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Q,z){var U=z.offsetParent;while(U&&p(U,"position")==="static")U=U.offsetParent;return U||W})},w.slice=function(Q,z){return O(r.call(this,Q,z))};var o5=/-([a-z])/g;function L1(Q){return Q.replace(o5,function(z,U){return U.toUpperCase()})}w.ready=function(Q){var z=function(){return setTimeout(Q,0,O)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},w.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var U=O(z);U.replaceWith(U.children())}),this},w.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},w.position=function(){var Q=this[0];if(!Q)return;var z=p(Q,"position")==="fixed",U=z?Q.getBoundingClientRect():this.offset();if(!z){var K=Q.ownerDocument,C=Q.offsetParent||K.documentElement;while((C===K.body||C===K.documentElement)&&p(C,"position")==="static")C=C.parentNode;if(C!==Q&&S(C)){var E=O(C).offset();U.top-=E.top+s(C,"borderTopWidth"),U.left-=E.left+s(C,"borderLeftWidth")}}return{top:U.top-s(Q,"marginTop"),left:U.left-s(Q,"marginLeft")}};var p1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Q,z){if(!Q)return;if(A(Q)){if(Q=p1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(K,C){C[Q]=z})}for(var U in Q)this.prop(U,Q[U]);return this},w.removeProp=function(Q){return this.each(function(z,U){delete U[p1[Q]||Q]})};var r5=/^--/;function F1(Q){return r5.test(Q)}var I1={},n5=q.style,a5=["webkit","moz","ms"];function t5(Q,z){if(z===void 0)z=F1(Q);if(z)return Q;if(!I1[Q]){var U=L1(Q),K="".concat(U[0].toUpperCase()).concat(U.slice(1)),C="".concat(U," ").concat(a5.join("".concat(K," "))).concat(K).split(" ");L(C,function(E,y){if(y in n5)return I1[Q]=y,!1})}return I1[Q]}var e5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function s1(Q,z,U){if(U===void 0)U=F1(Q);return!U&&!e5[Q]&&R(z)?"".concat(z,"px"):z}function J8(Q,z){if(A(Q)){var U=F1(Q);if(Q=t5(Q,U),arguments.length<2)return this[0]&&p(this[0],Q,U);if(!Q)return this;return z=s1(Q,z,U),this.each(function(C,E){if(!S(E))return;if(U)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var K in Q)this.css(K,Q[K]);return this}w.css=J8;function l1(Q,z){try{return Q(z)}catch(U){return z}}var Z8=/^\s+|\s+$/;function o1(Q,z){var U=Q.dataset[z]||Q.dataset[L1(z)];if(Z8.test(U))return U;return l1(JSON.parse,U)}function Q8(Q,z,U){U=l1(JSON.stringify,U),Q.dataset[L1(z)]=U}function W8(Q,z){if(!Q){if(!this[0])return;var U={};for(var K in this[0].dataset)U[K]=o1(this[0],K);return U}if(A(Q)){if(arguments.length<2)return this[0]&&o1(this[0],Q);if($(z))return this;return this.each(function(C,E){Q8(E,Q,z)})}for(var K in Q)this.data(K,Q[K]);return this}w.data=W8;function r1(Q,z){var U=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],U["scroll".concat(z)],Q.body["offset".concat(z)],U["offset".concat(z)],U["client".concat(z)])}L([!0,!1],function(Q,z){L(["Width","Height"],function(U,K){var C="".concat(z?"outer":"inner").concat(K);w[C]=function(E){if(!this[0])return;if(P(this[0]))return z?this[0]["inner".concat(K)]:this[0].document.documentElement["client".concat(K)];if(F(this[0]))return r1(this[0],K);return this[0]["".concat(z?"offset":"client").concat(K)]+(E&&z?s(this[0],"margin".concat(U?"Top":"Left"))+s(this[0],"margin".concat(U?"Bottom":"Right")):0)}})}),L(["Width","Height"],function(Q,z){var U=z.toLowerCase();w[U]=function(K){if(!this[0])return $(K)?void 0:this;if(!arguments.length){if(P(this[0]))return this[0].document.documentElement["client".concat(z)];if(F(this[0]))return r1(this[0],z);return this[0].getBoundingClientRect()[U]-o(this[0],!Q)}var C=parseInt(K,10);return this.each(function(E,y){if(!S(y))return;var l=p(y,"boxSizing");y.style[U]=s1(U,C+(l==="border-box"?o(y,!Q):0))})}});var n1="___cd";w.toggle=function(Q){return this.each(function(z,U){if(!S(U))return;var K=g0(U),C=$(Q)?K:Q;if(C){if(U.style.display=U[n1]||"",g0(U))U.style.display=L0(U.tagName)}else if(!K)U[n1]=p(U,"display"),U.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var a1="___ce",V1=".",C1={focus:"focusin",blur:"focusout"},t1={mouseenter:"mouseover",mouseleave:"mouseout"},H8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return t1[Q]||C1[Q]||Q}function P1(Q){var z=Q.split(V1);return[z[0],z.slice(1).sort()]}w.trigger=function(Q,z){if(A(Q)){var U=P1(Q),K=U[0],C=U[1],E=N1(K);if(!E)return this;var y=H8.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent(E,!0,!0),Q.namespace=C.join(V1),Q.___ot=K}Q.___td=z;var l=Q.___ot in C1;return this.each(function(j0,q0){if(l&&f(q0[Q.___ot]))q0["___i".concat(Q.type)]=!0,q0[Q.___ot](),q0["___i".concat(Q.type)]=!1;q0.dispatchEvent(Q)})};function e1(Q){return Q[a1]=Q[a1]||{}}function X8(Q,z,U,K,C){var E=e1(Q);E[z]=E[z]||[],E[z].push([U,K,C]),Q.addEventListener(z,C)}function J5(Q,z){return!z||!H0.call(z,function(U){return Q.indexOf(U)<0})}function l0(Q,z,U,K,C){var E=e1(Q);if(!z)for(z in E)l0(Q,z,U,K,C);else if(E[z])E[z]=E[z].filter(function(y){var l=y[0],j0=y[1],q0=y[2];if(C&&q0.guid!==C.guid||!J5(l,U)||K&&K!==j0)return!0;Q.removeEventListener(z,q0)})}w.off=function(Q,z,U){var K=this;if($(Q))this.each(function(E,y){if(!S(y)&&!F(y)&&!P(y))return;l0(y)});else if(!A(Q))for(var C in Q)this.off(C,Q[C]);else{if(f(z))U=z,z="";L(x(Q),function(E,y){var l=P1(y),j0=l[0],q0=l[1],U0=N1(j0);K.each(function(A0,O0){if(!S(O0)&&!F(O0)&&!P(O0))return;l0(O0,U0,q0,z,U)})})}return this},w.remove=function(Q){return R0(this,Q).detach().off(),this},w.replaceWith=function(Q){return this.before(Q).remove()},w.replaceAll=function(Q){return O(Q).replaceWith(this),this};function q8(Q,z,U,K,C){var E=this;if(!A(Q)){for(var y in Q)this.on(y,z,U,Q[y],C);return this}if(!A(z))if($(z)||k(z))z="";else if($(U))U=z,z="";else K=U,U=z,z="";if(!f(K))K=U,U=void 0;if(!K)return this;return L(x(Q),function(l,j0){var q0=P1(j0),U0=q0[0],A0=q0[1],O0=N1(U0),o0=U0 in t1,$1=U0 in C1;if(!O0)return;E.each(function(R1,w0){if(!S(w0)&&!F(w0)&&!P(w0))return;var E1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!J5(A0,z0.namespace.split(V1)))return;if(!z&&($1&&(z0.target!==w0||z0.___ot===O0)||o0&&z0.relatedTarget&&w0.contains(z0.relatedTarget)))return;var T1=w0;if(z){var k0=z0.target;while(!m1(k0,z)){if(k0===w0)return;if(k0=k0.parentNode,!k0)return}T1=k0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return T1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return w0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return U}});var w8=K.call(T1,z0,z0.___td);if(C)l0(w0,O0,A0,z,E1);if(w8===!1)z0.preventDefault(),z0.stopPropagation()};E1.guid=K.guid=K.guid||O.guid++,X8(w0,O0,A0,z,E1)})}),this}w.on=q8;function z8(Q,z,U,K){return this.on(Q,z,U,K,!0)}w.one=z8;var B8=/\r?\n/g;function G8(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(B8,"\r\n")))}var U8=/file|reset|submit|button|image/i,Z5=/radio|checkbox/i;if(w.serialize=function(){var Q="";return this.each(function(z,U){L(U.elements||[U],function(K,C){if(C.disabled||!C.name||C.tagName==="FIELDSET"||U8.test(C.type)||Z5.test(C.type)&&!C.checked)return;var E=c1(C);if(!$(E)){var y=G(E)?E:[E];L(y,function(l,j0){Q+=G8(C.name,j0)})}})}),Q.slice(1)},typeof W5!=="undefined")H5.exports=O;else Z.cash=Z.$=O})()});class r0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const W=this.callbacks.get(Z);if(W)W()}catch(W){console.error(`Error updating component ${Z}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class n0{subscriptions=new Map;tick=new r0;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const W=this,X=new WeakMap,q=(B)=>{if(typeof B.toJSON==="function")return B;if(B instanceof Map)B.forEach((G,M)=>B.set(M,H(G)));else if(Array.isArray(B))B.forEach((G,M)=>B[M]=H(G));else if(typeof B==="object")Object.entries(B).forEach(([G,M])=>B[G]=H(M));let Y=new Proxy(B,{get(G,M){if(M==="toJSON")return function(){const N=(b)=>{if(!b||typeof b!=="object")return b;if(X.has(b)){const i=X.get(b);if(i instanceof Map){const r={};return i.forEach((H0,t)=>r[typeof t==="object"?JSON.stringify(t):String(t)]=N(H0)),r}if(Array.isArray(i))return i.map((r)=>N(r));const e={};return Object.entries(i).forEach(([r,H0])=>e[r]=N(H0)),e}if(typeof b.toJSON==="function"&&!X.has(b))return b.toJSON();return b};return N(Y)};if(M==="reset")return function(){Y=null};const j=G[M];if(B instanceof Map&&typeof j==="function")return function(...N){const b=M.toString();if(b==="set"&&N.length>=2)N[1]=H(N[1]);const i=j.apply(G,N);return["set","delete","clear"].includes(b)&&W.queueUpdate(J),i};if(Array.isArray(B)&&typeof j==="function")return function(...N){const b=M.toString();if(["push","unshift"].includes(b))N=N.map((e)=>H(e));else if(b==="splice"&&N.length>2)N=[N[0],N[1],...N.slice(2).map((e)=>H(e))];const i=j.apply(G,N);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&W.queueUpdate(J),i};return j},set(G,M,j){if(G[M]===j)return!0;if(j instanceof Map&&G[M]instanceof Map){const N=G[M];return N.clear(),j.forEach((b,i)=>N.set(i,H(b))),W.queueUpdate(J),!0}return G[M]=H(j),W.queueUpdate(J),!0}});return X.set(Y,B),Y},H=(B)=>{if(!B)return B;return B instanceof Map||Array.isArray(B)||typeof B==="object"?q(B):B};return q(Z)}}class a0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const W=Z.node;if(!W){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const W=J.node;if(!W)return;if(Z==="attach"&&document.contains(W[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(W[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const X=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:X,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var t0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,X)=>{return Z[X]!==void 0?Z[X].toString():`{${X}}`})},Q5=(J,Z,W,X,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(X.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let Y=W["*"];if(typeof Y==="object")Y=Y[q||"*"];return t0(Y,X)}if(typeof X.count==="string")X.count=Number(X.count);let H="*";if(X.count.toString()in W)H=X.count.toString();let B=W[H]||W["*"];if(typeof B==="object")B=B[q||"*"];return t0(B,X)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let H;for(let B in W)try{if(new Function("params",`with( params ){ return ${B}; }`)(X||{})){H=W[B];break}}catch(Y){console.warn(`Invalid <${Z}(${B})> condition expression`)}if(H===void 0)return;if(typeof H==="object")H=H[q||"*"];return t0(H,X)}case"variable":default:{const H=typeof W==="object"?W[q||"*"]:W;if(typeof H==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return t0(H,X)}}};class e0{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[W,X]=Z.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const q=this.DICTIONARIES[W][J];J=q[X||"*"]||q["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Z}}format(J,Z,W){W=W||this.currentLang;const[X,q]=W.split("-");if(!this.DICTIONARIES[X]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[X][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const H=this.DICTIONARIES[X][J];if(typeof H==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof H!=="object"||H===null||Array.isArray(H)){console.warn(`Invalid <${W}[${J}]> format value`);return}return Q5(H.type,J,H.value,Z,q)}}var P5=S1(J1(),1);var Z1="comm",Q1="rule",W1="decl";var X5="@import";var q5="@namespace",z5="@keyframes";var B5="@layer";function H1(J){return J.trim()}function _0(J,Z,W){return J.replace(Z,W)}function G5(J,Z,W){return J.indexOf(Z,W)}function V0(J,Z){return J.charCodeAt(Z)|0}function C0(J,Z,W){return J.slice(Z,W)}function G0(J){return J.length}function X1(J){return J.length}function h0(J,Z){return Z.push(J),J}var b1=Math.abs,i0=String.fromCharCode;function z1(J,Z,W,X,q,H,B,Y){return{value:J,root:Z,parent:W,type:X,props:q,children:H,line:q1,column:f0,length:B,return:"",siblings:Y}}function w5(){return X0}function Y5(){if(X0=M0>0?V0(v0,--M0):0,f0--,X0===10)f0=1,q1--;return X0}function K0(){if(X0=M0<U5?V0(v0,M0++):0,f0++,X0===10)f0=1,q1++;return X0}function N0(){return V0(v0,M0)}function c0(){return M0}function B1(J,Z){return C0(v0,J,Z)}function y0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M5(J){return q1=f0=1,U5=G0(v0=J),M0=0,[]}function K5(J){return v0="",J}function G1(J){return H1(B1(M0-1,x1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(X0=N0())if(X0<33)K0();else break;return y0(J)>2||y0(X0)>3?"":" "}function O5(J,Z){while(--Z&&K0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return B1(J,c0()+(Z<6&&N0()==32&&K0()==32))}function x1(J){while(K0())switch(X0){case J:return M0;case 34:case 39:if(J!==34&&J!==39)x1(X0);break;case 40:if(J===41)x1(J);break;case 92:K0();break}return M0}function D5(J,Z){while(K0())if(J+X0===57)break;else if(J+X0===84&&N0()===47)break;return"/*"+B1(Z,M0-1)+"*"+i0(J===47?J:K0())}function L5(J){while(!y0(N0()))K0();return B1(J,M0)}var q1=1,f0=1,U5=0,M0=0,X0=0,v0="";function V5(J){return K5(U1("",null,null,null,[""],J=M5(J),0,[0],J))}function U1(J,Z,W,X,q,H,B,Y,G){var M=0,j=0,N=B,b=0,i=0,e=0,r=1,H0=1,t=1,J0=0,d="",h=q,u=H,v=X,T=d;while(H0)switch(e=J0,J0=K0()){case 40:if(e!=108&&V0(T,N-1)==58){if(G5(T+=_0(G1(J0),"&","&\f"),"&\f",b1(M?Y[M-1]:0))!=-1)t=-1;break}case 34:case 39:case 91:T+=G1(J0);break;case 9:case 10:case 13:case 32:T+=j5(e);break;case 92:T+=O5(c0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(h0(L8(D5(K0(),c0()),Z,W,G),G),(y0(e||1)==5||y0(N0()||1)==5)&&G0(T)&&C0(T,-1,void 0)!==" ")T+=" ";break;default:T+="/"}break;case 123*r:Y[M++]=G0(T)*t;case 125*r:case 59:case 0:switch(J0){case 0:case 125:H0=0;case 59+j:if(t==-1)T=_0(T,/\f/g,"");if(i>0&&(G0(T)-N||r===0&&e===47))h0(i>32?I5(T+";",X,W,N-1,G):I5(_0(T," ","")+";",X,W,N-2,G),G);break;case 59:T+=";";default:if(h0(v=F5(T,Z,W,M,j,q,Y,d,h=[],u=[],N,H),H),J0===123)if(j===0)U1(T,Z,v,v,h,H,N,Y,u);else{switch(b){case 99:if(V0(T,3)===110)break;case 108:if(V0(T,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)U1(J,v,v,X&&h0(F5(J,v,v,0,0,q,Y,d,q,h=[],N,u),u),q,u,N,Y,X?h:u);else U1(T,v,v,v,[""],u,0,Y,u)}}M=j=i=0,r=t=1,d=T="",N=B;break;case 58:N=1+G0(T),i=e;default:if(r<1){if(J0==123)--r;else if(J0==125&&r++==0&&Y5()==125)continue}switch(T+=i0(J0),J0*r){case 38:t=j>0?1:(T+="\f",-1);break;case 44:Y[M++]=(G0(T)-1)*t,t=1;break;case 64:if(N0()===45)T+=G1(K0());b=N0(),j=N=G0(d=T+=L5(c0())),J0++;break;case 45:if(e===45&&G0(T)==2)r=0}}return H}function F5(J,Z,W,X,q,H,B,Y,G,M,j,N){var b=q-1,i=q===0?H:[""],e=X1(i);for(var r=0,H0=0,t=0;r<X;++r)for(var J0=0,d=C0(J,b+1,b=b1(H0=B[r])),h=J;J0<e;++J0)if(h=H1(H0>0?i[J0]+" "+d:_0(d,/&\f/g,i[J0])))G[t++]=h;return z1(J,Z,W,q===0?Q1:Y,G,M,j,N)}function L8(J,Z,W,X){return z1(J,Z,W,Z1,i0(w5()),C0(J,2,-2),0,X)}function I5(J,Z,W,X,q){return z1(J,Z,W,W1,C0(J,0,X),C0(J,X+1,-1),X,q)}function w1(J,Z){var W="";for(var X=0;X<J.length;X++)W+=Z(J[X],X,J,Z)||"";return W}function C5(J,Z,W,X){switch(J.type){case B5:if(J.children.length)break;case X5:case q5:case W1:return J.return=J.return||J.value;case Z1:return"";case z5:return J.return=J.value+"{"+w1(J.children,X)+"}";case Q1:if(!G0(J.value=J.props.join(",")))return""}return G0(W=w1(J.children,X))?J.return=J.value+"{"+W+"}":""}function N5(J){var Z=X1(J);return function(W,X,q,H){var B="";for(var Y=0;Y<Z;Y++)B+=J[Y](W,X,q,H)||"";return B}}class u0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=P5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return w1(V5(J),N5([C5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const W=new MutationObserver(()=>{const X=document.querySelector(J);if(X&&getComputedStyle(X).cssText)W.disconnect(),Z()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const W=this.compile(J);if(!W)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const X=document.createElement("style");X.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),X.textContent=W;let q=0;const H=this.$head.find(`style[${Z}]`);if(H.length)q=parseInt(H.attr("dindex"))+1,H.remove();return X.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(X):document.head.appendChild(X),X}catch(W){throw new Error(`Style injection failed: ${W.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class Y1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},W="batch-updator"){try{const X=this.component.FGUD.get(J)?.get(Z);if(!X){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(X.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(X.nodepath);if(!q)return;const H=X.update(q.memo||{},W);if(H){if(typeof H.memo==="object")q.memo=H.memo;typeof H.cleanup==="function"&&H.cleanup()}}catch(X){console.error("Failed to update dependency --",X)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((X,q)=>J.set(q,new Set(X))),this.pending.clear(),this.isPending=!1;const Z=(X)=>{const q=Array.from(X);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((H)=>this.apply(H))},W=Array.from(J.keys()).sort((X,q)=>X-q);for(let X of W){const q=J.get(X);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class M1{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const W=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(W);if(typeof q==="object")for(let H in q)q[H]=W(q[H]);return q},X=Z.map(W);this.__events[J]?.forEach((q)=>q(...X)),this.__once_events[J]?.forEach((q)=>q(...X)),delete this.__once_events[J]}}var g1=S1(J1(),1);function B0(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if($5(J)&&$5(Z)){for(let B of J)if(!Z.has(B))return!0;return!1}const H=new WeakMap;for(let B of J){let Y=!1;if(typeof B!=="object"){if(Z.has(B))Y=!0}else for(let G of Z){if(typeof G!=="object")continue;if(!H.has(B))H.set(B,new WeakMap);const M=H.get(B);if(M.has(G)){if(Y=M.get(G),Y)break;continue}const j=!B0(B,G);if(M.set(G,j),j){Y=!0;break}}if(!Y)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if(R5(J)&&R5(Z)){for(let[B,Y]of J)if(Z.get(B)!==Y)return!0;return!1}const H=new WeakMap;for(let[B,Y]of J){if(typeof B!=="object"){if(!Z.has(B))return!0;const j=Z.get(B);if(typeof Y!=="object"){if(Y!==j)return!0;continue}if(typeof j!=="object"||B0(Y,j))return!0;continue}let G=!1,M=!1;for(let[j,N]of Z){if(typeof j!=="object")continue;if(!H.has(B))H.set(B,new WeakMap);const b=H.get(B);if(b.has(j)){const[i,e]=b.get(j);if(i){G=!0,M=e;break}continue}if(!B0(B,j)){if(G=!0,M=typeof Y==="object"&&typeof N==="object"?!B0(Y,N):Y===N,b.set(j,[!0,M]),M)break}else b.set(j,[!1,!1])}if(!G||!M)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let H=0;H<J.length;H++){const B=J[H],Y=Z[H];if(B!==Y&&(typeof B!=="object"||B0(B,Y)))return!0}return!1}const W=Object.keys(J),X=Object.keys(Z);if(W.length!==X.length)return!0;W.sort(),X.sort();const q=W.length;for(let H=0;H<q;H++)if(W[H]!==X[H])return!0;for(let H=0;H<q;H++){const B=W[H],Y=J[B],G=Z[B];if(Y===G)continue;if(Y instanceof Date){if(!(G instanceof Date)||String(Y)!==String(G))return!0;continue}if(Y instanceof RegExp){if(!(G instanceof RegExp)||Y.source!==G.source||Y.flags!==G.flags)return!0;continue}if(Y instanceof Map){if(!(G instanceof Map)||B0(Y,G))return!0;continue}if(Y instanceof Set){if(!(G instanceof Set)||B0(Y,G))return!0;continue}if(Y instanceof Function){if(!(G instanceof Function))return!0;continue}if(typeof Y==="object"){if(typeof G!=="object")return!0;if(Y===J){if(G!==Z)return!0}else if(B0(Y,G))return!0}else return!0}return!1}function P0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const W=typeof J;if(W!==typeof Z)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const Y=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),G=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let M=0;M<Y.length;M++)if(Y[M]!==G[M])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Z;if(typeof J==="function"){if(typeof Z!=="function")return!1;return J.toString()===Z.toString()&&J.name===Z.name}if(J.constructor!==Z.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!B0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const H=Object.getOwnPropertyNames(J),B=Object.getOwnPropertyNames(Z);if(H.length!==B.length)return!1;for(let Y of H){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!P0(J[Y],Z[Y]))return!1}if(q!==null&&q!==Object.prototype){const Y=Object.getOwnPropertyNames(q),G=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==G.length)return!1;for(let M of Y){if(M==="constructor")continue;if(!P0(q[M],Object.getPrototypeOf(Z)[M]))return!1}}return!0}function $5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function R5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function W0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((H,B)=>q.set(W0(B,Z),W0(H,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((H)=>q.add(W0(H,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let H=0;H<J.length;H++)q[H]=W0(J[H],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Z.set(J,W);const X=Object.getOwnPropertySymbols(J);for(let q of X)W[q]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=W0(J[q],Z);return W}function k5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function W(q,H,B){const Y=H.split(/\.|\[|\]/).filter(Boolean);let G=q;for(let M=0;M<Y.length;M++){const j=Y[M],N=!isNaN(Number(j)),b=M===Y.length-1,i=!isNaN(Number(Y[M+1]));if(b){G[j]=B;continue}if(!(j in G))G[j]=i?[]:{};else if(i&&!Array.isArray(G[j]))G[j]=[];else if(!i&&Array.isArray(G[j]))G[j]={};G=G[j]}}const X=W0(J);try{for(let[q,H]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);W(X,q,H)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return X}function _5(J){return JSON.parse(JSON.stringify(J))}var T0="i18n",$0="syn:",D0="fn:",S0="on-",Y0=/^\.\.\./,K1=/^\[(.*?)\]$/,k1=/{\s*([^{}]+)\s*}/g,E5=["@html","@text","@format"],T5=["display","visibility","position","width","height"],j1=":r",A5=":n",S5="m",b5="c",x5="x",g5=100;g1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&g1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class O1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,W)=>Z+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},X={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},H={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(W),console.table(X),console.table(q),console.table(H),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Z0=S1(J1(),1);var F8=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,X;while((X=Z.exec(J))!==null){const q=X[1],H=X.index+X[0].length;let B=1,Y=H;while(Y<J.length&&B>0){if(J[Y]==="(")B++;if(J[Y]===")")B--;Y++}if(B===0){const G=J.slice(H,Y-1).trim(),M=J.slice(0,X.index),j=`${S0}${q}="${G}"`,N=J.slice(Y);W=M+j+N,J=W,Z.lastIndex=M.length+j.length}}return W},I8=function(J){const Z=[];let X=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,H,B)=>{return Z.push(B),`<${H}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const H=`##TAG_ATTRS_${q}##`,B=Z[q],Y=V8(B);X=X.replace(H,Y)}return X},V8=function(J){let Z="",W=0,X=!1,q="",H=0,B=0,Y=0;while(W<J.length){const G=J[W];if((G==='"'||G==="'")&&(W===0||J[W-1]!=="\\")){if(!X)X=!0,q=G;else if(G===q)X=!1}if(!X){if(G==="(")B++;else if(G===")")B--;else if(G==="{")Y++;else if(G==="}")Y--}if(!X&&B===0&&Y===0&&(G===" "||W===J.length-1)){let M=W;if(W===J.length-1)M=W+1;const j=J.substring(H,M).trim();if(j){const N=C8(j);Z+=" "+N}H=W+1}W++}return Z},C8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===T0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Z).trim(),X=J.substring(Z+1).trim();if(W.startsWith("@"))return W=!E5.includes(W)?W.slice(1):W,`:${W}=${X}`;if(W.startsWith(D0)||W.startsWith(S0))return J;if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'")){const q=X.substring(1,X.length-1);if(N8(q))return`:${W}="${q}"`;return J}else return`:${W}="${X}"`};function N8(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function _1(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(W,X,q)=>{return q.endsWith("<")?`<lips dtag="${X}" ${q}/lips>`:`<lips dtag="${X}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${D0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=F8(Z),Z=I8(Z),Z}var P8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},f5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function b0(J,Z={maxSize:100}){const W=new Set,X=[{value:J,timestamp:Date.now()}];let q=0;const H=()=>{const M=D1[D1.length-1];return M&&P8(M,W),X[q].value},B=()=>{const M=[...W];if(h5)for(let j of M)h5.add(j);else for(let j of M)j.execute()};return[H,(M,j)=>{if(Object.is(X[q].value,M))return;if(q<X.length-1)X.splice(q+1);if(X.push({value:M,timestamp:Date.now(),metadata:j}),X.length>Z.maxSize)X.shift(),q=Math.max(0,q-1);else q++;B()},{undo(){if(q>0)q--,B()},redo(){if(q<X.length-1)q++,B()},jumpTo(M){if(M>=0&&M<X.length&&M!==q)q=M,B()},getHistory(){return[...X]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<X.length-1},clear(){const M=X[0];X.length=0,X.push(M),q=0,B()}}]}function p0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(X.isDisposed)return;Z=!0,f5(X),D1.push(X);try{J()}finally{Z=!1,D1.pop()}},X={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{X.isDisposed=!0,f5(X)}}}var D1=[],h5=null;class x0 extends M1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:W,state:X,context:q,_static:H,handler:B,stylesheet:Y,macros:G,declaration:M},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=_1(Z),this.__boundaries__=j.boundaries,this.declaration=M||{name:J},this.input=W||{},this.static=H||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,X||{}),G&&this.setMacros(G),B&&this.setHandler(B),Y&&this.setStylesheet(Y),this.metrics=new O1(this.debug),this.metrics.inc("componentCount"),this.UQS=new Y1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W0(this.state),input:W0(this.input),context:W0(this.context)};const[N,b]=b0(this.input),[i,e]=b0(this.state),[r,H0]=b0(this.context);this.__setInput=b,this.__setState=e,this.__getState=i,this.lips.IUC.register(this.__path__,()=>{B0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(t)=>{if(!B0(this.context,t))return;H0(t),this.context=t,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(t)=>{if(t===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=t}),this.ICE=p0(()=>{const t=i(),J0=this.input=N(),d=this.context=r();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||M?.syntax&&typeof this.onSelfRender=="function"){const h=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=h||Z0.default()}else{const{$log:h}=this.render("",void 0,void 0,this.FGUD);this.$=h}!M?.syntax&&this.$?.each((h,u)=>{typeof u.setAttribute=="function"&&u.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W0(J0),state:W0(t),context:W0(d)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!B0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(k5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=_1(J),W=Z0.default(Z);if(!W.length)return;const X=this;W.each(function(){const q=Z0.default(this),{argv:H,attrs:B}=X.__getAttributes__(q);if(!Object.keys(B))throw new Error("Invalid macro component definition");if(!B.literals.name)throw new Error("Undefined macro `name` attribute.");if(X.__macros.get(B.literals.name))console.warn(`Duplicate macro <${B.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");X.__macros.set(B.literals.name,{argv:H,$node:q})})}setHandler(J){Object.entries(J).map(([Z,W])=>this[Z]=W?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new u0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,W={},X,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:X||new Map};const H=this,B=X||new Map,Y=[];this.metrics.startRender();let G=Z0.default();function M(){return W0(W)}function j(w,O=!1){const D=N(w,O);return H.__inpathCounter__++,H.__inpath__?`${H.__inpath__}/${D}`:`${J?J+"/":""}${D}`}function N(w,O=!1){let D="";switch(w){case"component":D=O?x5:b5;break;case"macro":D=S5;break}return D+H.__inpathCounter__}function b(w){return w!==null&&typeof w==="object"&&typeof w.mesh==="function"&&typeof w.update==="function"}function i(w){return w!==null&&typeof w==="object"&&typeof w.default&&typeof w.default==="string"}function e(w){if(!w.attr(":dtag")||w.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const O=w.attr(":dtag"),D=H.__evaluate__(O,W);if(b(D)||D===null)return J0(w,O,D);else if(i(D))return d(w,{template:D});else return d(w,{name:D})}function r(w){const O=w.attr(":args"),D=j("log");if(!O)return;const P=M();if(H.__evaluate__(`console.log(${O})`,P),H.__isReactive__(O,P))H.__extractExpressionDeps__(O,P).forEach((V)=>H.__trackDep__(B,V,P,{nodetype:"log",nodepath:D,target:"argument",$fragment:null,update:(S)=>H.__evaluate__(`console.log(${O})`,S),syntax:!0}))}function H0(w){const O=j("var"),{attrs:D}=H.__getAttributes__(w);if(!D)return;Object.entries(D.literals).forEach(([P,F])=>{if(W[P]&&W[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);W[P]={value:F,type:"let"}}),Object.entries(D.expressions).forEach(([P,F])=>{if(W[P]&&W[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(W[P]={value:H.__evaluate__(F,W),type:"let"},H.__isReactive__(F,W)){const V=H.__extractExpressionDeps__(F,W),S=(m,c)=>{if(m[P]&&m[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(D.map.beforeSpreadAttrs.includes(P))return;const f=H.__evaluate__(F,m);if(P0(m[P].value,f))return;return m[P]={value:f,type:"let"},H.__updateVarDepNodes__(P,O,m),_5({memo:m})};V.forEach((m)=>H.__trackDep__(B,m,M(),{nodetype:"let",nodepath:O,deppath:`${O}.${P}`,target:"attr",$fragment:null,update:S,syntax:!0}))}}),H.metrics.inc("elementCount")}function t(w){const{attrs:O}=H.__getAttributes__(w);if(!O)return;Object.entries(O.literals).forEach(([D,P])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!P)return;W[D]={value:P,type:"const"}}),Object.entries(O.expressions).forEach(([D,P])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!P)return;W[D]={value:H.__evaluate__(P,W),type:"const"}}),H.metrics.inc("elementCount")}function J0(w,O,D){const{attrs:P}=H.__getAttributes__(w),F=j("element"),V=H.__getBoundaries__(F),S={},m={};let c=M(),f=Z0.default(V.start),A={},$=D;if($){P.literals&&Object.entries(P.literals).forEach(([R,_])=>{S[R]=_,A[R]={type:"arg",value:_}}),P.expressions&&Object.entries(P.expressions).forEach(([R,_])=>{if(!$)return;if(Y0.test(R))H.__evaluateSpreadAttr__(R,{memo:c,get keystore(){return m[R]},set keystore(L){if(!m[R])m[R]=[];m[R]=L},each:(L,g)=>{if(S[L]=g,L!=="#"&&!$?.argv.includes(L))return;A[L]={type:"arg",value:g}}});else{const L=_?H.__evaluate__(_,c):!0;if(S[R]=L,R!=="#"&&!$.argv.includes(R))return;A[R]={type:"arg",value:L}}}),c.__arguments__=S;const k=$.mesh(A);if(k&&k.length)f=f.add(k);P.expressions&&Object.entries(P.expressions).forEach(([R,_])=>{if(!$)return;if(Y0.test(R)&&H.__isReactive__(R,c)){const L=H.__extractExpressionDeps__(R,c),g=(I,x)=>{if(!$)return;const a={};let n=[];if(H.__evaluateSpreadAttr__(R,{memo:I,get keystore(){return m[R]},set keystore(p){if(!m[R])m[R]=[];m[R]=p},each:(p,s)=>{if(P.map.afterSpreadAttrs.includes(p))return;if(p!=="#"&&!$?.argv.includes(p))return;if(P0(s,I[p]?.value))return;A[p]=a[p]={value:s,type:"arg"},S[p]=s,n.push(p)},nullify:(p)=>{p.forEach((s)=>{a[s]={value:void 0,type:"arg"},delete S[s]}),n=p}}),n.length)$.argv.length&&H.__updateArgumentsDepNodes__(F,S),$.update(n,a,I,V)};L.forEach((I)=>H.__trackDep__(B,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"spread-attr",$fragment:null,boundaries:V,update:g}))}else if((R==="#"||$.argv.includes(R))&&H.__isReactive__(_,c)){const L=H.__extractExpressionDeps__(_,c),g=(I,x)=>{if(!$)return;if(P.map.beforeSpreadAttrs.includes(R))return;const a=_?H.__evaluate__(_,I):!0,n={type:"arg",value:a};if(A[R]=n,$.argv.length)S[R]=a,H.__updateArgumentsDepNodes__(F,S);$.update([R],{[R]:n},I,V)};L.forEach((I)=>H.__trackDep__(B,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"attr",$fragment:null,boundaries:V,update:g}))}})}if(H.__isReactive__(O,c)){const k=(_,L)=>{const g=H.__evaluate__(O,_);let I;if(i(g))I=d(w,{template:g}),H.__fillBoundaries__(I,V);else if(b(g)){if("#"in A)A=A["#"].value;else Object.entries(A).forEach(([x,a])=>{if(typeof a==="function")return;S[x]=a.value});if($?.cleanup(V),$=g,$)$.argv.length&&H.__updateArgumentsDepNodes__(F,S),I=$.mesh(A),I?.length&&$.fill(I,V)}else if($)$.cleanup(V),$=null};H.__extractExpressionDeps__(O,c).forEach((_)=>H.__trackDep__(B,_,{...c,...A},{nodetype:"dynamic",nodepath:F,deppath:`${F}.dtag`,target:"dtag",$fragment:null,boundaries:V,update:k}))}return f=f.add(V.end),f}function d(w,O){let D,P;if(O?.template)D=O.template,P=N("component",D.declaration?.syntax);else{if(P=O?.name||w.prop("tagName")?.toLowerCase(),!P)throw new Error("Invalid component");if(P===H.__name__)throw new Error("Render component within itself is forbidden");D=H.lips.import(P)}if(!D||!P)throw new Error(`<${P}> template not found`);const F=j("component",D.declaration?.syntax),V=H.__getBoundaries__(F),{argv:S,functions:m,attrs:c,events:f}=H.__getAttributes__(w),A={},$={};let k={},R=Z0.default(V.start),_=H.PCC.get(F),L=M();c.literals&&Object.entries(c.literals).forEach(([I,x])=>{if(I=="key")return;k[I]=x}),m&&Object.entries(m).forEach(([I,x])=>{k[I]=H.__evaluateFunction__(x,[],L),D.declaration?.syntax?A[$0+D0+I]=x:A[D0+I]=x}),c.expressions&&Object.entries(c.expressions).forEach(([I,x])=>{if(I=="key")return;if(Y0.test(I))H.__evaluateSpreadAttr__(I,{memo:L,get keystore(){return $[I]},set keystore(a){if(!$[I])$[I]=[];$[I]=a},each:(a,n)=>k[a]=n});else k[I]=x?H.__evaluate__(x,L):!0;D.declaration?.syntax?A[$0+I]=x:A[I]=x});const g=w.contents();if(g.length){if(k={...k,...H.__meshwire__({$node:w,fragmentPath:F,fragmentBoundaries:V,meshPath:null,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)},D.declaration){if(D.declaration.tags){let I;Object.entries(D.declaration?.tags).forEach(([x,{type:a,many:n,alts:p}])=>{switch(a){case"nexted":{let s=w.next(x);if(!s.length&&Array.isArray(p)&&I?.length&&I.is(p.join(",")))s=I.next(x);if(!s.length)return;if(n){k[x]=[];let o=0,Q0=!1;while(!Q0){if(k[x].push(H.__meshwire__({$node:s,meshPath:`${x}[${o}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)),!s.next(x).length){Q0=!0;break}s=I=s.next(x),o++}}else k[x]=H.__meshwire__({$node:s,meshPath:x,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:D.declaration},A)}break;case"child":{const s=w.children(x);if(n)k[x]=[],s.each(function(o){const Q0=Z0.default(this),{argv:L0}=H.__getAttributes__(Q0);k[x].push(H.__meshwire__({$node:Q0,meshPath:`${x}[${o}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:L0,xmlns:q,useAttributes:!0,declaration:D.declaration},A))});else if(w.children(x).first().length){const o=w.children(x).first(),{argv:Q0}=H.__getAttributes__(o);k[x]=H.__meshwire__({$node:o,meshPath:x,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:Q0,xmlns:q,useAttributes:!0,declaration:D.declaration},A)}}break}})}else if(D.declaration.contents)k.__contents__=g}}if(_)_.setInput(W0(k)),R=R.add(_.node);else{const{declaration:I,state:x,_static:a,handler:n,context:p,default:s,stylesheet:o}=D;_=new x0(P,s||"",{state:W0(x),input:W0(k),context:p,_static:W0(a),handler:n,stylesheet:o,declaration:I},{debug:H.debug,lips:H.lips,prepath:F,boundaries:V}),R=R.add(_.node),!D.declaration?.syntax&&H.PCC.set(F,_)}return R=R.add(V.end),Object.entries(f).forEach(([I,x])=>{H.__attachEvent__({nodepath:F,element:_,_event:I,instruction:x,scope:L,get __dependencies__(){return B}})}),A&&Object.entries(A).forEach(([I,x])=>{let a=!1,n=!1;if(I.startsWith($0))a=!0,I=I.replace($0,"");if(I.startsWith(D0))n=!0,I=I.replace(D0,"");if(Y0.test(I)){if(H.__isReactive__(I,L)){const p=(o)=>{const Q0={};H.__evaluateSpreadAttr__(I,{memo:o,get keystore(){return $[I]},set keystore(L0){if(!$[I])$[I]=[];$[I]=L0},each:(L0,g0)=>{if(c.map.afterSpreadAttrs.includes(L0))return;Q0[L0]=g0},nullify:(L0)=>L0.forEach((g0)=>Q0[g0]=void 0)}),_?.subInput(Q0,o)};H.__extractExpressionDeps__(I,L).forEach((o)=>H.__trackDep__(B,o,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"spread-attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}else if(H.__isReactive__(x,L)){const p=(o)=>{if(c.map.beforeSpreadAttrs.includes(I))return;const Q0=n?H.__evaluateFunction__(x,[],o):x?H.__evaluate__(x,o):!0;_?.subInput({[I]:Q0},o)};H.__extractExpressionDeps__(x,L).forEach((o)=>H.__trackDep__(B,o,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}),H.metrics.inc("componentCount"),R}function h(w){const O=w.prop("tagName")?.toLowerCase();if(!O)throw new Error("Invalid macro rendering call");const D=H.__macros.get(O);if(!D)throw new Error("Macro component not found");const P=j("macro"),F=H.__getBoundaries__(P),{attrs:V}=H.__getAttributes__(w),S={},m=M(),c={},f={};V.literals&&Object.entries(V.literals).forEach(([L,g])=>{c[L]=g,f[L]={value:g,type:"arg"}});const A={};V.expressions&&Object.entries(V.expressions).forEach(([L,g])=>{if(Y0.test(L))H.__evaluateSpreadAttr__(L,{memo:m,get keystore(){return A[L]},set keystore(I){if(!A[L])A[L]=[];A[L]=I},each:(I,x)=>{if(c[I]=x,D.argv.includes(I))f[I]={value:x,type:"arg"}}}),S[L]=g;else{const I=g?H.__evaluate__(g,m):!0;if(c[L]=I,D.argv.includes(L))f[L]={value:I,type:"arg"},S[L]=g}D.argv.forEach((I)=>{if(f[I]!==void 0)return;f[I]={value:!1,type:"arg"}})}),f.__arguments__=c;let $=Z0.default(F.start);const k={$node:D.$node,meshPath:null,fragmentPath:P,fragmentBoundaries:F,argv:D.argv,scope:m,xmlns:q,useAttributes:!0},R=H.__meshwire__(k,S),_=R.renderer.mesh(f,m);return $=$.add(_),S&&Object.entries(S).forEach(([L,g])=>{let I=!1;if(new RegExp(`^${$0}`).test(L))I=!0,L=L.replace($0,"");if(Y0.test(L)){if(!H.__isReactive__(L,m))return;const x=H.__extractExpressionDeps__(L,m),a=(n)=>{const p={};let s=[];if(H.__evaluateSpreadAttr__(L,{memo:n,get keystore(){return A[L]},set keystore(o){if(!A[L])A[L]=[];A[L]=o},each:(o,Q0)=>{if(V.map.afterSpreadAttrs.includes(o))return;if(P0(Q0,n[o]?.value))return;p[o]={value:Q0,type:"arg"},c[o]=Q0,s.push(o)},nullify:(o)=>{o.forEach((Q0)=>{p[Q0]={value:void 0,type:"arg"},delete c[Q0]}),s=o}}),s.length)H.__updateArgumentsDepNodes__(P,c),R.renderer.update(s,p,n)};x.forEach((n)=>H.__trackDep__(B,n,{...m,...f},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"spread-attr",$fragment:null,boundaries:F,update:a,syntax:I}))}else if(H.__isReactive__(g,m)){const x=H.__extractExpressionDeps__(g,m),a=(n)=>{if(V.map.beforeSpreadAttrs.includes(L))return;const p=g?H.__evaluate__(g,n):!0;c[L]=p,H.__updateArgumentsDepNodes__(P,c),R.renderer.update([L],{[L]:{value:p,type:"arg"}},n)};x.forEach((n)=>H.__trackDep__(B,n,{...m,...f},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"attr",$fragment:null,boundaries:F,update:a,syntax:I}))}}),$=$.add(F.end),H.metrics.inc("elementCount"),$}function u(w){if(!w.length||!w.prop("tagName"))return w;const O=w.is("svg")||q,D=O?Z0.default(document.createElementNS("http://www.w3.org/2000/svg",w.prop("tagName").toLowerCase())):Z0.default(`<${w.prop("tagName").toLowerCase()}/>`),P=w.contents(),F=j("element"),V=M();P.length&&D.append(H.__withPath__(F,()=>H.render(F+A5,P,V,B,O).$log));const{attrs:S,events:m}=H.__getAttributes__(w);S.literals&&Object.entries(S.literals).forEach(([f,A])=>{if(f===T0)return;const $=w.is(`[${T0}]`)&&["title","placeholder"].includes(f);D.attr(f,$?H.lips.i18n.translate(A).text:A);const k=(R)=>{D.attr(f,$?H.lips.i18n.translate(A).text:A),$&&H.__trackTranslationDep__(R,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"attr",$fragment:D,update:k})};$&&H.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"attr",$fragment:D,update:k})});const c=(f,A=!1)=>{f&&Object.entries(f).forEach(([$,k])=>{switch($){case"@html":{const R=(_)=>{D.html(H.__evaluate__(k,_))};if(R(V),A&&H.__isReactive__(k,V))H.__extractExpressionDeps__(k,V).forEach((L)=>H.__trackDep__(B,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:R}))}break;case"@text":{const R=w.is(`[${T0}]`),_=(L)=>{D.text(H.__evaluate__(k,L,{translate:R})),R&&H.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_})};if(_(V),A&&H.__isReactive__(k,V))H.__extractExpressionDeps__(k,V).forEach((g)=>H.__trackDep__(B,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_}));R&&H.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:_})}break;case"@format":{const[R,_]=k.split(",").map((g)=>g.trim());if(!R)throw new Error("Invalid @format reference");if(!_)throw new Error("Invalid @format parameters");const L=(g)=>{const I=H.__evaluate__(`!${_.trim()}`,g);if(typeof I!=="object")throw new Error("Invalid @format parameters");const x=H.lips.i18n.format(R,I);x!==void 0&&D.text(x),H.__trackTranslationDep__(g,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:L})};L(V),H.__extractExpressionDeps__(_,V).forEach((g)=>H.__trackDep__(B,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:D,update:L}))}break;case"style":if(A&&H.__isReactive__(k,V)){const R=(L)=>{const g=H.__evaluate__(k,L);if(typeof g==="object"){let I="";Object.entries(g).forEach(([x,a])=>I+=`${x}:${a};`),I.length&&D.attr("style",I)}else D.attr("style",g)};R(V),H.__extractExpressionDeps__(k,V).forEach((L)=>H.__trackDep__(B,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:R}))}else D.attr("style",k);break;default:{const R=w.is(`[${T0}]`)&&["title","placeholder"].includes($),_=(L)=>{const g=k&&H.__isReactive__(k,V)?H.__evaluate__(k,L,{translate:R}):k!==void 0?k:!0;if(g===void 0||g===!1)D.removeAttr($);else D.attr($,g),R&&H.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_})};if(_(V),A&&H.__isReactive__(k,V))H.__extractExpressionDeps__(k,V).forEach((g)=>H.__trackDep__(B,g,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_}));R&&H.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:D,update:_})}}})};return S.expressions&&Object.keys(S.expressions).forEach((f)=>{if(!Y0.test(f))return;let A=[];const $=(k,R,_=!1)=>{const L={};H.__evaluateSpreadAttr__(f,{memo:k,get keystore(){return A},set keystore(g){A=g},each:(g,I)=>{if(!_&&S.map.afterSpreadAttrs.includes(g))return;L[g]=I},nullify:(g)=>g.forEach((I)=>D.removeAttr(I))}),Object.keys(L).length&&c(L)};if(delete S.expressions[f],$(V,"",!0),f&&H.__isReactive__(f,V))H.__extractExpressionDeps__(f,V).forEach((R)=>H.__trackDep__(B,R,V,{nodetype:"element",nodepath:F,deppath:`${F}.${f}`,target:"spread-attr",$fragment:D,update:$}))}),c(S.expressions,!0),m&&Object.entries(m).forEach(([f,A])=>{Y.push({nodepath:F,element:D,_event:f,instruction:A,scope:V,get __dependencies__(){return B}})}),H.metrics.inc("elementCount"),H.metrics.inc("domInsertsCount"),D}function v(w){const O=w.text(),D=M(),P=j("element"),F=w.parent().is(`[${T0}]`),V=Z0.default(document.createTextNode(H.__interpolate__(O,D,F))),S=(m)=>{const c=H.__interpolate__(O,m,F);if(!V[0])return;V[0].textContent=c,F&&H.__trackTranslationDep__(m,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S})};if(O&&H.__isReactive__(O,D))H.__extractTextDeps__(O,D).forEach((c)=>H.__trackDep__(B,c,D,{nodetype:"text",nodepath:P,deppath:`${P}.${c}`,target:"value",$fragment:V,update:S}));return F&&H.__trackTranslationDep__(D,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S}),H.metrics.inc("elementCount"),H.metrics.inc("domInsertsCount"),V}function T(w){if(w.get(0)?.nodeType===Node.COMMENT_NODE)return w;if(w.get(0)?.nodeType===Node.TEXT_NODE)return v(w);if(w.is("let"))return H0(w);else if(w.is("const"))return t(w);else if(w.is("lips")&&w.attr(":dtag"))return e(w);else if(w.is("log"))return r(w);else if(H.__macros.has(w.prop("tagName")?.toLowerCase()))return h(w);else if(w.is("if, for, switch, async")||H.lips.has(w.prop("tagName")?.toLowerCase()))return d(w);else if(w.is("else-if, else"))return;return u(w)}try{this.__renderDepth__++,Z=!Z&&Z0.default(this.__template__).length>1?Z0.default("<template>").html(this.__template__).contents():Z||Z0.default(this.__template__),Z.each(function(){const w=T(Z0.default(this));if(w)G=G.add(w)}),Y.forEach(this.__attachEvent__.bind(this)),H.metrics.inc("renderCount")}catch(w){console.error("Rendering Failed --",w),H.metrics.trackError(w)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:G,dependencies:B,events:Y}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Z0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const W=this,{$node:X,meshPath:q,fragmentPath:H,fragmentBoundaries:B,argv:Y,xmlns:G,declaration:M,useAttributes:j}=J;let N,b=[];const i=[],e=H+j1,r=(d,h,u,v)=>{const T=`${e}${v!==void 0?`[${v}]`:""}`,{$log:w,dependencies:O,events:D}=W.__withPath__(T,()=>{return W.render(T,d,{...h,...u},void 0,G)});if(i.push(T),O?.forEach((P,F)=>{if(!W.FGUD?.has(F))W.FGUD.set(F,new Map);P.forEach((V,S)=>{if(V.garbage)return;V.partial?.length?V.partial.push(T):V.partial=[T],W.FGUD.get(F)?.set(S,V)})}),W.metrics.inc("partialCount"),v!==void 0){const P=W.__getBoundaries__(T);b[v]={argvalues:u,boundaries:P};let F=Z0.default(P.start);return F=F.add(w),F=F.add(P.end),F}return w},H0=(d,h,u,v)=>{W.metrics.startRender();const T=v!==void 0?i.filter((w)=>w.endsWith(`${j1}[${v}]`)):i;if(d.forEach((w)=>{const O=W.FGUD.get(w);if(!O)return;O.forEach((D)=>{const P=T.find((S)=>{return D.partial?.find((m)=>S==m||W.__hasSamePathParent__(m,S))});if(!D.partial||!P)return;const F=D.deppath||D.nodepath,V=this.FGUDMemory.get(D.nodepath);if(D.garbage||B?.start&&!document.contains(B.start)){O.delete(F),W.__unbindMemo__(D);return}if(!V){console.warn(`unexpected occurence: <${F}> has no memo`);return}if(V.memo?.[w]&&u?.[w]&&!P0(V.memo[w],u[w]))V.memo={...h,...V.memo,...u};W.UQS.queue({dep:w,deppath:F,priority:D.priority}),W.metrics.inc("dependencyUpdateCount")}),!O.size&&W.FGUD.delete(w)}),v!==void 0&&b[v])b[v].argvalues=u;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},t=(d)=>{if(!b[d])return;const h=b[d].boundaries;if(b.splice(d,1),!document.contains(h.start)||!document.contains(h.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const u=[];let v=h.start.nextSibling;while(v&&v!==h.end)u.push(v),v=v.nextSibling;Z0.default(u).remove(),h.start.remove(),h.end.remove()},J0={renderer:{path:q,argv:Y,mesh(d,h){if(N=X.contents(),!N?.length)return null;if(h=h||J.scope,M?.iterator){const u=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!u.length)return null;let v=Z0.default();return u.forEach((T,w)=>{if(!N?.length)return null;v=v.add(r(N,h,T,w))}),v}else return r(N,h,d)},update(d,h,u,v){if(!i.length)return;if(u=u||J.scope,v=v||B,M?.iterator){const T=h?.["#"].value;if(!Array.isArray(T))return;if(Array.isArray(b)){if(b.length===T.length){for(let O=0;O<T.length;O++)!P0(b[O].argvalues,T[O])&&H0(Object.keys(T[O]),u,T[O],O);return}const w=Math.min(b.length,T.length);for(let O=0;O<w;O++)H0(Object.keys(T[O]),u,T[O],O);if(T.length>b.length){if(!N?.length)return;for(let O=b.length;O<T.length;O++){const D=r(N,u,T[O],O);Z0.default(v.end).before(D)}}else if(T.length<b.length)for(let O=b.length-1;O>=T.length;O--)t(O)}}else H0(d,u,h)},fill(d,h){console.log("fill",h||B),W.__fillBoundaries__(d,h||B)},cleanup(d){console.log("cleanup"),W.FGUD.forEach((h,u)=>{h.forEach((v,T)=>{if(!W.__hasSamePathParent__(T,e))return;W.__unbindMemo__(v),v.garbage=!0}),!h.size&&W.FGUD.delete(u)}),W.__emptyBoundaries__(d||B)}}};if(j&&q){const{attrs:d}=W.__getAttributes__(X);d.literals&&Object.entries(d.literals).forEach(([h,u])=>J0[h]=u),d.expressions&&Object.entries(d.expressions).forEach(([h,u])=>{if(Y0.test(h)){let v=[];W.__evaluateSpreadAttr__(h,{memo:J.scope,get keystore(){return v},set keystore(T){v=T},each:(T,w)=>J0[T]=w}),Z[`${M?.syntax?$0:""}${q}.${h}`]=u}else J0[h]=u?W.__evaluate__(u,J.scope):!0,Z[`${M?.syntax?$0:""}${q}.${h}`]=u})}return J0}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let W=J.start.nextSibling;while(W&&W!==J.end)Z.push(W),W=W.nextSibling;Z0.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Z0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),W={},X={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},H=Object.keys(Z).find((G)=>Y0.test(G));let B=[],Y=!1;return Z&&Object.entries(Z).forEach(([G,M])=>{if(G==":dtag")return;if(G.startsWith(":")||G.startsWith(D0)||G.startsWith(S0)||Y0.test(G)||K1.test(G))if(K1.test(G)){const[j,N]=G.match(K1)||[];B=N.split(",")}else if(G.startsWith(S0))W[G.replace(S0,"")]=M;else if(G.startsWith(D0))X[G.replace(D0,"")]=M;else{if(G.startsWith(":"))G=G.slice(1,G.length);if(H)if(Y0.test(G))q.map.spreadAttrs.push(G),Y=!0;else q.map.explicitAttrs.push(G),!Y?q.map.beforeSpreadAttrs.push(G):q.map.afterSpreadAttrs.push(G);q.expressions[G]=M||""}else if(q.literals[G]=M,H)q.map.explicitAttrs.push(G),!Y?q.map.beforeSpreadAttrs.push(G):q.map.afterSpreadAttrs.push(G)}),{argv:B,events:W,functions:X,attrs:q}}__withPath__(J,Z){const W=this.__inpath__;this.__inpath__=J;const X=Z();return this.__inpath__=W,X}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+j1}`)}__evaluate__(J,Z,W){J=typeof J==="string"?J.trim():J;try{const X=(q)=>{const H=this.state.toJSON(),B=(G,...M)=>{try{return G(...M)}catch(j){!W?.mute&&console.error("Eval error --",j);return}};let Y=`return ${q};`;if(Z){let G={},M;for(let N in Z){if(N==="__arguments__")continue;G[N]=Z[N].value}if(typeof Z.__arguments__==="object")M=Z.__arguments__;Y=`with( scope ){ ${Y} }`;const j=new Function("self","input","state","static","context","scope","arguments",Y);return B(j,this,this.input,H,this.static,this.context,G||{},M)}else{const G=new Function("self","input","state","static","context",Y);return B(G,this,this.input,H,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return X(J.slice(1));return J.replace(k1,(q,H)=>X(H))}return X(J)}catch(X){!W?.mute&&console.error("Expression evaluation error --",X);return}}__evaluateFunction__(J,Z,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Z);else{let[X,...q]=J.split(/\s*,\s*/),H;const B=this.__evaluate__(X,W,{mute:!0});if(typeof B==="function")H=B;else{if(typeof this[X]!=="function")throw new Error(`Undefined <${X}> handler method`);H=this[X].bind(this)}if(typeof H!=="function")throw new Error(`Expected <${X}> to be a function or handler method`);let Y=q.map((G)=>this.__evaluate__(G,W));if(Z.length)Y=[...Y,...Z];return H(...Y)}}__evaluateSpreadAttr__(J,Z){const W=this.__evaluate__(J.replace(Y0,""),Z.memo);if(!W){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof W!=="object"||Array.isArray(W))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(W)||[],typeof Z.each==="function")for(let X in W)Z.each(X,W[X])}__interpolate__(J,Z,W){if(J=J.replace(k1,(X,q)=>this.__evaluate__(q,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:W,_event:X,instruction:q,scope:H,__dependencies__:B}=J;let Y=H;if(Z.on(X,(...G)=>this.__evaluateFunction__(q,G,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,H))this.__extractExpressionDeps__(q,H).forEach((M)=>this.__trackDep__(B,M,H||{},{nodetype:"event",nodepath:W,deppath:`${W}.${X}`,target:"event-handler",$fragment:!(Z instanceof x0)?Z:null,boundaries:Z instanceof x0?Z.__boundaries__:void 0,update:(j)=>{Y=j}}))}__detachEvent__({element:J,nodepath:Z,_event:W,instruction:X,scope:q,__dependencies__:H}){if(J.off(W),this.__isReactive__(X,q)){const B=this.__extractExpressionDeps__(X,q),Y=`${Z}.${W}`;B.forEach((G)=>{H.get(G)?.delete(Y),this.FGUD.get(G)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const H=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(H,Z).forEach((Y)=>W.add(Y))}),Array.from(W)}__extractExpressionDeps__(J,Z){const W=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,X=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let H=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(X)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const B=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");H=[...H,...Array.from(J.matchAll(B)),...Array.from(J.matchAll(Y))]}return[...new Set(H.map((B)=>B[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const W=Z.deppath||Z.nodepath,X=this.FGUDMemory.get(Z.nodepath);if(X)X.tracks.set(W,Z.priority||2),X.memo=J,this.FGUDMemory.set(Z.nodepath,X);else{const q=new Map;q.set(W,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,W=this.FGUDMemory.get(J.nodepath);if(!W||!W.tracks.get(Z))return;W.tracks.delete(Z),!W.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,W,X){if(W&&W[Z]&&W[Z].type==="let")X.haslet=!0;if(X.priority===void 0)if(X.target==="attr"&&Z.split(".").find((H)=>T5.includes(H)))X.priority=0;else if(X.syntax)X.priority=1;else if(["event"].includes(X.nodetype))X.priority=3;else X.priority=2;const q=X.deppath||X.nodepath;X.level=q.split(/\//g).length,X.priority=X.level*g5+X.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,X),this.__bindMemo__(W,X),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((W,X)=>W?.[X],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const W={state:this.state,input:this.input,context:this.context},X=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(W[J],Z);return!P0(X,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[W,...X]=Z.split(".");if(!this.__shouldUpdate__(W,X))return;J.forEach((q)=>{try{const H=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(H),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:H,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(H){console.error("failed to update dependency nodes --",H);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((X,q)=>{if(!X.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const H=X.deppath||X.nodepath,B=this.FGUDMemory.get(X.nodepath);if(!B){console.warn(`unexpected occurence: <${H}> has no memo`);return}B.memo={...B.memo,...W},this.UQS.queue({dep:J,deppath:H,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const W="arguments";this.FGUD.get(W)?.forEach((X,q)=>{if(!this.__hasSamePathParent__(q,J))return;const H=X.deppath||X.nodepath,B=this.FGUDMemory.get(X.nodepath);if(!B){console.warn(`unexpected occurence: <${H}> has no memo`);return}B.memo.__arguments__=Z,this.UQS.queue({dep:W,deppath:H,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const W=this.FGUDMemory.get(J.nodepath);if(!W){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(W.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Z0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Z0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Z0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var h1={};d0(h1,{handler:()=>{{return E8}},declaration:()=>{{return $8}},_static:()=>{{return R8}}});var $8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},R8={initialized:!1,prevRenderer:null},E8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const X=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!X?.length)return;if(W)return X;J.renderer.fill(X)}else{this.static.prevRenderer?.cleanup();let X=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let H of J["else-if"]){if(!H.by)continue;if(q=H.renderer.mesh({},Z),this.static.prevRenderer=H.renderer,!q?.length)return;if(W)return q;q?.length&&H.renderer.fill(q),X=!0;break}if(!X&&J.else){const H=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!H?.length)return;if(W)return H;J.else.renderer.fill(H)}}}};var f1={};d0(f1,{state:()=>{{return A8}},handler:()=>{{return b8}},default:()=>{{return x8}},declaration:()=>{{return T8}},_static:()=>{{return S8}}});var T8={name:"for",syntax:!0,iterator:!0},A8={argvlist:null},S8={lastIn:null,processingBatch:!1},b8={onInput(){this.processor(this.input)},processor(J){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:W,to:X}=J;if(Z===void 0&&W===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(W!==void 0){if(W=parseFloat(String(W)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const q=W<X,H=Math.abs(X-W)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===H){const[Y]=J.renderer.argv;if(Y){let G=W,M=!0;for(let j=0;j<this.state.argvlist.length;j++){if(this.state.argvlist[j][Y].value!==G){M=!1;break}G=q?G+1:G-1}if(M)return;G=W;for(let j=0;j<this.state.argvlist.length;j++)this.state.argvlist[j][Y].value=G,G=q?G+1:G-1;return}}const B=[];for(let Y=W;q?Y<=X:Y>=X;q?Y++:Y--){const G={},[M]=J.renderer.argv;if(M)G[M]={value:Y,type:"arg"};B.push(G)}this.state.argvlist=B}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[B,Y]=J.renderer.argv;for(let G=0;G<Z.length;G++){const M=this.state.argvlist[G];if(B)M[B].value=Z[G]}return}const q=[];let H=0;for(let B of Z){const Y={},[G,M]=J.renderer.argv;if(G)Y[G]={value:B,type:"arg"};if(M)Y[M]={value:H,type:"arg"};q.push(Y),H++}this.state.argvlist=q}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[B,Y,G]=J.renderer.argv;let M=0;for(let[j,N]of Z){const b=this.state.argvlist[M];if(B)b[B].value=j;if(Y)b[Y].value=N;M++}return}const q=[];let H=0;for(let[B,Y]of Z){const G={},[M,j,N]=J.renderer.argv;if(M)G[M]={value:B,type:"arg"};if(j)G[j]={value:Y,type:"arg"};if(N)G[N]={value:H,type:"arg"};q.push(G),H++}this.state.argvlist=q}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=Z;const q=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[Y,G,M]=J.renderer.argv;for(let j=0;j<q.length;j++){const N=q[j],b=this.state.argvlist[j];if(Y)b[Y].value=N;if(G)b[G].value=Z[N]}return}const H=[];let B=0;for(let Y in Z){const G={},[M,j,N]=J.renderer.argv;if(M)G[M]={value:Y,type:"arg"};if(j)G[j]={value:Z[Y],type:"arg"};if(N)G[N]={value:B,type:"arg"};H.push(G),B++}this.state.argvlist=H}}finally{this.static.processingBatch=!1}}},x8="<{input.renderer} #=state.argvlist/>";var y1={};d0(y1,{state:()=>{{return k8}},handler:()=>{{return _8}},default:()=>{{return h8}},declaration:()=>{{return g8}}});var g8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k8={renderer:null,props:{}},_8={onInput(){this.processor(this.input)},processor(J){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(J.loading)this.state.renderer=J.loading.renderer,this.state.props={};J.await.then((Z)=>{if(!J.then)return;this.state.renderer=J.then.renderer;const[W]=J.then.renderer.argv;this.state.props={[W]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!J.catch)return;this.state.renderer=J.catch.renderer;const[W]=J.then.renderer.argv;this.state.props={[W]:{value:Z,type:"arg"}}})}},h8="<{state.renderer} #=state.props/>";var v1={};d0(v1,{handler:()=>{{return v8}},declaration:()=>{{return f8}},_static:()=>{{return y8}}});var f8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},y8={initialized:!1,prevRenderer:null},v8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){let X=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?X=[...new Set([...X,...q.is])]:X.push(q.is);const H=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!H?.length)return;if(W)return H;q.renderer.fill(H)}if(X.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(W)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var u1={};d0(u1,{state:()=>{{return u8}},handler:()=>{{return c8}},default:()=>{{return p8}},context:()=>{{return d8}},_static:()=>{{return m8}}});var i8=function(J){const Z={};return J.split("&").map((X)=>{const[q,H]=X.split("=");Z[q]=H}),Z},u8={page:null,params:{},query:{}},m8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},d8=["navigate"],c8={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:W,default:X})=>{if(X)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],H=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:W,default:X,pathVars:q,pathRegex:new RegExp(`${H}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const X=W[1]?i8(W[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:X}});const H=this.match(J);if(!H){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:B,params:Y}=H;this.emit("after",{fromState:q,toState:{path:B.path,params:Y,query:X}}),this.static.currentPath=J,this.static.currentRoute=B,this.state.params=Y,this.state.query=X,this.state.page=B.template},match(J){const Z={};let W=!1;for(let X of this.static.routes){const{pathVars:q,pathRegex:H}=X,B=J.match(H);if(B!==null&&B.index===0){for(let Y=0;Y+1<B.length&&Y<q.length;Y++)Z[q[Y].replaceAll(/[\/:]/g,"")]=B[Y+1];W=X;break}}return W?{route:W,params:Z}:!1}},p8="<{state.page} params=state.params query=state.query/>";class m0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new e0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new a0,this.IUC=new n0;const[Z,W]=b0(this.i18n.lang),[X,q]=b0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=X,this.register("if",h1),this.register("for",f1),this.register("async",y1),this.register("switch",v1),this.register("router",u1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,W){const{default:X,...q}=Z,H={debug:this.debug,prepath:"0",lips:this},B=new x0(J,X||"",{...q,input:W},H);return window.addEventListener("beforeunload",()=>{return this.dispose(),B.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),B}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new u0("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const W=this.__getContext();if(typeof J==="string"){const X={...W,[J]:Z};B0(W,X)&&this.__setContext(X)}else if(!Array.isArray(J)){const X={...W,...J};B0(W,X)&&this.__setContext(X)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;p0(()=>{const W=this.__getContext();if(!W)return;const X=Object.fromEntries(J.map((q)=>[q,W[q]]));X&&typeof Z==="function"&&Object.keys(X).length&&Z(X)})}useTranslator(J,Z){p0(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Z==="function"&&Z(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}function s8(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},X={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const G=performance.now();if(this.static.lastFrameTimestamp){const M=G-this.static.lastFrameTimestamp;if(M<1000){if(this.static.updateTimes.push(M),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=G,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const G=this.static.updateTimes.reduce((M,j)=>M+j,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=G}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(G){const M=parseFloat(G.target.value);if(this.state.updateFrequency=M,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const G=performance.now();let M=0;for(let j=0;j<1e7;j++)M+=Math.sqrt(j);console.log(`Heavy computation completed in ${performance.now()-G}ms, result: ${M}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},Y=new m0({debug:!0}).render("StressTestApp",{default:`
1
+ var K8=Object.create;var{defineProperty:x1,getPrototypeOf:I8,getOwnPropertyNames:O8}=Object;var D8=Object.prototype.hasOwnProperty;var e0=(J,Z,W)=>{W=J!=null?K8(I8(J)):{};const H=Z||!J||!J.__esModule?x1(W,"default",{value:J,enumerable:!0}):W;for(let q of O8(J))if(!D8.call(H,q))x1(H,q,{get:()=>J[q],enumerable:!0});return H};var j8=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var c0=(J,Z)=>{for(var W in Z)x1(J,W,{get:Z[W],enumerable:!0,configurable:!0,set:(H)=>Z[W]=()=>H})};var p0=j8((q5,z5)=>{(function(){var J=document,Z=window,W=J.documentElement,H=J.createElement.bind(J),q=H("div"),X=H("table"),G=H("tbody"),U=H("tr"),Y=Array.isArray,B=Array.prototype,O=B.concat,K=B.filter,S=B.indexOf,m=B.map,e=B.push,t=B.slice,H0=B.some,r=B.splice,d=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,v=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,c=/<.+>/,p=/^\w+$/;function J0(Q,z){var w=P(z);return!Q||!w&&!L(z)&&!A(z)?[]:!w&&v.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!w&&p.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var u=function(){function Q(z,w){if(!z)return;if(D(z))return z;var I=z;if(x(z)){var V=w||J;if(I=d.test(z)&&L(V)?V.getElementById(z.slice(1).replace(/\\/g,"")):c.test(z)?s1(z):D(V)?V.find(z):x(V)?j(V).find(z):J0(z,V),!I)return}else if(g(z))return this.ready(z);if(I.nodeType||I===Z)I=[I];this.length=I.length;for(var E=0,f=this.length;E<f;E++)this[E]=I[E]}return Q.prototype.init=function(z,w){return new Q(z,w)},Q}(),M=u.prototype,j=M.init;if(j.fn=j.prototype=M,M.length=0,M.splice=r,typeof Symbol==="function")M[Symbol.iterator]=B[Symbol.iterator];function D(Q){return Q instanceof u}function C(Q){return!!Q&&Q===Q.window}function L(Q){return!!Q&&Q.nodeType===9}function P(Q){return!!Q&&Q.nodeType===11}function A(Q){return!!Q&&Q.nodeType===1}function y(Q){return!!Q&&Q.nodeType===3}function l(Q){return typeof Q==="boolean"}function g(Q){return typeof Q==="function"}function x(Q){return typeof Q==="string"}function N(Q){return Q===void 0}function _(Q){return Q===null}function R(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function k(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}j.isWindow=C,j.isFunction=g,j.isArray=Y,j.isNumeric=R,j.isPlainObject=k;function F(Q,z,w){if(w){var I=Q.length;while(I--)if(z.call(Q[I],I,Q[I])===!1)return Q}else if(k(Q)){var V=Object.keys(Q);for(var I=0,E=V.length;I<E;I++){var f=V[I];if(z.call(Q[f],f,Q[f])===!1)return Q}}else for(var I=0,E=Q.length;I<E;I++)if(z.call(Q[I],I,Q[I])===!1)return Q;return Q}j.each=F,M.each=function(Q){return F(this,Q)},M.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function T(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var w=l(Q[0])?Q.shift():!1,I=Q.shift(),V=Q.length;if(!I)return{};if(!V)return T(w,j,I);for(var E=0;E<V;E++){var f=Q[E];for(var s in f)if(w&&(Y(f[s])||k(f[s]))){if(!I[s]||I[s].constructor!==f[s].constructor)I[s]=new f[s].constructor;T(w,I[s],f[s])}else I[s]=f[s]}return I}j.extend=T,M.extend=function(Q){return T(M,Q)};var h=/\S+/g;function $(Q){return x(Q)?Q.match(h)||[]:[]}M.toggleClass=function(Q,z){var w=$(Q),I=!N(z);return this.each(function(V,E){if(!A(E))return;F(w,function(f,s){if(I)z?E.classList.add(s):E.classList.remove(s);else E.classList.toggle(s)})})},M.addClass=function(Q){return this.toggleClass(Q,!0)},M.removeAttr=function(Q){var z=$(Q);return this.each(function(w,I){if(!A(I))return;F(z,function(V,E){I.removeAttribute(E)})})};function b(Q,z){if(!Q)return;if(x(Q)){if(arguments.length<2){if(!this[0]||!A(this[0]))return;var w=this[0].getAttribute(Q);return _(w)?void 0:w}if(N(z))return this;if(_(z))return this.removeAttr(Q);return this.each(function(V,E){if(!A(E))return;E.setAttribute(Q,z)})}for(var I in Q)this.attr(I,Q[I]);return this}M.attr=b,M.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},M.hasClass=function(Q){return!!Q&&H0.call(this,function(z){return A(z)&&z.classList.contains(Q)})},M.get=function(Q){if(N(Q))return t.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},M.eq=function(Q){return j(this.get(Q))},M.first=function(){return this.eq(0)},M.last=function(){return this.eq(-1)};function o(Q){if(N(Q))return this.get().map(function(z){return A(z)||y(z)?z.textContent:""}).join("");return this.each(function(z,w){if(!A(w))return;w.textContent=Q})}M.text=o;function i(Q,z,w){if(!A(Q))return;var I=Z.getComputedStyle(Q,null);return w?I.getPropertyValue(z)||void 0:I[z]||Q.style[z]}function n(Q,z){return parseInt(i(Q,z),10)||0}function Z0(Q,z){return n(Q,"border".concat(z?"Left":"Top","Width"))+n(Q,"padding".concat(z?"Left":"Top"))+n(Q,"padding".concat(z?"Right":"Bottom"))+n(Q,"border".concat(z?"Right":"Bottom","Width"))}var a={};function B0(Q){if(a[Q])return a[Q];var z=H(Q);J.body.insertBefore(z,null);var w=i(z,"display");return J.body.removeChild(z),a[Q]=w!=="none"?w:"block"}function D0(Q){return i(Q,"display")==="none"}function h0(Q,z){var w=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!w&&!!z&&w.call(Q,z)}function n0(Q){return x(Q)?function(z,w){return h0(w,Q)}:g(Q)?Q:D(Q)?function(z,w){return Q.is(w)}:!Q?function(){return!1}:function(z,w){return w===Q}}M.filter=function(Q){var z=n0(Q);return j(K.call(this,function(w,I){return z.call(w,I,w)}))};function A0(Q,z){return!z?Q:Q.filter(z)}M.detach=function(Q){return A0(this,Q).each(function(z,w){if(w.parentNode)w.parentNode.removeChild(w)}),this};var m5=/^\s*<(\w+)[^>]*>/,d5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p1={"*":q,tr:G,td:U,th:U,thead:X,tbody:X,tfoot:X};function s1(Q){if(!x(Q))return[];if(d5.test(Q))return[H(RegExp.$1)];var z=m5.test(Q)&&RegExp.$1,w=p1[z]||p1["*"];return w.innerHTML=Q,j(w.childNodes).detach().get()}j.parseHTML=s1,M.has=function(Q){var z=x(Q)?function(w,I){return J0(Q,I).length}:function(w,I){return I.contains(Q)};return this.filter(z)},M.not=function(Q){var z=n0(Q);return this.filter(function(w,I){return(!x(Q)||A(I))&&!z.call(I,w,I)})};function C0(Q,z,w,I){var V=[],E=g(z),f=I&&n0(I);for(var s=0,j0=Q.length;s<j0;s++)if(E){var q0=z(Q[s]);if(q0.length)e.apply(V,q0)}else{var U0=Q[s][z];while(U0!=null){if(I&&f(-1,U0))break;V.push(U0),U0=w?U0[z]:null}}return V}function l1(Q){if(Q.multiple&&Q.options)return C0(K.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function i5(Q){if(!arguments.length)return this[0]&&l1(this[0]);return this.each(function(z,w){var I=w.multiple&&w.options;if(I||X5.test(w.type)){var V=Y(Q)?m.call(Q,String):_(Q)?[]:[String(Q)];if(I)F(w.options,function(E,f){f.selected=V.indexOf(f.value)>=0},!0);else w.checked=V.indexOf(w.value)>=0}else w.value=N(Q)||_(Q)?"":Q})}M.val=i5,M.is=function(Q){var z=n0(Q);return H0.call(this,function(w,I){return z.call(w,I,w)})},j.guid=1;function V0(Q){return Q.length>1?K.call(Q,function(z,w,I){return S.call(I,z)===w}):Q}j.unique=V0,M.add=function(Q,z){return j(V0(this.get().concat(j(Q,z).get())))},M.children=function(Q){return A0(j(V0(C0(this,function(z){return z.children}))),Q)},M.parent=function(Q){return A0(j(V0(C0(this,"parentNode"))),Q)},M.index=function(Q){var z=Q?j(Q)[0]:this[0],w=Q?this:j(z).parent().children();return S.call(w,z)},M.closest=function(Q){var z=this.filter(Q);if(z.length)return z;var w=this.parent();if(!w.length)return z;return w.closest(Q)},M.siblings=function(Q){return A0(j(V0(C0(this,function(z){return j(z).parent().children().not(z)}))),Q)},M.find=function(Q){return j(V0(C0(this,function(z){return J0(Q,z)})))};var c5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,p5=/^$|^module$|\/(java|ecma)script/i,s5=["type","src","nonce","noModule"];function l5(Q,z){var w=j(Q);w.filter("script").add(w.find("script")).each(function(I,V){if(p5.test(V.type)&&W.contains(V)){var E=H("script");E.text=V.textContent.replace(c5,""),F(s5,function(f,s){if(V[s])E[s]=V[s]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function o5(Q,z,w,I,V){if(I)Q.insertBefore(z,w?Q.firstChild:null);else if(Q.nodeName==="HTML")Q.parentNode.replaceChild(z,Q);else Q.parentNode.insertBefore(z,w?Q:Q.nextSibling);if(V)l5(z,Q.ownerDocument)}function $0(Q,z,w,I,V,E,f,s){return F(Q,function(j0,q0){F(j(q0),function(U0,b0){F(j(z),function(F0,t0){var $1=w?b0:t0,S1=w?t0:b0,M0=w?U0:F0;o5($1,!M0?S1:S1.cloneNode(!0),I,V,!M0)},s)},f)},E),z}M.after=function(){return $0(arguments,this,!1,!1,!1,!0,!0)},M.append=function(){return $0(arguments,this,!1,!1,!0)};function r5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if(N(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(w,I){if(!A(I))return;if(z)j(I).empty().append(Q);else I.innerHTML=Q})}M.html=r5,M.appendTo=function(Q){return $0(arguments,this,!0,!1,!0)},M.wrapInner=function(Q){return this.each(function(z,w){var I=j(w),V=I.contents();V.length?V.wrapAll(Q):I.append(Q)})},M.before=function(){return $0(arguments,this,!1,!0)},M.wrapAll=function(Q){var z=j(Q),w=z[0];while(w.children.length)w=w.firstElementChild;return this.first().before(z),this.appendTo(w)},M.wrap=function(Q){return this.each(function(z,w){var I=j(Q)[0];j(w).wrapAll(!z?I:I.cloneNode(!0))})},M.insertAfter=function(Q){return $0(arguments,this,!0,!1,!1,!1,!1,!0)},M.insertBefore=function(Q){return $0(arguments,this,!0,!0)},M.prepend=function(){return $0(arguments,this,!1,!0,!0,!0,!0)},M.prependTo=function(Q){return $0(arguments,this,!0,!0,!0,!1,!1,!0)},M.contents=function(){return j(V0(C0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},M.next=function(Q,z,w){return A0(j(V0(C0(this,"nextElementSibling",z,w))),Q)},M.nextAll=function(Q){return this.next(Q,!0)},M.nextUntil=function(Q,z){return this.next(z,!0,Q)},M.parents=function(Q,z){return A0(j(V0(C0(this,"parentElement",!0,z))),Q)},M.parentsUntil=function(Q,z){return this.parents(z,Q)},M.prev=function(Q,z,w){return A0(j(V0(C0(this,"previousElementSibling",z,w))),Q)},M.prevAll=function(Q){return this.prev(Q,!0)},M.prevUntil=function(Q,z){return this.prev(z,!0,Q)},M.map=function(Q){return j(O.apply([],m.call(this,function(z,w){return Q.call(z,w,z)})))},M.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},M.offsetParent=function(){return this.map(function(Q,z){var w=z.offsetParent;while(w&&i(w,"position")==="static")w=w.offsetParent;return w||W})},M.slice=function(Q,z){return j(t.call(this,Q,z))};var n5=/-([a-z])/g;function N1(Q){return Q.replace(n5,function(z,w){return w.toUpperCase()})}M.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},M.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var w=j(z);w.replaceWith(w.children())}),this},M.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},M.position=function(){var Q=this[0];if(!Q)return;var z=i(Q,"position")==="fixed",w=z?Q.getBoundingClientRect():this.offset();if(!z){var I=Q.ownerDocument,V=Q.offsetParent||I.documentElement;while((V===I.body||V===I.documentElement)&&i(V,"position")==="static")V=V.parentNode;if(V!==Q&&A(V)){var E=j(V).offset();w.top-=E.top+n(V,"borderTopWidth"),w.left-=E.left+n(V,"borderLeftWidth")}}return{top:w.top-n(Q,"marginTop"),left:w.left-n(Q,"marginLeft")}};var o1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};M.prop=function(Q,z){if(!Q)return;if(x(Q)){if(Q=o1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(I,V){V[Q]=z})}for(var w in Q)this.prop(w,Q[w]);return this},M.removeProp=function(Q){return this.each(function(z,w){delete w[o1[Q]||Q]})};var a5=/^--/;function C1(Q){return a5.test(Q)}var R1={},t5=q.style,e5=["webkit","moz","ms"];function J8(Q,z){if(z===void 0)z=C1(Q);if(z)return Q;if(!R1[Q]){var w=N1(Q),I="".concat(w[0].toUpperCase()).concat(w.slice(1)),V="".concat(w," ").concat(e5.join("".concat(I," "))).concat(I).split(" ");F(V,function(E,f){if(f in t5)return R1[Q]=f,!1})}return R1[Q]}var Z8={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function r1(Q,z,w){if(w===void 0)w=C1(Q);return!w&&!Z8[Q]&&R(z)?"".concat(z,"px"):z}function Q8(Q,z){if(x(Q)){var w=C1(Q);if(Q=J8(Q,w),arguments.length<2)return this[0]&&i(this[0],Q,w);if(!Q)return this;return z=r1(Q,z,w),this.each(function(V,E){if(!A(E))return;if(w)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var I in Q)this.css(I,Q[I]);return this}M.css=Q8;function n1(Q,z){try{return Q(z)}catch(w){return z}}var W8=/^\s+|\s+$/;function a1(Q,z){var w=Q.dataset[z]||Q.dataset[N1(z)];if(W8.test(w))return w;return n1(JSON.parse,w)}function X8(Q,z,w){w=n1(JSON.stringify,w),Q.dataset[N1(z)]=w}function H8(Q,z){if(!Q){if(!this[0])return;var w={};for(var I in this[0].dataset)w[I]=a1(this[0],I);return w}if(x(Q)){if(arguments.length<2)return this[0]&&a1(this[0],Q);if(N(z))return this;return this.each(function(V,E){X8(E,Q,z)})}for(var I in Q)this.data(I,Q[I]);return this}M.data=H8;function t1(Q,z){var w=Q.documentElement;return Math.max(Q.body["scroll".concat(z)],w["scroll".concat(z)],Q.body["offset".concat(z)],w["offset".concat(z)],w["client".concat(z)])}F([!0,!1],function(Q,z){F(["Width","Height"],function(w,I){var V="".concat(z?"outer":"inner").concat(I);M[V]=function(E){if(!this[0])return;if(C(this[0]))return z?this[0]["inner".concat(I)]:this[0].document.documentElement["client".concat(I)];if(L(this[0]))return t1(this[0],I);return this[0]["".concat(z?"offset":"client").concat(I)]+(E&&z?n(this[0],"margin".concat(w?"Top":"Left"))+n(this[0],"margin".concat(w?"Bottom":"Right")):0)}})}),F(["Width","Height"],function(Q,z){var w=z.toLowerCase();M[w]=function(I){if(!this[0])return N(I)?void 0:this;if(!arguments.length){if(C(this[0]))return this[0].document.documentElement["client".concat(z)];if(L(this[0]))return t1(this[0],z);return this[0].getBoundingClientRect()[w]-Z0(this[0],!Q)}var V=parseInt(I,10);return this.each(function(E,f){if(!A(f))return;var s=i(f,"boxSizing");f.style[w]=r1(w,V+(s==="border-box"?Z0(f,!Q):0))})}});var e1="___cd";M.toggle=function(Q){return this.each(function(z,w){if(!A(w))return;var I=D0(w),V=N(Q)?I:Q;if(V){if(w.style.display=w[e1]||"",D0(w))w.style.display=B0(w.tagName)}else if(!I)w[e1]=i(w,"display"),w.style.display="none"})},M.hide=function(){return this.toggle(!1)},M.show=function(){return this.toggle(!0)};var J5="___ce",P1=".",T1={focus:"focusin",blur:"focusout"},Z5={mouseenter:"mouseover",mouseleave:"mouseout"},q8=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function E1(Q){return Z5[Q]||T1[Q]||Q}function A1(Q){var z=Q.split(P1);return[z[0],z.slice(1).sort()]}M.trigger=function(Q,z){if(x(Q)){var w=A1(Q),I=w[0],V=w[1],E=E1(I);if(!E)return this;var f=q8.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(f),Q.initEvent(E,!0,!0),Q.namespace=V.join(P1),Q.___ot=I}Q.___td=z;var s=Q.___ot in T1;return this.each(function(j0,q0){if(s&&g(q0[Q.___ot]))q0["___i".concat(Q.type)]=!0,q0[Q.___ot](),q0["___i".concat(Q.type)]=!1;q0.dispatchEvent(Q)})};function Q5(Q){return Q[J5]=Q[J5]||{}}function z8(Q,z,w,I,V){var E=Q5(Q);E[z]=E[z]||[],E[z].push([w,I,V]),Q.addEventListener(z,V)}function W5(Q,z){return!z||!H0.call(z,function(w){return Q.indexOf(w)<0})}function a0(Q,z,w,I,V){var E=Q5(Q);if(!z)for(z in E)a0(Q,z,w,I,V);else if(E[z])E[z]=E[z].filter(function(f){var s=f[0],j0=f[1],q0=f[2];if(V&&q0.guid!==V.guid||!W5(s,w)||I&&I!==j0)return!0;Q.removeEventListener(z,q0)})}M.off=function(Q,z,w){var I=this;if(N(Q))this.each(function(E,f){if(!A(f)&&!L(f)&&!C(f))return;a0(f)});else if(!x(Q))for(var V in Q)this.off(V,Q[V]);else{if(g(z))w=z,z="";F($(Q),function(E,f){var s=A1(f),j0=s[0],q0=s[1],U0=E1(j0);I.each(function(b0,F0){if(!A(F0)&&!L(F0)&&!C(F0))return;a0(F0,U0,q0,z,w)})})}return this},M.remove=function(Q){return A0(this,Q).detach().off(),this},M.replaceWith=function(Q){return this.before(Q).remove()},M.replaceAll=function(Q){return j(Q).replaceWith(this),this};function G8(Q,z,w,I,V){var E=this;if(!x(Q)){for(var f in Q)this.on(f,z,w,Q[f],V);return this}if(!x(z))if(N(z)||_(z))z="";else if(N(w))w=z,z="";else I=w,w=z,z="";if(!g(I))I=w,w=void 0;if(!I)return this;return F($(Q),function(s,j0){var q0=A1(j0),U0=q0[0],b0=q0[1],F0=E1(U0),t0=U0 in Z5,$1=U0 in T1;if(!F0)return;E.each(function(S1,M0){if(!A(M0)&&!L(M0)&&!C(M0))return;var b1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!W5(b0,z0.namespace.split(P1)))return;if(!z&&($1&&(z0.target!==M0||z0.___ot===F0)||t0&&z0.relatedTarget&&M0.contains(z0.relatedTarget)))return;var g1=M0;if(z){var f0=z0.target;while(!h0(f0,z)){if(f0===M0)return;if(f0=f0.parentNode,!f0)return}g1=f0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return g1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return M0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return w}});var M8=I.call(g1,z0,z0.___td);if(V)a0(M0,F0,b0,z,b1);if(M8===!1)z0.preventDefault(),z0.stopPropagation()};b1.guid=I.guid=I.guid||j.guid++,z8(M0,F0,b0,z,b1)})}),this}M.on=G8;function B8(Q,z,w,I){return this.on(Q,z,w,I,!0)}M.one=B8;var Y8=/\r?\n/g;function w8(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(Y8,"\r\n")))}var U8=/file|reset|submit|button|image/i,X5=/radio|checkbox/i;if(M.serialize=function(){var Q="";return this.each(function(z,w){F(w.elements||[w],function(I,V){if(V.disabled||!V.name||V.tagName==="FIELDSET"||U8.test(V.type)||X5.test(V.type)&&!V.checked)return;var E=l1(V);if(!N(E)){var f=Y(E)?E:[E];F(f,function(s,j0){Q+=w8(V.name,j0)})}})}),Q.slice(1)},typeof q5!=="undefined")z5.exports=j;else Z.cash=Z.$=j})()});class J1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Z){this.callbacks.set(J,Z)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Z)=>{try{const W=this.callbacks.get(Z);if(W)W()}catch(W){console.error(`Error updating component ${Z}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class Z1{subscriptions=new Map;tick=new J1;register(J,Z){this.subscriptions.set(J,Z),this.tick.register(J,Z)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Z)=>{this.subscriptions.set(Z,()=>{})})}proxyState(J,Z){const W=this,H=new WeakMap,q=(G)=>{if(typeof G.toJSON==="function")return G;if(G instanceof Map)G.forEach((Y,B)=>G.set(B,X(Y)));else if(Array.isArray(G))G.forEach((Y,B)=>G[B]=X(Y));else if(typeof G==="object")Object.entries(G).forEach(([Y,B])=>G[Y]=X(B));let U=new Proxy(G,{get(Y,B){if(B==="toJSON")return function(){const K=(S)=>{if(!S||typeof S!=="object")return S;if(H.has(S)){const m=H.get(S);if(m instanceof Map){const t={};return m.forEach((H0,r)=>t[typeof r==="object"?JSON.stringify(r):String(r)]=K(H0)),t}if(Array.isArray(m))return m.map((t)=>K(t));const e={};return Object.entries(m).forEach(([t,H0])=>e[t]=K(H0)),e}if(typeof S.toJSON==="function"&&!H.has(S))return S.toJSON();return S};return K(U)};if(B==="reset")return function(){U=null};const O=Y[B];if(G instanceof Map&&typeof O==="function")return function(...K){const S=B.toString();if(S==="set"&&K.length>=2)K[1]=X(K[1]);const m=O.apply(Y,K);return["set","delete","clear"].includes(S)&&W.queueUpdate(J),m};if(Array.isArray(G)&&typeof O==="function")return function(...K){const S=B.toString();if(["push","unshift"].includes(S))K=K.map((e)=>X(e));else if(S==="splice"&&K.length>2)K=[K[0],K[1],...K.slice(2).map((e)=>X(e))];const m=O.apply(Y,K);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(S)&&W.queueUpdate(J),m};return O},set(Y,B,O){if(Y[B]===O)return!0;if(O instanceof Map&&Y[B]instanceof Map){const K=Y[B];return K.clear(),O.forEach((S,m)=>K.set(m,X(S))),W.queueUpdate(J),!0}return Y[B]=X(O),W.queueUpdate(J),!0}});return H.set(U,G),U},X=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class Q1{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const W=Z.node;if(!W){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const W=J.node;if(!W)return;if(Z==="attach"&&document.contains(W[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(W[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const H=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:H,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var W1=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(W,H)=>{return Z[H]!==void 0?Z[H].toString():`{${H}}`})},H5=(J,Z,W,H,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(H.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let U=W["*"];if(typeof U==="object")U=U[q||"*"];return W1(U,H)}if(typeof H.count==="string")H.count=Number(H.count);let X="*";if(H.count.toString()in W)X=H.count.toString();let G=W[X]||W["*"];if(typeof G==="object")G=G[q||"*"];return W1(G,H)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let X;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(H||{})){X=W[G];break}}catch(U){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(X===void 0)return;if(typeof X==="object")X=X[q||"*"];return W1(X,H)}case"variable":default:{const X=typeof W==="object"?W[q||"*"]:W;if(typeof X==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return W1(X,H)}}};class X1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Z){this.DICTIONARIES[J]=Z}translate(J,Z){if(Z&&this.currentLang===Z)return{text:J,lang:this.currentLang};Z=Z||this.currentLang;const[W,H]=Z.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const q=this.DICTIONARIES[W][J];J=q[H||"*"]||q["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Z}}format(J,Z,W){W=W||this.currentLang;const[H,q]=W.split("-");if(!this.DICTIONARIES[H]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[H][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const X=this.DICTIONARIES[H][J];if(typeof X==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof X!=="object"||X===null||Array.isArray(X)){console.warn(`Invalid <${W}[${J}]> format value`);return}return H5(X.type,J,X.value,Z,q)}}var E5=e0(p0(),1);var H1="comm",q1="rule",z1="decl";var G5="@import";var B5="@namespace",Y5="@keyframes";var w5="@layer";function G1(J){return J.trim()}function _0(J,Z,W){return J.replace(Z,W)}function U5(J,Z,W){return J.indexOf(Z,W)}function R0(J,Z){return J.charCodeAt(Z)|0}function P0(J,Z,W){return J.slice(Z,W)}function Y0(J){return J.length}function B1(J){return J.length}function y0(J,Z){return Z.push(J),J}var k1=Math.abs,s0=String.fromCharCode;function w1(J,Z,W,H,q,X,G,U){return{value:J,root:Z,parent:W,type:H,props:q,children:X,line:Y1,column:v0,length:G,return:"",siblings:U}}function K5(){return X0}function I5(){if(X0=I0>0?R0(m0,--I0):0,v0--,X0===10)v0=1,Y1--;return X0}function O0(){if(X0=I0<M5?R0(m0,I0++):0,v0++,X0===10)v0=1,Y1++;return X0}function T0(){return R0(m0,I0)}function l0(){return I0}function U1(J,Z){return P0(m0,J,Z)}function u0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function O5(J){return Y1=v0=1,M5=Y0(m0=J),I0=0,[]}function D5(J){return m0="",J}function M1(J){return G1(U1(I0-1,h1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(X0=T0())if(X0<33)O0();else break;return u0(J)>2||u0(X0)>3?"":" "}function F5(J,Z){while(--Z&&O0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return U1(J,l0()+(Z<6&&T0()==32&&O0()==32))}function h1(J){while(O0())switch(X0){case J:return I0;case 34:case 39:if(J!==34&&J!==39)h1(X0);break;case 40:if(J===41)h1(J);break;case 92:O0();break}return I0}function L5(J,Z){while(O0())if(J+X0===57)break;else if(J+X0===84&&T0()===47)break;return"/*"+U1(Z,I0-1)+"*"+s0(J===47?J:O0())}function V5(J){while(!u0(T0()))O0();return U1(J,I0)}var Y1=1,v0=1,M5=0,I0=0,X0=0,m0="";function R5(J){return D5(K1("",null,null,null,[""],J=O5(J),0,[0],J))}function K1(J,Z,W,H,q,X,G,U,Y){var B=0,O=0,K=G,S=0,m=0,e=0,t=1,H0=1,r=1,d=0,v="",c=q,p=X,J0=H,u=v;while(H0)switch(e=d,d=O0()){case 40:if(e!=108&&R0(u,K-1)==58){if(U5(u+=_0(M1(d),"&","&\f"),"&\f",k1(B?U[B-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:u+=M1(d);break;case 9:case 10:case 13:case 32:u+=j5(e);break;case 92:u+=F5(l0()-1,7);continue;case 47:switch(T0()){case 42:case 47:if(y0(L8(L5(O0(),l0()),Z,W,Y),Y),(u0(e||1)==5||u0(T0()||1)==5)&&Y0(u)&&P0(u,-1,void 0)!==" ")u+=" ";break;default:u+="/"}break;case 123*t:U[B++]=Y0(u)*r;case 125*t:case 59:case 0:switch(d){case 0:case 125:H0=0;case 59+O:if(r==-1)u=_0(u,/\f/g,"");if(m>0&&(Y0(u)-K||t===0&&e===47))y0(m>32?C5(u+";",H,W,K-1,Y):C5(_0(u," ","")+";",H,W,K-2,Y),Y);break;case 59:u+=";";default:if(y0(J0=N5(u,Z,W,B,O,q,U,v,c=[],p=[],K,X),X),d===123)if(O===0)K1(u,Z,J0,J0,c,X,K,U,p);else{switch(S){case 99:if(R0(u,3)===110)break;case 108:if(R0(u,2)===97)break;default:O=0;case 100:case 109:case 115:}if(O)K1(J,J0,J0,H&&y0(N5(J,J0,J0,0,0,q,U,v,q,c=[],K,p),p),q,p,K,U,H?c:p);else K1(u,J0,J0,J0,[""],p,0,U,p)}}B=O=m=0,t=r=1,v=u="",K=G;break;case 58:K=1+Y0(u),m=e;default:if(t<1){if(d==123)--t;else if(d==125&&t++==0&&I5()==125)continue}switch(u+=s0(d),d*t){case 38:r=O>0?1:(u+="\f",-1);break;case 44:U[B++]=(Y0(u)-1)*r,r=1;break;case 64:if(T0()===45)u+=M1(O0());S=T0(),O=K=Y0(v=u+=V5(l0())),d++;break;case 45:if(e===45&&Y0(u)==2)t=0}}return X}function N5(J,Z,W,H,q,X,G,U,Y,B,O,K){var S=q-1,m=q===0?X:[""],e=B1(m);for(var t=0,H0=0,r=0;t<H;++t)for(var d=0,v=P0(J,S+1,S=k1(H0=G[t])),c=J;d<e;++d)if(c=G1(H0>0?m[d]+" "+v:_0(v,/&\f/g,m[d])))Y[r++]=c;return w1(J,Z,W,q===0?q1:U,Y,B,O,K)}function L8(J,Z,W,H){return w1(J,Z,W,H1,s0(K5()),P0(J,2,-2),0,H)}function C5(J,Z,W,H,q){return w1(J,Z,W,z1,P0(J,0,H),P0(J,H+1,-1),H,q)}function I1(J,Z){var W="";for(var H=0;H<J.length;H++)W+=Z(J[H],H,J,Z)||"";return W}function P5(J,Z,W,H){switch(J.type){case w5:if(J.children.length)break;case G5:case B5:case z1:return J.return=J.return||J.value;case H1:return"";case Y5:return J.return=J.value+"{"+I1(J.children,H)+"}";case q1:if(!Y0(J.value=J.props.join(",")))return""}return Y0(W=I1(J.children,H))?J.return=J.value+"{"+W+"}":""}function T5(J){var Z=B1(J);return function(W,H,q,X){var G="";for(var U=0;U<Z;U++)G+=J[U](W,H,q,X)||"";return G}}class d0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=E5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return I1(R5(J),T5([P5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const W=new MutationObserver(()=>{const H=document.querySelector(J);if(H&&getComputedStyle(H).cssText)W.disconnect(),Z()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Z=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const W=this.compile(J);if(!W)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const H=document.createElement("style");H.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),H.textContent=W;let q=0;const X=this.$head.find(`style[${Z}]`);if(X.length)q=parseInt(X.attr("dindex"))+1,X.remove();return H.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(H):document.head.appendChild(H),H}catch(W){throw new Error(`Style injection failed: ${W.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Z=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Z=parseInt(J.attr("dindex"));Z===0?J.remove():J.attr("dindex",String(Z-1))}async custom(){return{}}async style(){return{}}}class O1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){const Z=J.priority??2;if(!this.pending.has(Z))this.pending.set(Z,new Set);if(this.pending.get(Z)?.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}apply({dep:J,deppath:Z},W="batch-updator"){try{const H=this.component.FGUD.get(J)?.get(Z);if(!H){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(H.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(H.nodepath);if(!q)return;const X=H.update(q.memo||{},W);if(X){if(typeof X.memo==="object")q.memo=X.memo;typeof X.cleanup==="function"&&X.cleanup()}}catch(H){console.error("Failed to update dependency --",H)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((H,q)=>J.set(q,new Set(H))),this.pending.clear(),this.isPending=!1;const Z=(H)=>{const q=Array.from(H);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((X)=>this.apply(X))},W=Array.from(J.keys()).sort((H,q)=>H-q);for(let H of W){const q=J.get(H);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class D1{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Z){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Z),this}once(J,Z){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Z),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Z){if(!this.options.emit)return;const W=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(W);if(typeof q==="object")for(let X in q)q[X]=W(q[X]);return q},H=Z.map(W);this.__events[J]?.forEach((q)=>q(...H)),this.__once_events[J]?.forEach((q)=>q(...H)),delete this.__once_events[J]}}var f1=e0(p0(),1);function G0(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if(A5(J)&&A5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const X=new WeakMap;for(let G of J){let U=!1;if(typeof G!=="object"){if(Z.has(G))U=!0}else for(let Y of Z){if(typeof Y!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const B=X.get(G);if(B.has(Y)){if(U=B.get(Y),U)break;continue}const O=!G0(G,Y);if(B.set(Y,O),O){U=!0;break}}if(!U)return!0}return!1}if(J instanceof Map){if(!(Z instanceof Map))return!0;if(J.size!==Z.size)return!0;if($5(J)&&$5(Z)){for(let[G,U]of J)if(Z.get(G)!==U)return!0;return!1}const X=new WeakMap;for(let[G,U]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const O=Z.get(G);if(typeof U!=="object"){if(U!==O)return!0;continue}if(typeof O!=="object"||G0(U,O))return!0;continue}let Y=!1,B=!1;for(let[O,K]of Z){if(typeof O!=="object")continue;if(!X.has(G))X.set(G,new WeakMap);const S=X.get(G);if(S.has(O)){const[m,e]=S.get(O);if(m){Y=!0,B=e;break}continue}if(!G0(G,O)){if(Y=!0,B=typeof U==="object"&&typeof K==="object"?!G0(U,K):U===K,S.set(O,[!0,B]),B)break}else S.set(O,[!1,!1])}if(!Y||!B)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Z))return!0;if(J.length!==Z.length)return!0;for(let X=0;X<J.length;X++){const G=J[X],U=Z[X];if(G!==U&&(typeof G!=="object"||G0(G,U)))return!0}return!1}const W=Object.keys(J),H=Object.keys(Z);if(W.length!==H.length)return!0;W.sort(),H.sort();const q=W.length;for(let X=0;X<q;X++)if(W[X]!==H[X])return!0;for(let X=0;X<q;X++){const G=W[X],U=J[G],Y=Z[G];if(U===Y)continue;if(U instanceof Date){if(!(Y instanceof Date)||String(U)!==String(Y))return!0;continue}if(U instanceof RegExp){if(!(Y instanceof RegExp)||U.source!==Y.source||U.flags!==Y.flags)return!0;continue}if(U instanceof Map){if(!(Y instanceof Map)||G0(U,Y))return!0;continue}if(U instanceof Set){if(!(Y instanceof Set)||G0(U,Y))return!0;continue}if(U instanceof Function){if(!(Y instanceof Function))return!0;continue}if(typeof U==="object"){if(typeof Y!=="object")return!0;if(U===J){if(Y!==Z)return!0}else if(G0(U,Y))return!0}else return!0}return!1}function w0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const W=typeof J;if(W!==typeof Z)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Z))return!0;return!1}if(J instanceof Date)return Z instanceof Date&&J.getTime()===Z.getTime();if(J instanceof RegExp)return Z instanceof RegExp&&J.source===Z.source&&J.flags===Z.flags;if(J instanceof Error)return Z instanceof Error&&J.name===Z.name&&J.message===Z.message&&(J.stack===Z.stack||!J.stack&&!Z.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Z))return!1;if(J.byteLength!==Z.byteLength)return!1;const U=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),Y=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength);for(let B=0;B<U.length;B++)if(U[B]!==Y[B])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Z;if(typeof J==="function"){if(typeof Z!=="function")return!1;return J.toString()===Z.toString()&&J.name===Z.name}if(J.constructor!==Z.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!G0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const X=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(X.length!==G.length)return!1;for(let U of X){if(!Object.prototype.hasOwnProperty.call(Z,U))return!1;if(!w0(J[U],Z[U]))return!1}if(q!==null&&q!==Object.prototype){const U=Object.getOwnPropertyNames(q),Y=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(U.length!==Y.length)return!1;for(let B of U){if(B==="constructor")continue;if(!w0(q[B],Object.getPrototypeOf(Z)[B]))return!1}}return!0}function A5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function $5(J){for(let[Z,W]of J)if(typeof Z==="object"&&Z!==null||typeof W==="object"&&W!==null)return!1;return!0}function W0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((X,G)=>q.set(W0(G,Z),W0(X,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((X)=>q.add(W0(X,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let X=0;X<J.length;X++)q[X]=W0(J[X],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Z.set(J,W);const H=Object.getOwnPropertySymbols(J);for(let q of H)W[q]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=W0(J[q],Z);return W}function _5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function W(q,X,G){const U=X.split(/\.|\[|\]/).filter(Boolean);let Y=q;for(let B=0;B<U.length;B++){const O=U[B],K=!isNaN(Number(O)),S=B===U.length-1,m=!isNaN(Number(U[B+1]));if(S){Y[O]=G;continue}if(!(O in Y))Y[O]=m?[]:{};else if(m&&!Array.isArray(Y[O]))Y[O]=[];else if(!m&&Array.isArray(Y[O]))Y[O]={};Y=Y[O]}}const H=W0(J);try{for(let[q,X]of Object.entries(Z)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);W(H,q,X)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return H}function F1(J){return JSON.parse(JSON.stringify(J))}var S0="i18n",E0="syn:",L0="fn:",g0="on-",K0=/^\.\.\./,j1=/^\[(.*?)\]$/,_1=/{\s*([^{}]+)\s*}/g,S5=["@html","@text","@format"],b5=["display","visibility","position","width","height"],g5=":n",y1=":pr",x5="m",k5="c",h5="x",o0="*",f5=100;f1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&f1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class L1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,W)=>Z+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},H={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},X={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Z),console.table(W),console.table(H),console.table(q),console.table(X),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Q0=e0(p0(),1);var V8=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let W=J,H;while((H=Z.exec(J))!==null){const q=H[1],X=H.index+H[0].length;let G=1,U=X;while(U<J.length&&G>0){if(J[U]==="(")G++;if(J[U]===")")G--;U++}if(G===0){const Y=J.slice(X,U-1).trim(),B=J.slice(0,H.index),O=`${g0}${q}="${Y}"`,K=J.slice(U);W=B+O+K,J=W,Z.lastIndex=B.length+O.length}}return W},N8=function(J){const Z=[];let H=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,X,G)=>{return Z.push(G),`<${X}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const X=`##TAG_ATTRS_${q}##`,G=Z[q],U=C8(G);H=H.replace(X,U)}return H},C8=function(J){let Z="",W=0,H=!1,q="",X=0,G=0,U=0;while(W<J.length){const Y=J[W];if((Y==='"'||Y==="'")&&(W===0||J[W-1]!=="\\")){if(!H)H=!0,q=Y;else if(Y===q)H=!1}if(!H){if(Y==="(")G++;else if(Y===")")G--;else if(Y==="{")U++;else if(Y==="}")U--}if(!H&&G===0&&U===0&&(Y===" "||W===J.length-1)){let B=W;if(W===J.length-1)B=W+1;const O=J.substring(X,B).trim();if(O){const K=R8(O);Z+=" "+K}X=W+1}W++}return Z},R8=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===S0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Z).trim(),H=J.substring(Z+1).trim();if(W.startsWith("@"))return W=!S5.includes(W)?W.slice(1):W,`:${W}=${H}`;if(W.startsWith(L0)||W.startsWith(g0))return J;if(H.startsWith('"')&&H.endsWith('"')||H.startsWith("'")&&H.endsWith("'")){const q=H.substring(1,H.length-1);if(P8(q))return`:${W}="${q}"`;return J}else return`:${W}="${H}"`};function P8(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function v1(J){let Z=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(W,H,q)=>{return q.endsWith("<")?`<lips dtag="${H}" ${q}/lips>`:`<lips dtag="${H}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${L0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Z=V8(Z),Z=N8(Z),Z}var T8=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},v5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function x0(J,Z={maxSize:100}){const W=new Set,H=[{value:J,timestamp:Date.now()}];let q=0;const X=()=>{const B=V1[V1.length-1];return B&&T8(B,W),H[q].value},G=()=>{const B=[...W];if(y5)for(let O of B)y5.add(O);else for(let O of B)O.execute()};return[X,(B,O)=>{if(Object.is(H[q].value,B))return;if(q<H.length-1)H.splice(q+1);if(H.push({value:B,timestamp:Date.now(),metadata:O}),H.length>Z.maxSize)H.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<H.length-1)q++,G()},jumpTo(B){if(B>=0&&B<H.length&&B!==q)q=B,G()},getHistory(){return[...H]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<H.length-1},clear(){const B=H[0];H.length=0,H.push(B),q=0,G()}}]}function r0(J){let Z=!1;const W=()=>{if(Z)throw new Error("Circular dependency detected");if(H.isDisposed)return;Z=!0,v5(H),V1.push(H);try{J()}finally{Z=!1,V1.pop()}},H={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{H.isDisposed=!0,v5(H)}}}var V1=[],y5=null;class k0 extends D1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;FGUDMemory=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__inpath__="";__inpathCounter__=0;__renderDepth__=0;__boundaries__;constructor(J,Z,{input:W,state:H,context:q,_static:X,handler:G,stylesheet:U,macros:Y,declaration:B},O){super();if(this.lips=O.lips,O?.debug)this.debug=O.debug||this.lips.debug;if(O?.prepath)this.prepath=O.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=this.__inpath__=`${this.prepath}:${this.__name__}`,this.__template__=v1(Z),this.__boundaries__=O.boundaries,this.declaration=B||{name:J},this.input=W||{},this.static=X||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,H||{}),Y&&this.setMacros(Y),G&&this.setHandler(G),U&&this.setStylesheet(U),this.metrics=new L1(this.debug),this.metrics.inc("componentCount"),this.UQS=new O1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W0(this.state),input:W0(this.input),context:W0(this.context)};const[K,S]=x0(this.input),[m,e]=x0(this.state),[t,H0]=x0(this.context);this.__setInput=S,this.__setState=e,this.__getState=m,this.lips.IUC.register(this.__path__,()=>{G0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(r)=>{if(!G0(this.context,r))return;H0(r),this.context=r,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(r)=>{if(r===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=r}),this.ICE=r0(()=>{const r=m(),d=this.input=K(),v=this.context=t();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||B?.syntax&&typeof this.onSelfRender=="function"){const c=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=c||Q0.default()}else{const{$log:c}=this.render("",void 0,void 0,this.FGUD);this.$=c}!B?.syntax&&this.$?.each((c,p)=>{typeof p.setAttribute=="function"&&p.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W0(d),state:W0(r),context:W0(v)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!G0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(_5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=v1(J),W=Q0.default(Z);if(!W.length)return;const H=this;W.each(function(){const q=Q0.default(this),{argv:X,attrs:G}=H.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(H.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");H.__macros.set(G.literals.name,{argv:X,$node:q})})}setHandler(J){Object.entries(J).map(([Z,W])=>this[Z]=W?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new d0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,W={},H,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:H||new Map};const X=this,G=H||new Map,U=[];this.metrics.startRender();let Y=Q0.default();function B(){return W0(W)}function O(M,j=!1){const D=K(M,j);return X.__inpathCounter__++,X.__inpath__?`${X.__inpath__}/${D}`:`${J?J+"/":""}${D}`}function K(M,j=!1){let D="";switch(M){case"component":D=j?h5:k5;break;case"macro":D=x5;break}return D+X.__inpathCounter__}function S(M){return M!==null&&typeof M==="object"&&typeof M.mesh==="function"&&typeof M.update==="function"}function m(M){return M!==null&&typeof M==="object"&&typeof M.default&&typeof M.default==="string"}function e(M){if(!M.attr(":dtag")||M.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=M.attr(":dtag"),D=X.__evaluate__(j,W);if(S(D)||D===null)return d(M,j,D);else if(m(D))return v(M,{template:D});else return v(M,{name:D})}function t(M){const j=M.attr(":args"),D=O("log");if(!j)return;const C=B();if(X.__evaluate__(`console.log(${j})`,C),X.__isReactive__(j,C))X.__extractExpressionDeps__(j,C).forEach((P)=>X.__trackDep__(G,P,C,{nodetype:"log",nodepath:D,target:"argument",$fragment:null,update:(A)=>X.__evaluate__(`console.log(${j})`,A),syntax:!0}))}function H0(M){const j=O("var"),{attrs:D}=X.__getAttributes__(M);if(!D)return;Object.entries(D.literals).forEach(([C,L])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:L,type:"let"}}),Object.entries(D.expressions).forEach(([C,L])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);if(W[C]={value:X.__evaluate__(L,W),type:"let"},X.__isReactive__(L,W)){const P=X.__extractExpressionDeps__(L,W),A=(y,l)=>{if(y[C]&&y[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);if(D.map.beforeSpreadAttrs.includes(C))return;const g=X.__evaluate__(L,y);if(w0(y[C].value,g))return;return y[C]={value:g,type:"let"},X.__updateVarDepNodes__(C,j,y),F1({memo:y})};P.forEach((y)=>X.__trackDep__(G,y,B(),{nodetype:"let",nodepath:j,deppath:`${j}.${C}`,target:"attr",$fragment:null,update:A,syntax:!0}))}}),X.metrics.inc("elementCount")}function r(M){const{attrs:j}=X.__getAttributes__(M);if(!j)return;Object.entries(j.literals).forEach(([D,C])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!C)return;W[D]={value:C,type:"const"}}),Object.entries(j.expressions).forEach(([D,C])=>{if(W[D]&&W[D].type==="const")throw new Error(`<const ${D}=[value]/> variable already defined`);if(!C)return;W[D]={value:X.__evaluate__(C,W),type:"const"}}),X.metrics.inc("elementCount")}function d(M,j,D){const{attrs:C}=X.__getAttributes__(M),L=O("element"),P=X.__getBoundaries__(L),A={},y={};let l=B(),g=Q0.default(P.start),x={},N=D;if(N){C.literals&&Object.entries(C.literals).forEach(([R,k])=>{A[R]=k,x[R]={type:"arg",value:k}}),C.expressions&&Object.entries(C.expressions).forEach(([R,k])=>{if(!N)return;if(K0.test(R))X.__evaluateSpreadAttr__(R,{memo:l,get keystore(){return y[R]},set keystore(F){if(!y[R])y[R]=[];y[R]=F},each:(F,T)=>{if(A[F]=T,!N?.argv.includes(F))return;x[F]={type:"arg",value:T}}});else{const F=k?X.__evaluate__(k,l):!0;if(A[R]=F,!N.argv.includes(R))return;x[R]={type:"arg",value:F}}}),l.__arguments__=A;const _=N.mesh(x);if(_&&_.length)g=g.add(_);C.expressions&&Object.entries(C.expressions).forEach(([R,k])=>{if(!N)return;if(K0.test(R)&&X.__isReactive__(R,l)){const F=X.__extractExpressionDeps__(R,l),T=(h,$)=>{if(!N)return;const b={};let o=[];if(X.__evaluateSpreadAttr__(R,{memo:h,get keystore(){return y[R]},set keystore(i){if(!y[R])y[R]=[];y[R]=i},each:(i,n)=>{if(C.map.afterSpreadAttrs.includes(i))return;if(!N?.argv.includes(i))return;if(w0(n,h[i]?.value))return;x[i]=b[i]={value:n,type:"arg"},A[i]=n,o.push(i)},nullify:(i)=>{i.forEach((n)=>{b[n]={value:void 0,type:"arg"},delete A[n]}),o=i}}),o.length)N.argv.length&&X.__updateArgumentsDepNodes__(L,A),N.update(o,b,h,P)};F.forEach((h)=>X.__trackDep__(G,h,l,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${R}`,target:"spread-attr",$fragment:null,boundaries:P,update:T}))}else if(N.argv.includes(R)&&X.__isReactive__(k,l)){const F=X.__extractExpressionDeps__(k,l),T=(h,$)=>{if(!N)return;if(C.map.beforeSpreadAttrs.includes(R))return;const b=k?X.__evaluate__(k,h):!0,o={type:"arg",value:b};if(x[R]=o,N.argv.length)A[R]=b,X.__updateArgumentsDepNodes__(L,A);N.update([R],{[R]:o},h,P)};F.forEach((h)=>X.__trackDep__(G,h,l,{nodetype:"dynamic",nodepath:L,deppath:`${L}.${R}`,target:"attr",$fragment:null,boundaries:P,update:T}))}})}if(X.__isReactive__(j,l)){const _=(k,F)=>{const T=X.__evaluate__(j,k);let h;if(m(T))h=v(M,{template:T}),X.__fillBoundaries__(h,P);else if(S(T)){if(Object.entries(x).forEach(([$,b])=>{if(typeof b==="function")return;A[$]=b.value}),N?.cleanup(P),N=T,N)N.argv.length&&X.__updateArgumentsDepNodes__(L,A),h=N.mesh(x),h?.length&&N.fill(h,P)}else if(N)N.cleanup(P),N=null};X.__extractExpressionDeps__(j,l).forEach((k)=>X.__trackDep__(G,k,{...l,...x},{nodetype:"dynamic",nodepath:L,deppath:`${L}.dtag`,target:"dtag",$fragment:null,boundaries:P,update:_}))}return g=g.add(P.end),g}function v(M,j){let D,C;if(j?.template)D=j.template,C=K("component",D.declaration?.syntax);else{if(C=j?.name||M.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");D=X.lips.import(C)}if(!D||!C)throw new Error(`<${C}> template not found`);const L=O("component",D.declaration?.syntax),P=`${L}#${C}`,A=X.__getBoundaries__(L),{argv:y,functions:l,attrs:g,events:x}=X.__getAttributes__(M),N={},_={};let R={},k=Q0.default(A.start),F=X.PCC.get(P),T=B();g.literals&&Object.entries(g.literals).forEach(([$,b])=>{if($=="key")return;R[$]=b}),l&&Object.entries(l).forEach(([$,b])=>{R[$]=X.__evaluateFunction__(b,[],T),D.declaration?.syntax?N[E0+L0+$]=b:N[L0+$]=b}),g.expressions&&Object.entries(g.expressions).forEach(([$,b])=>{if($=="key")return;if(K0.test($))X.__evaluateSpreadAttr__($,{memo:T,get keystore(){return _[$]},set keystore(o){if(!_[$])_[$]=[];_[$]=o},each:(o,i)=>R[o]=i});else R[$]=b?X.__evaluate__(b,T):!0;D.declaration?.syntax?N[E0+$]=b:N[$]=b});const h=M.contents();if(h.length){if(R={...R,...X.__meshwire__({$node:M,fragmentPath:L,fragmentBoundaries:A,meshPath:null,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)},D.declaration){if(D.declaration.tags){let $;Object.entries(D.declaration?.tags).forEach(([b,{type:o,many:i,alts:n}])=>{switch(o){case"nexted":{let Z0=M.next(b);if(!Z0.length&&Array.isArray(n)&&$?.length&&$.is(n.join(",")))Z0=$.next(b);if(!Z0.length)return;if(i){R[b]=[];let a=0,B0=!1;while(!B0){if(R[b].push(X.__meshwire__({$node:Z0,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)),!Z0.next(b).length){B0=!0;break}Z0=$=Z0.next(b),a++}}else R[b]=X.__meshwire__({$node:Z0,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:y,xmlns:q,useAttributes:!0,declaration:D.declaration},N)}break;case"child":{const Z0=M.children(b);if(i)R[b]=[],Z0.each(function(a){const B0=Q0.default(this),{argv:D0}=X.__getAttributes__(B0);R[b].push(X.__meshwire__({$node:B0,meshPath:`${b}[${a}]`,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:D0,xmlns:q,useAttributes:!0,declaration:D.declaration},N))});else if(M.children(b).first().length){const a=M.children(b).first(),{argv:B0}=X.__getAttributes__(a);R[b]=X.__meshwire__({$node:a,meshPath:b,fragmentPath:L,fragmentBoundaries:A,scope:T,argv:B0,xmlns:q,useAttributes:!0,declaration:D.declaration},N)}}break}})}else if(D.declaration.contents)R.__contents__=h}}if(F)F.setInput(W0(R)),k=k.add(F.node);else{const{declaration:$,state:b,_static:o,handler:i,context:n,default:Z0,stylesheet:a}=D;F=new k0(C,Z0||"",{state:W0(b),input:W0(R),context:n,_static:W0(o),handler:i,stylesheet:a,declaration:$},{debug:X.debug,lips:X.lips,prepath:L,boundaries:A}),k=k.add(F.node),!D.declaration?.syntax&&X.PCC.set(P,F)}return k=k.add(A.end),Object.entries(x).forEach(([$,b])=>{X.__attachEvent__({nodepath:L,element:F,_event:$,instruction:b,scope:T,get __dependencies__(){return G}})}),N&&Object.entries(N).forEach(([$,b])=>{let o=!1,i=!1;if($.startsWith(E0))o=!0,$=$.replace(E0,"");if($.startsWith(L0))i=!0,$=$.replace(L0,"");if(K0.test($)){if(X.__isReactive__($,T)){const n=(a)=>{const B0={};X.__evaluateSpreadAttr__($,{memo:a,get keystore(){return _[$]},set keystore(D0){if(!_[$])_[$]=[];_[$]=D0},each:(D0,h0)=>{if(g.map.afterSpreadAttrs.includes(D0))return;B0[D0]=h0},nullify:(D0)=>D0.forEach((h0)=>B0[h0]=void 0)}),F?.subInput(B0,a)};X.__extractExpressionDeps__($,T).forEach((a)=>X.__trackDep__(G,a,T,{nodetype:"component",nodepath:L,deppath:`${L}.${$}`,target:"spread-attr",$fragment:null,boundaries:A,update:n,syntax:o}))}}else if(X.__isReactive__(b,T)){const n=(a)=>{if(g.map.beforeSpreadAttrs.includes($))return;const B0=i?X.__evaluateFunction__(b,[],a):b?X.__evaluate__(b,a):!0;F?.subInput({[$]:B0},a)};X.__extractExpressionDeps__(b,T).forEach((a)=>X.__trackDep__(G,a,T,{nodetype:"component",nodepath:L,deppath:`${L}.${$}`,target:"attr",$fragment:null,boundaries:A,update:n,syntax:o}))}}),X.metrics.inc("componentCount"),k}function c(M){const j=M.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const D=X.__macros.get(j);if(!D)throw new Error("Macro component not found");const C=O("macro"),L=X.__getBoundaries__(C),{attrs:P}=X.__getAttributes__(M),A={},y=B(),l={},g={};P.literals&&Object.entries(P.literals).forEach(([F,T])=>{l[F]=T,g[F]={value:T,type:"arg"}});const x={};P.expressions&&Object.entries(P.expressions).forEach(([F,T])=>{if(K0.test(F))X.__evaluateSpreadAttr__(F,{memo:y,get keystore(){return x[F]},set keystore(h){if(!x[F])x[F]=[];x[F]=h},each:(h,$)=>{if(l[h]=$,D.argv.includes(h))g[h]={value:$,type:"arg"}}}),A[F]=T;else{const h=T?X.__evaluate__(T,y):!0;if(l[F]=h,D.argv.includes(F))g[F]={value:h,type:"arg"},A[F]=T}D.argv.forEach((h)=>{if(g[h]!==void 0)return;g[h]={value:!1,type:"arg"}})}),g.__arguments__=l;let N=Q0.default(L.start);const _={$node:D.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:L,argv:D.argv,scope:y,xmlns:q,useAttributes:!0},R=X.__meshwire__(_,A),k=R.renderer.mesh(g,y);return N=N.add(k),A&&Object.entries(A).forEach(([F,T])=>{let h=!1;if(new RegExp(`^${E0}`).test(F))h=!0,F=F.replace(E0,"");if(K0.test(F)){if(!X.__isReactive__(F,y))return;const $=X.__extractExpressionDeps__(F,y),b=(o)=>{const i={};let n=[];if(X.__evaluateSpreadAttr__(F,{memo:o,get keystore(){return x[F]},set keystore(Z0){if(!x[F])x[F]=[];x[F]=Z0},each:(Z0,a)=>{if(P.map.afterSpreadAttrs.includes(Z0))return;if(w0(a,o[Z0]?.value))return;i[Z0]={value:a,type:"arg"},l[Z0]=a,n.push(Z0)},nullify:(Z0)=>{Z0.forEach((a)=>{i[a]={value:void 0,type:"arg"},delete l[a]}),n=Z0}}),n.length)X.__updateArgumentsDepNodes__(C,l),R.renderer.update(n,i,o);return F1({memo:{...o,...i}})};$.forEach((o)=>X.__trackDep__(G,o,{...y,...g},{nodetype:"macro",nodepath:C,deppath:`${C}.${F}`,target:"spread-attr",$fragment:null,boundaries:L,update:b,syntax:h}))}else if(X.__isReactive__(T,y)){const $=X.__extractExpressionDeps__(T,y),b=(o)=>{if(P.map.beforeSpreadAttrs.includes(F))return;const i=T?X.__evaluate__(T,o):!0;return l[F]=i,X.__updateArgumentsDepNodes__(C,l),R.renderer.update([F],{[F]:{value:i,type:"arg"}},o),F1({memo:o})};$.forEach((o)=>X.__trackDep__(G,o,{...y,...g},{nodetype:"macro",nodepath:C,deppath:`${C}.${F}`,target:"attr",$fragment:null,boundaries:L,update:b,syntax:h}))}}),N=N.add(L.end),X.metrics.inc("elementCount"),N}function p(M){if(!M.length||!M.prop("tagName"))return M;const j=M.is("svg")||q,D=j?Q0.default(document.createElementNS("http://www.w3.org/2000/svg",M.prop("tagName").toLowerCase())):Q0.default(`<${M.prop("tagName").toLowerCase()}/>`),C=M.contents(),L=O("element"),P=B();C.length&&D.append(X.__withPath__(L,()=>X.render(L+g5,C,P,G,j).$log));const{attrs:A,events:y}=X.__getAttributes__(M);A.literals&&Object.entries(A.literals).forEach(([g,x])=>{if(g===S0)return;const N=M.is(`[${S0}]`)&&["title","placeholder"].includes(g);D.attr(g,N?X.lips.i18n.translate(x).text:x);const _=(R)=>{D.attr(g,N?X.lips.i18n.translate(x).text:x),N&&X.__trackTranslationDep__(R,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:D,update:_})};N&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"attr",$fragment:D,update:_})});const l=(g,x=!1)=>{g&&Object.entries(g).forEach(([N,_])=>{switch(N){case"@html":{const R=(k)=>{D.html(X.__evaluate__(_,k))};if(R(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((F)=>X.__trackDep__(G,F,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:R}))}break;case"@text":{const R=M.is(`[${S0}]`),k=(F)=>{D.text(X.__evaluate__(_,F,{translate:R})),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:k})};if(k(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:k})}break;case"@format":{const[R,k]=_.split(",").map((T)=>T.trim());if(!R)throw new Error("Invalid @format reference");if(!k)throw new Error("Invalid @format parameters");const F=(T)=>{const h=X.__evaluate__(`!${k.trim()}`,T);if(typeof h!=="object")throw new Error("Invalid @format parameters");const $=X.lips.i18n.format(R,h);$!==void 0&&D.text($),X.__trackTranslationDep__(T,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:F})};F(P),X.__extractExpressionDeps__(k,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"meta-attr",$fragment:D,update:F}))}break;case"style":if(x&&X.__isReactive__(_,P)){const R=(F)=>{const T=X.__evaluate__(_,F);if(typeof T==="object"){let h="";Object.entries(T).forEach(([$,b])=>h+=`${$}:${b};`),h.length&&D.attr("style",h)}else D.attr("style",T)};R(P),X.__extractExpressionDeps__(_,P).forEach((F)=>X.__trackDep__(G,F,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,update:R}))}else D.attr("style",_);break;default:{const R=M.is(`[${S0}]`)&&["title","placeholder"].includes(N),k=(F)=>{const T=_&&X.__isReactive__(_,P)?X.__evaluate__(_,F,{translate:R}):_!==void 0?_:!0;if(T===void 0||T===!1)D.removeAttr(N);else D.attr(N,T),R&&X.__trackTranslationDep__(F,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,update:k})};if(k(P),x&&X.__isReactive__(_,P))X.__extractExpressionDeps__(_,P).forEach((T)=>X.__trackDep__(G,T,P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,update:k}));R&&X.__trackTranslationDep__(P,{nodetype:"element",nodepath:L,deppath:`${L}.${N}`,target:"attr",$fragment:D,update:k})}}})};return A.expressions&&Object.keys(A.expressions).forEach((g)=>{if(!K0.test(g))return;let x=[];const N=(_,R,k=!1)=>{const F={};X.__evaluateSpreadAttr__(g,{memo:_,get keystore(){return x},set keystore(T){x=T},each:(T,h)=>{if(!k&&A.map.afterSpreadAttrs.includes(T))return;F[T]=h},nullify:(T)=>T.forEach((h)=>D.removeAttr(h))}),Object.keys(F).length&&l(F)};if(delete A.expressions[g],N(P,"",!0),g&&X.__isReactive__(g,P))X.__extractExpressionDeps__(g,P).forEach((R)=>X.__trackDep__(G,R,P,{nodetype:"element",nodepath:L,deppath:`${L}.${g}`,target:"spread-attr",$fragment:D,update:N}))}),l(A.expressions,!0),y&&Object.entries(y).forEach(([g,x])=>{U.push({nodepath:L,element:D,_event:g,instruction:x,scope:P,get __dependencies__(){return G}})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),D}function J0(M){const j=M.text(),D=B(),C=O("element"),L=M.parent().is(`[${S0}]`),P=Q0.default(document.createTextNode(X.__interpolate__(j,D,L))),A=(y)=>{const l=X.__interpolate__(j,y,L);if(!P[0])return;P[0].textContent=l,L&&X.__trackTranslationDep__(y,{nodetype:"text",nodepath:C,target:"value",$fragment:P,update:A})};if(j&&X.__isReactive__(j,D))X.__extractTextDeps__(j,D).forEach((l)=>X.__trackDep__(G,l,D,{nodetype:"text",nodepath:C,deppath:`${C}.${l}`,target:"value",$fragment:P,update:A}));return L&&X.__trackTranslationDep__(D,{nodetype:"text",nodepath:C,target:"value",$fragment:P,update:A}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),P}function u(M){if(M.get(0)?.nodeType===Node.COMMENT_NODE)return M;if(M.get(0)?.nodeType===Node.TEXT_NODE)return J0(M);if(M.is("let"))return H0(M);else if(M.is("const"))return r(M);else if(M.is("lips")&&M.attr(":dtag"))return e(M);else if(M.is("log"))return t(M);else if(X.__macros.has(M.prop("tagName")?.toLowerCase()))return c(M);else if(M.is("if, for, switch, async")||X.lips.has(M.prop("tagName")?.toLowerCase()))return v(M);else if(M.is("else-if, else"))return;return p(M)}try{this.__renderDepth__++,Z=!Z&&Q0.default(this.__template__).length>1?Q0.default("<template>").html(this.__template__).contents():Z||Q0.default(this.__template__),Z.each(function(){const M=u(Q0.default(this));if(M)Y=Y.add(M)}),U.forEach(this.__attachEvent__.bind(this)),X.metrics.inc("renderCount")}catch(M){console.error("Rendering Failed --",M),X.metrics.trackError(M)}finally{if(this.__renderDepth__--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth__===0)this.__inpath__="",this.__inpathCounter__=0}return{$log:Y,dependencies:G,events:U}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Q0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const W=this,{$node:H,meshPath:q,fragmentPath:X,fragmentBoundaries:G,argv:U,xmlns:Y,declaration:B,useAttributes:O}=J;let K;const S=new Map,m=X+y1,e=(d,v,c)=>{if(K=H.contents(),!K?.length)return null;v=v||J.scope;const p=m+(c||""),{$log:J0,dependencies:u,events:M}=W.__withPath__(p,()=>{return W.render(p,K,{...v,...d},void 0,Y)}),j=c||o0;return!S.has(j)&&S.set(j,new Set),S.get(j)?.add(p),u?.forEach((D,C)=>{!W.FGUD?.has(C)&&W.FGUD.set(C,new Map),D.forEach((L,P)=>{if(L.garbage)return;L.partial?.length?L.partial.push(p):L.partial=[p],W.FGUD.get(C)?.set(P,L)})}),W.metrics.inc("partialCount"),J0},t=(d,v,c,p,J0)=>{if(!S.get(J0||o0)?.size)return;c=c||J.scope,p=p||G,W.metrics.startRender();const u=Array.from(S.get(J0||o0)||[]);d.forEach((M)=>{const j=W.FGUD.get(M);if(!j)return;j.forEach((D)=>{const C=u.find((A)=>{return D.partial?.find((y)=>A==y||W.__hasSamePathParent__(y,A))});if(!D.partial||!C)return;const L=D.deppath||D.nodepath,P=this.FGUDMemory.get(D.nodepath);if(D.garbage||p?.start&&!document.contains(p.start)){j.delete(L),W.__unbindMemo__(D);return}if(!P){console.warn(`unexpected occurence: <${L}> has no memo`);return}if(P.memo?.[M]&&v?.[M]&&!w0(P.memo[M],v[M]))P.memo={...c,...P.memo,...v};W.UQS.queue({dep:M,deppath:L,priority:D.priority}),W.metrics.inc("dependencyUpdateCount")}),!j.size&&W.FGUD.delete(M)}),W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},H0=(d,v)=>{if(W.FGUD.forEach((c,p)=>{c.forEach((J0,u)=>{if(!W.__hasSamePathParent__(u,m+(v||"")))return;W.__unbindMemo__(J0),J0.garbage=!0}),!c.size&&W.FGUD.delete(p)}),S.delete(typeof v==="string"&&v||o0),d=d||G,W.__emptyBoundaries__(d),v)d.start.remove(),d.end.remove()},r={renderer:{path:q,argv:U,mesh:e,update:t,cleanup:H0,fill(d,v){W.__fillBoundaries__(d,v||G)},demarcate(d,v){const c=W.__getBoundaries__(m+(v||""));let p=Q0.default(c.start);return p=p.add(d),p=p.add(c.end),{$partial:p,boundaries:c}}}};if(O&&q){const{attrs:d}=W.__getAttributes__(H);d.literals&&Object.entries(d.literals).forEach(([v,c])=>r[v]=c),d.expressions&&Object.entries(d.expressions).forEach(([v,c])=>{if(K0.test(v)){let p=[];W.__evaluateSpreadAttr__(v,{memo:J.scope,get keystore(){return p},set keystore(J0){p=J0},each:(J0,u)=>r[J0]=u}),Z[`${B?.syntax?E0:""}${q}.${v}`]=c}else r[v]=c?W.__evaluate__(c,J.scope):!0,Z[`${B?.syntax?E0:""}${q}.${v}`]=c})}return r}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let W=J.start.nextSibling;while(W&&W!==J.end)Z.push(W),W=W.nextSibling;Q0.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Q0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),W={},H={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},X=Object.keys(Z).find((Y)=>K0.test(Y));let G=[],U=!1;return Z&&Object.entries(Z).forEach(([Y,B])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(L0)||Y.startsWith(g0)||K0.test(Y)||j1.test(Y))if(j1.test(Y)){const[O,K]=Y.match(j1)||[];G=K.split(",")}else if(Y.startsWith(g0))W[Y.replace(g0,"")]=B;else if(Y.startsWith(L0))H[Y.replace(L0,"")]=B;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);if(X)if(K0.test(Y))q.map.spreadAttrs.push(Y),U=!0;else q.map.explicitAttrs.push(Y),!U?q.map.beforeSpreadAttrs.push(Y):q.map.afterSpreadAttrs.push(Y);q.expressions[Y]=B||""}else if(q.literals[Y]=B,X)q.map.explicitAttrs.push(Y),!U?q.map.beforeSpreadAttrs.push(Y):q.map.afterSpreadAttrs.push(Y)}),{argv:G,events:W,functions:H,attrs:q}}__withPath__(J,Z){const W=this.__inpath__;this.__inpath__=J;const H=Z();return this.__inpath__=W,H}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+y1}`)}__evaluate__(J,Z,W){J=typeof J==="string"?J.trim():J;try{const H=(q)=>{const X=this.state.toJSON(),G=(Y,...B)=>{try{return Y(...B)}catch(O){!W?.mute&&console.error("Eval error --",O);return}};let U=`return ${q};`;if(Z){let Y={},B;for(let K in Z){if(K==="__arguments__")continue;Y[K]=Z[K].value}if(typeof Z.__arguments__==="object")B=Z.__arguments__;U=`with( scope ){ ${U} }`;const O=new Function("self","input","state","static","context","scope","arguments",U);return G(O,this,this.input,X,this.static,this.context,Y||{},B)}else{const Y=new Function("self","input","state","static","context",U);return G(Y,this,this.input,X,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return H(J.slice(1));return J.replace(_1,(q,X)=>H(X))}return H(J)}catch(H){!W?.mute&&console.error("Expression evaluation error --",H);return}}__evaluateFunction__(J,Z,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Z);else{let[H,...q]=J.split(/\s*,\s*/),X;const G=this.__evaluate__(H,W,{mute:!0});if(typeof G==="function")X=G;else{if(typeof this[H]!=="function")throw new Error(`Undefined <${H}> handler method`);X=this[H].bind(this)}if(typeof X!=="function")throw new Error(`Expected <${H}> to be a function or handler method`);let U=q.map((Y)=>this.__evaluate__(Y,W));if(Z.length)U=[...U,...Z];return X(...U)}}__evaluateSpreadAttr__(J,Z){const W=this.__evaluate__(J.replace(K0,""),Z.memo);if(!W){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof W!=="object"||Array.isArray(W))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(W)||[],typeof Z.each==="function")for(let H in W)Z.each(H,W[H])}__interpolate__(J,Z,W){if(J=J.replace(_1,(H,q)=>this.__evaluate__(q,Z)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:W,_event:H,instruction:q,scope:X,__dependencies__:G}=J;let U=X;if(Z.on(H,(...Y)=>this.__evaluateFunction__(q,Y,U)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,X))this.__extractExpressionDeps__(q,X).forEach((B)=>this.__trackDep__(G,B,X||{},{nodetype:"event",nodepath:W,deppath:`${W}.${H}`,target:"event-handler",$fragment:!(Z instanceof k0)?Z:null,boundaries:Z instanceof k0?Z.__boundaries__:void 0,update:(O)=>{U=O}}))}__detachEvent__({element:J,nodepath:Z,_event:W,instruction:H,scope:q,__dependencies__:X}){if(J.off(W),this.__isReactive__(H,q)){const G=this.__extractExpressionDeps__(H,q),U=`${Z}.${W}`;G.forEach((Y)=>{X.get(Y)?.delete(U),this.FGUD.get(Y)?.delete(U)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const X=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(X,Z).forEach((U)=>W.add(U))}),Array.from(W)}__extractExpressionDeps__(J,Z){const W=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,H=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let X=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(H)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const G=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),U=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");X=[...X,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(U))]}return[...new Set(X.map((G)=>G[0]))]}__isReactive__(J,Z){if(/(self|state|input|context|arguments)(\.[\w.]+)?/.test(J))return!0;if(Z&&Object.keys(Z).length&&new RegExp(Object.keys(Z).join("|")).test(J))return!0;return!1}__bindMemo__(J,Z){const W=Z.deppath||Z.nodepath,H=this.FGUDMemory.get(Z.nodepath);if(H)H.tracks.set(W,Z.priority||2),H.memo=J,this.FGUDMemory.set(Z.nodepath,H);else{const q=new Map;q.set(W,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,W=this.FGUDMemory.get(J.nodepath);if(!W||!W.tracks.get(Z))return;W.tracks.delete(Z),!W.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,W,H){if(W&&W[Z]&&W[Z].type==="let")H.haslet=!0;if(H.priority===void 0)if(H.target==="attr"&&Z.split(".").find((X)=>b5.includes(X)))H.priority=0;else if(H.syntax)H.priority=1;else if(["event"].includes(H.nodetype))H.priority=3;else H.priority=2;const q=H.deppath||H.nodepath;H.level=q.split(/\//g).length,H.priority=H.level*f5+H.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,H),this.__bindMemo__(W,H),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((W,H)=>W?.[H],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const W={state:this.state,input:this.input,context:this.context},H=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(W[J],Z);return!w0(H,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[W,...H]=Z.split(".");if(!this.__shouldUpdate__(W,H))return;J.forEach((q)=>{try{const X=q.deppath||q.nodepath;if(q.garbage||q.boundaries?.start&&!document.contains(q.boundaries.start)||q.$fragment!==null&&!q.$fragment.closest("body").length){J.delete(X),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:X,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(X){console.error("failed to update dependency nodes --",X);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((H,q)=>{if(!H.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const X=H.deppath||H.nodepath,G=this.FGUDMemory.get(H.nodepath);if(!G){console.warn(`unexpected occurence: <${X}> has no memo`);return}G.memo={...G.memo,...W},this.UQS.queue({dep:J,deppath:X,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const W="arguments";this.FGUD.get(W)?.forEach((H,q)=>{if(!this.__hasSamePathParent__(q,J))return;const X=H.deppath||H.nodepath,G=this.FGUDMemory.get(H.nodepath);if(!G){console.warn(`unexpected occurence: <${X}> has no memo`);return}G.memo.__arguments__=Z,this.UQS.queue({dep:W,deppath:X,priority:H.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const W=this.FGUDMemory.get(J.nodepath);if(!W){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(W.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Q0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Q0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Q0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var u1={};c0(u1,{handler:()=>{{return $8}},declaration:()=>{{return E8}},_static:()=>{{return A8}}});var E8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},A8={initialized:!1,prevRenderer:null},$8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const H=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!H?.length)return;if(W)return H;J.renderer.fill(H)}else{this.static.prevRenderer?.cleanup();let H=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let X of J["else-if"]){if(!X.by)continue;if(q=X.renderer.mesh({},Z),this.static.prevRenderer=X.renderer,!q?.length)return;if(W)return q;q?.length&&X.renderer.fill(q),H=!0;break}if(!H&&J.else){const X=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!X?.length)return;if(W)return X;J.else.renderer.fill(X)}}}};var m1={};c0(m1,{handler:()=>{{return g8}},declaration:()=>{{return S8}},_static:()=>{{return b8}}});var N0=e0(p0(),1);var S8={name:"for",syntax:!0},b8={lastIn:null,argvlist:null,initialized:!1,prevRenderer:null,processingBatch:!1},g8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:H,from:q,to:X}=J;if(H===void 0&&q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(q!==void 0)return this.asFromTo(J.renderer,q,X,Z,W);else if(Array.isArray(H))return this.asArray(J.renderer,H,Z,W);else if(H instanceof Map)return this.asMap(J.renderer,H,Z,W);else if(typeof H=="object")return this.asObject(J.renderer,H,Z,W)}finally{this.static.processingBatch=!1}},addItem(J,Z,W,H){if(!this.static.argvlist)this.static.argvlist=[];const q=`[${H}]`,X=J.mesh(W,Z,q);if(!X)return;const{boundaries:G,$partial:U}=J.demarcate(X,q);return this.static.prevRenderer=J,this.static.argvlist.push({argvalues:W,boundaries:G}),U},updateItem(J,Z,W,H){if(!this.static.argvlist?.[H])return;this.static.argvlist[H].argvalues=W,J.update(Object.keys(W),W,Z,this.static.argvlist[H].boundaries,`[${H}]`)},removeItem(J,Z){if(!this.static.argvlist?.[Z])return;J.cleanup(this.static.argvlist[Z].boundaries,`[${Z}]`),this.static.argvlist.splice(Z,1)},asFromTo(J,Z,W,H,q){if(Z=parseFloat(String(Z)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");W=parseFloat(String(W));const X=Z<W,G=Math.abs(W-Z)+1;if(Array.isArray(this.static.argvlist)){const[Y]=J.argv;if(Y){let B=Z;if(this.static.argvlist.length===G){for(let K=0;K<this.static.argvlist.length;K++)this.static.argvlist[K].argvalues[Y].value!==B&&this.updateItem(J,H,{[Y]:{value:B,type:"arg"}},K),B=X?B+1:B-1;return}const O=Math.min(this.static.argvlist.length,G);for(let K=0;K<O;K++)this.updateItem(J,H,{[Y]:{value:K,type:"arg"}},K);if(G>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<G;K++){const S={[Y]:{value:K,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,H,S,K))}else if(G<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=G;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let U=N0.default();for(let Y=Z;X?Y<=W:Y>=W;X?Y++:Y--){const B={},[O]=J.argv;if(O)B[O]={value:Y,type:"arg"};U=U.add(this.addItem(J,H,B,Y))}if(!U?.length)return;if(q)return U;J.fill(U)},asArray(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,U]=J.argv;if(G){if(this.static.argvlist.length===Z.length){for(let B=0;B<this.static.argvlist.length;B++)!w0(this.static.argvlist[B].argvalues[G].value,Z[B])&&this.updateItem(J,W,{[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}},B);return}const Y=Math.min(this.static.argvlist.length,Z.length);for(let B=0;B<Y;B++)this.updateItem(J,W,{[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}},B);if(Z.length>this.static.argvlist.length)for(let B=this.static.argvlist.length;B<Z.length;B++){const O={[G]:{value:Z[B],type:"arg"},[U]:{value:B,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,W,O,B))}else if(Z.length<this.static.argvlist.length)for(let B=this.static.argvlist.length-1;B>=Z.length;B--)this.removeItem(J,B)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let G of Z){const U={},[Y,B]=J.argv;if(Y)U[Y]={value:G,type:"arg"};if(B)U[B]={value:X,type:"arg"};q=q.add(this.addItem(J,W,U,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},asMap(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,U,Y]=J.argv,B=Array.from(Z.entries());if(G){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!w0(this.static.argvlist[K].argvalues[G].value,B[K][0])||!w0(this.static.argvlist[K].argvalues[U].value,B[K][1])&&this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);return}const O=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<O;K++)this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length)for(let K=this.static.argvlist.length;K<B.length;K++){const S={[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}};this.boundaries&&N0.default(this.boundaries.end).before(this.addItem(J,W,S,K))}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let[G,U]of Z){const Y={},[B,O,K]=J.argv;if(B)Y[B]={value:G,type:"arg"};if(O)Y[O]={value:U,type:"arg"};if(K)Y[K]={value:X,type:"arg"};q=q.add(this.addItem(J,W,Y,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},asObject(J,Z,W,H){if(this.static.argvlist&&this.static.lastIn&&Z===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update")}if(this.static.lastIn=Z,Array.isArray(this.static.argvlist)){const[G,U,Y]=J.argv,B=Object.entries(Z);if(G){if(this.static.argvlist.length===B.length){for(let K=0;K<this.static.argvlist.length;K++)!w0(this.static.argvlist[K].argvalues[G].value,B[K][0])||!w0(this.static.argvlist[K].argvalues[U].value,B[K][1])&&this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);return}const O=Math.min(this.static.argvlist.length,B.length);for(let K=0;K<O;K++)this.updateItem(J,W,{[G]:{value:B[K][0],type:"arg"},[U]:{value:B[K][1],type:"arg"},[Y]:{value:K,type:"arg"}},K);if(B.length>this.static.argvlist.length){let K=N0.default();for(let S=this.static.argvlist.length;S<B.length;S++){const m={[G]:{value:B[S][0],type:"arg"},[U]:{value:B[S][1],type:"arg"},[Y]:{value:S,type:"arg"}},e=this.addItem(J,W,m,S);K=K.add(e)}this.boundaries&&N0.default(this.boundaries.end).before(K)}else if(B.length<this.static.argvlist.length)for(let K=this.static.argvlist.length-1;K>=B.length;K--)this.removeItem(J,K)}return}this.static.prevRenderer?.cleanup(),this.static.argvlist=[];let q=N0.default(),X=0;for(let G in Z){const U={},[Y,B,O]=J.argv;if(Y)U[Y]={value:G,type:"arg"};if(B)U[B]={value:Z[G],type:"arg"};if(O)U[O]={value:X,type:"arg"};q=q.add(this.addItem(J,W,U,X)),X++}if(!q?.length)return;if(H)return q;J.fill(q)},onDestroy(){this.static.prevRenderer?.cleanup(void 0,!0),this.static.prevRenderer=null,this.static.argvlist=null,this.static.lastIn=null}};var d1={};c0(d1,{handler:()=>{{return h8}},declaration:()=>{{return x8}},_static:()=>{{return k8}}});var x8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k8={initialized:!1,finalized:!1,prevRenderer:null},h8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.static.finalized=!1,J.loading){this.static.prevRenderer?.cleanup();const H=J.loading.renderer.mesh({},Z);if(this.static.prevRenderer=J.loading.renderer,this.execute(J,Z,!0),this.static.finalized)return;if(!H?.length)return;if(W)return H;J.loading.renderer.fill(H)}else this.execute(J,Z)},execute(J,Z,W=!1){J.await.then((H)=>{if(this.static.prevRenderer?.cleanup(),!J.then)return;const[q]=J.then.renderer.argv,X={[q]:{value:H,type:"arg"}},G=J.then.renderer.mesh(X,Z);if(this.static.prevRenderer=J.then.renderer,!G?.length)return;if(!W)return G;J.then.renderer.fill(G)}).catch((H)=>{if(this.static.prevRenderer?.cleanup(),!J.catch)return;const[q]=J.catch.renderer.argv,X={[q]:{value:H,type:"arg"}},G=J.catch.renderer.mesh(X,Z);if(this.static.prevRenderer=J.catch.renderer,!G?.length)return;if(!W)return G;J.catch.renderer.fill(G)}).finally(()=>this.static.finalized=!0)}};var i1={};c0(i1,{handler:()=>{{return y8}},declaration:()=>{{return f8}},_static:()=>{{return _8}}});var f8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},_8={initialized:!1,prevRenderer:null},y8={onInput(J){this.static.initialized&&this.processor(this.input,J)},onSelfRender(){const J=this.processor(this.input,void 0,!0);return this.static.initialized=!0,J},processor(J,Z,W=!1){let H=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?H=[...new Set([...H,...q.is])]:H.push(q.is);const X=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!X?.length)return;if(W)return X;q.renderer.fill(X)}if(H.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(W)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var c1={};c0(c1,{state:()=>{{return v8}},handler:()=>{{return i8}},default:()=>{{return c8}},context:()=>{{return m8}},_static:()=>{{return u8}}});var d8=function(J){const Z={};return J.split("&").map((H)=>{const[q,X]=H.split("=");Z[q]=X}),Z},v8={page:null,params:{},query:{}},u8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},m8=["navigate"],i8={onInput(){this.processor(this.input)},processor(J){if(!J.routes)return;if(J.global)this.static.global=J.global;if(this.static.routes=J.routes.map(({path:Z,template:W,default:H})=>{if(H)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],X=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:W,default:H,pathVars:q,pathRegex:new RegExp(`${X}\$`,"i")}}),J.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Z){!Z&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const H=W[1]?d8(W[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:H}});const X=this.match(J);if(!X){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:U}=X;this.emit("after",{fromState:q,toState:{path:G.path,params:U,query:H}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=U,this.state.query=H,this.state.page=G.template},match(J){const Z={};let W=!1;for(let H of this.static.routes){const{pathVars:q,pathRegex:X}=H,G=J.match(X);if(G!==null&&G.index===0){for(let U=0;U+1<G.length&&U<q.length;U++)Z[q[U].replaceAll(/[\/:]/g,"")]=G[U+1];W=H;break}}return W?{route:W,params:Z}:!1}},c8="<{state.page} params=state.params query=state.query/>";class i0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new X1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new Q1,this.IUC=new Z1;const[Z,W]=x0(this.i18n.lang),[H,q]=x0(J?.context||{});this.__setLang=W,this.__getLang=Z,this.__setContext=q,this.__getContext=H,this.register("if",u1),this.register("for",m1),this.register("async",d1),this.register("switch",i1),this.register("router",c1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,W){const{default:H,...q}=Z,X={debug:this.debug,prepath:"0",lips:this},G=new k0(J,H||"",{...q,input:W},X);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(U)=>{!U.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(J,Z){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Z),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new d0("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const W=this.__getContext();if(typeof J==="string"){const H={...W,[J]:Z};G0(W,H)&&this.__setContext(H)}else if(!Array.isArray(J)){const H={...W,...J};G0(W,H)&&this.__setContext(H)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;r0(()=>{const W=this.__getContext();if(!W)return;const H=Object.fromEntries(J.map((q)=>[q,W[q]]));H&&typeof Z==="function"&&Object.keys(H).length&&Z(H)})}useTranslator(J,Z){r0(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Z==="function"&&Z(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}function p8(J="body"){const Z={counter:0,counterHistory:[],updateFrequency:16,isRunning:!1,metrics:{fps:0,avgRenderTime:0,totalUpdates:0,memoryUsageMB:0,domOperations:0}},W={updateInterval:null,frameCountInterval:null,frameCount:0,lastFrameTimestamp:0,updateTimes:[]},H={onCreate(){console.log("Stress test component created")},onMount(){console.log("Stress test component mounted"),this.startPerformanceTracking()},onRender(){const Y=performance.now();if(this.static.lastFrameTimestamp){const B=Y-this.static.lastFrameTimestamp;if(B<1000){if(this.static.updateTimes.push(B),this.static.updateTimes.length>100)this.static.updateTimes.shift()}}this.static.lastFrameTimestamp=Y,this.static.frameCount++},startPerformanceTracking(){this.static.frameCountInterval=setInterval(()=>{if(this.state.metrics.fps=this.static.frameCount,this.static.frameCount=0,this.static.updateTimes.length){const Y=this.static.updateTimes.reduce((B,O)=>B+O,0)/this.static.updateTimes.length;this.state.metrics.avgRenderTime=Y}if(window.performance&&window.performance.memory)this.state.metrics.memoryUsageMB=window.performance.memory.usedJSHeapSize/1048576},1000)},startStressTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.counterHistory=[],this.static.updateInterval=setInterval(()=>{if(this.state.counter++,this.state.metrics.totalUpdates++,this.state.counterHistory.length>100)this.state.counterHistory.shift();this.state.counterHistory.push(this.state.counter)},this.state.updateFrequency)},stopStressTest(){if(!this.state.isRunning)return;clearInterval(this.static.updateInterval),this.state.isRunning=!1},setUpdateFrequency(Y){const B=parseFloat(Y.target.value);if(this.state.updateFrequency=B,this.state.isRunning)this.stopStressTest(),this.startStressTest()},resetCounter(){this.state.counter=0,this.state.counterHistory=[],this.state.metrics.totalUpdates=0},runHeavyComputation(){const Y=performance.now();let B=0;for(let O=0;O<1e7;O++)B+=Math.sqrt(O);console.log(`Heavy computation completed in ${performance.now()-Y}ms, result: ${B}`)},destroy(){clearInterval(this.static.updateInterval),clearInterval(this.static.frameCountInterval)}},U=new i0({debug:!0}).render("StressTestApp",{default:`
2
2
  <div class="stress-test-container">
3
3
  <h2>Lips Framework Stress Test</h2>
4
4
 
@@ -65,7 +65,7 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
65
65
  </table>
66
66
  </div>
67
67
  </div>
68
- `,state:Z,_static:W,handler:X,stylesheet:`
68
+ `,state:Z,_static:W,handler:H,stylesheet:`
69
69
  .stress-test-container {
70
70
  font-family: 'Arial', sans-serif;
71
71
  max-width: 800px;
@@ -205,7 +205,7 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
205
205
  font-size: 1.1em;
206
206
  color: #1976d2;
207
207
  }
208
- `},{});return Y.appendTo(J),Y}function l8(J="body",Z=5000){console.log(`Running high frequency update test for ${Z}ms...`);const W={counter:0,elapsedTime:0,updatesPerSecond:0,totalUpdates:0,isRunning:!1,testComplete:!1,testResults:{totalUpdates:0,duration:0,updatesPerSecond:0,avgUpdateTime:0}},X={updateIntervalId:null,startTime:0,updateTimes:[]},q={startTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.testComplete=!1,this.state.counter=0,this.state.totalUpdates=0,this.state.elapsedTime=0,this.static.startTime=performance.now(),this.static.updateTimes=[];const M=()=>{if(!this.state.isRunning)return;const j=performance.now();if(this.state.counter++,this.state.totalUpdates++,this.state.elapsedTime=j-this.static.startTime,this.state.elapsedTime>0)this.state.updatesPerSecond=Math.round(this.state.totalUpdates/this.state.elapsedTime*1000);const N=performance.now();if(this.static.updateTimes.push(N-j),this.state.elapsedTime>=Z){this.finishTest();return}requestAnimationFrame(M)};requestAnimationFrame(M)},finishTest(){this.state.isRunning=!1,this.state.testComplete=!0;const M=this.static.updateTimes.reduce((j,N)=>j+N,0)/this.static.updateTimes.length;this.state.testResults={totalUpdates:this.state.totalUpdates,duration:this.state.elapsedTime,updatesPerSecond:this.state.updatesPerSecond,avgUpdateTime:M},console.log("High Frequency Test Results:",this.state.testResults)}},H=`
208
+ `},{});return U.appendTo(J),U}function s8(J="body",Z=5000){console.log(`Running high frequency update test for ${Z}ms...`);const W={counter:0,elapsedTime:0,updatesPerSecond:0,totalUpdates:0,isRunning:!1,testComplete:!1,testResults:{totalUpdates:0,duration:0,updatesPerSecond:0,avgUpdateTime:0}},H={updateIntervalId:null,startTime:0,updateTimes:[]},q={startTest(){if(this.state.isRunning)return;this.state.isRunning=!0,this.state.testComplete=!1,this.state.counter=0,this.state.totalUpdates=0,this.state.elapsedTime=0,this.static.startTime=performance.now(),this.static.updateTimes=[];const B=()=>{if(!this.state.isRunning)return;const O=performance.now();if(this.state.counter++,this.state.totalUpdates++,this.state.elapsedTime=O-this.static.startTime,this.state.elapsedTime>0)this.state.updatesPerSecond=Math.round(this.state.totalUpdates/this.state.elapsedTime*1000);const K=performance.now();if(this.static.updateTimes.push(K-O),this.state.elapsedTime>=Z){this.finishTest();return}requestAnimationFrame(B)};requestAnimationFrame(B)},finishTest(){this.state.isRunning=!1,this.state.testComplete=!0;const B=this.static.updateTimes.reduce((O,K)=>O+K,0)/this.static.updateTimes.length;this.state.testResults={totalUpdates:this.state.totalUpdates,duration:this.state.elapsedTime,updatesPerSecond:this.state.updatesPerSecond,avgUpdateTime:B},console.log("High Frequency Test Results:",this.state.testResults)}},X=`
209
209
  <div class="high-freq-test">
210
210
  <h2>High Frequency Update Test</h2>
211
211
  <p>This test measures how many state updates Lips can handle per second.</p>
@@ -250,7 +250,7 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
250
250
  </else>
251
251
  </div>
252
252
  </div>
253
- `,B=`
253
+ `,G=`
254
254
  .high-freq-test {
255
255
  max-width: 600px;
256
256
  margin: 20px auto;
@@ -316,7 +316,7 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
316
316
  td:first-child {
317
317
  font-weight: bold;
318
318
  }
319
- `,G=new m0({debug:!0}).render("HighFrequencyTest",{default:H,state:W,handler:q,stylesheet:B},{});return G.appendTo(J),G}function y5(J="body"){const Z={nodeCount:1000,renderTime:0,isRendering:!1,nodes:[]},W={createNodes(Y){this.state.isRendering=!0;const G=performance.now(),M=[];for(let j=0;j<Y;j++)M.push({id:j,value:`Node ${j}: ${Math.random().toString(36).substring(2,15)}`});this.state.nodes=M,this.state.renderTime=performance.now()-G,setTimeout(()=>{this.state.renderTime=performance.now()-G,this.state.isRendering=!1},10)},shuffleNodes(){this.state.isRendering=!0;const Y=performance.now(),G=[...this.state.nodes];for(let M=G.length-1;M>0;M--){const j=Math.floor(Math.random()*(M+1));[G[M],G[j]]=[G[j],G[M]]}this.state.nodes=G,setTimeout(()=>{this.state.renderTime=performance.now()-Y,this.state.isRendering=!1},10)},updateValues(){this.state.isRendering=!0;const Y=performance.now(),G=this.state.nodes.map((M)=>({...M,value:`Node ${M.id}: ${Math.random().toString(36).substring(2,15)}`}));this.state.nodes=G,setTimeout(()=>{this.state.renderTime=performance.now()-Y,this.state.isRendering=!1},10)},setNodeCount(Y){this.state.nodeCount=parseInt(Y.target.value,10)}},B=new m0({debug:!0}).render("DOMStressTest",{default:`
319
+ `,Y=new i0({debug:!0}).render("HighFrequencyTest",{default:X,state:W,handler:q,stylesheet:G},{});return Y.appendTo(J),Y}function u5(J="body"){const Z={nodeCount:1000,renderTime:0,isRendering:!1,nodes:[]},W={createNodes(U){this.state.isRendering=!0;const Y=performance.now(),B=[];for(let O=0;O<U;O++)B.push({id:O,value:`Node ${O}: ${Math.random().toString(36).substring(2,15)}`});this.state.nodes=B,this.state.renderTime=performance.now()-Y,setTimeout(()=>{this.state.renderTime=performance.now()-Y,this.state.isRendering=!1},10)},shuffleNodes(){this.state.isRendering=!0;const U=performance.now(),Y=[...this.state.nodes];for(let B=Y.length-1;B>0;B--){const O=Math.floor(Math.random()*(B+1));[Y[B],Y[O]]=[Y[O],Y[B]]}this.state.nodes=Y,setTimeout(()=>{this.state.renderTime=performance.now()-U,this.state.isRendering=!1},10)},updateValues(){this.state.isRendering=!0;const U=performance.now(),Y=this.state.nodes.map((B)=>({...B,value:`Node ${B.id}: ${Math.random().toString(36).substring(2,15)}`}));this.state.nodes=Y,setTimeout(()=>{this.state.renderTime=performance.now()-U,this.state.isRendering=!1},10)},setNodeCount(U){this.state.nodeCount=parseInt(U.target.value,10)}},G=new i0({debug:!0}).render("DOMStressTest",{default:`
320
320
  <div class="dom-stress-test">
321
321
  <h2>DOM Stress Test</h2>
322
322
 
@@ -445,7 +445,7 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
445
445
  .node:last-child {
446
446
  border-bottom: none;
447
447
  }
448
- `},{});return B.appendTo(J),B}function a6(J="body"){const Z=document.createElement("div");Z.className="stress-tests-suite",Z.innerHTML=`
448
+ `},{});return G.appendTo(J),G}function a6(J="body"){const Z=document.createElement("div");Z.className="stress-tests-suite",Z.innerHTML=`
449
449
  <h1>Lips Framework Stress Test Suite</h1>
450
450
 
451
451
  <div class="test-section" id="stress-test"></div>
@@ -471,6 +471,6 @@ var Y8=Object.create;var{defineProperty:A1,getPrototypeOf:M8,getOwnPropertyNames
471
471
  padding: 10px;
472
472
  border-radius: 8px;
473
473
  }
474
- `,document.head.appendChild(W),document.querySelector(J)?.appendChild(Z),s8("#stress-test"),l8("#high-frequency-test",3000),y5("#dom-stress-test"),{container:Z}}y5();export{l8 as runHighFrequencyTest,y5 as runDOMStressTest,a6 as runAllStressTests,s8 as createLipsStressTest};
474
+ `,document.head.appendChild(W),document.querySelector(J)?.appendChild(Z),p8("#stress-test"),s8("#high-frequency-test",3000),u5("#dom-stress-test"),{container:Z}}u5();export{s8 as runHighFrequencyTest,u5 as runDOMStressTest,a6 as runAllStressTests,p8 as createLipsStressTest};
475
475
 
476
- //# debugId=52AFE438659F821864756e2164756e21
476
+ //# debugId=6F96B9EA6365CCED64756e2164756e21