mphttpx 1.0.5 → 1.0.7
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 +658 -21
- package/dist/index.cjs.js +1382 -1203
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.d.ts +545 -198
- package/dist/index.esm.js +1381 -1204
- package/dist/index.esm.min.js +1 -1
- package/package.json +2 -1
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){let 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 u=e.TextEncoder||l;var c,d;const f=Symbol();class p{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[g]&&this.ignoreBOM&&s.length>=3&&239===s[0]&&187===s[1]&&191===s[2]&&(s=s.subarray(3),r[g]=!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)){v(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=v(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(p,"TextDecoder");const g=Symbol(),y=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[c]=!1,this[d]=[]}}c=g,d=y;const m=["utf-8","utf8","unicode-1-1-utf-8"];function v(t){return t>239?4:t>223?3:t>191?2:1}const w=e.TextDecoder||p;var E,T,S,x,P;const R=Symbol();class A{constructor(t,e){this[R]=new U;const r=this[R];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),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return this[R][q]}.bind(this)})}get type(){return this[R].type}get bubbles(){return this[R].bubbles}get cancelable(){return this[R].cancelable}get composed(){return this[R].composed}get target(){return this[R].target}get currentTarget(){return this[R].currentTarget}get eventPhase(){return this[R].eventPhase}get srcElement(){return this[R].target}get cancelBubble(){return this[R].cancelBubble}set cancelBubble(t){this[R].cancelBubble=t}get defaultPrevented(){return this[R].defaultPrevented}get returnValue(){return this[R].returnValue}set returnValue(t){t||this.preventDefault()}get timeStamp(){return this[R].timeStamp}composedPath(){let t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const s=this[R];s[C]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[R];t[j]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[D]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[R][B]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}const O={NONE:{value:0,enumerable:!0},CAPTURING_PHASE:{value:1,enumerable:!0},AT_TARGET:{value:2,enumerable:!0},BUBBLING_PHASE:{value:3,enumerable:!0}};Object.defineProperties(A,O),Object.defineProperties(A.prototype,O),o(A,"Event");const L=Symbol(),q=Symbol(),j=Symbol(),C=Symbol(),D=Symbol(),B=Symbol();class U{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()-U[L],this[E]=!1,this[T]=!1,this[S]=!1,this[x]=!1,this[P]=!1}}function N(t,e,r,s=!0){let n=new A(e,r);return n[R].target=t,n[R][q]=s,n}E=q,T=j,S=C,x=D,P=B,U[L]=(new Date).getTime();const M=e.EventTarget?e.Event:A;var H;const F=Symbol();class k{constructor(){this[F]=new X(this)}addEventListener(t,e,r){const s=this[F],n=new z(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,$.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.");return t[R].target=this,Object.defineProperty(t[R],q,{value:!1,configurable:!0,enumerable:!0,writable:!0}),G.call(this[F],t)}removeEventListener(t,e,r){const s=this[F],n=new z(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(k,"EventTarget");const I=Symbol();class X{constructor(t){this[H]=[],this.target=t}}function G(t){const e=t[R];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=A.AT_TARGET,e[C]=!0;let r=[];for(let s=0;s<this[I].length;++s){let n=this[I][s];if(n.type!==t.type)continue;e[j]=!!n.options.passive,n.options.once&&r.push(s);let{callback:o}=n;try{"function"==typeof o&&o.call(this.target,t)}catch(t){console.error(t)}if(e[j]=!1,e[B])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[C]=!1,!(t.cancelable&&e[D])}function $(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 z{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 V(t,e,r){"function"==typeof e?this.addEventListener(t,r):this.removeEventListener(t,r)}function _(t,e){"function"==typeof t&&t.call(this,e)}const J=e.EventTarget||k,Y=Symbol();class K extends A{constructor(t,e){var r;super(t,e),this[Y]=new Q,this[Y].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[Y].detail}initCustomEvent(t,e,r,s){this[R][C]||(this.initEvent(t,e,r),this[Y].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(K,"CustomEvent");class Q{}const W=e.EventTarget?e.CustomEvent:K,Z=Symbol();class et extends A{constructor(t,e){var r,s;super(t,e),this[Z]=new rt;const n=this[Z];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 st(this[Z].lengthComputable)}get loaded(){return st(this[Z].loaded)}get total(){return st(this[Z].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(et,"ProgressEvent");class rt{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function st(t){return"function"==typeof t?t():t}function nt(t,e,r=0,s=0){let n=function(t,e,{lengthComputable:r=!1,loaded:s=0,total:n=0}={}){let o=new et(e);return o[Z].lengthComputable=r,o[Z].loaded=s,o[Z].total=n,o[R].target=t,o[R][q]=!0,o}(t,e,{lengthComputable:()=>st(s)>0,loaded:r,total:s});G.call(t[F],n)}const ot=e.EventTarget?e.ProgressEvent:et,it=Symbol();class at{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[it][lt]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(ct(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[it]=new ht(function(t){let 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[it];o.size=o[lt].length;let i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[it].size}get type(){return this[it].type}arrayBuffer(){return Promise.resolve(dt(this[it][lt].buffer).buffer)}bytes(){return Promise.resolve(dt(this[it][lt].buffer))}slice(t,e,r){let s=this[it][lt].slice(null!=t?t:0,null!=e?e:this[it][lt].length);return new at([s],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){let t=new p;return Promise.resolve(t.decode(this[it][lt]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(at,"Blob");const lt=Symbol();class ht{constructor(t){this.size=0,this.type="",this[lt]=t}toUint8Array(){return this[lt]}toArrayBuffer(){return this[lt].buffer}}function ut(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,u=(3&n)<<4|i>>4,c=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(c=64)),r.push(e[h],e[u],e[c],e[d])}return r.join("")}function ct(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function dt(t){let e=ct(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}const ft=e.Blob||at,pt=Symbol();class gt extends at{constructor(t,e,r){super(t,r),this[pt]=new yt,this[pt].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[pt].name=e.replace(/\//g,":")}get lastModified(){return this[pt].lastModified}get name(){return this[pt].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 bt=e.Blob?e.File:gt;var mt;const vt=Symbol();class wt extends k{constructor(){super(),this[vt]=new St(this)}get readyState(){return this[vt].readyState}get result(){return this[vt].result}get error(){return this[vt].error}abort(){this.readyState===wt.LOADING&&(this[vt].readyState=wt.DONE,this[vt].result=null,nt(this,"abort"))}readAsArrayBuffer(t){xt.call(this[vt],"readAsArrayBuffer",t,()=>{this[vt].result=t[it].toArrayBuffer().slice(0)})}readAsBinaryString(t){xt.call(this[vt],"readAsBinaryString",t,()=>{this[vt].result=t[it].toUint8Array().reduce((t,e)=>t+=String.fromCharCode(e),"")})}readAsDataURL(t){xt.call(this[vt],"readAsDataURL",t,()=>{this[vt].result="data:"+t.type+";base64,"+ut(t[it].toUint8Array())})}readAsText(t,e){xt.call(this[vt],"readAsText",t,()=>{this[vt].result=new p(e).decode(t[it].toUint8Array())})}get onabort(){return this[vt].onabort}set onabort(t){this[vt].onabort=t,Pt.call(this[vt],"abort")}get onerror(){return this[vt].onerror}set onerror(t){this[vt].onerror=t,Pt.call(this[vt],"error")}get onload(){return this[vt].onload}set onload(t){this[vt].onload=t,Pt.call(this[vt],"load")}get onloadend(){return this[vt].onloadend}set onloadend(t){this[vt].onloadend=t,Pt.call(this[vt],"loadend")}get onloadstart(){return this[vt].onloadstart}set onloadstart(t){this[vt].onloadstart=t,Pt.call(this[vt],"loadstart")}get onprogress(){return this[vt].onprogress}set onprogress(t){this[vt].onprogress=t,Pt.call(this[vt],"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}const Et={EMPTY:{value:0,enumerable:!0},LOADING:{value:1,enumerable:!0},DONE:{value:2,enumerable:!0}};Object.defineProperties(wt,Et),Object.defineProperties(wt.prototype,Et),o(wt,"FileReader");const Tt=Symbol();class St{constructor(t){this.readyState=wt.EMPTY,this.result=null,this.error=null,this[mt]=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 xt(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=wt.LOADING,nt(this.target,"loadstart",0,e.size),setTimeout(()=>{if(this.readyState===wt.LOADING){this.readyState=wt.DONE;try{r(),nt(this.target,"load",e.size,e.size)}catch(t){this.result=null,this.error=t,nt(this.target,"error",0,e.size)}}nt(this.target,"loadend",this.result?e.size:0,e.size)})}function Pt(t){const e="on"+t,r=this[e],s=this[Tt][e];V.call(this.target,t,r,s)}function Rt(){return{onabort:t=>{_.call(this.target,this.onabort,t)},onerror:t=>{_.call(this.target,this.onerror,t)},onload:t=>{_.call(this.target,this.onload,t)},onloadend:t=>{_.call(this.target,this.onloadend,t)},onloadstart:t=>{_.call(this.target,this.onloadstart,t)},onprogress:t=>{_.call(this.target,this.onprogress,t)}}}mt=Tt;const At=e.Blob?e.FileReader:wt;var Ot;const Lt=Symbol();class qt{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[Lt]=new Ct}append(t,e,r){this[Lt][jt].push(Dt(t,e,r))}delete(t){let e=[];t=String(t),Ut(this[Lt][jt],r=>{r[0]!==t&&e.push(r)}),this[Lt][jt]=e}get(t){let e=this[Lt][jt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){let e=[];return t=String(t),Ut(this[Lt][jt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[Lt][jt].length;++e)if(this[Lt][jt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);let s=[],n=Dt(t,e,r),o=!0;Ut(this[Lt][jt],e=>{e[0]===t?o&&(o=!s.push(n)):s.push(e)}),o&&s.push(n),this[Lt][jt]=s}forEach(t,e){for(let[r,s]of this)t.call(e,s,r,e)}entries(){return this[Lt][jt].values()}keys(){return this[Lt][jt].map(t=>t[0]).values()}values(){return this[Lt][jt].map(t=>t[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}o(qt,"FormData");const jt=Symbol();class Ct{constructor(){this[Ot]=[]}toBlob(){const t="----formdata-polyfill-"+Math.random(),e=`--${t}\r\nContent-Disposition: form-data; name="`;let r=[];for(const[t,s]of this[jt].values())"string"==typeof s?r.push(e+Nt(Bt(t))+`"\r\n\r\n${Bt(s)}\r\n`):r.push(e+Nt(Bt(t))+`"; filename="${Nt(s.name)}"\r\nContent-Type: ${s.type||"application/octet-stream"}\r\n\r\n`,s,"\r\n");return r.push(`--${t}--`),new at(r,{type:"multipart/form-data; boundary="+t})}}function Dt(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 Bt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Ut(t,e){for(let r=0;r<t.length;++r)e(t[r])}function Nt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Ot=jt;const Mt=e.FormData||qt;var Ht;const Ft=Symbol();class kt{constructor(t){let e=t||"";r("URLSearchParams",e)&&(e=e.toString()),this[Ft]=new Xt,this[Ft][It]=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");Gt(e,s[0],s[1])}else for(let r in t)t.hasOwnProperty(r)&&Gt(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?Gt(e,zt(s.slice(0,n)),zt(s.slice(n+1))):s&&Gt(e,zt(s),"")}}return e}(e)}get size(){return i(this[Ft][It]).reduce((t,e)=>t+e.length,0)}append(t,e){Gt(this[Ft][It],t,e)}delete(t,e){let r={};for(let[s,n]of a(this[Ft][It]))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[Ft][It]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ft][It][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ft][It][t].slice(0):[]}has(t,e){return!!Vt(this[Ft][It],t)&&(void 0===e||this[Ft][It][t].indexOf(""+e)>-1)}set(t,e){this[Ft][It][t]=[""+e]}sort(){const t=this[Ft];let e=Object.keys(t[It]);e.sort();let r={};for(let s of e)Object.assign(r,{[s]:t[It][s]});t[It]=r}forEach(t,e){a(this[Ft][It]).forEach(([r,s])=>{s.forEach(s=>{t.call(e,s,r,this)})})}entries(){return a(this[Ft][It]).map(([t,e])=>e.map(e=>[t,e])).reduce(_t,[]).values()}keys(){return Object.keys(this[Ft][It]).values()}values(){return i(this[Ft][It]).reduce(_t,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[];for(let[e,r]of a(this[Ft][It])){let s=$t(e);for(let e of r)t.push(s+"="+$t(e))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(kt,"URLSearchParams");const It=Symbol();class Xt{constructor(){this[Ht]={}}}function Gt(t,e,r){let s="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);Vt(t,e)?t[e].push(s):t[e]=[s]}function $t(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function zt(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,t=>decodeURIComponent(t))}function Vt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _t(t,e){for(let r of e)t.push(r);return t}Ht=It;const Jt=e.URLSearchParams||kt;var Yt;const Kt=Symbol();class Qt extends k{static abort(t){let e=re();return te.call(e[Kt],t,!1),e}static any(t){let e=re(),r=t.find(t=>t.aborted);if(r)te.call(e[Kt],r.reason,!1);else{function s(r){for(let e of t)e.removeEventListener("abort",s);te.call(e[Kt],this.reason,!0,r.isTrusted)}for(let n of t)n.addEventListener("abort",s)}return e}static timeout(t){let e=re();return setTimeout(()=>{te.call(e[Kt],new n("signal timed out","TimeoutError"))},t),e}constructor(){if(new.target===Qt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[Kt]=new Zt(this)}get aborted(){return this[Kt].aborted}get reason(){return this[Kt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[Kt].onabort}set onabort(t){this[Kt].onabort=t,V.call(this,"abort",t,this[Kt][Wt].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}o(Qt,"AbortSignal");const Wt=Symbol();class Zt{constructor(t){this.aborted=!1,this.reason=void 0,this[Yt]=ee.call(this),this.onabort=null,this.target=t}}function te(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)){let t=N(this.target,"abort",void 0,r);G.call(this.target[F],t)}}function ee(){return{onabort:t=>{_.call(this.target,this.onabort,t)}}}function re(){let t=Object.create(Qt.prototype);return t[F]=new X(t),t[Kt]=new Zt(t),t}Yt=Wt;const se=e.AbortSignal||Qt,ne=Symbol();class oe{constructor(){this[ne]=new ie}get signal(){return this[ne].signal}abort(t){te.call(this[ne].signal[Kt],t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(oe,"AbortController");class ie{constructor(){this.signal=re()}}const ae=e.AbortController||oe;var le;const he=Symbol();class ue extends k{constructor(){if(new.target===ue)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[he]=new de(this)}get onabort(){return this[he].onabort}set onabort(t){this[he].onabort=t,fe.call(this[he],"abort")}get onerror(){return this[he].onerror}set onerror(t){this[he].onerror=t,fe.call(this[he],"error")}get onload(){return this[he].onload}set onload(t){this[he].onload=t,fe.call(this[he],"load")}get onloadend(){return this[he].onloadend}set onloadend(t){this[he].onloadend=t,fe.call(this[he],"loadend")}get onloadstart(){return this[he].onloadstart}set onloadstart(t){this[he].onloadstart=t,fe.call(this[he],"loadstart")}get onprogress(){return this[he].onprogress}set onprogress(t){this[he].onprogress=t,fe.call(this[he],"progress")}get ontimeout(){return this[he].ontimeout}set ontimeout(t){this[he].ontimeout=t,fe.call(this[he],"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(ue,"XMLHttpRequestEventTarget");const ce=Symbol();class de{constructor(t){this[le]=pe.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 fe(t){const e="on"+t,r=this[e],s=this[ce][e];V.call(this.target,t,r,s)}function pe(){return{onabort:t=>{_.call(this.target,this.onabort,t)},onerror:t=>{_.call(this.target,this.onerror,t)},onload:t=>{_.call(this.target,this.onload,t)},onloadend:t=>{_.call(this.target,this.onloadend,t)},onloadstart:t=>{_.call(this.target,this.onloadstart,t)},onprogress:t=>{_.call(this.target,this.onprogress,t)},ontimeout:t=>{_.call(this.target,this.ontimeout,t)}}}le=ce;class ge extends ue{constructor(){if(new.target===ge)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(ge,"XMLHttpRequestUpload");const ye=(()=>{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})(),be=ye?ye.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 me,ve,we,Ee,Te,Se,xe,Pe,Re,Ae;const Oe=Symbol();class Le extends ue{constructor(){super(),this[Oe]=new Ie(this)}get readyState(){return this[Oe].readyState}get response(){return this[Oe].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[Oe].responseType}set responseType(t){this[Oe].responseType=t}get responseURL(){return this[Oe].responseURL}get responseXML(){return null}get status(){return this[Oe].status}get statusText(){return this.readyState===Le.UNSENT||this.readyState===Le.OPENED?"":this[Oe].statusText||(t=this.status,ir[t]||"unknown");var t}get timeout(){return this[Oe].timeout}set timeout(t){this[Oe].timeout=t}get upload(){const t=this[Oe];return t.upload||(t.upload=function(){let t=Object.create(ge.prototype);return t[F]=new X(t),t[he]=new de(t),t}()),t.upload}get withCredentials(){return this[Oe].withCredentials}set withCredentials(t){this[Oe].withCredentials=t}abort(){ze.call(this[Oe])}getAllResponseHeaders(){return this[Oe][He]?a(this[Oe][He]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[Oe][He])return null;let s=t.toLowerCase();return null!==(r=null===(e=a(this[Oe][He]||{}).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[Oe];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."),ze.call(i,!1),i[Ne]=We(e),i[Ue]=String(r),null!==n||null!==o){let t=String(null!=n?n:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){let r=`Basic ${ut((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[Ce]=!0,Ye.call(i,Le.OPENED)}overrideMimeType(t){this[Oe][Ce]&&console.warn(`XMLHttpRequest.overrideMimeType('${t}') is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[Oe];if(!e[Ce]||e.readyState!==Le.OPENED)throw new n("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[Ce]=!1;const r="GET"!==e[Ne]&&"HEAD"!==e[Ne],s=r&&-1===Object.keys(e[Me]).map(t=>t.toLowerCase()).indexOf("content-type"),o=e.upload,i=o&&o[F][I].length>0;let a=s?Object.assign({},e[Me]):e[Me],l=or,h=sr(t,s?t=>{tr(a,"Content-Type",t)}:void 0,i?t=>{l=t}:void 0),u={url:e[Ue],method:e[Ne],header:a,data:h,dataType:"json"===e.responseType?"json":Ze(e.responseType),responseType:Ze(e.responseType),success:Xe.bind(e),fail:Ge.bind(e),complete:$e.bind(e)};if(e.withCredentials&&(u.withCredentials=!0,u.enableCookie=!0),e[ke]=be(u),nt(this,"loadstart"),i){const t=r&&("string"==typeof h?h.length>0:h.byteLength>0);t&&nt(o,"loadstart",0,l),setTimeout(()=>{const r=e[Ce]||e.readyState!==Le.OPENED,s=r?0:l;r?nt(o,"abort"):t&&nt(o,"load",s,s),(r||t)&&nt(o,"loadend",s,s)})}Ve.call(e)}setRequestHeader(t,e){tr(this[Oe][Me],t,e)}get onreadystatechange(){return this[Oe].onreadystatechange}set onreadystatechange(t){this[Oe].onreadystatechange=t,V.call(this,"readystatechange",t,this[Oe][je].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}const qe={UNSENT:{value:0,enumerable:!0},OPENED:{value:1,enumerable:!0},HEADERS_RECEIVED:{value:2,enumerable:!0},LOADING:{value:3,enumerable:!0},DONE:{value:4,enumerable:!0}};Object.defineProperties(Le,qe),Object.defineProperties(Le.prototype,qe),o(Le,"XMLHttpRequest");const je=Symbol(),Ce=Symbol(),De=Symbol(),Be=Symbol(),Ue=Symbol(),Ne=Symbol(),Me=Symbol(),He=Symbol(),Fe=Symbol(),ke=Symbol();class Ie{constructor(t){this.readyState=Le.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[me]=Ke.call(this),this.onreadystatechange=null,this[ve]=!1,this[we]=!1,this[Ee]=0,this[Te]="",this[Se]="GET",this[xe]={Accept:"*/*"},this[Pe]=null,this[Re]=or,this[Ae]=null,this.target=t}}function Xe({statusCode:t,header:e,data:r}){this.responseURL=this[Ue],this.status=t,this[He]=e;let s=this.target.getResponseHeader("Content-Length");this[Fe]=()=>s?parseInt(s):0,this.readyState===Le.OPENED&&(Ye.call(this,Le.HEADERS_RECEIVED),Ye.call(this,Le.LOADING),setTimeout(()=>{if(!this[Ce]){let t=this[Fe];try{this.response=nr(this.responseType,r),nt(this.target,"load",t,t)}catch(t){console.error(t),nt(this.target,"error")}}}))}function Ge(t){"status"in t?Xe.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[Ce]||this.readyState===Le.UNSENT||this.readyState===Le.DONE||(nt(this.target,"error"),Je.call(this)))}function $e(){this[ke]=null,this[Ce]||this.readyState!==Le.OPENED&&this.readyState!==Le.LOADING||Ye.call(this,Le.DONE),setTimeout(()=>{if(!this[Ce]){let t=this[Fe];nt(this.target,"loadend",t,t)}})}function ze(t=!0){const e=t?setTimeout:t=>{t()};this[De]=!0,this[ke]&&this.readyState!==Le.DONE&&(t&&Ye.call(this,Le.DONE),e(()=>{const e=this[ke];e&&e.abort(),t&&nt(this.target,"abort"),t&&!e&&nt(this.target,"loadend")})),e(()=>{this[De]&&(t&&(this.readyState=Le.UNSENT),_e.call(this))})}function Ve(){this.timeout&&(this[Be]=setTimeout(()=>{this.status||this.readyState===Le.DONE||(this[ke]&&this[ke].abort(),Ye.call(this,Le.DONE),nt(this.target,"timeout"))},this.timeout))}function _e(){this[De]=!1,Je.call(this),this.response="",this.responseURL="",this.status=0,this.statusText="",this[Me]={},this[He]=null,this[Fe]=or}function Je(){this[Be]&&(clearTimeout(this[Be]),this[Be]=0)}function Ye(t){let e=t!==this.readyState;if(this.readyState=t,e){let t=N(this.target,"readystatechange");G.call(this.target[F],t)}}function Ke(){return{onreadystatechange:t=>{_.call(this.target,this.onreadystatechange,t)}}}me=je,ve=Ce,we=De,Ee=Be,Te=Ue,Se=Ne,xe=Me,Pe=He,Re=Fe,Ae=ke;const Qe=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function We(t){let e=t.toUpperCase();return Qe.indexOf(e)>-1?e:t}function Ze(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function tr(t,e,r){let s=e.toLowerCase();for(let e of Object.keys(t))if(e.toLowerCase()===s)return void(t[e]=r);Object.assign(t,{[e]:r})}const er=t=>(new l).encode(t).buffer,rr=t=>(new p).decode(t);function sr(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[it].toArrayBuffer().slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){let r=t[Lt].toBlob();o=r[it].toArrayBuffer(),e&&e(r.type)}else o=t?String(t):"";return n&&n(()=>("string"==typeof o?er(o):o).byteLength),o}function nr(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:rr(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):er(r):"blob"===t?new at([r]):r:"string"==typeof r?r:rr(r)}const or=()=>0,ir={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 ar="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||Le;var lr,hr;const ur=Symbol();class cr{constructor(){if(new.target===cr)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ur]=new pr}get body(){if(!this[ur][fr])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ur].bodyUsed}arrayBuffer(){const t="arrayBuffer";return mr.call(this[ur],t)||yr.call(this[ur],t)}blob(){const t="blob";return mr.call(this[ur],t)||yr.call(this[ur],t)}bytes(){const t="bytes";return mr.call(this[ur],t)||yr.call(this[ur],t)}formData(){const t="formData";return mr.call(this[ur],t)||yr.call(this[ur],t)}json(){const t="json";return mr.call(this[ur],t)||yr.call(this[ur],t)}text(){const t="text";return mr.call(this[ur],t)||yr.call(this[ur],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(cr,"Body");const dr=Symbol(),fr=Symbol();class pr{constructor(){this.bodyUsed=!1,this[lr]="Body",this[hr]=""}}function gr(t,e){if(r("ReadableStream",t))throw new ReferenceError("ReadableStream is not defined");this[fr]=sr(t,t=>{e&&!e.get("Content-Type")&&e.set("Content-Type",t)})}function yr(t){return new Promise((e,r)=>{try{e(br.call(this,t))}catch(t){r(t)}})}function br(t){if("arrayBuffer"===t)return nr("arraybuffer",this[fr]);if("blob"===t)return nr("blob",this[fr]);if("bytes"===t){let t=nr("arraybuffer",this[fr]);return new Uint8Array(t)}if("formData"===t){return function(t,e="Failed to fetch"){const r=new qt;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 u=i[1],c=!!a,d=h?(h[1]||"").trim():"application/octet-stream";if(c)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(u,n,s)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(u,t)}}),r}(nr("text",this[fr]))}return nr("json"===t?"json":"text",this[fr])}function mr(t){if(this[fr])return this.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${t}' on '${this[dr]}': body stream already read`)):void(this.bodyUsed=!0)}var vr;lr=dr,hr=fr;const wr=Symbol();class Er{constructor(t){this[wr]=new Sr,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=xr(t,"append");e=Pr(e);let n=null===(r=this[wr][Tr].get(s))||void 0===r?void 0:r[1];this[wr][Tr].set(s,[""+t,n?`${n}, ${e}`:e])}delete(t){let e=xr(t,"delete");this[wr][Tr].delete(e)}get(t){var e,r;let s=xr(t,"get");return null!==(r=null===(e=this[wr][Tr].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=xr(t,"has");return this[wr][Tr].has(e)}set(t,e){let r=xr(t,"set");this[wr][Tr].set(r,[""+t,Pr(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,s])=>{t.call(e,s,r,this)})}entries(){return this[wr][Tr].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(Er,"Headers");const Tr=Symbol();class Sr{constructor(){this[vr]=new Map}}function xr(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 Pr(t){return"string"!=typeof t&&(t=String(t)),t}function Rr(t){let e=new Er;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}vr=Tr;const Ar=e.Headers||Er,Or=Symbol();class Lr extends cr{constructor(t,e){super(),this[Or]=new qr;const r=this[Or];this[ur][dr]="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 Er(t.headers)),r.method=t.method,r.mode=t.mode;let e=t[Or].signal;e&&(r.signal=e),r.url=t.url;let s=t;o||null===s[ur][fr]||(o=s[ur][fr],s[ur].bodyUsed=!0)}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new Er(n.headers)),n.method&&(r.method=We(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(gr.call(this[ur],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[Or].cache}get credentials(){return this[Or].credentials}get destination(){return this[Or].destination}get headers(){const t=this[Or];return t.headers||(t.headers=new Er),t.headers}get integrity(){return this[Or].integrity}get keepalive(){return this[Or].keepalive}get method(){return this[Or].method}get mode(){return this[Or].mode}get redirect(){return this[Or].redirect}get referrer(){return this[Or].referrer}get referrerPolicy(){return this[Or].referrerPolicy}get signal(){const t=this[Or];return t.signal||(t.signal=(new oe).signal),t.signal}get url(){return this[Or].url}clone(){var t;return new Lr(this,{body:null!==(t=this[ur][fr])&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request","Body"]}}}o(Lr,"Request");class qr{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 jr=e.Request||Lr,Cr=Symbol();class Dr extends cr{constructor(t,e){super(),this[Cr]=new Br;const r=this[Cr];this[ur][dr]="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 Er(s.headers)),r.ok=this.status>=200&&this.status<300,r.status=n,r.statusText=void 0===s.statusText?"":""+s.statusText,gr.call(this[ur],t,this.headers)}get headers(){const t=this[Cr];return t.headers||(t.headers=new Er),t.headers}get ok(){return this[Cr].ok}get redirected(){return this[Cr].redirected}get status(){return this[Cr].status}get statusText(){return this[Cr].statusText}get type(){return this[Cr].type}get url(){return this[Cr].url}clone(){let t=new Dr(this[ur][fr],{headers:new Er(this.headers),status:this.status,statusText:this.statusText});return t[Cr].url=this.url,t}static json(t,e){return new Response(JSON.stringify(t),e)}static error(){let t=new Dr(null,{status:200,statusText:""});return t[Cr].ok=!1,t[Cr].status=0,t[Cr].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","Body"]}}}o(Dr,"Response");class Br{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const Ur=e.Response||Dr;function Nr(t,e){if(new.target===Nr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){const i=new Lr(t,e),l=i[Or].signal;if(l&&l.aborted)return o(l.reason);let h=new ar;if(h.onload=function(){let t={headers:h instanceof Le?new Er(h[Oe][He]||void 0):Rr(h.getAllResponseHeaders()||""),status:h.status,statusText:h.statusText};setTimeout(()=>{let e=new Dr(h.response,t);e[Cr].url=h.responseURL,s(e)})},h.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},h.ontimeout=function(){setTimeout(function(){o(new n("request:fail timeout","TimeoutError"))})},h.onabort=function(){setTimeout(function(){o(new n("request:fail abort","AbortError"))})},h.open(i.method,i.url),"include"===i.credentials?h.withCredentials=!0:"omit"===i.credentials&&(h.withCredentials=!1),e&&"object"==typeof e&&("object"==typeof(u=e.headers)&&!r("Headers",u))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(xr(t)),h.setRequestHeader(t,Pr(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(xr(e))&&h.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){h.setRequestHeader(e,t)});var u;if(l){const t=()=>{h.abort()};l.addEventListener("abort",t),h.onreadystatechange=function(){4===h.readyState&&l.removeEventListener("abort",t)}}h.send(i[ur][fr])})}const Mr=e.fetch||Nr;exports.AbortController=ae,exports.AbortControllerP=oe,exports.AbortSignal=se,exports.AbortSignalP=Qt,exports.Blob=ft,exports.BlobP=at,exports.CustomEvent=W,exports.CustomEventP=K,exports.Event=M,exports.EventP=A,exports.EventTarget=J,exports.EventTargetP=k,exports.File=bt,exports.FileP=gt,exports.FileReader=At,exports.FileReaderP=wt,exports.FormData=Mt,exports.FormDataP=qt,exports.Headers=Ar,exports.HeadersP=Er,exports.ProgressEvent=ot,exports.ProgressEventP=et,exports.Request=jr,exports.RequestP=Lr,exports.Response=Ur,exports.ResponseP=Dr,exports.TextDecoder=w,exports.TextDecoderP=p,exports.TextEncoder=u,exports.TextEncoderP=l,exports.URLSearchParams=Jt,exports.URLSearchParamsP=kt,exports.XMLHttpRequest=ar,exports.XMLHttpRequestP=Le,exports.fetch=Mr,exports.fetchP=Nr;
|
|
1
|
+
"use strict";const t=Symbol("isPolyfill"),e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{};class r extends Error{constructor(t,e){super(),this.message=null!=t?t:this.message,this.name=null!=e?e:this.name}}function n(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}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 u(t).encoded}encodeInto(t,e){let r=u(t,e);return{read:r.read,written:r.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function u(t,e){const r=void 0!==e;let n=0,s=0,o=t.length,i=0,a=Math.max(32,o+(o>>1)+7),l=r?e:new Uint8Array(a>>3<<3);for(;n<o;){let e,u=t.charCodeAt(n++);if(u>=55296&&u<=56319)if(n<o){let e=t.charCodeAt(n);56320==(64512&e)?(++n,u=((1023&u)<<10)+(1023&e)+65536):u=65533}else u=65533;else u>=56320&&u<=57343&&(u=65533);if(!r&&i+4>l.length){a+=8,a*=1+n/t.length*2,a=a>>3<<3;let e=new Uint8Array(a);e.set(l),l=e}if(4294967168&u?4294965248&u?4294901760&u?4292870144&u?(u=65533,e=3):e=4:e=3:e=2:e=1,r&&i+e>l.length)break;1===e?l[i++]=u:2===e?(l[i++]=u>>6&31|192,l[i++]=63&u|128):3===e?(l[i++]=u>>12&15|224,l[i++]=u>>6&63|128,l[i++]=63&u|128):4===e&&(l[i++]=u>>18&7|240,l[i++]=u>>12&63|128,l[i++]=u>>6&63|128,l[i++]=63&u|128),s++}return{encoded:r?e.slice():l.slice(0,i),read:s,written:i}}o(l,"TextEncoder");const h=e.TextEncoder||l;var c,d;const f=Symbol();class p{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 n;if(void 0===t){if(r[g].length>0){if(this.fatal)throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");r[g]=[]}return""}if(n=t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t),!r[y]&&this.ignoreBOM&&n.length>=3&&239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3),r[y]=!0),r[g].length>0){let t=new Uint8Array(r[g].length+n.length);t.set(r[g],0),t.set(n,r[g].length),n=t,r[g]=[]}let s=n.length,o=[];if(e&&n.length>0){let t=n.length;for(;t>0&&t>n.length-4;){let e=n[t-1];if(128!=(192&e)){v(e)>n.length-(t-1)&&(s=t-1);break}t--}r[g]=Array.from(n.slice(s)),n=n.slice(0,s)}let i=0;for(;i<s;){let t=n[i],e=null,r=v(t);if(i+r<=s){let s,o,a,l;switch(r){case 1:t<128&&(e=t);break;case 2:s=n[i+1],128==(192&s)&&(l=(31&t)<<6|63&s,l>127&&(e=l));break;case 3:s=n[i+1],o=n[i+2],128==(192&s)&&128==(192&o)&&(l=(15&t)<<12|(63&s)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:s=n[i+1],o=n[i+2],a=n[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&t)<<18|(63&s)<<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(p,"TextDecoder");const y=Symbol(),g=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[c]=!1,this[d]=[]}}c=y,d=g;const m=["utf-8","utf8","unicode-1-1-utf-8"];function v(t){return t>239?4:t>223?3:t>191?2:1}const w=e.TextDecoder||p,E=Symbol();class T{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[E][S]):e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t.push(R(e)):(r||(r=new l),t.push(r.encode(String(e)))),t),[]);this[E]=new x(function(t){let 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[E];o.size=o[S].length;let i=(null==e?void 0:e.type)||"";o.type=/[^\u0020-\u007E]/.test(i)?"":i.toLowerCase()}get size(){return this[E].size}get type(){return this[E].type}arrayBuffer(){return Promise.resolve(A(this[E][S].buffer).buffer)}bytes(){return Promise.resolve(A(this[E][S].buffer))}slice(t,e,r){let n=this[E][S].slice(null!=t?t:0,null!=e?e:this[E][S].length);return new T([n],{type:null!=r?r:""})}stream(){throw new ReferenceError("ReadableStream is not defined")}text(){let t=new p;return Promise.resolve(t.decode(this[E][S]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}o(T,"Blob");const S=Symbol();class x{constructor(t){this.size=0,this.type="",this[S]=t}}function P(t){return t[E][S]}function R(t){return t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function A(t){let e=R(t),r=new Uint8Array(new ArrayBuffer(e.byteLength));return r.set(e),r}function O(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var n=0;n<t.length;n+=3){let s=t[n],o=n+1<t.length,i=o?t[n+1]:0,a=n+2<t.length,l=a?t[n+2]:0,u=s>>2,h=(3&s)<<4|i>>4,c=(15&i)<<2|l>>6,d=63&l;a||(d=64,o||(c=64)),r.push(e[u],e[h],e[c],e[d])}return r.join("")}const q=e.Blob||T,L=Symbol();class j extends T{constructor(t,e,r){super(t,r),this[L]=new D,this[L].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[L].name=e.replace(/\//g,":")}get lastModified(){return this[L].lastModified}get name(){return this[L].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(j,"File");class D{constructor(){this.lastModified=0,this.name=""}}const C=e.Blob?e.File:j;var M,N,H,U,B;const F=Symbol();class k{constructor(t,e){this[F]=new J;const r=this[F];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),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return this[F][G]}.bind(this)})}get type(){return this[F].type}get bubbles(){return this[F].bubbles}get cancelable(){return this[F].cancelable}get composed(){return this[F].composed}get target(){return this[F].target}get currentTarget(){return this[F].currentTarget}get eventPhase(){return this[F].eventPhase}get srcElement(){return this[F].target}get cancelBubble(){return this[F].cancelBubble}set cancelBubble(t){this[F].cancelBubble=t}get defaultPrevented(){return this[F].defaultPrevented}get returnValue(){return this[F].returnValue}set returnValue(t){t||this.preventDefault()}get timeStamp(){return this[F].timeStamp}composedPath(){let t=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&t.push(this.currentTarget),t}initEvent(t,e,r){const n=this[F];n[z]||(n.type=String(t),n.bubbles=!!e,n.cancelable=!!r)}preventDefault(){const t=this[F];t[$]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(t[V]=!0,t.defaultPrevented=!0,t.returnValue=!1)}stopImmediatePropagation(){this[F][_]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}const I={NONE:{value:0,enumerable:!0},CAPTURING_PHASE:{value:1,enumerable:!0},AT_TARGET:{value:2,enumerable:!0},BUBBLING_PHASE:{value:3,enumerable:!0}};Object.defineProperties(k,I),Object.defineProperties(k.prototype,I),o(k,"Event");const X=(new Date).getTime(),G=Symbol(),$=Symbol(),z=Symbol(),V=Symbol(),_=Symbol();class J{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=k.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-X,this[M]=!1,this[N]=!1,this[H]=!1,this[U]=!1,this[B]=!1}}function Y(t,e){Object.defineProperty(t[F],G,{value:e,writable:!0,enumerable:!0,configurable:!0})}M=G,N=$,H=z,U=V,B=_;function K(t,e){const r=t[F];switch(e){case 0:return r[$];case 1:return r[z];case 2:return r[V];case 3:return r[_]}}function Q(t,e,r){const n=t[F];switch(e){case 0:n[$]=r;break;case 1:n[z]=r;break;case 2:n[V]=r;break;case 3:n[_]=r}}function W(t,e,r,n=!0){let s=new k(e,r);return s[F].target=t,s[F][G]=n,s}const Z=e.EventTarget?e.Event:k;var et;const rt=Symbol();class nt{constructor(){this[rt]=new ot(this)}addEventListener(t,e,r){const n=this[rt],s=new at(t,e);if(s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),!n[st].some(t=>t.equals(s))){if("object"==typeof r){const{once:t,passive:e,signal:n}=r;s.options.once=!!t,s.options.passive=!!e,n&&(s.options.signal=n,function(t,e,r){const n=t[rt],s=()=>{n[st]=n[st].filter(t=>!t.equals(r)),e.removeEventListener("abort",s)};try{e.addEventListener("abort",s)}catch(t){console.warn(t)}}(this,n,s))}n[st].push(s);const t=t=>t.options.capture?0:1;n[st]=n[st].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 k))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");return Y(t,!1),t[F].target=this,it(this,t)}removeEventListener(t,e,r){const n=this[rt],s=new at(t,e);s.options.capture="boolean"==typeof r?r:!!(null==r?void 0:r.capture),n[st].some(t=>t.equals(s))&&(n[st]=n[st].filter(t=>!t.equals(s)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}o(nt,"EventTarget");const st=Symbol();class ot{constructor(t){this[et]=[],this.target=t}}function it(t,e){const r=t[rt],n=e[F];e.target||(n.target=t),n.currentTarget=t,n.eventPhase=k.AT_TARGET,Q(e,1,!0);let s=[];for(let n=0;n<r[st].length;++n){let o=r[st][n];if(o.type!==e.type)continue;Q(e,0,!!o.options.passive),o.options.once&&s.push(n);let{callback:i}=o;try{"function"==typeof i&&i.call(t,e)}catch(t){console.error(t)}if(Q(e,0,!1),K(e,3))break}return s.length>0&&(r[st]=r[st].reduce((t,e,r)=>(-1===s.indexOf(r)&&t.push(e),t),[])),n.currentTarget=null,n.eventPhase=k.NONE,Q(e,1,!1),!(e.cancelable&&K(e,2))}et=st;class at{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 lt(t,e,r,n){"function"==typeof r?t.addEventListener(e,n):t.removeEventListener(e,n)}function ut(t,e,r){"function"==typeof e&&e.call(t,r)}const ht=e.EventTarget||nt,ct=Symbol();class dt extends k{constructor(t,e){var r,n;super(t,e),this[ct]=new ft;const s=this[ct];s.lengthComputable=!!(null==e?void 0:e.lengthComputable),s.loaded=null!==(r=null==e?void 0:e.loaded)&&void 0!==r?r:0,s.total=null!==(n=null==e?void 0:e.total)&&void 0!==n?n:0}get lengthComputable(){return pt(this[ct].lengthComputable)}get loaded(){return pt(this[ct].loaded)}get total(){return pt(this[ct].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}o(dt,"ProgressEvent");class ft{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function pt(t){return"function"==typeof t?t():t}function yt(t,e,r=0,n=0){let s=function(t,e,{lengthComputable:r=!1,loaded:n=0,total:s=0}={}){let o=new dt(e);return o[ct].lengthComputable=r,o[ct].loaded=n,o[ct].total=s,o[F].target=t,Y(o,!0),o}(t,e,{lengthComputable:()=>pt(n)>0,loaded:r,total:n});it(t,s)}const gt=e.EventTarget?e.ProgressEvent:dt;var bt;const mt=Symbol();class vt extends nt{constructor(){super(),this[mt]=new Tt(this)}get readyState(){return this[mt].readyState}get result(){return this[mt].result}get error(){return this[mt].error}abort(){this.readyState===vt.LOADING&&(this[mt].readyState=vt.DONE,this[mt].result=null,yt(this,"abort"))}readAsArrayBuffer(t){St(this,"readAsArrayBuffer",t,()=>{this[mt].result=P(t).buffer.slice(0)})}readAsBinaryString(t){St(this,"readAsBinaryString",t,()=>{this[mt].result=P(t).reduce((t,e)=>t+=String.fromCharCode(e),"")})}readAsDataURL(t){St(this,"readAsDataURL",t,()=>{this[mt].result="data:"+(t.type||"application/octet-stream")+";base64,"+O(P(t))})}readAsText(t,e){St(this,"readAsText",t,()=>{this[mt].result=new p(e).decode(P(t))})}get onabort(){return this[mt].onabort}set onabort(t){this[mt].onabort=t,xt(this,"abort")}get onerror(){return this[mt].onerror}set onerror(t){this[mt].onerror=t,xt(this,"error")}get onload(){return this[mt].onload}set onload(t){this[mt].onload=t,xt(this,"load")}get onloadend(){return this[mt].onloadend}set onloadend(t){this[mt].onloadend=t,xt(this,"loadend")}get onloadstart(){return this[mt].onloadstart}set onloadstart(t){this[mt].onloadstart=t,xt(this,"loadstart")}get onprogress(){return this[mt].onprogress}set onprogress(t){this[mt].onprogress=t,xt(this,"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}const wt={EMPTY:{value:0,enumerable:!0},LOADING:{value:1,enumerable:!0},DONE:{value:2,enumerable:!0}};Object.defineProperties(vt,wt),Object.defineProperties(vt.prototype,wt),o(vt,"FileReader");const Et=Symbol();class Tt{constructor(t){var e;this.readyState=vt.EMPTY,this.result=null,this.error=null,this[bt]=(e=this,{onabort:t=>{ut(e.target,e.onabort,t)},onerror:t=>{ut(e.target,e.onerror,t)},onload:t=>{ut(e.target,e.onload,t)},onloadend:t=>{ut(e.target,e.onloadend,t)},onloadstart:t=>{ut(e.target,e.onloadstart,t)},onprogress:t=>{ut(e.target,e.onprogress,t)}}),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function St(t,e,r,n){if(!s("Blob",r))throw new TypeError("Failed to execute '"+e+"' on 'FileReader': parameter 1 is not of type 'Blob'.");const o=t[mt];o.error=null,o.readyState=vt.LOADING,yt(o.target,"loadstart",0,r.size),setTimeout(()=>{if(o.readyState===vt.LOADING){o.readyState=vt.DONE;try{n(),yt(o.target,"load",r.size,r.size)}catch(t){o.result=null,o.error=t,yt(o.target,"error",0,r.size)}}yt(o.target,"loadend",o.result?r.size:0,r.size)})}function xt(t,e){const r=t[mt],n="on"+e;lt(t,e,r[n],r[Et][n])}bt=Et;const Pt=e.Blob?e.FileReader:vt;var Rt;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 Lt}append(t,e,r){this[At][qt].push(jt(t,e,r))}delete(t){let e=[];t=String(t),Ct(this[At][qt],r=>{r[0]!==t&&e.push(r)}),this[At][qt]=e}get(t){let e=this[At][qt];t=String(t);for(let r=0;r<e.length;++r)if(e[r][0]===t)return e[r][1];return null}getAll(t){let e=[];return t=String(t),Ct(this[At][qt],r=>{r[0]===t&&e.push(r[1])}),e}has(t){t=String(t);for(let e=0;e<this[At][qt].length;++e)if(this[At][qt][e][0]===t)return!0;return!1}set(t,e,r){t=String(t);let n=[],s=jt(t,e,r),o=!0;Ct(this[At][qt],e=>{e[0]===t?o&&(o=!n.push(s)):n.push(e)}),o&&n.push(s),this[At][qt]=n}forEach(t,e){for(let r=0;r<this[At][qt].length;++r){let n=this[At][qt][r];t.call(e,n[1],n[0],e)}}entries(){return this[At][qt].values()}keys(){return this[At][qt].map(t=>t[0]).values()}values(){return this[At][qt].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 qt=Symbol();class Lt{constructor(){this[Rt]=[]}}function jt(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 j([e],r)),[String(t),e]):[String(t),String(e)]}function Dt(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 Mt(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Rt=qt;const Nt=e.FormData||Ot;var Ht;const Ut=Symbol();class Bt{constructor(t){let e=t||"";n("URLSearchParams",e)&&(e=e.toString()),this[Ut]=new kt,this[Ut][Ft]=function(t){let e={};if("object"==typeof t)if(Array.isArray(t))for(let r=0;r<t.length;++r){let n=t[r];if(!Array.isArray(n)||2!==n.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");It(e,n[0],n[1])}else{let r=Object.keys(t);for(let n=0;n<r.length;++n){let s=r[n];t.hasOwnProperty(s)&&It(e,s,t[s])}}else{0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let t=0;t<r.length;++t){let n=r[t],s=n.indexOf("=");-1<s?It(e,Gt(n.slice(0,s)),Gt(n.slice(s+1))):n&&It(e,Gt(n),"")}}return e}(e)}get size(){return i(this[Ut][Ft]).reduce((t,e)=>t+e.length,0)}append(t,e){It(this[Ut][Ft],t,e)}delete(t,e){let r={},n=a(this[Ut][Ft]);for(let s=0;s<n.length;++s){let o=n[s],i=o[0],a=o[1];if(i!==t)Object.assign(r,{[i]:a});else if(void 0!==e){let t=a.filter(t=>t!==""+e);t.length>0&&Object.assign(r,{[i]:t})}}this[Ut][Ft]=r}get(t){var e;return this.has(t)&&null!==(e=this[Ut][Ft][t][0])&&void 0!==e?e:null}getAll(t){return this.has(t)?this[Ut][Ft][t].slice(0):[]}has(t,e){return!!$t(this[Ut][Ft],t)&&(void 0===e||this[Ut][Ft][t].indexOf(""+e)>-1)}set(t,e){this[Ut][Ft][t]=[""+e]}sort(){const t=this[Ut];let e=Object.keys(t[Ft]);e.sort();let r={};for(let n=0;n<e.length;++n){let s=e[n];Object.assign(r,{[s]:t[Ft][s]})}t[Ft]=r}forEach(t,e){a(this[Ut][Ft]).forEach(([r,n])=>{n.forEach(n=>{t.call(e,n,r,this)})})}entries(){return a(this[Ut][Ft]).map(([t,e])=>e.map(e=>[t,e])).reduce(zt,[]).values()}keys(){return Object.keys(this[Ut][Ft]).values()}values(){return i(this[Ut][Ft]).reduce(zt,[]).values()}[Symbol.iterator](){return this.entries()}toString(){let t=[],e=a(this[Ut][Ft]);for(let r=0;r<e.length;++r){let n=e[r],s=n[0],o=n[1],i=Xt(s);for(let e=0;e<o.length;++e){let r=o[e];t.push(i+"="+Xt(r))}}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}o(Bt,"URLSearchParams");const Ft=Symbol();class kt{constructor(){this[Ht]={}}}function It(t,e,r){let n="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$t(t,e)?t[e].push(n):t[e]=[n]}function Xt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,t=>e[t])}function Gt(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 zt(t,e){for(let r=0;r<e.length;++r){let n=e[r];t.push(n)}return t}Ht=Ft;const Vt=e.URLSearchParams||Bt;var _t;const Jt=Symbol();class Yt extends nt{static abort(t){let e=Zt();return Wt(e,t,!1),e}static any(t){let e=Zt(),r=t.find(t=>t.aborted);if(r)Wt(e,r.reason,!1);else{let n=Array.from(t);function s(t){for(let t=0;t<n.length;++t){n[t].removeEventListener("abort",s)}Wt(e,this.reason,!0,t.isTrusted)}for(let o=0;o<n.length;++o){n[1].addEventListener("abort",s)}}return e}static timeout(t){let e=Zt();return setTimeout(()=>{Wt(e,new r("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,lt(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){var e;this.aborted=!1,this.reason=void 0,this[_t]=(e=this,{onabort:t=>{ut(e.target,e.onabort,t)}}),this.onabort=null,this.target=t}}function Wt(t,e,n=!0,s=!0){const o=t[Jt];if(!o.aborted&&(o.aborted=!0,o.reason=null!=e?e:new r("signal is aborted without reason","AbortError"),n)){it(t,W(t,"abort",void 0,s))}}function Zt(){let t=Object.create(Yt.prototype);return t[rt]=new ot(t),t[Jt]=new Qt(t),t}_t=Kt;const te=e.AbortSignal||Yt;var ee,re;const ne=Symbol();class se{constructor(){if(new.target===se)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[ne]=new ae}get body(){if(!this[ne][ie])return null;throw new ReferenceError("ReadableStream is not defined")}get bodyUsed(){return this[ne].bodyUsed}arrayBuffer(){const t="arrayBuffer";return de(this,t)||ce(this,t)}blob(){const t="blob";return de(this,t)||ce(this,t)}bytes(){const t="bytes";return de(this,t)||ce(this,t)}formData(){const t="formData";return de(this,t)||ce(this,t)}json(){const t="json";return de(this,t)||ce(this,t)}text(){const t="text";return de(this,t)||ce(this,t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(se,"Body");const oe=Symbol(),ie=Symbol();class ae{constructor(){this.bodyUsed=!1,this[ee]="Body",this[re]=""}}function le(t,e,r){if(n("ReadableStream",e))throw new ReferenceError("ReadableStream is not defined");t[ne][ie]=ye(e,t=>{r&&!r.get("Content-Type")&&r.set("Content-Type",t)})}function ue(t,e){t[ne][oe]=e}function he(t){return t[ne][ie]}function ce(t,e){return new Promise((r,n)=>{try{r(function(t,e){const r=t[ne][ie];if("arrayBuffer"===e)return ge("arraybuffer",r);if("blob"===e)return ge("blob",r);if("bytes"===e){let t=ge("arraybuffer",r);return new Uint8Array(t)}if("formData"===e){return function(t,e="Failed to fetch"){const r=new Ot;if("string"!=typeof t||""===t.trim())return r;const n=t.indexOf("\r\n");if(-1===n)throw new TypeError(e);const s=t.substring(2,n).trim();if(!s)throw new TypeError("Invalid MIME type");const o=t.split(`--${s}`).filter(t=>{const e=t.trim();return""!==e&&"--"!==e});if(0===o.length)throw new TypeError(e);return o.forEach(t=>{const n=t.indexOf("\r\n\r\n");if(-1===n)throw new TypeError(e);const s=t.substring(0,n).trim(),o=t.substring(n+4),i=s.match(/name="([^"]+)"/),a=s.match(/filename="([^"]*)"/),u=s.match(/Content-Type: ([^\r\n]+)/);if(!i||!i[1])throw new TypeError(e);const h=i[1],c=!!a,d=u?(u[1]||"").trim():"application/octet-stream";if(c)try{const t=o.replace(/\r\n/g,""),e=(new l).encode(t),n=a[1]||"unknown-file",s=new j([e],n,{type:d});r.append(h,s,n)}catch(t){throw new TypeError(e)}else{const t=o.replace(/^[\r\n]+|[\r\n]+$/g,"");r.append(h,t)}}),r}(ge("text",r))}return ge("json"===e?"json":"text",r)}(t,e))}catch(t){n(t)}})}function de(t,e){const r=t[ne];if(r[ie])return r.bodyUsed?Promise.reject(new TypeError(`TypeError: Failed to execute '${e}' on '${r[oe]}': body stream already read`)):void(r.bodyUsed=!0)}ee=oe,re=ie;const fe=t=>(new l).encode(t).buffer,pe=t=>(new p).decode(t);function ye(t,e,r){let o;if("string"==typeof t)o=t,e&&e("text/plain;charset=UTF-8");else if(n("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=P(t).buffer.slice(0),e&&t.type&&e(t.type);else if(s("FormData",t)){let r=function(t){const e="----formdata-polyfill-"+Math.random(),r=`--${e}\r\nContent-Disposition: form-data; name="`;let n=[];for(let e=0;e<t[At][qt].length;++e){let s=t[At][qt][e],o=s[0],i=s[1];"string"==typeof i?n.push(r+Mt(Dt(o))+`"\r\n\r\n${Dt(i)}\r\n`):n.push(r+Mt(Dt(o))+`"; filename="${Mt(i.name)}"\r\nContent-Type: ${i.type||"application/octet-stream"}\r\n\r\n`,i,"\r\n")}return n.push(`--${e}--`),new T(n,{type:"multipart/form-data; boundary="+e})}(t);o=P(r).buffer,e&&e(r.type)}else o=t?String(t):"";return r&&r(()=>("string"==typeof o?fe(o):o).byteLength),o}function ge(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:pe(r)):"arraybuffer"===t?r instanceof ArrayBuffer?r.slice(0):fe(r):"blob"===t?new T([r]):r:"string"==typeof r?r:pe(r)}var be;const me=Symbol();class ve{constructor(t){this[me]=new Ee,n("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 n=Se(t,"append"),s=xe(e),o=null===(r=this[me][we].get(n))||void 0===r?void 0:r[1];this[me][we].set(n,[""+t,o?`${o}, ${s}`:s])}delete(t){let e=Se(t,"delete");this[me][we].delete(e)}get(t){var e,r;let n=Se(t,"get");return null!==(r=null===(e=this[me][we].get(n))||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=Se(t,"has");return this[me][we].has(e)}set(t,e){let r=Se(t,"set");this[me][we].set(r,[""+t,xe(e)])}forEach(t,e){Array.from(this.entries()).forEach(([r,n])=>{t.call(e,n,r,this)})}entries(){return this[me][we].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(ve,"Headers");const we=Symbol();class Ee{constructor(){this[be]=new Te}}be=we;class Te{constructor(){this.array=[]}get(t){for(let e=0;e<this.array.length;++e){let r=this.array[e];if(r[0]===t)return r[1]}}set(t,e){let r=-1;for(let n=0;n<this.array.length;++n){let s=this.array[n];if(s[0]===t){s[1]=e,r=n;break}}return-1===r&&this.array.push([t,e]),this.array}has(t){for(let e=0;e<this.array.length;++e){if(this.array[e][0]===t)return!0}return!1}delete(t){let e=-1,r=[];for(let n=0;n<this.array.length;++n){let s=this.array[n];s[0]!==t?r.push(s):e=n}return e>-1&&(this.array=r),e>-1}values(){return this.array.map(t=>t[1]).values()}}function Se(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 xe(t){return"string"!=typeof t&&(t=String(t)),t}const Pe=e.Headers||ve,Re=Symbol();class Ae{constructor(){this[Re]=new Oe}get signal(){return this[Re].signal}abort(t){Wt(this[Re].signal,t)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}o(Ae,"AbortController");class Oe{constructor(){this.signal=Zt()}}const qe=e.AbortController||Ae,Le=Symbol();class je extends se{constructor(t,e){super(),ue(this,"Request"),this[Le]=new De;const r=this[Le];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 ve(t.headers)),r.method=t.method,r.mode=t.mode;let e=t[Le].signal;e&&(r.signal=e),r.url=t.url;let s=he(t);o||null===s||(o=s,function(t,e){t[ne].bodyUsed=e}(t,!0))}else r.url=String(t);if(n.credentials&&(r.credentials=n.credentials),n.headers&&(r.headers=new ve(n.headers)),n.method&&(r.method=Me(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(le(this,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[Le].cache}get credentials(){return this[Le].credentials}get destination(){return this[Le].destination}get headers(){const t=this[Le];return t.headers||(t.headers=new ve),t.headers}get integrity(){return this[Le].integrity}get keepalive(){return this[Le].keepalive}get method(){return this[Le].method}get mode(){return this[Le].mode}get redirect(){return this[Le].redirect}get referrer(){return this[Le].referrer}get referrerPolicy(){return this[Le].referrerPolicy}get signal(){const t=this[Le];return t.signal||(t.signal=(new Ae).signal),t.signal}get url(){return this[Le].url}clone(){var t;return new je(this,{body:null!==(t=he(this))&&void 0!==t?t:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request","Body"]}}}o(je,"Request");class De{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 Ce=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Me(t){let e=t.toUpperCase();return Ce.indexOf(e)>-1?e:t}const Ne=e.Request||je,He=Symbol();class Ue extends se{constructor(t,e){super(),ue(this,"Response"),this[He]=new Be;const r=this[He];let n=null!=e?e:{},s=void 0===n.status?200:n.status;if(s<200||s>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+s}) is outside the range [200, 599].`);n.headers&&(r.headers=new ve(n.headers)),r.ok=this.status>=200&&this.status<300,r.status=s,r.statusText=void 0===n.statusText?"":""+n.statusText,le(this,t,this.headers)}get headers(){const t=this[He];return t.headers||(t.headers=new ve),t.headers}get ok(){return this[He].ok}get redirected(){return this[He].redirected}get status(){return this[He].status}get statusText(){return this[He].statusText}get type(){return this[He].type}get url(){return this[He].url}clone(){let t=new Ue(he(this),{headers:new ve(this.headers),status:this.status,statusText:this.statusText});return t[He].url=this.url,t}static json(t,e){return new Ue(JSON.stringify(t),e)}static error(){let t=new Ue(null,{status:200,statusText:""});return t[He].ok=!1,t[He].status=0,t[He].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 Ue(null,{status:e,headers:{location:String(t)}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response","Body"]}}}o(Ue,"Response");class Be{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const Fe=e.Response||Ue;var ke;const Ie=Symbol();class Xe extends nt{constructor(){if(new.target===Xe)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[Ie]=new $e(this)}get onabort(){return this[Ie].onabort}set onabort(t){this[Ie].onabort=t,ze(this,"abort")}get onerror(){return this[Ie].onerror}set onerror(t){this[Ie].onerror=t,ze(this,"error")}get onload(){return this[Ie].onload}set onload(t){this[Ie].onload=t,ze(this,"load")}get onloadend(){return this[Ie].onloadend}set onloadend(t){this[Ie].onloadend=t,ze(this,"loadend")}get onloadstart(){return this[Ie].onloadstart}set onloadstart(t){this[Ie].onloadstart=t,ze(this,"loadstart")}get onprogress(){return this[Ie].onprogress}set onprogress(t){this[Ie].onprogress=t,ze(this,"progress")}get ontimeout(){return this[Ie].ontimeout}set ontimeout(t){this[Ie].ontimeout=t,ze(this,"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}o(Xe,"XMLHttpRequestEventTarget");const Ge=Symbol();class $e{constructor(t){var e;this[ke]=(e=this,{onabort:t=>{ut(e.target,e.onabort,t)},onerror:t=>{ut(e.target,e.onerror,t)},onload:t=>{ut(e.target,e.onload,t)},onloadend:t=>{ut(e.target,e.onloadend,t)},onloadstart:t=>{ut(e.target,e.onloadstart,t)},onprogress:t=>{ut(e.target,e.onprogress,t)},ontimeout:t=>{ut(e.target,e.ontimeout,t)}}),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 ze(t,e){const r=t[Ie],n="on"+e;lt(t,e,r[n],r[Ge][n])}ke=Ge;class Ve extends Xe{constructor(){if(new.target===Ve)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(Ve,"XMLHttpRequestUpload");const _e=(()=>{let t,r="undefined",n="request",s="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[n])===s&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[n])===s&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[n])===s&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[n])===s&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[n])===s&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[n])===s&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[n])===s&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[n])===s&&qh||typeof xhs!==r&&typeof(null===xhs||void 0===xhs?void 0:xhs[n])===s&&xhs||void 0,typeof e.XMLHttpRequest!==s)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[n])===s&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[n])===s&&Taro||void 0),t})();var Je,Ye,Ke,Qe,We,Ze,tr,er,rr,nr;const sr={request:_e?_e.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.error(t)}}).then(()=>{t.complete&&t.complete(r)}),new ReferenceError("request is not defined")}},or=Symbol();class ir extends Xe{constructor(){super(),this[or]=new mr(this)}get readyState(){return this[or].readyState}get response(){return this[or].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[or].responseType}set responseType(t){var e;this[or].responseType=(e=t,Pr.indexOf(e)>-1?e:"")}get responseURL(){return this[or].responseURL}get responseXML(){return null}get status(){return this[or].status}get statusText(){return this.readyState===ir.UNSENT||this.readyState===ir.OPENED?"":this[or].statusText||(t=this.status,qr[t]||"unknown");var t}get timeout(){return this[or].timeout}set timeout(t){this[or].timeout=t>0?t:0}get upload(){const t=this[or];return t.upload||(t.upload=function(){let t=Object.create(Ve.prototype);return t[rt]=new ot(t),t[Ie]=new $e(t),t}()),t.upload}get withCredentials(){return this[or].withCredentials}set withCredentials(t){this[or].withCredentials=!!t}abort(){Tr(this)}getAllResponseHeaders(){return this[or][yr]?Array.from(this[or][yr].entries()).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){return this[or][yr]?this[or][yr].get(t):null}open(...t){const[e,r,n=!0,s=null,o=null]=t,i=this[or];if(t.length<2)throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${t.length} present.`);if(n||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience."),Tr(this,!1),i[fr]=Me(e),i[dr]=String(r),null!==s||null!==o){let t=String(null!=s?s:""),e=String(null!=o?o:"");if(t.length>0||e.length>0){let r=`Basic ${O((new l).encode(t+":"+e))}`;this.setRequestHeader("Authorization",r)}}i[ur]=!0,xr(this,ir.OPENED)}overrideMimeType(t){this[or][ur]&&console.warn(`XMLHttpRequest.overrideMimeType('${t}') is not implemented: The method will have no effect on response parsing.`)}send(t){const e=this[or];if(!e[ur]||e.readyState!==ir.OPENED)throw new r("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");e[ur]=!1;const n="GET"!==e[fr]&&"HEAD"!==e[fr],s=n&&!e[pr].has("Content-Type"),o=e.upload,i=o&&o[rt][st].length>0;let a=Or;const l=s?t=>{e[pr].set("Content-Type",t)}:void 0,u=i?t=>{a=t}:void 0;let h=t;try{h=ye(t,l,u)}catch(t){console.warn(t)}let c={url:e[dr],method:e[fr],header:Array.from(e[pr].entries()).reduce((t,e)=>(t[e[0]]=e[1],t),{}),data:h,dataType:"json"===e.responseType?"json":Rr(e.responseType),responseType:Rr(e.responseType),withCredentials:e.withCredentials,success:vr.bind(this),fail:wr.bind(this),complete:Er.bind(this)};if(e[br]=sr.request(c),yt(this,"loadstart"),i){const t=n&&!!h;t&&yt(o,"loadstart",0,a),setTimeout(()=>{const r=e[ur]||e.readyState!==ir.OPENED,n=r?0:a;r?yt(o,"abort"):t&&yt(o,"load",n,n),(r||t)&&yt(o,"loadend",n,n)})}!function(t){const e=t[or];e.timeout&&(e[cr]=setTimeout(()=>{e.status||e.readyState===ir.DONE||(e[br]&&e[br].abort(),xr(t,ir.DONE),yt(t,"timeout"))},e.timeout))}(this)}setRequestHeader(t,e){this[or][pr].append(t,e)}get onreadystatechange(){return this[or].onreadystatechange}set onreadystatechange(t){this[or].onreadystatechange=t,lt(this,"readystatechange",t,this[or][lr].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}const ar={UNSENT:{value:0,enumerable:!0},OPENED:{value:1,enumerable:!0},HEADERS_RECEIVED:{value:2,enumerable:!0},LOADING:{value:3,enumerable:!0},DONE:{value:4,enumerable:!0}};Object.defineProperties(ir,ar),Object.defineProperties(ir.prototype,ar),o(ir,"XMLHttpRequest");const lr=Symbol(),ur=Symbol(),hr=Symbol(),cr=Symbol(),dr=Symbol(),fr=Symbol(),pr=Symbol(),yr=Symbol(),gr=Symbol(),br=Symbol();class mr{constructor(t){var e;this.readyState=ir.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[Je]=(e=this,{onreadystatechange:t=>{ut(e.target,e.onreadystatechange,t)}}),this.onreadystatechange=null,this[Ye]=!1,this[Ke]=!1,this[Qe]=0,this[We]="",this[Ze]="GET",this[tr]=new ve,this[er]=null,this[rr]=Or,this[nr]=null,this.target=t}}function vr({statusCode:t,header:e,data:r}){const n=this[or];n.responseURL=n[dr],n.status=t,n[yr]=new ve(e);let s=n[yr].get("Content-Length");n[gr]=()=>s?parseInt(s):0,n.readyState===ir.OPENED&&(xr(this,ir.HEADERS_RECEIVED),xr(this,ir.LOADING),setTimeout(()=>{if(!n[ur]){let t=n[gr];try{n.response=ge(n.responseType,r),yt(this,"load",t,t)}catch(t){console.error(t),yt(this,"error")}}}))}function wr(t){if("status"in t)return void vr.call(this,{statusCode:t.status,header:t.headers,data:t.data});const e=this[or];e.status=0,e.statusText="errMsg"in t?t.errMsg:"errorMessage"in t?t.errorMessage:"",e[ur]||e.readyState===ir.UNSENT||e.readyState===ir.DONE||(yt(this,"error"),Sr(this))}function Er(){const t=this[or];t[br]=null,t[ur]||t.readyState!==ir.OPENED&&t.readyState!==ir.LOADING||xr(this,ir.DONE),setTimeout(()=>{if(!t[ur]){let e=t[gr];yt(this,"loadend",e,e)}})}function Tr(t,e=!0){const r=t[or],n=e?setTimeout:t=>{t()};r[hr]=!0,r[br]&&r.readyState!==ir.DONE&&(e&&xr(t,ir.DONE),n(()=>{const n=r[br];n&&n.abort(),e&&yt(t,"abort"),e&&!n&&yt(t,"loadend")})),n(()=>{r[hr]&&(e&&(r.readyState=ir.UNSENT),function(t){const e=t[or];e[hr]=!1,Sr(t),e.response="",e.responseURL="",e.status=0,e.statusText="",e[pr]=new ve,e[yr]=null,e[gr]=Or}(t))})}function Sr(t){const e=t[or];e[cr]&&(clearTimeout(e[cr]),e[cr]=0)}function xr(t,e){const r=t[or];let n=e!==r.readyState;if(r.readyState=e,n){it(t,W(t,"readystatechange"))}}Je=lr,Ye=ur,Ke=hr,Qe=cr,We=dr,Ze=fr,tr=pr,er=yr,rr=gr,nr=br;const Pr=["","text","json","arraybuffer","blob","document"];function Rr(t){return"blob"===t||"arraybuffer"===t?"arraybuffer":"text"}function Ar(t){return t instanceof ir?t[or][yr]:function(t){let e=new ve;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(":"),n=r.shift().trim();if(n){let t=r.join(":").trim();try{e.append(n,t)}catch(t){console.warn("Response "+t.message)}}}),e}(t.getAllResponseHeaders()||"")}const Or=()=>0,qr={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 Lr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||ir,jr={XMLHttpRequest:Lr};function Dr(t,e){if(new.target===Dr)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){const i=new je(t,e),l=i[Le].signal;if(l&&l.aborted)return o(l.reason);let u=new jr.XMLHttpRequest;if(u.onload=function(){let t={headers:Ar(u),status:u.status,statusText:u.statusText};setTimeout(()=>{let e=new Ue(u.response,t);e[He].url=u.responseURL,s(e)})},u.onerror=function(){setTimeout(function(){o(new TypeError("Failed to fetch"))})},u.ontimeout=function(){setTimeout(function(){o(new r("request:fail timeout","TimeoutError"))})},u.onabort=function(){setTimeout(function(){o(new r("request:fail abort","AbortError"))})},u.open(i.method,i.url),"include"===i.credentials?u.withCredentials=!0:"omit"===i.credentials&&(u.withCredentials=!1),e&&"object"==typeof e&&("object"==typeof(h=e.headers)&&!n("Headers",h))){let t=e.headers,r=[];a(t).forEach(([t,e])=>{r.push(Se(t)),u.setRequestHeader(t,xe(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(Se(e))&&u.setRequestHeader(e,t)})}else i.headers.forEach(function(t,e){u.setRequestHeader(e,t)});var h;if(l){const t=()=>{u.abort()};l.addEventListener("abort",t),u.onreadystatechange=function(){4===u.readyState&&l.removeEventListener("abort",t)}}u.send(he(i))})}const Cr=e.fetch||Dr,Mr=Symbol();class Nr extends k{constructor(t,e){var r;super(t,e),this[Mr]=new Hr,this[Mr].detail=null!==(r=null==e?void 0:e.detail)&&void 0!==r?r:null}get detail(){return this[Mr].detail}initCustomEvent(t,e,r,n){K(this,1)||(this.initEvent(t,e,r),this[Mr].detail=null!=n?n:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}o(Nr,"CustomEvent");class Hr{}const Ur=e.EventTarget?e.CustomEvent:Nr;exports.AbortController=qe,exports.AbortControllerP=Ae,exports.AbortSignal=te,exports.AbortSignalP=Yt,exports.Blob=q,exports.BlobP=T,exports.CustomEvent=Ur,exports.CustomEventP=Nr,exports.Event=Z,exports.EventP=k,exports.EventTarget=ht,exports.EventTargetP=nt,exports.File=C,exports.FileP=j,exports.FileReader=Pt,exports.FileReaderP=vt,exports.FormData=Nt,exports.FormDataP=Ot,exports.Headers=Pe,exports.HeadersP=ve,exports.ProgressEvent=gt,exports.ProgressEventP=dt,exports.Request=Ne,exports.RequestP=je,exports.Response=Fe,exports.ResponseP=Ue,exports.TextDecoder=w,exports.TextDecoderP=p,exports.TextEncoder=h,exports.TextEncoderP=l,exports.URLSearchParams=Vt,exports.URLSearchParamsP=Bt,exports.XMLHttpRequest=Lr,exports.XMLHttpRequestP=ir,exports.fetch=Cr,exports.fetchP=Dr,exports.setRequest=t=>{sr.request=t},exports.setXMLHttpRequest=t=>{jr.XMLHttpRequest=t};
|