@lipsjs/lips 0.0.12 → 0.0.14

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