@dooboostore/dom-render 1.0.102 → 1.0.103

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.
Files changed (57) hide show
  1. package/DomRender.d.ts +21 -6
  2. package/DomRender.js +54 -23
  3. package/DomRenderProxy.d.ts +7 -3
  4. package/DomRenderProxy.js +120 -49
  5. package/README.MD +380 -65
  6. package/components/ComponentBase.d.ts +11 -9
  7. package/components/ComponentBase.js +41 -14
  8. package/components/ComponentSet.d.ts +2 -2
  9. package/components/appender/Appender.d.ts +2 -2
  10. package/components/checkbox/CheckBox.d.ts +4 -4
  11. package/components/choose/Choose.d.ts +4 -4
  12. package/components/choose/Choose.js +0 -16
  13. package/components/details/Details.d.ts +5 -5
  14. package/components/forOf/ForOf.d.ts +2 -2
  15. package/components/if/If.d.ts +2 -2
  16. package/components/index.d.ts +26 -24
  17. package/components/index.js +2 -1
  18. package/components/input/Input.d.ts +2 -2
  19. package/components/input/Input.js +27 -24
  20. package/components/promise/PromiseSwitch.d.ts +6 -6
  21. package/components/promise/PromiseSwitch.js +15 -0
  22. package/components/radio/Radio.d.ts +4 -4
  23. package/components/router/Route.d.ts +32 -0
  24. package/components/router/Route.js +116 -0
  25. package/components/select/Select.d.ts +3 -3
  26. package/components/select/Select.js +2 -2
  27. package/components/this/This.d.ts +9 -2
  28. package/components/this/This.js +24 -2
  29. package/components/timer/Timer.d.ts +2 -2
  30. package/configs/Config.d.ts +6 -1
  31. package/decorators/DomRenderNoProxy.d.ts +2 -0
  32. package/decorators/DomRenderNoProxy.js +15 -0
  33. package/dist/bundle.js +2 -0
  34. package/events/EventManager.d.ts +16 -4
  35. package/events/EventManager.js +320 -140
  36. package/index.d.ts +48 -1
  37. package/index.js +40 -0
  38. package/lifecycle/OnDestroyRender.d.ts +1 -1
  39. package/lifecycle/OnProxyDomRender.d.ts +1 -0
  40. package/lifecycle/OnProxyDomRender.js +1 -1
  41. package/operators/DrForOf.js +2 -1
  42. package/operators/DrIf.js +3 -2
  43. package/operators/DrTargetElement.js +2 -1
  44. package/operators/DrTargetElementIsElement.d.ts +0 -5
  45. package/operators/DrTargetElementIsElement.js +2 -1
  46. package/operators/DrThis.js +40 -11
  47. package/operators/OperatorExecuter.js +3 -1
  48. package/package.json +5 -4
  49. package/rawsets/Attrs.d.ts +2 -0
  50. package/rawsets/RawSet.d.ts +2 -2
  51. package/rawsets/RawSet.js +48 -33
  52. package/routers/HashRouter.d.ts +5 -4
  53. package/routers/HashRouter.js +8 -5
  54. package/routers/PathRouter.d.ts +5 -4
  55. package/routers/PathRouter.js +6 -4
  56. package/routers/Router.d.ts +22 -8
  57. package/routers/Router.js +44 -24
