morningfast-plus 1.0.21 → 1.0.22
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/components/index.cjs +1 -1
- package/components/index.mjs +1 -1
- package/package.json +1 -1
- package/shared/index.cjs +1 -1
- package/shared/index.d.ts +1 -0
- package/shared/index.mjs +1 -1
package/shared/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=Object.defineProperty,t=(t,r)=>{let n={};for(var s in t)e(n,s,{get:t[s],enumerable:!0});return r&&e(n,Symbol.toStringTag,{value:"Module"}),n};let r=require("element-plus"),n=require("exceljs");function s(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{if(document.execCommand("copy"))return!0}catch(r){return!1}document.body.removeChild(t)}var o=null,i="",a={},c={},l="",u="",h=void 0,d=null,f={accessKeyId:"",accessKeySecret:"",stsToken:"",region:"",bucket:"",refreshSTSTokenInterval:9999999};const p=new Proxy(f,{get:(e,t)=>e[t],set:()=>!1});async function m(){const e=await(await fetch(i,{headers:new Headers({"Content-Type":"application/json",...a||{}}),body:JSON.stringify(c||{}),method:"POST",credentials:"include"})).json();return e?.data?.accessKeySecret&&e?.data?.securityToken?e?.data:null}function y(e){f.accessKeyId=e.accessKeyId||f.accessKeyId,f.accessKeySecret=e.accessKeySecret||f.accessKeySecret,f.stsToken=e.securityToken||f.stsToken,f.region=e.region||f.region,f.bucket=e.bucket||f.bucket,l=e.accessUrl||l,u=e.uploadUrl||u,f.refreshSTSTokenInterval=(0,r.dayjs)(e.expiration).diff((0,r.dayjs)(),"millisecond"),f.refreshSTSToken=h||(async()=>{const e=await m();return f.refreshSTSTokenInterval=(0,r.dayjs)(e?.expiration).diff((0,r.dayjs)(),"millisecond"),{accessKeyId:e?.accessKeyId||"",accessKeySecret:e?.accessKeySecret||"",stsToken:e?.securityToken||""}}),d=new o(f)}async function g(e,t){const r=await d.put(`${t}/${e.name}`,e,{timeout:(new Date).getTime()+18e4});return r.name=r.name?.split("/").pop()||e.name,"https:"===window.location.protocol&&(r.url=r.url.replace("http://","https://")),l&&u&&(r.url=r.url.replace(l,u)),r}function w(e,t){return function(){return e.apply(t,arguments)}}var b,{toString:v}=Object.prototype,{getPrototypeOf:E}=Object,{iterator:S,toStringTag:O}=Symbol,T=(b=Object.create(null),e=>{const t=v.call(e);return b[t]||(b[t]=t.slice(8,-1).toLowerCase())}),R=e=>(e=e.toLowerCase(),t=>T(t)===e),x=e=>t=>typeof t===e,{isArray:k}=Array,A=x("undefined");function C(e){return null!==e&&!A(e)&&null!==e.constructor&&!A(e.constructor)&&U(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var j=R("ArrayBuffer");var _=x("string"),U=x("function"),P=x("number"),D=e=>null!==e&&"object"==typeof e,L=e=>{if("object"!==T(e))return!1;const t=E(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||O in e||S in e)},N=R("Date"),I=R("File"),M=R("Blob"),F=R("FileList"),B=R("URLSearchParams"),[$,q,K,z]=["ReadableStream","Request","Response","Headers"].map(R);function J(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),k(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(C(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function W(e,t){if(C(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}var H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,V=e=>!A(e)&&e!==H;var X,Q=(X="undefined"!=typeof Uint8Array&&E(Uint8Array),e=>X&&e instanceof X),G=R("HTMLFormElement"),Z=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Y=R("RegExp"),ee=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};J(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)};var te,re,ne,se,oe=R("AsyncFunction"),ie=(te="function"==typeof setImmediate,re=U(H.postMessage),te?setImmediate:re?(ne=`axios@${Math.random()}`,se=[],H.addEventListener("message",({source:e,data:t})=>{e===H&&t===ne&&se.length&&se.shift()()},!1),e=>{se.push(e),H.postMessage(ne,"*")}):e=>setTimeout(e)),ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(H):"undefined"!=typeof process&&process.nextTick||ie,ce={isArray:k,isArrayBuffer:j,isBuffer:C,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||U(e.append)&&("formdata"===(t=T(e))||"object"===t&&U(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:P,isBoolean:e=>!0===e||!1===e,isObject:D,isPlainObject:L,isEmptyObject:e=>{if(!D(e)||C(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:$,isRequest:q,isResponse:K,isHeaders:z,isUndefined:A,isDate:N,isFile:I,isBlob:M,isRegExp:Y,isFunction:U,isStream:e=>D(e)&&U(e.pipe),isURLSearchParams:B,isTypedArray:Q,isFileList:F,forEach:J,merge:function e(){const{caseless:t,skipUndefined:r}=V(this)&&this||{},n={},s=(s,o)=>{const i=t&&W(n,o)||o;L(n[i])&&L(s)?n[i]=e(n[i],s):L(s)?n[i]=e({},s):k(s)?n[i]=s.slice():r&&A(s)||(n[i]=s)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&J(arguments[o],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(J(t,(t,n)=>{r&&U(t)?e[n]=w(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&E(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:T,kindOfTest:R,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(k(e))return e;let t=e.length;if(!P(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[S]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:G,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:ee,freezeMethods:e=>{ee(e,(t,r)=>{if(U(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];U(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return k(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:W,global:H,isContextDefined:V,isSpecCompliantForm:function(e){return!!(e&&U(e.append)&&"FormData"===e[O]&&e[S])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(D(e)){if(t.indexOf(e)>=0)return;if(C(e))return e;if(!("toJSON"in e)){t[n]=e;const s=k(e)?[]:{};return J(e,(e,t)=>{const o=r(e,n+1);!A(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:oe,isThenable:e=>e&&(D(e)||U(e))&&U(e.then)&&U(e.catch),setImmediate:ie,asap:ae,isIterable:e=>null!=e&&U(e[S])};function le(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}ce.inherits(le,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});var ue=le.prototype,he={};["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=>{he[e]={value:e}}),Object.defineProperties(le,he),Object.defineProperty(ue,"isAxiosError",{value:!0}),le.from=(e,t,r,n,s,o)=>{const i=Object.create(ue);ce.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return le.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};var de=le;function fe(e){return ce.isPlainObject(e)||ce.isArray(e)}function pe(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,r){return e?e.concat(t).map(function(e,t){return e=pe(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}var ye=ce.toFlatObject(ce,{},null,function(e){return/^is[A-Z]/.test(e)});var ge=function(e,t,r){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=ce.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ce.isUndefined(t[e])})).metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ce.isDate(e))return e.toISOString();if(ce.isBoolean(e))return e.toString();if(!a&&ce.isBlob(e))throw new de("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(e)||ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(ce.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(ce.isArray(e)&&function(e){return ce.isArray(e)&&!e.some(fe)}(e)||(ce.isFileList(e)||ce.endsWith(r,"[]"))&&(a=ce.toArray(e)))return r=pe(r),a.forEach(function(e,n){!ce.isUndefined(e)&&null!==e&&t.append(!0===i?me([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!fe(e)||(t.append(me(s,r,o),c(e)),!1)}const u=[],h=Object.assign(ye,{defaultVisitor:l,convertValue:c,isVisitable:fe});if(!ce.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!ce.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),ce.forEach(r,function(r,o){!0===(!(ce.isUndefined(r)||null===r)&&s.call(t,r,ce.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t};function we(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function be(e,t){this._pairs=[],e&&ge(e,this,t)}var ve=be.prototype;ve.append=function(e,t){this._pairs.push([e,t])},ve.toString=function(e){const t=e?function(t){return e.call(this,t,we)}:we;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var Ee=be;function Se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Oe(e,t,r){if(!t)return e;const n=r&&r.encode||Se;ce.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):ce.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}var Te=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ce.forEach(this.handlers,function(t){null!==t&&e(t)})}},Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ke=t({hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>je,hasStandardBrowserWebWorkerEnv:()=>_e,navigator:()=>Ce,origin:()=>Ue},1),Ae="undefined"!=typeof window&&"undefined"!=typeof document,Ce="object"==typeof navigator&&navigator||void 0,je=Ae&&(!Ce||["ReactNative","NativeScript","NS"].indexOf(Ce.product)<0),_e="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ue=Ae&&window.location.href||"http://localhost",Pe={...ke,...xe};var De=function(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;return o=!o&&ce.isArray(n)?n.length:o,a?(ce.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i):(n[o]&&ce.isObject(n[o])||(n[o]=[]),t(e,r,n[o],s)&&ce.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const r={};return ce.forEachEntry(e,(e,n)=>{t(function(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null};var Le={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=ce.isObject(e);if(s&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return n?JSON.stringify(De(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ge(e,new Pe.classes.URLSearchParams,{visitor:function(e,t,r,n){return Pe.isNode&&ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=ce.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ge(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,r){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Le.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(s){if(r){if("SyntaxError"===s.name)throw de.from(s,de.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pe.classes.FormData,Blob:Pe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{Le.headers[e]={}});var Ne=Le,Ie=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=Symbol("internals");function Fe(e){return e&&String(e).trim().toLowerCase()}function Be(e){return!1===e||null==e?e:ce.isArray(e)?e.map(Be):String(e)}function $e(e,t,r,n,s){return ce.isFunction(n)?n.call(this,t,r):(s&&(t=r),ce.isString(t)?ce.isString(n)?-1!==t.indexOf(n):ce.isRegExp(n)?n.test(t):void 0:void 0)}var qe=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Fe(t);if(!s)throw new Error("header name must be a non-empty string");const o=ce.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Be(e))}const o=(e,t)=>ce.forEach(e,(e,r)=>s(e,r,t));if(ce.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ce.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Ie[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(ce.isObject(e)&&ce.isIterable(e)){let r,n,s={};for(const t of e){if(!ce.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?ce.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Fe(e)){const r=ce.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(ce.isFunction(t))return t.call(this,e,r);if(ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Fe(e)){const r=ce.findKey(this,e);return!(!r||void 0===this[r]||t&&!$e(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Fe(e)){const s=ce.findKey(r,e);!s||t&&!$e(0,r[s],s,t)||(delete r[s],n=!0)}}return ce.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!$e(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return ce.forEach(this,(n,s)=>{const o=ce.findKey(r,s);if(o)return t[o]=Be(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=Be(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ce.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&ce.isArray(r)?r.join(", "):r)}),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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Fe(e);t[n]||(!function(e,t){const r=ce.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return ce.isArray(e)?e.forEach(n):n(e),this}};qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ce.reduceDescriptors(qe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),ce.freezeMethods(qe);var Ke=qe;function ze(e,t){const r=this||Ne,n=t||r,s=Ke.from(n.headers);let o=n.data;return ce.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Je(e){return!(!e||!e.__CANCEL__)}function We(e,t,r){de.call(this,null==e?"canceled":e,de.ERR_CANCELED,t,r),this.name="CanceledError"}ce.inherits(We,de,{__CANCEL__:!0});var He=We;function Ve(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new de("Request failed with status code "+r.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}var Xe=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[i];s||(s=c),r[o]=a,n[o]=c;let u=i,h=0;for(;u!==o;)h+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=l&&c-l;return d?Math.round(1e3*h/d):void 0}};var Qe=function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]};const Ge=(e,t,r=3)=>{let n=0;const s=Xe(50,250);return Qe(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o,e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},Ze=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ye=e=>(...t)=>ce.asap(()=>e(...t));var et,tt,rt=Pe.hasStandardBrowserEnv?(et=new URL(Pe.origin),tt=Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent),e=>(e=new URL(e,Pe.origin),et.protocol===e.protocol&&et.host===e.host&&(tt||et.port===e.port))):()=>!0,nt=Pe.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),ce.isString(n)&&a.push(`path=${n}`),ce.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),ce.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function st(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ot=e=>e instanceof Ke?{...e}:e;function it(e,t){t=t||{};const r={};function n(e,t,r,n){return ce.isPlainObject(e)&&ce.isPlainObject(t)?ce.merge.call({caseless:n},e,t):ce.isPlainObject(t)?ce.merge({},t):ce.isArray(t)?t.slice():t}function s(e,t,r,s){return ce.isUndefined(t)?ce.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!ce.isUndefined(t))return n(void 0,t)}function i(e,t){return ce.isUndefined(t)?ce.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,r)=>s(ot(e),ot(t),0,!0)};return ce.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);ce.isUndefined(i)&&o!==a||(r[n]=i)}),r}var at=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Ke.from(i),t.url=Oe(st(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ce.isFormData(r))if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(ce.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Pe.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(t)),n||!1!==n&&rt(t.url))){const e=s&&o&&nt.read(o);e&&i.set(s,e)}return t},ct="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=at(e);let s=n.data;const o=Ke.from(n.headers).normalize();let i,a,c,l,u,{responseType:h,onUploadProgress:d,onDownloadProgress:f}=n;function p(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;const n=Ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ve(function(e){t(e),p()},function(e){r(e),p()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(r(new de("Request aborted",de.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const n=new de(t&&t.message?t.message:"Network Error",de.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Re;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new de(t,s.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&ce.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),ce.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),h&&"json"!==h&&(m.responseType=n.responseType),f&&([c,u]=Ge(f,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ge(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new He(null,e,m):t),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Pe.protocols.indexOf(g)?r(new de("Unsupported protocol "+g+":",de.ERR_BAD_REQUEST,e)):m.send(s||null)})},lt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof de?t:new He(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>ce.asap(i),a}};const ut=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n};var ht=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}};const dt=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of ht(e))yield*ut(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;r&&r(i+=o),e.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:e=>(a(e),s.return())},{highWaterMark:2})};var{isFunction:ft}=ce,pt=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:mt,TextEncoder:yt}=ce.global,gt=(e,...t)=>{try{return!!e(...t)}catch(r){return!1}},wt=e=>{e=ce.merge.call({skipUndefined:!0},pt,e);const{fetch:t,Request:r,Response:n}=e,s=t?ft(t):"function"==typeof fetch,o=ft(r),i=ft(n);if(!s)return!1;const a=s&&ft(mt),c=s&&("function"==typeof yt?(l=new yt,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=o&&a&>(()=>{let e=!1;const t=new r(Pe.origin,{body:new mt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&>(()=>ce.isReadableStream(new n("").body)),d={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new de(`Response type '${e}' is not supported`,de.ERR_NOT_SUPPORT,r)})});const f=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:ce.isBlob(e)?e.size:ce.isSpecCompliantForm(e)?(await new r(Pe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength:ce.isArrayBufferView(e)||ce.isArrayBuffer(e)?e.byteLength:(ce.isURLSearchParams(e)&&(e+=""),ce.isString(e)?(await c(e)).byteLength:void 0))(t):n};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:y,responseType:g,headers:w,withCredentials:b="same-origin",fetchOptions:v}=at(e),E=t||fetch;g=g?(g+"").toLowerCase():"text";let S=lt([c,l&&l.toAbortSignal()],p),O=null;const T=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let R;try{if(y&&u&&"get"!==i&&"head"!==i&&0!==(R=await f(w,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(ce.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,r]=Ze(R,Ge(Ye(y)));a=dt(t.body,65536,e,r)}}ce.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in r.prototype,c={...v,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};O=o&&new r(s,c);let l=await(o?E(O,v):E(s,c));const p=h&&("stream"===g||"response"===g);if(h&&(m||p&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=ce.toFiniteNumber(l.headers.get("content-length")),[r,s]=m&&Ze(t,Ge(Ye(m),!0))||[];l=new n(dt(l.body,65536,r,()=>{s&&s(),T&&T()}),e)}g=g||"text";let x=await d[ce.findKey(d,g)||"text"](l,e);return!p&&T&&T(),await new Promise((t,r)=>{Ve(t,r,{data:x,headers:Ke.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:O})})}catch(x){if(T&&T(),x&&"TypeError"===x.name&&/Load failed|fetch/i.test(x.message))throw Object.assign(new de("Network Error",de.ERR_NETWORK,e,O),{cause:x.cause||x});throw de.from(x,x&&x.code,e,O)}}},bt=new Map;const vt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,l=bt;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:wt(t)),l=a;return a};vt();var Et={http:null,xhr:ct,fetch:{get:vt}};ce.forEach(Et,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var St=e=>`- ${e}`,Ot=e=>ce.isFunction(e)||null===e||!1===e;var Tt={getAdapter:function(e,t){e=ce.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Ot(n)&&(s=Et[(r=String(n)).toLowerCase()],void 0===s))throw new de(`Unknown adapter '${r}'`);if(s&&(ce.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new de("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(St).join("\n"):" "+St(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Et};function Rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new He(null,e)}function xt(e){return Rt(e),e.headers=Ke.from(e.headers),e.data=ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(e.adapter||Ne.adapter,e)(e).then(function(t){return Rt(e),t.data=ze.call(e,e.transformResponse,t),t.headers=Ke.from(t.headers),t},function(t){return Je(t)||(Rt(e),t&&t.response&&(t.response.data=ze.call(e,e.transformResponse,t.response),t.response.headers=Ke.from(t.response.headers))),Promise.reject(t)})}const kt="1.13.2";var At={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{At[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var Ct={};At.transitional=function(e,t,r){return(n,s,o)=>{if(!1===e)throw new de(function(e,t){return"[Axios v"+kt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(s," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!Ct[s]&&(Ct[s]=!0),!e||e(n,s,o)}},At.spelling=function(e){return(e,t)=>!0};var jt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new de("option "+o+" must be "+r,de.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}},validators:At},_t=jt.validators,Ut=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Te,response:new Te}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{r.stack?t&&!String(r.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+t):r.stack=t}catch(n){}}throw r}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=it(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&jt.assertOptions(r,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean)},!1),null!=n&&(ce.isFunction(n)?t.paramsSerializer={serialize:n}:jt.assertOptions(n,{encode:_t.function,serialize:_t.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),jt.assertOptions(t,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&ce.merge(s.common,s[t.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Ke.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[xt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=i.length;let d=t;for(;h<u;){const e=i[h++],t=i[h++];try{d=e(d)}catch(f){t.call(this,f);break}}try{l=xt.call(this,d)}catch(f){return Promise.reject(f)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return Oe(st((e=it(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(e){Ut.prototype[e]=function(t,r){return this.request(it(r||{},{method:e,url:t,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(it(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ut.prototype[e]=t(),Ut.prototype[e+"Form"]=t(!0)});var Pt=Ut,Dt=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 r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new He(e,n,s),t(r.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}}};var Lt={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(Lt).forEach(([e,t])=>{Lt[t]=e});var Nt=Lt;var It=function e(t){const r=new Pt(t),n=w(Pt.prototype.request,r);return ce.extend(n,Pt.prototype,r,{allOwnKeys:!0}),ce.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(it(t,r))},n}(Ne);It.Axios=Pt,It.CanceledError=He,It.CancelToken=Dt,It.isCancel=Je,It.VERSION=kt,It.toFormData=ge,It.AxiosError=de,It.Cancel=It.CanceledError,It.all=function(e){return Promise.all(e)},It.spread=function(e){return function(t){return e.apply(null,t)}},It.isAxiosError=function(e){return ce.isObject(e)&&!0===e.isAxiosError},It.mergeConfig=it,It.AxiosHeaders=Ke,It.formToJSON=e=>De(ce.isHTMLForm(e)?new FormData(e):e),It.getAdapter=Tt.getAdapter,It.HttpStatusCode=Nt,It.default=It;var Mt=It;function Ft(e,t){const r=document.createElement("a");r.style.visibility="hidden",r.href=URL.createObjectURL(e),r.download=t,r.type=e.type,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Bt=null,$t=null;var qt=class{constructor(){}static success(e="",t=""){}static info(e="",t=""){}static warn(e="",t=""){}static danger(e="",t=""){}static error(e="",t=""){}};const Kt={String:"string",Number:"number",Boolean:"boolean",Json:"json",Null:"null"};var zt=class{constructor(e){this.structure=[],this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data"},this.notError=!1,this.inited=!1,this.data=[],this.name=e.name,this.db=e.db,this.structure=e.structure,this.service=e.service,this.keyMap=e?.keyMap??this.keyMap,this.open()}get structureMap(){return this.structure.reduce((e,t)=>(e[t.name]=t,e),{})}async open(){this.validate(),this.extractPrimaryKey()}close(){this.structure=[]}validate(){if(!this.name)throw new Error("表名称不能为空");if(!this.structure)throw new Error(`表 ${this.name} 的结构未定义`);const e=this.structure.filter(e=>e.primaryKey);if(e.length>1)throw new Error(`表 ${this.name} 只能有一个主键,但找到了 ${e.length} 个, 分别是: ${e.map(e=>e.name).join(", ")}`);for(const t of this.structure){if(!t.name)throw new Error(`表 ${this.name} 的某个字段名称不能为空`);if(!Kt[t.type])throw new Error(`表 ${this.name} 的字段 ${t.name} 的类型 ${t.type} 无效`)}this.notError=!0}extractPrimaryKey(){this.primaryKey=this.structure.find(e=>e.primaryKey)?.name}updateStructure(e){this.structure=e,this.notError=!1,this.validate()}async fetchAsyncData(){const e=await(this.service?.queryTable(this.db,this.name));e&&(this.inited=!0,this.id=e?.[this.keyMap?.id],this.data=e?.[this.keyMap?.config_data]??[])}async getData(e=!1){return!e&&this.inited||await this.fetchAsyncData(),this.data}};const Jt=["=",">","<",">=","<=","!=","like"];var Wt=class{constructor(e){this.steps=[],this._run=e}start(){const e={collect:{select:void 0,insertInto:void 0,update:void 0,replaceInto:void 0,delete:void 0,from:void 0,where:void 0,limit:void 0},sentence:{DML:void 0}};return this.steps.push(e),this.currentStep=e,this}run(){return this._run(this)}validate(e,t,r){const n=this.currentStep;if(n?.collect?.[e])return n.error=`当前步骤已存在「${e}」操作,无法重复操作,请先调用start()重置「Action」再进行操作`,qt.error("Action",n.error),!n.error;for(let s=0;s<(t?.length||0);s++){const r=t[s];if(n?.collect?.[r])break;if(s===(t?.length||0)-1)return n.error=`${e}操作缺少必要的依赖关系,请先进行「${t.join("/")}」操作`,qt.error("Action",n.error),!n?.error}for(let s=0;s<(r?.length||0);s++){const t=r[s];if(n?.collect?.[t])return n.error=`「${e}」操作与「${t}」操作冲突,请只保留其中一个操作重试`,qt.error("Action",n.error),!n.error}return!n.error}select(e){return this.validate("select",[],["insertInto","update","delete","replaceInto"])?(this.currentStep.collect.select=e,this.currentStep.sentence.DML="select",this):this}insertInto(e,t,r){return this.validate("insertInto",[],["select","update","delete","replaceInto"])?(this.currentStep.collect.insertInto={table:e,fields:t,values:r},this.currentStep.sentence.DML="insertInto",this):this}update(e,t,r){return this.validate("update",[],["select","insertInto","delete","replaceInto"])?(this.currentStep.collect.update={table:e,fields:t,values:r},this.currentStep.sentence.DML="update",this):this}replaceInto(e,t,r){return this.validate("replaceInto",[],["select","insertInto","update","delete"])?(this.currentStep.collect.replaceInto={table:e,fields:t,values:r},this.currentStep.sentence.DML="replaceInto",this):this}delete(){return this.validate("delete",[],["select","insertInto","update","replaceInto","limit"])?(this.currentStep.collect.delete=!0,this.currentStep.sentence.DML="delete",this):this}from(e){return this.validate("from",["select","insertInto","update","delete","replaceInto"])?(this.currentStep.collect.from=e,this):this}where(e,t="AND"){if(!this.validate("where",[],["insertInto","replaceInto"]))return this;if(!e?.length)return this;const r=this.currentStep,n={segments:[],relationship:t};for(let s=0;s<e.length;s++){const t=e[s],[o,i,a]=t?.split(" ").map(e=>e.trim());if(!o||!i||void 0===a)throw r.error=`条件语句 "${t}" 格式错误,请使用 "字段 操作符 值" 的格式`,new Error(r.error);if(!Jt.includes(i))throw r.error=`条件语句 "${t}" 中的操作符 "${i}" 不受支持,请使用 ${Jt.join(", ")} 之一`,new Error(r.error);let c;if(a.startsWith("'")&&a.endsWith("'"))c=a.slice(1,-1);else if(isNaN(Number(a)))if("true"===a.toLowerCase()||"false"===a.toLowerCase())c="true"===a.toLowerCase();else{if(isNaN(Date.parse(a)))throw r.error=`条件语句 "${t}" 中的值 "${a}" 格式错误,无法解析为字符串、数字、布尔值或日期`,new Error(r.error);c=new Date(a)}else c=Number(a);n.segments.push({leftField:o,operator:i,rightValue:c})}return this.currentStep.collect.where=n,this}limit(e){return this.validate("limit",["select"],["insertInto","update","delete","replaceInto"])?(this.currentStep.collect.limit=e,this):this}},Ht=class{get execution(){return window.structuredClone(this.__executions?.[this.__executions?.length-1])}get result(){return this.__executions?.[this.__executions?.length-1]?.result}constructor(e){this.tables=new Map,this.locks=new Map,this.views=new Map,this.name="",this.closed=!1,this.name=e.name,this.service=e.service,this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data",...e?.keyMap||{}}}open(){this.closed=!1}close(){this.closed?qt.error("校验失败",`数据库 ${this.name} 已经关闭,无需重复关闭.`):(delete this.service,delete this.__executions,this.tables.forEach(e=>e.close()),this.tables.clear(),this.locks.forEach(e=>e.close()),this.locks.clear(),this.views.forEach(e=>e.close()),this.views.clear(),this.closed=!0)}useTable(e,t){return this.tables.has(e)||this.tables.set(e,new zt({name:e,db:this.name,structure:t||[],service:this.service,keyMap:this.keyMap})),this.tables.get(e)}createErrorReturn(e){return{error:e.error||""}}start(){return new Wt(this.run.bind(this)).start()}async run(e){const t=[];for(let n=0;n<e.steps.length;n++){const s=e.steps[n];if(s?.error){t.push(this.createErrorReturn(s));continue}if(!s?.sentence.DML){s.error="当前步骤没有明确的DML操作,无法执行,请先执行DML操作 (select/insertInto/update/replaceInto/delete)",t.push(this.createErrorReturn(s));continue}const o=s.collect?.from||(s.collect?.[s.sentence.DML])?.table,i=this.tables.get(o);if(!i||!i?.notError){s.error=`表 ${o} 不存在或错误,请先检查表.`,qt.error("校验失败",s.error),t.push(this.createErrorReturn(s));continue}const a=0===n?await(i?.getData()):window.structuredClone(t?.[n-1]?.result||[]),c=window.structuredClone(a),l={id:i?.id,DML:s.sentence.DML,where:s.collect.where,limit:s.collect.limit||0,from:o,rawData:a,result:[]};t.push(l);try{switch(s.sentence.DML){case"select":l.result=this.runOnSelect(c,i,s);break;case"insertInto":l.result=this.runOnInsertInto(c,i,s);break;case"update":l.result=this.runOnUpdate(c,i,s);break;case"replaceInto":l.result=this.runOnReplaceInto(c,i,s);break;case"delete":l.result=this.runOnDelete(c,i,s)}}catch(r){s.error=r?.message,qt.error("run 任务执行失败",s.error),t.push(this.createErrorReturn(s))}}return this.__executions=t,{acs:t,result:t?.[t.length-1]?.result||[],fetch:this.fetch.bind(this)}}validateTableStructure(e,t){if(t.includes("*"))return!0;const r=e.structureMap;for(let n=0;n<t.length;n++){const e=t[n];if(!r[e])return qt.error("Table Structure",`表结构中不存在字段「${e}」,请检查表结构定义或查询字段是否正确`),!1}return!0}runOnSelect(e,t,r){if(!this.validateTableStructure(t,r?.collect.select||[]))throw new Error("表结构验证失败");if(!e?.length)return[];r?.collect.where&&(e=this.applicationConditions(e,r.collect.where));let n=[...e];return r?.collect?.select?.includes("*")||(n=e?.map(e=>{const t={};return(r?.collect.select||[]).forEach(r=>{t[r]=e[r]}),t})),Number(r?.collect?.limit)>0?n?.slice(0,r?.collect.limit):n||[]}generateRow(e,t){if(!["insertInto","replaceInto"].includes(t?.sentence?.DML))return void qt.error("generateRow",`当前操作 ${t?.sentence?.DML} 不支持生成数据行,请检查 SQL 语句`);const r=t?.collect?.[t?.sentence?.DML];let n={};return r?.fields.forEach((e,t)=>{n[e]=r?.values[t]}),Object.keys(e.structureMap).forEach(t=>{if(void 0===n[t]){const r=e.structureMap[t];"function"==typeof r.default?n[t]=r.default():n[t]=r.default}}),n}runOnInsertInto(e,t,r){if(!this.validateTableStructure(t,r?.collect.insertInto?.fields||[]))throw new Error("表结构验证失败");if(r?.collect.insertInto?.fields.length!==r?.collect.insertInto?.values.length)throw new Error("插入数据的字段数量与值数量不匹配");const n=this.generateRow(t,r);return n&&e.push(n),e}runOnUpdate(e,t,r){if(!this.validateTableStructure(t,r?.collect.update?.fields||[]))throw new Error("表结构验证失败");return this.applicationConditions(e,r?.collect.where).forEach(e=>{r?.collect.update?.fields.forEach((t,n)=>{e[t]=r?.collect.update?.values[n]})}),e}runOnReplaceInto(e,t,r){if(!this.validateTableStructure(t,r?.collect.replaceInto?.fields||[]))throw new Error("表结构验证失败");if(r?.collect.replaceInto?.fields.length!==r?.collect.replaceInto?.values.length)throw new Error("插入数据的字段数量与值数量不匹配");if(!t?.primaryKey)throw new Error(`表 ${t.name} 没有定义主键,无法执行 replaceInto 操作,请检查表结构定义`);const n=r?.collect?.replaceInto?.fields?.findIndex(e=>e===t.primaryKey),s=r?.collect?.replaceInto?.values?.[n],o=e.findIndex(e=>e[t.primaryKey]===s),i=-1!==o?window.structuredClone(e.splice(o,1)[0]):void 0;if(i)r?.collect.replaceInto?.fields.forEach((e,t)=>{i[e]=r?.collect.replaceInto?.values[t]}),e.push(i);else{const n=this.generateRow(t,r);n&&e.push(n)}return e}runOnDelete(e,t,r){if(!r?.collect?.where)return[];if(!e?.length)throw new Error(`表 ${t.name} 为空,无法执行 delete 操作,请检查表数据`);return this.applicationConditions(e,r?.collect?.where).forEach(t=>{const r=e.indexOf(t);-1!==r&&e.splice(r,1)}),e}applicationConditions(e,t){if(!t||!t.segments.length)return e;const r=new Set;return"AND"===t?.relationship&&e?.forEach(e=>r.add(e)),t?.segments?.forEach(n=>{if("AND"===t?.relationship){const e=Array.from(r);r.clear(),e.filter(e=>this.isConditionPass(e,n)&&r.add(e))}else"OR"===t?.relationship&&e?.forEach(e=>this.isConditionPass(e,n)&&r.add(e))}),Array.from(r)}isConditionPass(e,t){if(void 0===e[t.leftField])return!1;switch(t.operator){case"=":return e[t.leftField]===t.rightValue;case">":return e[t.leftField]>t.rightValue;case"<":return e[t.leftField]<t.rightValue;case">=":return e[t.leftField]>=t.rightValue;case"<=":return e[t.leftField]<=t.rightValue;case"!=":return e[t.leftField]!==t.rightValue;case"like":return"string"==typeof e[t.leftField]&&"string"==typeof t.rightValue&&new RegExp("^"+t.rightValue.replace(/%/g,".*").replace(/_/g,".")+"$").test(e[t.leftField]);default:return!1}}async fetch(){const e=this.execution;if(!e)return qt.error("fetch 失败","没有可用的执行结果,请确保已经执行了 SQL 语句并且有结果返回."),!1;const t=e.from,r=this.tables.get(t);if(!r)return qt.error("fetch 失败",`表 ${t} 不存在,请检查 SQL 语句中的表名是否正确.`),!1;if(!r?.id){const e=!!(await(this.service?.createTable(this.name,this.execution?.from,this.execution?.result)));return await(r?.getData(!0)),e}switch(e.DML){case"insertInto":return!!(await(this.service?.createTable(this.name,e?.from,e.result)));case"delete":return e?.result?.length?!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result))):!!(await(this.service?.deleteTable(this.name,e?.from,r.id)));case"update":return!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result)));case"replaceInto":return e?.result?.length?!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result))):!!(await(this.service?.createTable(this.name,e?.from,e.result)));case"select":return!0;default:return!1}}},Vt=class{constructor(e){this.urls=e.urls,this.authToken=e.authToken||"",this.identifier=e.identifier||"",this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data",...e?.keyMap||{}}}globalParams(e,t){return{[this.keyMap.config_type]:e,[this.keyMap.config_name]:this.identifier?`${t}|${this.identifier}`:t}}async fetch(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:this.authToken},body:JSON.stringify(t)});if(!r.ok)throw new Error(`指令执行失败. 响应码: ${r.status}, 响应消息: ${r.statusText}`);const n=await r.json();if(200!==n.code)throw new Error(`指令执行失败. 响应码: ${n.code}, 响应消息: ${n.message}`);return n.data}async createTable(e,t,r){try{return await this.fetch(this.urls.create,{...this.globalParams(e,t),[this.keyMap.config_data]:JSON.stringify(r)}),!0}catch(n){return!1}}async updateTable(e,t,r,n){try{return await this.fetch(this.urls.update,{...this.globalParams(e,t),[this.keyMap.id]:r,[this.keyMap.config_data]:JSON.stringify(n)}),!0}catch(s){return!1}}async deleteTable(e,t,r){try{return await this.fetch(this.urls.delete,{...this.globalParams(e,t),[this.keyMap.id]:r}),!0}catch(n){return!1}}async queryTable(e,t){return(await this.fetch(this.urls.query,{...this.globalParams(e,t)}))?.[0]}};exports.Database=Ht,exports.ExcelController=class{constructor(){this.sheets=[]}get sheetsMap(){return this.sheets.reduce((e,t)=>(e[t.id]=t,e),{})}addSheet(e){const t={id:`sheet-${window.crypto.randomUUID()}-${Date.now()}`,...e};return this.sheets.push(t),t}removeSheet(e){return this.sheetsMap?.[e]&&this.sheets.splice(this.sheets.indexOf(this.sheetsMap[e]),1)?.[0]||null}getSheet(e){return this.sheetsMap?.[e]||null}updateSheetName(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].name=t)}updateSheetStruct(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].struct=t)}updateSheetData(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].data=t)}injectSheet(e,t){if(!t?.struct)throw new Error(`${t.name} 表结构未定义`);const r=e.addWorksheet(t.name);r.columns=t?.struct,t?.data?.forEach(e=>{r.addRow(e)})}exportExcel(){const e=new n.Workbook;for(const t of this.sheets)this.injectSheet(e,t);return e.xlsx.writeBuffer()}exportSheet(e){if(!this.sheetsMap?.[e])throw new Error(`id为「${e}」的表不存在`);const t=new n.Workbook;return this.injectSheet(t,this.sheetsMap?.[e]),t.xlsx.writeBuffer()}async downloadExcel(e){const t=await this.exportExcel();Ft(new Blob([new Uint8Array(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),e)}async downloadSheet(e,t){const r=await this.exportSheet(e);Ft(new Blob([new Uint8Array(r)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),t)}},exports.IntegratedDb=class{constructor(e){this.databases=new Map,this.validateConfig(e),this.config=e,this.service=new Vt({urls:e.link.url,authToken:e.link.authToken,keyMap:e.fetchKeyMap,identifier:e.identifier})}validateConfig(e){if(!e.link?.url)throw new Error("IntegratedDb必须配置连接地址,请查看配置项中「link.url」是否为空");e.link?.authToken||qt.warn("IntegratedDb","未传入「link.authToken」参数,连接存在无安全校验风险,请添加「link.authToken」以消除该警告")}openDb(e){return this.databases.has(e)||this.databases.set(e,new Ht({name:e,service:this.service,keyMap:this.config.fetchKeyMap})),this.databases.get(e)?.open(),this.databases.get(e)}closeDb(e){if(void 0===e)return this.databases.forEach(e=>e.close()),void this.databases.clear();this.databases.has(e)?(this.databases.get(e)?.close(),this.databases.delete(e)):qt.warn("IntegratedDb",`尝试关闭数据库「${e}」,但该数据库未打开或已关闭,请检查数据库名称是否正确`)}},exports.Service=Vt,exports.copyText=async function(e,t){return Boolean(t?s(e):async function(e){try{return await(navigator?.clipboard?.writeText?.(e)),!0}catch(t){return s(e)}}(e))},exports.deleteUrlParams=function(e,t=!0){const r=new URLSearchParams(location.search);r?.delete(e);const n=r.toString();t&&history.replaceState(history.state,"",`${location.pathname}${n?`?${n}`:""}`)},exports.downloadBlob=Ft,exports.downloadFile=function(e,t){return new Promise(r=>{fetch(e).then(e=>e.blob()).then(e=>{const n=document.createElement("a"),s=t?.name;n.href=URL.createObjectURL(e),n.download=s,n.click(),n.remove(),URL.revokeObjectURL(n.href),r(!0)}).catch(e=>{r(!1)})})},exports.downloadFilesAsZip=async function(e,t="archive.zip"){await async function(){return Bt||(Bt=(await import("jszip")).default),Bt}(),await async function(){if(!$t){const e=await import("file-saver");$t={saveAs:e.saveAs||e.default||e.default?.saveAs}}return $t}();const r=new Bt,n=[],s={},o=e=>{if(s[e]){s[e]++;const t=e.lastIndexOf(".");return-1!==t?`${e.substring(0,t)}(${s[e]})${e.substring(t)}`:`${e}(${s[e]})`}return s[e]=1,e};for(const a of e)if("string"==typeof a){const e=a,t=o(e.substring(e.lastIndexOf("/")+1)||"unknown_file");n.push(Mt.get(e,{responseType:"blob"}).then(e=>{r.file(t,e.data)}).catch(e=>{r.file(`${t}.error.txt`,`Download failed: ${e.message}`)}))}else{const{name:e,url:t,data:s,folder:i}=a,c=o(e),l=i?r.folder(i):r;if(!l)continue;void 0!==s?l.file(c,s):t&&n.push(Mt.get(t,{responseType:"blob"}).then(e=>{l.file(c,e.data)}).catch(e=>{l.file(`${c}.error.txt`,`Download failed: ${e.message}`)}))}await Promise.all(n);const i=await r.generateAsync({type:"blob"});i&&$t?.saveAs(i,t)},exports.getFilenameWithoutExtension=function(e){const t=e.match(/\/([^\/]+)\.[\w]+$/);return t&&t[1]?t[1]:""},exports.getOsser=function(){return d},exports.getUrlParams=function(e){return new URLSearchParams(location.search)?.get(e)||""},exports.initUploadOss=async function(e,t,r,n){return await async function(){o=(await import("ali-oss")).default}(),!!o&&(h=n,"string"==typeof e?await async function(e,t,r){i=e||i,c=t||c,a=r||a;const n=await m();return!!n&&(y(n),!0)}(e,t,r):(f.refreshSTSTokenInterval=9999999,y(e),!0))},exports.ossConfiguration=p,exports.setUrlParams=function(e,t,r=!0){const n=new URLSearchParams(location.search);void 0!==n.get(e)?n.set(e,t):n.append(e,t);const s=n.toString();return r&&history.replaceState(history.state,"",`${location.pathname}?${s}`),n.toString()},exports.sleep=function(e){return new Promise(t=>setTimeout(t,e))},exports.uploadFileToOss=g,exports.uploadFilesToOss=async function(e,t){const r=e.map(e=>g(e,t));return await Promise.all(r)},exports.uuid=function(){return`${window.crypto.randomUUID()}-${Date.now()}`};
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=Object.defineProperty,t=(t,r)=>{let n={};for(var s in t)e(n,s,{get:t[s],enumerable:!0});return r&&e(n,Symbol.toStringTag,{value:"Module"}),n};let r=require("element-plus"),n=require("exceljs");function s(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{if(document.execCommand("copy"))return!0}catch(r){return!1}document.body.removeChild(t)}var o=null,i="",a={},c={},l="",u="",h=void 0,d=null,f={accessKeyId:"",accessKeySecret:"",stsToken:"",region:"",bucket:"",refreshSTSTokenInterval:9999999};const p=new Proxy(f,{get:(e,t)=>e[t],set:()=>!1});async function m(){const e=await(await fetch(i,{headers:new Headers({"Content-Type":"application/json",...a||{}}),body:JSON.stringify(c||{}),method:"POST",credentials:"include"})).json();return e?.data?.accessKeySecret&&e?.data?.securityToken?e?.data:null}function y(e){f.accessKeyId=e.accessKeyId||f.accessKeyId,f.accessKeySecret=e.accessKeySecret||f.accessKeySecret,f.stsToken=e.securityToken||f.stsToken,f.region=e.region||f.region,f.bucket=e.bucket||f.bucket,l=e.accessUrl||l,u=e.uploadUrl||u,f.refreshSTSTokenInterval=(0,r.dayjs)(e.expiration).diff((0,r.dayjs)(),"millisecond"),f.refreshSTSToken=h||(async()=>{const e=await m();return f.refreshSTSTokenInterval=(0,r.dayjs)(e?.expiration).diff((0,r.dayjs)(),"millisecond"),{accessKeyId:e?.accessKeyId||"",accessKeySecret:e?.accessKeySecret||"",stsToken:e?.securityToken||""}}),d=new o(f)}async function g(e,t){const r=await d.put(`${t}/${e.name}`,e,{timeout:(new Date).getTime()+18e4});return r.name=r.name?.split("/").pop()||e.name,"https:"===window.location.protocol&&(r.url=r.url.replace("http://","https://")),l&&u&&(r.url=r.url.replace(l,u)),r}function w(e,t){return function(){return e.apply(t,arguments)}}var b,{toString:v}=Object.prototype,{getPrototypeOf:E}=Object,{iterator:S,toStringTag:O}=Symbol,T=(b=Object.create(null),e=>{const t=v.call(e);return b[t]||(b[t]=t.slice(8,-1).toLowerCase())}),R=e=>(e=e.toLowerCase(),t=>T(t)===e),x=e=>t=>typeof t===e,{isArray:k}=Array,A=x("undefined");function C(e){return null!==e&&!A(e)&&null!==e.constructor&&!A(e.constructor)&&U(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var j=R("ArrayBuffer");var _=x("string"),U=x("function"),P=x("number"),D=e=>null!==e&&"object"==typeof e,L=e=>{if("object"!==T(e))return!1;const t=E(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||O in e||S in e)},N=R("Date"),I=R("File"),M=R("Blob"),F=R("FileList"),B=R("URLSearchParams"),[$,q,K,z]=["ReadableStream","Request","Response","Headers"].map(R);function J(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),k(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(C(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function W(e,t){if(C(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}var H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,V=e=>!A(e)&&e!==H;var X,Q=(X="undefined"!=typeof Uint8Array&&E(Uint8Array),e=>X&&e instanceof X),G=R("HTMLFormElement"),Z=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Y=R("RegExp"),ee=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};J(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)};var te,re,ne,se,oe=R("AsyncFunction"),ie=(te="function"==typeof setImmediate,re=U(H.postMessage),te?setImmediate:re?(ne=`axios@${Math.random()}`,se=[],H.addEventListener("message",({source:e,data:t})=>{e===H&&t===ne&&se.length&&se.shift()()},!1),e=>{se.push(e),H.postMessage(ne,"*")}):e=>setTimeout(e)),ae="undefined"!=typeof queueMicrotask?queueMicrotask.bind(H):"undefined"!=typeof process&&process.nextTick||ie,ce={isArray:k,isArrayBuffer:j,isBuffer:C,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||U(e.append)&&("formdata"===(t=T(e))||"object"===t&&U(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:P,isBoolean:e=>!0===e||!1===e,isObject:D,isPlainObject:L,isEmptyObject:e=>{if(!D(e)||C(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(t){return!1}},isReadableStream:$,isRequest:q,isResponse:K,isHeaders:z,isUndefined:A,isDate:N,isFile:I,isBlob:M,isRegExp:Y,isFunction:U,isStream:e=>D(e)&&U(e.pipe),isURLSearchParams:B,isTypedArray:Q,isFileList:F,forEach:J,merge:function e(){const{caseless:t,skipUndefined:r}=V(this)&&this||{},n={},s=(s,o)=>{const i=t&&W(n,o)||o;L(n[i])&&L(s)?n[i]=e(n[i],s):L(s)?n[i]=e({},s):k(s)?n[i]=s.slice():r&&A(s)||(n[i]=s)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&J(arguments[o],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(J(t,(t,n)=>{r&&U(t)?e[n]=w(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&E(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:T,kindOfTest:R,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(k(e))return e;let t=e.length;if(!P(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[S]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:G,hasOwnProperty:Z,hasOwnProp:Z,reduceDescriptors:ee,freezeMethods:e=>{ee(e,(t,r)=>{if(U(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];U(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return k(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:W,global:H,isContextDefined:V,isSpecCompliantForm:function(e){return!!(e&&U(e.append)&&"FormData"===e[O]&&e[S])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(D(e)){if(t.indexOf(e)>=0)return;if(C(e))return e;if(!("toJSON"in e)){t[n]=e;const s=k(e)?[]:{};return J(e,(e,t)=>{const o=r(e,n+1);!A(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:oe,isThenable:e=>e&&(D(e)||U(e))&&U(e.then)&&U(e.catch),setImmediate:ie,asap:ae,isIterable:e=>null!=e&&U(e[S])};function le(e,t,r,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}ce.inherits(le,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});var ue=le.prototype,he={};["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=>{he[e]={value:e}}),Object.defineProperties(le,he),Object.defineProperty(ue,"isAxiosError",{value:!0}),le.from=(e,t,r,n,s,o)=>{const i=Object.create(ue);ce.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return le.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};var de=le;function fe(e){return ce.isPlainObject(e)||ce.isArray(e)}function pe(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,r){return e?e.concat(t).map(function(e,t){return e=pe(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}var ye=ce.toFlatObject(ce,{},null,function(e){return/^is[A-Z]/.test(e)});var ge=function(e,t,r){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=ce.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ce.isUndefined(t[e])})).metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ce.isDate(e))return e.toISOString();if(ce.isBoolean(e))return e.toString();if(!a&&ce.isBlob(e))throw new de("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(e)||ce.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(ce.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(ce.isArray(e)&&function(e){return ce.isArray(e)&&!e.some(fe)}(e)||(ce.isFileList(e)||ce.endsWith(r,"[]"))&&(a=ce.toArray(e)))return r=pe(r),a.forEach(function(e,n){!ce.isUndefined(e)&&null!==e&&t.append(!0===i?me([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!fe(e)||(t.append(me(s,r,o),c(e)),!1)}const u=[],h=Object.assign(ye,{defaultVisitor:l,convertValue:c,isVisitable:fe});if(!ce.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!ce.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),ce.forEach(r,function(r,o){!0===(!(ce.isUndefined(r)||null===r)&&s.call(t,r,ce.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])}),u.pop()}}(e),t};function we(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function be(e,t){this._pairs=[],e&&ge(e,this,t)}var ve=be.prototype;ve.append=function(e,t){this._pairs.push([e,t])},ve.toString=function(e){const t=e?function(t){return e.call(this,t,we)}:we;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var Ee=be;function Se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Oe(e,t,r){if(!t)return e;const n=r&&r.encode||Se;ce.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):ce.isURLSearchParams(t)?t.toString():new Ee(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}var Te=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ce.forEach(this.handlers,function(t){null!==t&&e(t)})}},Re={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ke=t({hasBrowserEnv:()=>Ae,hasStandardBrowserEnv:()=>je,hasStandardBrowserWebWorkerEnv:()=>_e,navigator:()=>Ce,origin:()=>Ue},1),Ae="undefined"!=typeof window&&"undefined"!=typeof document,Ce="object"==typeof navigator&&navigator||void 0,je=Ae&&(!Ce||["ReactNative","NativeScript","NS"].indexOf(Ce.product)<0),_e="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ue=Ae&&window.location.href||"http://localhost",Pe={...ke,...xe};var De=function(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;return o=!o&&ce.isArray(n)?n.length:o,a?(ce.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i):(n[o]&&ce.isObject(n[o])||(n[o]=[]),t(e,r,n[o],s)&&ce.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const r={};return ce.forEachEntry(e,(e,n)=>{t(function(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null};var Le={transitional:Re,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=ce.isObject(e);if(s&&ce.isHTMLForm(e)&&(e=new FormData(e)),ce.isFormData(e))return n?JSON.stringify(De(e)):e;if(ce.isArrayBuffer(e)||ce.isBuffer(e)||ce.isStream(e)||ce.isFile(e)||ce.isBlob(e)||ce.isReadableStream(e))return e;if(ce.isArrayBufferView(e))return e.buffer;if(ce.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ge(e,new Pe.classes.URLSearchParams,{visitor:function(e,t,r,n){return Pe.isNode&&ce.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=ce.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ge(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,r){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Le.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(ce.isResponse(e)||ce.isReadableStream(e))return e;if(e&&ce.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(s){if(r){if("SyntaxError"===s.name)throw de.from(s,de.ERR_BAD_RESPONSE,this,null,this.response);throw s}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pe.classes.FormData,Blob:Pe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{Le.headers[e]={}});var Ne=Le,Ie=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Me=Symbol("internals");function Fe(e){return e&&String(e).trim().toLowerCase()}function Be(e){return!1===e||null==e?e:ce.isArray(e)?e.map(Be):String(e)}function $e(e,t,r,n,s){return ce.isFunction(n)?n.call(this,t,r):(s&&(t=r),ce.isString(t)?ce.isString(n)?-1!==t.indexOf(n):ce.isRegExp(n)?n.test(t):void 0:void 0)}var qe=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Fe(t);if(!s)throw new Error("header name must be a non-empty string");const o=ce.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=Be(e))}const o=(e,t)=>ce.forEach(e,(e,r)=>s(e,r,t));if(ce.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ce.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Ie[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(ce.isObject(e)&&ce.isIterable(e)){let r,n,s={};for(const t of e){if(!ce.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?ce.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Fe(e)){const r=ce.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(ce.isFunction(t))return t.call(this,e,r);if(ce.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Fe(e)){const r=ce.findKey(this,e);return!(!r||void 0===this[r]||t&&!$e(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Fe(e)){const s=ce.findKey(r,e);!s||t&&!$e(0,r[s],s,t)||(delete r[s],n=!0)}}return ce.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!$e(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return ce.forEach(this,(n,s)=>{const o=ce.findKey(r,s);if(o)return t[o]=Be(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=Be(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ce.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&ce.isArray(r)?r.join(", "):r)}),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 r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Me]=this[Me]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Fe(e);t[n]||(!function(e,t){const r=ce.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return ce.isArray(e)?e.forEach(n):n(e),this}};qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ce.reduceDescriptors(qe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),ce.freezeMethods(qe);var Ke=qe;function ze(e,t){const r=this||Ne,n=t||r,s=Ke.from(n.headers);let o=n.data;return ce.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Je(e){return!(!e||!e.__CANCEL__)}function We(e,t,r){de.call(this,null==e?"canceled":e,de.ERR_CANCELED,t,r),this.name="CanceledError"}ce.inherits(We,de,{__CANCEL__:!0});var He=We;function Ve(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new de("Request failed with status code "+r.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}var Xe=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[i];s||(s=c),r[o]=a,n[o]=c;let u=i,h=0;for(;u!==o;)h+=r[u++],u%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=l&&c-l;return d?Math.round(1e3*h/d):void 0}};var Qe=function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]};const Ge=(e,t,r=3)=>{let n=0;const s=Xe(50,250);return Qe(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o,e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},Ze=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ye=e=>(...t)=>ce.asap(()=>e(...t));var et,tt,rt=Pe.hasStandardBrowserEnv?(et=new URL(Pe.origin),tt=Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent),e=>(e=new URL(e,Pe.origin),et.protocol===e.protocol&&et.host===e.host&&(tt||et.port===e.port))):()=>!0,nt=Pe.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),ce.isString(n)&&a.push(`path=${n}`),ce.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),ce.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function st(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ot=e=>e instanceof Ke?{...e}:e;function it(e,t){t=t||{};const r={};function n(e,t,r,n){return ce.isPlainObject(e)&&ce.isPlainObject(t)?ce.merge.call({caseless:n},e,t):ce.isPlainObject(t)?ce.merge({},t):ce.isArray(t)?t.slice():t}function s(e,t,r,s){return ce.isUndefined(t)?ce.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!ce.isUndefined(t))return n(void 0,t)}function i(e,t){return ce.isUndefined(t)?ce.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,r)=>s(ot(e),ot(t),0,!0)};return ce.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);ce.isUndefined(i)&&o!==a||(r[n]=i)}),r}var at=e=>{const t=it({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=Ke.from(i),t.url=Oe(st(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ce.isFormData(r))if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(ce.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Pe.hasStandardBrowserEnv&&(n&&ce.isFunction(n)&&(n=n(t)),n||!1!==n&&rt(t.url))){const e=s&&o&&nt.read(o);e&&i.set(s,e)}return t},ct="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=at(e);let s=n.data;const o=Ke.from(n.headers).normalize();let i,a,c,l,u,{responseType:h,onUploadProgress:d,onDownloadProgress:f}=n;function p(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;const n=Ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ve(function(e){t(e),p()},function(e){r(e),p()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(r(new de("Request aborted",de.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const n=new de(t&&t.message?t.message:"Network Error",de.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Re;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new de(t,s.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&ce.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),ce.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),h&&"json"!==h&&(m.responseType=n.responseType),f&&([c,u]=Ge(f,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ge(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new He(null,e,m):t),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===Pe.protocols.indexOf(g)?r(new de("Unsupported protocol "+g+":",de.ERR_BAD_REQUEST,e)):m.send(s||null)})},lt=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof de?t:new He(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>ce.asap(i),a}};const ut=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n};var ht=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}};const dt=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of ht(e))yield*ut(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;r&&r(i+=o),e.enqueue(new Uint8Array(n))}catch(t){throw a(t),t}},cancel:e=>(a(e),s.return())},{highWaterMark:2})};var{isFunction:ft}=ce,pt=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:mt,TextEncoder:yt}=ce.global,gt=(e,...t)=>{try{return!!e(...t)}catch(r){return!1}},wt=e=>{e=ce.merge.call({skipUndefined:!0},pt,e);const{fetch:t,Request:r,Response:n}=e,s=t?ft(t):"function"==typeof fetch,o=ft(r),i=ft(n);if(!s)return!1;const a=s&&ft(mt),c=s&&("function"==typeof yt?(l=new yt,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=o&&a&>(()=>{let e=!1;const t=new r(Pe.origin,{body:new mt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&>(()=>ce.isReadableStream(new n("").body)),d={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new de(`Response type '${e}' is not supported`,de.ERR_NOT_SUPPORT,r)})});const f=async(e,t)=>{const n=ce.toFiniteNumber(e.getContentLength());return null==n?(async e=>null==e?0:ce.isBlob(e)?e.size:ce.isSpecCompliantForm(e)?(await new r(Pe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength:ce.isArrayBufferView(e)||ce.isArrayBuffer(e)?e.byteLength:(ce.isURLSearchParams(e)&&(e+=""),ce.isString(e)?(await c(e)).byteLength:void 0))(t):n};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:l,timeout:p,onDownloadProgress:m,onUploadProgress:y,responseType:g,headers:w,withCredentials:b="same-origin",fetchOptions:v}=at(e),E=t||fetch;g=g?(g+"").toLowerCase():"text";let S=lt([c,l&&l.toAbortSignal()],p),O=null;const T=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let R;try{if(y&&u&&"get"!==i&&"head"!==i&&0!==(R=await f(w,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(ce.isFormData(a)&&(e=t.headers.get("content-type"))&&w.setContentType(e),t.body){const[e,r]=Ze(R,Ge(Ye(y)));a=dt(t.body,65536,e,r)}}ce.isString(b)||(b=b?"include":"omit");const t=o&&"credentials"in r.prototype,c={...v,signal:S,method:i.toUpperCase(),headers:w.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};O=o&&new r(s,c);let l=await(o?E(O,v):E(s,c));const p=h&&("stream"===g||"response"===g);if(h&&(m||p&&T)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=l[t]});const t=ce.toFiniteNumber(l.headers.get("content-length")),[r,s]=m&&Ze(t,Ge(Ye(m),!0))||[];l=new n(dt(l.body,65536,r,()=>{s&&s(),T&&T()}),e)}g=g||"text";let x=await d[ce.findKey(d,g)||"text"](l,e);return!p&&T&&T(),await new Promise((t,r)=>{Ve(t,r,{data:x,headers:Ke.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:O})})}catch(x){if(T&&T(),x&&"TypeError"===x.name&&/Load failed|fetch/i.test(x.message))throw Object.assign(new de("Network Error",de.ERR_NETWORK,e,O),{cause:x.cause||x});throw de.from(x,x&&x.code,e,O)}}},bt=new Map;const vt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,l=bt;for(;c--;)i=o[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:wt(t)),l=a;return a};vt();var Et={http:null,xhr:ct,fetch:{get:vt}};ce.forEach(Et,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var St=e=>`- ${e}`,Ot=e=>ce.isFunction(e)||null===e||!1===e;var Tt={getAdapter:function(e,t){e=ce.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Ot(n)&&(s=Et[(r=String(n)).toLowerCase()],void 0===s))throw new de(`Unknown adapter '${r}'`);if(s&&(ce.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new de("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(St).join("\n"):" "+St(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Et};function Rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new He(null,e)}function xt(e){return Rt(e),e.headers=Ke.from(e.headers),e.data=ze.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Tt.getAdapter(e.adapter||Ne.adapter,e)(e).then(function(t){return Rt(e),t.data=ze.call(e,e.transformResponse,t),t.headers=Ke.from(t.headers),t},function(t){return Je(t)||(Rt(e),t&&t.response&&(t.response.data=ze.call(e,e.transformResponse,t.response),t.response.headers=Ke.from(t.response.headers))),Promise.reject(t)})}const kt="1.13.2";var At={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{At[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var Ct={};At.transitional=function(e,t,r){return(n,s,o)=>{if(!1===e)throw new de(function(e,t){return"[Axios v"+kt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(s," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!Ct[s]&&(Ct[s]=!0),!e||e(n,s,o)}},At.spelling=function(e){return(e,t)=>!0};var jt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new de("option "+o+" must be "+r,de.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}},validators:At},_t=jt.validators,Ut=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Te,response:new Te}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{r.stack?t&&!String(r.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(r.stack+="\n"+t):r.stack=t}catch(n){}}throw r}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=it(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&jt.assertOptions(r,{silentJSONParsing:_t.transitional(_t.boolean),forcedJSONParsing:_t.transitional(_t.boolean),clarifyTimeoutError:_t.transitional(_t.boolean)},!1),null!=n&&(ce.isFunction(n)?t.paramsSerializer={serialize:n}:jt.assertOptions(n,{encode:_t.function,serialize:_t.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),jt.assertOptions(t,{baseUrl:_t.spelling("baseURL"),withXsrfToken:_t.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&ce.merge(s.common,s[t.method]);s&&ce.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=Ke.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,h=0;if(!a){const e=[xt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);h<u;)l=l.then(e[h++],e[h++]);return l}u=i.length;let d=t;for(;h<u;){const e=i[h++],t=i[h++];try{d=e(d)}catch(f){t.call(this,f);break}}try{l=xt.call(this,d)}catch(f){return Promise.reject(f)}for(h=0,u=c.length;h<u;)l=l.then(c[h++],c[h++]);return l}getUri(e){return Oe(st((e=it(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(e){Ut.prototype[e]=function(t,r){return this.request(it(r||{},{method:e,url:t,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(it(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ut.prototype[e]=t(),Ut.prototype[e+"Form"]=t(!0)});var Pt=Ut,Dt=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 r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new He(e,n,s),t(r.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}}};var Lt={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(Lt).forEach(([e,t])=>{Lt[t]=e});var Nt=Lt;var It=function e(t){const r=new Pt(t),n=w(Pt.prototype.request,r);return ce.extend(n,Pt.prototype,r,{allOwnKeys:!0}),ce.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(it(t,r))},n}(Ne);It.Axios=Pt,It.CanceledError=He,It.CancelToken=Dt,It.isCancel=Je,It.VERSION=kt,It.toFormData=ge,It.AxiosError=de,It.Cancel=It.CanceledError,It.all=function(e){return Promise.all(e)},It.spread=function(e){return function(t){return e.apply(null,t)}},It.isAxiosError=function(e){return ce.isObject(e)&&!0===e.isAxiosError},It.mergeConfig=it,It.AxiosHeaders=Ke,It.formToJSON=e=>De(ce.isHTMLForm(e)?new FormData(e):e),It.getAdapter=Tt.getAdapter,It.HttpStatusCode=Nt,It.default=It;var Mt=It;function Ft(e,t){const r=document.createElement("a");r.style.visibility="hidden",r.href=URL.createObjectURL(e),r.download=t,r.type=e.type,document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Bt=null,$t=null;var qt=class{constructor(){}static success(e="",t=""){}static info(e="",t=""){}static warn(e="",t=""){}static danger(e="",t=""){}static error(e="",t=""){}};const Kt={String:"string",Number:"number",Boolean:"boolean",Json:"json",Null:"null"};var zt=class{constructor(e){this.structure=[],this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data"},this.notError=!1,this.inited=!1,this.data=[],this.name=e.name,this.db=e.db,this.structure=e.structure,this.service=e.service,this.keyMap=e?.keyMap??this.keyMap,this.open()}get structureMap(){return this.structure.reduce((e,t)=>(e[t.name]=t,e),{})}async open(){this.validate(),this.extractPrimaryKey()}close(){this.structure=[]}validate(){if(!this.name)throw new Error("表名称不能为空");if(!this.structure)throw new Error(`表 ${this.name} 的结构未定义`);const e=this.structure.filter(e=>e.primaryKey);if(e.length>1)throw new Error(`表 ${this.name} 只能有一个主键,但找到了 ${e.length} 个, 分别是: ${e.map(e=>e.name).join(", ")}`);for(const t of this.structure){if(!t.name)throw new Error(`表 ${this.name} 的某个字段名称不能为空`);if(!Kt[t.type])throw new Error(`表 ${this.name} 的字段 ${t.name} 的类型 ${t.type} 无效`)}this.notError=!0}extractPrimaryKey(){this.primaryKey=this.structure.find(e=>e.primaryKey)?.name}updateStructure(e){this.structure=e,this.notError=!1,this.validate()}async fetchAsyncData(){const e=await(this.service?.queryTable(this.db,this.name));e&&(this.inited=!0,this.id=e?.[this.keyMap?.id],this.data=e?.[this.keyMap?.config_data]??[])}async getData(e=!1){return!e&&this.inited||await this.fetchAsyncData(),this.data}};const Jt=["=",">","<",">=","<=","!=","like"];var Wt=class{constructor(e){this.steps=[],this._run=e}start(){const e={collect:{select:void 0,insertInto:void 0,update:void 0,replaceInto:void 0,delete:void 0,from:void 0,where:void 0,limit:void 0},sentence:{DML:void 0}};return this.steps.push(e),this.currentStep=e,this}run(){return this._run(this)}validate(e,t,r){const n=this.currentStep;if(n?.collect?.[e])return n.error=`当前步骤已存在「${e}」操作,无法重复操作,请先调用start()重置「Action」再进行操作`,qt.error("Action",n.error),!n.error;for(let s=0;s<(t?.length||0);s++){const r=t[s];if(n?.collect?.[r])break;if(s===(t?.length||0)-1)return n.error=`${e}操作缺少必要的依赖关系,请先进行「${t.join("/")}」操作`,qt.error("Action",n.error),!n?.error}for(let s=0;s<(r?.length||0);s++){const t=r[s];if(n?.collect?.[t])return n.error=`「${e}」操作与「${t}」操作冲突,请只保留其中一个操作重试`,qt.error("Action",n.error),!n.error}return!n.error}select(e){return this.validate("select",[],["insertInto","update","delete","replaceInto"])?(this.currentStep.collect.select=e,this.currentStep.sentence.DML="select",this):this}insertInto(e,t,r){return this.validate("insertInto",[],["select","update","delete","replaceInto"])?(this.currentStep.collect.insertInto={table:e,fields:t,values:r},this.currentStep.sentence.DML="insertInto",this):this}update(e,t,r){return this.validate("update",[],["select","insertInto","delete","replaceInto"])?(this.currentStep.collect.update={table:e,fields:t,values:r},this.currentStep.sentence.DML="update",this):this}replaceInto(e,t,r){return this.validate("replaceInto",[],["select","insertInto","update","delete"])?(this.currentStep.collect.replaceInto={table:e,fields:t,values:r},this.currentStep.sentence.DML="replaceInto",this):this}delete(){return this.validate("delete",[],["select","insertInto","update","replaceInto","limit"])?(this.currentStep.collect.delete=!0,this.currentStep.sentence.DML="delete",this):this}from(e){return this.validate("from",["select","insertInto","update","delete","replaceInto"])?(this.currentStep.collect.from=e,this):this}where(e,t="AND"){if(!this.validate("where",[],["insertInto","replaceInto"]))return this;if(!e?.length)return this;const r=this.currentStep,n={segments:[],relationship:t};for(let s=0;s<e.length;s++){const t=e[s],[o,i,a]=t?.split(" ").map(e=>e.trim());if(!o||!i||void 0===a)throw r.error=`条件语句 "${t}" 格式错误,请使用 "字段 操作符 值" 的格式`,new Error(r.error);if(!Jt.includes(i))throw r.error=`条件语句 "${t}" 中的操作符 "${i}" 不受支持,请使用 ${Jt.join(", ")} 之一`,new Error(r.error);let c;if(a.startsWith("'")&&a.endsWith("'"))c=a.slice(1,-1);else if(isNaN(Number(a)))if("true"===a.toLowerCase()||"false"===a.toLowerCase())c="true"===a.toLowerCase();else{if(isNaN(Date.parse(a)))throw r.error=`条件语句 "${t}" 中的值 "${a}" 格式错误,无法解析为字符串、数字、布尔值或日期`,new Error(r.error);c=new Date(a)}else c=Number(a);n.segments.push({leftField:o,operator:i,rightValue:c})}return this.currentStep.collect.where=n,this}limit(e){return this.validate("limit",["select"],["insertInto","update","delete","replaceInto"])?(this.currentStep.collect.limit=e,this):this}},Ht=class{get execution(){return window.structuredClone(this.__executions?.[this.__executions?.length-1])}get result(){return this.__executions?.[this.__executions?.length-1]?.result}constructor(e){this.tables=new Map,this.locks=new Map,this.views=new Map,this.name="",this.closed=!1,this.name=e.name,this.service=e.service,this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data",...e?.keyMap||{}}}open(){this.closed=!1}close(){this.closed?qt.error("校验失败",`数据库 ${this.name} 已经关闭,无需重复关闭.`):(delete this.service,delete this.__executions,this.tables.forEach(e=>e.close()),this.tables.clear(),this.locks.forEach(e=>e.close()),this.locks.clear(),this.views.forEach(e=>e.close()),this.views.clear(),this.closed=!0)}useTable(e,t){return this.tables.has(e)||this.tables.set(e,new zt({name:e,db:this.name,structure:t||[],service:this.service,keyMap:this.keyMap})),this.tables.get(e)}createErrorReturn(e){return{error:e.error||""}}start(){return new Wt(this.run.bind(this)).start()}async run(e){const t=[];for(let n=0;n<e.steps.length;n++){const s=e.steps[n];if(s?.error){t.push(this.createErrorReturn(s));continue}if(!s?.sentence.DML){s.error="当前步骤没有明确的DML操作,无法执行,请先执行DML操作 (select/insertInto/update/replaceInto/delete)",t.push(this.createErrorReturn(s));continue}const o=s.collect?.from||(s.collect?.[s.sentence.DML])?.table,i=this.tables.get(o);if(!i||!i?.notError){s.error=`表 ${o} 不存在或错误,请先检查表.`,qt.error("校验失败",s.error),t.push(this.createErrorReturn(s));continue}const a=0===n?await(i?.getData()):window.structuredClone(t?.[n-1]?.result||[]),c=window.structuredClone(a),l={id:i?.id,DML:s.sentence.DML,where:s.collect.where,limit:s.collect.limit||0,from:o,rawData:a,result:[]};t.push(l);try{switch(s.sentence.DML){case"select":l.result=this.runOnSelect(c,i,s);break;case"insertInto":l.result=this.runOnInsertInto(c,i,s);break;case"update":l.result=this.runOnUpdate(c,i,s);break;case"replaceInto":l.result=this.runOnReplaceInto(c,i,s);break;case"delete":l.result=this.runOnDelete(c,i,s)}}catch(r){s.error=r?.message,qt.error("run 任务执行失败",s.error),t.push(this.createErrorReturn(s))}}return this.__executions=t,{acs:t,result:t?.[t.length-1]?.result||[],fetch:this.fetch.bind(this)}}validateTableStructure(e,t){if(t.includes("*"))return!0;const r=e.structureMap;for(let n=0;n<t.length;n++){const e=t[n];if(!r[e])return qt.error("Table Structure",`表结构中不存在字段「${e}」,请检查表结构定义或查询字段是否正确`),!1}return!0}runOnSelect(e,t,r){if(!this.validateTableStructure(t,r?.collect.select||[]))throw new Error("表结构验证失败");if(!e?.length)return[];r?.collect.where&&(e=this.applicationConditions(e,r.collect.where));let n=[...e];return r?.collect?.select?.includes("*")||(n=e?.map(e=>{const t={};return(r?.collect.select||[]).forEach(r=>{t[r]=e[r]}),t})),Number(r?.collect?.limit)>0?n?.slice(0,r?.collect.limit):n||[]}generateRow(e,t){if(!["insertInto","replaceInto"].includes(t?.sentence?.DML))return void qt.error("generateRow",`当前操作 ${t?.sentence?.DML} 不支持生成数据行,请检查 SQL 语句`);const r=t?.collect?.[t?.sentence?.DML];let n={};return r?.fields.forEach((e,t)=>{n[e]=r?.values[t]}),Object.keys(e.structureMap).forEach(t=>{if(void 0===n[t]){const r=e.structureMap[t];"function"==typeof r.default?n[t]=r.default():n[t]=r.default}}),n}runOnInsertInto(e,t,r){if(!this.validateTableStructure(t,r?.collect.insertInto?.fields||[]))throw new Error("表结构验证失败");if(r?.collect.insertInto?.fields.length!==r?.collect.insertInto?.values.length)throw new Error("插入数据的字段数量与值数量不匹配");const n=this.generateRow(t,r);return n&&e.push(n),e}runOnUpdate(e,t,r){if(!this.validateTableStructure(t,r?.collect.update?.fields||[]))throw new Error("表结构验证失败");return this.applicationConditions(e,r?.collect.where).forEach(e=>{r?.collect.update?.fields.forEach((t,n)=>{e[t]=r?.collect.update?.values[n]})}),e}runOnReplaceInto(e,t,r){if(!this.validateTableStructure(t,r?.collect.replaceInto?.fields||[]))throw new Error("表结构验证失败");if(r?.collect.replaceInto?.fields.length!==r?.collect.replaceInto?.values.length)throw new Error("插入数据的字段数量与值数量不匹配");if(!t?.primaryKey)throw new Error(`表 ${t.name} 没有定义主键,无法执行 replaceInto 操作,请检查表结构定义`);const n=r?.collect?.replaceInto?.fields?.findIndex(e=>e===t.primaryKey),s=r?.collect?.replaceInto?.values?.[n],o=e.findIndex(e=>e[t.primaryKey]===s),i=-1!==o?window.structuredClone(e.splice(o,1)[0]):void 0;if(i)r?.collect.replaceInto?.fields.forEach((e,t)=>{i[e]=r?.collect.replaceInto?.values[t]}),e.push(i);else{const n=this.generateRow(t,r);n&&e.push(n)}return e}runOnDelete(e,t,r){if(!r?.collect?.where)return[];if(!e?.length)throw new Error(`表 ${t.name} 为空,无法执行 delete 操作,请检查表数据`);return this.applicationConditions(e,r?.collect?.where).forEach(t=>{const r=e.indexOf(t);-1!==r&&e.splice(r,1)}),e}applicationConditions(e,t){if(!t||!t.segments.length)return e;const r=new Set;return"AND"===t?.relationship&&e?.forEach(e=>r.add(e)),t?.segments?.forEach(n=>{if("AND"===t?.relationship){const e=Array.from(r);r.clear(),e.filter(e=>this.isConditionPass(e,n)&&r.add(e))}else"OR"===t?.relationship&&e?.forEach(e=>this.isConditionPass(e,n)&&r.add(e))}),Array.from(r)}isConditionPass(e,t){if(void 0===e[t.leftField])return!1;switch(t.operator){case"=":return e[t.leftField]===t.rightValue;case">":return e[t.leftField]>t.rightValue;case"<":return e[t.leftField]<t.rightValue;case">=":return e[t.leftField]>=t.rightValue;case"<=":return e[t.leftField]<=t.rightValue;case"!=":return e[t.leftField]!==t.rightValue;case"like":return"string"==typeof e[t.leftField]&&"string"==typeof t.rightValue&&new RegExp("^"+t.rightValue.replace(/%/g,".*").replace(/_/g,".")+"$").test(e[t.leftField]);default:return!1}}async fetch(){const e=this.execution;if(!e)return qt.error("fetch 失败","没有可用的执行结果,请确保已经执行了 SQL 语句并且有结果返回."),!1;const t=e.from,r=this.tables.get(t);if(!r)return qt.error("fetch 失败",`表 ${t} 不存在,请检查 SQL 语句中的表名是否正确.`),!1;if(!r?.id){const e=!!(await(this.service?.createTable(this.name,this.execution?.from,this.execution?.result)));return await(r?.getData(!0)),e}switch(e.DML){case"insertInto":return!!(await(this.service?.createTable(this.name,e?.from,e.result)));case"delete":return e?.result?.length?!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result))):!!(await(this.service?.deleteTable(this.name,e?.from,r.id)));case"update":return!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result)));case"replaceInto":return e?.result?.length?!!(await(this.service?.updateTable(this.name,e?.from,r.id,e.result))):!!(await(this.service?.createTable(this.name,e?.from,e.result)));case"select":return!0;default:return!1}}},Vt=class{constructor(e){this.urls=e.urls,this.authToken=e.authToken||"",this.identifier=e.identifier||"",this.keyMap={id:"id",config_type:"config_type",config_name:"config_name",config_data:"config_data",...e?.keyMap||{}}}globalParams(e,t){return{[this.keyMap.config_type]:e,[this.keyMap.config_name]:this.identifier?`${t}|${this.identifier}`:t}}async fetch(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:this.authToken},body:JSON.stringify(t)});if(!r.ok)throw new Error(`指令执行失败. 响应码: ${r.status}, 响应消息: ${r.statusText}`);const n=await r.json();if(200!==n.code)throw new Error(`指令执行失败. 响应码: ${n.code}, 响应消息: ${n.message}`);return n.data}async createTable(e,t,r){try{return await this.fetch(this.urls.create,{...this.globalParams(e,t),[this.keyMap.config_data]:JSON.stringify(r)}),!0}catch(n){return!1}}async updateTable(e,t,r,n){try{return await this.fetch(this.urls.update,{...this.globalParams(e,t),[this.keyMap.id]:r,[this.keyMap.config_data]:JSON.stringify(n)}),!0}catch(s){return!1}}async deleteTable(e,t,r){try{return await this.fetch(this.urls.delete,{...this.globalParams(e,t),[this.keyMap.id]:r}),!0}catch(n){return!1}}async queryTable(e,t){return(await this.fetch(this.urls.query,{...this.globalParams(e,t)}))?.[0]}};exports.Database=Ht,exports.ExcelController=class{constructor(){this.sheets=[]}get sheetsMap(){return this.sheets.reduce((e,t)=>(e[t.id]=t,e),{})}addSheet(e){const t={id:`sheet-${window.crypto.randomUUID()}-${Date.now()}`,...e};return this.sheets.push(t),t}removeSheet(e){return this.sheetsMap?.[e]&&this.sheets.splice(this.sheets.indexOf(this.sheetsMap[e]),1)?.[0]||null}getSheet(e){return this.sheetsMap?.[e]||null}updateSheetName(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].name=t)}updateSheetStruct(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].struct=t)}updateSheetData(e,t){this.sheetsMap?.[e]&&(this.sheetsMap[e].data=t)}injectSheet(e,t){if(!t?.struct)throw new Error(`${t.name} 表结构未定义`);const r=e.addWorksheet(t.name);r.columns=t?.struct,t?.data?.forEach(e=>{r.addRow(e)})}exportExcel(){const e=new n.Workbook;for(const t of this.sheets)this.injectSheet(e,t);return e.xlsx.writeBuffer()}exportSheet(e){if(!this.sheetsMap?.[e])throw new Error(`id为「${e}」的表不存在`);const t=new n.Workbook;return this.injectSheet(t,this.sheetsMap?.[e]),t.xlsx.writeBuffer()}async downloadExcel(e){const t=await this.exportExcel();Ft(new Blob([new Uint8Array(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),e)}async downloadSheet(e,t){const r=await this.exportSheet(e);Ft(new Blob([new Uint8Array(r)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),t)}},exports.IntegratedDb=class{constructor(e){this.databases=new Map,this.validateConfig(e),this.config=e,this.service=new Vt({urls:e.link.url,authToken:e.link.authToken,keyMap:e.fetchKeyMap,identifier:e.identifier})}validateConfig(e){if(!e.link?.url)throw new Error("IntegratedDb必须配置连接地址,请查看配置项中「link.url」是否为空");e.link?.authToken||qt.warn("IntegratedDb","未传入「link.authToken」参数,连接存在无安全校验风险,请添加「link.authToken」以消除该警告")}openDb(e){return this.databases.has(e)||this.databases.set(e,new Ht({name:e,service:this.service,keyMap:this.config.fetchKeyMap})),this.databases.get(e)?.open(),this.databases.get(e)}closeDb(e){if(void 0===e)return this.databases.forEach(e=>e.close()),void this.databases.clear();this.databases.has(e)?(this.databases.get(e)?.close(),this.databases.delete(e)):qt.warn("IntegratedDb",`尝试关闭数据库「${e}」,但该数据库未打开或已关闭,请检查数据库名称是否正确`)}},exports.Log=qt,exports.Service=Vt,exports.copyText=async function(e,t){return Boolean(t?s(e):async function(e){try{return await(navigator?.clipboard?.writeText?.(e)),!0}catch(t){return s(e)}}(e))},exports.deleteUrlParams=function(e,t=!0){const r=new URLSearchParams(location.search);r?.delete(e);const n=r.toString();t&&history.replaceState(history.state,"",`${location.pathname}${n?`?${n}`:""}`)},exports.downloadBlob=Ft,exports.downloadFile=function(e,t){return new Promise(r=>{fetch(e).then(e=>e.blob()).then(e=>{const n=document.createElement("a"),s=t?.name;n.href=URL.createObjectURL(e),n.download=s,n.click(),n.remove(),URL.revokeObjectURL(n.href),r(!0)}).catch(e=>{r(!1)})})},exports.downloadFilesAsZip=async function(e,t="archive.zip"){await async function(){return Bt||(Bt=(await import("jszip")).default),Bt}(),await async function(){if(!$t){const e=await import("file-saver");$t={saveAs:e.saveAs||e.default||e.default?.saveAs}}return $t}();const r=new Bt,n=[],s={},o=e=>{if(s[e]){s[e]++;const t=e.lastIndexOf(".");return-1!==t?`${e.substring(0,t)}(${s[e]})${e.substring(t)}`:`${e}(${s[e]})`}return s[e]=1,e};for(const a of e)if("string"==typeof a){const e=a,t=o(e.substring(e.lastIndexOf("/")+1)||"unknown_file");n.push(Mt.get(e,{responseType:"blob"}).then(e=>{r.file(t,e.data)}).catch(e=>{r.file(`${t}.error.txt`,`Download failed: ${e.message}`)}))}else{const{name:e,url:t,data:s,folder:i}=a,c=o(e),l=i?r.folder(i):r;if(!l)continue;void 0!==s?l.file(c,s):t&&n.push(Mt.get(t,{responseType:"blob"}).then(e=>{l.file(c,e.data)}).catch(e=>{l.file(`${c}.error.txt`,`Download failed: ${e.message}`)}))}await Promise.all(n);const i=await r.generateAsync({type:"blob"});i&&$t?.saveAs(i,t)},exports.getFilenameWithoutExtension=function(e){const t=e.match(/\/([^\/]+)\.[\w]+$/);return t&&t[1]?t[1]:""},exports.getOsser=function(){return d},exports.getUrlParams=function(e){return new URLSearchParams(location.search)?.get(e)||""},exports.initUploadOss=async function(e,t,r,n){return await async function(){o=(await import("ali-oss")).default}(),!!o&&(h=n,"string"==typeof e?await async function(e,t,r){i=e||i,c=t||c,a=r||a;const n=await m();return!!n&&(y(n),!0)}(e,t,r):(f.refreshSTSTokenInterval=9999999,y(e),!0))},exports.ossConfiguration=p,exports.setUrlParams=function(e,t,r=!0){const n=new URLSearchParams(location.search);void 0!==n.get(e)?n.set(e,t):n.append(e,t);const s=n.toString();return r&&history.replaceState(history.state,"",`${location.pathname}?${s}`),n.toString()},exports.sleep=function(e){return new Promise(t=>setTimeout(t,e))},exports.uploadFileToOss=g,exports.uploadFilesToOss=async function(e,t){const r=e.map(e=>g(e,t));return await Promise.all(r)},exports.uuid=function(){return`${window.crypto.randomUUID()}-${Date.now()}`};
|