@impui/imp 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,2 +1 @@
1
- import{urltool as e,date as t,getAndWaitCache as n,loadjs as r,extend as o,type as i,getLog as s,message as a,isBoolean as c,cache as l}from"@impui/com";import*as u from"@impui/com/layer";import{event as d}from"@impui/com/event";import{urltool as f}from"@impui/com/url";import{getLog as h}from"@impui/com/log";import{cache as m}from"@impui/com/cache";import{extend as g}from"@impui/com/core";import{iframeReq as p,get as y}from"@impui/com/req";const w=e.getDomainJson(),b={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com"};let _=null;const O={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},v=t.getTimestamp(),E={config:v,bubble:v,dress:v,gift:v,template:v},S=()=>{if(_)return _;_=b,"undefined"!=typeof __impconfig__&&(_=o(!0,{},b,__impconfig__));for(const e in O)_[e]=_.allsr+O[e];return _},R=()=>o(!0,{},E,window.codever),L=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await n("config_allconfig",async()=>(await r(S().allconfig),window.allconfig))).domainsitetype},x=async()=>{const e=(await L())[w.main];return e||{}},P=async()=>{if(window.config||window.sconfig)return window.config||window.sconfig;return await n("config_simplify",async()=>{const e=await k("config_simplify");return await r(e),window.sconfig})},T=async()=>{if(window.config&&window.config.noble2&&window.config.Appmodules)return window.config;return await n("config_full",async()=>{const e=await k("config");return await r(e),window.config})},k=async e=>{const t=await x(),n=S();var r=t.res||"sr",o=t.resHost||w.mainhost,i=w.protocol+"//"+r+"."+o;"localhost"==w.main&&n.debugDomain?i="https://sr."+n.debugDomain:"localhost"==w.main&&n.localhostSr&&(i=n.localhostSr);return`${i}/live/webSkins_site/${t.sitetype}/config/${e}.js`},U=async()=>{if(window.apiurl)return window.apiurl;return await n("config_apiurl",async()=>(window.apiurl=await r(S().apiurl,{extend:o,config:await T()}),window.apiurl))};(()=>{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 o=n.lastIndexOf("\n");return-1!=o&&(console.log(n.substr(0,o)),n=n.substr(o+1)),t.length},write(e,n,r,o,i,s){if(0!==r||o!==n.length||null!==i)return void s(t());s(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,o){o(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,o){o(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,o){o(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,o){o(t())},read(e,n,r,o,i,s){s(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,o){o(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 o=new DataView(new ArrayBuffer(8));var i=[];const s={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{o.setBigInt64(0,e,!0);const t=o.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:(o.setFloat64(0,e,!0),o.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),d=(e,t,n)=>{const r=new Array(t);for(let o=0;o<t;o++)r[o]=a(e+8*o);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),h=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,o,s){let a=0;if(1==t)for(let c=0;c<o;c++){let t=n+8*c,o=e().getUint32(t+0,!0),s=e().getUint32(t+4,!0);a+=s;for(let n=0;n<s;n++){let t=e().getUint8(o+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(i));i=[],console.log(e)}else i.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(s,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(),s},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(h+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==s)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 o=f(n,r),i=t(e),s=Reflect.get(i,o);return c(s)},"syscall/js.valueSet":(e,n,r,o)=>{const i=t(e),s=f(n,r),a=t(o);Reflect.set(i,s,a)},"syscall/js.valueDelete":(e,n,r)=>{const o=t(e),i=f(n,r);Reflect.deleteProperty(o,i)},"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,o,i,s,a,c)=>{const u=t(r),h=f(o,i),m=d(s,a);try{const t=Reflect.get(u,h);l(n,Reflect.apply(t,u,m)),e().setUint8(n+8,1)}catch(g){l(n,g),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,o,i,s)=>{try{const s=t(r),a=d(o,i);l(n,Reflect.apply(s,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,o,i,s)=>{const a=t(r),c=d(o,i);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,o)=>{const i=String(t(o)),s=n.encode(i);l(r,s),e().setInt32(r+8,s.length,!0)},"syscall/js.valueLoadString":(e,n,r,o)=>{const i=t(e);u(n,r).set(i)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,o,i,s)=>{let a=n,c=n+4;const l=u(r,o),d=t(s);if(!(d instanceof Uint8Array||d instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,o,i,s)=>{let a=n,c=n+4;const l=t(r),d=u(o,i);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.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!==s)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!==s)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 A=Go,C={},j=(await T()).allsr+"/plug/gotool/lib/imptool.wasm",N=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 U(),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 B=new class{constructor(e){this.isbase=e===j,this.url=e}async#e(){if(!this.url){const e=await T();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 r=new A;debug2("=== WASM加载调试开始 ==="),debug2("URL:",e),debug2("UserAgent:",navigator.userAgent);const o=await fetch(e+t);debug2("✅ 响应状态:",o.status);const i=await o.arrayBuffer();debug2("✅ ArrayBuffer大小:",i.byteLength,"bytes");const s=new Uint8Array(i.slice(0,4));debug2("🔍 WASM文件头:",Array.from(s)),debug2("🔍 Go importObject结构:",Object.keys(r.importObject)),r.importObject.go&&debug2("🔍 GoJS导入键:",Object.keys(r.importObject.go)),debug2("🚀 开始WebAssembly.instantiate...");const a=await WebAssembly.instantiate(i,r.importObject);if(debug2("✅ WebAssembly实例化成功"),debug2("🚀 开始go.run..."),r.run(a.instance),debug2("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,debug2("✅ goCrypto加载成功"),e}if(n)return await N();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(r){throw console.error("💥 完整错误堆栈:",r),console.error("错误名称:",r.name),console.error("错误信息:",r.message),r}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&C[t])return C[t];const n=R(),r=n.config?"?d="+n.config:"",o=await this.#t(t,r),i={};if(o)for(let s in o)i[s]=o[s];return C[t]=i,i}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(j);function I(e,t){return function(){return e.apply(t,arguments)}}const{toString:D}=Object.prototype,{getPrototypeOf:F}=Object,{iterator:M,toStringTag:q}=Symbol,W=/* @__PURE__ */(e=>t=>{const n=D.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),z=e=>(e=e.toLowerCase(),t=>W(t)===e),G=e=>t=>typeof t===e,{isArray:K}=Array,H=G("undefined");function J(e){return null!==e&&!H(e)&&null!==e.constructor&&!H(e.constructor)&&X(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $=z("ArrayBuffer");const V=G("string"),X=G("function"),Z=G("number"),Q=e=>null!==e&&"object"==typeof e,Y=e=>{if("object"!==W(e))return!1;const t=F(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||q in e||M in e)},ee=z("Date"),te=z("File"),ne=z("Blob"),re=z("FileList"),oe=z("URLSearchParams"),[ie,se,ae,ce]=["ReadableStream","Request","Response","Headers"].map(z);function le(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),K(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(J(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function ue(e,t){if(J(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fe=e=>!H(e)&&e!==de;const he=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&F(Uint8Array)),me=z("HTMLFormElement"),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pe=z("RegExp"),ye=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};le(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const we=z("AsyncFunction"),be=(_e="function"==typeof setImmediate,Oe=X(de.postMessage),_e?setImmediate:Oe?(ve=`axios@${Math.random()}`,Ee=[],de.addEventListener("message",({source:e,data:t})=>{e===de&&t===ve&&Ee.length&&Ee.shift()()},!1),e=>{Ee.push(e),de.postMessage(ve,"*")}):e=>setTimeout(e));var _e,Oe,ve,Ee;const Se="undefined"!=typeof queueMicrotask?queueMicrotask.bind(de):"undefined"!=typeof process&&process.nextTick||be,Re={isArray:K,isArrayBuffer:$,isBuffer:J,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||X(e.append)&&("formdata"===(t=W(e))||"object"===t&&X(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$(e.buffer),t},isString:V,isNumber:Z,isBoolean:e=>!0===e||!1===e,isObject:Q,isPlainObject:Y,isEmptyObject:e=>{if(!Q(e)||J(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:ie,isRequest:se,isResponse:ae,isHeaders:ce,isUndefined:H,isDate:ee,isFile:te,isBlob:ne,isRegExp:pe,isFunction:X,isStream:e=>Q(e)&&X(e.pipe),isURLSearchParams:oe,isTypedArray:he,isFileList:re,forEach:le,merge:function e(){const{caseless:t,skipUndefined:n}=fe(this)&&this||{},r={},o=(o,i)=>{const s=t&&ue(r,i)||i;Y(r[s])&&Y(o)?r[s]=e(r[s],o):Y(o)?r[s]=e({},o):K(o)?r[s]=o.slice():n&&H(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&le(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(le(t,(t,r)=>{n&&X(t)?e[r]=I(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 o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&F(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:W,kindOfTest:z,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(K(e))return e;let t=e.length;if(!Z(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[M]).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:me,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:ye,freezeMethods:e=>{ye(e,(t,n)=>{if(X(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];X(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 K(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:ue,global:de,isContextDefined:fe,isSpecCompliantForm:function(e){return!!(e&&X(e.append)&&"FormData"===e[q]&&e[M])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Q(e)){if(t.indexOf(e)>=0)return;if(J(e))return e;if(!("toJSON"in e)){t[r]=e;const o=K(e)?[]:{};return le(e,(e,t)=>{const i=n(e,r+1);!H(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:we,isThenable:e=>e&&(Q(e)||X(e))&&X(e.then)&&X(e.catch),setImmediate:be,asap:Se,isIterable:e=>null!=e&&X(e[M])};function Le(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}Re.inherits(Le,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:Re.toJSONObject(this.config),code:this.code,status:this.status}}});const xe=Le.prototype,Pe={};["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=>{Pe[e]={value:e}}),Object.defineProperties(Le,Pe),Object.defineProperty(xe,"isAxiosError",{value:!0}),Le.from=(e,t,n,r,o,i)=>{const s=Object.create(xe);Re.toFlatObject(e,s,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 Le.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Te(e){return Re.isPlainObject(e)||Re.isArray(e)}function ke(e){return Re.endsWith(e,"[]")?e.slice(0,-2):e}function Ue(e,t,n){return e?e.concat(t).map(function(e,t){return e=ke(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ae=Re.toFlatObject(Re,{},null,function(e){return/^is[A-Z]/.test(e)});function Ce(e,t,n){if(!Re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Re.isUndefined(t[e])})).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Re.isSpecCompliantForm(t);if(!Re.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Re.isDate(e))return e.toISOString();if(Re.isBoolean(e))return e.toString();if(!a&&Re.isBlob(e))throw new Le("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(e)||Re.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Re.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Re.isArray(e)&&function(e){return Re.isArray(e)&&!e.some(Te)}(e)||(Re.isFileList(e)||Re.endsWith(n,"[]"))&&(a=Re.toArray(e)))return n=ke(n),a.forEach(function(e,r){!Re.isUndefined(e)&&null!==e&&t.append(!0===s?Ue([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!Te(e)||(t.append(Ue(o,n,i),c(e)),!1)}const u=[],d=Object.assign(Ae,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!Re.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Re.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Re.forEach(n,function(n,i){!0===(!(Re.isUndefined(n)||null===n)&&o.call(t,n,Re.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ne(e,t){this._pairs=[],e&&Ce(e,this,t)}const Be=Ne.prototype;function Ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function De(e,t,n){if(!t)return e;const r=n&&n.encode||Ie;Re.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Re.isURLSearchParams(t)?t.toString():new Ne(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Be.append=function(e,t){this._pairs.push([e,t])},Be.toString=function(e){const t=e?function(t){return e.call(this,t,je)}:je;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Fe{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){Re.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},We="undefined"!=typeof window&&"undefined"!=typeof document,ze="object"==typeof navigator&&navigator||void 0,Ge=We&&(!ze||["ReactNative","NativeScript","NS"].indexOf(ze.product)<0),Ke="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,He=We&&window.location.href||"http://localhost",Je={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:Ge,hasStandardBrowserWebWorkerEnv:Ke,navigator:ze,origin:He},Symbol.toStringTag,{value:"Module"})),...qe};function $e(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&Re.isArray(r)?r.length:i,a)return Re.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Re.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Re.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(Re.isFormData(e)&&Re.isFunction(e.entries)){const n={};return Re.forEachEntry(e,(e,r)=>{t(function(e){return Re.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Ve={transitional:Me,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Re.isObject(e);o&&Re.isHTMLForm(e)&&(e=new FormData(e));if(Re.isFormData(e))return r?JSON.stringify($e(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e)||Re.isReadableStream(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ce(e,new Je.classes.URLSearchParams,{visitor:function(e,t,n,r){return Je.isNode&&Re.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Re.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ce(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Re.isString(e))try{return(t||JSON.parse)(e),Re.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ve.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Re.isResponse(e)||Re.isReadableStream(e))return e;if(e&&Re.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw Le.from(o,Le.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Re.forEach(["delete","get","head","post","put","patch"],e=>{Ve.headers[e]={}});const Xe=Re.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"]),Ze=Symbol("internals");function Qe(e){return e&&String(e).trim().toLowerCase()}function Ye(e){return!1===e||null==e?e:Re.isArray(e)?e.map(Ye):String(e)}function et(e,t,n,r,o){return Re.isFunction(r)?r.call(this,t,n):(o&&(t=n),Re.isString(t)?Re.isString(r)?-1!==t.indexOf(r):Re.isRegExp(r)?r.test(t):void 0:void 0)}let tt=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Qe(t);if(!o)throw new Error("header name must be a non-empty string");const i=Re.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ye(e))}const i=(e,t)=>Re.forEach(e,(e,n)=>o(e,n,t));if(Re.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Re.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Xe[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(Re.isObject(e)&&Re.isIterable(e)){let n,r,o={};for(const t of e){if(!Re.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Re.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Qe(e)){const n=Re.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(Re.isFunction(t))return t.call(this,e,n);if(Re.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qe(e)){const n=Re.findKey(this,e);return!(!n||void 0===this[n]||t&&!et(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Qe(e)){const o=Re.findKey(n,e);!o||t&&!et(0,n[o],o,t)||(delete n[o],r=!0)}}return Re.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!et(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Re.forEach(this,(r,o)=>{const i=Re.findKey(n,o);if(i)return t[i]=Ye(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ye(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Re.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Re.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[Ze]=this[Ze]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Qe(e);t[r]||(!function(e,t){const n=Re.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Re.isArray(e)?e.forEach(r):r(e),this}};function nt(e,t){const n=this||Ve,r=t||n,o=tt.from(r.headers);let i=r.data;return Re.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function rt(e){return!(!e||!e.__CANCEL__)}function ot(e,t,n){Le.call(this,null==e?"canceled":e,Le.ERR_CANCELED,t,n),this.name="CanceledError"}function it(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Le("Request failed with status code "+n.status,[Le.ERR_BAD_REQUEST,Le.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(tt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Re.freezeMethods(tt),Re.inherits(ot,Le,{__CANCEL__:!0});const st=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];o||(o=c),n[i]=a,r[i]=c;let u=s,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},at=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ct=e=>(...t)=>Re.asap(()=>e(...t)),lt=Je.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,ut=Je.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Re.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Re.isString(r)&&a.push(`path=${r}`),Re.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),Re.isString(s)&&a.push(`SameSite=${s}`),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 dt(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 ft=e=>e instanceof tt?{...e}:e;function ht(e,t){t=t||{};const n={};function r(e,t,n,r){return Re.isPlainObject(e)&&Re.isPlainObject(t)?Re.merge.call({caseless:r},e,t):Re.isPlainObject(t)?Re.merge({},t):Re.isArray(t)?t.slice():t}function o(e,t,n,o){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Re.isUndefined(t))return r(void 0,t)}function s(e,t){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(ft(e),ft(t),0,!0)};return Re.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);Re.isUndefined(s)&&i!==a||(n[r]=s)}),n}const mt=e=>{const t=ht({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=tt.from(s),t.url=De(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Re.isFormData(n))if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Re.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(Je.hasStandardBrowserEnv&&(r&&Re.isFunction(r)&&(r=r(t)),r||!1!==r&&lt(t.url))){const e=o&&i&&ut.read(i);e&&s.set(o,e)}return t},gt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=mt(e);let o=r.data;const i=tt.from(r.headers).normalize();let s,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function m(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function p(){if(!g)return;const r=tt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());it(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=p:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(p)},g.onabort=function(){g&&(n(new Le("Request aborted",Le.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Le(t&&t.message?t.message:"Network Error",Le.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Me;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Le(t,o.clarifyTimeoutError?Le.ETIMEDOUT:Le.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Re.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Re.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=st(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=st(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new ot(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Je.protocols.indexOf(y)?n(new Le("Unsupported protocol "+y+":",Le.ERR_BAD_REQUEST,e)):g.send(o||null)})},pt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Le?t:new ot(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Le(`timeout ${t} of ms exceeded`,Le.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>Re.asap(s),a}},yt=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},wt=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()}},bt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of wt(e))yield*yt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:_t}=Re,Ot=(({Request:e,Response:t})=>({Request:e,Response:t}))(Re.global),{ReadableStream:vt,TextEncoder:Et}=Re.global,St=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Rt=e=>{e=Re.merge.call({skipUndefined:!0},Ot,e);const{fetch:t,Request:n,Response:r}=e,o=t?_t(t):"function"==typeof fetch,i=_t(n),s=_t(r);if(!o)return!1;const a=o&&_t(vt),c=o&&("function"==typeof Et?/* @__PURE__ */(e=>t=>e.encode(t))(new Et):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=i&&a&&St(()=>{let e=!1;const t=new n(Je.origin,{body:new vt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=s&&a&&St(()=>Re.isReadableStream(new r("").body)),d={stream:u&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Le(`Response type '${e}' is not supported`,Le.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Re.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Re.isBlob(e))return e.size;if(Re.isSpecCompliantForm(e)){const t=new n(Je.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Re.isArrayBufferView(e)||Re.isArrayBuffer(e)?e.byteLength:(Re.isURLSearchParams(e)&&(e+=""),Re.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:h,timeout:m,onDownloadProgress:g,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=mt(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let v=pt([c,h&&h.toAbortSignal()],m),E=null;const S=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let R;try{if(p&&l&&"get"!==s&&"head"!==s&&0!==(R=await f(w,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(Re.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=at(R,st(ct(p)));a=bt(t.body,65536,e,n)}}Re.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={..._,signal:v,method:s.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=i&&new n(o,c);let h=await(i?O(E,_):O(o,c));const m=u&&("stream"===y||"response"===y);if(u&&(g||m&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Re.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&at(t,st(ct(g),!0))||[];h=new r(bt(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Re.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{it(t,n,{data:L,headers:tt.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:E})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Le("Network Error",Le.ERR_NETWORK,e,E),{cause:L.cause||L});throw Le.from(L,L&&L.code,e,E)}}},Lt=/* @__PURE__ */new Map,xt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,l=Lt;for(;c--;)s=i[c],a=l.get(s),void 0===a&&l.set(s,a=c?/* @__PURE__ */new Map:Rt(t)),l=a;return a};xt();const Pt={http:null,xhr:gt,fetch:{get:xt}};Re.forEach(Pt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Tt=e=>`- ${e}`,kt=e=>Re.isFunction(e)||null===e||!1===e;const Ut={getAdapter:function(e,t){e=Re.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!kt(r)&&(o=Pt[(n=String(r)).toLowerCase()],void 0===o))throw new Le(`Unknown adapter '${n}'`);if(o&&(Re.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Le("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Tt).join("\n"):" "+Tt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:Pt};function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ot(null,e)}function Ct(e){At(e),e.headers=tt.from(e.headers),e.data=nt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ut.getAdapter(e.adapter||Ve.adapter,e)(e).then(function(t){return At(e),t.data=nt.call(e,e.transformResponse,t),t.headers=tt.from(t.headers),t},function(t){return rt(t)||(At(e),t&&t.response&&(t.response.data=nt.call(e,e.transformResponse,t.response),t.response.headers=tt.from(t.response.headers))),Promise.reject(t)})}const jt="1.13.2",Nt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Nt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Bt={};Nt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+jt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Le(r(o," has been removed"+(t?" in "+t:"")),Le.ERR_DEPRECATED);return t&&!Bt[o]&&(Bt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Nt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const It={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Le("options must be an object",Le.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new Le("option "+i+" must be "+n,Le.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Le("Unknown option "+i,Le.ERR_BAD_OPTION)}},validators:Nt},Dt=It.validators;let Ft=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}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=ht(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&It.assertOptions(n,{silentJSONParsing:Dt.transitional(Dt.boolean),forcedJSONParsing:Dt.transitional(Dt.boolean),clarifyTimeoutError:Dt.transitional(Dt.boolean)},!1),null!=r&&(Re.isFunction(r)?t.paramsSerializer={serialize:r}:It.assertOptions(r,{encode:Dt.function,serialize:Dt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),It.assertOptions(t,{baseUrl:Dt.spelling("baseURL"),withXsrfToken:Dt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Re.merge(o.common,o[t.method]);o&&Re.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=tt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Ct.bind(this),void 0];for(e.unshift(...s),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=s.length;let f=t;for(;d<u;){const e=s[d++],t=s[d++];try{f=e(f)}catch(h){t.call(this,h);break}}try{l=Ct.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return De(dt((e=ht(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Re.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(t,n){return this.request(ht(n||{},{method:e,url:t,data:(n||{}).data}))}}),Re.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ht(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ft.prototype[e]=t(),Ft.prototype[e+"Form"]=t(!0)});const Mt={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(Mt).forEach(([e,t])=>{Mt[t]=e});const qt=function e(t){const n=new Ft(t),r=I(Ft.prototype.request,n);return Re.extend(r,Ft.prototype,n,{allOwnKeys:!0}),Re.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ht(t,n))},r}(Ve);qt.Axios=Ft,qt.CanceledError=ot,qt.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,o){n.reason||(n.reason=new ot(e,r,o),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}}},qt.isCancel=rt,qt.VERSION=jt,qt.toFormData=Ce,qt.AxiosError=Le,qt.Cancel=qt.CanceledError,qt.all=function(e){return Promise.all(e)},qt.spread=function(e){return function(t){return e.apply(null,t)}},qt.isAxiosError=function(e){return Re.isObject(e)&&!0===e.isAxiosError},qt.mergeConfig=ht,qt.AxiosHeaders=tt,qt.formToJSON=e=>$e(Re.isHTMLForm(e)?new FormData(e):e),qt.getAdapter=Ut.getAdapter,qt.HttpStatusCode=Mt,qt.default=qt;const{Axios:Wt,AxiosError:zt,CanceledError:Gt,isCancel:Kt,CancelToken:Ht,VERSION:Jt,all:$t,Cancel:Vt,isAxiosError:Xt,spread:Zt,toFormData:Qt,AxiosHeaders:Yt,HttpStatusCode:en,formToJSON:tn,getAdapter:nn,mergeConfig:rn}=qt,on=f.getPar,sn=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(on("Device")||-1)};t&&(r._tui_source=((n=on("_tui_source")||on("from")||on("source"))||(n=m.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=g(!0,r,o,e)},an=function(e,t,n){return n=sn(n,t),e=f.addPars(n,e)},cn=await h(),ln="imp_sign",un="imp_useridx";f.getPar("useridx");var dn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};qt.codeEnum=dn,qt.defaults.baseURL="",qt.defaults.withCredentials=!0,qt.defaults.crossDomain=!0,qt.defaults.dataType="json",qt.saveLogin=function(e,t){cn.debug("写入sign:",t),m.set(ln,t),e&&m.set(un,e)},qt.interceptors.request.use(async function(e){cn.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",f.getPar("_tui_source")||f.getPar("from")||f.getPar("source")),an(e.url),"post"===e.method&&(e.data=f.jsonto(e.data).substring(1));const t=await d.runM("login","getLogin",[null,!0]);return t&&(e.headers[ln]=t.sign,e.headers[un]=m.get(un)),e},function(e){return Promise.reject(e)}),qt.interceptors.response.use(async function(e){if(i.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([B.init(),T()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}switch(cn.debug("响应拦截",e),e.data.__source=e,(e=e.data).codeEnum=dn,e.isSuccess=function(t){return e.code!==dn.success&&(t||u.msg(e.msg)),e.code===dn.success},e.code){case dn.success:return Promise.resolve(e);case dn.jumpTo:return void(location.href=e.data);case dn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case dn.alert:case dn.msg:return u.msg(e.msg),Promise.reject(e);case dn.noRealName:return impall.showReal_name();case dn.ServerSignError:case dn.nologin:if(e.__source.config.isTwice)return d.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return cn.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=f.toData(e.__source.config.data),qt(e.__source.config)};return await d.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var fn=qt.get;qt.get=function(e,t,n){return(n=n||{}).params=t,fn(e,n)};const hn=await T(),mn=await s();class gn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname?"https://localhost:44360":hn.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:an(this.loginDomain+"/index.html",!0),reg:an(this.loginDomain+"/index.html?type=reg",!0),loginPage:an(this.loginDomain+"/loginPage.html",!0),regPage:an(this.loginDomain+"/regPage.html",!0),autoLogin:an(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:an(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:an(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:an(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(){a.on(this.keys.msg_close,()=>{mn.debug("关闭登录框"),this.close()}),a.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),a.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),a.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),a.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()})}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&&(mn.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(c(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===qt.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(mn.debug("登录消息返回",t),t.isok=t.code===qt.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]),l.set(this.keys.cache_loginSave,t,this.loginTime),qt.saveLogin(t.useridx,t.sign);try{await qt.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;a.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){l.remove(this.keys.cache_loginSave),l.remove(this.keys.cache_userInfo),l.remove(this.keys.cache_userInfo+"_more"),l.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=o(!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(o){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){a.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"}}):a.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"}}):a.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 o=an(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(o)})}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||l.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 o=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=l.get(o);if(t)return void e(t)}qt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(l.set(o,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(mn.debug("checkZ:",this.autoLogin),!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),o=parseInt(e.getPar(this.keys.loginStatus)||-1);mn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?qt.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()}):qt.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 mn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{p.get(this.urls.exitLogin).then(t=>{y(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 o,i=!1;const s=()=>{r.removeEventListener("error",a),clearTimeout(o)},a=e=>{i||(i=!0,s(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",()=>{i||(i=!0,s(),console.log("缓存数据已保存"))},{once:!0}),r.addEventListener("error",a,{once:!0}),o=setTimeout(()=>{a()},1e3),document.body.append(r),r}onNoLogin(e){d?d.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return d?Promise.resolve(d.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 pn=new gn;export{gn as Login,qt as axios,L as getAllConfig,U as getApiurl,R as getCodeVer,T as getConfig,x as getDomainConfig,S as getEvnConfig,P as getSimplifyConfig,B as gotool,an as handleUrl,pn as login};
2
- //# sourceMappingURL=index.es.js.map
1
+ import{urltool as e,date as t,getAndWaitCache as n,loadjs as r,extend as o,type as i,getLog as s,message as a,isBoolean as c,cache as l}from"@impui/com";import*as u from"@impui/com/layer";import{event as d}from"@impui/com/event";import{urltool as f}from"@impui/com/url";import{getLog as h}from"@impui/com/log";import{cache as m}from"@impui/com/cache";import{extend as g}from"@impui/com/core";import{iframeReq as p,get as y}from"@impui/com/req";const w=e.getDomainJson(),b={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com"};let _=null;const O={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},v=t.getTimestamp(),E={config:v,bubble:v,dress:v,gift:v,template:v},S=()=>{if(_)return _;_=b,"undefined"!=typeof __impconfig__&&(_=o(!0,{},b,__impconfig__));for(const e in O)_[e]=_.allsr+O[e];return _},R=()=>o(!0,{},E,window.codever),L=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await n("config_allconfig",async()=>(await r(S().allconfig),window.allconfig))).domainsitetype},x=async()=>{const e=(await L())["localhost"===w.main?S().debugDomain:w.main];return e||{}},P=async()=>{if(window.config||window.sconfig)return window.config||window.sconfig;return await n("config_simplify",async()=>{const e=await k("config_simplify");return await r(e),window.sconfig})},T=async()=>{if(window.config&&window.config.noble2&&window.config.Appmodules)return window.config;return await n("config_full",async()=>{const e=await k("config");return await r(e),window.config})},k=async e=>{const t=await x(),n=S();var r=t.res||"sr",o=t.resHost||w.mainhost,i=w.protocol+"//"+r+"."+o;"localhost"==w.main&&n.debugDomain?i="https://sr."+n.debugDomain:"localhost"==w.main&&n.localhostSr&&(i=n.localhostSr);return`${i}/live/webSkins_site/${t.sitetype}/config/${e}.js`},U=async()=>{if(window.apiurl)return window.apiurl;return await n("config_apiurl",async()=>(window.apiurl=await r(S().apiurl,{extend:o,config:await T()}),window.apiurl))};(()=>{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 o=n.lastIndexOf("\n");return-1!=o&&(console.log(n.substr(0,o)),n=n.substr(o+1)),t.length},write(e,n,r,o,i,s){if(0!==r||o!==n.length||null!==i)return void s(t());s(null,this.writeSync(e,n))},chmod(e,n,r){r(t())},chown(e,n,r,o){o(t())},close(e,n){n(t())},fchmod(e,n,r){r(t())},fchown(e,n,r,o){o(t())},fstat(e,n){n(t())},fsync(e,t){t(null)},ftruncate(e,n,r){r(t())},lchown(e,n,r,o){o(t())},link(e,n,r){r(t())},lstat(e,n){n(t())},mkdir(e,n,r){r(t())},open(e,n,r,o){o(t())},read(e,n,r,o,i,s){s(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,o){o(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 o=new DataView(new ArrayBuffer(8));var i=[];const s={};e.Go=class{constructor(){this._callbackTimeouts=/* @__PURE__ */new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),t=e=>{o.setBigInt64(0,e,!0);const t=o.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:(o.setFloat64(0,e,!0),o.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),d=(e,t,n)=>{const r=new Array(t);for(let o=0;o<t;o++)r[o]=a(e+8*o);return r},f=(e,t)=>r.decode(new DataView(this._inst.exports.memory.buffer,e,t)),h=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,n,o,s){let a=0;if(1==t)for(let c=0;c<o;c++){let t=n+8*c,o=e().getUint32(t+0,!0),s=e().getUint32(t+4,!0);a+=s;for(let n=0;n<s;n++){let t=e().getUint8(o+n);if(13==t);else if(10==t){let e=r.decode(new Uint8Array(i));i=[],console.log(e)}else i.push(t)}}else console.error("invalid file descriptor:",t);return e().setUint32(s,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(),s},random_get:(e,t)=>(crypto.getRandomValues(u(e,t)),0)},gojs:{"runtime.ticks":()=>BigInt(1e6*(h+performance.now())),"runtime.sleepTicks":e=>{setTimeout(()=>{if(!this.exited)try{this._inst.exports.go_scheduler()}catch(e){if(e!==s)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 o=f(n,r),i=t(e),s=Reflect.get(i,o);return c(s)},"syscall/js.valueSet":(e,n,r,o)=>{const i=t(e),s=f(n,r),a=t(o);Reflect.set(i,s,a)},"syscall/js.valueDelete":(e,n,r)=>{const o=t(e),i=f(n,r);Reflect.deleteProperty(o,i)},"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,o,i,s,a,c)=>{const u=t(r),h=f(o,i),m=d(s,a);try{const t=Reflect.get(u,h);l(n,Reflect.apply(t,u,m)),e().setUint8(n+8,1)}catch(g){l(n,g),e().setUint8(n+8,0)}},"syscall/js.valueInvoke":(n,r,o,i,s)=>{try{const s=t(r),a=d(o,i);l(n,Reflect.apply(s,void 0,a)),e().setUint8(n+8,1)}catch(a){l(n,a),e().setUint8(n+8,0)}},"syscall/js.valueNew":(n,r,o,i,s)=>{const a=t(r),c=d(o,i);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,o)=>{const i=String(t(o)),s=n.encode(i);l(r,s),e().setInt32(r+8,s.length,!0)},"syscall/js.valueLoadString":(e,n,r,o)=>{const i=t(e);u(n,r).set(i)},"syscall/js.valueInstanceOf":(e,n)=>t(e)instanceof t(n),"syscall/js.copyBytesToGo":(n,r,o,i,s)=>{let a=n,c=n+4;const l=u(r,o),d=t(s);if(!(d instanceof Uint8Array||d instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.subarray(0,l.length);l.set(f),e().setUint32(a,f.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(n,r,o,i,s)=>{let a=n,c=n+4;const l=t(r),d=u(o,i);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray))return void e().setUint8(c,0);const f=d.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!==s)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!==s)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 A=Go,C={},j=(await T()).allsr+"/plug/gotool/lib/imptool.wasm",N=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 U(),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 B=new class{constructor(e){this.isbase=e===j,this.url=e}async#e(){if(!this.url){const e=await T();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 r=new A;debug2("=== WASM加载调试开始 ==="),debug2("URL:",e),debug2("UserAgent:",navigator.userAgent);const o=await fetch(e+t);debug2("✅ 响应状态:",o.status);const i=await o.arrayBuffer();debug2("✅ ArrayBuffer大小:",i.byteLength,"bytes");const s=new Uint8Array(i.slice(0,4));debug2("🔍 WASM文件头:",Array.from(s)),debug2("🔍 Go importObject结构:",Object.keys(r.importObject)),r.importObject.go&&debug2("🔍 GoJS导入键:",Object.keys(r.importObject.go)),debug2("🚀 开始WebAssembly.instantiate...");const a=await WebAssembly.instantiate(i,r.importObject);if(debug2("✅ WebAssembly实例化成功"),debug2("🚀 开始go.run..."),r.run(a.instance),debug2("✅ go.run执行完成"),window.goCrypto){const e=window.goCrypto;return delete window.goCrypto,debug2("✅ goCrypto加载成功"),e}if(n)return await N();throw console.warn("❌ window.goCrypto未定义,进入诊断模式"),await loadGoWasmWithDiagnosis(e),new Error("❌ window.goCrypto未定义")}catch(r){throw console.error("💥 完整错误堆栈:",r),console.error("错误名称:",r.name),console.error("错误信息:",r.message),r}}(e=e||await this.#e(),t,this.isbase)}async getRunTimes(e=!1){const t=await this.#e();if(!e&&C[t])return C[t];const n=R(),r=n.config?"?d="+n.config:"",o=await this.#t(t,r),i={};if(o)for(let s in o)i[s]=o[s];return C[t]=i,i}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(j);function I(e,t){return function(){return e.apply(t,arguments)}}const{toString:D}=Object.prototype,{getPrototypeOf:F}=Object,{iterator:M,toStringTag:q}=Symbol,W=/* @__PURE__ */(e=>t=>{const n=D.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),z=e=>(e=e.toLowerCase(),t=>W(t)===e),G=e=>t=>typeof t===e,{isArray:K}=Array,H=G("undefined");function J(e){return null!==e&&!H(e)&&null!==e.constructor&&!H(e.constructor)&&X(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $=z("ArrayBuffer");const V=G("string"),X=G("function"),Z=G("number"),Q=e=>null!==e&&"object"==typeof e,Y=e=>{if("object"!==W(e))return!1;const t=F(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||q in e||M in e)},ee=z("Date"),te=z("File"),ne=z("Blob"),re=z("FileList"),oe=z("URLSearchParams"),[ie,se,ae,ce]=["ReadableStream","Request","Response","Headers"].map(z);function le(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),K(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(J(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function ue(e,t){if(J(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fe=e=>!H(e)&&e!==de;const he=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&F(Uint8Array)),me=z("HTMLFormElement"),ge=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),pe=z("RegExp"),ye=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};le(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const we=z("AsyncFunction"),be=(_e="function"==typeof setImmediate,Oe=X(de.postMessage),_e?setImmediate:Oe?(ve=`axios@${Math.random()}`,Ee=[],de.addEventListener("message",({source:e,data:t})=>{e===de&&t===ve&&Ee.length&&Ee.shift()()},!1),e=>{Ee.push(e),de.postMessage(ve,"*")}):e=>setTimeout(e));var _e,Oe,ve,Ee;const Se="undefined"!=typeof queueMicrotask?queueMicrotask.bind(de):"undefined"!=typeof process&&process.nextTick||be,Re={isArray:K,isArrayBuffer:$,isBuffer:J,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||X(e.append)&&("formdata"===(t=W(e))||"object"===t&&X(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$(e.buffer),t},isString:V,isNumber:Z,isBoolean:e=>!0===e||!1===e,isObject:Q,isPlainObject:Y,isEmptyObject:e=>{if(!Q(e)||J(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:ie,isRequest:se,isResponse:ae,isHeaders:ce,isUndefined:H,isDate:ee,isFile:te,isBlob:ne,isRegExp:pe,isFunction:X,isStream:e=>Q(e)&&X(e.pipe),isURLSearchParams:oe,isTypedArray:he,isFileList:re,forEach:le,merge:function e(){const{caseless:t,skipUndefined:n}=fe(this)&&this||{},r={},o=(o,i)=>{const s=t&&ue(r,i)||i;Y(r[s])&&Y(o)?r[s]=e(r[s],o):Y(o)?r[s]=e({},o):K(o)?r[s]=o.slice():n&&H(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&le(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(le(t,(t,r)=>{n&&X(t)?e[r]=I(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 o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&F(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:W,kindOfTest:z,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(K(e))return e;let t=e.length;if(!Z(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[M]).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:me,hasOwnProperty:ge,hasOwnProp:ge,reduceDescriptors:ye,freezeMethods:e=>{ye(e,(t,n)=>{if(X(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];X(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 K(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:ue,global:de,isContextDefined:fe,isSpecCompliantForm:function(e){return!!(e&&X(e.append)&&"FormData"===e[q]&&e[M])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Q(e)){if(t.indexOf(e)>=0)return;if(J(e))return e;if(!("toJSON"in e)){t[r]=e;const o=K(e)?[]:{};return le(e,(e,t)=>{const i=n(e,r+1);!H(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:we,isThenable:e=>e&&(Q(e)||X(e))&&X(e.then)&&X(e.catch),setImmediate:be,asap:Se,isIterable:e=>null!=e&&X(e[M])};function Le(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}Re.inherits(Le,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:Re.toJSONObject(this.config),code:this.code,status:this.status}}});const xe=Le.prototype,Pe={};["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=>{Pe[e]={value:e}}),Object.defineProperties(Le,Pe),Object.defineProperty(xe,"isAxiosError",{value:!0}),Le.from=(e,t,n,r,o,i)=>{const s=Object.create(xe);Re.toFlatObject(e,s,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 Le.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Te(e){return Re.isPlainObject(e)||Re.isArray(e)}function ke(e){return Re.endsWith(e,"[]")?e.slice(0,-2):e}function Ue(e,t,n){return e?e.concat(t).map(function(e,t){return e=ke(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ae=Re.toFlatObject(Re,{},null,function(e){return/^is[A-Z]/.test(e)});function Ce(e,t,n){if(!Re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Re.isUndefined(t[e])})).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Re.isSpecCompliantForm(t);if(!Re.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Re.isDate(e))return e.toISOString();if(Re.isBoolean(e))return e.toString();if(!a&&Re.isBlob(e))throw new Le("Blob is not supported. Use a Buffer instead.");return Re.isArrayBuffer(e)||Re.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(Re.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Re.isArray(e)&&function(e){return Re.isArray(e)&&!e.some(Te)}(e)||(Re.isFileList(e)||Re.endsWith(n,"[]"))&&(a=Re.toArray(e)))return n=ke(n),a.forEach(function(e,r){!Re.isUndefined(e)&&null!==e&&t.append(!0===s?Ue([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!Te(e)||(t.append(Ue(o,n,i),c(e)),!1)}const u=[],d=Object.assign(Ae,{defaultVisitor:l,convertValue:c,isVisitable:Te});if(!Re.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Re.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Re.forEach(n,function(n,i){!0===(!(Re.isUndefined(n)||null===n)&&o.call(t,n,Re.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ne(e,t){this._pairs=[],e&&Ce(e,this,t)}const Be=Ne.prototype;function Ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function De(e,t,n){if(!t)return e;const r=n&&n.encode||Ie;Re.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Re.isURLSearchParams(t)?t.toString():new Ne(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Be.append=function(e,t){this._pairs.push([e,t])},Be.toString=function(e){const t=e?function(t){return e.call(this,t,je)}:je;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class Fe{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){Re.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ne,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},We="undefined"!=typeof window&&"undefined"!=typeof document,ze="object"==typeof navigator&&navigator||void 0,Ge=We&&(!ze||["ReactNative","NativeScript","NS"].indexOf(ze.product)<0),Ke="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,He=We&&window.location.href||"http://localhost",Je={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:We,hasStandardBrowserEnv:Ge,hasStandardBrowserWebWorkerEnv:Ke,navigator:ze,origin:He},Symbol.toStringTag,{value:"Module"})),...qe};function $e(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&Re.isArray(r)?r.length:i,a)return Re.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Re.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Re.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(Re.isFormData(e)&&Re.isFunction(e.entries)){const n={};return Re.forEachEntry(e,(e,r)=>{t(function(e){return Re.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Ve={transitional:Me,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Re.isObject(e);o&&Re.isHTMLForm(e)&&(e=new FormData(e));if(Re.isFormData(e))return r?JSON.stringify($e(e)):e;if(Re.isArrayBuffer(e)||Re.isBuffer(e)||Re.isStream(e)||Re.isFile(e)||Re.isBlob(e)||Re.isReadableStream(e))return e;if(Re.isArrayBufferView(e))return e.buffer;if(Re.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ce(e,new Je.classes.URLSearchParams,{visitor:function(e,t,n,r){return Je.isNode&&Re.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Re.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ce(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Re.isString(e))try{return(t||JSON.parse)(e),Re.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ve.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Re.isResponse(e)||Re.isReadableStream(e))return e;if(e&&Re.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n){if("SyntaxError"===o.name)throw Le.from(o,Le.ERR_BAD_RESPONSE,this,null,this.response);throw o}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Re.forEach(["delete","get","head","post","put","patch"],e=>{Ve.headers[e]={}});const Xe=Re.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"]),Ze=Symbol("internals");function Qe(e){return e&&String(e).trim().toLowerCase()}function Ye(e){return!1===e||null==e?e:Re.isArray(e)?e.map(Ye):String(e)}function et(e,t,n,r,o){return Re.isFunction(r)?r.call(this,t,n):(o&&(t=n),Re.isString(t)?Re.isString(r)?-1!==t.indexOf(r):Re.isRegExp(r)?r.test(t):void 0:void 0)}let tt=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Qe(t);if(!o)throw new Error("header name must be a non-empty string");const i=Re.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ye(e))}const i=(e,t)=>Re.forEach(e,(e,n)=>o(e,n,t));if(Re.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Re.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Xe[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(Re.isObject(e)&&Re.isIterable(e)){let n,r,o={};for(const t of e){if(!Re.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Re.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Qe(e)){const n=Re.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(Re.isFunction(t))return t.call(this,e,n);if(Re.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Qe(e)){const n=Re.findKey(this,e);return!(!n||void 0===this[n]||t&&!et(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Qe(e)){const o=Re.findKey(n,e);!o||t&&!et(0,n[o],o,t)||(delete n[o],r=!0)}}return Re.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!et(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Re.forEach(this,(r,o)=>{const i=Re.findKey(n,o);if(i)return t[i]=Ye(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ye(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Re.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Re.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[Ze]=this[Ze]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Qe(e);t[r]||(!function(e,t){const n=Re.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Re.isArray(e)?e.forEach(r):r(e),this}};function nt(e,t){const n=this||Ve,r=t||n,o=tt.from(r.headers);let i=r.data;return Re.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function rt(e){return!(!e||!e.__CANCEL__)}function ot(e,t,n){Le.call(this,null==e?"canceled":e,Le.ERR_CANCELED,t,n),this.name="CanceledError"}function it(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Le("Request failed with status code "+n.status,[Le.ERR_BAD_REQUEST,Le.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Re.reduceDescriptors(tt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Re.freezeMethods(tt),Re.inherits(ot,Le,{__CANCEL__:!0});const st=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];o||(o=c),n[i]=a,r[i]=c;let u=s,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=l&&c-l;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n)]}(n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},at=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ct=e=>(...t)=>Re.asap(()=>e(...t)),lt=Je.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,Je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,ut=Je.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Re.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Re.isString(r)&&a.push(`path=${r}`),Re.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),Re.isString(s)&&a.push(`SameSite=${s}`),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 dt(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 ft=e=>e instanceof tt?{...e}:e;function ht(e,t){t=t||{};const n={};function r(e,t,n,r){return Re.isPlainObject(e)&&Re.isPlainObject(t)?Re.merge.call({caseless:r},e,t):Re.isPlainObject(t)?Re.merge({},t):Re.isArray(t)?t.slice():t}function o(e,t,n,o){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Re.isUndefined(t))return r(void 0,t)}function s(e,t){return Re.isUndefined(t)?Re.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(ft(e),ft(t),0,!0)};return Re.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);Re.isUndefined(s)&&i!==a||(n[r]=s)}),n}const mt=e=>{const t=ht({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=tt.from(s),t.url=De(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Re.isFormData(n))if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Re.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(Je.hasStandardBrowserEnv&&(r&&Re.isFunction(r)&&(r=r(t)),r||!1!==r&&lt(t.url))){const e=o&&i&&ut.read(i);e&&s.set(o,e)}return t},gt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=mt(e);let o=r.data;const i=tt.from(r.headers).normalize();let s,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:h}=r;function m(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let g=new XMLHttpRequest;function p(){if(!g)return;const r=tt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());it(function(e){t(e),m()},function(e){n(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout,"onloadend"in g?g.onloadend=p:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&0===g.responseURL.indexOf("file:"))&&setTimeout(p)},g.onabort=function(){g&&(n(new Le("Request aborted",Le.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Le(t&&t.message?t.message:"Network Error",Le.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Me;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Le(t,o.clarifyTimeoutError?Le.ETIMEDOUT:Le.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Re.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Re.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=st(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=st(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new ot(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===Je.protocols.indexOf(y)?n(new Le("Unsupported protocol "+y+":",Le.ERR_BAD_REQUEST,e)):g.send(o||null)})},pt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Le?t:new ot(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Le(`timeout ${t} of ms exceeded`,Le.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>Re.asap(s),a}},yt=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},wt=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()}},bt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of wt(e))yield*yt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:_t}=Re,Ot=(({Request:e,Response:t})=>({Request:e,Response:t}))(Re.global),{ReadableStream:vt,TextEncoder:Et}=Re.global,St=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},Rt=e=>{e=Re.merge.call({skipUndefined:!0},Ot,e);const{fetch:t,Request:n,Response:r}=e,o=t?_t(t):"function"==typeof fetch,i=_t(n),s=_t(r);if(!o)return!1;const a=o&&_t(vt),c=o&&("function"==typeof Et?/* @__PURE__ */(e=>t=>e.encode(t))(new Et):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=i&&a&&St(()=>{let e=!1;const t=new n(Je.origin,{body:new vt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=s&&a&&St(()=>Re.isReadableStream(new r("").body)),d={stream:u&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Le(`Response type '${e}' is not supported`,Le.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Re.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Re.isBlob(e))return e.size;if(Re.isSpecCompliantForm(e)){const t=new n(Je.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Re.isArrayBufferView(e)||Re.isArrayBuffer(e)?e.byteLength:(Re.isURLSearchParams(e)&&(e+=""),Re.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:h,timeout:m,onDownloadProgress:g,onUploadProgress:p,responseType:y,headers:w,withCredentials:b="same-origin",fetchOptions:_}=mt(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let v=pt([c,h&&h.toAbortSignal()],m),E=null;const S=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let R;try{if(p&&l&&"get"!==s&&"head"!==s&&0!==(R=await f(w,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(Re.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=at(R,st(ct(p)));a=bt(t.body,65536,e,n)}}Re.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={..._,signal:v,method:s.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=i&&new n(o,c);let h=await(i?O(E,_):O(o,c));const m=u&&("stream"===y||"response"===y);if(u&&(g||m&&S)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=Re.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&at(t,st(ct(g),!0))||[];h=new r(bt(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Re.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{it(t,n,{data:L,headers:tt.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:E})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Le("Network Error",Le.ERR_NETWORK,e,E),{cause:L.cause||L});throw Le.from(L,L&&L.code,e,E)}}},Lt=/* @__PURE__ */new Map,xt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,l=Lt;for(;c--;)s=i[c],a=l.get(s),void 0===a&&l.set(s,a=c?/* @__PURE__ */new Map:Rt(t)),l=a;return a};xt();const Pt={http:null,xhr:gt,fetch:{get:xt}};Re.forEach(Pt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Tt=e=>`- ${e}`,kt=e=>Re.isFunction(e)||null===e||!1===e;const Ut={getAdapter:function(e,t){e=Re.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!kt(r)&&(o=Pt[(n=String(r)).toLowerCase()],void 0===o))throw new Le(`Unknown adapter '${n}'`);if(o&&(Re.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Le("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Tt).join("\n"):" "+Tt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:Pt};function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ot(null,e)}function Ct(e){At(e),e.headers=tt.from(e.headers),e.data=nt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ut.getAdapter(e.adapter||Ve.adapter,e)(e).then(function(t){return At(e),t.data=nt.call(e,e.transformResponse,t),t.headers=tt.from(t.headers),t},function(t){return rt(t)||(At(e),t&&t.response&&(t.response.data=nt.call(e,e.transformResponse,t.response),t.response.headers=tt.from(t.response.headers))),Promise.reject(t)})}const jt="1.13.2",Nt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Nt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Bt={};Nt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+jt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Le(r(o," has been removed"+(t?" in "+t:"")),Le.ERR_DEPRECATED);return t&&!Bt[o]&&(Bt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Nt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const It={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Le("options must be an object",Le.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new Le("option "+i+" must be "+n,Le.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Le("Unknown option "+i,Le.ERR_BAD_OPTION)}},validators:Nt},Dt=It.validators;let Ft=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Fe,response:new Fe}}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=ht(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&It.assertOptions(n,{silentJSONParsing:Dt.transitional(Dt.boolean),forcedJSONParsing:Dt.transitional(Dt.boolean),clarifyTimeoutError:Dt.transitional(Dt.boolean)},!1),null!=r&&(Re.isFunction(r)?t.paramsSerializer={serialize:r}:It.assertOptions(r,{encode:Dt.function,serialize:Dt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),It.assertOptions(t,{baseUrl:Dt.spelling("baseURL"),withXsrfToken:Dt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Re.merge(o.common,o[t.method]);o&&Re.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=tt.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[Ct.bind(this),void 0];for(e.unshift(...s),e.push(...c),u=e.length,l=Promise.resolve(t);d<u;)l=l.then(e[d++],e[d++]);return l}u=s.length;let f=t;for(;d<u;){const e=s[d++],t=s[d++];try{f=e(f)}catch(h){t.call(this,h);break}}try{l=Ct.call(this,f)}catch(h){return Promise.reject(h)}for(d=0,u=c.length;d<u;)l=l.then(c[d++],c[d++]);return l}getUri(e){return De(dt((e=ht(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Re.forEach(["delete","get","head","options"],function(e){Ft.prototype[e]=function(t,n){return this.request(ht(n||{},{method:e,url:t,data:(n||{}).data}))}}),Re.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ht(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ft.prototype[e]=t(),Ft.prototype[e+"Form"]=t(!0)});const Mt={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(Mt).forEach(([e,t])=>{Mt[t]=e});const qt=function e(t){const n=new Ft(t),r=I(Ft.prototype.request,n);return Re.extend(r,Ft.prototype,n,{allOwnKeys:!0}),Re.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ht(t,n))},r}(Ve);qt.Axios=Ft,qt.CanceledError=ot,qt.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,o){n.reason||(n.reason=new ot(e,r,o),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}}},qt.isCancel=rt,qt.VERSION=jt,qt.toFormData=Ce,qt.AxiosError=Le,qt.Cancel=qt.CanceledError,qt.all=function(e){return Promise.all(e)},qt.spread=function(e){return function(t){return e.apply(null,t)}},qt.isAxiosError=function(e){return Re.isObject(e)&&!0===e.isAxiosError},qt.mergeConfig=ht,qt.AxiosHeaders=tt,qt.formToJSON=e=>$e(Re.isHTMLForm(e)?new FormData(e):e),qt.getAdapter=Ut.getAdapter,qt.HttpStatusCode=Mt,qt.default=qt;const{Axios:Wt,AxiosError:zt,CanceledError:Gt,isCancel:Kt,CancelToken:Ht,VERSION:Jt,all:$t,Cancel:Vt,isAxiosError:Xt,spread:Zt,toFormData:Qt,AxiosHeaders:Yt,HttpStatusCode:en,formToJSON:tn,getAdapter:nn,mergeConfig:rn}=qt,on=f.getPar,sn=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(on("Device")||-1)};t&&(r._tui_source=((n=on("_tui_source")||on("from")||on("source"))||(n=m.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=g(!0,r,o,e)},an=function(e,t,n){return n=sn(n,t),e=f.addPars(n,e)},cn=await h(),ln="imp_sign",un="imp_useridx";f.getPar("useridx");var dn={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};qt.codeEnum=dn,qt.defaults.baseURL="",qt.defaults.withCredentials=!0,qt.defaults.crossDomain=!0,qt.defaults.dataType="json",qt.saveLogin=function(e,t){cn.debug("写入sign:",t),m.set(ln,t),e&&m.set(un,e)},qt.interceptors.request.use(async function(e){cn.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",f.getPar("_tui_source")||f.getPar("from")||f.getPar("source")),an(e.url),"post"===e.method&&(e.data=f.jsonto(e.data).substring(1));const t=await d.runM("login","getLogin",[null,!0]);return t&&(e.headers[ln]=t.sign,e.headers[un]=m.get(un)),e},function(e){return Promise.reject(e)}),qt.interceptors.response.use(async function(e){if(i.isString(e.data)){const t=new Error("接口:"+e.config.url+"返回了纯字符串数据:"+e.data);return Promise.reject(t)}if(e.data&&"true"==e.headers["res-encrypt"]){const t=await Promise.all([B.init(),T()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}switch(cn.debug("响应拦截",e),e.data.__source=e,(e=e.data).codeEnum=dn,e.isSuccess=function(t){return e.code!==dn.success&&(t||u.msg(e.msg)),e.code===dn.success},e.code){case dn.success:return Promise.resolve(e);case dn.jumpTo:return void(location.href=e.data);case dn.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case dn.alert:case dn.msg:return u.msg(e.msg),Promise.reject(e);case dn.noRealName:return impall.showReal_name();case dn.ServerSignError:case dn.nologin:if(e.__source.config.isTwice)return d.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return cn.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=f.toData(e.__source.config.data),qt(e.__source.config)};return await d.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var fn=qt.get;qt.get=function(e,t,n){return(n=n||{}).params=t,fn(e,n)};const hn=await T(),mn=await s();class gn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname?"https://localhost:44360":hn.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:an(this.loginDomain+"/index.html",!0),reg:an(this.loginDomain+"/index.html?type=reg",!0),loginPage:an(this.loginDomain+"/loginPage.html",!0),regPage:an(this.loginDomain+"/regPage.html",!0),autoLogin:an(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:an(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:an(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:an(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(){a.on(this.keys.msg_close,()=>{mn.debug("关闭登录框"),this.close()}),a.on(this.keys.msg_goto,e=>{this.handlePageTransition(e)}),a.on(this.keys.msg_autoSize,e=>{this.handleAutoSize(e)}),a.on(this.keys.msg_loginReturn,async e=>{await this.dealwithLoginRes(e)}),a.on(this.eventKeys.closeThreeLogin,e=>{this.save(e),this.closeThreeLoginWin()})}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&&(mn.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(c(e))t.ok&&t.ok(e);else{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===qt.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(mn.debug("登录消息返回",t),t.isok=t.code===qt.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]),l.set(this.keys.cache_loginSave,t,this.loginTime),qt.saveLogin(t.useridx,t.sign);try{await qt.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;a.send(this.keys.msg_loginReturn,{code:e.code,msg:e.msg,sign:t,useridx:n})}clear(){l.remove(this.keys.cache_loginSave),l.remove(this.keys.cache_userInfo),l.remove(this.keys.cache_userInfo+"_more"),l.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=o(!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(o){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){a.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"}}):a.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"}}):a.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 o=an(`/v1.0.0/user/OpenThreeLogin?type=${e}`,t);this.threeLoginWin=window.open(o)})}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||l.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 o=this.keys.cache_userInfo+"_"+(t?"more":"simplify");if(!n){const t=l.get(o);if(t)return void e(t)}qt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(l.set(o,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(mn.debug("checkZ:",this.autoLogin),!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),o=parseInt(e.getPar(this.keys.loginStatus)||-1);mn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?qt.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()}):qt.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 mn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{p.get(this.urls.exitLogin).then(t=>{y(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 o,i=!1;const s=()=>{r.removeEventListener("error",a),clearTimeout(o)},a=e=>{i||(i=!0,s(),r.remove(),this.runAutoLoginCallback(!1))};return r.addEventListener("load",()=>{i||(i=!0,s(),console.log("缓存数据已保存"))},{once:!0}),r.addEventListener("error",a,{once:!0}),o=setTimeout(()=>{a()},1e4),document.body.append(r),r}onNoLogin(e){d?d.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return d?Promise.resolve(d.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 pn=new gn;export{gn as Login,qt as axios,L as getAllConfig,U as getApiurl,R as getCodeVer,T as getConfig,x as getDomainConfig,S as getEvnConfig,P as getSimplifyConfig,B as gotool,an as handleUrl,pn as login};