UNPKG

@easylogic/editor

Version:

Fantastic Web Design Tool

2 lines 1.35 MB
var T7=Object.defineProperty,k7=Object.defineProperties;var M7=Object.getOwnPropertyDescriptors;var qg=Object.getOwnPropertySymbols;var I7=Object.prototype.hasOwnProperty,E7=Object.prototype.propertyIsEnumerable;var Qg=($,Ke,lt)=>Ke in $?T7($,Ke,{enumerable:!0,configurable:!0,writable:!0,value:lt}):$[Ke]=lt,b=($,Ke)=>{for(var lt in Ke||(Ke={}))I7.call(Ke,lt)&&Qg($,lt,Ke[lt]);if(qg)for(var lt of qg(Ke))E7.call(Ke,lt)&&Qg($,lt,Ke[lt]);return $},se=($,Ke)=>k7($,M7(Ke));var Th=($,Ke,lt)=>{if(!Ke.has($))throw TypeError("Cannot "+lt)};var Te=($,Ke,lt)=>(Th($,Ke,"read from private field"),lt?lt.call($):Ke.get($)),wt=($,Ke,lt)=>{if(Ke.has($))throw TypeError("Cannot add the same private member more than once");Ke instanceof WeakSet?Ke.add($):Ke.set($,lt)},Ct=($,Ke,lt,gi)=>(Th($,Ke,"write to private field"),gi?gi.call($,lt):Ke.set($,lt),lt),Jg=($,Ke,lt,gi)=>({set _(Zn){Ct($,Ke,Zn,lt)},get _(){return Te($,Ke,gi)}}),Kn=($,Ke,lt)=>(Th($,Ke,"access private method"),lt);(function($,Ke){typeof exports=="object"&&typeof module!="undefined"?Ke(exports):typeof define=="function"&&define.amd?define(["exports"],Ke):($=typeof globalThis!="undefined"?globalThis:$||self,Ke($.elf={}))})(this,function($){var di,el,jn,_a,zn,Sa,Pa,ys,An,Dn,tl,ef,Fn,kh,rl,tf,Ks,si,rr,wa,Bn,Nn,Gn,Zs,Hn,Ca;"use strict";function Ke(s,e=()=>!0){let t=s,r=[];do{if(t instanceof Object===!1)break;const a=Object.getOwnPropertyNames(t).filter(e);r.push.apply(r,a)}while(t=Object.getPrototypeOf(t));return r}function lt(s,e=0){if(e===0)return s;var t=void 0;return function(r,i,a,n,o){t&&window.clearTimeout(t),t=window.setTimeout(function(){s(r,i,a,n,o)},e||300)}}function gi(s,e){var t=void 0;return function(r,i,a,n,o){t||(t=window.setTimeout(function(){s(r,i,a,n,o),t=null},e||300))}}function Zn(s,e,t){return(...r)=>{t.every(a=>e[a].apply(e,r))&&s.apply(e,r)}}function Mh(s,e){return(...t)=>{window.requestAnimationFrame(()=>{s.apply(e,t)})}}function La(s,e){Object.keys(s).forEach((t,r)=>{e(t,s[t],r)})}function vl(s,e){return Object.keys(s).map((t,r)=>e(t,s[t],r))}function Ih(s,e,t=""){return vl(s,e).join(t)}function rf(s,e,t){var r=Eh(s[e],e);return de(t)?t(r):r}function Eh(s,e){return typeof s=="undefined"?e:s}function Tt(s){return typeof s=="undefined"}function ke(s){return!Tt(s)}function ai(s){return typeof s=="boolean"}function it(s){return typeof s=="string"}function sf(s){return!it(s)}function Gt(s){return Array.isArray(s)}function Hr(s){return typeof s=="object"&&!Array.isArray(s)&&!ft(s)&&!it(s)&&s!==null}function de(s){return typeof s=="function"}function ft(s){return typeof s=="number"}function Lh(s){return s===0}function _s(s){return!Lh(s)}const af=s=>JSON.parse(JSON.stringify(s));function be(s){if(!Tt(s))return af(s)}function yl(s){return Object.keys(s).forEach(e=>{Array.isArray(s[e])&&(s[e]=s[e].join(", "))}),s}function kr(...s){const e=[];return s.filter(Boolean).forEach(t=>{Gt(t)?e.push(kr(...t)):Hr(t)?Object.keys(t).filter(r=>Boolean(t[r])).forEach(r=>{e.push(r)}):it(t)&&e.push(t)}),e.join(" ")}const nf=(s,e,t)=>{t?(s.setAttribute(e,e),s[e]=t):(s.removeAttribute(e),s[e]=t)},of=(s,e,t)=>{typeof t=="boolean"?nf(s,e,t):s.setAttribute(e,t)},lf=(s,e)=>{s.removeAttribute(e),s[e]=!1},cf=(s,e)=>{s.removeAttribute(e)},hf=(s,e,t)=>{typeof t=="boolean"?lf(s,e):e&&cf(s,e)},df=(s,e,t,r)=>{t?(!r||t!==r)&&of(s,e,t):hf(s,e,r)},uf=(s,e={},t={})=>{const r=[];r.push.apply(r,Object.keys(e)),r.push.apply(r,Object.keys(t)),new Set(r).forEach(a=>{df(s,a,e[a],t[a])})};function pf(s,e){return s.nodeType===window.Node.TEXT_NODE&&s.textContent!==e.textContent||s.nodeName!==e.nodeName}function Oh(s){return(s==null?void 0:s.nodeType)===8?!0:s.nodeType!==window.Node.TEXT_NODE&&s.getAttribute("data-domdiff-pass")==="true"}function gf(s){return s.nodeType!==window.Node.TEXT_NODE&&s.getAttribute("refClass")}function Vh(s){var e={};const t=s.length;for(let r=0;r<t;r++){const i=s[r];e[i.name]=i.value}return e}function ff(s,e){return s.outerHTML==e.outerHTML}function Rh(s,e,t,r,i={}){if(!e)s.appendChild(t.cloneNode(!0));else if(!t)s.removeChild(e);else if(!(Oh(e)||Oh(t))){if(ff(t,e))return;if(pf(t,e)||gf(t))s.replaceChild(t.cloneNode(!0),e);else if(t.nodeType!==window.Node.TEXT_NODE&&t.nodeType!==window.Node.COMMENT_NODE&&t.toString()!=="[object HTMLUnknownElement]"){i.checkPassed&&i.checkPassed(e,t)||uf(e,Vh(t.attributes),Vh(e.attributes));for(var a=qn(e),n=qn(t),o=Math.max(a.length,n.length),l=0;l<o;l++)Rh(e,a[l],n[l],l,i)}}}const qn=s=>{var e=s.firstChild;if(!e)return[];var t=[];do t.push(e),e=e.nextSibling;while(e);return t};function Qn(s,e,t={}){t.checkPassed=de(t.checkPassed)?t.checkPassed:void 0,t.removedElements=[],s=s.el||s,e=e.el||e;var r=qn(s),i=qn(e),a=Math.max(r.length,i.length);if(a!==0)if(r.length===0&&i.length>0)s.append(...i);else if(r.length>0&&i.length===0)s.textContent="";else for(var n=0;n<a;n++)Rh(s,r[n],i[n],n,t)}const jh=/[xy]/g;function bl(){var s=new Date().getTime(),e="xxx12-xx-34xx".replace(jh,function(t){var r=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(t=="x"?r:r&3|8).toString(16)});return e}function Jn(){var s=new Date().getTime(),e="idxxxxxxx".replace(jh,function(t){var r=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(t=="x"?r:r&3|8).toString(16)});return e}const eo={},Oa={},zh={},Ah=new Set,Ri=new Map,ea=new Map,Dh="v:";function ji(s,e=""){const t=`${Dh}${Jn()}`;return Ri.set(t,s),e&&(ea.has(e)||ea.set(e,new Set),ea.get(e).add(t)),t}function mf(s){ea.has(s)&&(ea.get(s).forEach(e=>{Ri.delete(e)}),ea.delete(s))}function Fh(s,e=!0){if(it(s)===!1)return s;let t=s;return Ri.has(s)&&(t=Ri.get(s),e&&Ri.delete(s)),t}function Va(s){return Ri.has(s)?Ri.get(s):s}function Bh(s){return Ri.has(s)}function Nh(s){return Object.entries(s).map(([e,t])=>`${e}=${ji(t)}`).join(" ")}function zi(s={}){Object.keys(s).forEach(e=>{eo[e]=s[e]})}function Gh(s){eo[s.name]&&(eo[s.name]=s)}function Hh(s,e){zh[s]=e}function Uh(s){return zh[s]}function Wh(s){return eo[Uh(s)||s]}function Xh(s){Ah.add(s)}function Yh(){return[...Ah]}function vf(s){Gh(s),Yh().forEach(e=>{e.hmr()})}function Kh(s){Object.keys(s).forEach(e=>{Oa[e]=s[e]})}function yf(s){return Oa[s]}function Zh(s){return Object.keys(Oa).filter(e=>Boolean(Oa[e])).map(e=>{const t=Oa[e];return new t(s)})}class ge{constructor(e,t,r){if(typeof e!="string")e instanceof ge?this.el=e.el:this.el=e;else{var i=document.createElement(e);t&&(i.className=t),r=r||{},Object.assign(i,r),this.el=i}}static create(e,t,r){return new ge(e,t,r)}static createByHTML(e){var t=ge.create("div");return t.html(e).firstChild}static makeElementList(e){const t=ge.create("div");let r=[];Gt(e)||(e=[e]),e=e.filter(Boolean);for(let i=0,a=e.length;i<a;i++){const n=e[i];it(n)?r.push(...t.html(n==null?void 0:n.trim()).childNodes||[]):n&&r.push(ge.create(n))}return r}static getScrollTop(){return Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop)}static getScrollLeft(){return Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft)}static parse(e){var t=window.DOMParser();return t.parseFromString(e,"text/htmll")}static body(){return ge.create(document.body)}get exists(){return Boolean(this.el)}setAttr(e){return Object.keys(e).forEach(t=>{this.attr(t,e[t])}),this}setAttrNS(e,t="http://www.w3.org/2000/svg"){return Object.keys(e).forEach(r=>{this.attr(r,e[r],t)}),this}setProp(e){return Object.keys(e).forEach(t=>{this.el[t]!=e[t]&&(this.el[t]=e[t])}),this}data(e,t){if(arguments.length===1){const r=this.attr("data-"+e);return Fh(r,!1)}else if(arguments.length===2)return this.attr("data-"+e,t);return this}attr(...e){return e.length==1?de(this.el.getAttribute)&&this.el.getAttribute(e[0]):(this.el.getAttribute(e[0])!=e[1]&&this.el.setAttribute(e[0],e[1]),this)}attrNS(e,t,r="http://www.w3.org/2000/svg"){return arguments.length==1?this.el.getAttributeNS(r,e):(this.el.getAttributeNS(r,e)!=t&&this.el.setAttributeNS(r,e,t),this)}attrKeyValue(e){return{[this.el.getAttribute(e)]:this.val()}}get attributes(){try{return[...this.el.attributes],this.el.attributes}catch{const r=this.el.attributes.length,i=[];for(var e=0;e<r;e++)i.push(this.el.attributes[`${e}`]);return i}}attrs(...e){return e.map(t=>this.el.getAttribute(t))}styles(...e){return e.map(t=>this.el.style[t])}removeAttr(e){return this.el.removeAttribute(e),this}removeStyle(e){return this.el.style.removeProperty(e),this}is(e){return e instanceof ge?this.el===e.el:this.el===e}isTag(e){return this.el.tagName.toLowerCase()===e.toLowerCase()}closest(e){for(var t=this,r=!1;!(r=t.hasClass(e));)if(t.el.parentNode)t=ge.create(t.el.parentNode);else return null;return r?t:null}path(){if(!this.el)return[];let e=[this],t=this.parent();if(!t.el)return e;for(;t&&(e.unshift(t),t=t.parent(),!!t.el););return e}get $parent(){return this.parent()}parent(){return ge.create(this.el.parentNode)}hasParent(){return!!this.el.parentNode}removeClass(...e){return this.el.classList.remove(...e),this}updateClass(e){return this.el.className=e,this}replaceClass(e,t){return this.el.classList.replace(e,t),this}hasClass(e){return this.el.classList?this.el.classList.contains(e):!1}addClass(...e){return this.el.classList.add(...e),this}onlyOneClass(e){var t=this.parent();t.children().forEach(r=>{r.removeClass(e)}),this.addClass(e)}toggleClass(e,t){return this.el.classList.toggle(e,t),this}outerHTML(){return this.isTextNode?this.text():this.el.outerHTML}html(e){try{return typeof e=="undefined"?this.el.innerHTML:(typeof e=="string"?Object.assign(this.el,{innerHTML:e}):this.empty().append(e),this)}catch(t){return console.log(t,e),this}}htmlDiff(e){Qn(this,e)}updateDiff(e,t="div",r={}){Qn(this,ge.create(t).html(e),r)}updateSVGDiff(e,t="div"){Qn(this,ge.create(t).html(`<svg>${e}</svg>`).firstChild.firstChild)}getById(e){return this.el.getElementById(e)}find(e){if(!this.isTextNode)return this.el.querySelector(e)}$(e){var t=this.find(e);return t?ge.create(t):null}findAll(e){return this.isTextNode?[]:Array.from(this.el.querySelectorAll(e))}$$(e){var t=this.findAll(e);return t.map(r=>ge.create(r))}empty(){for(;this.el.firstChild;)this.el.removeChild(this.el.firstChild);return this}append(e){return e?(Gt(e)?this.el.append(...e.map(t=>t.el||t)):typeof e=="string"?this.el.appendChild(document.createTextNode(e)):this.el.appendChild(e.el||e),this):this}prepend(e){return typeof e=="string"?this.el.prepend(document.createTextNode(e)):this.el.prepend(e.el||e),this}prependHTML(e){var t=ge.create("div").html(e);return this.prepend(t.createChildrenFragment()),t}appendHTML(e){var t=ge.create("div").html(e);return this.append(t.createChildrenFragment()),t}createChildrenFragment(){const e=this.childNodes;var t=document.createDocumentFragment();return e.forEach(r=>t.appendChild(r.el)),t}appendTo(e){var t=e.el?e.el:e;return t.appendChild(this.el),this}remove(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}removeChild(e){return this.el.removeChild(e.el||e),this}text(e){if(typeof e=="undefined")return this.el.textContent;var t=e;return e instanceof ge&&(t=e.text()),this.el.textContent!==t&&(this.el.textContent=t),this}css(e,t){if(typeof e!="undefined"&&typeof t!="undefined")e.indexOf("--")===0&&typeof t!="undefined"?this.el.style.setProperty(e,t):this.el.style[e]=t;else if(typeof e!="undefined"){if(typeof e=="string")return window.getComputedStyle(this.el)[e];Object.entries(e).forEach(([r,i])=>{r.indexOf("--")===0&&typeof i!="undefined"?this.el.style.setProperty(r,i):this.el.style[r]=i})}return this}getComputedStyle(...e){var t=window.getComputedStyle(this.el),r={};return e.forEach(i=>{r[i]=t[i]}),r}getStyleList(...e){for(var t={},r=this.el.style.length,i=0;i<r;i++){var a=this.el.style[i];t[a]=this.el.style[a]}return e.forEach(n=>{t[n]=this.css(n)}),t}cssText(e){return typeof e=="undefined"?this.el.style.cssText:(e!=this.el.tempCssText&&(this.el.style.cssText=e,this.el.tempCssText=e),this)}cssArray(e){return e[0]&&(this.el.style[e[0]]=e[1]),e[2]&&(this.el.style[e[2]]=e[3]),e[4]&&(this.el.style[e[4]]=e[5]),e[6]&&(this.el.style[e[6]]=e[7]),e[8]&&(this.el.style[e[8]]=e[9]),this}cssFloat(e){return parseFloat(this.css(e))}cssInt(e){return parseInt(this.css(e))}px(e,t){return this.css(e,`${t}px`)}rect(){return this.el.getBoundingClientRect()}bbox(){return this.el.getBBox()}isSVG(){return this.el._cachedIsSVG||(this.el._cachedIsSVG={value:this.el.tagName.toLowerCase()==="svg"}),this.el._cachedIsSVG.value}offsetRect(){if(this.isSVG()){const t=this.parent().rect(),r=this.rect();return{x:r.x-t.x,y:r.y-t.y,width:r.width,height:r.height}}const e=this.el;return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}offsetClientRect(){if(this.isSVG()){const r=this.parent().rect(),i=this.rect();return{x:i.x-r.x,y:i.y-r.y,width:i.width,height:i.height}}const e=this.parent().rect(),t=this.rect();return{x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height}}offset(){var e=this.rect(),t=ge.getScrollTop(),r=ge.getScrollLeft();return{top:e.top+t,left:e.left+r}}offsetLeft(){return this.offset().left}offsetTop(){return this.offset().top}position(){return this.el.style.top?{top:parseFloat(this.css("top")),left:parseFloat(this.css("left"))}:this.rect()}size(){return[this.width(),this.height()]}width(){return this.el.offsetWidth||this.rect().width}contentWidth(){return this.width()-this.cssFloat("padding-left")-this.cssFloat("padding-right")}height(){return this.el.offsetHeight||this.rect().height}contentHeight(){return this.height()-this.cssFloat("padding-top")-this.cssFloat("padding-bottom")}val(e){if(typeof e=="undefined")return this.el.value;if(typeof e!="undefined"){var t=e;e instanceof ge&&(t=e.val()),this.el.value=t}return this}matches(e){return this.el&&this.el.matches?this.el.matches(e)?this:this.parent().matches(e):null}get value(){return this.el.value}get naturalWidth(){return this.el.naturalWidth}get naturalHeight(){return this.el.naturalHeight}get files(){return this.el.files?[...this.el.files]:[]}get isTextNode(){return this.el.nodeType===3}realVal(){switch(this.el.nodeType){case"INPUT":var e=this.attr("type");return e=="checkbox"||e=="radio"?this.checked():this.el.value;case"SELECT":case"TEXTAREA":return this.el.value}return""}int(){return parseInt(this.val(),10)}float(){return parseFloat(this.val())}show(e="block"){return this.el.style.display=e!="none"?e:"block",this}hide(){return this.el.style.display="none",this}isHide(){return this.el.style.display==="none"}isShow(){return!this.isHide()}toggle(e){var t=this.isHide();return arguments.length==1?e?this.show():this.hide():t?this.show():this.hide()}get totalLength(){return this.el.getTotalLength()}scrollIntoView(){this.el.scrollIntoView()}addScrollLeft(e){return this.el.scrollLeft+=e,this}addScrollTop(e){return this.el.scrollTop+=e,this}setScrollTop(e){return this.el.scrollTop=e,this}setScrollLeft(e){return this.el.scrollLeft=e,this}scrollTop(){return this.el===document.body?ge.getScrollTop():this.el.scrollTop}scrollLeft(){return this.el===document.body?ge.getScrollLeft():this.el.scrollLeft}scrollHeight(){return this.el.scrollHeight}scrollWidth(){return this.el.scrollWidth}on(e,t,r,i){return this.el.addEventListener(e,t,r,i),this}off(e,t){return this.el.removeEventListener(e,t),this}getElement(){return this.el}createChild(e,t="",r={},i={}){let a=ge.create(e,t,r);return a.css(i),this.append(a),a}get firstChild(){return ge.create(this.el.firstElementChild)}get first(){return ge.create(this.el.firstChild)}children(){var e=this.el.firstElementChild;if(!e)return[];var t=[];do t.push(ge.create(e)),e=e.nextElementSibling;while(e);return t}get childNodes(){const e=[];if(this.el.hasChildNodes()){const t=this.el.childNodes;for(let r=0;r<t.length;r++)e.push(ge.create(t[r]))}return e}childLength(){return this.el.children.length}replace(e){return this.el.parentNode&&this.el.parentNode.replaceChild(e.el||e,this.el),this}replaceChild(e,t){return this.el.replaceChild(t.el||t,e.el||e),this}checked(e=!1){return arguments.length==0?!!this.el.checked:(this.el.checked=!!e,this)}click(){return this.el.click(),this}focus(){return this.el.focus(),this}select(){if(this.attr("contenteditable")==="true"){var e=document.createRange();e.selectNodeContents(this.el);var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}else this.el.select();return this}blur(){return this.el.blur(),this}context(e="2d"){return this._initContext||(this._initContext=this.el.getContext(e)),this._initContext}resize({width:e,height:t}){this._initContext=null;var r=this.context(),i=window.devicePixelRatio||1;this.px("width",+e),this.px("height",+t),this.el.width=e*i,this.el.height=t*i,r.scale(i,i)}toDataURL(e="image/png",t=1){return this.el.toDataURL(e,t)}clear(){this.context().clearRect(0,0,this.el.width,this.el.height)}update(e){this.clear(),e.call(this,this)}drawImage(e,t=0,r=0){var i=this.context(),a=window.devicePixelRatio||1;i.drawImage(e,t,r,e.width,e.height,0,0,this.el.width/a,this.el.height/a)}drawOption(e={}){var t=this.context();Object.assign(t,e)}drawLine(e,t,r,i){var a=this.context();a.beginPath(),a.moveTo(e,t),a.lineTo(r,i),a.stroke(),a.closePath()}drawPath(...e){var t=this.context();t.beginPath(),e.forEach((r,i)=>{i==0?t.moveTo(r[0],r[1]):t.lineTo(r[0],r[1])}),t.stroke(),t.fill(),t.closePath()}drawCircle(e,t,r){var i=this.context();i.beginPath(),i.arc(e,t,r,0,2*Math.PI),i.stroke(),i.fill()}drawText(e,t,r){this.context().fillText(r,e,t)}fullscreen(){var e=this.el;e.requestFullscreen?e.requestFullscreen():e.wekitRequestFullscreen&&e.wekitRequestFullscreen()}toggleFullscreen(){this.el===document.fullscreenElement?document.exitFullscreen():this.fullscreen()}}class xl{constructor(e){this.id=Jn(),this.cachedCallback={},this.callbacks={},this.editor=e}getCallbacks(e){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e]}setCallbacks(e,t=[]){this.callbacks[e]=t}debug(...e){this.editor&&this.editor.context.config.get("debug.mode")&&console.debug(...e)}on(e,t,r,i=0,a=0,n=!1,o=!1,l=[],c=!1){var h=t;return i>0?h=lt(t,i):a>0&&(h=gi(t,a)),l.length&&(h=Zn(h,r,l)),c&&(h=Mh(h,r)),this.getCallbacks(e).push({event:e,callback:h,context:r,originalCallback:t,enableAllTrigger:n,enableSelfTrigger:o}),()=>{this.off(e,t)}}off(e,t){this.debug("off message event",e),arguments.length==1?this.setCallbacks(e):arguments.length==2&&this.setCallbacks(e,this.getCallbacks(e).filter(r=>r.originalCallback!==t))}offAll(e){Object.keys(this.callbacks).forEach(t=>{this.setCallbacks(t,this.getCallbacks(t).filter(r=>r.context!==e))}),this.debug("off all message",e.sourceName)}getCachedCallbacks(e){return this.getCallbacks(e)}sendMessage(e,t,...r){this.sendMessageList(e,[[t,...r]])}runMessage(e,t){const r=e.callback.apply(e.context,t);if(ke(r)){if(r===!1)return;if(de(r)){r();return}}}sendMessageList(e,t=[]){window.Promise.resolve().then(()=>{t.forEach(([r,...i])=>{var a=this.getCachedCallbacks(r);if(a&&a.length){const n=a.filter(l=>!l.enableSelfTrigger).filter(l=>l.enableAllTrigger||l.originalCallback.source!==e);let o=n.length;for(;o--;){const l=n[o];this.runMessage(l,i)}}else this.debug(`message event ${r} is not exist.`)})})}nextSendMessage(e,t,...r){window.Promise.resolve().then(()=>{t(...r)})}triggerMessage(e,t,...r){window.Promise.resolve().then(()=>{var i=this.getCachedCallbacks(t);i?i.filter(n=>n.originalCallback.source===e).forEach(n=>{n.callback.apply(n.context,r)}):this.debug(t," is not valid event")})}emit(e,...t){de(e)?e(...t):Gt(e)?this.sendMessageList(this.source,e):this.sendMessage(this.source,e,...t)}nextTick(e){this.nextSendMessage(this.source,e)}trigger(e,...t){de(e)?e(...t):this.triggerMessage(this.source,e,...t)}}const $l=/^@magic:([a-zA-Z][a-zA-Z0-9]*)[\W]{1}(.*)*$/g,_l="@magic:",Ai="|",qh=/(([\$a-z_\-]+)\([^\(\)]*\)|([a-z_\-]+))/gi,Sl="(",Qh=")",to={KEYWORD:"keyword",FUNCTION:"function",VALUE:"value"};class Ur{constructor(e){this.context=e.context,this.originalMethod=e.originalMethod,this.method=e.method,this.args=e.args,this.pipes=e.pipes,this.keys=e.keys,this.__cache=new Map}setCache(e,t){this.__cache.set(e,t)}hasCache(e){return this.__cache.has(e)}getCache(e){return this.__cache.get(e)}hasKeyword(e){if(this.hasCache(e))return this.getCache(e);let t=!1;return this.pipes.forEach(r=>{switch(r.type){case to.KEYWORD:r.value===e&&(t=!0);break}}),this.setCache(e,t),t}hasFunction(e){if(this.hasCache(e))return this.getCache(e);let t=!!this.getFunction(e);return this.setCache(e,t),t}getFunction(e){return this.functions.find(t=>t.func===e)}getFunctionList(e){return this.functions.filter(t=>t.func===e)}get originalCallback(){return this.context[this.originalMethod]}get keywords(){return this.keys[to.KEYWORD].map(e=>e.value)}get functions(){return this.keys[to.FUNCTION]}get values(){return this.keys[to.VALUE].map(e=>e.value)}execute(...e){return this.originalCallback.call(this.context,...e)}executeWithContext(e,...t){return this.originalCallback.call(e,...t)}static make(e,...t){return`${_l}${e} ${t.join(Ai)}`}static check(e){return e.match($l)!==null}static parse(e,t={}){const r=e.match($l);if(!r)return;const i=r[0].split(_l)[1].split(Ai).map(u=>u.trim());let[a,...n]=i;const[o,...l]=a.split(" "),c=n.map(u=>this.parsePipe(u)).filter(u=>u.value),h={function:[],keyword:[],value:[]};return c.forEach(u=>{u.type==="function"?h.function.push(u):u.type==="keyword"?h.keyword.push(u):h.value.push(u)}),new Ur({context:t,originalMethod:e,method:o,args:l,pipes:c,keys:h})}static parsePipe(e){const t=e.match(qh);if(!t)return{type:"value",value:e};const[r]=t;if(r.includes(Sl)){const[i,a]=r.split(Sl),[n]=a.split(Qh);return{type:"function",value:r,func:i,args:n.split(",").map(o=>o.trim()).filter(Boolean)}}return{type:"keyword",value:t[0]}}}const Jh=(s,e=Ai)=>` ${e} ${s}`,bf="ME@",ed=(...s)=>s.join(Ai),Pl=(...s)=>bf+ed(...s),xf=Pl,$f=Pl,ro=":",td=" ",_f={},Fe=(...s)=>{var e=s.join(ro);return(...t)=>{const[r,...i]=t;return Ur.make("domevent",[e,r].join(" "),...i)}},io=(...s)=>Ur.make("subscribe",...s),Sf=(...s)=>Ur.make("callback",...s),Pf=(...s)=>Ur.make("observer",...s),We=(s,e=Ai)=>Jh(s,e),ta=(s,e=Ai)=>We(`after(${s})`,e),wf=(s,e=Ai)=>We(`before(${s})`,e),fe=We,Cf=We,Tf=We("ArrowUp"),kf=We("ArrowDown"),Mf=We("ArrowLeft"),If=We("ArrowRight"),Di=We("Enter"),Ef=We("Space"),ra=We("Escape"),Lf=We("Backspace"),rd=We("Delete"),Of=We("Equal"),Vf=We("Minus"),Rf=We("BracketRight"),jf=We("BracketLeft"),zf=We("isAltKey"),Af=We("isShiftKey"),Df=We("isMetaKey"),Ff=We("isCtrlKey"),Bf=We("hasMouse"),Nf=We("hasTouch"),Gf=We("hasPen"),Hf=We("self"),_r=We("isMouseLeftButton"),Uf=We("isMouseRightButton"),Wf=We("fit"),Xf=We("passive"),Ee=We("domdiff"),Ne=(s=100)=>We(`debounce(${s})`),wl=(s=300)=>We(`delay(${s})`),Yf=Ne(1e3),Ss=(s=100)=>We(`throttle(${s})`),id=We("allTrigger()"),sd=We("selfTrigger()"),Kf=We("frame()"),Zf=s=>We(`params(${ji(s)})`),qf=We("capture()"),Oe=ta("preventDefault"),Wr=ta("stopPropagation"),M=io,so=(...s)=>io(...s,id),Z=(...s)=>io(...s,sd),bt=(s,...e)=>io(`config:${s}`,...e),ad=Sf,Qf=ad("requestAnimationFrame"),Jf=Pf,ni=Fe,A=Fe("click"),ia=Fe("dblclick"),em=Fe("mousedown"),tm=Fe("mouseup"),rm=Fe("mousemove"),Cl=Fe("mouseover"),im=Fe("mouseout"),sm=Fe("mouseenter"),nd=Fe("mouseleave"),am=Fe("touchstart"),nm=Fe("touchmove"),om=Fe("touchend"),Ra=Fe("keydown"),er=Fe("keyup"),lm=Fe("keypress"),cm=Fe("drag"),pr=Fe("dragstart"),Xr=Fe("drop"),Yr=Fe("dragover"),hm=Fe("dragenter"),dm=Fe("dragleave"),um=Fe("dragexit"),pm=Fe("dragout"),od=Fe("dragend"),ld=Fe("contextmenu"),Sr=Fe("change"),dt=Fe("input"),Tl=Fe("focus"),ja=Fe("focusin"),Fi=Fe("focusout"),kl=Fe("blur"),cd=Fe("paste"),hd=Fe("resize"),gm=Fe("scroll"),fm=Fe("submit"),me=(...s)=>ni("pointerdown")(...s)+_r,za=ni("pointerover"),mm=ni("pointerenter"),Aa=ni("pointerout"),Ps=ni("pointermove"),dd=ni("pointerup"),ud=ni("change","input"),Ml=ni("wheel","mousewheel","DOMMouseScroll"),vm=Fe("animationstart"),ym=Fe("animationend"),bm=Fe("animationiteration"),xm=Fe("transitionstart"),pd=Fe("transitionend"),$m=Fe("transitionrun"),_m=Fe("transitioncancel"),Il=ni("doubletab"),G=(s="$el")=>Ur.make("load",s),Sm=s=>_f[s]||"",gd=s=>function(){return this.prevState[s]!=this.state[s]},fd=()=>!0,ne=(s="$el")=>Ur.make("bind",s);function El(s){let e=s.deltaX,t=s.deltaY;return e===0&&s.shiftKey&&([t,e]=[e,t]),s.deltaMode===window.WheelEvent.DOM_DELTA_LINE?t*=8:s.deltaMode===window.WheelEvent.DOM_DELTA_PAGE&&(t*=24),[md(e,24),md(t,24),0]}function md(s,e){return Math.sign(s)*Math.min(e,Math.abs(s))}var Ll={addDomEvent(s,e,t,r=!1){s&&s.addEventListener(e,t,r)},removeDomEvent(s,e,t){s&&s.removeEventListener(e,t)},pos(s){return s.touches&&s.touches[0]?s.touches[0]:s},posXY(s){var e=this.pos(s);return{x:e.pageX,y:e.pageY}}};class Da{constructor(e,t={}){this.context=e,this.options=t}initialize(){}load(){}refresh(){}render(){}getRef(e){return this.context.getRef(e)}run(){}destroy(){}}const Pm=(s,e)=>{if(ft(e))switch(s){case"width":case"height":case"top":case"left":case"right":case"bottom":return e+"px"}return e},wm=(s,e,t,r=!1)=>{if(e==="cssText"){s.cssText(t);return}else if(e==="style"){if(typeof t!="string"){const i={};if(Object.entries(t).forEach(([a,n])=>{i[a]=Pm(a,n)}),r){const a=Object.keys(i).map(n=>`${n}:${i[n]};`).join("");s.attr("style",a)}else s.css(i)}return}else if(e==="class"){Array.isArray(t)?s.updateClass(kr(...t)):s.updateClass(kr(t));return}else if(e==="callback"&&typeof t=="function"){t();return}typeof t=="undefined"?s.removeAttr(e):s.el.nodeName==="TEXTAREA"&&e==="value"||e==="text"||e==="textContent"?s.text(t):e==="innerHTML"||e==="html"?s.html(t):e==="htmlDiff"?s.updateDiff(t):e==="svgDiff"?s.updateSVGDiff(t):e==="value"?s.val(t):s.attr(e,t)},Ol={};class Cm extends Da{async initialize(){Ol[this.context.sourceName]||(Ol[this.context.sourceName]=this.context.filterMethodes("bind"))}getBindMethods(){return Ol[this.context.sourceName]||[]}async bindData(...e){const t=this.getBindMethods();if(!(t!=null&&t.length))return;const r=t==null?void 0:t.filter(i=>e.length?e.indexOf(i.args[0])>-1:!0);await Promise.all(r==null?void 0:r.map(async i=>{let a=this.getRef(`${i.keywords[0]}`),n=fd;typeof a=="string"&&a!==""?n=gd(a):typeof a=="function"&&(n=a);const o=i.args[0];let l=this.context.refs[o];const c=typeof n=="function"&&n.call(this.context);if(l&&c){const d=await i.executeWithContext(this.context,...e);if(!d)return;const v=Object.keys(d);for(var h=0,u=v.length;h<u;h++){const g=v[h],y=d[g];wm(l,g,y,this.context.isServer)}}}))}destroy(){this._bindMethods=void 0}}class Tm extends Da{initialize(){var e,t;this.destroy(),this._callbacks||(this._callbacks=this.context.filterMethodes("callback")),!((e=this._bindings)!=null&&e.length)&&((t=this._callbacks)==null?void 0:t.length)&&this._callbacks.forEach(r=>this.parseCallback(r))}destroy(){this.context.notEventRedefine||this.removeCallbackAll()}getCallback(e){return this.context[e]}removeCallbackAll(){this.getBindings().forEach(e=>{this.removeCallback(e)}),this.initBindings()}removeCallback({requestId:e}){window.cancelAnimationFrame(e)}getBindings(){return this._bindings||this.initBindings(),this._bindings}addBinding(e){this.getBindings().push(e)}initBindings(){this._bindings=[]}makeCallback(e){const t=e.callback,r=i=>{t(i),e.requestId=window.requestAnimationFrame(r)};return()=>{e.requestId=window.requestAnimationFrame(r)}}addCallback(e,t){const r=this.makeCallback(e,t);this.addBinding(e),r()}bindingCallback(e,t){var l,c;const r={eventName:e.args[0],callback:t};r.codes=[],r.checkMethodList=[];const i=e.getFunction("debounce"),a=e.getFunction("throttle");if(i){var n=+(((l=i.args)==null?void 0:l[0])||0);r.callback=lt(t,n)}else if(a){var o=+(((c=a.args)==null?void 0:c[0])||0);r.callback=gi(t,o)}e.keywords.forEach(h=>{const u=h;this.getCallback(u)?r.checkMethodList.push(u):r.codes.push(u.toLowerCase())}),this.addCallback(r,e)}parseCallback(e){const t=this.context;var r=e.args;if(r){var i=t[e.originalMethod].bind(t);this.bindingCallback(e,i)}}}const km={touchstart:!0,touchmove:!0,mousedown:!0,mouseup:!0,mousemove:!0},Mm={doubletab:"touchend"},Im={doubletab:!0},Em={self(s){return s&&s.$dt&&s.$dt.is(s.target)},isAltKey(s){return s.altKey},isCtrlKey(s){return s.ctrlKey},isShiftKey(s){return s.shiftKey},isMetaKey(s){return s.metaKey||s.key=="Meta"||s.code.indexOf("Meta")>-1},isMouseLeftButton(s){return s.buttons===1},isMouseRightButton(s){return s.buttons===2},hasMouse(s){return s.pointerType==="mouse"},hasTouch(s){return s.pointerType==="touch"},hasPen(s){return s.pointerType==="pen"},preventDefault(s){return s.preventDefault(),!0},stopPropagation(s){return s.stopPropagation(),!0}};class Lm extends Da{initialize(){var e,t;this.destroy(),!(this._domEvents&&this.context.notEventRedefine)&&((!this._domEvents||this._domEvents.length===0||this._bindings.length===0)&&(this._domEvents=this.context.filterMethodes("domevent")),!((e=this._bindings)!=null&&e.length)&&((t=this._domEvents)==null?void 0:t.length)&&this._domEvents.forEach(r=>this.parseDomEvent(r)))}destroy(){this.context.notEventRedefine||this.removeEventAll()}getCallback(e){return this.context[e]||Em[e]}removeEventAll(){this.getBindings().forEach(e=>{this.removeDomEvent(e)}),this.initBindings()}removeDomEvent({eventName:e,dom:t,callback:r}){Ll.removeDomEvent(t,e,r)}getBindings(){return this._bindings||this.initBindings(),this._bindings}addBinding(e){this.getBindings().push(e)}initBindings(){this._bindings=[]}matchPath(e,t){return e?e.matches(t)?e:this.matchPath(e.parentElement,t):null}hasDelegate(e,t){return this.matchPath(e.target||e.srcElement,t.delegate)}makeCallback(e,t,r){return e.delegate?this.makeDelegateCallback(e,t,r):this.makeDefaultCallback(e,t,r)}makeDefaultCallback(e,t,r){return i=>{var a=this.runEventCallback(i,e,t,r);if(ke(a))return a}}makeDelegateCallback(e,t,r){return i=>{const a=this.hasDelegate(i,e);if(a){i.$dt=ge.create(a);var n=this.runEventCallback(i,e,t,r);if(ke(n))return n}}}runEventCallback(e,t,r,i){const a=this.context;if(e.xy=Ll.posXY(e),t.beforeMethods.length&&t.beforeMethods.every(o=>this.getCallback(o.target).call(a,e,o.param)),this.checkEventType(e,t)){var n=i(e,e.$dt,e.xy);return n!==!1&&t.afterMethods.length&&t.afterMethods.forEach(o=>this.getCallback(o.target).call(a,e,o.param)),n}}checkEventType(e,t){const r=this.context;var i=!0;t.codes.length&&(i=(e.code?t.codes.indexOf(e.code.toLowerCase())>-1:!1)||(e.key?t.codes.indexOf(e.key.toLowerCase())>-1:!1));var a=!0;return t.checkMethodList.length&&(a=t.checkMethodList.every(n=>{var o=this.getCallback(n);return de(o)&&o?o.call(r,e):ke(o)?!!o:!0})),i&&a}getDefaultDomElement(e){const t=this.context;let r;return e?r=t.refs[e]||t[e]||window[e]:r=t.el||t.$el||t.$root,r instanceof ge?r.getElement():r}getRealEventName(e){return Mm[e]||e}getCustomEventName(e){return Im[e]?e:""}getDefaultEventObject(e,t,r,i,a){var g,y;const n={eventName:this.getRealEventName(e),customEventName:this.getCustomEventName(e),callback:a},[,,...o]=i.args;n.dom=this.getDefaultDomElement(t),n.delegate=o.join(td),n.beforeMethods=[],n.afterMethods=[],n.codes=[],n.checkMethodList=[];const l=i.getFunction("debounce"),c=i.getFunction("throttle");if(l){var h=+(((g=l.args)==null?void 0:g[0])||0);n.callback=lt(a,h)}else if(c){var u=+(((y=c.args)==null?void 0:y[0])||0);n.callback=gi(a,u)}const d=i.getFunctionList("after"),v=i.getFunctionList("before");return d.length&&d.forEach(P=>{var S=P.args[0].split(" "),[O,E]=S;n.afterMethods.push({target:O,param:E})}),v.length&&v.forEach(P=>{var S=P.args[0].split(" "),[O,E]=S;n.beforeMethods.push({target:O,param:E})}),i.keywords.forEach(P=>{const S=P;this.getCallback(S)?n.checkMethodList.push(S):n.codes.push(S.toLowerCase())}),n}addDomEvent(e,t,r){e.callback=this.makeCallback(e,t,r),this.addBinding(e);var i=!1;t.hasKeyword("capture")&&(i=!0),km[e.eventName]&&(i={passive:!0,capture:i}),e.dom&&Ll.addDomEvent(e.dom,e.eventName,e.callback,i)}makeCustomEventCallback(e,t,r){var n;if(e.customEventName==="doubletab"){var i=300,a=t.getFunction("delay");return a&&(i=+(((n=a.args)==null?void 0:n[0])||0)),(...o)=>{this.doubleTab?(window.performance.now()-this.doubleTab.time<i&&r(...o),this.doubleTab=null):this.doubleTab={time:window.performance.now()}}}return r}bindingDomEvent([e,t,...r],i,a){let n=this.getDefaultEventObject(e,t,r,i,a);n.callback=this.makeCustomEventCallback(n,i,n.callback),this.addDomEvent(n,i,n.callback)}getEventNames(e){let t=[];return e.split(ro).forEach(r=>{var i=r.split(ro);t.push.apply(t,i)}),t}parseDomEvent(e){const t=this.context;var r=e.args;if(r){var i=this.getEventNames(r[0]),a=t[e.originalMethod].bind(t);for(let n=0,o=i.length;n<o;n++)r[0]=i[n],this.bindingDomEvent(r,e,a)}}}class Om extends Da{initialize(){var e,t;this.destroy(),!(this._observers&&this.context.notEventRedefine)&&((!this._observers||this._observers.length===0)&&(this._observers=this.context.filterMethodes("observer")),!((e=this._bindings)!=null&&e.length)&&((t=this._observers)==null?void 0:t.length)&&this._observers.forEach(r=>this.parseObserver(r)))}destroy(){this.context.notEventRedefine||this.removeEventAll()}removeEventAll(){this.getBindings().forEach(e=>{this.removeDomEvent(e)}),this.initBindings()}disconnectObserver(e){e==null||e.disconnect()}getBindings(){return this._bindings||this.initBindings(),this._bindings}addBinding(e){this.getBindings().push(e)}initBindings(){this._bindings=[]}addObserver(e){this.addBinding(e)}getDefaultDomElement(e){const t=this.context;let r;return e?r=t.refs[e]||t[e]||window[e]:r=t.el||t.$el||t.$root,r instanceof ge?r.getElement():r}createObserver(e,t){var c;const[r,i]=e.args||["intersection"],a=this.getDefaultDomElement(i),n=e.getFunction("params"),o=Va((c=n==null?void 0:n.args)==null?void 0:c[0]);let l;switch(r){case"intersection":o.root&&(o.root=this.getDefaultDomElement(o.root)),l=new window.IntersectionObserver(t,o||{}),l.observe(a);break;case"mutation":l=new window.MutationObserver(t),l.observe(a,o||{attributes:!0,characterData:!0,childList:!0});break;case"performance":l=new window.PerformanceObserver(t),l.observe(o||{entryTypes:["paint"]});break}return l}bindingObserver(e,t){this.addObserver(this.createObserver(e,t))}parseObserver(e){const t=this.context;var r=t[e.originalMethod].bind(t);this.bindingObserver(e,r)}}class Vm extends Da{initialize(){var e,t;this.destroy(),this._callbacks||(this._callbacks=this.context.filterMethodes("subscribe")),!((e=this._bindings)!=null&&e.length)&&((t=this._callbacks)==null?void 0:t.length)&&this._callbacks.forEach(r=>this.parseSubscribe(r))}destroy(){this.context.notEventRedefine||this.context.$store.offAll(this.context)}getCallback(e){return this.context[e]}getBindings(){return this._bindings||this.initBindings(),this._bindings}addBinding(e){this.getBindings().push(e)}initBindings(){this._bindings=[]}createLocalCallback(e,t){var r=t.bind(this.context);return r.displayName=`${this.context.sourceName}.${e}`,r.source=this.context.source,r}parseSubscribe(e){var P,S;const t=e.args.join(" "),r=[],i=[];let a=0,n=0,o=!1,l=!1,c=!1;const h=e.getFunction("debounce"),u=e.getFunction("throttle"),d=e.getFunction("allTrigger"),v=e.getFunction("selfTrigger"),g=e.getFunction("frame");h&&(a=+(((P=h.args)==null?void 0:P[0])||0)),u&&(n=+(((S=u.args)==null?void 0:S[0])||0)),d&&(o=!0),v&&(l=!0),g&&(c=!0),e.keywords.forEach(O=>{const E=O;this.context[E]?r.push(E):i.push(E)});const y=this.context[e.originalMethod];[...i,t].filter(Boolean).forEach(O=>{var E=this.createLocalCallback(O,y);this.context.$store.on(O,E,this.context,a,n,o,l,r,c)}),this.addBinding(e)}}Kh({BindHandler:Cm,CallbackHandler:Tm,DomEventHandler:Lm,ObserverHandler:Om,StoreHandler:Vm});const Fa="ref",vd=ge.create("div"),yd=`[${Fa}]`,Vl="refclass",Rm=`[${Vl}]`,bd=[],gh=class{constructor(e,t){wt(this,tl);wt(this,Fn);wt(this,rl);wt(this,di,{});wt(this,el,{});wt(this,jn,0);wt(this,_a,void 0);wt(this,zn,void 0);wt(this,Sa,void 0);wt(this,Pa,{});wt(this,ys,{});wt(this,An,!1);wt(this,Dn,[]);this.refs={},this.children={},this.id=bl(),this.initializeProperty(e,t),this.handlers=this.initializeHandler(),this.initComponents()}get __timestamp(){return Te(this,jn)}get timestamp(){return Te(this,zn)}set timestamp(e){Ct(this,zn,e)}get target(){return this.$el.el}checkProps(e={}){return e}initializeProperty(e,t={}){this.opt=e||{},this.parent=this.opt,this.source=bl(),this.sourceName=this.constructor.name,this.props=new Proxy(Te(this,Pa),{get:(r,i)=>Kn(this,rl,tf).call(this,i),set:(r,i)=>{throw new Error(`${i} is readonly`)}}),Kn(this,Fn,kh).call(this,t)}hasProp(e){return Te(this,Dn).includes(e==null?void 0:e.toUpperCase())}setServer(e=!0){Ct(this,An,e)}get isServer(){var e;return((e=this.parent)==null?void 0:e.isServer)||Te(this,An)}initComponents(){this.childComponents=this.components()}initializeHandler(){return Zh(this)}initState(){return{}}setState(e={},t=!0){Ct(this,el,Te(this,di)),Ct(this,di,Object.assign({},Te(this,di),e)),t&&this.load()}toggleState(e,t=!0){this.setState({[e]:!Te(this,di)[e]},t)}apply(e){return Nh(e)}_reload(e,t=null){t&&this.render(t),Kn(this,Fn,kh).call(this,e),Ct(this,di,{}),this.setState(this.initState(),!1),this.refresh(!0)}checkLoad(e){window.requestAnimationFrame(()=>{this.render(e)})}get state(){return Te(this,di)}get propKeys(){return Te(this,ys)}get isPreLoaded(){return!0}async render(e){if(!this.isPreLoaded){this.checkLoad(e);return}const t=this.template(),r=this.parseTemplate(t);return this.$el?this.$el.htmlDiff(r):(this.$el=r,this.refs.$el=this.$el,e&&e.append(this.$el)),await this.load(),this.afterRender(),this}get html(){return this.$el.outerHTML()}initialize(){Ct(this,di,this.initState())}afterRender(){}components(){return b({},this.parent.childComponents)}getRef(...e){const t=e.join("");return this.refs[t]}refreshElementReference(e,t){for(var r=e.$$(yd),i=0,a=r.length;i<a;i++){const n=r[i],o=n.attr(Fa);this.refs[o]?this.refs[o].is(n)===!1&&(this.refs[o]=n):this.refs[o]=n}this.afterLoadRendering(e,t)}afterLoadRendering(){}afterComponentRendering(){}parseTemplate(e,t){let r=ge.makeElementList(e);for(var i=0,a=r.length;i<a;i++){const u=r[i];var n=u.attr(Fa);n&&(t||(this.refs[n]=u));for(var o=u.$$(yd),l={},c=0,h=o.length;c<h;c++){const d=o[c],v=d.attr(Fa);l[v]?console.warn(`${n} is duplicated. - ${this.sourceName}`,this):l[v]=!0,t||(this.refs[v]=d)}}return t?(vd.append(r),vd.createChildrenFragment()):r[0]}parsePropertyInfo(e){let t={};for(var r of e.attributes){const a=r.name||r.nodeName,n=r.value||r.nodeValue;if(Bh(a)){const o=Va(a);Hr(o)?t=Object.assign(t,o):t[a]=Va(n)}else t[a]=Va(n)}const i=e.html();return i&&(t.content=i,t.contentChildren=this.parseContent(t.content)),t}parseSourceName(e){return e.parent?[e.sourceName,...this.parseSourceName(e.parent)]:[e.sourceName]}getEventMachineComponent(e){var t=Wh(e)||this.childComponents[e];return t}createFunctionComponent(e,t,r=gh){class i extends r{template(){return e.call(this,this.props)}}return new i(this,t)}createInstanceForComponent(e,t,r){return e.__proto__.name==="ProxyComponent"?new e({target:t,props:r}):e.__proto__.name===""&&de(e)?this.createFunctionComponent(e,r):new e(this,r)}async renderComponent({$dom:e,refName:t,component:r,props:i}){var n;var a=null;this.children[t]?(a=this.children[t],a.timestamp=this.__timestamp,a._reload(i)):(a=this.createInstanceForComponent(r,e.$parent.el,i),a.timestamp=this.__timestamp,this.children[t||a.id]=a,de(a.render)&&await a.render()),this.afterComponentRendering(e,t,a,i),a.renderTarget?((n=a.$el)==null||n.appendTo(a.renderTarget),e.remove()):a.$el?e.replace(a.$el):e.remove()}parseContent(e,t=[]){return ge.create("div").html(e).children().map(r=>this._getComponentInfo(r)).filter(r=>t.length===0?!0:t.includes(r.refClass))}_getComponentInfo(e){const t=e.attr(Vl),r=this.getEventMachineComponent(t);if(r){let i=this.parsePropertyInfo(e),a=e.attr(Fa);return{$dom:e,refClass:t,props:i,refName:a||i.ref,component:r}}else return{refClass:t,notUsed:!0,$dom:e}}getComponentInfoList(e){if(!e)return bd;let t=e.$$(Rm).filter(r=>r.path().filter(i=>i.attr(Vl)).length===1);return t.length?t.map(r=>this._getComponentInfo(r)):bd}async parseComponent(){const e=this.$el,t=this.getComponentInfoList(e);!t.length||(await Promise.all(t.map(async r=>{r.notUsed?(r.$dom.remove(),console.warn(`${r.refClass} is not used.`)):await this.renderComponent(r)})),La(this.children,(r,i)=>{i.timestamp!==this.__timestamp&&i.clean()}))}clean(){if(this.$el&&!this.$el.hasParent())return La(this.children,(e,t)=>{de(t==null?void 0:t.clean)&&t.clean()}),this.destroy(),!0}refresh(){this.load()}async _afterLoad(){Kn(this,tl,ef).call(this),this.runHandlers("initialize"),await this.bindData(),await this.parseComponent()}async makeLoadAction(e){const[t,...r]=e.args;let i=e.hasKeyword("domdiff");const a=this.refs[t];if(a){const n=await e.execute(...r),o=this.parseTemplate(n,!0);i?a.htmlDiff(o):a.html(o),this.refreshElementReference(a,t)}}async load(...e){Te(this,_a)||Ct(this,_a,this.filterMethodes("load"));const t=Te(this,_a).filter(r=>e.length===0?!0:r.args[0]===e[0]);await Promise.all(t.map(async r=>{await this.makeLoadAction(r)})),await this._afterLoad()}async runHandlers(e="run",...t){await Promise.all(this.handlers.filter(r=>r[e]).map(async r=>{await r[e](...t)}))}async bindData(...e){await this.runHandlers("bindData",...e)}template(){return null}eachChildren(e){!de(e)||Object.keys(this.children).forEach(t=>{e(this.children[t])})}hmr(){this.created(),this.initialize(),this.rerender(),this.eachChildren(e=>{e.hmr()})}rerender(){var e=this.$el.parent();this.destroy(),this.render(e)}destroy(){this.eachChildren(e=>{e.destroy()}),this.runHandlers("destroy"),this.$el&&this.$el.remove(),this.$el=null,this.refs={},this.children={}}collectMethodes(e=!1){return(!Te(this,Sa)||e)&&Ct(this,Sa,Ke(this,t=>Ur.check(t)).map(t=>Ur.parse(t,this))),Te(this,Sa)}filterMethodes(e,t=!1){return this.collectMethodes(t).filter(r=>r.method===e)}findChildren(e){return this.props.contentChildren.filter(t=>t.component===e)}getChildContent(e,t=""){var r;return((r=this.getChild(e))==null?void 0:r.props.content)||t}getChild(e){return this.props.contentChildren.find(e)}};let Rl=gh;di=new WeakMap,el=new WeakMap,jn=new WeakMap,_a=new WeakMap,zn=new WeakMap,Sa=new WeakMap,Pa=new WeakMap,ys=new WeakMap,An=new WeakMap,Dn=new WeakMap,tl=new WeakSet,ef=function(){Jg(this,jn)._++},Fn=new WeakSet,kh=function(e){Ct(this,Pa,this.checkProps(e)),Ct(this,ys,{}),Object.keys(e).forEach(t=>{Te(this,ys)[t.toUpperCase()]=t}),Ct(this,Dn,Object.keys(Te(this,ys)))},rl=new WeakSet,tf=function(e){return Te(this,Pa)[Te(this,ys)[e.toUpperCase()]]};const il=class extends Rl{constructor(t,r={}){super(t,r);wt(this,Ks,void 0);r.store?Ct(this,Ks,r.store):Ct(this,Ks,new xl),this.created(),this.initialize()}currentContext(){return this.contexts[this.contexts.length-1]}setStore(t){Ct(this,Ks,t)}get $store(){return Te(this,Ks)||this.parent.$store}async created(){}createLocalCallback(t,r){var i=r.bind(this);return i.displayName=`${this.sourceName}.${t}`,i.source=this.source,i}emit(t,...r){this.$store.source=this.source,this.$store.sourceContext=this,this.$store.emit(t,...r)}nextTick(t,r=0){window.setTimeout(()=>{this.$store.nextTick(t)},r)}trigger(t,...r){this.$store.source=this.source,this.$store.trigger(t,...r)}broadcast(t,...r){Object.keys(this.children).forEach(i=>{this.children[i].trigger(t,...r),this.children[i].broadcast(t,...r)})}on(t,r,i=0,a=0,n=!1,o=!1,l=!1){this.$store.on(t,r,this.source,i,a,n,o,[],l)}off(t,r){this.$store.off(t,r,this.source)}subscribe(t,r=0,i=0){const a=`subscribe.${Jn()}`,n=this.createLocalCallback(a,t);return this.$store.on(a,n,this,r,i,!1,!0),a}createFunctionComponent(t,r,i=il){return super.createFunctionComponent(t,r,i)}static createElementInstance(t,r){if(t.__proto__.name===""){class i extends il{template(){return t.call(this,this.props)}}return new i(r,r)}else return new t(r,r)}};let oi=il;Ks=new WeakMap;const jl=(s,e)=>{const t=ge.create(e.container||document.body),r=oi.createElementInstance(s,e);return r.render(t),Xh(r),r};async function jm(s,e){const t=oi.createElementInstance(s,e);return t.setServer(!0),(await t.render()).html}function zm(s,e=""){var t=s||{};return Object.keys(t).filter(r=>ke(t[r])).map(r=>`${r}: ${t[r]}`).join(";"+e)}function Am(s){return Object.keys(s||{}).map(t=>t==="class"&&Hr(s[t])?`${t}="${kr(s[t])}"`:t==="style"&&Hr(s[t])?`${t}="${zm(s[t])}"`:ai(s[t])||Tt(s[t])||s[t]==="undefined"?s[t]?t:"":`${t}="${s[t]}"`).join(" ")}function R(s,e={},t=[]){t=t.flat(1/0).join("");let r;r=Object.keys(e).length?ji(e):"";const i=e.ref?`ref="${e.ref}"`:"";return`<object refClass="${s}" ${i} ${r}>${t}</object>`}function Ba(...s){return s.map(e=>{let t,r={},i=[];return it(e)?t=e:Gt(e)&&([t,r={},i=[]]=e),i.length?R(t,r,Ba(i)):R(t,r)}).join(` `)}function ao(s,e,t=[]){return t=t.flat(1/0),`<${s} ${Am(e)}>${t.join(" ")}</${s}>`}function C(s,e={},...t){if(t=t.flat(1/0),s===Lt)return t;if(e=e||{},typeof s!="string"){const r=s.name;return zi({[r]:s}),R(r,e,t)}else return ao(s,e,t)}const Lt=new Object;var L7="",O7="",fi=1e-6,ir=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var s=0,e=arguments.length;e--;)s+=arguments[e]*arguments[e];return Math.sqrt(s)});function xd(){var s=new ir(9);return ir!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[5]=0,s[6]=0,s[7]=0),s[0]=1,s[4]=1,s[8]=1,s}function zl(s,e,t){var r=e[0],i=e[1],a=e[2],n=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=t[0],v=t[1],g=t[2],y=t[3],P=t[4],S=t[5],O=t[6],E=t[7],I=t[8];return s[0]=d*r+v*n+g*c,s[1]=d*i+v*o+g*h,s[2]=d*a+v*l+g*u,s[3]=y*r+P*n+S*c,s[4]=y*i+P*o+S*h,s[5]=y*a+P*l+S*u,s[6]=O*r+E*n+I*c,s[7]=O*i+E*o+I*h,s[8]=O*a+E*l+I*u,s}function Dm(s,e){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=1,s[5]=0,s[6]=e[0],s[7]=e[1],s[8]=1,s}function Fm(s,e){var t=Math.sin(e),r=Math.cos(e);return s[0]=r,s[1]=t,s[2]=0,s[3]=-t,s[4]=r,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s}function Bm(s,e){return s[0]=e[0],s[1]=0,s[2]=0,s[3]=0,s[4]=e[1],s[5]=0,s[6]=0,s[7]=0,s[8]=1,s}function Ot(){var s=new ir(16);return ir!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s}function Bi(s,e,t,r,i,a,n,o,l,c,h,u,d,v,g,y){var P=new ir(16);return P[0]=s,P[1]=e,P[2]=t,P[3]=r,P[4]=i,P[5]=a,P[6]=n,P[7]=o,P[8]=l,P[9]=c,P[10]=h,P[11]=u,P[12]=d,P[13]=v,P[14]=g,P[15]=y,P}function Nm(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=1,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,s}function $d(s,e){if(s===e){var t=e[1],r=e[2],i=e[3],a=e[6],n=e[7],o=e[11];s[1]=e[4],s[2]=e[8],s[3]=e[12],s[4]=t,s[6]=e[9],s[7]=e[13],s[8]=r,s[9]=a,s[11]=e[14],s[12]=i,s[13]=n,s[14]=o}else s[0]=e[0],s[1]=e[4],s[2]=e[8],s[3]=e[12],s[4]=e[1],s[5]=e[5],s[6]=e[9],s[7]=e[13],s[8]=e[2],s[9]=e[6],s[10]=e[10],s[11]=e[14],s[12]=e[3],s[13]=e[7],s[14]=e[11],s[15]=e[15];return s}function Dt(s,e){var t=e[0],r=e[1],i=e[2],a=e[3],n=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],v=e[11],g=e[12],y=e[13],P=e[14],S=e[15],O=t*o-r*n,E=t*l-i*n,I=t*c-a*n,V=r*l-i*o,B=r*c-a*o,U=i*c-a*l,X=h*y-u*g,ce=h*P-d*g,he=h*S-v*g,ye=u*P-d*y,ve=u*S-v*y,Re=d*S-v*P,Q=O*Re-E*ve+I*ye+V*he-B*ce+U*X;return Q?(Q=1/Q,s[0]=(o*Re-l*ve+c*ye)*Q,s[1]=(i*ve-r*Re-a*ye)*Q,s[2]=(y*U-P*B+S*V)*Q,s[3]=(d*B-u*U-v*V)*Q,s[4]=(l*he-n*Re-c*ce)*Q,s[5]=(t*Re-i*he+a*ce)*Q,s[6]=(P*I-g*U-S*E)*Q,s[7]=(h*U-d*I+v*E)*Q,s[8]=(n*ve-o*he+c*X)*Q,s[9]=(r*he-t*ve-a*X)*Q,s[10]=(g*B-y*I+S*O)*Q,s[11]=(u*I-h*B-v*O)*Q,s[12]=(o*ce-n*ye-l*X)*Q,s[13]=(t*ye-r*ce+i*X)*Q,s[14]=(y*E-g*V-P*O)*Q,s[15]=(h*V-u*E+d*O)*Q,s):null}function Vt(s,e,t){var r=e[0],i=e[1],a=e[2],n=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],v=e[10],g=e[11],y=e[12],P=e[13],S=e[14],O=e[15],E=t[0],I=t[1],V=t[2],B=t[3];return s[0]=E*r+I*o+V*u+B*y,s[1]=E*i+I*l+V*d+B*P,s[2]=E*a+I*c+V*v+B*S,s[3]=E*n+I*h+V*g+B*O,E=t[4],I=t[5],V=t[6],B=t[7],s[4]=E*r+I*o+V*u+B*y,s[5]=E*i+I*l+V*d+B*P,s[6]=E*a+I*c+V*v+B*S,s[7]=E*n+I*h+V*g+B*O,E=t[8],I=t[9],V=t[10],B=t[11],s[8]=E*r+I*o+V*u+B*y,s[9]=E*i+I*l+V*d+B*P,s[10]=E*a+I*c+V*v+B*S,s[11]=E*n+I*h+V*g+B*O,E=t[12],I=t[13],V=t[14],B=t[15],s[12]=E*r+I*o+V*u+B*y,s[13]=E*i+I*l+V*d+B*P,s[14]=E*a+I*c+V*v+B*S,s[15]=E*n+I*h+V*g+B*O,s}function kt(s,e,t){var r=t[0],i=t[1],a=t[2],n,o,l,c,h,u,d,v,g,y,P,S;return e===s?(s[12]=e[0]*r+e[4]*i+e[8]*a+e[12],s[13]=e[1]*r+e[5]*i+e[9]*a+e[13],s[14]=e[2]*r+e[6]*i+e[10]*a+e[14],s[15]=e[3]*r+e[7]*i+e[11]*a+e[15]):(n=e[0],o=e[1],l=e[2],c=e[3],h=e[4],u=e[5],d=e[6],v=e[7],g=e[8],y=e[9],P=e[10],S=e[11],s[0]=n,s[1]=o,s[2]=l,s[3]=c,s[4]=h,s[5]=u,s[6]=d,s[7]=v,s[8]=g,s[9]=y,s[10]=P,s[11]=S,s[12]=n*r+h*i+g*a+e[12],s[13]=o*r+u*i+y*a+e[13],s[14]=l*r+d*i+P*a+e[14],s[15]=c*r+v*i+S*a+e[15]),s}function li(s,e,t){var r=t[0],i=t[1],a=t[2];return s[0]=e[0]*r,s[1]=e[1]*r,s[2]=e[2]*r,s[3]=e[3]*r,s[4]=e[4]*i,s[5]=e[5]*i,s[6]=e[6]*i,s[7]=e[7]*i,s[8]=e[8]*a,s[9]=e[9]*a,s[10]=e[10]*a,s[11]=e[11]*a,s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15],s}function Gm(s,e,t,r){var i=r[0],a=r[1],n=r[2],o=Math.hypot(i,a,n),l,c,h,u,d,v,g,y,P,S,O,E,I,V,B,U,X,ce,he,ye,ve,Re,Q,He;return o<fi?null:(o=1/o,i*=o,a*=o,n*=o,l=Math.sin(t),c=Math.cos(t),h=1-c,u=e[0],d=e[1],v=e[2],g=e[3],y=e[4],P=e[5],S=e[6],O=e[7],E=e[8],I=e[9],V=e[10],B=e[11],U=i*i*h+c,X=a*i*h+n*l,ce=n*i*h-a*l,he=i*a*h-n*l,ye=a*a*h+c,ve=n*a*h+i*l,Re=i*n*h+a*l,Q=a*n*h-i*l,He=n*n*h+c,s[0]=u*U+y*X+E*ce,s[1]=d*U+P*X+I*ce,s[2]=v*U+S*X+V*ce,s[3]=g*U+O*X+B*ce,s[4]=u*he+y*ye+E*ve,s[5]=d*he+P*ye+I*ve,s[6]=v*he+S*ye+V*ve,s[7]=g*he+O*ye+B*ve,s[8]=u*Re+y*Q+E*He,s[9]=d*Re+P*Q+I*He,s[10]=v*Re+S*Q+V*He,s[11]=g*Re+O*Q+B*He,e!==s&&(s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15]),s)}function Hm(s,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11];return e!==s&&(s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15]),s[4]=a*i+c*r,s[5]=n*i+h*r,s[6]=o*i+u*r,s[7]=l*i+d*r,s[8]=c*i-a*r,s[9]=h*i-n*r,s[10]=u*i-o*r,s[11]=d*i-l*r,s}function Um(s,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[0],n=e[1],o=e[2],l=e[3],c=e[8],h=e[9],u=e[10],d=e[11];return e!==s&&(s[4]=e[4],s[5]=e[5],s[6]=e[6],s[7]=e[7],s[12]=e[12],s[13]=e[13],s[14]=e[14],s[15]=e[15]),s[0]=a*i-c*r,s[1]=n*i-h*r,s[2]=o*i-u*r,s[3]=l*i-d*r,s[8]=a*r+c*i,s[9]=n*r+h*i,s[10]=o*r+u*i,s[11]=l*r+d*i,s}function _d(s,e,t){var r=Math.sin(t),i=Math.cos(t),a=e[0],n=e[1],o=e[2],l=e[3],c=e[4],h=e[5],u=e[6],d=e[7];return e!==s&&(s[8]=e