@akad/sdk 1.0.17 → 1.0.18
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/authAkad/index.d.ts +3 -1
- package/authAkad/types.d.ts +10 -0
- package/main.d.ts +2 -0
- package/package.json +1 -1
- package/ts-lib.js +409 -401
- package/ts-lib.umd.cjs +6 -6
package/ts-lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(U,$){typeof exports=="object"&&typeof module<"u"?module.exports=$():typeof define=="function"&&define.amd?define($):(U=typeof globalThis<"u"?globalThis:U||self,U["ts-lib"]=$())})(this,function(){"use strict";function U(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:ee}=Object,z=(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>z(t)===e),J=e=>t=>typeof t===e,{isArray:L}=Array,D=J("undefined");function nt(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=O("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=J("string"),R=J("function"),ge=J("number"),V=e=>e!==null&&typeof e=="object",ot=e=>e===!0||e===!1,G=e=>{if(z(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=O("Date"),at=O("File"),ct=O("Blob"),ut=O("FileList"),lt=e=>V(e)&&R(e.pipe),ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=z(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},dt=O("URLSearchParams"),[ht,pt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(O),gt=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 i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let u;for(r=0;r<o;r++)u=i[r],t.call(null,e[u],u,e)}}function be(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=>!D(e)&&e!==we;function te(){const{caseless:e}=Te(this)&&this||{},t={},n=(r,s)=>{const i=e&&be(t,s)||s;G(t[i])&&G(r)?t[i]=te(t[i],r):G(r)?t[i]=te({},r):L(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&I(arguments[r],n);return t}const bt=(e,t,n,{allOwnKeys:r}={})=>(I(t,(s,i)=>{n&&R(s)?e[i]=U(s,n):e[i]=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)},Et=(e,t,n,r)=>{let s,i,o;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!u[o]&&(t[o]=e[o],u[o]=!0);e=n!==!1&&ee(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},St=(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(!ge(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 i=s.value;t.call(e,i[0],i[1])}},Pt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Nt=O("HTMLFormElement"),Ct=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ee=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),kt=O("RegExp"),Se=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};I(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},xt=e=>{Se(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(i=>{n[i]=!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 qt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _t=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 i=L(r)?[]:{};return I(r,(o,u)=>{const f=n(o,s+1);!D(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},$t=O("AsyncFunction"),c={isArray:L,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:D,isDate:it,isFile:at,isBlob:ct,isRegExp:kt,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:bt,trim:gt,stripBOM:wt,inherits:Tt,toFlatObject:Et,kindOf:z,kindOfTest:O,endsWith:St,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Ee,hasOwnProp:Ee,reduceDescriptors:Se,freezeMethods:xt,toObjectSet:Bt,toCamelCase:Ct,noop:Ft,toFiniteNumber:Ut,findKey:be,global:we,isContextDefined:Te,ALPHABET:Oe,generateString:Lt,isSpecCompliantForm:qt,toJSONObject:_t,isAsyncFn:$t,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,i)=>{const o=Object.create(Ae);return c.toFlatObject(e,o,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),y.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Dt=null;function re(e){return c.isPlainObject(e)||c.isArray(e)}function Ne(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(e,t,n){return e?e.concat(t).map(function(s,i){return s=Ne(s),!n&&i?"["+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,b){return!c.isUndefined(b[p])});const r=n.metaTokens,s=n.visitor||a,i=n.dots,o=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,b){let E=h;if(h&&!b&&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,"[]"))&&(E=c.toArray(h)))return p=Ne(p),E.forEach(function(w,M){!(c.isUndefined(w)||w===null)&&t.append(o===!0?Ce([p],M,i):o===null?p:p+"[]",l(w))}),!1}return re(h)?!0:(t.append(Ce(b,p,i),l(h)),!1)}const d=[],m=Object.assign(jt,{defaultVisitor:a,convertValue:l,isVisitable:re});function g(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(E,N){(!(c.isUndefined(E)||E===null)&&s.call(t,E,c.isString(N)?N.trim():N,p,m))===!0&&g(E,p?p.concat(N):[N])}),d.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ke(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,ke)}:ke;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 i;if(s?i=s(t,n):i=c.isURLSearchParams(t)?t.toString():new se(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}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},Mt={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",zt=(e=>oe&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Jt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Vt=oe&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:oe,hasStandardBrowserEnv:zt,hasStandardBrowserWebWorkerEnv:Jt,origin:Vt},Symbol.toStringTag,{value:"Module"})),...Mt};function Gt(e,t){return K(e,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return A.isNode&&c.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Kt(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Le(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const u=Number.isFinite(+o),f=i>=n.length;return o=!o&&c.isArray(s)?s.length:o,f?(c.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!u):((!s[o]||!c.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&c.isArray(s[o])&&(s[o]=Wt(s[o])),!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 Qt(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,i=c.isObject(t);if(i&&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(i){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 i||s?(n.setContentType("application/json",!1),Qt(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 o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(o)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:A.classes.FormData,Blob:A.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 vt=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(
|
|
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[qe]=this[qe]={accessors:{}}).accessors,s=this.prototype;function i(o){const u=H(o);r[u]||(tn(s,o),r[u]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};S.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(S.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),c.freezeMethods(S);function ae(e,t){const n=this||j,r=t||n,s=S.from(r.headers);let i=r.data;return c.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function _e(e){return!!(e&&e.__CANCEL__)}function q(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(q,y,{__CANCEL__:!0});function $e(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,i=0,o;return t=t!==void 0?t:1e3,function(f){const l=Date.now(),a=r[i];o||(o=l),n[s]=f,r[s]=l;let d=i,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const g=a&&l-a;return g?Math.round(m*1e3/g):void 0}}function sn(e,t){let n=0;const r=1e3/t;let s=null;return function(){const o=this===!0,u=Date.now();if(o||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 Q=(e,t,n=3)=>{let r=0;const s=rn(50,250);return sn(i=>{const o=i.loaded,u=i.lengthComputable?i.total:void 0,f=o-r,l=s(f),a=o<=u;r=o;const d={loaded:o,total:u,progress:u?o/u:void 0,bytes:f,rate:l||void 0,estimated:l&&u&&a?(u-o)/l:void 0,event:i,lengthComputable:u!=null};d[t?"download":"upload"]=!0,e(d)},n)},on=A.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{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(o){const u=c.isString(o)?s(o):o;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}(),an=A.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];c.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),c.isString(r)&&o.push("path="+r),c.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 De(e,t){return e&&!cn(t)?un(e,t):t}const Ie=e=>e instanceof S?{...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 i(l,a){if(!c.isUndefined(a))return r(void 0,a)}function o(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: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: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:i,headers:o,auth:u}=t;t.headers=o=S.from(o),t.url=Be(De(t.baseURL,t.url),e.params,e.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(c.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((f=o.getContentType())!==!1){const[l,...a]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...a].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&c.isFunction(r)&&(r=r(t)),r||r!==!1&&on(t.url))){const l=s&&i&&an.read(i);l&&o.set(s,l)}return t},ln=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=je(e);let i=s.data;const o=S.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 g=S.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),p={data:!u||u==="text"||u==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:g,config:e,request:a};$e(function(E){n(E),l()},function(E){r(E),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},i===void 0&&o.setContentType(null),"setRequestHeader"in a&&c.forEach(o.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",Q(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",Q(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=g=>{a&&(r(!g||g.type?new q(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 m=nn(s.url);if(m&&A.protocols.indexOf(m)===-1){r(new y("Unsupported protocol "+m+":",y.ERR_BAD_REQUEST,e));return}a.send(i||null)})},fn=(e,t)=>{let n=new AbortController,r;const s=function(f){if(!r){r=!0,o();const l=f instanceof Error?f:this.reason;n.abort(l instanceof y?l:new q(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{s(new y(`timeout ${t} of ms exceeded`,y.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:u}=n;return u.unsubscribe=o,[u,()=>{i&&clearTimeout(i),i=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 i=hn(e,t,s);let o=0;return new ReadableStream({type:"bytes",async pull(u){const{done:f,value:l}=await i.next();if(f){u.close(),r();return}let a=l.byteLength;n&&n(o+=a),u.enqueue(new Uint8Array(l))},cancel(u){return r(u),i.return()}},{highWaterMark:2})},Me=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},v=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ze=v&&typeof ReadableStream=="function",ce=v&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),pn=ze&&(()=>{let e=!1;const t=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Je=64*1024,ue=ze&&!!(()=>{try{return c.isReadableStream(new Response("").body)}catch{}})(),X={stream:ue&&(e=>e.body)};v&&(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:Dt,xhr:ln,fetch:v&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:u,onUploadProgress:f,responseType:l,headers:a,withCredentials:d="same-origin",fetchOptions:m}=je(e);l=l?(l+"").toLowerCase():"text";let[g,h]=s||i||o?fn([s,i],o):[],p,b;const E=()=>{!p&&setTimeout(()=>{g&&g.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"}),_;c.isFormData(r)&&(_=x.headers.get("content-type"))&&a.setContentType(_),x.body&&(r=He(x.body,Je,Me(N,Q(f)),null,ce))}c.isString(d)||(d=d?"cors":"omit"),b=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(b);const M=ue&&(l==="stream"||l==="response");if(ue&&(u||M)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const _=c.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,Je,u&&Me(_,Q(u,!0)),M&&E,ce),x)}l=l||"text";let In=await X[c.findKey(X,l)||"text"](w,e);return!M&&E(),h&&h(),await new Promise((x,_)=>{$e(x,_,{data:In,headers:S.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:b})})}catch(w){throw E(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,b),{cause:w.cause||w}):y.from(w,w&&w.code,e,b)}})};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}`,gn=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 i=0;i<t;i++){n=e[i];let o;if(r=n,!gn(n)&&(r=le[(o=String(n)).toLowerCase()],r===void 0))throw new y(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
4
|
-
`+
|
|
5
|
-
`):" "+Ve(
|
|
6
|
-
`+i):r.stack=i}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:i}=n;r!==void 0&&he.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:C.function,serialize:C.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&c.merge(i.common,i[n.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],h=>{delete i[h]}),n.headers=S.concat(o,i);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 g=n;for(d=0;d<m;){const h=u[d++],p=u[d++];try{g=h(g)}catch(b){p.call(this,b);break}}try{a=Ke.call(this,g)}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=De(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(i,o,u){return this.request(B(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}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(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(u=>{r.subscribe(u),i=u}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,u){r.reason||(r.reason=new q(i,o,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 En(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 ve(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 ve(B(e,s))},n}const T=ve(j);T.Axios=F,T.CanceledError=q,T.CancelToken=wn,T.isCancel=_e,T.VERSION=We,T.toFormData=K,T.AxiosError=y,T.Cancel=T.CanceledError,T.all=function(t){return Promise.all(t)},T.spread=Tn,T.isAxiosError=En,T.mergeConfig=B,T.AxiosHeaders=S,T.formToJSON=e=>Le(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Ge.getAdapter,T.HttpStatusCode=pe,T.default=T;const{Axios:Kn,AxiosError:Sn,CanceledError:Wn,isCancel:Qn,CancelToken:vn,VERSION:Xn,all:Zn,Cancel:Yn,isAxiosError:er,spread:tr,toFormData:nr,AxiosHeaders:Xe,HttpStatusCode:rr,formToJSON:sr,getAdapter:or,mergeConfig:ir}=T,Z=()=>new Sn("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"),i=a=>{localStorage.setItem("accessToken",a.accessToken),localStorage.setItem("refreshToken",a.refreshToken)},o=()=>{localStorage.removeItem("accessToken"),localStorage.removeItem("refreshToken")},u=(a,d=null)=>{n.forEach(m=>{a?m.reject(a):(m.requestConfig.headers||(m.requestConfig.headers={}),m.requestConfig.headers.Authorization=`Bearer ${d}`,m.resolve(m.requestConfig))}),n.length=0};return{getAccessToken:r,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 u(p),p}if(!r()){o();const p=Z();throw u(p),p}if(t)return new Promise((p,b)=>{n.push({resolve:p,reject:b,requestConfig:a})});const g=s();if(!g){o();const p=Z();throw u(p),p}t=!0;try{const p=await e.onRefreshToken(g);return i(p),a.headers||(a.headers={}),a.headers.Authorization=`Bearer ${p.accessToken}`,u(null,p.accessToken),t=!1,a}catch{o();const b=Z();throw u(b),t=!1,b}},isAuthError:a=>{var d;return((d=a==null?void 0:a.response)==null?void 0:d.status)===401}}},P=e=>{const t=T.create(),n=e.apiVersion,r=e.productCode,s=e.baseUrl,i=s?s.replace(/\/$/,""):"",o=e.refreshTokenApiVersion||n,u=e.refreshTokenEndpointPath||"/refresh-token",f=`${i}/auth/${o}${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 g=await l.handleTokenRefresh(m);return t.request(g)}catch(g){return Promise.reject(g)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(d,m)=>{const g=d.startsWith("/")?d.substring(1):d,h=`${i}/${r}/${n}/${g}`,p={"Content-Type":(m==null?void 0:m.contentType)||"application/json",apiVersion:n,Authorization:"",...e.headers??{}},b=l.getAccessToken();b&&(p.Authorization=`Bearer ${b}`);const E={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(E)},getAccessToken:l.getAccessToken,setTokens:l.setTokens,clearTokens:l.clearTokens}},On="cep";function An(e){const t=P(e);function n(r){return t.request(`/${On}`,{method:"POST",data:JSON.stringify(r)})}return{getAddress:n}}const Ze="auth",Pn=e=>{const t=P(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:""})}},Nn=e=>{const t=P(e);return{signUp:async i=>await t.request("/sign-up",{method:"POST",data:JSON.stringify(i)}),signIn:async i=>{var u,f;const o=await t.request("/sign-in",{method:"POST",data:JSON.stringify(i)});return o.status===200&&((u=o.data)!=null&&u.accessToken)&&((f=o.data)!=null&&f.refreshToken)&&t.setTokens(o.data),o},getProfile:async()=>await t.request("/me",{method:"GET",data:""})}},Ye="digital",Cn=e=>{const t=P(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},kn="data",xn=e=>{const t=P(e);return{postData:async r=>await t.request(`/${kn}`,{method:"POST",data:JSON.stringify(r)})}},me="payment",Bn=e=>{const t=P(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",Fn=e=>{const t=P(e);return{getCnpjStatus:o=>t.request(`/${Y}/Custom/CnpjCheck?cnpj=${o}`,{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)})}},k="quotation",Un=e=>{const t=P(e);return{getQuotations:a=>{const d=new URLSearchParams({...a});return t.request(`/${k}/query?${d.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const d=new URLSearchParams({id:a.policyId});return t.request(`/${k}?${d.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${k}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${k}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${k}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${k}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${k}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${k}/switchSelectedVersion?policyId=${a.policyId}"ationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},Ln="report",qn=e=>{const t=P(e);return{getReportStream:r=>{const s=new URLSearchParams({policyId:r.policyId,documentType:r.documentType||"certificate",...r.additionalParams});return t.request(`/${Ln}/generate-stream?${s.toString()}`,{method:"GET",data:"",responseType:"blob"})}}},_n="SubscriberData",$n=e=>{const t=P(e);return{getSubscriber:r=>t.request(`/${_n}/get-subscriber-data?cnpj=${r}`,{method:"GET",data:""})}};function Dn(e){const t=Pn(e),n=Nn(e),r=xn(e),s=Un(e),i=Bn(e),o=An(e),u=Cn(e),f=Fn(e),l=qn(e),a=$n(e);return{auth:t,authAkad:n,data:r,quotation:s,payment:i,address:o,broker:u,plugin:f,report:l,subscriber:a}}return Dn});
|
|
1
|
+
(function(U,$){typeof exports=="object"&&typeof module<"u"?module.exports=$():typeof define=="function"&&define.amd?define($):(U=typeof globalThis<"u"?globalThis:U||self,U["ts-lib"]=$())})(this,function(){"use strict";function U(e,t){return function(){return e.apply(t,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:ee}=Object,M=(e=>t=>{const n=$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>M(t)===e),z=e=>t=>typeof t===e,{isArray:q}=Array,D=z("undefined");function nt(e){return e!==null&&!D(e)&&e.constructor!==null&&!D(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ye=O("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=O("Date"),at=O("File"),ct=O("Blob"),ut=O("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=O("URLSearchParams"),[ht,pt,mt,yt]=["ReadableStream","Request","Response","Headers"].map(O),gt=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]),q(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 be(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=>!D(e)&&e!==we;function te(){const{caseless:e}=Te(this)&&this||{},t={},n=(r,s)=>{const o=e&&be(t,s)||s;G(t[o])&&G(r)?t[o]=te(t[o],r):G(r)?t[o]=te({},r):q(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 bt=(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(q(e))return e;let t=e.length;if(!ge(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=O("HTMLFormElement"),Ct=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),kt=O("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 q(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},qt=(e=16,t=Oe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Lt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _t=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=q(r)?[]:{};return I(r,(i,u)=>{const f=n(i,s+1);!D(f)&&(o[u]=f)}),t[s]=void 0,o}}return r};return n(e,0)},$t=O("AsyncFunction"),c={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:D,isDate:it,isFile:at,isBlob:ct,isRegExp:kt,isFunction:R,isStream:lt,isURLSearchParams:dt,isTypedArray:Ot,isFileList:ut,forEach:I,merge:te,extend:bt,trim:gt,stripBOM:wt,inherits:Tt,toFlatObject:St,kindOf:M,kindOfTest:O,endsWith:Et,toArray:Rt,forEachEntry:At,matchAll:Pt,isHTMLForm:Nt,hasOwnProperty:Se,hasOwnProp:Se,reduceDescriptors:Ee,freezeMethods:xt,toObjectSet:Bt,toCamelCase:Ct,noop:Ft,toFiniteNumber:Ut,findKey:be,global:we,isContextDefined:Te,ALPHABET:Oe,generateString:qt,isSpecCompliantForm:Lt,toJSONObject:_t,isAsyncFn:$t,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 Dt=null;function re(e){return c.isPlainObject(e)||c.isArray(e)}function Ne(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ce(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,b){return!c.isUndefined(b[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,b){let S=h;if(h&&!b&&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?Ce([p],J,o):i===null?p:p+"[]",l(w))}),!1}return re(h)?!0:(t.append(Ce(b,p,o),l(h)),!1)}const d=[],m=Object.assign(jt,{defaultVisitor:a,convertValue:l,isVisitable:re});function g(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&&g(S,p?p.concat(N):[N])}),d.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return g(e),t}function ke(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,ke)}:ke;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",A={...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 A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return A.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 qe(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(qe(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:A.classes.FormData,Blob:A.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},Le=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[Le]=this[Le]={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 _e(e){return!!(e&&e.__CANCEL__)}function L(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}c.inherits(L,y,{__CANCEL__:!0});function $e(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 g=a&&l-a;return g?Math.round(m*1e3/g):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=A.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=A.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 De(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(De(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(A.hasStandardBrowserEnv||A.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(A.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 g=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:g,config:e,request:a};$e(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=g=>{a&&(r(!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 m=nn(s.url);if(m&&A.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(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(A.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:Dt,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[g,h]=s||o||i?fn([s,o],i):[],p,b;const S=()=>{!p&&setTimeout(()=>{g&&g.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"}),_;c.isFormData(r)&&(_=x.headers.get("content-type"))&&a.setContentType(_),x.body&&(r=He(x.body,ze,Je(N,W(f)),null,ce))}c.isString(d)||(d=d?"cors":"omit"),b=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:a.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(b);const J=ue&&(l==="stream"||l==="response");if(ue&&(u||J)){const x={};["status","statusText","headers"].forEach(et=>{x[et]=w[et]});const _=c.toFiniteNumber(w.headers.get("content-length"));w=new Response(He(w.body,ze,u&&Je(_,W(u,!0)),J&&S,ce),x)}l=l||"text";let In=await X[c.findKey(X,l)||"text"](w,e);return!J&&S(),h&&h(),await new Promise((x,_)=>{$e(x,_,{data:In,headers:E.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:b})})}catch(w){throw S(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,e,b),{cause:w.cause||w}):y.from(w,w&&w.code,e,b)}})};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}`,gn=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,!gn(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 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(r){return fe(e),r.data=ae.call(e,e.transformResponse,r),r.headers=E.from(r.headers),r},function(r){return _e(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 bn(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:bn,validators:de},C=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:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(c.isFunction(s)?n.paramsSerializer={serialize:s}:he.assertOptions(s,{encode:C.function,serialize:C.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 g=n;for(d=0;d<m;){const h=u[d++],p=u[d++];try{g=h(g)}catch(b){p.call(this,b);break}}try{a=Ke.call(this,g)}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=De(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 L(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=L,T.CancelToken=wn,T.isCancel=_e,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=>qe(c.isHTMLForm(e)?new FormData(e):e),T.getAdapter=Ge.getAdapter,T.HttpStatusCode=pe,T.default=T;const{Axios:Kn,AxiosError:En,CanceledError:vn,isCancel:Wn,CancelToken:Qn,VERSION:Xn,all:Zn,Cancel:Yn,isAxiosError:er,spread:tr,toFormData:nr,AxiosHeaders:Xe,HttpStatusCode:rr,formToJSON:sr,getAdapter:or,mergeConfig:ir}=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=>{a?m.reject(a):(m.requestConfig.headers||(m.requestConfig.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,b)=>{n.push({resolve:p,reject:b,requestConfig:a})});const g=s();if(!g){i();const p=Z();throw u(p),p}t=!0;try{const p=await e.onRefreshToken(g);return o(p),a.headers||(a.headers={}),a.headers.Authorization=`Bearer ${p.accessToken}`,u(null,p.accessToken),t=!1,a}catch{i();const b=Z();throw u(b),t=!1,b}},isAuthError:a=>{var d;return((d=a==null?void 0:a.response)==null?void 0:d.status)===401}}},P=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 g=await l.handleTokenRefresh(m);return t.request(g)}catch(g){return Promise.reject(g)}}),e.responseInterceptor&&t.interceptors.response.use(e.responseInterceptor.onFulfilled,e.responseInterceptor.onReject),{request:async(d,m)=>{const g=d.startsWith("/")?d.substring(1):d,h=`${o}/${r}/${n}/${g}`,p={"Content-Type":(m==null?void 0:m.contentType)||"application/json",apiVersion:n,Authorization:"",...e.headers??{}},b=l.getAccessToken();b&&(p.Authorization=`Bearer ${b}`);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=P(e);function n(r){return t.request(`/${On}`,{method:"POST",data:JSON.stringify(r)})}return{getAddress:n}}const Ze="auth",Pn=e=>{const t=P(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=P(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",Cn=e=>{const t=P(e);return{getBroker:()=>t.request(`/${Ye}/getBroker`,{method:"GET",data:""}),getAllBrokerages:s=>t.request(`/${Ye}/getAllBrokerages?name=${s}`,{method:"GET",data:""})}},kn="data",xn=e=>{const t=P(e);return{postData:async r=>await t.request(`/${kn}`,{method:"POST",data:JSON.stringify(r)})}},me="payment",Bn=e=>{const t=P(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",Fn=e=>{const t=P(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)})}},k="quotation",Un=e=>{const t=P(e);return{getQuotations:a=>{const d=new URLSearchParams({...a});return t.request(`/${k}/query?${d.toString()}`,{method:"GET",data:""})},getQuotationDetail:a=>{const d=new URLSearchParams({id:a.policyId});return t.request(`/${k}?${d.toString()}`,{method:"GET",data:""})},postQuickQuote:a=>t.request(`/${k}/QuickQuote`,{method:"POST",data:JSON.stringify(a)}),postFullQuote:a=>t.request(`/${k}/FullQuote`,{method:"POST",data:JSON.stringify(a)}),postBind:a=>t.request(`/${k}/Bind`,{method:"POST",data:JSON.stringify(a)}),getQuotation:a=>t.request(`/${k}?id=${a.policyId}`,{method:"GET",data:""}),getVersions:a=>t.request(`/${k}/versions?policyId=${a.policyId}`,{method:"GET",data:""}),switchSelectedVersion:a=>t.request(`/${k}/switchSelectedVersion?policyId=${a.policyId}"ationVersionId=${a.quotationVersionId}`,{method:"POST",data:JSON.stringify(a)})}},qn="report",Ln=e=>{const t=P(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",$n=e=>{const t=P(e);return{getSubscriber:r=>t.request(`/${_n}/get-subscriber-data?cnpj=${r}`,{method:"GET",data:""})}};function Dn(e){const t=Pn(e),n=Nn(e),r=xn(e),s=Un(e),o=Bn(e),i=An(e),u=Cn(e),f=Fn(e),l=Ln(e),a=$n(e);return{auth:t,authAkad:n,data:r,quotation:s,payment:o,address:i,broker:u,plugin:f,report:l,subscriber:a}}return Dn});
|