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