You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
amis/demo/json.worker.js

2 lines
251 KiB

1 year ago
/*! For license information please see json.worker.js.LICENSE.txt */
!function(){"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack)throw new Error(e.message+"\n\n"+e.stack);throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function n(e){var n;(n=e)instanceof Error&&n.name===i&&n.message===i||t.onUnexpectedError(e)}function r(e){if(e instanceof Error){let{name:t,message:n}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack}}return e}const i="Canceled";function o(e){const t=this;let n,r=!1;return function(){return r||(r=!0,n=e.apply(t,arguments)),n}}var s;!function(e){e.is=function(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]};const t=Object.freeze([]);e.empty=function(){return t},e.single=function*(e){yield e},e.from=function(e){return e||t},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const n of e)if(t(n))return!0;return!1},e.find=function(e,t){for(const n of e)if(t(n))return n},e.filter=function*(e,t){for(const n of e)t(n)&&(yield n)},e.map=function*(e,t){let n=0;for(const r of e)yield t(r,n++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.concatNested=function*(e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,n){let r=n;for(const n of e)r=t(r,n);return r},e.slice=function*(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]},e.consume=function(t,n=Number.POSITIVE_INFINITY){const r=[];if(0===n)return[r,t];const i=t[Symbol.iterator]();for(let t=0;t<n;t++){const t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]},e.equals=function(e,t,n=((e,t)=>e===t)){const r=e[Symbol.iterator](),i=t[Symbol.iterator]();for(;;){const e=r.next(),t=i.next();if(e.done!==t.done)return!1;if(e.done)return!0;if(!n(e.value,t.value))return!1}}}(s||(s={}));let a=null;var u;function l(e){return null==a||a.trackDisposable(e),e}function c(e){null==a||a.markAsDisposed(e)}function h(e,t){null==a||a.setParent(e,t)}class f extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function d(e){if(s.is(e)){let t=[];for(const n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw new f(t);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function m(e){const t=l({dispose:o((()=>{c(t),e()}))});return t}class g{constructor(){this._toDispose=new Set,this._isDisposed=!1,l(this)}dispose(){this._isDisposed||(c(this),this._isDisposed=!0,this.clear())}clear(){try{d(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return h(e,this),this._isDisposed?g.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}}g.DISABLE_DISPOSED_WARNING=!1;class p{constructor(){this._store=new g,l(this),h(this._store,this)}dispose(){c(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}p.None=Object.freeze({dispose(){}});class v{constructor(e){this.element=e,this.next=v.Undefined,this.prev=v.Undefined}}v.Undefined=new v(void 0);class y{constructor(){this._first=v.Undefined,this._last=v.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===v.Undefined}clear(){let e=this._first;for(;e!==v.Undefined;){const t=e.next;e.prev=v.Undefined,e.next=v.Undefined,e=t}this._first=v.Undefined,this._last=v.Undefined,this._size=0}unshift(