@impui/imp 1.0.15-beta.2 → 1.0.15-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.es.js +1 -1
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -1 +1 @@
1
- import{urltool as e,date as t,extend as n,getAndWaitCache as r,loadjs as s,getLog as o,bufferToBase64 as i,base64ToBuffer as a,type as c,message as l,isBoolean as u,cache as h,isString as f,isObject as d,isArray as g}from"@impui/com";import*as m from"@impui/com/layer";import{event as p}from"@impui/com/event";import{urltool as y}from"@impui/com/url";import{getLog as w}from"@impui/com/log";import{cache as b}from"@impui/com/cache";import{extend as _}from"@impui/com/core";import{iframeReq as v,get as S}from"@impui/com/req";const E=e.getDomainJson(),O={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com",isLocalhost:!1,localConfig:null};let L=null;const R={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},x=t.getTimestamp(),P={config:x,bubble:x,dress:x,gift:x,template:x},T=()=>{if(L)return L;L=O,"undefined"!=typeof __impconfig__&&(L=n(!0,{},O,__impconfig__));for(const e in R)L[e]=L.allsr+R[e];return L};"localhost"===E.main&&(E.main=T().debugDomain,E.mainhost=T().debugDomain,E.port="",E.name=E.mainhost.split(".")[0],E.protocol="https:");const k=()=>n(!0,{},P,window.codever),C=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await r("config_allconfig",async()=>(await s(T().allconfig),window.allconfig))).domainsitetype},U=async()=>{const e=(await C())["localhost"===E.main?T().debugDomain:E.main];return e||{}},A=async()=>await r("config_simplify",async()=>{const e=await N("config_simplify");await s(e);const t=window.sconfig;return delete window.sconfig,t}),j=async()=>await r("config_full",async()=>{console.log("getConfig");const e=await N("config");await s(e);const t=T();let r=window.config;return delete window.config,r.npm=r.allsr+"/npm/",t.isLocalhost&&t.localConfig&&(r=n(!0,{},r,t.localConfig)),r}),N=async e=>{const t=await U();var n=t.res||"sr",r=t.resHost||E.mainhost;return`${E.protocol+"//"+n+"."+r}/live/webSkins_site/${t.sitetype}/config/${e}.js`},B=async()=>await r("config_apiurl",async()=>await s(T().apiurl,{extend:n,config:await j()}));(()=>{const e=globalThis,t=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!e.fs){let n="";e.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=r.decode(t);const s=n.lastIndexOf("\n");return-1!=s&&(console.log(n.substr(0,s)),n=n.substr(s+1)),t.length},write(e,n,r,s,o,i){if(0!==r||s!==n.length||null!==o)return void i(t());i(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,s){s(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,s){s(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,s){s(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,s){s(t())},read(e,n,r,s,o,i){i(t())},readdir(e,n){n(t())},readlink(e,n){n(t())},rename(e,n,r){r(t())},rmdir(e,n){n(t())},stat(e,n){n(t())},symlink(e,n,r){r(t())},truncate(e,n,r){r(t())},unlink(e,n){n(t())},utimes(e,n,r,s){s(t())}}}if(e.process||(e.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw t()},pid:-1,ppid:-1,umask(){throw t()},cwd(){throw t()},chdir(){throw t()}}),!e.crypto){const t=require("node:crypto");e.crypto={getRandomValues(e){t.randomFillSync(e)}}}e.performance||(e.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),e.TextEncoder||(e.TextEncoder=require("node:util").TextEncoder),e.TextDecoder||(e.TextDecoder=require("node:util").TextDecoder);const n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8");let s=new DataView(new ArrayBuffer(8));var o=[];const i={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{s.setBigInt64(0,e,!0);const t=s.getFloat64(0,!0);if(0===t)return;if(!isNaN(t))return t;const n=0xffffffffn&e;return this._values[n]},a=n=>{let r=e().getBigUint64(n,!0);return t(r)},c=e=>{const t=0x7FF80000n;if("number"==typeof e)return isNaN(e)?t<<32n:0===e?t<<32n|1n:(s.setFloat64(0,e,!0),s.getBigInt64(0,!0));switch(e){case void 0:return 0n;case null:return t<<32n|2n;case!0:return t<<32n|3n;case!1:return t<<32n|4n}let n=this._ids.get(e);void 0===n&&(n=this._idPool.pop(),void 0===n&&(n=BigInt(this._values.length)),this._values[n]=e,this._goRefCounts[n]=0,this._ids.set(e,n)),this._goRefCounts[n]++;let r=1n;switch(typeof e){case"string":r=2n;break;case"symbol":r=3n;break;case"function":r=4n}return n|(t|r)<<32n},l=(t,n)=>{let r=c(n);e().setBigUint64(t,r,!0)},u=(e,t,n)=>new Uint8Array(this._inst.exports.memory.buffer,e,t),h=(e,t,n)=>{const r=new Array(t);for(let s=0;s<t;s++)r[s]=a(e+8*s);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),d=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,s,i){let a=0;if(1==t)for(let c=0;c<s;c++){let t=n+8*c,s=e().getUint32(t+0,!0),i=e().getUint32(t+4,!0);a+=i;for(let n=0;n<i;n++){let t=e().getUint8(s+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(o));o=[],console.log(e)}else o.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(i,a,!0),0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,proc_exit:e=>{throw this.exited=!0,this.exitCode=e,this._resolveExitPromise(),i},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(d+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==i)throw e}},Number(e)/1e6)},"syscall/js.finalizeRef":e=>{const t=0xffffffffn&e;if(void 0!==this._goRefCounts?.[t]){if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}}else console.error("syscall/js.finalizeRef: unknown id",t)},"syscall/js.stringVal":(e,t)=>{const n=f(e>>>=0,t);return c(n)},"syscall/js.valueGet":(e,n,r)=>{let s=f(n,r),o=t(e),i=Reflect.get(o,s);return c(i)},"syscall/js.valueSet":(e,n,r,s)=>{const o=t(e),i=f(n,r),a=t(s);Reflect.set(o,i,a)},"syscall/js.valueDelete":(e,n,r)=>{const s=t(e),o=f(n,r);Reflect.deleteProperty(s,o)},"syscall/js.valueIndex":(e,n)=>c(Reflect.get(t(e),n)),"syscall/js.valueSetIndex":(e,n,r)=>{Reflect.set(t(e),n,t(r))},"syscall/js.valueCall":(n,r,s,o,i,a,c)=>{const u=t(r),d=f(s,o),g=h(i,a);try{const t=Reflect.get(u,d);l(n,Reflect.apply(t,u,g)),e().setUint8(n+8,1)}catch(m){l(n,m),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,s,o,i)=>{try{const i=t(r),a=h(s,o);l(n,Reflect.apply(i,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,s,o,i)=>{const a=t(r),c=h(s,o);try{l(n,Reflect.construct(a,c)),e().setUint8(n+8,1)}catch(u){l(n,u),e().setUint8(n+8,0)}},"syscall/js.valueLength":e=>t(e).length,"syscall/js.valuePrepareString":(r,s)=>{const o=String(t(s)),i=n.encode(o);l(r,i),e().setInt32(r+8,i.length,!0)},"syscall/js.valueLoadString":(e,n,r,s)=>{const o=t(e);u(n,r).set(o)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,s,o,i)=>{let a=n,c=n+4;const l=u(r,s),h=t(i);if(!(h instanceof Uint8Array||h instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=h.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,s,o,i)=>{let a=n,c=n+4;const l=t(r),h=u(s,o);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=h.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)}}},this.importObject.env=this.importObject.gojs}async run(t){if(this._inst=t,this._values=[NaN,0,null,!0,!1,e,this],this._goRefCounts=[],this._ids=/* @__PURE__ */new Map,this._idPool=[],this.exited=!1,this.exitCode=0,this._inst.exports._start){let e=new Promise((e,t)=>{this._resolveExitPromise=e});try{this._inst.exports._start()}catch(n){if(n!==i)throw n}return await e,this.exitCode}this._inst.exports._initialize()}_resume(){if(this.exited)throw new Error("Go program has already exited");try{this._inst.exports.resume()}catch(e){if(e!==i)throw e}this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}}})();const I=Go,D={},F=(await j()).allsr+"/plug/gotool/lib/imptool.wasm",M=await o(),q=async function(){return console.warn("⚠️ 降级方案已启用"),{encrypt:function(){throw new Error("❌ 降级方案未实现:encrypt方法")},parseRes:async function(e,t){try{if("true"!==e.headers["res-encrypt"])return e;const t={data:e.data},n=await B(),r=await axios.post(n.parseRes,{res:encodeURIComponent(JSON.stringify(t)),config:null});return e.data=JSON.parse(r.data),e}catch(n){console.error("❌ 降级方案请求接口失败:",n)}},parseServer:function(){throw new Error("❌ 降级方案未实现:parseServer方法")}}};const W=new class{constructor(e){this.isbase=e===F,this.url=e}async#e(){if(!this.url){const e=await j();this.url=e.allsr+"plug/gotool/lib/imptool.wasm"}return this.url}async#t(e,t){return async function(e,t,n=!1){try{const s=new I;M("=== WASM加载调试开始 ==="),M("URL:",e),M("UserAgent:",navigator.userAgent);const o=await r(e,async()=>{const n=await fetch(e+t);M("✅ 响应状态:",n.status);const r=await n.arrayBuffer();return M("✅ ArrayBuffer大小:",r.byteLength,"bytes"),i(r,{type:"application/wasm"})}),c=await a(o),l=new Uint8Array(c.slice(0,4));M("🔍 WASM文件头:",Array.from(l)),M("🔍 Go importObject结构:",Object.keys(s.importObject)),s.importObject.go&&M("🔍 GoJS导入键:",Object.keys(s.importObject.go)),M("🚀 开始WebAssembly.instantiate...");const u=await WebAssembly.instantiate(c,s.importObject);if(M("✅ WebAssembly实例化成功"),M("🚀 开始go.run..."),s.run(u.instance),M("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,M("✅ goCrypto加载成功"),e}if(n)return await q();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(s){throw console.error("💥 完整错误堆栈:",s),console.error("错误名称:",s.name),console.error("错误信息:",s.message),s}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&D[t])return D[t];const n=k(),r=n.config?"?d="+n.config:"",s=await this.#t(t,r),o={};if(s)for(let i in s)o[i]=s[i];return D[t]=o,o}async init(){return this.getRunTimes()}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(F);function z(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:G}=Object,{iterator:H,toStringTag:K}=Symbol,J=/* @__PURE__ */(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),V=e=>(e=e.toLowerCase(),t=>J(t)===e),X=e=>t=>typeof t===e,{isArray:Z}=Array,Q=X("undefined");function Y(e){return null!==e&&!Q(e)&&null!==e.constructor&&!Q(e.constructor)&&ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ee=V("ArrayBuffer");const te=X("string"),ne=X("function"),re=X("number"),se=e=>null!==e&&"object"==typeof e,oe=e=>{if("object"!==J(e))return!1;const t=G(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||K in e||H in e)},ie=V("Date"),ae=V("File"),ce=V("Blob"),le=V("FileList"),ue=V("URLSearchParams"),[he,fe,de,ge]=["ReadableStream","Request","Response","Headers"].map(V);function me(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Y(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(r=0;r<o;r++)i=s[r],t.call(null,e[i],i,e)}}function pe(e,t){if(Y(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,we=e=>!Q(e)&&e!==ye;const be=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&G(Uint8Array)),_e=V("HTMLFormElement"),ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Se=V("RegExp"),Ee=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};me(n,(n,s)=>{let o;!1!==(o=t(n,s,e))&&(r[s]=o||n)}),Object.defineProperties(e,r)};const Oe=V("AsyncFunction"),Le=(Re="function"==typeof setImmediate,xe=ne(ye.postMessage),Re?setImmediate:xe?(Pe=`axios@${Math.random()}`,Te=[],ye.addEventListener("message",({source:e,data:t})=>{e===ye&&t===Pe&&Te.length&&Te.shift()()},!1),e=>{Te.push(e),ye.postMessage(Pe,"*")}):e=>setTimeout(e));var Re,xe,Pe,Te;const ke="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ye):"undefined"!=typeof process&&process.nextTick||Le,Ce={isArray:Z,isArrayBuffer:ee,isBuffer:Y,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ne(e.append)&&("formdata"===(t=J(e))||"object"===t&&ne(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ee(e.buffer),t},isString:te,isNumber:re,isBoolean:e=>!0===e||!1===e,isObject:se,isPlainObject:oe,isEmptyObject:e=>{if(!se(e)||Y(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:he,isRequest:fe,isResponse:de,isHeaders:ge,isUndefined:Q,isDate:ie,isFile:ae,isBlob:ce,isRegExp:Se,isFunction:ne,isStream:e=>se(e)&&ne(e.pipe),isURLSearchParams:ue,isTypedArray:be,isFileList:le,forEach:me,merge:function e(){const{caseless:t,skipUndefined:n}=we(this)&&this||{},r={},s=(s,o)=>{const i=t&&pe(r,o)||o;oe(r[i])&&oe(s)?r[i]=e(r[i],s):oe(s)?r[i]=e({},s):Z(s)?r[i]=s.slice():n&&Q(s)||(r[i]=s)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&me(arguments[o],s);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(me(t,(t,r)=>{n&&ne(t)?e[r]=z(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&G(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:J,kindOfTest:V,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Z(e))return e;let t=e.length;if(!re(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[H]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_e,hasOwnProperty:ve,hasOwnProp:ve,reduceDescriptors:Ee,freezeMethods:e=>{Ee(e,(t,n)=>{if(ne(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ne(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Z(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:pe,global:ye,isContextDefined:we,isSpecCompliantForm:function(e){return!!(e&&ne(e.append)&&"FormData"===e[K]&&e[H])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(se(e)){if(t.indexOf(e)>=0)return;if(Y(e))return e;if(!("toJSON"in e)){t[r]=e;const s=Z(e)?[]:{};return me(e,(e,t)=>{const o=n(e,r+1);!Q(o)&&(s[t]=o)}),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Oe,isThenable:e=>e&&(se(e)||ne(e))&&ne(e.then)&&ne(e.catch),setImmediate:Le,asap:ke,isIterable:e=>null!=e&&ne(e[H])};function Ue(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Ce.inherits(Ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.status}}});const Ae=Ue.prototype,je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{je[e]={value:e}}),Object.defineProperties(Ue,je),Object.defineProperty(Ae,"isAxiosError",{value:!0}),Ue.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);Ce.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Ue.call(i,a,c,n,r,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Ne(e){return Ce.isPlainObject(e)||Ce.isArray(e)}function Be(e){return Ce.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(e,t){return e=Be(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const De=Ce.toFlatObject(Ce,{},null,function(e){return/^is[A-Z]/.test(e)});function Fe(e,t,n){if(!Ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ce.isUndefined(t[e])})).metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(t);if(!Ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Ce.isDate(e))return e.toISOString();if(Ce.isBoolean(e))return e.toString();if(!a&&Ce.isBlob(e))throw new Ue("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(e)||Ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(Ce.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ce.isArray(e)&&function(e){return Ce.isArray(e)&&!e.some(Ne)}(e)||(Ce.isFileList(e)||Ce.endsWith(n,"[]"))&&(a=Ce.toArray(e)))return n=Be(n),a.forEach(function(e,r){!Ce.isUndefined(e)&&null!==e&&t.append(!0===i?Ie([n],r,o):null===i?n:n+"[]",c(e))}),!1;return!!Ne(e)||(t.append(Ie(s,n,o),c(e)),!1)}const u=[],h=Object.assign(De,{defaultVisitor:l,convertValue:c,isVisitable:Ne});if(!Ce.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Ce.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Ce.forEach(n,function(n,o){!0===(!(Ce.isUndefined(n)||null===n)&&s.call(t,n,Ce.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t}function Me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function qe(e,t){this._pairs=[],e&&Fe(e,this,t)}const We=qe.prototype;function ze(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||ze;Ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(t,n):Ce.isURLSearchParams(t)?t.toString():new qe(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,Me)}:Me;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Ge{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ce.forEach(this.handlers,function(t){null!==t&&e(t)})}}const He={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ke={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:qe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Je="undefined"!=typeof window&&"undefined"!=typeof document,Ve="object"==typeof navigator&&navigator||void 0,Xe=Je&&(!Ve||["ReactNative","NativeScript","NS"].indexOf(Ve.product)<0),Ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Qe=Je&&window.location.href||"http://localhost",Ye={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:Je,hasStandardBrowserEnv:Xe,hasStandardBrowserWebWorkerEnv:Ze,navigator:Ve,origin:Qe},Symbol.toStringTag,{value:"Module"})),...Ke};function et(e){function t(e,n,r,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&Ce.isArray(r)?r.length:o,a)return Ce.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&Ce.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],s)&&Ce.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}(r[o])),!i}if(Ce.isFormData(e)&&Ce.isFunction(e.entries)){const n={};return Ce.forEachEntry(e,(e,r)=>{t(function(e){return Ce.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const tt={transitional:He,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Ce.isObject(e);s&&Ce.isHTMLForm(e)&&(e=new FormData(e));if(Ce.isFormData(e))return r?JSON.stringify(et(e)):e;if(Ce.isArrayBuffer(e)||Ce.isBuffer(e)||Ce.isStream(e)||Ce.isFile(e)||Ce.isBlob(e)||Ce.isReadableStream(e))return e;if(Ce.isArrayBufferView(e))return e.buffer;if(Ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Fe(e,new Ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ye.isNode&&Ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Fe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ce.isString(e))try{return(t||JSON.parse)(e),Ce.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||tt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Ce.isResponse(e)||Ce.isReadableStream(e))return e;if(e&&Ce.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(s){if(n){if("SyntaxError"===s.name)throw Ue.from(s,Ue.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ye.classes.FormData,Blob:Ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ce.forEach(["delete","get","head","post","put","patch"],e=>{tt.headers[e]={}});const nt=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),rt=Symbol("internals");function st(e){return e&&String(e).trim().toLowerCase()}function ot(e){return!1===e||null==e?e:Ce.isArray(e)?e.map(ot):String(e)}function it(e,t,n,r,s){return Ce.isFunction(r)?r.call(this,t,n):(s&&(t=n),Ce.isString(t)?Ce.isString(r)?-1!==t.indexOf(r):Ce.isRegExp(r)?r.test(t):void 0:void 0)}let at=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=st(t);if(!s)throw new Error("header name must be a non-empty string");const o=Ce.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ot(e))}const o=(e,t)=>Ce.forEach(e,(e,n)=>s(e,n,t));if(Ce.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Ce.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&nt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Ce.isObject(e)&&Ce.isIterable(e)){let n,r,s={};for(const t of e){if(!Ce.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?Ce.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=st(e)){const n=Ce.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=/* @__PURE__ */Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Ce.isFunction(t))return t.call(this,e,n);if(Ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=st(e)){const n=Ce.findKey(this,e);return!(!n||void 0===this[n]||t&&!it(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=st(e)){const s=Ce.findKey(n,e);!s||t&&!it(0,n[s],s,t)||(delete n[s],r=!0)}}return Ce.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!it(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Ce.forEach(this,(r,s)=>{const o=Ce.findKey(n,s);if(o)return t[o]=ot(r),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(s):String(s).trim();i!==s&&delete t[s],t[i]=ot(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Ce.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ce.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[rt]=this[rt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=st(e);t[r]||(!function(e,t){const n=Ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})})}(n,e),t[r]=!0)}return Ce.isArray(e)?e.forEach(r):r(e),this}};function ct(e,t){const n=this||tt,r=t||n,s=at.from(r.headers);let o=r.data;return Ce.forEach(e,function(e){o=e.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function lt(e){return!(!e||!e.__CANCEL__)}function ut(e,t,n){Ue.call(this,null==e?"canceled":e,Ue.ERR_CANCELED,t,n),this.name="CanceledError"}function ht(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ue("Request failed with status code "+n.status,[Ue.ERR_BAD_REQUEST,Ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.reduceDescriptors(at.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ce.freezeMethods(at),Ce.inherits(ut,Ue,{__CANCEL__:!0});const ft=(e,t,n=3)=>{let r=0;const s=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];s||(s=c),n[o]=a,r[o]=c;let u=i,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const f=l&&c-l;return f?Math.round(1e3*h/f):void 0}}(50,250);return function(e,t){let n,r,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},o-a)))},()=>n&&i(n)]}(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,c=s(a);r=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},dt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},gt=e=>(...t)=>Ce.asap(()=>e(...t)),mt=Ye.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,Ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ye.origin),Ye.navigator&&/(msie|trident)/i.test(Ye.navigator.userAgent)):()=>!0,pt=Ye.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Ce.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Ce.isString(r)&&a.push(`path=${r}`),Ce.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),Ce.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function yt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const wt=e=>e instanceof at?{...e}:e;function bt(e,t){t=t||{};const n={};function r(e,t,n,r){return Ce.isPlainObject(e)&&Ce.isPlainObject(t)?Ce.merge.call({caseless:r},e,t):Ce.isPlainObject(t)?Ce.merge({},t):Ce.isArray(t)?t.slice():t}function s(e,t,n,s){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function o(e,t){if(!Ce.isUndefined(t))return r(void 0,t)}function i(e,t){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,o){return o in t?r(n,s):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>s(wt(e),wt(t),0,!0)};return Ce.forEach(Object.keys({...e,...t}),function(r){const o=c[r]||s,i=o(e[r],t[r],r);Ce.isUndefined(i)&&o!==a||(n[r]=i)}),n}const _t=e=>{const t=bt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=at.from(i),t.url=$e(yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Ce.isFormData(n))if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Ce.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Ye.hasStandardBrowserEnv&&(r&&Ce.isFunction(r)&&(r=r(t)),r||!1!==r&&mt(t.url))){const e=s&&o&&pt.read(o);e&&i.set(s,e)}return t},vt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=_t(e);let s=r.data;const o=at.from(r.headers).normalize();let i,a,c,l,u,{responseType:h,onUploadProgress:f,onDownloadProgress:d}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function p(){if(!m)return;const r=at.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());ht(function(e){t(e),g()},function(e){n(e),g()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=p:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(p)},m.onabort=function(){m&&(n(new Ue("Request aborted",Ue.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new Ue(t&&t.message?t.message:"Network Error",Ue.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||He;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ue(t,s.clarifyTimeoutError?Ue.ETIMEDOUT:Ue.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&Ce.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Ce.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),d&&([c,u]=ft(d,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,l]=ft(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new ut(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Ye.protocols.indexOf(y)?n(new Ue("Unsupported protocol "+y+":",Ue.ERR_BAD_REQUEST,e)):m.send(s||null)})},St=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ue?t:new ut(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Ue(`timeout ${t} of ms exceeded`,Ue.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>Ce.asap(i),a}},Et=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Ot=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Lt=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of Ot(e))yield*Et(n,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=i+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:Rt}=Ce,xt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ce.global),{ReadableStream:Pt,TextEncoder:Tt}=Ce.global,kt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Ct=e=>{e=Ce.merge.call({skipUndefined:!0},xt,e);const{fetch:t,Request:n,Response:r}=e,s=t?Rt(t):"function"==typeof fetch,o=Rt(n),i=Rt(r);if(!s)return!1;const a=s&&Rt(Pt),c=s&&("function"==typeof Tt?/* @__PURE__ */(e=>t=>e.encode(t))(new Tt):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=o&&a&&kt(()=>{let e=!1;const t=new n(Ye.origin,{body:new Pt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&a&&kt(()=>Ce.isReadableStream(new r("").body)),h={stream:u&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ue(`Response type '${e}' is not supported`,Ue.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Ce.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Ce.isBlob(e))return e.size;if(Ce.isSpecCompliantForm(e)){const t=new n(Ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ce.isArrayBufferView(e)||Ce.isArrayBuffer(e)?e.byteLength:(Ce.isURLSearchParams(e)&&(e+=""),Ce.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:d,timeout:g,onDownloadProgress:m,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=_t(e),v=t||fetch;y=y?(y+"").toLowerCase():"text";let S=St([c,d&&d.toAbortSignal()],g),E=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let L;try{if(p&&l&&"get"!==i&&"head"!==i&&0!==(L=await f(w,a))){let e,t=new n(s,{method:"POST",body:a,duplex:"half"});if(Ce.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=dt(L,ft(gt(p)));a=Lt(t.body,65536,e,n)}}Ce.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in n.prototype,c={..._,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=o&&new n(s,c);let d=await(o?v(E,_):v(s,c));const g=u&&("stream"===y||"response"===y);if(u&&(m||g&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=d[t]});const t=Ce.toFiniteNumber(d.headers.get("content-length")),[n,s]=m&&dt(t,ft(gt(m),!0))||[];d=new r(Lt(d.body,65536,n,()=>{s&&s(),O&&O()}),e)}y=y||"text";let R=await h[Ce.findKey(h,y)||"text"](d,e);return!g&&O&&O(),await new Promise((t,n)=>{ht(t,n,{data:R,headers:at.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:E})})}catch(R){if(O&&O(),R&&"TypeError"===R.name&&/Load failed|fetch/i.test(R.message))throw Object.assign(new Ue("Network Error",Ue.ERR_NETWORK,e,E),{cause:R.cause||R});throw Ue.from(R,R&&R.code,e,E)}}},Ut=/* @__PURE__ */new Map,At=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i,a,c=o.length,l=Ut;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?/* @__PURE__ */new Map:Ct(t)),l=a;return a};At();const jt={http:null,xhr:vt,fetch:{get:At}};Ce.forEach(jt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Bt=e=>Ce.isFunction(e)||null===e||!1===e;const It={getAdapter:function(e,t){e=Ce.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){let n;if(r=e[i],s=r,!Bt(r)&&(s=jt[(n=String(r)).toLowerCase()],void 0===s))throw new Ue(`Unknown adapter '${n}'`);if(s&&(Ce.isFunction(s)||(s=s.get(t))))break;o[n||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Ue("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:jt};function Dt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ut(null,e)}function Ft(e){Dt(e),e.headers=at.from(e.headers),e.data=ct.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return It.getAdapter(e.adapter||tt.adapter,e)(e).then(function(t){return Dt(e),t.data=ct.call(e,e.transformResponse,t),t.headers=at.from(t.headers),t},function(t){return lt(t)||(Dt(e),t&&t.response&&(t.response.data=ct.call(e,e.transformResponse,t.response),t.response.headers=at.from(t.response.headers))),Promise.reject(t)})}const Mt="1.13.2",qt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Wt={};qt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Mt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,o)=>{if(!1===e)throw new Ue(r(s," has been removed"+(t?" in "+t:"")),Ue.ERR_DEPRECATED);return t&&!Wt[s]&&(Wt[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,o)}},qt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const zt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ue("options must be an object",Ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const t=e[o],n=void 0===t||i(t,o,e);if(!0!==n)throw new Ue("option "+o+" must be "+n,Ue.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ue("Unknown option "+o,Ue.ERR_BAD_OPTION)}},validators:qt},$t=zt.validators;let Gt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ge,response:new Ge}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=bt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&zt.assertOptions(n,{silentJSONParsing:$t.transitional($t.boolean),forcedJSONParsing:$t.transitional($t.boolean),clarifyTimeoutError:$t.transitional($t.boolean)},!1),null!=r&&(Ce.isFunction(r)?t.paramsSerializer={serialize:r}:zt.assertOptions(r,{encode:$t.function,serialize:$t.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),zt.assertOptions(t,{baseUrl:$t.spelling("baseURL"),withXsrfToken:$t.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&Ce.merge(s.common,s[t.method]);s&&Ce.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=at.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[Ft.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=i.length;let f=t;for(;h<u;){const e=i[h++],t=i[h++];try{f=e(f)}catch(d){t.call(this,d);break}}try{l=Ft.call(this,f)}catch(d){return Promise.reject(d)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return $e(yt((e=bt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Ce.forEach(["delete","get","head","options"],function(e){Gt.prototype[e]=function(t,n){return this.request(bt(n||{},{method:e,url:t,data:(n||{}).data}))}}),Ce.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,s){return this.request(bt(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gt.prototype[e]=t(),Gt.prototype[e+"Form"]=t(!0)});const Ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ht).forEach(([e,t])=>{Ht[t]=e});const Kt=function e(t){const n=new Gt(t),r=z(Gt.prototype.request,n);return Ce.extend(r,Gt.prototype,n,{allOwnKeys:!0}),Ce.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(bt(t,n))},r}(tt);Kt.Axios=Gt,Kt.CanceledError=ut,Kt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,s){n.reason||(n.reason=new ut(e,r,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Kt.isCancel=lt,Kt.VERSION=Mt,Kt.toFormData=Fe,Kt.AxiosError=Ue,Kt.Cancel=Kt.CanceledError,Kt.all=function(e){return Promise.all(e)},Kt.spread=function(e){return function(t){return e.apply(null,t)}},Kt.isAxiosError=function(e){return Ce.isObject(e)&&!0===e.isAxiosError},Kt.mergeConfig=bt,Kt.AxiosHeaders=at,Kt.formToJSON=e=>et(Ce.isHTMLForm(e)?new FormData(e):e),Kt.getAdapter=It.getAdapter,Kt.HttpStatusCode=Ht,Kt.default=Kt;const{Axios:Jt,AxiosError:Vt,CanceledError:Xt,isCancel:Zt,CancelToken:Qt,VERSION:Yt,all:en,Cancel:tn,isAxiosError:nn,spread:rn,toFormData:sn,AxiosHeaders:on,HttpStatusCode:an,formToJSON:cn,getAdapter:ln,mergeConfig:un}=Kt,hn=y.getPar,fn=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(hn("Device")||-1)};t&&(r._tui_source=((n=hn("_tui_source")||hn("from")||hn("source"))||(n=b.get("_tui_source")),n));var s=window.pdata||window.axiosData||window.reqData||{};return e=_(!0,r,s,e)},dn=function(e,t,n){return n=fn(n,t),e=y.addPars(n,e)},gn=await w(),mn="imp_sign",pn="imp_useridx";y.getPar("useridx");var yn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Kt.codeEnum=yn,Kt.defaults.baseURL="",Kt.defaults.withCredentials=!0,Kt.defaults.crossDomain=!0,Kt.defaults.dataType="json",Kt.saveLogin=function(e,t){gn.debug("写入sign:",t),b.set(mn,t),e&&b.set(pn,e)},Kt.interceptors.request.use(async function(e){gn.debug("请求拦截",e),function(e,t,n){var r;"post"===e.method?(e.data=e.data||{},r=e.data):(e.params=e.params||{},r=e.params),n&&(r[t]=n)}(e,"_tui_source",y.getPar("_tui_source")||y.getPar("from")||y.getPar("source")),dn(e.url),"post"===e.method&&(e.data=y.jsonto(e.data).substring(1));const t=await Sn.getLogin(null,!0);return t&&(e.headers[mn]=t.sign,e.headers[pn]=b.get(pn)),e},function(e){return Promise.reject(e)}),Kt.interceptors.response.use(async function(e){if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([W.init(),j()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}if(c.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}switch(gn.debug("响应拦截 -> "+e.config.url+"\n",e),e.data.__source=e,(e=e.data).codeEnum=yn,e.isSuccess=function(t){return e.code!==yn.success&&(t||m.msg(e.msg)),e.code===yn.success},e.code){case yn.success:return Promise.resolve(e);case yn.jumpTo:return void(location.href=e.data);case yn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case yn.alert:case yn.msg:return m.msg(e.msg),Promise.reject(e);case yn.noRealName:return impall.showReal_name();case yn.ServerSignError:case yn.nologin:if(e.__source.config.isTwice)return Sn.runNoLogin&&Sn.runNoLogin(e),Promise.resolve(e);const t=function(){return gn.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=y.toData(e.__source.config.data),Kt(e.__source.config)};return await p.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var wn=Kt.get;Kt.get=function(e,t,n){return(n=n||{}).params=t,wn(e,n)};const bn=await j(),_n=await o();class vn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname&&T().isLocalhost?"https://localhost:44360":bn.domainLogin,this.ver="v1.0.0",this.loginTime=21600,this.prefix="IMP_PLUG_LOGIN_",this.initUrls(),this.initKeys(),this.initEventKeys(),this.bindEvents(),this.iframeBox=null,this.iframe=null,this.iframeBg=null,this.autoLogin={},this.exitLogin={},this.threeLoginWin=null,this.isTempCheck=e.getPar(this.keys.url_tempSignKey)&&e.getPar(this.keys.url_tempUseridxKey),window.login=this}initUrls(){this.urls={login:dn(this.loginDomain+"/index.html",!0),reg:dn(this.loginDomain+"/index.html?type=reg",!0),loginPage:dn(this.loginDomain+"/loginPage.html",!0),regPage:dn(this.loginDomain+"/regPage.html",!0),autoLogin:dn(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:dn(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:dn(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:dn(this.loginDomain+"/"+this.ver+"/user/CheckLoginByCode"),exitLogin:this.loginDomain+"/"+this.ver+"/user/exitLogin",userInfo:this.loginDomain+"/"+this.ver+"/user/UserInfo",writeCookies:"/ashx/member/CheckSSOWriteCookie.ashx",webLoginOut:"/ajax/logout.aspx"}}initKeys(){const e=e=>this.prefix+e;this.keys={msg_loginReturn:e("loginReturn"),msg_close:e("close"),msg_goto:e("goto"),msg_autoSize:e("autoSize"),msg_getSize:e("getSize"),cache_loginSave:e("loginSave"),cache_userInfo:e("userInfo"),checkLogin_code:"code",loginStatus:"__login_status",loginResult:"__login_result",url_tempSignKey:"sign",url_tempUseridxKey:"useridx"}}initEventKeys(){const e=e=>this.prefix+e;this.eventKeys={nologin:e("login"),closeThreeLogin:e("close_login_three")}}bindEvents(){l.on(this.keys.msg_close,()=>{_n.debug("关闭登录框"),this.close()}),l.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),l.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),l.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),l.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()}),p.onM("login","getLogin",this.getLogin.bind(this)),p.onM("login","noLogin",this.runNoLogin.bind(this))}handlePageTransition(e){if(!this.iframe)return;this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut");const t=()=>{this.iframe.src=e.url,this.iframe.classList.remove("IMP_PLUG_LOGIN_animateOut"),this.iframe.removeEventListener("transitionend",t)};this.iframe.addEventListener("transitionend",t)}handleAutoSize(e){this.iframe&&(_n.debug("登录框尺寸适配",e),this.iframe.width=e.width,this.iframe.height=e.height,this.iframe.classList.add("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateIn"))}runAutoLoginCallback(e,t){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{if(u(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Kt.codeEnum.success)}}),this.autoLogin.iframe&&this.autoLogin.iframe.remove(),this.autoLogin.window&&this.autoLogin.window.close(),this.autoLogin={},e&&this.close())}async dealwithLoginRes(t){if(_n.debug("登录消息返回",t),t.isok=t.code===Kt.codeEnum.success,1!==t.code)return this.clear(),void this.runAutoLoginCallback(t);if(t.sign&&8===t.sign.length)this.save(t);else{e.delParsUpUrl([this.keys.url_tempSignKey,this.keys.url_tempUseridxKey]),h.set(this.keys.cache_loginSave,t,this.loginTime),Kt.saveLogin(t.useridx,t.sign);try{await Kt.get(this.urls.writeCookies,null,null,"text")}finally{this.runAutoLoginCallback(t)}}}save(e){const t=e.__source?.headers?.[e.sign]||e.data?.headers?.[e.sign]||e.sign,n=e.useridx||e.data?.___useridx;l.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){h.remove(this.keys.cache_loginSave),h.remove(this.keys.cache_userInfo),h.remove(this.keys.cache_userInfo+"_more"),h.remove(this.keys.cache_userInfo+"_simplify")}onLoginOK(e,t){this.autoLogin.callbacks||(this.autoLogin.callbacks=[]),this.autoLogin.callbacks.push({ok:e,no:t})}create(e){const t=n(!0,{url:"",name:"",option:null},e);this.createIframeBox(),this.createIframe(t),this.applyStyles(t.option||{}),this.appendToDocument()}createIframeBox(){this.iframeBox=document.createElement("div"),this.iframeBox.className="IMP_PLUG_LOGIN_box";const e=parseFloat(window.getComputedStyle(document.documentElement).zoom);e<1&&(this.iframeBox.style.zoom=(1/e).toFixed(2)),this.iframe=document.createElement("iframe"),this.iframeBg=document.createElement("div")}createIframe(e){this.iframe.id=this.iframe.name=e.name,this.iframe.src=e.url;const t=e.option||{};this.iframe.width=t.width||400,this.iframe.height=t.height||400,this.iframe.scrolling=t.scrolling||"no",this.iframe.marginWidth=t.marginWidth||"0",this.iframe.marginHeight=t.marginHeight||"0",this.iframe.frameBorder=t.frameBorder||"0"}applyStyles(e){Object.assign(this.iframe.style,{zIndex:3e3,position:"fixed",borderRadius:e.radius||"none",opacity:0}),Object.assign(this.iframeBg.style,{position:"fixed",backgroundColor:"#6f6f6f80",width:"100%",height:"100%",top:0,left:0,opacity:0}),this.applyPosition(e.offset||"center"),this.applyAnimation(e)}applyPosition(e){const t={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},top:{top:"5%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"5%",left:"50%",transform:"translateX(-50%)"},lt:{top:"5%",left:"5%"},lb:{bottom:"5%",left:"5%"},rt:{top:"5%",right:"5%"},rb:{bottom:"5%",right:"5%"}},n=t[e]||t.center;Object.assign(this.iframe.style,n)}applyAnimation(e){const t=e.animTime||300;this.iframe.style.transition=`opacity ${t}ms`,this.iframeBg.style.transition=`opacity ${t}ms`,this.createAnimationStyles(e.anime||0)}createAnimationStyles(e){const t={0:".IMP_PLUG_LOGIN_animateIn{opacity:1 !important;} .IMP_PLUG_LOGIN_animateOut{opacity:0 !important;}"},n=t[e]||t[0],r=document.createElement("style");r.id="IMP_PLUG_LOGIN_animateCss";try{r.appendChild(document.createTextNode(n))}catch(s){r.styleSheet.cssText=n}document.head.appendChild(r)}appendToDocument(){this.iframeBox.append(this.iframe),this.iframeBox.append(this.iframeBg),document.body.append(this.iframeBox)}istop(){return parent===window}close(){if(!this.istop())return;const e=()=>{this.iframeBox&&(this.iframeBox.remove(),this.iframeBox=null),this.autoLogin.iframe&&this.autoLogin.iframe.remove();const e=document.getElementById("IMP_PLUG_LOGIN_animateCss");e&&e.remove()};this.iframeBg&&(this.iframeBg.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateOut")),this.iframe?(this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut"),this.iframe.addEventListener("transitionend",e,{once:!0})):e()}autoSize(e,t){l.send(this.keys.msg_autoSize,{width:e||document.body.scrollWidth,height:t||document.body.scrollHeight})}open(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.login,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.login})});return e?t:t.then(()=>location.reload())}openPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.loginPage);location.href=n}openReg(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.reg,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.reg})});return e?t:t.then(()=>location.reload())}openRegPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.regPage);location.href=n}threeLogin(e,t){return new Promise((n,r)=>{this.closeThreeLoginWin(),this.onLoginOK(n,r);const s=dn(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(s)})}closeThreeLoginWin(){this.threeLoginWin&&(this.threeLoginWin.close(),this.threeLoginWin=null)}getWechatCode(){const t=e.getPar("__login_code");if(!t){const e=`${this.loginDomain}/v1.0.0/user/OpenThreeLogin?type=wechatcode&redirect_uri=${encodeURIComponent(location.href)}`;location.href=e}return t}getLogin(e,t=!1){const n=e||h.get(this.keys.cache_loginSave);return n?(t||delete n.sign,n):null}getUser(e,t=!1,n=!1){"function"!=typeof e&&(n=t,t=e,e=null);const r=new Promise((e,r)=>{const s=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=h.get(s);if(t)return void e(t)}Kt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(h.set(s,t.data,this.loginTime),e(t.data)):r(t)})});return e?r.then(e):r}islogin(){return!!this.getLogin()}async check(){return!(this.isTempCheck||!this.islogin())||this.checkZ()}checkZ(){return new Promise((t,n)=>{if(!this.autoLogin.iframe&&!this.autoLogin.window){let t=this.urls.autoLogin;t=e.addPars({sign:e.getPar(this.keys.url_tempSignKey),useridx:e.getPar(this.keys.url_tempUseridxKey)},t),this.autoLogin.iframe=this.getIframeUrl(t,this.keys.msg_loginReturn),this.autoLogin.callbacks=[]}this.autoLogin.callbacks.push({ok:t,no:()=>{t(!1)}})})}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),s=parseInt(e.getPar(this.keys.loginStatus)||-1);_n.debug("checkLogin_code:",r),0===s?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):s&&r?Kt.get(this.urls.CheckLoginByCode,{code:r}).then(r=>{1===r.code?(e.delParsUpUrl([this.keys.checkLogin_code,this.keys.loginStatus]),this.save(r.data),t(r)):n()}):Kt.get(this.urls.checkSSOLogin).then(n=>{if(1===n.code)this.getUser().then(t);else{let t=e.addPars({redirect_uri:encodeURIComponent(location.href)},this.urls.checkLoginPage);location.href=t}})})}res(t){const n=decodeURIComponent(e.getPar(this.keys.loginResult)||"");if(n){const r=JSON.parse(n);t?.(r),e.delParsUpUrl([this.keys.loginResult])}}exit(e=!1){return _n.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{v.get(this.urls.exitLogin).then(t=>{S(this.urls.webLoginOut,null,()=>{e(t)},"text"),this.clear(),this.exitLogin={}})}),e||(this.exitLogin.Promise=this.exitLogin.Promise.then(()=>{location.reload()}))),this.exitLogin.Promise}getIframeUrl(t,n){const r=document.createElement("iframe");Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",top:"-100px"}),r.dataset.flag=9513,n&&(t=e.addPar("post_msg_name",n,t)),r.src=t;let s,o=!1;const i=()=>{r.removeEventListener("error",a),clearTimeout(s)},a=e=>{o||(o=!0,i(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",e=>{o||(o=!0,i(),console.log("登录页面已打开"))},{once:!0}),r.addEventListener("error",a,{once:!0}),s=setTimeout(()=>{a()},1e4),document.body.append(r),r}onNoLogin(e){p?p.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return p?Promise.resolve(p.run(this.eventKeys.nologin,e)):(console.warn("事件模块event未加载,事件相关功能不可用!"),Promise.resolve())}writeXhr(e){if(!e)return console.warn("xhr不能为空!"),e;const t=this.getLogin(null,!0);return t&&(e.withCredentials=!0,e.setRequestHeader("imp_sign",t.sign),e.setRequestHeader("imp_useridx",t.useridx)),e}debug(...e){console&&console.debug&&console.debug(...e)}}const Sn=new vn,En={};const On=new class{constructor(){this._config=null,this.initPromise=this.init()}async init(){return this._config||(this._config=await j()),this}async ensureConfig(){return this._config||await this.initPromise,this}get statics(){return this._config?{nohead:`${this._config.sr}/live/webSkins_site/${this._config.sitetype}/images/nohead.jpg`}:{nohead:""}}getSrc(e,t,n){if(!this._config)return"";let r=e;if(isNaN(parseInt(e))&&(r=this._config.paths.typeEnums[e]),f(e)&&["emblem","bubble","head","cardskin"].indexOf(e.toLowerCase())>=0&&(d(t)||g(t))&&0===(t=this.titlesTool.getTitlexIdFromType(t,e)))return"";if(4!==r&&0!=t&&!t)return"";r=parseInt(r);const s=this._config.paths.types[`t_${r}`],o=s.pc_path||s.path,i=s.pc_suffix||s.suffix;let a=this._config.js_version;if(n){a=impui.getCodeVer()[n]||this._config.js_version}return t||0===t?`${o}${t}${i}?d=${a}`:`${o}?d=${a}`}getEmotSrc(e,t,n=!1){return n?this.getSrc("emot",`${e}/${t}_s`):this.getSrc("emot",`${e}/${t}`)}getUserLevelSrc(e){return this.getSrc("user",e)}getAnchorLevelSrc(e){return this.getSrc("host",e)}getBubbleZipSrc(e){return this.getSrc("bubble_zip",e)}getFanclubLevelHtml(e,t){return`<span class="fanclubgrage" style="background-image:url(${this.getSrc("fans_grade",e)})">${t}</span>`}async getBubbleImageMap(e,t){const n=this.getBubbleZipSrc(e);return await this.getZipUrlMap(n,t)}getSrImgSrc(e){return e?e.startsWith("http")?e:`${this._config.sr}${e.startsWith("/")?e:"/"+e}`:""}async getZipUrlMap(e,t){await this.ensureConfig();const{jszip:n}=await impui.loadAsync(["jszip"]),r=new n;try{let n;if(En[e])n=En[e];else{const t=await fetch(e),s=await t.arrayBuffer();n=await r.loadAsync(s),En[e]=n}t=t||(()=>!0);const s={},o=[];n.forEach(async(e,n)=>{if(t(e,n)){const t=n.async("blob").then(t=>{const n=URL.createObjectURL(t);return{key:e,url:n}});o.push(t)}});return(await Promise.all(o)).forEach(e=>{s[e.key]=e.url}),s}catch(s){return console.error("获取压缩包失败:",s),null}}get titlesTool(){return{converTitlesex:e=>{if(!e)return{};if(d(e))return e;if(f(e))return JSON.parse(e);const t={};return g(e)&&e.forEach(e=>{t[e.titleid]=e}),t},getTitlesexFromType:(e,t)=>{const n=this.titlesTool.converTitlesex(e),r=[];for(const s in n){n[s].type===t&&r.push(parseInt(s))}return r},getTitlexIdFromType:(e,t)=>{const n=this.titlesTool.converTitlesex(e);let r=0,s=Number.MAX_VALUE;const o=t.toLowerCase();for(const i in n){const e=n[i];if(e.type.toLowerCase()===o){if("bubble"!==o)return parseInt(i);const t=parseInt(e.endtime);t<s&&(r=parseInt(i),s=t)}}return r},getHeadBorderSrc:e=>this.getSrc(7,e),getHeadBorderImg:e=>`<div class="border_img"><img src="${this.titlesTool.getHeadBorderSrc(e)}" /></div>`,getHeadBorder:(e,t)=>(e.addClass("headBorder"),e.append(this.titlesTool.getHeadBorderImg(t)),e)}}};export{vn as Login,Kt as axios,C as getAllConfig,B as getApiurl,k as getCodeVer,j as getConfig,U as getDomainConfig,T as getEvnConfig,A as getSimplifyConfig,W as gotool,dn as handleUrl,Sn as login,On as restool};
1
+ import{urltool as e,date as t,extend as n,getAndWaitCache as r,loadjs as s,getLog as o,bufferToBase64 as i,base64ToBuffer as a,type as c,message as l,isBoolean as u,cache as h,isString as f,isObject as d,isArray as g}from"@impui/com";import*as m from"@impui/com/layer";import{event as p}from"@impui/com/event";import{urltool as y}from"@impui/com/url";import{getLog as w}from"@impui/com/log";import{cache as b}from"@impui/com/cache";import{extend as _}from"@impui/com/core";import{iframeReq as v,get as S}from"@impui/com/req";const E=e.getDomainJson(),O={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com",isLocalhost:!1,localConfig:null};let L=null;const R={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},x=t.getTimestamp(),P={config:x,bubble:x,dress:x,gift:x,template:x},T=()=>{if(L)return L;L=O,"undefined"!=typeof __impconfig__&&(L=n(!0,{},O,__impconfig__));for(const e in R)L[e]=L.allsr+R[e];return L};"localhost"===E.main&&(E.main=T().debugDomain,E.mainhost=T().debugDomain,E.port="",E.name=E.mainhost.split(".")[0],E.protocol="https:");const k=()=>n(!0,{},P,window.codever),C=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await r("config_allconfig",async()=>(await s(T().allconfig),window.allconfig))).domainsitetype},U=async()=>{const e=(await C())["localhost"===E.main?T().debugDomain:E.main];return e||{}},A=async()=>await r("config_simplify",async()=>{const e=await N("config_simplify");await s(e);const t=window.sconfig;return delete window.sconfig,t}),j=async()=>await r("config_full",async()=>{console.log("getConfig");const e=await N("config");await s(e);const t=T();let r=window.config;return delete window.config,r.npm=r.allsr+"/npm/",t.isLocalhost&&t.localConfig&&(r=n(!0,{},r,t.localConfig)),r}),N=async e=>{const t=await U();var n=t.res||"sr",r=t.resHost||E.mainhost;return`${E.protocol+"//"+n+"."+r}/live/webSkins_site/${t.sitetype}/config/${e}.js`},B=async()=>await r("config_apiurl",async()=>await s(T().apiurl,{extend:n,config:await j()}));(()=>{const e=globalThis,t=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!e.fs){let n="";e.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,t){n+=r.decode(t);const s=n.lastIndexOf("\n");return-1!=s&&(console.log(n.substr(0,s)),n=n.substr(s+1)),t.length},write(e,n,r,s,o,i){if(0!==r||s!==n.length||null!==o)return void i(t());i(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,s){s(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,s){s(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,s){s(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,s){s(t())},read(e,n,r,s,o,i){i(t())},readdir(e,n){n(t())},readlink(e,n){n(t())},rename(e,n,r){r(t())},rmdir(e,n){n(t())},stat(e,n){n(t())},symlink(e,n,r){r(t())},truncate(e,n,r){r(t())},unlink(e,n){n(t())},utimes(e,n,r,s){s(t())}}}if(e.process||(e.process={getuid:()=>-1,getgid:()=>-1,geteuid:()=>-1,getegid:()=>-1,getgroups(){throw t()},pid:-1,ppid:-1,umask(){throw t()},cwd(){throw t()},chdir(){throw t()}}),!e.crypto){const t=require("node:crypto");e.crypto={getRandomValues(e){t.randomFillSync(e)}}}e.performance||(e.performance={now(){const[e,t]=process.hrtime();return 1e3*e+t/1e6}}),e.TextEncoder||(e.TextEncoder=require("node:util").TextEncoder),e.TextDecoder||(e.TextDecoder=require("node:util").TextDecoder);const n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8");let s=new DataView(new ArrayBuffer(8));var o=[];const i={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{s.setBigInt64(0,e,!0);const t=s.getFloat64(0,!0);if(0===t)return;if(!isNaN(t))return t;const n=0xffffffffn&e;return this._values[n]},a=n=>{let r=e().getBigUint64(n,!0);return t(r)},c=e=>{const t=0x7FF80000n;if("number"==typeof e)return isNaN(e)?t<<32n:0===e?t<<32n|1n:(s.setFloat64(0,e,!0),s.getBigInt64(0,!0));switch(e){case void 0:return 0n;case null:return t<<32n|2n;case!0:return t<<32n|3n;case!1:return t<<32n|4n}let n=this._ids.get(e);void 0===n&&(n=this._idPool.pop(),void 0===n&&(n=BigInt(this._values.length)),this._values[n]=e,this._goRefCounts[n]=0,this._ids.set(e,n)),this._goRefCounts[n]++;let r=1n;switch(typeof e){case"string":r=2n;break;case"symbol":r=3n;break;case"function":r=4n}return n|(t|r)<<32n},l=(t,n)=>{let r=c(n);e().setBigUint64(t,r,!0)},u=(e,t,n)=>new Uint8Array(this._inst.exports.memory.buffer,e,t),h=(e,t,n)=>{const r=new Array(t);for(let s=0;s<t;s++)r[s]=a(e+8*s);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),d=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,s,i){let a=0;if(1==t)for(let c=0;c<s;c++){let t=n+8*c,s=e().getUint32(t+0,!0),i=e().getUint32(t+4,!0);a+=i;for(let n=0;n<i;n++){let t=e().getUint8(s+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(o));o=[],console.log(e)}else o.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(i,a,!0),0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,proc_exit:e=>{throw this.exited=!0,this.exitCode=e,this._resolveExitPromise(),i},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(d+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==i)throw e}},Number(e)/1e6)},"syscall/js.finalizeRef":e=>{const t=0xffffffffn&e;if(void 0!==this._goRefCounts?.[t]){if(this._goRefCounts[t]--,0===this._goRefCounts[t]){const e=this._values[t];this._values[t]=null,this._ids.delete(e),this._idPool.push(t)}}else console.error("syscall/js.finalizeRef: unknown id",t)},"syscall/js.stringVal":(e,t)=>{const n=f(e>>>=0,t);return c(n)},"syscall/js.valueGet":(e,n,r)=>{let s=f(n,r),o=t(e),i=Reflect.get(o,s);return c(i)},"syscall/js.valueSet":(e,n,r,s)=>{const o=t(e),i=f(n,r),a=t(s);Reflect.set(o,i,a)},"syscall/js.valueDelete":(e,n,r)=>{const s=t(e),o=f(n,r);Reflect.deleteProperty(s,o)},"syscall/js.valueIndex":(e,n)=>c(Reflect.get(t(e),n)),"syscall/js.valueSetIndex":(e,n,r)=>{Reflect.set(t(e),n,t(r))},"syscall/js.valueCall":(n,r,s,o,i,a,c)=>{const u=t(r),d=f(s,o),g=h(i,a);try{const t=Reflect.get(u,d);l(n,Reflect.apply(t,u,g)),e().setUint8(n+8,1)}catch(m){l(n,m),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,s,o,i)=>{try{const i=t(r),a=h(s,o);l(n,Reflect.apply(i,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,s,o,i)=>{const a=t(r),c=h(s,o);try{l(n,Reflect.construct(a,c)),e().setUint8(n+8,1)}catch(u){l(n,u),e().setUint8(n+8,0)}},"syscall/js.valueLength":e=>t(e).length,"syscall/js.valuePrepareString":(r,s)=>{const o=String(t(s)),i=n.encode(o);l(r,i),e().setInt32(r+8,i.length,!0)},"syscall/js.valueLoadString":(e,n,r,s)=>{const o=t(e);u(n,r).set(o)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,s,o,i)=>{let a=n,c=n+4;const l=u(r,s),h=t(i);if(!(h instanceof Uint8Array||h instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=h.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,s,o,i)=>{let a=n,c=n+4;const l=t(r),h=u(s,o);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=h.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)}}},this.importObject.env=this.importObject.gojs}async run(t){if(this._inst=t,this._values=[NaN,0,null,!0,!1,e,this],this._goRefCounts=[],this._ids=/* @__PURE__ */new Map,this._idPool=[],this.exited=!1,this.exitCode=0,this._inst.exports._start){let e=new Promise((e,t)=>{this._resolveExitPromise=e});try{this._inst.exports._start()}catch(n){if(n!==i)throw n}return await e,this.exitCode}this._inst.exports._initialize()}_resume(){if(this.exited)throw new Error("Go program has already exited");try{this._inst.exports.resume()}catch(e){if(e!==i)throw e}this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const t=this;return function(){const n={id:e,this:this,args:arguments};return t._pendingEvent=n,t._resume(),n.result}}}})();const I=Go,D={},F=(await j()).allsr+"/plug/gotool/lib/imptool.wasm",M=await o(),q=async function(){return console.warn("⚠️ 降级方案已启用"),{encrypt:function(){throw new Error("❌ 降级方案未实现:encrypt方法")},parseRes:async function(e,t){try{if("true"!==e.headers["res-encrypt"])return e;const t={data:e.data},n=await B(),r=await axios.post(n.parseRes,{res:encodeURIComponent(JSON.stringify(t)),config:null});return e.data=JSON.parse(r.data),e}catch(n){console.error("❌ 降级方案请求接口失败:",n)}},parseServer:function(){throw new Error("❌ 降级方案未实现:parseServer方法")}}};const W=new class{constructor(e){this.isbase=e===F,this.url=e}async#e(){if(!this.url){const e=await j();this.url=e.allsr+"plug/gotool/lib/imptool.wasm"}return this.url}async#t(e,t){return async function(e,t,n=!1){try{const s=new I;M("=== WASM加载调试开始 ==="),M("URL:",e),M("UserAgent:",navigator.userAgent);const o=await r(e,async()=>{const n=await fetch(e+t);M("✅ 响应状态:",n.status);const r=await n.arrayBuffer();return M("✅ ArrayBuffer大小:",r.byteLength,"bytes"),i(r,{type:"application/wasm"})}),c=await a(o),l=new Uint8Array(c.slice(0,4));M("🔍 WASM文件头:",Array.from(l)),M("🔍 Go importObject结构:",Object.keys(s.importObject)),s.importObject.go&&M("🔍 GoJS导入键:",Object.keys(s.importObject.go)),M("🚀 开始WebAssembly.instantiate...");const u=await WebAssembly.instantiate(c,s.importObject);if(M("✅ WebAssembly实例化成功"),M("🚀 开始go.run..."),s.run(u.instance),M("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,M("✅ goCrypto加载成功"),e}if(n)return await q();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(s){throw console.error("💥 完整错误堆栈:",s),console.error("错误名称:",s.name),console.error("错误信息:",s.message),s}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&D[t])return D[t];const n=k(),r=n.config?"?d="+n.config:"",s=await this.#t(t,r),o={};if(s)for(let i in s)o[i]=s[i];return D[t]=o,o}async init(){return this.getRunTimes()}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(F);function z(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:G}=Object,{iterator:H,toStringTag:K}=Symbol,J=/* @__PURE__ */(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),V=e=>(e=e.toLowerCase(),t=>J(t)===e),X=e=>t=>typeof t===e,{isArray:Z}=Array,Q=X("undefined");function Y(e){return null!==e&&!Q(e)&&null!==e.constructor&&!Q(e.constructor)&&ne(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ee=V("ArrayBuffer");const te=X("string"),ne=X("function"),re=X("number"),se=e=>null!==e&&"object"==typeof e,oe=e=>{if("object"!==J(e))return!1;const t=G(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||K in e||H in e)},ie=V("Date"),ae=V("File"),ce=V("Blob"),le=V("FileList"),ue=V("URLSearchParams"),[he,fe,de,ge]=["ReadableStream","Request","Response","Headers"].map(V);function me(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Z(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Y(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(r=0;r<o;r++)i=s[r],t.call(null,e[i],i,e)}}function pe(e,t){if(Y(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,we=e=>!Q(e)&&e!==ye;const be=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&G(Uint8Array)),_e=V("HTMLFormElement"),ve=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Se=V("RegExp"),Ee=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};me(n,(n,s)=>{let o;!1!==(o=t(n,s,e))&&(r[s]=o||n)}),Object.defineProperties(e,r)};const Oe=V("AsyncFunction"),Le=(Re="function"==typeof setImmediate,xe=ne(ye.postMessage),Re?setImmediate:xe?(Pe=`axios@${Math.random()}`,Te=[],ye.addEventListener("message",({source:e,data:t})=>{e===ye&&t===Pe&&Te.length&&Te.shift()()},!1),e=>{Te.push(e),ye.postMessage(Pe,"*")}):e=>setTimeout(e));var Re,xe,Pe,Te;const ke="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ye):"undefined"!=typeof process&&process.nextTick||Le,Ce={isArray:Z,isArrayBuffer:ee,isBuffer:Y,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ne(e.append)&&("formdata"===(t=J(e))||"object"===t&&ne(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ee(e.buffer),t},isString:te,isNumber:re,isBoolean:e=>!0===e||!1===e,isObject:se,isPlainObject:oe,isEmptyObject:e=>{if(!se(e)||Y(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:he,isRequest:fe,isResponse:de,isHeaders:ge,isUndefined:Q,isDate:ie,isFile:ae,isBlob:ce,isRegExp:Se,isFunction:ne,isStream:e=>se(e)&&ne(e.pipe),isURLSearchParams:ue,isTypedArray:be,isFileList:le,forEach:me,merge:function e(){const{caseless:t,skipUndefined:n}=we(this)&&this||{},r={},s=(s,o)=>{const i=t&&pe(r,o)||o;oe(r[i])&&oe(s)?r[i]=e(r[i],s):oe(s)?r[i]=e({},s):Z(s)?r[i]=s.slice():n&&Q(s)||(r[i]=s)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&me(arguments[o],s);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(me(t,(t,r)=>{n&&ne(t)?e[r]=z(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&G(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:J,kindOfTest:V,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Z(e))return e;let t=e.length;if(!re(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[H]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_e,hasOwnProperty:ve,hasOwnProp:ve,reduceDescriptors:Ee,freezeMethods:e=>{Ee(e,(t,n)=>{if(ne(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ne(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Z(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:pe,global:ye,isContextDefined:we,isSpecCompliantForm:function(e){return!!(e&&ne(e.append)&&"FormData"===e[K]&&e[H])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(se(e)){if(t.indexOf(e)>=0)return;if(Y(e))return e;if(!("toJSON"in e)){t[r]=e;const s=Z(e)?[]:{};return me(e,(e,t)=>{const o=n(e,r+1);!Q(o)&&(s[t]=o)}),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Oe,isThenable:e=>e&&(se(e)||ne(e))&&ne(e.then)&&ne(e.catch),setImmediate:Le,asap:ke,isIterable:e=>null!=e&&ne(e[H])};function Ue(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Ce.inherits(Ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.status}}});const Ae=Ue.prototype,je={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{je[e]={value:e}}),Object.defineProperties(Ue,je),Object.defineProperty(Ae,"isAxiosError",{value:!0}),Ue.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);Ce.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Ue.call(i,a,c,n,r,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Ne(e){return Ce.isPlainObject(e)||Ce.isArray(e)}function Be(e){return Ce.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(e,t){return e=Be(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const De=Ce.toFlatObject(Ce,{},null,function(e){return/^is[A-Z]/.test(e)});function Fe(e,t,n){if(!Ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ce.isUndefined(t[e])})).metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(t);if(!Ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Ce.isDate(e))return e.toISOString();if(Ce.isBoolean(e))return e.toString();if(!a&&Ce.isBlob(e))throw new Ue("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(e)||Ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(Ce.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Ce.isArray(e)&&function(e){return Ce.isArray(e)&&!e.some(Ne)}(e)||(Ce.isFileList(e)||Ce.endsWith(n,"[]"))&&(a=Ce.toArray(e)))return n=Be(n),a.forEach(function(e,r){!Ce.isUndefined(e)&&null!==e&&t.append(!0===i?Ie([n],r,o):null===i?n:n+"[]",c(e))}),!1;return!!Ne(e)||(t.append(Ie(s,n,o),c(e)),!1)}const u=[],h=Object.assign(De,{defaultVisitor:l,convertValue:c,isVisitable:Ne});if(!Ce.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Ce.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Ce.forEach(n,function(n,o){!0===(!(Ce.isUndefined(n)||null===n)&&s.call(t,n,Ce.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),u.pop()}}(e),t}function Me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function qe(e,t){this._pairs=[],e&&Fe(e,this,t)}const We=qe.prototype;function ze(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||ze;Ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(t,n):Ce.isURLSearchParams(t)?t.toString():new qe(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}We.append=function(e,t){this._pairs.push([e,t])},We.toString=function(e){const t=e?function(t){return e.call(this,t,Me)}:Me;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Ge{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ce.forEach(this.handlers,function(t){null!==t&&e(t)})}}const He={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ke={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:qe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Je="undefined"!=typeof window&&"undefined"!=typeof document,Ve="object"==typeof navigator&&navigator||void 0,Xe=Je&&(!Ve||["ReactNative","NativeScript","NS"].indexOf(Ve.product)<0),Ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Qe=Je&&window.location.href||"http://localhost",Ye={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:Je,hasStandardBrowserEnv:Xe,hasStandardBrowserWebWorkerEnv:Ze,navigator:Ve,origin:Qe},Symbol.toStringTag,{value:"Module"})),...Ke};function et(e){function t(e,n,r,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&Ce.isArray(r)?r.length:o,a)return Ce.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&Ce.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],s)&&Ce.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}(r[o])),!i}if(Ce.isFormData(e)&&Ce.isFunction(e.entries)){const n={};return Ce.forEachEntry(e,(e,r)=>{t(function(e){return Ce.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const tt={transitional:He,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Ce.isObject(e);s&&Ce.isHTMLForm(e)&&(e=new FormData(e));if(Ce.isFormData(e))return r?JSON.stringify(et(e)):e;if(Ce.isArrayBuffer(e)||Ce.isBuffer(e)||Ce.isStream(e)||Ce.isFile(e)||Ce.isBlob(e)||Ce.isReadableStream(e))return e;if(Ce.isArrayBufferView(e))return e.buffer;if(Ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Fe(e,new Ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ye.isNode&&Ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=Ce.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Fe(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Ce.isString(e))try{return(t||JSON.parse)(e),Ce.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||tt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Ce.isResponse(e)||Ce.isReadableStream(e))return e;if(e&&Ce.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(s){if(n){if("SyntaxError"===s.name)throw Ue.from(s,Ue.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ye.classes.FormData,Blob:Ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ce.forEach(["delete","get","head","post","put","patch"],e=>{tt.headers[e]={}});const nt=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),rt=Symbol("internals");function st(e){return e&&String(e).trim().toLowerCase()}function ot(e){return!1===e||null==e?e:Ce.isArray(e)?e.map(ot):String(e)}function it(e,t,n,r,s){return Ce.isFunction(r)?r.call(this,t,n):(s&&(t=n),Ce.isString(t)?Ce.isString(r)?-1!==t.indexOf(r):Ce.isRegExp(r)?r.test(t):void 0:void 0)}let at=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=st(t);if(!s)throw new Error("header name must be a non-empty string");const o=Ce.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ot(e))}const o=(e,t)=>Ce.forEach(e,(e,n)=>s(e,n,t));if(Ce.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(Ce.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&nt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Ce.isObject(e)&&Ce.isIterable(e)){let n,r,s={};for(const t of e){if(!Ce.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?Ce.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=st(e)){const n=Ce.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=/* @__PURE__ */Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Ce.isFunction(t))return t.call(this,e,n);if(Ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=st(e)){const n=Ce.findKey(this,e);return!(!n||void 0===this[n]||t&&!it(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=st(e)){const s=Ce.findKey(n,e);!s||t&&!it(0,n[s],s,t)||(delete n[s],r=!0)}}return Ce.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!it(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Ce.forEach(this,(r,s)=>{const o=Ce.findKey(n,s);if(o)return t[o]=ot(r),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(s):String(s).trim();i!==s&&delete t[s],t[i]=ot(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Ce.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Ce.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[rt]=this[rt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=st(e);t[r]||(!function(e,t){const n=Ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})})}(n,e),t[r]=!0)}return Ce.isArray(e)?e.forEach(r):r(e),this}};function ct(e,t){const n=this||tt,r=t||n,s=at.from(r.headers);let o=r.data;return Ce.forEach(e,function(e){o=e.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function lt(e){return!(!e||!e.__CANCEL__)}function ut(e,t,n){Ue.call(this,null==e?"canceled":e,Ue.ERR_CANCELED,t,n),this.name="CanceledError"}function ht(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ue("Request failed with status code "+n.status,[Ue.ERR_BAD_REQUEST,Ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.reduceDescriptors(at.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ce.freezeMethods(at),Ce.inherits(ut,Ue,{__CANCEL__:!0});const ft=(e,t,n=3)=>{let r=0;const s=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];s||(s=c),n[o]=a,r[o]=c;let u=i,h=0;for(;u!==o;)h+=n[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const f=l&&c-l;return f?Math.round(1e3*h/f):void 0}}(50,250);return function(e,t){let n,r,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},o-a)))},()=>n&&i(n)]}(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,c=s(a);r=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},dt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},gt=e=>(...t)=>Ce.asap(()=>e(...t)),mt=Ye.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,Ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ye.origin),Ye.navigator&&/(msie|trident)/i.test(Ye.navigator.userAgent)):()=>!0,pt=Ye.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Ce.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Ce.isString(r)&&a.push(`path=${r}`),Ce.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),Ce.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function yt(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const wt=e=>e instanceof at?{...e}:e;function bt(e,t){t=t||{};const n={};function r(e,t,n,r){return Ce.isPlainObject(e)&&Ce.isPlainObject(t)?Ce.merge.call({caseless:r},e,t):Ce.isPlainObject(t)?Ce.merge({},t):Ce.isArray(t)?t.slice():t}function s(e,t,n,s){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function o(e,t){if(!Ce.isUndefined(t))return r(void 0,t)}function i(e,t){return Ce.isUndefined(t)?Ce.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,o){return o in t?r(n,s):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>s(wt(e),wt(t),0,!0)};return Ce.forEach(Object.keys({...e,...t}),function(r){const o=c[r]||s,i=o(e[r],t[r],r);Ce.isUndefined(i)&&o!==a||(n[r]=i)}),n}const _t=e=>{const t=bt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=at.from(i),t.url=$e(yt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Ce.isFormData(n))if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(Ce.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if(Ye.hasStandardBrowserEnv&&(r&&Ce.isFunction(r)&&(r=r(t)),r||!1!==r&&mt(t.url))){const e=s&&o&&pt.read(o);e&&i.set(s,e)}return t},vt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=_t(e);let s=r.data;const o=at.from(r.headers).normalize();let i,a,c,l,u,{responseType:h,onUploadProgress:f,onDownloadProgress:d}=r;function g(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function p(){if(!m)return;const r=at.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());ht(function(e){t(e),g()},function(e){n(e),g()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=p:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(p)},m.onabort=function(){m&&(n(new Ue("Request aborted",Ue.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new Ue(t&&t.message?t.message:"Network Error",Ue.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||He;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ue(t,s.clarifyTimeoutError?Ue.ETIMEDOUT:Ue.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&Ce.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Ce.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),d&&([c,u]=ft(d,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,l]=ft(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new ut(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Ye.protocols.indexOf(y)?n(new Ue("Unsupported protocol "+y+":",Ue.ERR_BAD_REQUEST,e)):m.send(s||null)})},St=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ue?t:new ut(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Ue(`timeout ${t} of ms exceeded`,Ue.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>Ce.asap(i),a}},Et=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Ot=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Lt=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of Ot(e))yield*Et(n,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=i+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:Rt}=Ce,xt=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ce.global),{ReadableStream:Pt,TextEncoder:Tt}=Ce.global,kt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Ct=e=>{e=Ce.merge.call({skipUndefined:!0},xt,e);const{fetch:t,Request:n,Response:r}=e,s=t?Rt(t):"function"==typeof fetch,o=Rt(n),i=Rt(r);if(!s)return!1;const a=s&&Rt(Pt),c=s&&("function"==typeof Tt?/* @__PURE__ */(e=>t=>e.encode(t))(new Tt):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=o&&a&&kt(()=>{let e=!1;const t=new n(Ye.origin,{body:new Pt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=i&&a&&kt(()=>Ce.isReadableStream(new r("").body)),h={stream:u&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ue(`Response type '${e}' is not supported`,Ue.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Ce.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Ce.isBlob(e))return e.size;if(Ce.isSpecCompliantForm(e)){const t=new n(Ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ce.isArrayBufferView(e)||Ce.isArrayBuffer(e)?e.byteLength:(Ce.isURLSearchParams(e)&&(e+=""),Ce.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:d,timeout:g,onDownloadProgress:m,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=_t(e),v=t||fetch;y=y?(y+"").toLowerCase():"text";let S=St([c,d&&d.toAbortSignal()],g),E=null;const O=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let L;try{if(p&&l&&"get"!==i&&"head"!==i&&0!==(L=await f(w,a))){let e,t=new n(s,{method:"POST",body:a,duplex:"half"});if(Ce.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=dt(L,ft(gt(p)));a=Lt(t.body,65536,e,n)}}Ce.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in n.prototype,c={..._,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=o&&new n(s,c);let d=await(o?v(E,_):v(s,c));const g=u&&("stream"===y||"response"===y);if(u&&(m||g&&O)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=d[t]});const t=Ce.toFiniteNumber(d.headers.get("content-length")),[n,s]=m&&dt(t,ft(gt(m),!0))||[];d=new r(Lt(d.body,65536,n,()=>{s&&s(),O&&O()}),e)}y=y||"text";let R=await h[Ce.findKey(h,y)||"text"](d,e);return!g&&O&&O(),await new Promise((t,n)=>{ht(t,n,{data:R,headers:at.from(d.headers),status:d.status,statusText:d.statusText,config:e,request:E})})}catch(R){if(O&&O(),R&&"TypeError"===R.name&&/Load failed|fetch/i.test(R.message))throw Object.assign(new Ue("Network Error",Ue.ERR_NETWORK,e,E),{cause:R.cause||R});throw Ue.from(R,R&&R.code,e,E)}}},Ut=/* @__PURE__ */new Map,At=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i,a,c=o.length,l=Ut;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?/* @__PURE__ */new Map:Ct(t)),l=a;return a};At();const jt={http:null,xhr:vt,fetch:{get:At}};Ce.forEach(jt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Nt=e=>`- ${e}`,Bt=e=>Ce.isFunction(e)||null===e||!1===e;const It={getAdapter:function(e,t){e=Ce.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){let n;if(r=e[i],s=r,!Bt(r)&&(s=jt[(n=String(r)).toLowerCase()],void 0===s))throw new Ue(`Unknown adapter '${n}'`);if(s&&(Ce.isFunction(s)||(s=s.get(t))))break;o[n||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Ue("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Nt).join("\n"):" "+Nt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:jt};function Dt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ut(null,e)}function Ft(e){Dt(e),e.headers=at.from(e.headers),e.data=ct.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return It.getAdapter(e.adapter||tt.adapter,e)(e).then(function(t){return Dt(e),t.data=ct.call(e,e.transformResponse,t),t.headers=at.from(t.headers),t},function(t){return lt(t)||(Dt(e),t&&t.response&&(t.response.data=ct.call(e,e.transformResponse,t.response),t.response.headers=at.from(t.response.headers))),Promise.reject(t)})}const Mt="1.13.2",qt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Wt={};qt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Mt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,o)=>{if(!1===e)throw new Ue(r(s," has been removed"+(t?" in "+t:"")),Ue.ERR_DEPRECATED);return t&&!Wt[s]&&(Wt[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,o)}},qt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const zt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ue("options must be an object",Ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const t=e[o],n=void 0===t||i(t,o,e);if(!0!==n)throw new Ue("option "+o+" must be "+n,Ue.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ue("Unknown option "+o,Ue.ERR_BAD_OPTION)}},validators:qt},$t=zt.validators;let Gt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ge,response:new Ge}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=bt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&zt.assertOptions(n,{silentJSONParsing:$t.transitional($t.boolean),forcedJSONParsing:$t.transitional($t.boolean),clarifyTimeoutError:$t.transitional($t.boolean)},!1),null!=r&&(Ce.isFunction(r)?t.paramsSerializer={serialize:r}:zt.assertOptions(r,{encode:$t.function,serialize:$t.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),zt.assertOptions(t,{baseUrl:$t.spelling("baseURL"),withXsrfToken:$t.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&Ce.merge(s.common,s[t.method]);s&&Ce.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=at.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[Ft.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=i.length;let f=t;for(;h<u;){const e=i[h++],t=i[h++];try{f=e(f)}catch(d){t.call(this,d);break}}try{l=Ft.call(this,f)}catch(d){return Promise.reject(d)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return $e(yt((e=bt(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Ce.forEach(["delete","get","head","options"],function(e){Gt.prototype[e]=function(t,n){return this.request(bt(n||{},{method:e,url:t,data:(n||{}).data}))}}),Ce.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,s){return this.request(bt(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gt.prototype[e]=t(),Gt.prototype[e+"Form"]=t(!0)});const Ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ht).forEach(([e,t])=>{Ht[t]=e});const Kt=function e(t){const n=new Gt(t),r=z(Gt.prototype.request,n);return Ce.extend(r,Gt.prototype,n,{allOwnKeys:!0}),Ce.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(bt(t,n))},r}(tt);Kt.Axios=Gt,Kt.CanceledError=ut,Kt.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,s){n.reason||(n.reason=new ut(e,r,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Kt.isCancel=lt,Kt.VERSION=Mt,Kt.toFormData=Fe,Kt.AxiosError=Ue,Kt.Cancel=Kt.CanceledError,Kt.all=function(e){return Promise.all(e)},Kt.spread=function(e){return function(t){return e.apply(null,t)}},Kt.isAxiosError=function(e){return Ce.isObject(e)&&!0===e.isAxiosError},Kt.mergeConfig=bt,Kt.AxiosHeaders=at,Kt.formToJSON=e=>et(Ce.isHTMLForm(e)?new FormData(e):e),Kt.getAdapter=It.getAdapter,Kt.HttpStatusCode=Ht,Kt.default=Kt;const{Axios:Jt,AxiosError:Vt,CanceledError:Xt,isCancel:Zt,CancelToken:Qt,VERSION:Yt,all:en,Cancel:tn,isAxiosError:nn,spread:rn,toFormData:sn,AxiosHeaders:on,HttpStatusCode:an,formToJSON:cn,getAdapter:ln,mergeConfig:un}=Kt,hn=y.getPar,fn=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(hn("Device")||-1)};t&&(r._tui_source=((n=hn("_tui_source")||hn("from")||hn("source"))||(n=b.get("_tui_source")),n));var s=window.pdata||window.axiosData||window.reqData||{};return e=_(!0,r,s,e)},dn=function(e,t,n){return n=fn(n,t),e=y.addPars(n,e)},gn=await w(),mn="imp_sign",pn="imp_useridx";y.getPar("useridx");var yn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Kt.codeEnum=yn,Kt.defaults.baseURL="",Kt.defaults.withCredentials=!0,Kt.defaults.crossDomain=!0,Kt.defaults.dataType="json",Kt.saveLogin=function(e,t){gn.debug("写入sign:",t),b.set(mn,t),e&&b.set(pn,e)},Kt.interceptors.request.use(async function(e){gn.debug("请求拦截",e),function(e,t,n){var r;"post"===e.method?(e.data=e.data||{},r=e.data):(e.params=e.params||{},r=e.params),n&&(r[t]=n)}(e,"_tui_source",y.getPar("_tui_source")||y.getPar("from")||y.getPar("source")),dn(e.url),"post"===e.method&&(e.data=y.jsonto(e.data).substring(1));const t=await Sn.getLogin(null,!0);return t&&(e.headers[mn]=t.sign,e.headers[pn]=b.get(pn)),e},function(e){return Promise.reject(e)}),Kt.interceptors.response.use(async function(e){if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([W.init(),j()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}if(c.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}switch(gn.debug("响应拦截 -> "+e.config.url+"\n",e),e.data.__source=e,(e=e.data).codeEnum=yn,e.isSuccess=function(t){return e.code!==yn.success&&(t||m.msg(e.msg)),e.code===yn.success},e.code){case yn.success:return Promise.resolve(e);case yn.jumpTo:return void(location.href=e.data);case yn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case yn.alert:case yn.msg:return m.msg(e.msg),Promise.reject(e);case yn.noRealName:return impall.showReal_name();case yn.ServerSignError:case yn.nologin:if(e.__source.config.isTwice)return Sn.runNoLogin&&Sn.runNoLogin(e),Promise.resolve(e);const t=function(){return gn.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=y.toData(e.__source.config.data),Kt(e.__source.config)};return await p.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var wn=Kt.get;Kt.get=function(e,t,n){return(n=n||{}).params=t,wn(e,n)};const bn=await j(),_n=await o();class vn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname&&T().isLocalhost?"https://localhost:44360":bn.domainLogin,this.ver="v1.0.0",this.loginTime=21600,this.prefix="IMP_PLUG_LOGIN_",this.initUrls(),this.initKeys(),this.initEventKeys(),this.bindEvents(),this.iframeBox=null,this.iframe=null,this.iframeBg=null,this.autoLogin={},this.exitLogin={},this.threeLoginWin=null,this.checkTemp(),window.login=this}initUrls(){this.urls={login:dn(this.loginDomain+"/index.html",!0),reg:dn(this.loginDomain+"/index.html?type=reg",!0),loginPage:dn(this.loginDomain+"/loginPage.html",!0),regPage:dn(this.loginDomain+"/regPage.html",!0),autoLogin:dn(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:dn(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:dn(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:dn(this.loginDomain+"/"+this.ver+"/user/CheckLoginByCode"),exitLogin:this.loginDomain+"/"+this.ver+"/user/exitLogin",userInfo:this.loginDomain+"/"+this.ver+"/user/UserInfo",writeCookies:"/ashx/member/CheckSSOWriteCookie.ashx",webLoginOut:"/ajax/logout.aspx"}}initKeys(){const e=e=>this.prefix+e;this.keys={msg_loginReturn:e("loginReturn"),msg_close:e("close"),msg_goto:e("goto"),msg_autoSize:e("autoSize"),msg_getSize:e("getSize"),cache_loginSave:e("loginSave"),cache_userInfo:e("userInfo"),checkLogin_code:"code",loginStatus:"__login_status",loginResult:"__login_result",url_tempSignKey:"sign",url_tempUseridxKey:"useridx"}}initEventKeys(){const e=e=>this.prefix+e;this.eventKeys={nologin:e("login"),closeThreeLogin:e("close_login_three")}}bindEvents(){l.on(this.keys.msg_close,()=>{_n.debug("关闭登录框"),this.close()}),l.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),l.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),l.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),l.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()}),p.onM("login","getLogin",this.getLogin.bind(this)),p.onM("login","noLogin",this.runNoLogin.bind(this))}handlePageTransition(e){if(!this.iframe)return;this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut");const t=()=>{this.iframe.src=e.url,this.iframe.classList.remove("IMP_PLUG_LOGIN_animateOut"),this.iframe.removeEventListener("transitionend",t)};this.iframe.addEventListener("transitionend",t)}handleAutoSize(e){this.iframe&&(_n.debug("登录框尺寸适配",e),this.iframe.width=e.width,this.iframe.height=e.height,this.iframe.classList.add("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateIn"))}runAutoLoginCallback(e,t){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{if(u(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Kt.codeEnum.success)}}),this.autoLogin.iframe&&this.autoLogin.iframe.remove(),this.autoLogin.window&&this.autoLogin.window.close(),this.autoLogin={},e&&this.close())}async dealwithLoginRes(t){if(_n.debug("登录消息返回",t),t.isok=t.code===Kt.codeEnum.success,1!==t.code)return this.clear(),void this.runAutoLoginCallback(t);if(t.sign&&8===t.sign.length)this.save(t);else{e.delParsUpUrl([this.keys.url_tempSignKey,this.keys.url_tempUseridxKey]),h.set(this.keys.cache_loginSave,t,this.loginTime),Kt.saveLogin(t.useridx,t.sign);try{await Kt.get(this.urls.writeCookies,null,null,"text")}finally{this.runAutoLoginCallback(t)}}}save(e){const t=e.__source?.headers?.[e.sign]||e.data?.headers?.[e.sign]||e.sign,n=e.useridx||e.data?.___useridx;l.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){h.remove(this.keys.cache_loginSave),h.remove(this.keys.cache_userInfo),h.remove(this.keys.cache_userInfo+"_more"),h.remove(this.keys.cache_userInfo+"_simplify")}onLoginOK(e,t){this.autoLogin.callbacks||(this.autoLogin.callbacks=[]),this.autoLogin.callbacks.push({ok:e,no:t})}create(e){const t=n(!0,{url:"",name:"",option:null},e);this.createIframeBox(),this.createIframe(t),this.applyStyles(t.option||{}),this.appendToDocument()}createIframeBox(){this.iframeBox=document.createElement("div"),this.iframeBox.className="IMP_PLUG_LOGIN_box";const e=parseFloat(window.getComputedStyle(document.documentElement).zoom);e<1&&(this.iframeBox.style.zoom=(1/e).toFixed(2)),this.iframe=document.createElement("iframe"),this.iframeBg=document.createElement("div")}createIframe(e){this.iframe.id=this.iframe.name=e.name,this.iframe.src=e.url;const t=e.option||{};this.iframe.width=t.width||400,this.iframe.height=t.height||400,this.iframe.scrolling=t.scrolling||"no",this.iframe.marginWidth=t.marginWidth||"0",this.iframe.marginHeight=t.marginHeight||"0",this.iframe.frameBorder=t.frameBorder||"0"}applyStyles(e){Object.assign(this.iframe.style,{zIndex:3e3,position:"fixed",borderRadius:e.radius||"none",opacity:0}),Object.assign(this.iframeBg.style,{position:"fixed",backgroundColor:"#6f6f6f80",width:"100%",height:"100%",top:0,left:0,opacity:0}),this.applyPosition(e.offset||"center"),this.applyAnimation(e)}applyPosition(e){const t={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},top:{top:"5%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"5%",left:"50%",transform:"translateX(-50%)"},lt:{top:"5%",left:"5%"},lb:{bottom:"5%",left:"5%"},rt:{top:"5%",right:"5%"},rb:{bottom:"5%",right:"5%"}},n=t[e]||t.center;Object.assign(this.iframe.style,n)}applyAnimation(e){const t=e.animTime||300;this.iframe.style.transition=`opacity ${t}ms`,this.iframeBg.style.transition=`opacity ${t}ms`,this.createAnimationStyles(e.anime||0)}createAnimationStyles(e){const t={0:".IMP_PLUG_LOGIN_animateIn{opacity:1 !important;} .IMP_PLUG_LOGIN_animateOut{opacity:0 !important;}"},n=t[e]||t[0],r=document.createElement("style");r.id="IMP_PLUG_LOGIN_animateCss";try{r.appendChild(document.createTextNode(n))}catch(s){r.styleSheet.cssText=n}document.head.appendChild(r)}appendToDocument(){this.iframeBox.append(this.iframe),this.iframeBox.append(this.iframeBg),document.body.append(this.iframeBox)}istop(){return parent===window}close(){if(!this.istop())return;const e=()=>{this.iframeBox&&(this.iframeBox.remove(),this.iframeBox=null),this.autoLogin.iframe&&this.autoLogin.iframe.remove();const e=document.getElementById("IMP_PLUG_LOGIN_animateCss");e&&e.remove()};this.iframeBg&&(this.iframeBg.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframeBg.classList.add("IMP_PLUG_LOGIN_animateOut")),this.iframe?(this.iframe.classList.remove("IMP_PLUG_LOGIN_animateIn"),this.iframe.classList.add("IMP_PLUG_LOGIN_animateOut"),this.iframe.addEventListener("transitionend",e,{once:!0})):e()}autoSize(e,t){l.send(this.keys.msg_autoSize,{width:e||document.body.scrollWidth,height:t||document.body.scrollHeight})}open(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.login,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.login})});return e?t:t.then(()=>location.reload())}openPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.loginPage);location.href=n}openReg(e=!1){if(this.iframeBox)return Promise.resolve();const t=new Promise((e,t)=>{this.onLoginOK(e,t),this.istop()?this.create({url:this.urls.reg,name:"signIn",option:{radius:"4px"}}):l.send(this.keys.msg_goto,{url:this.urls.reg})});return e?t:t.then(()=>location.reload())}openRegPage(){const t=e.getPar("sourceurl")||location.href,n=e.addPar("sourceurl",unescape(t),this.urls.regPage);location.href=n}threeLogin(e,t){return new Promise((n,r)=>{this.closeThreeLoginWin(),this.onLoginOK(n,r);const s=dn(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(s)})}closeThreeLoginWin(){this.threeLoginWin&&(this.threeLoginWin.close(),this.threeLoginWin=null)}getWechatCode(){const t=e.getPar("__login_code");if(!t){const e=`${this.loginDomain}/v1.0.0/user/OpenThreeLogin?type=wechatcode&redirect_uri=${encodeURIComponent(location.href)}`;location.href=e}return t}getLogin(e,t=!1){const n=e||h.get(this.keys.cache_loginSave);return n?(t||delete n.sign,n):null}getUser(e,t=!1,n=!1){"function"!=typeof e&&(n=t,t=e,e=null);const r=new Promise((e,r)=>{const s=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=h.get(s);if(t)return void e(t)}Kt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(h.set(s,t.data,this.loginTime),e(t.data)):r(t)})});return e?r.then(e):r}islogin(){return!!this.getLogin()}async check(){return!(this.isTempCheck||!this.islogin())||this.checkZ()}checkZ(){return new Promise((t,n)=>{if(!this.autoLogin.iframe&&!this.autoLogin.window){let t=this.urls.autoLogin;t=e.addPars({sign:e.getPar(this.keys.url_tempSignKey),useridx:e.getPar(this.keys.url_tempUseridxKey)},t),this.autoLogin.iframe=this.getIframeUrl(t,this.keys.msg_loginReturn),this.autoLogin.callbacks=[]}this.autoLogin.callbacks.push({ok:t,no:()=>{t(!1)}})})}async checkTemp(){if(this.isTempCheck=e.getPar(this.keys.url_tempSignKey)&&e.getPar(this.keys.url_tempUseridxKey),this.isTempCheck)return this.checkZ()}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),s=parseInt(e.getPar(this.keys.loginStatus)||-1);_n.debug("checkLogin_code:",r),0===s?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):s&&r?Kt.get(this.urls.CheckLoginByCode,{code:r}).then(r=>{1===r.code?(e.delParsUpUrl([this.keys.checkLogin_code,this.keys.loginStatus]),this.save(r.data),t(r)):n()}):Kt.get(this.urls.checkSSOLogin).then(n=>{if(1===n.code)this.getUser().then(t);else{let t=e.addPars({redirect_uri:encodeURIComponent(location.href)},this.urls.checkLoginPage);location.href=t}})})}res(t){const n=decodeURIComponent(e.getPar(this.keys.loginResult)||"");if(n){const r=JSON.parse(n);t?.(r),e.delParsUpUrl([this.keys.loginResult])}}exit(e=!1){return _n.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{v.get(this.urls.exitLogin).then(t=>{S(this.urls.webLoginOut,null,()=>{e(t)},"text"),this.clear(),this.exitLogin={}})}),e||(this.exitLogin.Promise=this.exitLogin.Promise.then(()=>{location.reload()}))),this.exitLogin.Promise}getIframeUrl(t,n){const r=document.createElement("iframe");Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",top:"-100px"}),r.dataset.flag=9513,n&&(t=e.addPar("post_msg_name",n,t)),r.src=t;let s,o=!1;const i=()=>{r.removeEventListener("error",a),clearTimeout(s)},a=e=>{o||(o=!0,i(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",e=>{o||(o=!0,i(),console.log("登录页面已打开"))},{once:!0}),r.addEventListener("error",a,{once:!0}),s=setTimeout(()=>{a()},1e4),document.body.append(r),r}onNoLogin(e){p?p.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return p?Promise.resolve(p.run(this.eventKeys.nologin,e)):(console.warn("事件模块event未加载,事件相关功能不可用!"),Promise.resolve())}writeXhr(e){if(!e)return console.warn("xhr不能为空!"),e;const t=this.getLogin(null,!0);return t&&(e.withCredentials=!0,e.setRequestHeader("imp_sign",t.sign),e.setRequestHeader("imp_useridx",t.useridx)),e}debug(...e){console&&console.debug&&console.debug(...e)}}const Sn=new vn,En={};const On=new class{constructor(){this._config=null,this.initPromise=this.init()}async init(){return this._config||(this._config=await j()),this}async ensureConfig(){return this._config||await this.initPromise,this}get statics(){return this._config?{nohead:`${this._config.sr}/live/webSkins_site/${this._config.sitetype}/images/nohead.jpg`}:{nohead:""}}getSrc(e,t,n){if(!this._config)return"";let r=e;if(isNaN(parseInt(e))&&(r=this._config.paths.typeEnums[e]),f(e)&&["emblem","bubble","head","cardskin"].indexOf(e.toLowerCase())>=0&&(d(t)||g(t))&&0===(t=this.titlesTool.getTitlexIdFromType(t,e)))return"";if(4!==r&&0!=t&&!t)return"";r=parseInt(r);const s=this._config.paths.types[`t_${r}`],o=s.pc_path||s.path,i=s.pc_suffix||s.suffix;let a=this._config.js_version;if(n){a=impui.getCodeVer()[n]||this._config.js_version}return t||0===t?`${o}${t}${i}?d=${a}`:`${o}?d=${a}`}getEmotSrc(e,t,n=!1){return n?this.getSrc("emot",`${e}/${t}_s`):this.getSrc("emot",`${e}/${t}`)}getUserLevelSrc(e){return this.getSrc("user",e)}getAnchorLevelSrc(e){return this.getSrc("host",e)}getBubbleZipSrc(e){return this.getSrc("bubble_zip",e)}getFanclubLevelHtml(e,t){return`<span class="fanclubgrage" style="background-image:url(${this.getSrc("fans_grade",e)})">${t}</span>`}async getBubbleImageMap(e,t){const n=this.getBubbleZipSrc(e);return await this.getZipUrlMap(n,t)}getSrImgSrc(e){return e?e.startsWith("http")?e:`${this._config.sr}${e.startsWith("/")?e:"/"+e}`:""}async getZipUrlMap(e,t){await this.ensureConfig();const{jszip:n}=await impui.loadAsync(["jszip"]),r=new n;try{let n;if(En[e])n=En[e];else{const t=await fetch(e),s=await t.arrayBuffer();n=await r.loadAsync(s),En[e]=n}t=t||(()=>!0);const s={},o=[];n.forEach(async(e,n)=>{if(t(e,n)){const t=n.async("blob").then(t=>{const n=URL.createObjectURL(t);return{key:e,url:n}});o.push(t)}});return(await Promise.all(o)).forEach(e=>{s[e.key]=e.url}),s}catch(s){return console.error("获取压缩包失败:",s),null}}get titlesTool(){return{converTitlesex:e=>{if(!e)return{};if(d(e))return e;if(f(e))return JSON.parse(e);const t={};return g(e)&&e.forEach(e=>{t[e.titleid]=e}),t},getTitlesexFromType:(e,t)=>{const n=this.titlesTool.converTitlesex(e),r=[];for(const s in n){n[s].type===t&&r.push(parseInt(s))}return r},getTitlexIdFromType:(e,t)=>{const n=this.titlesTool.converTitlesex(e);let r=0,s=Number.MAX_VALUE;const o=t.toLowerCase();for(const i in n){const e=n[i];if(e.type.toLowerCase()===o){if("bubble"!==o)return parseInt(i);const t=parseInt(e.endtime);t<s&&(r=parseInt(i),s=t)}}return r},getHeadBorderSrc:e=>this.getSrc(7,e),getHeadBorderImg:e=>`<div class="border_img"><img src="${this.titlesTool.getHeadBorderSrc(e)}" /></div>`,getHeadBorder:(e,t)=>(e.addClass("headBorder"),e.append(this.titlesTool.getHeadBorderImg(t)),e)}}};export{vn as Login,Kt as axios,C as getAllConfig,B as getApiurl,k as getCodeVer,j as getConfig,U as getDomainConfig,T as getEvnConfig,A as getSimplifyConfig,W as gotool,dn as handleUrl,Sn as login,On as restool};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impui/imp",
3
- "version": "1.0.15-beta.2",
3
+ "version": "1.0.15-beta.3",
4
4
  "description": "此库主要是公司相关的特殊处理,只用于公司专有项目,无法用于其他项目",
5
5
  "main": "dist/index.es.js",
6
6
  "files": [