react-auth-service 0.0.2 → 0.0.3

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.
@@ -1,11 +1,11 @@
1
- (function(g,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom"],x):(g=typeof globalThis<"u"?globalThis:g||self,x(g.AuthUI={},g.React,g.ReactRouterDOM))})(this,(function(g,x,be){"use strict";var ye={exports:{}},oe={};var Ze;function nn(){if(Ze)return oe;Ze=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:i}}return oe.Fragment=t,oe.jsx=n,oe.jsxs=n,oe}var ie={};var Qe;function rn(){return Qe||(Qe=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===je?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case p:return"Fragment";case P:return"Profiler";case R:return"StrictMode";case H:return"Suspense";case F:return"SuspenseList";case Le:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case E:return"Portal";case j:return l.displayName||"Context";case _:return(l._context.displayName||"Context")+".Consumer";case v:var b=l.render;return l=l.displayName,l||(l=b.displayName||b.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case pe:return b=l.displayName||null,b!==null?b:e(l.type)||"Memo";case J:b=l._payload,l=l._init;try{return e(l(b))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var b=!1}catch{b=!0}if(b){b=console;var A=b.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return A.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),t(l)}}function r(l){if(l===p)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===J)return"<...>";try{var b=e(l);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function s(){var l=W.A;return l===null?null:l.getOwner()}function i(){return Error("react-stack-top-frame")}function o(l){if(V.call(l,"key")){var b=Object.getOwnPropertyDescriptor(l,"key").get;if(b&&b.isReactWarning)return!1}return l.key!==void 0}function c(l,b){function A(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}A.isReactWarning=!0,Object.defineProperty(l,"key",{get:A,configurable:!0})}function h(){var l=e(this.type);return me[l]||(me[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,b,A,O,Z,Ye){var I=A.ref;return l={$$typeof:d,type:l,key:b,props:A,_owner:O},(I!==void 0?I:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:h}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ye}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,b,A,O,Z,Ye){var I=b.children;if(I!==void 0)if(O)if(z(I)){for(O=0;O<I.length;O++)m(I[O]);Object.freeze&&Object.freeze(I)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(I);if(V.call(b,"key")){I=e(l);var se=Object.keys(b).filter(function(vr){return vr!=="key"});O=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",ke[I+O]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(y,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom"],P):(y=typeof globalThis<"u"?globalThis:y||self,P(y.AuthUI={},y.React,y.ReactRouterDOM))})(this,(function(y,P,Se){"use strict";var ye={exports:{}},ae={};var et;function cn(){if(et)return ae;et=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var c in s)c!=="key"&&(i[c]=s[c])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:o,ref:s!==void 0?s:null,props:i}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var ce={};var tt;function ln(){return tt||(tt=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===ke?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case p:return"Fragment";case C:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case F:return"SuspenseList";case Ie:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case E:return"Portal";case k:return l.displayName||"Context";case _:return(l._context.displayName||"Context")+".Consumer";case v:var b=l.render;return l=l.displayName,l||(l=b.displayName||b.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case me:return b=l.displayName||null,b!==null?b:e(l.type)||"Memo";case J:b=l._payload,l=l._init;try{return e(l(b))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var b=!1}catch{b=!0}if(b){b=console;var A=b.error,O=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return A.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",O),t(l)}}function r(l){if(l===p)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===J)return"<...>";try{var b=e(l);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function s(){var l=W.A;return l===null?null:l.getOwner()}function i(){return Error("react-stack-top-frame")}function o(l){if(V.call(l,"key")){var b=Object.getOwnPropertyDescriptor(l,"key").get;if(b&&b.isReactWarning)return!1}return l.key!==void 0}function c(l,b){function A(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}A.isReactWarning=!0,Object.defineProperty(l,"key",{get:A,configurable:!0})}function h(){var l=e(this.type);return Ee[l]||(Ee[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,b,A,O,ee,Ze){var L=A.ref;return l={$$typeof:d,type:l,key:b,props:A,_owner:O},(L!==void 0?L:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:h}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ze}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,b,A,O,ee,Ze){var L=b.children;if(L!==void 0)if(O)if(z(L)){for(O=0;O<L.length;O++)m(L[O]);Object.freeze&&Object.freeze(L)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(L);if(V.call(b,"key")){L=e(l);var ie=Object.keys(b).filter(function(Gr){return Gr!=="key"});O=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",je[L+O]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,O,I,se,I),ke[I+O]=!0)}if(I=null,A!==void 0&&(n(A),I=""+A),o(b)&&(n(b.key),I=""+b.key),"key"in b){A={};for(var Ke in b)Ke!=="key"&&(A[Ke]=b[Ke])}else A=b;return I&&c(A,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,I,A,s(),Z,Ye)}function m(l){S(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===J&&(l._payload.status==="fulfilled"?S(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function S(l){return typeof l=="object"&&l!==null&&l.$$typeof===d}var T=x,d=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),j=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),pe=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Le=Symbol.for("react.activity"),je=Symbol.for("react.client.reference"),W=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,z=Array.isArray,re=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(l){return l()}};var D,me={},M=T.react_stack_bottom_frame.bind(T,i)(),Ee=re(r(i)),ke={};ie.Fragment=p,ie.jsx=function(l,b,A){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,A,!1,O?Error("react-stack-top-frame"):M,O?re(r(l)):Ee)},ie.jsxs=function(l,b,A){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,A,!0,O?Error("react-stack-top-frame"):M,O?re(r(l)):Ee)}})()),ie}var et;function sn(){return et||(et=1,process.env.NODE_ENV==="production"?ye.exports=nn():ye.exports=rn()),ye.exports}var w=sn();const $={refreshToken:"auth/renew-token",login:"auth/authenticate",logout:"auth/terminate",register:"auth/register",userDetails:"auth/profile",test:"/auth/test-endpoint"},tt="Registration successful! Please login.",nt="Registration failed. Please try again.",rt="Login failed. Please try again.",st="Login successful!",on="Logged out successfully.",ot="Session expired. Please login again.",C={LOGIN:"Sign In",SIGNUP:"Sign Up"},it="Signing in...",at="Signing up...",Ue="Email",ct="Password",lt="User ID",ut="Logout",ae="sessionExpired",we="true";let ft=null;function ce(e){ft=e}function an(){return ft}function dt(e,t){return function(){return e.apply(t,arguments)}}const{toString:cn}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:Se,toStringTag:ht}=Symbol,ge=(e=>t=>{const n=cn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),B=e=>(e=e.toLowerCase(),t=>ge(t)===e),Re=e=>t=>typeof t===e,{isArray:Q}=Array,ee=Re("undefined");function le(e){return e!==null&&!ee(e)&&e.constructor!==null&&!ee(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pt=B("ArrayBuffer");function ln(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pt(e.buffer),t}const un=Re("string"),k=Re("function"),mt=Re("number"),ue=e=>e!==null&&typeof e=="object",fn=e=>e===!0||e===!1,Ae=e=>{if(ge(e)!=="object")return!1;const t=Fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ht in e)&&!(Se in e)},dn=e=>{if(!ue(e)||le(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},hn=B("Date"),pn=B("File"),mn=B("Blob"),En=B("FileList"),bn=e=>ue(e)&&k(e.pipe),yn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||k(e.append)&&((t=ge(e))==="formdata"||t==="object"&&k(e.toString)&&e.toString()==="[object FormData]"))},wn=B("URLSearchParams"),[Sn,gn,Rn,An]=["ReadableStream","Request","Response","Headers"].map(B),On=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function fe(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{if(le(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Et(e,t){if(le(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,bt=e=>!ee(e)&&e!==X;function ve(){const{caseless:e,skipUndefined:t}=bt(this)&&this||{},n={},r=(s,i)=>{const o=e&&Et(n,i)||i;Ae(n[o])&&Ae(s)?n[o]=ve(n[o],s):Ae(s)?n[o]=ve({},s):Q(s)?n[o]=s.slice():(!t||!ee(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&fe(arguments[s],r);return n}const Tn=(e,t,n,{allOwnKeys:r}={})=>(fe(t,(s,i)=>{n&&k(s)?e[i]=dt(s,n):e[i]=s},{allOwnKeys:r}),e),Nn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_n=(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)},Pn=(e,t,n,r)=>{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],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},xn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Cn=e=>{if(!e)return null;if(Q(e))return e;let t=e.length;if(!mt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},In=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Fe(Uint8Array)),Ln=(e,t)=>{const r=(e&&e[Se]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},jn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},kn=B("HTMLFormElement"),Un=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),yt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Fn=B("RegExp"),wt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};fe(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},vn=e=>{wt(e,(t,n)=>{if(k(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(k(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+"'")})}})},Dn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Q(e)?r(e):r(String(e).split(t)),n},Bn=()=>{},Mn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Gn(e){return!!(e&&k(e.append)&&e[ht]==="FormData"&&e[Se])}const qn=e=>{const t=new Array(10),n=(r,s)=>{if(ue(r)){if(t.indexOf(r)>=0)return;if(le(r))return r;if(!("toJSON"in r)){t[s]=r;const i=Q(r)?[]:{};return fe(r,(o,c)=>{const h=n(o,s+1);!ee(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},Hn=B("AsyncFunction"),zn=e=>e&&(ue(e)||k(e))&&k(e.then)&&k(e.catch),St=((e,t)=>e?setImmediate:t?((n,r)=>(X.addEventListener("message",({source:s,data:i})=>{s===X&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),X.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",k(X.postMessage)),$n=typeof queueMicrotask<"u"?queueMicrotask.bind(X):typeof process<"u"&&process.nextTick||St,a={isArray:Q,isArrayBuffer:pt,isBuffer:le,isFormData:yn,isArrayBufferView:ln,isString:un,isNumber:mt,isBoolean:fn,isObject:ue,isPlainObject:Ae,isEmptyObject:dn,isReadableStream:Sn,isRequest:gn,isResponse:Rn,isHeaders:An,isUndefined:ee,isDate:hn,isFile:pn,isBlob:mn,isRegExp:Fn,isFunction:k,isStream:bn,isURLSearchParams:wn,isTypedArray:In,isFileList:En,forEach:fe,merge:ve,extend:Tn,trim:On,stripBOM:Nn,inherits:_n,toFlatObject:Pn,kindOf:ge,kindOfTest:B,endsWith:xn,toArray:Cn,forEachEntry:Ln,matchAll:jn,isHTMLForm:kn,hasOwnProperty:yt,hasOwnProp:yt,reduceDescriptors:wt,freezeMethods:vn,toObjectSet:Dn,toCamelCase:Un,noop:Bn,toFiniteNumber:Mn,findKey:Et,global:X,isContextDefined:bt,isSpecCompliantForm:Gn,toJSONObject:qn,isAsyncFn:Hn,isThenable:zn,setImmediate:St,asap:$n,isIterable:e=>e!=null&&k(e[Se])};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,this.status=s.status?s.status:null)}a.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:a.toJSONObject(this.config),code:this.code,status:this.status}}});const gt=y.prototype,Rt={};["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=>{Rt[e]={value:e}}),Object.defineProperties(y,Rt),Object.defineProperty(gt,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(gt);a.toFlatObject(e,o,function(u){return u!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return y.call(o,c,h,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const Jn=null;function De(e){return a.isPlainObject(e)||a.isArray(e)}function At(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ot(e,t,n){return e?e.concat(t).map(function(s,i){return s=At(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Wn(e){return a.isArray(e)&&!e.some(De)}const Vn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function Oe(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,p){return!a.isUndefined(p[E])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!h&&a.isBlob(d))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?h&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,E,p){let R=d;if(d&&!p&&typeof d=="object"){if(a.endsWith(E,"{}"))E=r?E:E.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Wn(d)||(a.isFileList(d)||a.endsWith(E,"[]"))&&(R=a.toArray(d)))return E=At(E),R.forEach(function(_,j){!(a.isUndefined(_)||_===null)&&t.append(o===!0?Ot([E],j,i):o===null?E:E+"[]",f(_))}),!1}return De(d)?!0:(t.append(Ot(p,E,i),f(d)),!1)}const m=[],S=Object.assign(Vn,{defaultVisitor:u,convertValue:f,isVisitable:De});function T(d,E){if(!a.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+E.join("."));m.push(d),a.forEach(d,function(R,P){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(P)?P.trim():P,E,S))===!0&&T(R,E?E.concat(P):[P])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return T(e),t}function Tt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Be(e,t){this._pairs=[],e&&Oe(e,this,t)}const Nt=Be.prototype;Nt.append=function(t,n){this._pairs.push([t,n])},Nt.toString=function(t){const n=t?function(r){return t.call(this,r,Tt)}:Tt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Xn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _t(e,t,n){if(!t)return e;const r=n&&n.encode||Xn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Be(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Pt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Yn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Be,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Me=typeof window<"u"&&typeof document<"u",Ge=typeof navigator=="object"&&navigator||void 0,Kn=Me&&(!Ge||["ReactNative","NativeScript","NS"].indexOf(Ge.product)<0),Zn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Qn=Me&&window.location.href||"http://localhost",L={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Me,hasStandardBrowserEnv:Kn,hasStandardBrowserWebWorkerEnv:Zn,navigator:Ge,origin:Qn},Symbol.toStringTag,{value:"Module"})),...Yn};function er(e,t){return Oe(e,new L.classes.URLSearchParams,{visitor:function(n,r,s,i){return L.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function tr(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function nr(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 Ct(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),h=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,h?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=nr(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(tr(r),s,n,0)}),n}return null}function rr(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const de={transitional:xt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Ct(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return er(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Oe(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),rr(t)):t}],transformResponse:[function(t){const n=this.transitional||de.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?y.from(c,y.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:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{de.headers[e]={}});const sr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),or=e=>{const t={};let n,r,s;return e&&e.split(`
7
- `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&sr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},It=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function Te(e){return e===!1||e==null?e:a.isArray(e)?e.map(Te):String(e)}function ir(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 ar=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function cr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lr(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let U=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,h,f){const u=he(h);if(!u)throw new Error("header name must be a non-empty string");const m=a.findKey(s,u);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||h]=Te(c))}const o=(c,h)=>a.forEach(c,(f,u)=>i(f,u,h));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!ar(t))o(or(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},h,f;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[f=u[0]]=(h=c[f])?a.isArray(h)?[...h,u[1]]:[h,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=he(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return ir(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=he(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||qe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=he(o),o){const c=a.findKey(r,o);c&&(!n||qe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||qe(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=Te(s),delete n[i];return}const c=t?cr(i):String(i).trim();c!==i&&delete n[i],n[c]=Te(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
8
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[It]=this[It]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=he(o);r[c]||(lr(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(U.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(U);function He(e,t){const n=this||de,r=t||n,s=U.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Lt(e){return!!(e&&e.__CANCEL__)}function te(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(te,y,{__CANCEL__:!0});function jt(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 ur(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fr(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(h){const f=Date.now(),u=r[i];o||(o=f),n[s]=h,r[s]=f;let m=i,S=0;for(;m!==s;)S+=n[m++],m=m%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),f-o<t)return;const T=u&&f-u;return T?Math.round(S*1e3/T):void 0}}function dr(e,t){let n=0,r=1e3/t,s,i;const o=(f,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const u=Date.now(),m=u-n;m>=r?o(f,u):(s=f,i||(i=setTimeout(()=>{i=null,o(s)},r-m)))},()=>s&&o(s)]}const Ne=(e,t,n=3)=>{let r=0;const s=fr(50,250);return dr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,h=o-r,f=s(h),u=o<=c;r=o;const m={loaded:o,total:c,progress:c?o/c:void 0,bytes:h,rate:f||void 0,estimated:f&&c&&u?(c-o)/f:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},kt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ut=e=>(...t)=>a.asap(()=>e(...t)),hr=L.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,L.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0,pr=L.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function mr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Er(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ft(e,t,n){let r=!mr(t);return e&&(r||n==!1)?Er(e,t):t}const vt=e=>e instanceof U?{...e}:e;function Y(e,t){t=t||{};const n={};function r(f,u,m,S){return a.isPlainObject(f)&&a.isPlainObject(u)?a.merge.call({caseless:S},f,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(f,u,m,S){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f,m,S)}else return r(f,u,m,S)}function i(f,u){if(!a.isUndefined(u))return r(void 0,u)}function o(f,u){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function c(f,u,m){if(m in t)return r(f,u);if(m in e)return r(void 0,f)}const h={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:(f,u,m)=>s(vt(f),vt(u),m,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const m=h[u]||s,S=m(e[u],t[u],u);a.isUndefined(S)&&m!==c||(n[u]=S)}),n}const Dt=e=>{const t=Y({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=U.from(o),t.url=_t(Ft(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const h=n.getHeaders(),f=["content-type","content-length"];Object.entries(h).forEach(([u,m])=>{f.includes(u.toLowerCase())&&o.set(u,m)})}}if(L.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&hr(t.url))){const h=s&&i&&pr.read(i);h&&o.set(s,h)}return t},br=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Dt(e);let i=s.data;const o=U.from(s.headers).normalize();let{responseType:c,onUploadProgress:h,onDownloadProgress:f}=s,u,m,S,T,d;function E(){T&&T(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function R(){if(!p)return;const _=U.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:_,config:e,request:p};jt(function(F){n(F),E()},function(F){r(F),E()},v),p=null}"onloadend"in p?p.onloadend=R:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(R)},p.onabort=function(){p&&(r(new y("Request aborted",y.ECONNABORTED,e,p)),p=null)},p.onerror=function(j){const v=j&&j.message?j.message:"Network Error",H=new y(v,y.ERR_NETWORK,e,p);H.event=j||null,r(H),p=null},p.ontimeout=function(){let j=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||xt;s.timeoutErrorMessage&&(j=s.timeoutErrorMessage),r(new y(j,v.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(j,v){p.setRequestHeader(v,j)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),f&&([S,d]=Ne(f,!0),p.addEventListener("progress",S)),h&&p.upload&&([m,T]=Ne(h),p.upload.addEventListener("progress",m),p.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(u=_=>{p&&(r(!_||_.type?new te(null,e,p):_),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const P=ur(s.url);if(P&&L.protocols.indexOf(P)===-1){r(new y("Unsupported protocol "+P+":",y.ERR_BAD_REQUEST,e));return}p.send(i||null)})},yr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(f){if(!s){s=!0,c();const u=f instanceof Error?f:this.reason;r.abort(u instanceof y?u:new te(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:h}=r;return h.unsubscribe=()=>a.asap(c),h}},wr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Sr=async function*(e,t){for await(const n of gr(e))yield*wr(n,t)},gr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Bt=(e,t,n,r)=>{const s=Sr(e,t);let i=0,o,c=h=>{o||(o=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:f,value:u}=await s.next();if(f){c(),h.close();return}let m=u.byteLength;if(n){let S=i+=m;n(S)}h.enqueue(new Uint8Array(u))}catch(f){throw c(f),f}},cancel(h){return c(h),s.return()}},{highWaterMark:2})},Mt=64*1024,{isFunction:_e}=a,Rr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Gt,TextEncoder:qt}=a.global,Ht=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ar=e=>{e=a.merge.call({skipUndefined:!0},Rr,e);const{fetch:t,Request:n,Response:r}=e,s=t?_e(t):typeof fetch=="function",i=_e(n),o=_e(r);if(!s)return!1;const c=s&&_e(Gt),h=s&&(typeof qt=="function"?(d=>E=>d.encode(E))(new qt):async d=>new Uint8Array(await new n(d).arrayBuffer())),f=i&&c&&Ht(()=>{let d=!1;const E=new n(L.origin,{body:new Gt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!E}),u=o&&c&&Ht(()=>a.isReadableStream(new r("").body)),m={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(E,p)=>{let R=E&&E[d];if(R)return R.call(E);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,p)})});const S=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(L.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await h(d)).byteLength},T=async(d,E)=>{const p=a.toFiniteNumber(d.getContentLength());return p??S(E)};return async d=>{let{url:E,method:p,data:R,signal:P,cancelToken:_,timeout:j,onDownloadProgress:v,onUploadProgress:H,responseType:F,headers:pe,withCredentials:J="same-origin",fetchOptions:Le}=Dt(d),je=t||fetch;F=F?(F+"").toLowerCase():"text";let W=yr([P,_&&_.toAbortSignal()],j),V=null;const z=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let re;try{if(H&&f&&p!=="get"&&p!=="head"&&(re=await T(pe,R))!==0){let l=new n(E,{method:"POST",body:R,duplex:"half"}),b;if(a.isFormData(R)&&(b=l.headers.get("content-type"))&&pe.setContentType(b),l.body){const[A,O]=kt(re,Ne(Ut(H)));R=Bt(l.body,Mt,A,O)}}a.isString(J)||(J=J?"include":"omit");const D=i&&"credentials"in n.prototype,me={...Le,signal:W,method:p.toUpperCase(),headers:pe.normalize().toJSON(),body:R,duplex:"half",credentials:D?J:void 0};V=i&&new n(E,me);let M=await(i?je(V,Le):je(E,me));const Ee=u&&(F==="stream"||F==="response");if(u&&(v||Ee&&z)){const l={};["status","statusText","headers"].forEach(Z=>{l[Z]=M[Z]});const b=a.toFiniteNumber(M.headers.get("content-length")),[A,O]=v&&kt(b,Ne(Ut(v),!0))||[];M=new r(Bt(M.body,Mt,A,()=>{O&&O(),z&&z()}),l)}F=F||"text";let ke=await m[a.findKey(m,F)||"text"](M,d);return!Ee&&z&&z(),await new Promise((l,b)=>{jt(l,b,{data:ke,headers:U.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:V})})}catch(D){throw z&&z(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,V),{cause:D.cause||D}):y.from(D,D&&D.code,d,V)}}},Or=new Map,zt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,h,f,u=Or;for(;c--;)h=i[c],f=u.get(h),f===void 0&&u.set(h,f=c?new Map:Ar(t)),u=f;return f};zt();const ze={http:Jn,xhr:br,fetch:{get:zt}};a.forEach(ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const $t=e=>`- ${e}`,Tr=e=>a.isFunction(e)||e===null||e===!1;function Nr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Tr(r)&&(s=ze[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([h,f])=>`adapter ${h} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
9
- `+o.map($t).join(`
10
- `):" "+$t(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Jt={getAdapter:Nr,adapters:ze};function $e(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te(null,e)}function Wt(e){return $e(e),e.headers=U.from(e.headers),e.data=He.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Jt.getAdapter(e.adapter||de.adapter,e)(e).then(function(r){return $e(e),r.data=He.call(e,e.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return Lt(r)||($e(e),r&&r.response&&(r.response.data=He.call(e,e.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Vt="1.13.2",Pe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Xt={};Pe.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Vt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new y(s(o," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!Xt[o]&&(Xt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},Pe.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function _r(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 i=r[s],o=t[i];if(o){const c=e[i],h=c===void 0||o(c,i,e);if(h!==!0)throw new y("option "+i+" must be "+h,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const xe={assertOptions:_r,validators:Pe},G=xe.validators;let K=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Pt,response:new Pt}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
11
- `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Y(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&xe.assertOptions(r,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:xe.assertOptions(s,{encode:G.function,serialize:G.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xe.assertOptions(n,{baseUrl:G.spelling("baseURL"),withXsrfToken:G.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=U.concat(o,i);const c=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(h=h&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const f=[];this.interceptors.response.forEach(function(E){f.push(E.fulfilled,E.rejected)});let u,m=0,S;if(!h){const d=[Wt.bind(this),void 0];for(d.unshift(...c),d.push(...f),S=d.length,u=Promise.resolve(n);m<S;)u=u.then(d[m++],d[m++]);return u}S=c.length;let T=n;for(;m<S;){const d=c[m++],E=c[m++];try{T=d(T)}catch(p){E.call(this,p);break}}try{u=Wt.call(this,T)}catch(d){return Promise.reject(d)}for(m=0,S=f.length;m<S;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=Y(this.defaults,t);const n=Ft(t.baseURL,t.url,t.allowAbsoluteUrls);return _t(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){K.prototype[t]=function(n,r){return this.request(Y(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(Y(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}K.prototype[t]=n(),K.prototype[t+"Form"]=n(!0)});let Pr=class tn{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(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new te(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tn(function(s){t=s}),cancel:t}}};function xr(e){return function(n){return e.apply(null,n)}}function Cr(e){return a.isObject(e)&&e.isAxiosError===!0}const Je={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Je).forEach(([e,t])=>{Je[t]=e});function Yt(e){const t=new K(e),n=dt(K.prototype.request,t);return a.extend(n,K.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Yt(Y(e,s))},n}const N=Yt(de);N.Axios=K,N.CanceledError=te,N.CancelToken=Pr,N.isCancel=Lt,N.VERSION=Vt,N.toFormData=Oe,N.AxiosError=y,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=xr,N.isAxiosError=Cr,N.mergeConfig=Y,N.AxiosHeaders=U,N.formToJSON=e=>Ct(a.isHTMLForm(e)?new FormData(e):e),N.getAdapter=Jt.getAdapter,N.HttpStatusCode=Je,N.default=N;const{Axios:zr,AxiosError:$r,CanceledError:Jr,isCancel:Wr,CancelToken:Vr,VERSION:Xr,all:Yr,Cancel:Kr,isAxiosError:Zr,spread:Qr,toFormData:es,AxiosHeaders:ts,HttpStatusCode:ns,formToJSON:rs,getAdapter:ss,mergeConfig:os}=N,Kt=x.createContext(null),Ir=({children:e})=>{const[t,n]=x.useState(localStorage.getItem("isLoggedIn")==="true"),r=()=>{localStorage.setItem("isLoggedIn","true"),n(!0)},s=()=>{localStorage.removeItem("isLoggedIn"),ce(null),n(!1)};return w.jsx(Kt.Provider,{value:{isAuthenticated:t,login:r,logout:s},children:e})},Ce=()=>{const e=x.useContext(Kt);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e};let We="";function Lr(e){We=e.apiBaseUrl}function ne(){if(!We)throw new Error("Auth not initialized. Call initAuth() in consumer app.");return We}async function Zt(){const e=await N.post(`${ne()}${$.refreshToken}`,{},{withCredentials:!0}),t=e?.data?.accessToken||e?.data?.data?.accessToken;if(!t)throw new Error("Invalid refresh response");return t}const q=N.create({withCredentials:!0});let Ie=!1,Ve=[];const Qt=(e,t=null)=>{Ve.forEach(n=>{e?n.reject(e):n.resolve(t)}),Ve=[]};q.interceptors.request.use(async e=>{if(e.withCredentials=!0,e.url?.includes($.login)||e.url?.includes($.register))return e.headers&&"Authorization"in e.headers&&delete e.headers.Authorization,e;const n=an();if(n)return e.headers&&(e.headers.Authorization=`Bearer ${n}`),e;try{const r=await Zt();return ce(r),e.headers&&(e.headers.Authorization=`Bearer ${r}`),e}catch(r){throw window.location.href="/",sessionStorage.setItem(ae,we),ce(null),localStorage.removeItem("isLoggedIn"),r}},e=>Promise.reject(e)),q.interceptors.response.use(e=>e,async e=>{const t=e.config;if(e.response?.status===401&&!t._retry){if(Ie)return new Promise((n,r)=>{Ve.push({resolve:n,reject:r})}).then(n=>(t.headers&&(t.headers.Authorization=`Bearer ${n}`),q(t))).catch(n=>Promise.reject(n));t._retry=!0,Ie=!0;try{const n=await Zt();return ce(n),t.headers&&(t.headers.Authorization=`Bearer ${n}`),Qt(null,n),Ie=!1,q(t)}catch(n){return window.location.href="/",sessionStorage.setItem(ae,we),Qt(n,null),Ie=!1,Ce().logout(),Promise.reject(n)}}return Promise.reject(e)});const Xe={MIN_LENGTH:8,REGEX:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#])[A-Za-z\d@$!%*?&#]{8,}$/,ERROR_MESSAGE:"Password must be at least 8 characters long and include uppercase, lowercase, number, and special character."},en=e=>Xe.REGEX.test(e),jr=({onLoginSuccess:e})=>{const[t,n]=x.useState(C.LOGIN),[r,s]=x.useState({email:"",password:""}),i=be.useNavigate(),[o,c]=x.useState(!1),[h,f]=x.useState(""),[u,m]=x.useState("");x.useEffect(()=>{typeof window<"u"&&sessionStorage.getItem(ae)===we&&(sessionStorage.removeItem(ae),f(ot),n(C.LOGIN))},[]);const S=p=>{const{name:R,value:P}=p.target;s(_=>({..._,[R]:P})),f("")},T=async p=>{p.preventDefault(),c(!0),f(""),m("");try{if(t===C.SIGNUP){if(!en(r.password)){f(Xe.ERROR_MESSAGE);return}await q.post(`${ne()}${$.register}`,r),m(tt),n(C.LOGIN),s({email:r.email,password:""});return}const R=await q.post(`${ne()}${$.login}`,r),{accessToken:P}=R.data;ce(P),localStorage.setItem("isLoggedIn","true"),m(st),e&&e(),i("/profile")}catch(R){const P=R?.response?.data?.message||(t===C.SIGNUP?nt:rt);f(P)}finally{c(!1)}},d=()=>{n(C.SIGNUP),f(""),m("")},E=()=>{n(C.LOGIN),f(""),m("")};return w.jsx("div",{className:"auth-container",children:w.jsxs("div",{className:"auth-card",children:[w.jsxs("div",{className:"mode-selector",children:[w.jsx("button",{className:t===C.LOGIN?"active":"",onClick:E,children:C.LOGIN}),w.jsx("button",{className:t===C.SIGNUP?"active":"",onClick:d,children:C.SIGNUP})]}),w.jsxs("form",{onSubmit:T,children:[t===C.LOGIN?w.jsx("h2",{children:C.LOGIN}):w.jsx("h2",{children:C.SIGNUP}),w.jsxs("div",{className:"form-group",children:[w.jsx("label",{htmlFor:"email",children:Ue}),w.jsx("input",{type:"email",id:"email",name:"email",value:r.email,onChange:S,required:!0,placeholder:"Enter your email"})]}),w.jsxs("div",{className:"form-group",children:[w.jsx("label",{htmlFor:"password",children:ct}),w.jsx("input",{type:"password",id:"password",name:"password",value:r.password,onChange:S,required:!0,placeholder:"Enter your password"})]}),h&&w.jsx("div",{className:"error-message",children:h}),u&&w.jsx("div",{className:"success-message",children:u}),w.jsx("button",{type:"submit",className:"submit-btn",disabled:o,children:o?t===C.LOGIN?it:at:t===C.LOGIN?C.LOGIN:C.SIGNUP})]})]})})},kr=({onLogout:e})=>{const[t,n]=x.useState(null),[r,s]=x.useState(!1),[i,o]=x.useState(""),[c,h]=x.useState(""),f=be.useNavigate(),u=()=>{q.post(`${ne()}${$.logout}`).catch(m=>{console.error("Logout failed:",m)}),n(null),e(),f("/")};return x.useEffect(()=>{(async()=>{s(!0),o("");try{const S=await q.get(`${ne()}${$.userDetails}`);n(S.data.data),h("User details fetched successfully")}catch(S){o(S.response?.data?.message||"Failed to fetch user details")}finally{s(!1)}})()},[]),w.jsx("div",{className:"auth-container",children:w.jsxs("div",{className:"auth-card profile-view",children:[w.jsx("h2",{children:"User Profile"}),r&&w.jsx("div",{className:"loading",children:"Loading user details..."}),w.jsxs("div",{className:"user-details",children:[w.jsxs("div",{className:"detail-row",children:[w.jsxs("span",{className:"label",children:[lt,":"]}),w.jsx("span",{className:"value",children:t?.userId})]}),w.jsxs("div",{className:"detail-row",children:[w.jsxs("span",{className:"label",children:[Ue,":"]}),w.jsx("span",{className:"value",children:t?.emailId})]})]}),i&&w.jsx("div",{className:"error-message",children:i}),c&&w.jsx("div",{className:"success-message",children:c}),w.jsx("button",{className:"logout-btn",onClick:u,children:ut})]})})},Ur=({children:e,redirectTo:t="/"})=>{const{isAuthenticated:n}=Ce();return n?w.jsx(w.Fragment,{children:e}):w.jsx(be.Navigate,{to:t,replace:!0})},Fr=({children:e,redirectTo:t="/profile"})=>{const{isAuthenticated:n}=Ce();return n?w.jsx(be.Navigate,{to:t,replace:!0}):w.jsx(w.Fragment,{children:e})};g.AuthForm=jr,g.AuthMode=C,g.AuthProvider=Ir,g.EMAIL_LABEL=Ue,g.LOGIN_FAILED=rt,g.LOGIN_SUCCESS=st,g.LOGOUT_BUTTON=ut,g.LOGOUT_SUCCESS=on,g.PASSWORD_LABEL=ct,g.PASSWORD_VALIDATION=Xe,g.ProtectedRoute=Ur,g.PublicRoute=Fr,g.REGISTRATION_FAILED=nt,g.REGISTRATION_SUCCESS=tt,g.SESSION_EXPIRED=ot,g.SIGNING_IN=it,g.SIGNING_UP=at,g.USER_ID=lt,g.UserProfile=kr,g.axiosInstance=q,g.endPoints=$,g.getApiBaseUrl=ne,g.initAuth=Lr,g.sessionExpired=ae,g.sessionExpiredValue=we,g.useAuth=Ce,g.validatePassword=en,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
6
+ <%s key={someKey} {...props} />`,O,L,ie,L),je[L+O]=!0)}if(L=null,A!==void 0&&(n(A),L=""+A),o(b)&&(n(b.key),L=""+b.key),"key"in b){A={};for(var Qe in b)Qe!=="key"&&(A[Qe]=b[Qe])}else A=b;return L&&c(A,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,L,A,s(),ee,Ze)}function m(l){g(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===J&&(l._payload.status==="fulfilled"?g(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function g(l){return typeof l=="object"&&l!==null&&l.$$typeof===d}var T=P,d=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),k=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),me=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),Ie=Symbol.for("react.activity"),ke=Symbol.for("react.client.reference"),W=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,z=Array.isArray,oe=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(l){return l()}};var D,Ee={},M=T.react_stack_bottom_frame.bind(T,i)(),be=oe(r(i)),je={};ce.Fragment=p,ce.jsx=function(l,b,A){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,A,!1,O?Error("react-stack-top-frame"):M,O?oe(r(l)):be)},ce.jsxs=function(l,b,A){var O=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,A,!0,O?Error("react-stack-top-frame"):M,O?oe(r(l)):be)}})()),ce}var nt;function un(){return nt||(nt=1,process.env.NODE_ENV==="production"?ye.exports=cn():ye.exports=ln()),ye.exports}var w=un();const $={refreshToken:"/auth/renew-token",login:"/auth/authenticate",logout:"/auth/terminate",register:"/auth/register",userDetails:"/auth/profile",test:"/auth/test-endpoint"},rt="Registration successful! Please login.",st="Registration failed. Please try again.",ot="Login failed. Please try again.",it="Login successful!",fn="Logged out successfully.",at="Session expired. Please login again.",x={LOGIN:"Sign In",SIGNUP:"Sign Up"},ct="Signing in...",lt="Signing up...",Ue="Email",ut="Password",ft="User ID",dt="Logout",le="sessionExpired",we="true",Fe="accessToken";function Y(e){e&&localStorage.setItem(Fe,e)}function ht(){localStorage.removeItem(Fe)}function pt(){return localStorage.getItem(Fe)}function mt(e,t){return function(){return e.apply(t,arguments)}}const{toString:dn}=Object.prototype,{getPrototypeOf:ve}=Object,{iterator:ge,toStringTag:Et}=Symbol,Re=(e=>t=>{const n=dn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),B=e=>(e=e.toLowerCase(),t=>Re(t)===e),Ae=e=>t=>typeof t===e,{isArray:te}=Array,ne=Ae("undefined");function ue(e){return e!==null&&!ne(e)&&e.constructor!==null&&!ne(e.constructor)&&j(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bt=B("ArrayBuffer");function hn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bt(e.buffer),t}const pn=Ae("string"),j=Ae("function"),St=Ae("number"),fe=e=>e!==null&&typeof e=="object",mn=e=>e===!0||e===!1,Oe=e=>{if(Re(e)!=="object")return!1;const t=ve(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Et in e)&&!(ge in e)},En=e=>{if(!fe(e)||ue(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bn=B("Date"),Sn=B("File"),yn=B("Blob"),wn=B("FileList"),gn=e=>fe(e)&&j(e.pipe),Rn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||j(e.append)&&((t=Re(e))==="formdata"||t==="object"&&j(e.toString)&&e.toString()==="[object FormData]"))},An=B("URLSearchParams"),[On,Tn,Nn,_n]=["ReadableStream","Request","Response","Headers"].map(B),Pn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function de(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),te(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(ue(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function yt(e,t){if(ue(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wt=e=>!ne(e)&&e!==X;function De(){const{caseless:e,skipUndefined:t}=wt(this)&&this||{},n={},r=(s,i)=>{const o=e&&yt(n,i)||i;Oe(n[o])&&Oe(s)?n[o]=De(n[o],s):Oe(s)?n[o]=De({},s):te(s)?n[o]=s.slice():(!t||!ne(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&de(arguments[s],r);return n}const Cn=(e,t,n,{allOwnKeys:r}={})=>(de(t,(s,i)=>{n&&j(s)?e[i]=mt(s,n):e[i]=s},{allOwnKeys:r}),e),xn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ln=(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)},In=(e,t,n,r)=>{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],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&ve(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kn=(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},jn=e=>{if(!e)return null;if(te(e))return e;let t=e.length;if(!St(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Un=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ve(Uint8Array)),Fn=(e,t)=>{const r=(e&&e[ge]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},vn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Dn=B("HTMLFormElement"),Bn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),gt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Mn=B("RegExp"),Rt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};de(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},Gn=e=>{Rt(e,(t,n)=>{if(j(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(j(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+"'")})}})},Hn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return te(e)?r(e):r(String(e).split(t)),n},qn=()=>{},zn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function $n(e){return!!(e&&j(e.append)&&e[Et]==="FormData"&&e[ge])}const Jn=e=>{const t=new Array(10),n=(r,s)=>{if(fe(r)){if(t.indexOf(r)>=0)return;if(ue(r))return r;if(!("toJSON"in r)){t[s]=r;const i=te(r)?[]:{};return de(r,(o,c)=>{const h=n(o,s+1);!ne(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},Wn=B("AsyncFunction"),Vn=e=>e&&(fe(e)||j(e))&&j(e.then)&&j(e.catch),At=((e,t)=>e?setImmediate:t?((n,r)=>(X.addEventListener("message",({source:s,data:i})=>{s===X&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),X.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",j(X.postMessage)),Yn=typeof queueMicrotask<"u"?queueMicrotask.bind(X):typeof process<"u"&&process.nextTick||At,a={isArray:te,isArrayBuffer:bt,isBuffer:ue,isFormData:Rn,isArrayBufferView:hn,isString:pn,isNumber:St,isBoolean:mn,isObject:fe,isPlainObject:Oe,isEmptyObject:En,isReadableStream:On,isRequest:Tn,isResponse:Nn,isHeaders:_n,isUndefined:ne,isDate:bn,isFile:Sn,isBlob:yn,isRegExp:Mn,isFunction:j,isStream:gn,isURLSearchParams:An,isTypedArray:Un,isFileList:wn,forEach:de,merge:De,extend:Cn,trim:Pn,stripBOM:xn,inherits:Ln,toFlatObject:In,kindOf:Re,kindOfTest:B,endsWith:kn,toArray:jn,forEachEntry:Fn,matchAll:vn,isHTMLForm:Dn,hasOwnProperty:gt,hasOwnProp:gt,reduceDescriptors:Rt,freezeMethods:Gn,toObjectSet:Hn,toCamelCase:Bn,noop:qn,toFiniteNumber:zn,findKey:yt,global:X,isContextDefined:wt,isSpecCompliantForm:$n,toJSONObject:Jn,isAsyncFn:Wn,isThenable:Vn,setImmediate:At,asap:Yn,isIterable:e=>e!=null&&j(e[ge])};function S(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(S,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const Ot=S.prototype,Tt={};["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=>{Tt[e]={value:e}}),Object.defineProperties(S,Tt),Object.defineProperty(Ot,"isAxiosError",{value:!0}),S.from=(e,t,n,r,s,i)=>{const o=Object.create(Ot);a.toFlatObject(e,o,function(u){return u!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return S.call(o,c,h,n,r,s),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const Xn=null;function Be(e){return a.isPlainObject(e)||a.isArray(e)}function Nt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function _t(e,t,n){return e?e.concat(t).map(function(s,i){return s=Nt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Kn(e){return a.isArray(e)&&!e.some(Be)}const Zn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function Te(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,p){return!a.isUndefined(p[E])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!h&&a.isBlob(d))throw new S("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?h&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,E,p){let R=d;if(d&&!p&&typeof d=="object"){if(a.endsWith(E,"{}"))E=r?E:E.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Kn(d)||(a.isFileList(d)||a.endsWith(E,"[]"))&&(R=a.toArray(d)))return E=Nt(E),R.forEach(function(_,k){!(a.isUndefined(_)||_===null)&&t.append(o===!0?_t([E],k,i):o===null?E:E+"[]",f(_))}),!1}return Be(d)?!0:(t.append(_t(p,E,i),f(d)),!1)}const m=[],g=Object.assign(Zn,{defaultVisitor:u,convertValue:f,isVisitable:Be});function T(d,E){if(!a.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+E.join("."));m.push(d),a.forEach(d,function(R,C){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(C)?C.trim():C,E,g))===!0&&T(R,E?E.concat(C):[C])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return T(e),t}function Pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Me(e,t){this._pairs=[],e&&Te(e,this,t)}const Ct=Me.prototype;Ct.append=function(t,n){this._pairs.push([t,n])},Ct.toString=function(t){const n=t?function(r){return t.call(this,r,Pt)}:Pt;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Qn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xt(e,t,n){if(!t)return e;const r=n&&n.encode||Qn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new Me(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Lt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const It={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},er={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ge=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,tr=Ge&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),nr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",rr=Ge&&window.location.href||"http://localhost",I={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ge,hasStandardBrowserEnv:tr,hasStandardBrowserWebWorkerEnv:nr,navigator:He,origin:rr},Symbol.toStringTag,{value:"Module"})),...er};function sr(e,t){return Te(e,new I.classes.URLSearchParams,{visitor:function(n,r,s,i){return I.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function or(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ir(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 kt(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),h=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,h?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=ir(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(or(r),s,n,0)}),n}return null}function ar(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const he={transitional:It,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(kt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return sr(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Te(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ar(t)):t}],transformResponse:[function(t){const n=this.transitional||he.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?S.from(c,S.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:I.classes.FormData,Blob:I.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{he.headers[e]={}});const cr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lr=e=>{const t={};let n,r,s;return e&&e.split(`
7
+ `).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&cr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},jt=Symbol("internals");function pe(e){return e&&String(e).trim().toLowerCase()}function Ne(e){return e===!1||e==null?e:a.isArray(e)?e.map(Ne):String(e)}function ur(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 fr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qe(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function dr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function hr(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let U=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,h,f){const u=pe(h);if(!u)throw new Error("header name must be a non-empty string");const m=a.findKey(s,u);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||h]=Ne(c))}const o=(c,h)=>a.forEach(c,(f,u)=>i(f,u,h));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(a.isString(t)&&(t=t.trim())&&!fr(t))o(lr(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},h,f;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[f=u[0]]=(h=c[f])?a.isArray(h)?[...h,u[1]]:[h,u[1]]:u[1]}o(c,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=pe(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return ur(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=pe(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||qe(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=pe(o),o){const c=a.findKey(r,o);c&&(!n||qe(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||qe(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=Ne(s),delete n[i];return}const c=t?dr(i):String(i).trim();c!==i&&delete n[i],n[c]=Ne(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
8
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[jt]=this[jt]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=pe(o);r[c]||(hr(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(U.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(U);function ze(e,t){const n=this||he,r=t||n,s=U.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ut(e){return!!(e&&e.__CANCEL__)}function re(e,t,n){S.call(this,e??"canceled",S.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(re,S,{__CANCEL__:!0});function Ft(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new S("Request failed with status code "+n.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mr(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(h){const f=Date.now(),u=r[i];o||(o=f),n[s]=h,r[s]=f;let m=i,g=0;for(;m!==s;)g+=n[m++],m=m%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),f-o<t)return;const T=u&&f-u;return T?Math.round(g*1e3/T):void 0}}function Er(e,t){let n=0,r=1e3/t,s,i;const o=(f,u=Date.now())=>{n=u,s=null,i&&(clearTimeout(i),i=null),e(...f)};return[(...f)=>{const u=Date.now(),m=u-n;m>=r?o(f,u):(s=f,i||(i=setTimeout(()=>{i=null,o(s)},r-m)))},()=>s&&o(s)]}const _e=(e,t,n=3)=>{let r=0;const s=mr(50,250);return Er(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,h=o-r,f=s(h),u=o<=c;r=o;const m={loaded:o,total:c,progress:c?o/c:void 0,bytes:h,rate:f||void 0,estimated:f&&c&&u?(c-o)/f:void 0,event:i,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},vt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Dt=e=>(...t)=>a.asap(()=>e(...t)),br=I.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,I.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(I.origin),I.navigator&&/(msie|trident)/i.test(I.navigator.userAgent)):()=>!0,Sr=I.hasStandardBrowserEnv?{write(e,t,n,r,s,i,o){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function yr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Bt(e,t,n){let r=!yr(t);return e&&(r||n==!1)?wr(e,t):t}const Mt=e=>e instanceof U?{...e}:e;function K(e,t){t=t||{};const n={};function r(f,u,m,g){return a.isPlainObject(f)&&a.isPlainObject(u)?a.merge.call({caseless:g},f,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(f,u,m,g){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f,m,g)}else return r(f,u,m,g)}function i(f,u){if(!a.isUndefined(u))return r(void 0,u)}function o(f,u){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function c(f,u,m){if(m in t)return r(f,u);if(m in e)return r(void 0,f)}const h={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:(f,u,m)=>s(Mt(f),Mt(u),m,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const m=h[u]||s,g=m(e[u],t[u],u);a.isUndefined(g)&&m!==c||(n[u]=g)}),n}const Gt=e=>{const t=K({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=t;if(t.headers=o=U.from(o),t.url=xt(Bt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(I.hasStandardBrowserEnv||I.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const h=n.getHeaders(),f=["content-type","content-length"];Object.entries(h).forEach(([u,m])=>{f.includes(u.toLowerCase())&&o.set(u,m)})}}if(I.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&br(t.url))){const h=s&&i&&Sr.read(i);h&&o.set(s,h)}return t},gr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Gt(e);let i=s.data;const o=U.from(s.headers).normalize();let{responseType:c,onUploadProgress:h,onDownloadProgress:f}=s,u,m,g,T,d;function E(){T&&T(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function R(){if(!p)return;const _=U.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:_,config:e,request:p};Ft(function(F){n(F),E()},function(F){r(F),E()},v),p=null}"onloadend"in p?p.onloadend=R:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(R)},p.onabort=function(){p&&(r(new S("Request aborted",S.ECONNABORTED,e,p)),p=null)},p.onerror=function(k){const v=k&&k.message?k.message:"Network Error",q=new S(v,S.ERR_NETWORK,e,p);q.event=k||null,r(q),p=null},p.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||It;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),r(new S(k,v.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,e,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(k,v){p.setRequestHeader(v,k)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),f&&([g,d]=_e(f,!0),p.addEventListener("progress",g)),h&&p.upload&&([m,T]=_e(h),p.upload.addEventListener("progress",m),p.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(u=_=>{p&&(r(!_||_.type?new re(null,e,p):_),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const C=pr(s.url);if(C&&I.protocols.indexOf(C)===-1){r(new S("Unsupported protocol "+C+":",S.ERR_BAD_REQUEST,e));return}p.send(i||null)})},Rr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(f){if(!s){s=!0,c();const u=f instanceof Error?f:this.reason;r.abort(u instanceof S?u:new re(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new S(`timeout ${t} of ms exceeded`,S.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(i):f.removeEventListener("abort",i)}),e=null)};e.forEach(f=>f.addEventListener("abort",i));const{signal:h}=r;return h.unsubscribe=()=>a.asap(c),h}},Ar=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Or=async function*(e,t){for await(const n of Tr(e))yield*Ar(n,t)},Tr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ht=(e,t,n,r)=>{const s=Or(e,t);let i=0,o,c=h=>{o||(o=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:f,value:u}=await s.next();if(f){c(),h.close();return}let m=u.byteLength;if(n){let g=i+=m;n(g)}h.enqueue(new Uint8Array(u))}catch(f){throw c(f),f}},cancel(h){return c(h),s.return()}},{highWaterMark:2})},qt=64*1024,{isFunction:Pe}=a,Nr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:zt,TextEncoder:$t}=a.global,Jt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_r=e=>{e=a.merge.call({skipUndefined:!0},Nr,e);const{fetch:t,Request:n,Response:r}=e,s=t?Pe(t):typeof fetch=="function",i=Pe(n),o=Pe(r);if(!s)return!1;const c=s&&Pe(zt),h=s&&(typeof $t=="function"?(d=>E=>d.encode(E))(new $t):async d=>new Uint8Array(await new n(d).arrayBuffer())),f=i&&c&&Jt(()=>{let d=!1;const E=new n(I.origin,{body:new zt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!E}),u=o&&c&&Jt(()=>a.isReadableStream(new r("").body)),m={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(E,p)=>{let R=E&&E[d];if(R)return R.call(E);throw new S(`Response type '${d}' is not supported`,S.ERR_NOT_SUPPORT,p)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new n(I.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await h(d)).byteLength},T=async(d,E)=>{const p=a.toFiniteNumber(d.getContentLength());return p??g(E)};return async d=>{let{url:E,method:p,data:R,signal:C,cancelToken:_,timeout:k,onDownloadProgress:v,onUploadProgress:q,responseType:F,headers:me,withCredentials:J="same-origin",fetchOptions:Ie}=Gt(d),ke=t||fetch;F=F?(F+"").toLowerCase():"text";let W=Rr([C,_&&_.toAbortSignal()],k),V=null;const z=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let oe;try{if(q&&f&&p!=="get"&&p!=="head"&&(oe=await T(me,R))!==0){let l=new n(E,{method:"POST",body:R,duplex:"half"}),b;if(a.isFormData(R)&&(b=l.headers.get("content-type"))&&me.setContentType(b),l.body){const[A,O]=vt(oe,_e(Dt(q)));R=Ht(l.body,qt,A,O)}}a.isString(J)||(J=J?"include":"omit");const D=i&&"credentials"in n.prototype,Ee={...Ie,signal:W,method:p.toUpperCase(),headers:me.normalize().toJSON(),body:R,duplex:"half",credentials:D?J:void 0};V=i&&new n(E,Ee);let M=await(i?ke(V,Ie):ke(E,Ee));const be=u&&(F==="stream"||F==="response");if(u&&(v||be&&z)){const l={};["status","statusText","headers"].forEach(ee=>{l[ee]=M[ee]});const b=a.toFiniteNumber(M.headers.get("content-length")),[A,O]=v&&vt(b,_e(Dt(v),!0))||[];M=new r(Ht(M.body,qt,A,()=>{O&&O(),z&&z()}),l)}F=F||"text";let je=await m[a.findKey(m,F)||"text"](M,d);return!be&&z&&z(),await new Promise((l,b)=>{Ft(l,b,{data:je,headers:U.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:V})})}catch(D){throw z&&z(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,d,V),{cause:D.cause||D}):S.from(D,D&&D.code,d,V)}}},Pr=new Map,Wt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let o=i.length,c=o,h,f,u=Pr;for(;c--;)h=i[c],f=u.get(h),f===void 0&&u.set(h,f=c?new Map:_r(t)),u=f;return f};Wt();const $e={http:Xn,xhr:gr,fetch:{get:Wt}};a.forEach($e,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Vt=e=>`- ${e}`,Cr=e=>a.isFunction(e)||e===null||e===!1;function xr(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let o=0;o<n;o++){r=e[o];let c;if(s=r,!Cr(r)&&(s=$e[(c=String(r)).toLowerCase()],s===void 0))throw new S(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([h,f])=>`adapter ${h} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
9
+ `+o.map(Vt).join(`
10
+ `):" "+Vt(o[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Yt={getAdapter:xr,adapters:$e};function Je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new re(null,e)}function Xt(e){return Je(e),e.headers=U.from(e.headers),e.data=ze.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Yt.getAdapter(e.adapter||he.adapter,e)(e).then(function(r){return Je(e),r.data=ze.call(e,e.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return Ut(r)||(Je(e),r&&r.response&&(r.response.data=ze.call(e,e.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Kt="1.13.2",Ce={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ce[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Zt={};Ce.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Kt+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new S(s(o," has been removed"+(n?" in "+n:"")),S.ERR_DEPRECATED);return n&&!Zt[o]&&(Zt[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}},Ce.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Lr(e,t,n){if(typeof e!="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],h=c===void 0||o(c,i,e);if(h!==!0)throw new S("option "+i+" must be "+h,S.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new S("Unknown option "+i,S.ERR_BAD_OPTION)}}const xe={assertOptions:Lr,validators:Ce},G=xe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Lt,response:new Lt}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
11
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=K(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&xe.assertOptions(r,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:xe.assertOptions(s,{encode:G.function,serialize:G.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),xe.assertOptions(n,{baseUrl:G.spelling("baseURL"),withXsrfToken:G.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),n.headers=U.concat(o,i);const c=[];let h=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(h=h&&E.synchronous,c.unshift(E.fulfilled,E.rejected))});const f=[];this.interceptors.response.forEach(function(E){f.push(E.fulfilled,E.rejected)});let u,m=0,g;if(!h){const d=[Xt.bind(this),void 0];for(d.unshift(...c),d.push(...f),g=d.length,u=Promise.resolve(n);m<g;)u=u.then(d[m++],d[m++]);return u}g=c.length;let T=n;for(;m<g;){const d=c[m++],E=c[m++];try{T=d(T)}catch(p){E.call(this,p);break}}try{u=Xt.call(this,T)}catch(d){return Promise.reject(d)}for(m=0,g=f.length;m<g;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=K(this.defaults,t);const n=Bt(t.baseURL,t.url,t.allowAbsoluteUrls);return xt(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(n,r){return this.request(K(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(K(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Z.prototype[t]=n(),Z.prototype[t+"Form"]=n(!0)});let Ir=class an{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(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new re(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new an(function(s){t=s}),cancel:t}}};function kr(e){return function(n){return e.apply(null,n)}}function jr(e){return a.isObject(e)&&e.isAxiosError===!0}const We={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(We).forEach(([e,t])=>{We[t]=e});function Qt(e){const t=new Z(e),n=mt(Z.prototype.request,t);return a.extend(n,Z.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Qt(K(e,s))},n}const N=Qt(he);N.Axios=Z,N.CanceledError=re,N.CancelToken=Ir,N.isCancel=Ut,N.VERSION=Kt,N.toFormData=Te,N.AxiosError=S,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=kr,N.isAxiosError=jr,N.mergeConfig=K,N.AxiosHeaders=U,N.formToJSON=e=>kt(a.isHTMLForm(e)?new FormData(e):e),N.getAdapter=Yt.getAdapter,N.HttpStatusCode=We,N.default=N;const{Axios:Vr,AxiosError:Yr,CanceledError:Xr,isCancel:Kr,CancelToken:Zr,VERSION:Qr,all:es,Cancel:ts,isAxiosError:ns,spread:rs,toFormData:ss,AxiosHeaders:os,HttpStatusCode:is,formToJSON:as,getAdapter:cs,mergeConfig:ls}=N;let Ve="";function Ur(e){Ve=e.apiBaseUrl}function Q(){if(!Ve)throw new Error("Auth not initialized. Call initAuth() in consumer app.");return Ve}let se=null;function en(e){se=e}function tn(){se=null}async function nn(){const e=await N.post(`${Q()}${$.refreshToken}`,{},{withCredentials:!0}),t=e?.data?.accessToken||e?.data?.data?.accessToken;if(!t)throw new Error("Invalid refresh response");return t}const H=N.create({baseURL:Q(),withCredentials:!0});let Le=!1,Ye=[];const rn=(e,t=null)=>{Ye.forEach(n=>{e?n.reject(e):n.resolve(t)}),Ye=[]};H.interceptors.request.use(async e=>{if(e.withCredentials=!0,e.url?.includes($.login)||e.url?.includes($.register))return e.headers&&"Authorization"in e.headers&&delete e.headers.Authorization,e;const n=pt();if(n)return e.headers&&(e.headers.Authorization=`Bearer ${n}`),e;try{const r=await nn();return Y(r),e.headers&&(e.headers.Authorization=`Bearer ${r}`),e}catch(r){throw window.location.href="/",sessionStorage.setItem(le,we),Y(null),localStorage.removeItem("isLoggedIn"),se&&se(),r}},e=>Promise.reject(e)),H.interceptors.response.use(e=>e,async e=>{const t=e.config;if(e.response?.status===401&&!t._retry){if(Le)return new Promise((n,r)=>{Ye.push({resolve:n,reject:r})}).then(n=>(t.headers&&(t.headers.Authorization=`Bearer ${n}`),H(t))).catch(n=>Promise.reject(n));t._retry=!0,Le=!0;try{const n=await nn();return Y(n),t.headers&&(t.headers.Authorization=`Bearer ${n}`),rn(null,n),Le=!1,H(t)}catch(n){return window.location.href="/",sessionStorage.setItem(le,we),rn(n,null),Le=!1,se&&se(),Promise.reject(n)}}return Promise.reject(e)});const Xe={MIN_LENGTH:8,REGEX:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#])[A-Za-z\d@$!%*?&#]{8,}$/,ERROR_MESSAGE:"Password must be at least 8 characters long and include uppercase, lowercase, number, and special character."},sn=e=>Xe.REGEX.test(e),Fr=({onLoginSuccess:e})=>{const[t,n]=P.useState(x.LOGIN),[r,s]=P.useState({email:"",password:""}),i=Se.useNavigate(),[o,c]=P.useState(!1),[h,f]=P.useState(""),[u,m]=P.useState("");P.useEffect(()=>{typeof window<"u"&&sessionStorage.getItem(le)===we&&(sessionStorage.removeItem(le),f(at),n(x.LOGIN))},[]);const g=p=>{const{name:R,value:C}=p.target;s(_=>({..._,[R]:C})),f("")},T=async p=>{p.preventDefault(),c(!0),f(""),m("");try{if(t===x.SIGNUP){if(!sn(r.password)){f(Xe.ERROR_MESSAGE);return}await H.post(`${Q()}${$.register}`,r),m(rt),n(x.LOGIN),s({email:r.email,password:""});return}const R=await H.post(`${Q()}${$.login}`,r),{accessToken:C}=R.data;Y(C),localStorage.setItem("isLoggedIn","true"),m(it),e&&e(),i("/profile")}catch(R){const C=R?.response?.data?.message||(t===x.SIGNUP?st:ot);f(C)}finally{c(!1)}},d=()=>{n(x.SIGNUP),f(""),m("")},E=()=>{n(x.LOGIN),f(""),m("")};return w.jsx("div",{className:"auth-container",children:w.jsxs("div",{className:"auth-card",children:[w.jsxs("div",{className:"mode-selector",children:[w.jsx("button",{className:t===x.LOGIN?"active":"",onClick:E,children:x.LOGIN}),w.jsx("button",{className:t===x.SIGNUP?"active":"",onClick:d,children:x.SIGNUP})]}),w.jsxs("form",{onSubmit:T,children:[t===x.LOGIN?w.jsx("h2",{children:x.LOGIN}):w.jsx("h2",{children:x.SIGNUP}),w.jsxs("div",{className:"form-group",children:[w.jsx("label",{htmlFor:"email",children:Ue}),w.jsx("input",{type:"email",id:"email",name:"email",value:r.email,onChange:g,required:!0,placeholder:"Enter your email"})]}),w.jsxs("div",{className:"form-group",children:[w.jsx("label",{htmlFor:"password",children:ut}),w.jsx("input",{type:"password",id:"password",name:"password",value:r.password,onChange:g,required:!0,placeholder:"Enter your password"})]}),h&&w.jsx("div",{className:"error-message",children:h}),u&&w.jsx("div",{className:"success-message",children:u}),w.jsx("button",{type:"submit",className:"submit-btn",disabled:o,children:o?t===x.LOGIN?ct:lt:t===x.LOGIN?x.LOGIN:x.SIGNUP})]})]})})},vr=({onLogout:e})=>{const[t,n]=P.useState(null),[r,s]=P.useState(!1),[i,o]=P.useState(""),[c,h]=P.useState(""),f=Se.useNavigate(),u=()=>{H.post(`${Q()}${$.logout}`).catch(m=>{console.error("Logout failed:",m)}),n(null),e(),f("/")};return P.useEffect(()=>{(async()=>{s(!0),o("");try{const g=await H.get(`${Q()}${$.userDetails}`);n(g.data.data),h("User details fetched successfully")}catch(g){o(g.response?.data?.message||"Failed to fetch user details")}finally{s(!1)}})()},[]),w.jsx("div",{className:"auth-container",children:w.jsxs("div",{className:"auth-card profile-view",children:[w.jsx("h2",{children:"User Profile"}),r&&w.jsx("div",{className:"loading",children:"Loading user details..."}),w.jsxs("div",{className:"user-details",children:[w.jsxs("div",{className:"detail-row",children:[w.jsxs("span",{className:"label",children:[ft,":"]}),w.jsx("span",{className:"value",children:t?.userId})]}),w.jsxs("div",{className:"detail-row",children:[w.jsxs("span",{className:"label",children:[Ue,":"]}),w.jsx("span",{className:"value",children:t?.emailId})]})]}),i&&w.jsx("div",{className:"error-message",children:i}),c&&w.jsx("div",{className:"success-message",children:c}),w.jsx("button",{className:"logout-btn",onClick:u,children:dt})]})})},on=P.createContext(null),Dr=({children:e})=>{const[t,n]=P.useState(localStorage.getItem("isLoggedIn")==="true"),r=i=>{localStorage.setItem("isLoggedIn","true"),Y(i),n(!0)},s=()=>{localStorage.removeItem("isLoggedIn"),ht(),Y(null),n(!1)};return P.useEffect(()=>(en(s),()=>{tn()}),[]),w.jsx(on.Provider,{value:{isAuthenticated:t,login:r,logout:s},children:e})},Ke=()=>{const e=P.useContext(on);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e},Br=({children:e,redirectTo:t="/"})=>{const{isAuthenticated:n}=Ke();return n?w.jsx(w.Fragment,{children:e}):w.jsx(Se.Navigate,{to:t,replace:!0})},Mr=({children:e,redirectTo:t="/profile"})=>{const{isAuthenticated:n}=Ke();return n?w.jsx(Se.Navigate,{to:t,replace:!0}):w.jsx(w.Fragment,{children:e})};y.AuthForm=Fr,y.AuthMode=x,y.AuthProvider=Dr,y.EMAIL_LABEL=Ue,y.LOGIN_FAILED=ot,y.LOGIN_SUCCESS=it,y.LOGOUT_BUTTON=dt,y.LOGOUT_SUCCESS=fn,y.PASSWORD_LABEL=ut,y.PASSWORD_VALIDATION=Xe,y.ProtectedRoute=Br,y.PublicRoute=Mr,y.REGISTRATION_FAILED=st,y.REGISTRATION_SUCCESS=rt,y.SESSION_EXPIRED=at,y.SIGNING_IN=ct,y.SIGNING_UP=lt,y.USER_ID=ft,y.UserProfile=vr,y.axiosInstance=H,y.clearAccessToken=ht,y.clearLogoutCallback=tn,y.endPoints=$,y.getAccessToken=pt,y.getApiBaseUrl=Q,y.initAuth=Ur,y.sessionExpired=le,y.sessionExpiredValue=we,y.setAccessToken=Y,y.setLogoutCallback=en,y.useAuth=Ke,y.validatePassword=sn,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-auth-service",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "main": "dist/auth-ui.umd.js",
5
5
  "module": "dist/auth-ui.es.js",
6
6
  "types": "types/index.d.ts",
@@ -1,2 +1,3 @@
1
1
  export declare function setAccessToken(token: string | null): void;
2
+ export declare function clearAccessToken(): void;
2
3
  export declare function getAccessToken(): string | null;
@@ -1,8 +1,8 @@
1
1
  export declare const endPoints: {
2
- readonly refreshToken: "auth/renew-token";
3
- readonly login: "auth/authenticate";
4
- readonly logout: "auth/terminate";
5
- readonly register: "auth/register";
6
- readonly userDetails: "auth/profile";
2
+ readonly refreshToken: "/auth/renew-token";
3
+ readonly login: "/auth/authenticate";
4
+ readonly logout: "/auth/terminate";
5
+ readonly register: "/auth/register";
6
+ readonly userDetails: "/auth/profile";
7
7
  readonly test: "/auth/test-endpoint";
8
8
  };
@@ -1,6 +1,6 @@
1
1
  type AuthContextType = {
2
2
  isAuthenticated: boolean;
3
- login: () => void;
3
+ login: (accessToken: string) => void;
4
4
  logout: () => void;
5
5
  };
6
6
  export declare const AuthProvider: ({ children }: {
package/types/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from "./enum/auth";
9
9
  export * from "./utils/helperfunction";
10
10
  export * from "./common/ProtectedRoute";
11
11
  export * from "./config/config";
12
+ export * from "./common/token";
@@ -1,2 +1,4 @@
1
+ export declare function setLogoutCallback(callback: () => void): void;
2
+ export declare function clearLogoutCallback(): void;
1
3
  export declare const axiosInstance: import("axios").AxiosInstance;
2
4
  export default axiosInstance;