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