mphttpx 1.0.3 → 1.0.4
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 +35 -1
- package/dist/index.cjs.js +24 -23
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +24 -23
- package/dist/index.esm.min.js +1 -1
- package/dist/types/FileReaderP.d.ts +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
A polyfill for
|
|
1
|
+
# A polyfill for mini-program.
|
|
2
|
+
|
|
3
|
+
## install
|
|
4
|
+
```bash
|
|
5
|
+
npm install mphttpx
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## usage
|
|
9
|
+
```javascript
|
|
10
|
+
import {
|
|
11
|
+
TextEncoder,
|
|
12
|
+
TextDecoder,
|
|
13
|
+
|
|
14
|
+
Event,
|
|
15
|
+
EventTarget,
|
|
16
|
+
CustomEvent,
|
|
17
|
+
ProgressEvent,
|
|
18
|
+
|
|
19
|
+
Blob,
|
|
20
|
+
File,
|
|
21
|
+
FileReader,
|
|
22
|
+
|
|
23
|
+
FormData,
|
|
24
|
+
URLSearchParams,
|
|
25
|
+
|
|
26
|
+
AbortSignal,
|
|
27
|
+
AbortController,
|
|
28
|
+
|
|
29
|
+
XMLHttpRequest,
|
|
30
|
+
fetch,
|
|
31
|
+
Headers,
|
|
32
|
+
Request,
|
|
33
|
+
Response
|
|
34
|
+
} from "mphttpx";
|
|
35
|
+
```
|
package/dist/index.cjs.js
CHANGED
|
@@ -763,29 +763,6 @@ class FileReaderP extends EventTargetP {
|
|
|
763
763
|
this.EMPTY = 0;
|
|
764
764
|
this.LOADING = 1;
|
|
765
765
|
this.DONE = 2;
|
|
766
|
-
this.readAsArrayBuffer = (blob) => {
|
|
767
|
-
read$1.call(this[state$a], "readAsArrayBuffer", blob, () => {
|
|
768
|
-
this[state$a].result = blob[state$c][_u8array].buffer.slice(0);
|
|
769
|
-
});
|
|
770
|
-
};
|
|
771
|
-
this.readAsBinaryString = (blob) => {
|
|
772
|
-
read$1.call(this[state$a], "readAsBinaryString", blob, () => {
|
|
773
|
-
this[state$a].result = blob[state$c][_u8array].reduce((acc, cur) => {
|
|
774
|
-
acc += String.fromCharCode(cur);
|
|
775
|
-
return acc;
|
|
776
|
-
}, "");
|
|
777
|
-
});
|
|
778
|
-
};
|
|
779
|
-
this.readAsDataURL = (blob) => {
|
|
780
|
-
read$1.call(this[state$a], "readAsDataURL", blob, () => {
|
|
781
|
-
this[state$a].result = "data:" + blob.type + ";base64," + u8array2base64(blob[state$c][_u8array]);
|
|
782
|
-
});
|
|
783
|
-
};
|
|
784
|
-
this.readAsText = (blob, encoding) => {
|
|
785
|
-
read$1.call(this[state$a], "readAsText", blob, () => {
|
|
786
|
-
this[state$a].result = (new TextDecoderP(encoding)).decode(blob[state$c][_u8array]);
|
|
787
|
-
});
|
|
788
|
-
};
|
|
789
766
|
this[state$a] = new FileReaderState(this);
|
|
790
767
|
}
|
|
791
768
|
get readyState() { return this[state$a].readyState; }
|
|
@@ -798,6 +775,29 @@ class FileReaderP extends EventTargetP {
|
|
|
798
775
|
emitProcessEvent(this, "abort");
|
|
799
776
|
}
|
|
800
777
|
}
|
|
778
|
+
readAsArrayBuffer(blob) {
|
|
779
|
+
read$1.call(this[state$a], "readAsArrayBuffer", blob, () => {
|
|
780
|
+
this[state$a].result = blob[state$c][_u8array].buffer.slice(0);
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
readAsBinaryString(blob) {
|
|
784
|
+
read$1.call(this[state$a], "readAsBinaryString", blob, () => {
|
|
785
|
+
this[state$a].result = blob[state$c][_u8array].reduce((acc, cur) => {
|
|
786
|
+
acc += String.fromCharCode(cur);
|
|
787
|
+
return acc;
|
|
788
|
+
}, "");
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
readAsDataURL(blob) {
|
|
792
|
+
read$1.call(this[state$a], "readAsDataURL", blob, () => {
|
|
793
|
+
this[state$a].result = "data:" + blob.type + ";base64," + u8array2base64(blob[state$c][_u8array]);
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
readAsText(blob, encoding) {
|
|
797
|
+
read$1.call(this[state$a], "readAsText", blob, () => {
|
|
798
|
+
this[state$a].result = (new TextDecoderP(encoding)).decode(blob[state$c][_u8array]);
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
801
|
get onabort() { return this[state$a].onabort; }
|
|
802
802
|
set onabort(value) { this[state$a].onabort = value; attach$1.call(this[state$a], "abort"); }
|
|
803
803
|
get onerror() { return this[state$a].onerror; }
|
|
@@ -1483,6 +1483,7 @@ const mp = (() => {
|
|
|
1483
1483
|
(typeof tt !== u && typeof (tt === null || tt === void 0 ? void 0 : tt[r]) === f && tt) || // 抖音 | 飞书
|
|
1484
1484
|
(typeof ks !== u && typeof (ks === null || ks === void 0 ? void 0 : ks[r]) === f && ks) || // 快手
|
|
1485
1485
|
(typeof qh !== u && typeof (qh === null || qh === void 0 ? void 0 : qh[r]) === f && qh) || // 360
|
|
1486
|
+
(typeof xhs !== u && typeof (xhs === null || xhs === void 0 ? void 0 : xhs[r]) === f && xhs) || // 小红书
|
|
1486
1487
|
undefined;
|
|
1487
1488
|
if (typeof g["XMLHttpRequest"] === f) {
|
|
1488
1489
|
return;
|
package/dist/index.cjs.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=Symbol("isPolyfill"),e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};function r(t,e){return Object.prototype.toString.call(e)===`[object ${t}]`}function s(e,r){return!!r&&"object"==typeof r&&"isPolyfill"in r&&!!r.isPolyfill&&"object"==typeof r.isPolyfill&&"symbol"in r.isPolyfill&&r.isPolyfill.symbol===t&&"hierarchy"in r.isPolyfill&&Array.isArray(r.isPolyfill.hierarchy)&&r.isPolyfill.hierarchy.indexOf(e)>-1}class n extends Error{constructor(t,e){super(),this.message=null!=t?t:this.message,this.name=null!=e?e:this.name}}function o(t,e){Object.defineProperty(t.prototype,Symbol.toStringTag,{configurable:!0,value:e})}function i(t){return Object.keys(t).map(e=>t[e])}function a(t){return Object.keys(t).map(e=>[e,t[e]])}class l{get encoding(){return"utf-8"}encode(t=""){return h(t).encoded}encodeInto(t,e){const r=h(t,e);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function h(t,e){const r=void 0!==e;let s=0,n=0,o=t.length,i=0,a=Math.max(32,o+(o>>1)+7),l=r?e:new Uint8Array(a>>3<<3);for(;s<o;){let e,h=t.charCodeAt(s++);if(h>=55296&&h<=56319)if(s<o){let e=t.charCodeAt(s);56320==(64512&e)?(++s,h=((1023&h)<<10)+(1023&e)+65536):h=65533}else h=65533;else h>=56320&&h<=57343&&(h=65533);if(!r&&i+4>l.length){a+=8,a*=1+s/t.length*2,a=a>>3<<3;let e=new Uint8Array(a);e.set(l),l=e}if(4294967168&h?4294965248&h?4294901760&h?4292870144&h?(h=65533,e=3):e=4:e=3:e=2:e=1,r&&i+e>l.length)break;1===e?l[i++]=h:2===e?(l[i++]=h>>6&31|192,l[i++]=63&h|128):3===e?(l[i++]=h>>12&15|224,l[i++]=h>>6&63|128,l[i++]=63&h|128):4===e&&(l[i++]=h>>18&7|240,l[i++]=h>>12&63|128,l[i++]=h>>6&63|128,l[i++]=63&h|128),n++}return{encoded:r?e.slice():l.slice(0,i),read:n,written:i}}o(l,"TextEncoder");const c=e.TextEncoder||l;var u,d;const f=Symbol();class g{constructor(t="utf-8",{fatal:e=!1,ignoreBOM:r=!1}={}){if(-1===m.indexOf(t.toLowerCase()))throw new RangeError("TextDecoder: The encoding label provided ('"+t+"') is invalid.");this[f]=new b,this[f].fatal=e,this[f].ignoreBOM=r}get encoding(){return"utf-8"}get fatal(){return this[f].fatal}get ignoreBOM(){return this[f].ignoreBOM}decode(t,{stream:e=!1}={}){const r=this[f];let s;if(void 0===t){if(r[y].length>0){if(this.fatal)throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");r[y]=[]}return""}if(s=t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t),!r[p]&&this.ignoreBOM&&s.length>=3&&239===s[0]&&187===s[1]&&191===s[2]&&(s=s.subarray(3),r[p]=!0),r[y].length>0){let t=new Uint8Array(r[y].length+s.length);t.set(r[y],0),t.set(s,r[y].length),s=t,r[y]=[]}let n=s.length,o=[];if(e&&s.length>0){let t=s.length;for(;t>0&&t>s.length-4;){let e=s[t-1];if(128!=(192&e)){E(e)>s.length-(t-1)&&(n=t-1);break}t--}r[y]=Array.from(s.slice(n)),s=s.slice(0,n)}let i=0;for(;i<n;){let t=s[i],e=null,r=E(t);if(i+r<=n){let n,o,a,l;switch(r){case 1:t<128&&(e=t);break;case 2:n=s[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(e=l));break;case 3:n=s[i+1],o=s[i+2],128==(192&n)&&128==(192&o)&&(l=(15&t)<<12|(63&n)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:n=s[i+1],o=s[i+2],a=s[i+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&o)<<6|63&a,l>65535&&l<1114112&&(e=l))}}if(null===e){if(this.fatal)throw new TypeError("TextDecoder.decode: Decoding failed.");e=65533,r=1}else e>65535&&(e-=65536,o.push(e>>>10&1023|55296),e=56320|1023&e);o.push(e),i+=r}let a="";for(let t=0,e=o.length;t<e;t+=4096)a+=String.fromCharCode.apply(String,o.slice(t,t+4096));return a}toString(){return"[object TextDecoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextDecoder"]}}}o(g,"TextDecoder");const p=Symbol(),y=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[u]=!1,this[d]=[]}}u=p,d=y;const m=["utf-8","utf8","unicode-1-1-utf-8"];function E(t){return t>239?4:t>223?3:t>191?2:1}const v=e.TextDecoder||g;var w,T,S,R,P;const x=Symbol();class A{constructor(t,e){this.NONE=A.NONE,this.CAPTURING_PHASE=A.CAPTURING_PHASE,this.AT_TARGET=A.AT_TARGET,this.BUBBLING_PHASE=A.BUBBLING_PHASE,this[x]=new j;const r=this[x];r.type=String(t),r.bubbles=!!(null==e?void 0:e.bubbles),r.cancelable=!!(null==e?void 0:e.cancelable),r.composed=!!(null==e?void 0:e.composed)}get type(){return this[x].type}get bubbles(){return this[x].bubbles}get cancelable(){return this[x].cancelable}get composed(){return this[x].composed}get target(){return this[x].target}get currentTarget(){return this[x].currentTarget}get eventPhase(){return this[x].eventPhase}get srcElement(){return this[x].target}get cancelBubble(){return this[x].cancelBubble}set cancelBubble(t){this[x].cancelBubble=t}get defaultPrevented(){return this[x].defaultPrevented}get returnValue(){return this[x].returnValue}set returnValue(t){t||this.preventDefault()}get isTrusted(){return this[x][L]}get timeStamp(){return this[x].timeStamp}composedPath(){const t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const s=this[x];s[q]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[x];t[D]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[N]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[x][C]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}A.NONE=0,A.CAPTURING_PHASE=1,A.AT_TARGET=2,A.BUBBLING_PHASE=3,o(A,"Event");const O=Symbol(),L=Symbol(),D=Symbol(),q=Symbol(),N=Symbol(),C=Symbol();class j{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=A.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-j[O],this[w]=!1,this[T]=!1,this[S]=!1,this[R]=!1,this[P]=!1}}function U(t,e,r,s=!0){const n=new A(e,r);return n[x].target=t,n[x][L]=s,n}w=L,T=D,S=q,R=N,P=C,j[O]=(new Date).getTime();const B=e.EventTarget?e.Event:A;var H;const M=Symbol();class F{constructor(){this[M]=new k(this)}addEventListener(t,e,r){const s=this[M],n=new $(t,e);if(n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),!s[I].some(t=>t.equals(n))){if("object"==typeof r){const{once:t,passive:e,signal:o}=r;n.options.once=!!t,n.options.passive=!!e,o&&(n.options.signal=o,X.call(s,o,n))}s[I].push(n);const t=t=>t.options.capture?0:1;s[I]=s[I].sort((e,r)=>t(e)-t(r))}}dispatchEvent(t){if("object"!=typeof t)throw new TypeError("EventTarget.dispatchEvent: Argument 1 is not an object.");if(!(t instanceof A))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");const e=t[x];return e.target=this,e[L]=!1,G.call(this[M],t)}removeEventListener(t,e,r){const s=this[M],n=new $(t,e);n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),s[I].some(t=>t.equals(n))&&(s[I]=s[I].filter(t=>!t.equals(n)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}o(F,"EventTarget");const I=Symbol();class k{constructor(t){this[H]=[],this.target=t}}function G(t){const e=t[x];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=A.AT_TARGET,e[q]=!0;const r=[];for(let s=0;s<this[I].length;++s){const n=this[I][s];if(n.type!==t.type)continue;e[D]=!!n.options.passive,n.options.once&&r.push(s);const{callback:o}=n;try{"function"==typeof o&&o.call(this.target,t)}catch(t){console.error(t)}if(e[D]=!1,e[C])break}return r.length>0&&(this[I]=this[I].reduce((t,e,s)=>(-1===r.indexOf(s)&&t.push(e),t),[])),e.currentTarget=null,e.eventPhase=A.NONE,e[q]=!1,!(t.cancelable&&e[N])}function X(t,e){const r=()=>{this[I]=this[I].filter(t=>!t.equals(e)),t.removeEventListener("abort",r)};try{t.addEventListener("abort",r)}catch(t){console.error(t)}}H=I;class ${constructor(t,e){var r;this.options={},this.type=String(t),this.callback="function"==typeof(r=e)?r:function(t){return!!t&&"handleEvent"in t&&"function"==typeof t.handleEvent}(r)?r.handleEvent:r}equals(t){return Object.is(this.type,t.type)&&Object.is(this.callback,t.callback)&&Object.is(this.options.capture,t.options.capture)}}function _(t,e,r){"function"==typeof e?this.addEventListener(t,r):this.removeEventListener(t,r)}function z(t,e){"function"==typeof t&&t.call(this,e)}const V=e.EventTarget||F,J=Symbol();class Y extends A{constructor(t,e){var r;super(t,e),this[J]=new K,this[J].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[J].detail}initCustomEvent(t,e,r,s){this[x][q]||(this.initEvent(t,e,r),this[J].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(Y,"CustomEvent");class K{}const Q=e.EventTarget?e.CustomEvent:Y,W=Symbol();class Z extends A{constructor(t,e){var r,s;super(t,e),this[W]=new et;const n=this[W];n.lengthComputable=!!(null==e?void 0:e.lengthComputable),n.loaded=null!==(r=null==e?void 0:e.loaded)&&void 0!==r?r:0,n.total=null!==(s=null==e?void 0:e.total)&&void 0!==s?s:0}get lengthComputable(){return rt(this[W].lengthComputable)}get loaded(){return rt(this[W].loaded)}get total(){return rt(this[W].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(Z,"ProgressEvent");class et{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function rt(t){return"function"==typeof t?t():t}function st(t,e,r=0,s=0){const n=function(t,e,{lengthComputable:r=!1,loaded:s=0,total:n=0}={}){const o=new Z(e);return o[W].lengthComputable=r,o[W].loaded=s,o[W].total=n,o[x].target=t,o[x][L]=!0,o}(t,e,{lengthComputable:()=>rt(s)>0,loaded:r,total:s});G.call(t[M],n)}const nt=e.EventTarget?e.ProgressEvent:Z,ot=Symbol();class it{constructor(t=[],e){if(!Array.isArray(t))throw new TypeError("First argument to Blob constructor must be an Array.");let r=null,n=t.reduce((t,e)=>(s("Blob",e)?t.push(e[ot][at]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(ct(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[ot]=new lt(function(t){const e=t.reduce((t,e)=>t+e.byteLength,0),r=new Uint8Array(e);return t.reduce((t,e)=>(r.set(e,t),t+e.byteLength),0),r}(n));const o=this[ot];o.size=o[at].length;const i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[ot].size}get type(){return this[ot].type}arrayBuffer(){return Promise.resolve(ut(this[ot][at].buffer).buffer)}bytes(){return Promise.resolve(ut(this[ot][at].buffer))}slice(t,e,r){const s=this[ot][at].slice(null!=t?t:0,null!=e?e:this[ot][at].length);return new it([s],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){const t=new g;return Promise.resolve(t.decode(this[ot][at]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(it,"Blob");const at=Symbol();class lt{constructor(t){this.size=0,this.type="",this[at]=t}}function ht(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var s=0;s<t.length;s+=3){let n=t[s],o=s+1<t.length,i=o?t[s+1]:0,a=s+2<t.length,l=a?t[s+2]:0,h=n>>2,c=(3&n)<<4|i>>4,u=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(u=64)),r.push(e[h],e[c],e[u],e[d])}return r.join("")}function ct(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function ut(t){const e=ct(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}const dt=e.Blob||it,ft=Symbol();class gt extends it{constructor(t,e,r){super(t,r),this[ft]=new pt,this[ft].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[ft].name=e.replace(/\//g,":")}get lastModified(){return this[ft].lastModified}get name(){return this[ft].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(gt,"File");class pt{constructor(){this.lastModified=0,this.name=""}}const yt=e.Blob?e.File:gt;var bt;const mt=Symbol();class Et extends F{constructor(){super(),this.EMPTY=0,this.LOADING=1,this.DONE=2,this.readAsArrayBuffer=t=>{Tt.call(this[mt],"readAsArrayBuffer",t,()=>{this[mt].result=t[ot][at].buffer.slice(0)})},this.readAsBinaryString=t=>{Tt.call(this[mt],"readAsBinaryString",t,()=>{this[mt].result=t[ot][at].reduce((t,e)=>t+=String.fromCharCode(e),"")})},this.readAsDataURL=t=>{Tt.call(this[mt],"readAsDataURL",t,()=>{this[mt].result="data:"+t.type+";base64,"+ht(t[ot][at])})},this.readAsText=(t,e)=>{Tt.call(this[mt],"readAsText",t,()=>{this[mt].result=new g(e).decode(t[ot][at])})},this[mt]=new wt(this)}get readyState(){return this[mt].readyState}get result(){return this[mt].result}get error(){return this[mt].error}abort(){this.readyState===Et.LOADING&&(this[mt].readyState=Et.DONE,this[mt].result=null,st(this,"abort"))}get onabort(){return this[mt].onabort}set onabort(t){this[mt].onabort=t,St.call(this[mt],"abort")}get onerror(){return this[mt].onerror}set onerror(t){this[mt].onerror=t,St.call(this[mt],"error")}get onload(){return this[mt].onload}set onload(t){this[mt].onload=t,St.call(this[mt],"load")}get onloadend(){return this[mt].onloadend}set onloadend(t){this[mt].onloadend=t,St.call(this[mt],"loadend")}get onloadstart(){return this[mt].onloadstart}set onloadstart(t){this[mt].onloadstart=t,St.call(this[mt],"loadstart")}get onprogress(){return this[mt].onprogress}set onprogress(t){this[mt].onprogress=t,St.call(this[mt],"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}Et.EMPTY=0,Et.LOADING=1,Et.DONE=2,o(Et,"FileReader");const vt=Symbol();class wt{constructor(t){this.readyState=Et.EMPTY,this.result=null,this.error=null,this[bt]=Rt.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function Tt(t,e,r){if(!s("Blob",e))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");this.error=null,this.readyState=Et.LOADING,st(this.target,"loadstart",0,e.size),setTimeout(()=>{if(this.readyState===Et.LOADING){this.readyState=Et.DONE;try{r(),st(this.target,"load",e.size,e.size)}catch(t){this.result=null,this.error=t,st(this.target,"error",0,e.size)}}st(this.target,"loadend",this.result?e.size:0,e.size)})}function St(t){const e="on"+t,r=this[e],s=this[vt][e];_.call(this.target,t,r,s)}function Rt(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)}}}bt=vt;const Pt=e.Blob?e.FileReader:Et;var xt;const At=Symbol();class Ot{constructor(t,e){if(void 0!==t)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type\t'HTMLFormElement'.");if(e)throw new TypeError("Failed to construct 'FormData': parameter 2 is not of type 'HTMLElement'.");this[At]=new Dt}append(t,e,r){this[At][Lt].push(qt(t,e,r))}delete(t){const e=[];t=String(t),Ct(this[At][Lt],r=>{r[0]!==t&&e.push(r)}),this[At][Lt]=e}get(t){const e=this[At][Lt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){const e=[];return t=String(t),Ct(this[At][Lt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[At][Lt].length;++e)if(this[At][Lt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);const s=[],n=qt(t,e,r);let o=!0;Ct(this[At][Lt],e=>{e[0]===t?o&&(o=!s.push(n)):s.push(e)}),o&&s.push(n),this[At][Lt]=s}forEach(t,e){for(const[r,s]of this)t.call(e,s,r,e)}entries(){return this[At][Lt].values()}keys(){return this[At][Lt].map(t=>t[0]).values()}values(){return this[At][Lt].map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}o(Ot,"FormData");const Lt=Symbol();class Dt{constructor(){this[xt]=[]}toBlob(){const t="----formdata-polyfill-"+Math.random(),e=`--${t}\r\nContent-Disposition: form-data; name="`;let r=[];for(const[t,s]of this[Lt].values())"string"==typeof s?r.push(e+jt(Nt(t))+`"\r\n\r\n${Nt(s)}\r\n`):r.push(e+jt(Nt(t))+`"; filename="${jt(s.name)}"\r\nContent-Type: ${s.type||"application/octet-stream"}\r\n\r\n`,s,"\r\n");return r.push(`--${t}--`),new it(r,{type:"multipart/form-data; boundary="+t})}}function qt(t,e,r){return s("Blob",e)?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new gt([e],r)),[String(t),e]):[String(t),String(e)]}function Nt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Ct(t,e){for(let r=0;r<t.length;++r)e(t[r])}function jt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}xt=Lt;const Ut=e.FormData||Ot;var Bt;const Ht=Symbol();class Mt{constructor(t){let e=t||"";r("URLSearchParams",e)&&(e=e.toString()),this[Ht]=new It,this[Ht][Ft]=function(t){let e={};if("object"==typeof t)if(Array.isArray(t))for(let r=0;r<t.length;++r){let s=t[r];if(!Array.isArray(s)||2!==s.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");kt(e,s[0],s[1])}else for(const r in t)t.hasOwnProperty(r)&&kt(e,r,t[r]);else{0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let t=0;t<r.length;++t){let s=r[t],n=s.indexOf("=");-1<n?kt(e,Xt(s.slice(0,n)),Xt(s.slice(n+1))):s&&kt(e,Xt(s),"")}}return e}(e)}get size(){return i(this[Ht][Ft]).reduce((t,e)=>t+e.length,0)}append(t,e){kt(this[Ht][Ft],t,e)}delete(t,e){let r={};for(let[s,n]of a(this[Ht][Ft]))if(s!==t)Object.assign(r,{[s]:n});else if(void 0!==e){let t=n.filter(t=>t!==""+e);t.length>0&&Object.assign(r,{[s]:t})}this[Ht][Ft]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ht][Ft][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ht][Ft][t].slice(0):[]}has(t,e){return!!$t(this[Ht][Ft],t)&&(void 0===e||this[Ht][Ft][t].indexOf(""+e)>-1)}set(t,e){this[Ht][Ft][t]=[""+e]}sort(){const t=this[Ht];let e=Object.keys(t[Ft]);e.sort();let r={};for(let s of e)Object.assign(r,{[s]:t[Ft][s]});t[Ft]=r}forEach(t,e){a(this[Ht][Ft]).forEach(([r,s])=>{s.forEach(s=>{t.call(e,s,r,this)})})}entries(){return a(this[Ht][Ft]).map(([t,e])=>e.map(e=>[t,e])).reduce(_t,[]).values()}keys(){return Object.keys(this[Ht][Ft]).values()}values(){return i(this[Ht][Ft]).reduce(_t,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[];for(let[e,r]of a(this[Ht][Ft])){let s=Gt(e);for(let e of r)t.push(s+"="+Gt(e))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(Mt,"URLSearchParams");const Ft=Symbol();class It{constructor(){this[Bt]={}}}function kt(t,e,r){let s="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$t(t,e)?t[e].push(s):t[e]=[s]}function Gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function Xt(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,t=>decodeURIComponent(t))}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){for(const r of e)t.push(r);return t}Bt=Ft;const zt=e.URLSearchParams||Mt;var Vt;const Jt=Symbol();class Yt extends F{static abort(t){const e=te();return Wt.call(e[Jt],t,!1),e}static any(t){const e=te(),r=t.find(t=>t.aborted);if(r)Wt.call(e[Jt],r.reason,!1);else{function s(r){for(const e of t)e.removeEventListener("abort",s);Wt.call(e[Jt],this.reason,!0,r.isTrusted)}for(const n of t)n.addEventListener("abort",s)}return e}static timeout(t){const e=te();return setTimeout(()=>{Wt.call(e[Jt],new n("signal timed out","TimeoutError"))},t),e}constructor(){if(new.target===Yt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[Jt]=new Qt(this)}get aborted(){return this[Jt].aborted}get reason(){return this[Jt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[Jt].onabort}set onabort(t){this[Jt].onabort=t,_.call(this,"abort",t,this[Jt][Kt].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}o(Yt,"AbortSignal");const Kt=Symbol();class Qt{constructor(t){this.aborted=!1,this.reason=void 0,this[Vt]=Zt.call(this),this.onabort=null,this.target=t}}function Wt(t,e=!0,r=!0){if(!this.aborted&&(this.aborted=!0,this.reason=null!=t?t:new n("signal is aborted without reason","AbortError"),e)){const t=U(this.target,"abort",void 0,r);G.call(this.target[M],t)}}function Zt(){return{onabort:t=>{z.call(this.target,this.onabort,t)}}}function te(){const t=Object.create(Yt.prototype);return t[M]=new k(t),t[Jt]=new Qt(t),t}Vt=Kt;const ee=e.AbortSignal||Yt,re=Symbol();class se{constructor(){this[re]=new ne}get signal(){return this[re].signal}abort(t){Wt.call(this[re].signal[Jt],t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(se,"AbortController");class ne{constructor(){this.signal=te()}}const oe=e.AbortController||se;var ie;const ae=Symbol();class le extends F{constructor(){if(new.target===le)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[ae]=new ce(this)}get onabort(){return this[ae].onabort}set onabort(t){this[ae].onabort=t,ue.call(this[ae],"abort")}get onerror(){return this[ae].onerror}set onerror(t){this[ae].onerror=t,ue.call(this[ae],"error")}get onload(){return this[ae].onload}set onload(t){this[ae].onload=t,ue.call(this[ae],"load")}get onloadend(){return this[ae].onloadend}set onloadend(t){this[ae].onloadend=t,ue.call(this[ae],"loadend")}get onloadstart(){return this[ae].onloadstart}set onloadstart(t){this[ae].onloadstart=t,ue.call(this[ae],"loadstart")}get onprogress(){return this[ae].onprogress}set onprogress(t){this[ae].onprogress=t,ue.call(this[ae],"progress")}get ontimeout(){return this[ae].ontimeout}set ontimeout(t){this[ae].ontimeout=t,ue.call(this[ae],"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(le,"XMLHttpRequestEventTarget");const he=Symbol();class ce{constructor(t){this[ie]=de.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.target=t}}function ue(t){const e="on"+t,r=this[e],s=this[he][e];_.call(this.target,t,r,s)}function de(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)},ontimeout:t=>{z.call(this.target,this.ontimeout,t)}}}ie=he;class fe extends le{constructor(){if(new.target===fe)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(fe,"XMLHttpRequestUpload");const ge=(()=>{let t,r="undefined",s="request",n="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[s])===n&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[s])===n&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[s])===n&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[s])===n&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[s])===n&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[s])===n&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[s])===n&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[s])===n&&qh||void 0,typeof e.XMLHttpRequest!==n)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[s])===n&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[s])===n&&Taro||void 0),t})(),pe=ge?ge.request:function(t){const e="NOT_SUPPORTED_ERR",r={errMsg:e,errno:9,exception:{retryCount:0,reasons:[{errMsg:e,errno:9}]},useHttpDNS:!1};throw Promise.resolve(r).then(e=>{try{t.fail&&t.fail(e)}catch(t){console.warn(t)}}).then(()=>{t.complete&&t.complete(r)}),new ReferenceError("request is not defined")};var ye,be,me,Ee,ve,we,Te,Se,Re,Pe;const xe=Symbol();class Ae extends le{constructor(){super(),this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this[xe]=new Me(this)}get readyState(){return this[xe].readyState}get response(){return this[xe].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[xe].responseType}set responseType(t){this[xe].responseType=t}get responseURL(){return this[xe].responseURL}get responseXML(){return null}get status(){return this[xe].status}get statusText(){return this.readyState===Ae.UNSENT||this.readyState===Ae.OPENED?"":this[xe].statusText||(t=this.status,rr[t]||"unknown");var t}get timeout(){return this[xe].timeout}set timeout(t){this[xe].timeout=t}get upload(){return this[xe].upload}get withCredentials(){return this[xe].withCredentials}set withCredentials(t){this[xe].withCredentials=t}abort(){Ge.call(this[xe])}getAllResponseHeaders(){return this[xe][Ue]?a(this[xe][Ue]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[xe][Ue])return null;const s=t.toLowerCase();return null!==(r=null===(e=a(this[xe][Ue]||{}).find(t=>t[0].toLowerCase()===s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}open(...t){const[e,r,s=!0,n=null,o=null]=t,i=this[xe];if(t.length<2)throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${t.length} present.`);if(s||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience."),Ge.call(i,!1),i[Ce]=Ye(e),i[Ne]=String(r),null!==n||null!==o){const t=String(null!=n?n:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){const r=`Basic ${ht((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[Le]=!0,ze.call(i,Ae.OPENED)}overrideMimeType(t){this[xe][Le]&&console.warn(`XMLHttpRequest.overrideMimeType(${t}) is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[xe];if(!e[Le]||e.readyState!==Ae.OPENED)throw new n("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[Le]=!1;const r=-1===["GET","HEAD"].indexOf(e[Ce]),s=r&&-1===Object.keys(e[je]).map(t=>t.toLowerCase()).indexOf("content-type"),o=e.upload[M][I].length>0;let i=Object.assign({},e[je]),a=0,l=tr(t,s?t=>{Qe(i,"Content-Type",t)}:void 0,o?t=>{a=t}:void 0);if(e[He]=pe({url:e[Ne],method:e[Ce],header:i,data:l,dataType:"json"===e.responseType?"json":Ke(e.responseType),responseType:Ke(e.responseType),success:Fe.bind(e),fail:Ie.bind(e),complete:ke.bind(e)}),st(this,"loadstart"),o){const t=r&&("string"==typeof l?l.length>0:l.byteLength>0);t&&st(e.upload,"loadstart",0,a),setTimeout(()=>{const r=e[Le]||e.readyState!==Ae.OPENED,s=r?0:a;r?st(e.upload,"abort"):t&&st(e.upload,"load",s,s),(r||t)&&st(e.upload,"loadend",s,s)})}Xe.call(e)}setRequestHeader(t,e){Qe(this[xe][je],t,e)}get onreadystatechange(){return this[xe].onreadystatechange}set onreadystatechange(t){this[xe].onreadystatechange=t,_.call(this,"readystatechange",t,this[xe][Oe].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}Ae.UNSENT=0,Ae.OPENED=1,Ae.HEADERS_RECEIVED=2,Ae.LOADING=3,Ae.DONE=4,o(Ae,"XMLHttpRequest");const Oe=Symbol(),Le=Symbol(),De=Symbol(),qe=Symbol(),Ne=Symbol(),Ce=Symbol(),je=Symbol(),Ue=Symbol(),Be=Symbol(),He=Symbol();class Me{constructor(t){this.readyState=Ae.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[ye]=Ve.call(this),this.onreadystatechange=null,this[be]=!1,this[me]=!1,this[Ee]=0,this[ve]="",this[we]="GET",this[Te]={Accept:"*/*"},this[Se]=null,this[Re]=0,this[Pe]=null,this.target=t,this.upload=function(){const t=Object.create(fe.prototype);return t[M]=new k(t),t[ae]=new ce(t),t}()}}function Fe({statusCode:t,header:e,data:r}){this.responseURL=this[Ne],this.status=t,this[Ue]=e;const s=this.target.getResponseHeader("Content-Length");this[Be]=()=>s?parseInt(s):0,this.readyState===Ae.OPENED&&(ze.call(this,Ae.HEADERS_RECEIVED),ze.call(this,Ae.LOADING),setTimeout(()=>{if(!this[Le]){let t=this[Be];try{this.response=er(this.responseType,r),st(this.target,"load",t,t)}catch(t){console.error(t),st(this.target,"error")}}}))}function Ie(t){"status"in t?Fe.call(this,{statusCode:t.status,header:t.headers,data:t.data}):(this.status=0,this.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:"",this[Le]||this.readyState===Ae.UNSENT||this.readyState===Ae.DONE||(st(this.target,"error"),_e.call(this)))}function ke(){this[He]=null,this[Le]||this.readyState!==Ae.OPENED&&this.readyState!==Ae.LOADING||ze.call(this,Ae.DONE),setTimeout(()=>{if(!this[Le]){let t=this[Be];st(this.target,"loadend",t,t)}})}function Ge(t=!0){const e=t?setTimeout:t=>{t()};this[De]=!0,this[He]&&this.readyState!==Ae.DONE&&(t&&ze.call(this,Ae.DONE),e(()=>{const e=this[He];e&&e.abort(),t&&st(this.target,"abort"),t&&!e&&st(this.target,"loadend")})),e(()=>{this[De]&&(t&&(this.readyState=Ae.UNSENT),$e.call(this))})}function Xe(){this.timeout&&(this[qe]=setTimeout(()=>{this.status||this.readyState===Ae.DONE||(this[He]&&this[He].abort(),ze.call(this,Ae.DONE),st(this.target,"timeout"))},this.timeout))}function $e(){this[De]=!1,_e.call(this),this.response="",this.responseURL="",this.status=0,this.statusText="",this[je]={},this[Ue]=null,this[Be]=0}function _e(){this[qe]&&(clearTimeout(this[qe]),this[qe]=0)}function ze(t){const e=t!==this.readyState;if(this.readyState=t,e){const t=U(this.target,"readystatechange");G.call(this.target[M],t)}}function Ve(){return{onreadystatechange:t=>{z.call(this.target,this.onreadystatechange,t)}}}ye=Oe,be=Le,me=De,Ee=qe,ve=Ne,we=Ce,Te=je,Se=Ue,Re=Be,Pe=He;const Je=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ye(t){let e=t.toUpperCase();return Je.indexOf(e)>-1?e:t}function Ke(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function Qe(t,e,r){const s=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===s)return void(t[e]=r);Object.assign(t,{[e]:r})}const We=t=>(new l).encode(t).buffer,Ze=t=>(new g).decode(t);function tr(t,e,n){let o;if("string"==typeof t)o=t,e&&e("text/plain;charset=UTF-8");else if(r("URLSearchParams",t))o=t.toString(),e&&e("application/x-www-form-urlencoded;charset=UTF-8");else if(t instanceof ArrayBuffer)o=t.slice(0);else if(ArrayBuffer.isView(t))o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);else if(s("Blob",t))o=t[ot][at].buffer.slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){const r=t[At].toBlob();o=r[ot][at].buffer,e&&e(r.type)}else o=t?String(t):"";return n&&n("string"==typeof o?()=>We(o).byteLength:o.byteLength),o}function er(t,e){let r=e?"string"==typeof e||e instanceof ArrayBuffer?e:JSON.stringify(e):"";return t&&"text"!==t?"json"===t?JSON.parse("string"==typeof r?r:Ze(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):We(r):"blob"===t?new it([r]):r:"string"==typeof r?r:Ze(r)}const rr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};const sr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||Ae;var nr,or;const ir=Symbol();class ar{constructor(){if(new.target===ar)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ir]=new cr}get body(){if(!this[ir][hr])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ir].bodyUsed}arrayBuffer(){const t="arrayBuffer";return gr.call(this[ir],t)||dr.call(this[ir],t)}blob(){const t="blob";return gr.call(this[ir],t)||dr.call(this[ir],t)}bytes(){const t="bytes";return gr.call(this[ir],t)||dr.call(this[ir],t)}formData(){const t="formData";return gr.call(this[ir],t)||dr.call(this[ir],t)}json(){const t="json";return gr.call(this[ir],t)||dr.call(this[ir],t)}text(){const t="text";return gr.call(this[ir],t)||dr.call(this[ir],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(ar,"Body");const lr=Symbol(),hr=Symbol();class cr{constructor(){this.bodyUsed=!1,this[nr]="Body",this[or]=""}}function ur(t,e){if(r("ReadableStream",t))throw new ReferenceError("ReadableStream is not defined");this[hr]=tr(t,t=>{e&&!e.get("Content-Type")&&e.set("Content-Type",t)})}function dr(t){return new Promise((e,r)=>{try{e(fr.call(this,t))}catch(t){r(t)}})}function fr(t){if("arrayBuffer"===t)return er("arraybuffer",this[hr]);if("blob"===t)return er("blob",this[hr]);if("bytes"===t){let t=er("arraybuffer",this[hr]);return new Uint8Array(t)}if("formData"===t){return function(t,e="Failed to fetch"){const r=new Ot;if("string"!=typeof t||""===t.trim())return r;const s=t.indexOf("\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(2,s).trim();if(!n)throw new TypeError("Invalid MIME type");const o=t.split(`--${n}`).filter(t=>{const e=t.trim();return""!==e&&"--"!==e});if(0===o.length)throw new TypeError(e);return o.forEach(t=>{const s=t.indexOf("\r\n\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(0,s).trim(),o=t.substring(s+4),i=n.match(/name="([^"]+)"/),a=n.match(/filename="([^"]*)"/),h=n.match(/Content-Type: ([^\r\n]+)/);if(!i||!i[1])throw new TypeError(e);const c=i[1],u=!!a,d=h?(h[1]||"").trim():"application/octet-stream";if(u)try{const t=o.replace(/\r\n/g,""),e=(new l).encode(t),s=a[1]||"unknown-file",n=new gt([e],s,{type:d});r.append(c,n,s)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(c,t)}}),r}(er("text",this[hr]))}return er("json"===t?"json":"text",this[hr])}function gr(t){if(this[hr])return this.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${t}' on '${this[lr]}': body stream already read`)):void(this.bodyUsed=!0)}var pr;nr=lr,or=hr;const yr=Symbol();class br{constructor(t){this[yr]=new Er,r("Headers",t)?t.forEach((t,e)=>{this.append(e,t)}):Array.isArray(t)?t.forEach(t=>{if(!Array.isArray(t))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");if(2!==t.length)throw new TypeError("Failed to construct 'Headers': Invalid value");this.append(t[0],t[1])}):t&&a(t).forEach(([t,e])=>{this.append(t,e)})}append(t,e){var r;let s=vr(t,"append");e=wr(e);let n=null===(r=this[yr][mr].get(s))||void 0===r?void 0:r[1];this[yr][mr].set(s,[""+t,n?`${n}, ${e}`:e])}delete(t){let e=vr(t,"delete");this[yr][mr].delete(e)}get(t){var e,r;let s=vr(t,"get");return null!==(r=null===(e=this[yr][mr].get(s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}getSetCookie(){let t=this.get("Set-Cookie");return t?t.split(", "):[]}has(t){let e=vr(t,"has");return this[yr][mr].has(e)}set(t,e){let r=vr(t,"set");this[yr][mr].set(r,[""+t,wr(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,s])=>{t.call(e,s,r,this)})}entries(){return this[yr][mr].values()}keys(){return Array.from(this.entries()).map(t=>t[0]).values()}values(){return Array.from(this.entries()).map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object Headers]"}get isPolyfill(){return{symbol:t,hierarchy:["Headers"]}}}o(br,"Headers");const mr=Symbol();class Er{constructor(){this[pr]=new Map}}function vr(t,e=""){if("string"!=typeof t&&(t=String(t)),(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)&&e)throw new TypeError(`Failed to execute '${e}' on 'Headers': Invalid name`);return t.toLowerCase()}function wr(t){return"string"!=typeof t&&(t=String(t)),t}function Tr(t){let e=new br;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substring(1,t.length):t}).forEach(function(t){let r=t.split(":"),s=r.shift().trim();if(s){let t=r.join(":").trim();try{e.append(s,t)}catch(t){console.warn("Response "+t.message)}}}),e}pr=mr;const Sr=e.Headers||br,Rr=Symbol();class Pr extends ar{constructor(t,e){super(),this[Rr]=new xr;const r=this[Rr];this[ir][lr]="Request";let n=null!=e?e:{},o=n.body;if(s("Request",t)){if(t.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.credentials=t.credentials,n.headers||(r.headers=new br(t.headers)),r.method=t.method,r.mode=t.mode,r.signal=t.signal,r.url=t.url;let e=t;o||null===e[ir][hr]||(o=e[ir][hr],e[ir].bodyUsed=!0)}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new br(n.headers)),n.method&&(r.method=Ye(n.method)),n.mode&&(r.mode=n.mode),n.signal&&(r.signal=n.signal),("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");if(ur.call(this[ir],o,this.headers),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==n.cache&&"no-cache"!==n.cache)){let t=/([?&])_=[^&]*/;if(t.test(this.url))r.url=this.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;r.url+=(t.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}get cache(){return this[Rr].cache}get credentials(){return this[Rr].credentials}get destination(){return this[Rr].destination}get headers(){const t=this[Rr];return t.headers||(t.headers=new br),t.headers}get integrity(){return this[Rr].integrity}get keepalive(){return this[Rr].keepalive}get method(){return this[Rr].method}get mode(){return this[Rr].mode}get redirect(){return this[Rr].redirect}get referrer(){return this[Rr].referrer}get referrerPolicy(){return this[Rr].referrerPolicy}get signal(){const t=this[Rr];return t.signal||(t.signal=(new se).signal),t.signal}get url(){return this[Rr].url}clone(){var t;return new Pr(this,{body:null!==(t=this[ir][hr])&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request"]}}}o(Pr,"Request");class xr{constructor(){this.cache="default",this.credentials="same-origin",this.destination="",this.integrity="",this.keepalive=!1,this.method="GET",this.mode="cors",this.redirect="follow",this.referrer="about:client",this.referrerPolicy="",this.url=""}}const Ar=e.Request||Pr,Or=Symbol();class Lr extends ar{constructor(t,e){super(),this[Or]=new Dr;const r=this[Or];this[ir][lr]="Response";let s=null!=e?e:{},n=void 0===s.status?200:s.status;if(n<200||n>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+n}) is outside the range [200, 599].`);s.headers&&(r.headers=new br(s.headers)),r.ok=this.status>=200&&this.status<300,r.status=n,r.statusText=void 0===s.statusText?"":""+s.statusText,ur.call(this[ir],t,this.headers)}get headers(){const t=this[Or];return t.headers||(t.headers=new br),t.headers}get ok(){return this[Or].ok}get redirected(){return this[Or].redirected}get status(){return this[Or].status}get statusText(){return this[Or].statusText}get type(){return this[Or].type}get url(){return this[Or].url}clone(){const t=new Lr(this[ir][hr],{headers:new br(this.headers),status:this.status,statusText:this.statusText});return t[Or].url=this.url,t}static json(t,e){return new Response(JSON.stringify(t),e)}static error(){const t=new Lr(null,{status:200,statusText:""});return t[Or].ok=!1,t[Or].status=0,t[Or].type="error",t}static redirect(t,e=301){if(-1===[301,302,303,307,308].indexOf(e))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new Response(null,{status:e,headers:{location:String(t)}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response"]}}}o(Lr,"Response");class Dr{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const qr=e.Response||Lr;function Nr(t,e){if(new.target===Nr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){let i=new Pr(t,e);if(i.signal&&i.signal.aborted)return o(i.signal.reason);let l=new sr;if(l.onload=function(){let t={headers:l instanceof Ae?new br(l[xe][Ue]||void 0):Tr(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};setTimeout(()=>{const e=new Lr(l.response,t);e[Or].url=l.responseURL,s(e)})},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},l.ontimeout=function(){setTimeout(function(){o(new n("request:fail timeout","TimeoutError"))})},l.onabort=function(){setTimeout(function(){o(new n("request:fail abort","AbortError"))})},l.open(i.method,i.url),"include"===i.credentials?l.withCredentials=!0:"omit"===i.credentials&&(l.withCredentials=!1),e&&("object"==typeof(h=e.headers)&&!r("Headers",h))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(vr(t)),l.setRequestHeader(t,wr(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(vr(e))&&l.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){l.setRequestHeader(e,t)});var h;if(i.signal){const t=()=>{l.abort()};i.signal.addEventListener("abort",t),l.onreadystatechange=function(){4===l.readyState&&i.signal.removeEventListener("abort",t)}}l.send(i[ir][hr])})}const Cr=e.fetch||Nr;exports.AbortController=oe,exports.AbortControllerP=se,exports.AbortSignal=ee,exports.AbortSignalP=Yt,exports.Blob=dt,exports.BlobP=it,exports.CustomEvent=Q,exports.CustomEventP=Y,exports.Event=B,exports.EventP=A,exports.EventTarget=V,exports.EventTargetP=F,exports.File=yt,exports.FileP=gt,exports.FileReader=Pt,exports.FileReaderP=Et,exports.FormData=Ut,exports.FormDataP=Ot,exports.Headers=Sr,exports.HeadersP=br,exports.ProgressEvent=nt,exports.ProgressEventP=Z,exports.Request=Ar,exports.RequestP=Pr,exports.Response=qr,exports.ResponseP=Lr,exports.TextDecoder=v,exports.TextDecoderP=g,exports.TextEncoder=c,exports.TextEncoderP=l,exports.URLSearchParams=zt,exports.URLSearchParamsP=Mt,exports.XMLHttpRequest=sr,exports.XMLHttpRequestP=Ae,exports.fetch=Cr,exports.fetchP=Nr;
|
|
1
|
+
"use strict";const t=Symbol("isPolyfill"),e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};function r(t,e){return Object.prototype.toString.call(e)===`[object ${t}]`}function s(e,r){return!!r&&"object"==typeof r&&"isPolyfill"in r&&!!r.isPolyfill&&"object"==typeof r.isPolyfill&&"symbol"in r.isPolyfill&&r.isPolyfill.symbol===t&&"hierarchy"in r.isPolyfill&&Array.isArray(r.isPolyfill.hierarchy)&&r.isPolyfill.hierarchy.indexOf(e)>-1}class n extends Error{constructor(t,e){super(),this.message=null!=t?t:this.message,this.name=null!=e?e:this.name}}function o(t,e){Object.defineProperty(t.prototype,Symbol.toStringTag,{configurable:!0,value:e})}function i(t){return Object.keys(t).map(e=>t[e])}function a(t){return Object.keys(t).map(e=>[e,t[e]])}class l{get encoding(){return"utf-8"}encode(t=""){return h(t).encoded}encodeInto(t,e){const r=h(t,e);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function h(t,e){const r=void 0!==e;let s=0,n=0,o=t.length,i=0,a=Math.max(32,o+(o>>1)+7),l=r?e:new Uint8Array(a>>3<<3);for(;s<o;){let e,h=t.charCodeAt(s++);if(h>=55296&&h<=56319)if(s<o){let e=t.charCodeAt(s);56320==(64512&e)?(++s,h=((1023&h)<<10)+(1023&e)+65536):h=65533}else h=65533;else h>=56320&&h<=57343&&(h=65533);if(!r&&i+4>l.length){a+=8,a*=1+s/t.length*2,a=a>>3<<3;let e=new Uint8Array(a);e.set(l),l=e}if(4294967168&h?4294965248&h?4294901760&h?4292870144&h?(h=65533,e=3):e=4:e=3:e=2:e=1,r&&i+e>l.length)break;1===e?l[i++]=h:2===e?(l[i++]=h>>6&31|192,l[i++]=63&h|128):3===e?(l[i++]=h>>12&15|224,l[i++]=h>>6&63|128,l[i++]=63&h|128):4===e&&(l[i++]=h>>18&7|240,l[i++]=h>>12&63|128,l[i++]=h>>6&63|128,l[i++]=63&h|128),n++}return{encoded:r?e.slice():l.slice(0,i),read:n,written:i}}o(l,"TextEncoder");const c=e.TextEncoder||l;var u,d;const f=Symbol();class g{constructor(t="utf-8",{fatal:e=!1,ignoreBOM:r=!1}={}){if(-1===m.indexOf(t.toLowerCase()))throw new RangeError("TextDecoder: The encoding label provided ('"+t+"') is invalid.");this[f]=new b,this[f].fatal=e,this[f].ignoreBOM=r}get encoding(){return"utf-8"}get fatal(){return this[f].fatal}get ignoreBOM(){return this[f].ignoreBOM}decode(t,{stream:e=!1}={}){const r=this[f];let s;if(void 0===t){if(r[y].length>0){if(this.fatal)throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");r[y]=[]}return""}if(s=t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t),!r[p]&&this.ignoreBOM&&s.length>=3&&239===s[0]&&187===s[1]&&191===s[2]&&(s=s.subarray(3),r[p]=!0),r[y].length>0){let t=new Uint8Array(r[y].length+s.length);t.set(r[y],0),t.set(s,r[y].length),s=t,r[y]=[]}let n=s.length,o=[];if(e&&s.length>0){let t=s.length;for(;t>0&&t>s.length-4;){let e=s[t-1];if(128!=(192&e)){E(e)>s.length-(t-1)&&(n=t-1);break}t--}r[y]=Array.from(s.slice(n)),s=s.slice(0,n)}let i=0;for(;i<n;){let t=s[i],e=null,r=E(t);if(i+r<=n){let n,o,a,l;switch(r){case 1:t<128&&(e=t);break;case 2:n=s[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(e=l));break;case 3:n=s[i+1],o=s[i+2],128==(192&n)&&128==(192&o)&&(l=(15&t)<<12|(63&n)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:n=s[i+1],o=s[i+2],a=s[i+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&o)<<6|63&a,l>65535&&l<1114112&&(e=l))}}if(null===e){if(this.fatal)throw new TypeError("TextDecoder.decode: Decoding failed.");e=65533,r=1}else e>65535&&(e-=65536,o.push(e>>>10&1023|55296),e=56320|1023&e);o.push(e),i+=r}let a="";for(let t=0,e=o.length;t<e;t+=4096)a+=String.fromCharCode.apply(String,o.slice(t,t+4096));return a}toString(){return"[object TextDecoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextDecoder"]}}}o(g,"TextDecoder");const p=Symbol(),y=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[u]=!1,this[d]=[]}}u=p,d=y;const m=["utf-8","utf8","unicode-1-1-utf-8"];function E(t){return t>239?4:t>223?3:t>191?2:1}const v=e.TextDecoder||g;var w,T,S,R,x;const P=Symbol();class A{constructor(t,e){this.NONE=A.NONE,this.CAPTURING_PHASE=A.CAPTURING_PHASE,this.AT_TARGET=A.AT_TARGET,this.BUBBLING_PHASE=A.BUBBLING_PHASE,this[P]=new j;const r=this[P];r.type=String(t),r.bubbles=!!(null==e?void 0:e.bubbles),r.cancelable=!!(null==e?void 0:e.cancelable),r.composed=!!(null==e?void 0:e.composed)}get type(){return this[P].type}get bubbles(){return this[P].bubbles}get cancelable(){return this[P].cancelable}get composed(){return this[P].composed}get target(){return this[P].target}get currentTarget(){return this[P].currentTarget}get eventPhase(){return this[P].eventPhase}get srcElement(){return this[P].target}get cancelBubble(){return this[P].cancelBubble}set cancelBubble(t){this[P].cancelBubble=t}get defaultPrevented(){return this[P].defaultPrevented}get returnValue(){return this[P].returnValue}set returnValue(t){t||this.preventDefault()}get isTrusted(){return this[P][L]}get timeStamp(){return this[P].timeStamp}composedPath(){const t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const s=this[P];s[q]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[P];t[D]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[N]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[P][C]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}A.NONE=0,A.CAPTURING_PHASE=1,A.AT_TARGET=2,A.BUBBLING_PHASE=3,o(A,"Event");const O=Symbol(),L=Symbol(),D=Symbol(),q=Symbol(),N=Symbol(),C=Symbol();class j{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=A.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-j[O],this[w]=!1,this[T]=!1,this[S]=!1,this[R]=!1,this[x]=!1}}function U(t,e,r,s=!0){const n=new A(e,r);return n[P].target=t,n[P][L]=s,n}w=L,T=D,S=q,R=N,x=C,j[O]=(new Date).getTime();const B=e.EventTarget?e.Event:A;var H;const M=Symbol();class F{constructor(){this[M]=new k(this)}addEventListener(t,e,r){const s=this[M],n=new $(t,e);if(n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),!s[I].some(t=>t.equals(n))){if("object"==typeof r){const{once:t,passive:e,signal:o}=r;n.options.once=!!t,n.options.passive=!!e,o&&(n.options.signal=o,X.call(s,o,n))}s[I].push(n);const t=t=>t.options.capture?0:1;s[I]=s[I].sort((e,r)=>t(e)-t(r))}}dispatchEvent(t){if("object"!=typeof t)throw new TypeError("EventTarget.dispatchEvent: Argument 1 is not an object.");if(!(t instanceof A))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");const e=t[P];return e.target=this,e[L]=!1,G.call(this[M],t)}removeEventListener(t,e,r){const s=this[M],n=new $(t,e);n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),s[I].some(t=>t.equals(n))&&(s[I]=s[I].filter(t=>!t.equals(n)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}o(F,"EventTarget");const I=Symbol();class k{constructor(t){this[H]=[],this.target=t}}function G(t){const e=t[P];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=A.AT_TARGET,e[q]=!0;const r=[];for(let s=0;s<this[I].length;++s){const n=this[I][s];if(n.type!==t.type)continue;e[D]=!!n.options.passive,n.options.once&&r.push(s);const{callback:o}=n;try{"function"==typeof o&&o.call(this.target,t)}catch(t){console.error(t)}if(e[D]=!1,e[C])break}return r.length>0&&(this[I]=this[I].reduce((t,e,s)=>(-1===r.indexOf(s)&&t.push(e),t),[])),e.currentTarget=null,e.eventPhase=A.NONE,e[q]=!1,!(t.cancelable&&e[N])}function X(t,e){const r=()=>{this[I]=this[I].filter(t=>!t.equals(e)),t.removeEventListener("abort",r)};try{t.addEventListener("abort",r)}catch(t){console.error(t)}}H=I;class ${constructor(t,e){var r;this.options={},this.type=String(t),this.callback="function"==typeof(r=e)?r:function(t){return!!t&&"handleEvent"in t&&"function"==typeof t.handleEvent}(r)?r.handleEvent:r}equals(t){return Object.is(this.type,t.type)&&Object.is(this.callback,t.callback)&&Object.is(this.options.capture,t.options.capture)}}function _(t,e,r){"function"==typeof e?this.addEventListener(t,r):this.removeEventListener(t,r)}function z(t,e){"function"==typeof t&&t.call(this,e)}const V=e.EventTarget||F,J=Symbol();class Y extends A{constructor(t,e){var r;super(t,e),this[J]=new K,this[J].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[J].detail}initCustomEvent(t,e,r,s){this[P][q]||(this.initEvent(t,e,r),this[J].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(Y,"CustomEvent");class K{}const Q=e.EventTarget?e.CustomEvent:Y,W=Symbol();class Z extends A{constructor(t,e){var r,s;super(t,e),this[W]=new et;const n=this[W];n.lengthComputable=!!(null==e?void 0:e.lengthComputable),n.loaded=null!==(r=null==e?void 0:e.loaded)&&void 0!==r?r:0,n.total=null!==(s=null==e?void 0:e.total)&&void 0!==s?s:0}get lengthComputable(){return rt(this[W].lengthComputable)}get loaded(){return rt(this[W].loaded)}get total(){return rt(this[W].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(Z,"ProgressEvent");class et{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function rt(t){return"function"==typeof t?t():t}function st(t,e,r=0,s=0){const n=function(t,e,{lengthComputable:r=!1,loaded:s=0,total:n=0}={}){const o=new Z(e);return o[W].lengthComputable=r,o[W].loaded=s,o[W].total=n,o[P].target=t,o[P][L]=!0,o}(t,e,{lengthComputable:()=>rt(s)>0,loaded:r,total:s});G.call(t[M],n)}const nt=e.EventTarget?e.ProgressEvent:Z,ot=Symbol();class it{constructor(t=[],e){if(!Array.isArray(t))throw new TypeError("First argument to Blob constructor must be an Array.");let r=null,n=t.reduce((t,e)=>(s("Blob",e)?t.push(e[ot][at]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(ct(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[ot]=new lt(function(t){const e=t.reduce((t,e)=>t+e.byteLength,0),r=new Uint8Array(e);return t.reduce((t,e)=>(r.set(e,t),t+e.byteLength),0),r}(n));const o=this[ot];o.size=o[at].length;const i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[ot].size}get type(){return this[ot].type}arrayBuffer(){return Promise.resolve(ut(this[ot][at].buffer).buffer)}bytes(){return Promise.resolve(ut(this[ot][at].buffer))}slice(t,e,r){const s=this[ot][at].slice(null!=t?t:0,null!=e?e:this[ot][at].length);return new it([s],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){const t=new g;return Promise.resolve(t.decode(this[ot][at]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(it,"Blob");const at=Symbol();class lt{constructor(t){this.size=0,this.type="",this[at]=t}}function ht(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var s=0;s<t.length;s+=3){let n=t[s],o=s+1<t.length,i=o?t[s+1]:0,a=s+2<t.length,l=a?t[s+2]:0,h=n>>2,c=(3&n)<<4|i>>4,u=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(u=64)),r.push(e[h],e[c],e[u],e[d])}return r.join("")}function ct(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function ut(t){const e=ct(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}const dt=e.Blob||it,ft=Symbol();class gt extends it{constructor(t,e,r){super(t,r),this[ft]=new pt,this[ft].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[ft].name=e.replace(/\//g,":")}get lastModified(){return this[ft].lastModified}get name(){return this[ft].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(gt,"File");class pt{constructor(){this.lastModified=0,this.name=""}}const yt=e.Blob?e.File:gt;var bt;const mt=Symbol();class Et extends F{constructor(){super(),this.EMPTY=0,this.LOADING=1,this.DONE=2,this[mt]=new wt(this)}get readyState(){return this[mt].readyState}get result(){return this[mt].result}get error(){return this[mt].error}abort(){this.readyState===Et.LOADING&&(this[mt].readyState=Et.DONE,this[mt].result=null,st(this,"abort"))}readAsArrayBuffer(t){Tt.call(this[mt],"readAsArrayBuffer",t,()=>{this[mt].result=t[ot][at].buffer.slice(0)})}readAsBinaryString(t){Tt.call(this[mt],"readAsBinaryString",t,()=>{this[mt].result=t[ot][at].reduce((t,e)=>t+=String.fromCharCode(e),"")})}readAsDataURL(t){Tt.call(this[mt],"readAsDataURL",t,()=>{this[mt].result="data:"+t.type+";base64,"+ht(t[ot][at])})}readAsText(t,e){Tt.call(this[mt],"readAsText",t,()=>{this[mt].result=new g(e).decode(t[ot][at])})}get onabort(){return this[mt].onabort}set onabort(t){this[mt].onabort=t,St.call(this[mt],"abort")}get onerror(){return this[mt].onerror}set onerror(t){this[mt].onerror=t,St.call(this[mt],"error")}get onload(){return this[mt].onload}set onload(t){this[mt].onload=t,St.call(this[mt],"load")}get onloadend(){return this[mt].onloadend}set onloadend(t){this[mt].onloadend=t,St.call(this[mt],"loadend")}get onloadstart(){return this[mt].onloadstart}set onloadstart(t){this[mt].onloadstart=t,St.call(this[mt],"loadstart")}get onprogress(){return this[mt].onprogress}set onprogress(t){this[mt].onprogress=t,St.call(this[mt],"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}Et.EMPTY=0,Et.LOADING=1,Et.DONE=2,o(Et,"FileReader");const vt=Symbol();class wt{constructor(t){this.readyState=Et.EMPTY,this.result=null,this.error=null,this[bt]=Rt.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function Tt(t,e,r){if(!s("Blob",e))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");this.error=null,this.readyState=Et.LOADING,st(this.target,"loadstart",0,e.size),setTimeout(()=>{if(this.readyState===Et.LOADING){this.readyState=Et.DONE;try{r(),st(this.target,"load",e.size,e.size)}catch(t){this.result=null,this.error=t,st(this.target,"error",0,e.size)}}st(this.target,"loadend",this.result?e.size:0,e.size)})}function St(t){const e="on"+t,r=this[e],s=this[vt][e];_.call(this.target,t,r,s)}function Rt(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)}}}bt=vt;const xt=e.Blob?e.FileReader:Et;var Pt;const At=Symbol();class Ot{constructor(t,e){if(void 0!==t)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type\t'HTMLFormElement'.");if(e)throw new TypeError("Failed to construct 'FormData': parameter 2 is not of type 'HTMLElement'.");this[At]=new Dt}append(t,e,r){this[At][Lt].push(qt(t,e,r))}delete(t){const e=[];t=String(t),Ct(this[At][Lt],r=>{r[0]!==t&&e.push(r)}),this[At][Lt]=e}get(t){const e=this[At][Lt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){const e=[];return t=String(t),Ct(this[At][Lt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[At][Lt].length;++e)if(this[At][Lt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);const s=[],n=qt(t,e,r);let o=!0;Ct(this[At][Lt],e=>{e[0]===t?o&&(o=!s.push(n)):s.push(e)}),o&&s.push(n),this[At][Lt]=s}forEach(t,e){for(const[r,s]of this)t.call(e,s,r,e)}entries(){return this[At][Lt].values()}keys(){return this[At][Lt].map(t=>t[0]).values()}values(){return this[At][Lt].map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}o(Ot,"FormData");const Lt=Symbol();class Dt{constructor(){this[Pt]=[]}toBlob(){const t="----formdata-polyfill-"+Math.random(),e=`--${t}\r\nContent-Disposition: form-data; name="`;let r=[];for(const[t,s]of this[Lt].values())"string"==typeof s?r.push(e+jt(Nt(t))+`"\r\n\r\n${Nt(s)}\r\n`):r.push(e+jt(Nt(t))+`"; filename="${jt(s.name)}"\r\nContent-Type: ${s.type||"application/octet-stream"}\r\n\r\n`,s,"\r\n");return r.push(`--${t}--`),new it(r,{type:"multipart/form-data; boundary="+t})}}function qt(t,e,r){return s("Blob",e)?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new gt([e],r)),[String(t),e]):[String(t),String(e)]}function Nt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Ct(t,e){for(let r=0;r<t.length;++r)e(t[r])}function jt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Pt=Lt;const Ut=e.FormData||Ot;var Bt;const Ht=Symbol();class Mt{constructor(t){let e=t||"";r("URLSearchParams",e)&&(e=e.toString()),this[Ht]=new It,this[Ht][Ft]=function(t){let e={};if("object"==typeof t)if(Array.isArray(t))for(let r=0;r<t.length;++r){let s=t[r];if(!Array.isArray(s)||2!==s.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");kt(e,s[0],s[1])}else for(const r in t)t.hasOwnProperty(r)&&kt(e,r,t[r]);else{0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let t=0;t<r.length;++t){let s=r[t],n=s.indexOf("=");-1<n?kt(e,Xt(s.slice(0,n)),Xt(s.slice(n+1))):s&&kt(e,Xt(s),"")}}return e}(e)}get size(){return i(this[Ht][Ft]).reduce((t,e)=>t+e.length,0)}append(t,e){kt(this[Ht][Ft],t,e)}delete(t,e){let r={};for(let[s,n]of a(this[Ht][Ft]))if(s!==t)Object.assign(r,{[s]:n});else if(void 0!==e){let t=n.filter(t=>t!==""+e);t.length>0&&Object.assign(r,{[s]:t})}this[Ht][Ft]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ht][Ft][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ht][Ft][t].slice(0):[]}has(t,e){return!!$t(this[Ht][Ft],t)&&(void 0===e||this[Ht][Ft][t].indexOf(""+e)>-1)}set(t,e){this[Ht][Ft][t]=[""+e]}sort(){const t=this[Ht];let e=Object.keys(t[Ft]);e.sort();let r={};for(let s of e)Object.assign(r,{[s]:t[Ft][s]});t[Ft]=r}forEach(t,e){a(this[Ht][Ft]).forEach(([r,s])=>{s.forEach(s=>{t.call(e,s,r,this)})})}entries(){return a(this[Ht][Ft]).map(([t,e])=>e.map(e=>[t,e])).reduce(_t,[]).values()}keys(){return Object.keys(this[Ht][Ft]).values()}values(){return i(this[Ht][Ft]).reduce(_t,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[];for(let[e,r]of a(this[Ht][Ft])){let s=Gt(e);for(let e of r)t.push(s+"="+Gt(e))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(Mt,"URLSearchParams");const Ft=Symbol();class It{constructor(){this[Bt]={}}}function kt(t,e,r){let s="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$t(t,e)?t[e].push(s):t[e]=[s]}function Gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function Xt(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,t=>decodeURIComponent(t))}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){for(const r of e)t.push(r);return t}Bt=Ft;const zt=e.URLSearchParams||Mt;var Vt;const Jt=Symbol();class Yt extends F{static abort(t){const e=te();return Wt.call(e[Jt],t,!1),e}static any(t){const e=te(),r=t.find(t=>t.aborted);if(r)Wt.call(e[Jt],r.reason,!1);else{function s(r){for(const e of t)e.removeEventListener("abort",s);Wt.call(e[Jt],this.reason,!0,r.isTrusted)}for(const n of t)n.addEventListener("abort",s)}return e}static timeout(t){const e=te();return setTimeout(()=>{Wt.call(e[Jt],new n("signal timed out","TimeoutError"))},t),e}constructor(){if(new.target===Yt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[Jt]=new Qt(this)}get aborted(){return this[Jt].aborted}get reason(){return this[Jt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[Jt].onabort}set onabort(t){this[Jt].onabort=t,_.call(this,"abort",t,this[Jt][Kt].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}o(Yt,"AbortSignal");const Kt=Symbol();class Qt{constructor(t){this.aborted=!1,this.reason=void 0,this[Vt]=Zt.call(this),this.onabort=null,this.target=t}}function Wt(t,e=!0,r=!0){if(!this.aborted&&(this.aborted=!0,this.reason=null!=t?t:new n("signal is aborted without reason","AbortError"),e)){const t=U(this.target,"abort",void 0,r);G.call(this.target[M],t)}}function Zt(){return{onabort:t=>{z.call(this.target,this.onabort,t)}}}function te(){const t=Object.create(Yt.prototype);return t[M]=new k(t),t[Jt]=new Qt(t),t}Vt=Kt;const ee=e.AbortSignal||Yt,re=Symbol();class se{constructor(){this[re]=new ne}get signal(){return this[re].signal}abort(t){Wt.call(this[re].signal[Jt],t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(se,"AbortController");class ne{constructor(){this.signal=te()}}const oe=e.AbortController||se;var ie;const ae=Symbol();class le extends F{constructor(){if(new.target===le)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[ae]=new ce(this)}get onabort(){return this[ae].onabort}set onabort(t){this[ae].onabort=t,ue.call(this[ae],"abort")}get onerror(){return this[ae].onerror}set onerror(t){this[ae].onerror=t,ue.call(this[ae],"error")}get onload(){return this[ae].onload}set onload(t){this[ae].onload=t,ue.call(this[ae],"load")}get onloadend(){return this[ae].onloadend}set onloadend(t){this[ae].onloadend=t,ue.call(this[ae],"loadend")}get onloadstart(){return this[ae].onloadstart}set onloadstart(t){this[ae].onloadstart=t,ue.call(this[ae],"loadstart")}get onprogress(){return this[ae].onprogress}set onprogress(t){this[ae].onprogress=t,ue.call(this[ae],"progress")}get ontimeout(){return this[ae].ontimeout}set ontimeout(t){this[ae].ontimeout=t,ue.call(this[ae],"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(le,"XMLHttpRequestEventTarget");const he=Symbol();class ce{constructor(t){this[ie]=de.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.target=t}}function ue(t){const e="on"+t,r=this[e],s=this[he][e];_.call(this.target,t,r,s)}function de(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)},ontimeout:t=>{z.call(this.target,this.ontimeout,t)}}}ie=he;class fe extends le{constructor(){if(new.target===fe)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(fe,"XMLHttpRequestUpload");const ge=(()=>{let t,r="undefined",s="request",n="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[s])===n&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[s])===n&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[s])===n&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[s])===n&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[s])===n&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[s])===n&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[s])===n&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[s])===n&&qh||typeof xhs!==r&&typeof(null===xhs||void 0===xhs?void 0:xhs[s])===n&&xhs||void 0,typeof e.XMLHttpRequest!==n)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[s])===n&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[s])===n&&Taro||void 0),t})(),pe=ge?ge.request:function(t){const e="NOT_SUPPORTED_ERR",r={errMsg:e,errno:9,exception:{retryCount:0,reasons:[{errMsg:e,errno:9}]},useHttpDNS:!1};throw Promise.resolve(r).then(e=>{try{t.fail&&t.fail(e)}catch(t){console.warn(t)}}).then(()=>{t.complete&&t.complete(r)}),new ReferenceError("request is not defined")};var ye,be,me,Ee,ve,we,Te,Se,Re,xe;const Pe=Symbol();class Ae extends le{constructor(){super(),this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this[Pe]=new Me(this)}get readyState(){return this[Pe].readyState}get response(){return this[Pe].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[Pe].responseType}set responseType(t){this[Pe].responseType=t}get responseURL(){return this[Pe].responseURL}get responseXML(){return null}get status(){return this[Pe].status}get statusText(){return this.readyState===Ae.UNSENT||this.readyState===Ae.OPENED?"":this[Pe].statusText||(t=this.status,rr[t]||"unknown");var t}get timeout(){return this[Pe].timeout}set timeout(t){this[Pe].timeout=t}get upload(){return this[Pe].upload}get withCredentials(){return this[Pe].withCredentials}set withCredentials(t){this[Pe].withCredentials=t}abort(){Ge.call(this[Pe])}getAllResponseHeaders(){return this[Pe][Ue]?a(this[Pe][Ue]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[Pe][Ue])return null;const s=t.toLowerCase();return null!==(r=null===(e=a(this[Pe][Ue]||{}).find(t=>t[0].toLowerCase()===s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}open(...t){const[e,r,s=!0,n=null,o=null]=t,i=this[Pe];if(t.length<2)throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${t.length} present.`);if(s||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience."),Ge.call(i,!1),i[Ce]=Ye(e),i[Ne]=String(r),null!==n||null!==o){const t=String(null!=n?n:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){const r=`Basic ${ht((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[Le]=!0,ze.call(i,Ae.OPENED)}overrideMimeType(t){this[Pe][Le]&&console.warn(`XMLHttpRequest.overrideMimeType(${t}) is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[Pe];if(!e[Le]||e.readyState!==Ae.OPENED)throw new n("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[Le]=!1;const r=-1===["GET","HEAD"].indexOf(e[Ce]),s=r&&-1===Object.keys(e[je]).map(t=>t.toLowerCase()).indexOf("content-type"),o=e.upload[M][I].length>0;let i=Object.assign({},e[je]),a=0,l=tr(t,s?t=>{Qe(i,"Content-Type",t)}:void 0,o?t=>{a=t}:void 0);if(e[He]=pe({url:e[Ne],method:e[Ce],header:i,data:l,dataType:"json"===e.responseType?"json":Ke(e.responseType),responseType:Ke(e.responseType),success:Fe.bind(e),fail:Ie.bind(e),complete:ke.bind(e)}),st(this,"loadstart"),o){const t=r&&("string"==typeof l?l.length>0:l.byteLength>0);t&&st(e.upload,"loadstart",0,a),setTimeout(()=>{const r=e[Le]||e.readyState!==Ae.OPENED,s=r?0:a;r?st(e.upload,"abort"):t&&st(e.upload,"load",s,s),(r||t)&&st(e.upload,"loadend",s,s)})}Xe.call(e)}setRequestHeader(t,e){Qe(this[Pe][je],t,e)}get onreadystatechange(){return this[Pe].onreadystatechange}set onreadystatechange(t){this[Pe].onreadystatechange=t,_.call(this,"readystatechange",t,this[Pe][Oe].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}Ae.UNSENT=0,Ae.OPENED=1,Ae.HEADERS_RECEIVED=2,Ae.LOADING=3,Ae.DONE=4,o(Ae,"XMLHttpRequest");const Oe=Symbol(),Le=Symbol(),De=Symbol(),qe=Symbol(),Ne=Symbol(),Ce=Symbol(),je=Symbol(),Ue=Symbol(),Be=Symbol(),He=Symbol();class Me{constructor(t){this.readyState=Ae.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[ye]=Ve.call(this),this.onreadystatechange=null,this[be]=!1,this[me]=!1,this[Ee]=0,this[ve]="",this[we]="GET",this[Te]={Accept:"*/*"},this[Se]=null,this[Re]=0,this[xe]=null,this.target=t,this.upload=function(){const t=Object.create(fe.prototype);return t[M]=new k(t),t[ae]=new ce(t),t}()}}function Fe({statusCode:t,header:e,data:r}){this.responseURL=this[Ne],this.status=t,this[Ue]=e;const s=this.target.getResponseHeader("Content-Length");this[Be]=()=>s?parseInt(s):0,this.readyState===Ae.OPENED&&(ze.call(this,Ae.HEADERS_RECEIVED),ze.call(this,Ae.LOADING),setTimeout(()=>{if(!this[Le]){let t=this[Be];try{this.response=er(this.responseType,r),st(this.target,"load",t,t)}catch(t){console.error(t),st(this.target,"error")}}}))}function Ie(t){"status"in t?Fe.call(this,{statusCode:t.status,header:t.headers,data:t.data}):(this.status=0,this.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:"",this[Le]||this.readyState===Ae.UNSENT||this.readyState===Ae.DONE||(st(this.target,"error"),_e.call(this)))}function ke(){this[He]=null,this[Le]||this.readyState!==Ae.OPENED&&this.readyState!==Ae.LOADING||ze.call(this,Ae.DONE),setTimeout(()=>{if(!this[Le]){let t=this[Be];st(this.target,"loadend",t,t)}})}function Ge(t=!0){const e=t?setTimeout:t=>{t()};this[De]=!0,this[He]&&this.readyState!==Ae.DONE&&(t&&ze.call(this,Ae.DONE),e(()=>{const e=this[He];e&&e.abort(),t&&st(this.target,"abort"),t&&!e&&st(this.target,"loadend")})),e(()=>{this[De]&&(t&&(this.readyState=Ae.UNSENT),$e.call(this))})}function Xe(){this.timeout&&(this[qe]=setTimeout(()=>{this.status||this.readyState===Ae.DONE||(this[He]&&this[He].abort(),ze.call(this,Ae.DONE),st(this.target,"timeout"))},this.timeout))}function $e(){this[De]=!1,_e.call(this),this.response="",this.responseURL="",this.status=0,this.statusText="",this[je]={},this[Ue]=null,this[Be]=0}function _e(){this[qe]&&(clearTimeout(this[qe]),this[qe]=0)}function ze(t){const e=t!==this.readyState;if(this.readyState=t,e){const t=U(this.target,"readystatechange");G.call(this.target[M],t)}}function Ve(){return{onreadystatechange:t=>{z.call(this.target,this.onreadystatechange,t)}}}ye=Oe,be=Le,me=De,Ee=qe,ve=Ne,we=Ce,Te=je,Se=Ue,Re=Be,xe=He;const Je=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ye(t){let e=t.toUpperCase();return Je.indexOf(e)>-1?e:t}function Ke(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function Qe(t,e,r){const s=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===s)return void(t[e]=r);Object.assign(t,{[e]:r})}const We=t=>(new l).encode(t).buffer,Ze=t=>(new g).decode(t);function tr(t,e,n){let o;if("string"==typeof t)o=t,e&&e("text/plain;charset=UTF-8");else if(r("URLSearchParams",t))o=t.toString(),e&&e("application/x-www-form-urlencoded;charset=UTF-8");else if(t instanceof ArrayBuffer)o=t.slice(0);else if(ArrayBuffer.isView(t))o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);else if(s("Blob",t))o=t[ot][at].buffer.slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){const r=t[At].toBlob();o=r[ot][at].buffer,e&&e(r.type)}else o=t?String(t):"";return n&&n("string"==typeof o?()=>We(o).byteLength:o.byteLength),o}function er(t,e){let r=e?"string"==typeof e||e instanceof ArrayBuffer?e:JSON.stringify(e):"";return t&&"text"!==t?"json"===t?JSON.parse("string"==typeof r?r:Ze(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):We(r):"blob"===t?new it([r]):r:"string"==typeof r?r:Ze(r)}const rr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};const sr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||Ae;var nr,or;const ir=Symbol();class ar{constructor(){if(new.target===ar)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ir]=new cr}get body(){if(!this[ir][hr])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ir].bodyUsed}arrayBuffer(){const t="arrayBuffer";return gr.call(this[ir],t)||dr.call(this[ir],t)}blob(){const t="blob";return gr.call(this[ir],t)||dr.call(this[ir],t)}bytes(){const t="bytes";return gr.call(this[ir],t)||dr.call(this[ir],t)}formData(){const t="formData";return gr.call(this[ir],t)||dr.call(this[ir],t)}json(){const t="json";return gr.call(this[ir],t)||dr.call(this[ir],t)}text(){const t="text";return gr.call(this[ir],t)||dr.call(this[ir],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(ar,"Body");const lr=Symbol(),hr=Symbol();class cr{constructor(){this.bodyUsed=!1,this[nr]="Body",this[or]=""}}function ur(t,e){if(r("ReadableStream",t))throw new ReferenceError("ReadableStream is not defined");this[hr]=tr(t,t=>{e&&!e.get("Content-Type")&&e.set("Content-Type",t)})}function dr(t){return new Promise((e,r)=>{try{e(fr.call(this,t))}catch(t){r(t)}})}function fr(t){if("arrayBuffer"===t)return er("arraybuffer",this[hr]);if("blob"===t)return er("blob",this[hr]);if("bytes"===t){let t=er("arraybuffer",this[hr]);return new Uint8Array(t)}if("formData"===t){return function(t,e="Failed to fetch"){const r=new Ot;if("string"!=typeof t||""===t.trim())return r;const s=t.indexOf("\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(2,s).trim();if(!n)throw new TypeError("Invalid MIME type");const o=t.split(`--${n}`).filter(t=>{const e=t.trim();return""!==e&&"--"!==e});if(0===o.length)throw new TypeError(e);return o.forEach(t=>{const s=t.indexOf("\r\n\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(0,s).trim(),o=t.substring(s+4),i=n.match(/name="([^"]+)"/),a=n.match(/filename="([^"]*)"/),h=n.match(/Content-Type: ([^\r\n]+)/);if(!i||!i[1])throw new TypeError(e);const c=i[1],u=!!a,d=h?(h[1]||"").trim():"application/octet-stream";if(u)try{const t=o.replace(/\r\n/g,""),e=(new l).encode(t),s=a[1]||"unknown-file",n=new gt([e],s,{type:d});r.append(c,n,s)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(c,t)}}),r}(er("text",this[hr]))}return er("json"===t?"json":"text",this[hr])}function gr(t){if(this[hr])return this.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${t}' on '${this[lr]}': body stream already read`)):void(this.bodyUsed=!0)}var pr;nr=lr,or=hr;const yr=Symbol();class br{constructor(t){this[yr]=new Er,r("Headers",t)?t.forEach((t,e)=>{this.append(e,t)}):Array.isArray(t)?t.forEach(t=>{if(!Array.isArray(t))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");if(2!==t.length)throw new TypeError("Failed to construct 'Headers': Invalid value");this.append(t[0],t[1])}):t&&a(t).forEach(([t,e])=>{this.append(t,e)})}append(t,e){var r;let s=vr(t,"append");e=wr(e);let n=null===(r=this[yr][mr].get(s))||void 0===r?void 0:r[1];this[yr][mr].set(s,[""+t,n?`${n}, ${e}`:e])}delete(t){let e=vr(t,"delete");this[yr][mr].delete(e)}get(t){var e,r;let s=vr(t,"get");return null!==(r=null===(e=this[yr][mr].get(s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}getSetCookie(){let t=this.get("Set-Cookie");return t?t.split(", "):[]}has(t){let e=vr(t,"has");return this[yr][mr].has(e)}set(t,e){let r=vr(t,"set");this[yr][mr].set(r,[""+t,wr(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,s])=>{t.call(e,s,r,this)})}entries(){return this[yr][mr].values()}keys(){return Array.from(this.entries()).map(t=>t[0]).values()}values(){return Array.from(this.entries()).map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object Headers]"}get isPolyfill(){return{symbol:t,hierarchy:["Headers"]}}}o(br,"Headers");const mr=Symbol();class Er{constructor(){this[pr]=new Map}}function vr(t,e=""){if("string"!=typeof t&&(t=String(t)),(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)&&e)throw new TypeError(`Failed to execute '${e}' on 'Headers': Invalid name`);return t.toLowerCase()}function wr(t){return"string"!=typeof t&&(t=String(t)),t}function Tr(t){let e=new br;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substring(1,t.length):t}).forEach(function(t){let r=t.split(":"),s=r.shift().trim();if(s){let t=r.join(":").trim();try{e.append(s,t)}catch(t){console.warn("Response "+t.message)}}}),e}pr=mr;const Sr=e.Headers||br,Rr=Symbol();class xr extends ar{constructor(t,e){super(),this[Rr]=new Pr;const r=this[Rr];this[ir][lr]="Request";let n=null!=e?e:{},o=n.body;if(s("Request",t)){if(t.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.credentials=t.credentials,n.headers||(r.headers=new br(t.headers)),r.method=t.method,r.mode=t.mode,r.signal=t.signal,r.url=t.url;let e=t;o||null===e[ir][hr]||(o=e[ir][hr],e[ir].bodyUsed=!0)}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new br(n.headers)),n.method&&(r.method=Ye(n.method)),n.mode&&(r.mode=n.mode),n.signal&&(r.signal=n.signal),("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");if(ur.call(this[ir],o,this.headers),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==n.cache&&"no-cache"!==n.cache)){let t=/([?&])_=[^&]*/;if(t.test(this.url))r.url=this.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;r.url+=(t.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}get cache(){return this[Rr].cache}get credentials(){return this[Rr].credentials}get destination(){return this[Rr].destination}get headers(){const t=this[Rr];return t.headers||(t.headers=new br),t.headers}get integrity(){return this[Rr].integrity}get keepalive(){return this[Rr].keepalive}get method(){return this[Rr].method}get mode(){return this[Rr].mode}get redirect(){return this[Rr].redirect}get referrer(){return this[Rr].referrer}get referrerPolicy(){return this[Rr].referrerPolicy}get signal(){const t=this[Rr];return t.signal||(t.signal=(new se).signal),t.signal}get url(){return this[Rr].url}clone(){var t;return new xr(this,{body:null!==(t=this[ir][hr])&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request"]}}}o(xr,"Request");class Pr{constructor(){this.cache="default",this.credentials="same-origin",this.destination="",this.integrity="",this.keepalive=!1,this.method="GET",this.mode="cors",this.redirect="follow",this.referrer="about:client",this.referrerPolicy="",this.url=""}}const Ar=e.Request||xr,Or=Symbol();class Lr extends ar{constructor(t,e){super(),this[Or]=new Dr;const r=this[Or];this[ir][lr]="Response";let s=null!=e?e:{},n=void 0===s.status?200:s.status;if(n<200||n>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+n}) is outside the range [200, 599].`);s.headers&&(r.headers=new br(s.headers)),r.ok=this.status>=200&&this.status<300,r.status=n,r.statusText=void 0===s.statusText?"":""+s.statusText,ur.call(this[ir],t,this.headers)}get headers(){const t=this[Or];return t.headers||(t.headers=new br),t.headers}get ok(){return this[Or].ok}get redirected(){return this[Or].redirected}get status(){return this[Or].status}get statusText(){return this[Or].statusText}get type(){return this[Or].type}get url(){return this[Or].url}clone(){const t=new Lr(this[ir][hr],{headers:new br(this.headers),status:this.status,statusText:this.statusText});return t[Or].url=this.url,t}static json(t,e){return new Response(JSON.stringify(t),e)}static error(){const t=new Lr(null,{status:200,statusText:""});return t[Or].ok=!1,t[Or].status=0,t[Or].type="error",t}static redirect(t,e=301){if(-1===[301,302,303,307,308].indexOf(e))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new Response(null,{status:e,headers:{location:String(t)}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response"]}}}o(Lr,"Response");class Dr{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const qr=e.Response||Lr;function Nr(t,e){if(new.target===Nr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){let i=new xr(t,e);if(i.signal&&i.signal.aborted)return o(i.signal.reason);let l=new sr;if(l.onload=function(){let t={headers:l instanceof Ae?new br(l[Pe][Ue]||void 0):Tr(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};setTimeout(()=>{const e=new Lr(l.response,t);e[Or].url=l.responseURL,s(e)})},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},l.ontimeout=function(){setTimeout(function(){o(new n("request:fail timeout","TimeoutError"))})},l.onabort=function(){setTimeout(function(){o(new n("request:fail abort","AbortError"))})},l.open(i.method,i.url),"include"===i.credentials?l.withCredentials=!0:"omit"===i.credentials&&(l.withCredentials=!1),e&&("object"==typeof(h=e.headers)&&!r("Headers",h))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(vr(t)),l.setRequestHeader(t,wr(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(vr(e))&&l.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){l.setRequestHeader(e,t)});var h;if(i.signal){const t=()=>{l.abort()};i.signal.addEventListener("abort",t),l.onreadystatechange=function(){4===l.readyState&&i.signal.removeEventListener("abort",t)}}l.send(i[ir][hr])})}const Cr=e.fetch||Nr;exports.AbortController=oe,exports.AbortControllerP=se,exports.AbortSignal=ee,exports.AbortSignalP=Yt,exports.Blob=dt,exports.BlobP=it,exports.CustomEvent=Q,exports.CustomEventP=Y,exports.Event=B,exports.EventP=A,exports.EventTarget=V,exports.EventTargetP=F,exports.File=yt,exports.FileP=gt,exports.FileReader=xt,exports.FileReaderP=Et,exports.FormData=Ut,exports.FormDataP=Ot,exports.Headers=Sr,exports.HeadersP=br,exports.ProgressEvent=nt,exports.ProgressEventP=Z,exports.Request=Ar,exports.RequestP=xr,exports.Response=qr,exports.ResponseP=Lr,exports.TextDecoder=v,exports.TextDecoderP=g,exports.TextEncoder=c,exports.TextEncoderP=l,exports.URLSearchParams=zt,exports.URLSearchParamsP=Mt,exports.XMLHttpRequest=sr,exports.XMLHttpRequestP=Ae,exports.fetch=Cr,exports.fetchP=Nr;
|
package/dist/index.d.ts
CHANGED
|
@@ -261,10 +261,10 @@ declare class FileReaderP extends EventTargetP implements FileReader {
|
|
|
261
261
|
readonly DONE = 2;
|
|
262
262
|
get error(): DOMException | null;
|
|
263
263
|
abort(): void;
|
|
264
|
-
readAsArrayBuffer
|
|
265
|
-
readAsBinaryString
|
|
266
|
-
readAsDataURL
|
|
267
|
-
readAsText
|
|
264
|
+
readAsArrayBuffer(blob: Blob): void;
|
|
265
|
+
readAsBinaryString(blob: Blob): void;
|
|
266
|
+
readAsDataURL(blob: Blob): void;
|
|
267
|
+
readAsText(blob: Blob, encoding?: string): void;
|
|
268
268
|
get onabort(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
|
269
269
|
set onabort(value: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null);
|
|
270
270
|
get onerror(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
package/dist/index.esm.js
CHANGED
|
@@ -761,29 +761,6 @@ class FileReaderP extends EventTargetP {
|
|
|
761
761
|
this.EMPTY = 0;
|
|
762
762
|
this.LOADING = 1;
|
|
763
763
|
this.DONE = 2;
|
|
764
|
-
this.readAsArrayBuffer = (blob) => {
|
|
765
|
-
read$1.call(this[state$a], "readAsArrayBuffer", blob, () => {
|
|
766
|
-
this[state$a].result = blob[state$c][_u8array].buffer.slice(0);
|
|
767
|
-
});
|
|
768
|
-
};
|
|
769
|
-
this.readAsBinaryString = (blob) => {
|
|
770
|
-
read$1.call(this[state$a], "readAsBinaryString", blob, () => {
|
|
771
|
-
this[state$a].result = blob[state$c][_u8array].reduce((acc, cur) => {
|
|
772
|
-
acc += String.fromCharCode(cur);
|
|
773
|
-
return acc;
|
|
774
|
-
}, "");
|
|
775
|
-
});
|
|
776
|
-
};
|
|
777
|
-
this.readAsDataURL = (blob) => {
|
|
778
|
-
read$1.call(this[state$a], "readAsDataURL", blob, () => {
|
|
779
|
-
this[state$a].result = "data:" + blob.type + ";base64," + u8array2base64(blob[state$c][_u8array]);
|
|
780
|
-
});
|
|
781
|
-
};
|
|
782
|
-
this.readAsText = (blob, encoding) => {
|
|
783
|
-
read$1.call(this[state$a], "readAsText", blob, () => {
|
|
784
|
-
this[state$a].result = (new TextDecoderP(encoding)).decode(blob[state$c][_u8array]);
|
|
785
|
-
});
|
|
786
|
-
};
|
|
787
764
|
this[state$a] = new FileReaderState(this);
|
|
788
765
|
}
|
|
789
766
|
get readyState() { return this[state$a].readyState; }
|
|
@@ -796,6 +773,29 @@ class FileReaderP extends EventTargetP {
|
|
|
796
773
|
emitProcessEvent(this, "abort");
|
|
797
774
|
}
|
|
798
775
|
}
|
|
776
|
+
readAsArrayBuffer(blob) {
|
|
777
|
+
read$1.call(this[state$a], "readAsArrayBuffer", blob, () => {
|
|
778
|
+
this[state$a].result = blob[state$c][_u8array].buffer.slice(0);
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
readAsBinaryString(blob) {
|
|
782
|
+
read$1.call(this[state$a], "readAsBinaryString", blob, () => {
|
|
783
|
+
this[state$a].result = blob[state$c][_u8array].reduce((acc, cur) => {
|
|
784
|
+
acc += String.fromCharCode(cur);
|
|
785
|
+
return acc;
|
|
786
|
+
}, "");
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
readAsDataURL(blob) {
|
|
790
|
+
read$1.call(this[state$a], "readAsDataURL", blob, () => {
|
|
791
|
+
this[state$a].result = "data:" + blob.type + ";base64," + u8array2base64(blob[state$c][_u8array]);
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
readAsText(blob, encoding) {
|
|
795
|
+
read$1.call(this[state$a], "readAsText", blob, () => {
|
|
796
|
+
this[state$a].result = (new TextDecoderP(encoding)).decode(blob[state$c][_u8array]);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
799
|
get onabort() { return this[state$a].onabort; }
|
|
800
800
|
set onabort(value) { this[state$a].onabort = value; attach$1.call(this[state$a], "abort"); }
|
|
801
801
|
get onerror() { return this[state$a].onerror; }
|
|
@@ -1481,6 +1481,7 @@ const mp = (() => {
|
|
|
1481
1481
|
(typeof tt !== u && typeof (tt === null || tt === void 0 ? void 0 : tt[r]) === f && tt) || // 抖音 | 飞书
|
|
1482
1482
|
(typeof ks !== u && typeof (ks === null || ks === void 0 ? void 0 : ks[r]) === f && ks) || // 快手
|
|
1483
1483
|
(typeof qh !== u && typeof (qh === null || qh === void 0 ? void 0 : qh[r]) === f && qh) || // 360
|
|
1484
|
+
(typeof xhs !== u && typeof (xhs === null || xhs === void 0 ? void 0 : xhs[r]) === f && xhs) || // 小红书
|
|
1484
1485
|
undefined;
|
|
1485
1486
|
if (typeof g["XMLHttpRequest"] === f) {
|
|
1486
1487
|
return;
|
package/dist/index.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=Symbol("isPolyfill"),e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};function r(t,e){return Object.prototype.toString.call(e)===`[object ${t}]`}function s(e,r){return!!r&&"object"==typeof r&&"isPolyfill"in r&&!!r.isPolyfill&&"object"==typeof r.isPolyfill&&"symbol"in r.isPolyfill&&r.isPolyfill.symbol===t&&"hierarchy"in r.isPolyfill&&Array.isArray(r.isPolyfill.hierarchy)&&r.isPolyfill.hierarchy.indexOf(e)>-1}class n extends Error{constructor(t,e){super(),this.message=null!=t?t:this.message,this.name=null!=e?e:this.name}}function o(t,e){Object.defineProperty(t.prototype,Symbol.toStringTag,{configurable:!0,value:e})}function i(t){return Object.keys(t).map(e=>t[e])}function a(t){return Object.keys(t).map(e=>[e,t[e]])}class l{get encoding(){return"utf-8"}encode(t=""){return h(t).encoded}encodeInto(t,e){const r=h(t,e);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function h(t,e){const r=void 0!==e;let s=0,n=0,o=t.length,i=0,a=Math.max(32,o+(o>>1)+7),l=r?e:new Uint8Array(a>>3<<3);for(;s<o;){let e,h=t.charCodeAt(s++);if(h>=55296&&h<=56319)if(s<o){let e=t.charCodeAt(s);56320==(64512&e)?(++s,h=((1023&h)<<10)+(1023&e)+65536):h=65533}else h=65533;else h>=56320&&h<=57343&&(h=65533);if(!r&&i+4>l.length){a+=8,a*=1+s/t.length*2,a=a>>3<<3;let e=new Uint8Array(a);e.set(l),l=e}if(4294967168&h?4294965248&h?4294901760&h?4292870144&h?(h=65533,e=3):e=4:e=3:e=2:e=1,r&&i+e>l.length)break;1===e?l[i++]=h:2===e?(l[i++]=h>>6&31|192,l[i++]=63&h|128):3===e?(l[i++]=h>>12&15|224,l[i++]=h>>6&63|128,l[i++]=63&h|128):4===e&&(l[i++]=h>>18&7|240,l[i++]=h>>12&63|128,l[i++]=h>>6&63|128,l[i++]=63&h|128),n++}return{encoded:r?e.slice():l.slice(0,i),read:n,written:i}}o(l,"TextEncoder");const c=e.TextEncoder||l;var u,d;const f=Symbol();class g{constructor(t="utf-8",{fatal:e=!1,ignoreBOM:r=!1}={}){if(-1===m.indexOf(t.toLowerCase()))throw new RangeError("TextDecoder: The encoding label provided ('"+t+"') is invalid.");this[f]=new b,this[f].fatal=e,this[f].ignoreBOM=r}get encoding(){return"utf-8"}get fatal(){return this[f].fatal}get ignoreBOM(){return this[f].ignoreBOM}decode(t,{stream:e=!1}={}){const r=this[f];let s;if(void 0===t){if(r[p].length>0){if(this.fatal)throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");r[p]=[]}return""}if(s=t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t),!r[y]&&this.ignoreBOM&&s.length>=3&&239===s[0]&&187===s[1]&&191===s[2]&&(s=s.subarray(3),r[y]=!0),r[p].length>0){let t=new Uint8Array(r[p].length+s.length);t.set(r[p],0),t.set(s,r[p].length),s=t,r[p]=[]}let n=s.length,o=[];if(e&&s.length>0){let t=s.length;for(;t>0&&t>s.length-4;){let e=s[t-1];if(128!=(192&e)){E(e)>s.length-(t-1)&&(n=t-1);break}t--}r[p]=Array.from(s.slice(n)),s=s.slice(0,n)}let i=0;for(;i<n;){let t=s[i],e=null,r=E(t);if(i+r<=n){let n,o,a,l;switch(r){case 1:t<128&&(e=t);break;case 2:n=s[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(e=l));break;case 3:n=s[i+1],o=s[i+2],128==(192&n)&&128==(192&o)&&(l=(15&t)<<12|(63&n)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:n=s[i+1],o=s[i+2],a=s[i+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&o)<<6|63&a,l>65535&&l<1114112&&(e=l))}}if(null===e){if(this.fatal)throw new TypeError("TextDecoder.decode: Decoding failed.");e=65533,r=1}else e>65535&&(e-=65536,o.push(e>>>10&1023|55296),e=56320|1023&e);o.push(e),i+=r}let a="";for(let t=0,e=o.length;t<e;t+=4096)a+=String.fromCharCode.apply(String,o.slice(t,t+4096));return a}toString(){return"[object TextDecoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextDecoder"]}}}o(g,"TextDecoder");const y=Symbol(),p=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[u]=!1,this[d]=[]}}u=y,d=p;const m=["utf-8","utf8","unicode-1-1-utf-8"];function E(t){return t>239?4:t>223?3:t>191?2:1}const w=e.TextDecoder||g;var v,T,S,R,A;const P=Symbol();class O{constructor(t,e){this.NONE=O.NONE,this.CAPTURING_PHASE=O.CAPTURING_PHASE,this.AT_TARGET=O.AT_TARGET,this.BUBBLING_PHASE=O.BUBBLING_PHASE,this[P]=new j;const r=this[P];r.type=String(t),r.bubbles=!!(null==e?void 0:e.bubbles),r.cancelable=!!(null==e?void 0:e.cancelable),r.composed=!!(null==e?void 0:e.composed)}get type(){return this[P].type}get bubbles(){return this[P].bubbles}get cancelable(){return this[P].cancelable}get composed(){return this[P].composed}get target(){return this[P].target}get currentTarget(){return this[P].currentTarget}get eventPhase(){return this[P].eventPhase}get srcElement(){return this[P].target}get cancelBubble(){return this[P].cancelBubble}set cancelBubble(t){this[P].cancelBubble=t}get defaultPrevented(){return this[P].defaultPrevented}get returnValue(){return this[P].returnValue}set returnValue(t){t||this.preventDefault()}get isTrusted(){return this[P][x]}get timeStamp(){return this[P].timeStamp}composedPath(){const t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const s=this[P];s[N]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[P];t[D]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[q]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[P][C]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}O.NONE=0,O.CAPTURING_PHASE=1,O.AT_TARGET=2,O.BUBBLING_PHASE=3,o(O,"Event");const L=Symbol(),x=Symbol(),D=Symbol(),N=Symbol(),q=Symbol(),C=Symbol();class j{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=O.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-j[L],this[v]=!1,this[T]=!1,this[S]=!1,this[R]=!1,this[A]=!1}}function U(t,e,r,s=!0){const n=new O(e,r);return n[P].target=t,n[P][x]=s,n}v=x,T=D,S=N,R=q,A=C,j[L]=(new Date).getTime();const B=e.EventTarget?e.Event:O;var H;const M=Symbol();class F{constructor(){this[M]=new k(this)}addEventListener(t,e,r){const s=this[M],n=new $(t,e);if(n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),!s[I].some(t=>t.equals(n))){if("object"==typeof r){const{once:t,passive:e,signal:o}=r;n.options.once=!!t,n.options.passive=!!e,o&&(n.options.signal=o,X.call(s,o,n))}s[I].push(n);const t=t=>t.options.capture?0:1;s[I]=s[I].sort((e,r)=>t(e)-t(r))}}dispatchEvent(t){if("object"!=typeof t)throw new TypeError("EventTarget.dispatchEvent: Argument 1 is not an object.");if(!(t instanceof O))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");const e=t[P];return e.target=this,e[x]=!1,G.call(this[M],t)}removeEventListener(t,e,r){const s=this[M],n=new $(t,e);n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),s[I].some(t=>t.equals(n))&&(s[I]=s[I].filter(t=>!t.equals(n)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}o(F,"EventTarget");const I=Symbol();class k{constructor(t){this[H]=[],this.target=t}}function G(t){const e=t[P];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=O.AT_TARGET,e[N]=!0;const r=[];for(let s=0;s<this[I].length;++s){const n=this[I][s];if(n.type!==t.type)continue;e[D]=!!n.options.passive,n.options.once&&r.push(s);const{callback:o}=n;try{"function"==typeof o&&o.call(this.target,t)}catch(t){console.error(t)}if(e[D]=!1,e[C])break}return r.length>0&&(this[I]=this[I].reduce((t,e,s)=>(-1===r.indexOf(s)&&t.push(e),t),[])),e.currentTarget=null,e.eventPhase=O.NONE,e[N]=!1,!(t.cancelable&&e[q])}function X(t,e){const r=()=>{this[I]=this[I].filter(t=>!t.equals(e)),t.removeEventListener("abort",r)};try{t.addEventListener("abort",r)}catch(t){console.error(t)}}H=I;class ${constructor(t,e){var r;this.options={},this.type=String(t),this.callback="function"==typeof(r=e)?r:function(t){return!!t&&"handleEvent"in t&&"function"==typeof t.handleEvent}(r)?r.handleEvent:r}equals(t){return Object.is(this.type,t.type)&&Object.is(this.callback,t.callback)&&Object.is(this.options.capture,t.options.capture)}}function _(t,e,r){"function"==typeof e?this.addEventListener(t,r):this.removeEventListener(t,r)}function z(t,e){"function"==typeof t&&t.call(this,e)}const V=e.EventTarget||F,J=Symbol();class Y extends O{constructor(t,e){var r;super(t,e),this[J]=new K,this[J].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[J].detail}initCustomEvent(t,e,r,s){this[P][N]||(this.initEvent(t,e,r),this[J].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(Y,"CustomEvent");class K{}const Q=e.EventTarget?e.CustomEvent:Y,W=Symbol();class Z extends O{constructor(t,e){var r,s;super(t,e),this[W]=new et;const n=this[W];n.lengthComputable=!!(null==e?void 0:e.lengthComputable),n.loaded=null!==(r=null==e?void 0:e.loaded)&&void 0!==r?r:0,n.total=null!==(s=null==e?void 0:e.total)&&void 0!==s?s:0}get lengthComputable(){return rt(this[W].lengthComputable)}get loaded(){return rt(this[W].loaded)}get total(){return rt(this[W].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(Z,"ProgressEvent");class et{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function rt(t){return"function"==typeof t?t():t}function st(t,e,r=0,s=0){const n=function(t,e,{lengthComputable:r=!1,loaded:s=0,total:n=0}={}){const o=new Z(e);return o[W].lengthComputable=r,o[W].loaded=s,o[W].total=n,o[P].target=t,o[P][x]=!0,o}(t,e,{lengthComputable:()=>rt(s)>0,loaded:r,total:s});G.call(t[M],n)}const nt=e.EventTarget?e.ProgressEvent:Z,ot=Symbol();class it{constructor(t=[],e){if(!Array.isArray(t))throw new TypeError("First argument to Blob constructor must be an Array.");let r=null,n=t.reduce((t,e)=>(s("Blob",e)?t.push(e[ot][at]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(ct(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[ot]=new lt(function(t){const e=t.reduce((t,e)=>t+e.byteLength,0),r=new Uint8Array(e);return t.reduce((t,e)=>(r.set(e,t),t+e.byteLength),0),r}(n));const o=this[ot];o.size=o[at].length;const i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[ot].size}get type(){return this[ot].type}arrayBuffer(){return Promise.resolve(ut(this[ot][at].buffer).buffer)}bytes(){return Promise.resolve(ut(this[ot][at].buffer))}slice(t,e,r){const s=this[ot][at].slice(null!=t?t:0,null!=e?e:this[ot][at].length);return new it([s],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){const t=new g;return Promise.resolve(t.decode(this[ot][at]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(it,"Blob");const at=Symbol();class lt{constructor(t){this.size=0,this.type="",this[at]=t}}function ht(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var s=0;s<t.length;s+=3){let n=t[s],o=s+1<t.length,i=o?t[s+1]:0,a=s+2<t.length,l=a?t[s+2]:0,h=n>>2,c=(3&n)<<4|i>>4,u=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(u=64)),r.push(e[h],e[c],e[u],e[d])}return r.join("")}function ct(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function ut(t){const e=ct(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}const dt=e.Blob||it,ft=Symbol();class gt extends it{constructor(t,e,r){super(t,r),this[ft]=new yt,this[ft].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[ft].name=e.replace(/\//g,":")}get lastModified(){return this[ft].lastModified}get name(){return this[ft].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(gt,"File");class yt{constructor(){this.lastModified=0,this.name=""}}const pt=e.Blob?e.File:gt;var bt;const mt=Symbol();class Et extends F{constructor(){super(),this.EMPTY=0,this.LOADING=1,this.DONE=2,this.readAsArrayBuffer=t=>{Tt.call(this[mt],"readAsArrayBuffer",t,()=>{this[mt].result=t[ot][at].buffer.slice(0)})},this.readAsBinaryString=t=>{Tt.call(this[mt],"readAsBinaryString",t,()=>{this[mt].result=t[ot][at].reduce((t,e)=>t+=String.fromCharCode(e),"")})},this.readAsDataURL=t=>{Tt.call(this[mt],"readAsDataURL",t,()=>{this[mt].result="data:"+t.type+";base64,"+ht(t[ot][at])})},this.readAsText=(t,e)=>{Tt.call(this[mt],"readAsText",t,()=>{this[mt].result=new g(e).decode(t[ot][at])})},this[mt]=new vt(this)}get readyState(){return this[mt].readyState}get result(){return this[mt].result}get error(){return this[mt].error}abort(){this.readyState===Et.LOADING&&(this[mt].readyState=Et.DONE,this[mt].result=null,st(this,"abort"))}get onabort(){return this[mt].onabort}set onabort(t){this[mt].onabort=t,St.call(this[mt],"abort")}get onerror(){return this[mt].onerror}set onerror(t){this[mt].onerror=t,St.call(this[mt],"error")}get onload(){return this[mt].onload}set onload(t){this[mt].onload=t,St.call(this[mt],"load")}get onloadend(){return this[mt].onloadend}set onloadend(t){this[mt].onloadend=t,St.call(this[mt],"loadend")}get onloadstart(){return this[mt].onloadstart}set onloadstart(t){this[mt].onloadstart=t,St.call(this[mt],"loadstart")}get onprogress(){return this[mt].onprogress}set onprogress(t){this[mt].onprogress=t,St.call(this[mt],"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}Et.EMPTY=0,Et.LOADING=1,Et.DONE=2,o(Et,"FileReader");const wt=Symbol();class vt{constructor(t){this.readyState=Et.EMPTY,this.result=null,this.error=null,this[bt]=Rt.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function Tt(t,e,r){if(!s("Blob",e))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");this.error=null,this.readyState=Et.LOADING,st(this.target,"loadstart",0,e.size),setTimeout(()=>{if(this.readyState===Et.LOADING){this.readyState=Et.DONE;try{r(),st(this.target,"load",e.size,e.size)}catch(t){this.result=null,this.error=t,st(this.target,"error",0,e.size)}}st(this.target,"loadend",this.result?e.size:0,e.size)})}function St(t){const e="on"+t,r=this[e],s=this[wt][e];_.call(this.target,t,r,s)}function Rt(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)}}}bt=wt;const At=e.Blob?e.FileReader:Et;var Pt;const Ot=Symbol();class Lt{constructor(t,e){if(void 0!==t)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type\t'HTMLFormElement'.");if(e)throw new TypeError("Failed to construct 'FormData': parameter 2 is not of type 'HTMLElement'.");this[Ot]=new Dt}append(t,e,r){this[Ot][xt].push(Nt(t,e,r))}delete(t){const e=[];t=String(t),Ct(this[Ot][xt],r=>{r[0]!==t&&e.push(r)}),this[Ot][xt]=e}get(t){const e=this[Ot][xt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){const e=[];return t=String(t),Ct(this[Ot][xt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[Ot][xt].length;++e)if(this[Ot][xt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);const s=[],n=Nt(t,e,r);let o=!0;Ct(this[Ot][xt],e=>{e[0]===t?o&&(o=!s.push(n)):s.push(e)}),o&&s.push(n),this[Ot][xt]=s}forEach(t,e){for(const[r,s]of this)t.call(e,s,r,e)}entries(){return this[Ot][xt].values()}keys(){return this[Ot][xt].map(t=>t[0]).values()}values(){return this[Ot][xt].map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}o(Lt,"FormData");const xt=Symbol();class Dt{constructor(){this[Pt]=[]}toBlob(){const t="----formdata-polyfill-"+Math.random(),e=`--${t}\r\nContent-Disposition: form-data; name="`;let r=[];for(const[t,s]of this[xt].values())"string"==typeof s?r.push(e+jt(qt(t))+`"\r\n\r\n${qt(s)}\r\n`):r.push(e+jt(qt(t))+`"; filename="${jt(s.name)}"\r\nContent-Type: ${s.type||"application/octet-stream"}\r\n\r\n`,s,"\r\n");return r.push(`--${t}--`),new it(r,{type:"multipart/form-data; boundary="+t})}}function Nt(t,e,r){return s("Blob",e)?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new gt([e],r)),[String(t),e]):[String(t),String(e)]}function qt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Ct(t,e){for(let r=0;r<t.length;++r)e(t[r])}function jt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Pt=xt;const Ut=e.FormData||Lt;var Bt;const Ht=Symbol();class Mt{constructor(t){let e=t||"";r("URLSearchParams",e)&&(e=e.toString()),this[Ht]=new It,this[Ht][Ft]=function(t){let e={};if("object"==typeof t)if(Array.isArray(t))for(let r=0;r<t.length;++r){let s=t[r];if(!Array.isArray(s)||2!==s.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");kt(e,s[0],s[1])}else for(const r in t)t.hasOwnProperty(r)&&kt(e,r,t[r]);else{0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let t=0;t<r.length;++t){let s=r[t],n=s.indexOf("=");-1<n?kt(e,Xt(s.slice(0,n)),Xt(s.slice(n+1))):s&&kt(e,Xt(s),"")}}return e}(e)}get size(){return i(this[Ht][Ft]).reduce((t,e)=>t+e.length,0)}append(t,e){kt(this[Ht][Ft],t,e)}delete(t,e){let r={};for(let[s,n]of a(this[Ht][Ft]))if(s!==t)Object.assign(r,{[s]:n});else if(void 0!==e){let t=n.filter(t=>t!==""+e);t.length>0&&Object.assign(r,{[s]:t})}this[Ht][Ft]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ht][Ft][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ht][Ft][t].slice(0):[]}has(t,e){return!!$t(this[Ht][Ft],t)&&(void 0===e||this[Ht][Ft][t].indexOf(""+e)>-1)}set(t,e){this[Ht][Ft][t]=[""+e]}sort(){const t=this[Ht];let e=Object.keys(t[Ft]);e.sort();let r={};for(let s of e)Object.assign(r,{[s]:t[Ft][s]});t[Ft]=r}forEach(t,e){a(this[Ht][Ft]).forEach(([r,s])=>{s.forEach(s=>{t.call(e,s,r,this)})})}entries(){return a(this[Ht][Ft]).map(([t,e])=>e.map(e=>[t,e])).reduce(_t,[]).values()}keys(){return Object.keys(this[Ht][Ft]).values()}values(){return i(this[Ht][Ft]).reduce(_t,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[];for(let[e,r]of a(this[Ht][Ft])){let s=Gt(e);for(let e of r)t.push(s+"="+Gt(e))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(Mt,"URLSearchParams");const Ft=Symbol();class It{constructor(){this[Bt]={}}}function kt(t,e,r){let s="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$t(t,e)?t[e].push(s):t[e]=[s]}function Gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function Xt(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,t=>decodeURIComponent(t))}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){for(const r of e)t.push(r);return t}Bt=Ft;const zt=e.URLSearchParams||Mt;var Vt;const Jt=Symbol();class Yt extends F{static abort(t){const e=te();return Wt.call(e[Jt],t,!1),e}static any(t){const e=te(),r=t.find(t=>t.aborted);if(r)Wt.call(e[Jt],r.reason,!1);else{function s(r){for(const e of t)e.removeEventListener("abort",s);Wt.call(e[Jt],this.reason,!0,r.isTrusted)}for(const n of t)n.addEventListener("abort",s)}return e}static timeout(t){const e=te();return setTimeout(()=>{Wt.call(e[Jt],new n("signal timed out","TimeoutError"))},t),e}constructor(){if(new.target===Yt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[Jt]=new Qt(this)}get aborted(){return this[Jt].aborted}get reason(){return this[Jt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[Jt].onabort}set onabort(t){this[Jt].onabort=t,_.call(this,"abort",t,this[Jt][Kt].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}o(Yt,"AbortSignal");const Kt=Symbol();class Qt{constructor(t){this.aborted=!1,this.reason=void 0,this[Vt]=Zt.call(this),this.onabort=null,this.target=t}}function Wt(t,e=!0,r=!0){if(!this.aborted&&(this.aborted=!0,this.reason=null!=t?t:new n("signal is aborted without reason","AbortError"),e)){const t=U(this.target,"abort",void 0,r);G.call(this.target[M],t)}}function Zt(){return{onabort:t=>{z.call(this.target,this.onabort,t)}}}function te(){const t=Object.create(Yt.prototype);return t[M]=new k(t),t[Jt]=new Qt(t),t}Vt=Kt;const ee=e.AbortSignal||Yt,re=Symbol();class se{constructor(){this[re]=new ne}get signal(){return this[re].signal}abort(t){Wt.call(this[re].signal[Jt],t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(se,"AbortController");class ne{constructor(){this.signal=te()}}const oe=e.AbortController||se;var ie;const ae=Symbol();class le extends F{constructor(){if(new.target===le)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[ae]=new ce(this)}get onabort(){return this[ae].onabort}set onabort(t){this[ae].onabort=t,ue.call(this[ae],"abort")}get onerror(){return this[ae].onerror}set onerror(t){this[ae].onerror=t,ue.call(this[ae],"error")}get onload(){return this[ae].onload}set onload(t){this[ae].onload=t,ue.call(this[ae],"load")}get onloadend(){return this[ae].onloadend}set onloadend(t){this[ae].onloadend=t,ue.call(this[ae],"loadend")}get onloadstart(){return this[ae].onloadstart}set onloadstart(t){this[ae].onloadstart=t,ue.call(this[ae],"loadstart")}get onprogress(){return this[ae].onprogress}set onprogress(t){this[ae].onprogress=t,ue.call(this[ae],"progress")}get ontimeout(){return this[ae].ontimeout}set ontimeout(t){this[ae].ontimeout=t,ue.call(this[ae],"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(le,"XMLHttpRequestEventTarget");const he=Symbol();class ce{constructor(t){this[ie]=de.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.target=t}}function ue(t){const e="on"+t,r=this[e],s=this[he][e];_.call(this.target,t,r,s)}function de(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)},ontimeout:t=>{z.call(this.target,this.ontimeout,t)}}}ie=he;class fe extends le{constructor(){if(new.target===fe)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(fe,"XMLHttpRequestUpload");const ge=(()=>{let t,r="undefined",s="request",n="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[s])===n&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[s])===n&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[s])===n&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[s])===n&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[s])===n&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[s])===n&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[s])===n&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[s])===n&&qh||void 0,typeof e.XMLHttpRequest!==n)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[s])===n&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[s])===n&&Taro||void 0),t})(),ye=ge?ge.request:function(t){const e="NOT_SUPPORTED_ERR",r={errMsg:e,errno:9,exception:{retryCount:0,reasons:[{errMsg:e,errno:9}]},useHttpDNS:!1};throw Promise.resolve(r).then(e=>{try{t.fail&&t.fail(e)}catch(t){console.warn(t)}}).then(()=>{t.complete&&t.complete(r)}),new ReferenceError("request is not defined")};var pe,be,me,Ee,we,ve,Te,Se,Re,Ae;const Pe=Symbol();class Oe extends le{constructor(){super(),this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this[Pe]=new Me(this)}get readyState(){return this[Pe].readyState}get response(){return this[Pe].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[Pe].responseType}set responseType(t){this[Pe].responseType=t}get responseURL(){return this[Pe].responseURL}get responseXML(){return null}get status(){return this[Pe].status}get statusText(){return this.readyState===Oe.UNSENT||this.readyState===Oe.OPENED?"":this[Pe].statusText||(t=this.status,rr[t]||"unknown");var t}get timeout(){return this[Pe].timeout}set timeout(t){this[Pe].timeout=t}get upload(){return this[Pe].upload}get withCredentials(){return this[Pe].withCredentials}set withCredentials(t){this[Pe].withCredentials=t}abort(){Ge.call(this[Pe])}getAllResponseHeaders(){return this[Pe][Ue]?a(this[Pe][Ue]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[Pe][Ue])return null;const s=t.toLowerCase();return null!==(r=null===(e=a(this[Pe][Ue]||{}).find(t=>t[0].toLowerCase()===s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}open(...t){const[e,r,s=!0,n=null,o=null]=t,i=this[Pe];if(t.length<2)throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${t.length} present.`);if(s||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience."),Ge.call(i,!1),i[Ce]=Ye(e),i[qe]=String(r),null!==n||null!==o){const t=String(null!=n?n:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){const r=`Basic ${ht((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[xe]=!0,ze.call(i,Oe.OPENED)}overrideMimeType(t){this[Pe][xe]&&console.warn(`XMLHttpRequest.overrideMimeType(${t}) is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[Pe];if(!e[xe]||e.readyState!==Oe.OPENED)throw new n("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[xe]=!1;const r=-1===["GET","HEAD"].indexOf(e[Ce]),s=r&&-1===Object.keys(e[je]).map(t=>t.toLowerCase()).indexOf("content-type"),o=e.upload[M][I].length>0;let i=Object.assign({},e[je]),a=0,l=tr(t,s?t=>{Qe(i,"Content-Type",t)}:void 0,o?t=>{a=t}:void 0);if(e[He]=ye({url:e[qe],method:e[Ce],header:i,data:l,dataType:"json"===e.responseType?"json":Ke(e.responseType),responseType:Ke(e.responseType),success:Fe.bind(e),fail:Ie.bind(e),complete:ke.bind(e)}),st(this,"loadstart"),o){const t=r&&("string"==typeof l?l.length>0:l.byteLength>0);t&&st(e.upload,"loadstart",0,a),setTimeout(()=>{const r=e[xe]||e.readyState!==Oe.OPENED,s=r?0:a;r?st(e.upload,"abort"):t&&st(e.upload,"load",s,s),(r||t)&&st(e.upload,"loadend",s,s)})}Xe.call(e)}setRequestHeader(t,e){Qe(this[Pe][je],t,e)}get onreadystatechange(){return this[Pe].onreadystatechange}set onreadystatechange(t){this[Pe].onreadystatechange=t,_.call(this,"readystatechange",t,this[Pe][Le].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}Oe.UNSENT=0,Oe.OPENED=1,Oe.HEADERS_RECEIVED=2,Oe.LOADING=3,Oe.DONE=4,o(Oe,"XMLHttpRequest");const Le=Symbol(),xe=Symbol(),De=Symbol(),Ne=Symbol(),qe=Symbol(),Ce=Symbol(),je=Symbol(),Ue=Symbol(),Be=Symbol(),He=Symbol();class Me{constructor(t){this.readyState=Oe.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[pe]=Ve.call(this),this.onreadystatechange=null,this[be]=!1,this[me]=!1,this[Ee]=0,this[we]="",this[ve]="GET",this[Te]={Accept:"*/*"},this[Se]=null,this[Re]=0,this[Ae]=null,this.target=t,this.upload=function(){const t=Object.create(fe.prototype);return t[M]=new k(t),t[ae]=new ce(t),t}()}}function Fe({statusCode:t,header:e,data:r}){this.responseURL=this[qe],this.status=t,this[Ue]=e;const s=this.target.getResponseHeader("Content-Length");this[Be]=()=>s?parseInt(s):0,this.readyState===Oe.OPENED&&(ze.call(this,Oe.HEADERS_RECEIVED),ze.call(this,Oe.LOADING),setTimeout(()=>{if(!this[xe]){let t=this[Be];try{this.response=er(this.responseType,r),st(this.target,"load",t,t)}catch(t){console.error(t),st(this.target,"error")}}}))}function Ie(t){"status"in t?Fe.call(this,{statusCode:t.status,header:t.headers,data:t.data}):(this.status=0,this.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:"",this[xe]||this.readyState===Oe.UNSENT||this.readyState===Oe.DONE||(st(this.target,"error"),_e.call(this)))}function ke(){this[He]=null,this[xe]||this.readyState!==Oe.OPENED&&this.readyState!==Oe.LOADING||ze.call(this,Oe.DONE),setTimeout(()=>{if(!this[xe]){let t=this[Be];st(this.target,"loadend",t,t)}})}function Ge(t=!0){const e=t?setTimeout:t=>{t()};this[De]=!0,this[He]&&this.readyState!==Oe.DONE&&(t&&ze.call(this,Oe.DONE),e(()=>{const e=this[He];e&&e.abort(),t&&st(this.target,"abort"),t&&!e&&st(this.target,"loadend")})),e(()=>{this[De]&&(t&&(this.readyState=Oe.UNSENT),$e.call(this))})}function Xe(){this.timeout&&(this[Ne]=setTimeout(()=>{this.status||this.readyState===Oe.DONE||(this[He]&&this[He].abort(),ze.call(this,Oe.DONE),st(this.target,"timeout"))},this.timeout))}function $e(){this[De]=!1,_e.call(this),this.response="",this.responseURL="",this.status=0,this.statusText="",this[je]={},this[Ue]=null,this[Be]=0}function _e(){this[Ne]&&(clearTimeout(this[Ne]),this[Ne]=0)}function ze(t){const e=t!==this.readyState;if(this.readyState=t,e){const t=U(this.target,"readystatechange");G.call(this.target[M],t)}}function Ve(){return{onreadystatechange:t=>{z.call(this.target,this.onreadystatechange,t)}}}pe=Le,be=xe,me=De,Ee=Ne,we=qe,ve=Ce,Te=je,Se=Ue,Re=Be,Ae=He;const Je=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ye(t){let e=t.toUpperCase();return Je.indexOf(e)>-1?e:t}function Ke(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function Qe(t,e,r){const s=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===s)return void(t[e]=r);Object.assign(t,{[e]:r})}const We=t=>(new l).encode(t).buffer,Ze=t=>(new g).decode(t);function tr(t,e,n){let o;if("string"==typeof t)o=t,e&&e("text/plain;charset=UTF-8");else if(r("URLSearchParams",t))o=t.toString(),e&&e("application/x-www-form-urlencoded;charset=UTF-8");else if(t instanceof ArrayBuffer)o=t.slice(0);else if(ArrayBuffer.isView(t))o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);else if(s("Blob",t))o=t[ot][at].buffer.slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){const r=t[Ot].toBlob();o=r[ot][at].buffer,e&&e(r.type)}else o=t?String(t):"";return n&&n("string"==typeof o?()=>We(o).byteLength:o.byteLength),o}function er(t,e){let r=e?"string"==typeof e||e instanceof ArrayBuffer?e:JSON.stringify(e):"";return t&&"text"!==t?"json"===t?JSON.parse("string"==typeof r?r:Ze(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):We(r):"blob"===t?new it([r]):r:"string"==typeof r?r:Ze(r)}const rr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};const sr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||Oe;var nr,or;const ir=Symbol();class ar{constructor(){if(new.target===ar)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ir]=new cr}get body(){if(!this[ir][hr])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ir].bodyUsed}arrayBuffer(){const t="arrayBuffer";return gr.call(this[ir],t)||dr.call(this[ir],t)}blob(){const t="blob";return gr.call(this[ir],t)||dr.call(this[ir],t)}bytes(){const t="bytes";return gr.call(this[ir],t)||dr.call(this[ir],t)}formData(){const t="formData";return gr.call(this[ir],t)||dr.call(this[ir],t)}json(){const t="json";return gr.call(this[ir],t)||dr.call(this[ir],t)}text(){const t="text";return gr.call(this[ir],t)||dr.call(this[ir],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(ar,"Body");const lr=Symbol(),hr=Symbol();class cr{constructor(){this.bodyUsed=!1,this[nr]="Body",this[or]=""}}function ur(t,e){if(r("ReadableStream",t))throw new ReferenceError("ReadableStream is not defined");this[hr]=tr(t,t=>{e&&!e.get("Content-Type")&&e.set("Content-Type",t)})}function dr(t){return new Promise((e,r)=>{try{e(fr.call(this,t))}catch(t){r(t)}})}function fr(t){if("arrayBuffer"===t)return er("arraybuffer",this[hr]);if("blob"===t)return er("blob",this[hr]);if("bytes"===t){let t=er("arraybuffer",this[hr]);return new Uint8Array(t)}if("formData"===t){return function(t,e="Failed to fetch"){const r=new Lt;if("string"!=typeof t||""===t.trim())return r;const s=t.indexOf("\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(2,s).trim();if(!n)throw new TypeError("Invalid MIME type");const o=t.split(`--${n}`).filter(t=>{const e=t.trim();return""!==e&&"--"!==e});if(0===o.length)throw new TypeError(e);return o.forEach(t=>{const s=t.indexOf("\r\n\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(0,s).trim(),o=t.substring(s+4),i=n.match(/name="([^"]+)"/),a=n.match(/filename="([^"]*)"/),h=n.match(/Content-Type: ([^\r\n]+)/);if(!i||!i[1])throw new TypeError(e);const c=i[1],u=!!a,d=h?(h[1]||"").trim():"application/octet-stream";if(u)try{const t=o.replace(/\r\n/g,""),e=(new l).encode(t),s=a[1]||"unknown-file",n=new gt([e],s,{type:d});r.append(c,n,s)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(c,t)}}),r}(er("text",this[hr]))}return er("json"===t?"json":"text",this[hr])}function gr(t){if(this[hr])return this.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${t}' on '${this[lr]}': body stream already read`)):void(this.bodyUsed=!0)}var yr;nr=lr,or=hr;const pr=Symbol();class br{constructor(t){this[pr]=new Er,r("Headers",t)?t.forEach((t,e)=>{this.append(e,t)}):Array.isArray(t)?t.forEach(t=>{if(!Array.isArray(t))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");if(2!==t.length)throw new TypeError("Failed to construct 'Headers': Invalid value");this.append(t[0],t[1])}):t&&a(t).forEach(([t,e])=>{this.append(t,e)})}append(t,e){var r;let s=wr(t,"append");e=vr(e);let n=null===(r=this[pr][mr].get(s))||void 0===r?void 0:r[1];this[pr][mr].set(s,[""+t,n?`${n}, ${e}`:e])}delete(t){let e=wr(t,"delete");this[pr][mr].delete(e)}get(t){var e,r;let s=wr(t,"get");return null!==(r=null===(e=this[pr][mr].get(s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}getSetCookie(){let t=this.get("Set-Cookie");return t?t.split(", "):[]}has(t){let e=wr(t,"has");return this[pr][mr].has(e)}set(t,e){let r=wr(t,"set");this[pr][mr].set(r,[""+t,vr(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,s])=>{t.call(e,s,r,this)})}entries(){return this[pr][mr].values()}keys(){return Array.from(this.entries()).map(t=>t[0]).values()}values(){return Array.from(this.entries()).map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object Headers]"}get isPolyfill(){return{symbol:t,hierarchy:["Headers"]}}}o(br,"Headers");const mr=Symbol();class Er{constructor(){this[yr]=new Map}}function wr(t,e=""){if("string"!=typeof t&&(t=String(t)),(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)&&e)throw new TypeError(`Failed to execute '${e}' on 'Headers': Invalid name`);return t.toLowerCase()}function vr(t){return"string"!=typeof t&&(t=String(t)),t}function Tr(t){let e=new br;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substring(1,t.length):t}).forEach(function(t){let r=t.split(":"),s=r.shift().trim();if(s){let t=r.join(":").trim();try{e.append(s,t)}catch(t){console.warn("Response "+t.message)}}}),e}yr=mr;const Sr=e.Headers||br,Rr=Symbol();class Ar extends ar{constructor(t,e){super(),this[Rr]=new Pr;const r=this[Rr];this[ir][lr]="Request";let n=null!=e?e:{},o=n.body;if(s("Request",t)){if(t.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.credentials=t.credentials,n.headers||(r.headers=new br(t.headers)),r.method=t.method,r.mode=t.mode,r.signal=t.signal,r.url=t.url;let e=t;o||null===e[ir][hr]||(o=e[ir][hr],e[ir].bodyUsed=!0)}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new br(n.headers)),n.method&&(r.method=Ye(n.method)),n.mode&&(r.mode=n.mode),n.signal&&(r.signal=n.signal),("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");if(ur.call(this[ir],o,this.headers),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==n.cache&&"no-cache"!==n.cache)){let t=/([?&])_=[^&]*/;if(t.test(this.url))r.url=this.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;r.url+=(t.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}get cache(){return this[Rr].cache}get credentials(){return this[Rr].credentials}get destination(){return this[Rr].destination}get headers(){const t=this[Rr];return t.headers||(t.headers=new br),t.headers}get integrity(){return this[Rr].integrity}get keepalive(){return this[Rr].keepalive}get method(){return this[Rr].method}get mode(){return this[Rr].mode}get redirect(){return this[Rr].redirect}get referrer(){return this[Rr].referrer}get referrerPolicy(){return this[Rr].referrerPolicy}get signal(){const t=this[Rr];return t.signal||(t.signal=(new se).signal),t.signal}get url(){return this[Rr].url}clone(){var t;return new Ar(this,{body:null!==(t=this[ir][hr])&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request"]}}}o(Ar,"Request");class Pr{constructor(){this.cache="default",this.credentials="same-origin",this.destination="",this.integrity="",this.keepalive=!1,this.method="GET",this.mode="cors",this.redirect="follow",this.referrer="about:client",this.referrerPolicy="",this.url=""}}const Or=e.Request||Ar,Lr=Symbol();class xr extends ar{constructor(t,e){super(),this[Lr]=new Dr;const r=this[Lr];this[ir][lr]="Response";let s=null!=e?e:{},n=void 0===s.status?200:s.status;if(n<200||n>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+n}) is outside the range [200, 599].`);s.headers&&(r.headers=new br(s.headers)),r.ok=this.status>=200&&this.status<300,r.status=n,r.statusText=void 0===s.statusText?"":""+s.statusText,ur.call(this[ir],t,this.headers)}get headers(){const t=this[Lr];return t.headers||(t.headers=new br),t.headers}get ok(){return this[Lr].ok}get redirected(){return this[Lr].redirected}get status(){return this[Lr].status}get statusText(){return this[Lr].statusText}get type(){return this[Lr].type}get url(){return this[Lr].url}clone(){const t=new xr(this[ir][hr],{headers:new br(this.headers),status:this.status,statusText:this.statusText});return t[Lr].url=this.url,t}static json(t,e){return new Response(JSON.stringify(t),e)}static error(){const t=new xr(null,{status:200,statusText:""});return t[Lr].ok=!1,t[Lr].status=0,t[Lr].type="error",t}static redirect(t,e=301){if(-1===[301,302,303,307,308].indexOf(e))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new Response(null,{status:e,headers:{location:String(t)}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response"]}}}o(xr,"Response");class Dr{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const Nr=e.Response||xr;function qr(t,e){if(new.target===qr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){let i=new Ar(t,e);if(i.signal&&i.signal.aborted)return o(i.signal.reason);let l=new sr;if(l.onload=function(){let t={headers:l instanceof Oe?new br(l[Pe][Ue]||void 0):Tr(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};setTimeout(()=>{const e=new xr(l.response,t);e[Lr].url=l.responseURL,s(e)})},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},l.ontimeout=function(){setTimeout(function(){o(new n("request:fail timeout","TimeoutError"))})},l.onabort=function(){setTimeout(function(){o(new n("request:fail abort","AbortError"))})},l.open(i.method,i.url),"include"===i.credentials?l.withCredentials=!0:"omit"===i.credentials&&(l.withCredentials=!1),e&&("object"==typeof(h=e.headers)&&!r("Headers",h))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(wr(t)),l.setRequestHeader(t,vr(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(wr(e))&&l.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){l.setRequestHeader(e,t)});var h;if(i.signal){const t=()=>{l.abort()};i.signal.addEventListener("abort",t),l.onreadystatechange=function(){4===l.readyState&&i.signal.removeEventListener("abort",t)}}l.send(i[ir][hr])})}const Cr=e.fetch||qr;export{oe as AbortController,se as AbortControllerP,ee as AbortSignal,Yt as AbortSignalP,dt as Blob,it as BlobP,Q as CustomEvent,Y as CustomEventP,B as Event,O as EventP,V as EventTarget,F as EventTargetP,pt as File,gt as FileP,At as FileReader,Et as FileReaderP,Ut as FormData,Lt as FormDataP,Sr as Headers,br as HeadersP,nt as ProgressEvent,Z as ProgressEventP,Or as Request,Ar as RequestP,Nr as Response,xr as ResponseP,w as TextDecoder,g as TextDecoderP,c as TextEncoder,l as TextEncoderP,zt as URLSearchParams,Mt as URLSearchParamsP,sr as XMLHttpRequest,Oe as XMLHttpRequestP,Cr as fetch,qr as fetchP};
|
|
1
|
+
const t=Symbol("isPolyfill"),e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};function r(t,e){return Object.prototype.toString.call(e)===`[object ${t}]`}function s(e,r){return!!r&&"object"==typeof r&&"isPolyfill"in r&&!!r.isPolyfill&&"object"==typeof r.isPolyfill&&"symbol"in r.isPolyfill&&r.isPolyfill.symbol===t&&"hierarchy"in r.isPolyfill&&Array.isArray(r.isPolyfill.hierarchy)&&r.isPolyfill.hierarchy.indexOf(e)>-1}class n extends Error{constructor(t,e){super(),this.message=null!=t?t:this.message,this.name=null!=e?e:this.name}}function o(t,e){Object.defineProperty(t.prototype,Symbol.toStringTag,{configurable:!0,value:e})}function i(t){return Object.keys(t).map(e=>t[e])}function a(t){return Object.keys(t).map(e=>[e,t[e]])}class l{get encoding(){return"utf-8"}encode(t=""){return h(t).encoded}encodeInto(t,e){const r=h(t,e);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function h(t,e){const r=void 0!==e;let s=0,n=0,o=t.length,i=0,a=Math.max(32,o+(o>>1)+7),l=r?e:new Uint8Array(a>>3<<3);for(;s<o;){let e,h=t.charCodeAt(s++);if(h>=55296&&h<=56319)if(s<o){let e=t.charCodeAt(s);56320==(64512&e)?(++s,h=((1023&h)<<10)+(1023&e)+65536):h=65533}else h=65533;else h>=56320&&h<=57343&&(h=65533);if(!r&&i+4>l.length){a+=8,a*=1+s/t.length*2,a=a>>3<<3;let e=new Uint8Array(a);e.set(l),l=e}if(4294967168&h?4294965248&h?4294901760&h?4292870144&h?(h=65533,e=3):e=4:e=3:e=2:e=1,r&&i+e>l.length)break;1===e?l[i++]=h:2===e?(l[i++]=h>>6&31|192,l[i++]=63&h|128):3===e?(l[i++]=h>>12&15|224,l[i++]=h>>6&63|128,l[i++]=63&h|128):4===e&&(l[i++]=h>>18&7|240,l[i++]=h>>12&63|128,l[i++]=h>>6&63|128,l[i++]=63&h|128),n++}return{encoded:r?e.slice():l.slice(0,i),read:n,written:i}}o(l,"TextEncoder");const c=e.TextEncoder||l;var u,d;const f=Symbol();class g{constructor(t="utf-8",{fatal:e=!1,ignoreBOM:r=!1}={}){if(-1===m.indexOf(t.toLowerCase()))throw new RangeError("TextDecoder: The encoding label provided ('"+t+"') is invalid.");this[f]=new b,this[f].fatal=e,this[f].ignoreBOM=r}get encoding(){return"utf-8"}get fatal(){return this[f].fatal}get ignoreBOM(){return this[f].ignoreBOM}decode(t,{stream:e=!1}={}){const r=this[f];let s;if(void 0===t){if(r[p].length>0){if(this.fatal)throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");r[p]=[]}return""}if(s=t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t),!r[y]&&this.ignoreBOM&&s.length>=3&&239===s[0]&&187===s[1]&&191===s[2]&&(s=s.subarray(3),r[y]=!0),r[p].length>0){let t=new Uint8Array(r[p].length+s.length);t.set(r[p],0),t.set(s,r[p].length),s=t,r[p]=[]}let n=s.length,o=[];if(e&&s.length>0){let t=s.length;for(;t>0&&t>s.length-4;){let e=s[t-1];if(128!=(192&e)){E(e)>s.length-(t-1)&&(n=t-1);break}t--}r[p]=Array.from(s.slice(n)),s=s.slice(0,n)}let i=0;for(;i<n;){let t=s[i],e=null,r=E(t);if(i+r<=n){let n,o,a,l;switch(r){case 1:t<128&&(e=t);break;case 2:n=s[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(e=l));break;case 3:n=s[i+1],o=s[i+2],128==(192&n)&&128==(192&o)&&(l=(15&t)<<12|(63&n)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:n=s[i+1],o=s[i+2],a=s[i+3],128==(192&n)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&o)<<6|63&a,l>65535&&l<1114112&&(e=l))}}if(null===e){if(this.fatal)throw new TypeError("TextDecoder.decode: Decoding failed.");e=65533,r=1}else e>65535&&(e-=65536,o.push(e>>>10&1023|55296),e=56320|1023&e);o.push(e),i+=r}let a="";for(let t=0,e=o.length;t<e;t+=4096)a+=String.fromCharCode.apply(String,o.slice(t,t+4096));return a}toString(){return"[object TextDecoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextDecoder"]}}}o(g,"TextDecoder");const y=Symbol(),p=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[u]=!1,this[d]=[]}}u=y,d=p;const m=["utf-8","utf8","unicode-1-1-utf-8"];function E(t){return t>239?4:t>223?3:t>191?2:1}const w=e.TextDecoder||g;var v,T,S,R,A;const P=Symbol();class O{constructor(t,e){this.NONE=O.NONE,this.CAPTURING_PHASE=O.CAPTURING_PHASE,this.AT_TARGET=O.AT_TARGET,this.BUBBLING_PHASE=O.BUBBLING_PHASE,this[P]=new j;const r=this[P];r.type=String(t),r.bubbles=!!(null==e?void 0:e.bubbles),r.cancelable=!!(null==e?void 0:e.cancelable),r.composed=!!(null==e?void 0:e.composed)}get type(){return this[P].type}get bubbles(){return this[P].bubbles}get cancelable(){return this[P].cancelable}get composed(){return this[P].composed}get target(){return this[P].target}get currentTarget(){return this[P].currentTarget}get eventPhase(){return this[P].eventPhase}get srcElement(){return this[P].target}get cancelBubble(){return this[P].cancelBubble}set cancelBubble(t){this[P].cancelBubble=t}get defaultPrevented(){return this[P].defaultPrevented}get returnValue(){return this[P].returnValue}set returnValue(t){t||this.preventDefault()}get isTrusted(){return this[P][L]}get timeStamp(){return this[P].timeStamp}composedPath(){const t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const s=this[P];s[N]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[P];t[D]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[q]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[P][C]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}O.NONE=0,O.CAPTURING_PHASE=1,O.AT_TARGET=2,O.BUBBLING_PHASE=3,o(O,"Event");const x=Symbol(),L=Symbol(),D=Symbol(),N=Symbol(),q=Symbol(),C=Symbol();class j{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=O.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-j[x],this[v]=!1,this[T]=!1,this[S]=!1,this[R]=!1,this[A]=!1}}function U(t,e,r,s=!0){const n=new O(e,r);return n[P].target=t,n[P][L]=s,n}v=L,T=D,S=N,R=q,A=C,j[x]=(new Date).getTime();const B=e.EventTarget?e.Event:O;var H;const M=Symbol();class F{constructor(){this[M]=new k(this)}addEventListener(t,e,r){const s=this[M],n=new $(t,e);if(n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),!s[I].some(t=>t.equals(n))){if("object"==typeof r){const{once:t,passive:e,signal:o}=r;n.options.once=!!t,n.options.passive=!!e,o&&(n.options.signal=o,X.call(s,o,n))}s[I].push(n);const t=t=>t.options.capture?0:1;s[I]=s[I].sort((e,r)=>t(e)-t(r))}}dispatchEvent(t){if("object"!=typeof t)throw new TypeError("EventTarget.dispatchEvent: Argument 1 is not an object.");if(!(t instanceof O))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");const e=t[P];return e.target=this,e[L]=!1,G.call(this[M],t)}removeEventListener(t,e,r){const s=this[M],n=new $(t,e);n.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),s[I].some(t=>t.equals(n))&&(s[I]=s[I].filter(t=>!t.equals(n)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}o(F,"EventTarget");const I=Symbol();class k{constructor(t){this[H]=[],this.target=t}}function G(t){const e=t[P];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=O.AT_TARGET,e[N]=!0;const r=[];for(let s=0;s<this[I].length;++s){const n=this[I][s];if(n.type!==t.type)continue;e[D]=!!n.options.passive,n.options.once&&r.push(s);const{callback:o}=n;try{"function"==typeof o&&o.call(this.target,t)}catch(t){console.error(t)}if(e[D]=!1,e[C])break}return r.length>0&&(this[I]=this[I].reduce((t,e,s)=>(-1===r.indexOf(s)&&t.push(e),t),[])),e.currentTarget=null,e.eventPhase=O.NONE,e[N]=!1,!(t.cancelable&&e[q])}function X(t,e){const r=()=>{this[I]=this[I].filter(t=>!t.equals(e)),t.removeEventListener("abort",r)};try{t.addEventListener("abort",r)}catch(t){console.error(t)}}H=I;class ${constructor(t,e){var r;this.options={},this.type=String(t),this.callback="function"==typeof(r=e)?r:function(t){return!!t&&"handleEvent"in t&&"function"==typeof t.handleEvent}(r)?r.handleEvent:r}equals(t){return Object.is(this.type,t.type)&&Object.is(this.callback,t.callback)&&Object.is(this.options.capture,t.options.capture)}}function _(t,e,r){"function"==typeof e?this.addEventListener(t,r):this.removeEventListener(t,r)}function z(t,e){"function"==typeof t&&t.call(this,e)}const V=e.EventTarget||F,J=Symbol();class Y extends O{constructor(t,e){var r;super(t,e),this[J]=new K,this[J].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[J].detail}initCustomEvent(t,e,r,s){this[P][N]||(this.initEvent(t,e,r),this[J].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(Y,"CustomEvent");class K{}const Q=e.EventTarget?e.CustomEvent:Y,W=Symbol();class Z extends O{constructor(t,e){var r,s;super(t,e),this[W]=new et;const n=this[W];n.lengthComputable=!!(null==e?void 0:e.lengthComputable),n.loaded=null!==(r=null==e?void 0:e.loaded)&&void 0!==r?r:0,n.total=null!==(s=null==e?void 0:e.total)&&void 0!==s?s:0}get lengthComputable(){return rt(this[W].lengthComputable)}get loaded(){return rt(this[W].loaded)}get total(){return rt(this[W].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(Z,"ProgressEvent");class et{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function rt(t){return"function"==typeof t?t():t}function st(t,e,r=0,s=0){const n=function(t,e,{lengthComputable:r=!1,loaded:s=0,total:n=0}={}){const o=new Z(e);return o[W].lengthComputable=r,o[W].loaded=s,o[W].total=n,o[P].target=t,o[P][L]=!0,o}(t,e,{lengthComputable:()=>rt(s)>0,loaded:r,total:s});G.call(t[M],n)}const nt=e.EventTarget?e.ProgressEvent:Z,ot=Symbol();class it{constructor(t=[],e){if(!Array.isArray(t))throw new TypeError("First argument to Blob constructor must be an Array.");let r=null,n=t.reduce((t,e)=>(s("Blob",e)?t.push(e[ot][at]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(ct(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[ot]=new lt(function(t){const e=t.reduce((t,e)=>t+e.byteLength,0),r=new Uint8Array(e);return t.reduce((t,e)=>(r.set(e,t),t+e.byteLength),0),r}(n));const o=this[ot];o.size=o[at].length;const i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[ot].size}get type(){return this[ot].type}arrayBuffer(){return Promise.resolve(ut(this[ot][at].buffer).buffer)}bytes(){return Promise.resolve(ut(this[ot][at].buffer))}slice(t,e,r){const s=this[ot][at].slice(null!=t?t:0,null!=e?e:this[ot][at].length);return new it([s],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){const t=new g;return Promise.resolve(t.decode(this[ot][at]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(it,"Blob");const at=Symbol();class lt{constructor(t){this.size=0,this.type="",this[at]=t}}function ht(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var s=0;s<t.length;s+=3){let n=t[s],o=s+1<t.length,i=o?t[s+1]:0,a=s+2<t.length,l=a?t[s+2]:0,h=n>>2,c=(3&n)<<4|i>>4,u=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(u=64)),r.push(e[h],e[c],e[u],e[d])}return r.join("")}function ct(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function ut(t){const e=ct(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}const dt=e.Blob||it,ft=Symbol();class gt extends it{constructor(t,e,r){super(t,r),this[ft]=new yt,this[ft].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[ft].name=e.replace(/\//g,":")}get lastModified(){return this[ft].lastModified}get name(){return this[ft].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(gt,"File");class yt{constructor(){this.lastModified=0,this.name=""}}const pt=e.Blob?e.File:gt;var bt;const mt=Symbol();class Et extends F{constructor(){super(),this.EMPTY=0,this.LOADING=1,this.DONE=2,this[mt]=new vt(this)}get readyState(){return this[mt].readyState}get result(){return this[mt].result}get error(){return this[mt].error}abort(){this.readyState===Et.LOADING&&(this[mt].readyState=Et.DONE,this[mt].result=null,st(this,"abort"))}readAsArrayBuffer(t){Tt.call(this[mt],"readAsArrayBuffer",t,()=>{this[mt].result=t[ot][at].buffer.slice(0)})}readAsBinaryString(t){Tt.call(this[mt],"readAsBinaryString",t,()=>{this[mt].result=t[ot][at].reduce((t,e)=>t+=String.fromCharCode(e),"")})}readAsDataURL(t){Tt.call(this[mt],"readAsDataURL",t,()=>{this[mt].result="data:"+t.type+";base64,"+ht(t[ot][at])})}readAsText(t,e){Tt.call(this[mt],"readAsText",t,()=>{this[mt].result=new g(e).decode(t[ot][at])})}get onabort(){return this[mt].onabort}set onabort(t){this[mt].onabort=t,St.call(this[mt],"abort")}get onerror(){return this[mt].onerror}set onerror(t){this[mt].onerror=t,St.call(this[mt],"error")}get onload(){return this[mt].onload}set onload(t){this[mt].onload=t,St.call(this[mt],"load")}get onloadend(){return this[mt].onloadend}set onloadend(t){this[mt].onloadend=t,St.call(this[mt],"loadend")}get onloadstart(){return this[mt].onloadstart}set onloadstart(t){this[mt].onloadstart=t,St.call(this[mt],"loadstart")}get onprogress(){return this[mt].onprogress}set onprogress(t){this[mt].onprogress=t,St.call(this[mt],"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}Et.EMPTY=0,Et.LOADING=1,Et.DONE=2,o(Et,"FileReader");const wt=Symbol();class vt{constructor(t){this.readyState=Et.EMPTY,this.result=null,this.error=null,this[bt]=Rt.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function Tt(t,e,r){if(!s("Blob",e))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");this.error=null,this.readyState=Et.LOADING,st(this.target,"loadstart",0,e.size),setTimeout(()=>{if(this.readyState===Et.LOADING){this.readyState=Et.DONE;try{r(),st(this.target,"load",e.size,e.size)}catch(t){this.result=null,this.error=t,st(this.target,"error",0,e.size)}}st(this.target,"loadend",this.result?e.size:0,e.size)})}function St(t){const e="on"+t,r=this[e],s=this[wt][e];_.call(this.target,t,r,s)}function Rt(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)}}}bt=wt;const At=e.Blob?e.FileReader:Et;var Pt;const Ot=Symbol();class xt{constructor(t,e){if(void 0!==t)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type\t'HTMLFormElement'.");if(e)throw new TypeError("Failed to construct 'FormData': parameter 2 is not of type 'HTMLElement'.");this[Ot]=new Dt}append(t,e,r){this[Ot][Lt].push(Nt(t,e,r))}delete(t){const e=[];t=String(t),Ct(this[Ot][Lt],r=>{r[0]!==t&&e.push(r)}),this[Ot][Lt]=e}get(t){const e=this[Ot][Lt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){const e=[];return t=String(t),Ct(this[Ot][Lt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[Ot][Lt].length;++e)if(this[Ot][Lt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);const s=[],n=Nt(t,e,r);let o=!0;Ct(this[Ot][Lt],e=>{e[0]===t?o&&(o=!s.push(n)):s.push(e)}),o&&s.push(n),this[Ot][Lt]=s}forEach(t,e){for(const[r,s]of this)t.call(e,s,r,e)}entries(){return this[Ot][Lt].values()}keys(){return this[Ot][Lt].map(t=>t[0]).values()}values(){return this[Ot][Lt].map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}o(xt,"FormData");const Lt=Symbol();class Dt{constructor(){this[Pt]=[]}toBlob(){const t="----formdata-polyfill-"+Math.random(),e=`--${t}\r\nContent-Disposition: form-data; name="`;let r=[];for(const[t,s]of this[Lt].values())"string"==typeof s?r.push(e+jt(qt(t))+`"\r\n\r\n${qt(s)}\r\n`):r.push(e+jt(qt(t))+`"; filename="${jt(s.name)}"\r\nContent-Type: ${s.type||"application/octet-stream"}\r\n\r\n`,s,"\r\n");return r.push(`--${t}--`),new it(r,{type:"multipart/form-data; boundary="+t})}}function Nt(t,e,r){return s("Blob",e)?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new gt([e],r)),[String(t),e]):[String(t),String(e)]}function qt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Ct(t,e){for(let r=0;r<t.length;++r)e(t[r])}function jt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Pt=Lt;const Ut=e.FormData||xt;var Bt;const Ht=Symbol();class Mt{constructor(t){let e=t||"";r("URLSearchParams",e)&&(e=e.toString()),this[Ht]=new It,this[Ht][Ft]=function(t){let e={};if("object"==typeof t)if(Array.isArray(t))for(let r=0;r<t.length;++r){let s=t[r];if(!Array.isArray(s)||2!==s.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");kt(e,s[0],s[1])}else for(const r in t)t.hasOwnProperty(r)&&kt(e,r,t[r]);else{0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let t=0;t<r.length;++t){let s=r[t],n=s.indexOf("=");-1<n?kt(e,Xt(s.slice(0,n)),Xt(s.slice(n+1))):s&&kt(e,Xt(s),"")}}return e}(e)}get size(){return i(this[Ht][Ft]).reduce((t,e)=>t+e.length,0)}append(t,e){kt(this[Ht][Ft],t,e)}delete(t,e){let r={};for(let[s,n]of a(this[Ht][Ft]))if(s!==t)Object.assign(r,{[s]:n});else if(void 0!==e){let t=n.filter(t=>t!==""+e);t.length>0&&Object.assign(r,{[s]:t})}this[Ht][Ft]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ht][Ft][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ht][Ft][t].slice(0):[]}has(t,e){return!!$t(this[Ht][Ft],t)&&(void 0===e||this[Ht][Ft][t].indexOf(""+e)>-1)}set(t,e){this[Ht][Ft][t]=[""+e]}sort(){const t=this[Ht];let e=Object.keys(t[Ft]);e.sort();let r={};for(let s of e)Object.assign(r,{[s]:t[Ft][s]});t[Ft]=r}forEach(t,e){a(this[Ht][Ft]).forEach(([r,s])=>{s.forEach(s=>{t.call(e,s,r,this)})})}entries(){return a(this[Ht][Ft]).map(([t,e])=>e.map(e=>[t,e])).reduce(_t,[]).values()}keys(){return Object.keys(this[Ht][Ft]).values()}values(){return i(this[Ht][Ft]).reduce(_t,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[];for(let[e,r]of a(this[Ht][Ft])){let s=Gt(e);for(let e of r)t.push(s+"="+Gt(e))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(Mt,"URLSearchParams");const Ft=Symbol();class It{constructor(){this[Bt]={}}}function kt(t,e,r){let s="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$t(t,e)?t[e].push(s):t[e]=[s]}function Gt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function Xt(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,t=>decodeURIComponent(t))}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){for(const r of e)t.push(r);return t}Bt=Ft;const zt=e.URLSearchParams||Mt;var Vt;const Jt=Symbol();class Yt extends F{static abort(t){const e=te();return Wt.call(e[Jt],t,!1),e}static any(t){const e=te(),r=t.find(t=>t.aborted);if(r)Wt.call(e[Jt],r.reason,!1);else{function s(r){for(const e of t)e.removeEventListener("abort",s);Wt.call(e[Jt],this.reason,!0,r.isTrusted)}for(const n of t)n.addEventListener("abort",s)}return e}static timeout(t){const e=te();return setTimeout(()=>{Wt.call(e[Jt],new n("signal timed out","TimeoutError"))},t),e}constructor(){if(new.target===Yt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[Jt]=new Qt(this)}get aborted(){return this[Jt].aborted}get reason(){return this[Jt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[Jt].onabort}set onabort(t){this[Jt].onabort=t,_.call(this,"abort",t,this[Jt][Kt].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}o(Yt,"AbortSignal");const Kt=Symbol();class Qt{constructor(t){this.aborted=!1,this.reason=void 0,this[Vt]=Zt.call(this),this.onabort=null,this.target=t}}function Wt(t,e=!0,r=!0){if(!this.aborted&&(this.aborted=!0,this.reason=null!=t?t:new n("signal is aborted without reason","AbortError"),e)){const t=U(this.target,"abort",void 0,r);G.call(this.target[M],t)}}function Zt(){return{onabort:t=>{z.call(this.target,this.onabort,t)}}}function te(){const t=Object.create(Yt.prototype);return t[M]=new k(t),t[Jt]=new Qt(t),t}Vt=Kt;const ee=e.AbortSignal||Yt,re=Symbol();class se{constructor(){this[re]=new ne}get signal(){return this[re].signal}abort(t){Wt.call(this[re].signal[Jt],t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(se,"AbortController");class ne{constructor(){this.signal=te()}}const oe=e.AbortController||se;var ie;const ae=Symbol();class le extends F{constructor(){if(new.target===le)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[ae]=new ce(this)}get onabort(){return this[ae].onabort}set onabort(t){this[ae].onabort=t,ue.call(this[ae],"abort")}get onerror(){return this[ae].onerror}set onerror(t){this[ae].onerror=t,ue.call(this[ae],"error")}get onload(){return this[ae].onload}set onload(t){this[ae].onload=t,ue.call(this[ae],"load")}get onloadend(){return this[ae].onloadend}set onloadend(t){this[ae].onloadend=t,ue.call(this[ae],"loadend")}get onloadstart(){return this[ae].onloadstart}set onloadstart(t){this[ae].onloadstart=t,ue.call(this[ae],"loadstart")}get onprogress(){return this[ae].onprogress}set onprogress(t){this[ae].onprogress=t,ue.call(this[ae],"progress")}get ontimeout(){return this[ae].ontimeout}set ontimeout(t){this[ae].ontimeout=t,ue.call(this[ae],"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(le,"XMLHttpRequestEventTarget");const he=Symbol();class ce{constructor(t){this[ie]=de.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.target=t}}function ue(t){const e="on"+t,r=this[e],s=this[he][e];_.call(this.target,t,r,s)}function de(){return{onabort:t=>{z.call(this.target,this.onabort,t)},onerror:t=>{z.call(this.target,this.onerror,t)},onload:t=>{z.call(this.target,this.onload,t)},onloadend:t=>{z.call(this.target,this.onloadend,t)},onloadstart:t=>{z.call(this.target,this.onloadstart,t)},onprogress:t=>{z.call(this.target,this.onprogress,t)},ontimeout:t=>{z.call(this.target,this.ontimeout,t)}}}ie=he;class fe extends le{constructor(){if(new.target===fe)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(fe,"XMLHttpRequestUpload");const ge=(()=>{let t,r="undefined",s="request",n="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[s])===n&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[s])===n&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[s])===n&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[s])===n&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[s])===n&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[s])===n&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[s])===n&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[s])===n&&qh||typeof xhs!==r&&typeof(null===xhs||void 0===xhs?void 0:xhs[s])===n&&xhs||void 0,typeof e.XMLHttpRequest!==n)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[s])===n&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[s])===n&&Taro||void 0),t})(),ye=ge?ge.request:function(t){const e="NOT_SUPPORTED_ERR",r={errMsg:e,errno:9,exception:{retryCount:0,reasons:[{errMsg:e,errno:9}]},useHttpDNS:!1};throw Promise.resolve(r).then(e=>{try{t.fail&&t.fail(e)}catch(t){console.warn(t)}}).then(()=>{t.complete&&t.complete(r)}),new ReferenceError("request is not defined")};var pe,be,me,Ee,we,ve,Te,Se,Re,Ae;const Pe=Symbol();class Oe extends le{constructor(){super(),this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this[Pe]=new Me(this)}get readyState(){return this[Pe].readyState}get response(){return this[Pe].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[Pe].responseType}set responseType(t){this[Pe].responseType=t}get responseURL(){return this[Pe].responseURL}get responseXML(){return null}get status(){return this[Pe].status}get statusText(){return this.readyState===Oe.UNSENT||this.readyState===Oe.OPENED?"":this[Pe].statusText||(t=this.status,rr[t]||"unknown");var t}get timeout(){return this[Pe].timeout}set timeout(t){this[Pe].timeout=t}get upload(){return this[Pe].upload}get withCredentials(){return this[Pe].withCredentials}set withCredentials(t){this[Pe].withCredentials=t}abort(){Ge.call(this[Pe])}getAllResponseHeaders(){return this[Pe][Ue]?a(this[Pe][Ue]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[Pe][Ue])return null;const s=t.toLowerCase();return null!==(r=null===(e=a(this[Pe][Ue]||{}).find(t=>t[0].toLowerCase()===s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}open(...t){const[e,r,s=!0,n=null,o=null]=t,i=this[Pe];if(t.length<2)throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${t.length} present.`);if(s||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience."),Ge.call(i,!1),i[Ce]=Ye(e),i[qe]=String(r),null!==n||null!==o){const t=String(null!=n?n:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){const r=`Basic ${ht((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[Le]=!0,ze.call(i,Oe.OPENED)}overrideMimeType(t){this[Pe][Le]&&console.warn(`XMLHttpRequest.overrideMimeType(${t}) is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[Pe];if(!e[Le]||e.readyState!==Oe.OPENED)throw new n("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[Le]=!1;const r=-1===["GET","HEAD"].indexOf(e[Ce]),s=r&&-1===Object.keys(e[je]).map(t=>t.toLowerCase()).indexOf("content-type"),o=e.upload[M][I].length>0;let i=Object.assign({},e[je]),a=0,l=tr(t,s?t=>{Qe(i,"Content-Type",t)}:void 0,o?t=>{a=t}:void 0);if(e[He]=ye({url:e[qe],method:e[Ce],header:i,data:l,dataType:"json"===e.responseType?"json":Ke(e.responseType),responseType:Ke(e.responseType),success:Fe.bind(e),fail:Ie.bind(e),complete:ke.bind(e)}),st(this,"loadstart"),o){const t=r&&("string"==typeof l?l.length>0:l.byteLength>0);t&&st(e.upload,"loadstart",0,a),setTimeout(()=>{const r=e[Le]||e.readyState!==Oe.OPENED,s=r?0:a;r?st(e.upload,"abort"):t&&st(e.upload,"load",s,s),(r||t)&&st(e.upload,"loadend",s,s)})}Xe.call(e)}setRequestHeader(t,e){Qe(this[Pe][je],t,e)}get onreadystatechange(){return this[Pe].onreadystatechange}set onreadystatechange(t){this[Pe].onreadystatechange=t,_.call(this,"readystatechange",t,this[Pe][xe].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}Oe.UNSENT=0,Oe.OPENED=1,Oe.HEADERS_RECEIVED=2,Oe.LOADING=3,Oe.DONE=4,o(Oe,"XMLHttpRequest");const xe=Symbol(),Le=Symbol(),De=Symbol(),Ne=Symbol(),qe=Symbol(),Ce=Symbol(),je=Symbol(),Ue=Symbol(),Be=Symbol(),He=Symbol();class Me{constructor(t){this.readyState=Oe.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[pe]=Ve.call(this),this.onreadystatechange=null,this[be]=!1,this[me]=!1,this[Ee]=0,this[we]="",this[ve]="GET",this[Te]={Accept:"*/*"},this[Se]=null,this[Re]=0,this[Ae]=null,this.target=t,this.upload=function(){const t=Object.create(fe.prototype);return t[M]=new k(t),t[ae]=new ce(t),t}()}}function Fe({statusCode:t,header:e,data:r}){this.responseURL=this[qe],this.status=t,this[Ue]=e;const s=this.target.getResponseHeader("Content-Length");this[Be]=()=>s?parseInt(s):0,this.readyState===Oe.OPENED&&(ze.call(this,Oe.HEADERS_RECEIVED),ze.call(this,Oe.LOADING),setTimeout(()=>{if(!this[Le]){let t=this[Be];try{this.response=er(this.responseType,r),st(this.target,"load",t,t)}catch(t){console.error(t),st(this.target,"error")}}}))}function Ie(t){"status"in t?Fe.call(this,{statusCode:t.status,header:t.headers,data:t.data}):(this.status=0,this.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:"",this[Le]||this.readyState===Oe.UNSENT||this.readyState===Oe.DONE||(st(this.target,"error"),_e.call(this)))}function ke(){this[He]=null,this[Le]||this.readyState!==Oe.OPENED&&this.readyState!==Oe.LOADING||ze.call(this,Oe.DONE),setTimeout(()=>{if(!this[Le]){let t=this[Be];st(this.target,"loadend",t,t)}})}function Ge(t=!0){const e=t?setTimeout:t=>{t()};this[De]=!0,this[He]&&this.readyState!==Oe.DONE&&(t&&ze.call(this,Oe.DONE),e(()=>{const e=this[He];e&&e.abort(),t&&st(this.target,"abort"),t&&!e&&st(this.target,"loadend")})),e(()=>{this[De]&&(t&&(this.readyState=Oe.UNSENT),$e.call(this))})}function Xe(){this.timeout&&(this[Ne]=setTimeout(()=>{this.status||this.readyState===Oe.DONE||(this[He]&&this[He].abort(),ze.call(this,Oe.DONE),st(this.target,"timeout"))},this.timeout))}function $e(){this[De]=!1,_e.call(this),this.response="",this.responseURL="",this.status=0,this.statusText="",this[je]={},this[Ue]=null,this[Be]=0}function _e(){this[Ne]&&(clearTimeout(this[Ne]),this[Ne]=0)}function ze(t){const e=t!==this.readyState;if(this.readyState=t,e){const t=U(this.target,"readystatechange");G.call(this.target[M],t)}}function Ve(){return{onreadystatechange:t=>{z.call(this.target,this.onreadystatechange,t)}}}pe=xe,be=Le,me=De,Ee=Ne,we=qe,ve=Ce,Te=je,Se=Ue,Re=Be,Ae=He;const Je=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ye(t){let e=t.toUpperCase();return Je.indexOf(e)>-1?e:t}function Ke(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function Qe(t,e,r){const s=e.toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase()===s)return void(t[e]=r);Object.assign(t,{[e]:r})}const We=t=>(new l).encode(t).buffer,Ze=t=>(new g).decode(t);function tr(t,e,n){let o;if("string"==typeof t)o=t,e&&e("text/plain;charset=UTF-8");else if(r("URLSearchParams",t))o=t.toString(),e&&e("application/x-www-form-urlencoded;charset=UTF-8");else if(t instanceof ArrayBuffer)o=t.slice(0);else if(ArrayBuffer.isView(t))o=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);else if(s("Blob",t))o=t[ot][at].buffer.slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){const r=t[Ot].toBlob();o=r[ot][at].buffer,e&&e(r.type)}else o=t?String(t):"";return n&&n("string"==typeof o?()=>We(o).byteLength:o.byteLength),o}function er(t,e){let r=e?"string"==typeof e||e instanceof ArrayBuffer?e:JSON.stringify(e):"";return t&&"text"!==t?"json"===t?JSON.parse("string"==typeof r?r:Ze(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):We(r):"blob"===t?new it([r]):r:"string"==typeof r?r:Ze(r)}const rr={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};const sr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||Oe;var nr,or;const ir=Symbol();class ar{constructor(){if(new.target===ar)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ir]=new cr}get body(){if(!this[ir][hr])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ir].bodyUsed}arrayBuffer(){const t="arrayBuffer";return gr.call(this[ir],t)||dr.call(this[ir],t)}blob(){const t="blob";return gr.call(this[ir],t)||dr.call(this[ir],t)}bytes(){const t="bytes";return gr.call(this[ir],t)||dr.call(this[ir],t)}formData(){const t="formData";return gr.call(this[ir],t)||dr.call(this[ir],t)}json(){const t="json";return gr.call(this[ir],t)||dr.call(this[ir],t)}text(){const t="text";return gr.call(this[ir],t)||dr.call(this[ir],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(ar,"Body");const lr=Symbol(),hr=Symbol();class cr{constructor(){this.bodyUsed=!1,this[nr]="Body",this[or]=""}}function ur(t,e){if(r("ReadableStream",t))throw new ReferenceError("ReadableStream is not defined");this[hr]=tr(t,t=>{e&&!e.get("Content-Type")&&e.set("Content-Type",t)})}function dr(t){return new Promise((e,r)=>{try{e(fr.call(this,t))}catch(t){r(t)}})}function fr(t){if("arrayBuffer"===t)return er("arraybuffer",this[hr]);if("blob"===t)return er("blob",this[hr]);if("bytes"===t){let t=er("arraybuffer",this[hr]);return new Uint8Array(t)}if("formData"===t){return function(t,e="Failed to fetch"){const r=new xt;if("string"!=typeof t||""===t.trim())return r;const s=t.indexOf("\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(2,s).trim();if(!n)throw new TypeError("Invalid MIME type");const o=t.split(`--${n}`).filter(t=>{const e=t.trim();return""!==e&&"--"!==e});if(0===o.length)throw new TypeError(e);return o.forEach(t=>{const s=t.indexOf("\r\n\r\n");if(-1===s)throw new TypeError(e);const n=t.substring(0,s).trim(),o=t.substring(s+4),i=n.match(/name="([^"]+)"/),a=n.match(/filename="([^"]*)"/),h=n.match(/Content-Type: ([^\r\n]+)/);if(!i||!i[1])throw new TypeError(e);const c=i[1],u=!!a,d=h?(h[1]||"").trim():"application/octet-stream";if(u)try{const t=o.replace(/\r\n/g,""),e=(new l).encode(t),s=a[1]||"unknown-file",n=new gt([e],s,{type:d});r.append(c,n,s)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(c,t)}}),r}(er("text",this[hr]))}return er("json"===t?"json":"text",this[hr])}function gr(t){if(this[hr])return this.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${t}' on '${this[lr]}': body stream already read`)):void(this.bodyUsed=!0)}var yr;nr=lr,or=hr;const pr=Symbol();class br{constructor(t){this[pr]=new Er,r("Headers",t)?t.forEach((t,e)=>{this.append(e,t)}):Array.isArray(t)?t.forEach(t=>{if(!Array.isArray(t))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");if(2!==t.length)throw new TypeError("Failed to construct 'Headers': Invalid value");this.append(t[0],t[1])}):t&&a(t).forEach(([t,e])=>{this.append(t,e)})}append(t,e){var r;let s=wr(t,"append");e=vr(e);let n=null===(r=this[pr][mr].get(s))||void 0===r?void 0:r[1];this[pr][mr].set(s,[""+t,n?`${n}, ${e}`:e])}delete(t){let e=wr(t,"delete");this[pr][mr].delete(e)}get(t){var e,r;let s=wr(t,"get");return null!==(r=null===(e=this[pr][mr].get(s))||void 0===e?void 0:e[1])&&void 0!==r?r:null}getSetCookie(){let t=this.get("Set-Cookie");return t?t.split(", "):[]}has(t){let e=wr(t,"has");return this[pr][mr].has(e)}set(t,e){let r=wr(t,"set");this[pr][mr].set(r,[""+t,vr(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,s])=>{t.call(e,s,r,this)})}entries(){return this[pr][mr].values()}keys(){return Array.from(this.entries()).map(t=>t[0]).values()}values(){return Array.from(this.entries()).map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object Headers]"}get isPolyfill(){return{symbol:t,hierarchy:["Headers"]}}}o(br,"Headers");const mr=Symbol();class Er{constructor(){this[yr]=new Map}}function wr(t,e=""){if("string"!=typeof t&&(t=String(t)),(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)&&e)throw new TypeError(`Failed to execute '${e}' on 'Headers': Invalid name`);return t.toLowerCase()}function vr(t){return"string"!=typeof t&&(t=String(t)),t}function Tr(t){let e=new br;return t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substring(1,t.length):t}).forEach(function(t){let r=t.split(":"),s=r.shift().trim();if(s){let t=r.join(":").trim();try{e.append(s,t)}catch(t){console.warn("Response "+t.message)}}}),e}yr=mr;const Sr=e.Headers||br,Rr=Symbol();class Ar extends ar{constructor(t,e){super(),this[Rr]=new Pr;const r=this[Rr];this[ir][lr]="Request";let n=null!=e?e:{},o=n.body;if(s("Request",t)){if(t.bodyUsed)throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");r.credentials=t.credentials,n.headers||(r.headers=new br(t.headers)),r.method=t.method,r.mode=t.mode,r.signal=t.signal,r.url=t.url;let e=t;o||null===e[ir][hr]||(o=e[ir][hr],e[ir].bodyUsed=!0)}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new br(n.headers)),n.method&&(r.method=Ye(n.method)),n.mode&&(r.mode=n.mode),n.signal&&(r.signal=n.signal),("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");if(ur.call(this[ir],o,this.headers),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==n.cache&&"no-cache"!==n.cache)){let t=/([?&])_=[^&]*/;if(t.test(this.url))r.url=this.url.replace(t,"$1_="+(new Date).getTime());else{let t=/\?/;r.url+=(t.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}get cache(){return this[Rr].cache}get credentials(){return this[Rr].credentials}get destination(){return this[Rr].destination}get headers(){const t=this[Rr];return t.headers||(t.headers=new br),t.headers}get integrity(){return this[Rr].integrity}get keepalive(){return this[Rr].keepalive}get method(){return this[Rr].method}get mode(){return this[Rr].mode}get redirect(){return this[Rr].redirect}get referrer(){return this[Rr].referrer}get referrerPolicy(){return this[Rr].referrerPolicy}get signal(){const t=this[Rr];return t.signal||(t.signal=(new se).signal),t.signal}get url(){return this[Rr].url}clone(){var t;return new Ar(this,{body:null!==(t=this[ir][hr])&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request"]}}}o(Ar,"Request");class Pr{constructor(){this.cache="default",this.credentials="same-origin",this.destination="",this.integrity="",this.keepalive=!1,this.method="GET",this.mode="cors",this.redirect="follow",this.referrer="about:client",this.referrerPolicy="",this.url=""}}const Or=e.Request||Ar,xr=Symbol();class Lr extends ar{constructor(t,e){super(),this[xr]=new Dr;const r=this[xr];this[ir][lr]="Response";let s=null!=e?e:{},n=void 0===s.status?200:s.status;if(n<200||n>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+n}) is outside the range [200, 599].`);s.headers&&(r.headers=new br(s.headers)),r.ok=this.status>=200&&this.status<300,r.status=n,r.statusText=void 0===s.statusText?"":""+s.statusText,ur.call(this[ir],t,this.headers)}get headers(){const t=this[xr];return t.headers||(t.headers=new br),t.headers}get ok(){return this[xr].ok}get redirected(){return this[xr].redirected}get status(){return this[xr].status}get statusText(){return this[xr].statusText}get type(){return this[xr].type}get url(){return this[xr].url}clone(){const t=new Lr(this[ir][hr],{headers:new br(this.headers),status:this.status,statusText:this.statusText});return t[xr].url=this.url,t}static json(t,e){return new Response(JSON.stringify(t),e)}static error(){const t=new Lr(null,{status:200,statusText:""});return t[xr].ok=!1,t[xr].status=0,t[xr].type="error",t}static redirect(t,e=301){if(-1===[301,302,303,307,308].indexOf(e))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new Response(null,{status:e,headers:{location:String(t)}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response"]}}}o(Lr,"Response");class Dr{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const Nr=e.Response||Lr;function qr(t,e){if(new.target===qr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){let i=new Ar(t,e);if(i.signal&&i.signal.aborted)return o(i.signal.reason);let l=new sr;if(l.onload=function(){let t={headers:l instanceof Oe?new br(l[Pe][Ue]||void 0):Tr(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};setTimeout(()=>{const e=new Lr(l.response,t);e[xr].url=l.responseURL,s(e)})},l.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},l.ontimeout=function(){setTimeout(function(){o(new n("request:fail timeout","TimeoutError"))})},l.onabort=function(){setTimeout(function(){o(new n("request:fail abort","AbortError"))})},l.open(i.method,i.url),"include"===i.credentials?l.withCredentials=!0:"omit"===i.credentials&&(l.withCredentials=!1),e&&("object"==typeof(h=e.headers)&&!r("Headers",h))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(wr(t)),l.setRequestHeader(t,vr(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(wr(e))&&l.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){l.setRequestHeader(e,t)});var h;if(i.signal){const t=()=>{l.abort()};i.signal.addEventListener("abort",t),l.onreadystatechange=function(){4===l.readyState&&i.signal.removeEventListener("abort",t)}}l.send(i[ir][hr])})}const Cr=e.fetch||qr;export{oe as AbortController,se as AbortControllerP,ee as AbortSignal,Yt as AbortSignalP,dt as Blob,it as BlobP,Q as CustomEvent,Y as CustomEventP,B as Event,O as EventP,V as EventTarget,F as EventTargetP,pt as File,gt as FileP,At as FileReader,Et as FileReaderP,Ut as FormData,xt as FormDataP,Sr as Headers,br as HeadersP,nt as ProgressEvent,Z as ProgressEventP,Or as Request,Ar as RequestP,Nr as Response,Lr as ResponseP,w as TextDecoder,g as TextDecoderP,c as TextEncoder,l as TextEncoderP,zt as URLSearchParams,Mt as URLSearchParamsP,sr as XMLHttpRequest,Oe as XMLHttpRequestP,Cr as fetch,qr as fetchP};
|
|
@@ -13,10 +13,10 @@ export declare class FileReaderP extends EventTargetP implements FileReader {
|
|
|
13
13
|
readonly DONE = 2;
|
|
14
14
|
get error(): DOMException | null;
|
|
15
15
|
abort(): void;
|
|
16
|
-
readAsArrayBuffer
|
|
17
|
-
readAsBinaryString
|
|
18
|
-
readAsDataURL
|
|
19
|
-
readAsText
|
|
16
|
+
readAsArrayBuffer(blob: Blob): void;
|
|
17
|
+
readAsBinaryString(blob: Blob): void;
|
|
18
|
+
readAsDataURL(blob: Blob): void;
|
|
19
|
+
readAsText(blob: Blob, encoding?: string): void;
|
|
20
20
|
get onabort(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|
|
21
21
|
set onabort(value: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null);
|
|
22
22
|
get onerror(): ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null;
|