react-auth-service 0.0.1 → 0.0.2

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 Ke;function tn(){if(Ke)return oe;Ke=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 Ze;function nn(){return Ze||(Ze=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 O=b.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return O.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),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 O(){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))}O.isReactWarning=!0,Object.defineProperty(l,"key",{get:O,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,O,A,Q,Xe){var I=O.ref;return l={$$typeof:d,type:l,key:b,props:O,_owner:A},(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:Q}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Xe}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,b,O,A,Q,Xe){var I=b.children;if(I!==void 0)if(A)if(z(I)){for(A=0;A<I.length;A++)m(I[A]);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(Ur){return Ur!=="key"});A=0<se.length?"{key: someKey, "+se.join(": ..., ")+": ...}":"{key: someKey}",ke[I+A]||(se=0<se.length?"{"+se.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
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:
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} />`,A,I,se,I),ke[I+A]=!0)}if(I=null,O!==void 0&&(n(O),I=""+O),o(b)&&(n(b.key),I=""+b.key),"key"in b){O={};for(var Ye in b)Ye!=="key"&&(O[Ye]=b[Ye])}else O=b;return I&&c(O,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,I,O,s(),Q,Xe)}function m(l){w(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===J&&(l._payload.status==="fulfilled"?w(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function w(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,O){var A=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,O,!1,A?Error("react-stack-top-frame"):M,A?re(r(l)):Ee)},ie.jsxs=function(l,b,O){var A=1e4>W.recentlyCreatedOwnerStacks++;return u(l,b,O,!0,A?Error("react-stack-top-frame"):M,A?re(r(l)):Ee)}})()),ie}var Qe;function rn(){return Qe||(Qe=1,process.env.NODE_ENV==="production"?ye.exports=tn():ye.exports=nn()),ye.exports}var S=rn();const X="http://localhost:5000",$={refreshToken:`${X}/auth/renew-token`,login:`${X}/auth/authenticate`,logout:`${X}/auth/terminate`,register:`${X}/auth/register`,userDetails:`${X}/auth/profile`,test:`${X}/auth/test-endpoint`},et="Registration successful! Please login.",tt="Registration failed. Please try again.",nt="Login failed. Please try again.",rt="Login successful!",sn="Logged out successfully.",st="Session expired. Please login again.",C={LOGIN:"Sign In",SIGNUP:"Sign Up"},ot="Signing in...",it="Signing up...",Ue="Email",at="Password",ct="User ID",lt="Logout",ae="sessionExpired",Se="true";let ut=null;function ce(e){ut=e}function on(){return ut}function ft(e,t){return function(){return e.apply(t,arguments)}}const{toString:an}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:we,toStringTag:dt}=Symbol,ge=(e=>t=>{const n=an.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:ee}=Array,te=Re("undefined");function le(e){return e!==null&&!te(e)&&e.constructor!==null&&!te(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=B("ArrayBuffer");function cn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const ln=Re("string"),k=Re("function"),pt=Re("number"),ue=e=>e!==null&&typeof e=="object",un=e=>e===!0||e===!1,Oe=e=>{if(ge(e)!=="object")return!1;const t=Fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(dt in e)&&!(we in e)},fn=e=>{if(!ue(e)||le(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dn=B("Date"),hn=B("File"),pn=B("Blob"),mn=B("FileList"),En=e=>ue(e)&&k(e.pipe),bn=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]"))},yn=B("URLSearchParams"),[Sn,wn,gn,Rn]=["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]),ee(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 mt(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 Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Et=e=>!te(e)&&e!==Y;function ve(){const{caseless:e,skipUndefined:t}=Et(this)&&this||{},n={},r=(s,i)=>{const o=e&&mt(n,i)||i;Oe(n[o])&&Oe(s)?n[o]=ve(n[o],s):Oe(s)?n[o]=ve({},s):ee(s)?n[o]=s.slice():(!t||!te(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&fe(arguments[s],r);return n}const An=(e,t,n,{allOwnKeys:r}={})=>(fe(t,(s,i)=>{n&&k(s)?e[i]=ft(s,n):e[i]=s},{allOwnKeys:r}),e),Tn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nn=(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)},_n=(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},Pn=(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},xn=e=>{if(!e)return null;if(ee(e))return e;let t=e.length;if(!pt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Cn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Fe(Uint8Array)),In=(e,t)=>{const r=(e&&e[we]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Ln=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},jn=B("HTMLFormElement"),kn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),bt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Un=B("RegExp"),yt=(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)},Fn=e=>{yt(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+"'")})}})},vn=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ee(e)?r(e):r(String(e).split(t)),n},Dn=()=>{},Bn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Mn(e){return!!(e&&k(e.append)&&e[dt]==="FormData"&&e[we])}const Gn=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=ee(r)?[]:{};return fe(r,(o,c)=>{const h=n(o,s+1);!te(h)&&(i[c]=h)}),t[s]=void 0,i}}return r};return n(e,0)},qn=B("AsyncFunction"),Hn=e=>e&&(ue(e)||k(e))&&k(e.then)&&k(e.catch),St=((e,t)=>e?setImmediate:t?((n,r)=>(Y.addEventListener("message",({source:s,data:i})=>{s===Y&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Y.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",k(Y.postMessage)),zn=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||St,a={isArray:ee,isArrayBuffer:ht,isBuffer:le,isFormData:bn,isArrayBufferView:cn,isString:ln,isNumber:pt,isBoolean:un,isObject:ue,isPlainObject:Oe,isEmptyObject:fn,isReadableStream:Sn,isRequest:wn,isResponse:gn,isHeaders:Rn,isUndefined:te,isDate:dn,isFile:hn,isBlob:pn,isRegExp:Un,isFunction:k,isStream:En,isURLSearchParams:yn,isTypedArray:Cn,isFileList:mn,forEach:fe,merge:ve,extend:An,trim:On,stripBOM:Tn,inherits:Nn,toFlatObject:_n,kindOf:ge,kindOfTest:B,endsWith:Pn,toArray:xn,forEachEntry:In,matchAll:Ln,isHTMLForm:jn,hasOwnProperty:bt,hasOwnProp:bt,reduceDescriptors:yt,freezeMethods:Fn,toObjectSet:vn,toCamelCase:kn,noop:Dn,toFiniteNumber:Bn,findKey:mt,global:Y,isContextDefined:Et,isSpecCompliantForm:Mn,toJSONObject:Gn,isAsyncFn:qn,isThenable:Hn,setImmediate:St,asap:zn,isIterable:e=>e!=null&&k(e[we])};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 wt=y.prototype,gt={};["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=>{gt[e]={value:e}}),Object.defineProperties(y,gt),Object.defineProperty(wt,"isAxiosError",{value:!0}),y.from=(e,t,n,r,s,i)=>{const o=Object.create(wt);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 $n=null;function De(e){return a.isPlainObject(e)||a.isArray(e)}function Rt(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=Rt(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function Jn(e){return a.isArray(e)&&!e.some(De)}const Wn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function Ae(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)&&Jn(d)||(a.isFileList(d)||a.endsWith(E,"[]"))&&(R=a.toArray(d)))return E=Rt(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=[],w=Object.assign(Wn,{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,w))===!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 At(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&&Ae(e,this,t)}const Tt=Be.prototype;Tt.append=function(t,n){this._pairs.push([t,n])},Tt.toString=function(t){const n=t?function(r){return t.call(this,r,At)}:At;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Vn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||Vn;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 _t{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 Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xn={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,Yn=Me&&(!Ge||["ReactNative","NativeScript","NS"].indexOf(Ge.product)<0),Kn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Zn=Me&&window.location.href||"http://localhost",L={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Me,hasStandardBrowserEnv:Yn,hasStandardBrowserWebWorkerEnv:Kn,navigator:Ge,origin:Zn},Symbol.toStringTag,{value:"Module"})),...Xn};function Qn(e,t){return Ae(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 er(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tr(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 xt(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]=tr(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(er(r),s,n,0)}),n}return null}function nr(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:Pt,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(xt(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 Qn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Ae(c?{"files[]":t}:t,h&&new h,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),nr(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 rr=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"]),sr=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]&&rr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ct=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 or(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 ir=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 ar(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function cr(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())&&!ir(t))o(sr(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 or(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?ar(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[Ct]=this[Ct]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=he(o);r[c]||(cr(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 It(e){return!!(e&&e.__CANCEL__)}function ne(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(ne,y,{__CANCEL__:!0});function Lt(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 lr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function ur(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,w=0;for(;m!==s;)w+=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(w*1e3/T):void 0}}function fr(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=ur(50,250);return fr(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)},jt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kt=e=>(...t)=>a.asap(()=>e(...t)),dr=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,hr=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 pr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ut(e,t,n){let r=!pr(t);return e&&(r||n==!1)?mr(e,t):t}const Ft=e=>e instanceof U?{...e}:e;function K(e,t){t=t||{};const n={};function r(f,u,m,w){return a.isPlainObject(f)&&a.isPlainObject(u)?a.merge.call({caseless:w},f,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(f,u,m,w){if(a.isUndefined(u)){if(!a.isUndefined(f))return r(void 0,f,m,w)}else return r(f,u,m,w)}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(Ft(f),Ft(u),m,!0)};return a.forEach(Object.keys({...e,...t}),function(u){const m=h[u]||s,w=m(e[u],t[u],u);a.isUndefined(w)&&m!==c||(n[u]=w)}),n}const vt=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=Nt(Ut(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&&dr(t.url))){const h=s&&i&&hr.read(i);h&&o.set(s,h)}return t},Er=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=vt(e);let i=s.data;const o=U.from(s.headers).normalize();let{responseType:c,onUploadProgress:h,onDownloadProgress:f}=s,u,m,w,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};Lt(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||Pt;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&&([w,d]=Ne(f,!0),p.addEventListener("progress",w)),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 ne(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=lr(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)})},br=(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 ne(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}},yr=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 wr(e))yield*yr(n,t)},wr=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()}},Dt=(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 w=i+=m;n(w)}h.enqueue(new Uint8Array(u))}catch(f){throw c(f),f}},cancel(h){return c(h),s.return()}},{highWaterMark:2})},Bt=64*1024,{isFunction:_e}=a,gr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Mt,TextEncoder:Gt}=a.global,qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Rr=e=>{e=a.merge.call({skipUndefined:!0},gr,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(Mt),h=s&&(typeof Gt=="function"?(d=>E=>d.encode(E))(new Gt):async d=>new Uint8Array(await new n(d).arrayBuffer())),f=i&&c&&qt(()=>{let d=!1;const E=new n(L.origin,{body:new Mt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!E}),u=o&&c&&qt(()=>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 w=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??w(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}=vt(d),je=t||fetch;F=F?(F+"").toLowerCase():"text";let W=br([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[O,A]=jt(re,Ne(kt(H)));R=Dt(l.body,Bt,O,A)}}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(Q=>{l[Q]=M[Q]});const b=a.toFiniteNumber(M.headers.get("content-length")),[O,A]=v&&jt(b,Ne(kt(v),!0))||[];M=new r(Dt(M.body,Bt,O,()=>{A&&A(),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)=>{Lt(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,Ht=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:Rr(t)),u=f;return f};Ht();const ze={http:$n,xhr:Er,fetch:{get:Ht}};a.forEach(ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const zt=e=>`- ${e}`,Ar=e=>a.isFunction(e)||e===null||e===!1;function Tr(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,!Ar(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(zt).join(`
10
- `):" "+zt(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 $t={getAdapter:Tr,adapters:ze};function $e(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ne(null,e)}function Jt(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),$t.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 It(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 Wt="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 Vt={};Pe.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Wt+"] 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&&!Vt[o]&&(Vt[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 Nr(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:Nr,validators:Pe},G=xe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _t,response:new _t}}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,w;if(!h){const d=[Jt.bind(this),void 0];for(d.unshift(...c),d.push(...f),w=d.length,u=Promise.resolve(n);m<w;)u=u.then(d[m++],d[m++]);return u}w=c.length;let T=n;for(;m<w;){const d=c[m++],E=c[m++];try{T=d(T)}catch(p){E.call(this,p);break}}try{u=Jt.call(this,T)}catch(d){return Promise.reject(d)}for(m=0,w=f.length;m<w;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=K(this.defaults,t);const n=Ut(t.baseURL,t.url,t.allowAbsoluteUrls);return Nt(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 _r=class en{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 ne(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 en(function(s){t=s}),cancel:t}}};function Pr(e){return function(n){return e.apply(null,n)}}function xr(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 Xt(e){const t=new Z(e),n=ft(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 Xt(K(e,s))},n}const N=Xt(de);N.Axios=Z,N.CanceledError=ne,N.CancelToken=_r,N.isCancel=It,N.VERSION=Wt,N.toFormData=Ae,N.AxiosError=y,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=Pr,N.isAxiosError=xr,N.mergeConfig=K,N.AxiosHeaders=U,N.formToJSON=e=>xt(a.isHTMLForm(e)?new FormData(e):e),N.getAdapter=$t.getAdapter,N.HttpStatusCode=Je,N.default=N;const{Axios:qr,AxiosError:Hr,CanceledError:zr,isCancel:$r,CancelToken:Jr,VERSION:Wr,all:Vr,Cancel:Xr,isAxiosError:Yr,spread:Kr,toFormData:Zr,AxiosHeaders:Qr,HttpStatusCode:es,formToJSON:ts,getAdapter:ns,mergeConfig:rs}=N,Yt=x.createContext(null),Cr=({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 S.jsx(Yt.Provider,{value:{isAuthenticated:t,login:r,logout:s},children:e})},Ce=()=>{const e=x.useContext(Yt);if(!e)throw new Error("useAuth must be used inside AuthProvider");return e};async function Kt(){try{const e=await N.post($.refreshToken,{},{withCredentials:!0}),t=e?.data?.accessToken||e?.data?.data?.accessToken;if(!t)throw new Error("Invalid refresh response");return t}catch(e){throw e}}const q=N.create({withCredentials:!0});let Ie=!1,We=[];const Zt=(e,t=null)=>{We.forEach(n=>{e?n.reject(e):n.resolve(t)}),We=[]};q.interceptors.request.use(async e=>{if(e.withCredentials=!0,e.url===$.login||e.url===$.register)return e.headers&&"Authorization"in e.headers&&delete e.headers.Authorization,e;const n=on();if(n)return e.headers&&(e.headers.Authorization=`Bearer ${n}`),e;try{const r=await Kt();return ce(r),e.headers&&(e.headers.Authorization=`Bearer ${r}`),e}catch(r){throw window.location.href="/",sessionStorage.setItem(ae,Se),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)=>{We.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 Kt();return ce(n),t.headers&&(t.headers.Authorization=`Bearer ${n}`),Zt(null,n),Ie=!1,q(t)}catch(n){return window.location.href="/",sessionStorage.setItem(ae,Se),Zt(n,null),Ie=!1,Ce().logout(),Promise.reject(n)}}return Promise.reject(e)});const Ve={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."},Qt=e=>Ve.REGEX.test(e),Ir=({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)===Se&&(sessionStorage.removeItem(ae),f(st),n(C.LOGIN))},[]);const w=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(!Qt(r.password)){f(Ve.ERROR_MESSAGE);return}await q.post($.register,r),m(et),n(C.LOGIN),s({email:r.email,password:""});return}const R=await q.post($.login,r),{accessToken:P}=R.data;ce(P),localStorage.setItem("isLoggedIn","true"),m(rt),e&&e(),i("/profile")}catch(R){const P=R?.response?.data?.message||(t===C.SIGNUP?tt:nt);f(P)}finally{c(!1)}},d=()=>{n(C.SIGNUP),f(""),m("")},E=()=>{n(C.LOGIN),f(""),m("")};return S.jsx("div",{className:"auth-container",children:S.jsxs("div",{className:"auth-card",children:[S.jsxs("div",{className:"mode-selector",children:[S.jsx("button",{className:t===C.LOGIN?"active":"",onClick:E,children:C.LOGIN}),S.jsx("button",{className:t===C.SIGNUP?"active":"",onClick:d,children:C.SIGNUP})]}),S.jsxs("form",{onSubmit:T,children:[t===C.LOGIN?S.jsx("h2",{children:C.LOGIN}):S.jsx("h2",{children:C.SIGNUP}),S.jsxs("div",{className:"form-group",children:[S.jsx("label",{htmlFor:"email",children:Ue}),S.jsx("input",{type:"email",id:"email",name:"email",value:r.email,onChange:w,required:!0,placeholder:"Enter your email"})]}),S.jsxs("div",{className:"form-group",children:[S.jsx("label",{htmlFor:"password",children:at}),S.jsx("input",{type:"password",id:"password",name:"password",value:r.password,onChange:w,required:!0,placeholder:"Enter your password"})]}),h&&S.jsx("div",{className:"error-message",children:h}),u&&S.jsx("div",{className:"success-message",children:u}),S.jsx("button",{type:"submit",className:"submit-btn",disabled:o,children:o?t===C.LOGIN?ot:it:t===C.LOGIN?C.LOGIN:C.SIGNUP})]})]})})},Lr=({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($.logout).catch(m=>{console.error("Logout failed:",m)}),n(null),e(),f("/")};return x.useEffect(()=>{(async()=>{s(!0),o("");try{const w=await q.get($.userDetails);n(w.data.data),h("User details fetched successfully")}catch(w){o(w.response?.data?.message||"Failed to fetch user details")}finally{s(!1)}})()},[]),S.jsx("div",{className:"auth-container",children:S.jsxs("div",{className:"auth-card profile-view",children:[S.jsx("h2",{children:"User Profile"}),r&&S.jsx("div",{className:"loading",children:"Loading user details..."}),S.jsxs("div",{className:"user-details",children:[S.jsxs("div",{className:"detail-row",children:[S.jsxs("span",{className:"label",children:[ct,":"]}),S.jsx("span",{className:"value",children:t?.userId})]}),S.jsxs("div",{className:"detail-row",children:[S.jsxs("span",{className:"label",children:[Ue,":"]}),S.jsx("span",{className:"value",children:t?.emailId})]})]}),i&&S.jsx("div",{className:"error-message",children:i}),c&&S.jsx("div",{className:"success-message",children:c}),S.jsx("button",{className:"logout-btn",onClick:u,children:lt})]})})},jr=({children:e,redirectTo:t="/"})=>{const{isAuthenticated:n}=Ce();return n?S.jsx(S.Fragment,{children:e}):S.jsx(be.Navigate,{to:t,replace:!0})},kr=({children:e,redirectTo:t="/profile"})=>{const{isAuthenticated:n}=Ce();return n?S.jsx(be.Navigate,{to:t,replace:!0}):S.jsx(S.Fragment,{children:e})};g.API_BASE_URL=X,g.AuthForm=Ir,g.AuthMode=C,g.AuthProvider=Cr,g.EMAIL_LABEL=Ue,g.LOGIN_FAILED=nt,g.LOGIN_SUCCESS=rt,g.LOGOUT_BUTTON=lt,g.LOGOUT_SUCCESS=sn,g.PASSWORD_LABEL=at,g.PASSWORD_VALIDATION=Ve,g.ProtectedRoute=jr,g.PublicRoute=kr,g.REGISTRATION_FAILED=tt,g.REGISTRATION_SUCCESS=et,g.SESSION_EXPIRED=st,g.SIGNING_IN=ot,g.SIGNING_UP=it,g.USER_ID=ct,g.UserProfile=Lr,g.axiosInstance=q,g.endPoints=$,g.sessionExpired=ae,g.sessionExpiredValue=Se,g.useAuth=Ce,g.validatePassword=Qt,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
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"})}));
package/package.json CHANGED
@@ -1,40 +1,42 @@
1
1
  {
2
2
  "name": "react-auth-service",
3
- "version": "0.0.1",
4
- "main": "dist/auth-ui.umd.js",
5
- "module": "dist/auth-ui.es.js",
6
- "types": "types/index.d.ts",
7
- "files": ["dist", "types"],
8
- "type": "module",
9
- "scripts": {
10
- "dev": "vite",
11
- "build": "tsc -p tsconfig.build.json && vite build",
12
- "lint": "eslint .",
13
- "preview": "vite preview"
14
- },
15
- "dependencies": {
16
- "axios": "^1.13.2",
17
- "history": "^5.3.0"
18
- },
19
- "peerDependencies": {
20
- "react": ">=18",
21
- "react-dom": ">=18",
22
- "react-router-dom": "^7.10.0"
23
-
24
- },
25
- "devDependencies": {
26
- "@eslint/js": "^9.39.1",
27
- "@types/node": "^24.10.1",
28
- "@types/react": "^19.2.5",
29
- "@types/react-dom": "^19.2.3",
30
- "@vitejs/plugin-react": "^5.1.1",
31
- "eslint": "^9.39.1",
32
- "eslint-plugin-react-hooks": "^7.0.1",
33
- "eslint-plugin-react-refresh": "^0.4.24",
34
- "globals": "^16.5.0",
35
- "sass-embedded": "^1.93.3",
36
- "typescript": "~5.9.3",
37
- "typescript-eslint": "^8.46.4",
38
- "vite": "^7.2.4"
39
- }
3
+ "version": "0.0.2",
4
+ "main": "dist/auth-ui.umd.js",
5
+ "module": "dist/auth-ui.es.js",
6
+ "types": "types/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "types"
10
+ ],
11
+ "type": "module",
12
+ "scripts": {
13
+ "dev": "vite",
14
+ "build": "tsc -p tsconfig.build.json && vite build",
15
+ "lint": "eslint .",
16
+ "preview": "vite preview"
17
+ },
18
+ "dependencies": {
19
+ "axios": "^1.13.2",
20
+ "history": "^5.3.0"
21
+ },
22
+ "peerDependencies": {
23
+ "react": ">=18",
24
+ "react-dom": ">=18",
25
+ "react-router-dom": "^7.10.0"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.39.1",
29
+ "@types/node": "^24.10.1",
30
+ "@types/react": "^19.2.5",
31
+ "@types/react-dom": "^19.2.3",
32
+ "@vitejs/plugin-react": "^5.1.1",
33
+ "eslint": "^9.39.1",
34
+ "eslint-plugin-react-hooks": "^7.0.1",
35
+ "eslint-plugin-react-refresh": "^0.4.24",
36
+ "globals": "^16.5.0",
37
+ "sass-embedded": "^1.93.3",
38
+ "typescript": "~5.9.3",
39
+ "typescript-eslint": "^8.46.4",
40
+ "vite": "^7.2.4"
41
+ }
40
42
  }
@@ -0,0 +1,4 @@
1
+ export declare function initAuth(config: {
2
+ apiBaseUrl: string;
3
+ }): void;
4
+ export declare function getApiBaseUrl(): string;
@@ -1,9 +1,8 @@
1
- export declare const API_BASE_URL: any;
2
1
  export declare const endPoints: {
3
- readonly refreshToken: `${any}/auth/renew-token`;
4
- readonly login: `${any}/auth/authenticate`;
5
- readonly logout: `${any}/auth/terminate`;
6
- readonly register: `${any}/auth/register`;
7
- readonly userDetails: `${any}/auth/profile`;
8
- readonly test: `${any}/auth/test-endpoint`;
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
+ readonly test: "/auth/test-endpoint";
9
8
  };
package/types/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./constants/messages";
8
8
  export * from "./enum/auth";
9
9
  export * from "./utils/helperfunction";
10
10
  export * from "./common/ProtectedRoute";
11
+ export * from "./config/config";
package/types/App.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import './App.css';
2
- declare function App(): import("react/jsx-runtime").JSX.Element;
3
- export default App;