fetch-xhr-shim 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/encoding/TextDecoderP.js +2 -0
- package/dist/cjs/event-system/AbortSignalP.js +16 -13
- package/dist/cjs/fetch-api/BodyImpl.js +2 -0
- package/dist/cjs/fetch-api/HeadersP.js +3 -1
- package/dist/cjs/fetch-api/RequestP.js +2 -0
- package/dist/cjs/file-system/BlobP.js +2 -0
- package/dist/cjs/network/FormDataP.js +3 -1
- package/dist/cjs/network/URLSearchParamsP.js +1 -1
- package/dist/cjs/polyfill.js +1 -0
- package/dist/esm/encoding/TextDecoderP.js +2 -0
- package/dist/esm/event-system/AbortSignalP.js +16 -13
- package/dist/esm/fetch-api/BodyImpl.js +2 -0
- package/dist/esm/fetch-api/HeadersP.js +3 -1
- package/dist/esm/fetch-api/RequestP.js +2 -0
- package/dist/esm/file-system/BlobP.js +2 -0
- package/dist/esm/network/FormDataP.js +3 -1
- package/dist/esm/network/URLSearchParamsP.js +1 -1
- package/dist/esm/polyfill.js +1 -0
- package/dist/fetch-xhr-shim.cjs.js +31 -16
- package/dist/fetch-xhr-shim.cjs.min.js +1 -1
- package/dist/fetch-xhr-shim.esm.js +31 -16
- package/dist/fetch-xhr-shim.esm.min.js +1 -1
- package/dist/fetch-xhr-shim.polyfill.iife.js +32 -16
- package/dist/fetch-xhr-shim.polyfill.iife.min.js +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +4 -3
- package/polyfill.js +2817 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e="function"==typeof Symbol&&(Symbol.iterator||"Symbol(Symbol.iterator)"),t="function"==typeof Symbol&&(Symbol.toStringTag||"Symbol(Symbol.toStringTag)");class r extends Error{constructor(e,t){super(e),void 0!==t&&(this.name=""+t)}get[t](){return"DOMException"}get __MPHTTPX__(){return{chain:["DOMException"]}}}const n=function(){try{return new DOMException,!0}catch(e){return!1}}()?DOMException:r;function o(e){try{return e.__MPHTTPX__.chain[0]}catch(t){return Object.prototype.toString.call(e).slice(8,-1)}}function s(e,t,r){Object.defineProperty(e,t,{value:r})}function i(e,t){return Object.prototype.toString.call(t)===`[object ${e}]`}function a(e,t,r=!1){const n="__MPHTTPX__";return!!t&&"object"==typeof t&&n in t&&!!t[n]&&"object"==typeof t[n]&&"chain"in t[n]&&Array.isArray(t[n].chain)&&(o=t[n].chain.indexOf(e),r?0===o:o>-1);var o}const l="function"==typeof Symbol&&!!Symbol.iterator;function u(e){return Array.isArray(e)||!!e&&"object"==typeof e&&l&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function c(e,t,r,n){if(e<t)throw new TypeError(`Failed to ${n?"execute '"+n+"' on":"construct"} '${r}': ${t} argument${t>1?"s":""} required, but only ${e} present.`)}class h{get encoding(){return"utf-8"}encode(e=""){return f("string"==typeof e?e:""+e).encoded}encodeInto(e,t){if(c(arguments.length,2,"TextEncoder","encodeInto"),!Uint8Array.prototype.isPrototypeOf(t)&&!i("Uint8Array",t))throw new TypeError("Failed to execute 'encodeInto' on 'TextEncoder': parameter 2 is not of type 'Uint8Array'.");let r=f("string"==typeof e?e:""+e,t);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get[t](){return"TextEncoder"}get __MPHTTPX__(){return{chain:["TextEncoder"]}}}function f(e,t){const r=void 0!==t;let n=0,o=0,s=e.length,i=0,a=Math.max(32,s+(s>>1)+7),l=r?t:new Uint8Array(a>>3<<3),u=0,c=0,h=0;for(;n<s;){if(u=e.charCodeAt(n),c=1,u>=55296&&u<=56319)if(n+1<s){let t=e.charCodeAt(n+1);56320==(64512&t)?(c=2,n+=2,u=((1023&u)<<10)+(1023&t)+65536):(n+=1,u=65533)}else n+=1,u=65533;else u>=56320&&u<=57343?(n+=1,u=65533):n+=1;if(!r&&i+4>l.length){a+=8,a*=1+n/e.length*2,a=a>>3<<3;let t=new Uint8Array(a);t.set(l),l=t}if(4294967168&u?4294965248&u?4294901760&u?4292870144&u?(u=65533,h=3):h=4:h=3:h=2:h=1,r&&i+h>l.length)break;switch(h){case 1:l[i++]=u;break;case 2:l[i++]=u>>6&31|192,l[i++]=63&u|128;break;case 3:l[i++]=u>>12&15|224,l[i++]=u>>6&63|128,l[i++]=63&u|128;break;case 4:l[i++]=u>>18&7|240,l[i++]=u>>12&63|128,l[i++]=u>>6&63|128,l[i++]=63&u|128}o+=c}return{encoded:r?t:l.slice(0,i),read:o,written:i}}const d="undefined"!=typeof TextEncoder&&TextEncoder||h,p=["utf-8","utf8","unicode-1-1-utf-8"];class y{constructor(e="utf-8",t){if(-1===p.indexOf(("string"==typeof e?e:""+e).toLowerCase()))throw new RangeError(`Failed to construct 'TextDecoder': encoding ('${e}') not implemented.`);s(this,"__TextDecoder__",new g(t))}get encoding(){return"utf-8"}get fatal(){return b(this).fatal}get ignoreBOM(){return b(this).ignoreBOM}decode(e,t){return function(e,{stream:t=!1}={},r={fatal:!1,ignoreBOM:!1,partial:[]}){if(void 0===e){if(r.partial.length>0&&r.fatal)throw r.partial=[],new TypeError("Incomplete UTF-8 sequence.");return""}let n=_(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(){throw new TypeError("Input could not be converted to any of: ArrayBufferView, ArrayBuffer.")}();if(r.partial.length>0){let e=new Uint8Array(r.partial.length+n.length);e.set(r.partial,0),e.set(n,r.partial.length),n=e,r.partial=[]}!r.ignoreBOM&&n.length>=3&&239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));let o=n.length,s=[];if(t&&n.length>0){let e=n.length;for(;e>0&&e>n.length-4;){let t=n[e-1];if(128!=(192&t)){(t>239?4:t>223?3:t>191?2:1)>n.length-(e-1)&&(o=e-1);break}--e}r.partial=Array.from(n.slice(o)),n=n.slice(0,o)}let i=0,a=0,l=0,u=0,c=0,h=0,f=0,d=0;for(;d<o;){if(i=0,u=n[d],l=u>239?4:u>223?3:u>191?2:1,d+l<=o)switch(l){case 1:u<128&&(i=u);break;case 2:c=n[d+1],128==(192&c)&&(a=(31&u)<<6|63&c,a>127&&(i=a));break;case 3:c=n[d+1],h=n[d+2],128==(192&c)&&128==(192&h)&&(a=(15&u)<<12|(63&c)<<6|63&h,a>2047&&(a<55296||a>57343)&&(i=a));break;case 4:c=n[d+1],h=n[d+2],f=n[d+3],128==(192&c)&&128==(192&h)&&128==(192&f)&&(a=(15&u)<<18|(63&c)<<12|(63&h)<<6|63&f,a>65535&&a<1114112&&(i=a))}if(0===i&&(1===l&&0!==u||l>1)){if(r.fatal)throw r.partial=[],new TypeError("Decoding failed.");let e=1;for(;d+e<o&&128==(192&n[d+e]);)e+=1;s.push(65533),d+=e;continue}i>65535&&(i-=65536,s.push(i>>>10&1023|55296),i=56320|1023&i),s.push(i),d+=l}return s.length>16384?function(e){let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(String.fromCharCode.apply(String,e.slice(r,r+4096)));return t.join("")}(s):function(e){let t="";for(let r=0,n=e.length;r<n;r+=4096)t+=String.fromCharCode.apply(String,e.slice(r,r+4096));return t}(s)}(e,t,b(this))}toString(){return"[object TextDecoder]"}get[t](){return"TextDecoder"}get __MPHTTPX__(){return{chain:["TextDecoder"]}}}class g{constructor({fatal:e=!1,ignoreBOM:t=!1}={}){this.partial=[],this.fatal=!!e,this.ignoreBOM=!!t}}function b(e){return e.__TextDecoder__}function _(e){return!!e&&"object"==typeof e&&ArrayBuffer.prototype.isPrototypeOf(e)||function(e){return(i("ArrayBuffer",e)||"[object ArrayBuffer]"===String(e))&&"byteLength"in e&&"number"==typeof e.byteLength}(e)}const m="undefined"!=typeof TextDecoder&&TextDecoder||y;class v{static get NONE(){return 0}static get CAPTURING_PHASE(){return 1}static get AT_TARGET(){return 2}static get BUBBLING_PHASE(){return 3}constructor(e,t){c(arguments.length,1,"Event"),s(this,"__Event__",new T);const r=w(this);r.type=""+e,r.bubbles=!!(null==t?void 0:t.bubbles),r.cancelable=!!(null==t?void 0:t.cancelable),r.composed=!!(null==t?void 0:t.composed),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return"YES"===r.isTrusted}})}get NONE(){return 0}get CAPTURING_PHASE(){return 1}get AT_TARGET(){return 2}get BUBBLING_PHASE(){return 3}get bubbles(){return w(this).bubbles}get cancelBubble(){return w(this).cancelBubble}set cancelBubble(e){e&&(w(this).cancelBubble=!0)}get cancelable(){return w(this).cancelable}get composed(){return w(this).composed}get currentTarget(){return w(this).currentTarget}get defaultPrevented(){return w(this).defaultPrevented}get eventPhase(){return w(this).eventPhase}get returnValue(){return w(this).returnValue}set returnValue(e){e||this.preventDefault()}get srcElement(){return w(this).target}get target(){return w(this).target}get timeStamp(){return w(this).timeStamp}get type(){return w(this).type}composedPath(){let e=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&e.push(this.currentTarget),e}initEvent(e,t,r){c(arguments.length,1,o(this),"initEvent");let n=w(this);n.eventDispatched||(n.type=""+e,n.bubbles=!!t,n.cancelable=!!r)}preventDefault(){let e=w(this);if(e.passive)return console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`);this.cancelable&&(e.defaultPrevented=!0,e.returnValue=!1)}stopImmediatePropagation(){w(this).immediatePropagationStopped=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get[t](){return"Event"}get __MPHTTPX__(){return{chain:["Event"]}}}class T{constructor(){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.composed=!1,this.currentTarget=null,this.defaultPrevented=!1,this.eventPhase=0,this.returnValue=!0,this.target=null,this.timeStamp=(new Date).getTime()-E,this.type="",this.passive=!1,this.eventDispatched=!1,this.immediatePropagationStopped=!1,Object.defineProperty(this,"isTrusted",P())}}function w(e){return e.__Event__}const E=(new Date).getTime();function P(){let e=P.name,t=e.length,r="NO";return{configurable:!1,enumerable:!0,get:function(){return r},set:function(n){e===n.slice(0,t)&&(r=n.slice(t+1))}}}function x(e,t){(w(e)||{}).isTrusted=`${P.name}:${t?"YES":"NO"}`}const S="undefined"!=typeof Event&&Event||v;class R{constructor(){s(this,"__EventTarget__",new A)}addEventListener(e,t,r){if(c(arguments.length,2,o(this),"addEventListener"),"function"!=typeof t&&"object"!=typeof t&&void 0!==t)throw new TypeError(`Failed to execute 'addEventListener' on '${o(this)}': parameter 2 is not of type 'Object'.`);let n=F(this)||{executors:[]},s=new B(e,t),i=s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture);if(!n.executors.some(function(e){return e.equals(s)})){if(n.executors.push(s),r&&"object"==typeof r){s.options.once=!!r.once,s.options.passive=!!r.passive;const e=r.signal;e&&j(e)&&!e.aborted&&(s.options.signal=e,function(e,t,r){const n=function(){F(e).executors=F(e).executors.filter(function(e){return!e.equals(t)}),r.removeEventListener("abort",n)};r.addEventListener("abort",n)}(this,s,e))}if(i){let e=function(e){return e.options.capture?0:1};n.executors=n.executors.sort(function(t,r){return e(t)-e(r)})}}}dispatchEvent(e){if(c(arguments.length,1,o(this),"dispatchEvent"),a("Event",e))x(e,!1);else{if(!function(e){const t=function(e){return"[object "===e.slice(0,8)&&"Event]"===e.slice(-6)};return!!e&&"object"==typeof e&&(t(Object.prototype.toString.call(e))||t(String(e)))&&"type"in e&&"string"==typeof e.type}(e))throw new TypeError(`Failed to execute 'dispatchEvent' on '${o(this)}': parameter 1 is not of type 'Event'.`);console.warn(`WARNING: undefined behavior when executing 'dispatchEvent' on '${o(this)}': parameter 1 is not of type 'Event(P)'.`)}return C(this,e)}removeEventListener(e,t,r){if(c(arguments.length,2,o(this),"removeEventListener"),"function"!=typeof t&&"object"!=typeof t&&void 0!==t)throw new TypeError(`Failed to execute 'removeEventListener' on '${o(this)}': parameter 2 is not of type 'Object'.`);let n=F(this)||{executors:[]},s=new B(e,t);s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),n.executors.some(function(e){return e.equals(s)})&&(n.executors=n.executors.filter(function(e){return!e.equals(s)}))}toString(){return"[object EventTarget]"}get[t](){return"EventTarget"}get __MPHTTPX__(){return{chain:["EventTarget"]}}}class A{constructor(){this.executors=[]}}function F(e){return e.__EventTarget__}class B{constructor(e,t){var r;this.options={},this.type=""+e,this.callback="function"==typeof(r=t)?r:function(e){return!!e&&"object"==typeof e&&"handleEvent"in e&&"function"==typeof e.handleEvent}(r)?r.handleEvent:r}equals(e){return this.type===e.type&&this.callback===e.callback&&this.options.capture===e.options.capture}}function C(e,t){const r=F(e)||{},n=t.__Event__||{};n.target=e,n.currentTarget=e,n.eventPhase=2,n.eventDispatched=!0;let o=[];Array.isArray(r.executors)||(r.executors=[]);for(let s=0;s<r.executors.length&&!n.immediatePropagationStopped;++s){let i=r.executors[s];if(i.type===t.type){i.options.once&&o.push(s),n.passive=!!i.options.passive;try{let r=i.callback;"function"==typeof r&&r.call(e,t)}catch(e){console.error(e)}n.passive=!1}}return o.length>0&&(r.executors=r.executors.reduce(function(e,t,r){return-1===o.indexOf(r)&&e.push(t),e},[])),n.currentTarget=null,n.eventPhase=0,n.eventDispatched=!1,!(t.cancelable&&t.defaultPrevented)}function L(e,t){return function(r){const n="on"+r,o=e[n],s=t[n];"function"==typeof o?R.prototype.addEventListener.call(e,r,s):R.prototype.removeEventListener.call(e,r,s)}}function H(e,t,r){"function"==typeof t&&t.call(e,r)}function j(e){return a("EventTarget",e)||function(e){return!!e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener&&"removeEventListener"in e&&"function"==typeof e.removeEventListener}(e)}const O="undefined"!=typeof EventTarget&&EventTarget||R;class q extends v{constructor(e,t){var r;c(arguments.length,1,"CustomEvent"),super(e,t),s(this,"__CustomEvent__",new D),U(this).detail=null!==(r=null==t?void 0:t.detail)&&void 0!==r?r:null}get detail(){return U(this).detail}initCustomEvent(e,t,r,n){c(arguments.length,1,"CustomEvent","initCustomEvent"),this.__Event__.eventDispatched||(this.initEvent(e,t,r),U(this).detail=null!=n?n:null)}toString(){return"[object CustomEvent]"}get[t](){return"CustomEvent"}get __MPHTTPX__(){return{chain:["CustomEvent","Event"]}}}class D{}function U(e){return e.__CustomEvent__}const M="undefined"!=typeof CustomEvent&&CustomEvent||q;class X extends R{static abort(e){let t=I();return k(t,!1,e),t}static any(e){if(c(arguments.length,1,"AbortSignal","any"),!u(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': The provided value cannot be converted to a sequence.");let t=Array.isArray(e)?e:Array.from(e);t.forEach(function(e){if(!j(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': Failed to convert value to 'AbortSignal'.")});let r=I(),n=function(){for(let e=0;e<t.length;++e){let r=t[e];if(r.aborted)return r}}();if(n)k(r,!1,n.reason);else{function o(){for(let e=0;e<t.length;++e){t[e].removeEventListener("abort",o)}k(r,!0,this.reason)}for(let s=0;s<t.length;++s){t[s].addEventListener("abort",o)}}return r}static timeout(e){if(c(arguments.length,1,"AbortSignal","timeout"),!(e>=0))throw new TypeError("Failed to execute 'timeout' on 'AbortSignal': Value is outside the 'unsigned long long' value range.");const t=I();return setTimeout(function(){k(t,!0,new n("signal timed out","TimeoutError"))},e),t}constructor(){if(new.target===X)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),s(this,"__AbortSignal__",new N(this))}get aborted(){return $(this).aborted}get reason(){return $(this).reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return $(this).onabort}set onabort(e){$(this).onabort=e,$(this).attach("abort")}toString(){return"[object AbortSignal]"}get[t](){return"AbortSignal"}get __MPHTTPX__(){return{chain:["AbortSignal","EventTarget"]}}}class N{constructor(e){var t;this.aborted=!1,this.reason=void 0,this.onabort=null,this.attach=L(e,(t=e,{onabort:function(e){H(t,t.onabort,e)}}))}}function $(e){return e.__AbortSignal__}function I(){let e=Object.create(X.prototype);return s(e,"__EventTarget__",{executors:[]}),s(e,"__AbortSignal__",new N(e)),e}function k(e,t=!0,r){if(!e.aborted){let o=$(e)||{};if(o.aborted=!0,o.reason=void 0!==r?r:new n("signal is aborted without reason","AbortError"),t){let t=new v("abort");t.__Event__.target=e,x(t,!0),C(e,t)}}}const z="undefined"!=typeof AbortSignal&&AbortSignal||X;class G{constructor(){s(this,"__AbortController__",new V)}get signal(){return(e=this,e.__AbortController__).signal;var e}abort(e){k(this.signal,!0,e)}toString(){return"[object AbortController]"}get[t](){return"AbortController"}get __MPHTTPX__(){return{chain:["AbortController"]}}}class V{constructor(){this.signal=I()}}const W="undefined"!=typeof AbortController&&AbortController||G,Y=d.prototype.encode.bind(new d),J=m.prototype.decode.bind(new m),K={ReadableStream:"undefined"!=typeof ReadableStream&&ReadableStream||void 0};class Q{constructor(e=[],t){if(!u(e))throw new TypeError("Failed to construct 'Blob/File': The provided value cannot be converted to a sequence.");let r=Array.isArray(e)?e:Array.from(e),n=[],o=0;for(let e=0;e<r.length;++e){let t=r[e];if(oe(t))o+=t.size,n.push(t.arrayBuffer().then(function(e){return new Uint8Array(e)}));else{let e=_(t)||ArrayBuffer.isView(t)?te(t):Y(t);o+=e.length,n.push(Promise.resolve(e))}}s(this,"__Blob__",new Z(Promise.all(n).then(function(e){return function(e){let t=e.reduce(function(e,t){return e+t.byteLength},0),r=new Uint8Array(t);return e.reduce(function(e,t){return r.set(t,e),e+t.byteLength},0),r}(e)}))),ee(this).size=o,ee(this).type=re(null==t?void 0:t.type)}get size(){return ee(this).size}get type(){return ee(this).type}arrayBuffer(){return ee(this).promise.then(function(e){return ne(e.buffer).buffer})}bytes(){return ee(this).promise.then(function(e){return ne(e.buffer)})}slice(e,t,r){let n=null!=e?e:0,o=null!=t?t:this.size,i=Object.create(Q.prototype);return s(i,"__Blob__",new Z(ee(this).promise.then(function(e){return ne(e.slice(n,o))}))),ee(i).size=function(e,t,r){const n=function(t){let r=Number(t);return isNaN(r)&&(r=0),r=r>=0?Math.min(r,e):Math.max(0,r+e),r};return Math.max(0,n(r)-n(t))}(this.size,n,o),ee(i).type=re(r),i}stream(){let e=K.ReadableStream||function(){throw new ReferenceError("ReadableStream is not defined")}(),t=0;try{return new e({type:"bytes",autoAllocateChunkSize:524288,pull:function(e){var r;let n=null===(r=e.byobRequest)||void 0===r?void 0:r.view;return this.slice(t,(null==n?void 0:n.byteLength)?t+n.byteLength:void 0).arrayBuffer().then(function(r){var o;let s=new Uint8Array(r),i=s.byteLength;t+=i,n.set(s),null===(o=e.byobRequest)||void 0===o||o.respond(i),t>=this.size&&e.close()}.bind(this))}.bind(this)})}catch(r){return new e({pull:function(e){return this.slice(t,t+524288).arrayBuffer().then(function(r){t+=r.byteLength;let n=new Uint8Array(r);e.enqueue(n),t==this.size&&e.close()}.bind(this))}.bind(this)})}}text(){return ee(this).promise.then(function(e){return J(e)})}toString(){return"[object Blob]"}get[t](){return"Blob"}get __MPHTTPX__(){return{chain:["Blob"]}}}class Z{constructor(e){this.size=0,this.type="",this.promise=e}}function ee(e){return e.__Blob__}function te(e){return _(e)?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function re(e){let t=""+(void 0!==e?e:"");return/[^\u0020-\u007E]/.test(t)?"":t.toLowerCase()}function ne(e){let t=te(e),r=new Uint8Array(new ArrayBuffer(t.byteLength));return r.set(t),r}function oe(e,t=!1){return a("Blob",e,t)||function(e,t=!1){let r=["[object Blob]"];t||r.push("[object File]");return(r.indexOf(Object.prototype.toString.call(e))>-1||r.indexOf(String(e))>-1)&&"size"in e&&"number"==typeof e.size&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer}(e,t)}const se=function(){try{return 2===new Blob(["ä"]).size}catch(e){return!1}}()?Blob:Q;function ie(e){class r extends e{constructor(e,t,r){c(arguments.length,2,"File"),super(e,r),s(this,"__File__",new ae),le(this).lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date)||0,le(this).name=""+t}get lastModified(){return le(this).lastModified}get name(){return le(this).name}get webkitRelativePath(){return""}toString(){return"[object File]"}get[t](){return"File"}}return e===Q&&Object.defineProperty(r.prototype,"__MPHTTPX__",{configurable:!0,get:function(){return{chain:["File","Blob"]}}}),r}class ae{constructor(){this.lastModified=0,this.name=""}}function le(e){return e.__File__}const ue=ie(Q),ce=function(){try{return new File([],""),!0}catch(e){return!1}}()?File:se===Q?ue:ie(se),he=["loaded","total"];class fe extends v{constructor(e,t){var r,n;super(e,t),s(this,"__ProgressEvent__",new de);const o=pe(this);o.lengthComputable=!!(null==t?void 0:t.lengthComputable),o.loaded=Number(null!==(r=null==t?void 0:t.loaded)&&void 0!==r?r:0),o.total=Number(null!==(n=null==t?void 0:t.total)&&void 0!==n?n:0);for(let e=0;e<he.length;++e){let t=he[e];if(isNaN(this[t]))throw new TypeError(`Failed to construct 'ProgressEvent': Failed to read the '${t}' property from 'ProgressEventInit': The provided double value is non-finite.`)}}get lengthComputable(){return pe(this).lengthComputable}get loaded(){return pe(this).loaded}get total(){return pe(this).total}toString(){return"[object ProgressEvent]"}get[t](){return"ProgressEvent"}get __MPHTTPX__(){return{chain:["ProgressEvent","Event"]}}}class de{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function pe(e){return e.__ProgressEvent__}function ye(e,t,r=0,n=0){let o=new fe(t,{lengthComputable:n>0,loaded:r,total:n});o.__Event__.target=e,x(o,!0),C(e,o)}class ge extends R{static get EMPTY(){return 0}static get LOADING(){return 1}static get DONE(){return 2}constructor(){super(),s(this,"__FileReader__",new be(this))}get EMPTY(){return 0}get LOADING(){return 1}get DONE(){return 2}get error(){return _e(this).error}get readyState(){return _e(this).readyState}get result(){return _e(this).result}abort(){2===_e(this).pos&&function(e){let t=_e(e);t.pos=5,t.error=new n("An ongoing operation was aborted, typically with a call to abort().","AbortError"),t.result=null,t.readyState=2,ye(e,"abort"),Te(e)}(this)}readAsArrayBuffer(e){me(this,"readAsArrayBuffer",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer()})}readAsBinaryString(e){me(this,"readAsBinaryString",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer().then(function(e){let t=[],r=new Uint8Array(e);for(let e=0;e<r.length;++e)t.push(String.fromCharCode(r[e]));return t.join("")})})}readAsDataURL(e){me(this,"readAsDataURL",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer().then(function(t){return"data:"+(e.type||"application/octet-stream")+";base64,"+function(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var n=0;n<e.length;n+=3){let o=e[n],s=n+1<e.length,i=s?e[n+1]:0,a=n+2<e.length,l=a?e[n+2]:0,u=o>>2,c=(3&o)<<4|i>>4,h=(15&i)<<2|l>>6,f=63&l;a||(f=64,s||(h=64)),r.push(t[u],t[c],t[h],t[f])}return r.join("")}(new Uint8Array(t))})})}readAsText(e,t){if(me(this,"readAsText",arguments.length,e),"function"==typeof TextDecoder){let r=new TextDecoder(t);ve(this,e.size,function(){return e.arrayBuffer().then(function(e){return r.decode(e)})})}else{if(void 0!==t){let e=""+t;-1===["utf-8","utf8","unicode-1-1-utf-8"].indexOf(e.toLowerCase())&&console.warn(`Ignoring the execution of 'readAsText' on 'FileReader': encoding ('${e}') not implemented.`)}ve(this,e.size,function(){return e.text()})}}get onabort(){return _e(this).onabort}set onabort(e){_e(this).onabort=e,_e(this).attach("abort")}get onerror(){return _e(this).onerror}set onerror(e){_e(this).onerror=e,_e(this).attach("error")}get onload(){return _e(this).onload}set onload(e){_e(this).onload=e,_e(this).attach("load")}get onloadend(){return _e(this).onloadend}set onloadend(e){_e(this).onloadend=e,_e(this).attach("loadend")}get onloadstart(){return _e(this).onloadstart}set onloadstart(e){_e(this).onloadstart=e,_e(this).attach("loadstart")}get onprogress(){return _e(this).onprogress}set onprogress(e){_e(this).onprogress=e,_e(this).attach("progress")}toString(){return"[object FileReader]"}get[t](){return"FileReader"}get __MPHTTPX__(){return{chain:["FileReader","EventTarget"]}}}class be{constructor(e){var t;this.pos=0,this.readyState=0,this.result=null,this.error=null,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.attach=L(e,(t=e,{onabort:function(e){H(t,t.onabort,e)},onerror:function(e){H(t,t.onerror,e)},onload:function(e){H(t,t.onload,e)},onloadend:function(e){H(t,t.onloadend,e)},onloadstart:function(e){H(t,t.onloadstart,e)},onprogress:function(e){H(t,t.onprogress,e)}}))}}function _e(e){return e.__FileReader__}function me(e,t,r,o){if(c(r,1,"FileReader",t),!oe(o))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");if(1===e.readyState)throw new n(`Failed to execute '${t}' on 'FileReader': The object is already busy reading Blobs.`,"InvalidStateError")}function ve(e,t,r){!function(e,t,r){let n=_e(e);n.pos=1,n.error=null,n.result=null;const o=function(){return ye(e,"loadstart",0,t),r()};(function(e,t,r){let n=_e(e);n.pos=2,n.readyState=1,Promise.resolve().then(function(){if(2===n.pos)return r().then(function(r){return function(e,t,r){let n=_e(e);if(2!==n.pos)return;n.pos=3,n.result=r,n.readyState=2,function(e,t){_e(e).pos=4,ye(e,"load",t,t),Te(e,t)}(e,t)}(e,t,r)}).catch(function(t){return function(e,t){let r=_e(e);if(2!==r.pos)return;r.pos=6,r.error=t,r.result=null,r.readyState=2,ye(e,"error"),Te(e)}(e,t)})})})(e,t,o)}(e,t,r)}function Te(e,t=0){_e(e).pos=7,ye(e,"loadend",t,t)}const we="undefined"!=typeof FileReader&&FileReader||ge;class Ee{constructor(e){if(s(this,"__URLSearchParams__",new Pe),void 0!==e)if(Be(e))e.forEach(function(e,t){this.append(t,e)}.bind(this),this);else if(e&&"object"==typeof e)if(u(e)){let t=Array.isArray(e)?e:Array.from(e);for(let e=0;e<t.length;++e){let r=t[e];if(!u(r))throw new TypeError("Failed to construct 'URLSearchParams': The provided value cannot be converted to a sequence.");{let e=Array.isArray(r)?r:Array.from(r);if(2!==e.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");this.append(e[0],e[1])}}}else Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])}.bind(this),this);else{let t=""+e;0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let e=0;e<r.length;++e){let t=r[e],n=t.indexOf("=");n>-1?this.append(Fe(t.slice(0,n)),Fe(t.slice(n+1))):t&&this.append(Fe(t),"")}}}get size(){return xe(this).array.length}append(e,t){Se(arguments.length,2,"append"),xe(this).array.push([""+e,Re(t)])}delete(e,t){Se(arguments.length,1,"delete");let r=""+e,n=-1,o=xe(this).array,s=[];for(let e=0;e<o.length;++e){let i=o[e];i[0]!==r?s.push(i):(1!==arguments.length&&i[1]!==Re(t)&&s.push(i),n=e)}n>-1&&(xe(this).array=s)}get(e){Se(arguments.length,1,"get");let t=""+e,r=xe(this).array;for(let e=0;e<r.length;++e){let n=r[e];if(n[0]===t)return n[1]}return null}getAll(e){Se(arguments.length,1,"getAll");let t=""+e,r=xe(this).array,n=[];for(let e=0;e<r.length;++e){let o=r[e];o[0]===t&&n.push(o[1])}return n}has(e,t){Se(arguments.length,1,"has");let r=""+e,n=xe(this).array;for(let e=0;e<n.length;++e){let o=n[e];if(o[0]===r){if(1===arguments.length)return!0;if(o[1]===Re(t))return!0}}return!1}set(e,t){Se(arguments.length,2,"set");let r=""+e,n=Re(t),o=-1,s=xe(this).array,i=[];for(let e=0;e<s.length;++e){let t=s[e];t[0]!==r?i.push(t):-1===o&&(o=e,i.push([r,n]))}-1===o&&i.push([r,n]),xe(this).array=i}sort(){xe(this).array.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})}forEach(e,t){if(Se(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'URLSearchParams': parameter 1 is not of type 'Function'.");let r=xe(this).array;for(let n=0;n<r.length;++n){let o=r[n];e.call(t,o[1],o[0],this)}}entries(){return xe(this).array.map(function(e){return[e[0],e[1]]}).values()}keys(){return xe(this).array.map(function(e){return e[0]}).values()}values(){return xe(this).array.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){let e=xe(this).array,t=[];for(let r=0;r<e.length;++r){let n=e[r];t.push(Ae(n[0])+"="+Ae(n[1]))}return t.join("&")}get[t](){return"URLSearchParams"}get __MPHTTPX__(){return{chain:["URLSearchParams"]}}}class Pe{constructor(){this.array=[]}}function xe(e){return e.__URLSearchParams__}function Se(e,t,r){c(e,t,"URLSearchParams",r)}function Re(e){return"string"==typeof e?e:null!=e&&"function"==typeof e.toString?e.toString():JSON.stringify(e)}function Ae(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function Fe(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(e){return decodeURIComponent(e)})}function Be(e){return a("URLSearchParams",e)||function(e){return i("URLSearchParams",e)||!!e&&"object"==typeof e&&"undefined"!=typeof URLSearchParams&&URLSearchParams&&URLSearchParams.prototype.isPrototypeOf(e)}(e)}const Ce="undefined"!=typeof URLSearchParams&&URLSearchParams||Ee;class Le{constructor(e,t){if(s(this,"__FormData__",new He),void 0!==e)try{let t=e.elements;for(let e=0;e<t.length;++e){let r=t[e];if(!r.name||r.disabled||"submit"===r.type||"button"===r.type||r.matches("form fieldset[disabled] *"))return;if("file"===r.type){let e=r.files&&r.files.length?r.files:[new ce([],"",{type:"application/octet-stream"})];for(let t=0;t<e.length;++t)this.append(r.name,e[t])}else if("select-multiple"===r.type||"select-one"===r.type)for(let e=0;e<r.options.length;++e){let t=r.options[e];!t.disabled&&t.selected&&this.append(r.name,t.value)}else if("checkbox"===r.type||"radio"===r.type)r.checked&&this.append(r.name,r.value);else{let e="textarea"===r.type?Me(r.value):r.value;this.append(r.name,e)}}}catch(e){throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}null!=t&&console.warn("Ignoring the 'submitter' of 'FormData' constructor: parameter 2 not implemented.")}append(e,t,r){Oe(arguments.length,2,"append"),je(this).array.push(qe(e,t,r))}delete(e){Oe(arguments.length,1,"delete");let t=""+e,r=-1,n=je(this).array,o=[];for(let e=0;e<n.length;++e){let s=n[e];s[0]!==t?o.push(s):r=e}r>-1&&(je(this).array=o)}get(e){Oe(arguments.length,1,"get");let t=""+e,r=je(this).array;for(let e=0;e<r.length;++e){let n=r[e];if(n[0]===t)return n[1]}return null}getAll(e){Oe(arguments.length,1,"getAll");let t=""+e,r=je(this).array,n=[];for(let e=0;e<r.length;++e){let o=r[e];o[0]===t&&n.push(o[1])}return n}has(e){Oe(arguments.length,1,"has");let t=""+e,r=je(this).array;for(let e=0;e<r.length;++e){if(r[e][0]===t)return!0}return!1}set(e,t,r){Oe(arguments.length,2,"set");let n=""+e,o=qe(e,t,r),s=-1,i=je(this).array,a=[];for(let e=0;e<i.length;++e){let t=i[e];t[0]!==n?a.push(t):-1===s&&(s=e,a.push(o))}-1===s&&a.push(o),je(this).array=a}forEach(e,t){if(Oe(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");let r=je(this).array;for(let n=0;n<r.length;++n){let o=r[n];e.call(t,o[1],o[0],t)}}entries(){return je(this).array.map(function(e){return[e[0],e[1]]}).values()}keys(){return je(this).array.map(function(e){return e[0]}).values()}values(){return je(this).array.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){return"[object FormData]"}get[t](){return"FormData"}get __MPHTTPX__(){return{chain:["FormData"]}}}class He{constructor(){this.array=[]}}function je(e){return e.__FormData__}function Oe(e,t,r){return c(e,t,"FormData",r)}function qe(e,t,r){if(oe(t)){if(r=void 0!==r?""+r:"string"==typeof t.name?t.name:"blob",t.name!==r||oe(t,!0)){t=new(a("Blob",t)?ue:ce)([t],r)}return[""+e,t]}return[""+e,""+t]}function De(e){return a("FormData",e)||function(e){let t="[object FormData]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&"forEach"in e&&"function"==typeof e.forEach}(e)}function Ue(e,t){const r=t||"----formdata-mphttpx-"+Math.random(),n=`--${r}\r\nContent-Disposition: form-data; name="`;let o=[],s=!0;return e.forEach(function(e,t){"string"==typeof e?o.push(n+Xe(Me(t))+`"\r\n\r\n${Me(e)}\r\n`):(s&&a("Blob",e)&&(s=!1),o.push(n+Xe(Me(t))+`"; filename="${Xe(e.name)}"\r\nContent-Type: ${e.type||"application/octet-stream"}\r\n\r\n`,e,"\r\n"))}),o.push(`--${r}--`),new(s?se:Q)(o,{type:"multipart/form-data; boundary="+r})}function Me(e){return e.replace(/\r?\n|\r/g,"\r\n")}function Xe(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}function Ne(e){if(!e)return;if(!/multipart\/form-data/i.test(e))return;let t=e.match(/boundary\s*=\s*([^;]+)/i);if(t&&t[1]){return t[1].trim().replace(/^["']|["']$/g,"")}}const $e="undefined"!=typeof FormData&&FormData||Le;class Ie{constructor(e,t){if(this._type="",t&&(this.type=t),"string"==typeof e)this.promise=Promise.resolve(e),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return Y(e).length};else if(Be(e)){let t=e.toString();this.promise=Promise.resolve(t),this.type="application/x-www-form-urlencoded;charset=UTF-8",this.calcLength=function(){return Y(t).length}}else if(_(e))this.promise=Promise.resolve(e.slice(0)),this.length=e.byteLength;else if(ArrayBuffer.isView(e)){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);this.promise=Promise.resolve(t),this.length=t.byteLength}else if(oe(e))this.promise=e.arrayBuffer(),this.type=e.type,this.length=e.size;else if(De(e)){let r=Ue(e,t?Ne(t):void 0);this.promise=r.arrayBuffer(),this.type=r.type,this.length=r.size}else if(null==e)this.promise=Promise.resolve(""),this.length=0;else{let t=""+e;this.promise=Promise.resolve(t),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return Y(t).length}}}get type(){return this._type}set type(e){this._type||(this._type=e)}get size(){var e;return"number"!=typeof this.length&&this.calcLength&&(this.length=this.calcLength()),null!==(e=this.length)&&void 0!==e?e:0}text(){return this.promise.then(function(e){return"string"==typeof e?e:J(e)})}arrayBuffer(){return this.promise.then(function(e){return _(e)?e:Y(e).buffer})}}class ke{constructor(){if(new.target===ke)throw new TypeError("Failed to construct 'Body': Illegal constructor");s(this,"__Body__",new ze)}get bodyUsed(){return Ge(this).bodyUsed}get body(){throw new TypeError(`Failed to access 'body' on '${o(this)}': property not implemented.`)}arrayBuffer(){const e="arrayBuffer";return Ye(this,e)||We(this,e)}blob(){const e="blob";return Ye(this,e)||We(this,e)}bytes(){const e="bytes";return Ye(this,e)||We(this,e)}formData(){const e="formData";return Ye(this,e)||We(this,e)}json(){const e="json";return Ye(this,e)||We(this,e)}text(){const e="text";return Ye(this,e)||We(this,e)}toString(){return"[object Body]"}get[t](){return"Body"}get __MPHTTPX__(){return{chain:["Body"]}}}class ze{constructor(){this.bodyUsed=!1}}function Ge(e){return e.__Body__}function Ve(e,t){const r=e;if((n=t)&&"object"==typeof n&&"undefined"!=typeof ReadableStream&&ReadableStream&&ReadableStream.prototype.isPrototypeOf(n)||function(e){return(i("ReadableStream",e)||"[object ReadableStream]"===String(e))&&"getReader"in e&&"function"==typeof e.getReader}(t))throw new TypeError(`Failed to construct '${o(r)}': ReadableStream not implemented.`);var n;null!=t&&(Ge(r).payload=new Ie(t))}function We(e,t){let r=Ge(e).payload||new Ie;return"json"===t?r.text().then(function(e){return JSON.parse(e)}):"text"===t?r.text():"arrayBuffer"===t?r.arrayBuffer():"bytes"===t?r.arrayBuffer().then(function(e){return new Uint8Array(e)}):"blob"===t?r.promise.then(function(e){return new se([e])}):"formData"===t?r.text().then(function(e){return function(e,t){const r=function(){throw new TypeError("Could not parse content as FormData.")};"string"==typeof e&&""!==e.trim()||r();let n=e.indexOf("\r\n");-1===n&&r();let o=e.substring(2,n).trim();o||r(),void 0!==t&&t!==o&&r();let s=e.split(`--${o}`).filter(function(e){let t=e.trim();return""!==t&&"--"!==t});0===s.length&&r();let i=[],a=!1;s.forEach(function(e){let t=e.indexOf("\r\n\r\n");-1===t&&r();let n=e.substring(0,t).trim(),o=n.match(/name="([^"]*)"/);(!o||o.length<2)&&r();let s=o[1],l=n.match(/filename="([^"]*)"/),u=e.substring(t+4);if(l){let e=l[1]||"",t=n.match(/Content-Type: ([^\r\n]+)/),r=t?(t[1]||"").trim():"text/plain",o=u.replace(/\r\n/g,"");a=!0,i.push([s,new ce([o],e,{type:r})])}else i.push([s,u.replace(/^[\r\n]+|[\r\n]+$/g,"")])});let l=new(!a||function(){try{let e=new $e;return e.append("file",new ce([],"")),"string"!=typeof e.get("file")}catch(e){return!1}}()?$e:Le);return i.forEach(function(e){l.append(e[0],e[1])}),l}(e,Ne(r.type))}):r.promise}function Ye(e,t){if(Ge(e).payload){if(e.bodyUsed)return Promise.reject(new TypeError(`Failed to execute '${t}' on '${o(e)}': body stream already read`));Ge(e).bodyUsed=!0}}class Je{constructor(e){if(s(this,"__Headers__",new Ke),void 0!==e)if(rt(e))e.forEach(function(e,t){Ze(this,t,e,"")}.bind(this),this);else if(u(e)){let t=Array.isArray(e)?e:Array.from(e);for(let e=0;e<t.length;++e){let r=t[e];if(!u(r))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");{let e=Array.isArray(r)?r:Array.from(r);if(2!==e.length)throw new TypeError("Failed to construct 'Headers': Invalid value");Ze(this,e[0],e[1])}}}else{if(!e||"object"!=typeof e)throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(record<ByteString, ByteString> or sequence<sequence<ByteString>>)'.");Object.getOwnPropertyNames(e).forEach(function(t){Ze(this,t,e[t])}.bind(this),this)}}append(e,t){tt(arguments.length,2,"append"),Ze(this,e,t,"append")}delete(e){tt(arguments.length,1,"delete"),delete Qe(this).dict[nt(e,et("delete"))]}get(e){var t;return tt(arguments.length,1,"get"),null!==(t=Qe(this).dict[nt(e,et("get"))])&&void 0!==t?t:null}getSetCookie(){let e=this.get("Set-Cookie");return e?e.split(", "):[]}has(e){return tt(arguments.length,1,"has"),Qe(this).dict.hasOwnProperty(nt(e,et("has")))}set(e,t){tt(arguments.length,2,"set"),Qe(this).dict[nt(e,et("set"))]=ot(t)}forEach(e,t){if(tt(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");let r=Qe(this).dict,n=Object.getOwnPropertyNames(r);for(let o=0;o<n.length;++o){let s=n[o];e.call(t,r[s],s,this)}}entries(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.values()}keys(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.map(function(e){return e[0]}).values()}values(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){return"[object Headers]"}get[t](){return"Headers"}get __MPHTTPX__(){return{chain:["Headers"]}}}class Ke{constructor(){this.dict={}}}function Qe(e){return e.__Headers__}function Ze(e,t,r,n="constructor"){let o=nt(t,n?et(n):void 0),s=ot(r),i=Qe(e).dict,a=i[o];i[o]=void 0!==a?`${a}, ${s}`:s}function et(e){return function(){throw new TypeError(`Failed to ${e&&"constructor"!==e?"execute '"+e+"' on":"construct"} 'Headers': Invalid name`)}}function tt(e,t,r){c(e,t,"Headers",r)}function rt(e){return a("Headers",e)||function(e){let t="[object Headers]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&"forEach"in e&&"function"==typeof e.forEach}(e)}function nt(e,t){return"string"!=typeof e&&(e=""+e),t&&(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)&&t(),e.toLowerCase()}function ot(e){return"string"==typeof e?e:""+e}function st(e){let t=new at;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substring(1,e.length):e}).forEach(function(e){let r=e.split(":"),n=r.shift().trim();if(n){let e=r.join(":").trim();try{t.append(n,e)}catch(e){console.warn(`SyntaxError: Response.headers: '${n}' is not a valid HTTP header field name.`)}}}),t}function it(e){if(a("Headers",e)&&at!==Je){let t=new at;return e.forEach(function(e,r){t.append(r,e)}),t}return new at(e)}const at="undefined"!=typeof Headers&&Headers||Je;class lt extends ke{constructor(e,t){c(arguments.length,1,"Request"),super(),s(this,"__Request__",new ut);const r=ct(this);let n=null!=t?t:{};if("object"!=typeof n)throw new TypeError("Failed to construct 'Request': The provided value is not of type 'RequestInit'.");let o=n.body,i=!1;if(a("Request",l=e)||function(e){let t="[object Request]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer}(l)){if(e.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.cache=e.cache,r.credentials=e.credentials,void 0===n.headers&&(ct(this).headers=it(e.headers)),r.method=e.method,r.mode=e.mode,r.signal=e.signal,r.url=e.url,o||(this.__Body__.payload=ht(e),i=!0)}else r.url=""+e;var l;if(n.cache&&(r.cache=n.cache),n.credentials&&(r.credentials=n.credentials),void 0!==n.headers&&(ct(this).headers=it(n.headers)),n.method&&(r.method=function(e){let t=e.toUpperCase();return ft.indexOf(t)>-1?t:e}(n.method)),n.mode&&(r.mode=n.mode),null!==n.signal&&void 0!==n.signal){if(!j(n.signal))throw new TypeError("Failed to construct 'Request': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.");r.signal=n.signal}if(("GET"===this.method||"HEAD"===this.method)&&null!=o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");Ve(this,i?null:o);let u=this.__Body__.payload;!this.headers.has("Content-Type")&&u&&u.type&&this.headers.set("Content-Type",u.type),"GET"!==this.method&&"HEAD"!==this.method||"no-cache"!==this.cache&&"no-store"!==this.cache||function(e){let t=/([?&])_=[^&]*/;if(t.test(e.url))ct(e).url=e.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;ct(e).url+=(t.test(e.url)?"&":"?")+"_="+(new Date).getTime()}}(this)}get cache(){return ct(this).cache}get credentials(){return ct(this).credentials}get destination(){return""}get headers(){return ct(this).headers||(ct(this).headers=new at),ct(this).headers}get integrity(){return""}get keepalive(){return!1}get method(){return ct(this).method}get mode(){return ct(this).mode}get redirect(){return"follow"}get referrer(){return ct(this).referrer}get referrerPolicy(){return""}get signal(){return ct(this).signal||(ct(this).signal=(new W).signal),ct(this).signal}get url(){return ct(this).url}clone(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Request': Request body is already used");{let e=new lt(this);return this.__Body__.bodyUsed=!1,e}}toString(){return"[object Request]"}get[t](){return"Request"}get __MPHTTPX__(){return{chain:["Request","Body"]}}}class ut{constructor(){this.cache="default",this.credentials="same-origin",this.method="GET",this.mode="cors",this.referrer="about:client",this.url=""}}function ct(e){return e.__Request__}function ht(e){let t=Object.create(Ie.prototype);t.type=e.headers.get("Content-Type")||"";try{t.promise=e.arrayBuffer()}catch(r){try{t.promise=e.text()}catch(r){if("multipart/form-data"===t.type.slice(0,19).toLowerCase())try{t.promise=e.formData().then(function(e){return new Ie(e,t.type).promise})}catch(e){}}}if(!t.promise)throw new TypeError("Failed to construct 'Request': Failed to read request body data, underlying data is in an invalid format.");return t}const ft=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];const dt="undefined"!=typeof Request&&Request||lt;class pt extends ke{static json(e,t){c(arguments.length,1,"Response","json");let r=new pt("string"==typeof e?e:JSON.stringify(e),t);return r.headers.set("Content-Type","application/json"),r}static error(){let e=new pt(null,{status:200,statusText:""});return gt(e).status=0,gt(e).type="error",e}static redirect(e,t=302){if(c(arguments.length,1,"Response","redirect"),-1===[301,302,303,307,308].indexOf(t))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new pt(null,{status:t,headers:{location:""+e}})}constructor(e,t){super(),s(this,"__Response__",new yt);const r=gt(this);let n=null!=t?t:{};if("object"!=typeof n)throw new TypeError("Failed to construct 'Response': The provided value is not of type 'ResponseInit'.");void 0!==n.headers&&(gt(this).headers=it(n.headers));let o=void 0===n.status?200:n.status;if(o<200||o>599)throw new RangeError(`Failed to construct 'Response': The status provided (${+o}) is outside the range [200, 599].`);r.status=o,r.statusText=void 0===n.statusText?"":""+n.statusText,Ve(this,e);let i=this.__Body__.payload;!this.headers.has("Content-Type")&&i&&i.type&&this.headers.set("Content-Type",i.type)}get headers(){return gt(this).headers||(gt(this).headers=new at),gt(this).headers}get ok(){return this.status>=200&&this.status<300}get redirected(){return!1}get status(){return gt(this).status}get statusText(){return gt(this).statusText}get type(){return gt(this).type}get url(){return gt(this).url}clone(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Response': Response body is already used");let e=new pt(null,{headers:it(this.headers),status:this.status,statusText:this.statusText});return gt(e).url=this.url,e.__Body__.payload=this.__Body__.payload,e}toString(){return"[object Response]"}get[t](){return"Response"}get __MPHTTPX__(){return{chain:["Response","Body"]}}}class yt{constructor(){this.status=200,this.statusText="",this.type="default",this.url=""}}function gt(e){return e.__Response__}const bt="undefined"!=typeof Response&&Response||pt,_t={XMLHttpRequest:"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||void 0};function mt(e,t){if(c(arguments.length,1,"Window","fetch"),new.target===mt)throw new TypeError("fetch is not a constructor");return new Promise(function(r,o){const s=new lt(e,t),i=s.__Request__.signal;if(i&&i.aborted)return o(i.reason);let a,l=new(_t.XMLHttpRequest||function(){throw new ReferenceError("XMLHttpRequest is not defined")}()),u=!1,c=s.__Body__.payload;if(l.onload=function(){let e={headers:st(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};0===s.url.indexOf("file://")&&(l.status<200||l.status>599)&&(e.status=200),setTimeout(function(){a=new pt("response"in l?l.response:l.responseText,e),a.__Response__.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL")||"";let t=a.__Body__.payload,n=a.headers.get("Content-Type")||"";t&&n&&(t.type=n),u?o(vt()):r(a)},0)},l.onabort=function(){setTimeout(function(){o(vt())},0)},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))},0)},l.ontimeout=function(){setTimeout(function(){o(new n("The request timed out.","TimeoutError"))},0)},l.open(s.method,wt(s.url),!0),"include"===s.credentials?l.withCredentials=!0:"omit"===s.credentials&&(l.withCredentials=!1),"responseType"in l&&(l.responseType="arraybuffer"),t&&"object"==typeof t&&t.headers&&"object"==typeof t.headers&&!rt(t.headers)){let e=t.headers,r=[];Object.getOwnPropertyNames(e).forEach(function(t){r.push(nt(t)),l.setRequestHeader(t,ot(e[t]))}),s.headers.forEach(function(e,t){-1===r.indexOf(t)&&l.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){l.setRequestHeader(t,e)});if(i){const e=function(){if(a&&!a.bodyUsed){(a.__Body__.payload=new Ie).promise=Promise.reject(vt())}u=!0,l.abort(),t()},t=function(){i.removeEventListener("abort",e)};i.addEventListener("abort",e),l.onreadystatechange=function(){4===l.readyState&&t()}}c?c.promise.then(function(e){u?o(vt()):l.send(""!==e?e:void 0)}).catch(function(e){console.error(e),o(new TypeError("Failed to fetch"))}):l.send()})}function vt(){return new n("The user aborted a request.","AbortError")}const Tt="undefined"!=typeof location&&!!location,wt=function(e){return""===e&&Tt&&(null===location||void 0===location?void 0:location.href)?location.href:e},Et="undefined"!=typeof fetch&&fetch||mt,Pt={value:!1};exports.AbortController=W,exports.AbortControllerP=G,exports.AbortSignal=z,exports.AbortSignalP=X,exports.Blob=se,exports.BlobP=Q,exports.CustomEvent=M,exports.CustomEventP=q,exports.Event=S,exports.EventP=v,exports.EventTarget=O,exports.EventTargetP=R,exports.File=ce,exports.FileP=ue,exports.FileReader=we,exports.FileReaderP=ge,exports.FormData=$e,exports.FormDataP=Le,exports.Headers=at,exports.HeadersP=Je,exports.Request=dt,exports.RequestP=lt,exports.Response=bt,exports.ResponseP=pt,exports.TextDecoder=m,exports.TextDecoderP=y,exports.TextEncoder=d,exports.TextEncoderP=h,exports.URLSearchParams=Ce,exports.URLSearchParamsP=Ee,exports.fetch=Et,exports.fetchP=mt,exports.fixFetch=function(e){const t=e||"undefined"!=typeof fetch&&fetch;if(!t||t===mt)return mt;if("__MPHTTPX__Polyfill__"in t)return t;function r(e,t){if(e.headers){if((r=e.headers)&&"object"==typeof r&&"has"in r&&"function"==typeof r.has&&"set"in r&&"function"==typeof r.set)e.headers.has("Content-Type")||e.headers.set("Content-Type",t);else if(u(e.headers)){let r=!1,n=Array.isArray(e.headers)?e.headers:Array.from(e.headers);for(let e=0;e<n.length;++e){let t=n[e];if(u(t)){let e=Array.isArray(t)?t:Array.from(t);if(e.length>=2&&"content-type"===String(e[0]).toLowerCase()){r=!0;break}}}r||(n.push(["Content-Type",t]),e.headers=n)}else if("object"==typeof e.headers){let r=!1,n=Object.getOwnPropertyNames(e.headers);for(let e=0;e<n.length;++e){if("content-type"===n[e].toLowerCase()){r=!0;break}}r||(e.headers["Content-Type"]=t)}}else e.headers={"Content-Type":t};var r}function o(e,o){if(a("Request",e)){let t=e,r=o||{};r.method||(r.method=t.method),r.headers||(r.headers=t.headers),r.mode||(r.mode=t.mode),r.cache||(r.cache=t.cache),r.credentials||(r.credentials=t.credentials),!r.signal&&t.__Request__.signal&&(r.signal=t.signal),r.body||(r.body=ht(t)),e=t.url,o=r}if(o&&o.headers&&a("Headers",o.headers))if("undefined"!=typeof Headers&&Headers&&!("__MPHTTPX__"in Headers.prototype)){let e=new Headers;o.headers.forEach(function(t,r){e.append(r,t)}),o.headers=e}else{let e={};o.headers.forEach(function(t,r){e[r]=t}),o.headers=e}return new Promise(function(s,i){o&&o.body&&(Pt.value?De(o.body):a("FormData",o.body))&&(o.body=Ue(o.body));let l=o&&o.body&&((Pt.value?oe(o.body):a("Blob",o.body))&&new Ie(o.body)||Ie.prototype.isPrototypeOf(o.body)&&o.body);if(l){l.type&&r(o,l.type);let a=null,u=!1,c=!0;if(e&&"object"==typeof e&&"signal"in e&&j(e.signal)){let t=function(){c&&(u=!0),a()};a=function(){e.signal.removeEventListener("abort",t)},e.signal.addEventListener("abort",t)}l.promise.then(function(r){o.body=""!==r?r:null,u?i(new n("The user aborted a request.","AbortError")):s(t.call(this,e,o)),c=!1}.bind(this)).catch(function(e){i(new TypeError("Failed to fetch")),console.error(e),c=!1}).then(function(){a&&a()})}else o&&o.body&&a("URLSearchParams",o.body)&&r(o,"application/x-www-form-urlencoded;charset=UTF-8"),s(t.call(this,e,o))}.bind(this))}return o.__MPHTTPX__Polyfill__=!0,o},exports.fixWebSocket=function(e){const t=e||"undefined"!=typeof WebSocket&&WebSocket;if(!t||"__MPHTTPX__Polyfill__"in t||"__MPHTTPX__"in t.prototype)return;const r=t.prototype.send;t.prototype.send=function(e){if(Pt.value?oe(e):a("Blob",e)){new Ie(e).promise.then(function(e){1===this.readyState&&r.call(this,e)}.bind(this))}else r.call(this,e)},t.__MPHTTPX__Polyfill__=!0},exports.fixXMLHttpRequest=function(e){const t=e||"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest;if(!t||"__MPHTTPX__Polyfill__"in t||"__MPHTTPX__"in t.prototype)return;const r=t.prototype.abort,o=t.prototype.open,i=t.prototype.send,l=t.prototype.setRequestHeader;t.prototype.abort=function(){c(this).processing&&(c(this).aborted=!0),r.call(this),c(this).hasContentType=!1},t.prototype.open=function(e,t,r=!0,n=null,s=null){c(this).processing&&(c(this).aborted=!0),o.call(this,e,t,r,n,s),c(this).hasContentType=!1},t.prototype.send=function(e){if((Pt.value?De(e):a("FormData",e))&&(e=Ue(e),c(this).hasContentType||this.setRequestHeader("Content-Type",e.type)),Pt.value?oe(e):a("Blob",e)){let t=new Ie(e);t.type&&!c(this).hasContentType&&this.setRequestHeader("Content-Type",t.type);const r=this.withCredentials;c(this).processing=!0,t.promise.then(function(e){c(this).aborted||(r!==this.withCredentials&&(console.warn("Illegal to set the 'withCredentials' property on 'XMLHttpRequest': The value may only be set if the object's state is UNSENT or OPENED."),this.withCredentials=r),i.call(this,""!==e?e:void 0)),c(this).aborted=!1,c(this).processing=!1}.bind(this)).catch(function(e){console.error(e),c(this).aborted=!1,c(this).processing=!1}.bind(this))}else a("URLSearchParams",e)&&!c(this).hasContentType&&this.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8"),i.call(this,e)},t.prototype.setRequestHeader=function(e,t){if(c(this).processing)throw new n("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");l.call(this,e,t),"content-type"===String(e).toLowerCase()&&(c(this).hasContentType=!0)},t.__MPHTTPX__Polyfill__=!0;class u{constructor(){this.aborted=!1,this.processing=!1,this.hasContentType=!1}}function c(e){const t="__XMLHttpRequest_Polyfill__";return t in e||s(e,t,new u),e[t]}},exports.setFullOverride=function(e){Pt.value=!!e},exports.setReadableStreamClass=function(e){K.ReadableStream=e},exports.setXMLHttpRequestClass=function(e){_t.XMLHttpRequest=e};
|
|
1
|
+
"use strict";const e="function"==typeof Symbol&&(Symbol.iterator||"Symbol(Symbol.iterator)"),t="function"==typeof Symbol&&(Symbol.toStringTag||"Symbol(Symbol.toStringTag)");class r extends Error{constructor(e,t){super(e),void 0!==t&&(this.name=""+t)}get[t](){return"DOMException"}get __MPHTTPX__(){return{chain:["DOMException"]}}}const n=function(){try{return new DOMException,!0}catch(e){return!1}}()?DOMException:r;function o(e){try{return e.__MPHTTPX__.chain[0]}catch(t){return Object.prototype.toString.call(e).slice(8,-1)}}function s(e,t,r){Object.defineProperty(e,t,{value:r})}function i(e,t){return Object.prototype.toString.call(t)===`[object ${e}]`}function a(e,t,r=!1){const n="__MPHTTPX__";return!!t&&"object"==typeof t&&n in t&&!!t[n]&&"object"==typeof t[n]&&"chain"in t[n]&&Array.isArray(t[n].chain)&&(o=t[n].chain.indexOf(e),r?0===o:o>-1);var o}const l="function"==typeof Symbol&&!!Symbol.iterator;function u(e){return Array.isArray(e)||!!e&&"object"==typeof e&&l&&Symbol.iterator in e&&"function"==typeof e[Symbol.iterator]}function c(e,t,r,n){if(e<t)throw new TypeError(`Failed to ${n?"execute '"+n+"' on":"construct"} '${r}': ${t} argument${t>1?"s":""} required, but only ${e} present.`)}class h{get encoding(){return"utf-8"}encode(e=""){return f("string"==typeof e?e:""+e).encoded}encodeInto(e,t){if(c(arguments.length,2,"TextEncoder","encodeInto"),!Uint8Array.prototype.isPrototypeOf(t)&&!i("Uint8Array",t))throw new TypeError("Failed to execute 'encodeInto' on 'TextEncoder': parameter 2 is not of type 'Uint8Array'.");let r=f("string"==typeof e?e:""+e,t);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get[t](){return"TextEncoder"}get __MPHTTPX__(){return{chain:["TextEncoder"]}}}function f(e,t){const r=void 0!==t;let n=0,o=0,s=e.length,i=0,a=Math.max(32,s+(s>>1)+7),l=r?t:new Uint8Array(a>>3<<3),u=0,c=0,h=0;for(;n<s;){if(u=e.charCodeAt(n),c=1,u>=55296&&u<=56319)if(n+1<s){let t=e.charCodeAt(n+1);56320==(64512&t)?(c=2,n+=2,u=((1023&u)<<10)+(1023&t)+65536):(n+=1,u=65533)}else n+=1,u=65533;else u>=56320&&u<=57343?(n+=1,u=65533):n+=1;if(!r&&i+4>l.length){a+=8,a*=1+n/e.length*2,a=a>>3<<3;let t=new Uint8Array(a);t.set(l),l=t}if(4294967168&u?4294965248&u?4294901760&u?4292870144&u?(u=65533,h=3):h=4:h=3:h=2:h=1,r&&i+h>l.length)break;switch(h){case 1:l[i++]=u;break;case 2:l[i++]=u>>6&31|192,l[i++]=63&u|128;break;case 3:l[i++]=u>>12&15|224,l[i++]=u>>6&63|128,l[i++]=63&u|128;break;case 4:l[i++]=u>>18&7|240,l[i++]=u>>12&63|128,l[i++]=u>>6&63|128,l[i++]=63&u|128}o+=c}return{encoded:r?t:l.slice(0,i),read:o,written:i}}const d="undefined"!=typeof TextEncoder&&TextEncoder||h,p=["utf-8","utf8","unicode-1-1-utf-8"];class y{constructor(e="utf-8",t){if(-1===p.indexOf(("string"==typeof e?e:""+e).toLowerCase()))throw new RangeError(`Failed to construct 'TextDecoder': encoding ('${e}') not implemented.`);s(this,"__TextDecoder__",new g(t))}get encoding(){return"utf-8"}get fatal(){return b(this).fatal}get ignoreBOM(){return b(this).ignoreBOM}decode(e,t){return function(e,{stream:t=!1}={},r={fatal:!1,ignoreBOM:!1,partial:[]}){if(void 0===e){if(r.partial.length>0&&r.fatal)throw r.partial=[],new TypeError("Incomplete UTF-8 sequence.");return""}let n=_(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):function(){throw new TypeError("Input could not be converted to any of: ArrayBufferView, ArrayBuffer.")}();if(r.partial.length>0){let e=new Uint8Array(r.partial.length+n.length);e.set(r.partial,0),e.set(n,r.partial.length),n=e,r.partial=[]}!r.ignoreBOM&&n.length>=3&&239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3));let o=n.length,s=[];if(t&&n.length>0){let e=n.length;for(;e>0&&e>n.length-4;){let t=n[e-1];if(128!=(192&t)){(t>239?4:t>223?3:t>191?2:1)>n.length-(e-1)&&(o=e-1);break}--e}r.partial=Array.from(n.slice(o)),n=n.slice(0,o)}let i=0,a=0,l=0,u=0,c=0,h=0,f=0,d=0;for(;d<o;){if(i=0,u=n[d],l=u>239?4:u>223?3:u>191?2:1,d+l<=o)switch(l){case 1:u<128&&(i=u);break;case 2:c=n[d+1],128==(192&c)&&(a=(31&u)<<6|63&c,a>127&&(i=a));break;case 3:c=n[d+1],h=n[d+2],128==(192&c)&&128==(192&h)&&(a=(15&u)<<12|(63&c)<<6|63&h,a>2047&&(a<55296||a>57343)&&(i=a));break;case 4:c=n[d+1],h=n[d+2],f=n[d+3],128==(192&c)&&128==(192&h)&&128==(192&f)&&(a=(15&u)<<18|(63&c)<<12|(63&h)<<6|63&f,a>65535&&a<1114112&&(i=a))}if(0===i&&(1===l&&0!==u||l>1)){if(r.fatal)throw r.partial=[],new TypeError("Decoding failed.");let e=1;for(;d+e<o&&128==(192&n[d+e]);)e+=1;s.push(65533),d+=e;continue}i>65535&&(i-=65536,s.push(i>>>10&1023|55296),i=56320|1023&i),s.push(i),d+=l}return s.length>16384?function(e){let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(String.fromCharCode.apply(String,e.slice(r,r+4096)));return t.join("")}(s):function(e){let t="";for(let r=0,n=e.length;r<n;r+=4096)t+=String.fromCharCode.apply(String,e.slice(r,r+4096));return t}(s)}(e,t,b(this))}toString(){return"[object TextDecoder]"}get[t](){return"TextDecoder"}get __MPHTTPX__(){return{chain:["TextDecoder"]}}}class g{constructor({fatal:e=!1,ignoreBOM:t=!1}={}){this.partial=[],this.fatal=!!e,this.ignoreBOM=!!t}}function b(e){return e.__TextDecoder__}function _(e){return!!e&&"object"==typeof e&&ArrayBuffer.prototype.isPrototypeOf(e)||function(e){return(i("ArrayBuffer",e)||"[object ArrayBuffer]"===String(e))&&!!e&&"object"==typeof e&&"byteLength"in e&&"number"==typeof e.byteLength}(e)}const m="undefined"!=typeof TextDecoder&&TextDecoder||y;class v{static get NONE(){return 0}static get CAPTURING_PHASE(){return 1}static get AT_TARGET(){return 2}static get BUBBLING_PHASE(){return 3}constructor(e,t){c(arguments.length,1,"Event"),s(this,"__Event__",new T);const r=w(this);r.type=""+e,r.bubbles=!!(null==t?void 0:t.bubbles),r.cancelable=!!(null==t?void 0:t.cancelable),r.composed=!!(null==t?void 0:t.composed),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return"YES"===r.isTrusted}})}get NONE(){return 0}get CAPTURING_PHASE(){return 1}get AT_TARGET(){return 2}get BUBBLING_PHASE(){return 3}get bubbles(){return w(this).bubbles}get cancelBubble(){return w(this).cancelBubble}set cancelBubble(e){e&&(w(this).cancelBubble=!0)}get cancelable(){return w(this).cancelable}get composed(){return w(this).composed}get currentTarget(){return w(this).currentTarget}get defaultPrevented(){return w(this).defaultPrevented}get eventPhase(){return w(this).eventPhase}get returnValue(){return w(this).returnValue}set returnValue(e){e||this.preventDefault()}get srcElement(){return w(this).target}get target(){return w(this).target}get timeStamp(){return w(this).timeStamp}get type(){return w(this).type}composedPath(){let e=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&e.push(this.currentTarget),e}initEvent(e,t,r){c(arguments.length,1,o(this),"initEvent");let n=w(this);n.eventDispatched||(n.type=""+e,n.bubbles=!!t,n.cancelable=!!r)}preventDefault(){let e=w(this);if(e.passive)return console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`);this.cancelable&&(e.defaultPrevented=!0,e.returnValue=!1)}stopImmediatePropagation(){w(this).immediatePropagationStopped=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get[t](){return"Event"}get __MPHTTPX__(){return{chain:["Event"]}}}class T{constructor(){this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.composed=!1,this.currentTarget=null,this.defaultPrevented=!1,this.eventPhase=0,this.returnValue=!0,this.target=null,this.timeStamp=(new Date).getTime()-E,this.type="",this.passive=!1,this.eventDispatched=!1,this.immediatePropagationStopped=!1,Object.defineProperty(this,"isTrusted",P())}}function w(e){return e.__Event__}const E=(new Date).getTime();function P(){let e=P.name,t=e.length,r="NO";return{configurable:!1,enumerable:!0,get:function(){return r},set:function(n){e===n.slice(0,t)&&(r=n.slice(t+1))}}}function x(e,t){(w(e)||{}).isTrusted=`${P.name}:${t?"YES":"NO"}`}const S="undefined"!=typeof Event&&Event||v;class R{constructor(){s(this,"__EventTarget__",new A)}addEventListener(e,t,r){if(c(arguments.length,2,o(this),"addEventListener"),"function"!=typeof t&&"object"!=typeof t&&void 0!==t)throw new TypeError(`Failed to execute 'addEventListener' on '${o(this)}': parameter 2 is not of type 'Object'.`);let n=F(this)||{executors:[]},s=new B(e,t),i=s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture);if(!n.executors.some(function(e){return e.equals(s)})){if(n.executors.push(s),r&&"object"==typeof r){s.options.once=!!r.once,s.options.passive=!!r.passive;const e=r.signal;e&&H(e)&&!e.aborted&&(s.options.signal=e,function(e,t,r){const n=function(){F(e).executors=F(e).executors.filter(function(e){return!e.equals(t)}),r.removeEventListener("abort",n)};r.addEventListener("abort",n)}(this,s,e))}if(i){let e=function(e){return e.options.capture?0:1};n.executors=n.executors.sort(function(t,r){return e(t)-e(r)})}}}dispatchEvent(e){if(c(arguments.length,1,o(this),"dispatchEvent"),a("Event",e))x(e,!1);else{if(!function(e){const t=function(e){return"[object "===e.slice(0,8)&&"Event]"===e.slice(-6)};return!!e&&"object"==typeof e&&(t(Object.prototype.toString.call(e))||t(String(e)))&&"type"in e&&"string"==typeof e.type}(e))throw new TypeError(`Failed to execute 'dispatchEvent' on '${o(this)}': parameter 1 is not of type 'Event'.`);console.warn(`WARNING: undefined behavior when executing 'dispatchEvent' on '${o(this)}': parameter 1 is not of type 'Event(P)'.`)}return C(this,e)}removeEventListener(e,t,r){if(c(arguments.length,2,o(this),"removeEventListener"),"function"!=typeof t&&"object"!=typeof t&&void 0!==t)throw new TypeError(`Failed to execute 'removeEventListener' on '${o(this)}': parameter 2 is not of type 'Object'.`);let n=F(this)||{executors:[]},s=new B(e,t);s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),n.executors.some(function(e){return e.equals(s)})&&(n.executors=n.executors.filter(function(e){return!e.equals(s)}))}toString(){return"[object EventTarget]"}get[t](){return"EventTarget"}get __MPHTTPX__(){return{chain:["EventTarget"]}}}class A{constructor(){this.executors=[]}}function F(e){return e.__EventTarget__}class B{constructor(e,t){var r;this.options={},this.type=""+e,this.callback="function"==typeof(r=t)?r:function(e){return!!e&&"object"==typeof e&&"handleEvent"in e&&"function"==typeof e.handleEvent}(r)?r.handleEvent:r}equals(e){return this.type===e.type&&this.callback===e.callback&&this.options.capture===e.options.capture}}function C(e,t){const r=F(e)||{},n=t.__Event__||{};n.target=e,n.currentTarget=e,n.eventPhase=2,n.eventDispatched=!0;let o=[];Array.isArray(r.executors)||(r.executors=[]);for(let s=0;s<r.executors.length&&!n.immediatePropagationStopped;++s){let i=r.executors[s];if(i.type===t.type){i.options.once&&o.push(s),n.passive=!!i.options.passive;try{let r=i.callback;"function"==typeof r&&r.call(e,t)}catch(e){console.error(e)}n.passive=!1}}return o.length>0&&(r.executors=r.executors.reduce(function(e,t,r){return-1===o.indexOf(r)&&e.push(t),e},[])),n.currentTarget=null,n.eventPhase=0,n.eventDispatched=!1,!(t.cancelable&&t.defaultPrevented)}function j(e,t){return function(r){const n="on"+r,o=e[n],s=t[n];"function"==typeof o?R.prototype.addEventListener.call(e,r,s):R.prototype.removeEventListener.call(e,r,s)}}function L(e,t,r){"function"==typeof t&&t.call(e,r)}function H(e){return a("EventTarget",e)||function(e){return!!e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener&&"removeEventListener"in e&&"function"==typeof e.removeEventListener}(e)}const O="undefined"!=typeof EventTarget&&EventTarget||R;class q extends v{constructor(e,t){var r;c(arguments.length,1,"CustomEvent"),super(e,t),s(this,"__CustomEvent__",new D),U(this).detail=null!==(r=null==t?void 0:t.detail)&&void 0!==r?r:null}get detail(){return U(this).detail}initCustomEvent(e,t,r,n){c(arguments.length,1,"CustomEvent","initCustomEvent"),this.__Event__.eventDispatched||(this.initEvent(e,t,r),U(this).detail=null!=n?n:null)}toString(){return"[object CustomEvent]"}get[t](){return"CustomEvent"}get __MPHTTPX__(){return{chain:["CustomEvent","Event"]}}}class D{}function U(e){return e.__CustomEvent__}const M="undefined"!=typeof CustomEvent&&CustomEvent||q;class X extends R{static abort(e){let t=I();return k(t,!1,e),t}static any(e){if(c(arguments.length,1,"AbortSignal","any"),!u(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': The provided value cannot be converted to a sequence.");let t=Array.isArray(e)?e:Array.from(e);t.forEach(function(e){if(!H(e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': Failed to convert value to 'AbortSignal'.")});let r=I(),n=function(){for(let e=0;e<t.length;++e){let r=t[e];if(r.aborted)return r}}();return n?k(r,!1,n.reason):function(e,t){function r(){for(let e=0;e<t.length;++e){t[e].removeEventListener("abort",r)}k(e,!0,this.reason)}for(let e=0;e<t.length;++e){t[e].addEventListener("abort",r)}}(r,t),r}static timeout(e){if(c(arguments.length,1,"AbortSignal","timeout"),!(e>=0))throw new TypeError("Failed to execute 'timeout' on 'AbortSignal': Value is outside the 'unsigned long long' value range.");const t=I();return setTimeout(function(){k(t,!0,new n("signal timed out","TimeoutError"))},e),t}constructor(){if(new.target===X)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),s(this,"__AbortSignal__",new N(this))}get aborted(){return $(this).aborted}get reason(){return $(this).reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return $(this).onabort}set onabort(e){$(this).onabort=e,$(this).attach("abort")}toString(){return"[object AbortSignal]"}get[t](){return"AbortSignal"}get __MPHTTPX__(){return{chain:["AbortSignal","EventTarget"]}}}class N{constructor(e){var t;this.aborted=!1,this.reason=void 0,this.onabort=null,this.attach=j(e,(t=e,{onabort:function(e){L(t,t.onabort,e)}}))}}function $(e){return e.__AbortSignal__}function I(){let e=Object.create(X.prototype);return s(e,"__EventTarget__",{executors:[]}),s(e,"__AbortSignal__",new N(e)),e}function k(e,t=!0,r){if(!e.aborted){let o=$(e)||{};if(o.aborted=!0,o.reason=void 0!==r?r:new n("signal is aborted without reason","AbortError"),t){let t=new v("abort");t.__Event__.target=e,x(t,!0),C(e,t)}}}const z="undefined"!=typeof AbortSignal&&AbortSignal||X;class G{constructor(){s(this,"__AbortController__",new V)}get signal(){return(e=this,e.__AbortController__).signal;var e}abort(e){k(this.signal,!0,e)}toString(){return"[object AbortController]"}get[t](){return"AbortController"}get __MPHTTPX__(){return{chain:["AbortController"]}}}class V{constructor(){this.signal=I()}}const W="undefined"!=typeof AbortController&&AbortController||G,Y=d.prototype.encode.bind(new d),J=m.prototype.decode.bind(new m),K={ReadableStream:"undefined"!=typeof ReadableStream&&ReadableStream||void 0};class Q{constructor(e=[],t){if(!u(e))throw new TypeError("Failed to construct 'Blob/File': The provided value cannot be converted to a sequence.");let r=Array.isArray(e)?e:Array.from(e),n=[],o=0;for(let e=0;e<r.length;++e){let t=r[e];if(oe(t))o+=t.size,n.push(t.arrayBuffer().then(function(e){return new Uint8Array(e)}));else{let e=_(t)||ArrayBuffer.isView(t)?te(t):Y(t);o+=e.length,n.push(Promise.resolve(e))}}s(this,"__Blob__",new Z(Promise.all(n).then(function(e){return function(e){let t=e.reduce(function(e,t){return e+t.byteLength},0),r=new Uint8Array(t);return e.reduce(function(e,t){return r.set(t,e),e+t.byteLength},0),r}(e)}))),ee(this).size=o,ee(this).type=re(null==t?void 0:t.type)}get size(){return ee(this).size}get type(){return ee(this).type}arrayBuffer(){return ee(this).promise.then(function(e){return ne(e.buffer).buffer})}bytes(){return ee(this).promise.then(function(e){return ne(e.buffer)})}slice(e,t,r){let n=null!=e?e:0,o=null!=t?t:this.size,i=Object.create(Q.prototype);return s(i,"__Blob__",new Z(ee(this).promise.then(function(e){return ne(e.slice(n,o))}))),ee(i).size=function(e,t,r){const n=function(t){let r=Number(t);return isNaN(r)&&(r=0),r=r>=0?Math.min(r,e):Math.max(0,r+e),r};return Math.max(0,n(r)-n(t))}(this.size,n,o),ee(i).type=re(r),i}stream(){let e=K.ReadableStream||function(){throw new ReferenceError("ReadableStream is not defined")}(),t=0;try{return new e({type:"bytes",autoAllocateChunkSize:524288,pull:function(e){var r;let n=null===(r=e.byobRequest)||void 0===r?void 0:r.view;return this.slice(t,(null==n?void 0:n.byteLength)?t+n.byteLength:void 0).arrayBuffer().then(function(r){var o;let s=new Uint8Array(r),i=s.byteLength;t+=i,n.set(s),null===(o=e.byobRequest)||void 0===o||o.respond(i),t>=this.size&&e.close()}.bind(this))}.bind(this)})}catch(r){return new e({pull:function(e){return this.slice(t,t+524288).arrayBuffer().then(function(r){t+=r.byteLength;let n=new Uint8Array(r);e.enqueue(n),t==this.size&&e.close()}.bind(this))}.bind(this)})}}text(){return ee(this).promise.then(function(e){return J(e)})}toString(){return"[object Blob]"}get[t](){return"Blob"}get __MPHTTPX__(){return{chain:["Blob"]}}}class Z{constructor(e){this.size=0,this.type="",this.promise=e}}function ee(e){return e.__Blob__}function te(e){return _(e)?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function re(e){let t=""+(void 0!==e?e:"");return/[^\u0020-\u007E]/.test(t)?"":t.toLowerCase()}function ne(e){let t=te(e),r=new Uint8Array(new ArrayBuffer(t.byteLength));return r.set(t),r}function oe(e,t=!1){return a("Blob",e,t)||function(e,t=!1){let r=["[object Blob]"];t||r.push("[object File]");return(r.indexOf(Object.prototype.toString.call(e))>-1||r.indexOf(String(e))>-1)&&!!e&&"object"==typeof e&&"size"in e&&"number"==typeof e.size&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer}(e,t)}const se=function(){try{return 2===new Blob(["ä"]).size}catch(e){return!1}}()?Blob:Q;function ie(e){class r extends e{constructor(e,t,r){c(arguments.length,2,"File"),super(e,r),s(this,"__File__",new ae),le(this).lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date)||0,le(this).name=""+t}get lastModified(){return le(this).lastModified}get name(){return le(this).name}get webkitRelativePath(){return""}toString(){return"[object File]"}get[t](){return"File"}}return e===Q&&Object.defineProperty(r.prototype,"__MPHTTPX__",{configurable:!0,get:function(){return{chain:["File","Blob"]}}}),r}class ae{constructor(){this.lastModified=0,this.name=""}}function le(e){return e.__File__}const ue=ie(Q),ce=function(){try{return new File([],""),!0}catch(e){return!1}}()?File:se===Q?ue:ie(se),he=["loaded","total"];class fe extends v{constructor(e,t){var r,n;super(e,t),s(this,"__ProgressEvent__",new de);const o=pe(this);o.lengthComputable=!!(null==t?void 0:t.lengthComputable),o.loaded=Number(null!==(r=null==t?void 0:t.loaded)&&void 0!==r?r:0),o.total=Number(null!==(n=null==t?void 0:t.total)&&void 0!==n?n:0);for(let e=0;e<he.length;++e){let t=he[e];if(isNaN(this[t]))throw new TypeError(`Failed to construct 'ProgressEvent': Failed to read the '${t}' property from 'ProgressEventInit': The provided double value is non-finite.`)}}get lengthComputable(){return pe(this).lengthComputable}get loaded(){return pe(this).loaded}get total(){return pe(this).total}toString(){return"[object ProgressEvent]"}get[t](){return"ProgressEvent"}get __MPHTTPX__(){return{chain:["ProgressEvent","Event"]}}}class de{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function pe(e){return e.__ProgressEvent__}function ye(e,t,r=0,n=0){let o=new fe(t,{lengthComputable:n>0,loaded:r,total:n});o.__Event__.target=e,x(o,!0),C(e,o)}class ge extends R{static get EMPTY(){return 0}static get LOADING(){return 1}static get DONE(){return 2}constructor(){super(),s(this,"__FileReader__",new be(this))}get EMPTY(){return 0}get LOADING(){return 1}get DONE(){return 2}get error(){return _e(this).error}get readyState(){return _e(this).readyState}get result(){return _e(this).result}abort(){2===_e(this).pos&&function(e){let t=_e(e);t.pos=5,t.error=new n("An ongoing operation was aborted, typically with a call to abort().","AbortError"),t.result=null,t.readyState=2,ye(e,"abort"),Te(e)}(this)}readAsArrayBuffer(e){me(this,"readAsArrayBuffer",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer()})}readAsBinaryString(e){me(this,"readAsBinaryString",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer().then(function(e){let t=[],r=new Uint8Array(e);for(let e=0;e<r.length;++e)t.push(String.fromCharCode(r[e]));return t.join("")})})}readAsDataURL(e){me(this,"readAsDataURL",arguments.length,e),ve(this,e.size,function(){return e.arrayBuffer().then(function(t){return"data:"+(e.type||"application/octet-stream")+";base64,"+function(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var n=0;n<e.length;n+=3){let o=e[n],s=n+1<e.length,i=s?e[n+1]:0,a=n+2<e.length,l=a?e[n+2]:0,u=o>>2,c=(3&o)<<4|i>>4,h=(15&i)<<2|l>>6,f=63&l;a||(f=64,s||(h=64)),r.push(t[u],t[c],t[h],t[f])}return r.join("")}(new Uint8Array(t))})})}readAsText(e,t){if(me(this,"readAsText",arguments.length,e),"function"==typeof TextDecoder){let r=new TextDecoder(t);ve(this,e.size,function(){return e.arrayBuffer().then(function(e){return r.decode(e)})})}else{if(void 0!==t){let e=""+t;-1===["utf-8","utf8","unicode-1-1-utf-8"].indexOf(e.toLowerCase())&&console.warn(`Ignoring the execution of 'readAsText' on 'FileReader': encoding ('${e}') not implemented.`)}ve(this,e.size,function(){return e.text()})}}get onabort(){return _e(this).onabort}set onabort(e){_e(this).onabort=e,_e(this).attach("abort")}get onerror(){return _e(this).onerror}set onerror(e){_e(this).onerror=e,_e(this).attach("error")}get onload(){return _e(this).onload}set onload(e){_e(this).onload=e,_e(this).attach("load")}get onloadend(){return _e(this).onloadend}set onloadend(e){_e(this).onloadend=e,_e(this).attach("loadend")}get onloadstart(){return _e(this).onloadstart}set onloadstart(e){_e(this).onloadstart=e,_e(this).attach("loadstart")}get onprogress(){return _e(this).onprogress}set onprogress(e){_e(this).onprogress=e,_e(this).attach("progress")}toString(){return"[object FileReader]"}get[t](){return"FileReader"}get __MPHTTPX__(){return{chain:["FileReader","EventTarget"]}}}class be{constructor(e){var t;this.pos=0,this.readyState=0,this.result=null,this.error=null,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.attach=j(e,(t=e,{onabort:function(e){L(t,t.onabort,e)},onerror:function(e){L(t,t.onerror,e)},onload:function(e){L(t,t.onload,e)},onloadend:function(e){L(t,t.onloadend,e)},onloadstart:function(e){L(t,t.onloadstart,e)},onprogress:function(e){L(t,t.onprogress,e)}}))}}function _e(e){return e.__FileReader__}function me(e,t,r,o){if(c(r,1,"FileReader",t),!oe(o))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");if(1===e.readyState)throw new n(`Failed to execute '${t}' on 'FileReader': The object is already busy reading Blobs.`,"InvalidStateError")}function ve(e,t,r){!function(e,t,r){let n=_e(e);n.pos=1,n.error=null,n.result=null;const o=function(){return ye(e,"loadstart",0,t),r()};(function(e,t,r){let n=_e(e);n.pos=2,n.readyState=1,Promise.resolve().then(function(){if(2===n.pos)return r().then(function(r){return function(e,t,r){let n=_e(e);if(2!==n.pos)return;n.pos=3,n.result=r,n.readyState=2,function(e,t){_e(e).pos=4,ye(e,"load",t,t),Te(e,t)}(e,t)}(e,t,r)}).catch(function(t){return function(e,t){let r=_e(e);if(2!==r.pos)return;r.pos=6,r.error=t,r.result=null,r.readyState=2,ye(e,"error"),Te(e)}(e,t)})})})(e,t,o)}(e,t,r)}function Te(e,t=0){_e(e).pos=7,ye(e,"loadend",t,t)}const we="undefined"!=typeof FileReader&&FileReader||ge;class Ee{constructor(e){if(s(this,"__URLSearchParams__",new Pe),void 0!==e)if(Be(e))e.forEach(function(e,t){this.append(t,e)}.bind(this),this);else if(e&&"object"==typeof e)if(u(e)){let t=Array.isArray(e)?e:Array.from(e);for(let e=0;e<t.length;++e){let r=t[e];if(!u(r))throw new TypeError("Failed to construct 'URLSearchParams': The provided value cannot be converted to a sequence.");{let e=Array.isArray(r)?r:Array.from(r);if(2!==e.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");this.append(e[0],e[1])}}}else Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])}.bind(this),this);else{let t=""+e;0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let e=0;e<r.length;++e){let t=r[e],n=t.indexOf("=");n>-1?this.append(Fe(t.slice(0,n)),Fe(t.slice(n+1))):t&&this.append(Fe(t),"")}}}get size(){return xe(this).array.length}append(e,t){Se(arguments.length,2,"append"),xe(this).array.push([""+e,Re(t)])}delete(e,t){Se(arguments.length,1,"delete");let r=""+e,n=-1,o=xe(this).array,s=[];for(let e=0;e<o.length;++e){let i=o[e];i[0]!==r?s.push(i):(1!==arguments.length&&i[1]!==Re(t)&&s.push(i),n=e)}n>-1&&(xe(this).array=s)}get(e){Se(arguments.length,1,"get");let t=""+e,r=xe(this).array;for(let e=0;e<r.length;++e){let n=r[e];if(n[0]===t)return n[1]}return null}getAll(e){Se(arguments.length,1,"getAll");let t=""+e,r=xe(this).array,n=[];for(let e=0;e<r.length;++e){let o=r[e];o[0]===t&&n.push(o[1])}return n}has(e,t){Se(arguments.length,1,"has");let r=""+e,n=xe(this).array;for(let e=0;e<n.length;++e){let o=n[e];if(o[0]===r){if(1===arguments.length)return!0;if(o[1]===Re(t))return!0}}return!1}set(e,t){Se(arguments.length,2,"set");let r=""+e,n=Re(t),o=-1,s=xe(this).array,i=[];for(let e=0;e<s.length;++e){let t=s[e];t[0]!==r?i.push(t):-1===o&&(o=e,i.push([r,n]))}-1===o&&i.push([r,n]),xe(this).array=i}sort(){xe(this).array.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})}forEach(e,t){if(Se(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'URLSearchParams': parameter 1 is not of type 'Function'.");let r=xe(this).array;for(let n=0;n<r.length;++n){let o=r[n];e.call(t,o[1],o[0],this)}}entries(){return xe(this).array.map(function(e){return[e[0],e[1]]}).values()}keys(){return xe(this).array.map(function(e){return e[0]}).values()}values(){return xe(this).array.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){let e=xe(this).array,t=[];for(let r=0;r<e.length;++r){let n=e[r];t.push(Ae(n[0])+"="+Ae(n[1]))}return t.join("&")}get[t](){return"URLSearchParams"}get __MPHTTPX__(){return{chain:["URLSearchParams"]}}}class Pe{constructor(){this.array=[]}}function xe(e){return e.__URLSearchParams__}function Se(e,t,r){c(e,t,"URLSearchParams",r)}function Re(e){return"string"==typeof e?e:null!=e&&"function"==typeof e.toString?e.toString():JSON.stringify(e)}function Ae(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,function(e){return t[e]})}function Fe(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(e){return decodeURIComponent(e)})}function Be(e){return a("URLSearchParams",e)||function(e){return i("URLSearchParams",e)||!!e&&"object"==typeof e&&"undefined"!=typeof URLSearchParams&&URLSearchParams&&URLSearchParams.prototype.isPrototypeOf(e)}(e)}const Ce="undefined"!=typeof URLSearchParams&&URLSearchParams||Ee;class je{constructor(e,t){if(s(this,"__FormData__",new Le),void 0!==e)try{let t=e.elements;for(let e=0;e<t.length;++e){let r=t[e];if(!r.name||r.disabled||"submit"===r.type||"button"===r.type||r.matches("form fieldset[disabled] *"))return;if("file"===r.type){let e=r.files&&r.files.length?r.files:[new ce([],"",{type:"application/octet-stream"})];for(let t=0;t<e.length;++t)this.append(r.name,e[t])}else if("select-multiple"===r.type||"select-one"===r.type)for(let e=0;e<r.options.length;++e){let t=r.options[e];!t.disabled&&t.selected&&this.append(r.name,t.value)}else if("checkbox"===r.type||"radio"===r.type)r.checked&&this.append(r.name,r.value);else{let e="textarea"===r.type?Me(r.value):r.value;this.append(r.name,e)}}}catch(e){throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}null!=t&&console.warn("Ignoring the 'submitter' of 'FormData' constructor: parameter 2 not implemented.")}append(e,t,r){Oe(arguments.length,2,"append"),He(this).array.push(qe(e,t,r))}delete(e){Oe(arguments.length,1,"delete");let t=""+e,r=-1,n=He(this).array,o=[];for(let e=0;e<n.length;++e){let s=n[e];s[0]!==t?o.push(s):r=e}r>-1&&(He(this).array=o)}get(e){Oe(arguments.length,1,"get");let t=""+e,r=He(this).array;for(let e=0;e<r.length;++e){let n=r[e];if(n[0]===t)return n[1]}return null}getAll(e){Oe(arguments.length,1,"getAll");let t=""+e,r=He(this).array,n=[];for(let e=0;e<r.length;++e){let o=r[e];o[0]===t&&n.push(o[1])}return n}has(e){Oe(arguments.length,1,"has");let t=""+e,r=He(this).array;for(let e=0;e<r.length;++e){if(r[e][0]===t)return!0}return!1}set(e,t,r){Oe(arguments.length,2,"set");let n=""+e,o=qe(e,t,r),s=-1,i=He(this).array,a=[];for(let e=0;e<i.length;++e){let t=i[e];t[0]!==n?a.push(t):-1===s&&(s=e,a.push(o))}-1===s&&a.push(o),He(this).array=a}forEach(e,t){if(Oe(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");let r=He(this).array;for(let n=0;n<r.length;++n){let o=r[n];e.call(t,o[1],o[0],t)}}entries(){return He(this).array.map(function(e){return[e[0],e[1]]}).values()}keys(){return He(this).array.map(function(e){return e[0]}).values()}values(){return He(this).array.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){return"[object FormData]"}get[t](){return"FormData"}get __MPHTTPX__(){return{chain:["FormData"]}}}class Le{constructor(){this.array=[]}}function He(e){return e.__FormData__}function Oe(e,t,r){return c(e,t,"FormData",r)}function qe(e,t,r){if(oe(t)){if(r=void 0!==r?""+r:"string"==typeof t.name?t.name:"blob",t.name!==r||oe(t,!0)){t=new(a("Blob",t)?ue:ce)([t],r)}return[""+e,t]}return[""+e,""+t]}function De(e){return a("FormData",e)||function(e){let t="[object FormData]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&!!e&&"object"==typeof e&&"forEach"in e&&"function"==typeof e.forEach}(e)}function Ue(e,t){const r=t||"----formdata-mphttpx-"+Math.random(),n=`--${r}\r\nContent-Disposition: form-data; name="`;let o=[],s=!0;return e.forEach(function(e,t){"string"==typeof e?o.push(n+Xe(Me(t))+`"\r\n\r\n${Me(e)}\r\n`):(s&&a("Blob",e)&&(s=!1),o.push(n+Xe(Me(t))+`"; filename="${Xe(e.name)}"\r\nContent-Type: ${e.type||"application/octet-stream"}\r\n\r\n`,e,"\r\n"))}),o.push(`--${r}--`),new(s?se:Q)(o,{type:"multipart/form-data; boundary="+r})}function Me(e){return e.replace(/\r?\n|\r/g,"\r\n")}function Xe(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}function Ne(e){if(!e)return;if(!/multipart\/form-data/i.test(e))return;let t=e.match(/boundary\s*=\s*([^;]+)/i);if(t&&t[1]){return t[1].trim().replace(/^["']|["']$/g,"")}}const $e="undefined"!=typeof FormData&&FormData||je;class Ie{constructor(e,t){if(this._type="",t&&(this.type=t),"string"==typeof e)this.promise=Promise.resolve(e),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return Y(e).length};else if(Be(e)){let t=e.toString();this.promise=Promise.resolve(t),this.type="application/x-www-form-urlencoded;charset=UTF-8",this.calcLength=function(){return Y(t).length}}else if(_(e))this.promise=Promise.resolve(e.slice(0)),this.length=e.byteLength;else if(ArrayBuffer.isView(e)){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);this.promise=Promise.resolve(t),this.length=t.byteLength}else if(oe(e))this.promise=e.arrayBuffer(),this.type=e.type,this.length=e.size;else if(De(e)){let r=Ue(e,t?Ne(t):void 0);this.promise=r.arrayBuffer(),this.type=r.type,this.length=r.size}else if(null==e)this.promise=Promise.resolve(""),this.length=0;else{let t=""+e;this.promise=Promise.resolve(t),this.type="text/plain;charset=UTF-8",this.calcLength=function(){return Y(t).length}}}get type(){return this._type}set type(e){this._type||(this._type=e)}get size(){var e;return"number"!=typeof this.length&&this.calcLength&&(this.length=this.calcLength()),null!==(e=this.length)&&void 0!==e?e:0}text(){return this.promise.then(function(e){return"string"==typeof e?e:J(e)})}arrayBuffer(){return this.promise.then(function(e){return _(e)?e:Y(e).buffer})}}class ke{constructor(){if(new.target===ke)throw new TypeError("Failed to construct 'Body': Illegal constructor");s(this,"__Body__",new ze)}get bodyUsed(){return Ge(this).bodyUsed}get body(){throw new TypeError(`Failed to access 'body' on '${o(this)}': property not implemented.`)}arrayBuffer(){const e="arrayBuffer";return Ye(this,e)||We(this,e)}blob(){const e="blob";return Ye(this,e)||We(this,e)}bytes(){const e="bytes";return Ye(this,e)||We(this,e)}formData(){const e="formData";return Ye(this,e)||We(this,e)}json(){const e="json";return Ye(this,e)||We(this,e)}text(){const e="text";return Ye(this,e)||We(this,e)}toString(){return"[object Body]"}get[t](){return"Body"}get __MPHTTPX__(){return{chain:["Body"]}}}class ze{constructor(){this.bodyUsed=!1}}function Ge(e){return e.__Body__}function Ve(e,t){const r=e;if((n=t)&&"object"==typeof n&&"undefined"!=typeof ReadableStream&&ReadableStream&&ReadableStream.prototype.isPrototypeOf(n)||function(e){return(i("ReadableStream",e)||"[object ReadableStream]"===String(e))&&!!e&&"object"==typeof e&&"getReader"in e&&"function"==typeof e.getReader}(t))throw new TypeError(`Failed to construct '${o(r)}': ReadableStream not implemented.`);var n;null!=t&&(Ge(r).payload=new Ie(t))}function We(e,t){let r=Ge(e).payload||new Ie;return"json"===t?r.text().then(function(e){return JSON.parse(e)}):"text"===t?r.text():"arrayBuffer"===t?r.arrayBuffer():"bytes"===t?r.arrayBuffer().then(function(e){return new Uint8Array(e)}):"blob"===t?r.promise.then(function(e){return new se([e])}):"formData"===t?r.text().then(function(e){return function(e,t){const r=function(){throw new TypeError("Could not parse content as FormData.")};"string"==typeof e&&""!==e.trim()||r();let n=e.indexOf("\r\n");-1===n&&r();let o=e.substring(2,n).trim();o||r(),void 0!==t&&t!==o&&r();let s=e.split(`--${o}`).filter(function(e){let t=e.trim();return""!==t&&"--"!==t});0===s.length&&r();let i=[],a=!1;s.forEach(function(e){let t=e.indexOf("\r\n\r\n");-1===t&&r();let n=e.substring(0,t).trim(),o=n.match(/name="([^"]*)"/);(!o||o.length<2)&&r();let s=o[1],l=n.match(/filename="([^"]*)"/),u=e.substring(t+4);if(l){let e=l[1]||"",t=n.match(/Content-Type: ([^\r\n]+)/),r=t?(t[1]||"").trim():"text/plain",o=u.replace(/\r\n/g,"");a=!0,i.push([s,new ce([o],e,{type:r})])}else i.push([s,u.replace(/^[\r\n]+|[\r\n]+$/g,"")])});let l=new(!a||function(){try{let e=new $e;return e.append("file",new ce([],"")),"string"!=typeof e.get("file")}catch(e){return!1}}()?$e:je);return i.forEach(function(e){l.append(e[0],e[1])}),l}(e,Ne(r.type))}):r.promise}function Ye(e,t){if(Ge(e).payload){if(e.bodyUsed)return Promise.reject(new TypeError(`Failed to execute '${t}' on '${o(e)}': body stream already read`));Ge(e).bodyUsed=!0}}class Je{constructor(e){if(s(this,"__Headers__",new Ke),void 0!==e)if(rt(e))e.forEach(function(e,t){Ze(this,t,e,"")}.bind(this),this);else if(u(e)){let t=Array.isArray(e)?e:Array.from(e);for(let e=0;e<t.length;++e){let r=t[e];if(!u(r))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");{let e=Array.isArray(r)?r:Array.from(r);if(2!==e.length)throw new TypeError("Failed to construct 'Headers': Invalid value");Ze(this,e[0],e[1])}}}else{if(!e||"object"!=typeof e)throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(record<ByteString, ByteString> or sequence<sequence<ByteString>>)'.");Object.getOwnPropertyNames(e).forEach(function(t){Ze(this,t,e[t])}.bind(this),this)}}append(e,t){tt(arguments.length,2,"append"),Ze(this,e,t,"append")}delete(e){tt(arguments.length,1,"delete"),delete Qe(this).dict[nt(e,et("delete"))]}get(e){var t;return tt(arguments.length,1,"get"),null!==(t=Qe(this).dict[nt(e,et("get"))])&&void 0!==t?t:null}getSetCookie(){let e=this.get("Set-Cookie");return e?e.split(", "):[]}has(e){return tt(arguments.length,1,"has"),Qe(this).dict.hasOwnProperty(nt(e,et("has")))}set(e,t){tt(arguments.length,2,"set"),Qe(this).dict[nt(e,et("set"))]=ot(t)}forEach(e,t){if(tt(arguments.length,1,"forEach"),"function"!=typeof e)throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");let r=Qe(this).dict,n=Object.getOwnPropertyNames(r);for(let o=0;o<n.length;++o){let s=n[o];e.call(t,r[s],s,this)}}entries(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.values()}keys(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.map(function(e){return e[0]}).values()}values(){let e=[];return this.forEach(function(t,r){e.push([r,t])}),e.map(function(e){return e[1]}).values()}[e](){return this.entries()}toString(){return"[object Headers]"}get[t](){return"Headers"}get __MPHTTPX__(){return{chain:["Headers"]}}}class Ke{constructor(){this.dict={}}}function Qe(e){return e.__Headers__}function Ze(e,t,r,n="constructor"){let o=nt(t,n?et(n):void 0),s=ot(r),i=Qe(e).dict,a=i[o];i[o]=void 0!==a?`${a}, ${s}`:s}function et(e){return function(){throw new TypeError(`Failed to ${e&&"constructor"!==e?"execute '"+e+"' on":"construct"} 'Headers': Invalid name`)}}function tt(e,t,r){c(e,t,"Headers",r)}function rt(e){return a("Headers",e)||function(e){let t="[object Headers]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&!!e&&"object"==typeof e&&"forEach"in e&&"function"==typeof e.forEach}(e)}function nt(e,t){return"string"!=typeof e&&(e=""+e),t&&(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)&&t(),e.toLowerCase()}function ot(e){return"string"==typeof e?e:""+e}function st(e){let t=new at;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substring(1,e.length):e}).forEach(function(e){let r=e.split(":"),n=r.shift().trim();if(n){let e=r.join(":").trim();try{t.append(n,e)}catch(e){console.warn(`SyntaxError: Response.headers: '${n}' is not a valid HTTP header field name.`)}}}),t}function it(e){if(a("Headers",e)&&at!==Je){let t=new at;return e.forEach(function(e,r){t.append(r,e)}),t}return new at(e)}const at="undefined"!=typeof Headers&&Headers||Je;class lt extends ke{constructor(e,t){c(arguments.length,1,"Request"),super(),s(this,"__Request__",new ut);const r=ct(this);let n=null!=t?t:{};if("object"!=typeof n)throw new TypeError("Failed to construct 'Request': The provided value is not of type 'RequestInit'.");let o=n.body,i=!1;if(a("Request",l=e)||function(e){let t="[object Request]";return(Object.prototype.toString.call(e)===t||String(e)===t)&&!!e&&"object"==typeof e&&"arrayBuffer"in e&&"function"==typeof e.arrayBuffer}(l)){if(e.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.cache=e.cache,r.credentials=e.credentials,void 0===n.headers&&(ct(this).headers=it(e.headers)),r.method=e.method,r.mode=e.mode,r.signal=e.signal,r.url=e.url,o||(this.__Body__.payload=ht(e),i=!0)}else r.url=""+e;var l;if(n.cache&&(r.cache=n.cache),n.credentials&&(r.credentials=n.credentials),void 0!==n.headers&&(ct(this).headers=it(n.headers)),n.method&&(r.method=function(e){let t=e.toUpperCase();return ft.indexOf(t)>-1?t:e}(n.method)),n.mode&&(r.mode=n.mode),null!==n.signal&&void 0!==n.signal){if(!H(n.signal))throw new TypeError("Failed to construct 'Request': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.");r.signal=n.signal}if(("GET"===this.method||"HEAD"===this.method)&&null!=o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");Ve(this,i?null:o);let u=this.__Body__.payload;!this.headers.has("Content-Type")&&u&&u.type&&this.headers.set("Content-Type",u.type),"GET"!==this.method&&"HEAD"!==this.method||"no-cache"!==this.cache&&"no-store"!==this.cache||function(e){let t=/([?&])_=[^&]*/;if(t.test(e.url))ct(e).url=e.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;ct(e).url+=(t.test(e.url)?"&":"?")+"_="+(new Date).getTime()}}(this)}get cache(){return ct(this).cache}get credentials(){return ct(this).credentials}get destination(){return""}get headers(){return ct(this).headers||(ct(this).headers=new at),ct(this).headers}get integrity(){return""}get keepalive(){return!1}get method(){return ct(this).method}get mode(){return ct(this).mode}get redirect(){return"follow"}get referrer(){return ct(this).referrer}get referrerPolicy(){return""}get signal(){return ct(this).signal||(ct(this).signal=(new W).signal),ct(this).signal}get url(){return ct(this).url}clone(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Request': Request body is already used");{let e=new lt(this);return this.__Body__.bodyUsed=!1,e}}toString(){return"[object Request]"}get[t](){return"Request"}get __MPHTTPX__(){return{chain:["Request","Body"]}}}class ut{constructor(){this.cache="default",this.credentials="same-origin",this.method="GET",this.mode="cors",this.referrer="about:client",this.url=""}}function ct(e){return e.__Request__}function ht(e){let t=Object.create(Ie.prototype);t.type=e.headers.get("Content-Type")||"";try{t.promise=e.arrayBuffer()}catch(r){try{t.promise=e.text()}catch(r){if("multipart/form-data"===t.type.slice(0,19).toLowerCase())try{t.promise=e.formData().then(function(e){return new Ie(e,t.type).promise})}catch(e){}}}if(!t.promise)throw new TypeError("Failed to construct 'Request': Failed to read request body data, underlying data is in an invalid format.");return t}const ft=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];const dt="undefined"!=typeof Request&&Request||lt;class pt extends ke{static json(e,t){c(arguments.length,1,"Response","json");let r=new pt("string"==typeof e?e:JSON.stringify(e),t);return r.headers.set("Content-Type","application/json"),r}static error(){let e=new pt(null,{status:200,statusText:""});return gt(e).status=0,gt(e).type="error",e}static redirect(e,t=302){if(c(arguments.length,1,"Response","redirect"),-1===[301,302,303,307,308].indexOf(t))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new pt(null,{status:t,headers:{location:""+e}})}constructor(e,t){super(),s(this,"__Response__",new yt);const r=gt(this);let n=null!=t?t:{};if("object"!=typeof n)throw new TypeError("Failed to construct 'Response': The provided value is not of type 'ResponseInit'.");void 0!==n.headers&&(gt(this).headers=it(n.headers));let o=void 0===n.status?200:n.status;if(o<200||o>599)throw new RangeError(`Failed to construct 'Response': The status provided (${+o}) is outside the range [200, 599].`);r.status=o,r.statusText=void 0===n.statusText?"":""+n.statusText,Ve(this,e);let i=this.__Body__.payload;!this.headers.has("Content-Type")&&i&&i.type&&this.headers.set("Content-Type",i.type)}get headers(){return gt(this).headers||(gt(this).headers=new at),gt(this).headers}get ok(){return this.status>=200&&this.status<300}get redirected(){return!1}get status(){return gt(this).status}get statusText(){return gt(this).statusText}get type(){return gt(this).type}get url(){return gt(this).url}clone(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Response': Response body is already used");let e=new pt(null,{headers:it(this.headers),status:this.status,statusText:this.statusText});return gt(e).url=this.url,e.__Body__.payload=this.__Body__.payload,e}toString(){return"[object Response]"}get[t](){return"Response"}get __MPHTTPX__(){return{chain:["Response","Body"]}}}class yt{constructor(){this.status=200,this.statusText="",this.type="default",this.url=""}}function gt(e){return e.__Response__}const bt="undefined"!=typeof Response&&Response||pt,_t={XMLHttpRequest:"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||void 0};function mt(e,t){if(c(arguments.length,1,"Window","fetch"),new.target===mt)throw new TypeError("fetch is not a constructor");return new Promise(function(r,o){const s=new lt(e,t),i=s.__Request__.signal;if(i&&i.aborted)return o(i.reason);let a,l=new(_t.XMLHttpRequest||function(){throw new ReferenceError("XMLHttpRequest is not defined")}()),u=!1,c=s.__Body__.payload;if(l.onload=function(){let e={headers:st(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};0===s.url.indexOf("file://")&&(l.status<200||l.status>599)&&(e.status=200),setTimeout(function(){a=new pt("response"in l?l.response:l.responseText,e),a.__Response__.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL")||"";let t=a.__Body__.payload,n=a.headers.get("Content-Type")||"";t&&n&&(t.type=n),u?o(vt()):r(a)},0)},l.onabort=function(){setTimeout(function(){o(vt())},0)},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))},0)},l.ontimeout=function(){setTimeout(function(){o(new n("The request timed out.","TimeoutError"))},0)},l.open(s.method,wt(s.url),!0),"include"===s.credentials?l.withCredentials=!0:"omit"===s.credentials&&(l.withCredentials=!1),"responseType"in l&&(l.responseType="arraybuffer"),t&&"object"==typeof t&&t.headers&&"object"==typeof t.headers&&!rt(t.headers)){let e=t.headers,r=[];Object.getOwnPropertyNames(e).forEach(function(t){r.push(nt(t)),l.setRequestHeader(t,ot(e[t]))}),s.headers.forEach(function(e,t){-1===r.indexOf(t)&&l.setRequestHeader(t,e)})}else s.headers.forEach(function(e,t){l.setRequestHeader(t,e)});if(i){const e=function(){if(a&&!a.bodyUsed){(a.__Body__.payload=new Ie).promise=Promise.reject(vt())}u=!0,l.abort(),t()},t=function(){i.removeEventListener("abort",e)};i.addEventListener("abort",e),l.onreadystatechange=function(){4===l.readyState&&t()}}c?c.promise.then(function(e){u?o(vt()):l.send(""!==e?e:void 0)}).catch(function(e){console.error(e),o(new TypeError("Failed to fetch"))}):l.send()})}function vt(){return new n("The user aborted a request.","AbortError")}const Tt="undefined"!=typeof location&&!!location,wt=function(e){return""===e&&Tt&&(null===location||void 0===location?void 0:location.href)?location.href:e},Et="undefined"!=typeof fetch&&fetch||mt,Pt={value:!1};exports.AbortController=W,exports.AbortControllerP=G,exports.AbortSignal=z,exports.AbortSignalP=X,exports.Blob=se,exports.BlobP=Q,exports.CustomEvent=M,exports.CustomEventP=q,exports.Event=S,exports.EventP=v,exports.EventTarget=O,exports.EventTargetP=R,exports.File=ce,exports.FileP=ue,exports.FileReader=we,exports.FileReaderP=ge,exports.FormData=$e,exports.FormDataP=je,exports.Headers=at,exports.HeadersP=Je,exports.Request=dt,exports.RequestP=lt,exports.Response=bt,exports.ResponseP=pt,exports.TextDecoder=m,exports.TextDecoderP=y,exports.TextEncoder=d,exports.TextEncoderP=h,exports.URLSearchParams=Ce,exports.URLSearchParamsP=Ee,exports.fetch=Et,exports.fetchP=mt,exports.fixFetch=function(e){const t=e||"undefined"!=typeof fetch&&fetch;if(!t||t===mt)return mt;if("__MPHTTPX__Polyfill__"in t)return t;function r(e,t){if(e.headers){if((r=e.headers)&&"object"==typeof r&&"has"in r&&"function"==typeof r.has&&"set"in r&&"function"==typeof r.set)e.headers.has("Content-Type")||e.headers.set("Content-Type",t);else if(u(e.headers)){let r=!1,n=Array.isArray(e.headers)?e.headers:Array.from(e.headers);for(let e=0;e<n.length;++e){let t=n[e];if(u(t)){let e=Array.isArray(t)?t:Array.from(t);if(e.length>=2&&"content-type"===String(e[0]).toLowerCase()){r=!0;break}}}r||(n.push(["Content-Type",t]),e.headers=n)}else if("object"==typeof e.headers){let r=!1,n=Object.getOwnPropertyNames(e.headers);for(let e=0;e<n.length;++e){if("content-type"===n[e].toLowerCase()){r=!0;break}}r||(e.headers["Content-Type"]=t)}}else e.headers={"Content-Type":t};var r}function o(e,o){if(a("Request",e)){let t=e,r=o||{};r.method||(r.method=t.method),r.headers||(r.headers=t.headers),r.mode||(r.mode=t.mode),r.cache||(r.cache=t.cache),r.credentials||(r.credentials=t.credentials),!r.signal&&t.__Request__.signal&&(r.signal=t.signal),r.body||(r.body=ht(t)),e=t.url,o=r}if(o&&o.headers&&a("Headers",o.headers))if("undefined"!=typeof Headers&&Headers&&!("__MPHTTPX__"in Headers.prototype)){let e=new Headers;o.headers.forEach(function(t,r){e.append(r,t)}),o.headers=e}else{let e={};o.headers.forEach(function(t,r){e[r]=t}),o.headers=e}return new Promise(function(s,i){o&&o.body&&(Pt.value?De(o.body):a("FormData",o.body))&&(o.body=Ue(o.body));let l=o&&o.body&&((Pt.value?oe(o.body):a("Blob",o.body))&&new Ie(o.body)||Ie.prototype.isPrototypeOf(o.body)&&o.body);if(l){l.type&&r(o,l.type);let a=null,u=!1,c=!0;if(e&&"object"==typeof e&&"signal"in e&&H(e.signal)){let t=function(){c&&(u=!0),a()};a=function(){e.signal.removeEventListener("abort",t)},e.signal.addEventListener("abort",t)}l.promise.then(function(r){o.body=""!==r?r:null,u?i(new n("The user aborted a request.","AbortError")):s(t.call(this,e,o)),c=!1}.bind(this)).catch(function(e){i(new TypeError("Failed to fetch")),console.error(e),c=!1}).then(function(){a&&a()})}else o&&o.body&&a("URLSearchParams",o.body)&&r(o,"application/x-www-form-urlencoded;charset=UTF-8"),s(t.call(this,e,o))}.bind(this))}return o.__MPHTTPX__Polyfill__=!0,o},exports.fixWebSocket=function(e){const t=e||"undefined"!=typeof WebSocket&&WebSocket;if(!t||"__MPHTTPX__Polyfill__"in t||"__MPHTTPX__"in t.prototype)return;const r=t.prototype.send;t.prototype.send=function(e){if(Pt.value?oe(e):a("Blob",e)){new Ie(e).promise.then(function(e){1===this.readyState&&r.call(this,e)}.bind(this))}else r.call(this,e)},t.__MPHTTPX__Polyfill__=!0},exports.fixXMLHttpRequest=function(e){const t=e||"undefined"!=typeof XMLHttpRequest&&XMLHttpRequest;if(!t||"__MPHTTPX__Polyfill__"in t||"__MPHTTPX__"in t.prototype)return;const r=t.prototype.abort,o=t.prototype.open,i=t.prototype.send,l=t.prototype.setRequestHeader;t.prototype.abort=function(){c(this).processing&&(c(this).aborted=!0),r.call(this),c(this).hasContentType=!1},t.prototype.open=function(e,t,r=!0,n=null,s=null){c(this).processing&&(c(this).aborted=!0),o.call(this,e,t,r,n,s),c(this).hasContentType=!1},t.prototype.send=function(e){if((Pt.value?De(e):a("FormData",e))&&(e=Ue(e),c(this).hasContentType||this.setRequestHeader("Content-Type",e.type)),Pt.value?oe(e):a("Blob",e)){let t=new Ie(e);t.type&&!c(this).hasContentType&&this.setRequestHeader("Content-Type",t.type);const r=this.withCredentials;c(this).processing=!0,t.promise.then(function(e){c(this).aborted||(r!==this.withCredentials&&(console.warn("Illegal to set the 'withCredentials' property on 'XMLHttpRequest': The value may only be set if the object's state is UNSENT or OPENED."),this.withCredentials=r),i.call(this,""!==e?e:void 0)),c(this).aborted=!1,c(this).processing=!1}.bind(this)).catch(function(e){console.error(e),c(this).aborted=!1,c(this).processing=!1}.bind(this))}else a("URLSearchParams",e)&&!c(this).hasContentType&&this.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8"),i.call(this,e)},t.prototype.setRequestHeader=function(e,t){if(c(this).processing)throw new n("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");l.call(this,e,t),"content-type"===String(e).toLowerCase()&&(c(this).hasContentType=!0)},t.__MPHTTPX__Polyfill__=!0;class u{constructor(){this.aborted=!1,this.processing=!1,this.hasContentType=!1}}function c(e){const t="__XMLHttpRequest_Polyfill__";return t in e||s(e,t,new u),e[t]}},exports.setFullOverride=function(e){Pt.value=!!e},exports.setReadableStreamClass=function(e){K.ReadableStream=e},exports.setXMLHttpRequestClass=function(e){_t.XMLHttpRequest=e};
|
|
@@ -336,6 +336,8 @@ function concatString(val) {
|
|
|
336
336
|
// Mini Program
|
|
337
337
|
function isOtherArrayBuffer(value) {
|
|
338
338
|
return (isObjectType("ArrayBuffer", value) || String(value) === "[object ArrayBuffer]")
|
|
339
|
+
&& !!value
|
|
340
|
+
&& typeof value === "object"
|
|
339
341
|
&& "byteLength" in value
|
|
340
342
|
&& typeof value.byteLength === "number";
|
|
341
343
|
}
|
|
@@ -680,21 +682,11 @@ class AbortSignalP extends EventTargetP {
|
|
|
680
682
|
if (sig.aborted)
|
|
681
683
|
return sig;
|
|
682
684
|
} })();
|
|
683
|
-
if (abortedSignal) {
|
|
684
|
-
|
|
685
|
+
if (!abortedSignal) {
|
|
686
|
+
followSignals(signal, _signals);
|
|
685
687
|
}
|
|
686
688
|
else {
|
|
687
|
-
|
|
688
|
-
for (let i = 0; i < _signals.length; ++i) {
|
|
689
|
-
let sig = _signals[i];
|
|
690
|
-
sig.removeEventListener("abort", abortFn);
|
|
691
|
-
}
|
|
692
|
-
AbortSignal_abort(signal, true, this.reason);
|
|
693
|
-
}
|
|
694
|
-
for (let i = 0; i < _signals.length; ++i) {
|
|
695
|
-
let sig = _signals[i];
|
|
696
|
-
sig.addEventListener("abort", abortFn);
|
|
697
|
-
}
|
|
689
|
+
AbortSignal_abort(signal, false, abortedSignal.reason);
|
|
698
690
|
}
|
|
699
691
|
return signal;
|
|
700
692
|
}
|
|
@@ -746,6 +738,19 @@ function getHandlers$1(t) {
|
|
|
746
738
|
function state$b(target) {
|
|
747
739
|
return target.__AbortSignal__;
|
|
748
740
|
}
|
|
741
|
+
function followSignals(signal, signals) {
|
|
742
|
+
function abortFn() {
|
|
743
|
+
for (let i = 0; i < signals.length; ++i) {
|
|
744
|
+
let sig = signals[i];
|
|
745
|
+
sig.removeEventListener("abort", abortFn);
|
|
746
|
+
}
|
|
747
|
+
AbortSignal_abort(signal, true, this.reason);
|
|
748
|
+
}
|
|
749
|
+
for (let i = 0; i < signals.length; ++i) {
|
|
750
|
+
let sig = signals[i];
|
|
751
|
+
sig.addEventListener("abort", abortFn);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
749
754
|
function createAbortSignal() {
|
|
750
755
|
let signal = Object.create(AbortSignalP.prototype);
|
|
751
756
|
setState(signal, "__EventTarget__", { executors: [] });
|
|
@@ -935,6 +940,8 @@ function isExternalBlob(value, strict = false) {
|
|
|
935
940
|
if (!strict)
|
|
936
941
|
expects.push("[object File]");
|
|
937
942
|
return (expects.indexOf(Object.prototype.toString.call(value)) > -1 || expects.indexOf(String(value)) > -1)
|
|
943
|
+
&& !!value
|
|
944
|
+
&& typeof value === "object"
|
|
938
945
|
&& "size" in value
|
|
939
946
|
&& typeof value.size === "number"
|
|
940
947
|
&& "arrayBuffer" in value
|
|
@@ -1289,7 +1296,7 @@ class URLSearchParamsP {
|
|
|
1289
1296
|
checkArgsFn$2(arguments.length, 2, "append");
|
|
1290
1297
|
state$5(this).array.push(["" + name, normalizeValue$1(value)]);
|
|
1291
1298
|
}
|
|
1292
|
-
delete(name, value) {
|
|
1299
|
+
["delete"](name, value) {
|
|
1293
1300
|
checkArgsFn$2(arguments.length, 1, "delete");
|
|
1294
1301
|
let _name = "" + name;
|
|
1295
1302
|
let index = -1;
|
|
@@ -1508,7 +1515,7 @@ class FormDataP {
|
|
|
1508
1515
|
checkArgsFn$1(arguments.length, 2, "append");
|
|
1509
1516
|
state$4(this).array.push(normalizeArgs(name, blobValue, filename));
|
|
1510
1517
|
}
|
|
1511
|
-
delete(name) {
|
|
1518
|
+
["delete"](name) {
|
|
1512
1519
|
checkArgsFn$1(arguments.length, 1, "delete");
|
|
1513
1520
|
let _name = "" + name;
|
|
1514
1521
|
let index = -1;
|
|
@@ -1647,6 +1654,8 @@ function isFormData(value) {
|
|
|
1647
1654
|
function isExternalFormData(value) {
|
|
1648
1655
|
let expect = "[object FormData]";
|
|
1649
1656
|
return (Object.prototype.toString.call(value) === expect || String(value) === expect)
|
|
1657
|
+
&& !!value
|
|
1658
|
+
&& typeof value === "object"
|
|
1650
1659
|
&& "forEach" in value
|
|
1651
1660
|
&& typeof value.forEach === "function";
|
|
1652
1661
|
}
|
|
@@ -1919,6 +1928,8 @@ function isGlobalReadableStream(value) {
|
|
|
1919
1928
|
}
|
|
1920
1929
|
function isOtherReadableStream(value) {
|
|
1921
1930
|
return (isObjectType("ReadableStream", value) || String(value) === "[object ReadableStream]")
|
|
1931
|
+
&& !!value
|
|
1932
|
+
&& typeof value === "object"
|
|
1922
1933
|
&& "getReader" in value
|
|
1923
1934
|
&& typeof value.getReader === "function";
|
|
1924
1935
|
}
|
|
@@ -1962,7 +1973,7 @@ class HeadersP {
|
|
|
1962
1973
|
checkArgsFn(arguments.length, 2, "append");
|
|
1963
1974
|
Headers_append(this, name, value, "append");
|
|
1964
1975
|
}
|
|
1965
|
-
delete(name) {
|
|
1976
|
+
["delete"](name) {
|
|
1966
1977
|
checkArgsFn(arguments.length, 1, "delete");
|
|
1967
1978
|
delete state$2(this).dict[normalizeName(name, throwsFn("delete"))];
|
|
1968
1979
|
}
|
|
@@ -2048,6 +2059,8 @@ function isHeaders(value) {
|
|
|
2048
2059
|
function isExternalHeaders(value) {
|
|
2049
2060
|
let expect = "[object Headers]";
|
|
2050
2061
|
return (Object.prototype.toString.call(value) === expect || String(value) === expect)
|
|
2062
|
+
&& !!value
|
|
2063
|
+
&& typeof value === "object"
|
|
2051
2064
|
&& "forEach" in value
|
|
2052
2065
|
&& typeof value.forEach === "function";
|
|
2053
2066
|
}
|
|
@@ -2223,6 +2236,8 @@ function isRequest(value) {
|
|
|
2223
2236
|
function isExternalRequest(value) {
|
|
2224
2237
|
let expect = "[object Request]";
|
|
2225
2238
|
return (Object.prototype.toString.call(value) === expect || String(value) === expect)
|
|
2239
|
+
&& !!value
|
|
2240
|
+
&& typeof value === "object"
|
|
2226
2241
|
&& "arrayBuffer" in value
|
|
2227
2242
|
&& typeof value.arrayBuffer === "function";
|
|
2228
2243
|
}
|