Files
gopeed/pkg/download/engine/polyfill/out/index.js
T

1 line
28 KiB
JavaScript

(()=>{var e={847(e,t,n){var r,o;r=function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n){return t=s(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var o=0,a=function(){};return{s:a,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var e=r.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==r.return||r.return()}finally{if(s)throw i}}}}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},l.apply(null,arguments)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}!function(e){e.AbortSignal,e.AbortController}("undefined"!=typeof self?self:n.g);var p=function(){return a(function e(){r(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})},[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r].callback===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){var t=this;if(e.type in this.listeners){for(var n=this.listeners[e.type].slice(),r=function(){var r=n[o];try{r.callback.call(t,e)}catch(e){Promise.resolve().then(function(){throw e})}r.options&&r.options.once&&t.removeEventListener(e.type,r.callback)},o=0,a=n.length;o<a;o++)r();return!e.defaultPrevented}}}])}(),b=function(e){function n(){var e;return r(this,n),(e=t(this,n)).listeners||p.call(e),Object.defineProperty(e,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(e,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(e,"reason",{value:void 0,writable:!0,configurable:!0}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(n,e),a(n,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){var t,r,o,a,i;"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),(t=n,r="dispatchEvent",o=this,i=l(s(1&(a=3)?t.prototype:t),r,o),2&a&&"function"==typeof i?function(e){return i.apply(o,e)}:i)([e])}},{key:"throwIfAborted",value:function(){var e=this.aborted,t=this.reason;if(e)throw void 0===t?"Aborted":t}}],[{key:"timeout",value:function(e){var t=new d;return setTimeout(function(){return t.abort(new DOMException("This signal is timeout in ".concat(e,"ms"),"TimeoutError"))},e),t.signal}},{key:"any",value:function(e){var t=new d;function n(){t.abort(this.reason),function(){var t,r=i(e);try{for(r.s();!(t=r.n()).done;)t.value.removeEventListener("abort",n)}catch(e){r.e(e)}finally{r.f()}}()}var r,o=i(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.aborted){t.abort(a.reason);break}a.addEventListener("abort",n)}}catch(e){o.e(e)}finally{o.f()}return t.signal}}])}(p),d=function(){return a(function e(){r(this,e),Object.defineProperty(this,"signal",{value:new b,writable:!0,configurable:!0})},[{key:"abort",value:function(e){var t=function(e){if(void 0===e)if("undefined"==typeof document)(e=new Error("This operation was aborted")).name="AbortError";else try{e=new DOMException("signal is aborted without reason"),Object.defineProperty(e,"name",{value:"AbortError"})}catch(t){(e=new Error("This operation was aborted")).name="AbortError"}return e}(e),n=function(e){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}return t.reason=e,t}(t);this.signal.reason=t,this.signal.dispatchEvent(n)}},{key:"toString",value:function(){return"[object AbortController]"}}])}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(d.prototype[Symbol.toStringTag]="AbortController",b.prototype[Symbol.toStringTag]="AbortSignal"),function(e){(function(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController})(e)&&(e.AbortController=d,e.AbortSignal=b)}("undefined"!=typeof self?self:n.g)},void 0===(o=r.call(t,n,t,e))||(e.exports=o)},203(e,t,n){var r,o,a;a="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==n.g&&n.g||this,r=function(e){"use strict";var t=a.BlobBuilder||a.WebKitBlobBuilder||a.MSBlobBuilder||a.MozBlobBuilder,n=a.URL||a.webkitURL||function(e,t){return(t=document.createElement("a")).href=e,t},r=a.Blob,o=n.createObjectURL,i=n.revokeObjectURL,l=a.Symbol&&a.Symbol.toStringTag,s=!1,c=!1,u=t&&t.prototype.append&&t.prototype.getBlob;try{s=2===new Blob(["ä"]).size,c=2===new Blob([new Uint8Array([1,2])]).size}catch(e){}function f(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e})}function p(e,n){n=n||{};var r=new t;return f(e).forEach(function(e){r.append(e)}),n.type?r.getBlob(n.type):r.getBlob()}function b(e,t){return new r(f(e),t||{})}a.Blob&&(p.prototype=Blob.prototype,b.prototype=Blob.prototype);var d="function"==typeof TextEncoder?TextEncoder.prototype.encode.bind(new TextEncoder):function(e){for(var t=0,n=e.length,r=a.Uint8Array||Array,o=0,i=Math.max(32,n+(n>>1)+7),l=new r(i>>3<<3);t<n;){var s=e.charCodeAt(t++);if(s>=55296&&s<=56319){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,s=((1023&s)<<10)+(1023&c)+65536)}if(s>=55296&&s<=56319)continue}if(o+4>l.length){i+=8,i=(i*=1+t/e.length*2)>>3<<3;var u=new Uint8Array(i);u.set(l),l=u}if(4294967168&s){if(4294965248&s)if(4294901760&s){if(4292870144&s)continue;l[o++]=s>>18&7|240,l[o++]=s>>12&63|128,l[o++]=s>>6&63|128}else l[o++]=s>>12&15|224,l[o++]=s>>6&63|128;else l[o++]=s>>6&31|192;l[o++]=63&s|128}else l[o++]=s}return l.slice(0,o)},y="function"==typeof TextDecoder?TextDecoder.prototype.decode.bind(new TextDecoder):function(e){for(var t=e.length,n=[],r=0;r<t;){var o,a,i,l,s=e[r],c=null,u=s>239?4:s>223?3:s>191?2:1;if(r+u<=t)switch(u){case 1:s<128&&(c=s);break;case 2:128==(192&(o=e[r+1]))&&(l=(31&s)<<6|63&o)>127&&(c=l);break;case 3:o=e[r+1],a=e[r+2],128==(192&o)&&128==(192&a)&&(l=(15&s)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[r+1],a=e[r+2],i=e[r+3],128==(192&o)&&128==(192&a)&&128==(192&i)&&(l=(15&s)<<18|(63&o)<<12|(63&a)<<6|63&i)>65535&&l<1114112&&(c=l)}null===c?(c=65533,u=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),r+=u}for(var f=n.length,p="",b=0;b<f;)p+=String.fromCharCode.apply(String,n.slice(b,b+=4096));return p};function g(){var t=!!a.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,n=a.XMLHttpRequest&&a.XMLHttpRequest.prototype.send;t&&n&&(XMLHttpRequest.prototype.send=function(e){e instanceof Blob?(this.setRequestHeader("Content-Type",e.type),n.call(this,e)):n.call(this,e)});try{new File([],""),e.File=a.File,e.FileReader=a.FileReader}catch(t){try{e.File=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name.replace(/\\//g, ":");this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date();this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')()}catch(t){e.File=function(e,t,n){var r=new Blob(e,n),o=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date;return r.name=t.replace(/\//g,":"),r.lastModifiedDate=o,r.lastModified=+o,r.toString=function(){return"[object File]"},l&&(r[l]="File"),r}}}}s?(g(),e.Blob=c?a.Blob:b):u?(g(),e.Blob=p):function(){function t(e){for(var t=new Array(e.byteLength),n=new Uint8Array(e),r=t.length;r--;)t[r]=n[r];return t}function r(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=[],r=0;r<e.length;r+=3){var o=e[r],a=r+1<e.length,i=a?e[r+1]:0,l=r+2<e.length,s=l?e[r+2]:0,c=o>>2,u=(3&o)<<4|i>>4,f=(15&i)<<2|s>>6,p=63&s;l||(p=64,a||(f=64)),n.push(t[c],t[u],t[f],t[p])}return n.join("")}var l=Object.create||function(e){function t(){}return t.prototype=e,new t};function s(e){return Object.prototype.toString.call(e).slice(8,-1)}function c(e,t){return"object"==typeof e&&Object.prototype.isPrototypeOf.call(e.prototype,t)}function u(e){return"DataView"===s(e)||c(a.DataView,e)}var f=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","ArrayBuffer"];function p(e){return t=f,n=s(e),-1!==t.indexOf(n)||c(a.ArrayBuffer,e);var t,n}function b(e,n){n=null==n?{}:n;for(var r=0,o=(e=e?e.slice():[]).length;r<o;r++){var i=e[r];i instanceof b?e[r]=i._buffer:"string"==typeof i?e[r]=d(i):u(i)?e[r]=t(i.buffer):p(i)?e[r]=t(i):e[r]=d(String(i))}this._buffer=a.Uint8Array?function(e){for(var t=0,n=e.length;n--;)t+=e[n].length;for(var r=new Uint8Array(t),o=0,a=0;a<e.length;a++){var i=e[a];r.set(i,o),o+=i.byteLength||i.length}return r}(e):[].concat.apply([],e),this.size=this._buffer.length,this.type=n.type||"",/[^\u0020-\u007E]/.test(this.type)?this.type="":this.type=this.type.toLowerCase()}function g(e,t,n){n=n||{};var r=b.call(this,e,n)||this;return r.name=t.replace(/\//g,":"),r.lastModifiedDate=n.lastModified?new Date(n.lastModified):new Date,r.lastModified=+r.lastModifiedDate,r}if(b.prototype.arrayBuffer=function(){return Promise.resolve(this._buffer.buffer||this._buffer)},b.prototype.text=function(){return Promise.resolve(y(this._buffer))},b.prototype.slice=function(e,t,n){return new b([this._buffer.slice(e||0,t||this._buffer.length)],{type:n})},b.prototype.toString=function(){return"[object Blob]"},g.prototype=l(b.prototype),g.prototype.constructor=g,Object.setPrototypeOf)Object.setPrototypeOf(g,b);else try{g.__proto__=b}catch(e){}function h(){if(!(this instanceof h))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var e=document.createDocumentFragment();this.addEventListener=e.addEventListener,this.dispatchEvent=function(t){var n=this["on"+t.type];"function"==typeof n&&n(t),e.dispatchEvent(t)},this.removeEventListener=e.removeEventListener}function v(e,t,n){if(!(t instanceof b))throw new TypeError("Failed to execute '"+n+"' on 'FileReader': parameter 1 is not of type 'Blob'.");e.result="",setTimeout(function(){this.readyState=h.LOADING,e.dispatchEvent(new Event("load")),e.dispatchEvent(new Event("loadend"))})}g.prototype.toString=function(){return"[object File]"},h.EMPTY=0,h.LOADING=1,h.DONE=2,h.prototype.error=null,h.prototype.onabort=null,h.prototype.onerror=null,h.prototype.onload=null,h.prototype.onloadend=null,h.prototype.onloadstart=null,h.prototype.onprogress=null,h.prototype.readAsDataURL=function(e){v(this,e,"readAsDataURL"),this.result="data:"+e.type+";base64,"+r(e._buffer)},h.prototype.readAsText=function(e){v(this,e,"readAsText"),this.result=y(e._buffer)},h.prototype.readAsArrayBuffer=function(e){v(this,e,"readAsText"),this.result=(e._buffer.buffer||e._buffer).slice()},h.prototype.abort=function(){},n.createObjectURL=function(e){return e instanceof b?"data:"+e.type+";base64,"+r(e._buffer):o.call(n,e)},n.revokeObjectURL=function(e){i&&i.call(n,e)};var w=a.XMLHttpRequest&&a.XMLHttpRequest.prototype.send;w&&(XMLHttpRequest.prototype.send=function(e){e instanceof b?(this.setRequestHeader("Content-Type",e.type),w.call(this,y(e._buffer))):w.call(this,e)}),e.Blob=b,e.File=g,e.FileReader=h,e.URL=n}(),l&&(e.File.prototype[l]||(e.File.prototype[l]="File"),e.Blob.prototype[l]||(e.Blob.prototype[l]="Blob"),e.FileReader.prototype[l]||(e.FileReader.prototype[l]="FileReader"));var h,v=e.Blob.prototype;try{new ReadableStream({type:"bytes"}),h=function(){var e=0,t=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:524288,pull:function(n){var r=n.byobRequest.view;return t.slice(e,e+r.byteLength).arrayBuffer().then(function(o){var a=new Uint8Array(o),i=a.byteLength;e+=i,r.set(a),n.byobRequest.respond(i),e>=t.size&&n.close()})}})}}catch(e){try{new ReadableStream({}),h=function(e){var t=0;return new ReadableStream({pull:function(n){return e.slice(t,t+524288).arrayBuffer().then(function(r){t+=r.byteLength;var o=new Uint8Array(r);n.enqueue(o),t==e.size&&n.close()})}})}}catch(e){try{new Response("").body.getReader().read(),h=function(){return new Response(this).body}}catch(e){h=function(){throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill")}}}}function w(e){return new Promise(function(t,n){e.onload=e.onerror=function(r){e.onload=e.onerror=null,"load"===r.type?t(e.result||e):n(new Error("Failed to read the blob/file"))}})}v.arrayBuffer||(v.arrayBuffer=function(){var e=new FileReader;return e.readAsArrayBuffer(this),w(e)}),v.text||(v.text=function(){var e=new FileReader;return e.readAsText(this),w(e)}),v.stream||(v.stream=h)},void 0===(o=r.apply(t,[t]))||(e.exports=o)},767(e,t,n){"use strict";!function(e){function t(){}function n(){}var r=String.fromCharCode,o={}.toString,a=o.call(e.SharedArrayBuffer),i=o(),l=e.Uint8Array,s=l||Array,c=l?ArrayBuffer:s,u=c.isView||function(e){return e&&"length"in e},f=o.call(c.prototype);c=n.prototype;var p=e.TextEncoder,b=new(l?Uint16Array:s)(32);t.prototype.decode=function(e){if(!u(e)){var t=o.call(e);if(t!==f&&t!==a&&t!==i)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");e=l?new s(e):e||[]}for(var n,c,p,d=t="",y=0,g=0|e.length,h=g-32|0,v=0,w=0,E=0,m=-1;y<g;){for(n=y<=h?32:g-y|0;E<n;y=y+1|0,E=E+1|0){switch((c=255&e[y])>>4){case 15:if(2!=(p=255&e[y=y+1|0])>>6||247<c){y=y-1|0;break}v=(7&c)<<6|63&p,w=5,c=256;case 14:v<<=6,v|=(15&c)<<6|63&(p=255&e[y=y+1|0]),w=2==p>>6?w+4|0:24,c=c+256&768;case 13:case 12:v<<=6,v|=(31&c)<<6|63&(p=255&e[y=y+1|0]),w=w+7|0,y<g&&2==p>>6&&v>>w&&1114112>v?(c=v,0<=(v=v-65536|0)&&(m=55296+(v>>10)|0,c=56320+(1023&v)|0,31>E?(b[E]=m,E=E+1|0,m=-1):(p=m,m=c,c=p))):(y=y-(c>>=8)-1|0,c=65533),v=w=0,n=y<=h?32:g-y|0;default:b[E]=c;continue;case 11:case 10:case 9:case 8:}b[E]=65533}if(d+=r(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15],b[16],b[17],b[18],b[19],b[20],b[21],b[22],b[23],b[24],b[25],b[26],b[27],b[28],b[29],b[30],b[31]),32>E&&(d=d.slice(0,E-32|0)),y<g){if(b[0]=m,E=~m>>>31,m=-1,d.length<t.length)continue}else-1!==m&&(d+=r(m));t+=d,d=""}return t},c.encode=function(e){var t,n=0|(e=void 0===e?"":""+e).length,r=new s(8+(n<<1)|0),o=0,a=!l;for(t=0;t<n;t=t+1|0,o=o+1|0){var i=0|e.charCodeAt(t);if(127>=i)r[o]=i;else{if(2047>=i)r[o]=192|i>>6;else{e:{if(55296<=i)if(56319>=i){var c=0|e.charCodeAt(t=t+1|0);if(56320<=c&&57343>=c){if(65535<(i=(i<<10)+c-56613888|0)){r[o]=240|i>>18,r[o=o+1|0]=128|i>>12&63,r[o=o+1|0]=128|i>>6&63,r[o=o+1|0]=128|63&i;continue}break e}i=65533}else 57343>=i&&(i=65533);!a&&t<<1<o&&t<<1<(o-7|0)&&(a=!0,(c=new s(3*n)).set(r),r=c)}r[o]=224|i>>12,r[o=o+1|0]=128|i>>6&63}r[o=o+1|0]=128|63&i}}return l?r.subarray(0,o):r.slice(0,o)},p||(e.TextDecoder=t,e.TextEncoder=n)}(""+void 0==typeof n.g?""+void 0==typeof self?this:self:n.g)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";function e(e,n,...r){if(!e)throw new TypeError(t(n,r))}function t(e,t){let n=0;return e.replace(/%[os]/gu,()=>r(t[n++]))}function r(e){return"object"!=typeof e||null===e?String(e):Object.prototype.toString.call(e)}const o="undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:"undefined"!=typeof globalThis?globalThis:void 0;let a;class i{constructor(e,t){this.code=e,this.message=t}warn(...e){var t;try{a;const n=(null!==(t=(new Error).stack)&&void 0!==t?t:"").replace(/^(?:.+?\n){2}/gu,"\n");console.warn(this.message,...e,n)}catch(e){}}}const l=new i("W01","Unable to initialize event under dispatching."),s=new i("W02","Assigning any falsy value to 'cancelBubble' property has no effect."),c=new i("W03","Assigning any truthy value to 'returnValue' property has no effect."),u=new i("W04","Unable to preventDefault on non-cancelable events."),f=new i("W05","Unable to preventDefault inside passive event listener invocation."),p=new i("W06","An event listener wasn't added because it has been added already: %o, %o"),b=new i("W07","The %o option value was abandoned because the event listener wasn't added as duplicated."),d=new i("W08","The 'callback' argument must be a function or an object that has 'handleEvent' method: %o");new i("W09","Event attribute handler must be a function: %o");class y{static get NONE(){return g}static get CAPTURING_PHASE(){return h}static get AT_TARGET(){return v}static get BUBBLING_PHASE(){return w}constructor(e,t){Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});const n=null!=t?t:{};E.set(this,{type:String(e),bubbles:Boolean(n.bubbles),cancelable:Boolean(n.cancelable),composed:Boolean(n.composed),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1,inPassiveListenerFlag:!1,dispatchFlag:!1,timeStamp:Date.now()})}get type(){return m(this).type}get target(){return m(this).target}get srcElement(){return m(this).target}get currentTarget(){return m(this).currentTarget}composedPath(){const e=m(this).currentTarget;return e?[e]:[]}get NONE(){return g}get CAPTURING_PHASE(){return h}get AT_TARGET(){return v}get BUBBLING_PHASE(){return w}get eventPhase(){return m(this).dispatchFlag?2:0}stopPropagation(){m(this).stopPropagationFlag=!0}get cancelBubble(){return m(this).stopPropagationFlag}set cancelBubble(e){e?m(this).stopPropagationFlag=!0:s.warn()}stopImmediatePropagation(){const e=m(this);e.stopPropagationFlag=e.stopImmediatePropagationFlag=!0}get bubbles(){return m(this).bubbles}get cancelable(){return m(this).cancelable}get returnValue(){return!m(this).canceledFlag}set returnValue(e){e?c.warn():R(m(this))}preventDefault(){R(m(this))}get defaultPrevented(){return m(this).canceledFlag}get composed(){return m(this).composed}get isTrusted(){return!1}get timeStamp(){return m(this).timeStamp}initEvent(e,t=!1,n=!1){const r=m(this);r.dispatchFlag?l.warn():E.set(this,{...r,type:String(e),bubbles:Boolean(t),cancelable:Boolean(n),target:null,currentTarget:null,stopPropagationFlag:!1,stopImmediatePropagationFlag:!1,canceledFlag:!1})}}const g=0,h=1,v=2,w=3,E=new WeakMap;function m(t,n="this"){const r=E.get(t);return e(null!=r,"'%s' must be an object that Event constructor created, but got another one: %o",n,t),r}function R(e){e.inPassiveListenerFlag?f.warn():e.cancelable?e.canceledFlag=!0:u.warn()}Object.defineProperty(y,"NONE",{enumerable:!0}),Object.defineProperty(y,"CAPTURING_PHASE",{enumerable:!0}),Object.defineProperty(y,"AT_TARGET",{enumerable:!0}),Object.defineProperty(y,"BUBBLING_PHASE",{enumerable:!0});const A=Object.getOwnPropertyNames(y.prototype);for(let e=0;e<A.length;++e)"constructor"!==A[e]&&Object.defineProperty(y.prototype,A[e],{enumerable:!0});let O;void 0!==o&&void 0!==o.Event&&Object.setPrototypeOf(y.prototype,o.Event.prototype);const T={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};function P(e){const t=Object.keys(T);for(let n=0;n<t.length;++n){const r=t[n],o=T[r];Object.defineProperty(e,r,{get:()=>o,configurable:!0,enumerable:!0})}}class _ extends y{static wrap(e){return new(j(e))(e)}constructor(e){super(e.type,{bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed}),e.cancelBubble&&super.stopPropagation(),e.defaultPrevented&&super.preventDefault(),S.set(this,{original:e});const t=Object.keys(e);for(let n=0;n<t.length;++n){const r=t[n];r in this||Object.defineProperty(this,r,F(e,r))}}stopPropagation(){super.stopPropagation();const{original:e}=B(this);"stopPropagation"in e&&e.stopPropagation()}get cancelBubble(){return super.cancelBubble}set cancelBubble(e){super.cancelBubble=e;const{original:t}=B(this);"cancelBubble"in t&&(t.cancelBubble=e)}stopImmediatePropagation(){super.stopImmediatePropagation();const{original:e}=B(this);"stopImmediatePropagation"in e&&e.stopImmediatePropagation()}get returnValue(){return super.returnValue}set returnValue(e){super.returnValue=e;const{original:t}=B(this);"returnValue"in t&&(t.returnValue=e)}preventDefault(){super.preventDefault();const{original:e}=B(this);"preventDefault"in e&&e.preventDefault()}get timeStamp(){const{original:e}=B(this);return"timeStamp"in e?e.timeStamp:super.timeStamp}}const S=new WeakMap;function B(t){const n=S.get(t);return e(null!=n,"'this' is expected an Event object, but got",t),n}const L=new WeakMap;function j(e){const t=Object.getPrototypeOf(e);if(null==t)return _;let n=L.get(t);return null==n&&(n=function(e,t){class n extends e{}const r=Object.keys(t);for(let e=0;e<r.length;++e)Object.defineProperty(n.prototype,r[e],F(t,r[e]));return n}(j(t),t),L.set(t,n)),n}function F(e,t){const n=Object.getOwnPropertyDescriptor(e,t);return{get(){const e=B(this).original,n=e[t];return"function"==typeof n?n.bind(e):n},set(e){B(this).original[t]=e},configurable:n.configurable,enumerable:n.enumerable}}function D(e){return!(1&~e.flags)}function I(e){return!(2&~e.flags)}function k(e){return!(4&~e.flags)}function U(e){return!(8&~e.flags)}function M({callback:e},t,n){try{"function"==typeof e?e.call(t,n):"function"==typeof e.handleEvent&&e.handleEvent(n)}catch(e){!function(e){try{const t=e instanceof Error?e:new Error(r(e));if("function"==typeof dispatchEvent&&"function"==typeof ErrorEvent)dispatchEvent(new ErrorEvent("error",{error:t,message:t.message}));else if("undefined"!=typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)}catch(e){}}(e)}}function N({listeners:e},t,n){for(let r=0;r<e.length;++r)if(e[r].callback===t&&D(e[r])===n)return r;return-1}function C(e,t,n){const r=N(e,t,n);return-1!==r&&x(e,r)}function x(e,t,n=!1){const r=e.listeners[t];return function(e){e.flags|=8}(r),r.signal&&r.signal.removeEventListener("abort",r.signalListener),e.cow&&!n?(e.cow=!1,e.listeners=e.listeners.filter((e,n)=>n!==t),!1):(e.listeners.splice(t,1),!0)}L.set(Object.prototype,_),void 0!==o&&void 0!==o.Event&&L.set(o.Event.prototype,_);class V{constructor(){H.set(this,Object.create(null))}addEventListener(e,t,n){const r=W(this),{callback:o,capture:a,once:i,passive:l,signal:s,type:c}=function(e,t,n){var r;return q(t),"object"==typeof n&&null!==n?{type:String(e),callback:null!=t?t:void 0,capture:Boolean(n.capture),passive:Boolean(n.passive),once:Boolean(n.once),signal:null!==(r=n.signal)&&void 0!==r?r:void 0}:{type:String(e),callback:null!=t?t:void 0,capture:Boolean(n),passive:!1,once:!1,signal:void 0}}(e,t,n);if(null==o||(null==s?void 0:s.aborted))return;const u=function(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e[t]={attrCallback:void 0,attrListener:void 0,cow:!1,listeners:[]}}(r,c),f=N(u,o,a);-1===f?function(e,t,n,r,o,a){let i;a&&(i=C.bind(null,e,t,n),a.addEventListener("abort",i));const l=function(e,t,n,r,o,a){return{callback:e,flags:(t?1:0)|(n?2:0)|(r?4:0),signal:o,signalListener:a}}(t,n,r,o,a,i);e.cow?(e.cow=!1,e.listeners=[...e.listeners,l]):e.listeners.push(l)}(u,o,a,l,i,s):function(e,t,n,r){p.warn(D(e)?"capture":"bubble",e.callback),I(e)!==t&&b.warn("passive"),k(e)!==n&&b.warn("once"),e.signal!==r&&b.warn("signal")}(u.listeners[f],l,i,s)}removeEventListener(e,t,n){const r=W(this),{callback:o,capture:a,type:i}=function(e,t,n){return q(t),"object"==typeof n&&null!==n?{type:String(e),callback:null!=t?t:void 0,capture:Boolean(n.capture)}:{type:String(e),callback:null!=t?t:void 0,capture:Boolean(n)}}(e,t,n),l=r[i];null!=o&&l&&C(l,o,a)}dispatchEvent(e){const t=W(this)[String(e.type)];if(null==t)return!0;const n=e instanceof y?e:_.wrap(e),r=m(n,"event");if(r.dispatchFlag)throw a="This event has been in dispatching.",o.DOMException?new o.DOMException(a,"InvalidStateError"):(null==O&&(O=class e extends Error{constructor(t){super(t),Error.captureStackTrace&&Error.captureStackTrace(this,e)}get code(){return 11}get name(){return"InvalidStateError"}},Object.defineProperties(O.prototype,{code:{enumerable:!0},name:{enumerable:!0}}),P(O),P(O.prototype)),new O(a));var a;if(r.dispatchFlag=!0,r.target=r.currentTarget=this,!r.stopPropagationFlag){const{cow:e,listeners:o}=t;t.cow=!0;for(let a=0;a<o.length;++a){const i=o[a];if(!U(i)&&(k(i)&&x(t,a,!e)&&(a-=1),r.inPassiveListenerFlag=I(i),M(i,this,n),r.inPassiveListenerFlag=!1,r.stopImmediatePropagationFlag))break}e||(t.cow=!1)}return r.target=null,r.currentTarget=null,r.stopImmediatePropagationFlag=!1,r.stopPropagationFlag=!1,r.dispatchFlag=!1,!r.canceledFlag}}const H=new WeakMap;function W(t,n="this"){const r=H.get(t);return e(null!=r,"'%s' must be an object that EventTarget constructor created, but got another one: %o",n,t),r}function q(e){if("function"!=typeof e&&("object"!=typeof e||null===e||"function"!=typeof e.handleEvent)){if(null!=e&&"object"!=typeof e)throw new TypeError(t(d.message,[e]));d.warn(e)}}const G=Object.getOwnPropertyNames(V.prototype);for(let e=0;e<G.length;++e)"constructor"!==G[e]&&Object.defineProperty(V.prototype,G[e],{enumerable:!0});void 0!==o&&void 0!==o.EventTarget&&Object.setPrototypeOf(V.prototype,o.EventTarget.prototype),"function"!=typeof globalThis.Event&&(globalThis.Event=y),"function"!=typeof globalThis.EventTarget&&(globalThis.EventTarget=V),n(847);var X=n(203);globalThis.Blob=X.Blob,globalThis.crypto={getRandomValues(e){for(let t=0,n=e.length;t<n;t++)e[t]=Math.floor(256*Math.random());return e},randomUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^this.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}},n(767)})()})();