@lipsjs/lips 0.0.14 → 0.1.0

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