@jctrans-materials/shared 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.esm.js +14 -14
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vt=require("mitt");function rt(e,t){return function(){return e.apply(t,arguments)}}const{toString:zt}=Object.prototype,{getPrototypeOf:Ne}=Object,{iterator:de,toStringTag:st}=Symbol,fe=(e=>t=>{const n=zt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>fe(t)===e),pe=e=>t=>typeof t===e,{isArray:V}=Array,J=pe("undefined");function Q(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ot=x("ArrayBuffer");function qt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ot(e.buffer),t}const jt=pe("string"),O=pe("function"),it=pe("number"),Y=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,ie=e=>{if(fe(e)!=="object")return!1;const t=Ne(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(st in e)&&!(de in e)},Mt=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ht=x("Date"),Jt=x("File"),Vt=x("Blob"),Wt=x("FileList"),Kt=e=>Y(e)&&O(e.pipe),Xt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=fe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Gt=x("URLSearchParams"),[Qt,Yt,Zt,en]=["ReadableStream","Request","Response","Headers"].map(x),tn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function at(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ct=e=>!J(e)&&e!==q;function Ce(){const{caseless:e,skipUndefined:t}=ct(this)&&this||{},n={},r=(s,o)=>{const i=e&&at(n,o)||o;ie(n[i])&&ie(s)?n[i]=Ce(n[i],s):ie(s)?n[i]=Ce({},s):V(s)?n[i]=s.slice():(!t||!J(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Z(arguments[s],r);return n}const nn=(e,t,n,{allOwnKeys:r}={})=>(Z(t,(s,o)=>{n&&O(s)?e[o]=rt(s,n):e[o]=s},{allOwnKeys:r}),e),rn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},on=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Ne(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},an=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!it(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},un=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ne(Uint8Array)),ln=(e,t)=>{const r=(e&&e[de]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=x("HTMLFormElement"),pn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yn=x("RegExp"),ut=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Z(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},hn=e=>{ut(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return V(e)?r(e):r(String(e).split(t)),n},gn=()=>{},wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bn(e){return!!(e&&O(e.append)&&e[st]==="FormData"&&e[de])}const Sn=e=>{const t=new Array(10),n=(r,s)=>{if(Y(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=V(r)?[]:{};return Z(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},En=x("AsyncFunction"),Cn=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),lt=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:o})=>{s===q&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(q.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||lt,Rn=e=>e!=null&&O(e[de]),a={isArray:V,isArrayBuffer:ot,isBuffer:Q,isFormData:Xt,isArrayBufferView:qt,isString:jt,isNumber:it,isBoolean:$t,isObject:Y,isPlainObject:ie,isEmptyObject:Mt,isReadableStream:Qt,isRequest:Yt,isResponse:Zt,isHeaders:en,isUndefined:J,isDate:Ht,isFile:Jt,isBlob:Vt,isRegExp:yn,isFunction:O,isStream:Kt,isURLSearchParams:Gt,isTypedArray:un,isFileList:Wt,forEach:Z,merge:Ce,extend:nn,trim:tn,stripBOM:rn,inherits:sn,toFlatObject:on,kindOf:fe,kindOfTest:x,endsWith:an,toArray:cn,forEachEntry:ln,matchAll:dn,isHTMLForm:fn,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:ut,freezeMethods:hn,toObjectSet:mn,toCamelCase:pn,noop:gn,toFiniteNumber:wn,findKey:at,global:q,isContextDefined:ct,isSpecCompliantForm:bn,toJSONObject:Sn,isAsyncFn:En,isThenable:Cn,setImmediate:lt,asap:An,isIterable:Rn};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const dt=m.prototype,ft={};["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=>{ft[e]={value:e}});Object.defineProperties(m,ft);Object.defineProperty(dt,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(dt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return m.call(i,c,f,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const On=null;function Ae(e){return a.isPlainObject(e)||a.isArray(e)}function pt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function $e(e,t,n){return e?e.concat(t).map(function(s,o){return s=pt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function In(e){return a.isArray(e)&&!e.some(Ae)}const Tn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ye(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!a.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,h,y){let b=d;if(d&&!y&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&In(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(b=a.toArray(d)))return h=pt(h),b.forEach(function(S,R){!(a.isUndefined(S)||S===null)&&t.append(i===!0?$e([h],R,o):i===null?h:h+"[]",u(S))}),!1}return Ae(d)?!0:(t.append($e(y,h,o),u(d)),!1)}const p=[],g=Object.assign(Tn,{defaultVisitor:l,convertValue:u,isVisitable:Ae});function E(d,h){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),a.forEach(d,function(b,T){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(T)?T.trim():T,h,g))===!0&&E(b,h?h.concat(T):[T])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Pe(e,t){this._pairs=[],e&&ye(e,this,t)}const yt=Pe.prototype;yt.append=function(t,n){this._pairs.push([t,n])};yt.toString=function(t){const n=t?function(r){return t.call(this,r,Me)}:Me;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(e,t,n){if(!t)return e;const r=n&&n.encode||Nn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Pe(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class He{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pn=typeof URLSearchParams<"u"?URLSearchParams:Pe,xn=typeof FormData<"u"?FormData:null,Bn=typeof Blob<"u"?Blob:null,Ln={isBrowser:!0,classes:{URLSearchParams:Pn,FormData:xn,Blob:Bn},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,Fn=xe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),_n=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kn=xe&&window.location.href||"http://localhost",Un=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:Fn,hasStandardBrowserWebWorkerEnv:_n,navigator:Re,origin:kn},Symbol.toStringTag,{value:"Module"})),C={...Un,...Ln};function Dn(e,t){return ye(e,new C.classes.URLSearchParams,{visitor:function(n,r,s,o){return C.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function vn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function gt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=zn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(vn(r),s,n,0)}),n}return null}function qn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ee={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(gt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Dn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ye(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const n=this.transitional||ee.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const jn=a.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"]),$n=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vt=require("mitt");function rt(e,t){return function(){return e.apply(t,arguments)}}const{toString:zt}=Object.prototype,{getPrototypeOf:Ne}=Object,{iterator:de,toStringTag:st}=Symbol,fe=(e=>t=>{const n=zt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),x=e=>(e=e.toLowerCase(),t=>fe(t)===e),pe=e=>t=>typeof t===e,{isArray:V}=Array,J=pe("undefined");function Q(e){return e!==null&&!J(e)&&e.constructor!==null&&!J(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ot=x("ArrayBuffer");function qt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ot(e.buffer),t}const jt=pe("string"),O=pe("function"),it=pe("number"),Y=e=>e!==null&&typeof e=="object",$t=e=>e===!0||e===!1,ie=e=>{if(fe(e)!=="object")return!1;const t=Ne(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(st in e)&&!(de in e)},Mt=e=>{if(!Y(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ht=x("Date"),Jt=x("File"),Vt=x("Blob"),Wt=x("FileList"),Kt=e=>Y(e)&&O(e.pipe),Xt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=fe(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Gt=x("URLSearchParams"),[Qt,Yt,Zt,en]=["ReadableStream","Request","Response","Headers"].map(x),tn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),V(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function at(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ct=e=>!J(e)&&e!==q;function Ce(){const{caseless:e,skipUndefined:t}=ct(this)&&this||{},n={},r=(s,o)=>{const i=e&&at(n,o)||o;ie(n[i])&&ie(s)?n[i]=Ce(n[i],s):ie(s)?n[i]=Ce({},s):V(s)?n[i]=s.slice():(!t||!J(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Z(arguments[s],r);return n}const nn=(e,t,n,{allOwnKeys:r}={})=>(Z(t,(s,o)=>{n&&O(s)?e[o]=rt(s,n):e[o]=s},{allOwnKeys:r}),e),rn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),sn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},on=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&Ne(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},an=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},cn=e=>{if(!e)return null;if(V(e))return e;let t=e.length;if(!it(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},un=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ne(Uint8Array)),ln=(e,t)=>{const r=(e&&e[de]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},fn=x("HTMLFormElement"),pn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),je=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yn=x("RegExp"),ut=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Z(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},hn=e=>{ut(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mn=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return V(e)?r(e):r(String(e).split(t)),n},gn=()=>{},wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Sn(e){return!!(e&&O(e.append)&&e[st]==="FormData"&&e[de])}const bn=e=>{const t=new Array(10),n=(r,s)=>{if(Y(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=V(r)?[]:{};return Z(r,(i,c)=>{const f=n(i,s+1);!J(f)&&(o[c]=f)}),t[s]=void 0,o}}return r};return n(e,0)},En=x("AsyncFunction"),Cn=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),lt=((e,t)=>e?setImmediate:t?((n,r)=>(q.addEventListener("message",({source:s,data:o})=>{s===q&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(q.postMessage)),An=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||lt,Rn=e=>e!=null&&O(e[de]),a={isArray:V,isArrayBuffer:ot,isBuffer:Q,isFormData:Xt,isArrayBufferView:qt,isString:jt,isNumber:it,isBoolean:$t,isObject:Y,isPlainObject:ie,isEmptyObject:Mt,isReadableStream:Qt,isRequest:Yt,isResponse:Zt,isHeaders:en,isUndefined:J,isDate:Ht,isFile:Jt,isBlob:Vt,isRegExp:yn,isFunction:O,isStream:Kt,isURLSearchParams:Gt,isTypedArray:un,isFileList:Wt,forEach:Z,merge:Ce,extend:nn,trim:tn,stripBOM:rn,inherits:sn,toFlatObject:on,kindOf:fe,kindOfTest:x,endsWith:an,toArray:cn,forEachEntry:ln,matchAll:dn,isHTMLForm:fn,hasOwnProperty:je,hasOwnProp:je,reduceDescriptors:ut,freezeMethods:hn,toObjectSet:mn,toCamelCase:pn,noop:gn,toFiniteNumber:wn,findKey:at,global:q,isContextDefined:ct,isSpecCompliantForm:Sn,toJSONObject:bn,isAsyncFn:En,isThenable:Cn,setImmediate:lt,asap:An,isIterable:Rn};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(m,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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const dt=m.prototype,ft={};["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=>{ft[e]={value:e}});Object.defineProperties(m,ft);Object.defineProperty(dt,"isAxiosError",{value:!0});m.from=(e,t,n,r,s,o)=>{const i=Object.create(dt);a.toFlatObject(e,i,function(l){return l!==Error.prototype},u=>u!=="isAxiosError");const c=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return m.call(i,c,f,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const On=null;function Ae(e){return a.isPlainObject(e)||a.isArray(e)}function pt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function $e(e,t,n){return e?e.concat(t).map(function(s,o){return s=pt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function In(e){return a.isArray(e)&&!e.some(Ae)}const Tn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ye(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,y){return!a.isUndefined(y[h])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,h,y){let S=d;if(d&&!y&&typeof d=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&In(d)||(a.isFileList(d)||a.endsWith(h,"[]"))&&(S=a.toArray(d)))return h=pt(h),S.forEach(function(b,R){!(a.isUndefined(b)||b===null)&&t.append(i===!0?$e([h],R,o):i===null?h:h+"[]",u(b))}),!1}return Ae(d)?!0:(t.append($e(y,h,o),u(d)),!1)}const p=[],g=Object.assign(Tn,{defaultVisitor:l,convertValue:u,isVisitable:Ae});function E(d,h){if(!a.isUndefined(d)){if(p.indexOf(d)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(d),a.forEach(d,function(S,T){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(T)?T.trim():T,h,g))===!0&&E(S,h?h.concat(T):[T])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return E(e),t}function Me(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Pe(e,t){this._pairs=[],e&&ye(e,this,t)}const yt=Pe.prototype;yt.append=function(t,n){this._pairs.push([t,n])};yt.toString=function(t){const n=t?function(r){return t.call(this,r,Me)}:Me;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(e,t,n){if(!t)return e;const r=n&&n.encode||Nn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Pe(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class He{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pn=typeof URLSearchParams<"u"?URLSearchParams:Pe,xn=typeof FormData<"u"?FormData:null,Bn=typeof Blob<"u"?Blob:null,Ln={isBrowser:!0,classes:{URLSearchParams:Pn,FormData:xn,Blob:Bn},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,_n=xe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Fn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kn=xe&&window.location.href||"http://localhost",Un=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:_n,hasStandardBrowserWebWorkerEnv:Fn,navigator:Re,origin:kn},Symbol.toStringTag,{value:"Module"})),C={...Un,...Ln};function Dn(e,t){return ye(e,new C.classes.URLSearchParams,{visitor:function(n,r,s,o){return C.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function vn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function gt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=zn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(vn(r),s,n,0)}),n}return null}function qn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ee={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(gt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Dn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return ye(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const n=this.transitional||ee.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ee.headers[e]={}});const jn=a.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"]),$n=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
2
|
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&jn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Je=Symbol("internals");function X(e){return e&&String(e).trim().toLowerCase()}function ae(e){return e===!1||e==null?e:a.isArray(e)?e.map(ae):String(e)}function Mn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Hn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Jn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Vn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let I=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,f,u){const l=X(f);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||u===!0||u===void 0&&s[p]!==!1)&&(s[p||f]=ae(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Hn(t))i($n(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=X(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Mn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=X(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||we(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=X(i),i){const c=a.findKey(r,i);c&&(!n||we(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||we(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=ae(s),delete n[o];return}const c=t?Jn(o):String(o).trim();c!==o&&delete n[o],n[c]=ae(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=X(i);r[c]||(Vn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(I);function be(e,t){const n=this||ee,r=t||n,s=I.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function wt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,m,{__CANCEL__:!0});function bt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,g=0;for(;p!==s;)g+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(g*1e3/E):void 0}}function Xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const ue=(e,t,n=3)=>{let r=0;const s=Kn(50,250);return Xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Ve=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>a.asap(()=>e(...t)),Gn=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Qn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")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(){return null},remove(){}};function Yn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function St(e,t,n){let r=!Yn(t);return e&&(r||n==!1)?Zn(e,t):t}const Ke=e=>e instanceof I?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,l,p,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p,g)}else return r(u,l,p,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={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:c,headers:(u,l,p)=>s(Ke(u),Ke(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||s,g=p(e[l],t[l],l);a.isUndefined(g)&&p!==c||(n[l]=g)}),n}const Et=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=ht(St(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Gn(t.url))){const f=s&&o&&Qn.read(o);f&&i.set(s,f)}return t},er=typeof XMLHttpRequest<"u",tr=er&&function(e){return new Promise(function(n,r){const s=Et(e);let o=s.data;const i=I.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,p,g,E,d;function h(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function b(){if(!y)return;const S=I.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};bt(function(N){n(N),h()},function(N){r(N),h()},P),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new m("Request aborted",m.ECONNABORTED,e,y)),y=null)},y.onerror=function(R){const P=R&&R.message?R.message:"Network Error",v=new m(P,m.ERR_NETWORK,e,y);v.event=R||null,r(v),y=null},y.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||mt;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new m(R,P.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&a.forEach(i.toJSON(),function(R,P){y.setRequestHeader(P,R)}),a.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),c&&c!=="json"&&(y.responseType=s.responseType),u&&([g,d]=ue(u,!0),y.addEventListener("progress",g)),f&&y.upload&&([p,E]=ue(f),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=S=>{y&&(r(!S||S.type?new W(null,e,y):S),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const T=Wn(s.url);if(T&&C.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,e));return}y.send(o||null)})},nr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new W(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},rr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},sr=async function*(e,t){for await(const n of or(e))yield*rr(n,t)},or=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Xe=(e,t,n,r)=>{const s=sr(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let p=l.byteLength;if(n){let g=o+=p;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Ge=64*1024,{isFunction:oe}=a,ir=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Qe,TextEncoder:Ye}=a.global,Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ar=e=>{e=a.merge.call({skipUndefined:!0},ir,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",o=oe(n),i=oe(r);if(!s)return!1;const c=s&&oe(Qe),f=s&&(typeof Ye=="function"?(d=>h=>d.encode(h))(new Ye):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&c&&Ze(()=>{let d=!1;const h=new n(C.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!h}),l=i&&c&&Ze(()=>a.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(h,y)=>{let b=h&&h[d];if(b)return b.call(h);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,y)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},E=async(d,h)=>{const y=a.toFiniteNumber(d.getContentLength());return y??g(h)};return async d=>{let{url:h,method:y,data:b,signal:T,cancelToken:S,timeout:R,onDownloadProgress:P,onUploadProgress:v,responseType:N,headers:me,withCredentials:ne="same-origin",fetchOptions:ke}=Et(d),Ue=t||fetch;N=N?(N+"").toLowerCase():"text";let re=nr([T,S&&S.toAbortSignal()],R),K=null;const z=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let De;try{if(v&&u&&y!=="get"&&y!=="head"&&(De=await E(me,b))!==0){let D=new n(h,{method:"POST",body:b,duplex:"half"}),M;if(a.isFormData(b)&&(M=D.headers.get("content-type"))&&me.setContentType(M),D.body){const[ge,se]=Ve(De,ue(We(v)));b=Xe(D.body,Ge,ge,se)}}a.isString(ne)||(ne=ne?"include":"omit");const B=o&&"credentials"in n.prototype,ve={...ke,signal:re,method:y.toUpperCase(),headers:me.normalize().toJSON(),body:b,duplex:"half",credentials:B?ne:void 0};K=o&&new n(h,ve);let U=await(o?Ue(K,ke):Ue(h,ve));const ze=l&&(N==="stream"||N==="response");if(l&&(P||ze&&z)){const D={};["status","statusText","headers"].forEach(qe=>{D[qe]=U[qe]});const M=a.toFiniteNumber(U.headers.get("content-length")),[ge,se]=P&&Ve(M,ue(We(P),!0))||[];U=new r(Xe(U.body,Ge,ge,()=>{se&&se(),z&&z()}),D)}N=N||"text";let Dt=await p[a.findKey(p,N)||"text"](U,d);return!ze&&z&&z(),await new Promise((D,M)=>{bt(D,M,{data:Dt,headers:I.from(U.headers),status:U.status,statusText:U.statusText,config:d,request:K})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,K),{cause:B.cause||B}):m.from(B,B&&B.code,d,K)}}},cr=new Map,Ct=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,f,u,l=cr;for(;c--;)f=o[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:ar(t)),l=u;return u};Ct();const Be={http:On,xhr:tr,fetch:{get:Ct}};a.forEach(Be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,ur=e=>a.isFunction(e)||e===null||e===!1;function lr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!ur(r)&&(s=Be[(c=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Je]=this[Je]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=X(i);r[c]||(Vn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(I);function Se(e,t){const n=this||ee,r=t||n,s=I.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function wt(e){return!!(e&&e.__CANCEL__)}function W(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(W,m,{__CANCEL__:!0});function St(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Wn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Kn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let p=o,g=0;for(;p!==s;)g+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(g*1e3/E):void 0}}function Xn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),p=l-n;p>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-p)))},()=>s&&i(s)]}const ue=(e,t,n=3)=>{let r=0;const s=Kn(50,250);return Xn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const p={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(p)},n)},Ve=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},We=e=>(...t)=>a.asap(()=>e(...t)),Gn=C.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,C.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Qn=C.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")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(){return null},remove(){}};function Yn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bt(e,t,n){let r=!Yn(t);return e&&(r||n==!1)?Zn(e,t):t}const Ke=e=>e instanceof I?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,l,p,g){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:g},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,p,g){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,p,g)}else return r(u,l,p,g)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,p){if(p in t)return r(u,l);if(p in e)return r(void 0,u)}const f={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:c,headers:(u,l,p)=>s(Ke(u),Ke(l),p,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const p=f[l]||s,g=p(e[l],t[l],l);a.isUndefined(g)&&p!==c||(n[l]=g)}),n}const Et=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=I.from(i),t.url=ht(bt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const f=n.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,p])=>{u.includes(l.toLowerCase())&&i.set(l,p)})}}if(C.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Gn(t.url))){const f=s&&o&&Qn.read(o);f&&i.set(s,f)}return t},er=typeof XMLHttpRequest<"u",tr=er&&function(e){return new Promise(function(n,r){const s=Et(e);let o=s.data;const i=I.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,p,g,E,d;function h(){E&&E(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function S(){if(!y)return;const b=I.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:e,request:y};St(function(N){n(N),h()},function(N){r(N),h()},P),y=null}"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(S)},y.onabort=function(){y&&(r(new m("Request aborted",m.ECONNABORTED,e,y)),y=null)},y.onerror=function(R){const P=R&&R.message?R.message:"Network Error",v=new m(P,m.ERR_NETWORK,e,y);v.event=R||null,r(v),y=null},y.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||mt;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new m(R,P.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,y)),y=null},o===void 0&&i.setContentType(null),"setRequestHeader"in y&&a.forEach(i.toJSON(),function(R,P){y.setRequestHeader(P,R)}),a.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),c&&c!=="json"&&(y.responseType=s.responseType),u&&([g,d]=ue(u,!0),y.addEventListener("progress",g)),f&&y.upload&&([p,E]=ue(f),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=b=>{y&&(r(!b||b.type?new W(null,e,y):b),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const T=Wn(s.url);if(T&&C.protocols.indexOf(T)===-1){r(new m("Unsupported protocol "+T+":",m.ERR_BAD_REQUEST,e));return}y.send(o||null)})},nr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof m?l:new W(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>a.asap(c),f}},rr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},sr=async function*(e,t){for await(const n of or(e))yield*rr(n,t)},or=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Xe=(e,t,n,r)=>{const s=sr(e,t);let o=0,i,c=f=>{i||(i=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let p=l.byteLength;if(n){let g=o+=p;n(g)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Ge=64*1024,{isFunction:oe}=a,ir=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Qe,TextEncoder:Ye}=a.global,Ze=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ar=e=>{e=a.merge.call({skipUndefined:!0},ir,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",o=oe(n),i=oe(r);if(!s)return!1;const c=s&&oe(Qe),f=s&&(typeof Ye=="function"?(d=>h=>d.encode(h))(new Ye):async d=>new Uint8Array(await new n(d).arrayBuffer())),u=o&&c&&Ze(()=>{let d=!1;const h=new n(C.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!h}),l=i&&c&&Ze(()=>a.isReadableStream(new r("").body)),p={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!p[d]&&(p[d]=(h,y)=>{let S=h&&h[d];if(S)return S.call(h);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,y)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},E=async(d,h)=>{const y=a.toFiniteNumber(d.getContentLength());return y??g(h)};return async d=>{let{url:h,method:y,data:S,signal:T,cancelToken:b,timeout:R,onDownloadProgress:P,onUploadProgress:v,responseType:N,headers:me,withCredentials:ne="same-origin",fetchOptions:ke}=Et(d),Ue=t||fetch;N=N?(N+"").toLowerCase():"text";let re=nr([T,b&&b.toAbortSignal()],R),K=null;const z=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let De;try{if(v&&u&&y!=="get"&&y!=="head"&&(De=await E(me,S))!==0){let D=new n(h,{method:"POST",body:S,duplex:"half"}),M;if(a.isFormData(S)&&(M=D.headers.get("content-type"))&&me.setContentType(M),D.body){const[ge,se]=Ve(De,ue(We(v)));S=Xe(D.body,Ge,ge,se)}}a.isString(ne)||(ne=ne?"include":"omit");const B=o&&"credentials"in n.prototype,ve={...ke,signal:re,method:y.toUpperCase(),headers:me.normalize().toJSON(),body:S,duplex:"half",credentials:B?ne:void 0};K=o&&new n(h,ve);let U=await(o?Ue(K,ke):Ue(h,ve));const ze=l&&(N==="stream"||N==="response");if(l&&(P||ze&&z)){const D={};["status","statusText","headers"].forEach(qe=>{D[qe]=U[qe]});const M=a.toFiniteNumber(U.headers.get("content-length")),[ge,se]=P&&Ve(M,ue(We(P),!0))||[];U=new r(Xe(U.body,Ge,ge,()=>{se&&se(),z&&z()}),D)}N=N||"text";let Dt=await p[a.findKey(p,N)||"text"](U,d);return!ze&&z&&z(),await new Promise((D,M)=>{St(D,M,{data:Dt,headers:I.from(U.headers),status:U.status,statusText:U.statusText,config:d,request:K})})}catch(B){throw z&&z(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,K),{cause:B.cause||B}):m.from(B,B&&B.code,d,K)}}},cr=new Map,Ct=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,f,u,l=cr;for(;c--;)f=o[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:ar(t)),l=u;return u};Ct();const Be={http:On,xhr:tr,fetch:{get:Ct}};a.forEach(Be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const et=e=>`- ${e}`,ur=e=>a.isFunction(e)||e===null||e===!1;function lr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!ur(r)&&(s=Be[(c=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
4
4
|
`+i.map(et).join(`
|
|
5
|
-
`):" "+et(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const At={getAdapter:lr,adapters:Be};function
|
|
6
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ce.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ce.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ce.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=I.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let l,p=0,g;if(!f){const d=[tt.bind(this),void 0];for(d.unshift(...c),d.push(...u),g=d.length,l=Promise.resolve(n);p<g;)l=l.then(d[p++],d[p++]);return l}g=c.length;let E=n;for(;p<g;){const d=c[p++],h=c[p++];try{E=d(E)}catch(y){h.call(this,y);break}}try{l=tt.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,g=u.length;p<g;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=$(this.defaults,t);const n=St(t.baseURL,t.url,t.allowAbsoluteUrls);return ht(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}j.prototype[t]=n(),j.prototype[t+"Form"]=n(!0)});let fr=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new W(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function pr(e){return function(n){return e.apply(null,n)}}function yr(e){return a.isObject(e)&&e.isAxiosError===!0}const Oe={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(Oe).forEach(([e,t])=>{Oe[t]=e});function It(e){const t=new j(e),n=rt(j.prototype.request,t);return a.extend(n,j.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return It($(e,s))},n}const w=It(ee);w.Axios=j;w.CanceledError=W;w.CancelToken=fr;w.isCancel=wt;w.VERSION=Rt;w.toFormData=ye;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=pr;w.isAxiosError=yr;w.mergeConfig=$;w.AxiosHeaders=I;w.formToJSON=e=>gt(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=At.getAdapter;w.HttpStatusCode=Oe;w.default=w;const{Axios:Vr,AxiosError:Wr,CanceledError:Kr,isCancel:Xr,CancelToken:Gr,VERSION:Qr,all:Yr,Cancel:Zr,isAxiosError:es,spread:ts,toFormData:ns,AxiosHeaders:rs,HttpStatusCode:ss,formToJSON:os,getAdapter:is,mergeConfig:as}=w,Ie=w.create({timeout:15e3});Ie.interceptors.response.use(e=>e,e=>Promise.reject(e));const Tt={async get(e,t){const n=await Ie.get(e,{params:t?.params,headers:t?.headers});return{data:n.data,status:n.status,headers:n.headers}},async post(e,t,n){const r=await Ie.post(e,t,{params:n?.params,headers:n?.headers});return{data:r.data,status:r.status,headers:r.headers}}};function hr(e){return{async get(t,n){const r=n?.params?"?"+new URLSearchParams(n.params).toString():"",s=await e(t+r,{method:"GET",headers:n?.headers});return{data:await s.json(),status:s.status}},async post(t,n,r){const s=r?.params?"?"+new URLSearchParams(r.params).toString():"",o=await e(t+s,{method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:n?JSON.stringify(n):void 0});return{data:await o.json(),status:o.status}}}}let G=Tt;function mr(e,t){return e==="fetch"?G=hr(t?.fetch??fetch):G=Tt,G}const Nt={get:(...e)=>G.get(...e),post:(...e)=>G.post(...e)},le={prefixPath:"https://cloudapi-sit2.jctrans.net.cn",searchPath:"/system/dms/fr/aggr/getLocationOptions"},Pt={get basePath(){return le.prefixPath+le.searchPath}},gr=e=>{e&&(e.prefixPath!==void 0&&(le.prefixPath=e.prefixPath),e.searchPath!==void 0&&(le.searchPath=e.searchPath))},Le=()=>Pt,Fe=()=>{try{const n=globalThis.useCookie;if(typeof n=="function"){const r=n("jc-language").value;if(r)return/en/i.test(r)||/en-US/i.test(r)}}catch{}const e=typeof window<"u"&&typeof document<"u";let t="";if(e)t=document.cookie||"";else try{t=globalThis.useNuxtApp?.()?.ssrContext?.event?.node?.req?.headers?.cookie||""}catch{t=""}return/jc-language=en-US/i.test(t)||/jc-language=en/i.test(t)},wr=()=>Le().basePath,br={Continent:"continentId",Country:"countryId",City:"cityId",Province:"provinceId",Seaport:"seaportId",Airport:"airportId"},Sr=["City","Seaport","Airport","Country","Region"].filter(Boolean);function H(e,t){return e==="allCityByCountryId"?Array.isArray(t)?String(t[0]):String(t):Array.isArray(t)?JSON.stringify(t):JSON.stringify([Number(t)])}function Er(e){const t=[];if(e.ids)for(const n of e.ids){const r=br[n.type];t.push({name:r,val:H(r,n.ids)})}return e.scope&&(e.scope.countryId!==void 0&&e.scope.countryId!==null&&t.push({name:"countryId",val:H("countryId",[e.scope.countryId])}),e.scope.cityId!==void 0&&e.scope.cityId!==null&&t.push({name:"cityId",val:H("cityId",[e.scope.cityId])}),e.scope.provinceId!==void 0&&e.scope.provinceId!==null&&t.push({name:"provinceId",val:H("provinceId",[e.scope.provinceId])})),t}function k(e){const t={current:e.page??1,size:e.size??10,level:e.level,searchContent:e.keyword??void 0,displayInfo:e.displayInfo??Sr,sort:e.sort},n=Er({ids:e.ids,scope:e.scope});return t.appointSearch=[...n,...e.extraAppoint||[]],Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),t}function Cr(e,t,n){const r=Fe(),s=(u,l)=>{if(!u)return"";const p=u.nameCn??u[`${l.toLowerCase()}NameCn`]??u.name,g=u.nameEn??u[`${l.toLowerCase()}NameEn`];return r?g||p||"":p||g||""},o=s(e,t),i=s(n.country,"country"),c=s(n.city,"city"),f=s(n.continent,"continent");switch(t){case"Seaport":case"Airport":const u=[c,i].filter(Boolean).join(", ");return u?`${o} (${u})`:o;case"City":case"Province":return i?`${o} (${i})`:o;case"Country":return f?`${o} (${f})`:o;default:return o}}function F(e=[],t=[]){const n=[];function r(o,i,c){if(!o||!t.includes(i))return;const f=o.id??o[i.toLowerCase()+"Id"]??null;if(f==null)return;const u=o.nameCn??o[`${i.toLowerCase()}NameCn`]??o.name??void 0,l=o.nameEn??o[`${i.toLowerCase()}NameEn`]??void 0,p=Cr(o,i,c)||u||l||"";n.push({id:f,type:i,nameCn:u,nameEn:l,display:p,continent:c.continent??void 0,country:c.country??void 0,city:c.city??void 0,province:c.province??void 0,raw:o})}for(const o of e){const i={continent:o.continent??void 0,country:o.country??void 0,city:o.city??void 0,province:o.province??void 0};let c=!1;if(["Continent","Country","Province","City","Seaport","Airport"].forEach(u=>{const l=u.toLowerCase();o[l]&&(r(o[l],u,i),c=!0)}),!c&&o.id!==void 0){let u;o.type&&t.includes(o.type)?u=o.type:t.length===1&&(u=t[0]),u&&r(o,u,i)}}const s=new Set;return n.filter(o=>{const i=`${o.type}_${o.id}`;return s.has(i)?!1:(s.add(i),!0)})}async function _(e){return(await Nt.post(wr(),e)).data}async function te(e){const t=k({keyword:e.keyword,displayInfo:e.displayInfo,page:e.page,size:e.size,level:e.level,sort:e.sort,ids:e.ids,scope:e.scope,extraAppoint:e.extraAppoint}),n=await _(t),r=F(n.data?.records||[],t.displayInfo||[]);return{...n,records:r}}async function _e(e){if(!e.keyword?.trim())throw new Error("searchByName: keyword 不能为空");const t=e.types&&e.types.length>0?e.types:["Continent","Country","City","Province","Seaport","Airport"];return te({keyword:e.keyword.trim(),displayInfo:t,page:e.page,size:e.size,level:e.level,sort:e.sort})}async function xt(e,t){const n=Array.isArray(t)?t:[t],r=[e],s=k({displayInfo:r,ids:[{type:e,ids:n}]}),o=await _(s);return F(o.records||[],r).filter(c=>c.type===e)}async function Ar(e,t){return(await xt(e,[t]))[0]??null}async function Rr(e,t){const n=["City"],r=k({displayInfo:n,page:t?.page??1,size:t?.size??1e3,extraAppoint:[{name:"allCityByCountryId",val:H("allCityByCountryId",e)}]}),s=await _(r);return{...s,records:F(s.records||[],n)}}async function Or(e,t,n){if(!t||t.length===0)throw new Error("childTypes 必须至少包含一个:Seaport | Airport");const r=t,s=k({displayInfo:r,page:n?.page??1,size:n?.size??1e3,extraAppoint:[{name:"cityId",val:H("cityId",[e])}]}),o=await _(s);return{...o,records:F(o.records||[],r)}}function Ir(e,t){return _e({keyword:e,types:["Country"],page:t?.page,size:t?.size})}function Tr(e,t){return t?.countryId?te({keyword:e,displayInfo:["City"],scope:{countryId:t.countryId},page:t.page,size:t.size}):_e({keyword:e,types:["City"],page:t?.page,size:t?.size})}function Nr(e,t){return te({keyword:e,displayInfo:["Seaport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}function Pr(e,t){return te({keyword:e,displayInfo:["Airport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}async function xr(e={}){const t=["Continent"],n=await _({current:e.page??1,size:e.size??10,level:1,displayInfo:t});return{...n,records:F(n.records||[],t)}}async function Br(e={}){const t=["Country"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Country",ids:e.ids}]:void 0}),r=await _(n);return{...r,records:F(r.records||[],t)}}async function Lr(e={}){const t=["City"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"City",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await _(n);return{...r,records:F(r.records||[],t)}}async function Fr(e={}){const t=["Province"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Province",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await _(n);return{...r,records:F(r.records||[],t)}}async function _r(e={}){const t=["Seaport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Seaport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await _(n);return{...r,records:F(r.records||[],t)}}async function kr(e={}){const t=["Airport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Airport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await _(n);return{...r,records:F(r.records||[],t)}}const Ur="2.0",Dr=()=>Le().basePath;function Bt(e){let t=e.type;return t==="Country"&&e.region&&!e.country?{target:e.region,finalType:"Region"}:{target:e[t.toLowerCase()]||{},finalType:t}}function Ee(e,t){const{target:n,finalType:r}=Bt(e),s=u=>{if(!u)return"";const l=u.nameCn||u.displayNameCn||u.name||"",p=u.nameEn||u.displayNameEn||u.nameEnShow||"";return t?p||l:l||p},o=s(n),i=e.country||e.region,c=s(i),f=s(e.city);if(["Seaport","Airport","Wharf"].includes(r)){const u=[f,c].filter(Boolean).join(", ");return u?`${o} (${u})`:o}return["City","Province"].includes(r)&&c?`${o} (${c})`:o}function vr(e=[]){return e.map(t=>{const{target:n,finalType:r}=Bt(t);return{id:n.id??t.id,type:r,nameCn:n.nameCn||n.name,nameEn:n.nameEn||n.nameEnShow,display:Ee(t,Fe()),displayEn:Ee(t,!0),displayCn:Ee(t,!1),raw:t}})}async function A(e){const t={current:1,size:10,...e},r=(await Nt.post(Dr(),t)).data.data||{};return{...r,records:vr(r.records||[])}}const Lt={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},Ft={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},Te={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["City"]}),getByIds:e=>A({cityIds:e,displayInfo:["City"]}),getCitiesByCountry:(e,t)=>A({countryIds:[e],displayInfo:["City"],...t})},_t={searchByName:e=>A({searchContent:e.keyword,cityIds:e.cityId?[e.cityId]:void 0,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Seaport"]}),getByIds:e=>A({seaportIds:e,displayInfo:["Seaport"]})},kt={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Airport"]}),getByIds:e=>A({airportIds:e,displayInfo:["Airport"]})},Ut={getByIds:e=>A({wharfIds:e,displayInfo:["Wharf"]})},zr=e=>A({searchContent:e.keyword,...e}),qr=(e,t)=>{const n=Array.isArray(e)?e:[e];switch(t){case"Country":return Lt.getByIds(n);case"Region":return Ft.getByIds(n);case"City":return Te.getByIds(n);case"Seaport":return _t.getByIds(n);case"Airport":return kt.getByIds(n);case"Wharf":return Ut.getByIds(n);default:return A({[`${t.toLowerCase()}Ids`]:n,displayInfo:[t]})}},jr={SEARCH_VERSION:Ur,searchByName:zr,searchByIdWithType:qr,country:Lt,region:Ft,city:Te,seaport:_t,airport:kt,wharf:Ut,getCitiesByCountry:Te.getCitiesByCountry,getChildrenByCity:(e,t,n)=>A({cityIds:[e],displayInfo:t,...n})},$r={Open:"GLOBAL_MODAL_OPEN",Close:"GLOBAL_MODAL_CLOSE",Submit:"GLOBAL_MODAL_SUBMIT"},Mr=vt();exports.MODAL_ACTION=$r;exports.createRequest=mr;exports.currentConfig=Pt;exports.emitter=Mr;exports.getAirport=kr;exports.getById=Ar;exports.getByIds=xt;exports.getChildrenByCity=Or;exports.getCitiesByCountry=Rr;exports.getCity=Lr;exports.getContinent=xr;exports.getCountry=Br;exports.getIsEn=Fe;exports.getProvince=Fr;exports.getSeaport=_r;exports.getSharedConfig=Le;exports.initSharedConfig=gr;exports.locationSearchV2=jr;exports.search=te;exports.searchAirportByName=Pr;exports.searchByName=_e;exports.searchCityByName=Tr;exports.searchCountryByName=Ir;exports.searchSeaportByName=Nr;
|
|
5
|
+
`):" "+et(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const At={getAdapter:lr,adapters:Be};function be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new W(null,e)}function tt(e){return be(e),e.headers=I.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),At.getAdapter(e.adapter||ee.adapter,e)(e).then(function(r){return be(e),r.data=Se.call(e,e.transformResponse,r),r.headers=I.from(r.headers),r},function(r){return wt(r)||(be(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=I.from(r.response.headers))),Promise.reject(r)})}const Rt="1.13.2",he={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{he[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const nt={};he.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Rt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!nt[i]&&(nt[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};he.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function dr(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new m("option "+o+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ce={assertOptions:dr,validators:he},L=ce.validators;let j=class{constructor(t){this.defaults=t||{},this.interceptors={request:new He,response:new He}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ce.assertOptions(r,{silentJSONParsing:L.transitional(L.boolean),forcedJSONParsing:L.transitional(L.boolean),clarifyTimeoutError:L.transitional(L.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ce.assertOptions(s,{encode:L.function,serialize:L.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ce.assertOptions(n,{baseUrl:L.spelling("baseURL"),withXsrfToken:L.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),n.headers=I.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(f=f&&h.synchronous,c.unshift(h.fulfilled,h.rejected))});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let l,p=0,g;if(!f){const d=[tt.bind(this),void 0];for(d.unshift(...c),d.push(...u),g=d.length,l=Promise.resolve(n);p<g;)l=l.then(d[p++],d[p++]);return l}g=c.length;let E=n;for(;p<g;){const d=c[p++],h=c[p++];try{E=d(E)}catch(y){h.call(this,y);break}}try{l=tt.call(this,E)}catch(d){return Promise.reject(d)}for(p=0,g=u.length;p<g;)l=l.then(u[p++],u[p++]);return l}getUri(t){t=$(this.defaults,t);const n=bt(t.baseURL,t.url,t.allowAbsoluteUrls);return ht(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){j.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}j.prototype[t]=n(),j.prototype[t+"Form"]=n(!0)});let fr=class Ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new W(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ot(function(s){t=s}),cancel:t}}};function pr(e){return function(n){return e.apply(null,n)}}function yr(e){return a.isObject(e)&&e.isAxiosError===!0}const Oe={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(Oe).forEach(([e,t])=>{Oe[t]=e});function It(e){const t=new j(e),n=rt(j.prototype.request,t);return a.extend(n,j.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return It($(e,s))},n}const w=It(ee);w.Axios=j;w.CanceledError=W;w.CancelToken=fr;w.isCancel=wt;w.VERSION=Rt;w.toFormData=ye;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=pr;w.isAxiosError=yr;w.mergeConfig=$;w.AxiosHeaders=I;w.formToJSON=e=>gt(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=At.getAdapter;w.HttpStatusCode=Oe;w.default=w;const{Axios:Vr,AxiosError:Wr,CanceledError:Kr,isCancel:Xr,CancelToken:Gr,VERSION:Qr,all:Yr,Cancel:Zr,isAxiosError:es,spread:ts,toFormData:ns,AxiosHeaders:rs,HttpStatusCode:ss,formToJSON:os,getAdapter:is,mergeConfig:as}=w,Ie=w.create({timeout:15e3});Ie.interceptors.response.use(e=>e,e=>Promise.reject(e));const Tt={async get(e,t){const n=await Ie.get(e,{params:t?.params,headers:t?.headers});return{data:n.data,status:n.status,headers:n.headers}},async post(e,t,n){const r=await Ie.post(e,t,{params:n?.params,headers:n?.headers});return{data:r.data,status:r.status,headers:r.headers}}};function hr(e){return{async get(t,n){const r=n?.params?"?"+new URLSearchParams(n.params).toString():"",s=await e(t+r,{method:"GET",headers:n?.headers});return{data:await s.json(),status:s.status}},async post(t,n,r){const s=r?.params?"?"+new URLSearchParams(r.params).toString():"",o=await e(t+s,{method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:n?JSON.stringify(n):void 0});return{data:await o.json(),status:o.status}}}}let G=Tt;function mr(e,t){return e==="fetch"?G=hr(t?.fetch??fetch):G=Tt,G}const Nt={get:(...e)=>G.get(...e),post:(...e)=>G.post(...e)},le={prefixPath:"https://cloudapi-sit2.jctrans.net.cn",searchPath:"/system/dms/fr/aggr/getLocationOptions"},Pt={get basePath(){return le.prefixPath+le.searchPath}},gr=e=>{e&&(e.prefixPath!==void 0&&(le.prefixPath=e.prefixPath),e.searchPath!==void 0&&(le.searchPath=e.searchPath))},Le=()=>Pt,_e=()=>{let e;try{typeof useCookie=="function"&&(e=useCookie("jc-language")?.value)}catch{}if(e)return e==="en"||e==="en-US";if(typeof document<"u"){const t=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(t)}try{if(typeof useNuxtApp=="function"){const n=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(n)}}catch{}return!1},wr=()=>Le().basePath,Sr={Continent:"continentId",Country:"countryId",City:"cityId",Province:"provinceId",Seaport:"seaportId",Airport:"airportId"},br=["City","Seaport","Airport","Country","Region"].filter(Boolean);function H(e,t){return e==="allCityByCountryId"?Array.isArray(t)?String(t[0]):String(t):Array.isArray(t)?JSON.stringify(t):JSON.stringify([Number(t)])}function Er(e){const t=[];if(e.ids)for(const n of e.ids){const r=Sr[n.type];t.push({name:r,val:H(r,n.ids)})}return e.scope&&(e.scope.countryId!==void 0&&e.scope.countryId!==null&&t.push({name:"countryId",val:H("countryId",[e.scope.countryId])}),e.scope.cityId!==void 0&&e.scope.cityId!==null&&t.push({name:"cityId",val:H("cityId",[e.scope.cityId])}),e.scope.provinceId!==void 0&&e.scope.provinceId!==null&&t.push({name:"provinceId",val:H("provinceId",[e.scope.provinceId])})),t}function k(e){const t={current:e.page??1,size:e.size??10,level:e.level,searchContent:e.keyword??void 0,displayInfo:e.displayInfo??br,sort:e.sort},n=Er({ids:e.ids,scope:e.scope});return t.appointSearch=[...n,...e.extraAppoint||[]],Object.keys(t).forEach(r=>{t[r]===void 0&&delete t[r]}),t}function Cr(e,t,n){const r=_e(),s=(u,l)=>{if(!u)return"";const p=u.nameCn??u[`${l.toLowerCase()}NameCn`]??u.name,g=u.nameEn??u[`${l.toLowerCase()}NameEn`];return r?g||p||"":p||g||""},o=s(e,t),i=s(n.country,"country"),c=s(n.city,"city"),f=s(n.continent,"continent");switch(t){case"Seaport":case"Airport":const u=[c,i].filter(Boolean).join(", ");return u?`${o} (${u})`:o;case"City":case"Province":return i?`${o} (${i})`:o;case"Country":return f?`${o} (${f})`:o;default:return o}}function _(e=[],t=[]){const n=[];function r(o,i,c){if(!o||!t.includes(i))return;const f=o.id??o[i.toLowerCase()+"Id"]??null;if(f==null)return;const u=o.nameCn??o[`${i.toLowerCase()}NameCn`]??o.name??void 0,l=o.nameEn??o[`${i.toLowerCase()}NameEn`]??void 0,p=Cr(o,i,c)||u||l||"";n.push({id:f,type:i,nameCn:u,nameEn:l,display:p,continent:c.continent??void 0,country:c.country??void 0,city:c.city??void 0,province:c.province??void 0,raw:o})}for(const o of e){const i={continent:o.continent??void 0,country:o.country??void 0,city:o.city??void 0,province:o.province??void 0};let c=!1;if(["Continent","Country","Province","City","Seaport","Airport"].forEach(u=>{const l=u.toLowerCase();o[l]&&(r(o[l],u,i),c=!0)}),!c&&o.id!==void 0){let u;o.type&&t.includes(o.type)?u=o.type:t.length===1&&(u=t[0]),u&&r(o,u,i)}}const s=new Set;return n.filter(o=>{const i=`${o.type}_${o.id}`;return s.has(i)?!1:(s.add(i),!0)})}async function F(e){return(await Nt.post(wr(),e)).data}async function te(e){const t=k({keyword:e.keyword,displayInfo:e.displayInfo,page:e.page,size:e.size,level:e.level,sort:e.sort,ids:e.ids,scope:e.scope,extraAppoint:e.extraAppoint}),n=await F(t),r=_(n.data?.records||[],t.displayInfo||[]);return{...n,records:r}}async function Fe(e){if(!e.keyword?.trim())throw new Error("searchByName: keyword 不能为空");const t=e.types&&e.types.length>0?e.types:["Continent","Country","City","Province","Seaport","Airport"];return te({keyword:e.keyword.trim(),displayInfo:t,page:e.page,size:e.size,level:e.level,sort:e.sort})}async function xt(e,t){const n=Array.isArray(t)?t:[t],r=[e],s=k({displayInfo:r,ids:[{type:e,ids:n}]}),o=await F(s);return _(o.records||[],r).filter(c=>c.type===e)}async function Ar(e,t){return(await xt(e,[t]))[0]??null}async function Rr(e,t){const n=["City"],r=k({displayInfo:n,page:t?.page??1,size:t?.size??1e3,extraAppoint:[{name:"allCityByCountryId",val:H("allCityByCountryId",e)}]}),s=await F(r);return{...s,records:_(s.records||[],n)}}async function Or(e,t,n){if(!t||t.length===0)throw new Error("childTypes 必须至少包含一个:Seaport | Airport");const r=t,s=k({displayInfo:r,page:n?.page??1,size:n?.size??1e3,extraAppoint:[{name:"cityId",val:H("cityId",[e])}]}),o=await F(s);return{...o,records:_(o.records||[],r)}}function Ir(e,t){return Fe({keyword:e,types:["Country"],page:t?.page,size:t?.size})}function Tr(e,t){return t?.countryId?te({keyword:e,displayInfo:["City"],scope:{countryId:t.countryId},page:t.page,size:t.size}):Fe({keyword:e,types:["City"],page:t?.page,size:t?.size})}function Nr(e,t){return te({keyword:e,displayInfo:["Seaport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}function Pr(e,t){return te({keyword:e,displayInfo:["Airport"],scope:t?.cityId?{cityId:t.cityId}:void 0,page:t?.page,size:t?.size})}async function xr(e={}){const t=["Continent"],n=await F({current:e.page??1,size:e.size??10,level:1,displayInfo:t});return{...n,records:_(n.records||[],t)}}async function Br(e={}){const t=["Country"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Country",ids:e.ids}]:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Lr(e={}){const t=["City"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"City",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function _r(e={}){const t=["Province"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Province",ids:e.ids}]:void 0,scope:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function Fr(e={}){const t=["Seaport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Seaport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}async function kr(e={}){const t=["Airport"],n=k({displayInfo:t,page:e.page??1,size:e.size??10,ids:e.ids?[{type:"Airport",ids:e.ids}]:void 0,scope:e.cityId?{cityId:e.cityId}:e.countryId?{countryId:e.countryId}:void 0}),r=await F(n);return{...r,records:_(r.records||[],t)}}const Ur="2.0",Dr=()=>Le().basePath;function Bt(e){let t=e.type;return t==="Country"&&e.region&&!e.country?{target:e.region,finalType:"Region"}:{target:e[t.toLowerCase()]||{},finalType:t}}function Ee(e,t){const{target:n,finalType:r}=Bt(e),s=u=>{if(!u)return"";const l=u.nameCn||u.displayNameCn||u.name||"",p=u.nameEn||u.displayNameEn||u.nameEnShow||"";return t?p||l:l||p},o=s(n),i=e.country||e.region,c=s(i),f=s(e.city);if(["Seaport","Airport","Wharf"].includes(r)){const u=[f,c].filter(Boolean).join(", ");return u?`${o} (${u})`:o}return["City","Province"].includes(r)&&c?`${o} (${c})`:o}function vr(e=[]){return e.map(t=>{const{target:n,finalType:r}=Bt(t);return{id:n.id??t.id,type:r,nameCn:n.nameCn||n.name,nameEn:n.nameEn||n.nameEnShow,display:Ee(t,_e()),displayEn:Ee(t,!0),displayCn:Ee(t,!1),raw:t}})}async function A(e){const t={current:1,size:10,...e},r=(await Nt.post(Dr(),t)).data.data||{};return{...r,records:vr(r.records||[])}}const Lt={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},_t={searchByName:e=>A({searchContent:e.keyword,searchMode:e.searchMode,...e,displayInfo:["Country"]}),getByIds:e=>A({countryIds:e,displayInfo:["Country"]})},Te={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["City"]}),getByIds:e=>A({cityIds:e,displayInfo:["City"]}),getCitiesByCountry:(e,t)=>A({countryIds:[e],displayInfo:["City"],...t})},Ft={searchByName:e=>A({searchContent:e.keyword,cityIds:e.cityId?[e.cityId]:void 0,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Seaport"]}),getByIds:e=>A({seaportIds:e,displayInfo:["Seaport"]})},kt={searchByName:e=>A({searchContent:e.keyword,countryIds:e.countryId?[e.countryId]:void 0,...e,displayInfo:["Airport"]}),getByIds:e=>A({airportIds:e,displayInfo:["Airport"]})},Ut={getByIds:e=>A({wharfIds:e,displayInfo:["Wharf"]})},zr=e=>A({searchContent:e.keyword,...e}),qr=(e,t)=>{const n=Array.isArray(e)?e:[e];switch(t){case"Country":return Lt.getByIds(n);case"Region":return _t.getByIds(n);case"City":return Te.getByIds(n);case"Seaport":return Ft.getByIds(n);case"Airport":return kt.getByIds(n);case"Wharf":return Ut.getByIds(n);default:return A({[`${t.toLowerCase()}Ids`]:n,displayInfo:[t]})}},jr={SEARCH_VERSION:Ur,searchByName:zr,searchByIdWithType:qr,country:Lt,region:_t,city:Te,seaport:Ft,airport:kt,wharf:Ut,getCitiesByCountry:Te.getCitiesByCountry,getChildrenByCity:(e,t,n)=>A({cityIds:[e],displayInfo:t,...n})},$r={Open:"GLOBAL_MODAL_OPEN",Close:"GLOBAL_MODAL_CLOSE",Submit:"GLOBAL_MODAL_SUBMIT"},Mr=vt();exports.MODAL_ACTION=$r;exports.createRequest=mr;exports.currentConfig=Pt;exports.emitter=Mr;exports.getAirport=kr;exports.getById=Ar;exports.getByIds=xt;exports.getChildrenByCity=Or;exports.getCitiesByCountry=Rr;exports.getCity=Lr;exports.getContinent=xr;exports.getCountry=Br;exports.getIsEn=_e;exports.getProvince=_r;exports.getSeaport=Fr;exports.getSharedConfig=Le;exports.initSharedConfig=gr;exports.locationSearchV2=jr;exports.search=te;exports.searchAirportByName=Pr;exports.searchByName=Fe;exports.searchCityByName=Tr;exports.searchCountryByName=Ir;exports.searchSeaportByName=Nr;
|
package/dist/index.esm.js
CHANGED
|
@@ -1844,25 +1844,25 @@ const Ot = {
|
|
|
1844
1844
|
}, Vr = (e) => {
|
|
1845
1845
|
e && (e.prefixPath !== void 0 && (ue.prefixPath = e.prefixPath), e.searchPath !== void 0 && (ue.searchPath = e.searchPath));
|
|
1846
1846
|
}, It = () => hr, Tt = () => {
|
|
1847
|
+
let e;
|
|
1847
1848
|
try {
|
|
1848
|
-
|
|
1849
|
-
if (typeof n == "function") {
|
|
1850
|
-
const r = n("jc-language").value;
|
|
1851
|
-
if (r) return /en/i.test(r) || /en-US/i.test(r);
|
|
1852
|
-
}
|
|
1849
|
+
typeof useCookie == "function" && (e = useCookie("jc-language")?.value);
|
|
1853
1850
|
} catch {
|
|
1854
1851
|
}
|
|
1855
|
-
const e = typeof window < "u" && typeof document < "u";
|
|
1856
|
-
let t = "";
|
|
1857
1852
|
if (e)
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1853
|
+
return e === "en" || e === "en-US";
|
|
1854
|
+
if (typeof document < "u") {
|
|
1855
|
+
const t = document.cookie || "";
|
|
1856
|
+
return /(^|;\s*)jc-language=en(-US)?(;|$)/.test(t);
|
|
1857
|
+
}
|
|
1858
|
+
try {
|
|
1859
|
+
if (typeof useNuxtApp == "function") {
|
|
1860
|
+
const n = useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie || "";
|
|
1861
|
+
return /(^|;\s*)jc-language=en(-US)?(;|$)/.test(n);
|
|
1864
1862
|
}
|
|
1865
|
-
|
|
1863
|
+
} catch {
|
|
1864
|
+
}
|
|
1865
|
+
return !1;
|
|
1866
1866
|
}, yr = () => It().basePath, mr = {
|
|
1867
1867
|
Continent: "continentId",
|
|
1868
1868
|
Country: "countryId",
|