@lipsjs/lips 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,68 @@
1
- var Q7=Object.create;var{defineProperty:P1,getPrototypeOf:X7,getOwnPropertyNames:H7}=Object;var q7=Object.prototype.hasOwnProperty;var E1=(J,W,Q)=>{Q=J!=null?Q7(X7(J)):{};const q=W||!J||!J.__esModule?P1(Q,"default",{value:J,enumerable:!0}):Q;for(let z of H7(J))if(!q7.call(q,z))P1(q,z,{get:()=>J[z],enumerable:!0});return q};var z7=(J,W)=>()=>(W||J((W={exports:{}}).exports,W),W.exports);var f0=(J,W)=>{for(var Q in W)P1(J,Q,{get:W[Q],enumerable:!0,configurable:!0,set:(q)=>W[Q]=()=>q})};var t0=z7((Z5,W5)=>{(function(){var J=document,W=window,Q=J.documentElement,q=J.createElement.bind(J),z=q("div"),Y=q("table"),G=q("tbody"),X=q("tr"),U=Array.isArray,D=Array.prototype,F=D.concat,A=D.filter,k=D.indexOf,g=D.map,m=D.push,o=D.slice,a=D.some,r=D.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,i=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,y=/<.+>/,v=/^\w+$/;function b(Z,H){var B=l(H);return!Z||!B&&!S(H)&&!$(H)?[]:!B&&i.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!B&&v.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var O=function(){function Z(H,B){if(!H)return;if(C(H))return H;var w=H;if(P(H)){var L=B||J;if(w=s.test(H)&&S(L)?L.getElementById(H.slice(1).replace(/\\/g,"")):y.test(H)?m1(H):C(L)?L.find(H):P(L)?M(L).find(H):b(H,L),!w)return}else if(V(H))return this.ready(H);if(w.nodeType||w===W)w=[w];this.length=w.length;for(var E=0,f=this.length;E<f;E++)this[E]=w[E]}return Z.prototype.init=function(H,B){return new Z(H,B)},Z}(),K=O.prototype,M=K.init;if(M.fn=M.prototype=K,K.length=0,K.splice=r,typeof Symbol==="function")K[Symbol.iterator]=D[Symbol.iterator];function C(Z){return Z instanceof O}function I(Z){return!!Z&&Z===Z.window}function S(Z){return!!Z&&Z.nodeType===9}function l(Z){return!!Z&&Z.nodeType===11}function $(Z){return!!Z&&Z.nodeType===1}function x(Z){return!!Z&&Z.nodeType===3}function h(Z){return typeof Z==="boolean"}function V(Z){return typeof Z==="function"}function P(Z){return typeof Z==="string"}function T(Z){return Z===void 0}function N(Z){return Z===null}function j(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function R(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}M.isWindow=I,M.isFunction=V,M.isArray=U,M.isNumeric=j,M.isPlainObject=R;function _(Z,H,B){if(B){var w=Z.length;while(w--)if(H.call(Z[w],w,Z[w])===!1)return Z}else if(R(Z)){var L=Object.keys(Z);for(var w=0,E=L.length;w<E;w++){var f=L[w];if(H.call(Z[f],f,Z[f])===!1)return Z}}else for(var w=0,E=Z.length;w<E;w++)if(H.call(Z[w],w,Z[w])===!1)return Z;return Z}M.each=_,K.each=function(Z){return _(this,Z)},K.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var B=h(Z[0])?Z.shift():!1,w=Z.shift(),L=Z.length;if(!w)return{};if(!L)return c(B,M,w);for(var E=0;E<L;E++){var f=Z[E];for(var d in f)if(B&&(U(f[d])||R(f[d]))){if(!w[d]||w[d].constructor!==f[d].constructor)w[d]=new f[d].constructor;c(B,w[d],f[d])}else w[d]=f[d]}return w}M.extend=c,K.extend=function(Z){return c(K,Z)};var p=/\S+/g;function u(Z){return P(Z)?Z.match(p)||[]:[]}K.toggleClass=function(Z,H){var B=u(Z),w=!T(H);return this.each(function(L,E){if(!$(E))return;_(B,function(f,d){if(w)H?E.classList.add(d):E.classList.remove(d);else E.classList.toggle(d)})})},K.addClass=function(Z){return this.toggleClass(Z,!0)},K.removeAttr=function(Z){var H=u(Z);return this.each(function(B,w){if(!$(w))return;_(H,function(L,E){w.removeAttribute(E)})})};function Z0(Z,H){if(!Z)return;if(P(Z)){if(arguments.length<2){if(!this[0]||!$(this[0]))return;var B=this[0].getAttribute(Z);return N(B)?void 0:B}if(T(H))return this;if(N(H))return this.removeAttr(Z);return this.each(function(L,E){if(!$(E))return;E.setAttribute(Z,H)})}for(var w in Z)this.attr(w,Z[w]);return this}K.attr=Z0,K.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},K.hasClass=function(Z){return!!Z&&a.call(this,function(H){return $(H)&&H.classList.contains(Z)})},K.get=function(Z){if(T(Z))return o.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},K.eq=function(Z){return M(this.get(Z))},K.first=function(){return this.eq(0)},K.last=function(){return this.eq(-1)};function D0(Z){if(T(Z))return this.get().map(function(H){return $(H)||x(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!$(B))return;B.textContent=Z})}K.text=D0;function e(Z,H,B){if(!$(Z))return;var w=W.getComputedStyle(Z,null);return B?w.getPropertyValue(H)||void 0:w[H]||Z.style[H]}function w0(Z,H){return parseInt(e(Z,H),10)||0}function h1(Z,H){return w0(Z,"border".concat(H?"Left":"Top","Width"))+w0(Z,"padding".concat(H?"Left":"Top"))+w0(Z,"padding".concat(H?"Right":"Bottom"))+w0(Z,"border".concat(H?"Right":"Bottom","Width"))}var O1={};function A5(Z){if(O1[Z])return O1[Z];var H=q(Z);J.body.insertBefore(H,null);var B=e(H,"display");return J.body.removeChild(H),O1[Z]=B!=="none"?B:"block"}function y1(Z){return e(Z,"display")==="none"}function v1(Z,H){var B=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!B&&!!H&&B.call(Z,H)}function m0(Z){return P(Z)?function(H,B){return v1(B,Z)}:V(Z)?Z:C(Z)?function(H,B){return Z.is(B)}:!Z?function(){return!1}:function(H,B){return B===Z}}K.filter=function(Z){var H=m0(Z);return M(A.call(this,function(B,w){return H.call(B,w,B)}))};function C0(Z,H){return!H?Z:Z.filter(H)}K.detach=function(Z){return C0(this,Z).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var T5=/^\s*<(\w+)[^>]*>/,b5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,u1={"*":z,tr:G,td:X,th:X,thead:Y,tbody:Y,tfoot:Y};function m1(Z){if(!P(Z))return[];if(b5.test(Z))return[q(RegExp.$1)];var H=T5.test(Z)&&RegExp.$1,B=u1[H]||u1["*"];return B.innerHTML=Z,M(B.childNodes).detach().get()}M.parseHTML=m1,K.has=function(Z){var H=P(Z)?function(B,w){return b(Z,w).length}:function(B,w){return w.contains(Z)};return this.filter(H)},K.not=function(Z){var H=m0(Z);return this.filter(function(B,w){return(!P(Z)||$(w))&&!H.call(w,B,w)})};function j0(Z,H,B,w){var L=[],E=V(H),f=w&&m0(w);for(var d=0,K0=Z.length;d<K0;d++)if(E){var Q0=H(Z[d]);if(Q0.length)m.apply(L,Q0)}else{var z0=Z[d][H];while(z0!=null){if(w&&f(-1,z0))break;L.push(z0),z0=B?z0[H]:null}}return L}function d1(Z){if(Z.multiple&&Z.options)return j0(A.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function _5(Z){if(!arguments.length)return this[0]&&d1(this[0]);return this.each(function(H,B){var w=B.multiple&&B.options;if(w||e1.test(B.type)){var L=U(Z)?g.call(Z,String):N(Z)?[]:[String(Z)];if(w)_(B.options,function(E,f){f.selected=L.indexOf(f.value)>=0},!0);else B.checked=L.indexOf(B.value)>=0}else B.value=T(Z)||N(Z)?"":Z})}K.val=_5,K.is=function(Z){var H=m0(Z);return a.call(this,function(B,w){return H.call(B,w,B)})},M.guid=1;function U0(Z){return Z.length>1?A.call(Z,function(H,B,w){return k.call(w,H)===B}):Z}M.unique=U0,K.add=function(Z,H){return M(U0(this.get().concat(M(Z,H).get())))},K.children=function(Z){return C0(M(U0(j0(this,function(H){return H.children}))),Z)},K.parent=function(Z){return C0(M(U0(j0(this,"parentNode"))),Z)},K.index=function(Z){var H=Z?M(Z)[0]:this[0],B=Z?this:M(H).parent().children();return k.call(B,H)},K.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Z)},K.siblings=function(Z){return C0(M(U0(j0(this,function(H){return M(H).parent().children().not(H)}))),Z)},K.find=function(Z){return M(U0(j0(this,function(H){return b(Z,H)})))};var x5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,g5=/^$|^module$|\/(java|ecma)script/i,k5=["type","src","nonce","noModule"];function f5(Z,H){var B=M(Z);B.filter("script").add(B.find("script")).each(function(w,L){if(g5.test(L.type)&&Q.contains(L)){var E=q("script");E.text=L.textContent.replace(x5,""),_(k5,function(f,d){if(L[d])E[d]=L[d]}),H.head.insertBefore(E,null),H.head.removeChild(E)}})}function h5(Z,H,B,w,L){if(w)Z.insertBefore(H,B?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,B?Z:Z.nextSibling);if(L)f5(H,Z.ownerDocument)}function N0(Z,H,B,w,L,E,f,d){return _(Z,function(K0,Q0){_(M(Q0),function(z0,E0){_(M(H),function(M0,i0){var V1=B?E0:i0,C1=B?i0:E0,Y0=B?z0:M0;h5(V1,!Y0?C1:C1.cloneNode(!0),w,L,!Y0)},d)},f)},E),H}K.after=function(){return N0(arguments,this,!1,!1,!1,!0,!0)},K.append=function(){return N0(arguments,this,!1,!1,!0)};function y5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(T(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(B,w){if(!$(w))return;if(H)M(w).empty().append(Z);else w.innerHTML=Z})}K.html=y5,K.appendTo=function(Z){return N0(arguments,this,!0,!1,!0)},K.wrapInner=function(Z){return this.each(function(H,B){var w=M(B),L=w.contents();L.length?L.wrapAll(Z):w.append(Z)})},K.before=function(){return N0(arguments,this,!1,!0)},K.wrapAll=function(Z){var H=M(Z),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},K.wrap=function(Z){return this.each(function(H,B){var w=M(Z)[0];M(B).wrapAll(!H?w:w.cloneNode(!0))})},K.insertAfter=function(Z){return N0(arguments,this,!0,!1,!1,!1,!1,!0)},K.insertBefore=function(Z){return N0(arguments,this,!0,!0)},K.prepend=function(){return N0(arguments,this,!1,!0,!0,!0,!0)},K.prependTo=function(Z){return N0(arguments,this,!0,!0,!0,!1,!1,!0)},K.contents=function(){return M(U0(j0(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},K.next=function(Z,H,B){return C0(M(U0(j0(this,"nextElementSibling",H,B))),Z)},K.nextAll=function(Z){return this.next(Z,!0)},K.nextUntil=function(Z,H){return this.next(H,!0,Z)},K.parents=function(Z,H){return C0(M(U0(j0(this,"parentElement",!0,H))),Z)},K.parentsUntil=function(Z,H){return this.parents(H,Z)},K.prev=function(Z,H,B){return C0(M(U0(j0(this,"previousElementSibling",H,B))),Z)},K.prevAll=function(Z){return this.prev(Z,!0)},K.prevUntil=function(Z,H){return this.prev(H,!0,Z)},K.map=function(Z){return M(F.apply([],g.call(this,function(H,B){return Z.call(H,B,H)})))},K.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},K.offsetParent=function(){return this.map(function(Z,H){var B=H.offsetParent;while(B&&e(B,"position")==="static")B=B.offsetParent;return B||Q})},K.slice=function(Z,H){return M(o.call(this,Z,H))};var v5=/-([a-z])/g;function w1(Z){return Z.replace(v5,function(H,B){return B.toUpperCase()})}K.ready=function(Z){var H=function(){return setTimeout(Z,0,M)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},K.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var B=M(H);B.replaceWith(B.children())}),this},K.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+W.pageYOffset,left:H.left+W.pageXOffset}},K.position=function(){var Z=this[0];if(!Z)return;var H=e(Z,"position")==="fixed",B=H?Z.getBoundingClientRect():this.offset();if(!H){var w=Z.ownerDocument,L=Z.offsetParent||w.documentElement;while((L===w.body||L===w.documentElement)&&e(L,"position")==="static")L=L.parentNode;if(L!==Z&&$(L)){var E=M(L).offset();B.top-=E.top+w0(L,"borderTopWidth"),B.left-=E.left+w0(L,"borderLeftWidth")}}return{top:B.top-w0(Z,"marginTop"),left:B.left-w0(Z,"marginLeft")}};var i1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};K.prop=function(Z,H){if(!Z)return;if(P(Z)){if(Z=i1[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(w,L){L[Z]=H})}for(var B in Z)this.prop(B,Z[B]);return this},K.removeProp=function(Z){return this.each(function(H,B){delete B[i1[Z]||Z]})};var u5=/^--/;function U1(Z){return u5.test(Z)}var D1={},m5=z.style,d5=["webkit","moz","ms"];function i5(Z,H){if(H===void 0)H=U1(Z);if(H)return Z;if(!D1[Z]){var B=w1(Z),w="".concat(B[0].toUpperCase()).concat(B.slice(1)),L="".concat(B," ").concat(d5.join("".concat(w," "))).concat(w).split(" ");_(L,function(E,f){if(f in m5)return D1[Z]=f,!1})}return D1[Z]}var c5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function c1(Z,H,B){if(B===void 0)B=U1(Z);return!B&&!c5[Z]&&j(H)?"".concat(H,"px"):H}function p5(Z,H){if(P(Z)){var B=U1(Z);if(Z=i5(Z,B),arguments.length<2)return this[0]&&e(this[0],Z,B);if(!Z)return this;return H=c1(Z,H,B),this.each(function(L,E){if(!$(E))return;if(B)E.style.setProperty(Z,H);else E.style[Z]=H})}for(var w in Z)this.css(w,Z[w]);return this}K.css=p5;function p1(Z,H){try{return Z(H)}catch(B){return H}}var o5=/^\s+|\s+$/;function o1(Z,H){var B=Z.dataset[H]||Z.dataset[w1(H)];if(o5.test(B))return B;return p1(JSON.parse,B)}function s5(Z,H,B){B=p1(JSON.stringify,B),Z.dataset[w1(H)]=B}function l5(Z,H){if(!Z){if(!this[0])return;var B={};for(var w in this[0].dataset)B[w]=o1(this[0],w);return B}if(P(Z)){if(arguments.length<2)return this[0]&&o1(this[0],Z);if(T(H))return this;return this.each(function(L,E){s5(E,Z,H)})}for(var w in Z)this.data(w,Z[w]);return this}K.data=l5;function s1(Z,H){var B=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],B["scroll".concat(H)],Z.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}_([!0,!1],function(Z,H){_(["Width","Height"],function(B,w){var L="".concat(H?"outer":"inner").concat(w);K[L]=function(E){if(!this[0])return;if(I(this[0]))return H?this[0]["inner".concat(w)]:this[0].document.documentElement["client".concat(w)];if(S(this[0]))return s1(this[0],w);return this[0]["".concat(H?"offset":"client").concat(w)]+(E&&H?w0(this[0],"margin".concat(B?"Top":"Left"))+w0(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),_(["Width","Height"],function(Z,H){var B=H.toLowerCase();K[B]=function(w){if(!this[0])return T(w)?void 0:this;if(!arguments.length){if(I(this[0]))return this[0].document.documentElement["client".concat(H)];if(S(this[0]))return s1(this[0],H);return this[0].getBoundingClientRect()[B]-h1(this[0],!Z)}var L=parseInt(w,10);return this.each(function(E,f){if(!$(f))return;var d=e(f,"boxSizing");f.style[B]=c1(B,L+(d==="border-box"?h1(f,!Z):0))})}});var l1="___cd";K.toggle=function(Z){return this.each(function(H,B){if(!$(B))return;var w=y1(B),L=T(Z)?w:Z;if(L){if(B.style.display=B[l1]||"",y1(B))B.style.display=A5(B.tagName)}else if(!w)B[l1]=e(B,"display"),B.style.display="none"})},K.hide=function(){return this.toggle(!1)},K.show=function(){return this.toggle(!0)};var r1="___ce",j1=".",F1={focus:"focusin",blur:"focusout"},n1={mouseenter:"mouseover",mouseleave:"mouseout"},r5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function I1(Z){return n1[Z]||F1[Z]||Z}function L1(Z){var H=Z.split(j1);return[H[0],H.slice(1).sort()]}K.trigger=function(Z,H){if(P(Z)){var B=L1(Z),w=B[0],L=B[1],E=I1(w);if(!E)return this;var f=r5.test(E)?"MouseEvents":"HTMLEvents";Z=J.createEvent(f),Z.initEvent(E,!0,!0),Z.namespace=L.join(j1),Z.___ot=w}Z.___td=H;var d=Z.___ot in F1;return this.each(function(K0,Q0){if(d&&V(Q0[Z.___ot]))Q0["___i".concat(Z.type)]=!0,Q0[Z.___ot](),Q0["___i".concat(Z.type)]=!1;Q0.dispatchEvent(Z)})};function t1(Z){return Z[r1]=Z[r1]||{}}function n5(Z,H,B,w,L){var E=t1(Z);E[H]=E[H]||[],E[H].push([B,w,L]),Z.addEventListener(H,L)}function a1(Z,H){return!H||!a.call(H,function(B){return Z.indexOf(B)<0})}function d0(Z,H,B,w,L){var E=t1(Z);if(!H)for(H in E)d0(Z,H,B,w,L);else if(E[H])E[H]=E[H].filter(function(f){var d=f[0],K0=f[1],Q0=f[2];if(L&&Q0.guid!==L.guid||!a1(d,B)||w&&w!==K0)return!0;Z.removeEventListener(H,Q0)})}K.off=function(Z,H,B){var w=this;if(T(Z))this.each(function(E,f){if(!$(f)&&!S(f)&&!I(f))return;d0(f)});else if(!P(Z))for(var L in Z)this.off(L,Z[L]);else{if(V(H))B=H,H="";_(u(Z),function(E,f){var d=L1(f),K0=d[0],Q0=d[1],z0=I1(K0);w.each(function(E0,M0){if(!$(M0)&&!S(M0)&&!I(M0))return;d0(M0,z0,Q0,H,B)})})}return this},K.remove=function(Z){return C0(this,Z).detach().off(),this},K.replaceWith=function(Z){return this.before(Z).remove()},K.replaceAll=function(Z){return M(Z).replaceWith(this),this};function t5(Z,H,B,w,L){var E=this;if(!P(Z)){for(var f in Z)this.on(f,H,B,Z[f],L);return this}if(!P(H))if(T(H)||N(H))H="";else if(T(B))B=H,H="";else w=B,B=H,H="";if(!V(w))w=B,B=void 0;if(!w)return this;return _(u(Z),function(d,K0){var Q0=L1(K0),z0=Q0[0],E0=Q0[1],M0=I1(z0),i0=z0 in n1,V1=z0 in F1;if(!M0)return;E.each(function(C1,Y0){if(!$(Y0)&&!S(Y0)&&!I(Y0))return;var N1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!a1(E0,X0.namespace.split(j1)))return;if(!H&&(V1&&(X0.target!==Y0||X0.___ot===M0)||i0&&X0.relatedTarget&&Y0.contains(X0.relatedTarget)))return;var S1=Y0;if(H){var A0=X0.target;while(!v1(A0,H)){if(A0===Y0)return;if(A0=A0.parentNode,!A0)return}S1=A0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return S1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return Y0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return B}});var W7=w.call(S1,X0,X0.___td);if(L)d0(Y0,M0,E0,H,N1);if(W7===!1)X0.preventDefault(),X0.stopPropagation()};N1.guid=w.guid=w.guid||M.guid++,n5(Y0,M0,E0,H,N1)})}),this}K.on=t5;function a5(Z,H,B,w){return this.on(Z,H,B,w,!0)}K.one=a5;var e5=/\r?\n/g;function J7(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(e5,"\r\n")))}var Z7=/file|reset|submit|button|image/i,e1=/radio|checkbox/i;if(K.serialize=function(){var Z="";return this.each(function(H,B){_(B.elements||[B],function(w,L){if(L.disabled||!L.name||L.tagName==="FIELDSET"||Z7.test(L.type)||e1.test(L.type)&&!L.checked)return;var E=d1(L);if(!T(E)){var f=U(E)?E:[E];_(f,function(d,K0){Z+=J7(L.name,K0)})}})}),Z.slice(1)},typeof Z5!=="undefined")W5.exports=M;else W.cash=W.$=M})()});var c0=function(J,W){if(!W)return J;return J.replace(/{(\w+)}/g,(Q,q)=>{return W[q]!==void 0?W[q].toString():`{${q}}`})},J5=(J,W,Q,q,z)=>{switch(J){case"plural":{if(typeof Q==="string"){console.warn("Plural format value cannot be a string");return}if(q.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=Q["*"];if(typeof X==="object")X=X[z||"*"];return c0(X,q)}if(typeof q.count==="string")q.count=Number(q.count);let Y="*";if(q.count.toString()in Q)Y=q.count.toString();let G=Q[Y]||Q["*"];if(typeof G==="object")G=G[z||"*"];return c0(G,q)}case"condition":{if(typeof Q==="string"){console.warn("Condition format value cannot be a string");return}let Y;for(let G in Q)try{if(new Function("params",`with( params ){ return ${G}; }`)(q||{})){Y=Q[G];break}}catch(X){console.warn(`Invalid <${W}(${G})> condition expression`)}if(Y===void 0)return;if(typeof Y==="object")Y=Y[z||"*"];return c0(Y,q)}case"variable":default:{const Y=typeof Q==="object"?Q[z||"*"]:Q;if(typeof Y==="object"){console.warn(`Invalid <${W}> variable variant definition`);return}return c0(Y,q)}}};class p0{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,W){this.DICTIONARIES[J]=W}translate(J,W){if(W&&this.currentLang===W)return{text:J,lang:this.currentLang};W=W||this.currentLang;const[Q,q]=W.split("-");if(this.DICTIONARIES[Q]&&J in this.DICTIONARIES[Q]){if(typeof this.DICTIONARIES[Q][J]==="object"){const z=this.DICTIONARIES[Q][J];J=z[q||"*"]||z["*"]}else if(typeof this.DICTIONARIES[Q][J]==="string")J=this.DICTIONARIES[Q][J]}return{text:J,lang:W}}format(J,W,Q){Q=Q||this.currentLang;const[q,z]=Q.split("-");if(!this.DICTIONARIES[q]){console.warn(`Undefined <${Q}> format dictionary`);return}if(!this.DICTIONARIES[q][J]){console.warn(`Undefined <${Q}[${J}]> format reference`);return}const Y=this.DICTIONARIES[q][J];if(typeof Y==="string"){console.warn(`Invalid <${Q}[${J}]> format reference. Expected object`);return}if(typeof Y!=="object"||Y===null||Array.isArray(Y)){console.warn(`Invalid <${Q}[${J}]> format value`);return}return J5(Y.type,J,Y.value,W,z)}}class o0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,W){this.callbacks.set(J,W)}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((W)=>{try{const Q=this.callbacks.get(W);if(Q)Q()}catch(Q){console.error(`Error updating component ${W}:`,Q)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class s0{subscriptions=new Map;tick=new o0;register(J,W){this.subscriptions.set(J,W),this.tick.register(J,W)}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,W)=>{this.subscriptions.set(W,()=>{})})}proxyState(J,W){const Q=this,q=new WeakMap,z=(G)=>{if(G instanceof Map)G.forEach((U,D)=>G.set(D,Y(U)));else if(Array.isArray(G))G.forEach((U,D)=>G[D]=Y(U));else if(typeof G==="object")Object.entries(G).forEach(([U,D])=>G[U]=Y(D));let X=new Proxy(G,{get(U,D){if(D==="toJSON")return function(){const A=(k)=>{if(!k||typeof k!=="object")return k;if(q.has(k)){const g=q.get(k);if(g instanceof Map){const o={};return g.forEach((a,r)=>o[typeof r==="object"?JSON.stringify(r):String(r)]=A(a)),o}if(Array.isArray(g))return g.map((o)=>A(o));const m={};return Object.entries(g).forEach(([o,a])=>m[o]=A(a)),m}if(typeof k.toJSON==="function"&&!q.has(k))return k.toJSON();return k};return A(X)};if(D==="reset")return function(){X=null};const F=U[D];if(G instanceof Map&&typeof F==="function")return function(...A){const k=D.toString();if(k==="set"&&A.length>=2)A[1]=Y(A[1]);const g=F.apply(U,A);return["set","delete","clear"].includes(k)&&Q.queueUpdate(J),g};if(Array.isArray(G)&&typeof F==="function")return function(...A){const k=D.toString();if(["push","unshift"].includes(k))A=A.map((m)=>Y(m));else if(k==="splice"&&A.length>2)A=[A[0],A[1],...A.slice(2).map((m)=>Y(m))];const g=F.apply(U,A);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(k)&&Q.queueUpdate(J),g};return F},set(U,D,F){if(U[D]===F)return!0;if(F instanceof Map&&U[D]instanceof Map){const A=U[D];return A.clear(),F.forEach((k,g)=>A.set(g,Y(k))),Q.queueUpdate(J),!0}return U[D]=Y(F),Q.queueUpdate(J),!0}});return q.set(X,G),X},Y=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?z(G):G};return z(W)}}class l0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,W)=>{try{const Q=W.node;if(!Q){this.unwatch(W);return}if(J.type==="attach"&&document.contains(Q[0]))this.unwatch(W),W.emit("component:attached"),typeof W.onAttach=="function"&&W.onAttach.bind(W)();else if(J.type==="detach"&&!document.contains(Q[0]))this.unwatch(W),W.emit("component:detached"),typeof W.onDetach=="function"&&W.onDetach.bind(W)()}catch(Q){console.log("DWS error --",Q)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,W="attach"){const Q=J.node;if(!Q)return;if(W==="attach"&&document.contains(Q[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(W==="detach"&&!document.contains(Q[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const q=setTimeout(()=>{this.unwatch(J),J.emit(`component:${W}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:q,type:W}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),W==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const W=this.observedComponents.get(J);if(W)clearTimeout(W.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}class r0{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.set(J.dependent.path,J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=Array.from(this.pending.values());if(this.metrics.batchCount++,this.metrics.lastBatchSize=J.length,this.metrics.updatesProcessed+=J.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.metrics.trackBatch(J.length),this.applyUpdates(J),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(J){J.forEach(({dep:W,dependent:Q})=>{try{const q=Q.update(Q.memo,"batch-updator");if(q)typeof q.memo==="object"&&this.component.FGUD.get(W)?.set(Q.path,{...Q,memo:q.memo}),typeof q.cleanup==="function"&&q.cleanup()}catch(q){console.error("Failed to update dependency --",q)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class n0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,W){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(W),this}once(J,W){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(W),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...W){if(!this.options.emit)return;const Q=(z)=>{if(typeof z.toJSON==="function")return z.toJSON();if(Array.isArray(z))return z.map(Q);if(typeof z==="object")for(let Y in z)z[Y]=Q(z[Y]);return z},q=W.map(Q);this.__events[J]?.forEach((z)=>z(...q)),this.__once_events[J]?.forEach((z)=>z(...q)),delete this.__once_events[J]}}var $1=E1(t0(),1);function H0(J,W){if(J===W)return!1;if(typeof J!=="object"||typeof W!=="object")return!1;if(J===null||W===null)return!0;if(J instanceof Set){if(!(W instanceof Set))return!0;if(J.size!==W.size)return!0;if(Q5(J)&&Q5(W)){for(let G of J)if(!W.has(G))return!0;return!1}const Y=new WeakMap;for(let G of J){let X=!1;if(typeof G!=="object"){if(W.has(G))X=!0}else for(let U of W){if(typeof U!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const D=Y.get(G);if(D.has(U)){if(X=D.get(U),X)break;continue}const F=!H0(G,U);if(D.set(U,F),F){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(W instanceof Map))return!0;if(J.size!==W.size)return!0;if(X5(J)&&X5(W)){for(let[G,X]of J)if(W.get(G)!==X)return!0;return!1}const Y=new WeakMap;for(let[G,X]of J){if(typeof G!=="object"){if(!W.has(G))return!0;const F=W.get(G);if(typeof X!=="object"){if(X!==F)return!0;continue}if(typeof F!=="object"||H0(X,F))return!0;continue}let U=!1,D=!1;for(let[F,A]of W){if(typeof F!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const k=Y.get(G);if(k.has(F)){const[g,m]=k.get(F);if(g){U=!0,D=m;break}continue}if(!H0(G,F)){if(U=!0,D=typeof X==="object"&&typeof A==="object"?!H0(X,A):X===A,k.set(F,[!0,D]),D)break}else k.set(F,[!1,!1])}if(!U||!D)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(W))return!0;if(J.length!==W.length)return!0;for(let Y=0;Y<J.length;Y++){const G=J[Y],X=W[Y];if(G!==X&&(typeof G!=="object"||H0(G,X)))return!0}return!1}const Q=Object.keys(J),q=Object.keys(W);if(Q.length!==q.length)return!0;Q.sort(),q.sort();const z=Q.length;for(let Y=0;Y<z;Y++)if(Q[Y]!==q[Y])return!0;for(let Y=0;Y<z;Y++){const G=Q[Y],X=J[G],U=W[G];if(X===U)continue;if(X instanceof Date){if(!(U instanceof Date)||String(X)!==String(U))return!0;continue}if(X instanceof RegExp){if(!(U instanceof RegExp)||X.source!==U.source||X.flags!==U.flags)return!0;continue}if(X instanceof Map){if(!(U instanceof Map)||H0(X,U))return!0;continue}if(X instanceof Set){if(!(U instanceof Set)||H0(X,U))return!0;continue}if(X instanceof Function){if(!(U instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof U!=="object")return!0;if(X===J){if(U!==W)return!0}else if(H0(X,U))return!0}else return!0}return!1}function S0(J,W){if(J===W)return!0;if(J==null||W==null)return J===W;const Q=typeof J;if(Q!==typeof W)return!1;if(Q!=="object"){if(Q==="number"&&isNaN(J)&&isNaN(W))return!0;return!1}if(J instanceof Date)return W instanceof Date&&J.getTime()===W.getTime();if(J instanceof RegExp)return W instanceof RegExp&&J.source===W.source&&J.flags===W.flags;if(J instanceof Error)return W instanceof Error&&J.name===W.name&&J.message===W.message&&(J.stack===W.stack||!J.stack&&!W.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(W))return!1;if(J.byteLength!==W.byteLength)return!1;const X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),U=new Uint8Array(W.buffer,W.byteOffset,W.byteLength);for(let D=0;D<X.length;D++)if(X[D]!==U[D])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===W;if(typeof J==="function"){if(typeof W!=="function")return!1;return J.toString()===W.toString()&&J.name===W.name}if(J.constructor!==W.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!H0(J,W);const z=Object.getPrototypeOf(J);if(z!==Object.getPrototypeOf(W))return!1;const Y=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(W);if(Y.length!==G.length)return!1;for(let X of Y){if(!Object.prototype.hasOwnProperty.call(W,X))return!1;if(!S0(J[X],W[X]))return!1}if(z!==null&&z!==Object.prototype){const X=Object.getOwnPropertyNames(z),U=Object.getOwnPropertyNames(Object.getPrototypeOf(W));if(X.length!==U.length)return!1;for(let D of X){if(D==="constructor")continue;if(!S0(z[D],Object.getPrototypeOf(W)[D]))return!1}}return!0}function Q5(J){for(let W of J)if(typeof W==="object"&&W!==null)return!1;return!0}function X5(J){for(let[W,Q]of J)if(typeof W==="object"&&W!==null||typeof Q==="object"&&Q!==null)return!1;return!0}function J0(J,W=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(W.has(J))return W.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 z=new Map;return W.set(J,z),J.forEach((Y,G)=>z.set(J0(G,W),J0(Y,W))),z}if(J instanceof Set){const z=new Set;return W.set(J,z),J.forEach((Y)=>z.add(J0(Y,W))),z}if(Array.isArray(J)){const z=[];W.set(J,z);for(let Y=0;Y<J.length;Y++)z[Y]=J0(J[Y],W);return z}if(ArrayBuffer.isView(J))return new J.constructor(J);const Q=Object.create(Object.getPrototypeOf(J));W.set(J,Q);const q=Object.getOwnPropertySymbols(J);for(let z of q)Q[z]=J0(J[z],W);for(let z in J)if(Object.prototype.hasOwnProperty.call(J,z))Q[z]=J0(J[z],W);return Q}function q5(J,W){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!W||typeof W!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(W).length)return{...J};function Q(z,Y,G){const X=Y.split(/\.|\[|\]/).filter(Boolean);let U=z;for(let D=0;D<X.length;D++){const F=X[D],A=!isNaN(Number(F)),k=D===X.length-1,g=!isNaN(Number(X[D+1]));if(k){U[F]=G;continue}if(!(F in U))U[F]=g?[]:{};else if(g&&!Array.isArray(U[F]))U[F]=[];else if(!g&&Array.isArray(U[F]))U[F]={};U=U[F]}}const q=J0(J);try{for(let[z,Y]of Object.entries(W)){if(typeof z!=="string")throw new TypeError(`Invalid path: ${z}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(z))throw new Error(`Invalid path format: ${z}`);Q(q,z,Y)}}catch(z){throw new Error(`Failed to assign value: ${z.message}`)}return q}var P0="i18n",F0="syn:",O0="fn:",$0="on-",t=/^\.\.\./,a0=/^\[(.*?)\]$/,R1=/{\s*([^{}]+)\s*}/g,H5=["@html","@text","@format"];$1.default.fn.extend({attrs:function(){const J={},W=this[0];return W&&W.nodeType!==Node.TEXT_NODE&&$1.default.each(W.attributes,function(){J[this.name]=this.value}),J}});class e0{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((W,Q)=>W+Q,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,W){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=W}add(J,W){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=W}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=J0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},W={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},Q={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},q={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},z={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},Y={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(W),console.table(Q),console.table(q),console.table(z),console.table(Y),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return J0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var n=E1(t0(),1);var E5=E1(t0(),1);var J1="comm",Z1="rule",W1="decl";var z5="@import";var Y5="@namespace",B5="@keyframes";var G5="@layer";function Q1(J){return J.trim()}function T0(J,W,Q){return J.replace(W,Q)}function K5(J,W,Q){return J.indexOf(W,Q)}function I0(J,W){return J.charCodeAt(W)|0}function L0(J,W,Q){return J.slice(W,Q)}function q0(J){return J.length}function X1(J){return J.length}function b0(J,W){return W.push(J),J}var A1=Math.abs,h0=String.fromCharCode;function q1(J,W,Q,q,z,Y,G,X){return{value:J,root:W,parent:Q,type:q,props:z,children:Y,line:H1,column:_0,length:G,return:"",siblings:X}}function O5(){return W0}function w5(){if(W0=B0>0?I0(g0,--B0):0,_0--,W0===10)_0=1,H1--;return W0}function G0(){if(W0=B0<M5?I0(g0,B0++):0,_0++,W0===10)_0=1,H1++;return W0}function V0(){return I0(g0,B0)}function y0(){return B0}function z1(J,W){return L0(g0,J,W)}function x0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U5(J){return H1=_0=1,M5=q0(g0=J),B0=0,[]}function D5(J){return g0="",J}function Y1(J){return Q1(z1(B0-1,T1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(W0=V0())if(W0<33)G0();else break;return x0(J)>2||x0(W0)>3?"":" "}function F5(J,W){while(--W&&G0())if(W0<48||W0>102||W0>57&&W0<65||W0>70&&W0<97)break;return z1(J,y0()+(W<6&&V0()==32&&G0()==32))}function T1(J){while(G0())switch(W0){case J:return B0;case 34:case 39:if(J!==34&&J!==39)T1(W0);break;case 40:if(J===41)T1(J);break;case 92:G0();break}return B0}function I5(J,W){while(G0())if(J+W0===57)break;else if(J+W0===84&&V0()===47)break;return"/*"+z1(W,B0-1)+"*"+h0(J===47?J:G0())}function L5(J){while(!x0(V0()))G0();return z1(J,B0)}var H1=1,_0=1,M5=0,B0=0,W0=0,g0="";function N5(J){return D5(B1("",null,null,null,[""],J=U5(J),0,[0],J))}function B1(J,W,Q,q,z,Y,G,X,U){var D=0,F=0,A=G,k=0,g=0,m=0,o=1,a=1,r=1,s=0,i="",y=z,v=Y,b=q,O=i;while(a)switch(m=s,s=G0()){case 40:if(m!=108&&I0(O,A-1)==58){if(K5(O+=T0(Y1(s),"&","&\f"),"&\f",A1(D?X[D-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:O+=Y1(s);break;case 9:case 10:case 13:case 32:O+=j5(m);break;case 92:O+=F5(y0()-1,7);continue;case 47:switch(V0()){case 42:case 47:if(b0(B7(I5(G0(),y0()),W,Q,U),U),(x0(m||1)==5||x0(V0()||1)==5)&&q0(O)&&L0(O,-1,void 0)!==" ")O+=" ";break;default:O+="/"}break;case 123*o:X[D++]=q0(O)*r;case 125*o:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+F:if(r==-1)O=T0(O,/\f/g,"");if(g>0&&(q0(O)-A||o===0&&m===47))b0(g>32?C5(O+";",q,Q,A-1,U):C5(T0(O," ","")+";",q,Q,A-2,U),U);break;case 59:O+=";";default:if(b0(b=V5(O,W,Q,D,F,z,X,i,y=[],v=[],A,Y),Y),s===123)if(F===0)B1(O,W,b,b,y,Y,A,X,v);else{switch(k){case 99:if(I0(O,3)===110)break;case 108:if(I0(O,2)===97)break;default:F=0;case 100:case 109:case 115:}if(F)B1(J,b,b,q&&b0(V5(J,b,b,0,0,z,X,i,z,y=[],A,v),v),z,v,A,X,q?y:v);else B1(O,b,b,b,[""],v,0,X,v)}}D=F=g=0,o=r=1,i=O="",A=G;break;case 58:A=1+q0(O),g=m;default:if(o<1){if(s==123)--o;else if(s==125&&o++==0&&w5()==125)continue}switch(O+=h0(s),s*o){case 38:r=F>0?1:(O+="\f",-1);break;case 44:X[D++]=(q0(O)-1)*r,r=1;break;case 64:if(V0()===45)O+=Y1(G0());k=V0(),F=A=q0(i=O+=L5(y0())),s++;break;case 45:if(m===45&&q0(O)==2)o=0}}return Y}function V5(J,W,Q,q,z,Y,G,X,U,D,F,A){var k=z-1,g=z===0?Y:[""],m=X1(g);for(var o=0,a=0,r=0;o<q;++o)for(var s=0,i=L0(J,k+1,k=A1(a=G[o])),y=J;s<m;++s)if(y=Q1(a>0?g[s]+" "+i:T0(i,/&\f/g,g[s])))U[r++]=y;return q1(J,W,Q,z===0?Z1:X,U,D,F,A)}function B7(J,W,Q,q){return q1(J,W,Q,J1,h0(O5()),L0(J,2,-2),0,q)}function C5(J,W,Q,q,z){return q1(J,W,Q,W1,L0(J,0,q),L0(J,q+1,-1),q,z)}function G1(J,W){var Q="";for(var q=0;q<J.length;q++)Q+=W(J[q],q,J,W)||"";return Q}function S5(J,W,Q,q){switch(J.type){case G5:if(J.children.length)break;case z5:case Y5:case W1:return J.return=J.return||J.value;case J1:return"";case B5:return J.return=J.value+"{"+G1(J.children,q)+"}";case Z1:if(!q0(J.value=J.props.join(",")))return""}return q0(Q=G1(J.children,q))?J.return=J.value+"{"+Q+"}":""}function P5(J){var W=X1(J);return function(Q,q,z,Y){var G="";for(var X=0;X<W;X++)G+=J[X](Q,q,z,Y)||"";return G}}class k0{nsp;settings;$head;constructor(J,W){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=W||{},this.settings&&this.load(this.settings)}compile(J){try{return G1(N5(J),P5([S5]))}catch(W){throw new Error(`Style compilation failed: ${W.message}`)}}waitForStyles(J){return new Promise((W)=>{const Q=new MutationObserver(()=>{const q=document.querySelector(J);if(q&&getComputedStyle(q).cssText)Q.disconnect(),W()});Q.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const W=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const Q=this.compile(J);if(!Q)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const q=document.createElement("style");q.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),q.textContent=Q;let z=0;const Y=this.$head.find(`style[${W}]`);if(Y.length)z=parseInt(Y.attr("dindex"))+1,Y.remove();return q.setAttribute("dindex",String(z)),this.settings.meta?document.head.prepend(q):document.head.appendChild(q),q}catch(Q){throw new Error(`Style injection failed: ${Q.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const W=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 W=parseInt(J.attr("dindex"));W===0?J.remove():J.attr("dindex",String(W-1))}async custom(){return{}}async style(){return{}}}var G7=function(J){const W=/on-([a-zA-Z-]+)\s*\(/g;let Q=J,q;while((q=W.exec(J))!==null){const z=q[1],Y=q.index+q[0].length;let G=1,X=Y;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const U=J.slice(Y,X-1).trim(),D=J.slice(0,q.index),F=`${$0}${z}="${U}"`,A=J.slice(X);Q=D+F+A,J=Q,W.lastIndex=D.length+F.length}}return Q},K7=function(J){const W=[];let q=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(z,Y,G)=>{return W.push(G),`<${Y}##TAG_ATTRS_${W.length-1}##>`});for(let z=0;z<W.length;z++){const Y=`##TAG_ATTRS_${z}##`,G=W[z],X=M7(G);q=q.replace(Y,X)}return q},M7=function(J){let W="",Q=0,q=!1,z="",Y=0,G=0,X=0;while(Q<J.length){const U=J[Q];if((U==='"'||U==="'")&&(Q===0||J[Q-1]!=="\\")){if(!q)q=!0,z=U;else if(U===z)q=!1}if(!q){if(U==="(")G++;else if(U===")")G--;else if(U==="{")X++;else if(U==="}")X--}if(!q&&G===0&&X===0&&(U===" "||Q===J.length-1)){let D=Q;if(Q===J.length-1)D=Q+1;const F=J.substring(Y,D).trim();if(F){const A=O7(F);W+=" "+A}Y=Q+1}Q++}return W},O7=function(J){const W=J.indexOf("=");if(W===-1){if(J===P0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let Q=J.substring(0,W).trim(),q=J.substring(W+1).trim();if(Q.startsWith("@"))return Q=!H5.includes(Q)?Q.slice(1):Q,`:${Q}=${q}`;if(Q.startsWith(O0)||Q.startsWith($0))return J;if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")){const z=q.substring(1,q.length-1);if(w7(z))return`:${Q}="${z}"`;return J}else return`:${Q}="${q}"`};function w7(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function b1(J){let W=(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,(Q,q,z)=>{return z.endsWith("<")?`<lips dtag="${q}" ${z}/lips>`:`<lips dtag="${q}" ${z}></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 ${O0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(Q)=>Q.replace(/\s+/g,""));return W=G7(W),W=K7(W),W}var U7=function(J,W){if(J.isDisposed)return;W.add(J),J.dependencies.add(W)},R5=function(J){for(let W of J.dependencies)W.delete(J);J.dependencies.clear()};function R0(J,W={maxSize:100}){const Q=new Set,q=[{value:J,timestamp:Date.now()}];let z=0;const Y=()=>{const D=K1[K1.length-1];return D&&U7(D,Q),q[z].value},G=()=>{const D=[...Q];if($5)for(let F of D)$5.add(F);else for(let F of D)F.execute()};return[Y,(D,F)=>{if(Object.is(q[z].value,D))return;if(z<q.length-1)q.splice(z+1);if(q.push({value:D,timestamp:Date.now(),metadata:F}),q.length>W.maxSize)q.shift(),z=Math.max(0,z-1);else z++;G()},{undo(){if(z>0)z--,G()},redo(){if(z<q.length-1)z++,G()},jumpTo(D){if(D>=0&&D<q.length&&D!==z)z=D,G()},getHistory(){return[...q]},getCurrentIndex(){return z},canUndo(){return z>0},canRedo(){return z<q.length-1},clear(){const D=q[0];q.length=0,q.push(D),z=0,G()}}]}function v0(J){let W=!1;const Q=()=>{if(W)throw new Error("Circular dependency detected");if(q.isDisposed)return;W=!0,R5(q),K1.push(q);try{J()}finally{W=!1,K1.pop()}},q={execute:Q,dependencies:new Set,isDisposed:!1};return Q(),{dispose:()=>{q.isDisposed=!0,R5(q)}}}var K1=[],$5=null;class u0 extends n0{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__path="";__pathCounter=0;__renderDepth=0;constructor(J,W,{input:Q,state:q,context:z,_static:Y,handler:G,stylesheet:X,macros:U,declaration:D},F){super();if(this.lips=F.lips,F?.debug)this.debug=F.debug||this.lips.debug;if(F?.prepath)this.prepath=F.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=b1(W),this.declaration=D||{name:J},this.input=Q||{},this.static=Y||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,q||{}),U&&this.setMacros(U),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new e0(this.debug),this.metrics.inc("componentCount"),this.UQS=new r0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input");this.__previous={input:J0(this.input),state:J0(this.state),context:J0(this.context)};const[A,k]=R0(this.input),[g,m]=R0(this.state),[o,a]=R0(this.context);this.__setInput=k,this.__setState=m,this.__getState=g,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(z)&&z.length&&this.lips.useContext(z,(r)=>{if(!H0(this.context,r))return;a(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=v0(()=>{const r=A(),s=g(),i=this.context=o();if(!this.isRendered){this.metrics.reset();const{$log:y}=this.render("",void 0,void 0,this.FGUD);this.$=y,!D?.syntax&&this.$?.each((v,b)=>{typeof b.setAttribute=="function"&&b.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:s,input:r,context:i},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:J0(r),state:J0(s),context:J0(i)},this.input=r;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,W){this.lips.setContext(J,W)}setInput(J){if(!H0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(J)}subInput(J){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(q5(this.input,J)),this}setMacros(J){const W=b1(J),Q=n.default(W);if(!Q.length)return;const q=this;Q.each(function(){const z=n.default(this),{argv:Y,attrs:G}=q.__getAttributes__(z);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(q.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!z.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");q.__macros.set(G.literals.name,{argv:Y,$node:z})})}setHandler(J){Object.entries(J).map(([W,Q])=>this[W]=Q?.bind(this))}setStylesheet(J){const W={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new k0(this.__name__,W)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,W,Q={},q,z){const Y=q||new Map,G=[];if(W&&!W.length)return console.warn("Undefined node element to render"),{$log:W,dependencies:Y};this.metrics.startRender();const X=this;let U=n.default();function D(O){const K=F(O);return X.__pathCounter++,X.__path?`${X.__path}/${K}`:`${J?J+"/":"#"}${K}`}function F(O){return(O==="component"?"c":"")+X.__pathCounter}function A(O){return O!==null&&typeof O==="object"&&typeof O.mesh==="function"&&typeof O.update==="function"}function k(O){return O!==null&&typeof O==="object"&&typeof O.default&&typeof O.default==="string"}function g(O){if(!O.attr(":dtag")||O.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const K=O.attr(":dtag"),M=X.__evaluate__(K,Q);if(A(M)||M===null)return r(O,K,M);else if(k(M))return s(O,{template:M});else return s(O,{name:M})}function m(O){const K=O.attr(":args"),M=D("log");if(!K)return;if(X.__evaluate__(`console.log(${K})`,Q),X.__isReactive__(K,Q))X.__extractExpressionDeps__(K,Q).forEach((I)=>X.__trackDep__(Y,I,{nodetype:"log",target:"argument",$fragment:null,path:M,update:(S)=>X.__evaluate__(`console.log(${K})`,S),memo:Q,batch:!0}))}function o(O){const K=D("var"),{attrs:M}=X.__getAttributes__(O);if(!M)return;Object.entries(M.literals).forEach(([C,I])=>{if(Q[C]&&Q[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);Q[C]={value:I,type:"let"}}),Object.entries(M.expressions).forEach(([C,I])=>{if(t.test(C)){const S=($,x)=>{const h=X.__evaluate__(C.replace(t,""),x||Q);if(typeof h!=="object")throw new Error(`Invalid spread operator ${C}`);for(let V in h){if(Q[V]&&Q[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(Q[V]={value:h[V],type:"let"},x)x[V]=Q[V],X.__updateVarDepNodes__(V,K,x)}if($)return{memo:x}};X.__extractExpressionDeps__(C,Q).forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"spread-attr",$fragment:null,path:`${K}.${C}`,update:(x)=>S(!0,x),memo:Q,batch:!0})),S()}else if(I){if(X.__isReactive__(I,Q)){const S=X.__extractExpressionDeps__(I,Q),l=($,x)=>{if(Q[C]&&Q[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);return $[C]=Q[C]={value:X.__evaluate__(I,$),type:"let"},X.__updateVarDepNodes__(C,K,$),{memo:$}};S.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"attr",$fragment:null,path:`${K}.${C}`,update:l,memo:Q,batch:!0}))}if(Q[C]&&Q[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);Q[C]={value:X.__evaluate__(I,Q),type:"let"}}}),X.metrics.inc("elementCount")}function a(O){const{attrs:K}=X.__getAttributes__(O);if(!K)return;Object.entries(K.literals).forEach(([M,C])=>{if(Q[M]&&Q[M].type==="const")throw new Error(`<const ${M}=[value]/> variable already defined`);if(!C)return;Q[M]={value:C,type:"const"}}),Object.entries(K.expressions).forEach(([M,C])=>{if(t.test(M)){const I=X.__evaluate__(M.replace(t,""),Q);if(typeof I!=="object")throw new Error(`Invalid spread operator ${M}`);for(let S in I){if(Q[S]&&Q[S].type==="const")throw new Error(`<const ${S}=[value]/> by spread operator ${M}. [${S}] variable already defined`);Q[S]={value:I[S],type:"const"}}}else{if(Q[M]&&Q[M].type==="const")throw new Error(`<const ${M}=[value]/> variable already defined`);if(!C)return;Q[M]={value:X.__evaluate__(C,Q),type:"const"}}}),X.metrics.inc("elementCount")}function r(O,K,M){const{attrs:C}=X.__getAttributes__(O),I=D("element"),S=X.__getBoundaries__(I);let l=n.default(S.start),$={},x=M;if(x){C.literals&&Object.entries(C.literals).forEach(([V,P])=>$[V]={type:"arg",value:P}),C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!x)return;if(t.test(V)){const T=X.__evaluate__(V.replace(t,""),Q);if(typeof T!=="object")throw new Error(`Invalid spread operator ${V}`);for(let N in T){if(N!=="#"&&!x.argv.includes(N))continue;$[N]={type:"arg",value:T[N]}}}else{if(V!=="#"&&!x.argv.includes(V))return;$[V]={type:"arg",value:P?X.__evaluate__(P,Q):!0}}});const h=x.mesh($);if(h&&h.length)l=l.add(h);C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!x)return;if(t.test(V)&&X.__isReactive__(V,Q)){const T=X.__extractExpressionDeps__(V,Q),N=(j,R)=>{if(!x)return;const _={},c=X.__evaluate__(V.replace(t,""),j);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const p=[];for(let u in c){if(u!=="#"&&!x.argv.includes(u))continue;$[u]=_[u]={type:"arg",value:c[u]},(!j[u]||!S0(c[u],j[u].value))&&p.push(u)}p.length&&x.update(p,_,S)};T.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"spread-attr",$fragment:null,boundaries:S,path:`${I}.${V}`,update:N,memo:Q,batch:!0}))}else if((V==="#"||x.argv.includes(V))&&X.__isReactive__(P,Q)){const T=X.__extractExpressionDeps__(P,Q),N=(j,R)=>{if(!x)return;const _=$[V]={type:"arg",value:P?X.__evaluate__(P,j):!0};x.update([V],{[V]:_},S)};T.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"attr",$fragment:null,boundaries:S,path:`${I}.${V}`,update:N,memo:Q,batch:!0}))}})}if(X.__isReactive__(K,Q)){const h=(P,T)=>{const N=X.__evaluate__(K,P);let j;if(k(N))j=s(O,{template:N});else if(A(N))$="#"in $?{...P,...$["#"].value}:{...P,...$},x=N,j=x?x.mesh($):null;if(!document.contains(S.start)||!document.contains(S.end))return;const R=[];let _=S.start.nextSibling;while(_&&_!==S.end)R.push(_),_=_.nextSibling;n.default(R).remove(),j&&n.default(S.start).after(j)};X.__extractExpressionDeps__(K,Q).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"dynamic",target:"dtag",$fragment:null,boundaries:S,path:I,update:h,batch:!0,memo:{...Q,...$}}))}return l=l.add(S.end),l}function s(O,K){let M,C;if(K?.template)M=K.template,C=F("component");else{if(C=K?.name||O.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");M=X.lips.import(C)}if(!M||!C)throw new Error(`<${C}> template not found`);const I=D("component"),S=X.__getBoundaries__(I),{argv:l,attrs:$,events:x}=X.__getAttributes__(O),h={};let V={},P=n.default(S.start),T=X.PCC.get(I);$.literals&&Object.entries($.literals).forEach(([j,R])=>{if(j=="key")return;V[j]=R}),$.functions&&Object.entries($.functions).forEach(([j,R])=>{V[j]=X.__evaluateFunction__(R,[],Q),M.declaration?.syntax?h[F0+O0+j]=R:h[O0+j]=R}),$.expressions&&Object.entries($.expressions).forEach(([j,R])=>{if(j=="key")return;if(t.test(j)){const _=X.__evaluate__(j.replace(t,""),Q);if(typeof _!=="object")throw new Error(`Invalid spread operator ${j}`);for(let c in _)V[c]=_[c]}else V[j]=R?X.__evaluate__(R,Q):!0;M.declaration?.syntax?h[F0+j]=R:h[j]=R});const N=O.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:O,fragmentPath:I,fragmentBoundaries:S,meshPath:null,argv:l,scope:Q,xmlns:z,useAttributes:!0,declaration:M.declaration},h)},M.declaration){if(M.declaration.tags)Object.entries(M.declaration?.tags).forEach(([j,{type:R,many:_}])=>{switch(R){case"nexted":{let c=O.next(j);if(!c.length)return;if(_){V[j]=[];let p=0,u=!1;while(!u){if(V[j].push(X.__meshwire__({$node:c,meshPath:`${j}[${p}]`,fragmentPath:I,fragmentBoundaries:S,argv:l,scope:Q,xmlns:z,useAttributes:!0,declaration:M.declaration},h)),!c.next(j).length){u=!0;break}c=c.next(j),p++}}else V[j]=X.__meshwire__({$node:c,meshPath:j,fragmentPath:I,fragmentBoundaries:S,argv:l,scope:Q,xmlns:z,useAttributes:!0,declaration:M.declaration},h)}break;case"child":{const c=O.children(j);if(_)V[j]=[],c.each(function(p){const u=n.default(this),{argv:Z0}=X.__getAttributes__(u);V[j].push(X.__meshwire__({$node:u,meshPath:`${j}[${p}]`,fragmentPath:I,fragmentBoundaries:S,argv:Z0,scope:Q,xmlns:z,useAttributes:!0,declaration:M.declaration},h))});else if(O.children(j).first().length){const p=O.children(j).first(),{argv:u}=X.__getAttributes__(p);V[j]=X.__meshwire__({$node:p,meshPath:j,fragmentPath:I,fragmentBoundaries:S,argv:u,scope:Q,xmlns:z,useAttributes:!0,declaration:M.declaration},h)}}break}});else if(M.declaration.contents)V.__contents__=N}}if(T)T.setInput(J0(V)),P=P.add(T.node);else{const{declaration:j,state:R,_static:_,handler:c,context:p,default:u,stylesheet:Z0}=M;T=new u0(C,u||"",{state:J0(R),input:J0(V),context:p,_static:J0(_),handler:c,stylesheet:Z0,declaration:j},{debug:X.debug,lips:X.lips,prepath:I}),P=P.add(T.node),X.PCC.set(I,T)}return P=P.add(S.end),Object.entries(x).forEach(([j,R])=>!!T&&X.__attachEvent__(T,j,R,Q)),h&&Object.entries(h).forEach(([j,R])=>{let _=!1,c=!1;if(j.startsWith(F0))_=!0,j=j.replace(F0,"");if(j.startsWith(O0))c=!0,j=j.replace(O0,"");if(t.test(j)){const p=(u)=>{const Z0={},D0=X.__evaluate__(j.replace(t,""),u);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${j}`);for(let e in D0)Z0[e]=D0[e];T?.subInput(Z0)};if(X.__isReactive__(j,Q))X.__extractExpressionDeps__(j,Q).forEach((Z0)=>X.__trackDep__(Y,Z0,{nodetype:"component",target:"spread-attr",$fragment:null,boundaries:S,path:`${I}.${j}`,update:p,syntax:_,memo:Q,batch:!0}))}else{const p=(u)=>{const Z0=c?X.__evaluateFunction__(R,[],u):R?X.__evaluate__(R,u):!0;T?.subInput({[j]:Z0})};if(X.__isReactive__(R,Q))X.__extractExpressionDeps__(R,Q).forEach((Z0)=>X.__trackDep__(Y,Z0,{nodetype:"component",target:"attr",$fragment:null,boundaries:S,path:`${I}.${j}`,update:p,syntax:_,memo:Q,batch:!0}))}}),X.metrics.inc("componentCount"),P}function i(O){const K=O.prop("tagName")?.toLowerCase();if(!K)throw new Error("Invalid macro rendering call");const M=X.__macros.get(K);if(!M)throw new Error("Macro component not found");const C=D("macro"),I=X.__getBoundaries__(C),{attrs:S}=X.__getAttributes__(O),l={};let $={},x={},h=n.default(I.start);S.literals&&Object.entries(S.literals).forEach(([N,j])=>$[N]={value:j,type:"arg"}),S.expressions&&Object.entries(S.expressions).forEach(([N,j])=>{if(t.test(N)){const R=X.__evaluate__(N.replace(t,""),Q);if(typeof R!=="object")throw new Error(`Invalid spread operator ${N}`);for(let _ in R)if(x[_]=R[_],M.argv.includes(_))$[_]={value:R[_],type:"arg"};l[N]=j}else{const R=j?X.__evaluate__(j,Q):!0;if(x[N]=R,M.argv.includes(N))$[N]={value:R,type:"arg"},l[N]=j}M.argv.forEach((R)=>{if($[R]!==void 0)return;$[R]={value:!1,type:"arg"}})}),$.__factory__=()=>{return x};const V={$node:M.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:I,argv:M.argv,scope:Q,xmlns:z,useAttributes:!0},P=X.__meshwire__(V,l),T=P.renderer.mesh($);return h=h.add(T),l&&Object.entries(l).forEach(([N,j])=>{let R=!1;if(new RegExp(`^${F0}`).test(N))R=!0,N=N.replace(F0,"");if(t.test(N)){if(!X.__isReactive__(N,Q))return;const _=X.__extractExpressionDeps__(N,Q),c=(p)=>{const u={},Z0=X.__evaluate__(N.replace(t,""),p);if(typeof Z0!=="object")throw new Error(`Invalid spread operator ${N}`);const D0=[];for(let e in Z0)u[e]={value:Z0[e],type:"arg"},x[e]=Z0[e],(!p[e]||!S0(Z0[e],p[e].value))&&D0.push(e);return D0.length&&P.renderer.update(D0,u),{memo:{...p,...u}}};_.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"spread-attr",$fragment:null,boundaries:I,path:`${C}.${N}`,update:c,syntax:R,memo:{...Q,...$},batch:!0}))}else if(X.__isReactive__(j,Q)){const _=X.__extractExpressionDeps__(j,Q),c=(p)=>{const u=x[N]=j?X.__evaluate__(j,p):!0;return p[N]={value:u,type:"arg"},P.renderer.update([N],{[N]:u}),{memo:p}};_.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"attr",$fragment:null,boundaries:I,path:`${C}.${N}`,update:c,syntax:R,memo:{...Q,...$},batch:!0}))}}),h=h.add(I.end),X.metrics.inc("elementCount"),h}function y(O){if(!O.length||!O.prop("tagName"))return O;const K=O.is("svg")||z,M=K?n.default(document.createElementNS("http://www.w3.org/2000/svg",O.prop("tagName").toLowerCase())):n.default(`<${O.prop("tagName").toLowerCase()}/>`),C=O.contents(),I=D("element");C.length&&M.append(X.__withPath__(I,()=>X.render(I+".n",C,Q,Y,K).$log));const{attrs:S,events:l}=X.__getAttributes__(O);S.literals&&Object.entries(S.literals).forEach(([x,h])=>{if(x===P0)return;const V=O.is(`[${P0}]`)&&["title","placeholder"].includes(x);M.attr(x,V?X.lips.i18n.translate(h).text:h);const P=(T)=>{M.attr(x,V?X.lips.i18n.translate(h).text:h),V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:M,update:P,memo:T})};V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:M,update:P,memo:Q})});const $=(x,h=!1)=>{x&&Object.entries(x).forEach(([V,P])=>{switch(V){case"@html":{const T=(N)=>{M.html(X.__evaluate__(P,N))};if(T(Q),h&&X.__isReactive__(P,Q))X.__extractExpressionDeps__(P,Q).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"meta-attr",$fragment:M,path:`${I}.${V}`,update:T,memo:Q,batch:!0}))}break;case"@text":{const T=O.is(`[${P0}]`),N=(j)=>{M.text(X.__evaluate__(P,j,T)),T&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:M,update:N,memo:j})};if(N(Q),h&&X.__isReactive__(P,Q))X.__extractExpressionDeps__(P,Q).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:M,path:`${I}.${V}`,update:N,memo:Q,batch:!0}));T&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:M,update:N,memo:Q})}break;case"@format":{const[T,N]=P.split(",").map((R)=>R.trim());if(!T)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const j=(R)=>{const _=X.__evaluate__(`!${N.trim()}`,R);if(typeof _!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(T,_);c!==void 0&&M.text(c),X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:M,update:j,memo:R})};j(Q),X.__extractExpressionDeps__(N,Q).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:M,path:`${I}.${V}`,update:j,memo:Q,batch:!0}))}break;case"style":{const T=(N)=>{const j=X.__evaluate__(P,N);if(typeof j==="object"){let R="";Object.entries(j).forEach(([_,c])=>R+=`${_}:${c};`),R.length&&M.attr("style",R)}else M.attr("style",j)};if(T(Q),h&&X.__isReactive__(P,Q))X.__extractExpressionDeps__(P,Q).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"attr",$fragment:M,path:`${I}.${V}`,update:T,memo:Q,batch:!0}))}break;default:{const T=O.is(`[${P0}]`)&&["title","placeholder"].includes(V),N=(j)=>{const R=P?X.__evaluate__(P,j,T):P!==void 0?P:!0;if(R===void 0||R===!1)M.removeAttr(V);else M.attr(V,R),T&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:M,update:N,memo:j})};if(N(Q),h&&X.__isReactive__(P,Q))X.__extractExpressionDeps__(P,Q).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"attr",$fragment:M,path:`${I}.${V}`,update:N,memo:Q,batch:!0}));T&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:M,update:N,memo:Q})}}})};return S.expressions&&Object.keys(S.expressions).forEach((x)=>{if(!t.test(x))return;const h=(V)=>{const P={},T=X.__evaluate__(x.replace(t,""),V);if(typeof T!=="object")throw new Error(`Invalid spread operator ${x}`);for(let N in T)P[N]=T[N];$(P)};if(delete S.expressions[x],h(Q),x&&X.__isReactive__(x,Q))X.__extractExpressionDeps__(x,Q).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"element",target:"spread-attr",$fragment:M,path:`${I}.${x}`,update:h,memo:Q,batch:!0}))}),$(S.expressions,!0),l&&Object.entries(l).forEach(([x,h])=>{G.push({_event:x,$fragment:M,instruction:h,scope:Q})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),M}function v(O){const K=O.text(),M=D("element"),C=O.parent().is(`[${P0}]`),I=n.default(document.createTextNode(X.__interpolate__(K,Q,C))),S=(l)=>{const $=X.__interpolate__(K,l,C);if(!I[0])return;I[0].textContent=$,C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:M,$fragment:I,update:S,memo:l||Q})};if(K&&X.__isReactive__(K,Q)){const l=X.__extractTextDeps__(K,Q);l.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"text",target:"value",path:M,$fragment:I,update:S,memo:Q,batch:l.length>1}))}return C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:M,$fragment:I,update:S,memo:Q}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),I}function b(O){if(O.get(0)?.nodeType===Node.COMMENT_NODE)return O;if(O.get(0)?.nodeType===Node.TEXT_NODE)return v(O);if(O.is("let"))return o(O);else if(O.is("const"))return a(O);else if(O.is("lips")&&O.attr(":dtag"))return g(O);else if(O.is("log"))return m(O);else if(X.__macros.has(O.prop("tagName")?.toLowerCase()))return i(O);else if(O.is("if, for, switch, async")||X.lips.has(O.prop("tagName")?.toLowerCase()))return s(O);else if(O.is("else-if, else"))return;return y(O)}try{this.__renderDepth++,W=W||n.default(this.__template__),W.each(function(){const O=b(n.default(this));if(O)U=U.add(O)}),G.forEach(({$fragment:O,_event:K,instruction:M,scope:C})=>{this.__attachEvent__(O,K,M,C)}),X.metrics.inc("renderCount")}catch(O){console.error("Rendering Failed --",O),X.metrics.trackError(O)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:U,dependencies:Y,events:G}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:J,_event:W})=>this.__detachEvent__(J,W)),this.VER=[];for(let J in this.PCC){const W=this.PCC.get(J);W?.destroy(),W?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,W)=>{n.default(W).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,W){const Q=this,{$node:q,meshPath:z,fragmentPath:Y,fragmentBoundaries:G,argv:X,scope:U,xmlns:D,declaration:F,useAttributes:A}=J;let k,g=[];const m=[],o=(i,y,v)=>{const b=`${Y}.${z||"r"}${v!==void 0?`[${v}]`:""}`,{$log:O,dependencies:K,events:M}=Q.__withPath__(b,()=>Q.render(b,i,{...U,...y},void 0,D));if(m.push(b),K?.forEach((C,I)=>{if(!Q.FGUD?.has(I))Q.FGUD.set(I,new Map);C.forEach((S,l)=>{S.partial?.length?S.partial.push(b):S.partial=[b],Q.FGUD.get(I)?.set(l,S)})}),Q.metrics.inc("partialCount"),v!==void 0){const C=Q.__getBoundaries__(b);g[v]={argvalues:y,boundaries:C};let I=n.default(C.start);return I=I.add(O),I=I.add(C.end),I}return O},a=(i,y,v)=>{Q.metrics.startRender();const b=v!==void 0?m.filter((O)=>O.endsWith(`r[${v}]`)):m;if(i.forEach((O)=>{const K=Q.FGUD.get(O);if(!K)return;K.forEach((M)=>{const C=b.find((I)=>{return M.partial?.find((S)=>I==S||Q.__hasSamePathParent__(S,I))});if(!M.partial||!C)return;if(G?.start&&!document.contains(G.start)){console.warn(`${z} -- partial boundaries missing in the DOM`),K.delete(M.path);return}if(M.memo?.[O]&&y?.[O]&&S0(M.memo[O],y[O]))return;if(M.memo={...U,...M.memo,...y},M.batch)Q.UQS.queue({dep:O,dependent:M});else{const I=M.update(M.memo,"mesh-partial-updator");if(I)typeof I.memo==="object"&&K.set(M.path,{...M,memo:I.memo}),typeof I.cleanup==="function"&&I.cleanup()}Q.metrics.inc("dependencyUpdateCount")}),!K.size&&Q.FGUD.delete(O)}),v!==void 0&&g[v])g[v].argvalues=y;Q.metrics.inc("partialUpdateCount"),Q.metrics.endRender()},r=(i)=>{if(!g[i])return;const y=g[i].boundaries;if(g.splice(i,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${i}> boundaries missing`);return}const v=[];let b=y.start.nextSibling;while(b&&b!==y.end)v.push(b),b=b.nextSibling;n.default(v).remove(),y.start.remove(),y.end.remove()},s={renderer:{path:z,argv:X,mesh(i,y=!1){if(k=q.contents(),!k?.length)return null;if(F?.iterator){const v=i?.["#"].value;if(!Array.isArray(i?.["#"].value))throw new Error("Invalid iterator argvalues");if(!v.length)return null;let b=n.default();return v.forEach((O,K)=>{if(!k?.length)return null;b=b.add(o(k,O,K))}),b}else return o(k,i)},update(i,y,v){if(!m.length)return;if(v=v||G,F?.iterator){const b=y?.["#"].value;if(!Array.isArray(b))return;if(Array.isArray(g)){if(g.length===b.length){for(let K=0;K<b.length;K++)!S0(g[K].argvalues,b[K])&&a(Object.keys(b[K]),b[K],K);return}const O=Math.min(g.length,b.length);for(let K=0;K<O;K++)a(Object.keys(b[K]),b[K],K);if(b.length>g.length){if(!k?.length)return;for(let K=g.length;K<b.length;K++){const M=o(k,b[K],K);n.default(v.end).before(M)}}else if(b.length<g.length)for(let K=g.length-1;K>=b.length;K--)r(K)}}else a(i,y)}}};if(A&&z){const{attrs:i}=Q.__getAttributes__(q);i.literals&&Object.entries(i.literals).forEach(([y,v])=>s[y]=v),i.expressions&&Object.entries(i.expressions).forEach(([y,v])=>{if(t.test(y)){const b=Q.__evaluate__(y.replace(t,""),U);if(typeof b!=="object")throw new Error(`Invalid spread operator ${y}`);for(let O in b)s[O]=b[O];W[`${F?.syntax?F0:""}${z}.${y}`]=v}else s[y]=v?Q.__evaluate__(v,U):!0,W[`${F?.syntax?F0:""}${z}.${y}`]=v})}return s}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${J}`),end:document.createComment(`e:${this.prepath}.${J}`)}}__getAttributes__(J){const W=J.attrs(),Q={},q={literals:{},functions:{},expressions:{}};let z=[];return W&&Object.entries(W).forEach(([Y,G])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(O0)||Y.startsWith($0)||t.test(Y)||a0.test(Y))if(a0.test(Y)){const[X,U]=Y.match(a0)||[];z=U.split(",")}else if(Y.startsWith($0))Q[Y.replace($0,"")]=G;else if(Y.startsWith(O0))q.functions[Y.replace(O0,"")]=G;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);q.expressions[Y]=G||""}else q.literals[Y]=G}),{argv:z,events:Q,attrs:q}}__withPath__(J,W){const Q=this.__path;this.__path=J;const q=W();return this.__path=Q,q}__getPathParent__(J){const W=J.split("/");if(W.length>1)W.pop();return W.join("/")}__hasSamePathParent__(J,W){return J.startsWith(W)}__evaluate__(J,W,Q){try{J=J.trim();const q=(z)=>{const Y=this.state.toJSON();if(W){let G;const X={};for(let F in W){if(F==="__factory__"&&typeof W.__factory__==="function"){G=W.__factory__();continue}X[F]=W[F].value}const U=`with( scope ){ return ${z}; }`;return new Function("self","input","state","static","context","scope","argvalues",U)(this,this.input,Y,this.static,this.context,X||{},G)}else{const G=`return ${z}`;return new Function("self","input","state","static","context",G)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return q(J.slice(1));return J.replace(R1,(z,Y)=>q(Y))}return q(J)}catch(q){return J}}__evaluateFunction__(J,W,Q){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,Q)(...W);else{let[q,...z]=J.split(/\s*,\s*/),Y;if(q=this.__evaluate__(q,Q),typeof q==="function")Y=q;else{if(typeof this[q]!=="function")throw new Error(`Undefined <${q}> handler method`);Y=this[q].bind(this)}if(typeof Y!=="function")throw new Error(`Expected <${q}> to be a function or handler method`);let G=z.map((X)=>this.__evaluate__(X,Q));if(W.length)G=[...G,...W];return Y(...G)}}__interpolate__(J,W,Q){if(J=J.replace(R1,(q,z)=>this.__evaluate__(z,W)),Q)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,W,Q,q){J.on(W,(...z)=>this.__evaluateFunction__(Q,z,q)),this.VER.push({element:J,_event:W}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,W){J.off(W),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,W){const Q=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((z)=>{const Y=z.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Y,W).forEach((X)=>Q.add(X))}),Array.from(Q)}__extractExpressionDeps__(J,W){const Q=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,q=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let z=[...Array.from(J.matchAll(Q)),...Array.from(J.matchAll(q))];if(W&&Object.keys(W).length){const Y=new RegExp(`\\b(${Object.keys(W).join("|")})`,"g");z=[...z,...Array.from(J.matchAll(Y))]}return[...new Set(z.map((Y)=>Y[0]))]}__isReactive__(J,W){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(W&&Object.keys(W).length&&new RegExp(Object.keys(W).join("|")).test(J))return!0;return!1}__trackDep__(J,W,Q){if(Q.memo&&Q.memo[W]&&Q.memo[W].type==="let")Q.haslet=!0;!J.has(W)&&J.set(W,new Map),J.get(W)?.set(Q.path,Q),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,W){return W.reduce((Q,q)=>Q?.[q],J)}__shouldUpdate__(J,W,Q,q){if(J==="self")return!0;const z=this.__valueDep__(q[J],W),Y=this.__valueDep__(Q[J],W);return!S0(z,Y)}__updateDepNodes__(J,W){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((Q,q)=>{const[z,...Y]=q.split(".");if(!this.__shouldUpdate__(z,Y,J,W))return;Q.forEach((G)=>{const{path:X,batch:U,$fragment:D,boundaries:F,update:A,memo:k,syntax:g}=G;try{if(!g&&(F?.start&&!document.contains(F.start))||D!==null&&!D.closest("body").length){Q.delete(X);return}if(U)this.UQS.queue({dep:q,dependent:G});else{const m=A(k,"main-updator");if(m)typeof m.memo==="object"&&Q.set(X,{...G,memo:m.memo}),typeof m.cleanup==="function"&&m.cleanup()}this.metrics.inc("dependencyUpdateCount")}catch(m){console.error("failed to update dependency nodes --",m);return}}),!Q.size&&this.FGUD?.delete(q)}),this.metrics.endRender()}__updateVarDepNodes__(J,W,Q){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((z,Y)=>{if(!z.haslet||!this.__hasSamePathParent__(Y,this.__getPathParent__(W)))return;if(z.memo={...z.memo,...Q},z.batch)this.UQS.queue({dep:J,dependent:z});else{const G=z.update(z.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,W)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(W);return}J.update(J.memo,"i18n-partial-updator")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?n.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?n.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?n.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _1={};f0(_1,{state:()=>{{return j7}},handler:()=>{{return F7}},default:()=>{{return I7}},declaration:()=>{{return D7}}});var D7={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},j7={renderer:null},F7={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let J=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((W)=>{if(J||!W.by)return;this.state.renderer=W.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},I7="<{state.renderer}/>";var x1={};f0(x1,{state:()=>{{return V7}},handler:()=>{{return N7}},default:()=>{{return S7}},declaration:()=>{{return L7}},_static:()=>{{return C7}}});var L7={name:"for",syntax:!0,iterator:!0},V7={argvlist:null},C7={lastIn:null,processingBatch:!1},N7={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:W,to:Q}=this.input;if(J===void 0&&W===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(W!==void 0){if(W=parseFloat(String(W)),Q==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(Q=parseFloat(String(Q)),W===Q)throw new Error("<from> and <to> attribute cannot have the same value");const q=W<Q,z=Math.abs(Q-W)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z){const[G]=this.input.renderer.argv;if(G){let X=W,U=!0;for(let D=0;D<this.state.argvlist.length;D++){if(this.state.argvlist[D][G].value!==X){U=!1;break}X=q?X+1:X-1}if(U)return;X=W;for(let D=0;D<this.state.argvlist.length;D++)this.state.argvlist[D][G].value=X,X=q?X+1:X-1;return}}const Y=[];for(let G=W;q?G<=Q:G>=Q;q?G++:G--){const X={},[U]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};Y.push(X)}this.state.argvlist=Y}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[Y,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const U=this.state.argvlist[X];if(Y)U[Y].value=J[X]}return}const q=[];let z=0;for(let Y of J){const G={},[X,U]=this.input.renderer.argv;if(X)G[X]={value:Y,type:"arg"};if(U)G[U]={value:z,type:"arg"};q.push(G),z++}this.state.argvlist=q}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[Y,G,X]=this.input.renderer.argv;let U=0;for(let[D,F]of J){const A=this.state.argvlist[U];if(Y)A[Y].value=D;if(G)A[G].value=F;U++}return}const q=[];let z=0;for(let[Y,G]of J){const X={},[U,D,F]=this.input.renderer.argv;if(U)X[U]={value:Y,type:"arg"};if(D)X[D]={value:G,type:"arg"};if(F)X[F]={value:z,type:"arg"};q.push(X),z++}this.state.argvlist=q}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!Object.keys(J).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=J;const q=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[G,X,U]=this.input.renderer.argv;for(let D=0;D<q.length;D++){const F=q[D],A=this.state.argvlist[D];if(G)A[G].value=F;if(X)A[X].value=J[F]}return}const z=[];let Y=0;for(let G in J){const X={},[U,D,F]=this.input.renderer.argv;if(U)X[U]={value:G,type:"arg"};if(D)X[D]={value:J[G],type:"arg"};if(F)X[F]={value:Y,type:"arg"};z.push(X),Y++}this.state.argvlist=z}}finally{this.static.processingBatch=!1}},updateItems(J){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(J)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[W]=this.input.renderer?.argv;if(!W)return;for(let{index:Q,value:q}of J)if(Q>=0&&Q<this.state.argvlist.length)this.state.argvlist[Q][W].value=q}finally{this.static.processingBatch=!1}},updateProperty(J,W){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!this.state.argvlist)return;this.static.processingBatch=!0;try{for(let Q=0;Q<this.state.argvlist.length;Q++){const q=this.state.argvlist[Q];if(q[J])q[J].value=typeof W==="function"?W(q[J].value,Q):W}}finally{this.static.processingBatch=!1}}},S7="<{input.renderer} #=state.argvlist/>";var g1={};f0(g1,{state:()=>{{return E7}},handler:()=>{{return $7}},default:()=>{{return R7}},declaration:()=>{{return P7}}});var P7={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},E7={renderer:null,props:{}},$7={onInput(){if(!this.input.await)throw new Error("Undefined async <await> attribute");if(!(this.input.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.input.loading)this.state.renderer=this.input.loading.renderer,this.state.props={};this.input.await.then((J)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[W]=this.input.then.renderer.argv;this.state.props={[W]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[W]=this.input.then.renderer.argv;this.state.props={[W]:{value:J,type:"arg"}}})}},R7="<{state.renderer} #=state.props/>";var k1={};f0(k1,{state:()=>{{return T7}},handler:()=>{{return b7}},default:()=>{{return _7}},declaration:()=>{{return A7}}});var A7={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},T7={renderer:null},b7={onInput(){let J=[];for(let W of this.input.case)if(W.is==this.input.by||Array.isArray(W.is)&&W.is.includes(this.input.by))Array.isArray(W.is)?J=[...new Set([...J,...W.is])]:J.push(W.is),this.state.renderer=W.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},_7="<{state.renderer}/>";var f1={};f0(f1,{state:()=>{{return x7}},handler:()=>{{return h7}},default:()=>{{return y7}},context:()=>{{return k7}},_static:()=>{{return g7}}});var f7=function(J){const W={};return J.split("&").map((q)=>{const[z,Y]=q.split("=");W[z]=Y}),W},x7={page:null,params:{},query:{}},g7={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},k7=["navigate"],h7={onInput(){if(!this.input.routes)return;if(this.input.global)this.static.global=this.input.global;if(this.static.routes=this.input.routes.map(({path:J,template:W,default:Q})=>{if(Q)this.static.defaultPath=J;const q=J.match(/:[^\/]*(\/|$)/gi)||[],z=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:W,default:Q,pathVars:q,pathRegex:new RegExp(`${z}\$`,"i")}}),this.input.global){const J=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&J=="/"&&J!==this.static.defaultPath?this.static.defaultPath:J?J+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,W){!W&&this.static.global&&history.pushState({path:J},"",J);const Q=J.split("?");J=Q[0];const q=Q[1]?f7(Q[1]):{};let z=null;if(this.static.currentRoute)z={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:z,toState:{path:J,query:q}});const Y=this.match(J);if(!Y){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=Y;this.emit("after",{fromState:z,toState:{path:G.path,params:X,query:q}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=X,this.state.query=q,this.state.page=G.template},match(J){const W={};let Q=!1;for(let q of this.static.routes){const{pathVars:z,pathRegex:Y}=q,G=J.match(Y);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<z.length;X++)W[z[X].replaceAll(/[\/:]/g,"")]=G[X+1];Q=q;break}}return Q?{route:Q,params:W}:!1}},y7="<{state.page} params=state.params query=state.query/>";class M1{debug=!1;stylesheets=[];config={};store={};__root;i18n=new p0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new l0,this.IUC=new s0;const[W,Q]=R0(this.i18n.lang),[q,z]=R0(J?.context||{});this.__setLang=Q,this.__getLang=W,this.__setContext=z,this.__getContext=q,this.register("if",_1),this.register("for",x1),this.register("async",g1),this.register("switch",k1),this.register("router",f1)}register(J,W){return this.store[J]=W,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,W,Q){const{default:q,...z}=W,Y={debug:this.debug,prepath:"0",lips:this},G=new u0(J,q||"",{...z,input:Q},Y);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(J,W){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(W),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((Q)=>new k0("root",{sheet:Q,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,W){const Q=this.__getContext();if(typeof J==="string"){const q={...Q,[J]:W};H0(Q,q)&&this.__setContext(q)}else if(!Array.isArray(J)){const q={...Q,...J};H0(Q,q)&&this.__setContext(q)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,W){if(!J.length)return;v0(()=>{const Q=this.__getContext();if(!Q)return;const q=Object.fromEntries(J.map((z)=>[z,Q[z]]));q&&typeof W==="function"&&Object.keys(q).length&&W(q)})}useTranslator(J,W){v0(()=>{const Q=this.__getLang();if(!Q)return;(J==="*"||Array.isArray(J)&&J.includes(Q))&&typeof W==="function"&&W(Q)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var n8=new M1({debug:!0});
1
+ var Y6=Object.create;var{defineProperty:T1,getPrototypeOf:U6,getOwnPropertyNames:K6}=Object;var j6=Object.prototype.hasOwnProperty;var S1=(J,Z,H)=>{H=J!=null?Y6(U6(J)):{};const X=Z||!J||!J.__esModule?T1(H,"default",{value:J,enumerable:!0}):H;for(let q of K6(J))if(!j6.call(X,q))T1(X,q,{get:()=>J[q],enumerable:!0});return X};var O6=(J,Z)=>()=>(Z||J((Z={exports:{}}).exports,Z),Z.exports);var m0=(J,Z)=>{for(var H in Z)T1(J,H,{get:Z[H],enumerable:!0,configurable:!0,set:(X)=>Z[H]=()=>X})};var e0=O6((W5,H5)=>{(function(){var J=document,Z=window,H=J.documentElement,X=J.createElement.bind(J),q=X("div"),W=X("table"),G=X("tbody"),Y=X("tr"),M=Array.isArray,U=Array.prototype,D=U.concat,N=U.filter,b=U.indexOf,i=U.map,e=U.push,r=U.slice,H0=U.some,t=U.splice,J0=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,_=/<.+>/,u=/^\w+$/;function v(Q,z){var B=V(z);return!Q||!B&&!F(z)&&!S(z)?[]:!B&&d.test(Q)?z.getElementsByClassName(Q.slice(1).replace(/\\/g,"")):!B&&u.test(Q)?z.getElementsByTagName(Q):z.querySelectorAll(Q)}var A=function(){function Q(z,B){if(!z)return;if(O(z))return z;var K=z;if(T(z)){var C=B||J;if(K=J0.test(z)&&F(C)?C.getElementById(z.slice(1).replace(/\\/g,"")):_.test(z)?i1(z):O(C)?C.find(z):T(C)?j(C).find(z):v(z,C),!K)return}else if(h(z))return this.ready(z);if(K.nodeType||K===Z)K=[K];this.length=K.length;for(var E=0,y=this.length;E<y;E++)this[E]=K[E]}return Q.prototype.init=function(z,B){return new Q(z,B)},Q}(),w=A.prototype,j=w.init;if(j.fn=j.prototype=w,w.length=0,w.splice=t,typeof Symbol==="function")w[Symbol.iterator]=U[Symbol.iterator];function O(Q){return Q instanceof A}function P(Q){return!!Q&&Q===Q.window}function F(Q){return!!Q&&Q.nodeType===9}function V(Q){return!!Q&&Q.nodeType===11}function S(Q){return!!Q&&Q.nodeType===1}function m(Q){return!!Q&&Q.nodeType===3}function c(Q){return typeof Q==="boolean"}function h(Q){return typeof Q==="function"}function T(Q){return typeof Q==="string"}function $(Q){return Q===void 0}function k(Q){return Q===null}function R(Q){return!isNaN(parseFloat(Q))&&isFinite(Q)}function f(Q){if(typeof Q!=="object"||Q===null)return!1;var z=Object.getPrototypeOf(Q);return z===null||z===Object.prototype}j.isWindow=P,j.isFunction=h,j.isArray=M,j.isNumeric=R,j.isPlainObject=f;function L(Q,z,B){if(B){var K=Q.length;while(K--)if(z.call(Q[K],K,Q[K])===!1)return Q}else if(f(Q)){var C=Object.keys(Q);for(var K=0,E=C.length;K<E;K++){var y=C[K];if(z.call(Q[y],y,Q[y])===!1)return Q}}else for(var K=0,E=Q.length;K<E;K++)if(z.call(Q[K],K,Q[K])===!1)return Q;return Q}j.each=L,w.each=function(Q){return L(this,Q)},w.empty=function(){return this.each(function(Q,z){while(z.firstChild)z.removeChild(z.firstChild)})};function x(){var Q=[];for(var z=0;z<arguments.length;z++)Q[z]=arguments[z];var B=c(Q[0])?Q.shift():!1,K=Q.shift(),C=Q.length;if(!K)return{};if(!C)return x(B,j,K);for(var E=0;E<C;E++){var y=Q[E];for(var o in y)if(B&&(M(y[o])||f(y[o]))){if(!K[o]||K[o].constructor!==y[o].constructor)K[o]=new y[o].constructor;x(B,K[o],y[o])}else K[o]=y[o]}return K}j.extend=x,w.extend=function(Q){return x(w,Q)};var I=/\S+/g;function g(Q){return T(Q)?Q.match(I)||[]:[]}w.toggleClass=function(Q,z){var B=g(Q),K=!$(z);return this.each(function(C,E){if(!S(E))return;L(B,function(y,o){if(K)z?E.classList.add(o):E.classList.remove(o);else E.classList.toggle(o)})})},w.addClass=function(Q){return this.toggleClass(Q,!0)},w.removeAttr=function(Q){var z=g(Q);return this.each(function(B,K){if(!S(K))return;L(z,function(C,E){K.removeAttribute(E)})})};function a(Q,z){if(!Q)return;if(T(Q)){if(arguments.length<2){if(!this[0]||!S(this[0]))return;var B=this[0].getAttribute(Q);return k(B)?void 0:B}if($(z))return this;if(k(z))return this.removeAttr(Q);return this.each(function(C,E){if(!S(E))return;E.setAttribute(Q,z)})}for(var K in Q)this.attr(K,Q[K]);return this}w.attr=a,w.removeClass=function(Q){if(arguments.length)return this.toggleClass(Q,!1);return this.attr("class","")},w.hasClass=function(Q){return!!Q&&H0.call(this,function(z){return S(z)&&z.classList.contains(Q)})},w.get=function(Q){if($(Q))return r.call(this);return Q=Number(Q),this[Q<0?Q+this.length:Q]},w.eq=function(Q){return j(this.get(Q))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function n(Q){if($(Q))return this.get().map(function(z){return S(z)||m(z)?z.textContent:""}).join("");return this.each(function(z,B){if(!S(B))return;B.textContent=Q})}w.text=n;function p(Q,z,B){if(!S(Q))return;var K=Z.getComputedStyle(Q,null);return B?K.getPropertyValue(z)||void 0:K[z]||Q.style[z]}function s(Q,z){return parseInt(p(Q,z),10)||0}function l(Q,z){return s(Q,"border".concat(z?"Left":"Top","Width"))+s(Q,"padding".concat(z?"Left":"Top"))+s(Q,"padding".concat(z?"Right":"Bottom"))+s(Q,"border".concat(z?"Right":"Bottom","Width"))}var Q0={};function L0(Q){if(Q0[Q])return Q0[Q];var z=X(Q);J.body.insertBefore(z,null);var B=p(z,"display");return J.body.removeChild(z),Q0[Q]=B!=="none"?B:"block"}function x0(Q){return p(Q,"display")==="none"}function m1(Q,z){var B=Q&&(Q.matches||Q.webkitMatchesSelector||Q.msMatchesSelector);return!!B&&!!z&&B.call(Q,z)}function p0(Q){return T(Q)?function(z,B){return m1(B,Q)}:h(Q)?Q:O(Q)?function(z,B){return Q.is(B)}:!Q?function(){return!1}:function(z,B){return B===Q}}w.filter=function(Q){var z=p0(Q);return j(N.call(this,function(B,K){return z.call(B,K,B)}))};function R0(Q,z){return!z?Q:Q.filter(z)}w.detach=function(Q){return R0(this,Q).each(function(z,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var v5=/^\s*<(\w+)[^>]*>/,u5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,d1={"*":q,tr:G,td:Y,th:Y,thead:W,tbody:W,tfoot:W};function i1(Q){if(!T(Q))return[];if(u5.test(Q))return[X(RegExp.$1)];var z=v5.test(Q)&&RegExp.$1,B=d1[z]||d1["*"];return B.innerHTML=Q,j(B.childNodes).detach().get()}j.parseHTML=i1,w.has=function(Q){var z=T(Q)?function(B,K){return v(Q,K).length}:function(B,K){return K.contains(Q)};return this.filter(z)},w.not=function(Q){var z=p0(Q);return this.filter(function(B,K){return(!T(Q)||S(K))&&!z.call(K,B,K)})};function I0(Q,z,B,K){var C=[],E=h(z),y=K&&p0(K);for(var o=0,j0=Q.length;o<j0;o++)if(E){var q0=z(Q[o]);if(q0.length)e.apply(C,q0)}else{var w0=Q[o][z];while(w0!=null){if(K&&y(-1,w0))break;C.push(w0),w0=B?w0[z]:null}}return C}function c1(Q){if(Q.multiple&&Q.options)return I0(N.call(Q.options,function(z){return z.selected&&!z.disabled&&!z.parentNode.disabled}),"value");return Q.value||""}function m5(Q){if(!arguments.length)return this[0]&&c1(this[0]);return this.each(function(z,B){var K=B.multiple&&B.options;if(K||Z5.test(B.type)){var C=M(Q)?i.call(Q,String):k(Q)?[]:[String(Q)];if(K)L(B.options,function(E,y){y.selected=C.indexOf(y.value)>=0},!0);else B.checked=C.indexOf(B.value)>=0}else B.value=$(Q)||k(Q)?"":Q})}w.val=m5,w.is=function(Q){var z=p0(Q);return H0.call(this,function(B,K){return z.call(B,K,B)})},j.guid=1;function F0(Q){return Q.length>1?N.call(Q,function(z,B,K){return b.call(K,z)===B}):Q}j.unique=F0,w.add=function(Q,z){return j(F0(this.get().concat(j(Q,z).get())))},w.children=function(Q){return R0(j(F0(I0(this,function(z){return z.children}))),Q)},w.parent=function(Q){return R0(j(F0(I0(this,"parentNode"))),Q)},w.index=function(Q){var z=Q?j(Q)[0]:this[0],B=Q?this:j(z).parent().children();return b.call(B,z)},w.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)},w.siblings=function(Q){return R0(j(F0(I0(this,function(z){return j(z).parent().children().not(z)}))),Q)},w.find=function(Q){return j(F0(I0(this,function(z){return v(Q,z)})))};var d5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,i5=/^$|^module$|\/(java|ecma)script/i,c5=["type","src","nonce","noModule"];function p5(Q,z){var B=j(Q);B.filter("script").add(B.find("script")).each(function(K,C){if(i5.test(C.type)&&H.contains(C)){var E=X("script");E.text=C.textContent.replace(d5,""),L(c5,function(y,o){if(C[o])E[o]=C[o]}),z.head.insertBefore(E,null),z.head.removeChild(E)}})}function s5(Q,z,B,K,C){if(K)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(C)p5(z,Q.ownerDocument)}function E0(Q,z,B,K,C,E,y,o){return L(Q,function(j0,q0){L(j(q0),function(w0,T0){L(j(z),function(O0,o0){var $1=B?T0:o0,R1=B?o0:T0,M0=B?w0:O0;s5($1,!M0?R1:R1.cloneNode(!0),K,C,!M0)},o)},y)},E),z}w.after=function(){return E0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return E0(arguments,this,!1,!1,!0)};function o5(Q){if(!arguments.length)return this[0]&&this[0].innerHTML;if($(Q))return this;var z=/<script[\s>]/.test(Q);return this.each(function(B,K){if(!S(K))return;if(z)j(K).empty().append(Q);else K.innerHTML=Q})}w.html=o5,w.appendTo=function(Q){return E0(arguments,this,!0,!1,!0)},w.wrapInner=function(Q){return this.each(function(z,B){var K=j(B),C=K.contents();C.length?C.wrapAll(Q):K.append(Q)})},w.before=function(){return E0(arguments,this,!1,!0)},w.wrapAll=function(Q){var z=j(Q),B=z[0];while(B.children.length)B=B.firstElementChild;return this.first().before(z),this.appendTo(B)},w.wrap=function(Q){return this.each(function(z,B){var K=j(Q)[0];j(B).wrapAll(!z?K:K.cloneNode(!0))})},w.insertAfter=function(Q){return E0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Q){return E0(arguments,this,!0,!0)},w.prepend=function(){return E0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Q){return E0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return j(F0(I0(this,function(Q){return Q.tagName==="IFRAME"?[Q.contentDocument]:Q.tagName==="TEMPLATE"?Q.content.childNodes:Q.childNodes})))},w.next=function(Q,z,B){return R0(j(F0(I0(this,"nextElementSibling",z,B))),Q)},w.nextAll=function(Q){return this.next(Q,!0)},w.nextUntil=function(Q,z){return this.next(z,!0,Q)},w.parents=function(Q,z){return R0(j(F0(I0(this,"parentElement",!0,z))),Q)},w.parentsUntil=function(Q,z){return this.parents(z,Q)},w.prev=function(Q,z,B){return R0(j(F0(I0(this,"previousElementSibling",z,B))),Q)},w.prevAll=function(Q){return this.prev(Q,!0)},w.prevUntil=function(Q,z){return this.prev(z,!0,Q)},w.map=function(Q){return j(D.apply([],i.call(this,function(z,B){return Q.call(z,B,z)})))},w.clone=function(){return this.map(function(Q,z){return z.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Q,z){var B=z.offsetParent;while(B&&p(B,"position")==="static")B=B.offsetParent;return B||H})},w.slice=function(Q,z){return j(r.call(this,Q,z))};var l5=/-([a-z])/g;function L1(Q){return Q.replace(l5,function(z,B){return B.toUpperCase()})}w.ready=function(Q){var z=function(){return setTimeout(Q,0,j)};if(J.readyState!=="loading")z();else J.addEventListener("DOMContentLoaded",z);return this},w.unwrap=function(){return this.parent().each(function(Q,z){if(z.tagName==="BODY")return;var B=j(z);B.replaceWith(B.children())}),this},w.offset=function(){var Q=this[0];if(!Q)return;var z=Q.getBoundingClientRect();return{top:z.top+Z.pageYOffset,left:z.left+Z.pageXOffset}},w.position=function(){var Q=this[0];if(!Q)return;var z=p(Q,"position")==="fixed",B=z?Q.getBoundingClientRect():this.offset();if(!z){var K=Q.ownerDocument,C=Q.offsetParent||K.documentElement;while((C===K.body||C===K.documentElement)&&p(C,"position")==="static")C=C.parentNode;if(C!==Q&&S(C)){var E=j(C).offset();B.top-=E.top+s(C,"borderTopWidth"),B.left-=E.left+s(C,"borderLeftWidth")}}return{top:B.top-s(Q,"marginTop"),left:B.left-s(Q,"marginLeft")}};var p1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Q,z){if(!Q)return;if(T(Q)){if(Q=p1[Q]||Q,arguments.length<2)return this[0]&&this[0][Q];return this.each(function(K,C){C[Q]=z})}for(var B in Q)this.prop(B,Q[B]);return this},w.removeProp=function(Q){return this.each(function(z,B){delete B[p1[Q]||Q]})};var r5=/^--/;function F1(Q){return r5.test(Q)}var I1={},n5=q.style,a5=["webkit","moz","ms"];function t5(Q,z){if(z===void 0)z=F1(Q);if(z)return Q;if(!I1[Q]){var B=L1(Q),K="".concat(B[0].toUpperCase()).concat(B.slice(1)),C="".concat(B," ").concat(a5.join("".concat(K," "))).concat(K).split(" ");L(C,function(E,y){if(y in n5)return I1[Q]=y,!1})}return I1[Q]}var e5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function s1(Q,z,B){if(B===void 0)B=F1(Q);return!B&&!e5[Q]&&R(z)?"".concat(z,"px"):z}function J6(Q,z){if(T(Q)){var B=F1(Q);if(Q=t5(Q,B),arguments.length<2)return this[0]&&p(this[0],Q,B);if(!Q)return this;return z=s1(Q,z,B),this.each(function(C,E){if(!S(E))return;if(B)E.style.setProperty(Q,z);else E.style[Q]=z})}for(var K in Q)this.css(K,Q[K]);return this}w.css=J6;function o1(Q,z){try{return Q(z)}catch(B){return z}}var Z6=/^\s+|\s+$/;function l1(Q,z){var B=Q.dataset[z]||Q.dataset[L1(z)];if(Z6.test(B))return B;return o1(JSON.parse,B)}function Q6(Q,z,B){B=o1(JSON.stringify,B),Q.dataset[L1(z)]=B}function W6(Q,z){if(!Q){if(!this[0])return;var B={};for(var K in this[0].dataset)B[K]=l1(this[0],K);return B}if(T(Q)){if(arguments.length<2)return this[0]&&l1(this[0],Q);if($(z))return this;return this.each(function(C,E){Q6(E,Q,z)})}for(var K in Q)this.data(K,Q[K]);return this}w.data=W6;function r1(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)])}L([!0,!1],function(Q,z){L(["Width","Height"],function(B,K){var C="".concat(z?"outer":"inner").concat(K);w[C]=function(E){if(!this[0])return;if(P(this[0]))return z?this[0]["inner".concat(K)]:this[0].document.documentElement["client".concat(K)];if(F(this[0]))return r1(this[0],K);return this[0]["".concat(z?"offset":"client").concat(K)]+(E&&z?s(this[0],"margin".concat(B?"Top":"Left"))+s(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),L(["Width","Height"],function(Q,z){var B=z.toLowerCase();w[B]=function(K){if(!this[0])return $(K)?void 0:this;if(!arguments.length){if(P(this[0]))return this[0].document.documentElement["client".concat(z)];if(F(this[0]))return r1(this[0],z);return this[0].getBoundingClientRect()[B]-l(this[0],!Q)}var C=parseInt(K,10);return this.each(function(E,y){if(!S(y))return;var o=p(y,"boxSizing");y.style[B]=s1(B,C+(o==="border-box"?l(y,!Q):0))})}});var n1="___cd";w.toggle=function(Q){return this.each(function(z,B){if(!S(B))return;var K=x0(B),C=$(Q)?K:Q;if(C){if(B.style.display=B[n1]||"",x0(B))B.style.display=L0(B.tagName)}else if(!K)B[n1]=p(B,"display"),B.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var a1="___ce",V1=".",C1={focus:"focusin",blur:"focusout"},t1={mouseenter:"mouseover",mouseleave:"mouseout"},H6=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function N1(Q){return t1[Q]||C1[Q]||Q}function P1(Q){var z=Q.split(V1);return[z[0],z.slice(1).sort()]}w.trigger=function(Q,z){if(T(Q)){var B=P1(Q),K=B[0],C=B[1],E=N1(K);if(!E)return this;var y=H6.test(E)?"MouseEvents":"HTMLEvents";Q=J.createEvent(y),Q.initEvent(E,!0,!0),Q.namespace=C.join(V1),Q.___ot=K}Q.___td=z;var o=Q.___ot in C1;return this.each(function(j0,q0){if(o&&h(q0[Q.___ot]))q0["___i".concat(Q.type)]=!0,q0[Q.___ot](),q0["___i".concat(Q.type)]=!1;q0.dispatchEvent(Q)})};function e1(Q){return Q[a1]=Q[a1]||{}}function X6(Q,z,B,K,C){var E=e1(Q);E[z]=E[z]||[],E[z].push([B,K,C]),Q.addEventListener(z,C)}function J5(Q,z){return!z||!H0.call(z,function(B){return Q.indexOf(B)<0})}function s0(Q,z,B,K,C){var E=e1(Q);if(!z)for(z in E)s0(Q,z,B,K,C);else if(E[z])E[z]=E[z].filter(function(y){var o=y[0],j0=y[1],q0=y[2];if(C&&q0.guid!==C.guid||!J5(o,B)||K&&K!==j0)return!0;Q.removeEventListener(z,q0)})}w.off=function(Q,z,B){var K=this;if($(Q))this.each(function(E,y){if(!S(y)&&!F(y)&&!P(y))return;s0(y)});else if(!T(Q))for(var C in Q)this.off(C,Q[C]);else{if(h(z))B=z,z="";L(g(Q),function(E,y){var o=P1(y),j0=o[0],q0=o[1],w0=N1(j0);K.each(function(T0,O0){if(!S(O0)&&!F(O0)&&!P(O0))return;s0(O0,w0,q0,z,B)})})}return this},w.remove=function(Q){return R0(this,Q).detach().off(),this},w.replaceWith=function(Q){return this.before(Q).remove()},w.replaceAll=function(Q){return j(Q).replaceWith(this),this};function q6(Q,z,B,K,C){var E=this;if(!T(Q)){for(var y in Q)this.on(y,z,B,Q[y],C);return this}if(!T(z))if($(z)||k(z))z="";else if($(B))B=z,z="";else K=B,B=z,z="";if(!h(K))K=B,B=void 0;if(!K)return this;return L(g(Q),function(o,j0){var q0=P1(j0),w0=q0[0],T0=q0[1],O0=N1(w0),o0=w0 in t1,$1=w0 in C1;if(!O0)return;E.each(function(R1,M0){if(!S(M0)&&!F(M0)&&!P(M0))return;var E1=function(z0){if(z0.target["___i".concat(z0.type)])return z0.stopImmediatePropagation();if(z0.namespace&&!J5(T0,z0.namespace.split(V1)))return;if(!z&&($1&&(z0.target!==M0||z0.___ot===O0)||o0&&z0.relatedTarget&&M0.contains(z0.relatedTarget)))return;var A1=M0;if(z){var k0=z0.target;while(!m1(k0,z)){if(k0===M0)return;if(k0=k0.parentNode,!k0)return}A1=k0}Object.defineProperty(z0,"currentTarget",{configurable:!0,get:function(){return A1}}),Object.defineProperty(z0,"delegateTarget",{configurable:!0,get:function(){return M0}}),Object.defineProperty(z0,"data",{configurable:!0,get:function(){return B}});var M6=K.call(A1,z0,z0.___td);if(C)s0(M0,O0,T0,z,E1);if(M6===!1)z0.preventDefault(),z0.stopPropagation()};E1.guid=K.guid=K.guid||j.guid++,X6(M0,O0,T0,z,E1)})}),this}w.on=q6;function z6(Q,z,B,K){return this.on(Q,z,B,K,!0)}w.one=z6;var B6=/\r?\n/g;function G6(Q,z){return"&".concat(encodeURIComponent(Q),"=").concat(encodeURIComponent(z.replace(B6,"\r\n")))}var w6=/file|reset|submit|button|image/i,Z5=/radio|checkbox/i;if(w.serialize=function(){var Q="";return this.each(function(z,B){L(B.elements||[B],function(K,C){if(C.disabled||!C.name||C.tagName==="FIELDSET"||w6.test(C.type)||Z5.test(C.type)&&!C.checked)return;var E=c1(C);if(!$(E)){var y=M(E)?E:[E];L(y,function(o,j0){Q+=G6(C.name,j0)})}})}),Q.slice(1)},typeof W5!=="undefined")H5.exports=j;else Z.cash=Z.$=j})()});class l0{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 H=this.callbacks.get(Z);if(H)H()}catch(H){console.error(`Error updating component ${Z}:`,H)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class r0{subscriptions=new Map;tick=new l0;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 H=this,X=new WeakMap,q=(G)=>{if(typeof G.toJSON==="function")return G;if(G instanceof Map)G.forEach((M,U)=>G.set(U,W(M)));else if(Array.isArray(G))G.forEach((M,U)=>G[U]=W(M));else if(typeof G==="object")Object.entries(G).forEach(([M,U])=>G[M]=W(U));let Y=new Proxy(G,{get(M,U){if(U==="toJSON")return function(){const N=(b)=>{if(!b||typeof b!=="object")return b;if(X.has(b)){const i=X.get(b);if(i instanceof Map){const r={};return i.forEach((H0,t)=>r[typeof t==="object"?JSON.stringify(t):String(t)]=N(H0)),r}if(Array.isArray(i))return i.map((r)=>N(r));const e={};return Object.entries(i).forEach(([r,H0])=>e[r]=N(H0)),e}if(typeof b.toJSON==="function"&&!X.has(b))return b.toJSON();return b};return N(Y)};if(U==="reset")return function(){Y=null};const D=M[U];if(G instanceof Map&&typeof D==="function")return function(...N){const b=U.toString();if(b==="set"&&N.length>=2)N[1]=W(N[1]);const i=D.apply(M,N);return["set","delete","clear"].includes(b)&&H.queueUpdate(J),i};if(Array.isArray(G)&&typeof D==="function")return function(...N){const b=U.toString();if(["push","unshift"].includes(b))N=N.map((e)=>W(e));else if(b==="splice"&&N.length>2)N=[N[0],N[1],...N.slice(2).map((e)=>W(e))];const i=D.apply(M,N);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(b)&&H.queueUpdate(J),i};return D},set(M,U,D){if(M[U]===D)return!0;if(D instanceof Map&&M[U]instanceof Map){const N=M[U];return N.clear(),D.forEach((b,i)=>N.set(i,W(b))),H.queueUpdate(J),!0}return M[U]=W(D),H.queueUpdate(J),!0}});return X.set(Y,G),Y},W=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Z)}}class n0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Z)=>{try{const H=Z.node;if(!H){this.unwatch(Z);return}if(J.type==="attach"&&document.contains(H[0]))this.unwatch(Z),Z.emit("component:attached"),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();else if(J.type==="detach"&&!document.contains(H[0]))this.unwatch(Z),Z.emit("component:detached"),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)()}catch(H){console.log("DWS error --",H)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Z="attach"){const H=J.node;if(!H)return;if(Z==="attach"&&document.contains(H[0])){J.emit("component:attached"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Z==="detach"&&!document.contains(H[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const X=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Z}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:X,type:Z}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Z==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Z=this.observedComponents.get(J);if(Z)clearTimeout(Z.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}var a0=function(J,Z){if(!Z)return J;return J.replace(/{(\w+)}/g,(H,X)=>{return Z[X]!==void 0?Z[X].toString():`{${X}}`})},Q5=(J,Z,H,X,q)=>{switch(J){case"plural":{if(typeof H==="string"){console.warn("Plural format value cannot be a string");return}if(X.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let Y=H["*"];if(typeof Y==="object")Y=Y[q||"*"];return a0(Y,X)}if(typeof X.count==="string")X.count=Number(X.count);let W="*";if(X.count.toString()in H)W=X.count.toString();let G=H[W]||H["*"];if(typeof G==="object")G=G[q||"*"];return a0(G,X)}case"condition":{if(typeof H==="string"){console.warn("Condition format value cannot be a string");return}let W;for(let G in H)try{if(new Function("params",`with( params ){ return ${G}; }`)(X||{})){W=H[G];break}}catch(Y){console.warn(`Invalid <${Z}(${G})> condition expression`)}if(W===void 0)return;if(typeof W==="object")W=W[q||"*"];return a0(W,X)}case"variable":default:{const W=typeof H==="object"?H[q||"*"]:H;if(typeof W==="object"){console.warn(`Invalid <${Z}> variable variant definition`);return}return a0(W,X)}}};class t0{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[H,X]=Z.split("-");if(this.DICTIONARIES[H]&&J in this.DICTIONARIES[H]){if(typeof this.DICTIONARIES[H][J]==="object"){const q=this.DICTIONARIES[H][J];J=q[X||"*"]||q["*"]}else if(typeof this.DICTIONARIES[H][J]==="string")J=this.DICTIONARIES[H][J]}return{text:J,lang:Z}}format(J,Z,H){H=H||this.currentLang;const[X,q]=H.split("-");if(!this.DICTIONARIES[X]){console.warn(`Undefined <${H}> format dictionary`);return}if(!this.DICTIONARIES[X][J]){console.warn(`Undefined <${H}[${J}]> format reference`);return}const W=this.DICTIONARIES[X][J];if(typeof W==="string"){console.warn(`Invalid <${H}[${J}]> format reference. Expected object`);return}if(typeof W!=="object"||W===null||Array.isArray(W)){console.warn(`Invalid <${H}[${J}]> format value`);return}return Q5(W.type,J,W.value,Z,q)}}var P5=S1(e0(),1);var J1="comm",Z1="rule",Q1="decl";var X5="@import";var q5="@namespace",z5="@keyframes";var B5="@layer";function W1(J){return J.trim()}function f0(J,Z,H){return J.replace(Z,H)}function G5(J,Z,H){return J.indexOf(Z,H)}function V0(J,Z){return J.charCodeAt(Z)|0}function C0(J,Z,H){return J.slice(Z,H)}function G0(J){return J.length}function H1(J){return J.length}function _0(J,Z){return Z.push(J),J}var b1=Math.abs,d0=String.fromCharCode;function q1(J,Z,H,X,q,W,G,Y){return{value:J,root:Z,parent:H,type:X,props:q,children:W,line:X1,column:h0,length:G,return:"",siblings:Y}}function M5(){return X0}function Y5(){if(X0=U0>0?V0(v0,--U0):0,h0--,X0===10)h0=1,X1--;return X0}function K0(){if(X0=U0<w5?V0(v0,U0++):0,h0++,X0===10)h0=1,X1++;return X0}function N0(){return V0(v0,U0)}function i0(){return U0}function z1(J,Z){return C0(v0,J,Z)}function y0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U5(J){return X1=h0=1,w5=G0(v0=J),U0=0,[]}function K5(J){return v0="",J}function B1(J){return W1(z1(U0-1,g1(J===91?J+2:J===40?J+1:J)))}function j5(J){while(X0=N0())if(X0<33)K0();else break;return y0(J)>2||y0(X0)>3?"":" "}function O5(J,Z){while(--Z&&K0())if(X0<48||X0>102||X0>57&&X0<65||X0>70&&X0<97)break;return z1(J,i0()+(Z<6&&N0()==32&&K0()==32))}function g1(J){while(K0())switch(X0){case J:return U0;case 34:case 39:if(J!==34&&J!==39)g1(X0);break;case 40:if(J===41)g1(J);break;case 92:K0();break}return U0}function D5(J,Z){while(K0())if(J+X0===57)break;else if(J+X0===84&&N0()===47)break;return"/*"+z1(Z,U0-1)+"*"+d0(J===47?J:K0())}function L5(J){while(!y0(N0()))K0();return z1(J,U0)}var X1=1,h0=1,w5=0,U0=0,X0=0,v0="";function V5(J){return K5(G1("",null,null,null,[""],J=U5(J),0,[0],J))}function G1(J,Z,H,X,q,W,G,Y,M){var U=0,D=0,N=G,b=0,i=0,e=0,r=1,H0=1,t=1,J0=0,d="",_=q,u=W,v=X,A=d;while(H0)switch(e=J0,J0=K0()){case 40:if(e!=108&&V0(A,N-1)==58){if(G5(A+=f0(B1(J0),"&","&\f"),"&\f",b1(U?Y[U-1]:0))!=-1)t=-1;break}case 34:case 39:case 91:A+=B1(J0);break;case 9:case 10:case 13:case 32:A+=j5(e);break;case 92:A+=O5(i0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(_0(L6(D5(K0(),i0()),Z,H,M),M),(y0(e||1)==5||y0(N0()||1)==5)&&G0(A)&&C0(A,-1,void 0)!==" ")A+=" ";break;default:A+="/"}break;case 123*r:Y[U++]=G0(A)*t;case 125*r:case 59:case 0:switch(J0){case 0:case 125:H0=0;case 59+D:if(t==-1)A=f0(A,/\f/g,"");if(i>0&&(G0(A)-N||r===0&&e===47))_0(i>32?I5(A+";",X,H,N-1,M):I5(f0(A," ","")+";",X,H,N-2,M),M);break;case 59:A+=";";default:if(_0(v=F5(A,Z,H,U,D,q,Y,d,_=[],u=[],N,W),W),J0===123)if(D===0)G1(A,Z,v,v,_,W,N,Y,u);else{switch(b){case 99:if(V0(A,3)===110)break;case 108:if(V0(A,2)===97)break;default:D=0;case 100:case 109:case 115:}if(D)G1(J,v,v,X&&_0(F5(J,v,v,0,0,q,Y,d,q,_=[],N,u),u),q,u,N,Y,X?_:u);else G1(A,v,v,v,[""],u,0,Y,u)}}U=D=i=0,r=t=1,d=A="",N=G;break;case 58:N=1+G0(A),i=e;default:if(r<1){if(J0==123)--r;else if(J0==125&&r++==0&&Y5()==125)continue}switch(A+=d0(J0),J0*r){case 38:t=D>0?1:(A+="\f",-1);break;case 44:Y[U++]=(G0(A)-1)*t,t=1;break;case 64:if(N0()===45)A+=B1(K0());b=N0(),D=N=G0(d=A+=L5(i0())),J0++;break;case 45:if(e===45&&G0(A)==2)r=0}}return W}function F5(J,Z,H,X,q,W,G,Y,M,U,D,N){var b=q-1,i=q===0?W:[""],e=H1(i);for(var r=0,H0=0,t=0;r<X;++r)for(var J0=0,d=C0(J,b+1,b=b1(H0=G[r])),_=J;J0<e;++J0)if(_=W1(H0>0?i[J0]+" "+d:f0(d,/&\f/g,i[J0])))M[t++]=_;return q1(J,Z,H,q===0?Z1:Y,M,U,D,N)}function L6(J,Z,H,X){return q1(J,Z,H,J1,d0(M5()),C0(J,2,-2),0,X)}function I5(J,Z,H,X,q){return q1(J,Z,H,Q1,C0(J,0,X),C0(J,X+1,-1),X,q)}function w1(J,Z){var H="";for(var X=0;X<J.length;X++)H+=Z(J[X],X,J,Z)||"";return H}function C5(J,Z,H,X){switch(J.type){case B5:if(J.children.length)break;case X5:case q5:case Q1:return J.return=J.return||J.value;case J1:return"";case z5:return J.return=J.value+"{"+w1(J.children,X)+"}";case Z1:if(!G0(J.value=J.props.join(",")))return""}return G0(H=w1(J.children,X))?J.return=J.value+"{"+H+"}":""}function N5(J){var Z=H1(J);return function(H,X,q,W){var G="";for(var Y=0;Y<Z;Y++)G+=J[Y](H,X,q,W)||"";return G}}class u0{nsp;settings;$head;constructor(J,Z){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=P5.default("head"),this.settings=Z||{},this.settings&&this.load(this.settings)}compile(J){try{return w1(V5(J),N5([C5]))}catch(Z){throw new Error(`Style compilation failed: ${Z.message}`)}}waitForStyles(J){return new Promise((Z)=>{const H=new MutationObserver(()=>{const X=document.querySelector(J);if(X&&getComputedStyle(X).cssText)H.disconnect(),Z()});H.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 H=this.compile(J);if(!H)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const X=document.createElement("style");X.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),X.textContent=H;let q=0;const W=this.$head.find(`style[${Z}]`);if(W.length)q=parseInt(W.attr("dindex"))+1,W.remove();return X.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(X):document.head.appendChild(X),X}catch(H){throw new Error(`Style injection failed: ${H.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 M1{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},H="batch-updator"){try{const X=this.component.FGUD.get(J)?.get(Z);if(!X){console.warn(`[batch update]: <${Z}> dependency not found`);return}if(X.garbage){this.component.FGUD.get(J)?.delete(Z),!this.component.FGUD.get(J)?.size&&this.component.FGUD.delete(J);return}const q=this.component.FGUDMemory.get(X.nodepath);if(!q)return;const W=X.update(q.memo||{},H);if(W){if(typeof W.memo==="object")q.memo=W.memo;typeof W.cleanup==="function"&&W.cleanup()}}catch(X){console.error("Failed to update dependency --",X)}}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=new Map;this.pending.forEach((X,q)=>J.set(q,new Set(X))),this.pending.clear(),this.isPending=!1;const Z=(X)=>{const q=Array.from(X);this.component.metrics.trackBatch(q.length),this.metrics.batchCount++,this.metrics.lastBatchSize=q.length,this.metrics.updatesProcessed+=q.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),q.forEach((W)=>this.apply(W))},H=Array.from(J.keys()).sort((X,q)=>X-q);for(let X of H){const q=J.get(X);q&&q.size&&Z(q)}if(this.pending.size>0&&!this.isPending)this.isPending=!0,this.scheduleProcessing()}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class Y1{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 H=(q)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(H);if(typeof q==="object")for(let W in q)q[W]=H(q[W]);return q},X=Z.map(H);this.__events[J]?.forEach((q)=>q(...X)),this.__once_events[J]?.forEach((q)=>q(...X)),delete this.__once_events[J]}}var x1=S1(e0(),1);function B0(J,Z){if(J===Z)return!1;if(typeof J!=="object"||typeof Z!=="object")return!1;if(J===null||Z===null)return!0;if(J instanceof Set){if(!(Z instanceof Set))return!0;if(J.size!==Z.size)return!0;if($5(J)&&$5(Z)){for(let G of J)if(!Z.has(G))return!0;return!1}const W=new WeakMap;for(let G of J){let Y=!1;if(typeof G!=="object"){if(Z.has(G))Y=!0}else for(let M of Z){if(typeof M!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const U=W.get(G);if(U.has(M)){if(Y=U.get(M),Y)break;continue}const D=!B0(G,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(R5(J)&&R5(Z)){for(let[G,Y]of J)if(Z.get(G)!==Y)return!0;return!1}const W=new WeakMap;for(let[G,Y]of J){if(typeof G!=="object"){if(!Z.has(G))return!0;const D=Z.get(G);if(typeof Y!=="object"){if(Y!==D)return!0;continue}if(typeof D!=="object"||B0(Y,D))return!0;continue}let M=!1,U=!1;for(let[D,N]of Z){if(typeof D!=="object")continue;if(!W.has(G))W.set(G,new WeakMap);const b=W.get(G);if(b.has(D)){const[i,e]=b.get(D);if(i){M=!0,U=e;break}continue}if(!B0(G,D)){if(M=!0,U=typeof Y==="object"&&typeof N==="object"?!B0(Y,N):Y===N,b.set(D,[!0,U]),U)break}else b.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 W=0;W<J.length;W++){const G=J[W],Y=Z[W];if(G!==Y&&(typeof G!=="object"||B0(G,Y)))return!0}return!1}const H=Object.keys(J),X=Object.keys(Z);if(H.length!==X.length)return!0;H.sort(),X.sort();const q=H.length;for(let W=0;W<q;W++)if(H[W]!==X[W])return!0;for(let W=0;W<q;W++){const G=H[W],Y=J[G],M=Z[G];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)||B0(Y,M))return!0;continue}if(Y instanceof Set){if(!(M instanceof Set)||B0(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(B0(Y,M))return!0}else return!0}return!1}function P0(J,Z){if(J===Z)return!0;if(J==null||Z==null)return J===Z;const H=typeof J;if(H!==typeof Z)return!1;if(H!=="object"){if(H==="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!B0(J,Z);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Z))return!1;const W=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Z);if(W.length!==G.length)return!1;for(let Y of W){if(!Object.prototype.hasOwnProperty.call(Z,Y))return!1;if(!P0(J[Y],Z[Y]))return!1}if(q!==null&&q!==Object.prototype){const Y=Object.getOwnPropertyNames(q),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Z));if(Y.length!==M.length)return!1;for(let U of Y){if(U==="constructor")continue;if(!P0(q[U],Object.getPrototypeOf(Z)[U]))return!1}}return!0}function $5(J){for(let Z of J)if(typeof Z==="object"&&Z!==null)return!1;return!0}function R5(J){for(let[Z,H]of J)if(typeof Z==="object"&&Z!==null||typeof H==="object"&&H!==null)return!1;return!0}function W0(J,Z=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Z.has(J))return Z.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const q=new Map;return Z.set(J,q),J.forEach((W,G)=>q.set(W0(G,Z),W0(W,Z))),q}if(J instanceof Set){const q=new Set;return Z.set(J,q),J.forEach((W)=>q.add(W0(W,Z))),q}if(Array.isArray(J)){const q=[];Z.set(J,q);for(let W=0;W<J.length;W++)q[W]=W0(J[W],Z);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const H=Object.create(Object.getPrototypeOf(J));Z.set(J,H);const X=Object.getOwnPropertySymbols(J);for(let q of X)H[q]=W0(J[q],Z);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))H[q]=W0(J[q],Z);return H}function k5(J,Z){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Z||typeof Z!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Z).length)return{...J};function H(q,W,G){const Y=W.split(/\.|\[|\]/).filter(Boolean);let M=q;for(let U=0;U<Y.length;U++){const D=Y[U],N=!isNaN(Number(D)),b=U===Y.length-1,i=!isNaN(Number(Y[U+1]));if(b){M[D]=G;continue}if(!(D in M))M[D]=i?[]:{};else if(i&&!Array.isArray(M[D]))M[D]=[];else if(!i&&Array.isArray(M[D]))M[D]={};M=M[D]}}const X=W0(J);try{for(let[q,W]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}`);H(X,q,W)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return X}function f5(J){return JSON.parse(JSON.stringify(J))}var A0="i18n",$0="syn:",D0="fn:",S0="on-",Y0=/^\.\.\./,U1=/^\[(.*?)\]$/,k1=/{\s*([^{}]+)\s*}/g,E5=["@html","@text","@format"],A5=["display","visibility","position","width","height"],K1=":r",T5=":n",S5="m",b5="c",g5="x",x5=100;x1.default.fn.extend({attrs:function(){const J={},Z=this[0];return Z&&Z.nodeType!==Node.TEXT_NODE&&x1.default.each(Z.attributes,function(){J[this.name]=this.value}),J}});class j1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,i18nTrackCount:0,i18nUpdateCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Z,H)=>Z+H,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Z){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Z}add(J,Z){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Z}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=W0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Z={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},H={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},X={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},W={"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(H),console.table(X),console.table(q),console.table(W),console.table(G),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return W0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var Z0=S1(e0(),1);var F6=function(J){const Z=/on-([a-zA-Z-]+)\s*\(/g;let H=J,X;while((X=Z.exec(J))!==null){const q=X[1],W=X.index+X[0].length;let G=1,Y=W;while(Y<J.length&&G>0){if(J[Y]==="(")G++;if(J[Y]===")")G--;Y++}if(G===0){const M=J.slice(W,Y-1).trim(),U=J.slice(0,X.index),D=`${S0}${q}="${M}"`,N=J.slice(Y);H=U+D+N,J=H,Z.lastIndex=U.length+D.length}}return H},I6=function(J){const Z=[];let X=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,W,G)=>{return Z.push(G),`<${W}##TAG_ATTRS_${Z.length-1}##>`});for(let q=0;q<Z.length;q++){const W=`##TAG_ATTRS_${q}##`,G=Z[q],Y=V6(G);X=X.replace(W,Y)}return X},V6=function(J){let Z="",H=0,X=!1,q="",W=0,G=0,Y=0;while(H<J.length){const M=J[H];if((M==='"'||M==="'")&&(H===0||J[H-1]!=="\\")){if(!X)X=!0,q=M;else if(M===q)X=!1}if(!X){if(M==="(")G++;else if(M===")")G--;else if(M==="{")Y++;else if(M==="}")Y--}if(!X&&G===0&&Y===0&&(M===" "||H===J.length-1)){let U=H;if(H===J.length-1)U=H+1;const D=J.substring(W,U).trim();if(D){const N=C6(D);Z+=" "+N}W=H+1}H++}return Z},C6=function(J){const Z=J.indexOf("=");if(Z===-1){if(J===A0||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let H=J.substring(0,Z).trim(),X=J.substring(Z+1).trim();if(H.startsWith("@"))return H=!E5.includes(H)?H.slice(1):H,`:${H}=${X}`;if(H.startsWith(D0)||H.startsWith(S0))return J;if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'")){const q=X.substring(1,X.length-1);if(N6(q))return`:${H}="${q}"`;return J}else return`:${H}="${X}"`};function N6(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 f1(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,(H,X,q)=>{return q.endsWith("<")?`<lips dtag="${X}" ${q}/lips>`:`<lips dtag="${X}" ${q}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${D0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(H)=>H.replace(/\s+/g,""));return Z=F6(Z),Z=I6(Z),Z}var P6=function(J,Z){if(J.isDisposed)return;Z.add(J),J.dependencies.add(Z)},h5=function(J){for(let Z of J.dependencies)Z.delete(J);J.dependencies.clear()};function b0(J,Z={maxSize:100}){const H=new Set,X=[{value:J,timestamp:Date.now()}];let q=0;const W=()=>{const U=O1[O1.length-1];return U&&P6(U,H),X[q].value},G=()=>{const U=[...H];if(_5)for(let D of U)_5.add(D);else for(let D of U)D.execute()};return[W,(U,D)=>{if(Object.is(X[q].value,U))return;if(q<X.length-1)X.splice(q+1);if(X.push({value:U,timestamp:Date.now(),metadata:D}),X.length>Z.maxSize)X.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<X.length-1)q++,G()},jumpTo(U){if(U>=0&&U<X.length&&U!==q)q=U,G()},getHistory(){return[...X]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<X.length-1},clear(){const U=X[0];X.length=0,X.push(U),q=0,G()}}]}function c0(J){let Z=!1;const H=()=>{if(Z)throw new Error("Circular dependency detected");if(X.isDisposed)return;Z=!0,h5(X),O1.push(X);try{J()}finally{Z=!1,O1.pop()}},X={execute:H,dependencies:new Set,isDisposed:!1};return H(),{dispose:()=>{X.isDisposed=!0,h5(X)}}}var O1=[],_5=null;class g0 extends Y1{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:H,state:X,context:q,_static:W,handler:G,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__=f1(Z),this.__boundaries__=D.boundaries,this.declaration=U||{name:J},this.input=H||{},this.static=W||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,X||{}),M&&this.setMacros(M),G&&this.setHandler(G),Y&&this.setStylesheet(Y),this.metrics=new j1(this.debug),this.metrics.inc("componentCount"),this.UQS=new M1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(),this.emit("component:input");this.__previous={state:W0(this.state),input:W0(this.input),context:W0(this.context)};const[N,b]=b0(this.input),[i,e]=b0(this.state),[r,H0]=b0(this.context);this.__setInput=b,this.__setState=e,this.__getState=i,this.lips.IUC.register(this.__path__,()=>{B0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(t)=>{if(!B0(this.context,t))return;H0(t),this.context=t,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(t)=>{if(t===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=t}),this.ICE=c0(()=>{const t=i(),J0=this.input=N(),d=this.context=r();if(!this.isRendered){if(this.metrics.reset(),!this.__template__.length||U?.syntax&&typeof this.onSelfRender=="function"){const _=this.onSelfRender.bind(this)(this.input);if(!this.__boundaries__?.start||!this.__boundaries__?.end)throw new Error(`Undefined <${this.__name__} syntax component boundaries`);this.$=_||Z0.default()}else{const{$log:_}=this.render("",void 0,void 0,this.FGUD);this.$=_}!U?.syntax&&this.$?.each((_,u)=>{typeof u.setAttribute=="function"&&u.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__(),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:W0(J0),state:W0(t),context:W0(d)};typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Z){this.lips.setContext(J,Z)}setInput(J,Z){if(!B0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(this.declaration.syntax?Z:void 0)}subInput(J,Z){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(k5(this.input,J),this.declaration.syntax?Z:void 0),this}setMacros(J){const Z=f1(J),H=Z0.default(Z);if(!H.length)return;const X=this;H.each(function(){const q=Z0.default(this),{argv:W,attrs:G}=X.__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(X.__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.");X.__macros.set(G.literals.name,{argv:W,$node:q})})}setHandler(J){Object.entries(J).map(([Z,H])=>this[Z]=H?.bind(this))}setStylesheet(J){const Z={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new u0(this.__name__,Z)}get node(){if(!this.isRendered)throw new Error("node() is expected to be call after component get rendered");return this.$}get boundaries(){return this.__boundaries__}render(J,Z,H={},X,q){if(Z&&!Z.length)return console.warn("Undefined node element to render"),{$log:Z,dependencies:X||new Map};const W=this,G=X||new Map,Y=[];this.metrics.startRender();let M=Z0.default();function U(){return W0(H)}function D(w,j=!1){const O=N(w,j);return W.__inpathCounter__++,W.__inpath__?`${W.__inpath__}/${O}`:`${J?J+"/":""}${O}`}function N(w,j=!1){let O="";switch(w){case"component":O=j?g5:b5;break;case"macro":O=S5;break}return O+W.__inpathCounter__}function b(w){return w!==null&&typeof w==="object"&&typeof w.mesh==="function"&&typeof w.update==="function"}function i(w){return w!==null&&typeof w==="object"&&typeof w.default&&typeof w.default==="string"}function e(w){if(!w.attr(":dtag")||w.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const j=w.attr(":dtag"),O=W.__evaluate__(j,H);if(b(O)||O===null)return J0(w,j,O);else if(i(O))return d(w,{template:O});else return d(w,{name:O})}function r(w){const j=w.attr(":args"),O=D("log");if(!j)return;const P=U();if(W.__evaluate__(`console.log(${j})`,P),W.__isReactive__(j,P))W.__extractExpressionDeps__(j,P).forEach((V)=>W.__trackDep__(G,V,P,{nodetype:"log",nodepath:O,target:"argument",$fragment:null,update:(S)=>W.__evaluate__(`console.log(${j})`,S),syntax:!0}))}function H0(w){const j=D("var"),{attrs:O}=W.__getAttributes__(w);if(!O)return;Object.entries(O.literals).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);H[P]={value:F,type:"let"}}),Object.entries(O.expressions).forEach(([P,F])=>{if(H[P]&&H[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(H[P]={value:W.__evaluate__(F,H),type:"let"},W.__isReactive__(F,H)){const V=W.__extractExpressionDeps__(F,H),S=(m,c)=>{if(m[P]&&m[P].type==="const")throw new Error(`Cannot override <const ${P}=[value]/> variable`);if(O.map.beforeSpreadAttrs.includes(P))return;const h=W.__evaluate__(F,m);if(P0(m[P].value,h))return;return m[P]={value:h,type:"let"},W.__updateVarDepNodes__(P,j,m),f5({memo:m})};V.forEach((m)=>W.__trackDep__(G,m,U(),{nodetype:"let",nodepath:j,deppath:`${j}.${P}`,target:"attr",$fragment:null,update:S,syntax:!0}))}}),W.metrics.inc("elementCount")}function t(w){const{attrs:j}=W.__getAttributes__(w);if(!j)return;Object.entries(j.literals).forEach(([O,P])=>{if(H[O]&&H[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!P)return;H[O]={value:P,type:"const"}}),Object.entries(j.expressions).forEach(([O,P])=>{if(H[O]&&H[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!P)return;H[O]={value:W.__evaluate__(P,H),type:"const"}}),W.metrics.inc("elementCount")}function J0(w,j,O){const{attrs:P}=W.__getAttributes__(w),F=D("element"),V=W.__getBoundaries__(F),S={},m={};let c=U(),h=Z0.default(V.start),T={},$=O;if($){P.literals&&Object.entries(P.literals).forEach(([R,f])=>{S[R]=f,T[R]={type:"arg",value:f}}),P.expressions&&Object.entries(P.expressions).forEach(([R,f])=>{if(!$)return;if(Y0.test(R))W.__evaluateSpreadAttr__(R,{memo:c,get keystore(){return m[R]},set keystore(L){if(!m[R])m[R]=[];m[R]=L},each:(L,x)=>{if(S[L]=x,L!=="#"&&!$?.argv.includes(L))return;T[L]={type:"arg",value:x}}});else{const L=f?W.__evaluate__(f,c):!0;if(S[R]=L,R!=="#"&&!$.argv.includes(R))return;T[R]={type:"arg",value:L}}}),c.__arguments__=S;const k=$.mesh(T);if(k&&k.length)h=h.add(k);P.expressions&&Object.entries(P.expressions).forEach(([R,f])=>{if(!$)return;if(Y0.test(R)&&W.__isReactive__(R,c)){const L=W.__extractExpressionDeps__(R,c),x=(I,g)=>{if(!$)return;const a={};let n=[];if(W.__evaluateSpreadAttr__(R,{memo:I,get keystore(){return m[R]},set keystore(p){if(!m[R])m[R]=[];m[R]=p},each:(p,s)=>{if(P.map.afterSpreadAttrs.includes(p))return;if(p!=="#"&&!$?.argv.includes(p))return;if(P0(s,I[p]?.value))return;T[p]=a[p]={value:s,type:"arg"},S[p]=s,n.push(p)},nullify:(p)=>{p.forEach((s)=>{a[s]={value:void 0,type:"arg"},delete S[s]}),n=p}}),n.length)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),$.update(n,a,I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"spread-attr",$fragment:null,boundaries:V,update:x}))}else if((R==="#"||$.argv.includes(R))&&W.__isReactive__(f,c)){const L=W.__extractExpressionDeps__(f,c),x=(I,g)=>{if(!$)return;if(P.map.beforeSpreadAttrs.includes(R))return;const a=f?W.__evaluate__(f,I):!0,n={type:"arg",value:a};if(T[R]=n,$.argv.length)S[R]=a,W.__updateArgumentsDepNodes__(F,S);$.update([R],{[R]:n},I,V)};L.forEach((I)=>W.__trackDep__(G,I,c,{nodetype:"dynamic",nodepath:F,deppath:`${F}.${R}`,target:"attr",$fragment:null,boundaries:V,update:x}))}})}if(W.__isReactive__(j,c)){const k=(f,L)=>{const x=W.__evaluate__(j,f);let I;if(i(x))I=d(w,{template:x}),W.__fillBoundaries__(I,V);else if(b(x)){if("#"in T)T=T["#"].value;else Object.entries(T).forEach(([g,a])=>{if(typeof a==="function")return;S[g]=a.value});if($?.cleanup(V),$=x,$)$.argv.length&&W.__updateArgumentsDepNodes__(F,S),I=$.mesh(T),I?.length&&$.fill(I,V)}else if($)$.cleanup(V),$=null};W.__extractExpressionDeps__(j,c).forEach((f)=>W.__trackDep__(G,f,{...c,...T},{nodetype:"dynamic",nodepath:F,deppath:`${F}.dtag`,target:"dtag",$fragment:null,boundaries:V,update:k}))}return h=h.add(V.end),h}function d(w,j){let O,P;if(j?.template)O=j.template,P=N("component",O.declaration?.syntax);else{if(P=j?.name||w.prop("tagName")?.toLowerCase(),!P)throw new Error("Invalid component");if(P===W.__name__)throw new Error("Render component within itself is forbidden");O=W.lips.import(P)}if(!O||!P)throw new Error(`<${P}> template not found`);const F=D("component",O.declaration?.syntax),V=W.__getBoundaries__(F),{argv:S,functions:m,attrs:c,events:h}=W.__getAttributes__(w),T={},$={};let k={},R=Z0.default(V.start),f=W.PCC.get(F),L=U();c.literals&&Object.entries(c.literals).forEach(([I,g])=>{if(I=="key")return;k[I]=g}),m&&Object.entries(m).forEach(([I,g])=>{k[I]=W.__evaluateFunction__(g,[],L),O.declaration?.syntax?T[$0+D0+I]=g:T[D0+I]=g}),c.expressions&&Object.entries(c.expressions).forEach(([I,g])=>{if(I=="key")return;if(Y0.test(I))W.__evaluateSpreadAttr__(I,{memo:L,get keystore(){return $[I]},set keystore(a){if(!$[I])$[I]=[];$[I]=a},each:(a,n)=>k[a]=n});else k[I]=g?W.__evaluate__(g,L):!0;O.declaration?.syntax?T[$0+I]=g:T[I]=g});const x=w.contents();if(x.length){if(k={...k,...W.__meshwire__({$node:w,fragmentPath:F,fragmentBoundaries:V,meshPath:null,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)},O.declaration){if(O.declaration.tags){let I;Object.entries(O.declaration?.tags).forEach(([g,{type:a,many:n,alts:p}])=>{switch(a){case"nexted":{let s=w.next(g);if(!s.length&&Array.isArray(p)&&I?.length&&I.is(p.join(",")))s=I.next(g);if(!s.length)return;if(n){k[g]=[];let l=0,Q0=!1;while(!Q0){if(k[g].push(W.__meshwire__({$node:s,meshPath:`${g}[${l}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)),!s.next(g).length){Q0=!0;break}s=I=s.next(g),l++}}else k[g]=W.__meshwire__({$node:s,meshPath:g,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:S,xmlns:q,useAttributes:!0,declaration:O.declaration},T)}break;case"child":{const s=w.children(g);if(n)k[g]=[],s.each(function(l){const Q0=Z0.default(this),{argv:L0}=W.__getAttributes__(Q0);k[g].push(W.__meshwire__({$node:Q0,meshPath:`${g}[${l}]`,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:L0,xmlns:q,useAttributes:!0,declaration:O.declaration},T))});else if(w.children(g).first().length){const l=w.children(g).first(),{argv:Q0}=W.__getAttributes__(l);k[g]=W.__meshwire__({$node:l,meshPath:g,fragmentPath:F,fragmentBoundaries:V,scope:L,argv:Q0,xmlns:q,useAttributes:!0,declaration:O.declaration},T)}}break}})}else if(O.declaration.contents)k.__contents__=x}}if(f)f.setInput(W0(k)),R=R.add(f.node);else{const{declaration:I,state:g,_static:a,handler:n,context:p,default:s,stylesheet:l}=O;f=new g0(P,s||"",{state:W0(g),input:W0(k),context:p,_static:W0(a),handler:n,stylesheet:l,declaration:I},{debug:W.debug,lips:W.lips,prepath:F,boundaries:V}),R=R.add(f.node),!O.declaration?.syntax&&W.PCC.set(F,f)}return R=R.add(V.end),Object.entries(h).forEach(([I,g])=>{W.__attachEvent__({nodepath:F,element:f,_event:I,instruction:g,scope:L,get __dependencies__(){return G}})}),T&&Object.entries(T).forEach(([I,g])=>{let a=!1,n=!1;if(I.startsWith($0))a=!0,I=I.replace($0,"");if(I.startsWith(D0))n=!0,I=I.replace(D0,"");if(Y0.test(I)){if(W.__isReactive__(I,L)){const p=(l)=>{const Q0={};W.__evaluateSpreadAttr__(I,{memo:l,get keystore(){return $[I]},set keystore(L0){if(!$[I])$[I]=[];$[I]=L0},each:(L0,x0)=>{if(c.map.afterSpreadAttrs.includes(L0))return;Q0[L0]=x0},nullify:(L0)=>L0.forEach((x0)=>Q0[x0]=void 0)}),f?.subInput(Q0,l)};W.__extractExpressionDeps__(I,L).forEach((l)=>W.__trackDep__(G,l,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"spread-attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}else if(W.__isReactive__(g,L)){const p=(l)=>{if(c.map.beforeSpreadAttrs.includes(I))return;const Q0=n?W.__evaluateFunction__(g,[],l):g?W.__evaluate__(g,l):!0;f?.subInput({[I]:Q0},l)};W.__extractExpressionDeps__(g,L).forEach((l)=>W.__trackDep__(G,l,L,{nodetype:"component",nodepath:F,deppath:`${F}.${I}`,target:"attr",$fragment:null,boundaries:V,update:p,syntax:a}))}}),W.metrics.inc("componentCount"),R}function _(w){const j=w.prop("tagName")?.toLowerCase();if(!j)throw new Error("Invalid macro rendering call");const O=W.__macros.get(j);if(!O)throw new Error("Macro component not found");const P=D("macro"),F=W.__getBoundaries__(P),{attrs:V}=W.__getAttributes__(w),S={},m=U(),c={},h={};V.literals&&Object.entries(V.literals).forEach(([L,x])=>{c[L]=x,h[L]={value:x,type:"arg"}});const T={};V.expressions&&Object.entries(V.expressions).forEach(([L,x])=>{if(Y0.test(L))W.__evaluateSpreadAttr__(L,{memo:m,get keystore(){return T[L]},set keystore(I){if(!T[L])T[L]=[];T[L]=I},each:(I,g)=>{if(c[I]=g,O.argv.includes(I))h[I]={value:g,type:"arg"}}}),S[L]=x;else{const I=x?W.__evaluate__(x,m):!0;if(c[L]=I,O.argv.includes(L))h[L]={value:I,type:"arg"},S[L]=x}O.argv.forEach((I)=>{if(h[I]!==void 0)return;h[I]={value:!1,type:"arg"}})}),h.__arguments__=c;let $=Z0.default(F.start);const k={$node:O.$node,meshPath:null,fragmentPath:P,fragmentBoundaries:F,argv:O.argv,scope:m,xmlns:q,useAttributes:!0},R=W.__meshwire__(k,S),f=R.renderer.mesh(h,m);return $=$.add(f),S&&Object.entries(S).forEach(([L,x])=>{let I=!1;if(new RegExp(`^${$0}`).test(L))I=!0,L=L.replace($0,"");if(Y0.test(L)){if(!W.__isReactive__(L,m))return;const g=W.__extractExpressionDeps__(L,m),a=(n)=>{const p={};let s=[];if(W.__evaluateSpreadAttr__(L,{memo:n,get keystore(){return T[L]},set keystore(l){if(!T[L])T[L]=[];T[L]=l},each:(l,Q0)=>{if(V.map.afterSpreadAttrs.includes(l))return;if(P0(Q0,n[l]?.value))return;p[l]={value:Q0,type:"arg"},c[l]=Q0,s.push(l)},nullify:(l)=>{l.forEach((Q0)=>{p[Q0]={value:void 0,type:"arg"},delete c[Q0]}),s=l}}),s.length)W.__updateArgumentsDepNodes__(P,c),R.renderer.update(s,p,n)};g.forEach((n)=>W.__trackDep__(G,n,{...m,...h},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"spread-attr",$fragment:null,boundaries:F,update:a,syntax:I}))}else if(W.__isReactive__(x,m)){const g=W.__extractExpressionDeps__(x,m),a=(n)=>{if(V.map.beforeSpreadAttrs.includes(L))return;const p=x?W.__evaluate__(x,n):!0;c[L]=p,W.__updateArgumentsDepNodes__(P,c),R.renderer.update([L],{[L]:{value:p,type:"arg"}},n)};g.forEach((n)=>W.__trackDep__(G,n,{...m,...h},{nodetype:"macro",nodepath:P,deppath:`${P}.${L}`,target:"attr",$fragment:null,boundaries:F,update:a,syntax:I}))}}),$=$.add(F.end),W.metrics.inc("elementCount"),$}function u(w){if(!w.length||!w.prop("tagName"))return w;const j=w.is("svg")||q,O=j?Z0.default(document.createElementNS("http://www.w3.org/2000/svg",w.prop("tagName").toLowerCase())):Z0.default(`<${w.prop("tagName").toLowerCase()}/>`),P=w.contents(),F=D("element"),V=U();P.length&&O.append(W.__withPath__(F,()=>W.render(F+T5,P,V,G,j).$log));const{attrs:S,events:m}=W.__getAttributes__(w);S.literals&&Object.entries(S.literals).forEach(([h,T])=>{if(h===A0)return;const $=w.is(`[${A0}]`)&&["title","placeholder"].includes(h);O.attr(h,$?W.lips.i18n.translate(T).text:T);const k=(R)=>{O.attr(h,$?W.lips.i18n.translate(T).text:T),$&&W.__trackTranslationDep__(R,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"attr",$fragment:O,update:k})};$&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"attr",$fragment:O,update:k})});const c=(h,T=!1)=>{h&&Object.entries(h).forEach(([$,k])=>{switch($){case"@html":{const R=(f)=>{O.html(W.__evaluate__(k,f))};if(R(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:R}))}break;case"@text":{const R=w.is(`[${A0}]`),f=(L)=>{O.text(W.__evaluate__(k,L,{translate:R})),R&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f})};if(f(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f}));R&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:f})}break;case"@format":{const[R,f]=k.split(",").map((x)=>x.trim());if(!R)throw new Error("Invalid @format reference");if(!f)throw new Error("Invalid @format parameters");const L=(x)=>{const I=W.__evaluate__(`!${f.trim()}`,x);if(typeof I!=="object")throw new Error("Invalid @format parameters");const g=W.lips.i18n.format(R,I);g!==void 0&&O.text(g),W.__trackTranslationDep__(x,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:L})};L(V),W.__extractExpressionDeps__(f,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"meta-attr",$fragment:O,update:L}))}break;case"style":if(T&&W.__isReactive__(k,V)){const R=(L)=>{const x=W.__evaluate__(k,L);if(typeof x==="object"){let I="";Object.entries(x).forEach(([g,a])=>I+=`${g}:${a};`),I.length&&O.attr("style",I)}else O.attr("style",x)};R(V),W.__extractExpressionDeps__(k,V).forEach((L)=>W.__trackDep__(G,L,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:R}))}else O.attr("style",k);break;default:{const R=w.is(`[${A0}]`)&&["title","placeholder"].includes($),f=(L)=>{const x=k&&W.__isReactive__(k,V)?W.__evaluate__(k,L,{translate:R}):k!==void 0?k:!0;if(x===void 0||x===!1)O.removeAttr($);else O.attr($,x),R&&W.__trackTranslationDep__(L,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f})};if(f(V),T&&W.__isReactive__(k,V))W.__extractExpressionDeps__(k,V).forEach((x)=>W.__trackDep__(G,x,V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f}));R&&W.__trackTranslationDep__(V,{nodetype:"element",nodepath:F,deppath:`${F}.${$}`,target:"attr",$fragment:O,update:f})}}})};return S.expressions&&Object.keys(S.expressions).forEach((h)=>{if(!Y0.test(h))return;let T=[];const $=(k,R,f=!1)=>{const L={};W.__evaluateSpreadAttr__(h,{memo:k,get keystore(){return T},set keystore(x){T=x},each:(x,I)=>{if(!f&&S.map.afterSpreadAttrs.includes(x))return;L[x]=I},nullify:(x)=>x.forEach((I)=>O.removeAttr(I))}),Object.keys(L).length&&c(L)};if(delete S.expressions[h],$(V,"",!0),h&&W.__isReactive__(h,V))W.__extractExpressionDeps__(h,V).forEach((R)=>W.__trackDep__(G,R,V,{nodetype:"element",nodepath:F,deppath:`${F}.${h}`,target:"spread-attr",$fragment:O,update:$}))}),c(S.expressions,!0),m&&Object.entries(m).forEach(([h,T])=>{Y.push({nodepath:F,element:O,_event:h,instruction:T,scope:V,get __dependencies__(){return G}})}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),O}function v(w){const j=w.text(),O=U(),P=D("element"),F=w.parent().is(`[${A0}]`),V=Z0.default(document.createTextNode(W.__interpolate__(j,O,F))),S=(m)=>{const c=W.__interpolate__(j,m,F);if(!V[0])return;V[0].textContent=c,F&&W.__trackTranslationDep__(m,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S})};if(j&&W.__isReactive__(j,O))W.__extractTextDeps__(j,O).forEach((c)=>W.__trackDep__(G,c,O,{nodetype:"text",nodepath:P,deppath:`${P}.${c}`,target:"value",$fragment:V,update:S}));return F&&W.__trackTranslationDep__(O,{nodetype:"text",nodepath:P,target:"value",$fragment:V,update:S}),W.metrics.inc("elementCount"),W.metrics.inc("domInsertsCount"),V}function A(w){if(w.get(0)?.nodeType===Node.COMMENT_NODE)return w;if(w.get(0)?.nodeType===Node.TEXT_NODE)return v(w);if(w.is("let"))return H0(w);else if(w.is("const"))return t(w);else if(w.is("lips")&&w.attr(":dtag"))return e(w);else if(w.is("log"))return r(w);else if(W.__macros.has(w.prop("tagName")?.toLowerCase()))return _(w);else if(w.is("if, for, switch, async")||W.lips.has(w.prop("tagName")?.toLowerCase()))return d(w);else if(w.is("else-if, else"))return;return u(w)}try{this.__renderDepth__++,Z=!Z&&Z0.default(this.__template__).length>1?Z0.default("<template>").html(this.__template__).contents():Z||Z0.default(this.__template__),Z.each(function(){const w=A(Z0.default(this));if(w)M=M.add(w)}),Y.forEach(this.__attachEvent__.bind(this)),W.metrics.inc("renderCount")}catch(w){console.error("Rendering Failed --",w),W.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:G,events:Y}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(this.__detachEvent__.bind(this)),this.VER=[];for(let J in this.PCC){const Z=this.PCC.get(J);Z?.destroy(),Z?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.FGUDMemory?.clear(),this.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Z)=>{Z0.default(Z).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Z){const H=this,{$node:X,meshPath:q,fragmentPath:W,fragmentBoundaries:G,argv:Y,xmlns:M,declaration:U,useAttributes:D}=J;let N,b=[];const i=[],e=W+K1,r=(d,_,u,v)=>{const A=`${e}${v!==void 0?`[${v}]`:""}`,{$log:w,dependencies:j,events:O}=H.__withPath__(A,()=>{return H.render(A,d,{..._,...u},void 0,M)});if(i.push(A),j?.forEach((P,F)=>{if(!H.FGUD?.has(F))H.FGUD.set(F,new Map);P.forEach((V,S)=>{if(V.garbage)return;V.partial?.length?V.partial.push(A):V.partial=[A],H.FGUD.get(F)?.set(S,V)})}),H.metrics.inc("partialCount"),v!==void 0){const P=H.__getBoundaries__(A);b[v]={argvalues:u,boundaries:P};let F=Z0.default(P.start);return F=F.add(w),F=F.add(P.end),F}return w},H0=(d,_,u,v)=>{H.metrics.startRender();const A=v!==void 0?i.filter((w)=>w.endsWith(`${K1}[${v}]`)):i;if(d.forEach((w)=>{const j=H.FGUD.get(w);if(!j)return;j.forEach((O)=>{const P=A.find((S)=>{return O.partial?.find((m)=>S==m||H.__hasSamePathParent__(m,S))});if(!O.partial||!P)return;const F=O.deppath||O.nodepath,V=this.FGUDMemory.get(O.nodepath);if(O.garbage||G?.start&&!document.contains(G.start)){j.delete(F),H.__unbindMemo__(O);return}if(!V){console.warn(`unexpected occurence: <${F}> has no memo`);return}if(V.memo?.[w]&&u?.[w]&&!P0(V.memo[w],u[w]))V.memo={..._,...V.memo,...u};H.UQS.queue({dep:w,deppath:F,priority:O.priority}),H.metrics.inc("dependencyUpdateCount")}),!j.size&&H.FGUD.delete(w)}),v!==void 0&&b[v])b[v].argvalues=u;H.metrics.inc("partialUpdateCount"),H.metrics.endRender()},t=(d)=>{if(!b[d])return;const _=b[d].boundaries;if(b.splice(d,1),!document.contains(_.start)||!document.contains(_.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const u=[];let v=_.start.nextSibling;while(v&&v!==_.end)u.push(v),v=v.nextSibling;Z0.default(u).remove(),_.start.remove(),_.end.remove()},J0={renderer:{path:q,argv:Y,mesh(d,_){if(N=X.contents(),!N?.length)return null;if(_=_||J.scope,U?.iterator){const u=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!u.length)return null;let v=Z0.default();return u.forEach((A,w)=>{if(!N?.length)return null;v=v.add(r(N,_,A,w))}),v}else return r(N,_,d)},update(d,_,u,v){if(!i.length)return;if(u=u||J.scope,v=v||G,U?.iterator){const A=_?.["#"].value;if(!Array.isArray(A))return;if(Array.isArray(b)){if(b.length===A.length){for(let j=0;j<A.length;j++)!P0(b[j].argvalues,A[j])&&H0(Object.keys(A[j]),u,A[j],j);return}const w=Math.min(b.length,A.length);for(let j=0;j<w;j++)H0(Object.keys(A[j]),u,A[j],j);if(A.length>b.length){if(!N?.length)return;for(let j=b.length;j<A.length;j++){const O=r(N,u,A[j],j);Z0.default(v.end).before(O)}}else if(A.length<b.length)for(let j=b.length-1;j>=A.length;j--)t(j)}}else H0(d,u,_)},fill(d,_){console.log("fill",_||G),H.__fillBoundaries__(d,_||G)},cleanup(d){console.log("cleanup"),H.FGUD.forEach((_,u)=>{_.forEach((v,A)=>{if(!H.__hasSamePathParent__(A,e))return;H.__unbindMemo__(v),v.garbage=!0}),!_.size&&H.FGUD.delete(u)}),H.__emptyBoundaries__(d||G)}}};if(D&&q){const{attrs:d}=H.__getAttributes__(X);d.literals&&Object.entries(d.literals).forEach(([_,u])=>J0[_]=u),d.expressions&&Object.entries(d.expressions).forEach(([_,u])=>{if(Y0.test(_)){let v=[];H.__evaluateSpreadAttr__(_,{memo:J.scope,get keystore(){return v},set keystore(A){v=A},each:(A,w)=>J0[A]=w}),Z[`${U?.syntax?$0:""}${q}.${_}`]=u}else J0[_]=u?H.__evaluate__(u,J.scope):!0,Z[`${U?.syntax?$0:""}${q}.${_}`]=u})}return J0}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${J}`),end:document.createComment(`e:${J}`)}}__emptyBoundaries__(J){const Z=[];let H=J.start.nextSibling;while(H&&H!==J.end)Z.push(H),H=H.nextSibling;Z0.default(Z).remove()}__fillBoundaries__(J,Z){if(!document.contains(Z.start)||!document.contains(Z.end)){console.warn("Dynamic element boundaries not found");return}this.__emptyBoundaries__(Z),J.length&&Z0.default(Z.start).after(J)}__getAttributes__(J){const Z=J.attrs(),H={},X={},q={literals:{},expressions:{},map:{explicitAttrs:[],spreadAttrs:[],beforeSpreadAttrs:[],afterSpreadAttrs:[],metaAttrs:[]}},W=Object.keys(Z).find((M)=>Y0.test(M));let G=[],Y=!1;return Z&&Object.entries(Z).forEach(([M,U])=>{if(M==":dtag")return;if(M.startsWith(":")||M.startsWith(D0)||M.startsWith(S0)||Y0.test(M)||U1.test(M))if(U1.test(M)){const[D,N]=M.match(U1)||[];G=N.split(",")}else if(M.startsWith(S0))H[M.replace(S0,"")]=U;else if(M.startsWith(D0))X[M.replace(D0,"")]=U;else{if(M.startsWith(":"))M=M.slice(1,M.length);if(W)if(Y0.test(M))q.map.spreadAttrs.push(M),Y=!0;else q.map.explicitAttrs.push(M),!Y?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M);q.expressions[M]=U||""}else if(q.literals[M]=U,W)q.map.explicitAttrs.push(M),!Y?q.map.beforeSpreadAttrs.push(M):q.map.afterSpreadAttrs.push(M)}),{argv:G,events:H,functions:X,attrs:q}}__withPath__(J,Z){const H=this.__inpath__;this.__inpath__=J;const X=Z();return this.__inpath__=H,X}__getPathParent__(J){const Z=J.split("/");if(Z.length>1)Z.pop();return Z.join("/")}__hasSamePathParent__(J,Z){return J.startsWith(Z)&&!J.replace(Z,"").startsWith(".")||J.startsWith(`${Z+K1}`)}__evaluate__(J,Z,H){J=typeof J==="string"?J.trim():J;try{const X=(q)=>{const W=this.state.toJSON(),G=(M,...U)=>{try{return M(...U)}catch(D){!H?.mute&&console.error("Eval error --",D);return}};let Y=`return ${q};`;if(Z){let M={},U;for(let N in Z){if(N==="__arguments__")continue;M[N]=Z[N].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 G(D,this,this.input,W,this.static,this.context,M||{},U)}else{const M=new Function("self","input","state","static","context",Y);return G(M,this,this.input,W,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return X(J.slice(1));return J.replace(k1,(q,W)=>X(W))}return X(J)}catch(X){!H?.mute&&console.error("Expression evaluation error --",X);return}}__evaluateFunction__(J,Z,H){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,H)(...Z);else{let[X,...q]=J.split(/\s*,\s*/),W;const G=this.__evaluate__(X,H,{mute:!0});if(typeof G==="function")W=G;else{if(typeof this[X]!=="function")throw new Error(`Undefined <${X}> handler method`);W=this[X].bind(this)}if(typeof W!=="function")throw new Error(`Expected <${X}> to be a function or handler method`);let Y=q.map((M)=>this.__evaluate__(M,H));if(Z.length)Y=[...Y,...Z];return W(...Y)}}__evaluateSpreadAttr__(J,Z){const H=this.__evaluate__(J.replace(Y0,""),Z.memo);if(!H){if(!Z.keystore.length)throw new Error(`Undefined spread operator ${J}`);typeof Z.nullify==="function"&&Z.nullify(Z.keystore);return}if(typeof H!=="object"||Array.isArray(H))throw new Error(`Invalid spread operator ${J}`);if(Z.keystore=Object.keys(H)||[],typeof Z.each==="function")for(let X in H)Z.each(X,H[X])}__interpolate__(J,Z,H){if(J=J.replace(k1,(X,q)=>this.__evaluate__(q,Z)),H)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J){const{element:Z,nodepath:H,_event:X,instruction:q,scope:W,__dependencies__:G}=J;let Y=W;if(Z.on(X,(...M)=>this.__evaluateFunction__(q,M,Y)),this.VER.push(J),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount"),this.__isReactive__(q,W))this.__extractExpressionDeps__(q,W).forEach((U)=>this.__trackDep__(G,U,W||{},{nodetype:"event",nodepath:H,deppath:`${H}.${X}`,target:"event-handler",$fragment:!(Z instanceof g0)?Z:null,boundaries:Z instanceof g0?Z.__boundaries__:void 0,update:(D)=>{Y=D}}))}__detachEvent__({element:J,nodepath:Z,_event:H,instruction:X,scope:q,__dependencies__:W}){if(J.off(H),this.__isReactive__(X,q)){const G=this.__extractExpressionDeps__(X,q),Y=`${Z}.${H}`;G.forEach((M)=>{W.get(M)?.delete(Y),this.FGUD.get(M)?.delete(Y)})}this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Z){const H=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((q)=>{const W=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(W,Z).forEach((Y)=>H.add(Y))}),Array.from(H)}__extractExpressionDeps__(J,Z){const H=/\b(state|input|context|arguments)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,X=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g,q=/\b(arguments)((?:\.[a-zA-Z_]\w*)+)?(?=\[|\.|$|\s|;|,|\))/g;let W=[...Array.from(J.matchAll(H)),...Array.from(J.matchAll(X)),...Array.from(J.matchAll(q))];if(Z&&Object.keys(Z).length){const G=new RegExp(`\\b(?<!\\.)(${Object.keys(Z).join("|")})`,"g"),Y=new RegExp(`(?:(?<=\\.\\.\\.))(${Object.keys(Z).join("|")})\\b`,"g");W=[...W,...Array.from(J.matchAll(G)),...Array.from(J.matchAll(Y))]}return[...new Set(W.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 H=Z.deppath||Z.nodepath,X=this.FGUDMemory.get(Z.nodepath);if(X)X.tracks.set(H,Z.priority||2),X.memo=J,this.FGUDMemory.set(Z.nodepath,X);else{const q=new Map;q.set(H,Z.priority),this.FGUDMemory.set(Z.nodepath,{tracks:q,memo:J})}}__unbindMemo__(J){const Z=J.deppath||J.nodepath,H=this.FGUDMemory.get(J.nodepath);if(!H||!H.tracks.get(Z))return;H.tracks.delete(Z),!H.tracks.size&&this.FGUDMemory.delete(J.nodepath)}__trackDep__(J,Z,H,X){if(H&&H[Z]&&H[Z].type==="let")X.haslet=!0;if(X.priority===void 0)if(X.target==="attr"&&Z.split(".").find((W)=>A5.includes(W)))X.priority=0;else if(X.syntax)X.priority=1;else if(["event"].includes(X.nodetype))X.priority=3;else X.priority=2;const q=X.deppath||X.nodepath;X.level=q.split(/\//g).length,X.priority=X.level*x5+X.priority,!J.has(Z)&&J.set(Z,new Map),J.get(Z)?.set(q,X),this.__bindMemo__(H,X),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Z){this.__i18nDeps.set(Z.deppath||Z.nodepath,Z),this.__bindMemo__(J,Z),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Z){return Z.reduce((H,X)=>H?.[X],J)}__shouldUpdate__(J,Z){if(J==="self")return!0;const H={state:this.state,input:this.input,context:this.context},X=this.__valueDep__(this.__previous[J],Z),q=this.__valueDep__(H[J],Z);return!P0(X,q)}__updateDepNodes__(){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((J,Z)=>{const[H,...X]=Z.split(".");if(!this.__shouldUpdate__(H,X))return;J.forEach((q)=>{try{const W=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(W),this.__unbindMemo__(q);return}this.UQS.queue({dep:Z,deppath:W,priority:q.priority}),this.metrics.inc("dependencyUpdateCount")}catch(W){console.error("failed to update dependency nodes --",W);return}}),!J.size&&this.FGUD?.delete(Z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Z,H){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((X,q)=>{if(!X.haslet||!this.__hasSamePathParent__(q,this.__getPathParent__(Z)))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo={...G.memo,...H},this.UQS.queue({dep:J,deppath:W,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateArgumentsDepNodes__(J,Z){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender();const H="arguments";this.FGUD.get(H)?.forEach((X,q)=>{if(!this.__hasSamePathParent__(q,J))return;const W=X.deppath||X.nodepath,G=this.FGUDMemory.get(X.nodepath);if(!G){console.warn(`unexpected occurence: <${W}> has no memo`);return}G.memo.__arguments__=Z,this.UQS.queue({dep:H,deppath:W,priority:X.priority}),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Z)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Z);return}const H=this.FGUDMemory.get(J.nodepath);if(!H){console.warn(`unexpected occurence: <${J.deppath||J.nodepath}> has no memo`);return}J.update(H.memo,"i18n-partial-updator"),this.metrics.inc("dependencyUpdateCount")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?Z0.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?Z0.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?Z0.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _1={};m0(_1,{handler:()=>{{return E6}},declaration:()=>{{return $6}},_static:()=>{{return R6}}});var $6={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",alts:["else-if"],optional:!0}}},R6={initialized:!1,prevRenderer:null},E6={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,H=!1){if(!J.renderer)return;if(J.by){this.static.prevRenderer?.cleanup();const X=J.renderer.mesh({},Z);if(this.static.prevRenderer=J.renderer,!X?.length)return;if(H)return X;J.renderer.fill(X)}else{this.static.prevRenderer?.cleanup();let X=!1,q;if(Array.isArray(J["else-if"])&&J["else-if"].length)for(let W of J["else-if"]){if(!W.by)continue;if(q=W.renderer.mesh({},Z),this.static.prevRenderer=W.renderer,!q?.length)return;if(H)return q;q?.length&&W.renderer.fill(q),X=!0;break}if(!X&&J.else){const W=J.else.renderer.mesh({},Z);if(this.static.prevRenderer=J.else.renderer,!W?.length)return;if(H)return W;J.else.renderer.fill(W)}}}};var h1={};m0(h1,{state:()=>{{return T6}},handler:()=>{{return b6}},default:()=>{{return g6}},declaration:()=>{{return A6}},_static:()=>{{return S6}}});var A6={name:"for",syntax:!0,iterator:!0},T6={argvlist:null},S6={lastIn:null,processingBatch:!1},b6={onInput(){this.processor(this.input)},processor(J){if(this.static.processingBatch)return;if(!J.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:H,to:X}=J;if(Z===void 0&&H===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(H!==void 0){if(H=parseFloat(String(H)),X==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");X=parseFloat(String(X));const q=H<X,W=Math.abs(X-H)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===W){const[Y]=J.renderer.argv;if(Y){let M=H,U=!0;for(let D=0;D<this.state.argvlist.length;D++){if(this.state.argvlist[D][Y].value!==M){U=!1;break}M=q?M+1:M-1}if(U)return;M=H;for(let D=0;D<this.state.argvlist.length;D++)this.state.argvlist[D][Y].value=M,M=q?M+1:M-1;return}}const G=[];for(let Y=H;q?Y<=X:Y>=X;q?Y++:Y--){const M={},[U]=J.renderer.argv;if(U)M[U]={value:Y,type:"arg"};G.push(M)}this.state.argvlist=G}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[G,Y]=J.renderer.argv;for(let M=0;M<Z.length;M++){const U=this.state.argvlist[M];if(G)U[G].value=Z[M]}return}const q=[];let W=0;for(let G of Z){const Y={},[M,U]=J.renderer.argv;if(M)Y[M]={value:G,type:"arg"};if(U)Y[U]={value:W,type:"arg"};q.push(Y),W++}this.state.argvlist=q}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Z.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[G,Y,M]=J.renderer.argv;let U=0;for(let[D,N]of Z){const b=this.state.argvlist[U];if(G)b[G].value=D;if(Y)b[Y].value=N;U++}return}const q=[];let W=0;for(let[G,Y]of Z){const M={},[U,D,N]=J.renderer.argv;if(U)M[U]={value:G,type:"arg"};if(D)M[D]={value:Y,type:"arg"};if(N)M[N]={value:W,type:"arg"};q.push(M),W++}this.state.argvlist=q}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastIn&&J.in===this.static.lastIn)return;if(!Object.keys(Z).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=Z;const q=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[Y,M,U]=J.renderer.argv;for(let D=0;D<q.length;D++){const N=q[D],b=this.state.argvlist[D];if(Y)b[Y].value=N;if(M)b[M].value=Z[N]}return}const W=[];let G=0;for(let Y in Z){const M={},[U,D,N]=J.renderer.argv;if(U)M[U]={value:Y,type:"arg"};if(D)M[D]={value:Z[Y],type:"arg"};if(N)M[N]={value:G,type:"arg"};W.push(M),G++}this.state.argvlist=W}}finally{this.static.processingBatch=!1}}},g6="<{input.renderer} #=state.argvlist/>";var y1={};m0(y1,{state:()=>{{return k6}},handler:()=>{{return f6}},default:()=>{{return _6}},declaration:()=>{{return x6}}});var x6={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},k6={renderer:null,props:{}},f6={onInput(){this.processor(this.input)},processor(J){if(!J.await)throw new Error("Undefined async <await> attribute");if(!(J.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(J.loading)this.state.renderer=J.loading.renderer,this.state.props={};J.await.then((Z)=>{if(!J.then)return;this.state.renderer=J.then.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!J.catch)return;this.state.renderer=J.catch.renderer;const[H]=J.then.renderer.argv;this.state.props={[H]:{value:Z,type:"arg"}}})}},_6="<{state.renderer} #=state.props/>";var v1={};m0(v1,{handler:()=>{{return v6}},declaration:()=>{{return h6}},_static:()=>{{return y6}}});var h6={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},y6={initialized:!1,prevRenderer:null},v6={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,H=!1){let X=[];this.static.prevRenderer?.cleanup();for(let q of J.case)if(q.is==J.by||Array.isArray(q.is)&&q.is.includes(J.by)){Array.isArray(q.is)?X=[...new Set([...X,...q.is])]:X.push(q.is);const W=q.renderer.mesh({},Z);if(this.static.prevRenderer=q.renderer,!W?.length)return;if(H)return W;q.renderer.fill(W)}if(X.includes(J.by))return;if(J.default){const q=J.default.renderer.mesh({},Z);if(this.static.prevRenderer=J.default.renderer,!q?.length)return;if(H)return q;J.default.renderer.fill(q)}else this.static.prevRenderer=null}};var u1={};m0(u1,{state:()=>{{return u6}},handler:()=>{{return c6}},default:()=>{{return p6}},context:()=>{{return d6}},_static:()=>{{return m6}}});var i6=function(J){const Z={};return J.split("&").map((X)=>{const[q,W]=X.split("=");Z[q]=W}),Z},u6={page:null,params:{},query:{}},m6={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},d6=["navigate"],c6={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:H,default:X})=>{if(X)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],W=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:H,default:X,pathVars:q,pathRegex:new RegExp(`${W}\$`,"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 H=J.split("?");J=H[0];const X=H[1]?i6(H[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:X}});const W=this.match(J);if(!W){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:Y}=W;this.emit("after",{fromState:q,toState:{path:G.path,params:Y,query:X}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=Y,this.state.query=X,this.state.page=G.template},match(J){const Z={};let H=!1;for(let X of this.static.routes){const{pathVars:q,pathRegex:W}=X,G=J.match(W);if(G!==null&&G.index===0){for(let Y=0;Y+1<G.length&&Y<q.length;Y++)Z[q[Y].replaceAll(/[\/:]/g,"")]=G[Y+1];H=X;break}}return H?{route:H,params:Z}:!1}},p6="<{state.page} params=state.params query=state.query/>";class D1{debug=!1;stylesheets=[];config={};store={};__root;i18n=new t0;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new n0,this.IUC=new r0;const[Z,H]=b0(this.i18n.lang),[X,q]=b0(J?.context||{});this.__setLang=H,this.__getLang=Z,this.__setContext=q,this.__getContext=X,this.register("if",_1),this.register("for",h1),this.register("async",y1),this.register("switch",v1),this.register("router",u1)}register(J,Z){return this.store[J]=Z,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Z,H){const{default:X,...q}=Z,W={debug:this.debug,prepath:"0",lips:this},G=new g0(J,X||"",{...q,input:H},W);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(Y)=>{!Y.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((H)=>new u0("root",{sheet:H,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Z){const H=this.__getContext();if(typeof J==="string"){const X={...H,[J]:Z};B0(H,X)&&this.__setContext(X)}else if(!Array.isArray(J)){const X={...H,...J};B0(H,X)&&this.__setContext(X)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Z){if(!J.length)return;c0(()=>{const H=this.__getContext();if(!H)return;const X=Object.fromEntries(J.map((q)=>[q,H[q]]));X&&typeof Z==="function"&&Object.keys(X).length&&Z(X)})}useTranslator(J,Z){c0(()=>{const H=this.__getLang();if(!H)return;(J==="*"||Array.isArray(J)&&J.includes(H))&&typeof Z==="function"&&Z(H)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}var s6=function(){return{state:{count:0},handler:{onInput(){console.log("spec input --",this.input)}},default:`
2
+ <fieldset on-click( () => self.emit('select') )>
3
+ <h2 style="margin-top: 0">
4
+ <span style="color: {input.active ? 'turquoise' : 'unset'}">{input.name}</span>
5
+ <if( input.deprecated )><small style="color: orange"> (Deprecated)</small></if>
6
+ </h2>
7
+ <!-- <const ...static.vars></const> -->
2
8
 
3
- //# debugId=DFF31B9394AEA38064756e2164756e21
9
+ <ul>
10
+ <li>Type: {input.type}</li>
11
+ <li>Size: {input.size || '-'}</li>
12
+ <li>Version: {input.version}</li>
13
+ <li>
14
+ Installed:
15
+ <if( input.installed )>
16
+ <span style="color: green">Yes</span>
17
+ </if>
18
+ <else><span style="color: gray">No</span></else>
19
+ </li>
20
+ </ul>
21
+ </fieldset>
22
+ `}};var o6=function(){y5.register("spec",s6());const J={specs:[{type:"Lib",name:"Request",version:"2.2.0",latest:"2.88.2",deprecated:!0},{type:"Framework",name:"Lips",version:"1.0.0",size:"86kb",installed:!0,active:!0},{type:"Framework",name:"React",version:"4.9.0",latest:"19.1.0",size:"156kb",installed:!1},{type:"App",name:"Chrome",version:"24.2.0",latest:"26.1.11",size:"132Mb",deprecated:!1},{type:"OS",name:"Ubuntu",size:"2.4Gb",deprecated:!0}],version:"10.10.1",selected:null},Z={onSelect(X){this.state.selected=X},getSpecs(X){return this.state.specs[X]},onInstall(X,q){this.state.specs[X].installed=!0,this.state.version=q},onUninstall(X,q){this.state.specs[X].installed=!1,this.state.version=null},onUpgrade(X,q=!1){if(this.state.version=this.state.specs[X].latest,q===!1)this.state.specs[X].version=this.state.specs[X].latest,this.state.specs[X].upgraded=!0}},H=`
23
+ <ul style="list-type: none">
24
+ <for [index] from=0 to=(state.specs.length - 1)>
25
+ <li style="border: 4px solid {state.selected === index ? 'turquoise' : 'black'}; margin: 5px 0;">
26
+ <let specs=self.getSpecs( index )/>
27
+
28
+ <spec version=state.version
29
+ ...specs
30
+ active=(state.selected === index)
31
+ on-select( onSelect, index )/>
32
+
33
+ <div style="display: flex; align-items: center; justify-content: between;padding: 10px;">
34
+ <let version=state.version active=(state.selected === index)/>
35
+
36
+ <log('installed --', specs.installed )/>
37
+ <if( !specs.installed )>
38
+ <button on-click( onInstall, index, specs.version )>Install {specs.name +(specs.version ? '~'+ specs.version : '')}</button>
39
+ </if>
40
+ <else>
41
+ <button on-click( onUninstall, index, specs.version )>Uninstall {specs.name +(specs.version ? '~'+ specs.version : '')}</button>
42
+ </else>
43
+
44
+ <if( active )>
45
+ <small style="padding: 0 10px;">Selected</small>
46
+ </if>
47
+
48
+ <if( specs.installed && !specs.upgraded && specs.latest )>
49
+ <div style="padding: 0 100px">
50
+ <span>Version {specs.latest} available!</span>
51
+
52
+ <if( state.version === specs.latest )>
53
+ <span style="padding: 0 10px;color: orange">Mounted</span>
54
+ </if>
55
+ <else>
56
+ <button style="margin: 0 10px" on-click( onUpgrade, index, true )>Mount</button>
57
+ </else>
58
+
59
+ <button style="margin: 0 10px" on-click( onUpgrade, index, false )>Upgrade</button>
60
+ </div>
61
+ </if>
62
+ </div>
63
+ </li>
64
+ </for>
65
+ </ul>
66
+ `;y5.root({default:H,state:J,handler:Z},"body")};var y5=new D1({debug:!0});o6();
67
+
68
+ //# debugId=E96F2290554DAF5B64756e2164756e21