mphttpx 1.0.6 → 1.0.8

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.
@@ -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){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 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)){v(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=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(g,"TextDecoder");const y=Symbol(),p=Symbol();class b{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[c]=!1,this[d]=[]}}c=y,d=p;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||g;var E,T,S,R,A;const P=Symbol();class O{constructor(t,e){this[P]=new N;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),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return this[P][q]}.bind(this)})}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 timeStamp(){return this[P].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[P];s[C]||(s.type=String(t),s.bubbles=!!e,s.cancelable=!!r)}preventDefault(){const t=this[P];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[P][B]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}const x={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(O,x),Object.defineProperties(O.prototype,x),o(O,"Event");const L=Symbol(),q=Symbol(),j=Symbol(),C=Symbol(),D=Symbol(),B=Symbol();class N{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()-N[L],this[E]=!1,this[T]=!1,this[S]=!1,this[R]=!1,this[A]=!1}}function U(t,e,r,s=!0){let n=new O(e,r);return n[P].target=t,n[P][q]=s,n}E=q,T=j,S=C,R=D,A=B,N[L]=(new Date).getTime();const M=e.EventTarget?e.Event:O;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 O))throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");return t[P].target=this,Object.defineProperty(t[P],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[P];t.target||(e.target=this.target),e.currentTarget=this.target,e.eventPhase=O.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=O.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 O{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[P][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 O{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[P].target=t,o[P][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 g;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,gt=Symbol();class yt extends at{constructor(t,e,r){super(t,r),this[gt]=new pt,this[gt].lastModified=+((null==r?void 0:r.lastModified)?new Date(r.lastModified):new Date),this[gt].name=e.replace(/\//g,":")}get lastModified(){return this[gt].lastModified}get name(){return this[gt].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}o(yt,"File");class pt{constructor(){this.lastModified=0,this.name=""}}const bt=e.Blob?e.File:yt;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){Rt.call(this[vt],"readAsArrayBuffer",t,()=>{this[vt].result=t[it].toArrayBuffer().slice(0)})}readAsBinaryString(t){Rt.call(this[vt],"readAsBinaryString",t,()=>{this[vt].result=t[it].toUint8Array().reduce((t,e)=>t+=String.fromCharCode(e),"")})}readAsDataURL(t){Rt.call(this[vt],"readAsDataURL",t,()=>{this[vt].result="data:"+t.type+";base64,"+ut(t[it].toUint8Array())})}readAsText(t,e){Rt.call(this[vt],"readAsText",t,()=>{this[vt].result=new g(e).decode(t[it].toUint8Array())})}get onabort(){return this[vt].onabort}set onabort(t){this[vt].onabort=t,At.call(this[vt],"abort")}get onerror(){return this[vt].onerror}set onerror(t){this[vt].onerror=t,At.call(this[vt],"error")}get onload(){return this[vt].onload}set onload(t){this[vt].onload=t,At.call(this[vt],"load")}get onloadend(){return this[vt].onloadend}set onloadend(t){this[vt].onloadend=t,At.call(this[vt],"loadend")}get onloadstart(){return this[vt].onloadstart}set onloadstart(t){this[vt].onloadstart=t,At.call(this[vt],"loadstart")}get onprogress(){return this[vt].onprogress}set onprogress(t){this[vt].onprogress=t,At.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]=Pt.call(this),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=t}}function Rt(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 At(t){const e="on"+t,r=this[e],s=this[Tt][e];V.call(this.target,t,r,s)}function Pt(){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 Ot=e.Blob?e.FileReader:wt;var xt;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),Nt(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),Nt(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;Nt(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[xt]=[]}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+Ut(Bt(t))+`"\r\n\r\n${Bt(s)}\r\n`):r.push(e+Ut(Bt(t))+`"; filename="${Ut(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 yt([e],r)),[String(t),e]):[String(t),String(e)]}function Bt(t){return t.replace(/\r?\n|\r/g,"\r\n")}function Nt(t,e){for(let r=0;r<t.length;++r)e(t[r])}function Ut(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}xt=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=U(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]=ge.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 ge(){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 ye extends ue{constructor(){if(new.target===ye)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}o(ye,"XMLHttpRequestUpload");const pe=(()=>{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=pe?pe.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,Re,Ae,Pe,Oe;const xe=Symbol();class Le extends ue{constructor(){super(),this[xe]=new Ie(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===Le.UNSENT||this.readyState===Le.OPENED?"":this[xe].statusText||(t=this.status,ir[t]||"unknown");var t}get timeout(){return this[xe].timeout}set timeout(t){this[xe].timeout=t}get upload(){const t=this[xe];return t.upload||(t.upload=function(){let t=Object.create(ye.prototype);return t[F]=new X(t),t[he]=new de(t),t}()),t.upload}get withCredentials(){return this[xe].withCredentials}set withCredentials(t){this[xe].withCredentials=t}abort(){ze.call(this[xe])}getAllResponseHeaders(){return this[xe][He]?a(this[xe][He]||{}).map(([t,e])=>`${t}: ${e}\r\n`).join(""):""}getResponseHeader(t){var e,r;if(!this[xe][He])return null;let s=t.toLowerCase();return null!==(r=null===(e=a(this[xe][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[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."),ze.call(i,!1),i[Ue]=We(e),i[Ne]=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[xe][Ce]&&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[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[Ue]&&"HEAD"!==e[Ue],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[Ne],method:e[Ue],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[xe][Me],t,e)}get onreadystatechange(){return this[xe].onreadystatechange}set onreadystatechange(t){this[xe].onreadystatechange=t,V.call(this,"readystatechange",t,this[xe][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(),Ne=Symbol(),Ue=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[Re]={Accept:"*/*"},this[Ae]=null,this[Pe]=or,this[Oe]=null,this.target=t}}function Xe({statusCode:t,header:e,data:r}){this.responseURL=this[Ne],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=U(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=Ne,Se=Ue,Re=Me,Ae=He,Pe=Fe,Oe=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 g).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 gr}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)||pr.call(this[ur],t)}blob(){const t="blob";return mr.call(this[ur],t)||pr.call(this[ur],t)}bytes(){const t="bytes";return mr.call(this[ur],t)||pr.call(this[ur],t)}formData(){const t="formData";return mr.call(this[ur],t)||pr.call(this[ur],t)}json(){const t="json";return mr.call(this[ur],t)||pr.call(this[ur],t)}text(){const t="text";return mr.call(this[ur],t)||pr.call(this[ur],t)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}o(cr,"Body");const dr=Symbol(),fr=Symbol();class gr{constructor(){this.bodyUsed=!1,this[lr]="Body",this[hr]=""}}function yr(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 pr(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 yt([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=Rr(t,"append");e=Ar(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=Rr(t,"delete");this[wr][Tr].delete(e)}get(t){var e,r;let s=Rr(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=Rr(t,"has");return this[wr][Tr].has(e)}set(t,e){let r=Rr(t,"set");this[wr][Tr].set(r,[""+t,Ar(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 Rr(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 Ar(t){return"string"!=typeof t&&(t=String(t)),t}function Pr(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 Or=e.Headers||Er,xr=Symbol();class Lr extends cr{constructor(t,e){super(),this[xr]=new qr;const r=this[xr];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[xr].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(yr.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[xr].cache}get credentials(){return this[xr].credentials}get destination(){return this[xr].destination}get headers(){const t=this[xr];return t.headers||(t.headers=new Er),t.headers}get integrity(){return this[xr].integrity}get keepalive(){return this[xr].keepalive}get method(){return this[xr].method}get mode(){return this[xr].mode}get redirect(){return this[xr].redirect}get referrer(){return this[xr].referrer}get referrerPolicy(){return this[xr].referrerPolicy}get signal(){const t=this[xr];return t.signal||(t.signal=(new oe).signal),t.signal}get url(){return this[xr].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,yr.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 Nr=e.Response||Dr;function Ur(t,e){if(new.target===Ur)throw new TypeError("fetch is not a constructor");return new Promise(function(s,o){const i=new Lr(t,e),l=i[xr].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[xe][He]||void 0):Pr(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(Rr(t)),h.setRequestHeader(t,Ar(e))}),i.headers.forEach(function(t,e){-1===r.indexOf(Rr(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||Ur;export{ae as AbortController,oe as AbortControllerP,se as AbortSignal,Qt as AbortSignalP,ft as Blob,at as BlobP,W as CustomEvent,K as CustomEventP,M as Event,O as EventP,J as EventTarget,k as EventTargetP,bt as File,yt as FileP,Ot as FileReader,wt as FileReaderP,Mt as FormData,qt as FormDataP,Or as Headers,Er as HeadersP,ot as ProgressEvent,et as ProgressEventP,jr as Request,Lr as RequestP,Nr as Response,Dr as ResponseP,w as TextDecoder,g as TextDecoderP,u as TextEncoder,l as TextEncoderP,Jt as URLSearchParams,kt as URLSearchParamsP,ar as XMLHttpRequest,Le as XMLHttpRequestP,Mr as fetch,Ur as fetchP};
1
+ const e="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},t="MPHTTPX";function r(e,t){Object.defineProperty(e.prototype,Symbol.toStringTag,{configurable:!0,value:t})}function n(e,t,r,n){if(e.length<t)throw new TypeError(`Failed to ${n?"execute '"+n+"' on":"construct"} '${r}': ${t} argument${t>1?"s":""} required, but only ${e.length} present.`)}class o extends Error{constructor(e,t){super(e),this.name="Error",t&&(this.name=t)}}function s(e,t){return Object.prototype.toString.call(t)===`[object ${e}]`}function i(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 a{get encoding(){return"utf-8"}encode(e=""){return l(""+e).encoded}encodeInto(...e){const[t,r]=e;n(e,2,"TextEncoder","encodeInto");let o=""+t;if(!(r instanceof Uint8Array))throw new TypeError("Failed to execute 'encodeInto' on 'TextEncoder': parameter 2 is not of type 'Uint8Array'.");let s=l(o,r);return{read:s.read,written:s.written}}toString(){return"[object TextEncoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextEncoder"]}}}function l(e,t){const r=void 0!==t;let n=0,o=0,s=e.length,i=0,a=Math.max(32,s+(s>>1)+7),l=r?t:new Uint8Array(a>>3<<3);for(;n<s;){let t,u=e.charCodeAt(n),c=1;if(u>=55296&&u<=56319)if(n+1<s){let t=e.charCodeAt(n+1);56320==(64512&t)?(c=2,n+=2,u=((1023&u)<<10)+(1023&t)+65536):(n+=1,u=65533)}else n+=1,u=65533;else u>=56320&&u<=57343?(n+=1,u=65533):n+=1;if(!r&&i+4>l.length){a+=8,a*=1+n/e.length*2,a=a>>3<<3;let t=new Uint8Array(a);t.set(l),l=t}if(4294967168&u?4294965248&u?4294901760&u?4292870144&u?(u=65533,t=3):t=4:t=3:t=2:t=1,r&&i+t>l.length)break;switch(t){case 1:l[i++]=u;break;case 2:l[i++]=u>>6&31|192,l[i++]=63&u|128;break;case 3:l[i++]=u>>12&15|224,l[i++]=u>>6&63|128,l[i++]=63&u|128;break;case 4:l[i++]=u>>18&7|240,l[i++]=u>>12&63|128,l[i++]=u>>6&63|128,l[i++]=63&u|128}o+=c}return{encoded:r?t:l.slice(0,i),read:o,written:i}}r(a,"TextEncoder");const u=e.TextEncoder||a;var c,h;const d=Symbol();class f{constructor(e="utf-8",{fatal:t=!1,ignoreBOM:r=!1}={}){let n=""+e;if(-1===["utf-8","utf8","unicode-1-1-utf-8"].indexOf(n.toLowerCase()))throw new RangeError(`Failed to construct 'TextDecoder': encoding ('${n}') not implemented.`);this[d]=new g,this[d].fatal=!!t,this[d].ignoreBOM=!!r}get encoding(){return"utf-8"}get fatal(){return this[d].fatal}get ignoreBOM(){return this[d].ignoreBOM}decode(e,{stream:t=!1}={}){const r=this[d];let n;if(void 0===e){if(r[y].length>0&&this.fatal)throw r[y]=[],new TypeError("TextDecoder: Incomplete UTF-8 sequence.");return""}if(e instanceof ArrayBuffer)n=new Uint8Array(e);else if(e instanceof Uint8Array)n=e;else{if(!ArrayBuffer.isView(e))throw new TypeError("Failed to execute 'decode' on 'TextDecoder': parameter 1 is not of type 'ArrayBuffer'.");n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(r[p]<3&&(r[p]+=n.length,n.length>=3&&239===n[0]&&187===n[1]&&191===n[2]&&(n=n.subarray(3))),r[y].length>0){let e=new Uint8Array(r[y].length+n.length);e.set(r[y],0),e.set(n,r[y].length),n=e,r[y]=[]}let o=n.length,s=[];if(t&&n.length>0){let e=n.length;for(;e>0&&e>n.length-4;){let t=n[e-1];if(128!=(192&t)){b(t)>n.length-(e-1)&&(o=e-1);break}e--}r[y]=Array.from(n.slice(o)),n=n.slice(0,o)}let i=0;for(;i<o;){let e=null,t=n[i],a=b(t);if(i+a<=o){let r,o,s,l;switch(a){case 1:t<128&&(e=t);break;case 2:r=n[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(e=l));break;case 3:r=n[i+1],o=n[i+2],128==(192&r)&&128==(192&o)&&(l=(15&t)<<12|(63&r)<<6|63&o,l>2047&&(l<55296||l>57343)&&(e=l));break;case 4:r=n[i+1],o=n[i+2],s=n[i+3],128==(192&r)&&128==(192&o)&&128==(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&o)<<6|63&s,l>65535&&l<1114112&&(e=l))}}if(null===e){if(this.fatal)throw r[y]=[],new TypeError("TextDecoder.decode: Decoding failed.");let e=1;for(;i+e<o&&128==(192&n[i+e]);)e+=1;s.push(65533),i+=e;continue}e>65535&&(e-=65536,s.push(e>>>10&1023|55296),e=56320|1023&e),s.push(e),i+=a}return s.length>16384?m(s):v(s)}toString(){return"[object TextDecoder]"}get isPolyfill(){return{symbol:t,hierarchy:["TextDecoder"]}}}r(f,"TextDecoder");const p=Symbol(),y=Symbol();class g{constructor(){this.fatal=!1,this.ignoreBOM=!1,this[c]=0,this[h]=[]}}function b(e){return e>239?4:e>223?3:e>191?2:1}c=p,h=y;const m=e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(String.fromCharCode.apply(String,e.slice(r,r+4096)));return t.join("")},v=e=>{let t="";for(let r=0,n=e.length;r<n;r+=4096)t+=String.fromCharCode.apply(String,e.slice(r,r+4096));return t},w=e.TextDecoder||f,E=Symbol();class T{constructor(e=[],t){if(!(Array.isArray(e)||e&&"object"==typeof e&&Symbol.iterator in e))throw new TypeError("Failed to construct 'Blob/File': The provided value cannot be converted to a sequence.");let r=Array.isArray(e)?e:Array.from(e),n=[];for(let e=0;e<r.length;++e){let t=r[e];i("Blob",t)?n.push(t[E][S]):t instanceof ArrayBuffer||ArrayBuffer.isView(t)?n.push(x(t)):n.push(q(""+t))}this[E]=new R(function(e){let t=e.reduce((e,t)=>e+t.byteLength,0),r=new Uint8Array(t);return e.reduce((e,t)=>(r.set(t,e),e+t.byteLength),0),r}(n));const o=this[E];o.size=o[S].length;let s=""+((null==t?void 0:t.type)||"");o.type=/[^\u0020-\u007E]/.test(s)?"":s.toLowerCase()}get size(){return this[E].size}get type(){return this[E].type}arrayBuffer(){return Promise.resolve(P(this[E][S].buffer).buffer)}bytes(){return Promise.resolve(P(this[E][S].buffer))}slice(e,t,r){let n=this[E][S].slice(null!=e?e:0,null!=t?t:this[E][S].length);return new T([n],{type:""+(null!=r?r:"")})}stream(){throw new TypeError("Failed to execute 'stream' on 'Blob': method not implemented.")}text(){return Promise.resolve(L(this[E][S]))}toString(){return"[object Blob]"}get isPolyfill(){return{symbol:t,hierarchy:["Blob"]}}}r(T,"Blob");const S=Symbol();class R{constructor(e){this.size=0,this.type="",this[S]=e}}function A(e){return e[E][S]}function x(e){return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function P(e){let t=x(e),r=new Uint8Array(new ArrayBuffer(t.byteLength));return r.set(t),r}function q(e){return(new a).encode(e)}function L(e){return(new f).decode(e)}function F(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r=[];for(var n=0;n<e.length;n+=3){let o=e[n],s=n+1<e.length,i=s?e[n+1]:0,a=n+2<e.length,l=a?e[n+2]:0,u=o>>2,c=(3&o)<<4|i>>4,h=(15&i)<<2|l>>6,d=63&l;a||(d=64,s||(h=64)),r.push(t[u],t[c],t[h],t[d])}return r.join("")}const O=e.Blob||T,j=Symbol();class D extends T{constructor(...e){const[t,r,o]=e;n(e,2,"File"),super(t,o),this[j]=new C,this[j].lastModified=+((null==o?void 0:o.lastModified)?new Date(o.lastModified):new Date)||0,this[j].name=""+r}get lastModified(){return this[j].lastModified}get name(){return this[j].name}get webkitRelativePath(){return""}toString(){return"[object File]"}get isPolyfill(){return{symbol:t,hierarchy:["File","Blob"]}}}r(D,"File");class C{constructor(){this.lastModified=0,this.name=""}}const N=e.Blob?e.File:D;var H,U,M,B,I;const k=Symbol();class ${constructor(...e){const[t,r]=e;n(e,1,new.target.name),this[k]=new K;const o=this[k];o.type=""+t,o.bubbles=!!(null==r?void 0:r.bubbles),o.cancelable=!!(null==r?void 0:r.cancelable),o.composed=!!(null==r?void 0:r.composed),Object.defineProperty(this,"isTrusted",{enumerable:!0,get:function(){return this[k][z]}.bind(this)})}get type(){return this[k].type}get bubbles(){return this[k].bubbles}get cancelable(){return this[k].cancelable}get composed(){return this[k].composed}get target(){return this[k].target}get currentTarget(){return this[k].currentTarget}get eventPhase(){return this[k].eventPhase}get srcElement(){return this[k].target}get cancelBubble(){return this[k].cancelBubble}set cancelBubble(e){this[k].cancelBubble=!!e}get defaultPrevented(){return this[k].defaultPrevented}get returnValue(){return this[k].returnValue}set returnValue(e){e||this.preventDefault()}get timeStamp(){return this[k].timeStamp}composedPath(){let e=this.target?[this.target]:[];return this.currentTarget&&this.currentTarget!==this.target&&e.push(this.currentTarget),e}initEvent(...e){const[t,r,o]=e;n(e,1,"Event","initEvent");const s=this[k];s[_]||(s.type=""+t,s.bubbles=!!r,s.cancelable=!!o)}preventDefault(){const e=this[k];e[V]?console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`):this.cancelable&&(e[J]=!0,e.defaultPrevented=!0,e.returnValue=!1)}stopImmediatePropagation(){this[k][Y]=!0,this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}toString(){return"[object Event]"}get isPolyfill(){return{symbol:t,hierarchy:["Event"]}}}const X={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($,X),Object.defineProperties($.prototype,X),r($,"Event");const G=(new Date).getTime(),z=Symbol(),V=Symbol(),_=Symbol(),J=Symbol(),Y=Symbol();class K{constructor(){this.type="",this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.target=null,this.currentTarget=null,this.eventPhase=$.NONE,this.cancelBubble=!1,this.defaultPrevented=!1,this.returnValue=!0,this.timeStamp=(new Date).getTime()-G,this[H]=!1,this[U]=!1,this[M]=!1,this[B]=!1,this[I]=!1}}function W(e,t){Object.defineProperty(e[k],z,{value:t,writable:!0,enumerable:!0,configurable:!0})}H=z,U=V,M=_,B=J,I=Y;function Q(e,t){const r=e[k];switch(t){case 0:return r[V];case 1:return r[_];case 2:return r[J];case 3:return r[Y]}}function Z(e,t,r){const n=e[k];switch(t){case 0:n[V]=r;break;case 1:n[_]=r;break;case 2:n[J]=r;break;case 3:n[Y]=r}}function ee(e,t,r,n=!0){let o=new $(t,r);return o[k].target=e,o[k][z]=n,o}const te=e.EventTarget?e.Event:$;var re;const ne=Symbol();class oe{constructor(){this[ne]=new ie(this),this[ne].name=new.target.name}addEventListener(...e){const[t,r,o]=e;if(n(e,2,this[ne].name,"addEventListener"),"function"!=typeof r&&"object"!=typeof r&&void 0!==r)throw new TypeError(`Failed to execute 'addEventListener' on '${this[ne].name}': parameter 2 is not of type 'Object'.`);const s=this[ne],i=new le(t,r);if(i.options.capture="boolean"==typeof o?o:!!(null==o?void 0:o.capture),!s[se].some(e=>e.equals(i))){if(o&&"object"==typeof o){const{once:e,passive:t,signal:r}=o;i.options.once=!!e,i.options.passive=!!t,r&&(i.options.signal=r,function(e,t,r){const n=e[ne],o=()=>{n[se]=n[se].filter(e=>!e.equals(r)),t.removeEventListener("abort",o)};try{t.addEventListener("abort",o)}catch(e){console.warn(e)}}(this,r,i))}s[se].push(i);const e=e=>e.options.capture?0:1;s[se]=s[se].sort((t,r)=>e(t)-e(r))}}dispatchEvent(...e){const[t]=e;if(n(e,1,this[ne].name,"dispatchEvent"),!(t instanceof $))throw new TypeError(`Failed to execute 'dispatchEvent' on '${this[ne].name}': parameter 1 is not of type 'Event'.`);return W(t,!1),t[k].target=this,ae(this,t)}removeEventListener(...e){const[t,r,o]=e;if(n(e,2,this[ne].name,"removeEventListener"),"function"!=typeof r&&"object"!=typeof r&&void 0!==r)throw new TypeError(`Failed to execute 'removeEventListener' on '${this[ne].name}': parameter 2 is not of type 'Object'.`);const s=this[ne],i=new le(t,r);i.options.capture="boolean"==typeof o?o:!!(null==o?void 0:o.capture),s[se].some(e=>e.equals(i))&&(s[se]=s[se].filter(e=>!e.equals(i)))}toString(){return"[object EventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["EventTarget"]}}}r(oe,"EventTarget");const se=Symbol();class ie{constructor(e){this.name="EventTarget",this[re]=[],this.target=e}}function ae(e,t){const r=e[ne],n=t[k];t.target||(n.target=e),n.currentTarget=e,n.eventPhase=$.AT_TARGET,Z(t,1,!0);let o=[];for(let n=0;n<r[se].length&&!Q(t,3);++n){let s=r[se][n];if(s.type===t.type){s.options.once&&o.push(n),Z(t,0,!!s.options.passive);try{let r=s.callback;"function"==typeof r&&r.call(e,t)}catch(e){console.error(e)}Z(t,0,!1)}}return o.length>0&&(r[se]=r[se].reduce((e,t,r)=>(-1===o.indexOf(r)&&e.push(t),e),[])),n.currentTarget=null,n.eventPhase=$.NONE,Z(t,1,!1),!(t.cancelable&&Q(t,2))}re=se;class le{constructor(e,t){var r;this.options={},this.type=""+e,this.callback="function"==typeof(r=t)?r:function(e){return!!e&&"handleEvent"in e&&"function"==typeof e.handleEvent}(r)?r.handleEvent:r}equals(e){return Object.is(this.type,e.type)&&Object.is(this.callback,e.callback)&&Object.is(this.options.capture,e.options.capture)}}function ue(e,t,r,n){"function"==typeof r?e.addEventListener(t,n):e.removeEventListener(t,n)}function ce(e,t,r){"function"==typeof t&&t.call(e,r)}const he=e.EventTarget||oe,de=Symbol();class fe extends ${constructor(e,t){var r,n;super(e,t),this[de]=new pe;const o=this[de];o.lengthComputable=!!(null==t?void 0:t.lengthComputable),o.loaded=Number(null!==(r=null==t?void 0:t.loaded)&&void 0!==r?r:0),o.total=Number(null!==(n=null==t?void 0:t.total)&&void 0!==n?n:0);let s="";if(isNaN(o.loaded)&&(s="loaded"),isNaN(o.total)&&(s="total"),s)throw new TypeError(`Failed to construct 'ProgressEvent': Failed to read the '${s}' property from 'ProgressEventInit': The provided double value is non-finite.`)}get lengthComputable(){return ye(this[de].lengthComputable)}get loaded(){return ye(this[de].loaded)}get total(){return ye(this[de].total)}toString(){return"[object ProgressEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["ProgressEvent","Event"]}}}r(fe,"ProgressEvent");class pe{constructor(){this.lengthComputable=!1,this.loaded=0,this.total=0}}function ye(e){return"function"==typeof e?e():e}function ge(e,t,r=0,n=0){let o=function(e,t,{lengthComputable:r=!1,loaded:n=0,total:o=0}={}){let s=new fe(t);return s[de].lengthComputable=r,s[de].loaded=n,s[de].total=o,s[k].target=e,W(s,!0),s}(e,t,{lengthComputable:()=>ye(n)>0,loaded:r,total:n});ae(e,o)}const be=e.EventTarget?e.ProgressEvent:fe;var me;const ve=Symbol();class we extends oe{constructor(){super(),this[ve]=new Se(this)}get readyState(){return this[ve].readyState}get result(){return this[ve].result}get error(){return this[ve].error}abort(){if(this.readyState===we.LOADING){const e=this[ve];e.readyState=we.DONE,e.result=null,e.error=new o("An ongoing operation was aborted, typically with a call to abort().","AbortError"),ge(this,"abort")}}readAsArrayBuffer(...e){Re(this,"readAsArrayBuffer",e,e=>{this[ve].result=A(e).buffer.slice(0)})}readAsBinaryString(...e){Re(this,"readAsBinaryString",e,e=>{let t=[],r=A(e);for(let e=0;e<r.length;++e){let n=r[e];t.push(String.fromCharCode(n))}this[ve].result=t.join("")})}readAsDataURL(...e){Re(this,"readAsDataURL",e,e=>{this[ve].result="data:"+(e.type||"application/octet-stream")+";base64,"+F(A(e))})}readAsText(...e){const t=e.length>1?e[1]:void 0;Re(this,"readAsText",e,e=>{if(void 0!==t){let e=""+t;-1===["utf-8","utf8","unicode-1-1-utf-8"].indexOf(e.toLowerCase())&&console.error(`TypeError: Failed to execute 'readAsText' on 'FileReader': encoding ('${e}') not implemented.`)}this[ve].result=L(A(e))})}get onabort(){return this[ve].onabort}set onabort(e){this[ve].onabort=e,Ae(this,"abort")}get onerror(){return this[ve].onerror}set onerror(e){this[ve].onerror=e,Ae(this,"error")}get onload(){return this[ve].onload}set onload(e){this[ve].onload=e,Ae(this,"load")}get onloadend(){return this[ve].onloadend}set onloadend(e){this[ve].onloadend=e,Ae(this,"loadend")}get onloadstart(){return this[ve].onloadstart}set onloadstart(e){this[ve].onloadstart=e,Ae(this,"loadstart")}get onprogress(){return this[ve].onprogress}set onprogress(e){this[ve].onprogress=e,Ae(this,"progress")}toString(){return"[object FileReader]"}get isPolyfill(){return{symbol:t,hierarchy:["FileReader","EventTarget"]}}}const Ee={EMPTY:{value:0,enumerable:!0},LOADING:{value:1,enumerable:!0},DONE:{value:2,enumerable:!0}};Object.defineProperties(we,Ee),Object.defineProperties(we.prototype,Ee),r(we,"FileReader");const Te=Symbol();class Se{constructor(e){var t;this.readyState=we.EMPTY,this.result=null,this.error=null,this[me]=(t=this,{onabort:e=>{ce(t.target,t.onabort,e)},onerror:e=>{ce(t.target,t.onerror,e)},onload:e=>{ce(t.target,t.onload,e)},onloadend:e=>{ce(t.target,t.onloadend,e)},onloadstart:e=>{ce(t.target,t.onloadstart,e)},onprogress:e=>{ce(t.target,t.onprogress,e)}}),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.target=e}}function Re(e,t,r,o){const[s]=r;if(n(r,1,"FileReader",t),!i("Blob",s))throw new TypeError("Failed to execute '"+t+"' on 'FileReader': parameter 1 is not of type 'Blob'.");const a=e[ve];a.error=null,a.readyState=we.LOADING,ge(a.target,"loadstart",0,s.size),setTimeout(()=>{if(a.readyState===we.LOADING){a.readyState=we.DONE;try{o(s),ge(a.target,"load",s.size,s.size)}catch(e){a.result=null,a.error=e,ge(a.target,"error",0,s.size)}}ge(a.target,"loadend",a.result?s.size:0,s.size)})}function Ae(e,t){const r=e[ve],n="on"+t;ue(e,t,r[n],r[Te][n])}me=Te;const xe=e.Blob?e.FileReader:we;var Pe;const qe=Symbol(),Le=(e,t,r)=>{n(e,t,"URLSearchParams",r)};class Fe{constructor(e){if(this[qe]=new je,void 0!==e)if(s("URLSearchParams",e))e.forEach((e,t)=>{this.append(t,e)},this);else if(e&&"object"==typeof e)if(Array.isArray(e)||Symbol.iterator in e){let t=Array.isArray(e)?e:Array.from(e);for(let e=0;e<t.length;++e){let r=t[e];if(!(Array.isArray(r)||r&&"object"==typeof r&&Symbol.iterator in r))throw new TypeError("Failed to construct 'URLSearchParams': The provided value cannot be converted to a sequence.");{let e=Array.isArray(r)?r:Array.from(r);if(2!==e.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");this.append(e[0],e[1])}}}else Object.getOwnPropertyNames(e).forEach(t=>{this.append(t,e[t])},this);else{let t=""+e;0===t.indexOf("?")&&(t=t.slice(1));let r=t.split("&");for(let e=0;e<r.length;++e){let t=r[e],n=t.indexOf("=");n>-1?this.append(Ne(t.slice(0,n)),Ne(t.slice(n+1))):t&&this.append(Ne(t),"")}}}get size(){return this[qe][Oe].length}append(...e){const[t,r]=e;Le(e,2,"append"),this[qe][Oe].push([""+t,De(r)])}delete(...e){const[t,r]=e;Le(e,1,"delete");let n=""+t,o=-1,s=this[qe][Oe],i=[];for(let t=0;t<s.length;++t){let a=s[t];a[0]!==n?i.push(a):(1!==e.length&&a[1]!==De(r)&&i.push(a),o=t)}o>-1&&(this[qe][Oe]=i)}get(...e){const[t]=e;Le(e,1,"get");let r=""+t,n=this[qe][Oe];for(let e=0;e<n.length;++e){let t=n[e];if(t[0]===r)return t[1]}return null}getAll(...e){const[t]=e;Le(e,1,"getAll");let r=""+t,n=this[qe][Oe],o=[];for(let e=0;e<n.length;++e){let t=n[e];t[0]===r&&o.push(t[1])}return o}has(...e){const[t,r]=e;Le(e,1,"has");let n=""+t,o=this[qe][Oe];for(let t=0;t<o.length;++t){let s=o[t];if(s[0]===n){if(1===e.length)return!0;if(s[1]===De(r))return!0}}return!1}set(...e){const[t,r]=e;Le(e,2,"set");let n=""+t,o=De(r),s=-1,i=this[qe][Oe],a=[];for(let e=0;e<i.length;++e){let t=i[e];t[0]!==n?a.push(t):-1===s&&(s=e,a.push([n,o]))}-1===s&&a.push([n,o]),this[qe][Oe]=a}sort(){this[qe][Oe].sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0)}forEach(...e){const[t,r]=e;if(Le(e,1,"forEach"),"function"!=typeof t)throw new TypeError("Failed to execute 'forEach' on 'URLSearchParams': parameter 1 is not of type 'Function'.");let n=this[qe][Oe];for(let e=0;e<n.length;++e){let o=n[e];t.call(r,o[1],o[0],this)}}entries(){return this[qe][Oe].map(e=>[e[0],e[1]]).values()}keys(){return this[qe][Oe].map(e=>e[0]).values()}values(){return this[qe][Oe].map(e=>e[1]).values()}[Symbol.iterator](){return this.entries()}toString(){let e=this[qe][Oe],t=[];for(let r=0;r<e.length;++r){let n=e[r];t.push(Ce(n[0])+"="+Ce(n[1]))}return t.join("&")}get isPolyfill(){return{symbol:t,hierarchy:["URLSearchParams"]}}}r(Fe,"URLSearchParams");const Oe=Symbol();class je{constructor(){this[Pe]=[]}}function De(e){return"string"==typeof e?e:null!=e&&"function"==typeof e.toString?e.toString():JSON.stringify(e)}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,e=>t[e])}function Ne(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,e=>decodeURIComponent(e))}Pe=Oe;const He=e.URLSearchParams||Fe;var Ue;const Me=Symbol(),Be=(e,t,r)=>{n(e,t,"FormData",r)};class Ie{constructor(e,t){void 0===t?void 0!==e&&console.error("TypeError: Failed to construct 'FormData': parameter 1 not implemented."):null!==t&&console.error("TypeError: Failed to construct 'FormData': parameter 1 and parameter 2 not implemented."),this[Me]=new $e}append(...e){const[t,r,n]=e;Be(e,2,"append"),this[Me][ke].push(Xe(t,r,n))}delete(...e){const[t]=e;Be(e,1,"delete");let r=""+t,n=-1,o=this[Me][ke],s=[];for(let e=0;e<o.length;++e){let t=o[e];t[0]!==r?s.push(t):n=e}n>-1&&(this[Me][ke]=s)}get(...e){const[t]=e;Be(e,1,"get");let r=""+t,n=this[Me][ke];for(let e=0;e<n.length;++e){let t=n[e];if(t[0]===r)return t[1]}return null}getAll(...e){const[t]=e;Be(e,1,"getAll");let r=""+t,n=this[Me][ke],o=[];for(let e=0;e<n.length;++e){let t=n[e];t[0]===r&&o.push(t[1])}return o}has(...e){const[t]=e;Be(e,1,"has");let r=""+t,n=this[Me][ke];for(let e=0;e<n.length;++e){if(n[e][0]===r)return!0}return!1}set(...e){const[t,r,n]=e;Be(e,2,"set");let o=""+t,s=Xe(t,r,n),i=-1,a=this[Me][ke],l=[];for(let e=0;e<a.length;++e){let t=a[e];t[0]!==o?l.push(t):-1===i&&(i=e,l.push(s))}-1===i&&l.push(s),this[Me][ke]=l}forEach(...e){const[t,r]=e;if(Be(e,1,"forEach"),"function"!=typeof t)throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");let n=this[Me][ke];for(let e=0;e<n.length;++e){let o=n[e];t.call(r,o[1],o[0],r)}}entries(){return this[Me][ke].map(e=>[e[0],e[1]]).values()}keys(){return this[Me][ke].map(e=>e[0]).values()}values(){return this[Me][ke].map(e=>e[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object FormData]"}get isPolyfill(){return{symbol:t,hierarchy:["FormData"]}}}r(Ie,"FormData");const ke=Symbol();class $e{constructor(){this[Ue]=[]}}function Xe(e,t,r){return i("Blob",t)?(r=void 0!==r?""+r:"string"==typeof t.name?t.name:"blob",(t.name!==r||s("Blob",t))&&(t=new D([t],r)),[""+e,t]):[""+e,""+t]}function Ge(e){return e.replace(/\r?\n|\r/g,"\r\n")}function ze(e){return e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")}Ue=ke;const Ve=e.FormData||Ie;var _e,Je;const Ye=Symbol(),Ke=(e,t,r)=>{n(e,t,"Headers",r)};class We{constructor(e){if(this[Ye]=new et,void 0!==e)if(s("Headers",e))e.forEach((e,t)=>{this.append(t,e)},this);else if(Array.isArray(e)||e&&"object"==typeof e&&Symbol.iterator in e){(Array.isArray(e)?e:Array.from(e)).forEach(e=>{if(!(Array.isArray(e)||e&&"object"==typeof e&&Symbol.iterator in e))throw new TypeError("Failed to construct 'Headers': The provided value cannot be converted to a sequence.");{let t=Array.isArray(e)?e:Array.from(e);if(2!==t.length)throw new TypeError("Failed to construct 'Headers': Invalid value");this.append(t[0],t[1])}},this)}else{if(!e||"object"!=typeof e)throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(record<ByteString, ByteString> or sequence<sequence<ByteString>>)'.");Object.getOwnPropertyNames(e).forEach(t=>{this.append(t,e[t])},this)}this[Ye][Qe]=!0}append(...e){const[t,r]=e;Ke(e,2,"append");let n=nt(t,rt(this[Ye][Qe]?"append":"")),o=ot(r),s=-1,i=this[Ye][Ze];for(let e=0;e<i.length;++e){let t=i[e];if(t[0]===n){t[1]=`${t[1]}, ${o}`,s=e;break}}-1===s&&i.push([n,o])}delete(...e){const[t]=e;Ke(e,1,"delete");let r=nt(t,rt("delete")),n=-1,o=this[Ye][Ze],s=[];for(let e=0;e<o.length;++e){let t=o[e];t[0]!==r?s.push(t):n=e}n>-1&&(this[Ye][Ze]=s)}get(...e){const[t]=e;Ke(e,1,"get");let r=nt(t,rt("get")),n=this[Ye][Ze];for(let e=0;e<n.length;++e){let t=n[e];if(t[0]===r)return t[1]}return null}getSetCookie(){let e=this.get("Set-Cookie");return e?e.split(", "):[]}has(...e){const[t]=e;Ke(e,1,"has");let r=nt(t,rt("has")),n=this[Ye][Ze];for(let e=0;e<n.length;++e){if(n[e][0]===r)return!0}return!1}set(...e){const[t,r]=e;Ke(e,2,"set");let n=nt(t,rt("set")),o=ot(r),s=-1,i=this[Ye][Ze];for(let e=0;e<i.length;++e){let t=i[e];if(t[0]===n){t[1]=o,s=e;break}}-1===s&&i.push([n,o])}forEach(...e){const[t,r]=e;if(Ke(e,1,"forEach"),"function"!=typeof t)throw new TypeError("Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.");let n=this[Ye][Ze];for(let e=0;e<n.length;++e){let o=n[e];t.call(r,o[1],o[0],this)}}entries(){return this[Ye][Ze].map(e=>[e[0],e[1]]).values()}keys(){return this[Ye][Ze].map(e=>e[0]).values()}values(){return this[Ye][Ze].map(e=>e[1]).values()}[Symbol.iterator](){return this.entries()}toString(){return"[object Headers]"}get isPolyfill(){return{symbol:t,hierarchy:["Headers"]}}}r(We,"Headers");const Qe=Symbol(),Ze=Symbol();class et{constructor(){this[_e]=!1,this[Je]=[]}}function rt(e){return()=>{throw new TypeError(`Failed to ${e?"execute '"+e+"' on":"construct"} 'Headers': Invalid name`)}}function nt(e,t){return"string"!=typeof e&&(e=""+e),t&&(/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)&&t(),e.toLowerCase()}function ot(e){return"string"==typeof e?e:""+e}function st(e){let t=new We;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(e=>0===e.indexOf("\n")?e.substring(1,e.length):e).forEach(e=>{let r=e.split(":"),n=r.shift().trim();if(n){let e=r.join(":").trim();try{t.append(n,e)}catch(e){console.warn(`SyntaxError: Response.headers: '${n}' is not a valid HTTP header field name.`)}}}),t}_e=Qe,Je=Ze;const it=e.Headers||We;var at;const lt=Symbol();class ut{constructor(){if(new.target===ut)throw new TypeError("Failed to construct 'Body': Illegal constructor");this[lt]=new ht}get body(){if(!this[lt][ct])return null;throw new TypeError(`Failed to access 'body' on '${this[lt].name}': property not implemented.`)}get bodyUsed(){return this[lt].bodyUsed}arrayBuffer(){const e="arrayBuffer";return yt(this,e)||pt(this,e)}blob(){const e="blob";return yt(this,e)||pt(this,e)}bytes(){const e="bytes";return yt(this,e)||pt(this,e)}formData(){const e="formData";return yt(this,e)||pt(this,e)}json(){const e="json";return yt(this,e)||pt(this,e)}text(){const e="text";return yt(this,e)||pt(this,e)}toString(){return"[object Body]"}get isPolyfill(){return{symbol:t,hierarchy:["Body"]}}}r(ut,"Body");const ct=Symbol();class ht{constructor(){this.name="Body",this.bodyUsed=!1,this[at]=""}}function dt(e,t){const r=e;if(s("ReadableStream",t))throw new TypeError(`Failed to construct '${r[lt].name}': ReadableStream not implemented.`);r[lt][ct]=gt(t,!0,e=>{r.headers.has("Content-Type")||r.headers.set("Content-Type",e)})}function ft(e){return e[lt][ct]}function pt(e,t){return new Promise((r,n)=>{try{r(function(e,t){const r=e[lt][ct];if("arrayBuffer"===t)return bt("arraybuffer",r);if("blob"===t)return bt("blob",r);if("bytes"===t){let e=bt("arraybuffer",r);return new Uint8Array(e)}if("formData"===t){const t=e=>{if(!e)return;if(!/multipart\/form-data/i.test(e))return;let t=e.match(/boundary\s*=\s*([^;]+)/i);if(t&&t[1]){return t[1].trim().replace(/^["']|["']$/g,"")}};return function(e,t){const r=()=>{throw new TypeError("Could not parse content as FormData.")};"string"==typeof e&&""!==e.trim()||r();let n=e.indexOf("\r\n");-1===n&&r();let o=e.substring(2,n).trim();o||r(),void 0!==t&&t!==o&&r();let s=e.split(`--${o}`).filter(e=>{let t=e.trim();return""!==t&&"--"!==t});0===s.length&&r();let i=new Ie;return s.forEach(e=>{let t=e.indexOf("\r\n\r\n");-1===t&&r();let n=e.substring(0,t).trim(),o=n.match(/name="([^"]*)"/);(!o||o.length<2)&&r();let s=o[1],a=n.match(/filename="([^"]*)"/),l=e.substring(t+4);if(a){let e=a[1]||"",t=n.match(/Content-Type: ([^\r\n]+)/),r=t?(t[1]||"").trim():"text/plain",o=l.replace(/\r\n/g,"");i.append(s,new D([o],e,{type:r}))}else i.append(s,l.replace(/^[\r\n]+|[\r\n]+$/g,""))}),i}(bt("text",r),t(e.headers.get("Content-Type"))||"")}return bt("json"===t?"json":"text",r)}(e,t))}catch(e){n(e)}})}function yt(e,t){const r=e[lt];if(r[ct])return r.bodyUsed?Promise.reject(new TypeError(`Failed to execute '${t}' on '${r.name}': body stream already read`)):void(r.bodyUsed=!0)}function gt(e,t=!0,r,n){let o;if("string"==typeof e)o=e,r&&r("text/plain;charset=UTF-8");else if(s("URLSearchParams",e))o=e.toString(),r&&r("application/x-www-form-urlencoded;charset=UTF-8");else if(e instanceof ArrayBuffer)o=t?e.slice(0):e;else if(ArrayBuffer.isView(e))o=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);else if(i("Blob",e))o=A(e).buffer.slice(0),r&&e.type&&r(e.type);else if(i("FormData",e)){let t=function(e){const t="----formdata-mphttpx-"+Math.random(),r=`--${t}\r\nContent-Disposition: form-data; name="`;let n=[];for(let t=0;t<e[Me][ke].length;++t){let o=e[Me][ke][t],s=o[0],i=o[1];"string"==typeof i?n.push(r+ze(Ge(s))+`"\r\n\r\n${Ge(i)}\r\n`):n.push(r+ze(Ge(s))+`"; filename="${ze(i.name)}"\r\nContent-Type: ${i.type||"application/octet-stream"}\r\n\r\n`,i,"\r\n")}return n.push(`--${t}--`),new T(n,{type:"multipart/form-data; boundary="+t})}(e);o=A(t).buffer,r&&r(t.type)}else o=e?""+e:"";if(n){let e=!1,t=0;n(()=>(e||(e=!0,t=("string"==typeof o?q(o).buffer:o).byteLength),t))}return o}function bt(e,t){let r=t?"string"==typeof t||t instanceof ArrayBuffer?t:JSON.stringify(t):"";return e&&"text"!==e?"json"===e?JSON.parse("string"==typeof r?r:L(r)):"arraybuffer"===e?r instanceof ArrayBuffer?r.slice(0):q(r).buffer:"blob"===e?new T([r]):r:"string"==typeof r?r:L(r)}var mt;at=ct;const vt=Symbol();class wt extends oe{static abort(e){let t=Rt();return St(t,e,!1),t}static any(...e){const[t]=e;if(n(e,1,"AbortSignal","any"),!(Array.isArray(t)||t&&"object"==typeof t&&Symbol.iterator in t))throw new TypeError("Failed to execute 'any' on 'AbortSignal': The provided value cannot be converted to a sequence.");let r=Array.isArray(t)?t:Array.from(t);r.forEach(e=>{if(!i("EventTarget",e))throw new TypeError("Failed to execute 'any' on 'AbortSignal': Failed to convert value to 'AbortSignal'.")});let o=Rt(),s=r.find(e=>e.aborted);if(s)St(o,s.reason,!1);else{function a(e){for(let e=0;e<r.length;++e){r[e].removeEventListener("abort",a)}St(o,this.reason,!0,e.isTrusted)}for(let l=0;l<r.length;++l){r[l].addEventListener("abort",a)}}return o}static timeout(...e){const[t]=e;if(n(e,1,"AbortSignal","timeout"),!(t>=0))throw new TypeError("Failed to execute 'timeout' on 'AbortSignal': Value is outside the 'unsigned long long' value range.");let r=Rt();return setTimeout(()=>{St(r,new o("signal timed out","TimeoutError"))},t),r}constructor(){if(new.target===wt)throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");super(),this[vt]=new Tt(this)}get aborted(){return this[vt].aborted}get reason(){return this[vt].reason}throwIfAborted(){if(this.aborted)throw this.reason}get onabort(){return this[vt].onabort}set onabort(e){this[vt].onabort=e,ue(this,"abort",e,this[vt][Et].onabort)}toString(){return"[object AbortSignal]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortSignal","EventTarget"]}}}r(wt,"AbortSignal");const Et=Symbol();class Tt{constructor(e){var t;this.aborted=!1,this.reason=void 0,this[mt]=(t=this,{onabort:e=>{ce(t.target,t.onabort,e)}}),this.onabort=null,this.target=e}}function St(e,t,r=!0,n=!0){const s=e[vt];if(!s.aborted&&(s.aborted=!0,s.reason=null!=t?t:new o("signal is aborted without reason","AbortError"),r)){ae(e,ee(e,"abort",void 0,n))}}function Rt(){let e=Object.create(wt.prototype);return e[ne]=new ie(e),e[vt]=new Tt(e),e}mt=Et;const At=e.AbortSignal||wt,xt=Symbol();class Pt{constructor(){this[xt]=new qt}get signal(){return this[xt].signal}abort(e){St(this[xt].signal,e)}toString(){return"[object AbortController]"}get isPolyfill(){return{symbol:t,hierarchy:["AbortController"]}}}r(Pt,"AbortController");class qt{constructor(){this.signal=Rt()}}const Lt=e.AbortController||Pt,Ft=Symbol();class Ot extends ut{constructor(...e){const[t,r]=e;n(e,1,"Request"),super(),this[lt].name="Request",this[Ft]=new jt;const o=this[Ft];let s=null!=r?r:{};if("object"!=typeof s)throw new TypeError("Failed to construct 'Request': The provided value is not of type 'RequestInit'.");let a=s.body;if(i("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.");o.cache=t.cache,o.credentials=t.credentials,s.headers||(o.headers=new We(t.headers)),o.method=t.method,o.mode=t.mode;let e=t[Ft].signal;e&&(o.signal=e),o.url=t.url;let r=ft(t);a||""===r||(a=r,t[lt].bodyUsed=!0)}else o.url=""+t;if(s.cache&&(o.cache=s.cache),s.credentials&&(o.credentials=s.credentials),s.headers&&(o.headers=new We(s.headers)),s.method&&(o.method=Ct(s.method)),s.mode&&(o.mode=s.mode),s.signal&&(o.signal=s.signal),("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");if(dt(this,a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==s.cache&&"no-cache"!==s.cache)){let e=/([?&])_=[^&]*/;if(e.test(this.url))o.url=this.url.replace(e,"$1_="+(new Date).getTime());else{let e=/\?/;o.url+=(e.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}get cache(){return this[Ft].cache}get credentials(){return this[Ft].credentials}get destination(){return this[Ft].destination}get headers(){const e=this[Ft];return e.headers||(e.headers=new We),e.headers}get integrity(){return this[Ft].integrity}get keepalive(){return this[Ft].keepalive}get method(){return this[Ft].method}get mode(){return this[Ft].mode}get redirect(){return this[Ft].redirect}get referrer(){return this[Ft].referrer}get referrerPolicy(){return this[Ft].referrerPolicy}get signal(){const e=this[Ft];return e.signal||(e.signal=(new Pt).signal),e.signal}get url(){return this[Ft].url}clone(){var e;if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Request': Request body is already used");return new Ot(this,{body:null!==(e=ft(this))&&void 0!==e?e:null})}toString(){return"[object Request]"}get isPolyfill(){return{symbol:t,hierarchy:["Request"]}}}r(Ot,"Request");class jt{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 Dt=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function Ct(e){let t=e.toUpperCase();return Dt.indexOf(t)>-1?t:e}const Nt=e.Request||Ot;var Ht;const Ut=Symbol();class Mt extends oe{constructor(){if(new.target===Mt)throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");super(),this[Ut]=new It(this)}get onabort(){return this[Ut].onabort}set onabort(e){this[Ut].onabort=e,kt(this,"abort")}get onerror(){return this[Ut].onerror}set onerror(e){this[Ut].onerror=e,kt(this,"error")}get onload(){return this[Ut].onload}set onload(e){this[Ut].onload=e,kt(this,"load")}get onloadend(){return this[Ut].onloadend}set onloadend(e){this[Ut].onloadend=e,kt(this,"loadend")}get onloadstart(){return this[Ut].onloadstart}set onloadstart(e){this[Ut].onloadstart=e,kt(this,"loadstart")}get onprogress(){return this[Ut].onprogress}set onprogress(e){this[Ut].onprogress=e,kt(this,"progress")}get ontimeout(){return this[Ut].ontimeout}set ontimeout(e){this[Ut].ontimeout=e,kt(this,"timeout")}toString(){return"[object XMLHttpRequestEventTarget]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestEventTarget","EventTarget"]}}}r(Mt,"XMLHttpRequestEventTarget");const Bt=Symbol();class It{constructor(e){var t;this[Ht]=(t=this,{onabort:e=>{ce(t.target,t.onabort,e)},onerror:e=>{ce(t.target,t.onerror,e)},onload:e=>{ce(t.target,t.onload,e)},onloadend:e=>{ce(t.target,t.onloadend,e)},onloadstart:e=>{ce(t.target,t.onloadstart,e)},onprogress:e=>{ce(t.target,t.onprogress,e)},ontimeout:e=>{ce(t.target,t.ontimeout,e)}}),this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.target=e}}function kt(e,t){const r=e[Ut],n="on"+t;ue(e,t,r[n],r[Bt][n])}Ht=Bt;class $t extends Mt{constructor(){if(new.target===$t)throw new TypeError("Failed to construct 'XMLHttpRequestUpload': Illegal constructor");super()}toString(){return"[object XMLHttpRequestUpload]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequestUpload","XMLHttpRequestEventTarget","EventTarget"]}}}r($t,"XMLHttpRequestUpload");const Xt=(()=>{let t,r="undefined",n="request",o="function";if(t=typeof wx!==r&&typeof(null===wx||void 0===wx?void 0:wx[n])===o&&wx||typeof my!==r&&typeof(null===my||void 0===my?void 0:my[n])===o&&my||typeof qq!==r&&typeof(null===qq||void 0===qq?void 0:qq[n])===o&&qq||typeof jd!==r&&typeof(null===jd||void 0===jd?void 0:jd[n])===o&&jd||typeof swan!==r&&typeof(null===swan||void 0===swan?void 0:swan[n])===o&&swan||typeof tt!==r&&typeof(null===tt||void 0===tt?void 0:tt[n])===o&&tt||typeof ks!==r&&typeof(null===ks||void 0===ks?void 0:ks[n])===o&&ks||typeof qh!==r&&typeof(null===qh||void 0===qh?void 0:qh[n])===o&&qh||typeof xhs!==r&&typeof(null===xhs||void 0===xhs?void 0:xhs[n])===o&&xhs||void 0,typeof e.XMLHttpRequest!==o)return void 0===t&&(t=typeof uni!==r&&typeof(null===uni||void 0===uni?void 0:uni[n])===o&&uni||typeof Taro!==r&&typeof(null===Taro||void 0===Taro?void 0:Taro[n])===o&&Taro||void 0),t})();var Gt,zt,Vt,_t,Jt,Yt,Kt,Wt,Qt,Zt;const er={request:Xt?Xt.request:function(e){const t="NOT_SUPPORTED_ERR",r={errMsg:t,errno:9,exception:{retryCount:0,reasons:[{errMsg:t,errno:9}]},useHttpDNS:!1};throw Promise.resolve(r).then(t=>{try{e.fail&&e.fail(t)}catch(e){console.error(e)}}).then(()=>{e.complete&&e.complete(r)}),new ReferenceError("request is not defined")}},tr=e=>{er.request=e},rr=Symbol();class nr extends Mt{constructor(){super(),this[rr]=new yr(this)}get readyState(){return this[rr].readyState}get response(){return this[rr].response}get responseText(){return this.responseType&&"text"!==this.responseType?"":this.response}get responseType(){return this[rr].responseType}set responseType(e){var t;this[rr].responseType=(t=e,Tr.indexOf(t)>-1?t:"")}get responseURL(){return this[rr].responseURL}get responseXML(){return null}get status(){return this[rr].status}get statusText(){return this.readyState===nr.UNSENT||this.readyState===nr.OPENED?"":this[rr].statusText||(e=this.status,Ar[e]||"unknown");var e}get timeout(){return this[rr].timeout}set timeout(e){this[rr].timeout=e>0?e:0}get upload(){const e=this[rr];return e.upload||(e.upload=function(){let e=Object.create($t.prototype);return e[ne]=new ie(e),e[Ut]=new It(e),e}()),e.upload}get withCredentials(){return this[rr].withCredentials}set withCredentials(e){this[rr].withCredentials=!!e}abort(){vr(this)}getAllResponseHeaders(){return this[rr][dr]?Array.from(this[rr][dr].entries()).map(([e,t])=>`${e}: ${t}\r\n`).join(""):""}getResponseHeader(...e){const[t]=e;return n(e,1,"XMLHttpRequest","getResponseHeader"),this[rr][dr]?this[rr][dr].get(t):null}open(...e){const[t,r,o=!0,s=null,i=null]=e;n(e,2,"XMLHttpRequest","open"),o||console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience.");const a=this[rr];if(vr(this,!1),a[cr]=Ct(t),a[ur]=""+r,null!==s||null!==i){let e=""+(null!=s?s:""),t=""+(null!=i?i:"");if(e.length>0||t.length>0){let r=`Basic ${F(q(e+":"+t))}`;this.setRequestHeader("Authorization",r)}}a[ir]=!0,Er(this,nr.OPENED)}overrideMimeType(...e){const[t]=e;n(e,1,"XMLHttpRequest","overrideMimeType"),this[rr][ir]&&console.error(`TypeError: Failed to execute 'overrideMimeType' on 'XMLHttpRequest': mimeType ('${t}') not implemented.`)}send(e){const t=this[rr];if(!t[ir]||t.readyState!==nr.OPENED)throw new o("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");t[ir]=!1;const r="GET"!==t[cr]&&"HEAD"!==t[cr],n=r&&!t[hr].has("Content-Type"),s=r&&!!e;let i=Rr;const a=n?e=>{t[hr].set("Content-Type",e)}:void 0,l=s?e=>{i=e}:void 0;let u=e;try{u=gt(e,!1,a,l)}catch(e){console.warn(e)}let c={url:t[ur],method:t[cr],header:(()=>{let e={};return t[hr].forEach((t,r)=>{e[r]=t}),e})(),data:u,dataType:"json"===t.responseType?"json":Sr(t.responseType),responseType:Sr(t.responseType),withCredentials:t.withCredentials,success:gr.bind(this),fail:br.bind(this),complete:mr.bind(this)};t[pr]=er.request(c),ge(this,"loadstart"),s&&t.upload&&ge(this.upload,"loadstart",0,i),setTimeout(()=>{if(t.upload){const e=t[ir]||t.readyState!==nr.OPENED,r=e?0:i;e?ge(this.upload,"abort"):s&&ge(this.upload,"load",r,r),(e||s)&&ge(this.upload,"loadend",r,r)}}),function(e){const t=e[rr];t.timeout&&(t[lr]=setTimeout(()=>{t.status||t.readyState===nr.DONE||(t[pr]&&t[pr].abort(),Er(e,nr.DONE),ge(e,"timeout"))},t.timeout))}(this)}setRequestHeader(...e){const[t,r]=e;n(e,2,"XMLHttpRequest","setRequestHeader");const s=this[rr];if(!s[ir]||s.readyState!==nr.OPENED)throw new o("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.","InvalidStateError");let i=nt(t,()=>{throw new SyntaxError(`Failed to execute 'setRequestHeader' on 'XMLHttpRequest': '${t}' is not a valid HTTP header field name.`)});s[hr].append(i,r)}get onreadystatechange(){return this[rr].onreadystatechange}set onreadystatechange(e){this[rr].onreadystatechange=e,ue(this,"readystatechange",e,this[rr][sr].onreadystatechange)}toString(){return"[object XMLHttpRequest]"}get isPolyfill(){return{symbol:t,hierarchy:["XMLHttpRequest","XMLHttpRequestEventTarget","EventTarget"]}}}const or={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(nr,or),Object.defineProperties(nr.prototype,or),r(nr,"XMLHttpRequest");const sr=Symbol(),ir=Symbol(),ar=Symbol(),lr=Symbol(),ur=Symbol(),cr=Symbol(),hr=Symbol(),dr=Symbol(),fr=Symbol(),pr=Symbol();class yr{constructor(e){var t;this.readyState=nr.UNSENT,this.response="",this.responseType="",this.responseURL="",this.status=0,this.statusText="",this.timeout=0,this.withCredentials=!1,this[Gt]=(t=this,{onreadystatechange:e=>{ce(t.target,t.onreadystatechange,e)}}),this.onreadystatechange=null,this[zt]=!1,this[Vt]=!1,this[_t]=0,this[Jt]="",this[Yt]="GET",this[Kt]=new We,this[Wt]=null,this[Qt]=Rr,this[Zt]=null,this.target=e}}function gr({statusCode:e,header:t,data:r}){const n=this[rr];n.responseURL=n[ur],n.status=e,n[dr]=new We(t);let o=n[dr].get("Content-Length");n[fr]=()=>o?parseInt(o):0,n.readyState===nr.OPENED&&(Er(this,nr.HEADERS_RECEIVED),Er(this,nr.LOADING),setTimeout(()=>{if(!n[ir]){let e=n[fr];try{n.response=bt(n.responseType,r),ge(this,"load",e,e)}catch(e){console.error(e),ge(this,"error")}}}))}function br(e){if("status"in e)return void gr.call(this,{statusCode:e.status,header:e.headers,data:e.data});const t=this[rr];t.status=0,t.statusText="errMsg"in e?e.errMsg:"errorMessage"in e?e.errorMessage:"",t[ir]||t.readyState===nr.UNSENT||t.readyState===nr.DONE||(ge(this,"error"),wr(this))}function mr(){const e=this[rr];e[pr]=null,e[ir]||e.readyState!==nr.OPENED&&e.readyState!==nr.LOADING||Er(this,nr.DONE),setTimeout(()=>{if(!e[ir]){let t=e[fr];ge(this,"loadend",t,t)}})}function vr(e,t=!0){const r=e[rr],n=t?setTimeout:e=>{e()};r[ar]=!0,r[pr]&&r.readyState!==nr.DONE&&(t&&Er(e,nr.DONE),n(()=>{const n=r[pr];n&&n.abort(),t&&ge(e,"abort"),t&&!n&&ge(e,"loadend")})),n(()=>{r[ar]&&(t&&(r.readyState=nr.UNSENT),function(e){const t=e[rr];t[ar]=!1,wr(e),t.response="",t.responseURL="",t.status=0,t.statusText="",t[hr]=new We,t[dr]=null,t[fr]=Rr}(e))})}function wr(e){const t=e[rr];t[lr]&&(clearTimeout(t[lr]),t[lr]=0)}function Er(e,t){const r=e[rr];let n=t!==r.readyState;if(r.readyState=t,n){ae(e,ee(e,"readystatechange"))}}Gt=sr,zt=ir,Vt=ar,_t=lr,Jt=ur,Yt=cr,Kt=hr,Wt=dr,Qt=fr,Zt=pr;const Tr=["","text","json","arraybuffer","blob","document"];function Sr(e){return"blob"===e||"arraybuffer"===e?"arraybuffer":"text"}const Rr=()=>0,Ar={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 xr="undefined"!=typeof XMLHttpRequest&&XMLHttpRequest||nr,Pr=Symbol();class qr extends ut{constructor(e,t){super(),this[lt].name="Response",this[Pr]=new Lr;const r=this[Pr];let n=null!=t?t:{};if("object"!=typeof n)throw new TypeError("Failed to construct 'Response': The provided value is not of type 'ResponseInit'.");let o=void 0===n.status?200:n.status;if(o<200||o>500)throw new RangeError(`Failed to construct 'Response': The status provided (${+o}) is outside the range [200, 599].`);n.headers&&(r.headers=new We(n.headers)),r.ok=o>=200&&o<300,r.status=o,r.statusText=void 0===n.statusText?"":""+n.statusText,dt(this,e)}get headers(){const e=this[Pr];return e.headers||(e.headers=new We),e.headers}get ok(){return this[Pr].ok}get redirected(){return this[Pr].redirected}get status(){return this[Pr].status}get statusText(){return this[Pr].statusText}get type(){return this[Pr].type}get url(){return this[Pr].url}clone(){if(this.bodyUsed)throw new TypeError("Failed to execute 'clone' on 'Response': Response body is already used");let e=new qr(ft(this),{headers:new We(this.headers),status:this.status,statusText:this.statusText});return e[Pr].url=this.url,e}static json(...e){const[t,r]=e;n(e,1,"Response","json");let o=new qr("string"==typeof t?t:JSON.stringify(t),r);return o.headers.set("Content-Type","application/json"),o}static error(){let e=new qr(null,{status:200,statusText:""});return e[Pr].ok=!1,e[Pr].status=0,e[Pr].type="error",e}static redirect(...e){const[t,r=301]=e;if(n(e,1,"Response","redirect"),-1===[301,302,303,307,308].indexOf(r))throw new RangeError("Failed to execute 'redirect' on 'Response': Invalid status code");return new qr(null,{status:r,headers:{location:""+t}})}toString(){return"[object Response]"}get isPolyfill(){return{symbol:t,hierarchy:["Response"]}}}r(qr,"Response");class Lr{constructor(){this.ok=!0,this.redirected=!1,this.status=200,this.statusText="",this.type="default",this.url=""}}const Fr=e.Response||qr,Or={XMLHttpRequest:xr},jr=e=>{Or.XMLHttpRequest=e};function Dr(...e){if(new.target===Dr)throw new TypeError("fetch is not a constructor");const[t,r]=e;return n(e,1,"Window","fetch"),new Promise((e,n)=>{const i=new Ot(t,r),a=i[Ft].signal;if(a&&a.aborted)return n(a.reason);let l=new Or.XMLHttpRequest;if(l.onload=function(){let t={headers:st(l.getAllResponseHeaders()||""),status:l.status,statusText:l.statusText};0===i.url.indexOf("file://")&&(l.status<200||l.status>599)&&(t.status=200),setTimeout(()=>{let r=new qr("response"in l?l.response:l.responseText,t);r[Pr].url="responseURL"in l?l.responseURL:t.headers.get("X-Request-URL")||"",e(r)})},l.onerror=function(){setTimeout(function(){n(new TypeError("Failed to fetch"))})},l.ontimeout=function(){setTimeout(function(){n(new o("request:fail timeout","TimeoutError"))})},l.onabort=function(){setTimeout(function(){n(new o("request:fail abort","AbortError"))})},l.open(i.method,i.url,!0),"include"===i.credentials?l.withCredentials=!0:"omit"===i.credentials&&(l.withCredentials=!1),"responseType"in l&&(l.responseType="arraybuffer"),r&&"object"==typeof r&&"object"==typeof r.headers&&!s("Headers",r.headers)){let e=r.headers,t=[];Object.getOwnPropertyNames(e).forEach(r=>{t.push(nt(r)),l.setRequestHeader(r,ot(e[r]))}),i.headers.forEach((e,r)=>{-1===t.indexOf(r)&&l.setRequestHeader(r,e)})}else i.headers.forEach((e,t)=>{l.setRequestHeader(t,e)});if(a){const e=()=>{l.abort()};a.addEventListener("abort",e),l.onreadystatechange=function(){4===l.readyState&&a.removeEventListener("abort",e)}}l.send(ft(i))})}const Cr=e.fetch||Dr,Nr=Symbol();class Hr extends ${constructor(e,t){var r;super(e,t),this[Nr]=new Ur,this[Nr].detail=null!==(r=null==t?void 0:t.detail)&&void 0!==r?r:null}get detail(){return this[Nr].detail}initCustomEvent(...e){const[t,r,o,s]=e;n(e,1,"CustomEvent","initCustomEvent"),Q(this,1)||(this.initEvent(t,r,o),this[Nr].detail=null!=s?s:null)}toString(){return"[object CustomEvent]"}get isPolyfill(){return{symbol:t,hierarchy:["CustomEvent","Event"]}}}r(Hr,"CustomEvent");class Ur{}const Mr=e.EventTarget?e.CustomEvent:Hr;export{Lt as AbortController,Pt as AbortControllerP,At as AbortSignal,wt as AbortSignalP,O as Blob,T as BlobP,Mr as CustomEvent,Hr as CustomEventP,te as Event,$ as EventP,he as EventTarget,oe as EventTargetP,N as File,D as FileP,xe as FileReader,we as FileReaderP,Ve as FormData,Ie as FormDataP,it as Headers,We as HeadersP,be as ProgressEvent,fe as ProgressEventP,Nt as Request,Ot as RequestP,Fr as Response,qr as ResponseP,w as TextDecoder,f as TextDecoderP,u as TextEncoder,a as TextEncoderP,He as URLSearchParams,Fe as URLSearchParamsP,xr as XMLHttpRequest,nr as XMLHttpRequestP,Cr as fetch,Dr as fetchP,tr as setRequest,jr as setXMLHttpRequest};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mphttpx",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -20,6 +20,7 @@
20
20
  "author": "Xingzeng",
21
21
  "license": "MIT",
22
22
  "description": "",
23
+ "homepage": "https://github.com/baoxingzeng/mphttpx",
23
24
  "keywords": [
24
25
  "mini-program",
25
26
  "polyfill"
package/README.md.bak DELETED
@@ -1,107 +0,0 @@
1
- # MPHTTPX
2
-
3
- The `request` function of Mini Programs does not support invocation in a Promise style
4
- and differs significantly from the request style in browsers. This results in the
5
- need to write two different sets of code logic for the same request in Mini Programs
6
- versus browsers. Therefore, the `mphttpx` library aims to make requests in Mini Programs
7
- as consistent as possible with those in browsers. This project implements a subset of
8
- standard browser APIs, and these implemented features are sufficient to send requests
9
- using the full `XMLHttpRequest` and `fetch` in Mini Programs.
10
-
11
- ## Table of Contents
12
-
13
- ## Installation
14
-
15
- ```
16
- npm install mphttpx
17
- ```
18
-
19
- ## Mini-Program Support
20
-
21
- | WeChat | Alipay | Baidu | ByteDance | QQ | Kwai | JD | RedNote |
22
- |:------:|:------:|:-----:|:---------:|:--:|:----:|:--:|:-------:|
23
- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
24
-
25
- ## Usage
26
-
27
- ```javascript
28
- import {
29
- TextEncoder,
30
- TextDecoder,
31
-
32
- Event,
33
- EventTarget,
34
- CustomEvent,
35
- ProgressEvent,
36
-
37
- Blob,
38
- File,
39
- FileReader,
40
-
41
- FormData,
42
- URLSearchParams,
43
-
44
- AbortSignal,
45
- AbortController,
46
-
47
- XMLHttpRequest,
48
- fetch,
49
- Headers,
50
- Request,
51
- Response
52
- } from "mphttpx";
53
- ```
54
-
55
- ### XMLHttpRequest
56
-
57
- #### Example: GET
58
-
59
- ```javascript
60
- import { XMLHttpRequest } from "mphttpx";
61
-
62
- const xhr = new XMLHttpRequest();
63
- xhr.open("GET", "https://example.com/server?foo=bar&lorem=ipsum");
64
-
65
- xhr.onload = () => {
66
- // Request finished. Do processing here.
67
- };
68
-
69
- xhr.send();
70
- ```
71
-
72
- #### Example: POST
73
-
74
- ```javascript
75
- import { XMLHttpRequest } from "mphttpx";
76
-
77
- const xhr = new XMLHttpRequest();
78
- xhr.open("POST", "https://example.com/server");
79
-
80
- // Send the proper header information along with the request
81
- xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
82
-
83
- xhr.onreadystatechange = () => {
84
- // Call a function when the state changes.
85
- if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
86
- // Request finished. Do processing here.
87
- }
88
- };
89
-
90
- xhr.send(JSON.stringify({ foo: "bar", lorem: "ipsum" }));
91
- ```
92
-
93
- #### Compatibility
94
-
95
- | Property | Available | Description |
96
- | -------- | --------- | -------------|
97
- | readyState | ✔ | States 2: HEADERS_RECEIVED and 3: LOADING are simulated; in reality, the request has just completed at this point. |
98
- | response | ✔ |
99
- | responseText | ✔ |
100
- | responseType | ✔ | The `"document"` is not supported, as the `Document` does not exist in mini-programs. |
101
- | responseURL | ✔ | Since mini-programs cannot obtain the URL after redirection, the `responseURL` returns the URL used in the original request. |
102
- | responseXML | ✖ |
103
- | status | ✔ |
104
- | statusText | ✔ |
105
- | timeout | ✔ |
106
- | upload | ✔ | The `upload` is simulated; in reality, regular requests in mini-programs cannot track the upload progress of the request body. |
107
- | withCredentials | ✔ | Related to Cookies, setting `withCredentials` has no effect at present; support may be added in the future. |