@akad/sdk 1.0.20 → 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/ts-lib.umd.cjs CHANGED
@@ -1,6 +1,6 @@
1
- (function(U,D){typeof exports=="object"&&typeof module<"u"?module.exports=D():typeof define=="function"&&define.amd?define(D):(U=typeof globalThis<"u"?globalThis:U||self,U["ts-lib"]=D())})(this,function(){"use strict";function U(e,t){return function(){return e.apply(t,arguments)}}const{toString:D}=Object.prototype,{getPrototypeOf:ee}=Object,M=(e=>t=>{const n=D.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>M(t)===e),z=e=>t=>typeof t===e,{isArray:L}=Array,_=z("undefined");function nt(e){return e!==null&&!_(e)&&e.constructor!==null&&!_(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=A("ArrayBuffer");function rt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ye(e.buffer),t}const st=z("string"),R=z("function"),be=z("number"),V=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,G=e=>{if(M(e)!=="object")return!1;const t=ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},it=A("Date"),at=A("File"),ct=A("Blob"),ut=A("FileList"),lt=e=>V(e)&&R(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=M(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},dt=A("URLSearchParams"),[ht,pt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(A),bt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),L(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function ge(e,t){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 we=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Te=e=>!_(e)&&e!==we;function te(){const{caseless:e}=Te(this)&&this||{},t={},n=(r,s)=>{const o=e&&ge(t,s)||s;G(t[o])&&G(r)?t[o]=te(t[o],r):G(r)?t[o]=te({},r):L(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&I(arguments[r],n);return t}const gt=(e,t,n,{allOwnKeys:r}={})=>(I(t,(s,o)=>{n&&R(s)?e[o]=U(s,n):e[o]=s},{allOwnKeys:r}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tt=(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)},St=(e,t,n,r)=>{let s,o,i;const u={};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))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Et=(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},Rt=e=>{if(!e)return null;if(L(e))return e;let t=e.length;if(!be(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ee(Uint8Array)),At=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Pt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Nt=A("HTMLFormElement"),kt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ct=A("RegExp"),Ee=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},xt=e=>{Ee(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(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+"'")})}})},Bt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return L(e)?r(e):r(String(e).split(t)),n},Ft=()=>{},Ut=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ne="abcdefghijklmnopqrstuvwxyz",Re="0123456789",Oe={DIGIT:Re,ALPHA:ne,ALPHA_DIGIT:ne+ne.toUpperCase()+Re},Lt=(e=16,t=Oe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function $t(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const qt=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=L(r)?[]:{};return I(r,(i,u)=>{const f=n(i,s+1);!_(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},Dt=A("AsyncFunction"),c={isArray:L,isArrayBuffer:ye,isBuffer:nt,isFormData:ft,isArrayBufferView:rt,isString:st,isNumber:be,isBoolean:ot,isObject:V,isPlainObject:G,isReadableStream:ht,isRequest:pt,isResponse:mt,isHeaders:yt,isUndefined:_,isDate:it,isFile:at,isBlob:ct,isRegExp:Ct,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:gt,trim:bt,stripBOM:wt,inherits:Tt,toFlatObject:St,kindOf:M,kindOfTest:A,endsWith:Et,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Ee,freezeMethods:xt,toObjectSet:Bt,toCamelCase:kt,noop:Ft,toFiniteNumber:Ut,findKey:ge,global:we,isContextDefined:Te,ALPHABET:Oe,generateString:Lt,isSpecCompliantForm:$t,toJSONObject:qt,isAsyncFn:Dt,isThenable:e=>e&&(V(e)||R(e))&&R(e.then)&&R(e.catch)};function y(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)}c.inherits(y,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:c.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ae=y.prototype,Pe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pe[e]={value:e}}),Object.defineProperties(y,Pe),Object.defineProperty(Ae,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,o)=>{const i=Object.create(Ae);return c.toFlatObject(e,i,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),y.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const _t=null;function re(e){return c.isPlainObject(e)||c.isArray(e)}function Ne(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ne(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function It(e){return c.isArray(e)&&!e.some(re)}const jt=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function K(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!c.isUndefined(g[p])});const r=n.metaTokens,s=n.visitor||a,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(!f&&c.isBlob(h))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function a(h,p,g){let S=h;if(h&&!g&&typeof h=="object"){if(c.endsWith(p,"{}"))p=r?p:p.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&It(h)||(c.isFileList(h)||c.endsWith(p,"[]"))&&(S=c.toArray(h)))return p=Ne(p),S.forEach(function(w,J){!(c.isUndefined(w)||w===null)&&t.append(i===!0?ke([p],J,o):i===null?p:p+"[]",l(w))}),!1}return re(h)?!0:(t.append(ke(g,p,o),l(h)),!1)}const d=[],m=Object.assign(jt,{defaultVisitor:a,convertValue:l,isVisitable:re});function b(h,p){if(!c.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));d.push(h),c.forEach(h,function(S,N){(!(c.isUndefined(S)||S===null)&&s.call(t,S,c.isString(N)?N.trim():N,p,m))===!0&&b(S,p?p.concat(N):[N])}),d.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function se(e,t){this._pairs=[],e&&K(e,this,t)}const xe=se.prototype;xe.append=function(t,n){this._pairs.push([t,n])},xe.toString=function(t){const n=t?function(r){return t.call(this,r,Ce)}:Ce;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let o;if(s?o=s(t,n):o=c.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Fe{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){c.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:se,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},oe=typeof window<"u"&&typeof document<"u",Mt=(e=>oe&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vt=oe&&window.location.href||"http://localhost",P={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oe,hasStandardBrowserEnv:Mt,hasStandardBrowserWebWorkerEnv:zt,origin:Vt},Symbol.toStringTag,{value:"Module"})),...Jt};function Gt(e,t){return K(e,new P.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return P.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(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 Le(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const u=Number.isFinite(+i),f=o>=n.length;return i=!i&&c.isArray(s)?s.length:i,f?(c.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&c.isArray(s[i])&&(s[i]=vt(s[i])),!u)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(r,s)=>{t(Kt(r),s,n,0)}),n}return null}function Wt(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const j={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(Le(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((u=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return K(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const n=this.transitional||j.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?y.from(u,y.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{j.headers[e]={}});const Qt=c.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"]),Xt=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Qt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},$e=Symbol("internals");function H(e){return e&&String(e).trim().toLowerCase()}function v(e){return e===!1||e==null?e:c.isArray(e)?e.map(v):String(e)}function Zt(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 Yt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ie(e,t,n,r,s){if(c.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!c.isString(t)){if(c.isString(r))return t.indexOf(r)!==-1;if(c.isRegExp(r))return r.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tn(e,t){const n=c.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 E=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,f,l){const a=H(f);if(!a)throw new Error("header name must be a non-empty string");const d=c.findKey(s,a);(!d||s[d]===void 0||l===!0||l===void 0&&s[d]!==!1)&&(s[d||f]=v(u))}const i=(u,f)=>c.forEach(u,(l,a)=>o(l,a,f));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(c.isString(t)&&(t=t.trim())&&!Yt(t))i(Xt(t),n);else if(c.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=H(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Zt(s);if(c.isFunction(n))return n.call(this,s,r);if(c.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=H(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ie(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=H(i),i){const u=c.findKey(r,i);u&&(!n||ie(r,r[u],u,n))&&(delete r[u],s=!0)}}return c.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||ie(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return c.forEach(this,(s,o)=>{const i=c.findKey(r,o);if(i){n[i]=v(s),delete n[o];return}const u=t?en(o):String(o).trim();u!==o&&delete n[o],n[u]=v(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&c.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
- `)}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[$e]=this[$e]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=H(i);r[u]||(tn(s,i),r[u]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};E.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(E.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),c.freezeMethods(E);function ae(e,t){const n=this||j,r=t||n,s=E.from(r.headers);let o=r.data;return c.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function qe(e){return!!(e&&e.__CANCEL__)}function $(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits($,y,{__CANCEL__:!0});function De(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function nn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rn(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 l=Date.now(),a=r[o];i||(i=l),n[s]=f,r[s]=l;let d=o,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const b=a&&l-a;return b?Math.round(m*1e3/b):void 0}}function sn(e,t){let n=0;const r=1e3/t;let s=null;return function(){const i=this===!0,u=Date.now();if(i||u-n>r)return s&&(clearTimeout(s),s=null),n=u,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(u-n)))}}const W=(e,t,n=3)=>{let r=0;const s=rn(50,250);return sn(o=>{const i=o.loaded,u=o.lengthComputable?o.total:void 0,f=i-r,l=s(f),a=i<=u;r=i;const d={loaded:i,total:u,progress:u?i/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-i)/l:void 0,event:o,lengthComputable:u!=null};d[t?"download":"upload"]=!0,e(d)},n)},on=P.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=c.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),an=P.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];c.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),c.isString(r)&&i.push("path="+r),c.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function _e(e,t){return e&&!cn(t)?un(e,t):t}const Ie=e=>e instanceof E?{...e}:e;function B(e,t){t=t||{};const n={};function r(l,a,d){return c.isPlainObject(l)&&c.isPlainObject(a)?c.merge.call({caseless:d},l,a):c.isPlainObject(a)?c.merge({},a):c.isArray(a)?a.slice():a}function s(l,a,d){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l,d)}else return r(l,a,d)}function o(l,a){if(!c.isUndefined(a))return r(void 0,a)}function i(l,a){if(c.isUndefined(a)){if(!c.isUndefined(l))return r(void 0,l)}else return r(void 0,a)}function u(l,a,d){if(d in t)return r(l,a);if(d in e)return r(void 0,l)}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:u,headers:(l,a)=>s(Ie(l),Ie(a),!0)};return c.forEach(Object.keys(Object.assign({},e,t)),function(a){const d=f[a]||s,m=d(e[a],t[a],a);c.isUndefined(m)&&d!==u||(n[a]=m)}),n}const je=e=>{const t=B({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:u}=t;t.headers=i=E.from(i),t.url=Be(_e(t.baseURL,t.url),e.params,e.paramsSerializer),u&&i.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(c.isFormData(n)){if(P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[l,...a]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([l||"multipart/form-data",...a].join("; "))}}if(P.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&on(t.url))){const l=s&&o&&an.read(o);l&&i.set(s,l)}return t},ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=je(e);let o=s.data;const i=E.from(s.headers).normalize();let{responseType:u}=s,f;function l(){s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let a=new XMLHttpRequest;a.open(s.method.toUpperCase(),s.url,!0),a.timeout=s.timeout;function d(){if(!a)return;const b=E.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),p={data:!u||u==="text"||u==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:b,config:e,request:a};De(function(S){n(S),l()},function(S){r(S),l()},p),a=null}"onloadend"in a?a.onloadend=d:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(d)},a.onabort=function(){a&&(r(new y("Request aborted",y.ECONNABORTED,s,a)),a=null)},a.onerror=function(){r(new y("Network Error",y.ERR_NETWORK,s,a)),a=null},a.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const p=s.transitional||Ue;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),r(new y(h,p.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,s,a)),a=null},o===void 0&&i.setContentType(null),"setRequestHeader"in a&&c.forEach(i.toJSON(),function(h,p){a.setRequestHeader(p,h)}),c.isUndefined(s.withCredentials)||(a.withCredentials=!!s.withCredentials),u&&u!=="json"&&(a.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&a.addEventListener("progress",W(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",W(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=b=>{a&&(r(!b||b.type?new $(null,e,a):b),a.abort(),a=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const m=nn(s.url);if(m&&P.protocols.indexOf(m)===-1){r(new y("Unsupported protocol "+m+":",y.ERR_BAD_REQUEST,e));return}a.send(o||null)})},fn=(e,t)=>{let n=new AbortController,r;const s=function(f){if(!r){r=!0,i();const l=f instanceof Error?f:this.reason;n.abort(l instanceof y?l:new $(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{s(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",s):f.unsubscribe(s))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",s));const{signal:u}=n;return u.unsubscribe=i,[u,()=>{o&&clearTimeout(o),o=null}]},dn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},hn=async function*(e,t,n){for await(const r of e)yield*dn(ArrayBuffer.isView(r)?r:await n(String(r)),t)},He=(e,t,n,r,s)=>{const o=hn(e,t,s);let i=0;return new ReadableStream({type:"bytes",async pull(u){const{done:f,value:l}=await o.next();if(f){u.close(),r();return}let a=l.byteLength;n&&n(i+=a),u.enqueue(new Uint8Array(l))},cancel(u){return r(u),o.return()}},{highWaterMark:2})},Je=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Me=Q&&typeof ReadableStream=="function",ce=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),pn=Me&&(()=>{let e=!1;const t=new Request(P.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),ze=64*1024,ue=Me&&!!(()=>{try{return c.isReadableStream(new Response("").body)}catch{}})(),X={stream:ue&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=c.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new y(`Response type '${t}' is not supported`,y.ERR_NOT_SUPPORT,r)})})})(new Response);const mn=async e=>{if(e==null)return 0;if(c.isBlob(e))return e.size;if(c.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(c.isArrayBufferView(e))return e.byteLength;if(c.isURLSearchParams(e)&&(e=e+""),c.isString(e))return(await ce(e)).byteLength},yn=async(e,t)=>{const n=c.toFiniteNumber(e.getContentLength());return n??mn(t)},le={http:_t,xhr:ln,fetch:Q&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:d="same-origin",fetchOptions:m}=je(e);l=l?(l+"").toLowerCase():"text";let[b,h]=s||o||i?fn([s,o],i):[],p,g;const S=()=>{!p&&setTimeout(()=>{b&&b.unsubscribe()}),p=!0};let N;try{if(f&&pn&&n!=="get"&&n!=="head"&&(N=await yn(a,r))!==0){let x=new Request(t,{method:"POST",body:r,duplex:"half"}),q;c.isFormData(r)&&(q=x.headers.get("content-type"))&&a.setContentType(q),x.body&&(r=He(x.body,ze,Je(N,W(f)),null,ce))}c.isString(d)||(d=d?"cors":"omit"),g=new Request(t,{...m,signal:b,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(g);const J=ue&&(l==="stream"||l==="response");if(ue&&(u||J)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const q=c.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,ze,u&&Je(q,W(u,!0)),J&&S,ce),x)}l=l||"text";let Hn=await X[c.findKey(X,l)||"text"](w,e);return!J&&S(),h&&h(),await new Promise((x,q)=>{De(x,q,{data:Hn,headers:E.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:g})})}catch(w){throw S(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,g),{cause:w.cause||w}):y.from(w,w&&w.code,e,g)}})};c.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ve=e=>`- ${e}`,bn=e=>c.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=c.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!bn(n)&&(r=le[(i=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
- `+o.map(Ve).join(`
5
- `):" "+Ve(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $(null,e)}function Ke(e){return fe(e),e.headers=E.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||j.adapter)(e).then(function(r){return fe(e),r.data=ae.call(e,e.transformResponse,r),r.headers=E.from(r.headers),r},function(r){return qe(r)||(fe(e),r&&r.response&&(r.response.data=ae.call(e,e.transformResponse,r.response),r.response.headers=E.from(r.response.headers))),Promise.reject(r)})}const ve="1.7.2",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const We={};de.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ve+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!We[i]&&(We[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function gn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.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 u=e[o],f=u===void 0||i(u,o,e);if(f!==!0)throw new y("option "+o+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const he={assertOptions:gn,validators:de},k=he.validators;let F=class{constructor(t){this.defaults=t,this.interceptors={request:new Fe,response:new Fe}}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=B(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&he.assertOptions(r,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:k.function,serialize:k.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[n.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=E.concat(i,o);const u=[];let f=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(f=f&&p.synchronous,u.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let a,d=0,m;if(!f){const h=[Ke.bind(this),void 0];for(h.unshift.apply(h,u),h.push.apply(h,l),m=h.length,a=Promise.resolve(n);d<m;)a=a.then(h[d++],h[d++]);return a}m=u.length;let b=n;for(d=0;d<m;){const h=u[d++],p=u[d++];try{b=h(b)}catch(g){p.call(this,g);break}}try{a=Ke.call(this,b)}catch(h){return Promise.reject(h)}for(d=0,m=l.length;d<m;)a=a.then(l[d++],l[d++]);return a}getUri(t){t=B(this.defaults,t);const n=_e(t.baseURL,t.url);return Be(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){F.prototype[t]=function(n,r){return this.request(B(r||{},{method:t,url:n,data:(r||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(B(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}F.prototype[t]=n(),F.prototype[t+"Form"]=n(!0)});let wn=class tt{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(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new $(o,i,u),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)}static source(){let t;return{token:new tt(function(s){t=s}),cancel:t}}};function Tn(e){return function(n){return e.apply(null,n)}}function Sn(e){return c.isObject(e)&&e.isAxiosError===!0}const pe={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};Object.entries(pe).forEach(([e,t])=>{pe[t]=e});function Qe(e){const t=new F(e),n=U(F.prototype.request,t);return c.extend(n,F.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qe(B(e,s))},n}const T=Qe(j);T.Axios=F,T.CanceledError=$,T.CancelToken=wn,T.isCancel=qe,T.VERSION=ve,T.toFormData=K,T.AxiosError=y,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Tn,T.isAxiosError=Sn,T.mergeConfig=B,T.AxiosHeaders=E,T.formToJSON=e=>Le(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Ge.getAdapter,T.HttpStatusCode=pe,T.default=T;const{Axios:Wn,AxiosError:En,CanceledError:Qn,isCancel:Xn,CancelToken:Zn,VERSION:Yn,all:er,Cancel:tr,isAxiosError:nr,spread:rr,toFormData:sr,AxiosHeaders:Xe,HttpStatusCode:or,formToJSON:ir,getAdapter:ar,mergeConfig:cr}=T,Z=()=>new En("Unauthorized","ERR_UNAUTHORIZED",{headers:new Xe},null,{status:401,data:null,statusText:"UNAUTHORIZED",headers:{},config:{headers:new Xe}}),Rn=e=>{let t=!1;const n=[],r=()=>localStorage.getItem("accessToken"),s=()=>localStorage.getItem("refreshToken"),o=a=>{localStorage.setItem("accessToken",a.accessToken),localStorage.setItem("refreshToken",a.refreshToken)},i=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken")},u=(a,d=null)=>{n.forEach(m=>{var b;a?m.reject(a):((b=m.requestConfig).headers??(b.headers={}),m.requestConfig.headers.Authorization=`Bearer ${d}`,m.resolve(m.requestConfig))}),n.length=0};return{getAccessToken:r,setTokens:o,clearTokens:i,handleTokenRefresh:async a=>{var h;if((h=a.url)==null?void 0:h.includes(e.refreshTokenEndpointPath)){i();const p=Z();throw u(p),p}if(!r()){i();const p=Z();throw u(p),p}if(t)return new Promise((p,g)=>{n.push({resolve:p,reject:g,requestConfig:a})});const b=s();if(!b){i();const p=Z();throw u(p),p}t=!0;try{const p=await e.onRefreshToken(b);return o(p),a.headers??(a.headers={}),a.headers.Authorization=`Bearer ${p.accessToken}`,u(null,p.accessToken),t=!1,a}catch{i();const g=Z();throw u(g),t=!1,g}},isAuthError:a=>{var d;return((d=a==null?void 0:a.response)==null?void 0:d.status)===401}}},O=e=>{const t=T.create(),n=e.apiVersion,r=e.productCode,s=e.baseUrl,o=s?s.replace(/\/$/,""):"",i=e.refreshTokenApiVersion??n,u=e.refreshTokenEndpointPath??"/refresh-token",f=`${o}/auth/${i}${u}`,l=Rn({baseUrl:s??"",apiVersion:n,refreshTokenEndpointPath:u,onRefreshToken:async d=>(await t.post(f,{refreshToken:d})).data});return t.interceptors.response.use(d=>d,async d=>{const m=d.config;if(!l.isAuthError(d)||m._retry)return Promise.reject(d);m._retry=!0;try{const b=await l.handleTokenRefresh(m);return t.request(b)}catch(b){return Promise.reject(b)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(d,m)=>{const b=d.startsWith("/")?d.substring(1):d,h=`${o}/${r}/${n}/${b}`,p={"Content-Type":(m==null?void 0:m.contentType)??"application/json",apiVersion:n,Authorization:"",...e.headers??{},...(m==null?void 0:m.headers)??{}},g=l.getAccessToken();g&&(p.Authorization=`Bearer ${g}`);const S={method:(m==null?void 0:m.method)??"GET",headers:p,url:h,data:m==null?void 0:m.data,responseType:m==null?void 0:m.responseType};return await t.request(S)},getAccessToken:l.getAccessToken,setTokens:l.setTokens,clearTokens:l.clearTokens}},On="cep";function An(e){const t=O(e);function n(r){return t.request(`/${On}`,{method:"POST",data:JSON.stringify(r)})}return{getAddress:n}}const Ze="auth",Pn=e=>{const t=O(e);return{postLogin:async s=>{var i;const o=await t.request(`/${Ze}/login`,{method:"POST",data:JSON.stringify(s)});return o.status===200&&((i=o.data)!=null&&i.accessToken)&&localStorage.setItem("accessToken",o.data.accessToken),o},getToken:async s=>await t.request(`/${Ze}?code=${s}`,{method:"GET",data:""})}},Nn=e=>{const t=O(e);return{signUp:async u=>await t.request("/sign-up",{method:"POST",data:JSON.stringify(u)}),signIn:async u=>{var l,a;const f=await t.request("/sign-in",{method:"POST",data:JSON.stringify(u)});return f.status===200&&((l=f.data)!=null&&l.accessToken)&&((a=f.data)!=null&&a.refreshToken)&&t.setTokens(f.data),f},getProfile:async()=>await t.request("/me",{method:"GET",data:""}),recoverPassword:async u=>await t.request("/recovery",{method:"POST",data:JSON.stringify(u)}),updatePassword:async u=>await t.request("/update-password",{method:"POST",data:JSON.stringify(u)})}},Ye="digital",kn=e=>{const t=O(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},Cn="data",xn=e=>{const t=O(e);return{postData:async r=>await t.request(`/${Cn}`,{method:"POST",data:JSON.stringify(r)})}},Bn="endorsement",Fn=e=>{const t=O(e);return{putEndorsement:(r,s)=>{const o=new FormData;return o.append("data",JSON.stringify(r)),s&&(Array.isArray(s)?s.forEach(i=>{o.append("attachments",i)}):o.append("attachments",s)),t.request(`/${Bn}`,{method:"PUT",data:o,contentType:"multipart/form-data"})}}},me="payment",Un=e=>{const t=O(e);return{postPayment:o=>t.request(`/${me}`,{method:"POST",data:JSON.stringify(o)}),getPaymentStatus:o=>t.request(`/${me}/status?policyId=${o.policyId}`,{method:"GET",data:""}),getPaymentSummary:o=>t.request(`/${me}/summary?policyId=${o.policyId}`,{method:"GET",data:""})}},Y="product/action",Ln=e=>{const t=O(e);return{getCnpjStatus:i=>t.request(`/${Y}/Custom/CnpjCheck?cnpj=${i}`,{method:"GET",data:""}),getKeyNumber:()=>t.request(`/${Y}/Custom/GetKeyNumber`,{method:"GET",data:""}),getProposalNumberByKeyNumber:i=>t.request(`/${Y}/Custom/GetProposalNoByKeyNumber?keyNumber=${i.keyNumber}`,{method:"GET",data:""}),postCoveragesAndClausesRules:i=>t.request(`/${Y}/Custom/LoadRules`,{method:"POST",data:JSON.stringify(i)})}},C="quotation",$n=e=>{const t=O(e);return{getQuotations:a=>{const d=new URLSearchParams({...a});return t.request(`/${C}/query?${d.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const d=new URLSearchParams({id:a.policyId});return t.request(`/${C}?${d.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${C}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${C}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${C}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${C}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${C}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${C}/switchSelectedVersion?policyId=${a.policyId}&quotationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},qn="report",Dn=e=>{const t=O(e);return{getReportStream:r=>{const s=new URLSearchParams({policyId:r.policyId,documentType:r.documentType??"certificate",...r.additionalParams});return t.request(`/${qn}/generate-stream?${s.toString()}`,{method:"GET",data:"",responseType:"blob"})}}},_n="SubscriberData",In=e=>{const t=O(e);return{getSubscriber:r=>t.request(`/${_n}/get-subscriber-data?cnpj=${r}`,{method:"GET",data:""})}};function jn(e){const t=Pn(e),n=Nn(e),r=xn(e),s=$n(e),o=Un(e),i=An(e),u=kn(e),f=Fn(e),l=Ln(e),a=Dn(e),d=In(e),m=O(e);return{auth:t,authAkad:n,data:r,quotation:s,payment:o,address:i,broker:u,endorsement:f,plugin:l,report:a,subscriber:d,base:m}}return jn});
1
+ (function(F,_){typeof exports=="object"&&typeof module<"u"?module.exports=_():typeof define=="function"&&define.amd?define(_):(F=typeof globalThis<"u"?globalThis:F||self,F["ts-lib"]=_())})(this,function(){"use strict";function F(e,t){return function(){return e.apply(t,arguments)}}const{toString:_}=Object.prototype,{getPrototypeOf:ee}=Object,M=(e=>t=>{const r=_.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>M(t)===e),z=e=>t=>typeof t===e,{isArray:q}=Array,$=z("undefined");function nt(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=A("ArrayBuffer");function rt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ye(e.buffer),t}const st=z("string"),R=z("function"),ge=z("number"),V=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,G=e=>{if(M(e)!=="object")return!1;const t=ee(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},it=A("Date"),at=A("File"),ct=A("Blob"),ut=A("FileList"),lt=e=>V(e)&&R(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=M(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},dt=A("URLSearchParams"),[ht,pt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(A),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function I(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),q(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(n=0;n<o;n++)c=i[n],t.call(null,e[c],c,e)}}function be(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const we=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Se=e=>!$(e)&&e!==we;function te(){const{caseless:e}=Se(this)&&this||{},t={},r=(n,s)=>{const i=e&&be(t,s)||s;G(t[i])&&G(n)?t[i]=te(t[i],n):G(n)?t[i]=te({},n):q(n)?t[i]=n.slice():t[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&I(arguments[n],r);return t}const bt=(e,t,r,{allOwnKeys:n}={})=>(I(t,(s,i)=>{r&&R(s)?e[i]=F(s,r):e[i]=s},{allOwnKeys:n}),e),wt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(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)},Tt=(e,t,r,n)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!n||n(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=r!==!1&&ee(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Et=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Rt=e=>{if(!e)return null;if(q(e))return e;let t=e.length;if(!ge(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Ot=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ee(Uint8Array)),At=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Pt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Nt=A("HTMLFormElement"),kt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Te=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Ct=A("RegExp"),Ee=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};I(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},xt=e=>{Ee(e,(t,r)=>{if(R(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(R(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Bt=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return q(e)?n(e):n(String(e).split(t)),r},Ut=()=>{},Ft=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ne="abcdefghijklmnopqrstuvwxyz",Re="0123456789",Oe={DIGIT:Re,ALPHA:ne,ALPHA_DIGIT:ne+ne.toUpperCase()+Re},qt=(e=16,t=Oe.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r};function Lt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Dt=e=>{const t=new Array(10),r=(n,s)=>{if(V(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[s]=n;const i=q(n)?[]:{};return I(n,(o,c)=>{const f=r(o,s+1);!$(f)&&(i[c]=f)}),t[s]=void 0,i}}return n};return r(e,0)},_t=A("AsyncFunction"),u={isArray:q,isArrayBuffer:ye,isBuffer:nt,isFormData:ft,isArrayBufferView:rt,isString:st,isNumber:ge,isBoolean:ot,isObject:V,isPlainObject:G,isReadableStream:ht,isRequest:pt,isResponse:mt,isHeaders:yt,isUndefined:$,isDate:it,isFile:at,isBlob:ct,isRegExp:Ct,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:bt,trim:gt,stripBOM:wt,inherits:St,toFlatObject:Tt,kindOf:M,kindOfTest:A,endsWith:Et,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Te,hasOwnProp:Te,reduceDescriptors:Ee,freezeMethods:xt,toObjectSet:Bt,toCamelCase:kt,noop:Ut,toFiniteNumber:Ft,findKey:be,global:we,isContextDefined:Se,ALPHABET:Oe,generateString:qt,isSpecCompliantForm:Lt,toJSONObject:Dt,isAsyncFn:_t,isThenable:e=>e&&(V(e)||R(e))&&R(e.then)&&R(e.catch)};function m(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)}u.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:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ae=m.prototype,Pe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pe[e]={value:e}}),Object.defineProperties(m,Pe),Object.defineProperty(Ae,"isAxiosError",{value:!0}),m.from=(e,t,r,n,s,i)=>{const o=Object.create(Ae);return u.toFlatObject(e,o,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,r,n,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const $t=null;function re(e){return u.isPlainObject(e)||u.isArray(e)}function Ne(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,r){return e?e.concat(t).map(function(s,i){return s=Ne(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function It(e){return u.isArray(e)&&!e.some(re)}const jt=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function K(e,t,r){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=u.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,b){return!u.isUndefined(b[p])});const n=r.metaTokens,s=r.visitor||a,i=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(t);if(!u.isFunction(s))throw new TypeError("visitor must be a function");function d(h){if(h===null)return"";if(u.isDate(h))return h.toISOString();if(!f&&u.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(h)||u.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function a(h,p,b){let T=h;if(h&&!b&&typeof h=="object"){if(u.endsWith(p,"{}"))p=n?p:p.slice(0,-2),h=JSON.stringify(h);else if(u.isArray(h)&&It(h)||(u.isFileList(h)||u.endsWith(p,"[]"))&&(T=u.toArray(h)))return p=Ne(p),T.forEach(function(w,J){!(u.isUndefined(w)||w===null)&&t.append(o===!0?ke([p],J,i):o===null?p:p+"[]",d(w))}),!1}return re(h)?!0:(t.append(ke(b,p,i),d(h)),!1)}const l=[],y=Object.assign(jt,{defaultVisitor:a,convertValue:d,isVisitable:re});function g(h,p){if(!u.isUndefined(h)){if(l.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));l.push(h),u.forEach(h,function(T,N){(!(u.isUndefined(T)||T===null)&&s.call(t,T,u.isString(N)?N.trim():N,p,y))===!0&&g(T,p?p.concat(N):[N])}),l.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return g(e),t}function Ce(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function se(e,t){this._pairs=[],e&&K(e,this,t)}const xe=se.prototype;xe.append=function(t,r){this._pairs.push([t,r])},xe.toString=function(t){const r=t?function(n){return t.call(this,n,Ce)}:Ce;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Be(e,t,r){if(!t)return e;const n=r&&r.encode||Ht,s=r&&r.serialize;let i;if(s?i=s(t,r):i=u.isURLSearchParams(t)?t.toString():new se(t,r).toString(n),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ue{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Jt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:se,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},oe=typeof window<"u"&&typeof document<"u",Mt=(e=>oe&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vt=oe&&window.location.href||"http://localhost",P={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oe,hasStandardBrowserEnv:Mt,hasStandardBrowserWebWorkerEnv:zt,origin:Vt},Symbol.toStringTag,{value:"Module"})),...Jt};function Gt(e,t){return K(e,new P.classes.URLSearchParams,Object.assign({visitor:function(r,n,s,i){return P.isNode&&u.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function vt(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function qe(e){function t(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=r.length;return o=!o&&u.isArray(s)?s.length:o,f?(u.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!c):((!s[o]||!u.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&u.isArray(s[o])&&(s[o]=vt(s[o])),!c)}if(u.isFormData(e)&&u.isFunction(e.entries)){const r={};return u.forEachEntry(e,(n,s)=>{t(Kt(n),s,r,0)}),r}return null}function Wt(e,t,r){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const j={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=u.isObject(t);if(i&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(qe(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Gt(t,this.formSerializer).toString();if((c=u.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return K(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),Wt(t)):t}],transformResponse:[function(t){const r=this.transitional||j.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)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:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],e=>{j.headers[e]={}});const Qt=u.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"]),Xt=e=>{const t={};let r,n,s;return e&&e.split(`
2
+ `).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Qt[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Le=Symbol("internals");function H(e){return e&&String(e).trim().toLowerCase()}function v(e){return e===!1||e==null?e:u.isArray(e)?e.map(v):String(e)}function Zt(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}const Yt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ie(e,t,r,n,s){if(u.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!u.isString(t)){if(u.isString(n))return t.indexOf(n)!==-1;if(u.isRegExp(n))return n.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function tn(e,t){const r=u.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}let E=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(c,f,d){const a=H(f);if(!a)throw new Error("header name must be a non-empty string");const l=u.findKey(s,a);(!l||s[l]===void 0||d===!0||d===void 0&&s[l]!==!1)&&(s[l||f]=v(c))}const o=(c,f)=>u.forEach(c,(d,a)=>i(d,a,f));if(u.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(u.isString(t)&&(t=t.trim())&&!Yt(t))o(Xt(t),r);else if(u.isHeaders(t))for(const[c,f]of t.entries())i(f,c,n);else t!=null&&i(r,t,n);return this}get(t,r){if(t=H(t),t){const n=u.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Zt(s);if(u.isFunction(r))return r.call(this,s,n);if(u.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=H(t),t){const n=u.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ie(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(o){if(o=H(o),o){const c=u.findKey(n,o);c&&(!r||ie(n,n[c],c,r))&&(delete n[c],s=!0)}}return u.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||ie(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return u.forEach(this,(s,i)=>{const o=u.findKey(n,i);if(o){r[o]=v(s),delete r[i];return}const c=t?en(i):String(i).trim();c!==i&&delete r[i],r[c]=v(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return u.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&u.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Le]=this[Le]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=H(o);n[c]||(tn(s,o),n[c]=!0)}return u.isArray(t)?t.forEach(i):i(t),this}};E.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(E.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),u.freezeMethods(E);function ae(e,t){const r=this||j,n=t||r,s=E.from(n.headers);let i=n.data;return u.forEach(e,function(c){i=c.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function De(e){return!!(e&&e.__CANCEL__)}function L(e,t,r){m.call(this,e??"canceled",m.ERR_CANCELED,t,r),this.name="CanceledError"}u.inherits(L,m,{__CANCEL__:!0});function _e(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function nn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function rn(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),a=n[i];o||(o=d),r[s]=f,n[s]=d;let l=i,y=0;for(;l!==s;)y+=r[l++],l=l%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),d-o<t)return;const g=a&&d-a;return g?Math.round(y*1e3/g):void 0}}function sn(e,t){let r=0;const n=1e3/t;let s=null;return function(){const o=this===!0,c=Date.now();if(o||c-r>n)return s&&(clearTimeout(s),s=null),r=c,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,r=Date.now(),e.apply(null,arguments)),n-(c-r)))}}const W=(e,t,r=3)=>{let n=0;const s=rn(50,250);return sn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,d=s(f),a=o<=c;n=o;const l={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:d||void 0,estimated:d&&c&&a?(c-o)/d:void 0,event:i,lengthComputable:c!=null};l[t?"download":"upload"]=!0,e(l)},r)},on=P.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let n;function s(i){let o=i;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return n=s(window.location.href),function(o){const c=u.isString(o)?s(o):o;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}(),an=P.hasStandardBrowserEnv?{write(e,t,r,n,s,i){const o=[e+"="+encodeURIComponent(t)];u.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),u.isString(n)&&o.push("path="+n),u.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function cn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $e(e,t){return e&&!cn(t)?un(e,t):t}const Ie=e=>e instanceof E?{...e}:e;function B(e,t){t=t||{};const r={};function n(d,a,l){return u.isPlainObject(d)&&u.isPlainObject(a)?u.merge.call({caseless:l},d,a):u.isPlainObject(a)?u.merge({},a):u.isArray(a)?a.slice():a}function s(d,a,l){if(u.isUndefined(a)){if(!u.isUndefined(d))return n(void 0,d,l)}else return n(d,a,l)}function i(d,a){if(!u.isUndefined(a))return n(void 0,a)}function o(d,a){if(u.isUndefined(a)){if(!u.isUndefined(d))return n(void 0,d)}else return n(void 0,a)}function c(d,a,l){if(l in t)return n(d,a);if(l in e)return n(void 0,d)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(d,a)=>s(Ie(d),Ie(a),!0)};return u.forEach(Object.keys(Object.assign({},e,t)),function(a){const l=f[a]||s,y=l(e[a],t[a],a);u.isUndefined(y)&&l!==c||(r[a]=y)}),r}const je=e=>{const t=B({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;t.headers=o=E.from(o),t.url=Be($e(t.baseURL,t.url),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(u.isFormData(r)){if(P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[d,...a]=f?f.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([d||"multipart/form-data",...a].join("; "))}}if(P.hasStandardBrowserEnv&&(n&&u.isFunction(n)&&(n=n(t)),n||n!==!1&&on(t.url))){const d=s&&i&&an.read(i);d&&o.set(s,d)}return t},ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=je(e);let i=s.data;const o=E.from(s.headers).normalize();let{responseType:c}=s,f;function d(){s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let a=new XMLHttpRequest;a.open(s.method.toUpperCase(),s.url,!0),a.timeout=s.timeout;function l(){if(!a)return;const g=E.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),p={data:!c||c==="text"||c==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:g,config:e,request:a};_e(function(T){r(T),d()},function(T){n(T),d()},p),a=null}"onloadend"in a?a.onloadend=l:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(l)},a.onabort=function(){a&&(n(new m("Request aborted",m.ECONNABORTED,s,a)),a=null)},a.onerror=function(){n(new m("Network Error",m.ERR_NETWORK,s,a)),a=null},a.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const p=s.transitional||Fe;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),n(new m(h,p.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,s,a)),a=null},i===void 0&&o.setContentType(null),"setRequestHeader"in a&&u.forEach(o.toJSON(),function(h,p){a.setRequestHeader(p,h)}),u.isUndefined(s.withCredentials)||(a.withCredentials=!!s.withCredentials),c&&c!=="json"&&(a.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&a.addEventListener("progress",W(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",W(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=g=>{a&&(n(!g||g.type?new L(null,e,a):g),a.abort(),a=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const y=nn(s.url);if(y&&P.protocols.indexOf(y)===-1){n(new m("Unsupported protocol "+y+":",m.ERR_BAD_REQUEST,e));return}a.send(i||null)})},fn=(e,t)=>{let r=new AbortController,n;const s=function(f){if(!n){n=!0,o();const d=f instanceof Error?f:this.reason;r.abort(d instanceof m?d:new L(d instanceof Error?d.message:d))}};let i=t&&setTimeout(()=>{s(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",s):f.unsubscribe(s))}),e=null)};e.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",s));const{signal:c}=r;return c.unsubscribe=o,[c,()=>{i&&clearTimeout(i),i=null}]},dn=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},hn=async function*(e,t,r){for await(const n of e)yield*dn(ArrayBuffer.isView(n)?n:await r(String(n)),t)},He=(e,t,r,n,s)=>{const i=hn(e,t,s);let o=0;return new ReadableStream({type:"bytes",async pull(c){const{done:f,value:d}=await i.next();if(f){c.close(),n();return}let a=d.byteLength;r&&r(o+=a),c.enqueue(new Uint8Array(d))},cancel(c){return n(c),i.return()}},{highWaterMark:2})},Je=(e,t)=>{const r=e!=null;return n=>setTimeout(()=>t({lengthComputable:r,total:e,loaded:n}))},Q=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Me=Q&&typeof ReadableStream=="function",ce=Q&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),pn=Me&&(()=>{let e=!1;const t=new Request(P.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),ze=64*1024,ue=Me&&!!(()=>{try{return u.isReadableStream(new Response("").body)}catch{}})(),X={stream:ue&&(e=>e.body)};Q&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!X[t]&&(X[t]=u.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,n)})})})(new Response);const mn=async e=>{if(e==null)return 0;if(u.isBlob(e))return e.size;if(u.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(u.isArrayBufferView(e))return e.byteLength;if(u.isURLSearchParams(e)&&(e=e+""),u.isString(e))return(await ce(e)).byteLength},yn=async(e,t)=>{const r=u.toFiniteNumber(e.getContentLength());return r??mn(t)},le={http:$t,xhr:ln,fetch:Q&&(async e=>{let{url:t,method:r,data:n,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:f,responseType:d,headers:a,withCredentials:l="same-origin",fetchOptions:y}=je(e);d=d?(d+"").toLowerCase():"text";let[g,h]=s||i||o?fn([s,i],o):[],p,b;const T=()=>{!p&&setTimeout(()=>{g&&g.unsubscribe()}),p=!0};let N;try{if(f&&pn&&r!=="get"&&r!=="head"&&(N=await yn(a,n))!==0){let x=new Request(t,{method:"POST",body:n,duplex:"half"}),D;u.isFormData(n)&&(D=x.headers.get("content-type"))&&a.setContentType(D),x.body&&(n=He(x.body,ze,Je(N,W(f)),null,ce))}u.isString(l)||(l=l?"cors":"omit"),b=new Request(t,{...y,signal:g,method:r.toUpperCase(),headers:a.normalize().toJSON(),body:n,duplex:"half",withCredentials:l});let w=await fetch(b);const J=ue&&(d==="stream"||d==="response");if(ue&&(c||J)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const D=u.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,ze,c&&Je(D,W(c,!0)),J&&T,ce),x)}d=d||"text";let Jn=await X[u.findKey(X,d)||"text"](w,e);return!J&&T(),h&&h(),await new Promise((x,D)=>{_e(x,D,{data:Jn,headers:E.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:b})})}catch(w){throw T(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,b),{cause:w.cause||w}):m.from(w,w&&w.code,e,b)}})};u.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ve=e=>`- ${e}`,gn=e=>u.isFunction(e)||e===null||e===!1,Ge={getAdapter:e=>{e=u.isArray(e)?e:[e];const{length:t}=e;let r,n;const s={};for(let i=0;i<t;i++){r=e[i];let o;if(n=r,!gn(r)&&(n=le[(o=String(r)).toLowerCase()],n===void 0))throw new m(`Unknown adapter '${o}'`);if(n)break;s[o||"#"+i]=n}if(!n){const i=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
4
+ `+i.map(Ve).join(`
5
+ `):" "+Ve(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new L(null,e)}function Ke(e){return fe(e),e.headers=E.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Ge.getAdapter(e.adapter||j.adapter)(e).then(function(n){return fe(e),n.data=ae.call(e,e.transformResponse,n),n.headers=E.from(n.headers),n},function(n){return De(n)||(fe(e),n&&n.response&&(n.response.data=ae.call(e,e.transformResponse,n.response),n.response.headers=E.from(n.response.headers))),Promise.reject(n)})}const ve="1.7.2",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const We={};de.transitional=function(t,r,n){function s(i,o){return"[Axios v"+ve+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(r?" in "+r:"")),m.ERR_DEPRECATED);return r&&!We[o]&&(We[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,c):!0}};function bn(e,t,r){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const i=n[s],o=t[i];if(o){const c=e[i],f=c===void 0||o(c,i,e);if(f!==!0)throw new m("option "+i+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const he={assertOptions:bn,validators:de},k=he.validators;let U=class{constructor(t){this.defaults=t,this.interceptors={request:new Ue,response:new Ue}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=B(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&he.assertOptions(n,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean)},!1),s!=null&&(u.isFunction(s)?r.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:k.function,serialize:k.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&u.merge(i.common,i[r.method]);i&&u.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),r.headers=E.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(f=f&&p.synchronous,c.unshift(p.fulfilled,p.rejected))});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let a,l=0,y;if(!f){const h=[Ke.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,d),y=h.length,a=Promise.resolve(r);l<y;)a=a.then(h[l++],h[l++]);return a}y=c.length;let g=r;for(l=0;l<y;){const h=c[l++],p=c[l++];try{g=h(g)}catch(b){p.call(this,b);break}}try{a=Ke.call(this,g)}catch(h){return Promise.reject(h)}for(l=0,y=d.length;l<y;)a=a.then(d[l++],d[l++]);return a}getUri(t){t=B(this.defaults,t);const r=$e(t.baseURL,t.url);return Be(r,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){U.prototype[t]=function(r,n){return this.request(B(n||{},{method:t,url:r,data:(n||{}).data}))}}),u.forEach(["post","put","patch"],function(t){function r(n){return function(i,o,c){return this.request(B(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}U.prototype[t]=r(),U.prototype[t+"Form"]=r(!0)});let wn=class tt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,c){n.reason||(n.reason=new L(i,o,c),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new tt(function(s){t=s}),cancel:t}}};function Sn(e){return function(r){return e.apply(null,r)}}function Tn(e){return u.isObject(e)&&e.isAxiosError===!0}const pe={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};Object.entries(pe).forEach(([e,t])=>{pe[t]=e});function Qe(e){const t=new U(e),r=F(U.prototype.request,t);return u.extend(r,U.prototype,t,{allOwnKeys:!0}),u.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return Qe(B(e,s))},r}const S=Qe(j);S.Axios=U,S.CanceledError=L,S.CancelToken=wn,S.isCancel=De,S.VERSION=ve,S.toFormData=K,S.AxiosError=m,S.Cancel=S.CanceledError,S.all=function(t){return Promise.all(t)},S.spread=Sn,S.isAxiosError=Tn,S.mergeConfig=B,S.AxiosHeaders=E,S.formToJSON=e=>qe(u.isHTMLForm(e)?new FormData(e):e),S.getAdapter=Ge.getAdapter,S.HttpStatusCode=pe,S.default=S;const{Axios:Qn,AxiosError:En,CanceledError:Xn,isCancel:Zn,CancelToken:Yn,VERSION:er,all:tr,Cancel:nr,isAxiosError:rr,spread:sr,toFormData:or,AxiosHeaders:Xe,HttpStatusCode:ir,formToJSON:ar,getAdapter:cr,mergeConfig:ur}=S,Z=()=>new En("Unauthorized","ERR_UNAUTHORIZED",{headers:new Xe},null,{status:401,data:null,statusText:"UNAUTHORIZED",headers:{},config:{headers:new Xe}}),Rn=e=>{let t=!1;const r=[],n=()=>localStorage.getItem("accessToken"),s=()=>localStorage.getItem("refreshToken"),i=a=>{localStorage.setItem("accessToken",a.accessToken),localStorage.setItem("refreshToken",a.refreshToken)},o=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken")},c=(a,l=null)=>{r.forEach(y=>{var g;a?y.reject(a):((g=y.requestConfig).headers??(g.headers={}),y.requestConfig.headers.Authorization=`Bearer ${l}`,y.resolve(y.requestConfig))}),r.length=0};return{getAccessToken:n,setTokens:i,clearTokens:o,handleTokenRefresh:async a=>{var h;if((h=a.url)==null?void 0:h.includes(e.refreshTokenEndpointPath)){o();const p=Z();throw c(p),p}if(!n()){o();const p=Z();throw c(p),p}if(t)return new Promise((p,b)=>{r.push({resolve:p,reject:b,requestConfig:a})});const g=s();if(!g){o();const p=Z();throw c(p),p}t=!0;try{const p=await e.onRefreshToken(g);return i(p),a.headers??(a.headers={}),a.headers.Authorization=`Bearer ${p.accessToken}`,c(null,p.accessToken),t=!1,a}catch{o();const b=Z();throw c(b),t=!1,b}},isAuthError:a=>{var l;return((l=a==null?void 0:a.response)==null?void 0:l.status)===401}}},On=e=>{const t=n=>n?n.toString().replace(/(^\/{1,2})|(\/{1,2}$)/g,""):null;return[t(e.baseUrl),t(e.productCode),t(e.apiVersion),t(e.endpoint)].filter(Boolean).join("/")},O=e=>{const t=S.create(),r=e.apiVersion,n=e.productCode,s=e.baseUrl,i=s.replace(/\/$/,""),o=e.hasTokenManager!==!1;let c=null,f="";if(o){const a=e.refreshTokenApiVersion??r,l=e.refreshTokenEndpointPath??"/refresh-token";f=`${i}/auth/${a}${l}`,c=Rn({baseUrl:s,refreshTokenEndpointPath:l,onRefreshToken:async y=>(await t.post(f,{refreshToken:y})).data})}return o&&c&&t.interceptors.response.use(a=>a,async a=>{const l=a.config;if(!c.isAuthError(a)||l._retry)return Promise.reject(a);l._retry=!0;try{const y=await c.handleTokenRefresh(l);return t.request(y)}catch(y){return Promise.reject(y)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(a,l)=>{const y=a.startsWith("/")?a.substring(1):a,g=On({baseUrl:i,productCode:n,apiVersion:r,endpoint:y}),h={"Content-Type":(l==null?void 0:l.contentType)??"application/json",apiVersion:r??"",Authorization:"",...e.headers??{},...(l==null?void 0:l.headers)??{}};if(o&&c){const b=c.getAccessToken();b&&(h.Authorization=`Bearer ${b}`)}const p={method:(l==null?void 0:l.method)??"GET",headers:h,url:g,data:l==null?void 0:l.data,responseType:l==null?void 0:l.responseType};return await t.request(p)},getAccessToken:o&&c?c.getAccessToken:()=>null,setTokens:o&&c?c.setTokens:()=>{},clearTokens:o&&c?c.clearTokens:()=>{}}},An="cep";function Pn(e){const t=O(e);function r(n){return t.request(`/${An}`,{method:"POST",data:JSON.stringify(n)})}return{getAddress:r}}const Ze="auth",Nn=e=>{const t=O(e);return{postLogin:async s=>{var o;const i=await t.request(`/${Ze}/login`,{method:"POST",data:JSON.stringify(s)});return i.status===200&&((o=i.data)!=null&&o.accessToken)&&localStorage.setItem("accessToken",i.data.accessToken),i},getToken:async s=>await t.request(`/${Ze}?code=${s}`,{method:"GET",data:""})}},kn=e=>{const t=O(e);return{signUp:async c=>await t.request("/sign-up",{method:"POST",data:JSON.stringify(c)}),signIn:async c=>{var d,a;const f=await t.request("/sign-in",{method:"POST",data:JSON.stringify(c)});return f.status===200&&((d=f.data)!=null&&d.accessToken)&&((a=f.data)!=null&&a.refreshToken)&&t.setTokens(f.data),f},getProfile:async()=>await t.request("/me",{method:"GET",data:""}),recoverPassword:async c=>await t.request("/recovery",{method:"POST",data:JSON.stringify(c)}),updatePassword:async c=>await t.request("/update-password",{method:"POST",data:JSON.stringify(c)})}},Ye="digital",Cn=e=>{const t=O(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},xn="data",Bn=e=>{const t=O(e);return{postData:async n=>await t.request(`/${xn}`,{method:"POST",data:JSON.stringify(n)})}},Un="endorsement",Fn=e=>{const t=O(e);return{putEndorsement:(n,s)=>{const i=new FormData;return i.append("data",JSON.stringify(n)),s&&(Array.isArray(s)?s.forEach(o=>{i.append("attachments",o)}):i.append("attachments",s)),t.request(`/${Un}`,{method:"PUT",data:i,contentType:"multipart/form-data"})}}},me="payment",qn=e=>{const t=O(e);return{postPayment:i=>t.request(`/${me}`,{method:"POST",data:JSON.stringify(i)}),getPaymentStatus:i=>t.request(`/${me}/status?policyId=${i.policyId}`,{method:"GET",data:""}),getPaymentSummary:i=>t.request(`/${me}/summary?policyId=${i.policyId}`,{method:"GET",data:""})}},Y="product/action",Ln=e=>{const t=O(e);return{getCnpjStatus:(o,c,f)=>{const a=new URLSearchParams({...o&&{cnpj:o},...c&&{brokerageIdentity:c},...f!==void 0&&{isBrokerageDefinedAtStart:String(f)}}).toString(),l=`/${Y}/Custom/CnpjCheck?${a}`;return t.request(l,{method:"GET",data:""})},getKeyNumber:()=>t.request(`/${Y}/Custom/GetKeyNumber`,{method:"GET",data:""}),getProposalNumberByKeyNumber:o=>t.request(`/${Y}/Custom/GetProposalNoByKeyNumber?keyNumber=${o.keyNumber}`,{method:"GET",data:""}),postCoveragesAndClausesRules:o=>t.request(`/${Y}/Custom/LoadRules`,{method:"POST",data:JSON.stringify(o)})}},C="quotation",Dn=e=>{const t=O(e);return{getQuotations:a=>{const l=new URLSearchParams({...a});return t.request(`/${C}/query?${l.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const l=new URLSearchParams({id:a.policyId});return t.request(`/${C}?${l.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${C}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${C}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${C}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${C}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${C}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${C}/switchSelectedVersion?policyId=${a.policyId}&quotationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},_n="report",$n=e=>{const t=O(e);return{getReportStream:n=>{const s=new URLSearchParams({policyId:n.policyId,documentType:n.documentType??"certificate",...n.additionalParams});return t.request(`/${_n}/generate-stream?${s.toString()}`,{method:"GET",data:"",responseType:"blob"})}}},In="SubscriberData",jn=e=>{const t=O(e);return{getSubscriber:n=>t.request(`/${In}/get-subscriber-data?cnpj=${n}`,{method:"GET",data:""})}};function Hn(e){const t=Nn(e),r=kn(e),n=Bn(e),s=Dn(e),i=qn(e),o=Pn(e),c=Cn(e),f=Fn(e),d=Ln(e),a=$n(e),l=jn(e),y=O(e);return{auth:t,authAkad:r,data:n,quotation:s,payment:i,address:o,broker:c,endorsement:f,plugin:d,report:a,subscriber:l,base:y}}return Hn});