mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-13 23:03:14 +08:00
17 lines
118 KiB
JavaScript
17 lines
118 KiB
JavaScript
(function(){System.register([],(function(exports,module){"use strict";return{execute:function(){var __vite_style__=document.createElement("style");function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}__vite_style__.textContent='html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}:focus{outline:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none}input[type=search]{-webkit-appearance:none;-moz-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}textarea{overflow:auto;vertical-align:top;resize:vertical}audio,canvas,video{display:inline-block;*display: inline;*zoom: 1;max-width:100%}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted}a:active,a:hover{outline:0}img{border:0;-ms-interpolation-mode:bicubic}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left: -7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align: middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;*overflow: visible}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0;*height: 13px;*width: 13px}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}html,button,input,select,textarea{color:#222}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}img{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}\n/*$vite$:1*/',document.head.appendChild(__vite_style__),exports({c:cloneDeep,g:getDefaultExportFromCjs,s:set});var events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}events.exports=s,events.exports.once=function(e,t){return new Promise((function(r,n){function s(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}f(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,r)}(e,s,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function o(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var s,i,c,u;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),c=i[t]),void 0===c)c=i[t]=r,++e._eventsCount;else if("function"==typeof c?c=i[t]=n?[r,c]:[c,r]:n?c.unshift(r):c.push(r),(s=o(e))>0&&c.length>s&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=c.length,u=l,console&&console.warn&&console.warn(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},s=u.bind(n);return s.listener=r,n.wrapFn=s,s}function d(e,t,r){var n=e._events;if(void 0===n)return[];var s=n[t];return void 0===s?[]:"function"==typeof s?r?[s.listener||s]:[s]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(s):p(s,s.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(i){n.once&&e.removeEventListener(t,s),r(i)}))}}return Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return o(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s="error"===e,i=this._events;if(void 0!==i)s=s&&void 0===i.error;else if(!s)return!1;if(s){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var u=c.length,l=p(c,u);for(n=0;n<u;++n)r(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,l(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,l(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,s,i,o;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,s=i;break}if(s<0)return this;0===s?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,s),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var s,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(s=i[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},events.exports}var eventsExports=exports("e",requireEvents());const EventEmitter$1=exports("E",getDefaultExportFromCjs(eventsExports));var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),Symbol$1=root.Symbol,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty,nativeObjectToString$1=objectProto$d.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$a.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(i){}var s=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),s}var objectProto$c=Object.prototype,nativeObjectToString=objectProto$c.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==typeof e}var symbolTag$2="[object Symbol]";function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==symbolTag$2}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,s=Array(n);++r<n;)s[r]=t(e[r],r,e);return s}var isArray=Array.isArray,symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function isObject$2(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function identity(e){return e}var asyncTag="[object AsyncFunction]",funcTag$2="[object Function]",genTag$1="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject$2(e))return!1;var t=baseGetTag(e);return t==funcTag$2||t==genTag$1||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$b=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$9).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$2(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var WeakMap$1=getNative(root,"WeakMap"),objectCreate=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$2(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function noop(){}var HOT_COUNT=800,HOT_SPAN=16,nativeNow=Date.now;function shortOut(e){var t=0,r=0;return function(){var n=nativeNow(),s=HOT_SPAN-(n-r);if(r=n,s>0){if(++t>=HOT_COUNT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function constant(e){return function(){return e}}var defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),baseSetToString=defineProperty?function(e,t){return defineProperty(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity,setToString=shortOut(baseSetToString);function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function baseFindIndex(e,t,r,n){for(var s=e.length,i=r+-1;++i<s;)if(t(e[i],i,e))return i;return-1}function baseIsNaN(e){return e!=e}function strictIndexOf(e,t,r){for(var n=r-1,s=e.length;++n<s;)if(e[n]===t)return n;return-1}function baseIndexOf(e,t,r){return t==t?strictIndexOf(e,t,r):baseFindIndex(e,baseIsNaN,r)}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}var MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}function baseAssignValue(e,t,r){"__proto__"==t&&defineProperty?defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function eq(e,t){return e===t||e!=e&&t!=t}var objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function assignValue(e,t,r){var n=e[t];hasOwnProperty$8.call(e,t)&&eq(n,r)&&(void 0!==r||t in e)||baseAssignValue(e,t,r)}var nativeMax=Math.max;function overRest(e,t,r){return t=nativeMax(void 0===t?e.length-1:t,0),function(){for(var n=arguments,s=-1,i=nativeMax(n.length-t,0),a=Array(i);++s<i;)a[s]=n[t+s];s=-1;for(var o=Array(t+1);++s<t;)o[s]=n[s];return o[t]=r(a),apply(e,this,o)}}function baseRest(e,t){return setToString(overRest(e,t,identity),e+"")}var MAX_SAFE_INTEGER=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var objectProto$9=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$9)}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var argsTag$2="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==argsTag$2}var objectProto$8=Object.prototype,hasOwnProperty$7=objectProto$8.hasOwnProperty,propertyIsEnumerable$1=objectProto$8.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&hasOwnProperty$7.call(e,"callee")&&!propertyIsEnumerable$1.call(e,"callee")};function stubFalse(){return!1}var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$1=moduleExports$2?root.Buffer:void 0,nativeIsBuffer=Buffer$1?Buffer$1.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$1="[object Function]",mapTag$5="[object Map]",numberTag$2="[object Number]",objectTag$2="[object Object]",regexpTag$2="[object RegExp]",setTag$5="[object Set]",stringTag$2="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$2]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$3]=typedArrayTags[dateTag$2]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$1]=typedArrayTags[mapTag$5]=typedArrayTags[numberTag$2]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag$2]=typedArrayTags[setTag$5]=typedArrayTags[stringTag$2]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal.process,nodeUtil=function(){try{var e=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return e||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(t){}}(),nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,objectProto$7=Object.prototype,hasOwnProperty$6=objectProto$7.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray(e),n=!r&&isArguments(e),s=!r&&!n&&isBuffer(e),i=!r&&!n&&!s&&isTypedArray(e),a=r||n||s||i,o=a?baseTimes(e.length,String):[],c=o.length;for(var u in e)!hasOwnProperty$6.call(e,u)||a&&("length"==u||s&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||isIndex(u,c))||o.push(u);return o}function overArg(e,t){return function(r){return e(t(r))}}var nativeKeys=overArg(Object.keys,Object),objectProto$6=Object.prototype,hasOwnProperty$5=objectProto$6.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$5.call(e,r)&&"constructor"!=r&&t.push(r);return t}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$4.call(t,e)?t[e]:void 0}var objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty$3.call(t,e)}var HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function listCacheClear(){this.__data__=[],this.size=0}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],i=r.cache;if(i.has(s))return i.get(s);var a=e.apply(this,n);return r.cache=i.set(s,a)||i,a};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,s){t.push(n?s.replace(reEscapeChar,"$1"):r||e)})),t}));function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function arrayPush(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(e){return isArray(e)||isArguments(e)||!!(spreadableSymbol&&e&&e[spreadableSymbol])}function baseFlatten(e,t,r,n,s){var i=-1,a=e.length;for(r||(r=isFlattenable),s||(s=[]);++i<a;){var o=e[i];r(o)&&arrayPush(s,o)}return s}var getPrototype=overArg(Object.getPrototypeOf,Object);function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}var LARGE_ARRAY_SIZE$1=200;function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Map$1||n.length<LARGE_ARRAY_SIZE$1-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root.Buffer:void 0;function cloneBuffer(e,t){return e.slice()}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,s=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[s++]=a)}return i}function stubArray(){return[]}Buffer&&Buffer.allocUnsafe;var objectProto$3=Object.prototype,propertyIsEnumerable=objectProto$3.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable.call(e,t)})))}:stubArray;function baseGetAllKeys(e,t,r){var n=t(e);return isArray(e)?n:arrayPush(n,r(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols)}var DataView=getNative(root,"DataView"),Promise$1=getNative(root,"Promise"),Set$1=getNative(root,"Set"),mapTag$4="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$4="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map$1),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set$1),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag$2||Map$1&&getTag(new Map$1)!=mapTag$4||Promise$1&&getTag(Promise$1.resolve())!=promiseTag||Set$1&&getTag(new Set$1)!=setTag$4||WeakMap$1&&getTag(new WeakMap$1)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,n=r?toSource(r):"";if(n)switch(n){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$4;case promiseCtorString:return promiseTag;case setCtorString:return setTag$4;case weakMapCtorString:return weakMapTag$1}return t});var objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function initCloneArray(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$2.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Uint8Array$1=root.Uint8Array;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$1(t).set(new Uint8Array$1(e)),t}function cloneDataView(e,t){var r=cloneArrayBuffer(e.buffer);return new e.constructor(r,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function cloneSymbol(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}function cloneTypedArray(e,t){var r=cloneArrayBuffer(e.buffer);return new e.constructor(r,e.byteOffset,e.length)}var boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$3="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$3="[object Set]",stringTag$1="[object String]",symbolTag$1="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new n(+e);case dataViewTag$1:return cloneDataView(e);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e);case mapTag$3:return new n;case numberTag$1:case stringTag$1:return new n(e);case regexpTag$1:return cloneRegExp(e);case setTag$3:return new n;case symbolTag$1:return cloneSymbol(e)}}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate(getPrototype(e))}var mapTag$2="[object Map]";function baseIsMap(e){return isObjectLike(e)&&getTag(e)==mapTag$2}var nodeIsMap=nodeUtil&&nodeUtil.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,setTag$2="[object Set]";function baseIsSet(e){return isObjectLike(e)&&getTag(e)==setTag$2}var nodeIsSet=nodeUtil&&nodeUtil.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,t,r,n,s,i){var a;if(void 0!==a)return a;if(!isObject$2(e))return e;var o=isArray(e);if(o)a=initCloneArray(e);else{var c=getTag(e),u=c==funcTag||c==genTag;if(isBuffer(e))return cloneBuffer(e);if(c==objectTag||c==argsTag||u&&!s)a=u?{}:initCloneObject(e);else{if(!cloneableTags[c])return s?e:{};a=initCloneByTag(e,c)}}i||(i=new Stack);var l=i.get(e);if(l)return l;i.set(e,a),isSet(e)?e.forEach((function(n){a.add(baseClone(n,t,r,n,e,i))})):isMap(e)&&e.forEach((function(n,s){a.set(s,baseClone(n,t,r,s,e,i))}));var d=o?void 0:getAllKeys(e);return arrayEach(d||e,(function(n,s){d&&(n=e[s=n]),assignValue(a,s,baseClone(n,t,r,s,e,i))})),a}cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag$1]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag$1]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}var HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd(e){return this.__data__.set(e,HASH_UNDEFINED),this}function setCacheHas(e){return this.__data__.has(e)}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function cacheHas(e,t){return e.has(t)}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function hasPath(e,t,r){for(var n=-1,s=(t=castPath(t,e)).length,i=!1;++n<s;){var a=toKey(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=s?i:!!(s=null==e?0:e.length)&&isLength(s)&&isIndex(a,s)&&(isArray(e)||isArguments(e))}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas;var objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function baseHas(e,t){return null!=e&&hasOwnProperty$1.call(e,t)}function has(e,t){return null!=e&&hasPath(e,t,baseHas)}var mapTag="[object Map]",setTag="[object Set]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function isEmpty(e){if(null==e)return!0;if(isArrayLike(e)&&(isArray(e)||"string"==typeof e||"function"==typeof e.splice||isBuffer(e)||isTypedArray(e)||isArguments(e)))return!e.length;var t=getTag(e);if(t==mapTag||t==setTag)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var r in e)if(hasOwnProperty.call(e,r))return!1;return!0}function baseSet(e,t,r,n){if(!isObject$2(e))return e;for(var s=-1,i=(t=castPath(t,e)).length,a=i-1,o=e;null!=o&&++s<i;){var c=toKey(t[s]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=a){var l=o[c];void 0===(u=void 0)&&(u=isObject$2(l)?l:isIndex(t[s+1])?[]:{})}assignValue(o,c,u),o=o[c]}return e}function set(e,t,r){return null==e?e:baseSet(e,t,r)}var INFINITY=1/0,createSet=Set$1&&1/setToArray(new Set$1([,-0]))[1]==INFINITY?function(e){return new Set$1(e)}:noop,LARGE_ARRAY_SIZE=200;function baseUniq(e,t,r){var n=-1,s=arrayIncludes,i=e.length,a=!0,o=[],c=o;if(i>=LARGE_ARRAY_SIZE){var u=createSet(e);if(u)return setToArray(u);a=!1,s=cacheHas,c=new SetCache}else c=o;e:for(;++n<i;){var l=e[n],d=l;if(l=0!==l?l:0,a&&d==d){for(var h=c.length;h--;)if(c[h]===d)continue e;o.push(l)}else s(c,d,r)||(c!==o&&c.push(d),o.push(l))}return o}var union=baseRest((function(e){return baseUniq(baseFlatten(e,1,isArrayLikeObject))}));
|
|
/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(t,s){function i(e){try{o(n.next(e))}catch(t){s(t)}}function a(e){try{o(n.throw(e))}catch(t){s(t)}}function o(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}o((n=n.apply(e,[])).next())}))}const segments=[];function Match(e,t,r="*"){if(e===r)return!0;segments.length=0;let n=0,s=0,i=0,a=0;for(let d=0,h=e.length;d<h;d+=1){const t=e[d];t===r&&(n+=1,d>a&&segments.push(e.substring(a,d)),segments.push(t),a=d+1)}if(a<e.length&&segments.push(e.substring(a)),n?(s=e.length-n,i=1/0):i=s=e.length,0===segments.length)return e===t;const o=t.length;if(o<s||o>i)return!1;let c=segments.length-1,u=t.length-1,l=!1;for(;;){const e=segments[c];if(c-=1,e===r)l=!0;else{const r=u+1-e.length,n=t.lastIndexOf(e,r);if(-1===n||n>r)return!1;if(l)u=n-1,l=!1;else{if(n!==r)return!1;u-=e.length}}if(0>c)break}return!0}class WildcardObject{constructor(e,t,r,n=void 0){this.obj=e,this.delimiter=t,this.wildcard=r,this.is_match=n}shortMatch(e,t){if(e===t)return!0;if(e===this.wildcard)return!0;if(this.is_match)return this.is_match(e,t);const r=e.indexOf(this.wildcard);if(r>-1){const n=e.substr(r+1);if(0===r||t.substring(0,r)===e.substring(0,r)){const e=n.length;return!(e>0)||t.substr(-e)===n}}return!1}match(e,t){return this.is_match?this.is_match(e,t):e===t||e===this.wildcard||t===this.wildcard||this.shortMatch(e,t)||Match(e,t,this.wildcard)}handleArray(e,t,r,n,s={}){let i=e.indexOf(this.delimiter,r),a=!1;-1===i&&(a=!0,i=e.length);const o=e.substring(r,i);let c=0;for(const u of t){const t=c.toString(),r=""===n?t:n+this.delimiter+c;(o===this.wildcard||o===t||this.shortMatch(o,t))&&(a?s[r]=u:this.goFurther(e,u,i+1,r,s)),c++}return s}handleObject(e,t,r,n,s={}){let i=e.indexOf(this.delimiter,r),a=!1;-1===i&&(a=!0,i=e.length);const o=e.substring(r,i);for(let c in t){c=c.toString();const r=""===n?c:n+this.delimiter+c;(o===this.wildcard||o===c||this.shortMatch(o,c))&&(a?s[r]=t[c]:this.goFurther(e,t[c],i+1,r,s))}return s}goFurther(e,t,r,n,s={}){return Array.isArray(t)?this.handleArray(e,t,r,n,s):this.handleObject(e,t,r,n,s)}get(e){return this.goFurther(e,this.obj,0,"")}}class ObjectPath{static get(e,t,r=!1){if(!t)return;let n=t;for(const s of e)if(s in n)n=n[s];else{if(!r)return;n[s]=Object.create({}),n=n[s]}return n}static set(e,t,r){if(!r)return;if(0===e.length){for(const e in r)delete r[e];for(const e in t)r[e]=t[e];return}const n=e.slice(),s=n.pop(),i=ObjectPath.get(n,r,!0);return"object"==typeof i&&(i[s]=t),t}}let wasm,WASM_VECTOR_LEN=0,cachegetUint8Memory0=null;function getUint8Memory0(){return null!==cachegetUint8Memory0&&cachegetUint8Memory0.buffer===wasm.memory.buffer||(cachegetUint8Memory0=new Uint8Array(wasm.memory.buffer)),cachegetUint8Memory0}let cachedTextEncoder=new TextEncoder("utf-8");const encodeString="function"==typeof cachedTextEncoder.encodeInto?function(e,t){return cachedTextEncoder.encodeInto(e,t)}:function(e,t){const r=cachedTextEncoder.encode(e);return t.set(r),{read:e.length,written:r.length}};function passStringToWasm0(e,t,r){if(void 0===r){const r=cachedTextEncoder.encode(e),n=t(r.length);return getUint8Memory0().subarray(n,n+r.length).set(r),WASM_VECTOR_LEN=r.length,n}let n=e.length,s=t(n);const i=getUint8Memory0();let a=0;for(;a<n;a++){const t=e.charCodeAt(a);if(t>127)break;i[s+a]=t}if(a!==n){0!==a&&(e=e.slice(a)),s=r(s,n,n=a+3*e.length);const t=getUint8Memory0().subarray(s+a,s+n);a+=encodeString(e,t).written}return WASM_VECTOR_LEN=a,s}function is_match(e,t){var r=passStringToWasm0(e,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),n=WASM_VECTOR_LEN,s=passStringToWasm0(t,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),i=WASM_VECTOR_LEN;return 0!==wasm.is_match(r,n,s,i)}async function load(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if("application/wasm"==e.headers.get("Content-Type"))throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}{const r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}async function init(e){("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:t,module:r}=await load(await e,{});return wasm=t.exports,init.__wbindgen_wasm_module=r,wasm}const defaultUpdateOptions={only:[],source:"",debug:!1,data:void 0,queue:!1,force:!1};function log(e,t){console.debug(e,t)}function getDefaultOptions(){return{delimiter:".",debug:!1,extraDebug:!1,useMute:!0,notRecursive:";",param:":",wildcard:"*",experimentalMatch:!1,queue:!1,defaultBulkValue:!0,useCache:!1,useSplitCache:!1,useIndicesCache:!1,maxSimultaneousJobs:1e3,maxQueueRuns:1e3,log:log,Promise:Promise}}function isObject$1(e){return e&&e.constructor?"Object"===e.constructor.name:"object"==typeof e&&null!==e}class DeepState{constructor(e={},t={}){this.jobsRunning=0,this.updateQueue=[],this.subscribeQueue=[],this.listenersIgnoreCache=new WeakMap,this.is_match=null,this.destroyed=!1,this.queueRuns=0,this.groupId=0,this.namedGroups=[],this.numberGroups=[],this.traceId=0,this.traceMap=new Map,this.tracing=[],this.savedTrace=[],this.collection=null,this.collections=0,this.cache=new Map,this.splitCache=new Map,this.indices=new Map,this.indicesCount=new Map,this.lastExecs=new WeakMap,this.listeners=new Map,this.waitingListeners=new Map,this.options=Object.assign(Object.assign({},getDefaultOptions()),t),this.data=e,this.id=0,this.options.useCache?(this.pathGet=this.cacheGet,this.pathSet=this.cacheSet):(this.pathGet=ObjectPath.get,this.pathSet=ObjectPath.set),t.Promise?this.resolved=t.Promise.resolve():this.resolved=Promise.resolve(),this.muted=new Set,this.mutedListeners=new Set,this.scan=new WildcardObject(this.data,this.options.delimiter,this.options.wildcard),this.destroyed=!1}getDefaultListenerOptions(){return{bulk:!1,bulkValue:this.options.defaultBulkValue,debug:!1,source:"",data:void 0,queue:!1,group:!1}}cacheGet(e,t=this.data,r=!1){const n=e.join(this.options.delimiter),s=this.cache.get(n);if(s){const e=s.deref();if(e)return e}const i=ObjectPath.get(e,t,r);return(isObject$1(i)||Array.isArray(i))&&this.cache.set(n,new WeakRef(i)),i}cacheSet(e,t,r=this.data){const n=e.join(this.options.delimiter);return isObject$1(t)||Array.isArray(t)?this.cache.set(n,new WeakRef(t)):this.cache.delete(n),ObjectPath.set(e,t,r)}silentSet(e,t){return this.pathSet(this.split(e),t,this.data)}loadWasmMatcher(e){return __awaiter(this,void 0,void 0,(function*(){yield init(e),this.is_match=is_match,this.scan=new WildcardObject(this.data,this.options.delimiter,this.options.wildcard,this.is_match)}))}same(e,t){return(["number","string","undefined","boolean"].includes(typeof e)||null===e)&&t===e}getListeners(){return this.listeners}destroy(){this.destroyed=!0,this.data=void 0,this.listeners=new Map,this.waitingListeners=new Map,this.updateQueue=[],this.jobsRunning=0}match(e,t,r=!0){return this.is_match?this.is_match(e,t):e===t||(e===this.options.wildcard||t===this.options.wildcard||!(!r&&this.getIndicesCount(this.options.delimiter,e)<this.getIndicesCount(this.options.delimiter,t))&&this.scan.match(e,t))}getIndicesOf(e,t){if(this.options.useIndicesCache&&this.indices.has(t))return this.indices.get(t);const r=e.length;if(0==r)return[];let n,s=0,i=[];for(;(n=t.indexOf(e,s))>-1;)i.push(n),s=n+r;return this.options.useIndicesCache&&this.indices.set(t,i),i}getIndicesCount(e,t){if(this.options.useIndicesCache&&this.indicesCount.has(t))return this.indicesCount.get(t);const r=e.length;if(0==r)return 0;let n,s=0,i=0;for(;(n=t.indexOf(e,s))>-1;)i++,s=n+r;return this.options.useIndicesCache&&this.indicesCount.set(t,i),i}cutPath(e,t){if(""===t)return"";if((e=this.cleanNotRecursivePath(e))===(t=this.cleanNotRecursivePath(t)))return e;const r=this.getIndicesCount(this.options.delimiter,t),n=this.getIndicesOf(this.options.delimiter,e);return e.substring(0,n[r])}trimPath(e){return(e=this.cleanNotRecursivePath(e)).charAt(0)===this.options.delimiter?e.substr(1):e}split(e){if(""===e)return[];if(!this.options.useSplitCache)return e.split(this.options.delimiter);const t=this.splitCache.get(e);if(t)return t.slice();const r=e.split(this.options.delimiter);return this.splitCache.set(e,r.slice()),r}isWildcard(e){return e.includes(this.options.wildcard)||this.hasParams(e)}isNotRecursive(e){return e.endsWith(this.options.notRecursive)}cleanNotRecursivePath(e){return this.isNotRecursive(e)?e.substring(0,e.length-1):e}hasParams(e){return e.includes(this.options.param)}getParamsInfo(e){let t={replaced:"",original:e,params:{}},r=0,n=[];for(const s of this.split(e)){t.params[r]={original:s,replaced:"",name:""};const e=new RegExp(`\\${this.options.param}([^\\${this.options.delimiter}\\${this.options.param}]+)`,"g");let i=e.exec(s);i?(t.params[r].name=i[1],e.lastIndex=0,t.params[r].replaced=s.replace(e,this.options.wildcard),n.push(t.params[r].replaced),r++):(delete t.params[r],n.push(s),r++)}return t.replaced=n.join(this.options.delimiter),t}getParams(e,t){if(!e)return;const r=this.split(t),n={};for(const s in e.params){n[e.params[s].name]=r[s]}return n}waitForAll(e,t){const r={};for(let n of e)r[n]={dirty:!1},this.hasParams(n)&&(r[n].paramsInfo=this.getParamsInfo(n)),r[n].isWildcard=this.isWildcard(n),r[n].isRecursive=!this.isNotRecursive(n);return this.waitingListeners.set(e,{fn:t,paths:r}),t(r),function(){this.waitingListeners.delete(e)}}executeWaitingListeners(e){if(!this.destroyed)for(const t of this.waitingListeners.values()){const{fn:r,paths:n}=t;let s=0,i=0;for(let t in n){const r=n[t];let a=!1;r.isRecursive&&(e=this.cutPath(e,t)),r.isWildcard&&this.match(t,e)&&(a=!0),e===t&&(a=!0),a&&(r.dirty=!0),r.dirty&&s++,i++}s===i&&r(n)}}subscribeAll(e,t,r=this.getDefaultListenerOptions()){if(this.destroyed)return()=>{};let n=[],s=0,i=null;"boolean"==typeof r.group&&r.group?(this.groupId++,i=this.groupId,r.bulk=!0):"string"==typeof r.group&&(r.bulk=!0,i=r.group);for(const a of e)n.push(this.subscribe(a,t,r,{all:e,index:s,groupId:i})),s++;return function(){for(const e of n)e()}}getCleanListenersCollection(e={}){return Object.assign({listeners:new Map,isRecursive:!1,isWildcard:!1,hasParams:!1,match:void 0,paramsInfo:void 0,path:void 0,originalPath:void 0,count:0},e)}getCleanListener(e,t=this.getDefaultListenerOptions()){return{fn:e,options:Object.assign(Object.assign({},this.getDefaultListenerOptions()),t),groupId:null}}getListenerCollectionMatch(e,t,r){e=this.cleanNotRecursivePath(e);const n=this;return function(s,i=!1){let a=e;return t?s=n.cutPath(s,e):a=n.cutPath(n.cleanNotRecursivePath(e),s),i&&console.log("[getListenerCollectionMatch]",{listenerPath:e,scopedListenerPath:a,path:s,isRecursive:t,isWildcard:r}),!(!r||!n.match(a,s,t))||a===s}}getListenersCollection(e,t){if(this.listeners.has(e)){let r=this.listeners.get(e);return r.listeners.set(++this.id,t),t.id=this.id,r}const r=this.hasParams(e);let n;r&&(n=this.getParamsInfo(e));let s={isRecursive:!this.isNotRecursive(e),isWildcard:this.isWildcard(e),hasParams:r,paramsInfo:n,originalPath:e,path:r?n.replaced:e};s.isRecursive||(s.path=this.cleanNotRecursivePath(s.path));let i=this.getCleanListenersCollection(Object.assign(Object.assign({},s),{match:this.getListenerCollectionMatch(s.path,s.isRecursive,s.isWildcard)}));return this.id++,i.listeners.set(this.id,t),t.id=this.id,this.listeners.set(s.originalPath,i),i}subscribe(e,t,r=this.getDefaultListenerOptions(),n={all:[e],index:0,groupId:null}){if(this.destroyed)return()=>{};this.jobsRunning++;const s="subscribe";let i=this.getCleanListener(t,r);r.group&&(r.bulk=!0,"string"==typeof r.group?i.groupId=r.group:n.groupId&&(i.groupId=n.groupId)),this.listenersIgnoreCache.set(i,{truthy:[],falsy:[]});const a=this.getListenersCollection(e,i);r.debug&&console.log("[subscribe]",{listenerPath:e,options:r}),a.count++;let o=!0;if(i.groupId&&("string"==typeof i.groupId?this.namedGroups.includes(i.groupId)?o=!1:this.namedGroups.push(i.groupId):"number"==typeof i.groupId&&(this.numberGroups.includes(i.groupId)?o=!1:this.numberGroups.push(i.groupId))),o){const n=this.cleanNotRecursivePath(a.path),o=this.split(n);if(a.isWildcard){const o=this.scan.get(n);if(r.bulk){const n=[];for(const e in o)this.isMuted(e)||n.push({path:e,params:this.getParams(a.paramsInfo,e),value:o[e]});this.isMuted(t)||t(n,{type:s,listener:i,listenersCollection:a,path:{listener:e,update:void 0,resolved:void 0},options:r,params:void 0})}else for(const n in o)this.isMuted(n)||this.isMuted(t)||t(o[n],{type:s,listener:i,listenersCollection:a,path:{listener:e,update:void 0,resolved:this.cleanNotRecursivePath(n)},params:this.getParams(a.paramsInfo,n),options:r})}else this.isMuted(n)||this.isMuted(t)||t(this.pathGet(o,this.data),{type:s,listener:i,listenersCollection:a,path:{listener:e,update:void 0,resolved:this.cleanNotRecursivePath(e)},params:this.getParams(a.paramsInfo,n),options:r})}return this.debugSubscribe(i,a,e),this.jobsRunning--,this.unsubscribe(e,this.id)}unsubscribe(e,t){const r=this.listeners,n=r.get(e);return function(){n.listeners.delete(t),n.count--,0===n.count&&r.delete(e)}}runQueuedListeners(){if(!this.destroyed&&0!==this.subscribeQueue.length)if(0===this.jobsRunning){this.queueRuns=0;const e=[...this.subscribeQueue];for(let t=0,r=e.length;t<r;t++)e[t]();this.subscribeQueue.length=0}else{if(this.queueRuns++,this.queueRuns>=this.options.maxQueueRuns)throw this.queueRuns=0,new Error("Maximal number of queue runs exhausted.");Promise.resolve().then((()=>this.runQueuedListeners())).catch((e=>{throw e}))}}getQueueNotifyListeners(e,t=[]){for(const r in e){if(this.isMuted(r))continue;let{single:n,bulk:s}=e[r];for(const e of n){let r=!1,n=e.listener.id+":"+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(n=e.listener.id+":"+e.eventInfo.path.listener);for(const e of t)if(n===e.resolvedIdPath){r=!0;break}if(r)continue;const s=this.debugTime(e);if(!this.isMuted(e.listener.fn))if(e.listener.options.queue&&this.jobsRunning)this.subscribeQueue.push((()=>{e.listener.fn(e.value?e.value():void 0,e.eventInfo)}));else{let r=e.listener.id+":"+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(r=e.listener.id+":"+e.eventInfo.path.listener),t.push({id:e.listener.id,resolvedPath:e.eventInfo.path.resolved,resolvedIdPath:r,originalFn:e.listener.fn,fn:()=>{e.listener.fn(e.value?e.value():void 0,e.eventInfo)},options:e.listener.options,groupId:e.listener.groupId})}this.debugListener(s,e)}for(const e of s){let r=!1;for(const i of t)if(i.id===e.listener.id){r=!0;break}if(r)continue;const n=this.debugTime(e),s=[];for(const t of e.value)s.push(Object.assign(Object.assign({},t),{value:t.value?t.value():void 0}));if(!this.isMuted(e.listener.fn))if(e.listener.options.queue&&this.jobsRunning)this.subscribeQueue.push((()=>!this.jobsRunning&&(e.listener.fn(s,e.eventInfo),!0)));else{let r=e.listener.id+":"+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(r=e.listener.id+":"+e.eventInfo.path.listener),t.push({id:e.listener.id,resolvedPath:e.eventInfo.path.resolved,resolvedIdPath:r,originalFn:e.listener.fn,fn:()=>{e.listener.fn(s,e.eventInfo)},options:e.listener.options,groupId:e.listener.groupId})}this.debugListener(n,e)}}return Promise.resolve().then((()=>this.runQueuedListeners())),t}shouldIgnore(e,t){if(!e.options.ignore)return!1;for(const r of e.options.ignore){if(t.startsWith(r))return!0;if(this.is_match&&this.is_match(r,t))return!0;{const e=this.cutPath(t,r);if(this.match(r,e))return!0}}return!1}getSubscribedListeners(e,t,r,n="update",s=null){r=Object.assign(Object.assign({},defaultUpdateOptions),r);const i={};for(let[a,o]of this.listeners)if(o.match(e)){i[a]={single:[],bulk:[],bulkData:[]};const c=o.paramsInfo?this.getParams(o.paramsInfo,e):void 0,u=this.cutPath(e,a),l=o.isRecursive||o.isWildcard?()=>this.get(u):()=>t,d=[{value:l,path:e,params:c}];for(const t of o.listeners.values())this.shouldIgnore(t,e)?t.options.debug&&console.log("[getSubscribedListeners] Listener was not fired because it was ignored.",{listener:t,listenersCollection:o}):t.options.bulk?i[a].bulk.push({listener:t,listenersCollection:o,eventInfo:{type:n,listener:t,path:{listener:a,update:s||e,resolved:void 0},params:c,options:r},value:d}):i[a].single.push({listener:t,listenersCollection:o,eventInfo:{type:n,listener:t,path:{listener:a,update:s||e,resolved:this.cleanNotRecursivePath(e)},params:c,options:r},value:l})}else if(this.options.extraDebug){let t=!1;for(const r of o.listeners.values())r.options.debug&&(t=!0,console.log("[getSubscribedListeners] Listener was not fired because there was no match.",{listener:r,listenersCollection:o,updatePath:e}));t&&o.match(e,!0)}return i}notifySubscribedListeners(e,t,r,n="update",s=null){return this.getQueueNotifyListeners(this.getSubscribedListeners(e,t,r,n,s))}useBulkValue(e){for(const[t,r]of e.listeners){if(r.options.bulk&&r.options.bulkValue)return!0;if(!r.options.bulk)return!0}return!1}getNestedListeners(e,t,r,n="update",s=null){const i={},a={};for(let[o,c]of this.listeners){if(!c.isRecursive)continue;const u=this.cutPath(o,e);if(this.match(u,e)){i[o]={single:[],bulk:[]};const l=this.trimPath(o.substr(u.length)),d=this.useBulkValue(c);let h;d&&(h=a[l]?a[l]:new WildcardObject(t,this.options.delimiter,this.options.wildcard).get(l),a[l]=h);const p=c.paramsInfo?this.getParams(c.paramsInfo,e):void 0,f=[],g={};for(const[t,a]of c.listeners)if(d)for(const u in h){const l=()=>h[u],d=[e,u].join(this.options.delimiter),m={type:n,listener:a,listenersCollection:c,path:{listener:o,update:s||e,resolved:this.cleanNotRecursivePath(d)},params:p,options:r};this.shouldIgnore(a,e)||(a.options.bulk?(f.push({value:l,path:d,params:p}),g[t]=a):i[o].single.push({listener:a,listenersCollection:c,eventInfo:m,value:l}))}else{const u={type:n,listener:a,listenersCollection:c,path:{listener:o,update:s||e,resolved:void 0},params:p,options:r};if(this.shouldIgnore(a,e))continue;a.options.bulk?(f.push({value:void 0,path:void 0,params:p}),g[t]=a):i[o].single.push({listener:a,listenersCollection:c,eventInfo:u,value:void 0})}for(const t in g){const s=g[t],a={type:n,listener:s,listenersCollection:c,path:{listener:o,update:e,resolved:void 0},options:r,params:p};i[o].bulk.push({listener:s,listenersCollection:c,eventInfo:a,value:f})}}else if(this.options.extraDebug)for(const t of c.listeners.values())t.options.debug&&console.log("[getNestedListeners] Listener was not fired because there was no match.",{listener:t,listenersCollection:c,currentCutPath:u,updatePath:e})}return i}notifyNestedListeners(e,t,r,n="update",s,i=null){return this.getQueueNotifyListeners(this.getNestedListeners(e,t,r,n,i),s)}getNotifyOnlyListeners(e,t,r,n="update",s=null){const i={};if("object"!=typeof r.only||!Array.isArray(r.only)||void 0===r.only[0]||!this.canBeNested(t))return i;for(const a of r.only){const o=new WildcardObject(t,this.options.delimiter,this.options.wildcard).get(a);i[a]={bulk:[],single:[]};for(const t in o){const c=e+this.options.delimiter+t;for(const[u,l]of this.listeners){const d=l.paramsInfo?this.getParams(l.paramsInfo,c):void 0;if(this.match(u,c)){const h=()=>o[t],p=[{value:h,path:c,params:d}];for(const t of l.listeners.values()){const o={type:n,listener:t,listenersCollection:l,path:{listener:u,update:s||e,resolved:this.cleanNotRecursivePath(c)},params:d,options:r};this.shouldIgnore(t,e)||(t.options.bulk?i[a].bulk.some((e=>e.listener===t))||i[a].bulk.push({listener:t,listenersCollection:l,eventInfo:o,value:p}):i[a].single.push({listener:t,listenersCollection:l,eventInfo:o,value:h}))}}}}}return i}runQueue(e){const t=[];for(const r of e)r.options.group?t.includes(r.groupId)||(r.fn(),t.push(r.groupId)):r.fn()}sortAndRunQueue(e,t){e.sort((function(e,t){return e.id-t.id})),this.options.debug&&console.log(`[deep-state-observer] queue for ${t}`,e),this.runQueue(e)}notifyOnly(e,t,r,n="update",s=""){const i=this.getQueueNotifyListeners(this.getNotifyOnlyListeners(e,t,r,n,s));this.sortAndRunQueue(i,e)}canBeNested(e){return"object"==typeof e&&null!==e}getUpdateValues(e,t){let r=t;return"function"==typeof t&&(r=t(e)),{newValue:r,oldValue:e}}wildcardNotify(e,t){let r=[];for(const n of e)this.getQueueNotifyListeners(n,r);for(const n of t)this.executeWaitingListeners(n);return this.jobsRunning--,r}wildcardUpdate(e,t,r=defaultUpdateOptions,n=!1){++this.jobsRunning,r=Object.assign(Object.assign({},defaultUpdateOptions),r);const s=this.scan.get(e),i={};for(const u in s){const e=this.split(u),{oldValue:n,newValue:a}=this.getUpdateValues(s[u],t);this.same(a,n)&&!r.force||(this.pathSet(e,a,this.data),i[u]=a)}const a=[],o=[];for(const u in i){const t=i[u];r.only.length?a.push(this.getNotifyOnlyListeners(u,t,r,"update",e)):(a.push(this.getSubscribedListeners(u,t,r,"update",e)),this.canBeNested(t)&&a.push(this.getNestedListeners(u,t,r,"update",e))),r.debug&&this.options.log("Wildcard update",{path:u,newValue:t}),o.push(u)}if(n){const t=this;return function(){const r=t.wildcardNotify(a,o);t.sortAndRunQueue(r,e)}}const c=this.wildcardNotify(a,o);this.sortAndRunQueue(c,e)}runUpdateQueue(){if(!this.destroyed)for(;this.updateQueue.length&&this.updateQueue.length<this.options.maxSimultaneousJobs;){const e=this.updateQueue.shift();e.options.queue=!1,this.update(e.updatePath,e.fnOrValue,e.options,e.multi)}}updateNotify(e,t,r){const n=this.notifySubscribedListeners(e,t,r);this.canBeNested(t)&&this.notifyNestedListeners(e,t,r,"update",n),this.sortAndRunQueue(n,e),this.executeWaitingListeners(e)}updateNotifyAll(e){let t=[];for(const r of e){const e=r.newValue;if(this.tracing.length){const t=this.tracing[this.tracing.length-1],n=this.traceMap.get(t);n.changed.push({traceId:t,updatePath:r.updatePath,fnOrValue:e,options:r.options}),this.traceMap.set(t,n)}t=t.concat(this.notifySubscribedListeners(r.updatePath,e,r.options)),this.canBeNested(r.newValue)&&this.notifyNestedListeners(r.updatePath,e,r.options,"update",t)}this.runQueue(t)}updateNotifyOnly(e,t,r){this.notifyOnly(e,t,r),this.executeWaitingListeners(e)}update(e,t,r=Object.assign({},defaultUpdateOptions),n=!1){if(this.destroyed)return;if(this.collection)return this.collection.update(e,t,r);if(this.tracing.length){const n=this.tracing[this.tracing.length-1],s=this.traceMap.get(n);s.changed.push({traceId:n,updatePath:e,fnOrValue:t,options:r}),this.traceMap.set(n,s)}const s=this.jobsRunning;if((this.options.queue||r.queue)&&s){if(s>this.options.maxSimultaneousJobs)throw new Error("Maximal simultaneous jobs limit reached.");this.updateQueue.push({updatePath:e,fnOrValue:t,options:r,multi:n});const i=Promise.resolve().then((()=>{this.runUpdateQueue()}));return n?function(){return i}:i}if(this.isWildcard(e))return this.wildcardUpdate(e,t,r,n);++this.jobsRunning;const i=this.split(e),a=this.pathGet(i,this.data);let{oldValue:o,newValue:c}=this.getUpdateValues(a,t);if(r.debug&&this.options.log(`Updating ${e} ${r.source?`from ${r.source}`:""}`,{oldValue:o,newValue:c}),this.same(c,o)&&!r.force)return--this.jobsRunning,n?function(){return c}:c;if(this.pathSet(i,c,this.data),null===(r=Object.assign(Object.assign({},defaultUpdateOptions),r)).only)return--this.jobsRunning,n?function(){}:c;if(r.only.length){if(--this.jobsRunning,n){const t=this;return function(){return t.updateNotifyOnly(e,c,r)}}return this.updateNotifyOnly(e,c,r),c}if(n){--this.jobsRunning;const t=this;return function(){return t.updateNotify(e,c,r)}}return this.updateNotify(e,c,r),--this.jobsRunning,c}multi(e=!1){if(this.destroyed)return{update(){return this},done(){},getStack:()=>[]};if(this.collection)return this.collection;const t=this,r=[],n=[];return{update(s,i,a=defaultUpdateOptions){if(e){const e=t.split(s);let n=i;const o=t.pathGet(e,t.data);"function"==typeof n&&(n=n(o)),t.pathSet(e,n,t.data),r.push({updatePath:s,newValue:n,options:a})}else n.push(t.update(s,i,a,!0));return this},done(){if(0===t.collections){if(e)t.updateNotifyAll(r);else for(const e of n)e();r.length=0}},getStack:()=>r}}collect(){return this.collections++,this.collection||(this.collection=this.multi(!0)),this.collection}executeCollected(){if(this.collections--,0===this.collections&&this.collection){const e=this.collection;this.collection=null,e.done()}}getCollectedCount(){return this.collections}getCollectedStack(){return this.collection?this.collection.getStack():[]}get(e=void 0){if(!this.destroyed)return void 0===e||""===e?this.data:this.isWildcard(e)?this.scan.get(e):this.pathGet(this.split(e),this.data)}last(e){let t=this.lastExecs.get(e);t||(t={calls:0},this.lastExecs.set(e,t));const r=++t.calls;this.resolved.then((()=>{r===t.calls&&(this.lastExecs.set(e,{calls:0}),e())}))}isMuted(e){if(!this.options.useMute)return!1;if("function"==typeof e)return this.isMutedListener(e);for(const t of this.muted){const r=!this.isNotRecursive(t),n=this.trimPath(t);if(this.match(e,n))return!0;if(this.match(n,e))return!0;if(r){const r=this.cutPath(n,e);if(this.match(r,t))return!0;if(this.match(t,r))return!0}}return!1}isMutedListener(e){return this.mutedListeners.has(e)}mute(e){if("function"==typeof e)return this.mutedListeners.add(e);this.muted.add(e)}unmute(e){if("function"==typeof e)return this.mutedListeners.delete(e);this.muted.delete(e)}debugSubscribe(e,t,r){e.options.debug&&this.options.log("listener subscribed",{listenerPath:r,listener:e,listenersCollection:t})}debugListener(e,t){(t.eventInfo.options.debug||t.listener.options.debug)&&this.options.log("Listener fired",{time:Date.now()-e,info:t})}debugTime(e){return e.listener.options.debug||e.eventInfo.options.debug?Date.now():0}startTrace(e,t=null){this.traceId++;const r=this.traceId+":"+e;return this.traceMap.set(r,{id:r,sort:this.traceId,stack:this.tracing.map((e=>e)),additionalData:t,changed:[]}),this.tracing.push(r),r}stopTrace(e){const t=this.traceMap.get(e);return this.tracing.pop(),this.traceMap.delete(e),t}saveTrace(e){const t=this.traceMap.get(e);return this.tracing.pop(),this.traceMap.delete(e),this.savedTrace.push(t),t}getSavedTraces(){const e=this.savedTrace.map((e=>e));return e.sort(((e,t)=>e.sort-t.sort)),this.savedTrace=[],e}}class ObservedData{}class SimpleObservedData extends ObservedData{data={};event=(()=>new eventsExports.EventEmitter)();constructor(e){super(),this.data=e}update(e,t){t?setValueByKeyPath(t,e,this.data):this.data=e;const r={updateData:e,path:t??""};t&&this.event.emit(t,r),this.event.emit("",r)}on(e,t){this.event.on(e,t)}off(e,t){this.event.off(e,t)}getData(e){return e?getValueByKeyPath(e,this.data):this.data}destroy(){}}class DataSource extends EventEmitter$1{isInit=!1;app;mockData;#e="base";#t;#r;#n;#s=[];#i=[];constructor(e){super(),this.#t=e.schema.id,this.#r=e.schema,this.app=e.app,this.setFields(e.schema.fields),this.setMethods(e.schema.methods||[]);let t=e.initialData;const r=e.ObservedDataClass||SimpleObservedData;if("editor"===this.app.platform){const r=cloneDeep(e.schema.mocks||[]);this.mockData=r.find((e=>e.useInEditor))?.data||this.getDefaultData(),t=cloneDeep(this.mockData)}else if("boolean"==typeof e.useMock&&e.useMock){const r=cloneDeep(e.schema.mocks||[]);this.mockData=r.find((e=>e.enable))?.data,t=cloneDeep(this.mockData)||this.getDefaultData()}else{if(e.initialData)return this.#n=new r(e.initialData??{}),void(this.isInit=!0);t=this.getDefaultData()}this.#n=new r(t??{})}get id(){return this.#t}get type(){return this.#e}get schema(){return this.#r}get fields(){return this.#s}get methods(){return this.#i}setFields(e){this.#s=e}setMethods(e){this.#i=e}get data(){return this.#n.getData("")}setData(e,t){this.#n.update(e,t);const r={updateData:e,path:t};this.emit("change",r)}setValue(e,t){return this.setData(t,e)}onDataChange(e,t){this.#n.on(e,t)}offDataChange(e,t){this.#n.off(e,t)}getDefaultData(){return getDefaultValueFromFields(this.#s)}async init(){this.isInit=!0}destroy(){this.#s=[],this.removeAllListeners(),this.#n.destroy()}}const urlencoded=e=>Object.entries(e).reduce(((e,[t,r])=>{let n=r;return"object"==typeof r&&(n=JSON.stringify(r)),void 0!==r?`${e}${e?"&":""}${globalThis.encodeURIComponent(t)}=${globalThis.encodeURIComponent(`${n}`)}`:e}),""),webRequest=async e=>{const{url:t,method:r="GET",headers:n={},params:s={},data:i={},...a}=e,o=urlencoded(s);let c=JSON.stringify(i);n["Content-Type"]?.includes("application/x-www-form-urlencoded")&&(c=urlencoded(i));return(await globalThis.fetch(o?`${t}?${o}`:t,{method:r,headers:n,body:"GET"===r?void 0:c,...a})).json()};class HttpDataSource extends DataSource{isLoading=!1;error;httpOptions;#a;#o=[];#c=[];#e="http";constructor(e){const{options:t}=e.schema;super(e),this.httpOptions=t,"function"==typeof e.request?this.#a=e.request:"function"==typeof globalThis.fetch&&(this.#a=webRequest),this.methods.forEach((e=>{"function"==typeof e.content&&("beforeRequest"===e.timing&&this.#o.push(e.content),"afterRequest"===e.timing&&this.#c.push(e.content))}))}get type(){return this.#e}async init(){this.schema.autoFetch&&await this.request(),super.init()}async request(e={}){this.isLoading=!0;const{url:t,params:r,data:n,headers:s,...i}=this.httpOptions;let a={url:"function"==typeof t?t({app:this.app,dataSource:this}):t,params:"function"==typeof r?r({app:this.app,dataSource:this}):r,data:"function"==typeof n?n({app:this.app,dataSource:this}):n,headers:"function"==typeof s?s({app:this.app,dataSource:this}):s,...i,...e};try{for(const e of this.#o)await e({options:a,params:{},dataSource:this,app:this.app});if("function"==typeof this.schema.beforeRequest&&(a=await this.schema.beforeRequest(a,{app:this.app,dataSource:this})),this.mockData)this.setData(this.mockData);else{let e=await(this.#a?.(a));for(const t of this.#c)await t({res:e,options:a,params:{},dataSource:this,app:this.app});if("function"==typeof this.schema.afterResponse&&(e=await this.schema.afterResponse(e,{app:this.app,dataSource:this,options:a})),this.schema.responseOptions?.dataPath){const t=getValueByKeyPath(this.schema.responseOptions.dataPath,e);this.setData(t)}else this.setData(e)}this.error=void 0}catch(o){this.error={msg:o.message},this.emit("error",o)}this.isLoading=!1}get(e){return this.request({...e,method:"GET"})}post(e){return this.request({...e,method:"POST"})}}const cache=new Map,getDeps=(e,t,r)=>{let n;if(r){const r=[];t.forEach((e=>{traverseNode(e,(e=>{r.push(e.id)}))})),n=`${e.id}:${r.join(":")}`}else n=`${e.id}:${t.map((e=>e.id)).join(":")}`;if(cache.has(n))return cache.get(n);const s=new Watcher;s.addTarget(new Target({id:e.id,type:"data-source",isTarget:(t,r)=>!`${t}`.includes(DSL_NODE_KEY_COPY_PREFIX)&&isDataSourceTarget(e,t,r,!0)})),s.addTarget(new Target({id:e.id,type:"cond",isTarget:(t,r)=>isDataSourceCondTarget(e,t,r,!0)})),s.collect(t,{},!0);const{deps:i}=s.getTarget(e.id,"data-source"),{deps:a}=s.getTarget(e.id,"cond"),o={deps:i,condDeps:a};return cache.set(n,o),o},compiledCondition=(e,t)=>{let r=!0;for(const{op:s,value:i,range:a,field:o}of e){const[e,...c]=o,u=t[e];if(!u||!c.length)break;try{const e=getValueByKeyPath(c.join("."),u);if(!compiledCond(s,e,i,a)){r=!1;break}}catch(n){console.warn(n)}}return r},compliedConditions=(e,t)=>{if(!e[NODE_CONDS_KEY]||!Array.isArray(e[NODE_CONDS_KEY])||!e[NODE_CONDS_KEY].length)return!0;for(const{cond:r}of e[NODE_CONDS_KEY])if(r&&compiledCondition(r,t))return!0;return!1},updateNode=(e,t)=>{if(isPage(e)||isPageFragment(e)){const r=t.items?.findIndex((t=>t.id===e.id));t.items.splice(r,1,e)}else replaceChildNode(e,t.items)},createIteratorContentData=(e,t,r=[],n={})=>{const s={...n,[t]:{}};let i=cloneDeep(n[t]),a=s[t];return r.forEach(((t,n)=>{Object.assign(a,i),n!==r.length-1?(Array.isArray(i[t])&&(i[t]={},a[t]={}),i=i[t],a=a[t]):a[t]=e})),s},compliedDataSourceField=(e,t)=>{const[r,...n]=e,s=r.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);if(s>-1){const a=t[r.substring(s+DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length)];if(!a)return e;try{return getValueByKeyPath(n.join("."),a)}catch(i){return e}}return e},template=(e,t)=>e.replaceAll(dataSourceTemplateRegExp,((e,r)=>{try{return getValueByKeyPath(r,t)}catch(n){return e}})),compiledNodeField=(e,t)=>"string"==typeof e?template(e,t):e?.isBindDataSource&&e.dataSourceId?t[e.dataSourceId]:e?.isBindDataSourceField&&e.dataSourceId&&"string"==typeof e.template?template(e.template,t[e.dataSourceId]):Array.isArray(e)&&"string"==typeof e[0]?compliedDataSourceField(e,t):e,compliedIteratorItem=({compile:e,dsId:t,item:r,deps:n,condDeps:s,inEditor:i,ctxData:a})=>{const{items:o,...c}=r,u=cloneDeep(c);return s[c.id]?.keys.length&&!i&&(u.condResult=compliedConditions(c,a)),Array.isArray(o)&&o.length?u.items=o.map((r=>compliedIteratorItem({compile:e,dsId:t,item:r,deps:n,condDeps:s,inEditor:i,ctxData:a}))):o&&(u.items=o),n[u.id]?.keys.length?compiledNode(e,u,{[t]:n},t):u},registerDataSourceOnDemand=async(e,t)=>{const{dataSourceMethodsDeps:r={},dataSourceCondDeps:n={},dataSourceDeps:s={},dataSources:i=[]}=e,a={};i.forEach((e=>{let i=n[e.id]||{};Object.keys(i).length||(i=s[e.id]||{}),Object.keys(i).length||(i=r[e.id]||{}),Object.keys(i).length&&t[e.type]&&(a[e.type]=t[e.type])}));const o=await Promise.all(Object.values(a).map((e=>e()))),c={};return o.forEach(((e,t)=>{const r=Object.keys(a)[t];c[r]=e.default})),c};class DataSourceManager extends EventEmitter$1{static dataSourceClassMap=(()=>new Map([["base",DataSource],["http",HttpDataSource]]))();static ObservedDataClass=(()=>SimpleObservedData)();static waitInitSchemaList=(()=>new Map)();static register(e,t){DataSourceManager.dataSourceClassMap.set(e,t),DataSourceManager.waitInitSchemaList?.forEach(((t,r)=>{const n=t[e]||[];for(let e=n.shift();e;e=n.shift()){const t=r.addDataSource(e);t&&r.init(t)}}))}static getDataSourceClass(e){return DataSourceManager.dataSourceClassMap.get(e)}static clearDataSourceClass(){DataSourceManager.dataSourceClassMap.clear(),DataSourceManager.dataSourceClassMap.set("base",DataSource),DataSourceManager.dataSourceClassMap.set("http",HttpDataSource)}static registerObservedData(e){DataSourceManager.ObservedDataClass=e}app;dataSourceMap=(()=>new Map)();data={};useMock=!1;constructor({app:e,useMock:t,initialData:r}){super(),DataSourceManager.waitInitSchemaList.set(this,{}),this.app=e,this.useMock=t,r&&(this.data=r),e.dsl?.dataSources?.forEach((e=>{this.addDataSource(e)}));const n=Array.from(this.dataSourceMap);"function"==typeof Promise.allSettled?Promise.allSettled(n.map((([,e])=>this.init(e)))).then((e=>{const t={},r={};e.forEach(((e,s)=>{const i=n[s][0];"fulfilled"===e.status?this.data[i]?t[i]=this.data[i]:delete t[i]:"rejected"===e.status&&(delete t[i],r[i]=e.reason)})),this.emit("init",t,r)})):Promise.all(n.map((([,e])=>this.init(e)))).then((()=>{this.emit("init",this.data)})).catch((()=>{this.emit("init",this.data)}))}async init(e){if(!(e.isInit||this.app.jsEngine&&e.schema.disabledInitInJsEngine?.includes(this.app.jsEngine))){for(const t of e.methods){if("function"!=typeof t.content)return;"beforeInit"===t.timing&&await t.content({params:{},dataSource:e,app:this.app})}await e.init();for(const t of e.methods){if("function"!=typeof t.content)return;"afterInit"===t.timing&&await t.content({params:{},dataSource:e,app:this.app})}}}get(e){return this.dataSourceMap.get(e)}addDataSource(e){if(!e)return;const t=DataSourceManager.dataSourceClassMap.get(e.type);if(!t){let t=DataSourceManager.waitInitSchemaList.get(this);return t||(t={},DataSourceManager.waitInitSchemaList.set(this,t)),void(t[e.type]?t[e.type].push(e):t[e.type]=[e])}const r=new t({app:this.app,schema:e,request:this.app.request,useMock:this.useMock,initialData:this.data[e.id],ObservedDataClass:DataSourceManager.ObservedDataClass});return this.dataSourceMap.set(e.id,r),this.data[r.id]=r.data,r.on("change",(e=>{this.setData(r,e)})),r}setData(e,t){this.data[e.id]=e.data,this.emit("change",e.id,t)}removeDataSource(e){this.get(e)?.destroy(),delete this.data[e],this.dataSourceMap.delete(e)}updateSchema(e){e.forEach((e=>{if(!this.get(e.id))return;this.removeDataSource(e.id),this.addDataSource(cloneDeep(e));const t=this.get(e.id);t&&this.init(t)}))}compiledNode({items:e,...t},r,n=!1){const s=cloneDeep(t);return e&&(s.items=Array.isArray(e)&&n?e.map((e=>this.compiledNode(e,r,n))):e),!1===t.condResult||!1===t.visible?s:compiledNode((e=>compiledNodeField(e,this.data)),s,this.app.dsl?.dataSourceDeps||{},r)}compliedConds(e){return compliedConditions(e,this.data)}compliedIteratorItemConds(e,t,r=[]){const[n,...s]=r,i=this.get(n);if(!i)return!0;const a=createIteratorContentData(e,i.id,s,this.data);return compliedConditions(t,a)}compliedIteratorItems(e,t,r=[]){const[n,...s]=r,i=this.get(n);if(!i)return t;const a="editor"===this.app.platform,o=createIteratorContentData(e,i.id,s,this.data),{deps:c={},condDeps:u={}}=getDeps(i.schema,t,a);return Object.keys(c).length||Object.keys(u).length?t.map((e=>compliedIteratorItem({compile:e=>compiledNodeField(e,o),dsId:i.id,item:e,deps:c,condDeps:u,inEditor:a,ctxData:o}))):t}destroy(){this.removeAllListeners(),this.data={},this.dataSourceMap.forEach((e=>{e.destroy()})),this.dataSourceMap.clear(),DataSourceManager.waitInitSchemaList.delete(this)}onDataChange(e,t,r){return this.get(e)?.onDataChange(t,r)}offDataChange(e,t,r){return this.get(e)?.offDataChange(t,r)}}const createDataSourceManager=(e,t,r)=>{const{dsl:n,platform:s}=e;if(!n?.dataSources)return;const i=new DataSourceManager({app:e,useMock:t,initialData:r});return n.dataSources&&n.dataSourceCondDeps&&"editor"!==s&&getNodes(getDepNodeIds(n.dataSourceCondDeps),n.items).forEach((e=>{e.condResult=i.compliedConds(e),updateNode(e,n)})),n.dataSources&&n.dataSourceDeps&&getNodes(getDepNodeIds(n.dataSourceDeps),n.items).forEach((e=>{updateNode(i.compiledNode(e),n)})),"nodejs"!==e.jsEngine&&i.on("change",((t,r)=>{const s=n.dataSourceDeps?.[t]||{},a=n.dataSourceCondDeps?.[t]||{},o=union([...Object.keys(a),...Object.keys(s)]),c=e.page?.data&&"editor"!==e.platform?[e.page.data]:n.items;i.emit("update-data",getNodes(o,c).map((t=>{"editor"!==e.platform&&(t.condResult=i.compliedConds(t));const r=i.compiledNode(t);if("function"==typeof e.page?.setData)if(isPage(r))e.page.setData(r);else{const n=e.page.getNode(t.id);n?.setData(r)}return r})),t,r)})),i},ignoreFirstCall=e=>{let t=0;return(...r)=>{if(0!==t)return e(...r);t+=1}};class DeepObservedData extends ObservedData{state;subscribers=(()=>new Map)();constructor(e){super(),this.state=new DeepState(e)}update=(e,t)=>{this.state?.update(t??"",e)};on=(e,t)=>{const r=this.state.subscribe(e,ignoreFirstCall(t)),n=this.subscribers.get(e)??new Map;n.set(t,r),this.subscribers.set(e,n)};off=(e,t)=>{const r=this.subscribers.get(e);r&&(r.get(t)?.(),r.delete(t))};getData=e=>this.state?this.state?.get(e):{};destroy=()=>{this.subscribers.forEach((e=>{e.forEach((e=>e()))}))}}var NodeType=(e=>(e.CONTAINER="container",e.PAGE="page",e.ROOT="app",e.PAGE_FRAGMENT="page-fragment",e))(NodeType||{});const NODE_CONDS_KEY="displayConds";var ActionType=(e=>(e.COMP="comp",e.CODE="code",e.DATA_SOURCE="data-source",e))(ActionType||{}),HookType=(e=>(e.CODE="code",e))(HookType||{}),HookCodeType=(e=>(e.CODE="code",e.DATA_SOURCE_METHOD="data-source-method",e))(HookCodeType||{});const toLine=(e="")=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),getNodePath=(e,t=[])=>{const r=[],n=function(e,t){if(!Array.isArray(t))return null;for(let s=0,i=t.length;s<i;s++){const i=t[s];if(r.push(i),`${i.id}`==`${e}`)return i;if(i.items){const t=n(e,i.items);if(t)return t}r.pop()}return null};return n(e,t),r},filterXSS=e=>e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),getUrlParam=(e,t)=>{const r=location.href,n=new RegExp(`[?&#]${e}=([^&#]+)`,"gi"),s=r.match(n);let i;return s&&s.length>0?(i=s[s.length-1].split("="),i&&i.length>1?filterXSS(i[1]):""):""},isObject=e=>"[object Object]"===Object.prototype.toString.call(e),isPage=e=>!!e&&Boolean(e.type?.toLowerCase()===NodeType.PAGE),isPageFragment=e=>!!e&&Boolean(e.type?.toLowerCase()===NodeType.PAGE_FRAGMENT),isNumber=e=>/^(-?\d+)(\.\d+)?$/.test(e),getKeysArray=e=>`${e}`.replaceAll(/\[(\d+)\]/g,".$1").split("."),getValueByKeyPath=(e="",t={})=>(Array.isArray(e)?e:getKeysArray(e)).reduce(((r,n)=>{if(isObject(r))return r[n];if(Array.isArray(r)&&/^\d*$/.test(`${n}`))return r[n];throw new Error(`${t}中不存在${e}`)}),t),setValueByKeyPath=(e,t,r={})=>set(r,e,t),getNodes=(e,t=[])=>{const r=[],n=function(e,t){if(Array.isArray(t))for(let s=0,i=t.length;s<i;s++){const i=t[s],a=e.findIndex((e=>`${e}`==`${i.id}`));a>-1&&(e.slice(a,1),r.push(i)),i.items&&n(e,i.items)}};return n(e,t),r},getDepKeys=(e={},t)=>Array.from(Object.values(e).reduce(((e,r)=>((r[t]?.keys||[]).forEach((t=>e.add(t))),e)),new Set)),getDepNodeIds=(e={})=>Array.from(Object.values(e).reduce(((e,t)=>(Object.keys(t).forEach((t=>{e.add(t)})),e)),new Set)),replaceChildNode=(e,t,r)=>{const n=getNodePath(e.id,t),s=n.pop();let i=n.pop();if(!s)throw new Error("未找到目标节点");if(!i)throw new Error("未找到父节点");const a=i.items?.findIndex((e=>e.id===s.id));i.items.splice(a,1,e)},DSL_NODE_KEY_COPY_PREFIX="__tmagic__",compiledNode=(e,t,r={},n)=>{let s=[];if(n){const e=r[n];s=e?.[t.id].keys||[]}else s=getDepKeys(r,t.id);return s.forEach((r=>{const n=getKeysArray(r),s=n.map(((e,t)=>t<n.length-1?e:`${DSL_NODE_KEY_COPY_PREFIX}${e}`));let i,a=getValueByKeyPath(s,t);if(void 0===a)try{const e=getValueByKeyPath(r,t);setValueByKeyPath(s.join("."),e,t),a=e}catch(o){return void console.warn(o)}try{i=e(a)}catch(o){console.error(o),i=""}setValueByKeyPath(r,i,t)})),t},compiledCond=(e,t,r,n=[])=>{switch("string"==typeof t&&void 0===r&&(r=""),e){case"is":case"=":return t===r;case"not":case"!=":return t!==r;case">":return t>r;case">=":return t>=r;case"<":return t<r;case"<=":return t<=r;case"between":return n.length>1&&t>=n[0]&&t<=n[1];case"not_between":return n.length<2||t<n[0]||t>n[1];case"include":return t?.includes?.(r);case"not_include":return void 0===t||!t.includes?.(r)}return!1},getDefaultValueFromFields=e=>{const t={},r={string:void 0,object:{},array:[],boolean:void 0,number:void 0,null:null,any:void 0};return e.forEach((e=>{if(void 0===e.defaultValue)"object"!==e.type?e.type?t[e.name]=r[e.type]:t[e.name]=void 0:t[e.name]=e.fields?getDefaultValueFromFields(e.fields):r.object;else{if("array"===e.type&&!Array.isArray(e.defaultValue))return void(t[e.name]=r.array);if("object"===e.type&&!isObject(e.defaultValue)){if("string"==typeof e.defaultValue){try{t[e.name]=JSON.parse(e.defaultValue)}catch(n){t[e.name]=r.object,console.warn("defaultValue 解析失败",e.defaultValue,n)}return}return void(t[e.name]=r.object)}t[e.name]=cloneDeep(e.defaultValue)}})),t},DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX="ds-field::",DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX="ds-field-changed",dataSourceTemplateRegExp=/\$\{([\s\S]+?)\}/g,traverseNode=(e,t,r=[],n=!1)=>{n||t(e,r),Array.isArray(e.items)&&e.items.length&&(r.push(e),e.items.forEach((e=>{traverseNode(e,t,[...r],n)}))),n&&t(e,r)};var DepTargetType=(e=>(e.DEFAULT="default",e.CODE_BLOCK="code-block",e.DATA_SOURCE="data-source",e.DATA_SOURCE_METHOD="data-source-method",e.DATA_SOURCE_COND="data-source-cond",e))(DepTargetType||{});class Target{isTarget;id;name;type=(()=>DepTargetType.DEFAULT)();deps={};isCollectByDefault;constructor(e){this.isTarget=e.isTarget,this.id=e.id,this.name=e.name,this.isCollectByDefault=e.isCollectByDefault??!0,e.type&&(this.type=e.type),e.initialDeps&&(this.deps=e.initialDeps)}updateDep({id:e,name:t,key:r,data:n}){const s=this.deps[e]||{name:t,keys:[]};s.name=t,s.data=n,this.deps[e]=s,-1===s.keys.indexOf(r)&&s.keys.push(r)}removeDep(e,t){if(void 0===e)return void Object.keys(this.deps).forEach((e=>{delete this.deps[e]}));const r=this.deps[e];if(r)if(t){const n=r.keys.indexOf(t);r.keys.splice(n,1),0===r.keys.length&&delete this.deps[e]}else delete this.deps[e]}hasDep(e,t){const r=this.deps[e];return Boolean(r?.keys.find((e=>e===t)))}destroy(){this.deps={}}}const isIncludeArrayField=(e,t)=>{let r=t;return e.some(((t,n)=>{const s=r.find((({name:e})=>e===t));return r=s?.fields||[],s&&"array"===s.type&&/^(?!\d+$).*$/.test(`${e[n+1]}`)&&n<e.length-1}))},isDataSourceTemplate=(e,t,r=!1)=>{const n=e.match(dataSourceTemplateRegExp)||[];if(n.length<=0)return!1;const s=[],i=[];return n.forEach((e=>{const r=e.substring(2,e.length-1),n=getKeysArray(r),a=n.shift();a&&a===t.id&&(isIncludeArrayField(n,t.fields)?s.push(e):i.push(e))})),r?s.length>0:i.length>0},isSpecificDataSourceTemplate=(e,t)=>e?.isBindDataSourceField&&e.dataSourceId&&e.dataSourceId===t&&"string"==typeof e.template,isUseDataSourceField=(e,t)=>{if(!Array.isArray(e)||"string"!=typeof e[0])return!1;const[r]=e,n=r.indexOf(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);if(-1===n)return!1;return r.substring(n+DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX.length)===t},isDataSourceTarget=(e,t,r,n=!1)=>{if(!r||!["string","object"].includes(typeof r))return!1;if(`${t}`.startsWith(NODE_CONDS_KEY))return!1;if("string"==typeof r)return isDataSourceTemplate(r,e,n);if(isObject(r)&&r?.isBindDataSource&&r.dataSourceId&&r.dataSourceId===e.id)return!0;if(isSpecificDataSourceTemplate(r,e.id))return!0;if(isUseDataSourceField(r,e.id)){const[,...t]=r,s=isIncludeArrayField(t,e.fields);return n?s:!s}return!1},isDataSourceCondTarget=(e,t,r,n=!1)=>{if(!Array.isArray(r)||!e)return!1;const[s,...i]=r;if(s!==e.id||!`${t}`.startsWith(NODE_CONDS_KEY))return!1;if(e.fields?.find((e=>e.name===i[0]))){const t=isIncludeArrayField(i,e.fields);return n?t:!t}return!1},traverseTarget=(e,t,r)=>{for(const n of Object.values(e))for(const e of Object.values(n))r&&e.type!==r||t(e)};class Watcher{targetsList={};childrenProp="items";idProp="id";nameProp="name";constructor(e){e?.initialTargets&&(this.targetsList=e.initialTargets),e?.childrenProp&&(this.childrenProp=e.childrenProp)}getTargetsList(){return this.targetsList}getTargets(e=DepTargetType.DEFAULT){return this.targetsList[e]||{}}addTarget(e){const t=this.getTargets(e.type)||{};this.targetsList[e.type]=t,t[e.id]=e}getTarget(e,t=DepTargetType.DEFAULT){return this.getTargets(t)[e]}hasTarget(e,t=DepTargetType.DEFAULT){return Boolean(this.getTarget(e,t))}hasSpecifiedTypeTarget(e=DepTargetType.DEFAULT){return Object.keys(this.getTargets(e)).length>0}removeTarget(e,t=DepTargetType.DEFAULT){const r=this.getTargets(t);r[e]&&(r[e].destroy(),delete r[e])}removeTargets(e=DepTargetType.DEFAULT){const t=this.targetsList[e];if(t){for(const e of Object.values(t))e.destroy();delete this.targetsList[e]}}clearTargets(){for(const e of Object.keys(this.targetsList))delete this.targetsList[e]}collect(e,t={},r=!1,n){this.collectByCallback(e,n,(({node:e,target:n})=>{this.removeTargetDep(n,e),this.collectItem(e,n,t,r)}))}collectByCallback(e,t,r){traverseTarget(this.targetsList,(n=>{if(t||n.isCollectByDefault)for(const t of e)r({node:t,target:n})}),t)}clear(e,t){let{targetsList:r}=this;t&&(r={[t]:this.getTargets(t)});const n=[];traverseTarget(r,(t=>{if(e)for(const r of e)t.removeDep(r[this.idProp]),Array.isArray(r[this.childrenProp])&&r[this.childrenProp].length&&!n.includes(r[this.idProp])&&(n.push(r[this.idProp]),this.clear(r[this.childrenProp]));else t.removeDep()}))}clearByType(e,t){this.clear(t,e)}collectItem(e,t,r={},n=!1){const s=(i,a="")=>{const o=(i,o)=>{const c=i===this.childrenProp,u=a?`${a}.${i}`:i;if(t.isTarget(u,o))t.updateDep({id:e[this.idProp],name:`${e[this.nameProp]||e[this.idProp]}`,data:r,key:u});else if(!c&&Array.isArray(o))for(let e=0,t=o.length;e<t;e++){const t=o[e];isObject(t)&&s(t,`${u}[${e}]`)}else isObject(o)&&s(o,u);if(c&&n&&Array.isArray(o))for(const e of o)this.collectItem(e,t,r,n)};for(const[e,t]of Object.entries(i))void 0!==t&&""!==t&&o(e,t)};s(e)}removeTargetDep(e,t,r){if(e.removeDep(t[this.idProp],r),void 0===r&&Array.isArray(t[this.childrenProp])&&t[this.childrenProp].length)for(const n of t[this.childrenProp])this.removeTargetDep(e,n,r)}}class Env{isIos=!1;isIphone=!1;isIpad=!1;isAndroid=!1;isAndroidPad=!1;isMac=!1;isWin=!1;isMqq=!1;isWechat=!1;isWeb=!1;isOpenHarmony=!1;constructor(e=globalThis.navigator?.userAgent??"",t={}){e&&(this.isIphone=e.indexOf("iPhone")>=0,this.isIpad=/(iPad).*OS\s([\d_]+)/.test(e),this.isIos=this.isIphone||this.isIpad,this.isAndroid=e.indexOf("Android")>=0,this.isAndroidPad=this.isAndroid&&e.indexOf("Mobile")<0,this.isMac=e.indexOf("Macintosh")>=0,this.isWin=e.indexOf("Windows")>=0,this.isMqq=/QQ\/([\d.]+)/.test(e),this.isWechat=e.indexOf("MicroMessenger")>=0&&e.indexOf("wxwork")<0,this.isOpenHarmony=e.includes("OpenHarmony"),this.isWeb=!(this.isIos||this.isAndroid||this.isOpenHarmony||/(WebOS|BlackBerry)/.test(e)),Object.entries(t).forEach((([e,t])=>{this[e]=t})))}}class FlowState{isAbort;constructor(){this.isAbort=!1}abort(){this.isAbort=!0}reset(){this.isAbort=!1}}class EventHelper extends eventsExports.EventEmitter{app;nodeEventList=(()=>new Map)();dataSourceEventList=(()=>new Map)();constructor({app:e}){super(),this.app=e}destroy(){this.removeNodeEvents(),this.removeAllListeners(),this.nodeEventList.clear(),this.dataSourceEventList.clear()}bindNodeEvents(e){e.events?.forEach(((t,r)=>{let n=`${t.name}_${e.data.id}`;const s=t.name.split(".");s.length>1&&(n=`${s[1]}_${s[0]}`);let i=Symbol(n);e.eventKeys.has(n)?i=e.eventKeys.get(n):e.eventKeys.set(n,i);const a=(t,...n)=>{this.eventHandler(r,e,n)};this.nodeEventList.set(a,i),this.on(i,a)}))}removeNodeEvents(){Array.from(this.nodeEventList.keys()).forEach((e=>{const t=this.nodeEventList.get(e);t&&this.off(t,e)})),this.nodeEventList.clear()}bindDataSourceEvents(e){this.removeDataSourceEvents(e),e.forEach((e=>{const t=this.dataSourceEventList.get(e.id)??new Map;(e.schema.events||[]).forEach((r=>{const[n,...s]=r.name?.split(".")||[];if(!n)return;const i=(...t)=>{this.eventHandler(r,e,t)};t.set(r.name,i),n===DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX?e?.onDataChange(s.join("."),i):e.on(n,i)})),this.dataSourceEventList.set(e.id,t)}))}removeDataSourceEvents(e){this.dataSourceEventList.size&&(e.forEach((e=>{const t=this.dataSourceEventList.get(e.id);t&&Array.from(t.keys()).forEach((r=>{const[n,...s]=r.split(".");n===DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX?e.offDataChange(s.join("."),t.get(r)):e.off(n,t.get(r))}))})),this.dataSourceEventList.clear())}async eventHandler(e,t,r){const n="number"==typeof e?t.events[e]:e;if(has(n,"actions")){const s=new FlowState,{actions:i}=n;for(let n=0;n<i.length&&!s?.isAbort;n++)if("number"==typeof e){const i=t.events[e].actions[n];this.actionHandler(i,t,r,s)}else this.actionHandler(i[n],t,r,s);s.reset()}else try{await this.compActionHandler(n,t,r)}catch(s){if(!this.app.errorHandler)throw s;this.app.errorHandler(s,t,{type:"action-handler",config:n,...r})}}async actionHandler(e,t,r,n){try{if(e.actionType===ActionType.COMP){const n=e;await this.compActionHandler(n,t,r)}else if(e.actionType===ActionType.CODE){const t=e;await this.app.runCode(t.codeId,t.params||{},r,n)}else if(e.actionType===ActionType.DATA_SOURCE){const t=e,[s,i]=t.dataSourceMethod;await this.app.runDataSourceMethod(s,i,t.params||{},r,n)}}catch(s){if(!this.app.errorHandler)throw s;this.app.errorHandler(s,t,{type:"action-handler",config:e,flowState:n,...r})}}async compActionHandler(e,t,r){if(!this.app.page)throw new Error("当前没有页面");let{method:n,to:s}=e;Array.isArray(n)&&([s,n]=n);const i=this.app.getNode(s);if(!i)throw new Error(`ID为${s}的组件不存在`);i.instance?"function"==typeof i.instance[n]&&await i.instance[n](t,...r):i.addEventToQueue({method:n,fromCpt:t,args:r})}}class Flexible{designWidth=375;tid;constructor(e){"complete"===globalThis.document.readyState?this.setBodyFontSize():globalThis.document.addEventListener("DOMContentLoaded",this.setBodyFontSize,!1),globalThis.addEventListener("resize",this.resizeHandler,!1),globalThis.addEventListener("pageshow",this.pageshowHandler,!1),void 0!==e?.designWidth&&this.setDesignWidth(e.designWidth)}destroy(){globalThis.document.removeEventListener("DOMContentLoaded",this.setBodyFontSize,!1),globalThis.removeEventListener("resize",this.resizeHandler,!1),globalThis.removeEventListener("pageshow",this.pageshowHandler,!1)}setDesignWidth(e){this.designWidth=e,this.refreshRem()}setBodyFontSize(){globalThis.document.body.style.fontSize=".12rem"}refreshRem(){const{width:e}=document.documentElement.getBoundingClientRect(),t=e/(this.designWidth/100);globalThis.document.documentElement.style.fontSize=`${t}px`,globalThis.document.documentElement.style.fontSize=`${this.correctRem(t)}px`}correctRem(e){const{document:t}=globalThis,r=t.createElement("div");r.style.cssText="width:1rem;height:0;overflow:hidden;position:absolute;z-index:-1;visibility:hidden;",t.documentElement.appendChild(r);const n=r.offsetWidth;return t.documentElement.removeChild(r),Math.abs(n-e)>1?e**2/n:e}resizeHandler=()=>{clearTimeout(this.tid),this.tid=setTimeout((()=>{this.refreshRem(),this.tid=void 0}),300)};pageshowHandler=e=>{e.persisted&&this.resizeHandler()}}class Store{data={};set(e,t){this.data[e]=t}get(e){return this.data[e]}}class Node extends eventsExports.EventEmitter{data;style;events=[];instance={};page;parent;app;store=(()=>new Store)();eventKeys=(()=>new Map)();eventQueue=[];constructor(e){super(),this.page=e.page,this.parent=e.parent,this.app=e.app,this.setData(e.config),this.listenLifeSafe()}setData(e){this.data=e;const{events:t,style:r}=e;this.events=t||[],this.style=r||{};try{this.instance.config=e}catch(n){}this.emit("update-data",e)}addEventToQueue(e){this.eventQueue.push(e)}registerMethod(e){if(e){this.instance||(this.instance={});for(const[t,r]of Object.entries(e))"function"==typeof r&&(this.instance[t]=r)}}setInstance(e){this.instance=e}async runHookCode(e,t){if("function"==typeof this.data[e])return void(await this.data[e](this));const r=this.data[e];if(r?.hookType===HookType.CODE)for(const n of r.hookData){const{codeType:e=HookCodeType.CODE,codeId:r,params:s={}}=n;let i;const a={app:this.app,node:this,params:t||s};if(e===HookCodeType.CODE&&"string"==typeof r&&this.app.codeDsl?.[r])i=this.app.codeDsl[r].content;else if(e===HookCodeType.DATA_SOURCE_METHOD&&Array.isArray(r)&&r.length>1){const e=this.app.dataSourceManager?.get(r[0]);i=e?.methods.find((e=>e.name===r[1]))?.content,a.dataSource=e}i&&"function"==typeof i&&await i(a)}}destroy(){this.eventQueue.length=0,this.instance=null,this.events=[],this.style={},this.removeAllListeners()}listenLifeSafe(){this.once("created",(e=>{this.once("destroy",(()=>{this.instance=null,"function"==typeof this.data.destroy&&this.data.destroy(this),this.listenLifeSafe()})),e&&this.setInstance(e),this.runHookCode("created")})),this.once("mounted",(e=>{(async()=>{e&&this.setInstance(e);for(let t=this.eventQueue.shift();t;t=this.eventQueue.shift())"function"==typeof e[t.method]&&await e[t.method](t.fromCpt,...t.args);this.runHookCode("mounted")})()}))}}class IteratorContainer extends Node{nodes=[];setData(e){this.resetNodes(),super.setData(e)}resetNodes(){this.nodes?.forEach((e=>{e.forEach((e=>{e.destroy()}))})),this.nodes=[]}initNode(e,t,r){if(r.has(e.id)&&r.get(e.id)?.destroy(),e.type&&this.app.iteratorContainerType.has(e.type)){const n=new IteratorContainer({config:e,parent:t,page:this.page,app:this.app});return r.set(e.id,n),void this.app.eventHelper?.bindNodeEvents(n)}const n=new Node({config:e,parent:t,page:this.page,app:this.app});if(this.app.eventHelper?.bindNodeEvents(n),r.set(e.id,n),e.type&&this.app.pageFragmentContainerType.has(e.type)&&e.pageFragmentId){const t=this.app.dsl?.items?.find((t=>t.id===e.pageFragmentId));t&&(e.items=[t])}e.items?.forEach((e=>{this.initNode(e,n,r)}))}setNodes(e,t){const r=this.nodes[t]||new Map;e.forEach((e=>{this.initNode(e,this,r)})),this.nodes[t]=r}getNode(e,t){return this.nodes[t]?.get(e)}destroy(){super.destroy(),this.resetNodes()}}class Page extends Node{nodes=(()=>new Map)();constructor(e){super(e),this.setNode(e.config.id,this),e.config.items.forEach((e=>{this.initNode(e,this)}))}initNode(e,t){if(e.type&&this.app.iteratorContainerType.has(e.type))return void this.setNode(e.id,new IteratorContainer({config:e,parent:t,page:this,app:this.app}));const r=new(e.type&&App.nodeClassMap.get(e.type)||Node)({config:e,parent:t,page:this,app:this.app});if(this.setNode(e.id,r),e.type&&this.app.pageFragmentContainerType.has(e.type)&&e.pageFragmentId){const t=this.app.dsl?.items?.find((t=>t.id===e.pageFragmentId));t&&(e.items=[t])}e.items?.forEach((e=>{this.initNode(e,r)}))}getNode(e,t,r){if(this.nodes.has(e))return this.nodes.get(e);if(Array.isArray(t)&&t.length&&Array.isArray(r)){let n=this.nodes.get(t[0]);for(let e=1,s=t.length;e<s;e++)n=n?.getNode(t[e],r[e-1]);return n?.getNode(e,r[r.length-1])}}setNode(e,t){this.nodes.set(e,t)}deleteNode(e){this.nodes.delete(e)}destroy(){this.nodes.forEach((e=>{e!==this&&e.destroy()})),this.nodes.clear(),super.destroy()}}const style2Obj=e=>{if("string"!=typeof e)return e;const t={};return e.split(";").forEach((e=>{if(!e)return;const r=e.split(":");let n=r.shift(),s=r.join(":");n&&(n=n.replace(/^\s*/,"").replace(/\s*$/,""),s=s.replace(/^\s*/,"").replace(/\s*$/,""),n=n.split("-").map(((e,t)=>t>0?`${e[0].toUpperCase()}${e.substr(1)}`:e)).join(""),t[n]=s)})),t},fillBackgroundImage=e=>!e||/^url/.test(e)||/^linear-gradient/.test(e)?e:`url(${e})`,getTransform=(e,t)=>{if(!e)return[];const r=Object.entries(e).map((([e,r])=>r.trim()?("rotate"===e&&isNumber(r)&&(r=`${r}deg`),"hippy"!==t?`${e}(${r})`:{[e]:r}):""));if("hippy"===t)return r;const n=r.join(" ");return n.trim()?n:"none"},transformStyle=(e,t)=>{if(!e)return{};let r={};const n={};r="string"==typeof e?style2Obj(e):{...e};const s="hippy"===t,i=["zIndex","opacity","fontWeight"];return Object.entries(r).forEach((([e,r])=>{"scale"===e&&!n.transform&&s?n.transform=[{scale:r}]:"backgroundImage"!==e||s?"transform"===e&&"string"!=typeof r?n[e]=getTransform(r,t):!i.includes(e)&&r&&/^[-]?[0-9]*[.]?[0-9]*$/.test(r)?n[e]=s?r:r/100+"rem":n[e]=r:r&&(n[e]=fillBackgroundImage(r))})),n};class App extends eventsExports.EventEmitter{static nodeClassMap=(()=>new Map)();static registerNode(e,t){App.nodeClassMap.set(e,t)}env;dsl;codeDsl;dataSourceManager;page;useMock=!1;platform="mobile";jsEngine="browser";components=(()=>new Map)();pageFragmentContainerType=(()=>new Set(["page-fragment-container"]))();iteratorContainerType=(()=>new Set(["iterator-container"]))();request;transformStyle;eventHelper;errorHandler;flexible;constructor(e){if(super(),e.env?this.setEnv(e.env):this.setEnv(e.ua),this.errorHandler=e.errorHandler,this.codeDsl=e.config?.codeBlocks,e.platform&&(this.platform=e.platform),e.jsEngine&&(this.jsEngine=e.jsEngine),e.pageFragmentContainerType){(Array.isArray(e.pageFragmentContainerType)?e.pageFragmentContainerType:[e.pageFragmentContainerType]).forEach((e=>{this.pageFragmentContainerType.add(e)}))}if(e.iteratorContainerType){(Array.isArray(e.iteratorContainerType)?e.iteratorContainerType:[e.iteratorContainerType]).forEach((e=>{this.iteratorContainerType.add(e)}))}"boolean"==typeof e.useMock&&(this.useMock=e.useMock),"browser"!==this.jsEngine||e.disabledFlexible||(this.flexible=new Flexible({designWidth:e.designWidth})),"editor"!==this.platform&&(this.eventHelper=new EventHelper({app:this})),this.transformStyle=e.transformStyle||(e=>transformStyle(e,this.jsEngine)),e.request&&(this.request=e.request),e.config&&this.setConfig(e.config,e.curPage)}setEnv(e){this.env=e&&"string"!=typeof e?e:new Env(e)}setDesignWidth(e){this.flexible?.setDesignWidth(e)}setConfig(e,t){this.dsl=e,!t&&e.items.length&&(t=e.items[0].id),this.dataSourceManager&&this.dataSourceManager.destroy(),this.dataSourceManager=createDataSourceManager(this,this.useMock),this.codeDsl=e.codeBlocks;const r=t||this.page?.data?.id;if(super.emit("dsl-change",{dsl:e,curPage:r}),this.setPage(r),this.dataSourceManager){const e=Array.from(this.dataSourceManager.dataSourceMap.values());this.eventHelper?.bindDataSourceEvents(e)}}setPage(e){const t=this.dsl?.items.find((t=>`${t.id}`==`${e}`));if(!t)return this.deletePage(),void super.emit("page-change");if(this.page){if(t===this.page.data)return;this.page.destroy()}if(this.page=new Page({config:t,app:this}),this.eventHelper){this.eventHelper.removeNodeEvents();for(const[,e]of this.page.nodes)this.eventHelper.bindNodeEvents(e)}super.emit("page-change",this.page)}deletePage(){this.page?.destroy(),this.eventHelper?.removeNodeEvents(),this.page=void 0}getPage(e){return e?this.page&&`${this.page.data.id}`==`${e}`?this.page:void 0:this.page}getNode(e,t,r){return this.page?.getNode(e,t,r)}registerComponent(e,t){this.components.set(e,t)}unregisterComponent(e){this.components.delete(e)}resolveComponent(e){return this.components.get(e)}emit(e,...t){const[r,...n]=t;return this.eventHelper&&r instanceof Node&&r.data?.id&&r.eventKeys.has(`${String(e)}_${r.data.id}`)?this.eventHelper?.emit(r.eventKeys.get(`${String(e)}_${r.data.id}`),r,...n):super.emit(e,...t)}async runCode(e,t,r,n){if(!e||isEmpty(this.codeDsl))return;const s=this.codeDsl?.[e]?.content;if("function"==typeof s)try{await s({app:this,params:t,eventParams:r,flowState:n})}catch(i){if(!this.errorHandler)throw i;this.errorHandler(i,void 0,{type:"run-code",codeId:e,params:t,eventParams:r,flowState:n})}}async runDataSourceMethod(e,t,r,n,s){if(!e||!t)return;const i=this.dataSourceManager?.get(e);if(!i)return;const a=(i.methods||[]).find((e=>e.name===t));if(a&&"function"==typeof a.content)try{await a.content({app:this,params:r,dataSource:i,eventParams:n,flowState:s})}catch(o){if(!this.errorHandler)throw o;this.errorHandler(o,i,{type:"data-source-method",params:r,eventParams:n,flowState:s})}}destroy(){this.removeAllListeners(),this.page=void 0,this.flexible?.destroy(),this.flexible=void 0,this.eventHelper?.destroy(),this.dsl=void 0,this.dataSourceManager?.destroy(),this.dataSourceManager=void 0,this.codeDsl=void 0,this.components.clear()}}const scriptRel="modulepreload",assetsURL=function(e){return"/tmagic-editor/playground/runtime/vue3/page/"+e},seen={},__vitePreload=function(e,t,r){let n=Promise.resolve();function s(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return n.then((t=>{for(const e of t||[])"rejected"===e.status&&s(e.reason);return e().catch(s)}))},components={page:()=>__vitePreload((()=>module.import("./index-legacy-CccXmG9s.js")),void 0),container:()=>__vitePreload((()=>module.import("./Container-legacy-C3e0AbPo.js")),void 0),button:()=>__vitePreload((()=>module.import("./index-legacy-CPwmulOK.js")),void 0),text:()=>__vitePreload((()=>module.import("./index-legacy-BMkuKRlR.js")),void 0),img:()=>__vitePreload((()=>module.import("./index-legacy-CEyn2vOx.js")),void 0),qrcode:()=>__vitePreload((()=>module.import("./index-legacy-v6XGvW-q.js")),void 0),overlay:()=>__vitePreload((()=>module.import("./index-legacy-D914Rki5.js")),void 0),"page-fragment-container":()=>__vitePreload((()=>module.import("./PageFragmentContainer-legacy-BvHYBm2n.js")),void 0),"page-fragment":()=>__vitePreload((()=>module.import("./PageFragment-legacy-DDcN5f8A.js")),void 0),"iterator-container":()=>__vitePreload((()=>module.import("./IteratorContainer-legacy-DspfzOVX.js")),void 0)},datasources={},plugins={};var axios$2={exports:{}},bind,hasRequiredBind,utils,hasRequiredUtils,buildURL,hasRequiredBuildURL,InterceptorManager_1,hasRequiredInterceptorManager,normalizeHeaderName,hasRequiredNormalizeHeaderName,enhanceError,hasRequiredEnhanceError,createError,hasRequiredCreateError,settle,hasRequiredSettle,cookies,hasRequiredCookies,isAbsoluteURL,hasRequiredIsAbsoluteURL,combineURLs,hasRequiredCombineURLs,buildFullPath,hasRequiredBuildFullPath,parseHeaders,hasRequiredParseHeaders,isURLSameOrigin,hasRequiredIsURLSameOrigin,Cancel_1,hasRequiredCancel,xhr,hasRequiredXhr,defaults_1,hasRequiredDefaults,transformData,hasRequiredTransformData,isCancel,hasRequiredIsCancel,dispatchRequest,hasRequiredDispatchRequest,mergeConfig,hasRequiredMergeConfig,data,hasRequiredData,validator,hasRequiredValidator,Axios_1,hasRequiredAxios$2,CancelToken_1,hasRequiredCancelToken,spread,hasRequiredSpread,isAxiosError,hasRequiredIsAxiosError,hasRequiredAxios$1,axios$1,hasRequiredAxios;function requireBind(){return hasRequiredBind||(hasRequiredBind=1,bind=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}),bind}function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;var e=requireBind(),t=Object.prototype.toString;function r(e){return Array.isArray(e)}function n(e){return void 0===e}function s(e){return"[object ArrayBuffer]"===t.call(e)}function i(e){return null!==e&&"object"==typeof e}function a(e){if("[object Object]"!==t.call(e))return!1;var r=Object.getPrototypeOf(e);return null===r||r===Object.prototype}function o(e){return"[object Function]"===t.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}return utils={isArray:r,isArrayBuffer:s,isBuffer:function(e){return null!==e&&!n(e)&&null!==e.constructor&&!n(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===t.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&s(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:i,isPlainObject:a,isUndefined:n,isDate:function(e){return"[object Date]"===t.call(e)},isFile:function(e){return"[object File]"===t.call(e)},isBlob:function(e){return"[object Blob]"===t.call(e)},isFunction:o,isStream:function(e){return i(e)&&o(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===t.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function e(){var t={};function n(n,s){a(t[s])&&a(n)?t[s]=e(t[s],n):a(n)?t[s]=e({},n):r(n)?t[s]=n.slice():t[s]=n}for(var s=0,i=arguments.length;s<i;s++)c(arguments[s],n);return t},extend:function(t,r,n){return c(r,(function(r,s){t[s]=n&&"function"==typeof r?e(r,n):r})),t},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},utils}function requireBuildURL(){if(hasRequiredBuildURL)return buildURL;hasRequiredBuildURL=1;var e=requireUtils();function t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}return buildURL=function(r,n,s){if(!n)return r;var i;if(s)i=s(n);else if(e.isURLSearchParams(n))i=n.toString();else{var a=[];e.forEach(n,(function(r,n){null!=r&&(e.isArray(r)?n+="[]":r=[r],e.forEach(r,(function(r){e.isDate(r)?r=r.toISOString():e.isObject(r)&&(r=JSON.stringify(r)),a.push(t(n)+"="+t(r))})))})),i=a.join("&")}if(i){var o=r.indexOf("#");-1!==o&&(r=r.slice(0,o)),r+=(-1===r.indexOf("?")?"?":"&")+i}return r}}function requireInterceptorManager(){if(hasRequiredInterceptorManager)return InterceptorManager_1;hasRequiredInterceptorManager=1;var e=requireUtils();function t(){this.handlers=[]}return t.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},t.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},t.prototype.forEach=function(t){e.forEach(this.handlers,(function(e){null!==e&&t(e)}))},InterceptorManager_1=t}function requireNormalizeHeaderName(){if(hasRequiredNormalizeHeaderName)return normalizeHeaderName;hasRequiredNormalizeHeaderName=1;var e=requireUtils();return normalizeHeaderName=function(t,r){e.forEach(t,(function(e,n){n!==r&&n.toUpperCase()===r.toUpperCase()&&(t[r]=e,delete t[n])}))}}function requireEnhanceError(){return hasRequiredEnhanceError||(hasRequiredEnhanceError=1,enhanceError=function(e,t,r,n,s){return e.config=t,r&&(e.code=r),e.request=n,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}),enhanceError}function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var e=requireEnhanceError();return createError=function(t,r,n,s,i){var a=new Error(t);return e(a,r,n,s,i)},createError}function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var e=requireCreateError();return settle=function(t,r,n){var s=n.config.validateStatus;n.status&&s&&!s(n.status)?r(e("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}}function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var e=requireUtils();return cookies=e.isStandardBrowserEnv()?{write:function(t,r,n,s,i,a){var o=[];o.push(t+"="+encodeURIComponent(r)),e.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),e.isString(s)&&o.push("path="+s),e.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}}function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL?isAbsoluteURL:(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)})}function requireCombineURLs(){return hasRequiredCombineURLs?combineURLs:(hasRequiredCombineURLs=1,combineURLs=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e})}function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var e=requireIsAbsoluteURL(),t=requireCombineURLs();return buildFullPath=function(r,n){return r&&!e(n)?t(r,n):n}}function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var e=requireUtils(),t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(r){var n,s,i,a={};return r?(e.forEach(r.split("\n"),(function(r){if(i=r.indexOf(":"),n=e.trim(r.substr(0,i)).toLowerCase(),s=e.trim(r.substr(i+1)),n){if(a[n]&&t.indexOf(n)>=0)return;a[n]="set-cookie"===n?(a[n]?a[n]:[]).concat([s]):a[n]?a[n]+", "+s:s}})),a):a}}function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var e=requireUtils();return isURLSameOrigin=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function s(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=s(window.location.href),function(r){var n=e.isString(r)?s(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}}function requireCancel(){if(hasRequiredCancel)return Cancel_1;function e(e){this.message=e}return hasRequiredCancel=1,e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Cancel_1=e}function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var e=requireUtils(),t=requireSettle(),r=requireCookies(),n=requireBuildURL(),s=requireBuildFullPath(),i=requireParseHeaders(),a=requireIsURLSameOrigin(),o=requireCreateError(),c=requireDefaults(),u=requireCancel();return xhr=function(l){return new Promise((function(d,h){var p,f=l.data,g=l.headers,m=l.responseType;function y(){l.cancelToken&&l.cancelToken.unsubscribe(p),l.signal&&l.signal.removeEventListener("abort",p)}e.isFormData(f)&&delete g["Content-Type"];var b=new XMLHttpRequest;if(l.auth){var v=l.auth.username||"",T=l.auth.password?unescape(encodeURIComponent(l.auth.password)):"";g.Authorization="Basic "+btoa(v+":"+T)}var S=s(l.baseURL,l.url);function E(){if(b){var e="getAllResponseHeaders"in b?i(b.getAllResponseHeaders()):null,r={data:m&&"text"!==m&&"json"!==m?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:e,config:l,request:b};t((function(e){d(e),y()}),(function(e){h(e),y()}),r),b=null}}if(b.open(l.method.toUpperCase(),n(S,l.params,l.paramsSerializer),!0),b.timeout=l.timeout,"onloadend"in b?b.onloadend=E:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(E)},b.onabort=function(){b&&(h(o("Request aborted",l,"ECONNABORTED",b)),b=null)},b.onerror=function(){h(o("Network Error",l,null,b)),b=null},b.ontimeout=function(){var e=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",t=l.transitional||c.transitional;l.timeoutErrorMessage&&(e=l.timeoutErrorMessage),h(o(e,l,t.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},e.isStandardBrowserEnv()){var w=(l.withCredentials||a(S))&&l.xsrfCookieName?r.read(l.xsrfCookieName):void 0;w&&(g[l.xsrfHeaderName]=w)}"setRequestHeader"in b&&e.forEach(g,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete g[t]:b.setRequestHeader(t,e)})),e.isUndefined(l.withCredentials)||(b.withCredentials=!!l.withCredentials),m&&"json"!==m&&(b.responseType=l.responseType),"function"==typeof l.onDownloadProgress&&b.addEventListener("progress",l.onDownloadProgress),"function"==typeof l.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",l.onUploadProgress),(l.cancelToken||l.signal)&&(p=function(e){b&&(h(!e||e&&e.type?new u("canceled"):e),b.abort(),b=null)},l.cancelToken&&l.cancelToken.subscribe(p),l.signal&&(l.signal.aborted?p():l.signal.addEventListener("abort",p))),f||(f=null),b.send(f)}))},xhr}function requireDefaults(){if(hasRequiredDefaults)return defaults_1;hasRequiredDefaults=1;var e=requireUtils(),t=requireNormalizeHeaderName(),r=requireEnhanceError(),n={"Content-Type":"application/x-www-form-urlencoded"};function s(t,r){!e.isUndefined(t)&&e.isUndefined(t["Content-Type"])&&(t["Content-Type"]=r)}var i,a={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(i=requireXhr()),i),transformRequest:[function(r,n){return t(n,"Accept"),t(n,"Content-Type"),e.isFormData(r)||e.isArrayBuffer(r)||e.isBuffer(r)||e.isStream(r)||e.isFile(r)||e.isBlob(r)?r:e.isArrayBufferView(r)?r.buffer:e.isURLSearchParams(r)?(s(n,"application/x-www-form-urlencoded;charset=utf-8"),r.toString()):e.isObject(r)||n&&"application/json"===n["Content-Type"]?(s(n,"application/json"),function(t,r,n){if(e.isString(t))try{return(r||JSON.parse)(t),e.trim(t)}catch(s){if("SyntaxError"!==s.name)throw s}return(n||JSON.stringify)(t)}(r)):r}],transformResponse:[function(t){var n=this.transitional||a.transitional,s=n&&n.silentJSONParsing,i=n&&n.forcedJSONParsing,o=!s&&"json"===this.responseType;if(o||i&&e.isString(t)&&t.length)try{return JSON.parse(t)}catch(c){if(o){if("SyntaxError"===c.name)throw r(c,this,"E_JSON_PARSE");throw c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return e.forEach(["delete","get","head"],(function(e){a.headers[e]={}})),e.forEach(["post","put","patch"],(function(t){a.headers[t]=e.merge(n)})),defaults_1=a}function requireTransformData(){if(hasRequiredTransformData)return transformData;hasRequiredTransformData=1;var e=requireUtils(),t=requireDefaults();return transformData=function(r,n,s){var i=this||t;return e.forEach(s,(function(e){r=e.call(i,r,n)})),r},transformData}function requireIsCancel(){return hasRequiredIsCancel?isCancel:(hasRequiredIsCancel=1,isCancel=function(e){return!(!e||!e.__CANCEL__)})}function requireDispatchRequest(){if(hasRequiredDispatchRequest)return dispatchRequest;hasRequiredDispatchRequest=1;var e=requireUtils(),t=requireTransformData(),r=requireIsCancel(),n=requireDefaults(),s=requireCancel();function i(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s("canceled")}return dispatchRequest=function(s){return i(s),s.headers=s.headers||{},s.data=t.call(s,s.data,s.headers,s.transformRequest),s.headers=e.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),e.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete s.headers[e]})),(s.adapter||n.adapter)(s).then((function(e){return i(s),e.data=t.call(s,e.data,e.headers,s.transformResponse),e}),(function(e){return r(e)||(i(s),e&&e.response&&(e.response.data=t.call(s,e.response.data,e.response.headers,s.transformResponse))),Promise.reject(e)}))}}function requireMergeConfig(){if(hasRequiredMergeConfig)return mergeConfig;hasRequiredMergeConfig=1;var e=requireUtils();return mergeConfig=function(t,r){r=r||{};var n={};function s(t,r){return e.isPlainObject(t)&&e.isPlainObject(r)?e.merge(t,r):e.isPlainObject(r)?e.merge({},r):e.isArray(r)?r.slice():r}function i(n){return e.isUndefined(r[n])?e.isUndefined(t[n])?void 0:s(void 0,t[n]):s(t[n],r[n])}function a(t){if(!e.isUndefined(r[t]))return s(void 0,r[t])}function o(n){return e.isUndefined(r[n])?e.isUndefined(t[n])?void 0:s(void 0,t[n]):s(void 0,r[n])}function c(e){return e in r?s(t[e],r[e]):e in t?s(void 0,t[e]):void 0}var u={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c};return e.forEach(Object.keys(t).concat(Object.keys(r)),(function(t){var r=u[t]||i,s=r(t);e.isUndefined(s)&&r!==c||(n[t]=s)})),n}}function requireData(){return hasRequiredData?data:(hasRequiredData=1,data={version:"0.25.0"})}function requireValidator(){if(hasRequiredValidator)return validator;hasRequiredValidator=1;var e=requireData().version,t={};["object","boolean","number","function","string","symbol"].forEach((function(e,r){t[e]=function(t){return typeof t===e||"a"+(r<1?"n ":" ")+e}}));var r={};return t.transitional=function(t,n,s){function i(t,r){return"[Axios v"+e+"] Transitional option '"+t+"'"+r+(s?". "+s:"")}return function(e,s,a){if(!1===t)throw new Error(i(s," has been removed"+(n?" in "+n:"")));return n&&!r[s]&&(r[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(e,s,a)}},validator={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),s=n.length;s-- >0;){var i=n[s],a=t[i];if(a){var o=e[i],c=void 0===o||a(o,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:t},validator}function requireAxios$2(){if(hasRequiredAxios$2)return Axios_1;hasRequiredAxios$2=1;var e=requireUtils(),t=requireBuildURL(),r=requireInterceptorManager(),n=requireDispatchRequest(),s=requireMergeConfig(),i=requireValidator(),a=i.validators;function o(e){this.defaults=e,this.interceptors={request:new r,response:new r}}return o.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&i.assertOptions(r,{silentJSONParsing:a.transitional(a.boolean),forcedJSONParsing:a.transitional(a.boolean),clarifyTimeoutError:a.transitional(a.boolean)},!1);var o=[],c=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(c=c&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));var u,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!c){var d=[n,void 0];for(Array.prototype.unshift.apply(d,o),d=d.concat(l),u=Promise.resolve(t);d.length;)u=u.then(d.shift(),d.shift());return u}for(var h=t;o.length;){var p=o.shift(),f=o.shift();try{h=p(h)}catch(g){f(g);break}}try{u=n(h)}catch(g){return Promise.reject(g)}for(;l.length;)u=u.then(l.shift(),l.shift());return u},o.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=s(this.defaults,e),t(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},e.forEach(["delete","get","head","options"],(function(e){o.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),e.forEach(["post","put","patch"],(function(e){o.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),Axios_1=o}function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var e=requireCancel();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(t){n.reason||(n.reason=new e(t),r(n.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},CancelToken_1=t}function requireSpread(){return hasRequiredSpread?spread:(hasRequiredSpread=1,spread=function(e){return function(t){return e.apply(null,t)}})}function requireIsAxiosError(){if(hasRequiredIsAxiosError)return isAxiosError;hasRequiredIsAxiosError=1;var e=requireUtils();return isAxiosError=function(t){return e.isObject(t)&&!0===t.isAxiosError}}function requireAxios$1(){if(hasRequiredAxios$1)return axios$2.exports;hasRequiredAxios$1=1;var e=requireUtils(),t=requireBind(),r=requireAxios$2(),n=requireMergeConfig();var s=function s(i){var a=new r(i),o=t(r.prototype.request,a);return e.extend(o,r.prototype,a),e.extend(o,a),o.create=function(e){return s(n(i,e))},o}(requireDefaults());return s.Axios=r,s.Cancel=requireCancel(),s.CancelToken=requireCancelToken(),s.isCancel=requireIsCancel(),s.VERSION=requireData().version,s.all=function(e){return Promise.all(e)},s.spread=requireSpread(),s.isAxiosError=requireIsAxiosError(),axios$2.exports=s,axios$2.exports.default=s,axios$2.exports}function requireAxios(){return hasRequiredAxios?axios$1:(hasRequiredAxios=1,axios$1=requireAxios$1())}var axiosExports=requireAxios();const axios=getDefaultExportFromCjs(axiosExports),requestHandler=function(e){return e},responseHandler=function(e){return e},service=axios.create({withCredentials:!0,timeout:7e3});service.interceptors.request.use(requestHandler),service.interceptors.response.use(responseHandler);const request={install(e){e.provide("request",service)}},useDsl=()=>{const e=VueDemi.inject("app");if(!e)throw new Error("useDsl must be used after MagicApp is created");const t=VueDemi.ref(e.page?.data||{});e.on("page-change",(()=>{t.value=e.page?.data||{}}));const r=(r,n,s)=>{r.forEach((e=>{isPage(e)?t.value=e:replaceChildNode(VueDemi.reactive(e),[t.value])})),VueDemi.nextTick((()=>{e.emit("replaced-node",{nodes:r,sourceId:n,...s})}))};return e.dataSourceManager&&(e.dataSourceManager.on("update-data",r),VueDemi.onBeforeUnmount((()=>{e.dataSourceManager.off("update-data",r)}))),{app:e,pageConfig:t}};function useComponent(e=""){let t,r,n;return"string"==typeof e?t=e:({componentType:t,app:r}=e),t&&""!==t||(t="container"),r||(r=VueDemi.inject("app")),n=resolveComponent({componentType:t,app:r}),n||t.startsWith("magic-ui-")||(t=`magic-ui-${toLine(t)}`,n=resolveComponent({componentType:t,app:r})),n??t}function resolveComponent({componentType:e,app:t}){return t?.resolveComponent(e)}const _sfc_main=Vue.defineComponent({__name:"App",setup(e){const{pageConfig:t}=useDsl(),r=useComponent("page");return(e,n)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(r)),{config:Vue.unref(t)},null,8,["config"]))}}),getLocalConfig=()=>{const configStr=localStorage.getItem("magicDSL");if(!configStr)return[];try{return[eval(`(${configStr})`)]}catch(err){return console.error("Error parsing localStorage magicDSL:",err),[]}};DataSourceManager.registerObservedData(DeepObservedData);const vueApp=Vue.createApp(_sfc_main);vueApp.use(request);const dsl=((getUrlParam("localPreview")?getLocalConfig():window.magicDSL)||[])[0]||{},app=new App({ua:window.navigator.userAgent,config:dsl,request:service,curPage:getUrlParam("page"),useMock:Boolean(getUrlParam("useMock"))});app.setDesignWidth(app.env.isWeb?window.document.documentElement.getBoundingClientRect().width:375),Object.entries(components).forEach((([e,t])=>{app.registerComponent(e,Vue.defineAsyncComponent(t))})),Object.values(plugins).forEach((e=>{vueApp.use(e,{app:app})})),registerDataSourceOnDemand(dsl,datasources).then((e=>{Object.entries(e).forEach((([e,t])=>{DataSourceManager.register(e,t)})),vueApp.config.globalProperties.app=app,vueApp.provide("app",app),vueApp.mount("#app")}))}}}))})();
|
|
//# sourceMappingURL=index-legacy-BM7x0TDi.js.map
|