package/dist/bundle.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see bundle.js.LICENSE.txt */
2
+ var t,e,n,r,i,s,o,a,c,l,h,u,d,p,f,g,m={494:(t,e,n)=>{var r;!function(t){!function(){var e="object"==typeof globalThis?globalThis:"object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),r=i(t);function i(t,e){return function(n,r){Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0!==e.Reflect&&(r=i(e.Reflect,r)),function(t,e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,c=!o&&!a,l={create:o?function(){return F(Object.create(null))}:a?function(){return F({__proto__:null})}:function(){return F({})},has:c?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:c?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),u="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[s]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,L(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,i)},e.prototype.entries=function(){return new n(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[s]=function(){return this.entries()},e.prototype._find=function(t,e){if(!L(this._cacheKey,t)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++)if(L(this._keys[n],t)){this._cacheIndex=n;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function i(t,e){return e}function o(t,e){return[t,e]}}(),d="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function t(){this._map=new u}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[s]=function(){return this.keys()},t}(),p="function"==typeof WeakMap?WeakMap:function(){var t=l.create(),e=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var e;do{e="@@WeakMap@@"+o()}while(l.has(t,e));return t[e]=!0,e}function i(t,r){if(!n.call(t,e)){if(!r)return;Object.defineProperty(t,e,{value:l.create()})}return t[e]}function s(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function o(){var t=function(t){if("function"==typeof Uint8Array){var e=new Uint8Array(t);return"undefined"!=typeof crypto?crypto.getRandomValues(e):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(e):s(e,t),e}return s(new Array(t),t)}(16);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var e="",n=0;n<16;++n){var r=t[n];4!==n&&6!==n&&8!==n||(e+="-"),r<16&&(e+="0"),e+=r.toString(16).toLowerCase()}return e}}(),f=r?Symbol.for("@reflect-metadata:registry"):void 0,g=function(){var t;return!S(f)&&O(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[f]),S(t)&&(t=function(){var t,n,r,i;S(f)||void 0===e.Reflect||f in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=function(t){var e=t.defineMetadata,n=t.hasOwnMetadata,r=t.getOwnMetadata,i=t.getOwnMetadataKeys,s=t.deleteMetadata,o=new p;return{isProviderFor:function(t,e){var n=o.get(t);return!(S(n)||!n.has(e))||!!i(t,e).length&&(S(n)&&(n=new d,o.set(t,n)),n.add(e),!0)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:s}}(e.Reflect));var s=new p,o={registerProvider:a,getProvider:l,setProvider:g};return o;function a(e){if(!Object.isExtensible(o))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case S(n):n=e;break;case n===e:break;case S(r):r=e;break;case r===e:break;default:void 0===i&&(i=new d),i.add(e)}}function c(e,s){if(!S(n)){if(n.isProviderFor(e,s))return n;if(!S(r)){if(r.isProviderFor(e,s))return n;if(!S(i))for(var o=j(i);;){var a=B(o);if(!a)return;var c=D(a);if(c.isProviderFor(e,s))return $(o),c}}}if(!S(t)&&t.isProviderFor(e,s))return t}function l(t,e){var n,r=s.get(t);return S(r)||(n=r.get(e)),S(n)?(S(n=c(t,e))||(S(r)&&(r=new u,s.set(t,r)),r.set(e,n)),n):n}function h(t){if(S(t))throw new TypeError;return n===t||r===t||!S(i)&&i.has(t)}function g(t,e,n){if(!h(n))throw new Error("Metadata provider not registered.");var r=l(t,e);if(r!==n){if(!S(r))return!1;var i=s.get(t);S(i)&&(i=new u,s.set(t,i)),i.set(e,n)}return!0}}()),!S(f)&&O(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,f,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}(),m=function(t){var e=new p,n={isProviderFor:function(t,n){var r=e.get(t);return!S(r)&&r.has(n)},OrdinaryDefineOwnMetadata:function(t,e,n,i){r(n,i,!0).set(t,e)},OrdinaryHasOwnMetadata:function(t,e,n){var i=r(e,n,!1);return!S(i)&&w(i.has(t))},OrdinaryGetOwnMetadata:function(t,e,n){var i=r(e,n,!1);if(!S(i))return i.get(t)},OrdinaryOwnMetadataKeys:function(t,e){var n=[],i=r(t,e,!1);if(S(i))return n;for(var s=j(i.keys()),o=0;;){var a=B(s);if(!a)return n.length=o,n;var c=D(a);try{n[o]=c}catch(t){try{$(s)}finally{throw t}}o++}},OrdinaryDeleteMetadata:function(t,n,i){var s=r(n,i,!1);if(S(s))return!1;if(!s.delete(t))return!1;if(0===s.size){var o=e.get(n);S(o)||(o.delete(i),0===o.size&&e.delete(o))}return!0}};return g.registerProvider(n),n;function r(r,i,s){var o=e.get(r),a=!1;if(S(o)){if(!s)return;o=new u,e.set(r,o),a=!0}var c=o.get(i);if(S(c)){if(!s)return;if(c=new u,o.set(i,c),!t.setProvider(r,i,n))throw o.delete(i),a&&e.delete(r),new Error("Wrong provider for target.")}return c}}(g);function y(t,e,n){if(A(t,e,n))return!0;var r=V(e);return!N(r)&&y(t,r,n)}function A(t,e,n){var r=H(e,n,!1);return!S(r)&&w(r.OrdinaryHasOwnMetadata(t,e,n))}function _(t,e,n){if(A(t,e,n))return E(t,e,n);var r=V(e);return N(r)?void 0:_(t,r,n)}function E(t,e,n){var r=H(e,n,!1);if(!S(r))return r.OrdinaryGetOwnMetadata(t,e,n)}function b(t,e,n,r){H(n,r,!0).OrdinaryDefineOwnMetadata(t,e,n,r)}function T(t,e){var n=R(t,e),r=V(t);if(null===r)return n;var i=T(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var s=new d,o=[],a=0,c=n;a<c.length;a++){var l=c[a];s.has(l)||(s.add(l),o.push(l))}for(var h=0,u=i;h<u.length;h++)l=u[h],s.has(l)||(s.add(l),o.push(l));return o}function R(t,e){var n=H(t,e,!1);return n?n.OrdinaryOwnMetadataKeys(t,e):[]}function v(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function S(t){return void 0===t}function N(t){return null===t}function O(t){return"object"==typeof t?null!==t:"function"==typeof t}function M(t,e){switch(v(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=k(t,i);if(void 0!==r){var s=r.call(t,n);if(O(s))throw new TypeError;return s}return function(t,e){if("string"===e){var n=t.toString;if(P(n)&&!O(i=n.call(t)))return i;if(P(r=t.valueOf)&&!O(i=r.call(t)))return i}else{var r;if(P(r=t.valueOf)&&!O(i=r.call(t)))return i;var i,s=t.toString;if(P(s)&&!O(i=s.call(t)))return i}throw new TypeError}(t,"default"===n?"number":n)}function w(t){return!!t}function x(t){var e=M(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function C(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function P(t){return"function"==typeof t}function I(t){return"function"==typeof t}function L(t,e){return t===e||t!=t&&e!=e}function k(t,e){var n=t[e];if(null!=n){if(!P(n))throw new TypeError;return n}}function j(t){var e=k(t,s);if(!P(e))throw new TypeError;var n=e.call(t);if(!O(n))throw new TypeError;return n}function D(t){return t.value}function B(t){var e=t.next();return!e.done&&e}function $(t){var e=t.return;e&&e.call(t)}function V(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function H(t,e,n){var r=g.getProvider(t,e);if(!S(r))return r;if(n){if(g.setProvider(t,e,m))return m;throw new Error("Illegal state.")}}function F(t){return t.__=void 0,delete t.__,t}t("decorate",function(t,e,n,r){if(S(n)){if(!C(t))throw new TypeError;if(!I(e))throw new TypeError;return function(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!S(r)&&!N(r)){if(!I(r))throw new TypeError;e=r}}return e}(t,e)}if(!C(t))throw new TypeError;if(!O(e))throw new TypeError;if(!O(r)&&!S(r)&&!N(r))throw new TypeError;return N(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var s=(0,t[i])(e,n,r);if(!S(s)&&!N(s)){if(!O(s))throw new TypeError;r=s}}return r}(t,e,n=x(n),r)}),t("metadata",function(t,e){return function(n,r){if(!O(n))throw new TypeError;if(!S(r)&&!function(t){switch(v(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;b(t,e,n,r)}}),t("defineMetadata",function(t,e,n,r){if(!O(n))throw new TypeError;return S(r)||(r=x(r)),b(t,e,n,r)}),t("hasMetadata",function(t,e,n){if(!O(e))throw new TypeError;return S(n)||(n=x(n)),y(t,e,n)}),t("hasOwnMetadata",function(t,e,n){if(!O(e))throw new TypeError;return S(n)||(n=x(n)),A(t,e,n)}),t("getMetadata",function(t,e,n){if(!O(e))throw new TypeError;return S(n)||(n=x(n)),_(t,e,n)}),t("getOwnMetadata",function(t,e,n){if(!O(e))throw new TypeError;return S(n)||(n=x(n)),E(t,e,n)}),t("getMetadataKeys",function(t,e){if(!O(t))throw new TypeError;return S(e)||(e=x(e)),T(t,e)}),t("getOwnMetadataKeys",function(t,e){if(!O(t))throw new TypeError;return S(e)||(e=x(e)),R(t,e)}),t("deleteMetadata",function(t,e,n){if(!O(e))throw new TypeError;if(S(n)||(n=x(n)),!O(e))throw new TypeError;S(n)||(n=x(n));var r=H(e,n,!1);return!S(r)&&r.OrdinaryDeleteMetadata(t,e,n)})}(r,e),void 0===e.Reflect&&(e.Reflect=t)}()}(r||(r={}))}},y={};function A(t){var e=y[t];if(void 0!==e)return e.exports;var n=y[t]={exports:{}};return m[t](n,n.exports,A),n.exports}A.d=(t,e)=>{for(var n in e)A.o(e,n)&&!A.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},A.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),A.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),A(494),function(t){t.isArrowFunction=t=>"function"==typeof t&&void 0===t.prototype&&!t.toString().startsWith("class"),t.isPlainObject=t=>null!==t&&"object"==typeof t&&t.constructor===Object,t.isFrozen=t=>Object.isFrozen(t),t.isSealed=t=>Object.isSealed(t),t.isFrozenOrSealed=e=>t.isFrozen(e)||t.isSealed(e),t.isFrozenAndSealed=e=>t.isFrozen(e)&&t.isSealed(e),t.isNotFrozen=t=>!Object.isFrozen(t),t.isNotSealed=t=>!Object.isSealed(t),t.isNotFrozenOrSealed=e=>!t.isFrozen(e)&&!t.isSealed(e),t.isNotFrozenAndSealed=e=>!t.isFrozen(e)||!t.isSealed(e),t.isNullOrUndefined=t=>null==t||void 0===t,t.isConstructor=t=>"function"==typeof t&&void 0!==t.prototype&&t.prototype.constructor===t,t.isFunction=e=>"function"==typeof e&&!t.isConstructor(e),t.isNullish=e=>t.isNotNullish(e),t.isNotNullish=e=>Array.isArray(e)||t.isString(e)?e.length>0:e instanceof Set||e instanceof Map?e.size>0:"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e,t.isNotNullUndefined=t=>null!=t,t.isNull=t=>null===t,t.isUndefined=t=>void 0===t,t.isArray=e=>!t.isNullOrUndefined(e)&&"[object Array]"===Object.prototype.toString.call(e).trim(),t.isStringNumber=t=>"number"==typeof t?!isNaN(t):"string"==typeof t&&""!==t.trim()&&!isNaN(Number(t)),t.isNumber=e=>!t.isNullOrUndefined(e)&&"[object Number]"===Object.prototype.toString.call(e).trim(),t.isIterator=t=>null!=t&&"function"==typeof t[Symbol.iterator],t.isString=e=>!t.isNullOrUndefined(e)&&"[object String]"===Object.prototype.toString.call(e).trim(),t.isObject=e=>!t.isNullOrUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e).trim(),t.isMap=e=>!t.isNullOrUndefined(e)&&"[object Map]"===Object.prototype.toString.call(e).trim(),t.isEmpty=e=>!!t.isNullOrUndefined(e)||(t.isArray(e)?0===e.length:t.isString(e)?0===e.trim().length:t.isMap(e)?0===e.size:!!t.isObject(e)&&0===Object.keys(e).length),t.isSet=t=>t instanceof Set,t.isNullishFiltered=t=>Array.isArray(t)?t.every(t=>null!=t):null!=t,t.isFalsyFiltered=t=>Array.isArray(t)?t.every(t=>t):!!t,t.includeValue=(t,e)=>Object.values(t).includes(e),t.includeKey=(t,e)=>Object.keys(t).includes(e),t.lastConsonantLetter=t=>(t.charCodeAt(t.length-1)-44032)%28>0,t.inRange=(t,e,n)=>e<=t&&t<=n,t.isBase64=t=>{let e=t;const n=t.split(";base64,");if(n.length>1)e=n[1];else if(t.startsWith("data:")){const n=t.indexOf(",");n>-1&&(e=t.substring(n+1))}return""===e||e.length,/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(t||(t={})),function(e){e.uniqueInts=(t,n,r)=>{const i=[];if(r>n-t)throw new Error("Count is greater than the range of unique integers");for(;i.length<r;){const r=e.int(t,n);i.includes(r)||i.push(r)}return i},e.chance=t=>{if(t<0||t>1)throw new Error("Percentage must be between 0 and 1");return Math.random()<t},e.int=(t,n)=>Math.floor(e.float(t,n)),e.float=(e,n)=>t.isNullOrUndefined(e)?Math.random():!t.isNullOrUndefined(e)&&t.isNullOrUndefined(n)?Math.random()*(e||0):Math.random()*((n||0)-(e||0))+(e||0),e.uuid=(t="xxxx-xxxx-xxxx-xxxx")=>t.replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}),e.uuid4=()=>{let t,e="";for(t=0;t<32;t+=1)switch(t){case 8:case 20:e+="-",e+=(16*Math.random()|0).toString(16);break;case 12:e+="-",e+="4";break;case 16:e+="-",e+=(4*Math.random()|8).toString(16);break;default:e+=(16*Math.random()|0).toString(16)}return e},e.hex=()=>{const t="0123456789ABCDEF".split("");let e="";for(let n=0;n<6;n++)e+=t[Math.floor(16*Math.random())];return e},e.rgb=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let n=0;n<6;n++)e+=t[Math.floor(16*Math.random())];return e},e.rgba=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let n=0;n<8;n++)e+=t[Math.floor(16*Math.random())];return e},e.alphabet=t=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}}(e||(e={})),function(e){e.deleteEnter=t=>t.replace(/\r?\n/g,""),e.pickEmoji=t=>t.match(/[\p{Emoji}]/gu)??[],e.regexExec=(t,e)=>{let n=t.exec(e);const r=[];for(;n;)r.push(n),n=t.exec(n.input);return r},e.regexExecArrayReplace=(t,n,r)=>((Array.isArray(n)?n:e.regexExec(n,t)).reverse().forEach(e=>{const n="string"==typeof r?r:r(e);t=t.substr(0,e.index)+t.substr(e.index).replace(e[0],n)}),t),e.escapeSpecialCharacterRegExp=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e.trim=t=>t.trim(),e.rsubString=(t,e)=>t.substring(t.length-e,t.length),e.lsubString=(t,e)=>t.substring(0,e),e.lpad=(t,n,r)=>{for(;n>r.length;)r=t+r;return e.rsubString(r,n)},e.rpad=(t,n,r)=>{for(;n>r.length;)r+=t;return e.lsubString(r,n)},e.lappend=(t,e)=>{let n="",r=0;for(;r++<t;)n+=e;return n},e.unescape=t=>{if(!t)return"";const e={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿","#x27":"'"};return t.replace(/&((?:(?:[a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?)+);/gi,(t,n)=>n.toLowerCase().split(";").map(n=>n in e?e[n]:t).join(""))},e.executeExpression=(t,e)=>t.replace(/\${([^{}]*)}/g,(t,n)=>String(e[n]??t)),e.ellipsis=(t,e)=>t.length>e?`${t.slice(0,e)}...`:t,e.appendPostposition=(e,{vowel:n,consonant:r})=>`${e}${t.lastConsonantLetter(e)?r:n}`}(n||(n={}));class _{static getVariablePaths(t){const e=new Set;class n{prefix;usingVars=e;constructor(t){this.prefix=t}set(t,e,n,r){return!0}get(t,e,r){let i;return"string"==typeof e&&isNaN(Number(e))?(i=this.prefix?this.prefix+"."+e:e,this.usingVars.add(i)):"string"!=typeof e||isNaN(Number(e))||(i=this.prefix?this.prefix+"["+e+"]":e,this.usingVars.add(i)),new Proxy(()=>{},new n(i))}}const r=new Proxy(()=>{},new n);try{Function(`"use strict"; ${t}; `).bind(r)()}catch(t){console.error(t)}return e}static evalReturn(t,e={}){let n="",r="";return"object"==typeof t?(n=t.bodyScript,r=t.returnScript):r=t,this.eval(`${n}; return ${r} `,e)}static eval(t,e={}){try{return Function(`"use strict"; ${t} `).bind(e)()}catch(e){return console.error("eval error",e),void console.error(t)}}static loadElement(t,e,n){return new Promise((r,i)=>{const s=t.createElement(e);if(n?.body?s.innerHTML=n.body:s.onload=r,s.onerror=i,n?.attribute)for(const[t,e]of Object.entries(n.attribute))s.setAttribute(t,e);n.created(s),n?.body&&s.parentNode&&r(s)})}static loadStyleSheet(t,e,n={}){return n.type="text/css",n.rel="stylesheet",n.href=e,_.loadElement(t,"link",{attribute:n,created:e=>{t.head.append(e)}})}static loadScript(t,e,n={}){return n.type=n?.type??"text/javascript",n.src=e,_.loadElement(t,"script",{attribute:n,created:e=>t.head.append(e)})}static loadScriptBody(t,e,n={}){return n.type=n?.type??"text/javascript",_.loadElement(t,"script",{body:e,attribute:n,created:e=>t.head.append(e)})}}!function(e){let n;e.filterCatch=async(e,n)=>{try{return void await e}catch(e){const r=Array.isArray(n)?n:[n];for(let n of r)if(t.isConstructor(n)){if(e instanceof n)return e}else if(n(e))return e;throw e}},e.sleep=t=>new Promise(e=>setTimeout(e,t)),e.sleepReject=t=>new Promise((e,n)=>setTimeout(n,t)),e.settle=async t=>Promise.allSettled([t]).then(t=>t[0]),e.settles=async(...t)=>Promise.allSettled(t),e.loop=t=>({subscribe:n=>{let r=!1,i=0;const s=async()=>{const o=Date.now();let a=o;i++;const c={age:i};let l,h=!1;try{l=await t.factory(c),a=Date.now(),n.then?.(l,{...c,duration:a-o})}catch(t){h=!0,a=Date.now(),n.catch?.(t,{...c,duration:a-o})}if(await e.sleep(t.loopDelay??0),n.delayThen?.({...c,duration:a-o,isCatch:h,data:l}),!r)return s()};return setTimeout(()=>{s()},t.delay??0),{get closed(){return r},unsubscribe:()=>{r=!0}}}}),e.delayExecute=(t,e=0)=>new Promise(n=>{setTimeout(async()=>{const e=await t();n(e)},e)}),e.transaction=(t,e)=>{const n="function"==typeof t?t():t;let r,i,s;new Promise((t,s)=>{setTimeout(()=>{i=e?.before?.(),n.then(e=>{t(e)}),r=e?.after?.()},e?.delay??0)}).then(t=>{s=t,e?.then?.(t,{before:i})}).catch(t=>{if(e?.catch?.(t,{before:i,after:r}),!e?.disabledCatchThrow)throw t}).finally(()=>{e?.finally?.({before:i,after:r,data:s})})},e.withResolvers=()=>{let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},function(t){function e(t){const n="function"==typeof t?t():t;if("function"==typeof t&&(n.factory=()=>e(t)),void 0===n.status){const t=n;t.status="pending",t.isPending=!0,t.isFulfilled=!1,t.isRejected=!1,t.then(t=>{console.log("result??",t);const e=n;e.status="fulfilled",e.isFulfilled=!0,e.isRejected=!1,e.isPending=!1,e.value=t},t=>{console.log("rejet??",t);const e=n;e.status="rejected",e.isFulfilled=!1,e.isRejected=!0,e.isPending=!1,e.reason=t})}return n}t.awaitWrap=async function t(n){const r=e(n);try{await r}catch(t){}const i={status:r.status,isFulfilled:r.isFulfilled,isRejected:r.isRejected,isPending:r.isPending,value:r.value,reason:r.reason};return"function"==typeof n?(i.factory=()=>t(n),i):i},t.wrap=e}(n=e.Result||(e.Result={}))}(r||(r={})),function(t){t.loadImage=function(t,e){let n,i;if(e)n=e.onload;else{const t=r.withResolvers();i=t.promise,n=t.resolve}const s=new Image;return s.onload=()=>{n(s)},e&&e.onerror&&(s.onerror=e.onerror),s.src=t,i},t.loadAudio=function(t,e){let n,i,s;if(e)n=e.onload,i=e.onerror;else{const t=r.withResolvers();s=t.promise,i=t.reject,n=t.resolve}const o=new Audio("path/to/audio1.mp3");return o.addEventListener("canplay",()=>{n?.(o)}),o.addEventListener("error",t=>{e?.onerror(t)}),o.load(),s},t.toInnerHTML=(t,e)=>{const n=e.document.createElement("div");return n.appendChild(t.cloneNode(!0)),console.log("DocumentFragment innerHTML:",n.innerHTML),n.innerHTML},t.replaceWith=(t,e)=>{t.replaceWith(e)},t.nodeList=t=>Array.from(t.childNodes),t.cloneNodeList=t=>Array.from(t.childNodes).map(t=>t.cloneNode(!0)),t.querySelector=(e,n)=>{const r=t.querySelectorAll(e,n);return r.length>0?r[0]:null},t.querySelectorAll=(t,e)=>{if(t instanceof Element)return Array.from(t.querySelectorAll(e));{const n=t.start,r=t.end;if(n&&r&&n.parentNode===r.parentNode){const t=[];let i=n.nextSibling;for(;i&&i!==r;){if(i.nodeType===Node.ELEMENT_NODE){const n=i;n.matches(e)&&t.push(n),t.push(...Array.from(n.querySelectorAll(e)))}i=i.nextSibling}return t}}return[]},t.selectorElements=(t,e=document)=>Array.prototype.slice.call(e.querySelectorAll(t)),t.selectorNodes=(t,e=document)=>e.querySelectorAll(t),t.removeAttribute=(t,e)=>{e.forEach(e=>{t.removeAttribute(e)})},t.setAttribute=(t,e)=>{e.forEach(e=>{t.setAttribute(e,"")})},t.setAttributeAttr=(t,e)=>{e.forEach(e=>{t.setAttribute(e.name,e.value)})},t.getAttributeToObject=t=>{const e={};return t.getAttributeNames().forEach(n=>{e[n]=t.getAttribute(n)}),e},t.getStyleToObject=t=>{const e={};for(let n=0;n<t.style.length;n++){const r=t.style[n];e[r]=t.style[r]}return e}}(i||(i={}));class E{done;value;constructor(t,e){this.done=e,this.value=t??0}}class b{_first;_current;_last;_step;constructor(t,e,n){this._current=this._first=t,this._last=e,this._step=n}next(t){let e;return this._first<this._last&&this._current<this._last||this._first<this._last&&this._current===this._last?(e=new E(this._current,!1),this._current+=this._step):this._first>this._last&&this._current>this._last||this._first>this._last&&this._current===this._last||this._current===this._last?(e=new E(this._current,!1),this._current-=this._step):e=new E(void 0,!0),e}}class T{first;last;step;isRange=!0;constructor(t,e,n=1){this.first=t,this.last=e,this.step=n}[Symbol.iterator](){return new b(this.first,this.last,this.step)}map(t,e){return Array.from(this).map(t)}static range(t,e,n=1){if("number"==typeof t&&void 0===e)return new T(0,t,n);if("string"==typeof t){const[e,n="0"]=t.split(".."),[r,i="1"]=n.split(",");return new T(Number(e.trim()),Number(r.trim()),Number(i.trim()))}return new T(t,e??0,n)}}class R{window;static attrPrefix="dr-";eventNames=["click","mousedown","mouseup","dblclick","mouseover","mouseout","mousemove","mouseenter","mouseleave","contextmenu","keyup","keydown","keypress","toggle","change","input","submit","resize","focus","blur","close","cancel"];delegatableEventMap={mouseleave:"mouseout",mouseenter:"mouseover",focus:"focusin",blur:"focusout"};directAttachEvents=new Set(["close"]);static ownerVariablePathAttrName=R.attrPrefix+"owner-variable-path";static eventParam=R.attrPrefix+"event";static onInitAttrName=R.attrPrefix+"on-init";static valueAttrName=R.attrPrefix+"value";static checkedAttrName=R.attrPrefix+"checked";static selectedAttrName=R.attrPrefix+"selected";static readonlyAttrName=R.attrPrefix+"readonly";static disabledAttrName=R.attrPrefix+"disabled";static hiddenAttrName=R.attrPrefix+"hidden";static requiredAttrName=R.attrPrefix+"required";static openAttrName=R.attrPrefix+"open";static linkAttrs=[{name:R.attrPrefix+"value-link",property:"value",event:"input"},{name:R.attrPrefix+"hidden-link",property:"value",event:"input"},{name:R.attrPrefix+"required-link",property:"value",event:"input"},{name:R.attrPrefix+"checked-link",property:"checked",event:"change"},{name:R.attrPrefix+"open-link",property:"open",event:"toggle"}];static linkTargetMapAttrName=R.attrPrefix+"link-variables";static onRenderedInitAttrName=R.attrPrefix+"on-rendered-init";static attrAttrName=R.attrPrefix+"attr";static normalAttrMapAttrName=R.attrPrefix+"normal-attr-map";static styleAttrName=R.attrPrefix+"style";static classAttrName=R.attrPrefix+"class";static VALUE_VARNAME="$value";static SCRIPTS_VARNAME="$scripts";static FAG_VARNAME="$fag";static RAWSET_VARNAME="$rawSet";static RENDER_VARNAME="$render";static NEAR_THIS_VARNAME="$nearThis";static PARENT_THIS_VARNAME="$parentThis";static ROOT_OBJECT_VARNAME="$rootObject";static SCRIPT_UTILS_VARNAME="$scriptUtils";static RANGE_VARNAME="$range";static ROUTER_VARNAME="$router";static INNER_HTML_VARNAME="$innerHTML";static ELEMENT_VARNAME="$element";static TARGET_VARNAME="$target";static EVENT_VARNAME="$event";static COMPONENT_VARNAME="$component";static INNERHTML_VARNAME="$innerHTML";static ATTRIBUTE_VARNAME="$attribute";static CREATOR_META_DATA_VARNAME="$creatorMetaData";static PARENT_THIS_PATH_VARNAME="$parentPath";static CURRENT_THIS_VARNAME="$currentThis";static CURRENT_THIS_PATH_VARNAME="$currentThisPath";static NEAR_THIS_PATH_VARNAME="$nearThisPath";static VARNAMES=[R.SCRIPTS_VARNAME,R.FAG_VARNAME,R.RAWSET_VARNAME,R.RANGE_VARNAME,R.ROUTER_VARNAME,R.ELEMENT_VARNAME,R.TARGET_VARNAME,R.EVENT_VARNAME,R.COMPONENT_VARNAME,R.INNERHTML_VARNAME,R.ATTRIBUTE_VARNAME,R.ATTRIBUTE_VARNAME,R.CREATOR_META_DATA_VARNAME,R.PARENT_THIS_PATH_VARNAME,R.PARENT_THIS_VARNAME];static WINDOW_EVENT_POPSTATE="popstate";static WINDOW_EVENT_RESIZE="resize";static WINDOW_EVENTS=[R.WINDOW_EVENT_POPSTATE,R.WINDOW_EVENT_RESIZE];static attrNames=[R.valueAttrName,R.checkedAttrName,R.selectedAttrName,R.readonlyAttrName,R.disabledAttrName,R.hiddenAttrName,R.requiredAttrName,R.openAttrName,R.attrAttrName,R.normalAttrMapAttrName,R.styleAttrName,R.classAttrName,R.attrPrefix+"window-event-"+R.WINDOW_EVENT_POPSTATE,R.attrPrefix+"window-event-"+R.WINDOW_EVENT_RESIZE,R.onInitAttrName,...R.linkAttrs.map(t=>t.name),this.eventParam];bindScript=`\n const ${R.VALUE_VARNAME} = this.__render.value;\n const ${R.SCRIPTS_VARNAME} = this.__render.scripts;\n const ${R.RANGE_VARNAME} = this.__render.range;\n const ${R.ROUTER_VARNAME} = this.__render.router;\n const ${R.ATTRIBUTE_VARNAME} = this.__render.attribute;\n const ${R.ELEMENT_VARNAME} = this.__render.element;\n const ${R.COMPONENT_VARNAME} = this.__render.element.component;\n const ${R.TARGET_VARNAME} = this.__render.target;\n const ${R.EVENT_VARNAME} = this.__render.event;\n `;constructor(t){if(this.window=t,this.eventNames.forEach(t=>{R.attrNames.push(R.attrPrefix+"event-"+t)}),R.attrNames.push(R.onRenderedInitAttrName),void 0!==t){R.WINDOW_EVENTS.forEach(e=>{t?.addEventListener(e,t=>{const n=`dr-window-event-${e}`;document.querySelectorAll(`[${n}]`).forEach(e=>{const r=e.getAttribute(n);if(r){const n=this.findComponentInstance(e),i=jt(n);_.eval(`${this.bindScript} ${r} `,this.createExecutionContext(t,e,n,i))}})})});const e=this.window.document,n=new Set;this.eventNames.forEach(t=>{if(this.directAttachEvents.has(t))return;const r=this.delegatableEventMap[t]||t;n.has(r)||(n.add(r),e.addEventListener(r,this.handleEvent.bind(this),!0))})}}handleEvent(t){const e=this.collectHandlers(t);for(const n of e){if(t.cancelBubble)break;const e=this.findComponentInstance(n.element);e&&this.executeHandler(t,n,e)}}collectHandlers(t){const e=[],n=this.window.document;if(!n)return e;const r=t.target;let i=1===r.nodeType?r:r.parentElement;const s=new Set,o={mouseout:"mouseleave",mouseover:"mouseenter",focusout:"blur",focusin:"focus"}[t.type]||t.type;for(;i&&!s.has(i);){const t=R.linkAttrs.find(t=>t.event===o&&i?.hasAttribute(t.name));t&&e.push({element:i,attr:t.name,type:"link",priority:1,property:t.property});const r=`${R.attrPrefix}event-${o}`;i.hasAttribute(r)&&e.push({element:i,attr:r,type:"event",priority:2});const a=R.eventParam;if(i.hasAttribute(a)){const t=i.getAttribute(`${a}:bind`);t&&t.split(",").map(t=>t.trim()).includes(o)&&e.push({element:i,attr:a,type:"event-param",priority:3})}if(s.add(i),i===n.documentElement)break;i=i.parentElement}return e.sort((t,e)=>t.priority-e.priority)}findComponentInstance(t){let e=t;const n=this.window.document;for(;e;){if(e.obj)return e.obj;if(e===n.documentElement)break;e=e.parentElement}return this.window}createExecutionContext(t,e,n,r,s={}){return Object.assign(n,{__render:Object.freeze({event:t,element:e,target:t.target,attribute:i.getAttributeToObject(e),router:r?.router,range:T.range,scripts:R.setBindProperty(r?.scripts,n),...r?.eventVariables,...s})})}executeHandler(t,e,n){const{element:r,type:s,attr:o}=e,a=jt(n);switch(s){case"link":const s=r.getAttribute(o);if(!s||!e.property)return;if(o.includes("leave")||o.includes("enter")||o.includes("focus")||o.includes("blur")){const e=t.relatedTarget;if(e&&r.contains(e))return}const c=r.getAttribute(R.ownerVariablePathAttrName);let l=n;c&&(l=_.evalReturn(c,n));const h=r.getAttribute(`${o}:map`);let u=r[e.property];if(h){const e=this.createExecutionContext(t,r,l,a,{value:u});u=_.eval(`return ${h}`,e)}"function"==typeof this.getValue(n,s,l)?this.getValue(n,s,l)(u,t):this.setValue(n,s,u);break;case"event":const d=r.getAttribute(o);if(!d)return;if(o.endsWith("mouseleave")||o.endsWith("mouseenter")||o.endsWith("blur")||o.endsWith("focus")){const e=t.relatedTarget;if(e&&r.contains(e))return}const p=this.createExecutionContext(t,r,n,a);r.getAttribute(`${o}:filter`),_.eval(`${this.getBindScript(a)} ${d}`,p);break;case"event-param":const f=r.getAttribute(o);if(!f)return;if(o.endsWith("mouseleave")||o.endsWith("mouseenter")||o.endsWith("blur")||o.endsWith("focus")){const e=t.relatedTarget;if(e&&r.contains(e))return}const g=i.getAttributeToObject(r),m={},y=o+":";Object.entries(g).filter(([t,e])=>t.startsWith(y)).forEach(([t,e])=>{m[t.slice(y.length)]=e});const A=this.createExecutionContext(t,r,n,a,{params:m});_.eval(`${this.getBindScript(a)} ${f}`,A)}}findAttrElements(t,e){const n=new Set;return(e?.applyEvents?.map(t=>t.attrName)??[]).concat([...R.attrNames]).forEach(e=>{t?.querySelectorAll(`[${e}]`).forEach(t=>{n.add(t)})}),n}applyEvent(t,e,n){e.forEach(e=>{1===e.nodeType&&(e.obj=t)}),this.procAttr(e,R.valueAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.value!==n&&(e.value=n)}}),this.procAttr(e,R.checkedAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.checked!==n&&(e.checked=n)}}),this.procAttr(e,R.selectedAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.selected!==n&&(e.selected=n)}}),this.procAttr(e,R.readonlyAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.readOnly!==n&&(e.readOnly=n)}}),this.procAttr(e,R.disabledAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.disabled!==n&&(e.disabled=n)}}),this.procAttr(e,R.hiddenAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.hidden!==n&&(e.hidden=n)}}),this.procAttr(e,R.requiredAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.required!==n&&(e.required=n)}}),this.procAttr(e,R.openAttrName,(e,n)=>{const r=n;if(r){const n=_.evalReturn(r,t);e.open!==n&&(e.open=n)}}),this.procAttr(e,R.normalAttrMapAttrName,(e,n)=>{new Map(JSON.parse(n)).forEach((n,r)=>{const s=_.eval(`const $element = this.element; return ${n} `,Object.assign(t,{__render:Object.freeze({element:e,attribute:i.getAttributeToObject(e)})}));null===s?e.removeAttribute(r):e.setAttribute(r,s)})}),R.WINDOW_EVENTS.forEach(n=>{this.procAttr(e,R.attrPrefix+"window-event-"+n,(e,n)=>{e.obj=t})}),R.linkAttrs.forEach(r=>{this.procAttr(e,r.name,(e,i)=>{if(i){const s=e.getAttribute(R.ownerVariablePathAttrName),o=e.getAttribute(`${r.name}:map`);let a=t;s&&(a=_.evalReturn(s,t));const c=this.getValue(t,i,a);if("function"==typeof c&&c){let i=e[r.property];o&&(i=_.eval(`${this.getBindScript(n)} return ${o}`,Object.assign(a,{__render:Object.freeze({element:e,target:a,range:T.range,value:i,scripts:R.setBindProperty(n?.scripts,t),...n?.eventVariables})}))),c(i)}else if(c){let i=c;o&&(i=_.eval(`${this.getBindScript(n)} return ${o}`,Object.assign(a,{__render:Object.freeze({element:e,target:a,range:T.range,value:i,scripts:R.setBindProperty(n?.scripts,t),...n?.eventVariables})}))),null===i?e.removeAttribute(r.property):e[r.property]=i}else void 0===c&&this.setValue(t,i,e[r.property])}})}),this.directAttachEvents.forEach(t=>{const r=`${R.attrPrefix}event-${t}`;this.procAttr(e,r,(e,i)=>{e.addEventListener(t,t=>{const s=this.findComponentInstance(e);if(!s)return;const o=this.createExecutionContext(t,e,s,n),a=e.getAttribute(`${r}:filter`);let c=!0;a&&(c=_.eval(`${this.getBindScript(n)} return ${a}`,o)??!1),c&&_.eval(`${this.getBindScript(n)} ${i}`,o)})})}),this.procAttr(e,R.onInitAttrName,(e,r)=>{let s=r;s&&(s="return "+s),s&&_.eval(`${this.getBindScript(n)}; ${s} `,Object.assign(t,{__render:Object.freeze({element:e,attribute:i.getAttributeToObject(e),...n?.eventVariables})}))}),this.onRenderedEvent(t,e,n),this.changeVar(t,e,void 0,n),Array.from(e).filter(t=>1===t.nodeType).map(t=>t).forEach(e=>{n?.applyEvents?.filter(t=>null!==e.getAttribute(t.attrName)).forEach(n=>n.callBack(e,e.getAttribute(n.attrName),t))})}onRenderedEvent(t,e,n){this.procAttr(e,R.onRenderedInitAttrName,(e,r)=>{if(!e.isConnected)return;let s=r;s&&(s="return "+s),s&&_.eval(`${this.getBindScript(n)}; ${s} `,Object.assign(t,{__render:Object.freeze({element:e,attribute:i.getAttributeToObject(e),...n?.eventVariables})}))})}changeVar(t,e,n,r){this.procAttr(e,R.styleAttrName,(e,r)=>{let s=r;if(s&&(s="return "+s),R.isUsingThisVar(s,n)||void 0===n){const n=_.eval(`const $element = this.__render.element; ${s} `,Object.assign(t,{__render:Object.freeze({element:e,attribute:i.getAttributeToObject(e)})}));if("string"==typeof n)e.setAttribute("style",n);else if(Array.isArray(n))e.setAttribute("style",n.join(";"));else for(const[t,r]of Object.entries(n))e instanceof HTMLElement&&(e.style[t]=String(r))}}),this.procAttr(e,R.classAttrName,(e,r)=>{let s=r;if(s&&(s="return "+s),R.isUsingThisVar(s,n)||void 0===n){const n=_.eval(`const $element = this.element; ${s} `,Object.assign(t,{__render:Object.freeze({element:e,attribute:i.getAttributeToObject(e)})}));if("string"==typeof n)e.setAttribute("class",n);else if(Array.isArray(n))e.setAttribute("class",n.join(" "));else for(const[t,r]of Object.entries(n))e instanceof HTMLElement&&(r?e.classList.add(t):e.classList.remove(t))}})}procAttr(t=new Set,e,n){const r=new Set;t.forEach(t=>{if(t&&1===t.nodeType){const n=t;r.add(n),n.querySelectorAll(`[${e}]`).forEach(t=>{r.add(t)})}}),r.forEach(t=>{const r=t.getAttribute(e),s=i.getAttributeToObject(t);r&&n(t,r,s)})}getValue(t,e,n){let r=_.evalReturn(e,t);return"function"==typeof r&&(r=r.bind(n??t)),r}setValue(t,e,n){e=e.replaceAll("this.","this.this."),_.eval(`${e} = this.value;`,{this:t,value:n})}static isUsingThisVar(t,e){return!(!e||!t)&&(e.startsWith("this.")&&(e=e.replace(/this\./,"")),R.VARNAMES.forEach(e=>{t=t.replace(RegExp(e.replace("$","\\$"),"g"),`this.___${e}`)}),_.getVariablePaths(t??"").has(e))}static setBindProperty(t,e){if(t){const n=Object.assign({},t);for(const[t,r]of Object.entries(n))"function"==typeof r&&(n[t]=r.bind(e));return n}}getBindScript(t){if(t?.eventVariables){const e=Object.entries(t.eventVariables).filter(([t,e])=>!this.bindScript.includes(`const ${t}`)).map(([t,e])=>`const ${t} = this.__render.${t};`).join(";");return this.bindScript+""+e}return this.bindScript}}!function(t){function e(t,e){if(0===t.length&&void 0!==e)return[];if(void 0===e)return t[Math.floor(Math.random()*t.length)];const n=[],r=new Set;for(;n.length<e&&r.size<t.length;){const e=Math.floor(Math.random()*t.length);r.has(e)||(n.push(t[e]),r.add(e))}return n}t.create2DArray=(t,e,n)=>{const r=[];for(let i=0;i<t;i++){const t=[];for(let r=0;r<e;r++)"function"==typeof n?t.push(n(i,r)):t.push(n);r.push(t)}return r},t.toShuffle=t=>{const e=[...t];for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}return e},t.popPick=t=>{const e=Math.floor(Math.random()*t.length);return t.splice(e,1)[0]},t.chancePick=(t,n)=>{const r=t.reduce((t,e)=>t+e.chance,0);let i=Math.random()*r;for(const e of t){if(i<e.chance)return e.data;i-=e.chance}return e(t.map(t=>t.data))},t.pick=e,t.maxLength=function(t){if(!t)return{maxRows:0,maxCols:0,maxRowsCols:0,total:0};const e=t.length,n=Math.max(...t.map(t=>t.length),0);return{maxRows:e,maxCols:n,maxRowsCols:Math.max(n,e),total:t.reduce((t,e)=>t+e.length,0)}},t.toPush=(t=[],...e)=>[...null!=t?t:[],...e],t.toRemove=(t=[],...e)=>(null!=t?t:[]).filter(t=>!e.includes(t)),t.toFilterOut=(t=[],e)=>(null!=t?t:[]).filter(t=>!e(t)),t.toFilter=(t=[],e)=>(null!=t?t:[]).filter(t=>e(t)),t.hasAll=(t=[],...e)=>e.every(e=>(null!=t?t:[]).includes(e)),t.has=(t=[],...e)=>e.some(e=>(null!=t?t:[]).includes(e)),t.hasNot=(t=[],...e)=>e.some(e=>!(null!=t?t:[]).includes(e)),t.hasAllNot=(t=[],...e)=>e.every(e=>!(null!=t?t:[]).includes(e)),t.relation=(...t)=>{if(0===t.length)return{intersection:[],union:[],difference:[],symmetricDifference:[]};const e=t.map(t=>new Set(t)),n=[...e[0]].filter(t=>e.every(e=>e.has(t))),r=[...new Set(t.flat())],i=[...e[0]].filter(t=>e.slice(1).every(e=>!e.has(t))),s=new Set;for(let n=0;n<e.length;n++){const r=e[n],i=new Set(t.filter((t,e)=>e!==n).flat());[...r].filter(t=>!i.has(t)).forEach(t=>s.add(t))}return{intersection:n,union:r,difference:i,symmetricDifference:[...s]}}}(s||(s={})),function(t){t.GHA="GHA",t.GAB="GAB",t.GUY="GUY",t.GMB="GMB",t.GGY="GGY",t.GLP="GLP",t.GTM="GTM",t.GUM="GUM",t.GRD="GRD",t.GRC="GRC",t.GRL="GRL",t.GIN="GIN",t.GNB="GNB",t.NAM="NAM",t.NRU="NRU",t.NGA="NGA",t.ATA="ATA",t.SSD="SSD",t.ZAF="ZAF",t.NLD="NLD",t.NPL="NPL",t.NOR="NOR",t.NFK="NFK",t.NCL="NCL",t.NZL="NZL",t.NIU="NIU",t.NER="NER",t.NIC="NIC",t.KOR="KOR",t.DNK="DNK",t.DOM="DOM",t.DMA="DMA",t.DEU="DEU",t.TLS="TLS",t.LAO="LAO",t.LBR="LBR",t.LVA="LVA",t.RUS="RUS",t.LBN="LBN",t.LSO="LSO",t.REU="REU",t.ROU="ROU",t.LUX="LUX",t.RWA="RWA",t.LBY="LBY",t.LTU="LTU",t.LIE="LIE",t.MDG="MDG",t.MTQ="MTQ",t.MHL="MHL",t.MYT="MYT",t.MAC="MAC",t.MKD="MKD",t.MWI="MWI",t.MYS="MYS",t.MLI="MLI",t.IMN="IMN",t.MEX="MEX",t.MCO="MCO",t.MAR="MAR",t.MUS="MUS",t.MRT="MRT",t.MOZ="MOZ",t.MNE="MNE",t.MSR="MSR",t.MDA="MDA",t.MDV="MDV",t.MLT="MLT",t.MNG="MNG",t.USA="USA",t.UMI="UMI",t.VIR="VIR",t.MMR="MMR",t.FSM="FSM",t.VUT="VUT",t.BHR="BHR",t.BRB="BRB",t.VAT="VAT",t.BHS="BHS",t.BGD="BGD",t.BMU="BMU",t.BEN="BEN",t.VEN="VEN",t.VNM="VNM",t.BEL="BEL",t.BLR="BLR",t.BLZ="BLZ",t.BES="BES",t.BIH="BIH",t.BWA="BWA",t.BOL="BOL",t.BDI="BDI",t.BFA="BFA",t.BVT="BVT",t.BTN="BTN",t.MNP="MNP",t.BGR="BGR",t.BRA="BRA",t.BRN="BRN",t.WSM="WSM",t.SAU="SAU",t.SGS="SGS",t.SMR="SMR",t.STP="STP",t.MAF="MAF",t.BLM="BLM",t.SPM="SPM",t.ESH="ESH",t.SEN="SEN",t.SRB="SRB",t.SYC="SYC",t.LCA="LCA",t.VCT="VCT",t.KNA="KNA",t.SHN="SHN",t.SOM="SOM",t.SLB="SLB",t.SDN="SDN",t.SUR="SUR",t.LKA="LKA",t.SJM="SJM",t.SWE="SWE",t.CHE="CHE",t.ESP="ESP",t.SVK="SVK",t.SVN="SVN",t.SYR="SYR",t.SLE="SLE",t.SXM="SXM",t.SGP="SGP",t.ARE="ARE",t.ABW="ABW",t.ARM="ARM",t.ARG="ARG",t.ASM="ASM",t.ISL="ISL",t.HTI="HTI",t.IRL="IRL",t.AZE="AZE",t.AFG="AFG",t.AND="AND",t.ALB="ALB",t.DZA="DZA",t.AGO="AGO",t.ATG="ATG",t.AIA="AIA",t.ERI="ERI",t.SWZ="SWZ",t.EST="EST",t.ECU="ECU",t.ETH="ETH",t.SLV="SLV",t.GBR="GBR",t.VGB="VGB",t.IOT="IOT",t.YEM="YEM",t.OMN="OMN",t.AUS="AUS",t.AUT="AUT",t.HND="HND",t.ALA="ALA",t.JOR="JOR",t.UGA="UGA",t.URY="URY",t.UZB="UZB",t.UKR="UKR",t.WLF="WLF",t.IRQ="IRQ",t.IRN="IRN",t.ISR="ISR",t.EGY="EGY",t.ITA="ITA",t.IND="IND",t.IDN="IDN",t.JPN="JPN",t.JAM="JAM",t.ZMB="ZMB",t.JEY="JEY",t.GNQ="GNQ",t.PRK="PRK",t.GEO="GEO",t.CHN="CHN",t.CAF="CAF",t.DJI="DJI",t.GIB="GIB",t.ZWE="ZWE",t.TCD="TCD",t.CZE="CZE",t.CHL="CHL",t.CMR="CMR",t.CPV="CPV",t.KAZ="KAZ",t.QAT="QAT",t.KHM="KHM",t.CAN="CAN",t.KEN="KEN",t.CYM="CYM",t.COM="COM",t.CRI="CRI",t.CCK="CCK",t.CIV="CIV",t.COL="COL",t.COG="COG",t.COD="COD",t.CUB="CUB",t.KWT="KWT",t.COK="COK",t.CUW="CUW",t.HRV="HRV",t.CXR="CXR",t.KGZ="KGZ",t.KIR="KIR",t.CYP="CYP",t.TWN="TWN",t.TJK="TJK",t.TZA="TZA",t.THA="THA",t.TCA="TCA",t.TUR="TUR",t.TGO="TGO",t.TKL="TKL",t.TON="TON",t.TKM="TKM",t.TUV="TUV",t.TUN="TUN",t.TTO="TTO",t.PAN="PAN",t.PRY="PRY",t.PAK="PAK",t.PNG="PNG",t.PLW="PLW",t.PSE="PSE",t.FRO="FRO",t.PER="PER",t.PRT="PRT",t.FLK="FLK",t.POL="POL",t.PRI="PRI",t.FRA="FRA",t.GUF="GUF",t.ATF="ATF",t.PYF="PYF",t.FJI="FJI",t.FIN="FIN",t.PHL="PHL",t.PCN="PCN",t.HMD="HMD",t.HUN="HUN",t.HKG="HKG"}(o||(o={})),o.GHA,o.GAB,o.GUY,o.GMB,o.GGY,o.GLP,o.GTM,o.GUM,o.GRD,o.GRC,o.GRL,o.GIN,o.GNB,o.NAM,o.NRU,o.NGA,o.ATA,o.SSD,o.ZAF,o.NLD,o.NPL,o.NOR,o.NFK,o.NCL,o.NZL,o.NIU,o.NER,o.NIC,o.KOR,o.DNK,o.DOM,o.DMA,o.DEU,o.TLS,o.LAO,o.LBR,o.LVA,o.RUS,o.LBN,o.LSO,o.REU,o.ROU,o.LUX,o.RWA,o.LBY,o.LTU,o.LIE,o.MDG,o.MTQ,o.MHL,o.MYT,o.MAC,o.MKD,o.MWI,o.MYS,o.MLI,o.IMN,o.MEX,o.MCO,o.MAR,o.MUS,o.MRT,o.MOZ,o.MNE,o.MSR,o.MDA,o.MDV,o.MLT,o.MNG,o.USA,o.UMI,o.VIR,o.MMR,o.FSM,o.VUT,o.BHR,o.BRB,o.VAT,o.BHS,o.BGD,o.BMU,o.BEN,o.VEN,o.VNM,o.BEL,o.BLR,o.BLZ,o.BES,o.BIH,o.BWA,o.BOL,o.BDI,o.BFA,o.BVT,o.BTN,o.MNP,o.BGR,o.BRA,o.BRN,o.WSM,o.SAU,o.SGS,o.SMR,o.STP,o.MAF,o.BLM,o.SPM,o.ESH,o.SEN,o.SRB,o.SYC,o.LCA,o.VCT,o.KNA,o.SHN,o.SOM,o.SLB,o.SDN,o.SUR,o.LKA,o.SJM,o.SWE,o.CHE,o.ESP,o.SVK,o.SVN,o.SYR,o.SLE,o.SXM,o.SGP,o.ARE,o.ABW,o.ARM,o.ARG,o.ASM,o.ISL,o.HTI,o.IRL,o.AZE,o.AFG,o.AND,o.ALB,o.DZA,o.AGO,o.ATG,o.AIA,o.ERI,o.SWZ,o.EST,o.ECU,o.ETH,o.SLV,o.GBR,o.VGB,o.IOT,o.YEM,o.OMN,o.AUS,o.AUT,o.HND,o.ALA,o.JOR,o.UGA,o.URY,o.UZB,o.UKR,o.WLF,o.IRQ,o.IRN,o.ISR,o.EGY,o.ITA,o.IND,o.IDN,o.JPN,o.JAM,o.ZMB,o.JEY,o.GNQ,o.PRK,o.GEO,o.CHN,o.CAF,o.DJI,o.GIB,o.ZWE,o.TCD,o.CZE,o.CHL,o.CMR,o.CPV,o.KAZ,o.QAT,o.KHM,o.CAN,o.KEN,o.CYM,o.COM,o.CRI,o.CCK,o.CIV,o.COL,o.COG,o.COD,o.CUB,o.KWT,o.COK,o.CUW,o.HRV,o.CXR,o.KGZ,o.KIR,o.CYP,o.TWN,o.TJK,o.TZA,o.THA,o.TCA,o.TUR,o.TGO,o.TKL,o.TON,o.TKM,o.TUV,o.TUN,o.TTO,o.PAN,o.PRY,o.PAK,o.PNG,o.PLW,o.PSE,o.FRO,o.PER,o.PRT,o.FLK,o.POL,o.PRI,o.FRA,o.GUF,o.ATF,o.PYF,o.FJI,o.FIN,o.PHL,o.PCN,o.HMD,o.HUN,o.HKG,function(t){t.isArrowFunction=t=>"function"==typeof t&&void 0===t.prototype&&!t.toString().startsWith("class"),t.isPlainObject=t=>null!==t&&"object"==typeof t&&t.constructor===Object,t.isFrozen=t=>Object.isFrozen(t),t.isSealed=t=>Object.isSealed(t),t.isFrozenOrSealed=e=>t.isFrozen(e)||t.isSealed(e),t.isFrozenAndSealed=e=>t.isFrozen(e)&&t.isSealed(e),t.isNotFrozen=t=>!Object.isFrozen(t),t.isNotSealed=t=>!Object.isSealed(t),t.isNotFrozenOrSealed=e=>!t.isFrozen(e)&&!t.isSealed(e),t.isNotFrozenAndSealed=e=>!t.isFrozen(e)||!t.isSealed(e),t.isNullOrUndefined=t=>null==t||void 0===t,t.isConstructor=t=>"function"==typeof t&&void 0!==t.prototype&&t.prototype.constructor===t,t.isFunction=e=>"function"==typeof e&&!t.isConstructor(e),t.isNullish=e=>t.isNotNullish(e),t.isNotNullish=e=>Array.isArray(e)||t.isString(e)?e.length>0:e instanceof Set||e instanceof Map?e.size>0:"object"==typeof e&&null!==e?Object.keys(e).length>0:null!=e,t.isNotNullUndefined=t=>null!=t,t.isNull=t=>null===t,t.isUndefined=t=>void 0===t,t.isArray=e=>!t.isNullOrUndefined(e)&&"[object Array]"===Object.prototype.toString.call(e).trim(),t.isStringNumber=t=>"number"==typeof t?!isNaN(t):"string"==typeof t&&""!==t.trim()&&!isNaN(Number(t)),t.isNumber=e=>!t.isNullOrUndefined(e)&&"[object Number]"===Object.prototype.toString.call(e).trim(),t.isIterator=t=>null!=t&&"function"==typeof t[Symbol.iterator],t.isString=e=>!t.isNullOrUndefined(e)&&"[object String]"===Object.prototype.toString.call(e).trim(),t.isObject=e=>!t.isNullOrUndefined(e)&&"[object Object]"===Object.prototype.toString.call(e).trim(),t.isMap=e=>!t.isNullOrUndefined(e)&&"[object Map]"===Object.prototype.toString.call(e).trim(),t.isEmpty=e=>!!t.isNullOrUndefined(e)||(t.isArray(e)?0===e.length:t.isString(e)?0===e.trim().length:t.isMap(e)?0===e.size:!!t.isObject(e)&&0===Object.keys(e).length),t.isSet=t=>t instanceof Set,t.isNullishFiltered=t=>Array.isArray(t)?t.every(t=>null!=t):null!=t,t.isFalsyFiltered=t=>Array.isArray(t)?t.every(t=>t):!!t,t.includeValue=(t,e)=>Object.values(t).includes(e),t.includeKey=(t,e)=>Object.keys(t).includes(e),t.lastConsonantLetter=t=>(t.charCodeAt(t.length-1)-44032)%28>0,t.inRange=(t,e,n)=>e<=t&&t<=n,t.isBase64=t=>{let e=t;const n=t.split(";base64,");if(n.length>1)e=n[1];else if(t.startsWith("data:")){const n=t.indexOf(",");n>-1&&(e=t.substring(n+1))}return""===e||e.length,/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}(a||(a={}));class v{constructor(t,e){var n,r;"object"==typeof t?(this.x=null!==(n=t.x)&&void 0!==n?n:0,this.y=null!==(r=t.y)&&void 0!==r?r:0):(this.x=null!=t?t:0,this.y=null!=e?e:0)}copy(){return new v(this.x,this.y)}}class S{constructor(t,e,n){var r,i,s;t instanceof N?(this.x=t.x,this.y=t.y,this.z=t.z):"object"==typeof t?(this.x=null!==(r=t.x)&&void 0!==r?r:0,this.y=null!==(i=t.y)&&void 0!==i?i:0,this.z=null!==(s=t.z)&&void 0!==s?s:0):(this.x=null!=t?t:0,this.y=null!=e?e:0,this.z=null!=n?n:0)}set(t,e=0,n=0){return t instanceof S||t instanceof N?this.set(t.x||0,t.y||0,t.z||0):(this.x=t,this.y=e,this.z=n),this}get(){return new S(this.x,this.y,this.z)}mag(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}add(t,e=0,n=0){t instanceof S||t instanceof N?(this.x+=t.x,this.y+=t.y,this.z+=t.z):(this.x+=t,this.y+=e,this.z+=n)}toAdd(t,e){return new S(t.x+e.x,t.y+e.y,t.x+e.y)}sub(t,e=0,n=0){t instanceof S||t instanceof N?(this.x-=t.x,this.y-=t.y,this.z-=t.z):(this.x-=t,this.y-=e,this.z-=n)}toSub(t){const e=this;return new S(e.x-t.x,e.y-t.y,e.z-t.z)}mult(t){return t instanceof S||t instanceof N?(this.x*=t.x,this.y*=t.y,this.z*=t.z):(this.x*=t,this.y*=t,this.z*=t),this}toMult(t){const e=this;return new S(e.x*=t.x,e.y*=t.y,e.z*=t.z)}div(t){return t instanceof S||t instanceof N?(this.x/=t.x,this.y/=t.y,this.z/=t.z):(this.x/=t,this.y/=t,this.z/=t),this}toDiv(t){const e=this.get();return e.x/=t,e.y/=t,e.z/=t,e}dist(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)}toDist(t){const e=this,n=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return Math.sqrt(n*n+r*r+i*i)}dot(t,e,n){return t instanceof S||t instanceof N?this.x*t.x+this.y*t.y+this.z*t.z:this.x*t+this.y*e+this.z*n}cross(t){const e=this.x,n=this.y,r=this.z;return new S(n*t.z-t.y*r,r*t.x-t.z*e,e*t.y-t.x*n)}normalize(){const t=this.mag();t>0&&this.div(t)}limit(t){this.mag()>t&&(this.normalize(),this.mult(t))}heading2D(){return-Math.atan2(-this.y,this.x)}random2D(){return this.fromAngle(Math.random()*(2*Math.PI))}fromAngle(t,e=1){return new S(e*Math.cos(t),e*Math.sin(t),0)}fromAngles(t,e,n=1){const r=Math.cos(e),i=Math.sin(e),s=Math.cos(t),o=Math.sin(t);return new S(n*o*i,-n*s,n*o*r)}array(){return[this.x,this.y,this.z]}toPoint3D(){return new N(this.x,this.y,this.z)}toPoint2D(){return new v(this.x,this.y)}copy(){return new S(this.x,this.y,this.z)}toString(){return"["+this.x+", "+this.y+", "+this.z+"]"}}class N extends v{constructor(t,e,n){var r,i,s;t instanceof S?(super(t.x,t.y),this.z=t.z):"object"==typeof t?(super({x:null!==(r=t.x)&&void 0!==r?r:0,y:null!==(i=t.y)&&void 0!==i?i:0}),this.z=null!==(s=t.z)&&void 0!==s?s:0):(super(t,e),this.z=null!=n?n:0)}copy(){return new N(this.x,this.y,this.z)}}class O extends S{constructor(t){super(),this.volume=0,this.mass=0,this.e=0,this.rotate=0,this.width=0,this.height=0,this.transform=[1,0,0,1,0,0],this.color={r:0,g:0,b:0,a:255},this.updateObjWithDefaults(t)}copyObj(){return new O({x:this.x,y:this.y,z:this.z,volume:this.volume,mass:this.mass,e:this.e,rotate:this.rotate,width:this.width,height:this.height,transform:[...this.transform],color:Object.assign({},this.color),data:Object.assign({},this.data)})}updateObjWithDefaults(t){var e,n,r,i,s,o,a,c,l,h,u,d;if(t){this.x=null!==(e=t.x)&&void 0!==e?e:this.x,this.y=null!==(n=t.y)&&void 0!==n?n:this.y,this.z=null!==(r=t.z)&&void 0!==r?r:this.z,this.volume=null!==(i=t.volume)&&void 0!==i?i:this.volume,this.mass=null!==(s=t.mass)&&void 0!==s?s:this.mass,this.e=null!==(o=t.e)&&void 0!==o?o:this.e,this.rotate=null!==(a=t.rotate)&&void 0!==a?a:this.rotate,this.width=null!==(c=t.width)&&void 0!==c?c:this.width,this.height=null!==(l=t.height)&&void 0!==l?l:this.height,this.transform=[...null!==(h=t.transform)&&void 0!==h?h:this.transform],this.color=Object.assign({},null!==(u=t.color)&&void 0!==u?u:this.color);const p=null!==(d=t.data)&&void 0!==d?d:this.data;this.data=p?Object.assign({},p):void 0}}setObj(t){var e,n,r,i,s,o,a,c,l,h,u;if(t){this.x=null!==(e=t.x)&&void 0!==e?e:0,this.y=null!==(n=t.y)&&void 0!==n?n:0,this.z=null!==(r=t.z)&&void 0!==r?r:0,this.volume=null!==(i=t.volume)&&void 0!==i?i:0,this.mass=null!==(s=t.mass)&&void 0!==s?s:0,this.e=null!==(o=t.e)&&void 0!==o?o:0,this.rotate=null!==(a=t.rotate)&&void 0!==a?a:0,this.width=null!==(c=t.width)&&void 0!==c?c:0,this.height=null!==(l=t.height)&&void 0!==l?l:0,this.transform=[...null!==(h=t.transform)&&void 0!==h?h:[1,0,0,1,0,0]],this.color=Object.assign({},null!==(u=t.color)&&void 0!==u?u:{r:0,g:0,b:0,a:255});const d=t.data;this.data=d?Object.assign({},d):void 0}}toRect(){return new M(this.x,this.y,this.width,this.height)}}!function(t){t.getMinByObjectArray=(t,e)=>{let n;if(e&&t&&t.length>0){n=t[0][e];for(let r=1;r<t.length;r++)n=Math.min(n,t[r][e])}return n},t.hypot=(...t)=>Math.hypot(...t),t.pythagorean=(t,e)=>Math.sqrt(t*t+e*e),t.getMaxByObjectArray=(t,e)=>{let n;if(e&&t&&t.length>0){n=t[0][e];for(let r=1;r<t.length;r++)n=Math.max(n,t[r][e])}return n},t.sum=t=>t.reduce((t,e)=>t+e,0),t.avg=e=>e.length>0?t.sum(e)/e.length:0,t.minMax=(t,e)=>Math.min(Math.max(t,e.min),e.max),t.max=t=>t.length>0?Math.max(...t):void 0,t.min=t=>t.length>0?Math.min(...t):void 0,t.getSumByObjectArray=(t,e)=>{let n=0;if(e&&t&&t.length>0)for(let r=0;r<t.length;r++)n+=t[r][e];return n},t.radians=(t,{type:e="degreeAngle"})=>"ratio"===e?2*t*Math.PI:"percent"===e?t/100*2*Math.PI:t/180*Math.PI,t.degrees=(t,{type:e="degreeAngle"})=>"ratio"===e?360*t:"percent"===e?t/100*360:180*t/Math.PI,t.ratio=(t,e,n=1)=>n*(e/t),t.getBetweenLength=(t,e)=>e-t,t.getPercentByTotal=(t,e)=>e/t*100,t.getRatioByTotal=(t,e)=>e/t,t.getValueByTotalInPercent=(t,e)=>t*e/100,t.getValueByTotalInRatio=(t,e)=>t*e,t.getValuePercentUp=(t,e)=>t*(1+e/100),t.getValueRatioUp=(t,e)=>t*(1+e),t.getValuePercentDown=(t,e)=>t*(1-e/100),t.getValueRatioDown=(t,e)=>t*(1-e),t.beziers=(e,n)=>{const r=new Array(n).fill(void 0);for(let i=0;i<r.length;i++)r[i]=t.bezier(e,n,i);return r},t.bezier=(e,n,r)=>{if(e&&e.length>0){const i=e.map(t=>new S(t.x,t.y,t.z)),s=[];return i.reduce((t,e)=>{const i=t.toSub(e).div(n).mult(r+1);return s.push(t.toSub(i)),e}),s.length<=1?s[0]:t.bezier(s.map(t=>new N(t)),n,r)}return new S},t.cubicBezier=function(e,n,r){var i,s,o,a,c,l,h,u;if(e.start instanceof O&&e.end instanceof O){const d=t.cubicBezier({start:e.start.x,end:e.end.x},n,r),p=t.cubicBezier({start:e.start.y,end:e.end.y},n,r),f=t.cubicBezier({start:e.start.z,end:e.end.z},n,r),g=t.cubicBezier({start:e.start.volume,end:e.end.volume},n,r),m=t.cubicBezier({start:e.start.mass,end:e.end.mass},n,r),y=t.cubicBezier({start:e.start.e,end:e.end.e},n,r),A=t.cubicBezier({start:e.start.rotate,end:e.end.rotate},n,r),_=t.cubicBezier({start:e.start.width,end:e.end.width},n,r),E=t.cubicBezier({start:e.start.height,end:e.end.height},n,r),b=t.cubicBezier({start:e.start.transform[0],end:e.end.transform[0]},n,r),T=t.cubicBezier({start:e.start.transform[1],end:e.end.transform[1]},n,r),R=t.cubicBezier({start:e.start.transform[2],end:e.end.transform[2]},n,r),v=t.cubicBezier({start:e.start.transform[3],end:e.end.transform[3]},n,r),S=t.cubicBezier({start:e.start.transform[4],end:e.end.transform[4]},n,r),N=t.cubicBezier({start:e.start.transform[5],end:e.end.transform[5]},n,r),M=t.cubicBezier({start:null!==(i=e.start.color.r)&&void 0!==i?i:0,end:null!==(s=e.end.color.r)&&void 0!==s?s:0},n,r),w=t.cubicBezier({start:null!==(o=e.start.color.g)&&void 0!==o?o:0,end:null!==(a=e.end.color.g)&&void 0!==a?a:0},n,r),x=t.cubicBezier({start:null!==(c=e.start.color.b)&&void 0!==c?c:0,end:null!==(l=e.end.color.b)&&void 0!==l?l:0},n,r),C=t.cubicBezier({start:null!==(h=e.start.color.a)&&void 0!==h?h:255,end:null!==(u=e.end.color.a)&&void 0!==u?u:255},n,r);return d.map((t,e)=>{const n=new O({x:t,y:p[e],z:f[e]});return n.volume=g[e],n.mass=m[e],n.e=y[e],n.rotate=A[e],n.width=_[e],n.height=E[e],n.transform=[b[e],T[e],R[e],v[e],S[e],N[e]],n.color={r:M[e],g:w[e],b:x[e],a:C[e]},n})}if(e.start instanceof N&&e.end instanceof N){const i=t.cubicBezier({start:e.start.x,end:e.end.x},n,r),s=t.cubicBezier({start:e.start.y,end:e.end.y},n,r),o=t.cubicBezier({start:e.start.z,end:e.end.z},n,r);return i.map((t,e)=>new N(t,s[e],o[e]))}const{start:d,end:p}=e,{frame:f}=n;let{p1x:g,p1y:m,p2x:y,p2y:A}=Array.isArray(r)?{p1x:r[0],p1y:r[1],p2x:r[2],p2y:r[3]}:r;g="random"===g?Math.random():g,m="random"===m?Math.random():m,y="random"===y?Math.random():y,A="random"===A?Math.random():A;const _=[],E=p-d,b=t=>{const e=Number(t*t),n=Number(e*t),r=Number(1-t),i=Number(r*r);return 0*Number(i*r)+3*i*t*Number(m)+3*r*e*Number(A)+1*n},T=f+1;for(let t=1;t<T;t++){const e=d+E*b(t/T);_.push(e)}return _},t.diff=(t,e)=>Math.abs(t-e),t.distSqToLineSegment=(t,e,n)=>{const r=Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2);if(0===r)return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);let i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;i=Math.max(0,Math.min(1,i));const s=e.x+i*(n.x-e.x),o=e.y+i*(n.y-e.y);return Math.pow(t.x-s,2)+Math.pow(t.y-o,2)},t.rotatePoint=(t,e,n)=>{const r=t.x-e.x,i=t.y-e.y,s=r*Math.cos(n)-i*Math.sin(n),o=r*Math.sin(n)+i*Math.cos(n);return new v(s+e.x,o+e.y)}}(c||(c={}));class M{constructor(t,e,n=0,r=0){var i;(i=t)&&"number"==typeof i.width&&"number"==typeof i.height?(this._start=new v(0,0),this._width=t.width,this._height=t.height):"object"==typeof t&&"object"==typeof e?(this._start=t instanceof v?t:new v(t.x,t.y),this.end=e instanceof v?e:new v(e.x,e.y)):"object"==typeof t&&"number"==typeof e?(this._start=t instanceof v?t:new v(t.x,t.y),this._width=e,this._height=n):"number"==typeof t&&"number"==typeof e&&(this._start=new v(t,e),this._width=n,this._height=r)}valueLinkControl(t){let e,n=!1;var r;return"object"==typeof(r=t)&&"value"in r&&"noLink"in r?(e=t.value,n=t.noLink):e=t,{value:e,noLink:n}}get width(){return this._width}get height(){return this._height}get start(){return this._start.copy()}set width(t){this.setWidth(t)}setWidth(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=c.getPercentByTotal(this._width,e);this._width=e,this.applyWidthPercentLinks({value:r,noLink:n})}set height(t){this.setHeight(t)}setHeight(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=c.getPercentByTotal(this._height,e);this._height=e,this.applyHeightPercentLinks({value:r,noLink:n})}set start(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=new v({x:c.getPercentByTotal(this._start.x,e.x),y:c.getPercentByTotal(this._start.y,e.y)});this._start=e,this.applyStartPercentLinks({value:r,noLink:n})}setWidthFromEnd(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=c.getPercentByTotal(this.start.x,e);this._start.x=this.end.x-e,this.applyStartXPercentLinks({value:r,noLink:n})}set widthFromEnd(t){this.setWidthFromEnd(t)}setHeightFromEnd(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.end.y-e,i=c.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks({value:i,noLink:n})}set heightFromEnd(t){this.setHeightFromEnd(t)}setWidthFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.x-e/2,i=c.getPercentByTotal(this.start.x,r);this._start.x=r,this.applyStartXPercentLinks(i)}set widthFromCenter(t){this.setWidthFromCenter(t)}setHeightFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.y-e/2,i=c.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks(i)}set heightFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.y-e/2,i=c.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks(i)}set x(t){this.setX(t)}setX(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=e-this._start.x,i=c.getPercentByTotal(this.width,r);this._start.x=e,this.applyStartXPercentLinks({value:i,noLink:n})}set y(t){this.setY(t)}setY(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=e-this._start.y,i=c.getPercentByTotal(this.height,r);this._start.y=e,this.applyStartYPercentLinks({value:i,noLink:n})}applyWidthPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.setWidthByWidthPercent({value:e,noLink:this})})}applyHeightPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.setHeightByHeightPercent({value:e,noLink:this})})}applyStartPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.applyStartXPercentLinks({value:e.x,noLink:n}),this.applyStartYPercentLinks({value:e.y,noLink:n})}applyStartXPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.addXByWidthPercent({value:e,noLink:this})})}applyStartYPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.addYByHeightPercent({value:e,noLink:this})})}hasLink(t){var e;return null===(e=this.linkRects)||void 0===e?void 0:e.has(t)}isLinked(){var t;return!!(null===(t=this.linkRects)||void 0===t?void 0:t.size)}addLink(...t){var e;null!==(e=this.linkRects)&&void 0!==e||(this.linkRects=new Set),t.filter(t=>{var e;return!(null===(e=this.linkRects)||void 0===e?void 0:e.has(t))}).forEach(t=>{var e;null===(e=this.linkRects)||void 0===e||e.add(t),t.addLink(this)})}setLinks(t){this.unLinkAll(),this.addLink(...t)}unLinkAll(){this.linkRects&&(Array.from(this.linkRects.values()).forEach(t=>{this.unLink(t)}),this.linkRects.clear())}unLink(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.linkRects&&this.linkRects.delete(e),n||e.unLink({value:this,noLink:this})}addWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:this.width+c.getValueByTotalInPercent(this.width,e),noLink:n})}addHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:this.height+c.getValueByTotalInPercent(this.height,e),noLink:n})}addWidthRatio(t){this.width=this.width+c.getValueByTotalInRatio(this.width,t)}addHeightRatio(t){this.height=this.height+c.getValueByTotalInRatio(this.height,t)}addXPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+c.getValueByTotalInPercent(this.width,e),noLink:n})}addYPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+c.getValueByTotalInPercent(this.height,e),noLink:n})}addXRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+c.getValueByTotalInRatio(this.width,e),noLink:n})}addYRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+c.getValueByTotalInRatio(this.height,e),noLink:n})}set endX(t){const e=t-this.x;this.width=e}set endXPercent(t){this.endX=c.getValueByTotalInPercent(this.width,t)}set endYPercent(t){this.endY=c.getValueByTotalInPercent(this.height,t)}set endY(t){this.height=t-this.y}set end(t){this.width=t.x-this.x,this.height=t.y-this.y}get x(){return this.start.x}get y(){return this.start.y}get endX(){return this.end.x}get endY(){return this.end.y}to(t){const e=this.copy();return e.start=t,e}toRotate(t,{rotatePoint:e=this.center,type:n="degreeAngle"}){const r=c.radians(t,{type:n}),i=e instanceof v?e:new v(e.x,e.y);return[this.leftTop,this.rightTop,this.rightBottom,this.leftBottom].map(t=>c.rotatePoint(t,i,r))}get center(){return new v(this.start.x+this.width/2,this.start.y+this.height/2)}get end(){return new v(this.start.x+this.width,this.start.y+this.height)}get leftTop(){return this.start.copy()}get leftBottom(){return new v(this.start.x,this.end.y)}get rightTop(){return new v(this.end.x,this.start.y)}get rightBottom(){return this.end}copy(){return new M(this.x,this.y,this.width,this.height)}getWidthPercent(t){return c.getPercentByTotal(this.width,t)}getWidthRatio(t){return c.getRatioByTotal(this.width,t)}getWidthByPercent(t){return c.getValueByTotalInPercent(this.width,t)}getWidthByRatio(t){return c.getValueByTotalInRatio(this.width,t)}getHeightPercent(t){return c.getPercentByTotal(this.height,t)}getHeightRatio(t){return c.getRatioByTotal(this.height,t)}getHeightByPercent(t){return c.getValueByTotalInPercent(this.height,t)}getHeightByRatio(t){return c.getValueByTotalInRatio(this.height,t)}getXPercent(t){return c.getPercentByTotal(this.width,t-this.x)}getXRatio(t){return c.getRatioByTotal(this.width,t-this.x)}getXByPercent(t){return this.x+c.getValueByTotalInPercent(this.width,t)}getXByRatio(t){return this.x+c.getValueByTotalInRatio(this.width,t)}getYPercent(t){return c.getPercentByTotal(this.height,t-this.y)}getYRatio(t){return c.getRatioByTotal(this.height,t-this.y)}getYByPercent(t){return this.y+c.getValueByTotalInPercent(this.height,t)}getYByRatio(t){return this.y+c.getValueByTotalInRatio(this.height,t)}getPercent(t){return new v(this.getXPercent(t.x),this.getYPercent(t.y))}toScaleByWidth(t){const e=this.height/this.width;return new M(this.x,this.y,t,t*e)}toScaleByHeight(t){const e=this.width/this.height;return new M(this.x,this.y,t*e,t)}toRatio(t){return new M(this.getXRatio(t.x),this.getYRatio(t.y),this.getWidthRatio(t instanceof M?t.width:t.w),this.getHeightRatio(t instanceof M?t.height:t.h))}getRatio(t){return new v(this.getXRatio(t.x),this.getYRatio(t.y))}getByPercent(t){return new v(this.getXByPercent(t.x),this.getYByPercent(t.y))}getByRatio(t){return new v(this.getXByRatio(t.x),this.getYByRatio(t.y))}getDiffX(t){return t-this.x}getDiffY(t){return t-this.y}getDiffLeft(t){this.getDiffX(t)}getDiffTop(t){this.getDiffY(t)}getDiffRight(t){return t-this.end.x}getDiffBottom(t){return t-this.end.y}getDiffWidth(t){return t-this.width}getDiffHeight(t){return t-this.height}toDiff(t){return new M(t.x-this.x,t.y-this.y,t.width-this.width,t.height-this.height)}setXByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:c.getValueByTotalInPercent(this.width,e),noLink:n})}set xByWidthPercent(t){this.setXByWidthPercent(t)}setXByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:c.getValueByTotalInRatio(this.width,e),noLink:n})}set xByWidthRatio(t){this.setXByWidthRatio(t)}setYByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:c.getValueByTotalInPercent(this.height,e),noLink:n})}set yByHeightPercent(t){this.setYByHeightPercent(t)}setYByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:c.getValueByTotalInRatio(this.height,e),noLink:n})}set yByHeightRatio(t){this.setYByHeightRatio(t)}addXByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+c.getValueByTotalInPercent(this.width,e),noLink:n})}addXByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+c.getValueByTotalInRatio(this.width,e),noLink:n})}addYByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+c.getValueByTotalInPercent(this.height,e),noLink:n})}addYByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+c.getValueByTotalInRatio(this.height,e),noLink:n})}setWidthByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:c.getValueByTotalInPercent(this.width,e),noLink:n})}set widthByWidthPercent(t){this.setWidthByWidthPercent(t)}setWidthByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:c.getValueByTotalInRatio(this.width,e),noLink:n})}set widthByWidthRatio(t){this.setWidthByWidthRatio(t)}setHeightByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:c.getValueByTotalInPercent(this.height,e),noLink:n})}set heightByHeightPercent(t){this.setHeightByHeightPercent(t)}setHeightByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:c.getValueByTotalInRatio(this.height,e),noLink:n})}set heightByHeightRatio(t){this.setHeightByHeightRatio(t)}copyByPercent(t,e){return new M(this.x,this.y,c.getValueByTotalInPercent(this.width,t),c.getValueByTotalInPercent(this.height,null!=e?e:t))}copyByRatio(t,e){return new M(this.x,this.y,c.getValueByTotalInRatio(this.width,t),c.getValueByTotalInRatio(this.height,null!=e?e:t))}isIn(t){return t instanceof M?this.isIn(t.start)&&this.isIn(t.end):t.x>=this.start.x&&t.x<=this.end.x&&t.y>=this.start.y&&t.y<=this.end.y}isOut(t){return t instanceof M?!this.isOverlap(t):!this.isIn(t)}isOverlap(t){return t instanceof M?!(this.endX<t.x||this.x>t.endX||this.endY<t.y||this.y>t.endY):this.isIn(t)}toString(){return`x:${this.x}, y:${this.y}, width: ${this.width}, height: ${this.height}`}}!function(t){let e;t.constructorName=t=>t&&t.constructor&&t.constructor.name?t.constructor.name:t&&t.name?t.name:void 0,t.deepCopy=t=>t instanceof Map?new Map(JSON.parse(JSON.stringify(Array.from(t.entries())))):t instanceof Set?new Set(JSON.parse(JSON.stringify(Array.from(t.values())))):a.isNullOrUndefined(t)?t:JSON.parse(JSON.stringify(t)),t.allProtoTypeName=(e,n)=>{let r=[];if(e){const i=Object.getPrototypeOf(e);i&&(r=Object.keys(i)||[]).length>0&&(r=r.concat(t.allProtoTypeName(i,n)))}let i=r.filter(t=>"constructor"!==t);if(n&&e){const t=Object.getPrototypeOf(e);i=i.filter(e=>n(e,null==t?void 0:t[e]))}return i},t.uniqueKeys=t=>Array.from(new Set((Array.isArray(t)?t:[t]).flatMap(t=>Object.keys(t)))),t.ownPropertyNames=t=>{const e=[];if(t)if(t.prototype)e.push(...Object.getOwnPropertyNames(Object.getPrototypeOf(t)));else{const n=Object.getPrototypeOf(t);e.push(...Object.getOwnPropertyNames(n))}return e.filter(t=>"constructor"!==t)},t.protoTypeName=t=>{let e=[];if(t){const n=Object.getPrototypeOf(t);e=Object.keys(n)||[]}return e.filter(t=>"constructor"!==t)},t.protoTypes=t=>{const e=[];if(t){const n=Object.getPrototypeOf(t);(Object.keys(n)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.push(n[t])})}return e},t.seal=t=>Object.seal(t),t.isPrototypeOfTarget=(t,e)=>!(!t||!e)&&Object.prototype.isPrototypeOf.call(t.prototype,e),t.prototypeOfDepth=(t,e)=>{let n=t;const r=[];if(e)do{if(n=Object.getPrototypeOf(n),(null==n?void 0:n.constructor)===e)break;r.push(n)}while(n);return r},t.allProtoType=t=>{const e=(t,n=[])=>(t.prototype&&(n.push(t),e(Object.getPrototypeOf(t),n)),n);return e(t)},t.prototypeOf=t=>Object.getPrototypeOf(t),t.prototypeKeyMap=t=>{const e=new Map;if(t){const n=Object.getPrototypeOf(t);(Object.keys(n)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.set(n[t],t)})}return e},t.prototypeName=(e,n)=>t.prototypeKeyMap(e).get(n),t.pickRandomKey=t=>{const e=Object.keys(t);return e[Math.floor(Math.random()*e.length)]},t.pickRandomValue=t=>{const e=Object.keys(t);return t[e[Math.floor(Math.random()*e.length)]]},t.pickRandomKeyValue=t=>{const e=Object.keys(t),n=e[Math.floor(Math.random()*e.length)];return{key:n,value:t[n]}},t.keyValues=t=>Object.keys(t).map(e=>({key:e,value:t[e]})),t.entries=t=>Object.entries(t),t.values=t=>Object.values(t),t.keys=t=>Object.keys(t),t.keyLength=e=>t.keys(e).length,t.toDeleteUndefinedAndNull=(t,e)=>{const n=t=>Array.isArray(t)?t.filter(t=>null!=t).map(n):t&&"object"==typeof t?(null==e?void 0:e.deep)?Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e).map(([t,e])=>[t,n(e)])):Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e)):t;return n(t)},function(t){t.isFunctionScript=t=>t.trim().startsWith("function"),t.isArrowFunctionScript=t=>/^\s*\([^)]*\)\s*=>/.test(t),t.toOptionalChainPath=e=>{if(!e)return"";if(t.isFunctionScript(e)||t.isArrowFunctionScript(e))return e;const n=e.match(/[^?.[\]]+|\[[^\]]*\]/g);return n?n.join("?."):e},t.removeOptionalChainOperator=t=>t?t.replace(/\?\./g,".").replace(/\.\[/g,"["):"";const e=t=>{var e;const n=[],r=/\.([^.\[]+)|\[(\d+)\]|\[(['"])(.*?)\3\]/g;let i,s=0;const o=t.match(r);if(o&&(null!==(e=null==o?void 0:o.index)&&void 0!==e?e:0)>0)n.push(t.substring(0,o.index)),s=o.index;else if(!o&&t.length>0)return n.push(t),n;for(;null!==(i=r.exec(t));){if(i.index>s){const e=t.substring(s,i.index);e.startsWith(".")?n.push(e.substring(1)):n.push(e)}i[1]?n.push(i[1]):i[2]?n.push(parseInt(i[2],10)):i[4]&&n.push(i[4]),s=r.lastIndex}if(s<t.length){const e=t.substring(s);e.startsWith(".")?n.push(e.substring(1)):n.push(e)}return n};t.to=e=>{const n={};return Object.entries(e).forEach(([e,r])=>{t.set(n,e,r)}),n},t.set=(t,n,r)=>{const i=e(n);let s=t;for(let t=0;t<i.length;t++){const e=i[t];if(t===i.length-1)s[e]=r;else{const n=i[t+1];if("number"==typeof n){if(Array.isArray(s[e])||(s[e]=[]),Array.isArray(s[e]))for(;s[e].length<=n;)s[e].push({})}else"object"==typeof s[e]&&null!==s[e]||(s[e]={});s=s[e]}}},t.get=(t,n,r)=>{const i=e(n);let s=t;for(let t=0;t<i.length;t++){const e=i[t];if(null==s)return r;if("object"!=typeof s||null===s||!(e in s))return r;s=s[e]}return s},t.deletePath=(t,n)=>{const r=e(n);if(0===r.length)return!1;let i=t;for(let t=0;t<r.length-1;t++){const e=r[t];if(null==i)return!1;if("object"!=typeof i||null===i||!(e in i))return!1;i=i[e]}const s=r[r.length-1];return null!==i&&"object"==typeof i&&s in i&&(Array.isArray(i)&&"number"==typeof s?i.splice(s,1):delete i[s],!0)},t.availablePath=(t,e)=>{const n=[],r=t=>"number"==typeof t?"["+t+"]":/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:"['"+t+"']",i=(t,s,o)=>{null!==t&&"object"==typeof t&&(o.has(t)||(o.add(t),Array.isArray(t)?t.forEach((t,a)=>{const c=r(a),l=s?`${s}${c}`:c;e&&!e(l,t)||n.push(l),i(t,l,o)}):Object.keys(t).forEach(a=>{const c=r(a);let l;l=c.startsWith("[")?s?`${s}${c}`:c:s?`${s}.${c}`:c,e&&!e(l,t[a])||n.push(l),i(t[a],l,o)})))};return i(t,"",new Set),n}}(e=t.Path||(t.Path={})),t.toDeleteKey=(e,n)=>{const r=Object.assign({},e);return t.deleteKey(r,n),r},t.deleteKey=(t,e)=>{e.filter(t=>null!=t).forEach(e=>{delete t[e]})}}(l||(l={})),(g=h||(h={})).objToGetURL=t=>Object.keys(t).reduce((e,n,r)=>`${e}${0!==r?"&":""}${n}=${t[n]}`,""),g.mapToJson=t=>JSON.stringify(Array.from(t.entries()).reduce((t,[e,n])=>(t[e]=n,t),{})),g.jsonToMap=t=>new Map(JSON.parse(t)),g.decodeURIString=t=>decodeURIComponent(t),g.objToStrMap=t=>{const e=new Map;for(const n of Object.keys(t))e.set(n,t[n]);return e},g.jsonToStrMap=t=>g.objToStrMap(JSON.parse(t)),g.strToObject=t=>JSON.parse(t),g.objToJson=t=>JSON.stringify(t),g.objToMap=t=>{const e=new Map;return Object.keys(t).forEach(n=>{e.set(n,t[n])}),e},g.mapToObj=t=>{const e={};return t.forEach((t,n)=>{e[n]=t}),e},g.snakeToCamelCase=t=>t.replace(/_([a-z])/g,(t,e)=>e.toUpperCase()),g.camelToSnakeCase=t=>t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),g.toFormData=function(t){const e=new FormData;for(const n in t)e.append(n,t[n]);return e},g.toObject=function(t,e){if(t instanceof URLSearchParams){const n={};return t.forEach((t,r)=>{(null==e?void 0:e.firstValue)&&void 0===n[r]?n[r]=t:(null==e?void 0:e.firstValue)||(n[r]?Array.isArray(n[r])?n[r].push(t):n[r]=[n[r],t]:n[r]=t)}),n}if(t instanceof FormData){const e=t=>{const e={};for(const n of t.keys()){const r=t.getAll(n);e[n]=r.length>1?r:r[0]}return e};return e(t)}if(t&&"function"==typeof t[Symbol.iterator])return Object.fromEntries(t);if(Array.isArray(t))return Object.fromEntries(t);if(a.isMap(t)){const e=t;t=g.mapToObj(e)}if(a.isArray(t)){const e=t;for(let t=0;t<e.length;t++)e[t]=g.toObject(e[t])}if(a.isObject(t))for(const e in t)t[e]=g.toObject(t[e]);return t},g.toArray=t=>t instanceof Set?Array.from(t.values()):Array.isArray(t)?t:t?[t]:[],g.flatArray=(...t)=>t.flatMap(t=>t instanceof Object&&Symbol.iterator in t?Array.from(t):[t]),g.iteratorToArray=t=>Array.from(t),g.toJson=t=>{const e=g.toObject(t);return JSON.stringify(e)},g.concatenateToAttribute=t=>g.concatenateToString(t,"="," ","'"),g.concatenateToParameter=t=>g.concatenateToString(t,"=","&",""),g.concatenateToString=(t,e="=",n=" ",r="")=>{const i=[];for(const n in t){const s=t[n];s&&i.push(n.toString()+e+r+s+r)}return i.join(n)},g.specialCharsToEscape=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g.decodeHTMLEscape=t=>t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x2F;/g,"/"),g.copyObject=(t,e={})=>Object.assign(Object.assign({},t),e),g.copyArrayWithAddition=(t,e)=>[...t,...e||[]],g.hexToInt=t=>(t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t.split("").map(t=>t+t).join("")),parseInt(t,16)),g.toHex=t=>(t<0&&(t=4294967295+t+1),(t=Number(t.toFixed(0))).toString(16).padStart(2,"0").toUpperCase()),g.toHexColor=t=>{var e,n,r,i;return`#${g.toHex(null!==(e=t.r)&&void 0!==e?e:0)}${g.toHex(null!==(n=t.g)&&void 0!==n?n:0)}${g.toHex(null!==(r=t.b)&&void 0!==r?r:0)}${g.toHex(null!==(i=t.a)&&void 0!==i?i:255)}`},g.avgColor=t=>{const e=t.reduce((t,e)=>{var n,r,i,s;return t.r+=null!==(n=e.r)&&void 0!==n?n:0,t.g+=null!==(r=e.g)&&void 0!==r?r:0,t.b+=null!==(i=e.b)&&void 0!==i?i:0,t.a+=null!==(s=e.a)&&void 0!==s?s:0,t},{r:0,g:0,b:0,a:0});return{r:Math.floor(e.r/t.length),g:Math.floor(e.g/t.length),b:Math.floor(e.b/t.length),a:Math.floor(e.a/t.length)}},g.toRGBA=t=>{null!=t||(t="#000000FF");const e=t.replace("#","");return{r:parseInt(e.slice(0,2)||"0",16),g:parseInt(e.slice(2,4)||"0",16),b:parseInt(e.slice(4,6)||"0",16),a:e.length>6?parseInt(e.slice(6,8)||"0",16):255}},g.minMaxCenterAvg=t=>{const e={},n=l.uniqueKeys(t);for(const r of n){const n=t.map(t=>t[r]),i=Math.min(...n),s=Math.max(...n),o=(i+s)/2,a=n.reduce((t,e)=>t+e,0)/n.length;e[r]={min:i,max:s,center:o,avg:a,diff:s-i}}return e},g.minMaxCenterRectAvg2D=t=>{const e=new v(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),n=new v(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);let r=new v(0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),n.x=Math.max(n.x,t.x),n.y=Math.max(n.y,t.y),r.x+=t.x,r.y+=t.y});const i=new v((e.x+n.x)/2,(e.y+n.y)/2),s=new v(r.x/t.length,r.y/t.length),o=new M(e.x,e.y,n.x-e.x,n.y-e.y);return{min:e,max:n,center:i,avg:s,minMaxRect:o}},g.minMaxCenterAvg3D=t=>{const e=new N(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new N(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);let r=new N(0,0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),e.z=Math.max(e.z,t.z),n.x=Math.max(n.x,t.x),n.y=Math.max(n.y,t.y),n.z=Math.max(n.z,t.y),r.x+=t.x,r.y+=t.y,r.z+=t.z});const i=new N((e.x+n.x)/2,(e.y+n.y)/2,(e.z+n.z)/2),s=new N(r.x/t.length,r.y/t.length,r.z/t.length);return{min:e,max:n,center:i,avg:s}},g.roundRectRadiiToFullRadii=t=>{var e,n,r,i,s,o,a,c,l,h,u,d;return t?1===t.length?[null!==(e=t[0])&&void 0!==e?e:0,null!==(n=t[0])&&void 0!==n?n:0,null!==(r=t[0])&&void 0!==r?r:0,null!==(i=t[0])&&void 0!==i?i:0]:2===t.length?[null!==(s=t[0])&&void 0!==s?s:0,null!==(o=t[1])&&void 0!==o?o:0,null!==(a=t[0])&&void 0!==a?a:0,null!==(c=t[1])&&void 0!==c?c:0]:3===t.length?[null!==(l=t[0])&&void 0!==l?l:0,null!==(h=t[1])&&void 0!==h?h:0,null!==(u=t[2])&&void 0!==u?u:0,null!==(d=t[1])&&void 0!==d?d:0]:t:[0,0,0,0]},g.toArrayDirectionChange=t=>{if(!t||0===t.length||!t[0]||0===t[0].length)return[];const e=[],n=t[0].length,r=t.length;for(let i=0;i<n;i++){const n=[];for(let e=0;e<r;e++)n.push(t[e][i]);e.push(n)}return e},g.groupByMap=(t,e)=>t.reduce((t,n)=>{const r=e(n),i=t.get(r)||[];return i.push(n),t.set(r,i),t},new Map),g.groupByObject=(t,e)=>{const n=g.groupByMap(t,e);return Object.fromEntries(n)},g.toURLSearchParams=t=>{const e=new URLSearchParams;if("string"==typeof t)new URLSearchParams(t).forEach((t,n)=>{e.append(n,t)});else if("object"==typeof t){const n=t instanceof URLSearchParams?t.entries():Array.isArray(t)?t:Object.entries(t);for(const[t,r]of Array.from(n))Array.isArray(r)?r.forEach(n=>e.append(t,n)):e.append(t,r)}return e},g.stringJsonToKeyPairs=t=>Array.from(t.matchAll(/(\w+):\s*([^,}]+)/g)).map(t=>({key:t[1],value:t[2]})),(f=u||(u={})).create=t=>new Date(t),f.dayZeroTime=t=>{const e=t?new Date(t):new Date;return e.setHours(0,0,0,0),e},f.fullMilliSecond=()=>(new Date).getTime(),f.fullSecond=()=>(new Date).getTime()/1e3,f.milliSecond=()=>(new Date).getMilliseconds(),f.format=(t,e="yyyy-MM-dd HH:mm:ss")=>{const n=t=>String(t).padStart(2,"0"),r=t.getFullYear(),i=n(t.getMonth()+1),s=n(t.getDate()),o=n(t.getHours()),a=n(t.getMinutes()),c=n(t.getSeconds());return e.replace("yyyy",String(r)).replace("MM",i).replace("dd",s).replace("HH",o).replace("mm",a).replace("ss",c)},f.isSameDate=(t,e)=>t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),f.compare=(t,e)=>t.getTime()<e.getTime()?-1:t.getTime()>e.getTime()?1:0,f.weekCountOfYear=t=>{const e=new Date(t.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));const n=new Date(e.getFullYear(),0,1);return Math.ceil(((e.getTime()-n.getTime())/864e5+1)/7)},f.age=(t,e=new Date)=>{let n=e.getFullYear()-t.getFullYear();const r=e.getMonth()-t.getMonth();return(r<0||0===r&&e.getDate()<t.getDate())&&n--,Math.max(n,0)},f.countingAge=(t,e=new Date)=>Math.max(e.getFullYear()-t.getFullYear(),0)+1,f.add=({years:t=0,months:e=0,days:n=0,minutes:r=0,seconds:i=0,milliSecond:s=0},o)=>{const a=o?new Date(o):new Date;return t&&a.setFullYear(a.getFullYear()+t),e&&a.setMonth(a.getMonth()+e),n&&a.setDate(a.getDate()+n),r&&a.setMinutes(a.getMinutes()+r),i&&a.setSeconds(a.getSeconds()+i),s&&a.setMilliseconds(a.getMilliseconds()+s),a},f.toDate=t=>{if(t instanceof Date)return t;if("string"==typeof t||"number"==typeof t)return new Date(t);throw new Error("Invalid date type. Expected Date, string, or number.")},f.sinceSeconds=t=>Math.floor((Date.now()-t.getTime())/1e3),f.toSeconds=(t=new Date)=>Math.floor(t.getTime()/1e3),f.toMilliseconds=(t=new Date)=>t.getTime(),f.fromSeconds=t=>new Date(1e3*t),f.fromMilliseconds=t=>new Date(t),f.toISOString=(t=new Date)=>t.toISOString(),f.fromISOString=t=>new Date(t),f.formatDuration=(t,e=f.getDefaultLocale())=>{const n=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"long"});let r=t;const i=Math.floor(r/86400);r-=86400*i;const s=Math.floor(r/3600);r-=3600*s;const o=Math.floor(r/60);r-=60*o;const a=r,c=[];return i>0&&c.push(n.format(i,"day").replace("후","").replace("in ","").replace("dans ","")),s>0&&c.push(n.format(s,"hour").replace("후","").replace("in ","").replace("dans ","")),o>0&&c.push(n.format(o,"minute").replace("후","").replace("in ","").replace("dans ","")),(a>0||0===c.length)&&c.push(n.format(a,"second").replace("후","").replace("in ","").replace("dans ","")),c.join(" ")},f.relativeTime=(t,e)=>{const n=new Intl.RelativeTimeFormat(null==e?void 0:e.locales,null==e?void 0:e.options);let r;r=t instanceof Date?t:new Date(t);const i=new Date,s=r.getTime()-i.getTime(),o=Math.floor(Math.abs(s)/6e4),a=Math.floor(Math.abs(s)/36e5),c=Math.floor(Math.abs(s)/864e5);return 0===s?n.format(0,"seconds"):s<0?o<1?n.format(-Math.floor(Math.abs(s)/1e3),"seconds"):o<60?n.format(-o,"minutes"):a<24?n.format(-a,"hours"):n.format(-c,"days"):o<1?n.format(Math.floor(s/1e3),"seconds"):o<60?n.format(o,"minutes"):a<24?n.format(a,"hours"):n.format(c,"days")},f.getDefaultLocale=()=>Intl.DateTimeFormat().resolvedOptions().locale;class w extends O{render(t,e){var n;try{this.beforeDraw(t),t.context.save(),(null==e?void 0:e.disableReset)||null===(n=t.reset)||void 0===n||n.call(t),this.draw(t),t.context.restore(),this.afterDraw(t)}catch(t){console.error("error!!",t),this.error(t)}}beforeDraw(t){}afterDraw(t){}error(t){}}class x extends w{constructor(t,e,n){this._calc={},this._transactionDoneSubscribers=[],super(t instanceof N||"object"==typeof t?t:{x:t,y:e,z:n}),this._currentTransactionControlConfig=this.makeTransactionControlConfig({targetPoint:{obj:this},drawFps:1})}get calc(){return this._calc}getCalc(t){return this._calc[t]}setCalc(t,e){this._calc[t]=e}getTransactionStartPoint(){return this._currentTransactionControlConfig.transactionStartPoint}getTransactionFrames(){return{points:this._currentTransactionControlConfig.points,calcs:this._currentTransactionControlConfig.calcs}}setTransactionIndex(t){this._currentTransactionControlConfig.pointPositionIndex=t}getTransactionIndex(){return this._currentTransactionControlConfig.pointPositionIndex}getTransactionIndexRate(){return c.getPercentByTotal(this._currentTransactionControlConfig.points.length,this._currentTransactionControlConfig.pointPositionIndex+1)/100}getCurrentTransactionPoint(){return this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex]}getCurrentDrawFps(){return this._currentTransactionControlConfig.config.drawFps}getCurrentTransactionTargetPoint(){const t=this.getCurrentDrawFps(),e=Array.isArray(this._currentTransactionControlConfig.config.targetPoint)?this._currentTransactionControlConfig.config.targetPoint:[this._currentTransactionControlConfig.config.targetPoint],n=Math.ceil(t/e.length);return e[this._currentTransactionControlConfig.pointPositionIndex/n]}remainingFrameCountTransaction(){return this._currentTransactionControlConfig.points.length-1-this._currentTransactionControlConfig.pointPositionIndex}isDoneTransaction(){return this._currentTransactionControlConfig.pointPositionIndex>=this._currentTransactionControlConfig.points.length-1}makeTransactionControlConfig(t){var e,n,r;t.startPoint&&this.updateObjWithDefaults(t.startPoint);const i=l.deepCopy(this._calc);t.startCalcs&&Object.entries(t.startCalcs).forEach(([t,e])=>{i[t]=e});const s=this.defaultTransactionConfig(t),o=s.targetPoint=Array.isArray(s.targetPoint)?s.targetPoint:[s.targetPoint],a=[],u=this.copyObj();let d={obj:u,bezierConfig:x.DEFAULT_BEZIER};const p=s.drawFps,f=Math.ceil(p/o.length);for(let t=0;t<o.length;t++){const n=o[t],r=c.cubicBezier({start:d.obj,end:n.obj},{frame:f},null!==(e=n.bezierConfig)&&void 0!==e?e:x.DEFAULT_BEZIER),i=[d.obj,...r,n.obj];i.forEach(t=>t.data=n.obj.data),a.push(...i),d=n}if(p<=0&&o.length>0){const t=o[o.length-1].obj;a.length=0,a.push(t),this.updateObjWithDefaults(t)}const g={};return null===(r=Object.entries(null!==(n=s.calcs)&&void 0!==n?n:{}))||void 0===r||r.forEach(([t,e],n)=>{var r,s;const o=Array.isArray(e)?e:[e];let a=i[t];const l=[];for(let t=0;t<o.length;t++){const e=o[t];if(Array.isArray(e.value)){const t=null!=a?a:[],n=e.value,r=n.map((r,i)=>{var s,o,a;return c.cubicBezier({start:null!==(s=t[i])&&void 0!==s?s:0,end:null!==(o=n[i])&&void 0!==o?o:0},{frame:f},null!==(a=e.bezierConfig)&&void 0!==a?a:x.DEFAULT_BEZIER)}),i=h.toArrayDirectionChange(r);l.push(t,...i,n)}else{const t=null!==(r=a)&&void 0!==r?r:0,n=c.cubicBezier({start:t,end:e.value},{frame:f},null!==(s=e.bezierConfig)&&void 0!==s?s:x.DEFAULT_BEZIER);l.push(t,...n,e.value)}a=e.value}p<=0&&l.length>0&&(i[t]=l[l.length-1]),g[t]=l}),{points:a,calcs:g,pointPositionIndex:0,transactionStartCalcs:i,transactionStartPoint:u,config:s}}transaction(t){var e;null===(e=this.syncSubLayer)||void 0===e||e.name,this.isDoneTransaction()&&t.deferTransaction?this._currentTransactionControlConfig=this.makeTransactionControlConfig(t):t.deferTransaction?this._waitTransactionConfig=t:this._currentTransactionControlConfig=this.makeTransactionControlConfig(t)}defaultTransactionConfig(t){var e,n;return Object.assign(Object.assign({},t),{animationIterationCount:null!==(e=t.animationIterationCount)&&void 0!==e?e:1,animationDirection:null!==(n=t.animationDirection)&&void 0!==n?n:"normal"})}render(t,e){var n,r,i,s,o,a,c,l,h,u,d,p,f,g,m,y,A,_,E,b,T,R,v,S,N,O,M,w,x,C,P,I,L,k,j,D,B,$,V,H,F,z,U,W,G,Y;if(this.x=null!==(r=null===(n=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===n?void 0:n.x)&&void 0!==r?r:this.x,this.y=null!==(s=null===(i=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===i?void 0:i.y)&&void 0!==s?s:this.y,this.z=null!==(a=null===(o=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===o?void 0:o.z)&&void 0!==a?a:this.z,this.volume=null!==(l=null===(c=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===c?void 0:c.volume)&&void 0!==l?l:this.volume,this.mass=null!==(u=null===(h=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===h?void 0:h.mass)&&void 0!==u?u:this.mass,this.e=null!==(p=null===(d=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===d?void 0:d.e)&&void 0!==p?p:this.e,this.rotate=null!==(g=null===(f=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===f?void 0:f.rotate)&&void 0!==g?g:this.rotate,this.width=null!==(y=null===(m=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===m?void 0:m.width)&&void 0!==y?y:this.width,this.height=null!==(_=null===(A=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===A?void 0:A.height)&&void 0!==_?_:this.height,this.transform[0]=null!==(b=null===(E=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===E?void 0:E.transform[0])&&void 0!==b?b:this.transform[0],this.transform[1]=null!==(R=null===(T=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===T?void 0:T.transform[1])&&void 0!==R?R:this.transform[1],this.transform[2]=null!==(S=null===(v=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===v?void 0:v.transform[2])&&void 0!==S?S:this.transform[2],this.transform[3]=null!==(O=null===(N=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===N?void 0:N.transform[3])&&void 0!==O?O:this.transform[3],this.transform[4]=null!==(w=null===(M=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===M?void 0:M.transform[4])&&void 0!==w?w:this.transform[4],this.transform[5]=null!==(C=null===(x=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===x?void 0:x.transform[5])&&void 0!==C?C:this.transform[5],this.color.r=null!==(L=null===(I=null===(P=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===P?void 0:P.color)||void 0===I?void 0:I.r)&&void 0!==L?L:this.color.r,this.color.g=null!==(D=null===(j=null===(k=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===k?void 0:k.color)||void 0===j?void 0:j.g)&&void 0!==D?D:this.color.g,this.color.b=null!==(V=null===($=null===(B=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===B?void 0:B.color)||void 0===$?void 0:$.b)&&void 0!==V?V:this.color.b,this.color.a=null!==(z=null===(F=null===(H=this._currentTransactionControlConfig.points[this._currentTransactionControlConfig.pointPositionIndex])||void 0===H?void 0:H.color)||void 0===F?void 0:F.a)&&void 0!==z?z:this.color.a,Object.entries(null!==(U=this._currentTransactionControlConfig.calcs)&&void 0!==U?U:{}).forEach(([t,e])=>{this._calc[t]=e[this._currentTransactionControlConfig.pointPositionIndex]}),this._currentTransactionControlConfig.pointPositionIndex=Math.min(this._currentTransactionControlConfig.pointPositionIndex+1,this._currentTransactionControlConfig.points.length-1),super.render(t,e),this.isDoneTransaction()){const t=Array.isArray(this._currentTransactionControlConfig.config.targetPoint)?[...this._currentTransactionControlConfig.config.targetPoint]:[this._currentTransactionControlConfig.config.targetPoint],e={};if(Object.entries(null!==(Y=null===(G=null===(W=this._currentTransactionControlConfig)||void 0===W?void 0:W.config)||void 0===G?void 0:G.calcs)&&void 0!==Y?Y:{}).forEach(([t,n])=>e[t]=Array.isArray(n)?n:[n]),this._waitTransactionConfig&&this._waitTransactionConfig.deferTransaction)return this.transaction(this._waitTransactionConfig),void(this._waitTransactionConfig=void 0);let n=this._currentTransactionControlConfig.config.startPoint,r=this._currentTransactionControlConfig.transactionStartCalcs;if("reverse"===this._currentTransactionControlConfig.config.animationDirection&&t.length>0){const i=t.pop();t.reverse(),n&&t.push({obj:n}),Object.entries(e).forEach(([t,e])=>{const n=e.pop();n&&(e.reverse(),e.push({value:r[t]}),r[t]=n.value)}),i&&(n=i.obj)}"infinite"===this._currentTransactionControlConfig.config.animationIterationCount?this.transaction(Object.assign(Object.assign({},this._currentTransactionControlConfig.config),{startPoint:n,targetPoint:t,startCalcs:r,calcs:e})):this._currentTransactionControlConfig.config.animationIterationCount>1&&this.transaction(Object.assign(Object.assign({},this._currentTransactionControlConfig.config),{startPoint:n,targetPoint:t,startCalcs:r,calcs:e,animationIterationCount:this._currentTransactionControlConfig.config.animationIterationCount-1}))}}}x.DEFAULT_BEZIER={p1x:.61,p1y:1,p2x:.88,p2y:1},function(t){t.deleteEnter=t=>t.replace(/\r?\n/g,""),t.pickEmoji=t=>{var e;return null!==(e=t.match(/[\p{Emoji}]/gu))&&void 0!==e?e:[]},t.regexExec=(t,e)=>{let n=t.exec(e);const r=[];for(;n;)r.push(n),n=t.exec(n.input);return r},t.regexExecArrayReplace=(e,n,r)=>((Array.isArray(n)?n:t.regexExec(n,e)).reverse().forEach(t=>{const n="string"==typeof r?r:r(t);e=e.substr(0,t.index)+e.substr(t.index).replace(t[0],n)}),e),t.escapeSpecialCharacterRegExp=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.trim=t=>t.trim(),t.rsubString=(t,e)=>t.substring(t.length-e,t.length),t.lsubString=(t,e)=>t.substring(0,e),t.lpad=(e,n,r)=>{for(;n>r.length;)r=e+r;return t.rsubString(r,n)},t.rpad=(e,n,r)=>{for(;n>r.length;)r+=e;return t.lsubString(r,n)},t.lappend=(t,e)=>{let n="",r=0;for(;r++<t;)n+=e;return n},t.unescape=t=>{if(!t)return"";const e={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿","#x27":"'"};return t.replace(/&((?:(?:[a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});?)+);/gi,(t,n)=>n.toLowerCase().split(";").map(n=>n in e?e[n]:t).join(""))},t.executeExpression=(t,e)=>t.replace(/\${([^{}]*)}/g,(t,n)=>{var r;return String(null!==(r=e[n])&&void 0!==r?r:t)}),t.ellipsis=(t,e)=>t.length>e?`${t.slice(0,e)}...`:t,t.appendPostposition=(t,{vowel:e,consonant:n})=>`${t}${a.lastConsonantLetter(t)?n:e}`}(d||(d={})),function(t){let e,n;t.bindExpression=(t,e)=>(null!=t?t:"").replace(/\$\{([\s\S.]*?)\}/g,(t,n)=>{const[r,i]=n.split(":"),s=e[r];return s?"function"==typeof s?s(e[i]):s:""}),function(t){t.isExpression=t=>/[$#]\{([\s\S.]*?)\}[$#]/g.test(null!=t?t:""),t.expressionGroups=t=>d.regexExec(/[$#]\{([\s\S.]*?)\}[$#]/g,null!=t?t:"")}(e=t.Group||(t.Group={})),function(t){t.pathNameData=(t,e)=>{const n=t.split("/"),r=e.split("/");if(n.length!==r.length)return;const i={};for(let t=0;t<r.length;t++){const e=r[t],s=n[t],o=/^\{(.+)\}$/g.exec(e);if(!o){if(e!==s)return;continue}const[a,c]=o[1].split(":");if(c&&!new RegExp(c).test(s))return;i[a]=s}return i}}(n=t.Path||(t.Path={}))}(p||(p={}));var C,P,I,L,k,j,D,B,$,V,H,F,z=function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function o(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}c((r=r.apply(t,e||[])).next())})};!function(t){let e;t.filterCatch=(t,e)=>z(this,void 0,void 0,function*(){try{return void(yield t)}catch(t){const n=Array.isArray(e)?e:[e];for(let e of n)if(a.isConstructor(e)){if(t instanceof e)return t}else if(e(t))return t;throw t}}),t.sleep=t=>new Promise(e=>setTimeout(e,t)),t.sleepReject=t=>new Promise((e,n)=>setTimeout(n,t)),t.settle=t=>z(this,void 0,void 0,function*(){return Promise.allSettled([t]).then(t=>t[0])}),t.settles=(...t)=>z(this,void 0,void 0,function*(){return Promise.allSettled(t)}),t.loop=e=>({subscribe:n=>{var r;let i=!1,s=0;const o=()=>z(this,void 0,void 0,function*(){var r,a,c,l;const h=Date.now();let u=h;s++;const d={age:s};let p,f=!1;try{p=yield e.factory(d),u=Date.now(),null===(r=n.then)||void 0===r||r.call(n,p,Object.assign(Object.assign({},d),{duration:u-h}))}catch(t){f=!0,u=Date.now(),null===(a=n.catch)||void 0===a||a.call(n,t,Object.assign(Object.assign({},d),{duration:u-h}))}if(yield t.sleep(null!==(c=e.loopDelay)&&void 0!==c?c:0),null===(l=n.delayThen)||void 0===l||l.call(n,Object.assign(Object.assign({},d),{duration:u-h,isCatch:f,data:p})),!i)return o()});return setTimeout(()=>{o()},null!==(r=e.delay)&&void 0!==r?r:0),{get closed(){return i},unsubscribe:()=>{i=!0}}}}),t.delayExecute=(t,e=0)=>new Promise(n=>{setTimeout(()=>z(this,void 0,void 0,function*(){const e=yield t();n(e)}),e)}),t.transaction=(t,e)=>{const n="function"==typeof t?t():t;let r,i,s;new Promise((t,s)=>{var o;setTimeout(()=>{(()=>{var s,o;i=null===(s=null==e?void 0:e.before)||void 0===s?void 0:s.call(e),n.then(e=>{t(e)}),r=null===(o=null==e?void 0:e.after)||void 0===o?void 0:o.call(e)})()},null!==(o=null==e?void 0:e.delay)&&void 0!==o?o:0)}).then(t=>{var n;s=t,null===(n=null==e?void 0:e.then)||void 0===n||n.call(e,t,{before:i})}).catch(t=>{var n;if(null===(n=null==e?void 0:e.catch)||void 0===n||n.call(e,t,{before:i,after:r}),!(null==e?void 0:e.disabledCatchThrow))throw t}).finally(()=>{var t;null===(t=null==e?void 0:e.finally)||void 0===t||t.call(e,{before:i,after:r,data:s})})},t.withResolvers=()=>{let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},function(t){function e(t){const n="function"==typeof t?t():t;if("function"==typeof t&&(n.factory=()=>e(t)),void 0===n.status){const t=n;t.status="pending",t.isPending=!0,t.isFulfilled=!1,t.isRejected=!1,t.then(t=>{console.log("result??",t);const e=n;e.status="fulfilled",e.isFulfilled=!0,e.isRejected=!1,e.isPending=!1,e.value=t},t=>{console.log("rejet??",t);const e=n;e.status="rejected",e.isFulfilled=!1,e.isRejected=!0,e.isPending=!1,e.reason=t})}return n}t.awaitWrap=function t(n){return z(this,void 0,void 0,function*(){const r=e(n);try{yield r}catch(t){}const i={status:r.status,isFulfilled:r.isFulfilled,isRejected:r.isRejected,isPending:r.isPending,value:r.value,reason:r.reason};return"function"==typeof n?(i.factory=()=>t(n),i):i})},t.wrap=e}(e=t.Result||(t.Result={}))}(C||(C={})),function(t){t.loadImageBitMap=function(t,e){let n,r,i;if(e)n=e.onload,r=e.onerror;else{const t=C.withResolvers();i=t.promise,n=t.resolve,r=t.reject}return fetch(t,{mode:"cors",credentials:"omit"}).then(t=>t.blob()).then(t=>createImageBitmap(t)).then(t=>{n(t)}).catch(t=>{r(t)}),i}}(P||(P={})),Symbol.iterator,function(t){t.LOG="LOG",t.ERROR="ERROR",t.WARN="WARN",t.INFO="INFO",t.DEBUG="DEBUG",t.TRACE="TRACE",t.OFF="OFF"}(I||(I={})),Error;class U{constructor(t){this.value=t}static ofNullable(t){return null==t?U.empty():U.of(t)}static of(t){return new U(t)}orElse(t){return this.isPresent()?this.value:t}isPresent(){return null!=this.value&&null!=this.value}static empty(){return U.EMPTY}}U.EMPTY=new U,function(t){t.mapIfPresent=(t,e)=>null==t?void 0:e(t)}(L||(L={})),function(t){t.uniqueInts=(e,n,r)=>{const i=[];if(r>n-e)throw new Error("Count is greater than the range of unique integers");for(;i.length<r;){const r=t.int(e,n);i.includes(r)||i.push(r)}return i},t.chance=t=>{if(t<0||t>1)throw new Error("Percentage must be between 0 and 1");return Math.random()<t},t.int=(e,n)=>Math.floor(t.float(e,n)),t.float=(t,e)=>a.isNullOrUndefined(t)?Math.random():!a.isNullOrUndefined(t)&&a.isNullOrUndefined(e)?Math.random()*(t||0):Math.random()*((e||0)-(t||0))+(t||0),t.uuid=(t="xxxx-xxxx-xxxx-xxxx")=>t.replace(/[xy]/g,function(t){const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}),t.uuid4=()=>{let t,e="";for(t=0;t<32;t+=1)switch(t){case 8:case 20:e+="-",e+=(16*Math.random()|0).toString(16);break;case 12:e+="-",e+="4";break;case 16:e+="-",e+=(4*Math.random()|8).toString(16);break;default:e+=(16*Math.random()|0).toString(16)}return e},t.hex=()=>{const t="0123456789ABCDEF".split("");let e="";for(let n=0;n<6;n++)e+=t[Math.floor(16*Math.random())];return e},t.rgb=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let n=0;n<6;n++)e+=t[Math.floor(16*Math.random())];return e},t.rgba=()=>{const t="0123456789ABCDEF".split("");let e="#";for(let n=0;n<8;n++)e+=t[Math.floor(16*Math.random())];return e},t.alphabet=t=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");let n="";for(let r=0;r<t;r++)n+=e[Math.floor(Math.random()*e.length)];return n}}(k||(k={})),function(t){t.getParameterTypes=(t,e)=>e?Reflect.getMetadata("design:paramtypes",t,e)||[]:Reflect.getMetadata("design:paramtypes",t)||[],t.getReturnType=(t,e)=>Reflect.getMetadata("design:returntype",t,e),t.getType=(t,e)=>e?Reflect.getMetadata("design:type",t,e):Reflect.getMetadata("design:type",t),t.getMetadata=(t,e,n)=>n?Reflect.getMetadata(t,e,n):Reflect.getMetadata(t,e),t.getMetadataKeys=t=>Reflect.getMetadataKeys(t),t.getOwnMetadata=(t,e,n)=>n?Reflect.getOwnMetadata(t,e,n):Reflect.getOwnMetadata(t,e),t.getMetadatas=e=>t.getMetadataKeys(e).map(n=>t.getMetadata(n,e)),t.metadata=(t,e)=>Reflect.metadata(t,e),t.defineMetadata=(t,e,n,r)=>{r&&Reflect.defineMetadata?Reflect.defineMetadata(t,e,n,r):Reflect.defineMetadata&&Reflect.defineMetadata(t,e,n)}}(j||(j={})),function(t){t.TOKEN=Symbol("Schedule")}(D||(D={})),function(t){t.origin=t=>new URL(t).origin,t.toUrl=t=>new URL(t)}(B||(B={})),function(t){t[t.EXECUTE=0]="EXECUTE",t[t.NO_EXECUTE=1]="NO_EXECUTE",t[t.STOP=2]="STOP"}($||($={}));class W{rawSet;render;returnContainer;elementSource;source;afterCallBack;startingExecute;constructor(t,e,n,r,i,s,o=!0){this.rawSet=t,this.render=e,this.returnContainer=n,this.elementSource=r,this.source=i,this.afterCallBack=s,this.startingExecute=o}async start(){let t=this.elementSource.attr;this.source.operatorAround?.beforeAttr&&(t=this.source.operatorAround.beforeAttr(t,this)??"");let e=t;if(e&&this.startingExecute){const n=l.Path.toOptionalChainPath(t);e=_.eval(` ${this.render.bindScript}; return ${n}`,Object.assign(this.source.obj,{__render:this.render}))}this.source.operatorAround?.before&&(e=this.source.operatorAround?.before(e,this));const n=await this.execute(e);return this.source.operatorAround?.after?.(e,this),n}}class G extends W{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s)}async execute(t){return null!=t?$.EXECUTE:$.NO_EXECUTE}}class Y extends W{constructor(t,e,n,r,i,s,o=!0){super(t,e,n,r,i,s,o)}async execute(t){return this.elementSource.attr?await this.executeAttrRequire(t):$.NO_EXECUTE}}class K extends Y{constructor(t,e,n,r,i,s){super(t,e,n,r,i,s)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n const n = $element.cloneNode(true);\n var destIt = ${this.elementSource.attrs.drItOption};\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n // console.log('----', n.innerHTML);\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n // console.log('----', n.innerHTML);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__fag.append(it));\n } else {\n this.__render.fag.append(n);\n }`,Object.assign(this.source.obj,{__render:Object.freeze({fag:r,drStripOption:this.elementSource.attrs.drStripOption,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class X extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element,"DrIf"),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");if(!1===_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n if ($rawSet.data === (${l.Path.toOptionalChainPath(t)})) {\n return false;\n }\n $rawSet.data = ${l.Path.toOptionalChainPath(t)};\n if($rawSet.data) {\n const n = $element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n var destIt = ${this.elementSource.attrs.drItOption};\n if (destIt !== undefined) {\n // 여기가 ..아주 헛갈리는데...\n Array.from(n.getAttributeNames()).forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#DrIFIt\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#DrIFIt\\#/g, destIt);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n }\n ${this.elementSource.attrs.drAfterOption??""};\n return true;\n `,Object.assign(this.source.obj,{__render:Object.freeze({fag:r,drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,drStripOption:this.elementSource.attrs.drStripOption,...this.render})})))return $.STOP;vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class q{}class J{set(t,e,n,r){return t[e]=n,!0}get(t,e,n){return t[e]}static final(t){return t._DomRender_isFinal=!0,t}static isFinal(t){return"_DomRender_isFinal"in t}static unFinal(t){return delete t._DomRender_isFinal,t}has(t,e){return"_DomRender_isFinal"===e||e in t}}class Z{obj;_config;_template;_styles;constructor(t,e,n){this.obj=t,this._template=e.template,this._styles=e.styles,this._config=J.final(Object.assign({objPath:"obj"},n))}get template(){return this._template}get styles(){return this._styles}get config(){return this._config}setTemplateStyle(t){this._template=t.template,this._styles=t.styles}}class Q extends Y{async executeAttrRequire(t){const e=this.elementSource.attrs.drDetectIfOption??this.elementSource.attrs.drIfOption,n=_.eval(`\n ${this.render.bindScript}\n try {\n const ok = ${this.elementSource.attrs.drThis};\n const option = ${e};\n if (option!==null) {\n return !!(ok && option); \n }\n // console.log('vv', ${this.elementSource.attrs.drThis}, ${this.elementSource.attrs.drIfOption}, '${this.elementSource.attrs.drIfOption}');\n return !!ok;\n } catch(e) {\n return false;\n }\n `,Object.assign(this.source.obj,{__render:Object.freeze({drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,...this.render})}));if(t&&this.elementSource.attrs.drThis&&n){let e=this.elementSource.attrs.drThis;if(t instanceof Z){t.config?.beforeComponentSet?.obj!==t.obj&&(r=t.config.beforeComponentSet?.obj,"function"==typeof r?.onDrThisUnBind&&t.config.beforeComponentSet?.obj?.onDrThisUnBind?.()),t.config?.beforeComponentSet?.obj!==t.obj&&(t=>"function"==typeof t?.onDrThisBind)(t.obj)&&t.obj?.onDrThisBind?.(),e=`${this.elementSource.attrs.drThis}${t.config.objPath?"."+t.config.objPath:""}`,this.setThisPath(e);const n=await vt.drThisCreate(this.rawSet,this.elementSource.element,e,this.elementSource.attrs.drVarOption??"",this.elementSource.attrs.drStripOption,this.source.obj,this.source.config,t);this.returnContainer.fag.append(n),this.afterCallBack.onThisComponentSetCallBacks.push(t)}else this.setThisPath(e),this.returnContainer.fag.append(await vt.drThisCreate(this.rawSet,this.elementSource.element,this.elementSource.attrs.drThis,this.elementSource.attrs.drVarOption??"",this.elementSource.attrs.drStripOption,this.source.obj,this.source.config));const n=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...n)}else this.elementSource.element.remove();var r;return $.EXECUTE}setThisPath(t){this.rawSet.point.start instanceof this.source.config.window.HTMLMetaElement&&this.rawSet.point.end instanceof this.source.config.window.HTMLMetaElement&&(this.rawSet.point.start.setAttribute("this-path",t),this.rawSet.point.end.setAttribute("this-path",t))}}class tt{_value;_target;_event;_autoValid;_autoValidAction;_validAction;constructor(t,e,n,r=!0,i=!0){this._value=t,this.setTarget(e),this.setEvent(n),this.setAutoValid(r),this.setAutoValidAction(i)}getValidAction(){return this._validAction}setValidAction(t){return this._validAction=t,this}getAutoValid(){return this._autoValid}setAutoValid(t){return this._autoValid=t,this}getAutoValidAction(){return this._autoValidAction}setAutoValidAction(t){return this._autoValidAction=t,this}getEvent(){return this._event}setEvent(t){return t&&(this._event=this.domRenderFinal(t)),this}getTarget(){return this._target}targetFocus(){this._target?.focus?.()}targetReset(){this._target?.reset?.()}targetDispatchEvent(t){return this._target?.dispatchEvent(t)}setTarget(t){return t&&(this._target=this.domRenderFinal(t)),this}domRenderFinal(t){return t._DomRender_isFinal=!0,t}get value(){return void 0!==this._value&&null!==this._value||(this._value=this.getTarget()?.value),this._value}set value(t){this._value=t,this.tickValue(t)}tickValue(t){this.changeValue(t);const e=this.getTarget();if(e&&null!=e?.value)try{e.value=this._value}catch(t){console.error("set value function is blocked ")}this.getAutoValidAction()?this.validAction():this.getAutoValid()&&this.valid()}set(t,e,n){this.setTarget(e),this.setEvent(n),this.value=t}changeValue(t){}get checked(){return this.getTarget()?.checked??!1}set checked(t){const e=this.getTarget();e&&(e.checked=t)}get selectedIndex(){return this.getTarget()?.selectedIndex??-1}set selectedIndex(t){const e=this.getTarget();e&&(e.selectedIndex=t)}querySelector(t){return this.getTarget()?.querySelector(t)}querySelectorALL(t){return this.getTarget()?.querySelectorAll(t)}validAction(){const t=this.valid();return this.getValidAction()?.(t,this.value,this.getTarget(),this.getEvent()),t}inValid(){return!this.valid()}allValid(){return this.valid()&&this.childInValid()}allValidAction(){return this.validAction()&&this.childInValidAction()}allInValid(){return!this.allValid()}allInValidAction(){return!this.allValidAction()}childValid(){return!this.childInValid()}childValue(){const t={};return this.childValidators().filter(([e,n])=>{t[e]=n.value}),t}childValidAction(){return!this.childInValidAction()}childInValid(){return this.childValidators().filter(([t,e])=>!e.valid()).length>0}childInValidValidator(){return this.childValidators().filter(([t,e])=>!e.valid())}childInValidAction(){return this.childValidators().filter(([t,e])=>!e.validAction()).length>0}childValidator(t){return Object.entries(this).find(([e,n])=>e===t&&n instanceof tt)?.[1]}childValidators(){return Object.entries(this).filter(([t,e])=>e instanceof tt)}childValidValidator(){return this.childValidators().filter(t=>t[1].valid())}syncValue(){this.value=this.getTarget()?.value}allSyncValue(){this.childValidators().forEach(([t,e])=>{e.syncValue()})}get length(){return this.value?.length??0}}class et extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){return!1}}class nt extends tt{_makeValidatorFactory=(t,e,n)=>new et(t,e,n);constructor(t,e,n,r=!0){super(t,e,n,r)}getMakeValidatorFactory(){return this._makeValidatorFactory}setMakeValidatorFactory(t){return this._makeValidatorFactory=t,this}setArrayValue(t,e,n){this.value?.filter(e=>!!e.getTarget()&&e.getTarget()===t).forEach(r=>{r.set(e,t,n)}),this.tickValue(this.value)}addValidator(t,e,n){this.value||(this.value=[]),t instanceof tt?this.value?.push(t):this.value?.push(this.makeValidator(t,e,n)),this.tickValue(this.value)}allChecked(t){this.checked=t,this.value?.forEach(e=>{e.checked=t})}getValidators(){return this._value}getValidator(t){return this.value?.filter(e=>e.getTarget()===t)[0]}getValidatorByValue(t){return this.getValidatorByValues(t)[0]}getValidatorByValues(t){return this.value?.filter(e=>e.value===t)??[]}removeElement(t){const e=this.value;e&&(this.value=e.filter(e=>e.getTarget()!==t))}makeValidator(t,e,n){return this._makeValidatorFactory(t,e,n)}}class rt extends Y{constructor(t,e,n,r,i,s){super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){vt.drFormOtherMoveAttr(this.elementSource.element,"name","temp-name",this.source.config);const e=_.evalReturn(`${t}`,this.source.obj),n=Array.from(this.elementSource.element.querySelectorAll("[name]")),r=_.evalReturn(this.elementSource.element.getAttribute(`${vt.DR_FORM_NAME}:name`)??"",this.source.obj)??this.elementSource.element.getAttribute("name");return n.length<=0&&r?n.push(this.elementSource.element):e instanceof tt&&e.setTarget(this.elementSource.element),n.forEach(e=>{const n=e.getAttribute(`${vt.DR_FORM_NAME}:event`)??"change",r=e.getAttribute(`${vt.DR_FORM_NAME}:validator`),i=R.attrPrefix+"event-"+n;let s=_.evalReturn(this.elementSource.element.getAttribute(`${vt.DR_FORM_NAME}:name`)??"",this.source.obj)??e.getAttribute("name");if(null!=s){r&&_.eval(`\n ${this.render.bindScript}\n const validator = typeof ${r} ==='function' ? new ${r}() : ${r};\n ${t}['${s}'] = validator;\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,...this.render})})),s=`${t}['${s}']`;const n=_.evalReturn(`${s}`,this.source.obj);n instanceof nt?(e.setAttribute(i,`${s}.setArrayValue($target, $target.value, $event); ${e.getAttribute(i)??""};`),n.addValidator(e.value,e)):n instanceof tt?(e.setAttribute(i,`${s}.set($target.value, $target, $event); ${e.getAttribute(i)??""};`),n.setTarget(e),n.value=e.value):e.setAttribute(i,`${s} = $target.value;`)}}),vt.drFormOtherMoveAttr(this.elementSource.element,"temp-name","name",this.source.config),this.returnContainer.raws.push(...vt.checkPointCreates(this.elementSource.element,this.source.obj,this.source.config)),$.EXECUTE}}class it extends Y{constructor(t,e,n,r,i,s){super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=this.source.config.window.document.createElement("temp");_.eval(` \n ${this.render.bindScript}\n const n = $element.cloneNode(true); \n ${this.elementSource.attrs.drBeforeOption??""}\n n.innerText = ${t};\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,fag:e,...this.render})}));const n=this.source.config.window.document.createElement("template");n.innerHTML=e.innerHTML,this.returnContainer.fag.append(n.content);const r=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...r),$.EXECUTE}}class st extends Y{constructor(t,e,n,r,i,s){super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n const n = $element.cloneNode(true);\n ${this.elementSource.attrs.drBeforeOption??""}\n n.innerHTML = ${t};\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,fag:e,...this.render})}));const n=this.source.config.window.document.createElement("template");n.innerHTML=e.innerHTML,this.returnContainer.fag.append(n.content);const r=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...r),$.EXECUTE}}class ot extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n for(${t}) {\n const n = this.__render.element.cloneNode(true);\n var destIt = ${this.elementSource.attrs.drItOption};\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/g, destIt))) \n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({fag:r,drStripOption:this.elementSource.attrs.drStripOption,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class at extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element,"DrForOf"),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n var i = -1; \n const forOf = ${l.Path.toOptionalChainPath(t)};\n const forOfStr = \`${t}\`.trim();\n // console.log('forOf---',forOf);\n if (forOf) {\n for(const it of forOf) {\n i++;\n var destIt = it;\n if (/\\[(.*,?)\\],/g.test(forOfStr)) {\n if (typeof it === 'string') {\n destIt = it;\n } else {\n destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];\n }\n } else if (forOf.isRange) {\n destIt = it;\n } else {\n destIt = forOfStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n // console.log('zzzzzzzzzzz', n.getAttribute('${vt.DR_DETECT_ATTR_OPTIONNAME}'));\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n // console.log('---------'+destIt,n, Array.from(n.getAttributeNames()).map(it=>({name:it,attr: n.getAttribute(it)})));\n // console.log('---------destItdestIt',destIt);\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))\n const drOptionAttr = n.getAttribute('${vt.DR_DETECT_ATTR_OPTIONNAME}');\n if (drOptionAttr) {\n const drOptionAttrResult = $scriptUtils.evalReturn(drOptionAttr, this);\n Array.from(Object.entries(drOptionAttrResult??{})).forEach(([k,v])=>{\n if (v === null) {\n n.removeAttribute(k);\n } else {\n n.setAttribute(k,v);\n }\n })\n }\n \n const drOptionFilter = n.getAttribute('${vt.DR_DETECT_FILTER_OPTIONNAME}');\n if (drOptionFilter) {\n const drOptionFilterResult = $scriptUtils.evalReturn(drOptionFilter, this);\n // console.log('---drforof----', drOptionFilter, drOptionFilterResult)\n if (!drOptionFilterResult) {\n continue;\n }\n }\n\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\n // console.log('!@@@@', n.innerHTML);\n // DR_THIS_OPTIONNAME 는 제거한다 꼬인다. strip 할때 막 꼬여버린다.\n // const drOptionThis = n.getAttribute('${vt.DR_THIS_OPTIONNAME}');\n // if (drOptionThis) {\n // n.setAttribute('${vt.DR_THIS_NAME}', drOptionThis)\n // }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n \n }\n \n if('${this.elementSource.attrs.drNextOption}' !== 'null') {\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const [name, idx] = '${this.elementSource.attrs.drNextOption}'.split(',');\n n.setAttribute('${vt.DR_FOR_OF_NAME}', name + '[' + idx + ']');\n n.setAttribute('${vt.DR_NEXT_OPTIONNAME}', name + ',' + (Number(idx) + 1));\n this.__render.fag.append(n);\n }\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,fag:r,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class ct extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");_.eval(`\n try{\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n const ifWrap = document.createElement('div');\n // ifWrap.setAttribute('${vt.DR_STRIP_OPTIONNAME}', 'true');\n // ifWrap.setAttribute('${vt.DR_IF_NAME}', '${this.elementSource.attrs.drAppender} && ${this.elementSource.attrs.drAppender}.length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const length = ${this.elementSource.attrs.drAppender}.length;\n if (length > 0) {\n n.setAttribute('${vt.DR_FOR_OF_NAME}', '${this.elementSource.attrs.drAppender}[' + (length-1) + ']');\n n.setAttribute('${vt.DR_NEXT_OPTIONNAME}', '${this.elementSource.attrs.drAppender},' + length);\n } else {\n n.setAttribute('${vt.DR_FOR_OF_NAME}', '${this.elementSource.attrs.drAppender}[0]');\n n.setAttribute('${vt.DR_NEXT_OPTIONNAME}', '${this.elementSource.attrs.drAppender},' + 1);\n }\n // console.log('appender---\x3e', Array.from(n.getAttributeNames()).map(it=>({name:it,attr: n.getAttribute(it)})));\n // const drOptionThis = n.getAttribute('${vt.DR_THIS_OPTIONNAME}');\n // if (drOptionThis) {\n // }\n // ifWrap.append(n);\n // this.__render.fag.append(ifWrap);\n this.__render.fag.append(n);\n ${this.elementSource.attrs.drAfterOption??""}\n }catch(e){}\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,fag:r,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class lt extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n var i = 0; \n const repeat = ${t};\n const repeatStr = \`${t}\`;\n let range = repeat;\n if (typeof repeat === 'number') {\n range = ${R.RANGE_VARNAME}(repeat);\n } \n for(const it of range) {\n var destIt = it;\n if (range.isRange) {\n destIt = it;\n } else {\n destIt = repeatStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearRangeIt\\#/g, destIt).replace(/\\#nearRangeIndex\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n \n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n i++;\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({fag:r,drStripOption:this.elementSource.attrs.drStripOption,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const i=this.source.config.window.document.createElement("template");i.innerHTML=r.innerHTML,this.returnContainer.fag.append(i.content);const s=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...s),$.EXECUTE}}class ht extends W{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async execute(){const t=this.source.config?.targetElements?.find(t=>t.name.toLowerCase()===this.elementSource.element.tagName.toLowerCase());if(t){this.rawSet.point.start instanceof this.source.config.window.HTMLMetaElement&&this.rawSet.point.end instanceof this.source.config.window.HTMLMetaElement&&(this.rawSet.point.start.setAttribute("this-path",`this.__domrender_components.${this.rawSet.uuid}`),this.rawSet.point.end.setAttribute("this-path",`this.__domrender_components.${this.rawSet.uuid}`));const e=await t.callBack(this.elementSource.element,this.source.obj,this.rawSet,this.elementSource.attrs,this.source.config);if(e){const n=this.elementSource.element.getAttribute(vt.DR_DETECT_NAME);this.rawSet.dataSet.fragment=e,n&&this.rawSet.dataSet.render&&(this.rawSet.detect={action:()=>{const t=`var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ${n} `;_.eval(t,Object.assign(this.source.obj,{__render:this.rawSet.dataSet.render}))}});let r=e;if(t.noStrip){const t=this.source.config.window.document.createDocumentFragment();Array.from(e.firstElementChild?.childNodes||[]).forEach(e=>{t.appendChild(e)}),r=t}const i=vt.checkPointCreates(r,this.source.obj,this.source.config);t.noStrip&&Array.from(r.childNodes||[]).forEach(t=>{e.firstElementChild?.appendChild(t)}),this.elementSource.element.parentNode?.replaceChild(e,this.elementSource.element),this.returnContainer.raws.push(...i),this.afterCallBack.onElementInitCallBacks.push({name:t.name.toLowerCase(),obj:this.source.obj,targetElement:t,creatorMetaData:t.__creatorMetaData}),t?.complete?.(this.elementSource.element,this.source.obj,this.rawSet)}return $.EXECUTE}return $.NO_EXECUTE}}class ut extends W{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async execute(){const t=this.elementSource.element.getAttributeNames(),e=this.source.config?.targetAttrs?.find(e=>t.includes(e.name));if(e){const t=e.name,n=this.rawSet.getAttributeAndDelete(this.elementSource.element,t);if(n&&t&&!this.elementSource.attrs.drForOf&&!this.elementSource.attrs.drFor&&!this.elementSource.attrs.drRepeat){const r=e.callBack(this.elementSource.element,n,this.source.obj,this.rawSet);if(r){const i=vt.checkPointCreates(r,this.source.obj,this.source.config);this.elementSource.element.parentNode?.replaceChild(r,this.elementSource.element),this.returnContainer.raws.push(...i),this.afterCallBack.onAttrInitCallBacks.push({attrName:t,attrValue:n,obj:this.source.obj}),e?.complete?.(this.elementSource.element,n,this.source.obj,this.rawSet)}}return $.EXECUTE}return $.NO_EXECUTE}}class dt extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=this.source.config.window.document.createElement("temp");_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n const n = $element.cloneNode(true);\n if(${t}) {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ${this.elementSource.attrs.drAfterOption??""};\n return true;\n `,Object.assign(this.source.obj,{__render:Object.freeze({fag:e,drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,drStripOption:this.elementSource.attrs.drStripOption,...this.render})}));const n=this.source.config.window.document.createElement("template");n.innerHTML=e.innerHTML,this.returnContainer.fag.append(n.content);const r=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...r),$.EXECUTE}}!function(t){t.NO_DESTROY="NO_DESTROY",t.NO_MESSENGER_DESTROY="NO_MESSENGER_DESTROY"}(V||(V={})),function(t){t.TEXT="TEXT",t.STYLE_TEXT="STYLE_TEXT",t.TARGET_ELEMENT="TARGET_ELEMENT",t.TARGET_ATTR="TARGET_ATTR",t.UNKOWN="UNKOWN"}(H||(H={}));class pt extends Y{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async executeAttrRequire(t){const e=vt.drItOtherEncoding(this.elementSource.element,"DrThisProperty"),n=vt.drVarEncoding(this.elementSource.element,this.elementSource.attrs.drVarOption??""),r=this.source.config.window.document.createElement("temp"),i=(_.evalReturn(t,this.source.obj),this.elementSource.attrs.drKeyOption??"");_.eval(`\n ${this.render.bindScript}\n ${this.elementSource.attrs.drBeforeOption??""}\n var i = 0; \n const dictionary = ${t};\n const dictionaryKey = '${i}';\n const dictionaryStr = \`${t}\`.trim();\n // console.log('----@#!@#@!#', this.__render.oldChild);\n if (dictionary) {\n for(const it in dictionary) {\n var destIt = dictionaryStr + '["' + it + '"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n n.setAttribute('${vt.DR_KEY_OPTIONNAME}', it);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('${vt.DR_HAS_KEYS_OPTIONNAME}',Object.keys(dictionary).join(','));\n }\n ${this.elementSource.attrs.drAfterOption??""}\n `,Object.assign(this.source.obj,{__render:Object.freeze({drStripOption:this.elementSource.attrs.drStripOption,drAttr:this.elementSource.attrs,drAttrsOriginName:vt.drAttrsOriginName,fag:r,...this.render})})),vt.drVarDecoding(r,n),vt.drItOtherDecoding(r,e);const s=this.source.config.window.document.createElement("template");s.innerHTML=r.innerHTML,this.returnContainer.fag.append(s.content);const o=vt.checkPointCreates(this.returnContainer.fag,this.source.obj,this.source.config);return this.elementSource.element.parentNode?.replaceChild(this.returnContainer.fag,this.elementSource.element),this.returnContainer.raws.push(...o),$.EXECUTE}static append(t,e,n,r,i){const s=i.window.document.importNode(r.dataSet.fragment,!0),o=[];for(const a of Array.from(s.childNodes.values())){const s=a.cloneNode(!0);s.removeAttribute(vt.DR_THIS_PROPERTY_NAME),s.setAttribute(vt.DR_THIS_NAME,`this.${e}`),s.setAttribute(vt.DR_KEY_OPTIONNAME,n);const c=i.window.document.createDocumentFragment();c.append(s),o.push(...vt.checkPointCreates(c,t,i)),r.point.end.before(c);const l=r.point.start,h=l.getAttribute(vt.DR_HAS_KEYS_OPTIONNAME)?.split(",")??[];h.push(n),l.setAttribute(vt.DR_HAS_KEYS_OPTIONNAME,h.join(",")),o.forEach(async e=>await e.render(t,i))}return o}}!function(t){t.DR_THIS_PROPERTY="this-property"}(F||(F={}));class ft{content;constructor(t=[]){this.content=t}get declarations(){const t={};return this.content.forEach(e=>{"declaration"===e.type&&(t[e.property]=e.value)}),t}get children(){return this.content.filter(t=>"rule"===t.type).map(t=>t.rule)}_addRules(t,e){const n=t.map(t=>({type:"rule",rule:t}));if(void 0===e)this.content.push(...n);else{const t=this.content.map((t,e)=>({item:t,idx:e})).filter(({item:t})=>"rule"===t.type).map(({idx:t})=>t),r=e<t.length?t[e]:this.content.length;this.content.splice(r,0,...n)}return this}append(t){const e=yt._parseInputToRules(t);return this._addRules(e)}prepend(t){const e=yt._parseInputToRules(t);return this._addRules(e,0)}insertAt(t,e){const n=yt._parseInputToRules(e);return this._addRules(n,t)}insertBefore(t,e){const n=this.content.findIndex(e=>"rule"===e.type&&e.rule===t);if(n>-1){const t=yt._parseInputToRules(e).map(t=>({type:"rule",rule:t}));this.content.splice(n,0,...t)}return this}insertAfter(t,e){const n=this.content.findIndex(e=>"rule"===e.type&&e.rule===t);if(n>-1){const t=yt._parseInputToRules(e).map(t=>({type:"rule",rule:t}));this.content.splice(n+1,0,...t)}return this}replace(t,e){const n=this.content.findIndex(e=>"rule"===e.type&&e.rule===t);if(n>-1){const t=yt._parseInputToRules(e).map(t=>({type:"rule",rule:t}));this.content.splice(n,1,...t)}return this}remove(t){const e=this.content.findIndex(e=>"rule"===e.type&&e.rule===t);return e>-1&&this.content.splice(e,1),this}}class gt extends ft{selector;constructor(t,e=[]){super(e),this.selector=t}stringify(t=0){const e=" ".repeat(t),n=" ".repeat(t+1);if(0===this.content.length)return`${e}${this.selector} {}`;const r=[];for(const e of this.content)if("declaration"===e.type){const t=yt._camelToKebab(e.property);r.push(`${n}${t}: ${e.value};`)}else"rule"===e.type?r.push(e.rule.stringify(t+1)):"comment"===e.type&&r.push(`${n}/* ${e.text} */`);const i=r.join("\n");return`${e}${this.selector} {\n${i}\n${e}}`}}class mt extends ft{name;condition;constructor(t,e,n=[]){super(n),this.name=t,this.condition=e}stringify(t=0){const e=" ".repeat(t),n=" ".repeat(t+1),r=`@${this.name}${this.condition?" "+this.condition:""}`;if(0===this.content.length)return`${e}${r};`;const i=[];for(const e of this.content)if("declaration"===e.type){const t=yt._camelToKebab(e.property);i.push(`${n}${t}: ${e.value};`)}else"rule"===e.type?i.push(e.rule.stringify(t+1)):"comment"===e.type&&i.push(`${n}/* ${e.text} */`);return`${e}${r} {\n${i.join("\n")}\n${e}}`}}class yt extends ft{constructor(t=""){super(yt._parseTopLevel(t))}get rules(){return this.children}stringify(t=0){if(0===this.content.length)return"";const e=[];for(const n of this.content)if("declaration"===n.type){const t=yt._camelToKebab(n.property);e.push(`${t}: ${n.value};`)}else"rule"===n.type?e.push(n.rule.stringify(t)):"comment"===n.type&&e.push(`/* ${n.text} */`);return e.join("\n")}static _parseTopLevel(t){const e=yt._cleanCss(t);return yt._parseContent(e)}static _cleanCss(t){return t.trim()}static _parseContent(t){const e=[];let n=0;for(;n<t.length;){for(;n<t.length&&/\s/.test(t[n]);)n++;if(n>=t.length)break;if("/"===t[n]&&n+1<t.length&&"*"===t[n+1]){const r=n+2;let i=t.indexOf("*/",r);if(-1===i)i=t.length,n=t.length;else{const s=t.substring(r,i).trim();e.push({type:"comment",text:s}),n=i+2}continue}const r=[{type:"brace",index:t.indexOf("{",n)},{type:"semicolon",index:t.indexOf(";",n)},{type:"comment",index:t.indexOf("/*",n)}].filter(t=>-1!==t.index).sort((t,e)=>t.index-e.index);if(0===r.length){const r=t.substring(n).trim();if(r&&r.includes(":")){const t=r.split(":");if(t.length>=2){const n=t[0].trim(),r=t.slice(1).join(":").trim();n&&r&&e.push({type:"declaration",property:n,value:r})}}break}const i=r[0];if("comment"!==i.type){if("brace"===i.type){const r=t.substring(n,i.index).trim();if(r){const s=yt._findMatchingBrace(t,i.index);if(-1!==s){const o=t.substring(i.index+1,s).trim();if(r.startsWith("@")){const t=r.match(/^@([^\s]+)/)?.[1]||"unknown",n=r.replace(/^@[^\s]+\s*/,"").trim(),i=yt._parseContent(o);e.push({type:"rule",rule:new mt(t,n,i)})}else{const t=yt._parseContent(o);e.push({type:"rule",rule:new gt(r,t)})}n=s+1;continue}}}if("semicolon"===i.type){const r=t.substring(n,i.index).trim();if(r)if(r.startsWith("@")){const t=r.match(/^@([^\s]+)/)?.[1]||"unknown",n=r.replace(/^@[^\s]+\s*/,"").trim();e.push({type:"rule",rule:new mt(t,n,[])})}else if(r.includes(":")){const t=r.split(":");if(t.length>=2){const n=t[0].trim(),r=t.slice(1).join(":").trim();n&&r&&e.push({type:"declaration",property:n,value:r})}}n=i.index+1;continue}n++}else n=i.index}return e}static _parseBlockContent(t){return{content:yt._parseContent(t)}}static _parseRules(t){const e=[];let n=0;for(t=t.trim();n<t.length;){for(;n<t.length&&/\s/.test(t[n]);)n++;if(n>=t.length)break;const r=t.indexOf("{",n),i=t.indexOf(";",n);if(-1!==r&&(r<i||-1===i)){const i=t.substring(n,r).trim();if(!i){n=r+1;continue}const s=yt._findMatchingBrace(t,r);if(-1===s)return console.error("Malformed CSS: No matching brace for selector -> ",i),e;const o=t.substring(r+1,s).trim();if(i.startsWith("@")){const t=i.match(/^@([^\s]+)/)?.[1]||"unknown",n=i.replace(/^@[^\s]+\s*/,"").trim(),r=yt._parseContent(o);e.push(new mt(t,n,r))}else{const t=yt._parseContent(o);e.push(new gt(i,t))}n=s+1}else{if(-1===i)break;{const r=t.substring(n,i).trim();if(r.startsWith("@")){const t=r.match(/^@([^\s]+)/)?.[1]||"unknown",n=r.replace(/^@[^\s]+\s*/,"").trim();e.push(new mt(t,n,[]))}n=i+1}}}return e}static _findMatchingBrace(t,e){let n=1;for(let r=e+1;r<t.length;r++)if("{"===t[r])n++;else if("}"===t[r]&&(n--,0===n))return r;return-1}static _parseDeclarations(t){const e={},n=t.split(";");for(const t of n){if(""===t.trim())continue;const n=t.split(":");if(n.length>=2){const t=n[0].trim(),r=n.slice(1).join(":").trim();t&&r&&(e[t]=r)}}return e}static _declarationsToCSS(t,e){const n=" ".repeat(e);return Object.entries(t).map(([t,e])=>`${n}${yt._camelToKebab(t)}: ${e};`).join("\n")}static _camelToKebab(t){return t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}static _parseInputToRules(t){if("string"==typeof t){const e=new yt(t).rules;return 0===e.length&&console.warn("Provided CSS string resulted in no rules."),[...e]}return[t]}}function At(t){return t instanceof gt}const _t=t=>"function"==typeof t?.onCreateRenderData,Et=t=>"function"==typeof t?.onCreateRender,bt=t=>"function"==typeof t?.onChangeAttrRender;function Tt(t){return"function"==typeof t?.onInitRender}class Rt extends W{constructor(t,e,n,r,i,s){i.operatorAround=void 0,super(t,e,n,r,i,s,!1)}async execute(t){if(!t)return $.NO_EXECUTE;const e=this.source.config?.targetElements?.find(e=>e.name.toLowerCase()===t.toLowerCase());if(e){this.rawSet.point.start instanceof this.source.config.window.HTMLMetaElement&&this.rawSet.point.end instanceof this.source.config.window.HTMLMetaElement&&(this.rawSet.point.start.setAttribute("this-path",`this.__domrender_components.${this.rawSet.uuid}`),this.rawSet.point.end.setAttribute("this-path",`this.__domrender_components.${this.rawSet.uuid}`));const t=await e.callBack(this.elementSource.element,this.source.obj,this.rawSet,this.elementSource.attrs,this.source.config);if(t){const n=this.elementSource.element.getAttribute(vt.DR_DETECT_NAME);this.rawSet.dataSet.fragment=t,n&&this.rawSet.dataSet.render&&(this.rawSet.detect={action:()=>{const t=`var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ${n} `;_.eval(t,Object.assign(this.source.obj,{__render:this.rawSet.dataSet.render}))}});const r=e.noStrip;let i=t;if(r){const e=this.source.config.window.document.createDocumentFragment();Array.from(t.firstElementChild?.childNodes||[]).forEach(t=>{e.appendChild(t)}),i=e}const s=vt.checkPointCreates(i,this.source.obj,this.source.config);r&&Array.from(i.childNodes||[]).forEach(e=>{t.firstElementChild?.appendChild(e)}),this.elementSource.element.parentNode?.replaceChild(t,this.elementSource.element),this.returnContainer.raws.push(...s),this.afterCallBack.onElementInitCallBacks.push({name:e.name.toLowerCase(),obj:this.source.obj,targetElement:e,creatorMetaData:e.__creatorMetaData}),e?.complete?.(this.elementSource.element,this.source.obj,this.rawSet)}return $.EXECUTE}return $.NO_EXECUTE}}class vt{uuid;type;point;dataSet;detect;static DR_NAME="dr";static DR_IF_NAME="dr-if";static DR_FOR_NAME="dr-for";static DR_FOR_OF_NAME="dr-for-of";static DR_THIS_PROPERTY_NAME="dr-this-property";static DR_REPEAT_NAME="dr-repeat";static DR_THIS_NAME="dr-this";static DR_FORM_NAME="dr-form";static DR_PRE_NAME="dr-pre";static DR_APPENDER_NAME="dr-appender";static DR_INNERHTML_NAME="dr-inner-html";static DR_INNERTEXT_NAME="dr-inner-text";static DR_DETECT_NAME="dr-detect";static DR_STRIP_NAME="dr-strip";static DR_REPLACE_TARGET_ELEMENT_IS_NAME="dr-replace-target-element-is";static DR_DETECT_IF_OPTIONNAME="dr-detect-option-if";static DR_DETECT_FILTER_OPTIONNAME="dr-detect-option-filter";static DR_DETECT_ATTR_OPTIONNAME="dr-detect-option-attr";static DR_THIS_OPTIONNAME="dr-option-this";static DR_ATTR_OPTIONNAME="dr-option-attr";static DR_IF_OPTIONNAME="dr-option-if";static DR_IT_OPTIONNAME="dr-option-it";static DR_VAR_OPTIONNAME="dr-option-var";static DR_AFTER_OPTIONNAME="dr-option-after";static DR_NEXT_OPTIONNAME="dr-option-next";static DR_BEFORE_OPTIONNAME="dr-option-before";static DR_COMPLETE_OPTIONNAME="dr-option-complete";static DR_STRIP_OPTIONNAME="dr-option-strip";static DR_DESTROY_OPTIONNAME="dr-option-destroy";static DR_THIS_NAME_OPTIONNAME="dr-option-this-name";static DR_COMPONENT_NAME_OPTIONNAME="dr-option-component-name";static DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME="dr-option-component-inner-html-name";static DR_KEY_OPTIONNAME="dr-option-key";static DR_HAS_KEYS_OPTIONNAME="dr-option-has-keys";static DR_ON_CREATE_ARGUMENTS_OPTIONNAME="dr-on-create:arguments";static DR_ON_CREATED_CALLBACK_OPTIONNAME="dr-on-create:callback";static DR_ON_INIT_ARGUMENTS_OPTIONNAME="dr-on-init:arguments";static DR_ON_CONSTRUCTOR_ARGUMENTS_OPTIONNAME="dr-on-constructor:arguments";static drAttrsOriginName={dr:vt.DR_NAME,drIf:vt.DR_IF_NAME,drFor:vt.DR_FOR_NAME,drForOf:vt.DR_FOR_OF_NAME,drThisProperty:vt.DR_THIS_PROPERTY_NAME,drAppender:vt.DR_APPENDER_NAME,drRepeat:vt.DR_REPEAT_NAME,drThis:vt.DR_THIS_NAME,drForm:vt.DR_FORM_NAME,drPre:vt.DR_PRE_NAME,drInnerHTML:vt.DR_INNERHTML_NAME,drInnerText:vt.DR_INNERTEXT_NAME,drItOption:vt.DR_IT_OPTIONNAME,drVarOption:vt.DR_VAR_OPTIONNAME,drAfterOption:vt.DR_AFTER_OPTIONNAME,drNextOption:vt.DR_NEXT_OPTIONNAME,drBeforeOption:vt.DR_BEFORE_OPTIONNAME,drCompleteOption:vt.DR_COMPLETE_OPTIONNAME,drStripElement:vt.DR_STRIP_NAME,drReplaceTargetElementIs:vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME,drStripOption:vt.DR_STRIP_OPTIONNAME,drIfOption:vt.DR_IF_OPTIONNAME,drDetectIfOption:vt.DR_DETECT_IF_OPTIONNAME,drDestroyOption:vt.DR_DESTROY_OPTIONNAME,drHasKeysOption:vt.DR_HAS_KEYS_OPTIONNAME,drKeyOption:vt.DR_KEY_OPTIONNAME};static DR_TAGS=[];static DR_ATTRIBUTES=[vt.DR_NAME,vt.DR_APPENDER_NAME,vt.DR_IF_NAME,vt.DR_FOR_OF_NAME,vt.DR_THIS_PROPERTY_NAME,vt.DR_FOR_NAME,vt.DR_THIS_NAME,vt.DR_FORM_NAME,vt.DR_PRE_NAME,vt.DR_INNERHTML_NAME,vt.DR_INNERTEXT_NAME,vt.DR_REPEAT_NAME,vt.DR_DETECT_NAME,vt.DR_STRIP_NAME];constructor(t,e,n,r,i){this.uuid=t,this.type=e,this.point=n,this.dataSet=r,this.detect=i}get isConnected(){return this.point.start.isConnected&&this.point.end.isConnected}getUsingTriggerVariables(t){const e=new Set;return this.dataSet.fragment.childNodes.forEach((n,r)=>{let i="";if(n.nodeType===Node.TEXT_NODE){i=`\`${n.textContent??""}\``;const t=vt.expressionGroups(i);t[0].length>1&&(i=t[0][1])}else if(n.nodeType===Node.ELEMENT_NODE){const e=n,r=(t?.targetAttrs?.map(t=>t.name)??[]).concat(vt.DR_ATTRIBUTES,vt.DR_DETECT_FILTER_OPTIONNAME,vt.DR_DETECT_IF_OPTIONNAME,vt.DR_DETECT_ATTR_OPTIONNAME).map(t=>e.getAttribute(t)).filter(t=>t).map(t=>`(${t})`),s=e.getAttribute(R.normalAttrMapAttrName);s&&new Map(JSON.parse(s)).forEach((t,e)=>{r.push(`(${t})`)}),i=r.join(";")}i&&(i=i.replace(/#[^#]*#/g,"({})"),R.VARNAMES.forEach(t=>{i=i.replace(RegExp(t.replace("$","\\$"),"g"),`this.___${t}`)}),Array.from(_.getVariablePaths(i)).filter(t=>!t.startsWith(`___${R.SCRIPTS_VARNAME}`)).forEach(t=>e.add(t)))}),e}async render(t,e){const n=e.window.document.importNode(this.dataSet.fragment,!0),r=[],s=[],o=[],a=[],c=[];for(const l of Array.from(n.childNodes.values())){let n={};l.nodeType===Node.ELEMENT_NODE&&(n=i.getAttributeToObject(l));const h=Object.freeze({rawSet:this,scripts:R.setBindProperty(e?.scripts,t),router:e?.router,range:T.range,element:l,attribute:n,rootObject:t,scriptUtils:_,nearThis:this.findNearThis(t),parentThis:this.findParentThis(t),bindScript:` /** render **/\n const ${R.SCRIPTS_VARNAME} = this.__render.scripts;\n const ${R.RAWSET_VARNAME} = this.__render.rawSet;\n const ${R.ELEMENT_VARNAME} = this.__render.element;\n const ${R.ATTRIBUTE_VARNAME} = this.__render.attribute;\n const ${R.RANGE_VARNAME} = this.__render.range;\n const ${R.ROUTER_VARNAME} = this.__render.router;\n const ${R.NEAR_THIS_VARNAME} = this.__render.nearThis;\n const ${R.PARENT_THIS_VARNAME} = this.__render.parentThis;\n const ${R.SCRIPT_UTILS_VARNAME} = this.__render.scriptUtils;\n const ${R.ROOT_OBJECT_VARNAME} = this.__render.rootObject;\n `}),u=e.window.document.createDocumentFragment();if(l.nodeType===Node.TEXT_NODE&&l.textContent){const n=l.textContent,r=vt.expressionGroups(n)[0][1];let i;if(n?.startsWith("#")){const n=_.eval(`${h.bindScript} return ${r}`,Object.assign(t,{__render:h})),s=e.window.document.createElement("template");s.innerHTML=n,i=s.content}else{const n=_.eval(`${h.bindScript} return ${r}`,Object.assign(t,{__render:h}));i=e.window.document.createTextNode(n)}l.parentNode?.replaceChild(i,l),this.type===H.STYLE_TEXT&&this.point.parent&&this.point.parent.removeAttribute("completed")}else if(l.nodeType===Node.ELEMENT_NODE){const n=l,i={dr:this.getAttributeAndDelete(n,vt.DR_NAME),drIf:this.getAttributeAndDelete(n,vt.DR_IF_NAME),drFor:this.getAttributeAndDelete(n,vt.DR_FOR_NAME),drForOf:this.getAttributeAndDelete(n,vt.DR_FOR_OF_NAME),drThisProperty:this.getAttributeAndDelete(n,vt.DR_THIS_PROPERTY_NAME),drAppender:this.getAttributeAndDelete(n,vt.DR_APPENDER_NAME),drRepeat:this.getAttributeAndDelete(n,vt.DR_REPEAT_NAME),drThis:this.getAttributeAndDelete(n,vt.DR_THIS_NAME),drForm:this.getAttributeAndDelete(n,vt.DR_FORM_NAME),drPre:this.getAttributeAndDelete(n,vt.DR_PRE_NAME),drInnerHTML:this.getAttributeAndDelete(n,vt.DR_INNERHTML_NAME),drInnerText:this.getAttributeAndDelete(n,vt.DR_INNERTEXT_NAME),drStripElement:this.getAttributeAndDelete(n,vt.DR_STRIP_NAME),drReplaceTargetElementIs:this.getAttributeAndDelete(n,vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME),drItOption:this.getAttributeAndDelete(n,vt.DR_IT_OPTIONNAME),drIfOption:this.getAttributeAndDelete(n,vt.DR_IF_OPTIONNAME),drVarOption:this.getAttributeAndDelete(n,vt.DR_VAR_OPTIONNAME),drNextOption:this.getAttributeAndDelete(n,vt.DR_NEXT_OPTIONNAME),drAfterOption:this.getAttributeAndDelete(n,vt.DR_AFTER_OPTIONNAME),drBeforeOption:this.getAttributeAndDelete(n,vt.DR_BEFORE_OPTIONNAME),drCompleteOption:this.getAttributeAndDelete(n,vt.DR_COMPLETE_OPTIONNAME),drStripOption:this.getAttributeAndDelete(n,vt.DR_STRIP_OPTIONNAME),drDestroyOption:this.getAttributeAndDelete(n,vt.DR_DESTROY_OPTIONNAME),drKeyOption:this.getAttributeAndDelete(n,vt.DR_KEY_OPTIONNAME),drDetectIfOption:this.getAttribute(n,vt.DR_DETECT_IF_OPTIONNAME),drHasKeysOption:this.getAttribute(n,vt.DR_HAS_KEYS_OPTIONNAME)};c.push(i);const d=[new G(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_PRE_NAME,attr:i.drPre,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drPre},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new K(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_NAME,attr:i.dr,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.dr},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new X(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_IF_NAME,attr:i.drIf,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drIf},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new dt(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_STRIP_NAME,attr:i.drStripElement,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drThis},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new Q(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_THIS_NAME,attr:i.drThis,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drThis},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new rt(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_FOR_NAME,attr:i.drForm,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drForm},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new it(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_INNERTEXT_NAME,attr:i.drInnerText,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drInnerText},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new st(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_INNERHTML_NAME,attr:i.drInnerHTML,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drInnerHTML},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new ot(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_FOR_NAME,attr:i.drFor,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drFor},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new at(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_FOR_OF_NAME,attr:i.drForOf,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drForOf},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new pt(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_THIS_PROPERTY_NAME,attr:i.drThisProperty,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drThisProperty},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new ct(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_APPENDER_NAME,attr:i.drAppender,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drAppender},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new lt(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_REPEAT_NAME,attr:i.drRepeat,attrs:i},{config:e,obj:t,operatorAround:e.operatorAround?.drRepeat},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new Rt(this,h,{raws:r,fag:u},{element:n,attrName:vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME,attr:i.drReplaceTargetElementIs,attrs:i},{config:e,obj:t},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new ht(this,h,{raws:r,fag:u},{element:n,attrs:i},{config:e,obj:t},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a}),new ut(this,h,{raws:r,fag:u},{element:n,attrs:i},{config:e,obj:t},{onAttrInitCallBacks:s,onElementInitCallBacks:o,onThisComponentSetCallBacks:a})];for(const t of d){const e=await t.start();if(e===$.EXECUTE)break;if(e===$.STOP)return r}}}this.point.childrenRawSets=r,r.forEach(t=>{t.point.parentRawSet=this});const l=Array.from(n.childNodes);this.applyEvent(t,n,e),this.replaceBody(n),this.onRenderedEvent(t,l,e),c.forEach(r=>{if(r.drCompleteOption){const i=Object.freeze({rawSet:this,fag:n,scripts:R.setBindProperty(e?.scripts,t)});_.eval(`\n const ${R.FAG_VARNAME} = this.__render.fag;\n const ${R.SCRIPTS_VARNAME} = this.__render.scripts;\n const ${R.RAWSET_VARNAME} = this.__render.rawSet;\n ${r.drCompleteOption}`,Object.assign(t,{__render:i}))}});for(const t of a)Tt(t.obj)&&t.obj?.onInitRender?.({},this);for(const n of o)Tt(this.dataSet.render?.currentThis)&&this.dataSet.render.currentThis.onInitRender({},this),e?.onElementInit?.(n.name,t,this,n.targetElement);for(const n of s)e?.onAttrInit?.(n.attrName,n.attrValue,t,this);return t.__domrender_components&&Object.entries(t.__domrender_components).forEach(([n,r])=>{const i=r.__rawSet,s=i?.dataSet.render?.attribute;if(i&&!i.isConnected){const r=s?.drDestroyOption?.split(",")??[];vt.destroy(t.__domrender_components[n],{rawSet:i},e,r),delete t.__domrender_components[n]}}),r}static generateRuleSelector(t,e,n){const r=`:is(${t} ~ *:not(${t} ~ ${e} ~ *))`;if(n.startsWith("## "))return n.replace(/^## /,"");if(n.startsWith("."))return`${r}${n}, ${r} ${n}`;if(n.includes("::")){const i=n.match(/(.*)::(.*)$/),s=i?.[1],o=i?.[2];return`${r} ${s}, ${t} ~ ${s}:not(${t} ~ ${e} ~ *)::${o}`}return`${r} ${n}, ${t} ~ ${n}:not(${t} ~ ${e} ~ *)`}static generateStyleTransform(t,e,n=!0){Array.isArray(t)&&(t=t.join("\n")),t=t.replaceAll("#uuid#",e);const r=`#${e}-start`,i=`#${e}-end`,s=new yt(t);s.rules.forEach(t=>{if(At(t)){if(!t.selector.includes(":root")){const e=t.selector.split(",").map(t=>t.trim()).map(t=>this.generateRuleSelector(r,i,t));t.selector=e.join(", ")}}else(function(t){return t instanceof mt})(t)&&"media"===t.name&&(t.children.some(t=>At(t)&&t.selector.includes(":root"))||t.children.forEach(t=>{if(At(t)){const e=t.selector.split(",").map(t=>t.trim()).map(t=>this.generateRuleSelector(r,i,t));t.selector=e.join(", ")}}))});let o=s.stringify();return o=o.replaceAll("/*$","${"),o=o.replaceAll("$*/","}$"),n&&(t=`<style id='${e}-style' domstyle>${o}</style>`),t}applyEvent(t,e=this.dataSet.fragment,n){this.dataSet.config.eventManager.applyEvent(t,this.dataSet.config.eventManager.findAttrElements(e,n),n)}onRenderedEvent(t,e,n){this.dataSet.config.eventManager.onRenderedEvent(t,e,n)}getAttribute(t,e){return t.getAttribute(e)}getAttributeAndDelete(t,e){const n=t.getAttribute(e);return t.removeAttribute(e),n}getDrAppendAttributeAndDelete(t,e){let n=t.getAttribute(vt.DR_APPENDER_NAME);return n&&!/\[.+\]/g.test(n)&&(n=`${n}[${_.evalReturn(`${l.Path.toOptionalChainPath(n)}?.length -1`,e)}]`,t.setAttribute(vt.DR_APPENDER_NAME,n)),t.removeAttribute(vt.DR_APPENDER_NAME),n}replaceBody(t){this.childAllRemove(),this.point.start.parentNode?.insertBefore(t,this.point.start.nextSibling)}static checkPointCreates(t,r,i){const s=i.window.document.createNodeIterator(t,NodeFilter.SHOW_ALL,{acceptNode(t){if(t.nodeType===Node.TEXT_NODE){const e=vt.expressionGroups(n.deleteEnter(t.data??""));return e?.length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}if(t.nodeType===Node.ELEMENT_NODE){const e=t;if(e.hasAttribute(vt.DR_PRE_NAME))return NodeFilter.FILTER_REJECT;if(e.hasAttribute(R.attrAttrName)){const t=e.getAttribute(R.attrAttrName)??"";(Array.from(t.matchAll(/(\w+):\s*([^,}]+)/g)).map(t=>({key:t[1],value:t[2]}))??[]).forEach(t=>{e.setAttribute(t.key,"${"+t.value+"}$")})}const n=e.getAttribute(vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME),s=i.targetElements?.map(t=>t.name.toLowerCase())??[],o=s.includes(e.tagName.toLowerCase())||s.includes(n?.toLowerCase()),a=(i.targetAttrs?.map(t=>t.name)??[]).concat([...vt.DR_ATTRIBUTES]),c=new Map,h=new Map,u=R.linkAttrs.map(t=>t.name),d=e.getAttributeNames().filter(t=>{const n=e.getAttribute(t);if(n&&u.includes(t))h.set(t,n);else if(n&&vt.isExpression(n)){let i=vt.expressionGroups(n)[0][1];i=i.replace(/#[^#]*#/g,"({})");const s=_.evalReturn(l.Path.toOptionalChainPath(i),Object.assign(r));null===s?e.removeAttribute(t):e.setAttribute(t,s),c.set(t,i)}return a.includes(t.toLowerCase())}).length>0;return h.size&&e.setAttribute(R.linkTargetMapAttrName,JSON.stringify(Array.from(h.entries()))),c.size&&e.setAttribute(R.normalAttrMapAttrName,JSON.stringify(Array.from(c.entries()))),d||o?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_REJECT}}),o=[];let a;for(;a=s.nextNode();)if(a.nodeType===Node.TEXT_NODE){const t=a.textContent??"",n=i.window.document.createElement("template"),s=vt.expressionGroups(t).map(t=>({uuid:`${e.alphabet(40)}_${r?.constructor?.name}`,content:t[0],regexArr:t}));let c=0;for(let t=0;t<s.length;t++){const e=s[t],r=e.regexArr,l=r.input.substring(c,r.index);let h;h=a.parentNode&&"STYLE"===a.parentNode.nodeName.toUpperCase()?H.STYLE_TEXT:H.TEXT;const u=document.createTextNode(l),d=vt.createStartEndPoint({id:e.uuid,type:h},i);n.content.append(u),n.content.append(d.start),n.content.append(d.end);const p=i.window.document.createDocumentFragment();p.append(i.window.document.createTextNode(e.content)),o.push(new vt(e.uuid,h,{start:d.start,node:a,end:d.end,parent:a.parentNode},{fragment:p,config:i})),c=r.index+e.content.length}n.content.append(i.window.document.createTextNode(t.substring(c,t.length))),a?.parentNode?.replaceChild(n.content,a)}else if(a.nodeType===Node.ELEMENT_NODE){const t=`${e.alphabet(40)}___${r?.constructor?.name}`,n=a,s=i.window.document.createDocumentFragment(),c=H.TARGET_ELEMENT,l=vt.createStartEndPoint({node:n,id:t,type:c},i),h=n.getAttribute(vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME),u=i.targetElements?.map(t=>t.name.toLowerCase())??[],d=u.includes(n.tagName.toLowerCase())||u.includes(h?.toLowerCase()),p=(i.targetAttrs?.map(t=>t.name)??[]).concat(vt.DR_ATTRIBUTES),f=n.getAttributeNames().filter(t=>p.includes(t.toLowerCase())).length>0;a?.parentNode?.insertBefore(l.start,a),a?.parentNode?.insertBefore(l.end,a.nextSibling),s.append(a);const g=new vt(t,d?c:f?H.TARGET_ATTR:H.UNKOWN,{start:l.start,node:a,end:l.end,parent:a.parentNode},{config:i,fragment:s});o.push(g)}return o}static createStartEndPoint(t,e){if(t.type===H.TARGET_ELEMENT&&t.node){const n=t.node,r=e.window.document.createElement("meta"),i=e.window.document.createElement("meta");r.setAttribute("id",`${t.id}-start`),r.setAttribute("dr-start-point","");const s=n.getAttribute(vt.DR_KEY_OPTIONNAME);return n.getAttribute(vt.DR_THIS_PROPERTY_NAME)&&r.setAttribute("type",F.DR_THIS_PROPERTY),s&&(n.removeAttribute(vt.DR_KEY_OPTIONNAME),r.setAttribute(vt.DR_KEY_OPTIONNAME,s)),i.setAttribute("id",`${t.id}-end`),i.setAttribute("dr-end-point",""),{start:r,end:i}}return t.type===H.STYLE_TEXT?{start:e.window.document.createTextNode(`/*start text ${t.id}*/`),end:e.window.document.createTextNode(`/*end text ${t.id}*/`)}:{start:e.window.document.createComment(`start text ${t.id}`),end:e.window.document.createComment(`end text ${t.id}`)}}remove(){this.childAllRemove(),this.point.end.remove(),this.point.start.remove()}childAllRemove(){let t=this.point.start.nextSibling;for(;t&&t!==this.point.end;)t.remove(),t=this.point.start.nextSibling}childs(t){const e=[];let n=this.point.start.nextSibling;for(;n&&n!==this.point.end;){if(t?.(n))return;e.push(n),n=n.nextSibling}return e}getHasRawSet(t){let e;return this.childs(n=>{const r=n.getAttribute?.(vt.DR_KEY_OPTIONNAME);return!(!r||r!==t||(e=n.rawSet,0))}),e}static drItOtherEncoding(t,n){const r=e.uuid()+n,i=/#it#/g;return t.querySelectorAll(`[${vt.DR_IT_OPTIONNAME}], [${vt.DR_FOR_OF_NAME}], [${vt.DR_REPEAT_NAME}], [${vt.DR_APPENDER_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(i,r)}),r}static drItOtherDecoding(t,e){t.querySelectorAll(`[${vt.DR_IT_OPTIONNAME}], [${vt.DR_FOR_OF_NAME}], [${vt.DR_REPEAT_NAME}], [${vt.DR_APPENDER_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(RegExp(e,"g"),"#it#")})}static drVarDecoding(t,e){t.querySelectorAll(`[${vt.DR_THIS_NAME}]`).forEach(t=>{e.filter(t=>t.value&&t.name).forEach(e=>{t.innerHTML=t.innerHTML.replace(RegExp(e.random,"g"),e.value)})})}static replaceInnerHTML(t,n){const r=t.innerHTML,i=n.toBe=n.toBe??e.uuid();return n.asIs instanceof RegExp?t.innerHTML=r.replace(n.asIs,n.toBe):t.innerHTML=r.replaceAll(n.asIs,n.toBe),i}static drThisEncoding(t,r,i){const s=i.toBe=i?.toBe??e.uuid();t.querySelectorAll(`[${vt.DR_PRE_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(i.asIs,s)}),t.querySelectorAll(`[${vt.DR_THIS_NAME}]`).forEach(t=>{let e=t.innerHTML;n.regexExec(i.asIs,e).reverse().forEach(t=>{e=e.substr(0,t.index)+e.substr(t.index).replace(t[0],`${t[1]??""}${r}`)}),t.innerHTML=e});let o=t.innerHTML;return n.regexExec(i.asIs,o).reverse().forEach(t=>{o=o.substr(0,t.index)+o.substr(t.index).replace(t[0],`${t[1]??""}${r}`)}),t.innerHTML=o,s}static drThisBindEncoding(t,r,i){t.querySelectorAll(`[${vt.DR_THIS_NAME}]`).forEach(t=>{let e=t.innerHTML;n.regexExec(r,e).reverse().forEach(n=>{e=e.substr(0,n.index)+e.substr(n.index).replace(n[0],`${n[1]??""}${t.getAttribute(vt.DR_THIS_NAME)}`)}),t.innerHTML=e});const s=(i.config.targetElements??[]).map(t=>t.name.replaceAll(".","\\.").replaceAll(":","\\:")).join(","),o=e.uuid();if(t.querySelectorAll(s).forEach(t=>{t.innerHTML=t.innerHTML.replace(r,o)}),t.querySelectorAll(`[${vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(r,o)}),i.otherReplaceVariablePath){let e=t.innerHTML;n.regexExec(r,e).reverse().forEach(t=>{e=e.substr(0,t.index)+e.substr(t.index).replace(t[0],`${t[1]??""}${i.otherReplaceVariablePath}`)}),t.innerHTML=e}return o}static drThisBindDecoding(t,e){const n=(e.config.targetElements??[]).map(t=>t.name.replaceAll(".","\\.").replaceAll(":","\\:")).join(",");t.querySelectorAll(n).forEach(t=>{t.innerHTML=t.innerHTML.replace(RegExp(e.asIs,"g"),e.toBe)}),t.querySelectorAll(`[${vt.DR_REPLACE_TARGET_ELEMENT_IS_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(RegExp(e.asIs,"g"),e.toBe)})}static drThisDecoding(t,e){t.querySelectorAll(`[${vt.DR_PRE_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(RegExp(e.asIs,"g"),e.toBe)}),t.querySelectorAll(`[${vt.DR_THIS_NAME}]`).forEach(t=>{t.innerHTML=t.innerHTML.replace(RegExp(e.asIs,"g"),e.toBe)})}static drFormOtherMoveAttr(t,e,n,r){t.querySelectorAll(`[${vt.DR_FORM_NAME}]`).forEach(t=>{const i=r.window.document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT});let s;for(;s=i.nextNode();){const t=s;t.setAttribute(n,t.getAttribute(e)??""),t.removeAttribute(e)}})}static drVarEncoding(t,n){const r=(n?.split(",")??[]).map(t=>{const n=t.trim().split("="),r=n[0]?.trim(),i=n[1]?.trim();return{name:r,value:i,regex:RegExp("\\$var\\."+r+"(?=.?)","g"),random:e.uuid()}});return t.querySelectorAll(`[${vt.DR_VAR_OPTIONNAME}]`).forEach(t=>{r.filter(t=>t.value&&t.name).forEach(e=>{t.innerHTML=t.innerHTML.replace(e.regex,e.random)})}),r.filter(t=>t.value&&t.name).forEach(e=>{t.innerHTML=t.innerHTML.replace(e.regex,e.value)}),r}static async drThisCreate(t,n,r,i,s,o,a,c){const h=a.window.document.createDocumentFragment(),u=n.cloneNode(!0);let d=o;if(c){d=c.obj,c.setTemplateStyle(await vt.fetchTemplateStyle(c));const e=vt.generateStyleTransform(c.styles??[],t.uuid,!0);u.innerHTML=e+(c.template??"")}else d=_.evalReturn(l.Path.toOptionalChainPath(r),o);const p=t.uuid,f=` /*drThisCreate*/\n // console.log('-----', this.__render);\n var ${R.RENDER_VARNAME} = this.__render; \n var ${R.RAWSET_VARNAME} = this.__render.rawSet; \n var ${R.COMPONENT_VARNAME} = this.__render.component; \n var ${R.ELEMENT_VARNAME} = this.__render.element; \n var ${R.ROUTER_VARNAME} = this.__render.router; \n var ${R.INNER_HTML_VARNAME} = this.__render.innerHTML; \n var ${R.ATTRIBUTE_VARNAME} = this.__render.attribute; \n var ${R.PARENT_THIS_PATH_VARNAME} = this.__render.parentThisPath; \n var ${R.CURRENT_THIS_VARNAME} = this.__render.currentThis; \n var ${R.CURRENT_THIS_PATH_VARNAME} = this.__render.currentThisPath; \n var ${R.PARENT_THIS_VARNAME} = this.__render.parentThis; \n var ${R.NEAR_THIS_PATH_VARNAME} = this.__render.nearThisPath; \n var ${R.NEAR_THIS_VARNAME} = this.__render.nearThis; \n var ${R.CREATOR_META_DATA_VARNAME} = this.__render.creatorMetaData;\n `,g=t.findParentThisPath(),m=t.findParentThis(o),y=t.findNearThisPath(),A=t.findNearThis(o);let E={renderScript:f,element:n,getElement:()=>a.window.document.querySelector(`[class*="${t.uuid}"]`),innerHTML:n.innerHTML,rawSet:t,router:a.router,componentKey:p,currentThis:d,currentThisPath:r,parentThisPath:g,parentThis:m,nearThisPath:y,nearThis:A,scripts:R.setBindProperty(a.scripts??{},o)};E.attribute=vt.getAttributeObject(n,{script:f,obj:o,renderData:E}),E=Object.freeze(E);const b=_.eval("return {rootParent: this, render: this.__render}",Object.assign(o,{__render:E}));_t(d)&&d?.onCreateRenderData(b),b?.render?.parentThis&&(t=>"function"==typeof t?.onCreatedThisChild)(b?.render?.parentThis)&&b.render.parentThis.onCreatedThisChild(d,b);const T=n.getAttribute(vt.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);let v=[];T&&(v=_.evalReturn({bodyScript:f,returnScript:l.Path.toOptionalChainPath(T)},o),Array.isArray(v)||(v=[v])),Et(d)&&d.onCreateRender(...v);const S=vt.getAttributeObject(n,{script:f,obj:o,renderData:E});S&&(t.dataSet.render??={},t.dataSet.render.attribute=S,Object.entries(S).forEach(([e,n],r)=>{bt(d)&&d.onChangeAttrRender(e,n,{rawSet:t})}));const N=n.getAttribute(vt.DR_ON_CREATED_CALLBACK_OPTIONNAME);if(N){const t=`${f} ${N} `;_.eval(t,Object.assign(o,{__render:E}))}u.querySelectorAll(R.attrNames.map(t=>`[${t}]`).join(",")).forEach(t=>{t.setAttribute(R.ownerVariablePathAttrName,"this")}),e.uuid();const O=u.getAttribute(vt.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME)??"innerHTML";O&&vt.replaceInnerHTML(u,{asIs:`#${O}#`,toBe:n.innerHTML});const M=u.getAttribute(vt.DR_THIS_NAME_OPTIONNAME);u.getAttributeNames().forEach(t=>u.setAttribute(t,u.getAttribute(t).replace(/#this#/g,r)));const w=this.drThisEncoding(u,r,{asIs:/@this@/g});M&&(u.innerHTML=u.innerHTML.replaceAll(`@${M}@`,r));const x=this.drThisBindEncoding(u,/@nearThis@/g,{config:a,otherReplaceVariablePath:t.findNearThisPath()}),C=this.drThisBindEncoding(u,/@parentThis@/g,{config:a,otherReplaceVariablePath:t.findParentThisPath()}),P=this.drVarEncoding(u,i);return this.drVarDecoding(u,P),this.drThisDecoding(u,{asIs:w,toBe:"@this@"}),this.drThisBindDecoding(u,{config:a,asIs:x,toBe:"@nearThis@"}),this.drThisBindDecoding(u,{config:a,asIs:C,toBe:"@parentThis@"}),!s||!0!==s&&"true"!==s?(u.classList.add(`${t.uuid}`),h.append(u)):Array.from(u.childNodes).forEach(t=>h.append(t)),h}static async fetchTemplateStyle(t){const e=[],n=t.template&&t.template.startsWith("lazy://")?(await fetch(t.template.substring(6))).text():Promise.resolve(t.template);if(Array.isArray(t.styles))for(let n=0;t.styles&&n<(t.styles.length??0);n++){const r=t.styles[n];e.push(r.startsWith("lazy://")?(await fetch(r.substring(6))).text():Promise.resolve(r))}else t.styles&&e.push(Promise.resolve(t.styles));return{template:await n,styles:await Promise.all(e)}}static createComponentTargetAttribute(t,e,n){return{name:t,callBack:(t,r,i,s)=>(e(t,r,i,s),n(t,r,i,s))}}static createComponentTargetElement({name:t,objFactory:n,template:r="",styles:i=[],noStrip:s}){const o={name:t,styles:i,template:r,noStrip:s,async callBack(t,r,i,o,a){const c=await vt.fetchTemplateStyle({template:this.template,styles:this.styles});this.template=c.template,this.styles=c.styles,r.__domrender_components??={};const h=r.__domrender_components,u=` /*createComponentTargetElement*/\n // console.log('-------------------',this.__render);\n var ${R.RAWSET_VARNAME} = this.__render.rawSet; \n var ${R.COMPONENT_VARNAME} = this.__render.component; \n var ${R.ELEMENT_VARNAME} = this.__render.element; \n var ${R.ROUTER_VARNAME} = this.__render.router; \n var ${R.INNER_HTML_VARNAME} = this.__render.innerHTML; \n var ${R.ATTRIBUTE_VARNAME} = this.__render.attribute; \n var ${R.PARENT_THIS_PATH_VARNAME} = this.__render.parentThisPath; \n var ${R.PARENT_THIS_VARNAME} = this.__render.parentThis; \n var ${R.NEAR_THIS_PATH_VARNAME} = this.__render.nearThisPath; \n var ${R.NEAR_THIS_VARNAME} = this.__render.nearThis; \n var ${R.CREATOR_META_DATA_VARNAME} = this.__render.creatorMetaData;\n `,d=i.findParentThisPath(),p=i.findParentThis(r),f=i.findNearThisPath(),g=i.findNearThis(r);let m={renderScript:u,element:t,innerHTML:t.innerHTML,getElement:()=>a.window.document.querySelector(`[class*="${i.uuid}"]`),rawSet:i,router:a.router,componentKey:i.uuid,nearThisPath:f,nearThis:g,parentThisPath:d,parentThis:p,scripts:R.setBindProperty(a.scripts??{},r)};const y=t.getAttribute(vt.DR_ON_CONSTRUCTOR_ARGUMENTS_OPTIONNAME);let A=[];if(m.attribute=vt.getAttributeObject(t,{script:u,obj:r,renderData:m}),m=Object.freeze(m),y){let t=_.evalReturn({bodyScript:u,returnScript:l.Path.toOptionalChainPath(y)},Object.assign(r,{__render:m}))??[];Array.isArray(t)||(t=[t]),A=t}const E=h[i.uuid]=n(t,r,i,A);m={currentThis:E,...m},i.dataSet.render=m,E.__rawSet=i;let b,T=t.innerHTML;const v=t.getAttribute(vt.DR_COMPONENT_NAME_OPTIONNAME)??"component",S=t.getAttribute(vt.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME)??"innerHTML";T&&(b=e.uuid(),T=T.replace(/this\./g,b),T=T.replace(RegExp(`#${v}#`,"g"),"this")),T=(this.template??"").replace(RegExp(`#${S}#`,"g"),T);const N=vt.generateStyleTransform(this.styles,i.uuid,!0);t.innerHTML=N+(T??"");let O=await vt.drThisCreate(i,t,`this.__domrender_components.${i.uuid}`,"",!s,r,a);if(b){const t=a.window.document.createElement("template");t.content.append(O),t.innerHTML=t.innerHTML.replace(RegExp(b,"g"),"this."),O=t.content}return O}};return o}static isExpression(t){return/[$#]\{([\s\S.]*?)\}[$#]/g.test(t??"")}static expressionGroups(t){return n.regexExec(/[$#]\{([\s\S.]*?)\}[$#]/g,t??"")}static destroy(t,e,n,r=[]){r.some(t=>t===V.NO_DESTROY)||(r.some(t=>t===V.NO_MESSENGER_DESTROY)||n.messenger&&t&&n.messenger.deleteChannelFromObj(t),(t=>"function"==typeof t?.onDestroyRender)(t)&&t.onDestroyRender?.(e))}findNearThis=(t,e=this)=>{const n=this.findNearThisPath(e);if(n){const e=l.Path.toOptionalChainPath(n);return _.evalReturn(e,t)}};findParentThis=(t,e=this)=>{const n=this.findParentThisPath(e);if(n){const e=l.Path.toOptionalChainPath(n);return _.evalReturn(e,t)}};findNearThisPath=(t=this)=>{const e=this.findThisPaths(t);return e[e.length-1]};findParentThisPath=(t=this)=>{const e=this.findThisPaths(t);return e[e.length-2]};findThisPaths=(t=this)=>{const e=[],n=t=>{t&&t.point&&("getAttribute"in t.point.start&&t.point.start.getAttribute("this-path")&&e.push(t.point.start.getAttribute("this-path")),t.point.parentRawSet&&n(t.point.parentRawSet))};return n(t),e.push("this"),e.reverse()};static getAttributeObject(t,e){if(!t)return;const n=i.getAttributeToObject(t),r=n[R.normalAttrMapAttrName];return r&&new Map(JSON.parse(r)).forEach((t,r)=>{const i=_.evalReturn({bodyScript:e.script,returnScript:t},Object.assign(e.obj,e.renderData?{__render:e.renderData}:void 0));n[r]=i}),n}}const St="DomRender:NoProxy",Nt=(t,e)=>{void 0!==e?Reflect.defineMetadata(St,!0,t,e):Reflect.defineMetadata(St,!0,t)};class Ot{destination;closed=!1;constructor(t){this.destination=t}next(t){this.closed||this.destination.next(t)}error(t){this.closed||(this.closed=!0,this.destination.error(t),this.unsubscribe())}complete(){this.closed||(this.closed=!0,this.destination.complete(),this.unsubscribe())}unsubscribe(){this.closed=!0}}class Mt{_producerFunction;constructor(t){this._producerFunction=t}subscribe(t,e,n){const r={next:"object"==typeof t?t.next:t,error:"object"==typeof t?t.error:e,complete:"object"==typeof t?t.complete:n},i=new Ot({next:t=>{r.next?.(t)},error:t=>{r.error?.(t)},complete:()=>{r.complete?.()}});let s;this._producerFunction&&(s=this._producerFunction(i));let o=!1;return{get closed(){return o},unsubscribe:()=>{"function"==typeof s?s():s&&"function"==typeof s.unsubscribe&&s.unsubscribe(),o=!0}}}toPromise(){return new Promise((t,e)=>{let n,r;r=this.subscribe({next:t=>{n=t},error:t=>{e(t),r.unsubscribe()},complete:()=>{t(n),r.unsubscribe()}})})}pipe(...t){return 0===t.length?this:t.reduce((t,e)=>e(t),this)}}class wt extends Mt{_observers=new Set;_isStopped=!1;_hasError=!1;_error;constructor(){super(t=>this._subscribeToSubject(t))}_subscribeToSubject(t){const e={next:t.next.bind(t),error:t.error.bind(t),complete:t.complete.bind(t)};if(this._isStopped)return this._hasError?e.error?.(this._error):e.complete?.(),{closed:!0,unsubscribe:()=>{}};this._observers.add(e);let n=!1;return{get closed(){return n},unsubscribe:()=>{this._observers.delete(e),n=!0}}}next(t){this._isStopped||this._observers.forEach(e=>{e.next?.(t)})}error(t){this._isStopped||(this._hasError=!0,this._error=t,this._isStopped=!0,this._observers.forEach(e=>e.error?.(t)),this._observers.clear())}complete(){this._isStopped||(this._isStopped=!0,this._observers.forEach(t=>t.complete?.()),this._observers.clear())}asObservable(){return new Mt(t=>this._subscribeToSubject(t))}}class xt extends wt{_value;constructor(t){super(),this._value=t}next(t){this._value=t,super.next(t)}_subscribeToSubject(t){const e=super._subscribeToSubject(t);return this._isStopped?this._hasError?t.error(this._error):t.complete():t.next(this._value),e}getValue(){if(this._hasError)throw this._error;return this._value}}var Ct;Error,function(t){t.querySelectorAllByAttributeName=(t,e)=>{const n=[];return t.querySelectorAll(`[${e}]`)?.forEach(t=>{n.push({element:t,value:t.getAttribute(e)})}),n},t.eventObservable=(t,e,n)=>new Mt(t=>{const r=e=>t.next(e);return window.addEventListener(e,r,n),()=>{window.removeEventListener(e,r,n)}})}(Ct||(Ct={}));const Pt=t=>null!=t;var It;!function(e){let n;e.constructorName=t=>t&&t.constructor&&t.constructor.name?t.constructor.name:t&&t.name?t.name:void 0,e.deepCopy=e=>e instanceof Map?new Map(JSON.parse(JSON.stringify(Array.from(e.entries())))):e instanceof Set?new Set(JSON.parse(JSON.stringify(Array.from(e.values())))):t.isNullOrUndefined(e)?e:JSON.parse(JSON.stringify(e)),e.allProtoTypeName=(t,n)=>{let r=[];if(t){const i=Object.getPrototypeOf(t);i&&(r=Object.keys(i)||[]).length>0&&(r=r.concat(e.allProtoTypeName(i,n)))}let i=r.filter(t=>"constructor"!==t);if(n&&t){const e=Object.getPrototypeOf(t);i=i.filter(t=>n(t,e?.[t]))}return i},e.uniqueKeys=t=>Array.from(new Set((Array.isArray(t)?t:[t]).flatMap(t=>Object.keys(t)))),e.ownPropertyNames=t=>{const e=[];if(t)if(t.prototype)e.push(...Object.getOwnPropertyNames(Object.getPrototypeOf(t)));else{const n=Object.getPrototypeOf(t);e.push(...Object.getOwnPropertyNames(n))}return e.filter(t=>"constructor"!==t)},e.protoTypeName=t=>{let e=[];if(t){const n=Object.getPrototypeOf(t);e=Object.keys(n)||[]}return e.filter(t=>"constructor"!==t)},e.protoTypes=t=>{const e=[];if(t){const n=Object.getPrototypeOf(t);(Object.keys(n)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.push(n[t])})}return e},e.seal=t=>Object.seal(t),e.isPrototypeOfTarget=(t,e)=>!(!t||!e)&&Object.prototype.isPrototypeOf.call(t.prototype,e),e.prototypeOfDepth=(t,e)=>{let n=t;const r=[];if(e)do{if(n=Object.getPrototypeOf(n),n?.constructor===e)break;r.push(n)}while(n);return r},e.allProtoType=t=>{const e=(t,n=[])=>(t.prototype&&(n.push(t),e(Object.getPrototypeOf(t),n)),n);return e(t)},e.prototypeOf=t=>Object.getPrototypeOf(t),e.prototypeKeyMap=t=>{const e=new Map;if(t){const n=Object.getPrototypeOf(t);(Object.keys(n)||[]).filter(t=>"constructor"!==t).forEach(t=>{e.set(n[t],t)})}return e},e.prototypeName=(t,n)=>e.prototypeKeyMap(t).get(n),e.pickRandomKey=t=>{const e=Object.keys(t);return e[Math.floor(Math.random()*e.length)]},e.pickRandomValue=t=>{const e=Object.keys(t);return t[e[Math.floor(Math.random()*e.length)]]},e.pickRandomKeyValue=t=>{const e=Object.keys(t),n=e[Math.floor(Math.random()*e.length)];return{key:n,value:t[n]}},e.keyValues=t=>Object.keys(t).map(e=>({key:e,value:t[e]})),e.entries=t=>Object.entries(t),e.values=t=>Object.values(t),e.keys=t=>Object.keys(t),e.keyLength=t=>e.keys(t).length,e.toDeleteUndefinedAndNull=(t,e)=>{const n=t=>Array.isArray(t)?t.filter(t=>null!=t).map(n):t&&"object"==typeof t?e?.deep?Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e).map(([t,e])=>[t,n(e)])):Object.fromEntries(Object.entries(t).filter(([t,e])=>null!=e)):t;return n(t)},function(t){t.isFunctionScript=t=>t.trim().startsWith("function"),t.isArrowFunctionScript=t=>/^\s*\([^)]*\)\s*=>/.test(t),t.toOptionalChainPath=e=>{if(!e)return"";if(t.isFunctionScript(e)||t.isArrowFunctionScript(e))return e;const n=e.match(/[^?.[\]]+|\[[^\]]*\]/g);return n?n.join("?."):e},t.removeOptionalChainOperator=t=>t?t.replace(/\?\./g,".").replace(/\.\[/g,"["):"";const e=t=>{const e=[],n=/\.([^.\[]+)|\[(\d+)\]|\[(['"])(.*?)\3\]/g;let r,i=0;const s=t.match(n);if(s&&(s?.index??0)>0)e.push(t.substring(0,s.index)),i=s.index;else if(!s&&t.length>0)return e.push(t),e;for(;null!==(r=n.exec(t));){if(r.index>i){const n=t.substring(i,r.index);n.startsWith(".")?e.push(n.substring(1)):e.push(n)}r[1]?e.push(r[1]):r[2]?e.push(parseInt(r[2],10)):r[4]&&e.push(r[4]),i=n.lastIndex}if(i<t.length){const n=t.substring(i);n.startsWith(".")?e.push(n.substring(1)):e.push(n)}return e};t.to=e=>{const n={};return Object.entries(e).forEach(([e,r])=>{t.set(n,e,r)}),n},t.set=(t,n,r)=>{const i=e(n);let s=t;for(let t=0;t<i.length;t++){const e=i[t];if(t===i.length-1)s[e]=r;else{const n=i[t+1];if("number"==typeof n){if(Array.isArray(s[e])||(s[e]=[]),Array.isArray(s[e]))for(;s[e].length<=n;)s[e].push({})}else"object"==typeof s[e]&&null!==s[e]||(s[e]={});s=s[e]}}},t.get=(t,n,r)=>{const i=e(n);let s=t;for(let t=0;t<i.length;t++){const e=i[t];if(null==s)return r;if("object"!=typeof s||null===s||!(e in s))return r;s=s[e]}return s},t.deletePath=(t,n)=>{const r=e(n);if(0===r.length)return!1;let i=t;for(let t=0;t<r.length-1;t++){const e=r[t];if(null==i)return!1;if("object"!=typeof i||null===i||!(e in i))return!1;i=i[e]}const s=r[r.length-1];return null!==i&&"object"==typeof i&&s in i&&(Array.isArray(i)&&"number"==typeof s?i.splice(s,1):delete i[s],!0)},t.availablePath=(t,e)=>{const n=[],r=t=>"number"==typeof t?"["+t+"]":/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:"['"+t+"']",i=(t,s,o)=>{null!==t&&"object"==typeof t&&(o.has(t)||(o.add(t),Array.isArray(t)?t.forEach((t,a)=>{const c=r(a),l=s?`${s}${c}`:c;e&&!e(l,t)||n.push(l),i(t,l,o)}):Object.keys(t).forEach(a=>{const c=r(a);let l;l=c.startsWith("[")?s?`${s}${c}`:c:s?`${s}.${c}`:c,e&&!e(l,t[a])||n.push(l),i(t[a],l,o)})))};return i(t,"",new Set),n}}(n=e.Path||(e.Path={})),e.toDeleteKey=(t,n)=>{const r={...t};return e.deleteKey(r,n),r},e.deleteKey=(t,e)=>{e.filter(t=>Pt(t)).forEach(e=>{delete t[e]})}}(It||(It={}));const Lt=["onBeforeReturnGet","onBeforeReturnSet","__domrender_components","__render","_DomRender_isFinal","_domRender_ref","_rawSets","_domRender_proxy","_targets","_DomRender_origin","_DomRender_ref","_DomRender_proxy"],kt=t=>t&&"object"==typeof t&&"_DomRender_isProxy"in t,jt=t=>{if(kt(t))return t._domRender_config};class Dt{_domRender_origin;_domRender_config;_domRender_ref=new Map;_rawSets=new Map;_domRender_proxy;_targets=new Set;constructor(t,e,n){this._domRender_origin=t,this._domRender_config=n,e&&this._targets.add(e)}static unFinal(t){return J.unFinal(t)}static final(t){return J.final(t)}static isFinal(t){return J.isFinal(t)}run(t){this._domRender_proxy=t,(t=>"function"==typeof t?.onProxyDomRender)(t)&&t.onProxyDomRender(this._domRender_config);const e=(t=>kt(t)?t._domRender_origin:t)(t);e&&Object.keys(e).forEach(n=>{try{if(Reflect.getMetadata(St,e,n)||Reflect.getMetadata(St,Object.getPrototypeOf(e).constructor))return e}catch(t){}const r=e[n];if(!(null==r||"object"!=typeof r||Dt.isFinal(r)||Object.isFrozen(r)||e instanceof q)){const i=this._domRender_config.proxyExcludeTyps?.some(t=>r instanceof t)??!1;if(!i){const i=this.proxy(t,r,n);e[n]=i}}}),this._targets.forEach(t=>{this.initRender(t)})}initRender(t,e){t instanceof Element&&(t.innerHTML=t.innerHTML.replace(/@this@/g,"this"));const n=t.getAttribute?.(vt.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);let r=[];n&&(r=_.evalReturn(n,this._domRender_proxy),Array.isArray(r)||(r=[r])),_t(this._domRender_proxy)&&this._domRender_proxy?.onCreateRenderData({rootParent:this._domRender_proxy}),Et(this._domRender_proxy)&&this._domRender_proxy.onCreateRender(...r),this._targets.add(t);const i=vt.checkPointCreates(t,this._domRender_proxy,this._domRender_config);this._domRender_config.eventManager.applyEvent(this._domRender_proxy,this._domRender_config.eventManager.findAttrElements(t,this._domRender_config),this._domRender_config),i.forEach(t=>{const e=t.getUsingTriggerVariables(this._domRender_config);e.size<=0?this.addRawSet("",t):e.forEach(e=>{this.addRawSet(e,t)})}),this.render(this.getRawSets()).then(r=>{let i;t.getAttribute?.(vt.DR_ON_INIT_ARGUMENTS_OPTIONNAME),n&&(i=_.evalReturn(n,this._domRender_proxy)),Tt(this._domRender_proxy)&&this._domRender_proxy.onInitRender(i,e??{})})}getRawSets(){const t=new Set;return this._rawSets.forEach((e,n)=>{e.forEach(e=>t.add(e))}),Array.from(t)}async render(t,e){if("string"==typeof t){const e=this._rawSets.get(t);t=e?Array.from(e):void 0}const n=[],r=t??this.getRawSets();for(const t of r)if(t.getUsingTriggerVariables(this._domRender_config).forEach(e=>{this.addRawSet(e,t)}),t.isConnected){const n=t.point.node?.getAttribute?.(R.normalAttrMapAttrName);if(t.detect?.action)t.detect.action();else if(t.type===H.TARGET_ELEMENT&&t.dataSet?.render?.currentThis&&e&&n)new Map(JSON.parse(n)).forEach((n,r)=>{if(R.isUsingThisVar(n,`this.${e}`)){const e=vt.getAttributeObject(t.point.node,{script:t.dataSet?.render?.renderScript??"",obj:Object.assign(this._domRender_proxy??{},{__render:t.dataSet?.render})});t.dataSet.render??={},t.dataSet.render.attribute=e,bt(t.dataSet?.render?.currentThis)&&t.dataSet?.render?.currentThis?.onChangeAttrRender?.(r,e[r],{rawSet:t})}});else{const e=await t.render(this._domRender_proxy,this._domRender_config);e&&e.length>0&&await this.render(e)}}else n.push(t);return n.length>0&&this.removeRawSet(...n),this.getRawSets()}root(t,e,n=!0){const r=[];if(this._domRender_ref.size>0)this._domRender_ref.forEach((i,s)=>{"_DomRender_isProxy"in s&&i.forEach(i=>{try{const o=t.concat([[{path:i,obj:s}]]),a=s._DomRender_proxy?.root(o,e,n);r.push(a.flat())}catch(t){}})});else{const i=t.reverse().map(t=>t.map(t=>t.path).join(",")),s=i.map(t=>isNaN(Number(t))?"."+t:`[${t}]`).join("").slice(1);if(n){const t=this._rawSets.get(s),n=i.slice(0,i.length-1).map(t=>isNaN(Number(t))?"."+t:`[${t}]`).join(""),r=i[i.length-1],o="this"+n,a=_.evalReturn(It.Path.toOptionalChainPath(o),this._domRender_proxy);new Promise(async i=>{let o=[];const c=n.slice(1),l=this._rawSets.get(c),h=[];if(l?.forEach(t=>{const e=t.point.start.getAttribute?.("type");e===F.DR_THIS_PROPERTY&&h.push(t)}),h.length>0){const t=[];let n=!1;h.forEach(i=>{const o=i.point.start,a=o.getAttribute(vt.DR_HAS_KEYS_OPTIONNAME)?.split(",")??[];if(void 0===e){const t=i.getHasRawSet(r);t?.remove(),o.setAttribute(vt.DR_HAS_KEYS_OPTIONNAME,a.filter(t=>t!==r).join(","))}if(a.includes(r))n=!0;else{const e=pt.append(this._domRender_proxy,s,r,i,this._domRender_config);e&&t.push(...e)}}),(!1===n||t.length>0)&&(o=await this.render(t))}if("length"===r&&Array.isArray(a)){const t=this._rawSets.get(c);t&&(o=await this.render(Array.from(t)))}else t&&(o=await this.render(Array.from(t),s));if(this._targets.forEach(t=>{if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE||t.nodeType===Node.ELEMENT_NODE){const e=this._domRender_config.eventManager.findAttrElements(t,this._domRender_config);this._domRender_config.eventManager.changeVar(this._domRender_proxy,e,`this.${s}`,this._domRender_config)}}),o?.length>0&&(u=a,"function"==typeof u?.onChildRenderedByProperty)){const t=_.evalReturn(`this.${r}`,a);a.onChildRenderedByProperty(r,t)}var u;i(o)}).then(t=>{})}r.push([{path:s,obj:this._domRender_proxy}])}return r}set(t,e,n,r){if("string"==typeof e&&"__domrender_components"!==e&&Lt.includes(e)||Reflect.getMetadata(St,t,e))return t[e]=n,!0;"string"==typeof e&&(n=this.proxy(r,n,e)),n instanceof Z&&t[e]instanceof Z&&(n.config.beforeComponentSet=t[e]),t[e]=n;let i=[];"string"==typeof e&&(i=this.root([[{path:e,obj:this._domRender_proxy}]],n));const s=this._domRender_config.rootElement??this._domRender_config.window.document;var o;return Ct.querySelectorAllByAttributeName(s,R.normalAttrMapAttrName)?.forEach(t=>{const e=new Map(_.evalReturn(t.value));Array.from(e.entries()).filter(([t,e])=>e.trim()).filter(Pt).flatMap(([t,e])=>i.flat().filter(t=>e.includes(`this.${t.path}`)).flatMap(n=>({key:t,valueScript:e,pathInfo:n}))).forEach(e=>{const n=It.Path.toOptionalChainPath(e.valueScript),r=_.evalReturn(n,e.pathInfo.obj);null===r?(t.element.removeAttribute(e.key),t.element[e.key]=null):(t.element.setAttribute(e.key,r),t.element[e.key]=r)})}),Ct.querySelectorAllByAttributeName(s,R.linkTargetMapAttrName)?.forEach(t=>{const e=new Map(_.evalReturn(t.value));Array.from(e.entries()).filter(([t,e])=>e.trim()).filter(Pt).flatMap(([t,e])=>i.flat().filter(t=>e.includes(`this.${t.path}`)).flatMap(n=>({key:t,valueScript:e,pathInfo:n}))).forEach(e=>{const n=_.evalReturn(e.valueScript,e.pathInfo.obj),r=R.linkAttrs.find(t=>t.name===e.key);r&&(null===n?t.element.removeAttribute(r.property):t.element.setAttribute(r.property,n))}),Array.from(e.entries()).filter(([t,e])=>e.trim()).filter(Pt).flatMap(([t,e])=>i.flat().filter(t=>e.includes(`this.${t.path}`)).flatMap(n=>({key:t,valueScript:e,pathInfo:n}))).forEach(e=>{const r=R.linkAttrs.find(t=>t.name===e.key);r&&(t.element[r.property]=n)})}),"onBeforeReturnSet"in r&&"string"==typeof e&&!(this._domRender_config.proxyExcludeOnBeforeReturnSets??[]).concat(Lt).includes(e)&&(o=r,"function"==typeof o?.onBeforeReturnSet&&r.onBeforeReturnSet?.(e,n,i.map(t=>t.map(t=>t.path).join()))),!0}get(t,e,n){if("_DomRender_origin"===e||"_domRender_origin"===e)return this._domRender_origin;if("_DomRender_ref"===e||"_domRender_ref"===e)return this._domRender_ref;if("_DomRender_config"===e||"_domRender_config"===e)return this._domRender_config;if("_DomRender_proxy"===e||"_domRender_proxy"===e)return this;{let r=t[e];return r&&"object"==typeof r&&"_DomRender_isProxy"in r&&"[object Date]"===Object.prototype.toString.call(r._DomRender_origin)&&(r=r._DomRender_origin),"onBeforeReturnGet"in n&&"string"==typeof e&&!(this._domRender_config.proxyExcludeOnBeforeReturnGets??[]).concat(Lt).includes(e)&&n?.onBeforeReturnGet?.(e,r,this.root([[{path:e,obj:this._domRender_proxy}]],r,!1)),r}}deleteProperty(t,e){return delete t[e],"string"==typeof e&&this.root([[{path:e,obj:this._domRender_proxy}]]),!0}has(t,e){return"_DomRender_isProxy"===e||e in t}proxy(e,n,r){try{const e="object"==typeof n,i=e&&!0===((t,e)=>void 0===e?Reflect.getMetadata(St,t):Reflect.getMetadata(St,t,e))(n,r),s=this._domRender_config.proxyExcludeTyps?.some(t=>n instanceof t)??!1,o=e&&Dt.isFinal(n),a=Object.isFrozen(n),c=n instanceof q;if(i||s||t.isNullOrUndefined(n)||!e||o||a||c)return n}catch(t){}if(!kt(n)){const t=new Dt(n,void 0,this._domRender_config);t.addRef(e,r);const i=new Proxy(n,t);return t.run(i),i}return kt(n)?(n._DomRender_proxy.addRef(this._domRender_proxy,r),n):n}addRef(t,e){this._domRender_ref.get(t)||this._domRender_ref.set(t,new Set),this._domRender_ref.get(t)?.add(e)}addRawSetAndRender(t,e){this.addRawSet(t,e),this.render([e])}addRawSet(t,e){this._rawSets.get(t)||this._rawSets.set(t,new Set),this._rawSets.get(t)?.add(e)}removeRawSet(...t){this._rawSets.forEach(e=>{e.forEach(n=>{n.isConnected?t.includes(n)&&e.delete(n):e.delete(n)})}),this.targetGarbageRawSet()}targetGarbageRawSet(){this._targets.forEach(t=>{t.isConnected||this._targets.delete(t)})}garbageRawSet(){this._targets.forEach(t=>{t.isConnected||this._targets.delete(t)}),this._rawSets.forEach(t=>{t.forEach(e=>{e.isConnected||t.delete(e)})})}}class Bt{x;y;constructor(t,e){"object"==typeof t?(this.x=t.x??0,this.y=t.y??0):(this.x=t??0,this.y=e??0)}copy(){return new Bt(this.x,this.y)}}class $t{x;y;z;constructor(t,e,n){t instanceof Vt?(this.x=t.x,this.y=t.y,this.z=t.z):"object"==typeof t?(this.x=t.x??0,this.y=t.y??0,this.z=t.z??0):(this.x=t??0,this.y=e??0,this.z=n??0)}set(t,e=0,n=0){return t instanceof $t||t instanceof Vt?this.set(t.x||0,t.y||0,t.z||0):(this.x=t,this.y=e,this.z=n),this}get(){return new $t(this.x,this.y,this.z)}mag(){const t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)}add(t,e=0,n=0){t instanceof $t||t instanceof Vt?(this.x+=t.x,this.y+=t.y,this.z+=t.z):(this.x+=t,this.y+=e,this.z+=n)}toAdd(t,e){return new $t(t.x+e.x,t.y+e.y,t.x+e.y)}sub(t,e=0,n=0){t instanceof $t||t instanceof Vt?(this.x-=t.x,this.y-=t.y,this.z-=t.z):(this.x-=t,this.y-=e,this.z-=n)}toSub(t){const e=this;return new $t(e.x-t.x,e.y-t.y,e.z-t.z)}mult(t){return t instanceof $t||t instanceof Vt?(this.x*=t.x,this.y*=t.y,this.z*=t.z):(this.x*=t,this.y*=t,this.z*=t),this}toMult(t){const e=this;return new $t(e.x*=t.x,e.y*=t.y,e.z*=t.z)}div(t){return t instanceof $t||t instanceof Vt?(this.x/=t.x,this.y/=t.y,this.z/=t.z):(this.x/=t,this.y/=t,this.z/=t),this}toDiv(t){const e=this.get();return e.x/=t,e.y/=t,e.z/=t,e}dist(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)}toDist(t){const e=this,n=e.x-t.x,r=e.y-t.y,i=e.z-t.z;return Math.sqrt(n*n+r*r+i*i)}dot(t,e,n){return t instanceof $t||t instanceof Vt?this.x*t.x+this.y*t.y+this.z*t.z:this.x*t+this.y*e+this.z*n}cross(t){const e=this.x,n=this.y,r=this.z;return new $t(n*t.z-t.y*r,r*t.x-t.z*e,e*t.y-t.x*n)}normalize(){const t=this.mag();t>0&&this.div(t)}limit(t){this.mag()>t&&(this.normalize(),this.mult(t))}heading2D(){return-Math.atan2(-this.y,this.x)}random2D(){return this.fromAngle(Math.random()*(2*Math.PI))}fromAngle(t,e=1){return new $t(e*Math.cos(t),e*Math.sin(t),0)}fromAngles(t,e,n=1){const r=Math.cos(e),i=Math.sin(e),s=Math.cos(t),o=Math.sin(t);return new $t(n*o*i,-n*s,n*o*r)}array(){return[this.x,this.y,this.z]}toPoint3D(){return new Vt(this.x,this.y,this.z)}toPoint2D(){return new Bt(this.x,this.y)}copy(){return new $t(this.x,this.y,this.z)}toString(){return"["+this.x+", "+this.y+", "+this.z+"]"}}class Vt extends Bt{z;constructor(t,e,n){t instanceof $t?(super(t.x,t.y),this.z=t.z):"object"==typeof t?(super({x:t.x??0,y:t.y??0}),this.z=t.z??0):(super(t,e),this.z=n??0)}copy(){return new Vt(this.x,this.y,this.z)}}class Ht extends $t{volume=0;mass=0;e=0;rotate=0;width=0;height=0;data;transform=[1,0,0,1,0,0];color={r:0,g:0,b:0,a:255};id;constructor(t){super(),this.updateObjWithDefaults(t)}copyObj(){return new Ht({x:this.x,y:this.y,z:this.z,volume:this.volume,mass:this.mass,e:this.e,rotate:this.rotate,width:this.width,height:this.height,transform:[...this.transform],color:{...this.color},data:{...this.data}})}updateObjWithDefaults(t){if(t){this.x=t.x??this.x,this.y=t.y??this.y,this.z=t.z??this.z,this.volume=t.volume??this.volume,this.mass=t.mass??this.mass,this.e=t.e??this.e,this.rotate=t.rotate??this.rotate,this.width=t.width??this.width,this.height=t.height??this.height,this.transform=[...t.transform??this.transform],this.color={...t.color??this.color};const e=t.data??this.data;this.data=e?{...e}:void 0}}setObj(t){if(t){this.x=t.x??0,this.y=t.y??0,this.z=t.z??0,this.volume=t.volume??0,this.mass=t.mass??0,this.e=t.e??0,this.rotate=t.rotate??0,this.width=t.width??0,this.height=t.height??0,this.transform=[...t.transform??[1,0,0,1,0,0]],this.color={...t.color??{r:0,g:0,b:0,a:255}};const e=t.data;this.data=e?{...e}:void 0}}toRect(){return new Yt(this.x,this.y,this.width,this.height)}}var Ft,zt,Ut,Wt,Gt;!function(t){t.getMinByObjectArray=(t,e)=>{let n;if(e&&t&&t.length>0){n=t[0][e];for(let r=1;r<t.length;r++)n=Math.min(n,t[r][e])}return n},t.hypot=(...t)=>Math.hypot(...t),t.pythagorean=(t,e)=>Math.sqrt(t*t+e*e),t.getMaxByObjectArray=(t,e)=>{let n;if(e&&t&&t.length>0){n=t[0][e];for(let r=1;r<t.length;r++)n=Math.max(n,t[r][e])}return n},t.sum=t=>t.reduce((t,e)=>t+e,0),t.avg=e=>e.length>0?t.sum(e)/e.length:0,t.minMax=(t,e)=>Math.min(Math.max(t,e.min),e.max),t.max=t=>t.length>0?Math.max(...t):void 0,t.min=t=>t.length>0?Math.min(...t):void 0,t.getSumByObjectArray=(t,e)=>{let n=0;if(e&&t&&t.length>0)for(let r=0;r<t.length;r++)n+=t[r][e];return n},t.radians=(t,{type:e="degreeAngle"})=>"ratio"===e?2*t*Math.PI:"percent"===e?t/100*2*Math.PI:t/180*Math.PI,t.degrees=(t,{type:e="degreeAngle"})=>"ratio"===e?360*t:"percent"===e?t/100*360:180*t/Math.PI,t.ratio=(t,e,n=1)=>n*(e/t),t.getBetweenLength=(t,e)=>e-t,t.getPercentByTotal=(t,e)=>e/t*100,t.getRatioByTotal=(t,e)=>e/t,t.getValueByTotalInPercent=(t,e)=>t*e/100,t.getValueByTotalInRatio=(t,e)=>t*e,t.getValuePercentUp=(t,e)=>t*(1+e/100),t.getValueRatioUp=(t,e)=>t*(1+e),t.getValuePercentDown=(t,e)=>t*(1-e/100),t.getValueRatioDown=(t,e)=>t*(1-e),t.beziers=(e,n)=>{const r=new Array(n).fill(void 0);for(let i=0;i<r.length;i++)r[i]=t.bezier(e,n,i);return r},t.bezier=(e,n,r)=>{if(e&&e.length>0){const i=e.map(t=>new $t(t.x,t.y,t.z)),s=[];return i.reduce((t,e)=>{const i=t.toSub(e).div(n).mult(r+1);return s.push(t.toSub(i)),e}),s.length<=1?s[0]:t.bezier(s.map(t=>new Vt(t)),n,r)}return new $t},t.cubicBezier=function(e,n,r){if(e.start instanceof Ht&&e.end instanceof Ht){const i=t.cubicBezier({start:e.start.x,end:e.end.x},n,r),s=t.cubicBezier({start:e.start.y,end:e.end.y},n,r),o=t.cubicBezier({start:e.start.z,end:e.end.z},n,r),a=t.cubicBezier({start:e.start.volume,end:e.end.volume},n,r),c=t.cubicBezier({start:e.start.mass,end:e.end.mass},n,r),l=t.cubicBezier({start:e.start.e,end:e.end.e},n,r),h=t.cubicBezier({start:e.start.rotate,end:e.end.rotate},n,r),u=t.cubicBezier({start:e.start.width,end:e.end.width},n,r),d=t.cubicBezier({start:e.start.height,end:e.end.height},n,r),p=t.cubicBezier({start:e.start.transform[0],end:e.end.transform[0]},n,r),f=t.cubicBezier({start:e.start.transform[1],end:e.end.transform[1]},n,r),g=t.cubicBezier({start:e.start.transform[2],end:e.end.transform[2]},n,r),m=t.cubicBezier({start:e.start.transform[3],end:e.end.transform[3]},n,r),y=t.cubicBezier({start:e.start.transform[4],end:e.end.transform[4]},n,r),A=t.cubicBezier({start:e.start.transform[5],end:e.end.transform[5]},n,r),_=t.cubicBezier({start:e.start.color.r??0,end:e.end.color.r??0},n,r),E=t.cubicBezier({start:e.start.color.g??0,end:e.end.color.g??0},n,r),b=t.cubicBezier({start:e.start.color.b??0,end:e.end.color.b??0},n,r),T=t.cubicBezier({start:e.start.color.a??255,end:e.end.color.a??255},n,r);return i.map((t,e)=>{const n=new Ht({x:t,y:s[e],z:o[e]});return n.volume=a[e],n.mass=c[e],n.e=l[e],n.rotate=h[e],n.width=u[e],n.height=d[e],n.transform=[p[e],f[e],g[e],m[e],y[e],A[e]],n.color={r:_[e],g:E[e],b:b[e],a:T[e]},n})}if(e.start instanceof Vt&&e.end instanceof Vt){const i=t.cubicBezier({start:e.start.x,end:e.end.x},n,r),s=t.cubicBezier({start:e.start.y,end:e.end.y},n,r),o=t.cubicBezier({start:e.start.z,end:e.end.z},n,r);return i.map((t,e)=>new Vt(t,s[e],o[e]))}const{start:i,end:s}=e,{frame:o}=n;let{p1x:a,p1y:c,p2x:l,p2y:h}=Array.isArray(r)?{p1x:r[0],p1y:r[1],p2x:r[2],p2y:r[3]}:r;a="random"===a?Math.random():a,c="random"===c?Math.random():c,l="random"===l?Math.random():l,h="random"===h?Math.random():h;const u=[],d=s-i,p=t=>{const e=Number(t*t),n=Number(e*t),r=Number(1-t),i=Number(r*r);return 0*Number(i*r)+3*i*t*Number(c)+3*r*e*Number(h)+1*n},f=o+1;for(let t=1;t<f;t++){const e=i+d*p(t/f);u.push(e)}return u},t.diff=(t,e)=>Math.abs(t-e),t.distSqToLineSegment=(t,e,n)=>{const r=(e.x-n.x)**2+(e.y-n.y)**2;if(0===r)return(t.x-e.x)**2+(t.y-e.y)**2;let i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;i=Math.max(0,Math.min(1,i));const s=e.x+i*(n.x-e.x),o=e.y+i*(n.y-e.y);return(t.x-s)**2+(t.y-o)**2},t.rotatePoint=(t,e,n)=>{const r=t.x-e.x,i=t.y-e.y,s=r*Math.cos(n)-i*Math.sin(n),o=r*Math.sin(n)+i*Math.cos(n);return new Bt(s+e.x,o+e.y)}}(Ft||(Ft={}));class Yt{_start;_width;_height;linkRects;constructor(t,e,n=0,r=0){var i;(i=t)&&"number"==typeof i.width&&"number"==typeof i.height?(this._start=new Bt(0,0),this._width=t.width,this._height=t.height):"object"==typeof t&&"object"==typeof e?(this._start=t instanceof Bt?t:new Bt(t.x,t.y),this.end=e instanceof Bt?e:new Bt(e.x,e.y)):"object"==typeof t&&"number"==typeof e?(this._start=t instanceof Bt?t:new Bt(t.x,t.y),this._width=e,this._height=n):"number"==typeof t&&"number"==typeof e&&(this._start=new Bt(t,e),this._width=n,this._height=r)}valueLinkControl(t){let e,n=!1;var r;return"object"==typeof(r=t)&&"value"in r&&"noLink"in r?(e=t.value,n=t.noLink):e=t,{value:e,noLink:n}}get width(){return this._width}get height(){return this._height}get start(){return this._start.copy()}set width(t){this.setWidth(t)}setWidth(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=Ft.getPercentByTotal(this._width,e);this._width=e,this.applyWidthPercentLinks({value:r,noLink:n})}set height(t){this.setHeight(t)}setHeight(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=Ft.getPercentByTotal(this._height,e);this._height=e,this.applyHeightPercentLinks({value:r,noLink:n})}set start(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=new Bt({x:Ft.getPercentByTotal(this._start.x,e.x),y:Ft.getPercentByTotal(this._start.y,e.y)});this._start=e,this.applyStartPercentLinks({value:r,noLink:n})}setWidthFromEnd(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=Ft.getPercentByTotal(this.start.x,e);this._start.x=this.end.x-e,this.applyStartXPercentLinks({value:r,noLink:n})}set widthFromEnd(t){this.setWidthFromEnd(t)}setHeightFromEnd(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.end.y-e,i=Ft.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks({value:i,noLink:n})}set heightFromEnd(t){this.setHeightFromEnd(t)}setWidthFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.x-e/2,i=Ft.getPercentByTotal(this.start.x,r);this._start.x=r,this.applyStartXPercentLinks(i)}set widthFromCenter(t){this.setWidthFromCenter(t)}setHeightFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.y-e/2,i=Ft.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks(i)}set heightFromCenter(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=this.center.y-e/2,i=Ft.getPercentByTotal(this.start.y,r);this._start.y=r,this.applyStartYPercentLinks(i)}set x(t){this.setX(t)}setX(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=e-this._start.x,i=Ft.getPercentByTotal(this.width,r);this._start.x=e,this.applyStartXPercentLinks({value:i,noLink:n})}set y(t){this.setY(t)}setY(t){let{value:e,noLink:n}=this.valueLinkControl(t);const r=e-this._start.y,i=Ft.getPercentByTotal(this.height,r);this._start.y=e,this.applyStartYPercentLinks({value:i,noLink:n})}applyWidthPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.setWidthByWidthPercent({value:e,noLink:this})})}applyHeightPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.setHeightByHeightPercent({value:e,noLink:this})})}applyStartPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.applyStartXPercentLinks({value:e.x,noLink:n}),this.applyStartYPercentLinks({value:e.y,noLink:n})}applyStartXPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.addXByWidthPercent({value:e,noLink:this})})}applyStartYPercentLinks(t){let{value:e,noLink:n}=this.valueLinkControl(t);!this.linkRects||"boolean"==typeof n&&n||Array.from(this.linkRects.values()).filter(t=>"boolean"==typeof n||t!==n).forEach(t=>{t.addYByHeightPercent({value:e,noLink:this})})}hasLink(t){return this.linkRects?.has(t)}isLinked(){return!!this.linkRects?.size}addLink(...t){this.linkRects??=new Set,t.filter(t=>!this.linkRects?.has(t)).forEach(t=>{this.linkRects?.add(t),t.addLink(this)})}setLinks(t){this.unLinkAll(),this.addLink(...t)}unLinkAll(){this.linkRects&&(Array.from(this.linkRects.values()).forEach(t=>{this.unLink(t)}),this.linkRects.clear())}unLink(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.linkRects&&this.linkRects.delete(e),n||e.unLink({value:this,noLink:this})}addWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:this.width+Ft.getValueByTotalInPercent(this.width,e),noLink:n})}addHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:this.height+Ft.getValueByTotalInPercent(this.height,e),noLink:n})}addWidthRatio(t){this.width=this.width+Ft.getValueByTotalInRatio(this.width,t)}addHeightRatio(t){this.height=this.height+Ft.getValueByTotalInRatio(this.height,t)}addXPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+Ft.getValueByTotalInPercent(this.width,e),noLink:n})}addYPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+Ft.getValueByTotalInPercent(this.height,e),noLink:n})}addXRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+Ft.getValueByTotalInRatio(this.width,e),noLink:n})}addYRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+Ft.getValueByTotalInRatio(this.height,e),noLink:n})}set endX(t){const e=t-this.x;this.width=e}set endXPercent(t){this.endX=Ft.getValueByTotalInPercent(this.width,t)}set endYPercent(t){this.endY=Ft.getValueByTotalInPercent(this.height,t)}set endY(t){this.height=t-this.y}set end(t){this.width=t.x-this.x,this.height=t.y-this.y}get x(){return this.start.x}get y(){return this.start.y}get endX(){return this.end.x}get endY(){return this.end.y}to(t){const e=this.copy();return e.start=t,e}toRotate(t,{rotatePoint:e=this.center,type:n="degreeAngle"}){const r=Ft.radians(t,{type:n}),i=e instanceof Bt?e:new Bt(e.x,e.y);return[this.leftTop,this.rightTop,this.rightBottom,this.leftBottom].map(t=>Ft.rotatePoint(t,i,r))}get center(){return new Bt(this.start.x+this.width/2,this.start.y+this.height/2)}get end(){return new Bt(this.start.x+this.width,this.start.y+this.height)}get leftTop(){return this.start.copy()}get leftBottom(){return new Bt(this.start.x,this.end.y)}get rightTop(){return new Bt(this.end.x,this.start.y)}get rightBottom(){return this.end}copy(){return new Yt(this.x,this.y,this.width,this.height)}getWidthPercent(t){return Ft.getPercentByTotal(this.width,t)}getWidthRatio(t){return Ft.getRatioByTotal(this.width,t)}getWidthByPercent(t){return Ft.getValueByTotalInPercent(this.width,t)}getWidthByRatio(t){return Ft.getValueByTotalInRatio(this.width,t)}getHeightPercent(t){return Ft.getPercentByTotal(this.height,t)}getHeightRatio(t){return Ft.getRatioByTotal(this.height,t)}getHeightByPercent(t){return Ft.getValueByTotalInPercent(this.height,t)}getHeightByRatio(t){return Ft.getValueByTotalInRatio(this.height,t)}getXPercent(t){return Ft.getPercentByTotal(this.width,t-this.x)}getXRatio(t){return Ft.getRatioByTotal(this.width,t-this.x)}getXByPercent(t){return this.x+Ft.getValueByTotalInPercent(this.width,t)}getXByRatio(t){return this.x+Ft.getValueByTotalInRatio(this.width,t)}getYPercent(t){return Ft.getPercentByTotal(this.height,t-this.y)}getYRatio(t){return Ft.getRatioByTotal(this.height,t-this.y)}getYByPercent(t){return this.y+Ft.getValueByTotalInPercent(this.height,t)}getYByRatio(t){return this.y+Ft.getValueByTotalInRatio(this.height,t)}getPercent(t){return new Bt(this.getXPercent(t.x),this.getYPercent(t.y))}toScaleByWidth(t){const e=this.height/this.width;return new Yt(this.x,this.y,t,t*e)}toScaleByHeight(t){const e=this.width/this.height;return new Yt(this.x,this.y,t*e,t)}toRatio(t){return new Yt(this.getXRatio(t.x),this.getYRatio(t.y),this.getWidthRatio(t instanceof Yt?t.width:t.w),this.getHeightRatio(t instanceof Yt?t.height:t.h))}getRatio(t){return new Bt(this.getXRatio(t.x),this.getYRatio(t.y))}getByPercent(t){return new Bt(this.getXByPercent(t.x),this.getYByPercent(t.y))}getByRatio(t){return new Bt(this.getXByRatio(t.x),this.getYByRatio(t.y))}getDiffX(t){return t-this.x}getDiffY(t){return t-this.y}getDiffLeft(t){this.getDiffX(t)}getDiffTop(t){this.getDiffY(t)}getDiffRight(t){return t-this.end.x}getDiffBottom(t){return t-this.end.y}getDiffWidth(t){return t-this.width}getDiffHeight(t){return t-this.height}toDiff(t){return new Yt(t.x-this.x,t.y-this.y,t.width-this.width,t.height-this.height)}setXByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:Ft.getValueByTotalInPercent(this.width,e),noLink:n})}set xByWidthPercent(t){this.setXByWidthPercent(t)}setXByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:Ft.getValueByTotalInRatio(this.width,e),noLink:n})}set xByWidthRatio(t){this.setXByWidthRatio(t)}setYByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:Ft.getValueByTotalInPercent(this.height,e),noLink:n})}set yByHeightPercent(t){this.setYByHeightPercent(t)}setYByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:Ft.getValueByTotalInRatio(this.height,e),noLink:n})}set yByHeightRatio(t){this.setYByHeightRatio(t)}addXByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+Ft.getValueByTotalInPercent(this.width,e),noLink:n})}addXByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setX({value:this.x+Ft.getValueByTotalInRatio(this.width,e),noLink:n})}addYByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+Ft.getValueByTotalInPercent(this.height,e),noLink:n})}addYByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setY({value:this.y+Ft.getValueByTotalInRatio(this.height,e),noLink:n})}setWidthByWidthPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:Ft.getValueByTotalInPercent(this.width,e),noLink:n})}set widthByWidthPercent(t){this.setWidthByWidthPercent(t)}setWidthByWidthRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setWidth({value:Ft.getValueByTotalInRatio(this.width,e),noLink:n})}set widthByWidthRatio(t){this.setWidthByWidthRatio(t)}setHeightByHeightPercent(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:Ft.getValueByTotalInPercent(this.height,e),noLink:n})}set heightByHeightPercent(t){this.setHeightByHeightPercent(t)}setHeightByHeightRatio(t){let{value:e,noLink:n}=this.valueLinkControl(t);this.setHeight({value:Ft.getValueByTotalInRatio(this.height,e),noLink:n})}set heightByHeightRatio(t){this.setHeightByHeightRatio(t)}copyByPercent(t,e){return new Yt(this.x,this.y,Ft.getValueByTotalInPercent(this.width,t),Ft.getValueByTotalInPercent(this.height,e??t))}copyByRatio(t,e){return new Yt(this.x,this.y,Ft.getValueByTotalInRatio(this.width,t),Ft.getValueByTotalInRatio(this.height,e??t))}isIn(t){return t instanceof Yt?this.isIn(t.start)&&this.isIn(t.end):t.x>=this.start.x&&t.x<=this.end.x&&t.y>=this.start.y&&t.y<=this.end.y}isOut(t){return t instanceof Yt?!this.isOverlap(t):!this.isIn(t)}isOverlap(t){return t instanceof Yt?!(this.endX<t.x||this.x>t.endX||this.endY<t.y||this.y>t.endY):this.isIn(t)}toString(){return`x:${this.x}, y:${this.y}, width: ${this.width}, height: ${this.height}`}}!function(e){e.objToGetURL=t=>Object.keys(t).reduce((e,n,r)=>`${e}${0!==r?"&":""}${n}=${t[n]}`,""),e.mapToJson=t=>JSON.stringify(Array.from(t.entries()).reduce((t,[e,n])=>(t[e]=n,t),{})),e.jsonToMap=t=>new Map(JSON.parse(t)),e.decodeURIString=t=>decodeURIComponent(t),e.objToStrMap=t=>{const e=new Map;for(const n of Object.keys(t))e.set(n,t[n]);return e},e.jsonToStrMap=t=>e.objToStrMap(JSON.parse(t)),e.strToObject=t=>JSON.parse(t),e.objToJson=t=>JSON.stringify(t),e.objToMap=t=>{const e=new Map;return Object.keys(t).forEach(n=>{e.set(n,t[n])}),e},e.mapToObj=t=>{const e={};return t.forEach((t,n)=>{e[n]=t}),e},e.snakeToCamelCase=t=>t.replace(/_([a-z])/g,(t,e)=>e.toUpperCase()),e.camelToSnakeCase=t=>t.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),e.toFormData=function(t){const e=new FormData;for(const n in t)e.append(n,t[n]);return e},e.toObject=function(n,r){if(n instanceof URLSearchParams){const t={};return n.forEach((e,n)=>{r?.firstValue&&void 0===t[n]?t[n]=e:r?.firstValue||(t[n]?Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]:t[n]=e)}),t}if(n instanceof FormData){const t=t=>{const e={};for(const n of t.keys()){const r=t.getAll(n);e[n]=r.length>1?r:r[0]}return e};return t(n)}if(n&&"function"==typeof n[Symbol.iterator])return Object.fromEntries(n);if(Array.isArray(n))return Object.fromEntries(n);if(t.isMap(n)){const t=n;n=e.mapToObj(t)}if(t.isArray(n)){const t=n;for(let n=0;n<t.length;n++)t[n]=e.toObject(t[n])}if(t.isObject(n))for(const t in n)n[t]=e.toObject(n[t]);return n},e.toArray=t=>t instanceof Set?Array.from(t.values()):Array.isArray(t)?t:t?[t]:[],e.flatArray=(...t)=>t.flatMap(t=>t instanceof Object&&Symbol.iterator in t?Array.from(t):[t]),e.iteratorToArray=t=>Array.from(t),e.toJson=t=>{const n=e.toObject(t);return JSON.stringify(n)},e.concatenateToAttribute=t=>e.concatenateToString(t,"="," ","'"),e.concatenateToParameter=t=>e.concatenateToString(t,"=","&",""),e.concatenateToString=(t,e="=",n=" ",r="")=>{const i=[];for(const n in t){const s=t[n];s&&i.push(n.toString()+e+r+s+r)}return i.join(n)},e.specialCharsToEscape=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e.decodeHTMLEscape=t=>t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x2F;/g,"/"),e.copyObject=(t,e={})=>({...t,...e}),e.copyArrayWithAddition=(t,e)=>[...t,...e||[]],e.hexToInt=t=>(t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t.split("").map(t=>t+t).join("")),parseInt(t,16)),e.toHex=t=>(t<0&&(t=4294967295+t+1),(t=Number(t.toFixed(0))).toString(16).padStart(2,"0").toUpperCase()),e.toHexColor=t=>`#${e.toHex(t.r??0)}${e.toHex(t.g??0)}${e.toHex(t.b??0)}${e.toHex(t.a??255)}`,e.avgColor=t=>{const e=t.reduce((t,e)=>(t.r+=e.r??0,t.g+=e.g??0,t.b+=e.b??0,t.a+=e.a??0,t),{r:0,g:0,b:0,a:0});return{r:Math.floor(e.r/t.length),g:Math.floor(e.g/t.length),b:Math.floor(e.b/t.length),a:Math.floor(e.a/t.length)}},e.toRGBA=t=>{t??="#000000FF";const e=t.replace("#","");return{r:parseInt(e.slice(0,2)||"0",16),g:parseInt(e.slice(2,4)||"0",16),b:parseInt(e.slice(4,6)||"0",16),a:e.length>6?parseInt(e.slice(6,8)||"0",16):255}},e.minMaxCenterAvg=t=>{const e={},n=It.uniqueKeys(t);for(const r of n){const n=t.map(t=>t[r]),i=Math.min(...n),s=Math.max(...n),o=(i+s)/2,a=n.reduce((t,e)=>t+e,0)/n.length;e[r]={min:i,max:s,center:o,avg:a,diff:s-i}}return e},e.minMaxCenterRectAvg2D=t=>{const e=new Bt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),n=new Bt(Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);let r=new Bt(0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),n.x=Math.max(n.x,t.x),n.y=Math.max(n.y,t.y),r.x+=t.x,r.y+=t.y});const i=new Bt((e.x+n.x)/2,(e.y+n.y)/2),s=new Bt(r.x/t.length,r.y/t.length),o=new Yt(e.x,e.y,n.x-e.x,n.y-e.y);return{min:e,max:n,center:i,avg:s,minMaxRect:o}},e.minMaxCenterAvg3D=t=>{const e=new Vt(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),n=new Vt(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);let r=new Vt(0,0,0);t.forEach(t=>{e.x=Math.min(e.x,t.x),e.y=Math.min(e.y,t.y),e.z=Math.max(e.z,t.z),n.x=Math.max(n.x,t.x),n.y=Math.max(n.y,t.y),n.z=Math.max(n.z,t.y),r.x+=t.x,r.y+=t.y,r.z+=t.z});const i=new Vt((e.x+n.x)/2,(e.y+n.y)/2,(e.z+n.z)/2),s=new Vt(r.x/t.length,r.y/t.length,r.z/t.length);return{min:e,max:n,center:i,avg:s}},e.roundRectRadiiToFullRadii=t=>t?1===t.length?[t[0]??0,t[0]??0,t[0]??0,t[0]??0]:2===t.length?[t[0]??0,t[1]??0,t[0]??0,t[1]??0]:3===t.length?[t[0]??0,t[1]??0,t[2]??0,t[1]??0]:t:[0,0,0,0],e.toArrayDirectionChange=t=>{if(!t||0===t.length||!t[0]||0===t[0].length)return[];const e=[],n=t[0].length,r=t.length;for(let i=0;i<n;i++){const n=[];for(let e=0;e<r;e++)n.push(t[e][i]);e.push(n)}return e},e.groupByMap=(t,e)=>t.reduce((t,n)=>{const r=e(n),i=t.get(r)||[];return i.push(n),t.set(r,i),t},new Map),e.groupByObject=(t,n)=>{const r=e.groupByMap(t,n);return Object.fromEntries(r)},e.toURLSearchParams=t=>{const e=new URLSearchParams;if("string"==typeof t)new URLSearchParams(t).forEach((t,n)=>{e.append(n,t)});else if("object"==typeof t){const n=t instanceof URLSearchParams?t.entries():Array.isArray(t)?t:Object.entries(t);for(const[t,r]of Array.from(n))Array.isArray(r)?r.forEach(n=>e.append(t,n)):e.append(t,r)}return e},e.stringJsonToKeyPairs=t=>Array.from(t.matchAll(/(\w+):\s*([^,}]+)/g)).map(t=>({key:t[1],value:t[2]}))}(zt||(zt={})),function(t){let e,r;t.bindExpression=(t,e)=>(t??"").replace(/\$\{([\s\S.]*?)\}/g,(t,n)=>{const[r,i]=n.split(":"),s=e[r];return s?"function"==typeof s?s(e[i]):s:""}),function(t){t.isExpression=t=>/[$#]\{([\s\S.]*?)\}[$#]/g.test(t??""),t.expressionGroups=t=>n.regexExec(/[$#]\{([\s\S.]*?)\}[$#]/g,t??"")}(e=t.Group||(t.Group={})),function(t){t.pathNameData=(t,e)=>{const n=t.split("/"),r=e.split("/");if(n.length!==r.length)return;const i={};for(let t=0;t<r.length;t++){const e=r[t],s=n[t],o=/^\{(.+)\}$/g.exec(e);if(!o){if(e!==s)return;continue}const[a,c]=o[1].split(":");if(c&&!new RegExp(c).test(s))return;i[a]=s}return i}}(r=t.Path||(t.Path={}))}(Ut||(Ut={}));class Kt{behaviorSubject;_config;get observable(){return this.behaviorSubject.asObservable()}get searchParamObject(){return zt.toObject(this.getSearchParams())}get config(){return this._config}constructor(t){this._config=t,this.behaviorSubject=new xt(this.getRouteData()),this.config.window.addEventListener("popstate",t=>{if(e=t.state,"domRenderRouter"!==e?.currentTargetName){const t=this.getRouteData();this.behaviorSubject.next(t)}var e})}getSearchFirstParamsObject(t){const e=zt.toObject(this.getSearchParams(),{firstValue:!0});return Object.assign({},t,e)}getHashSearchFirstParamsObject(){return zt.toObject(this.getHashSearchParams(),{firstValue:!0})}async attach(){const t=(t=>{if(kt(t))return t._domRender_proxy})(this.config.rootObject);if(t){const e=`___${R.ROUTER_VARNAME}`;await t.render(e)}}testRegexp(t){return RegExp(t).test(this.getPathName())}test(t){return!!this.getPathData(t)}getRouteData(t){const e={path:this.getPathName(),url:this.getUrl(),searchParams:this.getSearchParams()},n=this.getData();if(n&&(e.data=n),t?.urlExpression){const n=this.getPathData(t.urlExpression);n&&(e.pathData=n)}return e.router=this,e.currentTarget=t?.currentTarget,Object.freeze(e)}pushState(t,e,n){return this.config.window.history.pushState(t,e??"",n),this.behaviorSubject.next(this.getRouteData({currentTarget:{currentTargetName:"domRenderRouter"}})),{data:t}}replaceState(t,e,n){return this.config.window.history.replaceState(t,e??"",n),this.behaviorSubject.next(this.getRouteData({currentTarget:{currentTargetName:"domRenderRouter"}})),{data:t}}dispatchPopStateEvent(t){this.config.window.dispatchEvent(new PopStateEvent("popstate",{state:{...t,currentTargetName:"domRenderRouter"}}))}reload(t){this.config.window.dispatchEvent(new PopStateEvent("popstate",{state:t}))}getData(){return this.config.window.history.state}getPathData(t,e=this.getPathName()){return Ut.Path.pathNameData(e,t)}async go(t){"string"==typeof t&&(t={path:t}),t?.replace?this.replace(t.path,t.data,t.title):this.push(t.path,t.data,t.title),this.config.disableAttach||await this.attach(),t.disabledPopEvent||this.dispatchPopStateEvent(t?.data)}toUrl(t){let e;if("string"==typeof t)e=t;else{const n=t.path??this.getPathName(),r=t.searchParams?zt.toURLSearchParams(t.searchParams).toString():"";e=`${n}${r.length>0?"?":""}${r}`}return e}}class Xt extends Kt{constructor(t){super(t)}getSearchParams(t){const e=new URL(this.config.window.document.location.href).searchParams;return t?.delete?.forEach(t=>{e.delete(t)}),t?.append?.forEach(t=>{e.append(t[0],t[1])}),e}push(t,e,n=""){return super.pushState(e,n,this.toUrl(t))}replace(t,e,n=""){return super.replaceState(e,n,this.toUrl(t))}pushDeleteSearchParam(t,e,n){const r=this.getSearchParams({delete:[t]});this.push({searchParams:r},e,n)}pushDeleteHashSearchParam(t,e,n){const r=this.getHashSearchParams({delete:[t]}),i=Array.from(r.entries()).length,s=`${this.config.window.location.pathname}${this.config.window.location.search}${i>0?"#"+r.toString():""}`;super.pushState(e,n,s)}pushAddSearchParam(t,e,n){const r=this.getSearchParams({append:t});this.push({searchParams:r},e,n)}replaceDeleteSearchParam(t,e,n){const r=this.getSearchParams({delete:Array.isArray(t)?t:[t]});this.replace({searchParams:r},e,n)}replaceDeleteHashSearchParam(t,e,n){const r=this.getHashSearchParams({delete:Array.isArray(t)?t:[t]}),i=Array.from(r.entries()).length,s=`${this.config.window.location.pathname}${this.config.window.location.search}${i>0?"#"+r.toString():""}`;super.replaceState(e,n,s)}replaceAddSearchParam(t,e,n){const r=this.getSearchParams({append:t});this.replace({searchParams:r},e,n)}getUrl(){const t=new URL(this.config.window.document.location.href);return t.pathname+t.search}getHref(){return this.config.window.location.href}getPathName(){return this.config.window.location.pathname}getHashSearchParams(t){const e=new URLSearchParams(this.config.window.location.hash.slice(1));return t?.delete?.forEach(t=>{e.delete(t)}),t?.append?.forEach(t=>{e.append(t[0],t[1])}),e}}class qt{static hash(t){return t.location.hash.replace("#","")}static hashPath(t){return t.location.hash.replace("#","").split("?")[0]}static hashSearch(t){return t.location.hash.replace("#","").split("?")[1]}static hashQueryParams(t){const e=t.location.hash.replace("#","").split("?")[1]||"";return this.queryStringToMap(e)}static path(t){return t.location.pathname}static pathQueryParamsObject(t){return this.queryStringToObject(t.location.search.substring(1))}static hashQueryParamsObject(t){const e=t.location.hash.split("?").pop()??"";return e.startsWith("#")?{}:this.queryStringToObject(e)}static pathQueryParams(t){return this.queryStringToMap(t.location.search.substring(1))}static queryStringToMap(t){const e=new Map;return(t.split("&")||[]).forEach(t=>{const n=t.split("=")||[];n[0]&&n[0].length>0&&e.set(n[0],n[1])}),e}static queryStringToObject(t){const e={};return(t.split("&")||[]).forEach(t=>{const n=t.split("=")||[];n[0]&&n[0].length>0&&(e[n[0]]=n[1])}),e}}class Jt extends Kt{constructor(t){super(t)}getSearchParams(t){const e=qt.hashSearch(this.config.window),n=e?new URLSearchParams(e):new URL(this.config.window.document.location.href).searchParams;return t?.delete?.forEach(t=>{n.delete(t)}),t?.append?.forEach(t=>{n.append(t[0],t[1])}),n}push(t,e,n=""){return"/"===t?super.pushState(e,n,"/"):super.pushState(e,n,`#${this.toUrl(t)}`)}replace(t,e,n){return"/"===t?super.replaceState(e,n,"/"):super.replaceState(e,n,`#${this.toUrl(t)}`)}setDeleteHashSearchParam(t,e,n){}pushDeleteHashSearchParam(t,e,n){const r=this.getHashSearchParams({delete:Array.isArray(t)?t:[t]}),i=Array.from(r.entries()).length,s=`${this.config.window.location.pathname}${this.config.window.location.search}${i>0?"#"+r.toString():""}`;super.pushState(e,n,s)}pushDeleteSearchParam(t,e,n){const r=this.getSearchParams({delete:Array.isArray(t)?t:[t]});this.push({searchParams:r},e,n)}pushAddSearchParam(t,e,n){const r=this.getSearchParams({append:t});this.push({searchParams:r},e,n)}replaceDeleteHashSearchParam(t,e,n){const r=this.getHashSearchParams({delete:Array.isArray(t)?t:[t]}),i=Array.from(r.entries()).length,s=`${this.config.window.location.pathname}${this.config.window.location.search}${i>0?"#"+r.toString():""}`;super.pushState(e,n,s)}replaceDeleteSearchParam(t,e,n){const r=this.getSearchParams({delete:Array.isArray(t)?t:[t]});this.push({searchParams:r},e,n)}replaceAddSearchParam(t,e,n){const r=this.getSearchParams({append:t});this.push({searchParams:r},e,n)}getUrl(){return qt.hash(this.config.window)||"/"}getHref(){return this.config.window.location.href}getPathName(){return qt.hashPath(this.config.window)||"/"}getHashSearchParams(t){const e=this.config.window.location.hash,n=e.indexOf("?"),r=-1!==n?new URLSearchParams(e.slice(n+1)):new URLSearchParams;return t?.delete?.forEach(t=>{r.delete(t)}),t?.append?.forEach(t=>{r.append(t[0],t[1])}),r}}!function(t){t[t.FILTER=0]="FILTER",t[t.MAP=1]="MAP",t[t.SUBSCRIBE=2]="SUBSCRIBE"}(Wt||(Wt={}));class Zt{channel;subscriber;constructor(t,e){this.channel=t,this.subscriber=e}unsubscribe(){this.subscriber.unsubscribe()}}class Qt{channel;parentSubscriber;callbacks=[];constructor(t){this.channel=t}exeCallback(t,e){for(const n of this.callbacks){if(n.type===Wt.FILTER&&!n.callback(t,e))break;if(n.type===Wt.MAP)t=n.callback(t,e);else if(n.type===Wt.SUBSCRIBE){t=n.callback(t,e);break}}return t}filter(t){return this.callbacks.push({type:Wt.FILTER,callback:t}),this}map(t){return this.callbacks.push({type:Wt.MAP,callback:t}),this}subscribe(t){return this.callbacks.push({type:Wt.SUBSCRIBE,callback:t}),this.channel.subscribers.add(this),new Zt(this.channel,this)}unsubscribe(){this.channel.subscribers.delete(this)}deleteSubscriber(){this.unsubscribe(),this.channel.subscribers.delete(this)}}class te{messenger;obj;key;subscribers=new Set;constructor(t,e,n){this.messenger=t,this.obj=e,this.key=n}publish(t,e,n){const r=[];return this.messenger.getChannels(t)?.forEach(t=>{try{t.subscribers.forEach(i=>{const s=i.exeCallback(e,{channel:this,action:n});r.push({channel:t,data:s})})}catch(t){console.error(t)}}),r}allPublish(t,e){const n=[];return this.messenger.getAllChannelKeys().forEach(e=>{n.push(this.publish(e,t))}),n.flat()}filter(t){const e=new Qt(this);return e.filter(t),e}map(t){const e=new Qt(this);return e.map(t),e}subscribe(t){return new Qt(this).subscribe(t)}deleteChannel(){this.messenger.deleteChannel(this)}}class ee{config;channels=new Set;static EVENT_PUBLISH_KEY="domRenderMessenger_publish";static EVENT_SUBSCRIBE_KEY="domRenderMessenger_subscribe";constructor(t){this.config=t,this.config.window.addEventListener(ee.EVENT_PUBLISH_KEY,t=>{const e=t.detail,n=[];this.getChannels(e.key)?.forEach(t=>{try{t.subscribers.forEach(r=>{const i=r.exeCallback(e.data,{action:e.action});n.push({channel:t,data:i})})}catch(t){console.error(t)}}),e.result?.(n)}),this.config.window.addEventListener(ee.EVENT_SUBSCRIBE_KEY,t=>{const e=t.detail,n=this.createChannel(e.obj,e.key);e.init(n,n.subscribe(e.subscribe))})}static publish(t,e){t.dispatchEvent(new CustomEvent(ee.EVENT_PUBLISH_KEY,{detail:e}))}static subscribe(t,e){t.dispatchEvent(new CustomEvent(ee.EVENT_SUBSCRIBE_KEY,{detail:e}))}createChannel(t,e=t.constructor.name){const n=J.final(new te(this,t,e));return this.channels.add(n),n}deleteChannel(t){this.channels.delete(t)}deleteChannelFromObj(t){t&&this.channels.forEach(e=>{e.obj===t&&this.deleteChannel(e)})}addChannel(t){this.channels.add(t)}getChannels(t){return"object"==typeof t?t=t.constructor.name:"function"==typeof t&&(t=t.name),Array.from(this.channels.values()).filter(e=>e.key===t)}getAllChannels(){return Array.from(this.channels.values())}getAllChannelKeys(){return Array.from(this.channels.values()).map(t=>t.key)}}class ne extends ee{}!function(t){t.getParameterTypes=(t,e)=>e?Reflect.getMetadata("design:paramtypes",t,e)||[]:Reflect.getMetadata("design:paramtypes",t)||[],t.getReturnType=(t,e)=>Reflect.getMetadata("design:returntype",t,e),t.getType=(t,e)=>e?Reflect.getMetadata("design:type",t,e):Reflect.getMetadata("design:type",t),t.getMetadata=(t,e,n)=>n?Reflect.getMetadata(t,e,n):Reflect.getMetadata(t,e),t.getMetadataKeys=t=>Reflect.getMetadataKeys(t),t.getOwnMetadata=(t,e,n)=>n?Reflect.getOwnMetadata(t,e,n):Reflect.getOwnMetadata(t,e),t.getMetadatas=e=>t.getMetadataKeys(e).map(n=>t.getMetadata(n,e)),t.metadata=(t,e)=>Reflect.metadata(t,e),t.defineMetadata=(t,e,n,r)=>{r&&Reflect.defineMetadata?Reflect.defineMetadata(t,e,n,r):Reflect.defineMetadata&&Reflect.defineMetadata(t,e,n)}}(Gt||(Gt={}));var re=function(t,e,n,r){var i,s=arguments.length,o=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ie=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const se=Symbol("attribute"),oe=Symbol("query"),ae=Symbol("event");function ce(t){return(e,n,r)=>{const i=Gt.getMetadata(se,e.constructor)||[];i.push({propertyKey:n,name:t?.name||n,converter:t?.converter,isMethod:!!r}),Gt.defineMetadata(se,i,e.constructor)}}function le(t){return(e,n,r)=>{const i=Gt.getMetadata(oe,e.constructor)||[];i.push({selector:t,propertyKey:n,isMethod:!!r}),Gt.defineMetadata(oe,i,e.constructor)}}function he(t){return(e,n,r)=>{const i=Gt.getMetadata(ae,e.constructor)||[];i.push({query:t.query,eventName:t.name,methodName:n}),Gt.defineMetadata(ae,i,e.constructor)}}class ue{_config;_rawSet;_children=[];_render;_attribute;_boundEventListeners=[];get componentConfig(){return this._config}get render(){return this._render}get rawSet(){return this._rawSet}_queryElements(t,e){const n=this.getElement();if(n)return i.querySelectorAll(n,t);{let n=e.point?.start,r=e.point?.end;if(e.point?.start&&n&&!n.isConnected&&n instanceof HTMLElement&&n.hasAttribute("id")&&(e.point.start=n=e.dataSet.config.window.document.querySelector("#"+n.id)),e.point?.end&&r&&!r.isConnected&&r instanceof HTMLElement&&r.hasAttribute("id")&&(e.point.end=r=e.dataSet.config.window.document.querySelector("#"+r.id)),n&&r)return i.querySelectorAll({start:n,end:r},t)}return[]}_cleanupEventListeners(){for(const{element:t,eventName:e,listener:n}of this._boundEventListeners)t.removeEventListener(e,n);this._boundEventListeners=[]}getAttribute(t,e=this._attribute){const n=e;if(!n)return null;const r=String(t);let i=r;return i in n?n[i]:(i=zt.snakeToCamelCase(r),i in n?n[i]:(i=zt.camelToSnakeCase(r),i in n?n[i]:(i=r.toUpperCase(),i in n?n[i]:(i=r.toLowerCase(),i in n?n[i]:null))))}hasAttribute(t){return null!==this.getAttribute(t)}equalsAttributeName(t,e){return t===e||zt.snakeToCamelCase(t)===e||zt.camelToSnakeCase(t)===e||t.toUpperCase()===e.toUpperCase()||t.toLowerCase()===e.toLowerCase()}get uuid(){return this._rawSet?.uuid}get children(){return this._children}getElement(){return(this.render??this.rawSet?.dataSet?.render)?.getElement?.()}getFirstChild(t){return this._children.find(e=>e instanceof t)}getParentThis(){return this.render?.parentThis}getChildren(t){const e=Array.isArray(t)?t:[t];return this._children.filter(t=>e.some(e=>t instanceof e))}constructor(t){this._config=t}setRawSet(t){this._rawSet=t,this._rawSet&&this.setAttribute(this._rawSet.dataSet?.render?.attribute)}setAttribute(t){this._attribute=t}onCreatedThisChild(t,e){this._children.push(t)}onCreateRenderData(t){if(this._render=t.render,t.render?.rawSet&&this.setRawSet(t.render.rawSet),this._config?.onlyParentType&&!(Array.isArray(this._config?.onlyParentType)?this._config?.onlyParentType:[this._config?.onlyParentType].some(e=>t.render?.parentThis instanceof e)))throw new Error("only my parentThis "+this._config?.onlyParentType)}onChangeAttrRender(t,e,n){n.rawSet&&this.setRawSet(n.rawSet);const r=Gt.getMetadata(se,this.constructor);if(r&&Array.isArray(r))for(const n of r)if(this.equalsAttributeName(t,n.name)){const t=n.converter?n.converter(e):e;if(n.isMethod){const e=this[n.propertyKey];"function"==typeof e&&e.call(this,t)}else this[n.propertyKey]=t}}onInitRender(t,e){if(e){this.setRawSet(e);const t=this.getElement();t&&(t.component=this);const n=Gt.getMetadata(oe,this.constructor);if(n&&Array.isArray(n))for(const t of n){const{selector:n,propertyKey:r,isMethod:i}=t,s=this._queryElements(n,e);if(i){const t=this[r];if("function"==typeof t){const e=Gt.getParameterTypes(this,r);e&&e.length>0&&e[0]===Array?t.call(this,s):s.length>0&&t.call(this,s[0])}}else{const t=Gt.getType(this,r);this[r]=t===Array?s:s[0]||null}}const r=Gt.getMetadata(ae,this.constructor);if(r&&Array.isArray(r))for(const t of r)this._queryElements(t.query,e).forEach(e=>{const n=this[t.methodName].bind(this);e.addEventListener(t.eventName,n),this._boundEventListeners.push({element:e,eventName:t.eventName,listener:n})})}}onDrThisBind(){}onDrThisUnBind(){this._cleanupEventListeners()}onDestroyRender(t){this._cleanupEventListeners()}}var de,pe;re([Nt,ie("design:type",vt)],ue.prototype,"_rawSet",void 0),re([Nt,ie("design:type",Array)],ue.prototype,"_children",void 0),re([Nt,ie("design:type",Object)],ue.prototype,"_render",void 0),re([Nt,ie("design:type",Object)],ue.prototype,"_attribute",void 0),re([Nt,ie("design:type",Array)],ue.prototype,"_boundEventListeners",void 0),(pe=de||(de={})).selector="dr-if",pe.If=class extends ue{sw=!1;onInitRender(t,e){super.onInitRender(t,e)}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.equalsAttributeName(t,"value")&&(this.sw=e)}};const fe={if:t=>vt.createComponentTargetElement({name:de.selector,template:'<div dr-if="@this@.sw" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new de.If(...i),config:t})})};var ge,me;(me=ge||(ge={})).selector="dr-this",me.This=class extends ue{value;if=null;createArguments;onInitRender(t,e){super.onInitRender(t,e)}onDestroyRender(t){super.onDestroyRender(t)}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.equalsAttributeName(t,"value")&&(this.value=e),this.equalsAttributeName(t,"if")&&(this.if=e),this.equalsAttributeName(t,"createArguments")&&(this.createArguments=e)}created(t){t??=this.value?.obj,this.getAttribute("onCreated")?.(t)}};const ye={this:t=>vt.createComponentTargetElement({name:ge.selector,template:'<div dr-this="@this@.value" dr-detect-option-if="@this@?.value && @this@?.if" dr-option-strip="true" dr-on-create:arguments="@this@.createArguments" dr-on-create:callback="@this@?.created?.($component)">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new ge.This(...i),config:t})})};var Ae,_e;(_e=Ae||(Ae={})).selector="dr-appender",_e.Appender=class extends ue{value;onInitRender(t,e){super.onInitRender(t,e)}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.equalsAttributeName(t,"value")&&(this.value=e)}};const Ee={appender:t=>vt.createComponentTargetElement({name:Ae.selector,template:'<div dr-appender="@this@.value" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Ae.Appender(...i),config:t})})};var be;!function(e){e.selector="dr-promise-switch";class n extends ue{hidden=!0}class i extends n{}e.Default=i;class s extends n{}e.Pending=s;class o extends n{data;setData(t){this.data=t}}e.Fulfilled=o;class a extends n{data;setData(t){this.data=t}}e.Rejected=a,e.PromiseSwitch=class extends ue{promiseState;onCreatedThisChild(t,e){super.onCreatedThisChild(t,e),this.childStateChange()}childStateChange(){const t=this.getChildren(i),e=this.getChildren(s),n=this.getChildren(o),r=this.getChildren(a),c=[...n,...r,...e,...t];if(void 0===this.promiseState)c.filter(t=>!t.hidden).forEach(t=>t.hidden=!0),t.filter(t=>t.hidden).forEach(t=>t.hidden=!1),e.filter(t=>t.getAttribute("defaultView")&&t.hidden).forEach(t=>t.hidden=!1);else if("pending"===this.promiseState.status)c.filter(t=>!t.hidden).forEach(t=>t.hidden=!0),e.filter(t=>t.hidden).forEach(t=>t.hidden=!1);else if("fulfilled"===this.promiseState.status){const t=this.promiseState.value;c.filter(t=>!t.hidden).forEach(t=>t.hidden=!0),n.forEach(e=>{e.setData(t)}),n.filter(t=>t.hidden).forEach(t=>t.hidden=!1)}else if("rejected"===this.promiseState.status){const t=this.promiseState.reason;c.filter(t=>!t.hidden).forEach(t=>t.hidden=!0),r.forEach(e=>{e.setData(t)}),r.filter(t=>t.hidden).forEach(t=>t.hidden=!1)}}onChangeAttrRender(e,n,i){super.onChangeAttrRender(e,n,i),this.equalsAttributeName(e,"data")&&n?(this.promiseState=void 0,this.promiseState=r.Result.wrap("function"==typeof n?n():n),this.getAttribute("change")?.({status:"pending"}),this.childStateChange(),this.promiseState.then(t=>(this.childStateChange(),this.getAttribute("change")?.({status:"fulfilled",data:t}),t)).catch(t=>{throw this.childStateChange(),this.getAttribute("change")?.({status:"rejected",data:t}),t}).finally(()=>{this.getAttribute("change")?.({status:"finally"})})):this.equalsAttributeName(e,"data")&&t.isNullOrUndefined(n)&&(this.promiseState=void 0,this.childStateChange())}}}(be||(be={}));const Te={promiseDefault:t=>vt.createComponentTargetElement({name:`${be.selector}-default`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new be.Default(...i),config:t})}),promisePending:t=>vt.createComponentTargetElement({name:`${be.selector}-pending`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new be.Pending(...i),config:t})}),promiseFulfilled:t=>vt.createComponentTargetElement({name:`${be.selector}-fulfilled`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new be.Fulfilled(...i),config:t})}),promiseRejected:t=>vt.createComponentTargetElement({name:`${be.selector}-rejected`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new be.Rejected(...i),config:t})}),promiseSwitch:t=>vt.createComponentTargetElement({name:`${be.selector}`,template:"#innerHTML#",objFactory:(e,n,r,i)=>We.run({rootObject:new be.PromiseSwitch(...i),config:t})})};var Re;!function(t){t.selector="dr-choose";class e extends ue{hidden=!0}class n extends e{data}class r extends n{constructor(){super({onlyParentType:s})}}t.When=r;class i extends n{constructor(){super({onlyParentType:s})}}t.OtherWise=i;class s extends ue{choose;onCreatedThisChild(t,e){super.onCreatedThisChild(t,e),this.setChange(t)}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.equalsAttributeName(t,"data")&&(this.choose=void 0,this.getChildren([r,i]).sort((t,e)=>(t instanceof i?1:0)-(e instanceof i?1:0)).forEach(t=>this.setChange(t)))}setChange(t){t.data=this.getAttribute("data"),!this.choose&&t instanceof r&&t.getAttribute("test")?.(this.getAttribute("data"))?(this.choose=t,t.hidden&&(t.hidden=!1)):this.choose!==t&&(t.hidden=!0),!this.choose&&t instanceof i&&(this.choose=t,t.hidden&&(t.hidden=!1))}}t.Choose=s}(Re||(Re={}));const ve={chooseWhen:t=>vt.createComponentTargetElement({name:`${Re.selector}-when`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Re.When,config:t})}),chooseOtherWise:t=>vt.createComponentTargetElement({name:`${Re.selector}-other-wise`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Re.OtherWise,config:t})}),choose:t=>vt.createComponentTargetElement({name:`${Re.selector}`,template:"#innerHTML#",objFactory:(e,n,r,i)=>We.run({rootObject:new Re.Choose(...i),config:t})})};var Se;!function(t){t.selector="dr-checkbox";class e extends ue{hidden=!0}class n extends e{name="checked";constructor(){super({onlyParentType:i})}}t.Checked=n;class r extends e{name="unChecked";constructor(){super({onlyParentType:i})}}t.UnChecked=r;class i extends ue{checked=!1;inputElement;change(t,e=this.checked){this.checked=e,this.setChildrenHidden(e),this.getAttribute("change")?.(e,t)}setChildrenHidden(t){this.getChildren(n).forEach(e=>{e.hidden=!t}),this.getChildren(r).forEach(e=>{e.hidden=t})}onCreatedThisChild(t,e){super.onCreatedThisChild(t,e),this.setChildrenHidden(this.checked)}onInitInputElement(t){this.inputElement=t,this.inputElement.checked=!!this.getAttribute("checked"),this.change({type:"initialize"},!!this.getAttribute("checked"))}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.inputElement&&this.getAttribute("checked")!==this.checked&&(this.inputElement.checked=!!this.getAttribute("checked"),this.change({type:"attributeChange"},!!this.getAttribute("checked")))}}t.CheckBox=i}(Se||(Se={}));const Ne={checkBoxChecked:t=>vt.createComponentTargetElement({name:`${Se.selector}-checked`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Se.Checked,config:t})}),checkBoxUnchecked:t=>vt.createComponentTargetElement({name:`${Se.selector}-unchecked`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Se.UnChecked,config:t})}),checkBox:t=>vt.createComponentTargetElement({name:`${Se.selector}`,template:'<label class="${@this@.getAttribute(\'class\')}$">\n <input\n name="${@this@.getAttribute(\'name\')}$"\n dr-on-init="@this@.onInitInputElement($element)"\n dr-event-change="@this@.change({type: \'event\'},$element.checked);"\n type="checkbox" hidden="hidden"/>\n #innerHTML#\n</label>',objFactory:(e,n,r,i)=>We.run({rootObject:new Se.CheckBox(...i),config:t})})};var Oe;!function(t){t.selector="System:Radio";class e extends ue{hidden=!0}class n extends e{name="Checked";constructor(){super({onlyParentType:i})}}t.Checked=n;class r extends e{name="unChecked";constructor(){super({onlyParentType:i})}}t.UnChecked=r;class i extends ue{checked=!1;inputElement;change(t=this.checked){this.checked=t,this.setChildrenHidden(t),console.log("radio checked!!!!!!!",t,this.checked,this.inputElement?.checked),this.getAttribute("on_change_checked")&&this.getAttribute("on_change_checked")?.(t,this.inputElement)}setChildrenHidden(t){this.getChildren(n).forEach(e=>{e.hidden=!t}),this.getChildren(r).forEach(e=>{e.hidden=t})}onCreatedThisChild(t,e){super.onCreatedThisChild(t,e),this.setChildrenHidden(this.checked)}onInitInputElement(t){this.inputElement=t}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.inputElement&&this.getAttribute("checked")!==this.checked&&(this.inputElement.checked=!!this.getAttribute("checked"),console.log("----changeAttribute",this.getAttribute("checked")),this.change(!!this.getAttribute("checked")))}}t.Radio=i}(Oe||(Oe={}));const Me={radioChecked:t=>vt.createComponentTargetElement({name:`${Oe.selector}-checked`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Oe.Checked,config:t})}),radioUnChecked:t=>vt.createComponentTargetElement({name:`${Oe.selector}-unchecked`,template:'<div dr-if="!@this@.hidden" dr-option-strip="true" >#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Oe.UnChecked,config:t})}),radio:t=>vt.createComponentTargetElement({name:`${Oe.selector}`,template:'<label class="${@this@.getAttribute(\'class\')}$">\n <input\n name="${@this@.getAttribute(\'name\')}$"\n checked="${@this@.getAttribute(\'checked\')}$"\n value="${@this@.getAttribute(\'value\')}$"\n dr-on-init="@this@.onInitInputElement($element)"\n dr-event-change="@this@.change($element.checked);"\n type="radio"\n\n />\n ${@this@.getAttribute(\'checked\')}$\n #innerHTML#\n</label>',objFactory:(e,n,r,i)=>We.run({rootObject:new Oe.Radio(...i),config:t})})};var we;!function(t){t.selector="dr-select",t.Option=class extends ue{constructor(){super({onlyParentType:[e]})}};class e extends ue{element;onCreateRender(...t){}onDestroyRender(...t){}}t.Select=e}(we||(we={}));const xe={selectOption:t=>vt.createComponentTargetElement({name:`${we.selector}-option`,template:"<option class=\"${`${@this@.getAttribute('class')} select-option-container`}$\">#innerHTML#</option>",objFactory:(e,n,r,i)=>We.run({rootObject:new we.Option,config:t})}),select:t=>vt.createComponentTargetElement({name:`${we.selector}`,template:"<select class=\"${@this@.getAttribute('class')}$\">#innerHTML#</select>",objFactory:(e,n,r,i)=>We.run({rootObject:new we.Select(...i),config:t})})};var Ce,Pe;(Pe=Ce||(Ce={})).selector="dr-timer",Pe.Timer=class extends ue{interval;timeSecond;onInitRender(t,e){super.onInitRender(t,e),console.log("---2",this.getElement()?.isConnected)}isRunning(){return void 0!==this.timeSecond}start(){const t=this.getAttribute("timeSecond");t&&(this.timeSecond=parseInt(t),this.interval=setInterval(()=>{this.timeSecond?this.timeSecond--:(clearInterval(this.interval),this.timeSecond=void 0,this.interval=void 0)},1e3))}stop(){this.interval&&(clearInterval(this.interval),this.interval=void 0,this.timeSecond=void 0)}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),console.log("-----",t,e,this.getElement())}onDestroyRender(t){super.onDestroyRender(t),this.interval&&clearInterval(this.interval)}};const Ie={choose:t=>vt.createComponentTargetElement({name:`${Ce.selector}`,template:"#innerHTML#",objFactory:(e,n,r,i)=>We.run({rootObject:new Ce.Timer(...i),config:t})})};var Le,ke,je;!function(e){e.coreValidUtils=t,e.isBrowser=t=>{const e="undefined"!=typeof window&&"undefined"!=typeof Window;return e&&t&&t(window),e},e.hasParentWindow=t=>e.isBrowser()&&t.parent&&t!==t.parent,e.isSocialNetworkServiceInappBrowser=()=>{const t=e.isBrowser()?window.navigator.userAgent.toLowerCase():"none";return/kakaotalk|naver|facebook|insta|FBAN|FBAV/.test(t)},e.isWkWebview=()=>e.isBrowser()&&null!=window.webkit&&null!=window.webkit.messageHandlers&&null!=window.webkit.messageHandlers.System,e.isiPhone=function(){return e.isBrowser()&&/iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase())},e.isAndroidWebview=()=>e.isBrowser()&&null!=window.System}(Le||(Le={})),function(t){t.htmlElementEventObservable=(t,e,n)=>new Mt(r=>{const i=t=>r.next(t);return t.addEventListener(e,i,n),()=>{t.removeEventListener(e,i,n)}})}(ke||(ke={})),function(t){t.selector="dr-details",t.Summary=class extends ue{constructor(){super({onlyParentType:[r]})}};class e extends ue{$element;constructor(){super({onlyParentType:[r]})}}t.Body=e,t.isBody=t=>t instanceof e;class n extends ue{$element;constructor(){super({onlyParentType:[r]})}submit(t,e){this.hasAttribute("disabledSubmit")&&e.preventDefault(),this.hasAttribute("submit")&&this.getAttribute("submit")?.(e,t)}reset(){this.$element?.reset()}}t.Form=n,t.isForm=t=>t instanceof n;class r extends ue{documentClickSubscription;toggleSubscription;element;onCreateRenderData(t){super.onCreateRenderData(t)}onCreateRender(...t){}toggle(t){const e=this.getAttribute("toggle");e&&e?.(t.open)}onInitRender(e,n){if(super.onInitRender(e,n),Le.isBrowser()&&this.rawSet?.dataSet.config.window){const e=this.element,n=this.rawSet.dataSet.config.window.document;this.documentClickSubscription=ke.htmlElementEventObservable(n,"click").subscribe(t=>{this.getAttribute("disableOtherClickClose")||e&&!e?.contains(t?.target)&&(e.open=!1)}),e&&(this.toggleSubscription=ke.htmlElementEventObservable(e,"toggle").subscribe(e=>{Le.coreValidUtils.isNotNullUndefined(this.getAttribute("toggle_form_reset"))&&this.children?.filter(t.isForm).forEach(t=>{t.reset()})}))}}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n)}onDestroyRender(...t){this.toggleSubscription?.unsubscribe(),this.documentClickSubscription?.unsubscribe()}}t.Details=r}(je||(je={}));const De={detailsSummary:t=>vt.createComponentTargetElement({name:`${je.selector}-summary`,template:"<summary class=\"${`${@this@.getAttribute('class')} details-summary-container`}$\">#innerHTML#</summary>",objFactory:(e,n,r,i)=>We.run({rootObject:new je.Summary,config:t})}),detailsBody:t=>vt.createComponentTargetElement({name:`${je.selector}-body`,template:"<div class=\"${`${@this@.getAttribute('class')} details-body-container details-body-${@this@.getAttribute('float')}-container`}$\" dr-on-init=\"@this@.$element = $element;\">#innerHTML#</div>",objFactory:(e,n,r,i)=>We.run({rootObject:new je.Body,config:t})}),detailsForm:t=>vt.createComponentTargetElement({name:`${je.selector}-form`,template:'<form class="${`${@this@.getAttribute(\'class\')} details-body-container details-body-${@this@.getAttribute(\'float\')}-container details-form-container`}$" dr-on-init="@this@.$element = $element;" dr-event-submit="@this@.submit($element,$event);">#innerHTML#</form>',objFactory:(e,n,r,i)=>We.run({rootObject:new je.Form,config:t})}),details:t=>vt.createComponentTargetElement({name:`${je.selector}`,styles:"\n .details-container {\n position: relative;\n }\n\n .details-container .details-body-container {\n position: absolute;\n }\n\n\n .details-container .details-body-bottom-left-container {\n position: absolute;\n left: 0;\n top: 100%;\n /*margin-top: 0px;*/\n /*width: max-content;*/\n }\n\n .details-container .details-body-bottom-right-container {\n position: absolute;\n right: 0;\n top: 100%;\n /*margin-top: 0px;*/\n /*width: max-content;*/\n }\n\n .details-container .details-body-top-left-container {\n position: absolute;\n left: 0;\n bottom: 100%;\n /*margin-bottom: 0px;*/\n /*width: max-content;*/\n }\n\n .details-container .details-body-top-right-container {\n position: absolute;\n right: 0;\n bottom: 100%;\n /*margin-bottom: 0px;*/\n }\n ",template:'<details class="${`${@this@.getAttribute(\'class\')} details-container`}$" dr-on-init="@this@.element = $element;" dr-event-toggle="@this@.toggle($element)"> #innerHTML# </details>',objFactory:(e,n,r,i)=>We.run({rootObject:new je.Details(...i),config:t})})};var Be;!function(e){e.selector="dr-input";class n extends ue{}e.Base=n,e.Input=class extends n{element;inputSubscription;resetSubscripton;onCreateRender(...t){}onInitRender(e,n){super.onInitRender(e,n);const r=this.element,i=this.getAttribute("debounceTime"),s=t.isNotNullUndefined(i)?Number(i):0,o=t.isNotNullUndefined(this.getAttribute("distinct"));if(r){const e=()=>{let e=ke.htmlElementEventObservable(r,"input").pipe((n=t=>t.target.value.trim(),t=>new Mt(e=>t.subscribe({next:t=>{try{e.next(n(t,0))}catch(t){e.error(t)}},error:t=>{e.error(t)},complete:()=>{e.complete()}}))));var n,i;return t.isNotNullUndefined(s)&&s>0&&(e=e.pipe((i=s,t=>new Mt(e=>{let n,r=null,s=!1;return t.subscribe({next:t=>{clearTimeout(r),n=t,s=!0,r=setTimeout(()=>{s&&(e.next(n),s=!1)},i)},error:t=>{clearTimeout(r),e.error(t)},complete:()=>{clearTimeout(r),s&&e.next(n),e.complete()}})})))),t.isNotNullUndefined(o)&&!0===o&&(e=e.pipe(t=>new Mt(e=>{let n,r=!1;return t.subscribe({next:t=>{r&&n===t||(r=!0,n=t,e.next(t))},error:t=>{e.error(t)},complete:()=>{e.complete()}})}))),e};this.inputSubscription=e().subscribe(t=>{this.getAttribute("input")?.(t,r)}),r.form&&(this.resetSubscripton=ke.htmlElementEventObservable(r.form,"reset").subscribe(t=>{this.inputSubscription?.unsubscribe(),this.inputSubscription=e().subscribe(t=>{this.getAttribute("input")?.(t,r)})}))}}onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n)}onDestroyRender(t){this.resetSubscripton?.unsubscribe(),this.inputSubscription?.unsubscribe()}}}(Be||(Be={}));const $e={input:t=>vt.createComponentTargetElement({name:`${Be.selector}`,template:'<Input type="${@this@.getAttribute(\'type\')}$" class="${@this@.getAttribute(\'class\')}$" id="${@this@.getAttribute(\'id\')}$" name="${@this@.getAttribute(\'name\')}$" dr-on-init="@this@.element=$element" >#innerHTML#',objFactory:(e,n,r,i)=>We.run({rootObject:new Be.Input(...i),config:t})})};var Ve,He=function(t,e,n,r){var i,s=arguments.length,o=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Fe=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};!function(t){t.selector="dr-route";class e extends ue{sw=!1}class n extends e{value;domRenderConfig;constructor(t){super(),this.domRenderConfig=t}onInitRender(t,e){super.onInitRender(t,e),this.domRenderConfig.router?.observable.subscribe(t=>{this.value?this.sw=this.domRenderConfig.router.test(this.value):this.sw=!1})}}He([ce({name:"value"}),Fe("design:type",String)],n.prototype,"value",void 0),He([Nt,Fe("design:type",Object)],n.prototype,"domRenderConfig",void 0),t.Match=n;class r extends e{value;domRenderConfig;constructor(t){super(),this.domRenderConfig=t}onInitRender(t,e){super.onInitRender(t,e),this.domRenderConfig.router?.observable.subscribe(t=>{this.value?this.sw=this.domRenderConfig.router.testRegexp(this.value):this.sw=!1})}}He([ce({name:"value"}),Fe("design:type",String)],r.prototype,"value",void 0),He([Nt,Fe("design:type",Object)],r.prototype,"domRenderConfig",void 0),t.Regexp=r}(Ve||(Ve={}));const ze={...fe,...ye,...Ee,...Te,...ve,...Ne,...Me,...xe,...Ie,...De,...$e,match:t=>vt.createComponentTargetElement({name:`${Ve.selector}-match`,template:'<div dr-if="$router && @this@.sw" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Ve.Match(t),config:t})}),regexp:t=>vt.createComponentTargetElement({name:`${Ve.selector}-regexp`,template:'<div dr-if="$router && @this@.sw" dr-option-strip="true">#innerHTML#</div>',objFactory:(e,n,r,i)=>We.run({rootObject:new Ve.Regexp(t),config:t})})};let Ue=null;class We{_config;_target;_rootObject;constructor(t,e){const n=We.runSet(t);this._config=n.config,this._target=n.target,this._rootObject=n.rootObject,e&&e?.autoGo&&this._config.router?.go(e.autoGo)}get rootObject(){return this._rootObject}get config(){return this._config}get target(){return this._target}static run(t){return We.runSet(t).rootObject}static runSet({rootObject:t,target:n,config:r}){let i=t="function"==typeof t?t():t;if("_DomRender_isProxy"in t)return n&&t._DomRender_proxy.initRender(n),i=t,{rootObject:i,target:n,config:t._domRender_config};const s=Object.assign({},r);Ue??=new R(s.window),s.window.domRender??={configs:[]},s.uuid=e.uuid4(),s.messenger=J.final(s.messenger??new ne(s)),s.proxyExcludeTyps=s.proxyExcludeTyps??[],s.targetElements??=[],"undefined"!=typeof Window&&-1===s.proxyExcludeTyps.indexOf(Window)&&s.proxyExcludeTyps.push(Window),"undefined"!=typeof Map&&-1===s.proxyExcludeTyps.indexOf(Map)&&s.proxyExcludeTyps.push(Map),"undefined"!=typeof Set&&-1===s.proxyExcludeTyps.indexOf(Set)&&s.proxyExcludeTyps.push(Set),"undefined"!=typeof Promise&&-1===s.proxyExcludeTyps.indexOf(Promise)&&s.proxyExcludeTyps.push(Promise),"undefined"!=typeof ResizeObserver&&-1===s.proxyExcludeTyps.indexOf(ResizeObserver)&&s.proxyExcludeTyps.push(ResizeObserver),"undefined"!=typeof ImageBitmap&&-1===s.proxyExcludeTyps.indexOf(ImageBitmap)&&s.proxyExcludeTyps.push(ImageBitmap),"undefined"!=typeof CanvasRenderingContext2D&&-1===s.proxyExcludeTyps.indexOf(CanvasRenderingContext2D)&&s.proxyExcludeTyps.push(CanvasRenderingContext2D),"undefined"!=typeof HTMLCanvasElement&&-1===s.proxyExcludeTyps.indexOf(HTMLCanvasElement)&&s.proxyExcludeTyps.push(HTMLCanvasElement),-1===s.proxyExcludeTyps.indexOf(vt)&&s.proxyExcludeTyps.push(vt),s.rootElement=n,s.eventManager=Ue,s.window.domRender.configs.push(s);const o=new Dt(t,n,s);let a;i=new Proxy(t,o),s.root=i,"hash"===r?.routerType?a=new Jt({rootObject:i,window:s.window}):"path"===r?.routerType?a=new Xt({rootObject:i,window:s.window}):"function"==typeof r?.routerType?a=r.routerType(i,s.window):"object"==typeof r?.routerType&&(a=r.routerType),s.router=a;for(const t of Object.values(ze)){const e=t(s);s.targetElements.find(t=>t.name===e.name)||s.targetElements.push(e)}return o.run(i),{rootObject:i,config:s,target:n}}static createComponent(t){return vt.createComponentTargetElement({name:t.tagName??("function"==typeof t.type?t.type.name:t.type.constructor.name),objFactory:(e,n,r,i)=>"function"==typeof t.type?new t.type(...i):t.type,noStrip:t.noStrip,template:t.template??"",styles:Array.isArray(t.styles)?t.styles:t.styles?[t.styles]:void 0})}static createAttribute(t,e,n){return vt.createComponentTargetAttribute(t,e,n)}}var Ge,Ye;(Ye=Ge||(Ge={})).selector="System:ForOf",Ye.ForOf=class extends ue{value;onChangeAttrRender(t,e,n){super.onChangeAttrRender(t,e,n),this.equalsAttributeName(t,"value")&&(this.value=e)}};class Ke{length=0;keyMap=new Map;isAppender=!0;constructor(...t){this.push(...t)}[Symbol.iterator](){const t=this.getAll();let e=0;return{next(n){let r={value:void 0,done:!0};return t.length>e&&(r={value:t[e],done:!1}),e++,r}}}set(t,...e){const n=this.keyMap.get(t);void 0!==n?this[n]=e:(this.keyMap.set(t,this.length),this.push(...e))}delete(t){const e=this.keyMap.get(t);void 0!==e&&(this[e]=[],this.keyMap.delete(t))}getAll(){return this.getAlls().flat()}getAlls(){return Array.from({length:this.length}).filter((t,e)=>this[e]).map((t,e)=>this[e])}push(...t){t&&t.length>0&&(t.index=this.length,this[this.length++]=t)}clear(){for(let t=0;t<this.length;t++)delete this[t];this.keyMap.clear(),this.length=0}}class Xe extends tt{constructor(t,e,n=!0){super(void 0,t,e,n)}validAction(){return super.childValidAction()}valid(){return this.childValid()}reset(){this.targetReset()}}class qe extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){const t=this.value;return null!=t&&(t?.length??0)>0}}class Je extends tt{regexp;constructor(t,e,n,r,i=!0){super(e,n,r,i),this.regexp=Dt.final(t)}valid(){const t=this.value,e=this.regexp._DomRender_origin??this.regexp;return!!t&&e.test(t)}}class Ze extends tt{regexp;constructor(t,e,n,r,i=!0){super(e,n,r,i),this.regexp=Dt.final(t)}valid(){const t=this.value,e=this.regexp._DomRender_origin??this.regexp;return!t||!e.test(t)}}class Qe extends tt{equalsValue;constructor(t,e,n,r,i=!0){super(e,n,r,i),this.equalsValue=t}valid(){return this.value===this.equalsValue}}class tn extends tt{equalsValue;constructor(t,e,n,r,i=!0){super(e,n,r,i),this.equalsValue=t}valid(){return this.value!==this.equalsValue}}class en extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){return!0}}class nn extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){return null!=this.value}}class rn extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){return this.getTarget()?.checked??!1}}class sn extends tt{constructor(t,e,n,r=!0){super(t,e,n,r)}valid(){return!this.getTarget()?.checked}}class on extends tt{validators;constructor(t,e,n,r,i=!0){super(e,n,r,i),this.validators=t.map(t=>(t.setAutoValid(!1),t.setAutoValidAction(!1),t)),this.validators.forEach(t=>{t.set(this.value,this.getTarget(),this.getEvent())})}changeValue(t){this.validators.forEach(t=>t.set(this.value,this.getTarget(),this.getEvent()))}validAction(){return!(this.validators.filter(t=>!t.validAction()).length>0)}valid(){return!(this.validators.filter(t=>!t.valid()).length>0)}}export{Ke as Appender,Ae as AppenderComponent,Se as CheckBox,rn as CheckedValidator,Re as Choose,ue as ComponentBase,Z as ComponentSet,je as Details,We as DomRender,Ge as ForOf,Xe as FormValidator,Jt as HashRouter,de as If,Be as Input,on as MultipleValidator,et as NonPassValidator,qe as NotEmptyValidator,Ze as NotRegExpTestValidator,en as PassValidator,Xt as PathRouter,be as PromiseSwitch,Oe as Radio,T as Range,Je as RegExpTestValidator,nn as RequiredValidator,Kt as Router,we as Select,q as Shield,ge as This,Ce as Timer,sn as UnCheckedValidator,tt as Validator,nt as ValidatorArray,Qe as ValueEqualsValidator,tn as ValueNotEqualsValidator,ce as attribute,he as event,le as query};