@impui/imp 1.0.4 → 1.0.6
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 +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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,cache as c}from"@impui/com";import*as l from"@impui/com/layer";import{event as u}from"@impui/com/event";import{urltool as d}from"@impui/com/url";import{getLog as f}from"@impui/com/log";import{cache as h}from"@impui/com/cache";import{extend as m}from"@impui/com/core";import{iframeReq as g,get as p}from"@impui/com/req";const y=e.getDomainJson(),w={allsr:"https://impsr.5see.com"};let b=null;const _={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},O=t.getTimestamp(),E={config:O,bubble:O,dress:O,gift:O,template:O},v=()=>{if(b)return b;b=w,"undefined"!=typeof __impconfig__&&(b=o(!0,{},w,__impconfig__));for(const e in _)b[e]=b.allsr+_[e];return b},S=()=>o(!0,{},E,window.codever),R=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await n("config_allconfig",async()=>(await r(v().allconfig),window.allconfig))).domainsitetype},L=async()=>{const e=(await R())[y.main];if(!e)throw clearDomainConfig(),new Error("未找到域名 "+y.main+" 的配置信息");return e},x=async()=>{if(window.config||window.sconfig)return window.config||window.sconfig;return await n("config_simplify",async()=>{const e=await T("config_simplify");return await r(e),window.sconfig})},P=async()=>{if(window.config&&window.config.noble2&&window.config.Appmodules)return window.config;return await n("config_full",async()=>{const e=await T("config");return await r(e),window.config})},T=async e=>{const t=await L();var n=t.res||"sr",r=t.resHost||y.mainhost,o=y.protocol+"//"+n+"."+r;"localhost"==y.main&&v().localhostSr&&(o=v().localhostSr);return`${o}/live/webSkins_site/${t.sitetype}/config/${e}.js`},k=async()=>{if(window.apiurl)return window.apiurl;return await n("config_apiurl",async()=>(window.apiurl=await r(v().apiurl,{extend:o,config:await P()}),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 U=Go,A={},C=(await P()).allsr+"/plug/gotool/lib/imptool.wasm",j=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 k(),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 N=new class{constructor(e){this.isbase=e===C,this.url=e}async#e(){if(!this.url){const e=await P();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 U;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 j();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&&A[t])return A[t];const n=S(),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 A[t]=i,i}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(C);function B(e,t){return function(){return e.apply(t,arguments)}}const{toString:I}=Object.prototype,{getPrototypeOf:D}=Object,{iterator:F,toStringTag:M}=Symbol,q=/* @__PURE__ */(e=>t=>{const n=I.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),W=e=>(e=e.toLowerCase(),t=>q(t)===e),z=e=>t=>typeof t===e,{isArray:G}=Array,K=z("undefined");function H(e){return null!==e&&!K(e)&&null!==e.constructor&&!K(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const J=W("ArrayBuffer");const $=z("string"),V=z("function"),X=z("number"),Z=e=>null!==e&&"object"==typeof e,Q=e=>{if("object"!==q(e))return!1;const t=D(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||M in e||F in e)},Y=W("Date"),ee=W("File"),te=W("Blob"),ne=W("FileList"),re=W("URLSearchParams"),[oe,ie,se,ae]=["ReadableStream","Request","Response","Headers"].map(W);function ce(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),G(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(H(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 le(e,t){if(H(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 ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,de=e=>!K(e)&&e!==ue;const fe=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&D(Uint8Array)),he=W("HTMLFormElement"),me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ge=W("RegExp"),pe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ce(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const ye=W("AsyncFunction"),we=(be="function"==typeof setImmediate,_e=V(ue.postMessage),be?setImmediate:_e?(Oe=`axios@${Math.random()}`,Ee=[],ue.addEventListener("message",({source:e,data:t})=>{e===ue&&t===Oe&&Ee.length&&Ee.shift()()},!1),e=>{Ee.push(e),ue.postMessage(Oe,"*")}):e=>setTimeout(e));var be,_e,Oe,Ee;const ve="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ue):"undefined"!=typeof process&&process.nextTick||we,Se={isArray:G,isArrayBuffer:J,isBuffer:H,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||V(e.append)&&("formdata"===(t=q(e))||"object"===t&&V(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&J(e.buffer),t},isString:$,isNumber:X,isBoolean:e=>!0===e||!1===e,isObject:Z,isPlainObject:Q,isEmptyObject:e=>{if(!Z(e)||H(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:oe,isRequest:ie,isResponse:se,isHeaders:ae,isUndefined:K,isDate:Y,isFile:ee,isBlob:te,isRegExp:ge,isFunction:V,isStream:e=>Z(e)&&V(e.pipe),isURLSearchParams:re,isTypedArray:fe,isFileList:ne,forEach:ce,merge:function e(){const{caseless:t,skipUndefined:n}=de(this)&&this||{},r={},o=(o,i)=>{const s=t&&le(r,i)||i;Q(r[s])&&Q(o)?r[s]=e(r[s],o):Q(o)?r[s]=e({},o):G(o)?r[s]=o.slice():n&&K(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&ce(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ce(t,(t,r)=>{n&&V(t)?e[r]=B(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&&D(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:q,kindOfTest:W,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(G(e))return e;let t=e.length;if(!X(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[F]).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:he,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:pe,freezeMethods:e=>{pe(e,(t,n)=>{if(V(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];V(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 G(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:le,global:ue,isContextDefined:de,isSpecCompliantForm:function(e){return!!(e&&V(e.append)&&"FormData"===e[M]&&e[F])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Z(e)){if(t.indexOf(e)>=0)return;if(H(e))return e;if(!("toJSON"in e)){t[r]=e;const o=G(e)?[]:{};return ce(e,(e,t)=>{const i=n(e,r+1);!K(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ye,isThenable:e=>e&&(Z(e)||V(e))&&V(e.then)&&V(e.catch),setImmediate:we,asap:ve,isIterable:e=>null!=e&&V(e[F])};function Re(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)}Se.inherits(Re,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:Se.toJSONObject(this.config),code:this.code,status:this.status}}});const Le=Re.prototype,xe={};["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=>{xe[e]={value:e}}),Object.defineProperties(Re,xe),Object.defineProperty(Le,"isAxiosError",{value:!0}),Re.from=(e,t,n,r,o,i)=>{const s=Object.create(Le);Se.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 Re.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 Pe(e){return Se.isPlainObject(e)||Se.isArray(e)}function Te(e){return Se.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){return e?e.concat(t).map(function(e,t){return e=Te(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ue=Se.toFlatObject(Se,{},null,function(e){return/^is[A-Z]/.test(e)});function Ae(e,t,n){if(!Se.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Se.isUndefined(t[e])})).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Se.isSpecCompliantForm(t);if(!Se.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Se.isDate(e))return e.toISOString();if(Se.isBoolean(e))return e.toString();if(!a&&Se.isBlob(e))throw new Re("Blob is not supported. Use a Buffer instead.");return Se.isArrayBuffer(e)||Se.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(Se.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Se.isArray(e)&&function(e){return Se.isArray(e)&&!e.some(Pe)}(e)||(Se.isFileList(e)||Se.endsWith(n,"[]"))&&(a=Se.toArray(e)))return n=Te(n),a.forEach(function(e,r){!Se.isUndefined(e)&&null!==e&&t.append(!0===s?ke([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!Pe(e)||(t.append(ke(o,n,i),c(e)),!1)}const u=[],d=Object.assign(Ue,{defaultVisitor:l,convertValue:c,isVisitable:Pe});if(!Se.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Se.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Se.forEach(n,function(n,i){!0===(!(Se.isUndefined(n)||null===n)&&o.call(t,n,Se.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function je(e,t){this._pairs=[],e&&Ae(e,this,t)}const Ne=je.prototype;function Be(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ie(e,t,n){if(!t)return e;const r=n&&n.encode||Be;Se.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Se.isURLSearchParams(t)?t.toString():new je(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Ne.append=function(e,t){this._pairs.push([e,t])},Ne.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class De{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){Se.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Me={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qe="undefined"!=typeof window&&"undefined"!=typeof document,We="object"==typeof navigator&&navigator||void 0,ze=qe&&(!We||["ReactNative","NativeScript","NS"].indexOf(We.product)<0),Ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ke=qe&&window.location.href||"http://localhost",He={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:qe,hasStandardBrowserEnv:ze,hasStandardBrowserWebWorkerEnv:Ge,navigator:We,origin:Ke},Symbol.toStringTag,{value:"Module"})),...Me};function Je(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&&Se.isArray(r)?r.length:i,a)return Se.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Se.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Se.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(Se.isFormData(e)&&Se.isFunction(e.entries)){const n={};return Se.forEachEntry(e,(e,r)=>{t(function(e){return Se.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const $e={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Se.isObject(e);o&&Se.isHTMLForm(e)&&(e=new FormData(e));if(Se.isFormData(e))return r?JSON.stringify(Je(e)):e;if(Se.isArrayBuffer(e)||Se.isBuffer(e)||Se.isStream(e)||Se.isFile(e)||Se.isBlob(e)||Se.isReadableStream(e))return e;if(Se.isArrayBufferView(e))return e.buffer;if(Se.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 Ae(e,new He.classes.URLSearchParams,{visitor:function(e,t,n,r){return He.isNode&&Se.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Se.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ae(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Se.isString(e))try{return(t||JSON.parse)(e),Se.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$e.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Se.isResponse(e)||Se.isReadableStream(e))return e;if(e&&Se.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 Re.from(o,Re.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:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Se.forEach(["delete","get","head","post","put","patch"],e=>{$e.headers[e]={}});const Ve=Se.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"]),Xe=Symbol("internals");function Ze(e){return e&&String(e).trim().toLowerCase()}function Qe(e){return!1===e||null==e?e:Se.isArray(e)?e.map(Qe):String(e)}function Ye(e,t,n,r,o){return Se.isFunction(r)?r.call(this,t,n):(o&&(t=n),Se.isString(t)?Se.isString(r)?-1!==t.indexOf(r):Se.isRegExp(r)?r.test(t):void 0:void 0)}let et=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ze(t);if(!o)throw new Error("header name must be a non-empty string");const i=Se.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Qe(e))}const i=(e,t)=>Se.forEach(e,(e,n)=>o(e,n,t));if(Se.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Se.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]&&Ve[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(Se.isObject(e)&&Se.isIterable(e)){let n,r,o={};for(const t of e){if(!Se.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Se.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=Ze(e)){const n=Se.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(Se.isFunction(t))return t.call(this,e,n);if(Se.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ze(e)){const n=Se.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ze(e)){const o=Se.findKey(n,e);!o||t&&!Ye(0,n[o],o,t)||(delete n[o],r=!0)}}return Se.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&&!Ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Se.forEach(this,(r,o)=>{const i=Se.findKey(n,o);if(i)return t[i]=Qe(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]=Qe(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Se.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Se.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[Xe]=this[Xe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ze(e);t[r]||(!function(e,t){const n=Se.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 Se.isArray(e)?e.forEach(r):r(e),this}};function tt(e,t){const n=this||$e,r=t||n,o=et.from(r.headers);let i=r.data;return Se.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function nt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,n){Re.call(this,null==e?"canceled":e,Re.ERR_CANCELED,t,n),this.name="CanceledError"}function ot(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Re("Request failed with status code "+n.status,[Re.ERR_BAD_REQUEST,Re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}et.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Se.reduceDescriptors(et.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Se.freezeMethods(et),Se.inherits(rt,Re,{__CANCEL__:!0});const it=(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)},st=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},at=e=>(...t)=>Se.asap(()=>e(...t)),ct=He.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,He.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,lt=He.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Se.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Se.isString(r)&&a.push(`path=${r}`),Se.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),Se.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 ut(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 dt=e=>e instanceof et?{...e}:e;function ft(e,t){t=t||{};const n={};function r(e,t,n,r){return Se.isPlainObject(e)&&Se.isPlainObject(t)?Se.merge.call({caseless:r},e,t):Se.isPlainObject(t)?Se.merge({},t):Se.isArray(t)?t.slice():t}function o(e,t,n,o){return Se.isUndefined(t)?Se.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Se.isUndefined(t))return r(void 0,t)}function s(e,t){return Se.isUndefined(t)?Se.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(dt(e),dt(t),0,!0)};return Se.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);Se.isUndefined(s)&&i!==a||(n[r]=s)}),n}const ht=e=>{const t=ft({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=et.from(s),t.url=Ie(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Se.isFormData(n))if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Se.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(He.hasStandardBrowserEnv&&(r&&Se.isFunction(r)&&(r=r(t)),r||!1!==r&&ct(t.url))){const e=o&&i&<.read(i);e&&s.set(o,e)}return t},mt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ht(e);let o=r.data;const i=et.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=et.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());ot(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 Re("Request aborted",Re.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Re(t&&t.message?t.message:"Network Error",Re.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||Fe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Re(t,o.clarifyTimeoutError?Re.ETIMEDOUT:Re.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Se.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Se.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=it(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=it(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new rt(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===He.protocols.indexOf(y)?n(new Re("Unsupported protocol "+y+":",Re.ERR_BAD_REQUEST,e)):g.send(o||null)})},gt=(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 Re?t:new rt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Re(`timeout ${t} of ms exceeded`,Re.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=()=>Se.asap(s),a}},pt=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},yt=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()}},wt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of yt(e))yield*pt(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:bt}=Se,_t=(({Request:e,Response:t})=>({Request:e,Response:t}))(Se.global),{ReadableStream:Ot,TextEncoder:Et}=Se.global,vt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},St=e=>{e=Se.merge.call({skipUndefined:!0},_t,e);const{fetch:t,Request:n,Response:r}=e,o=t?bt(t):"function"==typeof fetch,i=bt(n),s=bt(r);if(!o)return!1;const a=o&&bt(Ot),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&&vt(()=>{let e=!1;const t=new n(He.origin,{body:new Ot,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=s&&a&&vt(()=>Se.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 Re(`Response type '${e}' is not supported`,Re.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Se.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Se.isBlob(e))return e.size;if(Se.isSpecCompliantForm(e)){const t=new n(He.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Se.isArrayBufferView(e)||Se.isArrayBuffer(e)?e.byteLength:(Se.isURLSearchParams(e)&&(e+=""),Se.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:_}=ht(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let E=gt([c,h&&h.toAbortSignal()],m),v=null;const S=E&&E.unsubscribe&&(()=>{E.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(Se.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=st(R,it(at(p)));a=wt(t.body,65536,e,n)}}Se.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={..._,signal:E,method:s.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};v=i&&new n(o,c);let h=await(i?O(v,_):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=Se.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&st(t,it(at(g),!0))||[];h=new r(wt(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Se.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{ot(t,n,{data:L,headers:et.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:v})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Re("Network Error",Re.ERR_NETWORK,e,v),{cause:L.cause||L});throw Re.from(L,L&&L.code,e,v)}}},Rt=/* @__PURE__ */new Map,Lt=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=Rt;for(;c--;)s=i[c],a=l.get(s),void 0===a&&l.set(s,a=c?/* @__PURE__ */new Map:St(t)),l=a;return a};Lt();const xt={http:null,xhr:mt,fetch:{get:Lt}};Se.forEach(xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Pt=e=>`- ${e}`,Tt=e=>Se.isFunction(e)||null===e||!1===e;const kt={getAdapter:function(e,t){e=Se.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,!Tt(r)&&(o=xt[(n=String(r)).toLowerCase()],void 0===o))throw new Re(`Unknown adapter '${n}'`);if(o&&(Se.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 Re("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Pt).join("\n"):" "+Pt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:xt};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rt(null,e)}function At(e){Ut(e),e.headers=et.from(e.headers),e.data=tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return kt.getAdapter(e.adapter||$e.adapter,e)(e).then(function(t){return Ut(e),t.data=tt.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t},function(t){return nt(t)||(Ut(e),t&&t.response&&(t.response.data=tt.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)})}const Ct="1.13.2",jt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nt={};jt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ct+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Re(r(o," has been removed"+(t?" in "+t:"")),Re.ERR_DEPRECATED);return t&&!Nt[o]&&(Nt[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)}},jt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Bt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Re("options must be an object",Re.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 Re("option "+i+" must be "+n,Re.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Re("Unknown option "+i,Re.ERR_BAD_OPTION)}},validators:jt},It=Bt.validators;let Dt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}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=ft(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Bt.assertOptions(n,{silentJSONParsing:It.transitional(It.boolean),forcedJSONParsing:It.transitional(It.boolean),clarifyTimeoutError:It.transitional(It.boolean)},!1),null!=r&&(Se.isFunction(r)?t.paramsSerializer={serialize:r}:Bt.assertOptions(r,{encode:It.function,serialize:It.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Bt.assertOptions(t,{baseUrl:It.spelling("baseURL"),withXsrfToken:It.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Se.merge(o.common,o[t.method]);o&&Se.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=et.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=[At.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=At.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 Ie(ut((e=ft(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Se.forEach(["delete","get","head","options"],function(e){Dt.prototype[e]=function(t,n){return this.request(ft(n||{},{method:e,url:t,data:(n||{}).data}))}}),Se.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ft(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Dt.prototype[e]=t(),Dt.prototype[e+"Form"]=t(!0)});const Ft={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(Ft).forEach(([e,t])=>{Ft[t]=e});const Mt=function e(t){const n=new Dt(t),r=B(Dt.prototype.request,n);return Se.extend(r,Dt.prototype,n,{allOwnKeys:!0}),Se.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ft(t,n))},r}($e);Mt.Axios=Dt,Mt.CanceledError=rt,Mt.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 rt(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}}},Mt.isCancel=nt,Mt.VERSION=Ct,Mt.toFormData=Ae,Mt.AxiosError=Re,Mt.Cancel=Mt.CanceledError,Mt.all=function(e){return Promise.all(e)},Mt.spread=function(e){return function(t){return e.apply(null,t)}},Mt.isAxiosError=function(e){return Se.isObject(e)&&!0===e.isAxiosError},Mt.mergeConfig=ft,Mt.AxiosHeaders=et,Mt.formToJSON=e=>Je(Se.isHTMLForm(e)?new FormData(e):e),Mt.getAdapter=kt.getAdapter,Mt.HttpStatusCode=Ft,Mt.default=Mt;const{Axios:qt,AxiosError:Wt,CanceledError:zt,isCancel:Gt,CancelToken:Kt,VERSION:Ht,all:Jt,Cancel:$t,isAxiosError:Vt,spread:Xt,toFormData:Zt,AxiosHeaders:Qt,HttpStatusCode:Yt,formToJSON:en,getAdapter:tn,mergeConfig:nn}=Mt,rn=d.getPar,on=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(rn("Device")||-1)};t&&(r._tui_source=((n=rn("_tui_source")||rn("from")||rn("source"))||(n=h.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=m(!0,r,o,e)},sn=function(e,t,n){return n=on(n,t),e=d.addPars(n,e)},an=await f(),cn="imp_sign",ln="imp_useridx";d.getPar("useridx");var un={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Mt.codeEnum=un,Mt.defaults.baseURL="",Mt.defaults.withCredentials=!0,Mt.defaults.crossDomain=!0,Mt.defaults.dataType="json",Mt.saveLogin=function(e,t){an.debug("写入sign:",t),h.set(cn,t),e&&h.set(ln,e)},Mt.interceptors.request.use(async function(e){an.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",d.getPar("_tui_source")||d.getPar("from")||d.getPar("source")),sn(e.url),"post"===e.method&&(e.data=d.jsonto(e.data).substring(1));const t=await u.runM("login","getLogin",[null,!0]);return t&&(e.headers[cn]=t.sign,e.headers[ln]=h.get(ln)),e},function(e){return Promise.reject(e)}),Mt.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([N.init(),P()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}switch(an.debug("响应拦截",e),e.data.__source=e,(e=e.data).codeEnum=un,e.isSuccess=function(t){return e.code!==un.success&&(t||l.msg(e.msg)),e.code===un.success},e.code){case un.success:return Promise.resolve(e);case un.jumpTo:return void(location.href=e.data);case un.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case un.alert:case un.msg:return l.msg(e.msg),Promise.reject(e);case un.noRealName:return impall.showReal_name();case un.ServerSignError:case un.nologin:if(e.__source.config.isTwice)return u.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return an.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=d.toData(e.__source.config.data),Mt(e.__source.config)};return await u.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var dn=Mt.get;Mt.get=function(e,t,n){return(n=n||{}).params=t,dn(e,n)};const fn=await P(),hn=await s();class mn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname?"https://localhost:44360":fn.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:sn(this.loginDomain+"/index.html",!0),reg:sn(this.loginDomain+"/index.html?type=reg",!0),loginPage:sn(this.loginDomain+"/loginPage.html",!0),regPage:sn(this.loginDomain+"/regPage.html",!0),autoLogin:sn(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:sn(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:sn(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:sn(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,()=>{hn.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&&(hn.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){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Mt.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(hn.debug("登录消息返回",t),t.isok=t.code===Mt.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]),c.set(this.keys.cache_loginSave,t,this.loginTime),Mt.saveLogin(t.useridx,t.sign);try{await Mt.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(){c.remove(this.keys.cache_loginSave),c.remove(this.keys.cache_userInfo),c.remove(this.keys.cache_userInfo+"_more"),c.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=sn(`/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||c.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=c.get(o);if(t)return void e(t)}Mt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(c.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(hn.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})})}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),o=parseInt(e.getPar(this.keys.loginStatus)||-1);hn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?Mt.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()}):Mt.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 hn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{g.get(this.urls.exitLogin).then(t=>{p(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");return 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,document.body.append(r),r}onNoLogin(e){u?u.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return u?Promise.resolve(u.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 gn=new mn;export{mn as Login,Mt as axios,R as getAllConfig,k as getApiurl,S as getCodeVer,P as getConfig,L as getDomainConfig,v as getEvnConfig,x as getSimplifyConfig,N as gotool,sn as handleUrl,gn as login};
|
|
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,cache as c}from"@impui/com";import*as l from"@impui/com/layer";import{event as u}from"@impui/com/event";import{urltool as d}from"@impui/com/url";import{getLog as f}from"@impui/com/log";import{cache as h}from"@impui/com/cache";import{extend as m}from"@impui/com/core";import{iframeReq as g,get as p}from"@impui/com/req";const y=e.getDomainJson(),w={allsr:"https://impsr.5see.com",debugDomain:"zjyx1.com"};let b=null;const _={allconfig:"/npm/allconfig.min.js",apiurl:"/npm/apiurl.min.js"},O=t.getTimestamp(),E={config:O,bubble:O,dress:O,gift:O,template:O},v=()=>{if(b)return b;b=w,"undefined"!=typeof __impconfig__&&(b=o(!0,{},w,__impconfig__));for(const e in _)b[e]=b.allsr+_[e];return b},S=()=>o(!0,{},E,window.codever),R=async()=>{if(window.allconfig)return window.allconfig.domainsitetype;return(await n("config_allconfig",async()=>(await r(v().allconfig),window.allconfig))).domainsitetype},L=async()=>{const e=(await R())[y.main];return e||{}},x=async()=>{if(window.config||window.sconfig)return window.config||window.sconfig;return await n("config_simplify",async()=>{const e=await T("config_simplify");return await r(e),window.sconfig})},P=async()=>{if(window.config&&window.config.noble2&&window.config.Appmodules)return window.config;return await n("config_full",async()=>{const e=await T("config");return await r(e),window.config})},T=async e=>{const t=await L(),n=v();var r=t.res||"sr",o=t.resHost||y.mainhost,i=y.protocol+"//"+r+"."+o;"localhost"==y.main&&n.debugDomain?i="https://sr."+n.debugDomain:"localhost"==y.main&&n.localhostSr&&(i=n.localhostSr);return`${i}/live/webSkins_site/${t.sitetype}/config/${e}.js`},k=async()=>{if(window.apiurl)return window.apiurl;return await n("config_apiurl",async()=>(window.apiurl=await r(v().apiurl,{extend:o,config:await P()}),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 U=Go,A={},C=(await P()).allsr+"/plug/gotool/lib/imptool.wasm",j=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 k(),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 N=new class{constructor(e){this.isbase=e===C,this.url=e}async#e(){if(!this.url){const e=await P();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 U;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 j();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&&A[t])return A[t];const n=S(),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 A[t]=i,i}async run(e,t){const n=await this.getRunTimes();return n[e]||console.error(`[${e}] 方法不在默认wasm中!`),n[e].apply(null,t)}}(C);function B(e,t){return function(){return e.apply(t,arguments)}}const{toString:I}=Object.prototype,{getPrototypeOf:D}=Object,{iterator:F,toStringTag:M}=Symbol,q=/* @__PURE__ */(e=>t=>{const n=I.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(/* @__PURE__ */Object.create(null)),W=e=>(e=e.toLowerCase(),t=>q(t)===e),z=e=>t=>typeof t===e,{isArray:G}=Array,K=z("undefined");function H(e){return null!==e&&!K(e)&&null!==e.constructor&&!K(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const J=W("ArrayBuffer");const $=z("string"),V=z("function"),X=z("number"),Z=e=>null!==e&&"object"==typeof e,Q=e=>{if("object"!==q(e))return!1;const t=D(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||M in e||F in e)},Y=W("Date"),ee=W("File"),te=W("Blob"),ne=W("FileList"),re=W("URLSearchParams"),[oe,ie,se,ae]=["ReadableStream","Request","Response","Headers"].map(W);function ce(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),G(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(H(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 le(e,t){if(H(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 ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,de=e=>!K(e)&&e!==ue;const fe=/* @__PURE__ */(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&D(Uint8Array)),he=W("HTMLFormElement"),me=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ge=W("RegExp"),pe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ce(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const ye=W("AsyncFunction"),we=(be="function"==typeof setImmediate,_e=V(ue.postMessage),be?setImmediate:_e?(Oe=`axios@${Math.random()}`,Ee=[],ue.addEventListener("message",({source:e,data:t})=>{e===ue&&t===Oe&&Ee.length&&Ee.shift()()},!1),e=>{Ee.push(e),ue.postMessage(Oe,"*")}):e=>setTimeout(e));var be,_e,Oe,Ee;const ve="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ue):"undefined"!=typeof process&&process.nextTick||we,Se={isArray:G,isArrayBuffer:J,isBuffer:H,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||V(e.append)&&("formdata"===(t=q(e))||"object"===t&&V(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&J(e.buffer),t},isString:$,isNumber:X,isBoolean:e=>!0===e||!1===e,isObject:Z,isPlainObject:Q,isEmptyObject:e=>{if(!Z(e)||H(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:oe,isRequest:ie,isResponse:se,isHeaders:ae,isUndefined:K,isDate:Y,isFile:ee,isBlob:te,isRegExp:ge,isFunction:V,isStream:e=>Z(e)&&V(e.pipe),isURLSearchParams:re,isTypedArray:fe,isFileList:ne,forEach:ce,merge:function e(){const{caseless:t,skipUndefined:n}=de(this)&&this||{},r={},o=(o,i)=>{const s=t&&le(r,i)||i;Q(r[s])&&Q(o)?r[s]=e(r[s],o):Q(o)?r[s]=e({},o):G(o)?r[s]=o.slice():n&&K(o)||(r[s]=o)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&ce(arguments[i],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ce(t,(t,r)=>{n&&V(t)?e[r]=B(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&&D(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:q,kindOfTest:W,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(G(e))return e;let t=e.length;if(!X(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[F]).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:he,hasOwnProperty:me,hasOwnProp:me,reduceDescriptors:pe,freezeMethods:e=>{pe(e,(t,n)=>{if(V(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];V(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 G(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:le,global:ue,isContextDefined:de,isSpecCompliantForm:function(e){return!!(e&&V(e.append)&&"FormData"===e[M]&&e[F])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Z(e)){if(t.indexOf(e)>=0)return;if(H(e))return e;if(!("toJSON"in e)){t[r]=e;const o=G(e)?[]:{};return ce(e,(e,t)=>{const i=n(e,r+1);!K(i)&&(o[t]=i)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ye,isThenable:e=>e&&(Z(e)||V(e))&&V(e.then)&&V(e.catch),setImmediate:we,asap:ve,isIterable:e=>null!=e&&V(e[F])};function Re(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)}Se.inherits(Re,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:Se.toJSONObject(this.config),code:this.code,status:this.status}}});const Le=Re.prototype,xe={};["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=>{xe[e]={value:e}}),Object.defineProperties(Re,xe),Object.defineProperty(Le,"isAxiosError",{value:!0}),Re.from=(e,t,n,r,o,i)=>{const s=Object.create(Le);Se.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 Re.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 Pe(e){return Se.isPlainObject(e)||Se.isArray(e)}function Te(e){return Se.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){return e?e.concat(t).map(function(e,t){return e=Te(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Ue=Se.toFlatObject(Se,{},null,function(e){return/^is[A-Z]/.test(e)});function Ae(e,t,n){if(!Se.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Se.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Se.isUndefined(t[e])})).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Se.isSpecCompliantForm(t);if(!Se.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Se.isDate(e))return e.toISOString();if(Se.isBoolean(e))return e.toString();if(!a&&Se.isBlob(e))throw new Re("Blob is not supported. Use a Buffer instead.");return Se.isArrayBuffer(e)||Se.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(Se.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Se.isArray(e)&&function(e){return Se.isArray(e)&&!e.some(Pe)}(e)||(Se.isFileList(e)||Se.endsWith(n,"[]"))&&(a=Se.toArray(e)))return n=Te(n),a.forEach(function(e,r){!Se.isUndefined(e)&&null!==e&&t.append(!0===s?ke([n],r,i):null===s?n:n+"[]",c(e))}),!1;return!!Pe(e)||(t.append(ke(o,n,i),c(e)),!1)}const u=[],d=Object.assign(Ue,{defaultVisitor:l,convertValue:c,isVisitable:Pe});if(!Se.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Se.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Se.forEach(n,function(n,i){!0===(!(Se.isUndefined(n)||null===n)&&o.call(t,n,Se.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])}),u.pop()}}(e),t}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function je(e,t){this._pairs=[],e&&Ae(e,this,t)}const Ne=je.prototype;function Be(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ie(e,t,n){if(!t)return e;const r=n&&n.encode||Be;Se.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):Se.isURLSearchParams(t)?t.toString():new je(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Ne.append=function(e,t){this._pairs.push([e,t])},Ne.toString=function(e){const t=e?function(t){return e.call(this,t,Ce)}:Ce;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class De{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){Se.forEach(this.handlers,function(t){null!==t&&e(t)})}}const Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Me={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},qe="undefined"!=typeof window&&"undefined"!=typeof document,We="object"==typeof navigator&&navigator||void 0,ze=qe&&(!We||["ReactNative","NativeScript","NS"].indexOf(We.product)<0),Ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ke=qe&&window.location.href||"http://localhost",He={.../* @__PURE__ */Object.freeze(/* @__PURE__ */Object.defineProperty({__proto__:null,hasBrowserEnv:qe,hasStandardBrowserEnv:ze,hasStandardBrowserWebWorkerEnv:Ge,navigator:We,origin:Ke},Symbol.toStringTag,{value:"Module"})),...Me};function Je(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&&Se.isArray(r)?r.length:i,a)return Se.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&Se.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&Se.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(Se.isFormData(e)&&Se.isFunction(e.entries)){const n={};return Se.forEachEntry(e,(e,r)=>{t(function(e){return Se.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const $e={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Se.isObject(e);o&&Se.isHTMLForm(e)&&(e=new FormData(e));if(Se.isFormData(e))return r?JSON.stringify(Je(e)):e;if(Se.isArrayBuffer(e)||Se.isBuffer(e)||Se.isStream(e)||Se.isFile(e)||Se.isBlob(e)||Se.isReadableStream(e))return e;if(Se.isArrayBufferView(e))return e.buffer;if(Se.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 Ae(e,new He.classes.URLSearchParams,{visitor:function(e,t,n,r){return He.isNode&&Se.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Se.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ae(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Se.isString(e))try{return(t||JSON.parse)(e),Se.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||$e.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Se.isResponse(e)||Se.isReadableStream(e))return e;if(e&&Se.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 Re.from(o,Re.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:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Se.forEach(["delete","get","head","post","put","patch"],e=>{$e.headers[e]={}});const Ve=Se.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"]),Xe=Symbol("internals");function Ze(e){return e&&String(e).trim().toLowerCase()}function Qe(e){return!1===e||null==e?e:Se.isArray(e)?e.map(Qe):String(e)}function Ye(e,t,n,r,o){return Se.isFunction(r)?r.call(this,t,n):(o&&(t=n),Se.isString(t)?Se.isString(r)?-1!==t.indexOf(r):Se.isRegExp(r)?r.test(t):void 0:void 0)}let et=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ze(t);if(!o)throw new Error("header name must be a non-empty string");const i=Se.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Qe(e))}const i=(e,t)=>Se.forEach(e,(e,n)=>o(e,n,t));if(Se.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Se.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]&&Ve[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(Se.isObject(e)&&Se.isIterable(e)){let n,r,o={};for(const t of e){if(!Se.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Se.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=Ze(e)){const n=Se.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(Se.isFunction(t))return t.call(this,e,n);if(Se.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ze(e)){const n=Se.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ze(e)){const o=Se.findKey(n,e);!o||t&&!Ye(0,n[o],o,t)||(delete n[o],r=!0)}}return Se.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&&!Ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Se.forEach(this,(r,o)=>{const i=Se.findKey(n,o);if(i)return t[i]=Qe(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]=Qe(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=/* @__PURE__ */Object.create(null);return Se.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Se.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[Xe]=this[Xe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ze(e);t[r]||(!function(e,t){const n=Se.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 Se.isArray(e)?e.forEach(r):r(e),this}};function tt(e,t){const n=this||$e,r=t||n,o=et.from(r.headers);let i=r.data;return Se.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function nt(e){return!(!e||!e.__CANCEL__)}function rt(e,t,n){Re.call(this,null==e?"canceled":e,Re.ERR_CANCELED,t,n),this.name="CanceledError"}function ot(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Re("Request failed with status code "+n.status,[Re.ERR_BAD_REQUEST,Re.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}et.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Se.reduceDescriptors(et.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Se.freezeMethods(et),Se.inherits(rt,Re,{__CANCEL__:!0});const it=(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)},st=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},at=e=>(...t)=>Se.asap(()=>e(...t)),ct=He.hasStandardBrowserEnv?/* @__PURE__ */((e,t)=>n=>(n=new URL(n,He.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,lt=He.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Se.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),Se.isString(r)&&a.push(`path=${r}`),Se.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),Se.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 ut(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 dt=e=>e instanceof et?{...e}:e;function ft(e,t){t=t||{};const n={};function r(e,t,n,r){return Se.isPlainObject(e)&&Se.isPlainObject(t)?Se.merge.call({caseless:r},e,t):Se.isPlainObject(t)?Se.merge({},t):Se.isArray(t)?t.slice():t}function o(e,t,n,o){return Se.isUndefined(t)?Se.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Se.isUndefined(t))return r(void 0,t)}function s(e,t){return Se.isUndefined(t)?Se.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(dt(e),dt(t),0,!0)};return Se.forEach(Object.keys({...e,...t}),function(r){const i=c[r]||o,s=i(e[r],t[r],r);Se.isUndefined(s)&&i!==a||(n[r]=s)}),n}const ht=e=>{const t=ft({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=et.from(s),t.url=Ie(ut(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),Se.isFormData(n))if(He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(Se.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(He.hasStandardBrowserEnv&&(r&&Se.isFunction(r)&&(r=r(t)),r||!1!==r&&ct(t.url))){const e=o&&i&<.read(i);e&&s.set(o,e)}return t},mt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=ht(e);let o=r.data;const i=et.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=et.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());ot(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 Re("Request aborted",Re.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){const r=new Re(t&&t.message?t.message:"Network Error",Re.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||Fe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Re(t,o.clarifyTimeoutError?Re.ETIMEDOUT:Re.ECONNABORTED,e,g)),g=null},void 0===o&&i.setContentType(null),"setRequestHeader"in g&&Se.forEach(i.toJSON(),function(e,t){g.setRequestHeader(t,e)}),Se.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),d&&"json"!==d&&(g.responseType=r.responseType),h&&([c,u]=it(h,!0),g.addEventListener("progress",c)),f&&g.upload&&([a,l]=it(f),g.upload.addEventListener("progress",a),g.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{g&&(n(!t||t.type?new rt(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===He.protocols.indexOf(y)?n(new Re("Unsupported protocol "+y+":",Re.ERR_BAD_REQUEST,e)):g.send(o||null)})},gt=(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 Re?t:new rt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Re(`timeout ${t} of ms exceeded`,Re.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=()=>Se.asap(s),a}},pt=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},yt=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()}},wt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of yt(e))yield*pt(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:bt}=Se,_t=(({Request:e,Response:t})=>({Request:e,Response:t}))(Se.global),{ReadableStream:Ot,TextEncoder:Et}=Se.global,vt=(e,...t)=>{try{return!!e(...t)}catch(n){return!1}},St=e=>{e=Se.merge.call({skipUndefined:!0},_t,e);const{fetch:t,Request:n,Response:r}=e,o=t?bt(t):"function"==typeof fetch,i=bt(n),s=bt(r);if(!o)return!1;const a=o&&bt(Ot),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&&vt(()=>{let e=!1;const t=new n(He.origin,{body:new Ot,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u=s&&a&&vt(()=>Se.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 Re(`Response type '${e}' is not supported`,Re.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const r=Se.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(Se.isBlob(e))return e.size;if(Se.isSpecCompliantForm(e)){const t=new n(He.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Se.isArrayBufferView(e)||Se.isArrayBuffer(e)?e.byteLength:(Se.isURLSearchParams(e)&&(e+=""),Se.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:_}=ht(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let E=gt([c,h&&h.toAbortSignal()],m),v=null;const S=E&&E.unsubscribe&&(()=>{E.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(Se.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,n]=st(R,it(at(p)));a=wt(t.body,65536,e,n)}}Se.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in n.prototype,c={..._,signal:E,method:s.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};v=i&&new n(o,c);let h=await(i?O(v,_):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=Se.toFiniteNumber(h.headers.get("content-length")),[n,o]=g&&st(t,it(at(g),!0))||[];h=new r(wt(h.body,65536,n,()=>{o&&o(),S&&S()}),e)}y=y||"text";let L=await d[Se.findKey(d,y)||"text"](h,e);return!m&&S&&S(),await new Promise((t,n)=>{ot(t,n,{data:L,headers:et.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:v})})}catch(L){if(S&&S(),L&&"TypeError"===L.name&&/Load failed|fetch/i.test(L.message))throw Object.assign(new Re("Network Error",Re.ERR_NETWORK,e,v),{cause:L.cause||L});throw Re.from(L,L&&L.code,e,v)}}},Rt=/* @__PURE__ */new Map,Lt=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=Rt;for(;c--;)s=i[c],a=l.get(s),void 0===a&&l.set(s,a=c?/* @__PURE__ */new Map:St(t)),l=a;return a};Lt();const xt={http:null,xhr:mt,fetch:{get:Lt}};Se.forEach(xt,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}});const Pt=e=>`- ${e}`,Tt=e=>Se.isFunction(e)||null===e||!1===e;const kt={getAdapter:function(e,t){e=Se.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,!Tt(r)&&(o=xt[(n=String(r)).toLowerCase()],void 0===o))throw new Re(`Unknown adapter '${n}'`);if(o&&(Se.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 Re("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Pt).join("\n"):" "+Pt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:xt};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rt(null,e)}function At(e){Ut(e),e.headers=et.from(e.headers),e.data=tt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return kt.getAdapter(e.adapter||$e.adapter,e)(e).then(function(t){return Ut(e),t.data=tt.call(e,e.transformResponse,t),t.headers=et.from(t.headers),t},function(t){return nt(t)||(Ut(e),t&&t.response&&(t.response.data=tt.call(e,e.transformResponse,t.response),t.response.headers=et.from(t.response.headers))),Promise.reject(t)})}const Ct="1.13.2",jt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{jt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nt={};jt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Ct+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Re(r(o," has been removed"+(t?" in "+t:"")),Re.ERR_DEPRECATED);return t&&!Nt[o]&&(Nt[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)}},jt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Bt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Re("options must be an object",Re.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 Re("option "+i+" must be "+n,Re.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Re("Unknown option "+i,Re.ERR_BAD_OPTION)}},validators:jt},It=Bt.validators;let Dt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new De,response:new De}}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=ft(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Bt.assertOptions(n,{silentJSONParsing:It.transitional(It.boolean),forcedJSONParsing:It.transitional(It.boolean),clarifyTimeoutError:It.transitional(It.boolean)},!1),null!=r&&(Se.isFunction(r)?t.paramsSerializer={serialize:r}:Bt.assertOptions(r,{encode:It.function,serialize:It.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Bt.assertOptions(t,{baseUrl:It.spelling("baseURL"),withXsrfToken:It.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Se.merge(o.common,o[t.method]);o&&Se.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=et.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=[At.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=At.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 Ie(ut((e=ft(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Se.forEach(["delete","get","head","options"],function(e){Dt.prototype[e]=function(t,n){return this.request(ft(n||{},{method:e,url:t,data:(n||{}).data}))}}),Se.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(ft(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Dt.prototype[e]=t(),Dt.prototype[e+"Form"]=t(!0)});const Ft={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(Ft).forEach(([e,t])=>{Ft[t]=e});const Mt=function e(t){const n=new Dt(t),r=B(Dt.prototype.request,n);return Se.extend(r,Dt.prototype,n,{allOwnKeys:!0}),Se.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ft(t,n))},r}($e);Mt.Axios=Dt,Mt.CanceledError=rt,Mt.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 rt(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}}},Mt.isCancel=nt,Mt.VERSION=Ct,Mt.toFormData=Ae,Mt.AxiosError=Re,Mt.Cancel=Mt.CanceledError,Mt.all=function(e){return Promise.all(e)},Mt.spread=function(e){return function(t){return e.apply(null,t)}},Mt.isAxiosError=function(e){return Se.isObject(e)&&!0===e.isAxiosError},Mt.mergeConfig=ft,Mt.AxiosHeaders=et,Mt.formToJSON=e=>Je(Se.isHTMLForm(e)?new FormData(e):e),Mt.getAdapter=kt.getAdapter,Mt.HttpStatusCode=Ft,Mt.default=Mt;const{Axios:qt,AxiosError:Wt,CanceledError:zt,isCancel:Gt,CancelToken:Kt,VERSION:Ht,all:Jt,Cancel:$t,isAxiosError:Vt,spread:Xt,toFormData:Zt,AxiosHeaders:Qt,HttpStatusCode:Yt,formToJSON:en,getAdapter:tn,mergeConfig:nn}=Mt,rn=d.getPar,on=function(e,t){var n,r={v:"1.0.1",Device:0,SourceDevice:parseInt(rn("Device")||-1)};t&&(r._tui_source=((n=rn("_tui_source")||rn("from")||rn("source"))||(n=h.get("_tui_source")),n));var o=window.pdata||window.axiosData||window.reqData||{};return e=m(!0,r,o,e)},sn=function(e,t,n){return n=on(n,t),e=d.addPars(n,e)},an=await f(),cn="imp_sign",ln="imp_useridx";d.getPar("useridx");var un={error:0,success:1,ServerSignError:2,jumpTo:100,window:101,alert:150,msg:160,noMoney:170,noRealName:234,nologin:666};Mt.codeEnum=un,Mt.defaults.baseURL="",Mt.defaults.withCredentials=!0,Mt.defaults.crossDomain=!0,Mt.defaults.dataType="json",Mt.saveLogin=function(e,t){an.debug("写入sign:",t),h.set(cn,t),e&&h.set(ln,e)},Mt.interceptors.request.use(async function(e){an.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",d.getPar("_tui_source")||d.getPar("from")||d.getPar("source")),sn(e.url),"post"===e.method&&(e.data=d.jsonto(e.data).substring(1));const t=await u.runM("login","getLogin",[null,!0]);return t&&(e.headers[cn]=t.sign,e.headers[ln]=h.get(ln)),e},function(e){return Promise.reject(e)}),Mt.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([N.init(),P()]),n=t[0],r=await n.parseRes(e,t[1]);null==r&&window.debug&&console.warn("响应数据解析异常",r),e=r||e}switch(an.debug("响应拦截",e),e.data.__source=e,(e=e.data).codeEnum=un,e.isSuccess=function(t){return e.code!==un.success&&(t||l.msg(e.msg)),e.code===un.success},e.code){case un.success:return Promise.resolve(e);case un.jumpTo:return void(location.href=e.data);case un.window:return!1!==Promise.resolve(e)&&window.open(e.data),Promise.reject(e);case un.alert:case un.msg:return l.msg(e.msg),Promise.reject(e);case un.noRealName:return impall.showReal_name();case un.ServerSignError:case un.nologin:if(e.__source.config.isTwice)return u.runM("login","noLogin",[e]),Promise.resolve(e);const t=function(){return an.debug("检测到未登录返回,发起验证登录之后,重新再请求一遍"),e.__source.config.isTwice=!0,e.__source.config.data=d.toData(e.__source.config.data),Mt(e.__source.config)};return await u.runM("login","checkLogin"),t()}return Promise.resolve(e)},function(e){return Promise.reject(e)});var dn=Mt.get;Mt.get=function(e,t,n){return(n=n||{}).params=t,dn(e,n)};const fn=await P(),hn=await s();class mn{constructor(){this.loginDomain=window.loginDomain="localhost"===location.hostname?"https://localhost:44360":fn.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:sn(this.loginDomain+"/index.html",!0),reg:sn(this.loginDomain+"/index.html?type=reg",!0),loginPage:sn(this.loginDomain+"/loginPage.html",!0),regPage:sn(this.loginDomain+"/regPage.html",!0),autoLogin:sn(this.loginDomain+"/"+this.ver+"/user/autoLogin"),checkSSOLogin:sn(this.loginDomain+"/"+this.ver+"/user/checkSSOLogin"),checkLoginPage:sn(this.loginDomain+"/"+this.ver+"/user/checkLoginPage"),CheckLoginByCode:sn(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,()=>{hn.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&&(hn.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){this.autoLogin.callbacks&&0!==this.autoLogin.callbacks.length&&(this.autoLogin.callbacks.forEach(t=>{const n=this.getLogin(e);t.ok&&t.ok(n&&n.code===Mt.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(hn.debug("登录消息返回",t),t.isok=t.code===Mt.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]),c.set(this.keys.cache_loginSave,t,this.loginTime),Mt.saveLogin(t.useridx,t.sign);try{await Mt.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(){c.remove(this.keys.cache_loginSave),c.remove(this.keys.cache_userInfo),c.remove(this.keys.cache_userInfo+"_more"),c.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=sn(`/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||c.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=c.get(o);if(t)return void e(t)}Mt.get(this.urls.userInfo,{more:t?1:0}).then(t=>{1===t.code?(c.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(hn.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})})}checkPage(){return new Promise((t,n)=>{const r=e.getPar(this.keys.checkLogin_code),o=parseInt(e.getPar(this.keys.loginStatus)||-1);hn.debug("checkLogin_code:",r),0===o?(e.delParsUpUrl([this.keys.loginStatus]),n("用户未登录!")):o&&r?Mt.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()}):Mt.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 hn.debug("退出登录!"),this.exitLogin.Promise||(this.exitLogin.Promise=new Promise(e=>{g.get(this.urls.exitLogin).then(t=>{p(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");return 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,document.body.append(r),r}onNoLogin(e){u?u.on(this.eventKeys.nologin,e):console.warn("事件模块event未加载,事件相关功能不可用!")}runNoLogin(e){return u?Promise.resolve(u.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 gn=new mn;export{mn as Login,Mt as axios,R as getAllConfig,k as getApiurl,S as getCodeVer,P as getConfig,L as getDomainConfig,v as getEvnConfig,x as getSimplifyConfig,N as gotool,sn as handleUrl,gn as login};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|