@lipsjs/lips 0.0.2 → 0.0.4
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.
- package/README.md +5 -3
- package/dist/lips.min.js +2 -2
- package/dist/lips.min.js.map +13 -12
- package/dist/test.component.min.js +23 -25
- package/dist/test.component.min.js.map +17 -16
- package/dist/test.stress.min.js +6 -6
- package/dist/test.stress.min.js.map +13 -12
- package/dist/types/component.d.ts +3 -1
- package/dist/types/i18n/formatters.d.ts +3 -0
- package/dist/types/i18n/index.d.ts +19 -0
- package/dist/types/index.d.ts +11 -4
- package/dist/types/lips.d.ts +5 -1
- package/dist/types/metrics.d.ts +2 -0
- package/dist/types/syntax/for.d.ts +1 -1
- package/dist/types/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
var ZJ=Object.create;var{defineProperty:$1,getPrototypeOf:QJ,getOwnPropertyNames:WJ}=Object;var XJ=Object.prototype.hasOwnProperty;var R1=(J,Q,W)=>{W=J!=null?ZJ(QJ(J)):{};const q=Q||!J||!J.__esModule?$1(W,"default",{value:J,enumerable:!0}):W;for(let Y of WJ(J))if(!XJ.call(q,Y))$1(q,Y,{get:()=>J[Y],enumerable:!0});return q};var HJ=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var u0=(J,Q)=>{for(var W in Q)$1(J,W,{get:Q[W],enumerable:!0,configurable:!0,set:(q)=>Q[W]=()=>q})};var J1=HJ((a1,e1)=>{(function(){var J=document,Q=window,W=J.documentElement,q=J.createElement.bind(J),Y=q("div"),z=q("table"),K=q("tbody"),X=q("tr"),j=Array.isArray,U=Array.prototype,D=U.concat,$=U.filter,_=U.indexOf,A=U.map,u=U.push,i=U.slice,e=U.some,l=U.splice,c=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,h=/<.+>/,y=/^\w+$/;function T(Z,H){var B=r(H);return!Z||!B&&!P(H)&&!S(H)?[]:!B&&d.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!B&&y.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var O=function(){function Z(H,B){if(!H)return;if(L(H))return H;var M=H;if(E(H)){var I=B||J;if(M=c.test(H)&&P(I)?I.getElementById(H.slice(1).replace(/\\/g,"")):h.test(H)?v1(H):L(I)?I.find(H):E(I)?w(I).find(H):T(H,I),!M)return}else if(C(H))return this.ready(H);if(M.nodeType||M===Q)M=[M];this.length=M.length;for(var N=0,g=this.length;N<g;N++)this[N]=M[N]}return Z.prototype.init=function(H,B){return new Z(H,B)},Z}(),G=O.prototype,w=G.init;if(w.fn=w.prototype=G,G.length=0,G.splice=l,typeof Symbol==="function")G[Symbol.iterator]=U[Symbol.iterator];function L(Z){return Z instanceof O}function V(Z){return!!Z&&Z===Z.window}function P(Z){return!!Z&&Z.nodeType===9}function r(Z){return!!Z&&Z.nodeType===11}function S(Z){return!!Z&&Z.nodeType===1}function x(Z){return!!Z&&Z.nodeType===3}function v(Z){return typeof Z==="boolean"}function C(Z){return typeof Z==="function"}function E(Z){return typeof Z==="string"}function b(Z){return Z===void 0}function R(Z){return Z===null}function F(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function k(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}w.isWindow=V,w.isFunction=C,w.isArray=j,w.isNumeric=F,w.isPlainObject=k;function f(Z,H,B){if(B){var M=Z.length;while(M--)if(H.call(Z[M],M,Z[M])===!1)return Z}else if(k(Z)){var I=Object.keys(Z);for(var M=0,N=I.length;M<N;M++){var g=I[M];if(H.call(Z[g],g,Z[g])===!1)return Z}}else for(var M=0,N=Z.length;M<N;M++)if(H.call(Z[M],M,Z[M])===!1)return Z;return Z}w.each=f,G.each=function(Z){return f(this,Z)},G.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function o(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var B=v(Z[0])?Z.shift():!1,M=Z.shift(),I=Z.length;if(!M)return{};if(!I)return o(B,w,M);for(var N=0;N<I;N++){var g=Z[N];for(var m in g)if(B&&(j(g[m])||k(g[m]))){if(!M[m]||M[m].constructor!==g[m].constructor)M[m]=new g[m].constructor;o(B,M[m],g[m])}else M[m]=g[m]}return M}w.extend=o,G.extend=function(Z){return o(G,Z)};var s=/\S+/g;function p(Z){return E(Z)?Z.match(s)||[]:[]}G.toggleClass=function(Z,H){var B=p(Z),M=!b(H);return this.each(function(I,N){if(!S(N))return;f(B,function(g,m){if(M)H?N.classList.add(m):N.classList.remove(m);else N.classList.toggle(m)})})},G.addClass=function(Z){return this.toggleClass(Z,!0)},G.removeAttr=function(Z){var H=p(Z);return this.each(function(B,M){if(!S(M))return;f(H,function(I,N){M.removeAttribute(N)})})};function U0(Z,H){if(!Z)return;if(E(Z)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var B=this[0].getAttribute(Z);return R(B)?void 0:B}if(b(H))return this;if(R(H))return this.removeAttr(Z);return this.each(function(I,N){if(!S(N))return;N.setAttribute(Z,H)})}for(var M in Z)this.attr(M,Z[M]);return this}G.attr=U0,G.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},G.hasClass=function(Z){return!!Z&&e.call(this,function(H){return S(H)&&H.classList.contains(Z)})},G.get=function(Z){if(b(Z))return i.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},G.eq=function(Z){return w(this.get(Z))},G.first=function(){return this.eq(0)},G.last=function(){return this.eq(-1)};function J0(Z){if(b(Z))return this.get().map(function(H){return S(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!S(B))return;B.textContent=Z})}G.text=J0;function n(Z,H,B){if(!S(Z))return;var M=Q.getComputedStyle(Z,null);return B?M.getPropertyValue(H)||void 0:M[H]||Z.style[H]}function q0(Z,H){return parseInt(n(Z,H),10)||0}function m0(Z,H){return q0(Z,"border".concat(H?"Left":"Top","Width"))+q0(Z,"padding".concat(H?"Left":"Top"))+q0(Z,"padding".concat(H?"Right":"Bottom"))+q0(Z,"border".concat(H?"Right":"Bottom","Width"))}var $0={};function N0(Z){if($0[Z])return $0[Z];var H=q(Z);J.body.insertBefore(H,null);var B=n(H,"display");return J.body.removeChild(H),$0[Z]=B!=="none"?B:"block"}function O0(Z){return n(Z,"display")==="none"}function b0(Z,H){var B=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!B&&!!H&&B.call(Z,H)}function R0(Z){return E(Z)?function(H,B){return b0(B,Z)}:C(Z)?Z:L(Z)?function(H,B){return Z.is(B)}:!Z?function(){return!1}:function(H,B){return B===Z}}G.filter=function(Z){var H=R0(Z);return w($.call(this,function(B,M){return H.call(B,M,B)}))};function S0(Z,H){return!H?Z:Z.filter(H)}G.detach=function(Z){return S0(this,Z).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var R5=/^\s*<(\w+)[^>]*>/,T5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,y1={"*":Y,tr:K,td:X,th:X,thead:z,tbody:z,tfoot:z};function v1(Z){if(!E(Z))return[];if(T5.test(Z))return[q(RegExp.$1)];var H=R5.test(Z)&&RegExp.$1,B=y1[H]||y1["*"];return B.innerHTML=Z,w(B.childNodes).detach().get()}w.parseHTML=v1,G.has=function(Z){var H=E(Z)?function(B,M){return T(Z,M).length}:function(B,M){return M.contains(Z)};return this.filter(H)},G.not=function(Z){var H=R0(Z);return this.filter(function(B,M){return(!E(Z)||S(M))&&!H.call(M,B,M)})};function F0(Z,H,B,M){var I=[],N=C(H),g=M&&R0(M);for(var m=0,M0=Z.length;m<M0;m++)if(N){var W0=H(Z[m]);if(W0.length)u.apply(I,W0)}else{var B0=Z[m][H];while(B0!=null){if(M&&g(-1,B0))break;I.push(B0),B0=B?B0[H]:null}}return I}function m1(Z){if(Z.multiple&&Z.options)return F0($.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function A5(Z){if(!arguments.length)return this[0]&&m1(this[0]);return this.each(function(H,B){var M=B.multiple&&B.options;if(M||t1.test(B.type)){var I=j(Z)?A.call(Z,String):R(Z)?[]:[String(Z)];if(M)f(B.options,function(N,g){g.selected=I.indexOf(g.value)>=0},!0);else B.checked=I.indexOf(B.value)>=0}else B.value=b(Z)||R(Z)?"":Z})}G.val=A5,G.is=function(Z){var H=R0(Z);return e.call(this,function(B,M){return H.call(B,M,B)})},w.guid=1;function D0(Z){return Z.length>1?$.call(Z,function(H,B,M){return _.call(M,H)===B}):Z}w.unique=D0,G.add=function(Z,H){return w(D0(this.get().concat(w(Z,H).get())))},G.children=function(Z){return S0(w(D0(F0(this,function(H){return H.children}))),Z)},G.parent=function(Z){return S0(w(D0(F0(this,"parentNode"))),Z)},G.index=function(Z){var H=Z?w(Z)[0]:this[0],B=Z?this:w(H).parent().children();return _.call(B,H)},G.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Z)},G.siblings=function(Z){return S0(w(D0(F0(this,function(H){return w(H).parent().children().not(H)}))),Z)},G.find=function(Z){return w(D0(F0(this,function(H){return T(Z,H)})))};var b5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,x5=/^$|^module$|\/(java|ecma)script/i,_5=["type","src","nonce","noModule"];function f5(Z,H){var B=w(Z);B.filter("script").add(B.find("script")).each(function(M,I){if(x5.test(I.type)&&W.contains(I)){var N=q("script");N.text=I.textContent.replace(b5,""),f(_5,function(g,m){if(I[m])N[m]=I[m]}),H.head.insertBefore(N,null),H.head.removeChild(N)}})}function g5(Z,H,B,M,I){if(M)Z.insertBefore(H,B?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,B?Z:Z.nextSibling);if(I)f5(H,Z.ownerDocument)}function P0(Z,H,B,M,I,N,g,m){return f(Z,function(M0,W0){f(w(W0),function(B0,T0){f(w(H),function(w0,s0){var N1=B?T0:s0,S1=B?s0:T0,z0=B?B0:w0;g5(N1,!z0?S1:S1.cloneNode(!0),M,I,!z0)},m)},g)},N),H}G.after=function(){return P0(arguments,this,!1,!1,!1,!0,!0)},G.append=function(){return P0(arguments,this,!1,!1,!0)};function k5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(b(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(B,M){if(!S(M))return;if(H)w(M).empty().append(Z);else M.innerHTML=Z})}G.html=k5,G.appendTo=function(Z){return P0(arguments,this,!0,!1,!0)},G.wrapInner=function(Z){return this.each(function(H,B){var M=w(B),I=M.contents();I.length?I.wrapAll(Z):M.append(Z)})},G.before=function(){return P0(arguments,this,!1,!0)},G.wrapAll=function(Z){var H=w(Z),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},G.wrap=function(Z){return this.each(function(H,B){var M=w(Z)[0];w(B).wrapAll(!H?M:M.cloneNode(!0))})},G.insertAfter=function(Z){return P0(arguments,this,!0,!1,!1,!1,!1,!0)},G.insertBefore=function(Z){return P0(arguments,this,!0,!0)},G.prepend=function(){return P0(arguments,this,!1,!0,!0,!0,!0)},G.prependTo=function(Z){return P0(arguments,this,!0,!0,!0,!1,!1,!0)},G.contents=function(){return w(D0(F0(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},G.next=function(Z,H,B){return S0(w(D0(F0(this,"nextElementSibling",H,B))),Z)},G.nextAll=function(Z){return this.next(Z,!0)},G.nextUntil=function(Z,H){return this.next(H,!0,Z)},G.parents=function(Z,H){return S0(w(D0(F0(this,"parentElement",!0,H))),Z)},G.parentsUntil=function(Z,H){return this.parents(H,Z)},G.prev=function(Z,H,B){return S0(w(D0(F0(this,"previousElementSibling",H,B))),Z)},G.prevAll=function(Z){return this.prev(Z,!0)},G.prevUntil=function(Z,H){return this.prev(H,!0,Z)},G.map=function(Z){return w(D.apply([],A.call(this,function(H,B){return Z.call(H,B,H)})))},G.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},G.offsetParent=function(){return this.map(function(Z,H){var B=H.offsetParent;while(B&&n(B,"position")==="static")B=B.offsetParent;return B||W})},G.slice=function(Z,H){return w(i.call(this,Z,H))};var h5=/-([a-z])/g;function U1(Z){return Z.replace(h5,function(H,B){return B.toUpperCase()})}G.ready=function(Z){var H=function(){return setTimeout(Z,0,w)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},G.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var B=w(H);B.replaceWith(B.children())}),this},G.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},G.position=function(){var Z=this[0];if(!Z)return;var H=n(Z,"position")==="fixed",B=H?Z.getBoundingClientRect():this.offset();if(!H){var M=Z.ownerDocument,I=Z.offsetParent||M.documentElement;while((I===M.body||I===M.documentElement)&&n(I,"position")==="static")I=I.parentNode;if(I!==Z&&S(I)){var N=w(I).offset();B.top-=N.top+q0(I,"borderTopWidth"),B.left-=N.left+q0(I,"borderLeftWidth")}}return{top:B.top-q0(Z,"marginTop"),left:B.left-q0(Z,"marginLeft")}};var u1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};G.prop=function(Z,H){if(!Z)return;if(E(Z)){if(Z=u1[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(M,I){I[Z]=H})}for(var B in Z)this.prop(B,Z[B]);return this},G.removeProp=function(Z){return this.each(function(H,B){delete B[u1[Z]||Z]})};var y5=/^--/;function D1(Z){return y5.test(Z)}var F1={},v5=Y.style,m5=["webkit","moz","ms"];function u5(Z,H){if(H===void 0)H=D1(Z);if(H)return Z;if(!F1[Z]){var B=U1(Z),M="".concat(B[0].toUpperCase()).concat(B.slice(1)),I="".concat(B," ").concat(m5.join("".concat(M," "))).concat(M).split(" ");f(I,function(N,g){if(g in v5)return F1[Z]=g,!1})}return F1[Z]}var d5={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 d1(Z,H,B){if(B===void 0)B=D1(Z);return!B&&!d5[Z]&&F(H)?"".concat(H,"px"):H}function i5(Z,H){if(E(Z)){var B=D1(Z);if(Z=u5(Z,B),arguments.length<2)return this[0]&&n(this[0],Z,B);if(!Z)return this;return H=d1(Z,H,B),this.each(function(I,N){if(!S(N))return;if(B)N.style.setProperty(Z,H);else N.style[Z]=H})}for(var M in Z)this.css(M,Z[M]);return this}G.css=i5;function i1(Z,H){try{return Z(H)}catch(B){return H}}var c5=/^\s+|\s+$/;function c1(Z,H){var B=Z.dataset[H]||Z.dataset[U1(H)];if(c5.test(B))return B;return i1(JSON.parse,B)}function p5(Z,H,B){B=i1(JSON.stringify,B),Z.dataset[U1(H)]=B}function o5(Z,H){if(!Z){if(!this[0])return;var B={};for(var M in this[0].dataset)B[M]=c1(this[0],M);return B}if(E(Z)){if(arguments.length<2)return this[0]&&c1(this[0],Z);if(b(H))return this;return this.each(function(I,N){p5(N,Z,H)})}for(var M in Z)this.data(M,Z[M]);return this}G.data=o5;function p1(Z,H){var B=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],B["scroll".concat(H)],Z.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}f([!0,!1],function(Z,H){f(["Width","Height"],function(B,M){var I="".concat(H?"outer":"inner").concat(M);G[I]=function(N){if(!this[0])return;if(V(this[0]))return H?this[0]["inner".concat(M)]:this[0].document.documentElement["client".concat(M)];if(P(this[0]))return p1(this[0],M);return this[0]["".concat(H?"offset":"client").concat(M)]+(N&&H?q0(this[0],"margin".concat(B?"Top":"Left"))+q0(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),f(["Width","Height"],function(Z,H){var B=H.toLowerCase();G[B]=function(M){if(!this[0])return b(M)?void 0:this;if(!arguments.length){if(V(this[0]))return this[0].document.documentElement["client".concat(H)];if(P(this[0]))return p1(this[0],H);return this[0].getBoundingClientRect()[B]-m0(this[0],!Z)}var I=parseInt(M,10);return this.each(function(N,g){if(!S(g))return;var m=n(g,"boxSizing");g.style[B]=d1(B,I+(m==="border-box"?m0(g,!Z):0))})}});var o1="___cd";G.toggle=function(Z){return this.each(function(H,B){if(!S(B))return;var M=O0(B),I=b(Z)?M:Z;if(I){if(B.style.display=B[o1]||"",O0(B))B.style.display=N0(B.tagName)}else if(!M)B[o1]=n(B,"display"),B.style.display="none"})},G.hide=function(){return this.toggle(!1)},G.show=function(){return this.toggle(!0)};var s1="___ce",I1=".",L1={focus:"focusin",blur:"focusout"},l1={mouseenter:"mouseover",mouseleave:"mouseout"},s5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function V1(Z){return l1[Z]||L1[Z]||Z}function C1(Z){var H=Z.split(I1);return[H[0],H.slice(1).sort()]}G.trigger=function(Z,H){if(E(Z)){var B=C1(Z),M=B[0],I=B[1],N=V1(M);if(!N)return this;var g=s5.test(N)?"MouseEvents":"HTMLEvents";Z=J.createEvent(g),Z.initEvent(N,!0,!0),Z.namespace=I.join(I1),Z.___ot=M}Z.___td=H;var m=Z.___ot in L1;return this.each(function(M0,W0){if(m&&C(W0[Z.___ot]))W0["___i".concat(Z.type)]=!0,W0[Z.___ot](),W0["___i".concat(Z.type)]=!1;W0.dispatchEvent(Z)})};function r1(Z){return Z[s1]=Z[s1]||{}}function l5(Z,H,B,M,I){var N=r1(Z);N[H]=N[H]||[],N[H].push([B,M,I]),Z.addEventListener(H,I)}function n1(Z,H){return!H||!e.call(H,function(B){return Z.indexOf(B)<0})}function o0(Z,H,B,M,I){var N=r1(Z);if(!H)for(H in N)o0(Z,H,B,M,I);else if(N[H])N[H]=N[H].filter(function(g){var m=g[0],M0=g[1],W0=g[2];if(I&&W0.guid!==I.guid||!n1(m,B)||M&&M!==M0)return!0;Z.removeEventListener(H,W0)})}G.off=function(Z,H,B){var M=this;if(b(Z))this.each(function(N,g){if(!S(g)&&!P(g)&&!V(g))return;o0(g)});else if(!E(Z))for(var I in Z)this.off(I,Z[I]);else{if(C(H))B=H,H="";f(p(Z),function(N,g){var m=C1(g),M0=m[0],W0=m[1],B0=V1(M0);M.each(function(T0,w0){if(!S(w0)&&!P(w0)&&!V(w0))return;o0(w0,B0,W0,H,B)})})}return this},G.remove=function(Z){return S0(this,Z).detach().off(),this},G.replaceWith=function(Z){return this.before(Z).remove()},G.replaceAll=function(Z){return w(Z).replaceWith(this),this};function r5(Z,H,B,M,I){var N=this;if(!E(Z)){for(var g in Z)this.on(g,H,B,Z[g],I);return this}if(!E(H))if(b(H)||R(H))H="";else if(b(B))B=H,H="";else M=B,B=H,H="";if(!C(M))M=B,B=void 0;if(!M)return this;return f(p(Z),function(m,M0){var W0=C1(M0),B0=W0[0],T0=W0[1],w0=V1(B0),s0=B0 in l1,N1=B0 in L1;if(!w0)return;N.each(function(S1,z0){if(!S(z0)&&!P(z0)&&!V(z0))return;var P1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!n1(T0,X0.namespace.split(I1)))return;if(!H&&(N1&&(X0.target!==z0||X0.___ot===w0)||s0&&X0.relatedTarget&&z0.contains(X0.relatedTarget)))return;var E1=z0;if(H){var x0=X0.target;while(!b0(x0,H)){if(x0===z0)return;if(x0=x0.parentNode,!x0)return}E1=x0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return E1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return z0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return B}});var JJ=M.call(E1,X0,X0.___td);if(I)o0(z0,w0,T0,H,P1);if(JJ===!1)X0.preventDefault(),X0.stopPropagation()};P1.guid=M.guid=M.guid||w.guid++,l5(z0,w0,T0,H,P1)})}),this}G.on=r5;function n5(Z,H,B,M){return this.on(Z,H,B,M,!0)}G.one=n5;var t5=/\r?\n/g;function a5(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(t5,"\r\n")))}var e5=/file|reset|submit|button|image/i,t1=/radio|checkbox/i;if(G.serialize=function(){var Z="";return this.each(function(H,B){f(B.elements||[B],function(M,I){if(I.disabled||!I.name||I.tagName==="FIELDSET"||e5.test(I.type)||t1.test(I.type)&&!I.checked)return;var N=m1(I);if(!b(N)){var g=j(N)?N:[N];f(g,function(m,M0){Z+=a5(I.name,M0)})}})}),Z.slice(1)},typeof a1!=="undefined")e1.exports=w;else Q.cash=Q.$=w})()});class l0{default=window.navigator.language;LANGUAGE_DICTIONARIES={};setLang(J){if(this.default!==J)return this.default=J,!0;return!1}setDictionary(J,Q){this.LANGUAGE_DICTIONARIES[J]=Q}translate(J,Q){if(Q&&this.default==Q)return{text:J,lang:this.default};Q=Q||this.default;const[W,q]=Q.split("-");if(this.LANGUAGE_DICTIONARIES[W]&&J in this.LANGUAGE_DICTIONARIES[W]){if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="object"){const Y=this.LANGUAGE_DICTIONARIES[W][J];J=Y[q||"*"]||Y["*"]}else if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="string")J=this.LANGUAGE_DICTIONARIES[W][J]}return{text:J,lang:Q}}format(J,Q,W){const{text:q}=this.translate(J,W);return q.replace(/{(\w+)}/g,(Y,z)=>Q[z]||"")}}class r0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Q){this.callbacks.set(J,Q)}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((Q)=>{try{const W=this.callbacks.get(Q);if(W)W()}catch(W){console.error(`Error updating component ${Q}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class n0{subscriptions=new Map;tick=new r0;register(J,Q){this.subscriptions.set(J,Q),this.tick.register(J,Q)}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,Q)=>{this.subscriptions.set(Q,()=>{})})}proxyState(J,Q){const W=this,q=new WeakMap,Y=(K)=>{if(K instanceof Map)K.forEach((j,U)=>K.set(U,z(j)));else if(Array.isArray(K))K.forEach((j,U)=>K[U]=z(j));else if(typeof K==="object")Object.entries(K).forEach(([j,U])=>K[j]=z(U));let X=new Proxy(K,{get(j,U){if(U==="toJSON")return function(){const $=(_)=>{if(!_||typeof _!=="object")return _;if(q.has(_)){const A=q.get(_);if(A instanceof Map){const i={};return A.forEach((e,l)=>i[typeof l==="object"?JSON.stringify(l):String(l)]=$(e)),i}if(Array.isArray(A))return A.map((i)=>$(i));const u={};return Object.entries(A).forEach(([i,e])=>u[i]=$(e)),u}if(typeof _.toJSON==="function"&&!q.has(_))return _.toJSON();return _};return $(X)};if(U==="reset")return function(){X=null};const D=j[U];if(K instanceof Map&&typeof D==="function")return function(...$){const _=U.toString();if(_==="set"&&$.length>=2)$[1]=z($[1]);const A=D.apply(j,$);return["set","delete","clear"].includes(_)&&W.queueUpdate(J),A};if(Array.isArray(K)&&typeof D==="function")return function(...$){const _=U.toString();if(["push","unshift"].includes(_))$=$.map((u)=>z(u));else if(_==="splice"&&$.length>2)$=[$[0],$[1],...$.slice(2).map((u)=>z(u))];const A=D.apply(j,$);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(_)&&W.queueUpdate(J),A};return D},set(j,U,D){if(j[U]===D)return!0;if(D instanceof Map&&j[U]instanceof Map){const $=j[U];return $.clear(),D.forEach((_,A)=>$.set(A,z(_))),W.queueUpdate(J),!0}return j[U]=z(D),W.queueUpdate(J),!0}});return q.set(X,K),X},z=(K)=>{if(!K)return K;return K instanceof Map||Array.isArray(K)||typeof K==="object"?Y(K):K};return Y(Q)}}class t0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Q)=>{try{const W=Q.node;if(!W){this.unwatch(Q);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Q),Q.emit("component:attached",Q),typeof Q.onAttach=="function"&&Q.onAttach.bind(Q)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Q),Q.emit("component:detached",Q),typeof Q.onDetach=="function"&&Q.onDetach.bind(Q)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Q="attach"){const W=J.node;if(!W)return;if(Q==="attach"&&document.contains(W[0])){J.emit("component:attached",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Q==="detach"&&!document.contains(W[0])){J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const q=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Q}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:q,type:Q}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Q==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Q=this.observedComponents.get(J);if(Q)clearTimeout(Q.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 a0{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.add(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);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:Q,dependent:W})=>{try{const q=W.update(W.memo,"batch-updator");if(q)typeof q.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:q.memo}),typeof q.cleanup==="function"&&q.cleanup()}catch(q){console.error("Failed to update dependency --",q)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class e0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Q){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Q),this}once(J,Q){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Q),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Q){if(!this.options.emit)return;const W=Q.map((q)=>typeof q.toJSON==="function"?q.toJSON():q);this.__events[J]?.forEach((q)=>q(...W)),this.__once_events[J]?.forEach((q)=>q(...W)),delete this.__once_events[J]}}var T1=R1(J1(),1);function H0(J,Q){if(J===Q)return!1;if(typeof J!=="object"||typeof Q!=="object")return!1;if(J===null||Q===null)return!0;if(J instanceof Set){if(!(Q instanceof Set))return!0;if(J.size!==Q.size)return!0;if(J5(J)&&J5(Q)){for(let K of J)if(!Q.has(K))return!0;return!1}const z=new WeakMap;for(let K of J){let X=!1;if(typeof K!=="object"){if(Q.has(K))X=!0}else for(let j of Q){if(typeof j!=="object")continue;if(!z.has(K))z.set(K,new WeakMap);const U=z.get(K);if(U.has(j)){if(X=U.get(j),X)break;continue}const D=!H0(K,j);if(U.set(j,D),D){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(Q instanceof Map))return!0;if(J.size!==Q.size)return!0;if(Z5(J)&&Z5(Q)){for(let[K,X]of J)if(Q.get(K)!==X)return!0;return!1}const z=new WeakMap;for(let[K,X]of J){if(typeof K!=="object"){if(!Q.has(K))return!0;const D=Q.get(K);if(typeof X!=="object"){if(X!==D)return!0;continue}if(typeof D!=="object"||H0(X,D))return!0;continue}let j=!1,U=!1;for(let[D,$]of Q){if(typeof D!=="object")continue;if(!z.has(K))z.set(K,new WeakMap);const _=z.get(K);if(_.has(D)){const[A,u]=_.get(D);if(A){j=!0,U=u;break}continue}if(!H0(K,D)){if(j=!0,U=typeof X==="object"&&typeof $==="object"?!H0(X,$):X===$,_.set(D,[!0,U]),U)break}else _.set(D,[!1,!1])}if(!j||!U)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Q))return!0;if(J.length!==Q.length)return!0;for(let z=0;z<J.length;z++){const K=J[z],X=Q[z];if(K!==X&&(typeof K!=="object"||H0(K,X)))return!0}return!1}const W=Object.keys(J),q=Object.keys(Q);if(W.length!==q.length)return!0;W.sort(),q.sort();const Y=W.length;for(let z=0;z<Y;z++)if(W[z]!==q[z])return!0;for(let z=0;z<Y;z++){const K=W[z],X=J[K],j=Q[K];if(X===j)continue;if(X instanceof Date){if(!(j instanceof Date)||String(X)!==String(j))return!0;continue}if(X instanceof RegExp){if(!(j instanceof RegExp)||X.source!==j.source||X.flags!==j.flags)return!0;continue}if(X instanceof Map){if(!(j instanceof Map)||H0(X,j))return!0;continue}if(X instanceof Set){if(!(j instanceof Set)||H0(X,j))return!0;continue}if(X instanceof Function){if(!(j instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof j!=="object")return!0;if(X===J){if(j!==Q)return!0}else if(H0(X,j))return!0}else return!0}return!1}function E0(J,Q){if(J===Q)return!0;if(J==null||Q==null)return J===Q;const W=typeof J;if(W!==typeof Q)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Q))return!0;return!1}if(J instanceof Date)return Q instanceof Date&&J.getTime()===Q.getTime();if(J instanceof RegExp)return Q instanceof RegExp&&J.source===Q.source&&J.flags===Q.flags;if(J instanceof Error)return Q instanceof Error&&J.name===Q.name&&J.message===Q.message&&(J.stack===Q.stack||!J.stack&&!Q.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Q))return!1;if(J.byteLength!==Q.byteLength)return!1;const X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),j=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);for(let U=0;U<X.length;U++)if(X[U]!==j[U])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Q;if(typeof J==="function"){if(typeof Q!=="function")return!1;return J.toString()===Q.toString()&&J.name===Q.name}if(J.constructor!==Q.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!H0(J,Q);const Y=Object.getPrototypeOf(J);if(Y!==Object.getPrototypeOf(Q))return!1;const z=Object.getOwnPropertyNames(J),K=Object.getOwnPropertyNames(Q);if(z.length!==K.length)return!1;for(let X of z){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!E0(J[X],Q[X]))return!1}if(Y!==null&&Y!==Object.prototype){const X=Object.getOwnPropertyNames(Y),j=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==j.length)return!1;for(let U of X){if(U==="constructor")continue;if(!E0(Y[U],Object.getPrototypeOf(Q)[U]))return!1}}return!0}function J5(J){for(let Q of J)if(typeof Q==="object"&&Q!==null)return!1;return!0}function Z5(J){for(let[Q,W]of J)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0}function Z0(J,Q=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Q.has(J))return Q.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 Y=new Map;return Q.set(J,Y),J.forEach((z,K)=>Y.set(Z0(K,Q),Z0(z,Q))),Y}if(J instanceof Set){const Y=new Set;return Q.set(J,Y),J.forEach((z)=>Y.add(Z0(z,Q))),Y}if(Array.isArray(J)){const Y=[];Q.set(J,Y);for(let z=0;z<J.length;z++)Y[z]=Z0(J[z],Q);return Y}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Q.set(J,W);const q=Object.getOwnPropertySymbols(J);for(let Y of q)W[Y]=Z0(J[Y],Q);for(let Y in J)if(Object.prototype.hasOwnProperty.call(J,Y))W[Y]=Z0(J[Y],Q);return W}function W5(J,Q){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Q||typeof Q!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Q).length)return{...J};function W(Y,z,K){const X=z.split(/\.|\[|\]/).filter(Boolean);let j=Y;for(let U=0;U<X.length;U++){const D=X[U],$=!isNaN(Number(D)),_=U===X.length-1,A=!isNaN(Number(X[U+1]));if(_){j[D]=K;continue}if(!(D in j))j[D]=A?[]:{};else if(A&&!Array.isArray(j[D]))j[D]=[];else if(!A&&Array.isArray(j[D]))j[D]={};j=j[D]}}const q=Z0(J);try{for(let[Y,z]of Object.entries(Q)){if(typeof Y!=="string")throw new TypeError(`Invalid path: ${Y}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(Y))throw new Error(`Invalid path format: ${Y}`);W(q,Y,z)}}catch(Y){throw new Error(`Failed to assign value: ${Y.message}`)}return q}var I0="syn:",j0="fn:",A0="on-",a=/^\.\.\./,Z1=/^\[(.*?)\]$/,Q5=["@html","@text"];T1.default.fn.extend({attrs:function(){const J={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&T1.default.each(Q.attributes,function(){J[this.name]=this.value}),J}});class Q1{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,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((Q,W)=>Q+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,Q){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Q}add(J,Q){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Q}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=Z0(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)},Q={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},q={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},Y={"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(Q),console.table(W),console.table(q),console.table(Y),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 Z0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var t=R1(J1(),1);var N5=R1(J1(),1);var W1="comm",X1="rule",H1="decl";var X5="@import";var H5="@namespace",q5="@keyframes";var Y5="@layer";function q1(J){return J.trim()}function _0(J,Q,W){return J.replace(Q,W)}function B5(J,Q,W){return J.indexOf(Q,W)}function L0(J,Q){return J.charCodeAt(Q)|0}function V0(J,Q,W){return J.slice(Q,W)}function Y0(J){return J.length}function Y1(J){return J.length}function f0(J,Q){return Q.push(J),J}var A1=Math.abs,d0=String.fromCharCode;function z1(J,Q,W,q,Y,z,K,X){return{value:J,root:Q,parent:W,type:q,props:Y,children:z,line:B1,column:g0,length:K,return:"",siblings:X}}function G5(){return Q0}function K5(){if(Q0=G0>0?L0(h0,--G0):0,g0--,Q0===10)g0=1,B1--;return Q0}function K0(){if(Q0=G0<z5?L0(h0,G0++):0,g0++,Q0===10)g0=1,B1++;return Q0}function C0(){return L0(h0,G0)}function i0(){return G0}function G1(J,Q){return V0(h0,J,Q)}function k0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function O5(J){return B1=g0=1,z5=Y0(h0=J),G0=0,[]}function M5(J){return h0="",J}function K1(J){return q1(G1(G0-1,b1(J===91?J+2:J===40?J+1:J)))}function w5(J){while(Q0=C0())if(Q0<33)K0();else break;return k0(J)>2||k0(Q0)>3?"":" "}function j5(J,Q){while(--Q&&K0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return G1(J,i0()+(Q<6&&C0()==32&&K0()==32))}function b1(J){while(K0())switch(Q0){case J:return G0;case 34:case 39:if(J!==34&&J!==39)b1(Q0);break;case 40:if(J===41)b1(J);break;case 92:K0();break}return G0}function U5(J,Q){while(K0())if(J+Q0===57)break;else if(J+Q0===84&&C0()===47)break;return"/*"+G1(Q,G0-1)+"*"+d0(J===47?J:K0())}function D5(J){while(!k0(C0()))K0();return G1(J,G0)}var B1=1,g0=1,z5=0,G0=0,Q0=0,h0="";function L5(J){return M5(O1("",null,null,null,[""],J=O5(J),0,[0],J))}function O1(J,Q,W,q,Y,z,K,X,j){var U=0,D=0,$=K,_=0,A=0,u=0,i=1,e=1,l=1,c=0,d="",h=Y,y=z,T=q,O=d;while(e)switch(u=c,c=K0()){case 40:if(u!=108&&L0(O,$-1)==58){if(B5(O+=_0(K1(c),"&","&\f"),"&\f",A1(U?X[U-1]:0))!=-1)l=-1;break}case 34:case 39:case 91:O+=K1(c);break;case 9:case 10:case 13:case 32:O+=w5(u);break;case 92:O+=j5(i0()-1,7);continue;case 47:switch(C0()){case 42:case 47:if(f0(YJ(U5(K0(),i0()),Q,W,j),j),(k0(u||1)==5||k0(C0()||1)==5)&&Y0(O)&&V0(O,-1,void 0)!==" ")O+=" ";break;default:O+="/"}break;case 123*i:X[U++]=Y0(O)*l;case 125*i:case 59:case 0:switch(c){case 0:case 125:e=0;case 59+D:if(l==-1)O=_0(O,/\f/g,"");if(A>0&&(Y0(O)-$||i===0&&u===47))f0(A>32?I5(O+";",q,W,$-1,j):I5(_0(O," ","")+";",q,W,$-2,j),j);break;case 59:O+=";";default:if(f0(T=F5(O,Q,W,U,D,Y,X,d,h=[],y=[],$,z),z),c===123)if(D===0)O1(O,Q,T,T,h,z,$,X,y);else{switch(_){case 99:if(L0(O,3)===110)break;case 108:if(L0(O,2)===97)break;default:D=0;case 100:case 109:case 115:}if(D)O1(J,T,T,q&&f0(F5(J,T,T,0,0,Y,X,d,Y,h=[],$,y),y),Y,y,$,X,q?h:y);else O1(O,T,T,T,[""],y,0,X,y)}}U=D=A=0,i=l=1,d=O="",$=K;break;case 58:$=1+Y0(O),A=u;default:if(i<1){if(c==123)--i;else if(c==125&&i++==0&&K5()==125)continue}switch(O+=d0(c),c*i){case 38:l=D>0?1:(O+="\f",-1);break;case 44:X[U++]=(Y0(O)-1)*l,l=1;break;case 64:if(C0()===45)O+=K1(K0());_=C0(),D=$=Y0(d=O+=D5(i0())),c++;break;case 45:if(u===45&&Y0(O)==2)i=0}}return z}function F5(J,Q,W,q,Y,z,K,X,j,U,D,$){var _=Y-1,A=Y===0?z:[""],u=Y1(A);for(var i=0,e=0,l=0;i<q;++i)for(var c=0,d=V0(J,_+1,_=A1(e=K[i])),h=J;c<u;++c)if(h=q1(e>0?A[c]+" "+d:_0(d,/&\f/g,A[c])))j[l++]=h;return z1(J,Q,W,Y===0?X1:X,j,U,D,$)}function YJ(J,Q,W,q){return z1(J,Q,W,W1,d0(G5()),V0(J,2,-2),0,q)}function I5(J,Q,W,q,Y){return z1(J,Q,W,H1,V0(J,0,q),V0(J,q+1,-1),q,Y)}function M1(J,Q){var W="";for(var q=0;q<J.length;q++)W+=Q(J[q],q,J,Q)||"";return W}function V5(J,Q,W,q){switch(J.type){case Y5:if(J.children.length)break;case X5:case H5:case H1:return J.return=J.return||J.value;case W1:return"";case q5:return J.return=J.value+"{"+M1(J.children,q)+"}";case X1:if(!Y0(J.value=J.props.join(",")))return""}return Y0(W=M1(J.children,q))?J.return=J.value+"{"+W+"}":""}function C5(J){var Q=Y1(J);return function(W,q,Y,z){var K="";for(var X=0;X<Q;X++)K+=J[X](W,q,Y,z)||"";return K}}class y0{nsp;settings;$head;constructor(J,Q){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=N5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(J){try{return M1(L5(J),C5([V5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(J){return new Promise((Q)=>{const W=new MutationObserver(()=>{const q=document.querySelector(J);if(q&&getComputedStyle(q).cssText)W.disconnect(),Q()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Q=`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 q=document.createElement("style");q.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),q.textContent=W;let Y=0;const z=this.$head.find(`style[${Q}]`);if(z.length)Y=parseInt(z.attr("dindex"))+1,z.remove();return q.setAttribute("dindex",String(Y)),this.settings.meta?document.head.prepend(q):document.head.appendChild(q),q}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 Q=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 Q=parseInt(J.attr("dindex"));Q===0?J.remove():J.attr("dindex",String(Q-1))}async custom(){return{}}async style(){return{}}}var BJ=function(J){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=J,q;while((q=Q.exec(J))!==null){const Y=q[1],z=q.index+q[0].length;let K=1,X=z;while(X<J.length&&K>0){if(J[X]==="(")K++;if(J[X]===")")K--;X++}if(K===0){const j=J.slice(z,X-1).trim(),U=J.slice(0,q.index),D=`${A0}${Y}="${j}"`,$=J.slice(X);W=U+D+$,J=W,Q.lastIndex=U.length+D.length}}return W},zJ=function(J){const Q=[];let q=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(Y,z,K)=>{return Q.push(K),`<${z}##TAG_ATTRS_${Q.length-1}##>`});for(let Y=0;Y<Q.length;Y++){const z=`##TAG_ATTRS_${Y}##`,K=Q[Y],X=GJ(K);q=q.replace(z,X)}return q},GJ=function(J){let Q="",W=0,q=!1,Y="",z=0,K=0,X=0;while(W<J.length){const j=J[W];if((j==='"'||j==="'")&&(W===0||J[W-1]!=="\\")){if(!q)q=!0,Y=j;else if(j===Y)q=!1}if(!q){if(j==="(")K++;else if(j===")")K--;else if(j==="{")X++;else if(j==="}")X--}if(!q&&K===0&&X===0&&(j===" "||W===J.length-1)){let U=W;if(W===J.length-1)U=W+1;const D=J.substring(z,U).trim();if(D){const $=KJ(D);Q+=" "+$}z=W+1}W++}return Q},KJ=function(J){const Q=J.indexOf("=");if(Q===-1){if(J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Q).trim(),q=J.substring(Q+1).trim();if(W.startsWith("@"))return W=!Q5.includes(W)?W.slice(1):W,`:${W}=${q}`;if(W.startsWith(j0)||W.startsWith(A0))return J;if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")){const Y=q.substring(1,q.length-1);if(OJ(Y))return`:${W}="${Y}"`;return J}else return`:${W}="${q}"`};function OJ(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 x1(J){let Q=(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,q,Y)=>{return Y.endsWith("<")?`<lips dtag="${q}" ${Y}/lips>`:`<lips dtag="${q}" ${Y}></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 ${j0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=BJ(Q),Q=zJ(Q),Q}var MJ=function(J,Q){if(J.isDisposed)return;Q.add(J),J.dependencies.add(Q)},P5=function(J){for(let Q of J.dependencies)Q.delete(J);J.dependencies.clear()};function v0(J,Q={maxSize:100}){const W=new Set,q=[{value:J,timestamp:Date.now()}];let Y=0;const z=()=>{const U=w1[w1.length-1];return U&&MJ(U,W),q[Y].value},K=()=>{const U=[...W];if(S5)for(let D of U)S5.add(D);else for(let D of U)D.execute()};return[z,(U,D)=>{if(Object.is(q[Y].value,U))return;if(Y<q.length-1)q.splice(Y+1);if(q.push({value:U,timestamp:Date.now(),metadata:D}),q.length>Q.maxSize)q.shift(),Y=Math.max(0,Y-1);else Y++;K()},{undo(){if(Y>0)Y--,K()},redo(){if(Y<q.length-1)Y++,K()},jumpTo(U){if(U>=0&&U<q.length&&U!==Y)Y=U,K()},getHistory(){return[...q]},getCurrentIndex(){return Y},canUndo(){return Y>0},canRedo(){return Y<q.length-1},clear(){const U=q[0];q.length=0,q.push(U),Y=0,K()}}]}function j1(J){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(q.isDisposed)return;Q=!0,P5(q),w1.push(q);try{J()}finally{Q=!1,w1.pop()}},q={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{q.isDisposed=!0,P5(q)}}}var w1=[],S5=null;class c0 extends e0{declaration;$=null;input;state;static;context;__name__;__path__;__template__;__previous;__macros=new Map;__translations=new Map;__renderCache=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,Q,{input:W,state:q,context:Y,_static:z,handler:K,stylesheet:X,macros:j,declaration:U},D){super();if(this.lips=D.lips,D?.debug)this.debug=D.debug||this.lips.debug;if(D?.prepath)this.prepath=D.prepath;if(this.__name__=J,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=x1(Q),console.log(this.__template__),this.declaration=U||{name:J},this.input=W||{},this.static=z||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,q||{}),j&&this.setMacros(j),K&&this.setHandler(K),X&&this.setStylesheet(X),this.metrics=new Q1(this.debug),this.metrics.inc("componentCount"),this.UQS=new a0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:Z0(this.input),state:Z0(this.state),context:Z0(this.context)};const[$,_]=v0(this.input),[A,u]=v0(this.state),[i,e]=v0(this.context);this.__setInput=_,this.__setState=u,this.__getState=A,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(Y)&&Y.length&&this.lips.useContext(Y,(l)=>{if(!H0(this.context,l))return;e(l),this.context=l,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.ICE=j1(()=>{const l=$(),c=A(),d=this.context=i();if(!this.isRendered){this.metrics.reset();const{$log:h}=this.render("",void 0,void 0,this.FGUD);this.$=h,!U?.syntax&&this.$?.each((y,T)=>typeof T.setAttribute=="function"&&T.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:c,input:l,context:d},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:Z0(l),state:Z0(c),context:Z0(d)},this.input=l;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(J,Q){this.lips.setContext(J,Q)}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(W5(this.input,J)),this}setMacros(J){const Q=x1(J),W=t.default(Q);if(!W.length)return;const q=this;W.each(function(){const Y=t.default(this),{argv:z,attrs:K}=q.__getAttributes__(Y);if(!Object.keys(K))throw new Error("Invalid macro component definition");if(!K.literals.name)throw new Error("Undefined macro `name` attribute.");if(q.__macros.get(K.literals.name))console.warn(`Duplicate macro <${K.literals.name}> will be override`);if(!Y.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");q.__macros.set(K.literals.name,{argv:z,$node:Y})})}setHandler(J){Object.entries(J).map(([Q,W])=>this[Q]=W.bind(this))}setStylesheet(J){const Q={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new y0(this.__name__,Q)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,Q,W={},q,Y){const z=q||new Map,K=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:z};this.metrics.startRender();const X=this;let j=t.default();function U(O){const G=D(O);return X.__pathCounter++,X.__path?`${X.__path}/${G}`:`${J?J+"/":"#"}${G}`}function D(O){return(O==="component"?"c":"")+X.__pathCounter}function $(O){return O!==null&&typeof O==="object"&&typeof O.mesh==="function"&&typeof O.update==="function"}function _(O){return O!==null&&typeof O==="object"&&typeof O.default&&typeof O.default==="string"}function A(O){if(!O.attr(":dtag")||O.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const G=O.attr(":dtag"),w=X.__evaluate__(G,W);if($(w)||w===null)return l(O,G,w);else if(_(w))return c(O,{template:w});else return c(O,{name:w})}function u(O){const G=O.attr(":args"),w=U("log");if(!G)return;if(X.__evaluate__(`console.log(${G})`,W),X.__isReactive__(G,W))X.__extractExpressionDeps__(G,W).forEach((V)=>X.__trackDep__(z,V,{$fragment:null,path:w,update:(P)=>X.__evaluate__(`console.log(${G})`,P),memo:W,batch:!0}))}function i(O){const G=U("var"),{attrs:w}=X.__getAttributes__(O);if(!w)return;Object.entries(w.literals).forEach(([L,V])=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:V,type:"let"}}),Object.entries(w.expressions).forEach(([L,V])=>{if(a.test(L)){const P=(S,x)=>{const v=X.__evaluate__(L.replace(a,""),x||W);if(typeof v!=="object")throw new Error(`Invalid spread operator ${L}`);for(let C in v){if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);if(W[C]={value:v[C],type:"let"},x)x[C]=W[C],X.__updateVarDepNodes__(C,G,x)}if(S)return{memo:x}};X.__extractExpressionDeps__(L,W).forEach((S)=>X.__trackDep__(z,S,{$fragment:null,path:`${G}.${L}`,update:(x)=>P(!0,x),memo:W,batch:!0})),P()}else if(V){if(X.__isReactive__(V,W)){const P=X.__extractExpressionDeps__(V,W),r=(S,x)=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);return S[L]=W[L]={value:X.__evaluate__(V,S),type:"let"},X.__updateVarDepNodes__(L,G,S),{memo:S}};P.forEach((S)=>X.__trackDep__(z,S,{$fragment:null,path:`${G}.${L}`,update:r,memo:W,batch:!0}))}if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:X.__evaluate__(V,W),type:"let"}}}),X.metrics.inc("elementCount")}function e(O){const{attrs:G}=X.__getAttributes__(O);if(!G)return;Object.entries(G.literals).forEach(([w,L])=>{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!L)return;W[w]={value:L,type:"const"}}),Object.entries(G.expressions).forEach(([w,L])=>{if(a.test(w)){const V=X.__evaluate__(w.replace(a,""),W);if(typeof V!=="object")throw new Error(`Invalid spread operator ${w}`);for(let P in V){if(W[P]&&W[P].type==="const")throw new Error(`<const ${P}=[value]/> by spread operator ${w}. [${P}] variable already defined`);W[P]={value:V[P],type:"const"}}}else{if(W[w]&&W[w].type==="const")throw new Error(`<const ${w}=[value]/> variable already defined`);if(!L)return;W[w]={value:X.__evaluate__(L,W),type:"const"}}}),X.metrics.inc("elementCount")}function l(O,G,w){const{attrs:L}=X.__getAttributes__(O),V=U("element"),P=X.__getBoundaries__(V);let r=t.default(P.start),S={},x=w;if(x){L.literals&&Object.entries(L.literals).forEach(([C,E])=>S[C]={type:"arg",value:E}),L.expressions&&Object.entries(L.expressions).forEach(([C,E])=>{if(!x)return;if(a.test(C)){const b=X.__evaluate__(C.replace(a,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${C}`);for(let R in b){if(R!=="#"&&!x.argv.includes(R))continue;S[R]={type:"arg",value:b[R]}}}else{if(C!=="#"&&!x.argv.includes(C))return;S[C]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const v=x.mesh(S);if(v&&v.length)r=r.add(v);L.expressions&&Object.entries(L.expressions).forEach(([C,E])=>{if(!x)return;if(a.test(C)&&X.__isReactive__(C,W)){const b=X.__extractExpressionDeps__(C,W),R=(F,k)=>{if(!x)return;const f={},o=X.__evaluate__(C.replace(a,""),F);if(typeof o!=="object")throw new Error(`Invalid spread operator ${C}`);const s=[];for(let p in o){if(p!=="#"&&!x.argv.includes(p))continue;S[p]=f[p]={type:"arg",value:o[p]},(!F[p]||!E0(o[p],F[p].value))&&s.push(p)}s.length&&x.update(s,f,P)};b.forEach((F)=>X.__trackDep__(z,F,{$fragment:null,boundaries:P,path:`${V}.${C}`,update:R,memo:W,batch:!0}))}else if((C==="#"||x.argv.includes(C))&&X.__isReactive__(E,W)){const b=X.__extractExpressionDeps__(E,W),R=(F,k)=>{if(!x)return;const f=S[C]={type:"arg",value:E?X.__evaluate__(E,F):!0};x.update([C],{[C]:f},P)};b.forEach((F)=>X.__trackDep__(z,F,{$fragment:null,boundaries:P,path:`${V}.${C}`,update:R,memo:W,batch:!0}))}})}if(X.__isReactive__(G,W)){const v=(E,b)=>{const R=X.__evaluate__(G,E);let F;if(_(R))F=c(O,{template:R});else if($(R))S="#"in S?{...E,...S["#"].value}:{...E,...S},x=R,F=x?x.mesh(S):null;if(!document.contains(P.start)||!document.contains(P.end))throw new Error("Dynamic element boundaries not found");const k=[];let f=P.start.nextSibling;while(f&&f!==P.end)k.push(f),f=f.nextSibling;t.default(k).remove(),F&&t.default(P.start).after(F)};X.__extractExpressionDeps__(G,W).forEach((E)=>X.__trackDep__(z,E,{$fragment:null,boundaries:P,path:V,update:v,batch:!0,memo:{...W,...S}}))}return r=r.add(P.end),r}function c(O,G){let w,L;if(G?.template)w=G.template,L=D("component");else{if(L=G?.name||O.prop("tagName")?.toLowerCase(),!L)throw new Error("Invalid component");if(L===X.__name__)throw new Error("Render component within itself is forbidden");w=X.lips.import(L)}if(!w||!L)throw new Error(`<${L}> template not found`);const V=U("component"),P=X.__getBoundaries__(V),{argv:r,attrs:S,events:x}=X.__getAttributes__(O),v={};let C={},E=t.default(P.start),b=X.PCC.get(V);S.literals&&Object.entries(S.literals).forEach(([F,k])=>{if(F=="key")return;C[F]=k}),S.functions&&Object.entries(S.functions).forEach(([F,k])=>{C[F]=X.__evaluateFunction__(k,[],W),w.declaration?.syntax?v[I0+j0+F]=k:v[j0+F]=k}),S.expressions&&Object.entries(S.expressions).forEach(([F,k])=>{if(F=="key")return;if(a.test(F)){const f=X.__evaluate__(F.replace(a,""),W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${F}`);for(let o in f)C[o]=f[o]}else C[F]=k?X.__evaluate__(k,W):!0;w.declaration?.syntax?v[I0+F]=k:v[F]=k});const R=O.contents();if(R.length){if(C={...C,...X.__meshwire__({$node:O,fragmentPath:V,fragmentBoundaries:P,meshPath:null,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:w.declaration},v)},w.declaration){if(w.declaration.tags)Object.entries(w.declaration?.tags).forEach(([F,{type:k,many:f}])=>{switch(k){case"nexted":{let o=O.next(F);if(!o.length)return;if(f){C[F]=[];let s=0,p=!1;while(!p){if(C[F].push(X.__meshwire__({$node:o,meshPath:`${F}[${s}]`,fragmentPath:V,fragmentBoundaries:P,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:w.declaration},v)),!o.next(F).length){p=!0;break}o=o.next(F),s++}}else C[F]=X.__meshwire__({$node:o,meshPath:F,fragmentPath:V,fragmentBoundaries:P,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:w.declaration},v)}break;case"child":{const o=O.children(F);if(f)C[F]=[],o.each(function(s){const p=t.default(this),{argv:U0}=X.__getAttributes__(p);C[F].push(X.__meshwire__({$node:p,meshPath:`${F}[${s}]`,fragmentPath:V,fragmentBoundaries:P,argv:U0,scope:W,xmlns:Y,useAttributes:!0,declaration:w.declaration},v))});else if(O.children(F).first().length){const s=O.children(F).first(),{argv:p}=X.__getAttributes__(s);C[F]=X.__meshwire__({$node:s,meshPath:F,fragmentPath:V,fragmentBoundaries:P,argv:p,scope:W,xmlns:Y,useAttributes:!0,declaration:w.declaration},v)}}break}});else if(w.declaration.contents)C.__contents__=R}}if(b)b.setInput(Z0(C)),E=E.add(b.node);else{const{declaration:F,state:k,_static:f,handler:o,context:s,default:p,stylesheet:U0}=w;b=new c0(L,p||"",{state:Z0(k),input:Z0(C),context:s,_static:Z0(f),handler:o,stylesheet:U0,declaration:F},{debug:X.debug,lips:X.lips,prepath:V}),E=E.add(b.node),X.PCC.set(V,b),Object.entries(x).forEach(([J0,n])=>!!b&&X.__attachEvent__(b,J0,n,W)),v&&Object.entries(v).forEach(([J0,n])=>{let q0=!1,m0=!1;if(J0.startsWith(I0))q0=!0,J0=J0.replace(I0,"");if(J0.startsWith(j0))m0=!0,J0=J0.replace(j0,"");if(a.test(J0)){const $0=(N0)=>{const O0={},b0=X.__evaluate__(J0.replace(a,""),N0);if(typeof b0!=="object")throw new Error(`Invalid spread operator ${J0}`);for(let R0 in b0)O0[R0]=b0[R0];b?.subInput(O0)};if(X.__isReactive__(J0,W))X.__extractExpressionDeps__(n,W).forEach((O0)=>X.__trackDep__(z,O0,{$fragment:null,boundaries:P,path:`${V}.${J0}`,update:$0,syntax:q0,memo:W,batch:!0}))}else{const $0=(N0)=>{const O0=m0?X.__evaluateFunction__(n,[],N0):n?X.__evaluate__(n,N0):!0;b?.subInput({[J0]:O0})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((O0)=>X.__trackDep__(z,O0,{$fragment:null,boundaries:P,path:`${V}.${J0}`,update:$0,syntax:q0,memo:W,batch:!0}))}}),E=E.add(P.end)}return X.metrics.inc("componentCount"),E}function d(O){const G=O.prop("tagName")?.toLowerCase();if(!G)throw new Error("Invalid macro rendering call");const w=X.__macros.get(G);if(!w)throw new Error("Macro component not found");const L=U("macro"),V=X.__getBoundaries__(L),{attrs:P}=X.__getAttributes__(O),r={};let S={},x={},v=t.default(V.start);if(P.literals&&Object.entries(P.literals).forEach(([R,F])=>S[R]={value:F,type:"arg"}),P.expressions&&Object.entries(P.expressions).forEach(([R,F])=>{if(a.test(R)){const k=X.__evaluate__(R.replace(a,""),W);if(typeof k!=="object")throw new Error(`Invalid spread operator ${R}`);for(let f in k)if(x[f]=k[f],w.argv.includes(f))S[f]={value:k[f],type:"arg"};r[R]=F}else{const k=F?X.__evaluate__(F,W):!0;if(x[R]=k,w.argv.includes(R))S[R]={value:k,type:"arg"};if(w.argv.includes(R))r[R]=F}w.argv.forEach((k)=>{if(S[k]!==void 0)return;S[k]={value:!1,type:"arg"}})}),w.argv.includes("__"))S.__={value:x,type:"arg"};const C={$node:w.$node,meshPath:null,fragmentPath:L,fragmentBoundaries:V,argv:w.argv,scope:W,xmlns:Y,useAttributes:!0},E=X.__meshwire__(C,r),b=E.renderer.mesh(S);return v=v.add(b),r&&Object.entries(r).forEach(([R,F])=>{let k=!1;if(new RegExp(`^${I0}`).test(R))k=!0,R=R.replace(I0,"");if(a.test(R)){if(!X.__isReactive__(R,W))return;const f=X.__extractExpressionDeps__(R,W),o=(s)=>{const p={},U0=X.__evaluate__(R.replace(a,""),s);if(typeof U0!=="object")throw new Error(`Invalid spread operator ${R}`);const J0=[];for(let n in U0)p[n]={value:U0[n],type:"arg"},(!s[n]||!E0(U0[n],s[n].value))&&J0.push(n);return J0.length&&E.renderer.update(J0,p),{memo:{...s,...p}}};f.forEach((s)=>X.__trackDep__(z,s,{$fragment:null,boundaries:V,path:`${L}.${R}`,update:o,syntax:k,memo:{...W,...S},batch:!0}))}else if(X.__isReactive__(F,W)){const f=X.__extractExpressionDeps__(F,W),o=(s)=>{const p=s[R]={value:F?X.__evaluate__(F,s):!0,type:"arg"};return E.renderer.update([R],{[R]:p}),{memo:s}};f.forEach((s)=>X.__trackDep__(z,s,{$fragment:null,boundaries:V,path:`${L}.${R}`,update:o,syntax:k,memo:{...W,...S},batch:!0}))}}),v=v.add(V.end),X.metrics.inc("elementCount"),v}function h(O){if(!O.length||!O.prop("tagName"))return O;const G=O.is("svg")||Y,w=G?t.default(document.createElementNS("http://www.w3.org/2000/svg",O.prop("tagName").toLowerCase())):t.default(`<${O.prop("tagName").toLowerCase()}/>`),L=O.contents(),V=U("element");L.length&&w.append(X.__withPath__(V,()=>X.render(V+".n",L,W,z,G).$log));const{attrs:P,events:r}=X.__getAttributes__(O);P.literals&&Object.entries(P.literals).forEach(([x,v])=>w.attr(x,v));const S=(x,v=!1)=>{x&&Object.entries(x).forEach(([C,E])=>{switch(C){case"@html":{const b=(R)=>{w.html(X.__evaluate__(E,R))};if(b(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(z,F,{$fragment:w,path:`${V}.${C}`,update:b,memo:W,batch:!0}))}break;case"@text":{const b=(R)=>{let F=X.__evaluate__(E,R);if(!O.is("[no-translate]")){const{text:k}=X.lips.i18n.translate(F);F=k}w.text(F)};if(b(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(z,F,{$fragment:w,path:`${V}.${C}`,update:b,memo:W,batch:!0}))}break;case"style":{const b=(R)=>{const F=X.__evaluate__(E,R);if(typeof F==="object"){let k="";Object.entries(F).forEach(([f,o])=>k+=`${f}:${o};`),k.length&&w.attr("style",k)}else w.attr("style",F)};if(b(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(z,F,{$fragment:w,path:`${V}.${C}`,update:b,memo:W,batch:!0}))}break;default:{const b=(R)=>{const F=E?X.__evaluate__(E,R):E!==void 0?E:!0;F===void 0||F===!1?w.removeAttr(C):w.attr(C,F)};if(b(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(z,F,{$fragment:w,path:`${V}.${C}`,update:b,memo:W,batch:!0}))}}})};return P.expressions&&Object.keys(P.expressions).forEach((x)=>{if(!a.test(x))return;const v=(C)=>{const E={},b=X.__evaluate__(x.replace(a,""),C);if(typeof b!=="object")throw new Error(`Invalid spread operator ${x}`);for(let R in b)E[R]=b[R];S(E)};if(delete P.expressions[x],v(W),x&&X.__isReactive__(x,W))X.__extractExpressionDeps__(x,W).forEach((E)=>X.__trackDep__(z,E,{$fragment:w,path:`${V}.${x}`,update:v,memo:W,batch:!0}))}),S(P.expressions,!0),r&&Object.entries(r).forEach(([x,v])=>{K.push({_event:x,$fragment:w,instruction:v,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),w}function y(O){const G=O.text(),w=U("element"),L=!O.parent().is("[no-translate]"),V=t.default(document.createTextNode(X.__interpolate__(G,L,W)));if(G&&X.__isReactive__(G,W)){const P=X.__extractTextDeps__(G,W),r=(S)=>{const x=X.__interpolate__(G,L,S);if(!V[0])return;V[0].textContent=x};P.forEach((S)=>X.__trackDep__(z,S,{path:w,$fragment:V,update:r,memo:W,translate:L,batch:P.length>1}))}return X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),V}function T(O){if(O.get(0)?.nodeType===Node.COMMENT_NODE)return O;if(O.get(0)?.nodeType===Node.TEXT_NODE)return y(O);if(O.is("let"))return i(O);else if(O.is("const"))return e(O);else if(O.is("lips")&&O.attr(":dtag"))return A(O);else if(O.is("log"))return u(O);else if(X.__macros.has(O.prop("tagName")?.toLowerCase()))return d(O);else if(O.is("if, for, switch, async")||X.lips.has(O.prop("tagName")?.toLowerCase()))return c(O);else if(O.is("else-if, else"))return;return h(O)}try{this.__renderDepth++,Q=Q||t.default(this.__template__),Q.each(function(){const O=T(t.default(this));if(O)j=j.add(O)}),K.forEach(({$fragment:O,_event:G,instruction:w,scope:L})=>{this.__attachEvent__(O,G,w,L)}),X.metrics.inc("renderCount")}catch(O){console.error("Rendering Failed --",O),X.metrics.trackError(O)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:j,dependencies:z,events:K}}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:Q})=>this.__detachEvent__(J,Q)),this.VER=[];for(let J in this.PCC){const Q=this.PCC.get(J);Q?.destroy(),Q?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.state.reset(),this.__macros.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Q)=>{t.default(Q).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(J,Q){const W=this,{$node:q,meshPath:Y,fragmentPath:z,fragmentBoundaries:K,argv:X,scope:j,xmlns:U,declaration:D,useAttributes:$}=J;let _,A=[];const u=[],i=(d,h,y)=>{const T=`${z}.${Y||"r"}${y!==void 0?`[${y}]`:""}`,{$log:O,dependencies:G,events:w}=W.render(T,d,{...j,...h},void 0,U);if(u.push(T),G?.forEach((L,V)=>{if(!W.FGUD?.has(V))W.FGUD.set(V,new Map);L.forEach((P,r)=>{P.partial?.length?P.partial.push(T):P.partial=[T],W.FGUD.get(V)?.set(r,P)})}),W.metrics.inc("partialCount"),y!==void 0){const L=W.__getBoundaries__(T);A[y]={argvalues:h,boundaries:L};let V=t.default(L.start);return V=V.add(O),V=V.add(L.end),V}return O},e=(d,h,y)=>{if(W.metrics.startRender(),d.forEach((T)=>{const O=W.FGUD.get(T);if(!O)return;O.forEach((G)=>{const w=u.find((L)=>G.partial?.find((V)=>L==V));if(!G.partial||!w)return;if(y!==void 0&&!w.endsWith(`r[${y}]`))return;if(K?.start&&!document.contains(K.start)){console.warn(`${Y} -- partial boundaries missing in the DOM`),O.delete(G.path);return}if(G.memo?.[T]&&h?.[T]&&E0(G.memo[T],h[T]))return;if(G.memo={...j,...G.memo,...h},G.batch)W.UQS.queue({dep:T,dependent:G});else{const L=G.update(G.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&O.set(G.path,{...G,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!O.size&&W.FGUD.delete(T)}),y!==void 0&&A[y])A[y].argvalues=h;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},l=(d)=>{if(!A[d])return;const h=A[d].boundaries;if(delete A[d],!document.contains(h.start)||!document.contains(h.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const y=[];let T=h.start.nextSibling;while(T&&T!==h.end)y.push(T),T=T.nextSibling;t.default(y).remove(),h.start.remove(),h.end.remove()},c={renderer:{path:Y,argv:X,mesh(d,h=!1){if(_=q.contents(),!_?.length)return null;if(D?.iterator){const y=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!y.length)return null;let T=t.default();return y.forEach((O,G)=>{if(!_?.length)return null;T=T.add(i(_,O,G))}),T}else return i(_,d)},update(d,h,y){if(!u.length)return;if(y=y||K,D?.iterator){const T=h?.["#"].value;if(!Array.isArray(T))return;if(Array.isArray(A)){if(A.length===T.length){for(let G=0;G<T.length;G++)!E0(A[G].argvalues,T[G])&&e(Object.keys(T[G]),T[G],G);return}const O=Math.min(A.length,T.length);for(let G=0;G<O;G++)e(Object.keys(T[G]),T[G],G);if(T.length>A.length){if(!_?.length)return;for(let G=A.length;G<T.length;G++){const w=i(_,T[G],G);t.default(y.end).before(w)}}else if(T.length<A.length)for(let G=T.length;G<A.length;G++)l(G)}}else e(d,h)}}};if($&&Y){const{attrs:d}=W.__getAttributes__(q);d.literals&&Object.entries(d.literals).forEach(([h,y])=>c[h]=y),d.expressions&&Object.entries(d.expressions).forEach(([h,y])=>{if(a.test(h)){const T=W.__evaluate__(h.replace(a,""),j);if(typeof T!=="object")throw new Error(`Invalid spread operator ${h}`);for(let O in T)c[O]=T[O];Q[`${D?.syntax?I0:""}${Y}.${h}`]=y}else c[h]=y?W.__evaluate__(y,j):!0,Q[`${D?.syntax?I0:""}${Y}.${h}`]=y})}return c}__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 Q=J.attrs(),W={},q={literals:{},functions:{},expressions:{}};let Y=[];return Q&&Object.entries(Q).forEach(([z,K])=>{if(z==":dtag")return;if(z.startsWith(":")||z.startsWith(j0)||z.startsWith(A0)||a.test(z)||Z1.test(z))if(Z1.test(z)){const[X,j]=z.match(Z1)||[];Y=j.split(",")}else if(z.startsWith(A0))W[z.replace(A0,"")]=K;else if(z.startsWith(j0))q.functions[z.replace(j0,"")]=K;else{if(z.startsWith(":"))z=z.slice(1,z.length);q.expressions[z]=K||""}else q.literals[z]=K}),{argv:Y,events:W,attrs:q}}__withPath__(J,Q){const W=this.__path;this.__path=J;const q=Q();return this.__path=W,q}__getPathParent__(J){const Q=J.split("/");return Q.pop(),Q.join("/")}__hasSamePathParent__(J,Q){return J.startsWith(Q)}__evaluate__(J,Q){try{J=J.trim();const W=(q)=>{const Y=this.state.toJSON();if(Q){const z={};for(let j in Q)z[j]=Q[j].value;const K=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",K)(this,this.input,Y,this.static,this.context,z||{})}else{const z=`return ${q}`;return new Function("self","input","state","static","context",z)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J))return J.replace(/{\s*([^{}]+)\s*}/g,(q,Y)=>W(Y));return W(J)}catch(W){return J}}__evaluateFunction__(J,Q,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Q);else{let[q,...Y]=J.split(/\s*,\s*/),z;if(q=this.__evaluate__(q,W),typeof q==="function")z=q;else{if(typeof this[q]!=="function")throw new Error(`Undefined <${q}> handler method`);z=this[q].bind(this)}if(typeof z!=="function")throw new Error(`Expected <${q}> to be a function or handler method`);let K=Y.map((X)=>this.__evaluate__(X,W));if(Q.length)K=[...K,...Q];return z(...K)}}__interpolate__(J,Q,W){return J.replace(/{\s*([^{}]+)\s*}/g,(q,Y)=>this.__evaluate__(Y,W))}__attachEvent__(J,Q,W,q){J.on(Q,(...Y)=>this.__evaluateFunction__(W,Y,q)),this.VER.push({element:J,_event:Q}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,Q){J.off(Q),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Q){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((Y)=>{const z=Y.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(z,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,q=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let Y=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(q))];if(Q&&Object.keys(Q).length){const z=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");Y=[...Y,...Array.from(J.matchAll(z))]}return[...new Set(Y.map((z)=>z[0]))]}__isReactive__(J,Q){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(Q&&Object.keys(Q).length&&new RegExp(Object.keys(Q).join("|")).test(J))return!0;return!1}__trackDep__(J,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!J.has(Q)&&J.set(Q,new Map),J.get(Q)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!J.has(Q)&&J.set(Q,new Map),J.get(Q)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__valueDep__(J,Q){return Q.reduce((W,q)=>W?.[q],J)}__shouldUpdate__(J,Q,W,q){if(J==="self")return!0;const Y=this.__valueDep__(q[J],Q),z=this.__valueDep__(W[J],Q);return!E0(Y,z)}__updateDepNodes__(J,Q){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,q)=>{const[Y,...z]=q.split(".");if(!this.__shouldUpdate__(Y,z,J,Q))return;W.forEach((K)=>{const{path:X,batch:j,$fragment:U,boundaries:D,update:$,memo:_,syntax:A}=K;try{if(!A&&(D?.start&&!document.contains(D.start))||U!==null&&!U.closest("body").length){W.delete(X);return}if(j)this.UQS.queue({dep:q,dependent:K});else{const u=$(_,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...K,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(q)}),this.metrics.endRender()}__updateVarDepNodes__(J,Q,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((Y,z)=>{if(!Y.haslet||!this.__hasSamePathParent__(z,this.__getPathParent__(Q)))return;if(Y.memo={...Y.memo,...W},Y.batch)this.UQS.queue({dep:J,dependent:Y});else{const K=Y.update(Y.memo,"var-partial-updator");typeof K?.cleanup==="function"&&K.cleanup()}}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?t.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?t.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?t.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _1={};u0(_1,{state:()=>{{return jJ}},handler:()=>{{return UJ}},default:()=>{{return DJ}},declaration:()=>{{return wJ}}});var wJ={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},jJ={renderer:null},UJ={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((Q)=>{if(J||!Q.by)return;this.state.renderer=Q.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},DJ="<{state.renderer}/>";var f1={};u0(f1,{state:()=>{{return IJ}},handler:()=>{{return VJ}},default:()=>{{return CJ}},declaration:()=>{{return FJ}},_static:()=>{{return LJ}}});var FJ={name:"for",syntax:!0,iterator:!0},IJ={argvlist:null},LJ={lastInput:null,processingBatch:!1},VJ={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:Q,to:W}=this.input;if(J===void 0&&Q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Q!==void 0){if(Q=parseFloat(String(Q)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Q===W)throw new Error("<from> and <to> attribute cannot have the same value");const q=Q<W,Y=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Y){const[K]=this.input.renderer.argv;if(K){let X=Q,j=!0;for(let U=0;U<this.state.argvlist.length;U++){if(this.state.argvlist[U][K].value!==X){j=!1;break}X=q?X+1:X-1}if(j)return;X=Q;for(let U=0;U<this.state.argvlist.length;U++)this.state.argvlist[U][K].value=X,X=q?X+1:X-1;return}}const z=[];for(let K=Q;q?K<=W:K>=W;q?K++:K--){const X={},[j]=this.input.renderer.argv;if(j)X[j]={value:K,type:"arg"};z.push(X)}this.state.argvlist=z}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.length){console.warn("empty for loop <in> attribute Array value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[z,K]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const j=this.state.argvlist[X];if(z)j[z].value=J[X]}return}const q=[];let Y=0;for(let z of J){const K={},[X,j]=this.input.renderer.argv;if(X)K[X]={value:z,type:"arg"};if(j)K[j]={value:Y,type:"arg"};q.push(K),Y++}this.state.argvlist=q}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.size){console.warn("empty for loop <in> attribute Map value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[z,K,X]=this.input.renderer.argv;let j=0;for(let[U,D]of J){const $=this.state.argvlist[j];if(z)$[z].value=U;if(K)$[K].value=D;j++}return}const q=[];let Y=0;for(let[z,K]of J){const X={},[j,U,D]=this.input.renderer.argv;if(j)X[j]={value:z,type:"arg"};if(U)X[U]={value:K,type:"arg"};if(D)X[D]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Object.keys(J).length){console.warn("empty for loop <in> attribute Object value"),this.state.argvlist=[];return}this.static.lastInput=J;const q=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[K,X,j]=this.input.renderer.argv;for(let U=0;U<q.length;U++){const D=q[U],$=this.state.argvlist[U];if(K)$[K].value=D;if(X)$[X].value=J[D]}return}const Y=[];let z=0;for(let K in J){const X={},[j,U,D]=this.input.renderer.argv;if(j)X[j]={value:K,type:"arg"};if(U)X[U]={value:J[K],type:"arg"};if(D)X[D]={value:z,type:"arg"};Y.push(X),z++}this.state.argvlist=Y}}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[Q]=this.input.renderer?.argv;if(!Q)return;for(let{index:W,value:q}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=q}finally{this.static.processingBatch=!1}},updateProperty(J,Q){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 q=this.state.argvlist[W];if(q[J])q[J].value=typeof Q==="function"?Q(q[J].value,W):Q}}finally{this.static.processingBatch=!1}}},CJ="<{input.renderer} #=state.argvlist/>";var g1={};u0(g1,{state:()=>{{return SJ}},handler:()=>{{return PJ}},default:()=>{{return EJ}},declaration:()=>{{return NJ}}});var NJ={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},SJ={renderer:null,props:{}},PJ={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[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}})}},EJ="<{state.renderer} #=state.props/>";var k1={};u0(k1,{state:()=>{{return RJ}},handler:()=>{{return TJ}},default:()=>{{return AJ}},declaration:()=>{{return $J}}});var $J={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},RJ={renderer:null},TJ={onInput(){let J=[];for(let Q of this.input.case)if(Q.is==this.input.by||Array.isArray(Q.is)&&Q.is.includes(this.input.by))Array.isArray(Q.is)?J=[...new Set([...J,...Q.is])]:J.push(Q.is),this.state.renderer=Q.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},AJ="<{state.renderer}/>";var h1={};u0(h1,{state:()=>{{return bJ}},handler:()=>{{return gJ}},default:()=>{{return kJ}},context:()=>{{return _J}},_static:()=>{{return xJ}}});var fJ=function(J){const Q={};return J.split("&").map((q)=>{const[Y,z]=q.split("=");Q[Y]=z}),Q},bJ={page:null,params:{},query:{}},xJ={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},_J=["navigate"],gJ={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:Q,default:W})=>{if(W)this.static.defaultPath=J;const q=J.match(/:[^\/]*(\/|$)/gi)||[],Y=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Q,default:W,pathVars:q,pathRegex:new RegExp(`${Y}\$`,"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,Q){!Q&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const q=W[1]?fJ(W[1]):{};let Y=null;if(this.static.currentRoute)Y={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:Y,toState:{path:J,query:q}});const z=this.match(J);if(!z){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:K,params:X}=z;this.emit("after",{fromState:Y,toState:{path:K.path,params:X,query:q}}),this.static.currentPath=J,this.static.currentRoute=K,this.state.params=X,this.state.query=q,this.state.page=K.template},match(J){const Q={};let W=!1;for(let q of this.static.routes){const{pathVars:Y,pathRegex:z}=q,K=J.match(z);if(K!==null&&K.index===0){for(let X=0;X+1<K.length&&X<Y.length;X++)Q[Y[X].replaceAll(/[\/:]/g,"")]=K[X+1];W=q;break}}return W?{route:W,params:Q}:!1}},kJ="<{state.page} params=state.params query=state.query/>";class p0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new l0;watcher;IUC;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new t0,this.IUC=new n0;const[Q,W]=v0(J?.context||{});this.__setContext=W,this.__getContext=Q,this.register("if",_1),this.register("for",f1),this.register("async",g1),this.register("switch",k1),this.register("router",h1)}register(J,Q){return this.store[J]=Q,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,Q,W){const{default:q,...Y}=Q,z={debug:this.debug,prepath:"0",lips:this},K=new c0(J,q||"",{...Y,input:W},z);return window.addEventListener("beforeunload",()=>{return this.dispose(),K.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),K}root(J,Q){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Q),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new y0("root",{sheet:W,meta:!0}));return this.__root}language(J){this.i18n.setLang(J)&&this.__root?.rerender()}setContext(J,Q){const W=this.__getContext();if(typeof J==="string"){const q={...W,[J]:Q};H0(W,q)&&this.__setContext(q)}else if(!Array.isArray(J)){const q={...W,...J};H0(W,q)&&this.__setContext(q)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Q){if(!J.length)return;j1(()=>{const W=this.__getContext();if(!W)return;const q=Object.fromEntries(J.map((Y)=>[Y,W[Y]]));q&&typeof Q==="function"&&Object.keys(q).length&&Q(q)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var E5={Undo:"Undo",Redo:"Redo",Reinitialize:"Reinitialize",Settings:"Settings",Link:"Link","Device Screens":{"*":"Device Screens",UK:"Media Devices"},Bold:"Bold",Count:"Count"};var $5={Undo:"Annuler",Redo:"Refaire",Reinitialize:"R\xE9initialiser",Settings:"Param\xEAtre",Link:"Lien","Device Screens":"Dispositifs",Bold:"Gras",Button:"Bouton",Count:"Compter"};var vJ=function(){const J={state:{count:0},handler:{onInput(){this.state.count=Number(this.input.initial)},handleClick(K){if(this.state.count>=this.static.limit)return;this.state.count++,this.emit("update",this.state.count)}},_static:{limit:12},stylesheet:`
|
|
2
|
-
|
|
3
|
-
`,default:`<div>
|
|
4
|
-
<{input.renderer}/>:
|
|
5
|
-
<span @text=state.count></span>
|
|
6
|
-
<br>
|
|
7
|
-
<button on-click(handleClick)>Count</button>
|
|
8
|
-
</div>`},Q={context:{lang:"en-US",online:!0},debug:!0},W=new p0(Q);W.register("counter",J),W.i18n.setDictionary("en",E5),W.i18n.setDictionary("fr",$5);const q={initial:3,countUpdate:0},Y={onMount(){this.node.css({color:"green"}),console.log("State: ",this.state.initial)},onUpdateCount(K){this.state.countUpdate=K},onContext(){console.log("on-context --",this.context)}},z=`<main>
|
|
9
|
-
<section style="border: 2px solid gray; margin: 3rem; padding: 15px">
|
|
10
|
-
<counter initial=state.initial
|
|
11
|
-
on-update="onUpdateCount">
|
|
12
|
-
Count till 12
|
|
13
|
-
</counter>
|
|
1
|
+
var q8=Object.create;var{defineProperty:A0,getPrototypeOf:Y8,getOwnPropertyNames:B8}=Object;var z8=Object.prototype.hasOwnProperty;var T0=(J,Q,W)=>{W=J!=null?q8(Y8(J)):{};const q=Q||!J||!J.__esModule?A0(W,"default",{value:J,enumerable:!0}):W;for(let Y of B8(J))if(!z8.call(q,Y))A0(q,Y,{get:()=>J[Y],enumerable:!0});return q};var G8=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var d1=(J,Q)=>{for(var W in Q)A0(J,W,{get:Q[W],enumerable:!0,configurable:!0,set:(q)=>Q[W]=()=>q})};var Q0=G8((W5,X5)=>{(function(){var J=document,Q=window,W=J.documentElement,q=J.createElement.bind(J),Y=q("div"),B=q("table"),K=q("tbody"),X=q("tr"),D=Array.isArray,U=Array.prototype,j=U.concat,R=U.filter,k=U.indexOf,_=U.map,u=U.push,p=U.slice,a=U.some,i=U.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,Z1=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/<.+>/,y=/^\w+$/;function h(Z,H){var z=m(H);return!Z||!z&&!C(H)&&!P(H)?[]:!z&&Z1.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!z&&y.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var O=function(){function Z(H,z){if(!H)return;if(S(H))return H;var w=H;if(E(H)){var L=z||J;if(w=s.test(H)&&C(L)?L.getElementById(H.slice(1).replace(/\\/g,"")):d.test(H)?i0(H):S(L)?L.find(H):E(L)?G(L).find(H):h(H,L),!w)return}else if(V(H))return this.ready(H);if(w.nodeType||w===Q)w=[w];this.length=w.length;for(var $=0,g=this.length;$<g;$++)this[$]=w[$]}return Z.prototype.init=function(H,z){return new Z(H,z)},Z}(),M=O.prototype,G=M.init;if(G.fn=G.prototype=M,M.length=0,M.splice=i,typeof Symbol==="function")M[Symbol.iterator]=U[Symbol.iterator];function S(Z){return Z instanceof O}function I(Z){return!!Z&&Z===Z.window}function C(Z){return!!Z&&Z.nodeType===9}function m(Z){return!!Z&&Z.nodeType===11}function P(Z){return!!Z&&Z.nodeType===1}function x(Z){return!!Z&&Z.nodeType===3}function f(Z){return typeof Z==="boolean"}function V(Z){return typeof Z==="function"}function E(Z){return typeof Z==="string"}function A(Z){return Z===void 0}function N(Z){return Z===null}function F(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function T(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}G.isWindow=I,G.isFunction=V,G.isArray=D,G.isNumeric=F,G.isPlainObject=T;function b(Z,H,z){if(z){var w=Z.length;while(w--)if(H.call(Z[w],w,Z[w])===!1)return Z}else if(T(Z)){var L=Object.keys(Z);for(var w=0,$=L.length;w<$;w++){var g=L[w];if(H.call(Z[g],g,Z[g])===!1)return Z}}else for(var w=0,$=Z.length;w<$;w++)if(H.call(Z[w],w,Z[w])===!1)return Z;return Z}G.each=b,M.each=function(Z){return b(this,Z)},M.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var z=f(Z[0])?Z.shift():!1,w=Z.shift(),L=Z.length;if(!w)return{};if(!L)return c(z,G,w);for(var $=0;$<L;$++){var g=Z[$];for(var v in g)if(z&&(D(g[v])||T(g[v]))){if(!w[v]||w[v].constructor!==g[v].constructor)w[v]=new g[v].constructor;c(z,w[v],g[v])}else w[v]=g[v]}return w}G.extend=c,M.extend=function(Z){return c(M,Z)};var l=/\S+/g;function o(Z){return E(Z)?Z.match(l)||[]:[]}M.toggleClass=function(Z,H){var z=o(Z),w=!A(H);return this.each(function(L,$){if(!P($))return;b(z,function(g,v){if(w)H?$.classList.add(v):$.classList.remove(v);else $.classList.toggle(v)})})},M.addClass=function(Z){return this.toggleClass(Z,!0)},M.removeAttr=function(Z){var H=o(Z);return this.each(function(z,w){if(!P(w))return;b(H,function(L,$){w.removeAttribute($)})})};function D1(Z,H){if(!Z)return;if(E(Z)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var z=this[0].getAttribute(Z);return N(z)?void 0:z}if(A(H))return this;if(N(H))return this.removeAttr(Z);return this.each(function(L,$){if(!P($))return;$.setAttribute(Z,H)})}for(var w in Z)this.attr(w,Z[w]);return this}M.attr=D1,M.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},M.hasClass=function(Z){return!!Z&&a.call(this,function(H){return P(H)&&H.classList.contains(Z)})},M.get=function(Z){if(A(Z))return p.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},M.eq=function(Z){return G(this.get(Z))},M.first=function(){return this.eq(0)},M.last=function(){return this.eq(-1)};function e(Z){if(A(Z))return this.get().map(function(H){return P(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,z){if(!P(z))return;z.textContent=Z})}M.text=e;function n(Z,H,z){if(!P(Z))return;var w=Q.getComputedStyle(Z,null);return z?w.getPropertyValue(H)||void 0:w[H]||Z.style[H]}function q1(Z,H){return parseInt(n(Z,H),10)||0}function m1(Z,H){return q1(Z,"border".concat(H?"Left":"Top","Width"))+q1(Z,"padding".concat(H?"Left":"Top"))+q1(Z,"padding".concat(H?"Right":"Bottom"))+q1(Z,"border".concat(H?"Right":"Bottom","Width"))}var R1={};function N1(Z){if(R1[Z])return R1[Z];var H=q(Z);J.body.insertBefore(H,null);var z=n(H,"display");return J.body.removeChild(H),R1[Z]=z!=="none"?z:"block"}function O1(Z){return n(Z,"display")==="none"}function x1(Z,H){var z=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!z&&!!H&&z.call(Z,H)}function A1(Z){return E(Z)?function(H,z){return x1(z,Z)}:V(Z)?Z:S(Z)?function(H,z){return Z.is(z)}:!Z?function(){return!1}:function(H,z){return z===Z}}M.filter=function(Z){var H=A1(Z);return G(R.call(this,function(z,w){return H.call(z,w,z)}))};function S1(Z,H){return!H?Z:Z.filter(H)}M.detach=function(Z){return S1(this,Z).each(function(H,z){if(z.parentNode)z.parentNode.removeChild(z)}),this};var x5=/^\s*<(\w+)[^>]*>/,k5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d0={"*":Y,tr:K,td:X,th:X,thead:B,tbody:B,tfoot:B};function i0(Z){if(!E(Z))return[];if(k5.test(Z))return[q(RegExp.$1)];var H=x5.test(Z)&&RegExp.$1,z=d0[H]||d0["*"];return z.innerHTML=Z,G(z.childNodes).detach().get()}G.parseHTML=i0,M.has=function(Z){var H=E(Z)?function(z,w){return h(Z,w).length}:function(z,w){return w.contains(Z)};return this.filter(H)},M.not=function(Z){var H=A1(Z);return this.filter(function(z,w){return(!E(Z)||P(w))&&!H.call(w,z,w)})};function F1(Z,H,z,w){var L=[],$=V(H),g=w&&A1(w);for(var v=0,M1=Z.length;v<M1;v++)if($){var W1=H(Z[v]);if(W1.length)u.apply(L,W1)}else{var B1=Z[v][H];while(B1!=null){if(w&&g(-1,B1))break;L.push(B1),B1=z?B1[H]:null}}return L}function c0(Z){if(Z.multiple&&Z.options)return F1(R.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function g5(Z){if(!arguments.length)return this[0]&&c0(this[0]);return this.each(function(H,z){var w=z.multiple&&z.options;if(w||Z5.test(z.type)){var L=D(Z)?_.call(Z,String):N(Z)?[]:[String(Z)];if(w)b(z.options,function($,g){g.selected=L.indexOf(g.value)>=0},!0);else z.checked=L.indexOf(z.value)>=0}else z.value=A(Z)||N(Z)?"":Z})}M.val=g5,M.is=function(Z){var H=A1(Z);return a.call(this,function(z,w){return H.call(z,w,z)})},G.guid=1;function j1(Z){return Z.length>1?R.call(Z,function(H,z,w){return k.call(w,H)===z}):Z}G.unique=j1,M.add=function(Z,H){return G(j1(this.get().concat(G(Z,H).get())))},M.children=function(Z){return S1(G(j1(F1(this,function(H){return H.children}))),Z)},M.parent=function(Z){return S1(G(j1(F1(this,"parentNode"))),Z)},M.index=function(Z){var H=Z?G(Z)[0]:this[0],z=Z?this:G(H).parent().children();return k.call(z,H)},M.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var z=this.parent();if(!z.length)return H;return z.closest(Z)},M.siblings=function(Z){return S1(G(j1(F1(this,function(H){return G(H).parent().children().not(H)}))),Z)},M.find=function(Z){return G(j1(F1(this,function(H){return h(Z,H)})))};var h5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,f5=/^$|^module$|\/(java|ecma)script/i,y5=["type","src","nonce","noModule"];function v5(Z,H){var z=G(Z);z.filter("script").add(z.find("script")).each(function(w,L){if(f5.test(L.type)&&W.contains(L)){var $=q("script");$.text=L.textContent.replace(h5,""),b(y5,function(g,v){if(L[v])$[v]=L[v]}),H.head.insertBefore($,null),H.head.removeChild($)}})}function u5(Z,H,z,w,L){if(w)Z.insertBefore(H,z?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,z?Z:Z.nextSibling);if(L)v5(H,Z.ownerDocument)}function P1(Z,H,z,w,L,$,g,v){return b(Z,function(M1,W1){b(G(W1),function(B1,T1){b(G(H),function(w1,l1){var P0=z?T1:l1,E0=z?l1:T1,z1=z?B1:w1;u5(P0,!z1?E0:E0.cloneNode(!0),w,L,!z1)},v)},g)},$),H}M.after=function(){return P1(arguments,this,!1,!1,!1,!0,!0)},M.append=function(){return P1(arguments,this,!1,!1,!0)};function m5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(A(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(z,w){if(!P(w))return;if(H)G(w).empty().append(Z);else w.innerHTML=Z})}M.html=m5,M.appendTo=function(Z){return P1(arguments,this,!0,!1,!0)},M.wrapInner=function(Z){return this.each(function(H,z){var w=G(z),L=w.contents();L.length?L.wrapAll(Z):w.append(Z)})},M.before=function(){return P1(arguments,this,!1,!0)},M.wrapAll=function(Z){var H=G(Z),z=H[0];while(z.children.length)z=z.firstElementChild;return this.first().before(H),this.appendTo(z)},M.wrap=function(Z){return this.each(function(H,z){var w=G(Z)[0];G(z).wrapAll(!H?w:w.cloneNode(!0))})},M.insertAfter=function(Z){return P1(arguments,this,!0,!1,!1,!1,!1,!0)},M.insertBefore=function(Z){return P1(arguments,this,!0,!0)},M.prepend=function(){return P1(arguments,this,!1,!0,!0,!0,!0)},M.prependTo=function(Z){return P1(arguments,this,!0,!0,!0,!1,!1,!0)},M.contents=function(){return G(j1(F1(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},M.next=function(Z,H,z){return S1(G(j1(F1(this,"nextElementSibling",H,z))),Z)},M.nextAll=function(Z){return this.next(Z,!0)},M.nextUntil=function(Z,H){return this.next(H,!0,Z)},M.parents=function(Z,H){return S1(G(j1(F1(this,"parentElement",!0,H))),Z)},M.parentsUntil=function(Z,H){return this.parents(H,Z)},M.prev=function(Z,H,z){return S1(G(j1(F1(this,"previousElementSibling",H,z))),Z)},M.prevAll=function(Z){return this.prev(Z,!0)},M.prevUntil=function(Z,H){return this.prev(H,!0,Z)},M.map=function(Z){return G(j.apply([],_.call(this,function(H,z){return Z.call(H,z,H)})))},M.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},M.offsetParent=function(){return this.map(function(Z,H){var z=H.offsetParent;while(z&&n(z,"position")==="static")z=z.offsetParent;return z||W})},M.slice=function(Z,H){return G(p.call(this,Z,H))};var d5=/-([a-z])/g;function F0(Z){return Z.replace(d5,function(H,z){return z.toUpperCase()})}M.ready=function(Z){var H=function(){return setTimeout(Z,0,G)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},M.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var z=G(H);z.replaceWith(z.children())}),this},M.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},M.position=function(){var Z=this[0];if(!Z)return;var H=n(Z,"position")==="fixed",z=H?Z.getBoundingClientRect():this.offset();if(!H){var w=Z.ownerDocument,L=Z.offsetParent||w.documentElement;while((L===w.body||L===w.documentElement)&&n(L,"position")==="static")L=L.parentNode;if(L!==Z&&P(L)){var $=G(L).offset();z.top-=$.top+q1(L,"borderTopWidth"),z.left-=$.left+q1(L,"borderLeftWidth")}}return{top:z.top-q1(Z,"marginTop"),left:z.left-q1(Z,"marginLeft")}};var p0={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};M.prop=function(Z,H){if(!Z)return;if(E(Z)){if(Z=p0[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(w,L){L[Z]=H})}for(var z in Z)this.prop(z,Z[z]);return this},M.removeProp=function(Z){return this.each(function(H,z){delete z[p0[Z]||Z]})};var i5=/^--/;function L0(Z){return i5.test(Z)}var I0={},c5=Y.style,p5=["webkit","moz","ms"];function o5(Z,H){if(H===void 0)H=L0(Z);if(H)return Z;if(!I0[Z]){var z=F0(Z),w="".concat(z[0].toUpperCase()).concat(z.slice(1)),L="".concat(z," ").concat(p5.join("".concat(w," "))).concat(w).split(" ");b(L,function($,g){if(g in c5)return I0[Z]=g,!1})}return I0[Z]}var s5={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 o0(Z,H,z){if(z===void 0)z=L0(Z);return!z&&!s5[Z]&&F(H)?"".concat(H,"px"):H}function l5(Z,H){if(E(Z)){var z=L0(Z);if(Z=o5(Z,z),arguments.length<2)return this[0]&&n(this[0],Z,z);if(!Z)return this;return H=o0(Z,H,z),this.each(function(L,$){if(!P($))return;if(z)$.style.setProperty(Z,H);else $.style[Z]=H})}for(var w in Z)this.css(w,Z[w]);return this}M.css=l5;function s0(Z,H){try{return Z(H)}catch(z){return H}}var n5=/^\s+|\s+$/;function l0(Z,H){var z=Z.dataset[H]||Z.dataset[F0(H)];if(n5.test(z))return z;return s0(JSON.parse,z)}function r5(Z,H,z){z=s0(JSON.stringify,z),Z.dataset[F0(H)]=z}function t5(Z,H){if(!Z){if(!this[0])return;var z={};for(var w in this[0].dataset)z[w]=l0(this[0],w);return z}if(E(Z)){if(arguments.length<2)return this[0]&&l0(this[0],Z);if(A(H))return this;return this.each(function(L,$){r5($,Z,H)})}for(var w in Z)this.data(w,Z[w]);return this}M.data=t5;function n0(Z,H){var z=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],z["scroll".concat(H)],Z.body["offset".concat(H)],z["offset".concat(H)],z["client".concat(H)])}b([!0,!1],function(Z,H){b(["Width","Height"],function(z,w){var L="".concat(H?"outer":"inner").concat(w);M[L]=function($){if(!this[0])return;if(I(this[0]))return H?this[0]["inner".concat(w)]:this[0].document.documentElement["client".concat(w)];if(C(this[0]))return n0(this[0],w);return this[0]["".concat(H?"offset":"client").concat(w)]+($&&H?q1(this[0],"margin".concat(z?"Top":"Left"))+q1(this[0],"margin".concat(z?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(Z,H){var z=H.toLowerCase();M[z]=function(w){if(!this[0])return A(w)?void 0:this;if(!arguments.length){if(I(this[0]))return this[0].document.documentElement["client".concat(H)];if(C(this[0]))return n0(this[0],H);return this[0].getBoundingClientRect()[z]-m1(this[0],!Z)}var L=parseInt(w,10);return this.each(function($,g){if(!P(g))return;var v=n(g,"boxSizing");g.style[z]=o0(z,L+(v==="border-box"?m1(g,!Z):0))})}});var r0="___cd";M.toggle=function(Z){return this.each(function(H,z){if(!P(z))return;var w=O1(z),L=A(Z)?w:Z;if(L){if(z.style.display=z[r0]||"",O1(z))z.style.display=N1(z.tagName)}else if(!w)z[r0]=n(z,"display"),z.style.display="none"})},M.hide=function(){return this.toggle(!1)},M.show=function(){return this.toggle(!0)};var t0="___ce",V0=".",C0={focus:"focusin",blur:"focusout"},a0={mouseenter:"mouseover",mouseleave:"mouseout"},a5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N0(Z){return a0[Z]||C0[Z]||Z}function S0(Z){var H=Z.split(V0);return[H[0],H.slice(1).sort()]}M.trigger=function(Z,H){if(E(Z)){var z=S0(Z),w=z[0],L=z[1],$=N0(w);if(!$)return this;var g=a5.test($)?"MouseEvents":"HTMLEvents";Z=J.createEvent(g),Z.initEvent($,!0,!0),Z.namespace=L.join(V0),Z.___ot=w}Z.___td=H;var v=Z.___ot in C0;return this.each(function(M1,W1){if(v&&V(W1[Z.___ot]))W1["___i".concat(Z.type)]=!0,W1[Z.___ot](),W1["___i".concat(Z.type)]=!1;W1.dispatchEvent(Z)})};function e0(Z){return Z[t0]=Z[t0]||{}}function e5(Z,H,z,w,L){var $=e0(Z);$[H]=$[H]||[],$[H].push([z,w,L]),Z.addEventListener(H,L)}function J5(Z,H){return!H||!a.call(H,function(z){return Z.indexOf(z)<0})}function s1(Z,H,z,w,L){var $=e0(Z);if(!H)for(H in $)s1(Z,H,z,w,L);else if($[H])$[H]=$[H].filter(function(g){var v=g[0],M1=g[1],W1=g[2];if(L&&W1.guid!==L.guid||!J5(v,z)||w&&w!==M1)return!0;Z.removeEventListener(H,W1)})}M.off=function(Z,H,z){var w=this;if(A(Z))this.each(function($,g){if(!P(g)&&!C(g)&&!I(g))return;s1(g)});else if(!E(Z))for(var L in Z)this.off(L,Z[L]);else{if(V(H))z=H,H="";b(o(Z),function($,g){var v=S0(g),M1=v[0],W1=v[1],B1=N0(M1);w.each(function(T1,w1){if(!P(w1)&&!C(w1)&&!I(w1))return;s1(w1,B1,W1,H,z)})})}return this},M.remove=function(Z){return S1(this,Z).detach().off(),this},M.replaceWith=function(Z){return this.before(Z).remove()},M.replaceAll=function(Z){return G(Z).replaceWith(this),this};function J8(Z,H,z,w,L){var $=this;if(!E(Z)){for(var g in Z)this.on(g,H,z,Z[g],L);return this}if(!E(H))if(A(H)||N(H))H="";else if(A(z))z=H,H="";else w=z,z=H,H="";if(!V(w))w=z,z=void 0;if(!w)return this;return b(o(Z),function(v,M1){var W1=S0(M1),B1=W1[0],T1=W1[1],w1=N0(B1),l1=B1 in a0,P0=B1 in C0;if(!w1)return;$.each(function(E0,z1){if(!P(z1)&&!C(z1)&&!I(z1))return;var $0=function(X1){if(X1.target["___i".concat(X1.type)])return X1.stopImmediatePropagation();if(X1.namespace&&!J5(T1,X1.namespace.split(V0)))return;if(!H&&(P0&&(X1.target!==z1||X1.___ot===w1)||l1&&X1.relatedTarget&&z1.contains(X1.relatedTarget)))return;var R0=z1;if(H){var k1=X1.target;while(!x1(k1,H)){if(k1===z1)return;if(k1=k1.parentNode,!k1)return}R0=k1}Object.defineProperty(X1,"currentTarget",{configurable:!0,get:function(){return R0}}),Object.defineProperty(X1,"delegateTarget",{configurable:!0,get:function(){return z1}}),Object.defineProperty(X1,"data",{configurable:!0,get:function(){return z}});var H8=w.call(R0,X1,X1.___td);if(L)s1(z1,w1,T1,H,$0);if(H8===!1)X1.preventDefault(),X1.stopPropagation()};$0.guid=w.guid=w.guid||G.guid++,e5(z1,w1,T1,H,$0)})}),this}M.on=J8;function Z8(Z,H,z,w){return this.on(Z,H,z,w,!0)}M.one=Z8;var Q8=/\r?\n/g;function W8(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(Q8,"\r\n")))}var X8=/file|reset|submit|button|image/i,Z5=/radio|checkbox/i;if(M.serialize=function(){var Z="";return this.each(function(H,z){b(z.elements||[z],function(w,L){if(L.disabled||!L.name||L.tagName==="FIELDSET"||X8.test(L.type)||Z5.test(L.type)&&!L.checked)return;var $=c0(L);if(!A($)){var g=D($)?$:[$];b(g,function(v,M1){Z+=W8(L.name,M1)})}})}),Z.slice(1)},typeof W5!=="undefined")X5.exports=G;else Q.cash=Q.$=G})()});var n1=function(J,Q){if(!Q)return J;return J.replace(/{(\w+)}/g,(W,q)=>{return Q[q]!==void 0?Q[q].toString():`{${q}}`})},Q5=(J,Q,W,q,Y)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(q.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=W["*"];if(typeof X==="object")X=X[Y||"*"];return n1(X,q)}if(typeof q.count==="string")q.count=Number(q.count);let B="*";if(q.count.toString()in W)B=q.count.toString();let K=W[B]||W["*"];if(typeof K==="object")K=K[Y||"*"];return n1(K,q)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let B;for(let K in W)try{if(new Function("params",`with( params ){ return ${K}; }`)(q||{})){B=W[K];break}}catch(X){console.warn(`Invalid <${Q}(${K})> condition expression`)}if(B===void 0)return;if(typeof B==="object")B=B[Y||"*"];return n1(B,q)}case"variable":default:{const B=typeof W==="object"?W[Y||"*"]:W;if(typeof B==="object"){console.warn(`Invalid <${Q}> variable variant definition`);return}return n1(B,q)}}};class r1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Q){this.DICTIONARIES[J]=Q}translate(J,Q){if(Q&&this.currentLang===Q)return{text:J,lang:this.currentLang};Q=Q||this.currentLang;const[W,q]=Q.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const Y=this.DICTIONARIES[W][J];J=Y[q||"*"]||Y["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Q}}format(J,Q,W){W=W||this.currentLang;const[q,Y]=W.split("-");if(!this.DICTIONARIES[q]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[q][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const B=this.DICTIONARIES[q][J];if(typeof B==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof B!=="object"||B===null||Array.isArray(B)){console.warn(`Invalid <${W}[${J}]> format value`);return}return Q5(B.type,J,B.value,Q,Y)}}class t1{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Q){this.callbacks.set(J,Q)}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((Q)=>{try{const W=this.callbacks.get(Q);if(W)W()}catch(W){console.error(`Error updating component ${Q}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class a1{subscriptions=new Map;tick=new t1;register(J,Q){this.subscriptions.set(J,Q),this.tick.register(J,Q)}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,Q)=>{this.subscriptions.set(Q,()=>{})})}proxyState(J,Q){const W=this,q=new WeakMap,Y=(K)=>{if(K instanceof Map)K.forEach((D,U)=>K.set(U,B(D)));else if(Array.isArray(K))K.forEach((D,U)=>K[U]=B(D));else if(typeof K==="object")Object.entries(K).forEach(([D,U])=>K[D]=B(U));let X=new Proxy(K,{get(D,U){if(U==="toJSON")return function(){const R=(k)=>{if(!k||typeof k!=="object")return k;if(q.has(k)){const _=q.get(k);if(_ instanceof Map){const p={};return _.forEach((a,i)=>p[typeof i==="object"?JSON.stringify(i):String(i)]=R(a)),p}if(Array.isArray(_))return _.map((p)=>R(p));const u={};return Object.entries(_).forEach(([p,a])=>u[p]=R(a)),u}if(typeof k.toJSON==="function"&&!q.has(k))return k.toJSON();return k};return R(X)};if(U==="reset")return function(){X=null};const j=D[U];if(K instanceof Map&&typeof j==="function")return function(...R){const k=U.toString();if(k==="set"&&R.length>=2)R[1]=B(R[1]);const _=j.apply(D,R);return["set","delete","clear"].includes(k)&&W.queueUpdate(J),_};if(Array.isArray(K)&&typeof j==="function")return function(...R){const k=U.toString();if(["push","unshift"].includes(k))R=R.map((u)=>B(u));else if(k==="splice"&&R.length>2)R=[R[0],R[1],...R.slice(2).map((u)=>B(u))];const _=j.apply(D,R);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(k)&&W.queueUpdate(J),_};return j},set(D,U,j){if(D[U]===j)return!0;if(j instanceof Map&&D[U]instanceof Map){const R=D[U];return R.clear(),j.forEach((k,_)=>R.set(_,B(k))),W.queueUpdate(J),!0}return D[U]=B(j),W.queueUpdate(J),!0}});return q.set(X,K),X},B=(K)=>{if(!K)return K;return K instanceof Map||Array.isArray(K)||typeof K==="object"?Y(K):K};return Y(Q)}}class e1{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Q)=>{try{const W=Q.node;if(!W){this.unwatch(Q);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Q),Q.emit("component:attached",Q),typeof Q.onAttach=="function"&&Q.onAttach.bind(Q)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Q),Q.emit("component:detached",Q),typeof Q.onDetach=="function"&&Q.onDetach.bind(Q)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Q="attach"){const W=J.node;if(!W)return;if(Q==="attach"&&document.contains(W[0])){J.emit("component:attached",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Q==="detach"&&!document.contains(W[0])){J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const q=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Q}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:q,type:Q}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Q==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Q=this.observedComponents.get(J);if(Q)clearTimeout(Q.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 J0{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.add(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);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:Q,dependent:W})=>{try{const q=W.update(W.memo,"batch-updator");if(q)typeof q.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:q.memo}),typeof q.cleanup==="function"&&q.cleanup()}catch(q){console.error("Failed to update dependency --",q)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class Z0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Q){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Q),this}once(J,Q){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Q),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Q){if(!this.options.emit)return;const W=Q.map((q)=>typeof q.toJSON==="function"?q.toJSON():q);this.__events[J]?.forEach((q)=>q(...W)),this.__once_events[J]?.forEach((q)=>q(...W)),delete this.__once_events[J]}}var b0=T0(Q0(),1);function H1(J,Q){if(J===Q)return!1;if(typeof J!=="object"||typeof Q!=="object")return!1;if(J===null||Q===null)return!0;if(J instanceof Set){if(!(Q instanceof Set))return!0;if(J.size!==Q.size)return!0;if(H5(J)&&H5(Q)){for(let K of J)if(!Q.has(K))return!0;return!1}const B=new WeakMap;for(let K of J){let X=!1;if(typeof K!=="object"){if(Q.has(K))X=!0}else for(let D of Q){if(typeof D!=="object")continue;if(!B.has(K))B.set(K,new WeakMap);const U=B.get(K);if(U.has(D)){if(X=U.get(D),X)break;continue}const j=!H1(K,D);if(U.set(D,j),j){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(Q instanceof Map))return!0;if(J.size!==Q.size)return!0;if(q5(J)&&q5(Q)){for(let[K,X]of J)if(Q.get(K)!==X)return!0;return!1}const B=new WeakMap;for(let[K,X]of J){if(typeof K!=="object"){if(!Q.has(K))return!0;const j=Q.get(K);if(typeof X!=="object"){if(X!==j)return!0;continue}if(typeof j!=="object"||H1(X,j))return!0;continue}let D=!1,U=!1;for(let[j,R]of Q){if(typeof j!=="object")continue;if(!B.has(K))B.set(K,new WeakMap);const k=B.get(K);if(k.has(j)){const[_,u]=k.get(j);if(_){D=!0,U=u;break}continue}if(!H1(K,j)){if(D=!0,U=typeof X==="object"&&typeof R==="object"?!H1(X,R):X===R,k.set(j,[!0,U]),U)break}else k.set(j,[!1,!1])}if(!D||!U)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Q))return!0;if(J.length!==Q.length)return!0;for(let B=0;B<J.length;B++){const K=J[B],X=Q[B];if(K!==X&&(typeof K!=="object"||H1(K,X)))return!0}return!1}const W=Object.keys(J),q=Object.keys(Q);if(W.length!==q.length)return!0;W.sort(),q.sort();const Y=W.length;for(let B=0;B<Y;B++)if(W[B]!==q[B])return!0;for(let B=0;B<Y;B++){const K=W[B],X=J[K],D=Q[K];if(X===D)continue;if(X instanceof Date){if(!(D instanceof Date)||String(X)!==String(D))return!0;continue}if(X instanceof RegExp){if(!(D instanceof RegExp)||X.source!==D.source||X.flags!==D.flags)return!0;continue}if(X instanceof Map){if(!(D instanceof Map)||H1(X,D))return!0;continue}if(X instanceof Set){if(!(D instanceof Set)||H1(X,D))return!0;continue}if(X instanceof Function){if(!(D instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof D!=="object")return!0;if(X===J){if(D!==Q)return!0}else if(H1(X,D))return!0}else return!0}return!1}function E1(J,Q){if(J===Q)return!0;if(J==null||Q==null)return J===Q;const W=typeof J;if(W!==typeof Q)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Q))return!0;return!1}if(J instanceof Date)return Q instanceof Date&&J.getTime()===Q.getTime();if(J instanceof RegExp)return Q instanceof RegExp&&J.source===Q.source&&J.flags===Q.flags;if(J instanceof Error)return Q instanceof Error&&J.name===Q.name&&J.message===Q.message&&(J.stack===Q.stack||!J.stack&&!Q.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Q))return!1;if(J.byteLength!==Q.byteLength)return!1;const X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),D=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);for(let U=0;U<X.length;U++)if(X[U]!==D[U])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Q;if(typeof J==="function"){if(typeof Q!=="function")return!1;return J.toString()===Q.toString()&&J.name===Q.name}if(J.constructor!==Q.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!H1(J,Q);const Y=Object.getPrototypeOf(J);if(Y!==Object.getPrototypeOf(Q))return!1;const B=Object.getOwnPropertyNames(J),K=Object.getOwnPropertyNames(Q);if(B.length!==K.length)return!1;for(let X of B){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!E1(J[X],Q[X]))return!1}if(Y!==null&&Y!==Object.prototype){const X=Object.getOwnPropertyNames(Y),D=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==D.length)return!1;for(let U of X){if(U==="constructor")continue;if(!E1(Y[U],Object.getPrototypeOf(Q)[U]))return!1}}return!0}function H5(J){for(let Q of J)if(typeof Q==="object"&&Q!==null)return!1;return!0}function q5(J){for(let[Q,W]of J)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0}function J1(J,Q=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Q.has(J))return Q.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 Y=new Map;return Q.set(J,Y),J.forEach((B,K)=>Y.set(J1(K,Q),J1(B,Q))),Y}if(J instanceof Set){const Y=new Set;return Q.set(J,Y),J.forEach((B)=>Y.add(J1(B,Q))),Y}if(Array.isArray(J)){const Y=[];Q.set(J,Y);for(let B=0;B<J.length;B++)Y[B]=J1(J[B],Q);return Y}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Q.set(J,W);const q=Object.getOwnPropertySymbols(J);for(let Y of q)W[Y]=J1(J[Y],Q);for(let Y in J)if(Object.prototype.hasOwnProperty.call(J,Y))W[Y]=J1(J[Y],Q);return W}function B5(J,Q){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Q||typeof Q!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Q).length)return{...J};function W(Y,B,K){const X=B.split(/\.|\[|\]/).filter(Boolean);let D=Y;for(let U=0;U<X.length;U++){const j=X[U],R=!isNaN(Number(j)),k=U===X.length-1,_=!isNaN(Number(X[U+1]));if(k){D[j]=K;continue}if(!(j in D))D[j]=_?[]:{};else if(_&&!Array.isArray(D[j]))D[j]=[];else if(!_&&Array.isArray(D[j]))D[j]={};D=D[j]}}const q=J1(J);try{for(let[Y,B]of Object.entries(Q)){if(typeof Y!=="string")throw new TypeError(`Invalid path: ${Y}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(Y))throw new Error(`Invalid path format: ${Y}`);W(q,Y,B)}}catch(Y){throw new Error(`Failed to assign value: ${Y.message}`)}return q}var $1="i18n",L1="syn:",U1="fn:",b1="on-",t=/^\.\.\./,W0=/^\[(.*?)\]$/,_0=/{\s*([^{}]+)\s*}/g,Y5=["@html","@text","@format"];b0.default.fn.extend({attrs:function(){const J={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&b0.default.each(Q.attributes,function(){J[this.name]=this.value}),J}});class X0{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((Q,W)=>Q+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,Q){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Q}add(J,Q){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Q}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=J1(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)},Q={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},q={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},Y={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},B={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},K={"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(Q),console.table(W),console.table(q),console.table(Y),console.table(B),console.table(K),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 J1(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var r=T0(Q0(),1);var R5=T0(Q0(),1);var H0="comm",q0="rule",Y0="decl";var z5="@import";var G5="@namespace",K5="@keyframes";var O5="@layer";function B0(J){return J.trim()}function g1(J,Q,W){return J.replace(Q,W)}function M5(J,Q,W){return J.indexOf(Q,W)}function I1(J,Q){return J.charCodeAt(Q)|0}function V1(J,Q,W){return J.slice(Q,W)}function Y1(J){return J.length}function z0(J){return J.length}function h1(J,Q){return Q.push(J),J}var x0=Math.abs,i1=String.fromCharCode;function K0(J,Q,W,q,Y,B,K,X){return{value:J,root:Q,parent:W,type:q,props:Y,children:B,line:G0,column:f1,length:K,return:"",siblings:X}}function U5(){return Q1}function D5(){if(Q1=G1>0?I1(v1,--G1):0,f1--,Q1===10)f1=1,G0--;return Q1}function K1(){if(Q1=G1<w5?I1(v1,G1++):0,f1++,Q1===10)f1=1,G0++;return Q1}function C1(){return I1(v1,G1)}function c1(){return G1}function O0(J,Q){return V1(v1,J,Q)}function y1(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 j5(J){return G0=f1=1,w5=Y1(v1=J),G1=0,[]}function F5(J){return v1="",J}function M0(J){return B0(O0(G1-1,k0(J===91?J+2:J===40?J+1:J)))}function L5(J){while(Q1=C1())if(Q1<33)K1();else break;return y1(J)>2||y1(Q1)>3?"":" "}function I5(J,Q){while(--Q&&K1())if(Q1<48||Q1>102||Q1>57&&Q1<65||Q1>70&&Q1<97)break;return O0(J,c1()+(Q<6&&C1()==32&&K1()==32))}function k0(J){while(K1())switch(Q1){case J:return G1;case 34:case 39:if(J!==34&&J!==39)k0(Q1);break;case 40:if(J===41)k0(J);break;case 92:K1();break}return G1}function V5(J,Q){while(K1())if(J+Q1===57)break;else if(J+Q1===84&&C1()===47)break;return"/*"+O0(Q,G1-1)+"*"+i1(J===47?J:K1())}function C5(J){while(!y1(C1()))K1();return O0(J,G1)}var G0=1,f1=1,w5=0,G1=0,Q1=0,v1="";function P5(J){return F5(w0("",null,null,null,[""],J=j5(J),0,[0],J))}function w0(J,Q,W,q,Y,B,K,X,D){var U=0,j=0,R=K,k=0,_=0,u=0,p=1,a=1,i=1,s=0,Z1="",d=Y,y=B,h=q,O=Z1;while(a)switch(u=s,s=K1()){case 40:if(u!=108&&I1(O,R-1)==58){if(M5(O+=g1(M0(s),"&","&\f"),"&\f",x0(U?X[U-1]:0))!=-1)i=-1;break}case 34:case 39:case 91:O+=M0(s);break;case 9:case 10:case 13:case 32:O+=L5(u);break;case 92:O+=I5(c1()-1,7);continue;case 47:switch(C1()){case 42:case 47:if(h1(O8(V5(K1(),c1()),Q,W,D),D),(y1(u||1)==5||y1(C1()||1)==5)&&Y1(O)&&V1(O,-1,void 0)!==" ")O+=" ";break;default:O+="/"}break;case 123*p:X[U++]=Y1(O)*i;case 125*p:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+j:if(i==-1)O=g1(O,/\f/g,"");if(_>0&&(Y1(O)-R||p===0&&u===47))h1(_>32?S5(O+";",q,W,R-1,D):S5(g1(O," ","")+";",q,W,R-2,D),D);break;case 59:O+=";";default:if(h1(h=N5(O,Q,W,U,j,Y,X,Z1,d=[],y=[],R,B),B),s===123)if(j===0)w0(O,Q,h,h,d,B,R,X,y);else{switch(k){case 99:if(I1(O,3)===110)break;case 108:if(I1(O,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)w0(J,h,h,q&&h1(N5(J,h,h,0,0,Y,X,Z1,Y,d=[],R,y),y),Y,y,R,X,q?d:y);else w0(O,h,h,h,[""],y,0,X,y)}}U=j=_=0,p=i=1,Z1=O="",R=K;break;case 58:R=1+Y1(O),_=u;default:if(p<1){if(s==123)--p;else if(s==125&&p++==0&&D5()==125)continue}switch(O+=i1(s),s*p){case 38:i=j>0?1:(O+="\f",-1);break;case 44:X[U++]=(Y1(O)-1)*i,i=1;break;case 64:if(C1()===45)O+=M0(K1());k=C1(),j=R=Y1(Z1=O+=C5(c1())),s++;break;case 45:if(u===45&&Y1(O)==2)p=0}}return B}function N5(J,Q,W,q,Y,B,K,X,D,U,j,R){var k=Y-1,_=Y===0?B:[""],u=z0(_);for(var p=0,a=0,i=0;p<q;++p)for(var s=0,Z1=V1(J,k+1,k=x0(a=K[p])),d=J;s<u;++s)if(d=B0(a>0?_[s]+" "+Z1:g1(Z1,/&\f/g,_[s])))D[i++]=d;return K0(J,Q,W,Y===0?q0:X,D,U,j,R)}function O8(J,Q,W,q){return K0(J,Q,W,H0,i1(U5()),V1(J,2,-2),0,q)}function S5(J,Q,W,q,Y){return K0(J,Q,W,Y0,V1(J,0,q),V1(J,q+1,-1),q,Y)}function U0(J,Q){var W="";for(var q=0;q<J.length;q++)W+=Q(J[q],q,J,Q)||"";return W}function E5(J,Q,W,q){switch(J.type){case O5:if(J.children.length)break;case z5:case G5:case Y0:return J.return=J.return||J.value;case H0:return"";case K5:return J.return=J.value+"{"+U0(J.children,q)+"}";case q0:if(!Y1(J.value=J.props.join(",")))return""}return Y1(W=U0(J.children,q))?J.return=J.value+"{"+W+"}":""}function $5(J){var Q=z0(J);return function(W,q,Y,B){var K="";for(var X=0;X<Q;X++)K+=J[X](W,q,Y,B)||"";return K}}class u1{nsp;settings;$head;constructor(J,Q){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=R5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(J){try{return U0(P5(J),$5([E5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(J){return new Promise((Q)=>{const W=new MutationObserver(()=>{const q=document.querySelector(J);if(q&&getComputedStyle(q).cssText)W.disconnect(),Q()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Q=`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 q=document.createElement("style");q.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),q.textContent=W;let Y=0;const B=this.$head.find(`style[${Q}]`);if(B.length)Y=parseInt(B.attr("dindex"))+1,B.remove();return q.setAttribute("dindex",String(Y)),this.settings.meta?document.head.prepend(q):document.head.appendChild(q),q}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 Q=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 Q=parseInt(J.attr("dindex"));Q===0?J.remove():J.attr("dindex",String(Q-1))}async custom(){return{}}async style(){return{}}}var M8=function(J){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=J,q;while((q=Q.exec(J))!==null){const Y=q[1],B=q.index+q[0].length;let K=1,X=B;while(X<J.length&&K>0){if(J[X]==="(")K++;if(J[X]===")")K--;X++}if(K===0){const D=J.slice(B,X-1).trim(),U=J.slice(0,q.index),j=`${b1}${Y}="${D}"`,R=J.slice(X);W=U+j+R,J=W,Q.lastIndex=U.length+j.length}}return W},w8=function(J){const Q=[];let q=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(Y,B,K)=>{return Q.push(K),`<${B}##TAG_ATTRS_${Q.length-1}##>`});for(let Y=0;Y<Q.length;Y++){const B=`##TAG_ATTRS_${Y}##`,K=Q[Y],X=U8(K);q=q.replace(B,X)}return q},U8=function(J){let Q="",W=0,q=!1,Y="",B=0,K=0,X=0;while(W<J.length){const D=J[W];if((D==='"'||D==="'")&&(W===0||J[W-1]!=="\\")){if(!q)q=!0,Y=D;else if(D===Y)q=!1}if(!q){if(D==="(")K++;else if(D===")")K--;else if(D==="{")X++;else if(D==="}")X--}if(!q&&K===0&&X===0&&(D===" "||W===J.length-1)){let U=W;if(W===J.length-1)U=W+1;const j=J.substring(B,U).trim();if(j){const R=D8(j);Q+=" "+R}B=W+1}W++}return Q},D8=function(J){const Q=J.indexOf("=");if(Q===-1){if(J===$1||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Q).trim(),q=J.substring(Q+1).trim();if(W.startsWith("@"))return W=!Y5.includes(W)?W.slice(1):W,`:${W}=${q}`;if(W.startsWith(U1)||W.startsWith(b1))return J;if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")){const Y=q.substring(1,q.length-1);if(j8(Y))return`:${W}="${Y}"`;return J}else return`:${W}="${q}"`};function j8(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 g0(J){let Q=(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,q,Y)=>{return Y.endsWith("<")?`<lips dtag="${q}" ${Y}/lips>`:`<lips dtag="${q}" ${Y}></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 ${U1}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=M8(Q),Q=w8(Q),Q}var F8=function(J,Q){if(J.isDisposed)return;Q.add(J),J.dependencies.add(Q)},T5=function(J){for(let Q of J.dependencies)Q.delete(J);J.dependencies.clear()};function _1(J,Q={maxSize:100}){const W=new Set,q=[{value:J,timestamp:Date.now()}];let Y=0;const B=()=>{const U=D0[D0.length-1];return U&&F8(U,W),q[Y].value},K=()=>{const U=[...W];if(A5)for(let j of U)A5.add(j);else for(let j of U)j.execute()};return[B,(U,j)=>{if(Object.is(q[Y].value,U))return;if(Y<q.length-1)q.splice(Y+1);if(q.push({value:U,timestamp:Date.now(),metadata:j}),q.length>Q.maxSize)q.shift(),Y=Math.max(0,Y-1);else Y++;K()},{undo(){if(Y>0)Y--,K()},redo(){if(Y<q.length-1)Y++,K()},jumpTo(U){if(U>=0&&U<q.length&&U!==Y)Y=U,K()},getHistory(){return[...q]},getCurrentIndex(){return Y},canUndo(){return Y>0},canRedo(){return Y<q.length-1},clear(){const U=q[0];q.length=0,q.push(U),Y=0,K()}}]}function p1(J){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(q.isDisposed)return;Q=!0,T5(q),D0.push(q);try{J()}finally{Q=!1,D0.pop()}},q={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{q.isDisposed=!0,T5(q)}}}var D0=[],A5=null;class o1 extends Z0{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;__renderCache=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,Q,{input:W,state:q,context:Y,_static:B,handler:K,stylesheet:X,macros:D,declaration:U},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=g0(Q),this.declaration=U||{name:J},this.input=W||{},this.static=B||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,q||{}),D&&this.setMacros(D),K&&this.setHandler(K),X&&this.setStylesheet(X),this.metrics=new X0(this.debug),this.metrics.inc("componentCount"),this.UQS=new J0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:J1(this.input),state:J1(this.state),context:J1(this.context)};const[R,k]=_1(this.input),[_,u]=_1(this.state),[p,a]=_1(this.context);this.__setInput=k,this.__setState=u,this.__getState=_,this.lips.IUC.register(this.__path__,()=>{H1(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(Y)&&Y.length&&this.lips.useContext(Y,(i)=>{if(!H1(this.context,i))return;a(i),this.context=i,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.lips.useTranslator("*",(i)=>{if(i===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=i}),this.ICE=p1(()=>{const i=R(),s=_(),Z1=this.context=p();if(!this.isRendered){this.metrics.reset();const{$log:d}=this.render("",void 0,void 0,this.FGUD);this.$=d,!U?.syntax&&this.$?.each((y,h)=>typeof h.setAttribute=="function"&&h.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:s,input:i,context:Z1},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:J1(i),state:J1(s),context:J1(Z1)},this.input=i;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(J,Q){this.lips.setContext(J,Q)}setInput(J){if(!H1(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(B5(this.input,J)),this}setMacros(J){const Q=g0(J),W=r.default(Q);if(!W.length)return;const q=this;W.each(function(){const Y=r.default(this),{argv:B,attrs:K}=q.__getAttributes__(Y);if(!Object.keys(K))throw new Error("Invalid macro component definition");if(!K.literals.name)throw new Error("Undefined macro `name` attribute.");if(q.__macros.get(K.literals.name))console.warn(`Duplicate macro <${K.literals.name}> will be override`);if(!Y.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");q.__macros.set(K.literals.name,{argv:B,$node:Y})})}setHandler(J){Object.entries(J).map(([Q,W])=>this[Q]=W.bind(this))}setStylesheet(J){const Q={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new u1(this.__name__,Q)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,Q,W={},q,Y){const B=q||new Map,K=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:B};this.metrics.startRender();const X=this;let D=r.default();function U(O){const M=j(O);return X.__pathCounter++,X.__path?`${X.__path}/${M}`:`${J?J+"/":"#"}${M}`}function j(O){return(O==="component"?"c":"")+X.__pathCounter}function R(O){return O!==null&&typeof O==="object"&&typeof O.mesh==="function"&&typeof O.update==="function"}function k(O){return O!==null&&typeof O==="object"&&typeof O.default&&typeof O.default==="string"}function _(O){if(!O.attr(":dtag")||O.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const M=O.attr(":dtag"),G=X.__evaluate__(M,W);if(R(G)||G===null)return i(O,M,G);else if(k(G))return s(O,{template:G});else return s(O,{name:G})}function u(O){const M=O.attr(":args"),G=U("log");if(!M)return;if(X.__evaluate__(`console.log(${M})`,W),X.__isReactive__(M,W))X.__extractExpressionDeps__(M,W).forEach((I)=>X.__trackDep__(B,I,{$fragment:null,path:G,update:(C)=>X.__evaluate__(`console.log(${M})`,C),memo:W,batch:!0}))}function p(O){const M=U("var"),{attrs:G}=X.__getAttributes__(O);if(!G)return;Object.entries(G.literals).forEach(([S,I])=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:I,type:"let"}}),Object.entries(G.expressions).forEach(([S,I])=>{if(t.test(S)){const C=(P,x)=>{const f=X.__evaluate__(S.replace(t,""),x||W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${S}`);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,M,x)}if(P)return{memo:x}};X.__extractExpressionDeps__(S,W).forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${M}.${S}`,update:(x)=>C(!0,x),memo:W,batch:!0})),C()}else if(I){if(X.__isReactive__(I,W)){const C=X.__extractExpressionDeps__(I,W),m=(P,x)=>{if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);return P[S]=W[S]={value:X.__evaluate__(I,P),type:"let"},X.__updateVarDepNodes__(S,M,P),{memo:P}};C.forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${M}.${S}`,update:m,memo:W,batch:!0}))}if(W[S]&&W[S].type==="const")throw new Error(`Cannot override <const ${S}=[value]/> variable`);W[S]={value:X.__evaluate__(I,W),type:"let"}}}),X.metrics.inc("elementCount")}function a(O){const{attrs:M}=X.__getAttributes__(O);if(!M)return;Object.entries(M.literals).forEach(([G,S])=>{if(W[G]&&W[G].type==="const")throw new Error(`<const ${G}=[value]/> variable already defined`);if(!S)return;W[G]={value:S,type:"const"}}),Object.entries(M.expressions).forEach(([G,S])=>{if(t.test(G)){const I=X.__evaluate__(G.replace(t,""),W);if(typeof I!=="object")throw new Error(`Invalid spread operator ${G}`);for(let C in I){if(W[C]&&W[C].type==="const")throw new Error(`<const ${C}=[value]/> by spread operator ${G}. [${C}] variable already defined`);W[C]={value:I[C],type:"const"}}}else{if(W[G]&&W[G].type==="const")throw new Error(`<const ${G}=[value]/> variable already defined`);if(!S)return;W[G]={value:X.__evaluate__(S,W),type:"const"}}}),X.metrics.inc("elementCount")}function i(O,M,G){const{attrs:S}=X.__getAttributes__(O),I=U("element"),C=X.__getBoundaries__(I);let m=r.default(C.start),P={},x=G;if(x){S.literals&&Object.entries(S.literals).forEach(([V,E])=>P[V]={type:"arg",value:E}),S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{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;P[N]={type:"arg",value:A[N]}}}else{if(V!=="#"&&!x.argv.includes(V))return;P[V]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const f=x.mesh(P);if(f&&f.length)m=m.add(f);S.expressions&&Object.entries(S.expressions).forEach(([V,E])=>{if(!x)return;if(t.test(V)&&X.__isReactive__(V,W)){const A=X.__extractExpressionDeps__(V,W),N=(F,T)=>{if(!x)return;const b={},c=X.__evaluate__(V.replace(t,""),F);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const l=[];for(let o in c){if(o!=="#"&&!x.argv.includes(o))continue;P[o]=b[o]={type:"arg",value:c[o]},(!F[o]||!E1(c[o],F[o].value))&&l.push(o)}l.length&&x.update(l,b,C)};A.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:C,path:`${I}.${V}`,update:N,memo:W,batch:!0}))}else if((V==="#"||x.argv.includes(V))&&X.__isReactive__(E,W)){const A=X.__extractExpressionDeps__(E,W),N=(F,T)=>{if(!x)return;const b=P[V]={type:"arg",value:E?X.__evaluate__(E,F):!0};x.update([V],{[V]:b},C)};A.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:C,path:`${I}.${V}`,update:N,memo:W,batch:!0}))}})}if(X.__isReactive__(M,W)){const f=(E,A)=>{const N=X.__evaluate__(M,E);let F;if(k(N))F=s(O,{template:N});else if(R(N))P="#"in P?{...E,...P["#"].value}:{...E,...P},x=N,F=x?x.mesh(P):null;if(!document.contains(C.start)||!document.contains(C.end))throw new Error("Dynamic element boundaries not found");const T=[];let b=C.start.nextSibling;while(b&&b!==C.end)T.push(b),b=b.nextSibling;r.default(T).remove(),F&&r.default(C.start).after(F)};X.__extractExpressionDeps__(M,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:null,boundaries:C,path:I,update:f,batch:!0,memo:{...W,...P}}))}return m=m.add(C.end),m}function s(O,M){let G,S;if(M?.template)G=M.template,S=j("component");else{if(S=M?.name||O.prop("tagName")?.toLowerCase(),!S)throw new Error("Invalid component");if(S===X.__name__)throw new Error("Render component within itself is forbidden");G=X.lips.import(S)}if(!G||!S)throw new Error(`<${S}> template not found`);const I=U("component"),C=X.__getBoundaries__(I),{argv:m,attrs:P,events:x}=X.__getAttributes__(O),f={};let V={},E=r.default(C.start),A=X.PCC.get(I);P.literals&&Object.entries(P.literals).forEach(([F,T])=>{if(F=="key")return;V[F]=T}),P.functions&&Object.entries(P.functions).forEach(([F,T])=>{V[F]=X.__evaluateFunction__(T,[],W),G.declaration?.syntax?f[L1+U1+F]=T:f[U1+F]=T}),P.expressions&&Object.entries(P.expressions).forEach(([F,T])=>{if(F=="key")return;if(t.test(F)){const b=X.__evaluate__(F.replace(t,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${F}`);for(let c in b)V[c]=b[c]}else V[F]=T?X.__evaluate__(T,W):!0;G.declaration?.syntax?f[L1+F]=T:f[F]=T});const N=O.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:O,fragmentPath:I,fragmentBoundaries:C,meshPath:null,argv:m,scope:W,xmlns:Y,useAttributes:!0,declaration:G.declaration},f)},G.declaration){if(G.declaration.tags)Object.entries(G.declaration?.tags).forEach(([F,{type:T,many:b}])=>{switch(T){case"nexted":{let c=O.next(F);if(!c.length)return;if(b){V[F]=[];let l=0,o=!1;while(!o){if(V[F].push(X.__meshwire__({$node:c,meshPath:`${F}[${l}]`,fragmentPath:I,fragmentBoundaries:C,argv:m,scope:W,xmlns:Y,useAttributes:!0,declaration:G.declaration},f)),!c.next(F).length){o=!0;break}c=c.next(F),l++}}else V[F]=X.__meshwire__({$node:c,meshPath:F,fragmentPath:I,fragmentBoundaries:C,argv:m,scope:W,xmlns:Y,useAttributes:!0,declaration:G.declaration},f)}break;case"child":{const c=O.children(F);if(b)V[F]=[],c.each(function(l){const o=r.default(this),{argv:D1}=X.__getAttributes__(o);V[F].push(X.__meshwire__({$node:o,meshPath:`${F}[${l}]`,fragmentPath:I,fragmentBoundaries:C,argv:D1,scope:W,xmlns:Y,useAttributes:!0,declaration:G.declaration},f))});else if(O.children(F).first().length){const l=O.children(F).first(),{argv:o}=X.__getAttributes__(l);V[F]=X.__meshwire__({$node:l,meshPath:F,fragmentPath:I,fragmentBoundaries:C,argv:o,scope:W,xmlns:Y,useAttributes:!0,declaration:G.declaration},f)}}break}});else if(G.declaration.contents)V.__contents__=N}}if(A)A.setInput(J1(V)),E=E.add(A.node);else{const{declaration:F,state:T,_static:b,handler:c,context:l,default:o,stylesheet:D1}=G;A=new o1(S,o||"",{state:J1(T),input:J1(V),context:l,_static:J1(b),handler:c,stylesheet:D1,declaration:F},{debug:X.debug,lips:X.lips,prepath:I}),E=E.add(A.node),X.PCC.set(I,A),Object.entries(x).forEach(([e,n])=>!!A&&X.__attachEvent__(A,e,n,W)),f&&Object.entries(f).forEach(([e,n])=>{let q1=!1,m1=!1;if(e.startsWith(L1))q1=!0,e=e.replace(L1,"");if(e.startsWith(U1))m1=!0,e=e.replace(U1,"");if(t.test(e)){const R1=(N1)=>{const O1={},x1=X.__evaluate__(e.replace(t,""),N1);if(typeof x1!=="object")throw new Error(`Invalid spread operator ${e}`);for(let A1 in x1)O1[A1]=x1[A1];A?.subInput(O1)};if(X.__isReactive__(e,W))X.__extractExpressionDeps__(n,W).forEach((O1)=>X.__trackDep__(B,O1,{$fragment:null,boundaries:C,path:`${I}.${e}`,update:R1,syntax:q1,memo:W,batch:!0}))}else{const R1=(N1)=>{const O1=m1?X.__evaluateFunction__(n,[],N1):n?X.__evaluate__(n,N1):!0;A?.subInput({[e]:O1})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((O1)=>X.__trackDep__(B,O1,{$fragment:null,boundaries:C,path:`${I}.${e}`,update:R1,syntax:q1,memo:W,batch:!0}))}}),E=E.add(C.end)}return X.metrics.inc("componentCount"),E}function Z1(O){const M=O.prop("tagName")?.toLowerCase();if(!M)throw new Error("Invalid macro rendering call");const G=X.__macros.get(M);if(!G)throw new Error("Macro component not found");const S=U("macro"),I=X.__getBoundaries__(S),{attrs:C}=X.__getAttributes__(O),m={};let P={},x={},f=r.default(I.start);if(C.literals&&Object.entries(C.literals).forEach(([N,F])=>P[N]={value:F,type:"arg"}),C.expressions&&Object.entries(C.expressions).forEach(([N,F])=>{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 b in T)if(x[b]=T[b],G.argv.includes(b))P[b]={value:T[b],type:"arg"};m[N]=F}else{const T=F?X.__evaluate__(F,W):!0;if(x[N]=T,G.argv.includes(N))P[N]={value:T,type:"arg"};if(G.argv.includes(N))m[N]=F}G.argv.forEach((T)=>{if(P[T]!==void 0)return;P[T]={value:!1,type:"arg"}})}),G.argv.includes("__"))P.__={value:x,type:"arg"};const V={$node:G.$node,meshPath:null,fragmentPath:S,fragmentBoundaries:I,argv:G.argv,scope:W,xmlns:Y,useAttributes:!0},E=X.__meshwire__(V,m),A=E.renderer.mesh(P);return f=f.add(A),m&&Object.entries(m).forEach(([N,F])=>{let T=!1;if(new RegExp(`^${L1}`).test(N))T=!0,N=N.replace(L1,"");if(t.test(N)){if(!X.__isReactive__(N,W))return;const b=X.__extractExpressionDeps__(N,W),c=(l)=>{const o={},D1=X.__evaluate__(N.replace(t,""),l);if(typeof D1!=="object")throw new Error(`Invalid spread operator ${N}`);const e=[];for(let n in D1)o[n]={value:D1[n],type:"arg"},(!l[n]||!E1(D1[n],l[n].value))&&e.push(n);return e.length&&E.renderer.update(e,o),{memo:{...l,...o}}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:I,path:`${S}.${N}`,update:c,syntax:T,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(F,W)){const b=X.__extractExpressionDeps__(F,W),c=(l)=>{const o=l[N]={value:F?X.__evaluate__(F,l):!0,type:"arg"};return E.renderer.update([N],{[N]:o}),{memo:l}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:I,path:`${S}.${N}`,update:c,syntax:T,memo:{...W,...P},batch:!0}))}}),f=f.add(I.end),X.metrics.inc("elementCount"),f}function d(O){if(!O.length||!O.prop("tagName"))return O;const M=O.is("svg")||Y,G=M?r.default(document.createElementNS("http://www.w3.org/2000/svg",O.prop("tagName").toLowerCase())):r.default(`<${O.prop("tagName").toLowerCase()}/>`),S=O.contents(),I=U("element");S.length&&G.append(X.__withPath__(I,()=>X.render(I+".n",S,W,B,M).$log));const{attrs:C,events:m}=X.__getAttributes__(O);C.literals&&Object.entries(C.literals).forEach(([x,f])=>{if(x===$1)return;const V=O.is(`[${$1}]`)&&["title","placeholder"].includes(x);G.attr(x,V?X.lips.i18n.translate(f).text:f);const E=(A)=>{G.attr(x,V?X.lips.i18n.translate(f).text:f),V&&X.__trackTranslationDep__({path:I,$fragment:G,update:E,memo:A})};V&&X.__trackTranslationDep__({path:I,$fragment:G,update:E,memo:W})});const P=(x,f=!1)=>{x&&Object.entries(x).forEach(([V,E])=>{switch(V){case"@html":{const A=(N)=>{G.html(X.__evaluate__(E,N))};if(A(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:G,path:`${I}.${V}`,update:A,memo:W,batch:!0}))}break;case"@text":{const A=O.is(`[${$1}]`),N=(F)=>{G.text(X.__evaluate__(E,F,A)),A&&X.__trackTranslationDep__({path:I,$fragment:G,update:N,memo:F})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((T)=>X.__trackDep__(B,T,{$fragment:G,path:`${I}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({path:I,$fragment:G,update:N,memo:W})}break;case"@format":{const[A,N]=E.split(",").map((T)=>T.trim());if(!A)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const F=(T)=>{const b=X.__evaluate__(`!${N.trim()}`,T);if(typeof b!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(A,b);c!==void 0&&G.text(c),X.__trackTranslationDep__({path:I,$fragment:G,update:F,memo:T})};F(W),X.__extractExpressionDeps__(N,W).forEach((T)=>X.__trackDep__(B,T,{$fragment:G,path:`${I}.${V}`,update:F,memo:W,batch:!0}))}break;case"style":{const A=(N)=>{const F=X.__evaluate__(E,N);if(typeof F==="object"){let T="";Object.entries(F).forEach(([b,c])=>T+=`${b}:${c};`),T.length&&G.attr("style",T)}else G.attr("style",F)};if(A(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:G,path:`${I}.${V}`,update:A,memo:W,batch:!0}))}break;default:{const A=O.is(`[${$1}]`)&&["title","placeholder"].includes(V),N=(F)=>{const T=E?X.__evaluate__(E,F,A):E!==void 0?E:!0;if(T===void 0||T===!1)G.removeAttr(V);else G.attr(V,T),A&&X.__trackTranslationDep__({path:I,$fragment:G,update:N,memo:F})};if(N(W),f&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((T)=>X.__trackDep__(B,T,{$fragment:G,path:`${I}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({path:I,$fragment:G,update:N,memo:W})}}})};return C.expressions&&Object.keys(C.expressions).forEach((x)=>{if(!t.test(x))return;const f=(V)=>{const E={},A=X.__evaluate__(x.replace(t,""),V);if(typeof A!=="object")throw new Error(`Invalid spread operator ${x}`);for(let N in A)E[N]=A[N];P(E)};if(delete C.expressions[x],f(W),x&&X.__isReactive__(x,W))X.__extractExpressionDeps__(x,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:G,path:`${I}.${x}`,update:f,memo:W,batch:!0}))}),P(C.expressions,!0),m&&Object.entries(m).forEach(([x,f])=>{K.push({_event:x,$fragment:G,instruction:f,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),G}function y(O){const M=O.text(),G=U("element"),S=O.parent().is(`[${$1}]`),I=r.default(document.createTextNode(X.__interpolate__(M,W,S))),C=(m)=>{const P=X.__interpolate__(M,m,S);if(!I[0])return;I[0].textContent=P,S&&X.__trackTranslationDep__({path:G,$fragment:I,update:C,memo:m||W})};if(M&&X.__isReactive__(M,W)){const m=X.__extractTextDeps__(M,W);m.forEach((P)=>X.__trackDep__(B,P,{path:G,$fragment:I,update:C,memo:W,batch:m.length>1}))}return S&&X.__trackTranslationDep__({path:G,$fragment:I,update:C,memo:W}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),I}function h(O){if(O.get(0)?.nodeType===Node.COMMENT_NODE)return O;if(O.get(0)?.nodeType===Node.TEXT_NODE)return y(O);if(O.is("let"))return p(O);else if(O.is("const"))return a(O);else if(O.is("lips")&&O.attr(":dtag"))return _(O);else if(O.is("log"))return u(O);else if(X.__macros.has(O.prop("tagName")?.toLowerCase()))return Z1(O);else if(O.is("if, for, switch, async")||X.lips.has(O.prop("tagName")?.toLowerCase()))return s(O);else if(O.is("else-if, else"))return;return d(O)}try{this.__renderDepth++,Q=Q||r.default(this.__template__),Q.each(function(){const O=h(r.default(this));if(O)D=D.add(O)}),K.forEach(({$fragment:O,_event:M,instruction:G,scope:S})=>{this.__attachEvent__(O,M,G,S)}),X.metrics.inc("renderCount")}catch(O){console.error("Rendering Failed --",O),X.metrics.trackError(O)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:D,dependencies:B,events:K}}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:Q})=>this.__detachEvent__(J,Q)),this.VER=[];for(let J in this.PCC){const Q=this.PCC.get(J);Q?.destroy(),Q?.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,Q)=>{r.default(Q).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(J,Q){const W=this,{$node:q,meshPath:Y,fragmentPath:B,fragmentBoundaries:K,argv:X,scope:D,xmlns:U,declaration:j,useAttributes:R}=J;let k,_=[],u=!1;const p=[],a=(d,y,h)=>{const O=`${B}.${Y||"r"}${h!==void 0?`[${h}]`:""}`,{$log:M,dependencies:G,events:S}=W.render(O,d,{...D,...y},void 0,U);if(p.push(O),G?.forEach((I,C)=>{if(!W.FGUD?.has(C))W.FGUD.set(C,new Map);I.forEach((m,P)=>{m.partial?.length?m.partial.push(O):m.partial=[O],W.FGUD.get(C)?.set(P,m)})}),W.metrics.inc("partialCount"),h!==void 0){const I=W.__getBoundaries__(O);_[h]={argvalues:y,boundaries:I};let C=r.default(I.start);return C=C.add(M),C=C.add(I.end),C}return M},i=(d,y,h)=>{if(W.metrics.startRender(),d.forEach((O)=>{const M=W.FGUD.get(O);if(!M)return;M.forEach((G)=>{const S=p.find((I)=>G.partial?.find((C)=>I==C));if(!G.partial||!S)return;if(h!==void 0&&!S.endsWith(`r[${h}]`))return;if(K?.start&&!document.contains(K.start)){console.warn(`${Y} -- partial boundaries missing in the DOM`),M.delete(G.path);return}if(G.memo?.[O]&&y?.[O]&&E1(G.memo[O],y[O]))return;if(G.memo={...D,...G.memo,...y},G.batch)W.UQS.queue({dep:O,dependent:G});else{const I=G.update(G.memo,"mesh-partial-updator");if(I)typeof I.memo==="object"&&M.set(G.path,{...G,memo:I.memo}),typeof I.cleanup==="function"&&I.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!M.size&&W.FGUD.delete(O)}),h!==void 0&&_[h])_[h].argvalues=y;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},s=(d)=>{if(!_[d])return;const y=_[d].boundaries;if(_.splice(d,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const h=[];let O=y.start.nextSibling;while(O&&O!==y.end)h.push(O),O=O.nextSibling;r.default(h).remove(),y.start.remove(),y.end.remove()},Z1={renderer:{path:Y,argv:X,mesh(d,y=!1){if(k=q.contents(),!k?.length)return null;if(j?.iterator){const h=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!h.length)return null;let O=r.default();return h.forEach((M,G)=>{if(!k?.length)return null;O=O.add(a(k,M,G))}),O}else return a(k,d)},update(d,y,h){if(!p.length||u)return;u=!0;try{if(h=h||K,j?.iterator){const O=y?.["#"].value;if(!Array.isArray(O))return;if(Array.isArray(_)){if(_.length===O.length){for(let G=0;G<O.length;G++)!E1(_[G].argvalues,O[G])&&i(Object.keys(O[G]),O[G],G);return}const M=Math.min(_.length,O.length);for(let G=0;G<M;G++)i(Object.keys(O[G]),O[G],G);if(O.length>_.length){if(!k?.length)return;for(let G=_.length;G<O.length;G++){const S=a(k,O[G],G);r.default(h.end).before(S)}}else if(O.length<_.length)for(let G=_.length-1;G>=O.length;G--)s(G)}}else i(d,y)}finally{setTimeout(()=>u=!1,0)}}}};if(R&&Y){const{attrs:d}=W.__getAttributes__(q);d.literals&&Object.entries(d.literals).forEach(([y,h])=>Z1[y]=h),d.expressions&&Object.entries(d.expressions).forEach(([y,h])=>{if(t.test(y)){const O=W.__evaluate__(y.replace(t,""),D);if(typeof O!=="object")throw new Error(`Invalid spread operator ${y}`);for(let M in O)Z1[M]=O[M];Q[`${j?.syntax?L1:""}${Y}.${y}`]=h}else Z1[y]=h?W.__evaluate__(h,D):!0,Q[`${j?.syntax?L1:""}${Y}.${y}`]=h})}return Z1}__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 Q=J.attrs(),W={},q={literals:{},functions:{},expressions:{}};let Y=[];return Q&&Object.entries(Q).forEach(([B,K])=>{if(B==":dtag")return;if(B.startsWith(":")||B.startsWith(U1)||B.startsWith(b1)||t.test(B)||W0.test(B))if(W0.test(B)){const[X,D]=B.match(W0)||[];Y=D.split(",")}else if(B.startsWith(b1))W[B.replace(b1,"")]=K;else if(B.startsWith(U1))q.functions[B.replace(U1,"")]=K;else{if(B.startsWith(":"))B=B.slice(1,B.length);q.expressions[B]=K||""}else q.literals[B]=K}),{argv:Y,events:W,attrs:q}}__withPath__(J,Q){const W=this.__path;this.__path=J;const q=Q();return this.__path=W,q}__getPathParent__(J){const Q=J.split("/");return Q.pop(),Q.join("/")}__hasSamePathParent__(J,Q){return J.startsWith(Q)}__evaluate__(J,Q,W){try{J=J.trim();const q=(Y)=>{const B=this.state.toJSON();if(Q){const K={};for(let U in Q)K[U]=Q[U].value;const X=`with( scope ){ return ${Y}; }`;return new Function("self","input","state","static","context","scope",X)(this,this.input,B,this.static,this.context,K||{})}else{const K=`return ${Y}`;return new Function("self","input","state","static","context",K)(this,this.input,B,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return q(J.slice(1));return J.replace(_0,(Y,B)=>q(B))}return q(J)}catch(q){return J}}__evaluateFunction__(J,Q,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Q);else{let[q,...Y]=J.split(/\s*,\s*/),B;if(q=this.__evaluate__(q,W),typeof q==="function")B=q;else{if(typeof this[q]!=="function")throw new Error(`Undefined <${q}> handler method`);B=this[q].bind(this)}if(typeof B!=="function")throw new Error(`Expected <${q}> to be a function or handler method`);let K=Y.map((X)=>this.__evaluate__(X,W));if(Q.length)K=[...K,...Q];return B(...K)}}__interpolate__(J,Q,W){if(J=J.replace(_0,(q,Y)=>this.__evaluate__(Y,Q)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,Q,W,q){J.on(Q,(...Y)=>this.__evaluateFunction__(W,Y,q)),this.VER.push({element:J,_event:Q}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,Q){J.off(Q),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Q){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((Y)=>{const B=Y.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(B,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,q=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let Y=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(q))];if(Q&&Object.keys(Q).length){const B=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");Y=[...Y,...Array.from(J.matchAll(B))]}return[...new Set(Y.map((B)=>B[0]))]}__isReactive__(J,Q){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(Q&&Object.keys(Q).length&&new RegExp(Object.keys(Q).join("|")).test(J))return!0;return!1}__trackDep__(J,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!J.has(Q)&&J.set(Q,new Map),J.get(Q)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Q){return Q.reduce((W,q)=>W?.[q],J)}__shouldUpdate__(J,Q,W,q){if(J==="self")return!0;const Y=this.__valueDep__(q[J],Q),B=this.__valueDep__(W[J],Q);return!E1(Y,B)}__updateDepNodes__(J,Q){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,q)=>{const[Y,...B]=q.split(".");if(!this.__shouldUpdate__(Y,B,J,Q))return;W.forEach((K)=>{const{path:X,batch:D,$fragment:U,boundaries:j,update:R,memo:k,syntax:_}=K;try{if(!_&&(j?.start&&!document.contains(j.start))||U!==null&&!U.closest("body").length){W.delete(X);return}if(D)this.UQS.queue({dep:q,dependent:K});else{const u=R(k,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...K,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(q)}),this.metrics.endRender()}__updateVarDepNodes__(J,Q,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((Y,B)=>{if(!Y.haslet||!this.__hasSamePathParent__(B,this.__getPathParent__(Q)))return;if(Y.memo={...Y.memo,...W},Y.batch)this.UQS.queue({dep:J,dependent:Y});else{const K=Y.update(Y.memo,"var-partial-updator");typeof K?.cleanup==="function"&&K.cleanup()}}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Q)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Q);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 h0={};d1(h0,{state:()=>{{return I8}},handler:()=>{{return V8}},default:()=>{{return C8}},declaration:()=>{{return L8}}});var L8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},I8={renderer:null},V8={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((Q)=>{if(J||!Q.by)return;this.state.renderer=Q.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},C8="<{state.renderer}/>";var f0={};d1(f0,{state:()=>{{return S8}},handler:()=>{{return E8}},default:()=>{{return $8}},declaration:()=>{{return N8}},_static:()=>{{return P8}}});var N8={name:"for",syntax:!0,iterator:!0},S8={argvlist:null},P8={lastIn:null,processingBatch:!1},E8={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:Q,to:W}=this.input;if(J===void 0&&Q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Q!==void 0){if(Q=parseFloat(String(Q)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Q===W)throw new Error("<from> and <to> attribute cannot have the same value");const q=Q<W,Y=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Y){const[K]=this.input.renderer.argv;if(K){let X=Q,D=!0;for(let U=0;U<this.state.argvlist.length;U++){if(this.state.argvlist[U][K].value!==X){D=!1;break}X=q?X+1:X-1}if(D)return;X=Q;for(let U=0;U<this.state.argvlist.length;U++)this.state.argvlist[U][K].value=X,X=q?X+1:X-1;return}}const B=[];for(let K=Q;q?K<=W:K>=W;q?K++:K--){const X={},[D]=this.input.renderer.argv;if(D)X[D]={value:K,type:"arg"};B.push(X)}this.state.argvlist=B}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[B,K]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const D=this.state.argvlist[X];if(B)D[B].value=J[X]}return}const q=[];let Y=0;for(let B of J){const K={},[X,D]=this.input.renderer.argv;if(X)K[X]={value:B,type:"arg"};if(D)K[D]={value:Y,type:"arg"};q.push(K),Y++}this.state.argvlist=q}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[B,K,X]=this.input.renderer.argv;let D=0;for(let[U,j]of J){const R=this.state.argvlist[D];if(B)R[B].value=U;if(K)R[K].value=j;D++}return}const q=[];let Y=0;for(let[B,K]of J){const X={},[D,U,j]=this.input.renderer.argv;if(D)X[D]={value:B,type:"arg"};if(U)X[U]={value:K,type:"arg"};if(j)X[j]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}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 q=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[K,X,D]=this.input.renderer.argv;for(let U=0;U<q.length;U++){const j=q[U],R=this.state.argvlist[U];if(K)R[K].value=j;if(X)R[X].value=J[j]}return}const Y=[];let B=0;for(let K in J){const X={},[D,U,j]=this.input.renderer.argv;if(D)X[D]={value:K,type:"arg"};if(U)X[U]={value:J[K],type:"arg"};if(j)X[j]={value:B,type:"arg"};Y.push(X),B++}this.state.argvlist=Y}}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[Q]=this.input.renderer?.argv;if(!Q)return;for(let{index:W,value:q}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=q}finally{this.static.processingBatch=!1}},updateProperty(J,Q){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 q=this.state.argvlist[W];if(q[J])q[J].value=typeof Q==="function"?Q(q[J].value,W):Q}}finally{this.static.processingBatch=!1}}},$8="<{input.renderer} #=state.argvlist/>";var y0={};d1(y0,{state:()=>{{return A8}},handler:()=>{{return T8}},default:()=>{{return b8}},declaration:()=>{{return R8}}});var R8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},A8={renderer:null,props:{}},T8={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[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}})}},b8="<{state.renderer} #=state.props/>";var v0={};d1(v0,{state:()=>{{return x8}},handler:()=>{{return k8}},default:()=>{{return g8}},declaration:()=>{{return _8}}});var _8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},x8={renderer:null},k8={onInput(){let J=[];for(let Q of this.input.case)if(Q.is==this.input.by||Array.isArray(Q.is)&&Q.is.includes(this.input.by))Array.isArray(Q.is)?J=[...new Set([...J,...Q.is])]:J.push(Q.is),this.state.renderer=Q.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},g8="<{state.renderer}/>";var u0={};d1(u0,{state:()=>{{return h8}},handler:()=>{{return u8}},default:()=>{{return m8}},context:()=>{{return y8}},_static:()=>{{return f8}}});var v8=function(J){const Q={};return J.split("&").map((q)=>{const[Y,B]=q.split("=");Q[Y]=B}),Q},h8={page:null,params:{},query:{}},f8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},y8=["navigate"],u8={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:Q,default:W})=>{if(W)this.static.defaultPath=J;const q=J.match(/:[^\/]*(\/|$)/gi)||[],Y=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Q,default:W,pathVars:q,pathRegex:new RegExp(`${Y}\$`,"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,Q){!Q&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const q=W[1]?v8(W[1]):{};let Y=null;if(this.static.currentRoute)Y={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:Y,toState:{path:J,query:q}});const B=this.match(J);if(!B){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:K,params:X}=B;this.emit("after",{fromState:Y,toState:{path:K.path,params:X,query:q}}),this.static.currentPath=J,this.static.currentRoute=K,this.state.params=X,this.state.query=q,this.state.page=K.template},match(J){const Q={};let W=!1;for(let q of this.static.routes){const{pathVars:Y,pathRegex:B}=q,K=J.match(B);if(K!==null&&K.index===0){for(let X=0;X+1<K.length&&X<Y.length;X++)Q[Y[X].replaceAll(/[\/:]/g,"")]=K[X+1];W=q;break}}return W?{route:W,params:Q}:!1}},m8="<{state.page} params=state.params query=state.query/>";class j0{debug=!1;stylesheets=[];config={};store={};__root;i18n=new r1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new e1,this.IUC=new a1;const[Q,W]=_1(this.i18n.lang),[q,Y]=_1(J?.context||{});this.__setLang=W,this.__getLang=Q,this.__setContext=Y,this.__getContext=q,this.register("if",h0),this.register("for",f0),this.register("async",y0),this.register("switch",v0),this.register("router",u0)}register(J,Q){return this.store[J]=Q,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,Q,W){const{default:q,...Y}=Q,B={debug:this.debug,prepath:"0",lips:this},K=new o1(J,q||"",{...Y,input:W},B);return window.addEventListener("beforeunload",()=>{return this.dispose(),K.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),K}root(J,Q){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Q),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new u1("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Q){const W=this.__getContext();if(typeof J==="string"){const q={...W,[J]:Q};H1(W,q)&&this.__setContext(q)}else if(!Array.isArray(J)){const q={...W,...J};H1(W,q)&&this.__setContext(q)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Q){if(!J.length)return;p1(()=>{const W=this.__getContext();if(!W)return;const q=Object.fromEntries(J.map((Y)=>[Y,W[Y]]));q&&typeof Q==="function"&&Object.keys(q).length&&Q(q)})}useTranslator(J,Q){p1(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Q==="function"&&Q(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var b5={Undo:"Undo",Redo:"Redo",Reinitialize:"Reinitialize",Settings:"Settings",Link:"Link","Device Screens":{"*":"Device Screens",UK:"Media Devices"},Bold:"Bold",Button:"Button",Count:"Count",Reply:"Reply","I guess all is well.":"I guess all is well.",welcome_user:{type:"variable",value:"Welcome, {name}!"},translate_button:{type:"condition",value:{"translate === true":"No Translate Keywords","translate === false":"Translate Keywords"}},keywords_count:{type:"plural",value:{"*":"{count} keywords","1":"{count} keyword","0":"No keywords"}}};var _5={Undo:"Annuler",Redo:"Refaire",Reinitialize:"R\xE9initialiser",Settings:"Param\xEAtre",Link:"Lien","Device Screens":"Dispositifs",Bold:"Gras",Button:"Bouton",Count:"Compter",Reply:"Repondre","I guess all is well.":"Tout va bien, je crois!",welcome_user:{type:"variable",value:"Bienvenue, {name}!"},translate_button:{type:"condition",value:{"translate === true":"Pas Traduire","translate === false":"Traduire"}},keywords_count:{type:"plural",value:{"*":"{count} mots cl\xE9s","1":"{count} mot cl\xE9","0":"Pas de mots cl\xE9s"}}};var c8=function(){m0.i18n.setDictionary("en",b5),m0.i18n.setDictionary("fr",_5);const J=["Undo","Redo","Reinitialize","Settings","Link","Device Screens"],Q={name:"Dilan",translate:!1,reply:!1,keywords:J},W={onTranslateChange(){this.state.translate=!this.state.translate},onReply(){this.state.reply=!this.state.reply},onChangeLanguage(Y){console.log("set-language --",Y),this.lips.setLanguage(Y)},onHandleKeywords(){this.state.keywords=!this.state.keywords.length?J:[]}},q=`
|
|
2
|
+
<p @format="welcome_user, { name: state.name }"></p>
|
|
14
3
|
|
|
15
|
-
|
|
4
|
+
<if( state.reply )>
|
|
5
|
+
<p i18n>I guess all is well.</p>
|
|
6
|
+
</if>
|
|
16
7
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
<b @format="keywords_count, { count: state.keywords.length }"></b>
|
|
9
|
+
<ul>
|
|
10
|
+
<for [keyword] in=state.keywords>
|
|
11
|
+
<if( state.translate )><li i18n>{keyword}</li></if>
|
|
12
|
+
<else><li>{keyword}</li></else>
|
|
13
|
+
</for>
|
|
14
|
+
</ul>
|
|
24
15
|
|
|
25
|
-
|
|
26
|
-
</
|
|
27
|
-
|
|
16
|
+
<br>
|
|
17
|
+
<button on-click(onReply) i18n>Reply</button>
|
|
18
|
+
<button on-click(onTranslateChange) @format="translate_button, { translate: state.translate }"></button>
|
|
19
|
+
<button on-click(onHandleKeywords) i18n>{state.keywords.length ? 'Clear' : 'Reset'} keywords</button>
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
<br><br>
|
|
22
|
+
<button on-click(onChangeLanguage, 'en-US')>English (US)</button>
|
|
23
|
+
<button on-click(onChangeLanguage, 'en-UK')>English (UK)</button>
|
|
24
|
+
<button on-click(onChangeLanguage, 'fr-FR')>French</button>
|
|
25
|
+
`;m0.render("DemoI18n",{default:q,state:Q,handler:W}).appendTo("body")};var m0=new j0({debug:!0});c8();
|
|
26
|
+
|
|
27
|
+
//# debugId=7A13BD4CB7FC934164756e2164756e21
|