oauth0-js-lib 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(v,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(v=typeof globalThis<"u"?globalThis:v||self,q(v["oauth0-js-lib"]={}))})(this,(function(v){"use strict";var Do=Object.defineProperty;var qo=(v,q,re)=>q in v?Do(v,q,{enumerable:!0,configurable:!0,writable:!0,value:re}):v[q]=re;var D=(v,q,re)=>qo(v,typeof q!="symbol"?q+"":q,re);const q={baseUrl:"",createEndpoint:"/api/oauth0/create",authEventEndpoint:"/api/oauth0/auth-events",authConfirmEndpoint:"/api/oauth0/auth-confirm"},re=typeof __OAUTH_LIB_CONFIG__<"u"?__OAUTH_LIB_CONFIG__:void 0,qn=typeof globalThis<"u"&&globalThis.OAUTH_LIB_CONFIG?globalThis.OAUTH_LIB_CONFIG:void 0;let _e={...q,...re,...qn};function jn(e){_e={..._e,...e}}function mt(){return _e}function yt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Hn}=Object.prototype,{getPrototypeOf:Ue}=Object,{iterator:be,toStringTag:wt}=Symbol,Ee=(e=>t=>{const r=Hn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),H=e=>(e=e.toLowerCase(),t=>Ee(t)===e),Ce=e=>t=>typeof t===e,{isArray:oe}=Array,ie=Ce("undefined");function fe(e){return e!==null&&!ie(e)&&e.constructor!==null&&!ie(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bt=H("ArrayBuffer");function zn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bt(e.buffer),t}const $n=Ce("string"),x=Ce("function"),Et=Ce("number"),de=e=>e!==null&&typeof e=="object",Vn=e=>e===!0||e===!1,Se=e=>{if(Ee(e)!=="object")return!1;const t=Ue(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wt in e)&&!(be in e)},Jn=e=>{if(!de(e)||fe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Kn=H("Date"),Qn=H("File"),Wn=H("Blob"),Gn=H("FileList"),Yn=e=>de(e)&&x(e.pipe),Xn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=Ee(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},Zn=H("URLSearchParams"),[er,tr,nr,rr]=["ReadableStream","Request","Response","Headers"].map(H),or=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function he(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),oe(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(fe(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function Ct(e,t){if(fe(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,St=e=>!ie(e)&&e!==Y;function ve(){const{caseless:e,skipUndefined:t}=St(this)&&this||{},r={},n=(o,i)=>{const s=e&&Ct(r,i)||i;Se(r[s])&&Se(o)?r[s]=ve(r[s],o):Se(o)?r[s]=ve({},o):oe(o)?r[s]=o.slice():(!t||!ie(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&he(arguments[o],n);return r}const ir=(e,t,r,{allOwnKeys:n}={})=>(he(t,(o,i)=>{r&&x(o)?e[i]=yt(o,r):e[i]=o},{allOwnKeys:n}),e),sr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ar=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ur=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Ue(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},lr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},cr=e=>{if(!e)return null;if(oe(e))return e;let t=e.length;if(!Et(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},fr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ue(Uint8Array)),dr=(e,t)=>{const n=(e&&e[be]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},hr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},pr=H("HTMLFormElement"),gr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Rt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mr=H("RegExp"),Tt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};he(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},yr=e=>{Tt(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},wr=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(e)?n(e):n(String(e).split(t)),r},br=()=>{},Er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Cr(e){return!!(e&&x(e.append)&&e[wt]==="FormData"&&e[be])}const Sr=e=>{const t=new Array(10),r=(n,o)=>{if(de(n)){if(t.indexOf(n)>=0)return;if(fe(n))return n;if(!("toJSON"in n)){t[o]=n;const i=oe(n)?[]:{};return he(n,(s,a)=>{const u=r(s,o+1);!ie(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},Rr=H("AsyncFunction"),Tr=e=>e&&(de(e)||x(e))&&x(e.then)&&x(e.catch),At=((e,t)=>e?setImmediate:t?((r,n)=>(Y.addEventListener("message",({source:o,data:i})=>{o===Y&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Y.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(Y.postMessage)),Ar=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||At,c={isArray:oe,isArrayBuffer:bt,isBuffer:fe,isFormData:Xn,isArrayBufferView:zn,isString:$n,isNumber:Et,isBoolean:Vn,isObject:de,isPlainObject:Se,isEmptyObject:Jn,isReadableStream:er,isRequest:tr,isResponse:nr,isHeaders:rr,isUndefined:ie,isDate:Kn,isFile:Qn,isBlob:Wn,isRegExp:mr,isFunction:x,isStream:Yn,isURLSearchParams:Zn,isTypedArray:fr,isFileList:Gn,forEach:he,merge:ve,extend:ir,trim:or,stripBOM:sr,inherits:ar,toFlatObject:ur,kindOf:Ee,kindOfTest:H,endsWith:lr,toArray:cr,forEachEntry:dr,matchAll:hr,isHTMLForm:pr,hasOwnProperty:Rt,hasOwnProp:Rt,reduceDescriptors:Tt,freezeMethods:yr,toObjectSet:wr,toCamelCase:gr,noop:br,toFiniteNumber:Er,findKey:Ct,global:Y,isContextDefined:St,isSpecCompliantForm:Cr,toJSONObject:Sr,isAsyncFn:Rr,isThenable:Tr,setImmediate:At,asap:Ar,isIterable:e=>e!=null&&x(e[be])};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const Bt=I.prototype,Nt={};["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=>{Nt[e]={value:e}}),Object.defineProperties(I,Nt),Object.defineProperty(Bt,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,i)=>{const s=Object.create(Bt);c.toFlatObject(e,s,function(f){return f!==Error.prototype},l=>l!=="isAxiosError");const a=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return I.call(s,a,u,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Br=null;function Fe(e){return c.isPlainObject(e)||c.isArray(e)}function Pt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ot(e,t,r){return e?e.concat(t).map(function(o,i){return o=Pt(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Nr(e){return c.isArray(e)&&!e.some(Fe)}const Pr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Re(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!c.isUndefined(g[p])});const n=r.metaTokens,o=r.visitor||f,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!u&&c.isBlob(d))throw new I("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?u&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,p,g){let w=d;if(d&&!g&&typeof d=="object"){if(c.endsWith(p,"{}"))p=n?p:p.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&Nr(d)||(c.isFileList(d)||c.endsWith(p,"[]"))&&(w=c.toArray(d)))return p=Pt(p),w.forEach(function(E,R){!(c.isUndefined(E)||E===null)&&t.append(s===!0?Ot([p],R,i):s===null?p:p+"[]",l(E))}),!1}return Fe(d)?!0:(t.append(Ot(g,p,i),l(d)),!1)}const h=[],m=Object.assign(Pr,{defaultVisitor:f,convertValue:l,isVisitable:Fe});function y(d,p){if(!c.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(d),c.forEach(d,function(w,P){(!(c.isUndefined(w)||w===null)&&o.call(t,w,c.isString(P)?P.trim():P,p,m))===!0&&y(w,p?p.concat(P):[P])}),h.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Lt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Me(e,t){this._pairs=[],e&&Re(e,this,t)}const It=Me.prototype;It.append=function(t,r){this._pairs.push([t,r])},It.toString=function(t){const r=t?function(n){return t.call(this,n,Lt)}:Lt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Or(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _t(e,t,r){if(!t)return e;const n=r&&r.encode||Or;c.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=c.isURLSearchParams(t)?t.toString():new Me(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ut{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const vt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",ke=typeof navigator=="object"&&navigator||void 0,Ir=xe&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),_r=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ur=xe&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:Ir,hasStandardBrowserWebWorkerEnv:_r,navigator:ke,origin:Ur},Symbol.toStringTag,{value:"Module"})),...Lr};function vr(e,t){return Re(e,new F.classes.URLSearchParams,{visitor:function(r,n,o,i){return F.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Fr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Mr(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ft(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=r.length;return s=!s&&c.isArray(o)?o.length:s,u?(c.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&c.isArray(o[s])&&(o[s]=Mr(o[s])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,o)=>{t(Fr(n),o,r,0)}),r}return null}function xr(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const pe={transitional:vt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return o?JSON.stringify(Ft(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return vr(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Re(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),xr(t)):t}],transformResponse:[function(t){const r=this.transitional||pe.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?I.from(a,I.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{pe.headers[e]={}});const kr=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dr=e=>{const t={};let r,n,o;return e&&e.split(`
2
- `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&kr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Mt=Symbol("internals");function ge(e){return e&&String(e).trim().toLowerCase()}function Te(e){return e===!1||e==null?e:c.isArray(e)?e.map(Te):String(e)}function qr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const jr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function De(e,t,r,n,o){if(c.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function Hr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zr(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let k=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,l){const f=ge(u);if(!f)throw new Error("header name must be a non-empty string");const h=c.findKey(o,f);(!h||o[h]===void 0||l===!0||l===void 0&&o[h]!==!1)&&(o[h||u]=Te(a))}const s=(a,u)=>c.forEach(a,(l,f)=>i(l,f,u));if(c.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(c.isString(t)&&(t=t.trim())&&!jr(t))s(Dr(t),r);else if(c.isObject(t)&&c.isIterable(t)){let a={},u,l;for(const f of t){if(!c.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[l=f[0]]=(u=a[l])?c.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}s(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ge(t),t){const n=c.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return qr(o);if(c.isFunction(r))return r.call(this,o,n);if(c.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ge(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||De(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=ge(s),s){const a=c.findKey(n,s);a&&(!r||De(n,n[a],a,r))&&(delete n[a],o=!0)}}return c.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||De(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return c.forEach(this,(o,i)=>{const s=c.findKey(n,i);if(s){r[s]=Te(o),delete r[i];return}const a=t?Hr(i):String(i).trim();a!==i&&delete r[i],r[a]=Te(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
- `)}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,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Mt]=this[Mt]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=ge(s);n[a]||(zr(o,s),n[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(k.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(k);function qe(e,t){const r=this||pe,n=t||r,o=k.from(n.headers);let i=n.data;return c.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function xt(e){return!!(e&&e.__CANCEL__)}function se(e,t,r){I.call(this,e??"canceled",I.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(se,I,{__CANCEL__:!0});function kt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];s||(s=l),r[o]=u,n[o]=l;let h=i,m=0;for(;h!==o;)m+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),l-s<t)return;const y=f&&l-f;return y?Math.round(m*1e3/y):void 0}}function Jr(e,t){let r=0,n=1e3/t,o,i;const s=(l,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const f=Date.now(),h=f-r;h>=n?s(l,f):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}const Ae=(e,t,r=3)=>{let n=0;const o=Vr(50,250);return Jr(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,l=o(u),f=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&f?(a-s)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},Dt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},qt=e=>(...t)=>c.asap(()=>e(...t)),Kr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),c.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.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 Wr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jt(e,t,r){let n=!Wr(t);return e&&(n||r==!1)?Gr(e,t):t}const Ht=e=>e instanceof k?{...e}:e;function X(e,t){t=t||{};const r={};function n(l,f,h,m){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:m},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function o(l,f,h,m){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,h,m)}else return n(l,f,h,m)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function s(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function a(l,f,h){if(h in t)return n(l,f);if(h in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,f,h)=>o(Ht(l),Ht(f),h,!0)};return c.forEach(Object.keys({...e,...t}),function(f){const h=u[f]||o,m=h(e[f],t[f],f);c.isUndefined(m)&&h!==a||(r[f]=m)}),r}const zt=e=>{const t=X({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=k.from(s),t.url=_t(jt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const u=r.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,h])=>{l.includes(f.toLowerCase())&&s.set(f,h)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Kr(t.url))){const u=o&&i&&Qr.read(i);u&&s.set(o,u)}return t},Yr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zt(e);let i=o.data;const s=k.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:l}=o,f,h,m,y,d;function p(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function w(){if(!g)return;const E=k.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};kt(function(S){r(S),p()},function(S){n(S),p()},_),g=null}"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(w)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,e,g)),g=null)},g.onerror=function(R){const _=R&&R.message?R.message:"Network Error",b=new I(_,I.ERR_NETWORK,e,g);b.event=R||null,n(b),g=null},g.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||vt;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new I(R,_.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&c.forEach(s.toJSON(),function(R,_){g.setRequestHeader(_,R)}),c.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),a&&a!=="json"&&(g.responseType=o.responseType),l&&([m,d]=Ae(l,!0),g.addEventListener("progress",m)),u&&g.upload&&([h,y]=Ae(u),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(f=E=>{g&&(n(!E||E.type?new se(null,e,g):E),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const P=$r(o.url);if(P&&F.protocols.indexOf(P)===-1){n(new I("Unsupported protocol "+P+":",I.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Xr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,a();const f=l instanceof Error?l:this.reason;n.abort(f instanceof I?f:new se(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout ${t} of ms exceeded`,I.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>c.asap(a),u}},Zr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},eo=async function*(e,t){for await(const r of to(e))yield*Zr(r,t)},to=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$t=(e,t,r,n)=>{const o=eo(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){a(),u.close();return}let h=f.byteLength;if(r){let m=i+=h;r(m)}u.enqueue(new Uint8Array(f))}catch(l){throw a(l),l}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},Vt=64*1024,{isFunction:Be}=c,no=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Jt,TextEncoder:Kt}=c.global,Qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ro=e=>{e=c.merge.call({skipUndefined:!0},no,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):typeof fetch=="function",i=Be(r),s=Be(n);if(!o)return!1;const a=o&&Be(Jt),u=o&&(typeof Kt=="function"?(d=>p=>d.encode(p))(new Kt):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&a&&Qt(()=>{let d=!1;const p=new r(F.origin,{body:new Jt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),f=s&&a&&Qt(()=>c.isReadableStream(new n("").body)),h={stream:f&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(p,g)=>{let w=p&&p[d];if(w)return w.call(p);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const m=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await u(d)).byteLength},y=async(d,p)=>{const g=c.toFiniteNumber(d.getContentLength());return g??m(p)};return async d=>{let{url:p,method:g,data:w,signal:P,cancelToken:E,timeout:R,onDownloadProgress:_,onUploadProgress:b,responseType:S,headers:A,withCredentials:C="same-origin",fetchOptions:L}=zt(d),B=t||fetch;S=S?(S+"").toLowerCase():"text";let N=Xr([P,E&&E.toAbortSignal()],R),T=null;const O=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let z;try{if(b&&l&&g!=="get"&&g!=="head"&&(z=await y(A,w))!==0){let j=new r(p,{method:"POST",body:w,duplex:"half"}),K;if(c.isFormData(w)&&(K=j.headers.get("content-type"))&&A.setContentType(K),j.body){const[ne,ue]=Dt(z,Ae(qt(b)));w=$t(j.body,Vt,ne,ue)}}c.isString(C)||(C=C?"include":"omit");const M=i&&"credentials"in r.prototype,Le={...L,signal:N,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:w,duplex:"half",credentials:M?C:void 0};T=i&&new r(p,Le);let $=await(i?B(T,L):B(p,Le));const Ie=f&&(S==="stream"||S==="response");if(f&&(_||Ie&&O)){const j={};["status","statusText","headers"].forEach(le=>{j[le]=$[le]});const K=c.toFiniteNumber($.headers.get("content-length")),[ne,ue]=_&&Dt(K,Ae(qt(_),!0))||[];$=new n($t($.body,Vt,ne,()=>{ue&&ue(),O&&O()}),j)}S=S||"text";let we=await h[c.findKey(h,S)||"text"]($,d);return!Ie&&O&&O(),await new Promise((j,K)=>{kt(j,K,{data:we,headers:k.from($.headers),status:$.status,statusText:$.statusText,config:d,request:T})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,T),{cause:M.cause||M}):I.from(M,M&&M.code,d,T)}}},oo=new Map,Wt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,l,f=oo;for(;a--;)u=i[a],l=f.get(u),l===void 0&&f.set(u,l=a?new Map:ro(t)),f=l;return l};Wt();const je={http:Br,xhr:Yr,fetch:{get:Wt}};c.forEach(je,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gt=e=>`- ${e}`,io=e=>c.isFunction(e)||e===null||e===!1;function so(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let a;if(o=n,!io(n)&&(o=je[(a=String(n)).toLowerCase()],o===void 0))throw new I(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(t))))break;i[a||"#"+s]=o}if(!o){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since :
1
+ (function(U,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(U=typeof globalThis<"u"?globalThis:U||self,q(U["oauth0-js-lib"]={}))})(this,(function(U){"use strict";var ko=Object.defineProperty;var qo=(U,q,re)=>q in U?ko(U,q,{enumerable:!0,configurable:!0,writable:!0,value:re}):U[q]=re;var x=(U,q,re)=>qo(U,typeof q!="symbol"?q+"":q,re);const q={baseUrl:"",createEndpoint:"/api/oauth0/create",authEventEndpoint:"/api/oauth0/auth-events",authConfirmEndpoint:"/api/oauth0/auth-confirm"},re=typeof __OAUTH_LIB_CONFIG__<"u"?__OAUTH_LIB_CONFIG__:void 0,qn=typeof globalThis<"u"&&globalThis.OAUTH_LIB_CONFIG?globalThis.OAUTH_LIB_CONFIG:void 0;let _e={...q,...re,...qn};function jn(e){_e={..._e,...e}}function mt(){return _e}function yt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Hn}=Object.prototype,{getPrototypeOf:ve}=Object,{iterator:be,toStringTag:wt}=Symbol,Ee=(e=>t=>{const r=Hn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),H=e=>(e=e.toLowerCase(),t=>Ee(t)===e),Ce=e=>t=>typeof t===e,{isArray:oe}=Array,ie=Ce("undefined");function fe(e){return e!==null&&!ie(e)&&e.constructor!==null&&!ie(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bt=H("ArrayBuffer");function zn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bt(e.buffer),t}const $n=Ce("string"),D=Ce("function"),Et=Ce("number"),de=e=>e!==null&&typeof e=="object",Vn=e=>e===!0||e===!1,Se=e=>{if(Ee(e)!=="object")return!1;const t=ve(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(wt in e)&&!(be in e)},Jn=e=>{if(!de(e)||fe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Kn=H("Date"),Qn=H("File"),Wn=H("Blob"),Gn=H("FileList"),Yn=e=>de(e)&&D(e.pipe),Xn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=Ee(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},Zn=H("URLSearchParams"),[er,tr,nr,rr]=["ReadableStream","Request","Response","Headers"].map(H),or=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function he(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),oe(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(fe(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function Ct(e,t){if(fe(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,St=e=>!ie(e)&&e!==Y;function Ue(){const{caseless:e,skipUndefined:t}=St(this)&&this||{},r={},n=(o,i)=>{const s=e&&Ct(r,i)||i;Se(r[s])&&Se(o)?r[s]=Ue(r[s],o):Se(o)?r[s]=Ue({},o):oe(o)?r[s]=o.slice():(!t||!ie(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&he(arguments[o],n);return r}const ir=(e,t,r,{allOwnKeys:n}={})=>(he(t,(o,i)=>{r&&D(o)?e[i]=yt(o,r):e[i]=o},{allOwnKeys:n}),e),sr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ar=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ur=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&ve(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},lr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},cr=e=>{if(!e)return null;if(oe(e))return e;let t=e.length;if(!Et(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},fr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ve(Uint8Array)),dr=(e,t)=>{const n=(e&&e[be]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},hr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},pr=H("HTMLFormElement"),gr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),Rt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mr=H("RegExp"),Tt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};he(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},yr=e=>{Tt(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},wr=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(e)?n(e):n(String(e).split(t)),r},br=()=>{},Er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Cr(e){return!!(e&&D(e.append)&&e[wt]==="FormData"&&e[be])}const Sr=e=>{const t=new Array(10),r=(n,o)=>{if(de(n)){if(t.indexOf(n)>=0)return;if(fe(n))return n;if(!("toJSON"in n)){t[o]=n;const i=oe(n)?[]:{};return he(n,(s,a)=>{const u=r(s,o+1);!ie(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},Rr=H("AsyncFunction"),Tr=e=>e&&(de(e)||D(e))&&D(e.then)&&D(e.catch),At=((e,t)=>e?setImmediate:t?((r,n)=>(Y.addEventListener("message",({source:o,data:i})=>{o===Y&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Y.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(Y.postMessage)),Ar=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||At,c={isArray:oe,isArrayBuffer:bt,isBuffer:fe,isFormData:Xn,isArrayBufferView:zn,isString:$n,isNumber:Et,isBoolean:Vn,isObject:de,isPlainObject:Se,isEmptyObject:Jn,isReadableStream:er,isRequest:tr,isResponse:nr,isHeaders:rr,isUndefined:ie,isDate:Kn,isFile:Qn,isBlob:Wn,isRegExp:mr,isFunction:D,isStream:Yn,isURLSearchParams:Zn,isTypedArray:fr,isFileList:Gn,forEach:he,merge:Ue,extend:ir,trim:or,stripBOM:sr,inherits:ar,toFlatObject:ur,kindOf:Ee,kindOfTest:H,endsWith:lr,toArray:cr,forEachEntry:dr,matchAll:hr,isHTMLForm:pr,hasOwnProperty:Rt,hasOwnProp:Rt,reduceDescriptors:Tt,freezeMethods:yr,toObjectSet:wr,toCamelCase:gr,noop:br,toFiniteNumber:Er,findKey:Ct,global:Y,isContextDefined:St,isSpecCompliantForm:Cr,toJSONObject:Sr,isAsyncFn:Rr,isThenable:Tr,setImmediate:At,asap:Ar,isIterable:e=>e!=null&&D(e[be])};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const Bt=I.prototype,Nt={};["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=>{Nt[e]={value:e}}),Object.defineProperties(I,Nt),Object.defineProperty(Bt,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,i)=>{const s=Object.create(Bt);c.toFlatObject(e,s,function(f){return f!==Error.prototype},l=>l!=="isAxiosError");const a=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return I.call(s,a,u,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Br=null;function Fe(e){return c.isPlainObject(e)||c.isArray(e)}function Pt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function Ot(e,t,r){return e?e.concat(t).map(function(o,i){return o=Pt(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Nr(e){return c.isArray(e)&&!e.some(Fe)}const Pr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Re(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!c.isUndefined(g[p])});const n=r.metaTokens,o=r.visitor||f,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!u&&c.isBlob(d))throw new I("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?u&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,p,g){let w=d;if(d&&!g&&typeof d=="object"){if(c.endsWith(p,"{}"))p=n?p:p.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&Nr(d)||(c.isFileList(d)||c.endsWith(p,"[]"))&&(w=c.toArray(d)))return p=Pt(p),w.forEach(function(E,R){!(c.isUndefined(E)||E===null)&&t.append(s===!0?Ot([p],R,i):s===null?p:p+"[]",l(E))}),!1}return Fe(d)?!0:(t.append(Ot(g,p,i),l(d)),!1)}const h=[],m=Object.assign(Pr,{defaultVisitor:f,convertValue:l,isVisitable:Fe});function y(d,p){if(!c.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(d),c.forEach(d,function(w,P){(!(c.isUndefined(w)||w===null)&&o.call(t,w,c.isString(P)?P.trim():P,p,m))===!0&&y(w,p?p.concat(P):[P])}),h.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Lt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Me(e,t){this._pairs=[],e&&Re(e,this,t)}const It=Me.prototype;It.append=function(t,r){this._pairs.push([t,r])},It.toString=function(t){const r=t?function(n){return t.call(this,n,Lt)}:Lt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Or(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _t(e,t,r){if(!t)return e;const n=r&&r.encode||Or;c.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=c.isURLSearchParams(t)?t.toString():new Me(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vt{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",De=typeof navigator=="object"&&navigator||void 0,Ir=xe&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0),_r=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vr=xe&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:Ir,hasStandardBrowserWebWorkerEnv:_r,navigator:De,origin:vr},Symbol.toStringTag,{value:"Module"})),...Lr};function Ur(e,t){return Re(e,new F.classes.URLSearchParams,{visitor:function(r,n,o,i){return F.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Fr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Mr(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ft(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=r.length;return s=!s&&c.isArray(o)?o.length:s,u?(c.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&c.isArray(o[s])&&(o[s]=Mr(o[s])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,o)=>{t(Fr(n),o,r,0)}),r}return null}function xr(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const pe={transitional:Ut,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return o?JSON.stringify(Ft(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ur(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Re(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),xr(t)):t}],transformResponse:[function(t){const r=this.transitional||pe.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?I.from(a,I.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{pe.headers[e]={}});const Dr=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kr=e=>{const t={};let r,n,o;return e&&e.split(`
2
+ `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Dr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Mt=Symbol("internals");function ge(e){return e&&String(e).trim().toLowerCase()}function Te(e){return e===!1||e==null?e:c.isArray(e)?e.map(Te):String(e)}function qr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const jr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ke(e,t,r,n,o){if(c.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function Hr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zr(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let k=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,l){const f=ge(u);if(!f)throw new Error("header name must be a non-empty string");const h=c.findKey(o,f);(!h||o[h]===void 0||l===!0||l===void 0&&o[h]!==!1)&&(o[h||u]=Te(a))}const s=(a,u)=>c.forEach(a,(l,f)=>i(l,f,u));if(c.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(c.isString(t)&&(t=t.trim())&&!jr(t))s(kr(t),r);else if(c.isObject(t)&&c.isIterable(t)){let a={},u,l;for(const f of t){if(!c.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[l=f[0]]=(u=a[l])?c.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}s(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ge(t),t){const n=c.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return qr(o);if(c.isFunction(r))return r.call(this,o,n);if(c.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ge(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||ke(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=ge(s),s){const a=c.findKey(n,s);a&&(!r||ke(n,n[a],a,r))&&(delete n[a],o=!0)}}return c.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||ke(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return c.forEach(this,(o,i)=>{const s=c.findKey(n,i);if(s){r[s]=Te(o),delete r[i];return}const a=t?Hr(i):String(i).trim();a!==i&&delete r[i],r[a]=Te(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}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,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Mt]=this[Mt]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=ge(s);n[a]||(zr(o,s),n[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(k.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(k);function qe(e,t){const r=this||pe,n=t||r,o=k.from(n.headers);let i=n.data;return c.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function xt(e){return!!(e&&e.__CANCEL__)}function se(e,t,r){I.call(this,e??"canceled",I.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(se,I,{__CANCEL__:!0});function Dt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];s||(s=l),r[o]=u,n[o]=l;let h=i,m=0;for(;h!==o;)m+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),l-s<t)return;const y=f&&l-f;return y?Math.round(m*1e3/y):void 0}}function Jr(e,t){let r=0,n=1e3/t,o,i;const s=(l,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const f=Date.now(),h=f-r;h>=n?s(l,f):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}const Ae=(e,t,r=3)=>{let n=0;const o=Vr(50,250);return Jr(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,l=o(u),f=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&f?(a-s)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},kt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},qt=e=>(...t)=>c.asap(()=>e(...t)),Kr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),c.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.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 Wr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jt(e,t,r){let n=!Wr(t);return e&&(n||r==!1)?Gr(e,t):t}const Ht=e=>e instanceof k?{...e}:e;function X(e,t){t=t||{};const r={};function n(l,f,h,m){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:m},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function o(l,f,h,m){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,h,m)}else return n(l,f,h,m)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function s(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function a(l,f,h){if(h in t)return n(l,f);if(h in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,f,h)=>o(Ht(l),Ht(f),h,!0)};return c.forEach(Object.keys({...e,...t}),function(f){const h=u[f]||o,m=h(e[f],t[f],f);c.isUndefined(m)&&h!==a||(r[f]=m)}),r}const zt=e=>{const t=X({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=k.from(s),t.url=_t(jt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const u=r.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,h])=>{l.includes(f.toLowerCase())&&s.set(f,h)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Kr(t.url))){const u=o&&i&&Qr.read(i);u&&s.set(o,u)}return t},Yr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zt(e);let i=o.data;const s=k.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:l}=o,f,h,m,y,d;function p(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function w(){if(!g)return;const E=k.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};Dt(function(S){r(S),p()},function(S){n(S),p()},_),g=null}"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(w)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,e,g)),g=null)},g.onerror=function(R){const _=R&&R.message?R.message:"Network Error",b=new I(_,I.ERR_NETWORK,e,g);b.event=R||null,n(b),g=null},g.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||Ut;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new I(R,_.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&c.forEach(s.toJSON(),function(R,_){g.setRequestHeader(_,R)}),c.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),a&&a!=="json"&&(g.responseType=o.responseType),l&&([m,d]=Ae(l,!0),g.addEventListener("progress",m)),u&&g.upload&&([h,y]=Ae(u),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(f=E=>{g&&(n(!E||E.type?new se(null,e,g):E),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const P=$r(o.url);if(P&&F.protocols.indexOf(P)===-1){n(new I("Unsupported protocol "+P+":",I.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Xr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,a();const f=l instanceof Error?l:this.reason;n.abort(f instanceof I?f:new se(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout ${t} of ms exceeded`,I.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>c.asap(a),u}},Zr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},eo=async function*(e,t){for await(const r of to(e))yield*Zr(r,t)},to=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$t=(e,t,r,n)=>{const o=eo(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){a(),u.close();return}let h=f.byteLength;if(r){let m=i+=h;r(m)}u.enqueue(new Uint8Array(f))}catch(l){throw a(l),l}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},Vt=64*1024,{isFunction:Be}=c,no=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Jt,TextEncoder:Kt}=c.global,Qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ro=e=>{e=c.merge.call({skipUndefined:!0},no,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):typeof fetch=="function",i=Be(r),s=Be(n);if(!o)return!1;const a=o&&Be(Jt),u=o&&(typeof Kt=="function"?(d=>p=>d.encode(p))(new Kt):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&a&&Qt(()=>{let d=!1;const p=new r(F.origin,{body:new Jt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),f=s&&a&&Qt(()=>c.isReadableStream(new n("").body)),h={stream:f&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(p,g)=>{let w=p&&p[d];if(w)return w.call(p);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const m=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await u(d)).byteLength},y=async(d,p)=>{const g=c.toFiniteNumber(d.getContentLength());return g??m(p)};return async d=>{let{url:p,method:g,data:w,signal:P,cancelToken:E,timeout:R,onDownloadProgress:_,onUploadProgress:b,responseType:S,headers:A,withCredentials:C="same-origin",fetchOptions:L}=zt(d),B=t||fetch;S=S?(S+"").toLowerCase():"text";let N=Xr([P,E&&E.toAbortSignal()],R),T=null;const O=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let z;try{if(b&&l&&g!=="get"&&g!=="head"&&(z=await y(A,w))!==0){let j=new r(p,{method:"POST",body:w,duplex:"half"}),K;if(c.isFormData(w)&&(K=j.headers.get("content-type"))&&A.setContentType(K),j.body){const[ne,ue]=kt(z,Ae(qt(b)));w=$t(j.body,Vt,ne,ue)}}c.isString(C)||(C=C?"include":"omit");const M=i&&"credentials"in r.prototype,Le={...L,signal:N,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:w,duplex:"half",credentials:M?C:void 0};T=i&&new r(p,Le);let $=await(i?B(T,L):B(p,Le));const Ie=f&&(S==="stream"||S==="response");if(f&&(_||Ie&&O)){const j={};["status","statusText","headers"].forEach(le=>{j[le]=$[le]});const K=c.toFiniteNumber($.headers.get("content-length")),[ne,ue]=_&&kt(K,Ae(qt(_),!0))||[];$=new n($t($.body,Vt,ne,()=>{ue&&ue(),O&&O()}),j)}S=S||"text";let we=await h[c.findKey(h,S)||"text"]($,d);return!Ie&&O&&O(),await new Promise((j,K)=>{Dt(j,K,{data:we,headers:k.from($.headers),status:$.status,statusText:$.statusText,config:d,request:T})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,T),{cause:M.cause||M}):I.from(M,M&&M.code,d,T)}}},oo=new Map,Wt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,l,f=oo;for(;a--;)u=i[a],l=f.get(u),l===void 0&&f.set(u,l=a?new Map:ro(t)),f=l;return l};Wt();const je={http:Br,xhr:Yr,fetch:{get:Wt}};c.forEach(je,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gt=e=>`- ${e}`,io=e=>c.isFunction(e)||e===null||e===!1;function so(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let a;if(o=n,!io(n)&&(o=je[(a=String(n)).toLowerCase()],o===void 0))throw new I(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(t))))break;i[a||"#"+s]=o}if(!o){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since :
4
4
  `+s.map(Gt).join(`
5
- `):" "+Gt(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Yt={getAdapter:so,adapters:je};function He(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new se(null,e)}function Xt(e){return He(e),e.headers=k.from(e.headers),e.data=qe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Yt.getAdapter(e.adapter||pe.adapter,e)(e).then(function(n){return He(e),n.data=qe.call(e,e.transformResponse,n),n.headers=k.from(n.headers),n},function(n){return xt(n)||(He(e),n&&n.response&&(n.response.data=qe.call(e,e.transformResponse,n.response),n.response.headers=k.from(n.response.headers))),Promise.reject(n)})}const Zt="1.13.1",Ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const en={};Ne.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Zt+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new I(o(s," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!en[s]&&(en[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}},Ne.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ao(e,t,r){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new I("option "+i+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Pe={assertOptions:ao,validators:Ne},V=Pe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ut,response:new Ut}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Pe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:V.function,serialize:V.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Pe.assertOptions(r,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=k.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Xt.bind(this),void 0];for(d.unshift(...a),d.push(...l),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Xt.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=l.length;h<m;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=X(this.defaults,t);const r=jt(t.baseURL,t.url,t.allowAbsoluteUrls);return _t(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,n){return this.request(X(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(X(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});let uo=class Dn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new se(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Dn(function(o){t=o}),cancel:t}}};function lo(e){return function(r){return e.apply(null,r)}}function co(e){return c.isObject(e)&&e.isAxiosError===!0}const ze={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(ze).forEach(([e,t])=>{ze[t]=e});function tn(e){const t=new Z(e),r=yt(Z.prototype.request,t);return c.extend(r,Z.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return tn(X(e,o))},r}const U=tn(pe);U.Axios=Z,U.CanceledError=se,U.CancelToken=uo,U.isCancel=xt,U.VERSION=Zt,U.toFormData=Re,U.AxiosError=I,U.Cancel=U.CanceledError,U.all=function(t){return Promise.all(t)},U.spread=lo,U.isAxiosError=co,U.mergeConfig=X,U.AxiosHeaders=k,U.formToJSON=e=>Ft(c.isHTMLForm(e)?new FormData(e):e),U.getAdapter=Yt.getAdapter,U.HttpStatusCode=ze,U.default=U;const{Axios:Ko,AxiosError:Qo,CanceledError:Wo,isCancel:Go,CancelToken:Yo,VERSION:Xo,all:Zo,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:ri,AxiosHeaders:oi,HttpStatusCode:ii,formToJSON:si,getAdapter:ai,mergeConfig:ui}=U,fo=`.oauth-modal-overlay {\r
5
+ `):" "+Gt(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Yt={getAdapter:so,adapters:je};function He(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new se(null,e)}function Xt(e){return He(e),e.headers=k.from(e.headers),e.data=qe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Yt.getAdapter(e.adapter||pe.adapter,e)(e).then(function(n){return He(e),n.data=qe.call(e,e.transformResponse,n),n.headers=k.from(n.headers),n},function(n){return xt(n)||(He(e),n&&n.response&&(n.response.data=qe.call(e,e.transformResponse,n.response),n.response.headers=k.from(n.response.headers))),Promise.reject(n)})}const Zt="1.13.1",Ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const en={};Ne.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Zt+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new I(o(s," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!en[s]&&(en[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}},Ne.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ao(e,t,r){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new I("option "+i+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Pe={assertOptions:ao,validators:Ne},V=Pe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vt,response:new vt}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Pe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:V.function,serialize:V.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Pe.assertOptions(r,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=k.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Xt.bind(this),void 0];for(d.unshift(...a),d.push(...l),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Xt.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=l.length;h<m;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=X(this.defaults,t);const r=jt(t.baseURL,t.url,t.allowAbsoluteUrls);return _t(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,n){return this.request(X(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(X(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});let uo=class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new se(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}};function lo(e){return function(r){return e.apply(null,r)}}function co(e){return c.isObject(e)&&e.isAxiosError===!0}const ze={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(ze).forEach(([e,t])=>{ze[t]=e});function tn(e){const t=new Z(e),r=yt(Z.prototype.request,t);return c.extend(r,Z.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return tn(X(e,o))},r}const v=tn(pe);v.Axios=Z,v.CanceledError=se,v.CancelToken=uo,v.isCancel=xt,v.VERSION=Zt,v.toFormData=Re,v.AxiosError=I,v.Cancel=v.CanceledError,v.all=function(t){return Promise.all(t)},v.spread=lo,v.isAxiosError=co,v.mergeConfig=X,v.AxiosHeaders=k,v.formToJSON=e=>Ft(c.isHTMLForm(e)?new FormData(e):e),v.getAdapter=Yt.getAdapter,v.HttpStatusCode=ze,v.default=v;const{Axios:Ko,AxiosError:Qo,CanceledError:Wo,isCancel:Go,CancelToken:Yo,VERSION:Xo,all:Zo,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:ri,AxiosHeaders:oi,HttpStatusCode:ii,formToJSON:si,getAdapter:ai,mergeConfig:ui}=v,fo=`.oauth-modal-overlay {\r
7
7
  position: fixed;\r
8
8
  top: 0;\r
9
9
  left: 0;\r
@@ -174,14 +174,14 @@
174
174
  }`;var ae={},$e,nn;function ho(){return nn||(nn=1,$e=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),$e}var Ve={},G={},rn;function ee(){if(rn)return G;rn=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return G.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},G.getSymbolTotalCodewords=function(n){return t[n]},G.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},G.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},G.isKanjiModeEnabled=function(){return typeof e<"u"},G.toSJIS=function(n){return e(n)},G}var Je={},on;function Ke(){return on||(on=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(Je)),Je}var Qe,sn;function po(){if(sn)return Qe;sn=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Qe=e,Qe}var We,an;function go(){if(an)return We;an=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,o){const i=t*this.size+r;this.data[i]=n,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},We=e,We}var Ge={},un;function mo(){return un||(un=1,(function(e){const t=ee().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let u=1;u<o-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(n){const o=[],i=e.getRowColCoords(n),s=i.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||o.push([i[a],i[u]]);return o}})(Ge)),Ge}var Ye={},ln;function yo(){if(ln)return Ye;ln=1;const e=ee().getSymbolSize,t=7;return Ye.getPositions=function(n){const o=e(n);return[[0,0],[o-t,0],[0,o-t]]},Ye}var Xe={},cn;function wo(){return cn||(cn=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,u=0,l=null,f=null;for(let h=0;h<i;h++){a=u=0,l=f=null;for(let m=0;m<i;m++){let y=o.get(h,m);y===l?a++:(a>=5&&(s+=t.N1+(a-5)),l=y,a=1),y=o.get(m,h),y===f?u++:(u>=5&&(s+=t.N1+(u-5)),f=y,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a<i-1;a++)for(let u=0;u<i-1;u++){const l=o.get(a,u)+o.get(a,u+1)+o.get(a+1,u)+o.get(a+1,u+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const i=o.size;let s=0,a=0,u=0;for(let l=0;l<i;l++){a=u=0;for(let f=0;f<i;f++)a=a<<1&2047|o.get(l,f),f>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(f,l),f>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let u=0;u<s;u++)i+=o.data[u];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function r(n,o,i){switch(n){case e.Patterns.PATTERN000:return(o+i)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(o+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return o*i%2+o*i%3===0;case e.Patterns.PATTERN110:return(o*i%2+o*i%3)%2===0;case e.Patterns.PATTERN111:return(o*i%3+(o+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(o,i){const s=i.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)i.isReserved(u,a)||i.xor(u,a,r(o,u,a))},e.getBestMask=function(o,i){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let l=0;l<s;l++){i(l),e.applyMask(l,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(l,o),f<u&&(u=f,a=l)}return a}})(Xe)),Xe}var Oe={},fn;function dn(){if(fn)return Oe;fn=1;const e=Ke(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Oe.getBlocksCount=function(o,i){switch(i){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},Oe.getTotalCodewordsCount=function(o,i){switch(i){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},Oe}var Ze={},me={},hn;function bo(){if(hn)return me;hn=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let o=0;o<255;o++)e[o]=n,t[n]=o,n<<=1,n&256&&(n^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),me.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},me.exp=function(n){return e[n]},me.mul=function(n,o){return n===0||o===0?0:e[t[n]+t[o]]},me}var pn;function Eo(){return pn||(pn=1,(function(e){const t=bo();e.mul=function(n,o){const i=new Uint8Array(n.length+o.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<o.length;a++)i[s+a]^=t.mul(n[s],o[a]);return i},e.mod=function(n,o){let i=new Uint8Array(n);for(;i.length-o.length>=0;){const s=i[0];for(let u=0;u<o.length;u++)i[u]^=t.mul(o[u],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let i=0;i<n;i++)o=e.mul(o,new Uint8Array([1,t.exp(i)]));return o}})(Ze)),Ze}var et,gn;function Co(){if(gn)return et;gn=1;const e=Eo();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(n.length+this.degree);o.set(n);const i=e.mod(o,this.genPoly),s=this.degree-i.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i},et=t,et}var tt={},nt={},rt={},mn;function yn(){return mn||(mn=1,rt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),rt}var J={},wn;function bn(){if(wn)return J;wn=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
175
175
  ]))+`;J.KANJI=new RegExp(r,"g"),J.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),J.BYTE=new RegExp(n,"g"),J.NUMERIC=new RegExp(e,"g"),J.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+r+"$"),i=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return J.testKanji=function(u){return o.test(u)},J.testNumeric=function(u){return i.test(u)},J.testAlphanumeric=function(u){return s.test(u)},J}var En;function te(){return En||(En=1,(function(e){const t=yn(),r=bn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(nt)),nt}var Cn;function So(){return Cn||(Cn=1,(function(e){const t=ee(),r=dn(),n=Ke(),o=te(),i=yn(),s=7973,a=t.getBCHDigit(s);function u(m,y,d){for(let p=1;p<=40;p++)if(y<=e.getCapacity(p,d,m))return p}function l(m,y){return o.getCharCountIndicator(m,y)+4}function f(m,y){let d=0;return m.forEach(function(p){const g=l(p.mode,y);d+=g+p.getBitsLength()}),d}function h(m,y){for(let d=1;d<=40;d++)if(f(m,d)<=e.getCapacity(d,y,o.MIXED))return d}e.from=function(y,d){return i.isValid(y)?parseInt(y,10):d},e.getCapacity=function(y,d,p){if(!i.isValid(y))throw new Error("Invalid QR Code version");typeof p>"u"&&(p=o.BYTE);const g=t.getSymbolTotalCodewords(y),w=r.getTotalCodewordsCount(y,d),P=(g-w)*8;if(p===o.MIXED)return P;const E=P-l(p,y);switch(p){case o.NUMERIC:return Math.floor(E/10*3);case o.ALPHANUMERIC:return Math.floor(E/11*2);case o.KANJI:return Math.floor(E/13);case o.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(y,d){let p;const g=n.from(d,n.M);if(Array.isArray(y)){if(y.length>1)return h(y,g);if(y.length===0)return 1;p=y[0]}else p=y;return u(p.mode,p.getLength(),g)},e.getEncodedBits=function(y){if(!i.isValid(y)||y<7)throw new Error("Invalid QR Code version");let d=y<<12;for(;t.getBCHDigit(d)-a>=0;)d^=s<<t.getBCHDigit(d)-a;return y<<12|d}})(tt)),tt}var ot={},Sn;function Ro(){if(Sn)return ot;Sn=1;const e=ee(),t=1335,r=21522,n=e.getBCHDigit(t);return ot.getEncodedBits=function(i,s){const a=i.bit<<3|s;let u=a<<10;for(;e.getBCHDigit(u)-n>=0;)u^=t<<e.getBCHDigit(u)-n;return(a<<10|u)^r},ot}var it={},st,Rn;function To(){if(Rn)return st;Rn=1;const e=te();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let o,i,s;for(o=0;o+3<=this.data.length;o+=3)i=this.data.substr(o,3),s=parseInt(i,10),n.put(s,10);const a=this.data.length-o;a>0&&(i=this.data.substr(o),s=parseInt(i,10),n.put(s,a*3+1))},st=t,st}var at,Tn;function Ao(){if(Tn)return at;Tn=1;const e=te(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let i;for(i=0;i+2<=this.data.length;i+=2){let s=t.indexOf(this.data[i])*45;s+=t.indexOf(this.data[i+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[i]),6)},at=r,at}var ut,An;function Bo(){if(An)return ut;An=1;const e=te();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,o=this.data.length;n<o;n++)r.put(this.data[n],8)},ut=t,ut}var lt,Bn;function No(){if(Bn)return lt;Bn=1;const e=te(),t=ee();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o<this.data.length;o++){let i=t.toSJIS(this.data[o]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
176
176
  Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13)}},lt=r,lt}var ct={exports:{}},Nn;function Po(){return Nn||(Nn=1,(function(e){var t={single_source_shortest_paths:function(r,n,o){var i={},s={};s[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var u,l,f,h,m,y,d,p,g;!a.empty();){u=a.pop(),l=u.value,h=u.cost,m=r[l]||{};for(f in m)m.hasOwnProperty(f)&&(y=m[f],d=h+y,p=s[f],g=typeof s[f]>"u",(g||p>d)&&(s[f]=d,a.push(f,d),i[f]=l))}if(typeof o<"u"&&typeof s[o]>"u"){var w=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],i=n;i;)o.push(i),r[i],i=r[i];return o.reverse(),o},find_path:function(r,n,o){var i=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},i;r=r||{};for(i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(ct)),ct.exports}var Pn;function Oo(){return Pn||(Pn=1,(function(e){const t=te(),r=To(),n=Ao(),o=Bo(),i=No(),s=bn(),a=ee(),u=Po();function l(w){return unescape(encodeURIComponent(w)).length}function f(w,P,E){const R=[];let _;for(;(_=w.exec(E))!==null;)R.push({data:_[0],index:_.index,mode:P,length:_[0].length});return R}function h(w){const P=f(s.NUMERIC,t.NUMERIC,w),E=f(s.ALPHANUMERIC,t.ALPHANUMERIC,w);let R,_;return a.isKanjiModeEnabled()?(R=f(s.BYTE,t.BYTE,w),_=f(s.KANJI,t.KANJI,w)):(R=f(s.BYTE_KANJI,t.BYTE,w),_=[]),P.concat(E,R,_).sort(function(S,A){return S.index-A.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function m(w,P){switch(P){case t.NUMERIC:return r.getBitsLength(w);case t.ALPHANUMERIC:return n.getBitsLength(w);case t.KANJI:return i.getBitsLength(w);case t.BYTE:return o.getBitsLength(w)}}function y(w){return w.reduce(function(P,E){const R=P.length-1>=0?P[P.length-1]:null;return R&&R.mode===E.mode?(P[P.length-1].data+=E.data,P):(P.push(E),P)},[])}function d(w){const P=[];for(let E=0;E<w.length;E++){const R=w[E];switch(R.mode){case t.NUMERIC:P.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:P.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:P.push([R,{data:R.data,mode:t.BYTE,length:l(R.data)}]);break;case t.BYTE:P.push([{data:R.data,mode:t.BYTE,length:l(R.data)}])}}return P}function p(w,P){const E={},R={start:{}};let _=["start"];for(let b=0;b<w.length;b++){const S=w[b],A=[];for(let C=0;C<S.length;C++){const L=S[C],B=""+b+C;A.push(B),E[B]={node:L,lastCount:0},R[B]={};for(let N=0;N<_.length;N++){const T=_[N];E[T]&&E[T].node.mode===L.mode?(R[T][B]=m(E[T].lastCount+L.length,L.mode)-m(E[T].lastCount,L.mode),E[T].lastCount+=L.length):(E[T]&&(E[T].lastCount=L.length),R[T][B]=m(L.length,L.mode)+4+t.getCharCountIndicator(L.mode,P))}}_=A}for(let b=0;b<_.length;b++)R[_[b]].end=0;return{map:R,table:E}}function g(w,P){let E;const R=t.getBestModeForData(w);if(E=t.from(P,R),E!==t.BYTE&&E.bit<R.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString(E)+`.
177
- Suggested mode is: `+t.toString(R));switch(E===t.KANJI&&!a.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new r(w);case t.ALPHANUMERIC:return new n(w);case t.KANJI:return new i(w);case t.BYTE:return new o(w)}}e.fromArray=function(P){return P.reduce(function(E,R){return typeof R=="string"?E.push(g(R,null)):R.data&&E.push(g(R.data,R.mode)),E},[])},e.fromString=function(P,E){const R=h(P,a.isKanjiModeEnabled()),_=d(R),b=p(_,E),S=u.find_path(b.map,"start","end"),A=[];for(let C=1;C<S.length-1;C++)A.push(b.table[S[C]].node);return e.fromArray(y(A))},e.rawSplit=function(P){return e.fromArray(h(P,a.isKanjiModeEnabled()))}})(it)),it}var On;function Lo(){if(On)return Ve;On=1;const e=ee(),t=Ke(),r=po(),n=go(),o=mo(),i=yo(),s=wo(),a=dn(),u=Co(),l=So(),f=Ro(),h=te(),m=Oo();function y(b,S){const A=b.size,C=i.getPositions(S);for(let L=0;L<C.length;L++){const B=C[L][0],N=C[L][1];for(let T=-1;T<=7;T++)if(!(B+T<=-1||A<=B+T))for(let O=-1;O<=7;O++)N+O<=-1||A<=N+O||(T>=0&&T<=6&&(O===0||O===6)||O>=0&&O<=6&&(T===0||T===6)||T>=2&&T<=4&&O>=2&&O<=4?b.set(B+T,N+O,!0,!0):b.set(B+T,N+O,!1,!0))}}function d(b){const S=b.size;for(let A=8;A<S-8;A++){const C=A%2===0;b.set(A,6,C,!0),b.set(6,A,C,!0)}}function p(b,S){const A=o.getPositions(S);for(let C=0;C<A.length;C++){const L=A[C][0],B=A[C][1];for(let N=-2;N<=2;N++)for(let T=-2;T<=2;T++)N===-2||N===2||T===-2||T===2||N===0&&T===0?b.set(L+N,B+T,!0,!0):b.set(L+N,B+T,!1,!0)}}function g(b,S){const A=b.size,C=l.getEncodedBits(S);let L,B,N;for(let T=0;T<18;T++)L=Math.floor(T/3),B=T%3+A-8-3,N=(C>>T&1)===1,b.set(L,B,N,!0),b.set(B,L,N,!0)}function w(b,S,A){const C=b.size,L=f.getEncodedBits(S,A);let B,N;for(B=0;B<15;B++)N=(L>>B&1)===1,B<6?b.set(B,8,N,!0):B<8?b.set(B+1,8,N,!0):b.set(C-15+B,8,N,!0),B<8?b.set(8,C-B-1,N,!0):B<9?b.set(8,15-B-1+1,N,!0):b.set(8,15-B-1,N,!0);b.set(C-8,8,1,!0)}function P(b,S){const A=b.size;let C=-1,L=A-1,B=7,N=0;for(let T=A-1;T>0;T-=2)for(T===6&&T--;;){for(let O=0;O<2;O++)if(!b.isReserved(L,T-O)){let z=!1;N<S.length&&(z=(S[N]>>>B&1)===1),b.set(L,T-O,z),B--,B===-1&&(N++,B=7)}if(L+=C,L<0||A<=L){L-=C,C=-C;break}}}function E(b,S,A){const C=new r;A.forEach(function(O){C.put(O.mode.bit,4),C.put(O.getLength(),h.getCharCountIndicator(O.mode,b)),O.write(C)});const L=e.getSymbolTotalCodewords(b),B=a.getTotalCodewordsCount(b,S),N=(L-B)*8;for(C.getLengthInBits()+4<=N&&C.put(0,4);C.getLengthInBits()%8!==0;)C.putBit(0);const T=(N-C.getLengthInBits())/8;for(let O=0;O<T;O++)C.put(O%2?17:236,8);return R(C,b,S)}function R(b,S,A){const C=e.getSymbolTotalCodewords(S),L=a.getTotalCodewordsCount(S,A),B=C-L,N=a.getBlocksCount(S,A),T=C%N,O=N-T,z=Math.floor(C/N),M=Math.floor(B/N),Le=M+1,$=z-M,Ie=new u($);let we=0;const j=new Array(N),K=new Array(N);let ne=0;const ue=new Uint8Array(b.buffer);for(let ce=0;ce<N;ce++){const gt=ce<O?M:Le;j[ce]=ue.slice(we,we+gt),K[ce]=Ie.encode(j[ce]),we+=gt,ne=Math.max(ne,gt)}const le=new Uint8Array(C);let kn=0,Q,W;for(Q=0;Q<ne;Q++)for(W=0;W<N;W++)Q<j[W].length&&(le[kn++]=j[W][Q]);for(Q=0;Q<$;Q++)for(W=0;W<N;W++)le[kn++]=K[W][Q];return le}function _(b,S,A,C){let L;if(Array.isArray(b))L=m.fromArray(b);else if(typeof b=="string"){let z=S;if(!z){const M=m.rawSplit(b);z=l.getBestVersionForData(M,A)}L=m.fromString(b,z||40)}else throw new Error("Invalid data");const B=l.getBestVersionForData(L,A);if(!B)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=B;else if(S<B)throw new Error(`
177
+ Suggested mode is: `+t.toString(R));switch(E===t.KANJI&&!a.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new r(w);case t.ALPHANUMERIC:return new n(w);case t.KANJI:return new i(w);case t.BYTE:return new o(w)}}e.fromArray=function(P){return P.reduce(function(E,R){return typeof R=="string"?E.push(g(R,null)):R.data&&E.push(g(R.data,R.mode)),E},[])},e.fromString=function(P,E){const R=h(P,a.isKanjiModeEnabled()),_=d(R),b=p(_,E),S=u.find_path(b.map,"start","end"),A=[];for(let C=1;C<S.length-1;C++)A.push(b.table[S[C]].node);return e.fromArray(y(A))},e.rawSplit=function(P){return e.fromArray(h(P,a.isKanjiModeEnabled()))}})(it)),it}var On;function Lo(){if(On)return Ve;On=1;const e=ee(),t=Ke(),r=po(),n=go(),o=mo(),i=yo(),s=wo(),a=dn(),u=Co(),l=So(),f=Ro(),h=te(),m=Oo();function y(b,S){const A=b.size,C=i.getPositions(S);for(let L=0;L<C.length;L++){const B=C[L][0],N=C[L][1];for(let T=-1;T<=7;T++)if(!(B+T<=-1||A<=B+T))for(let O=-1;O<=7;O++)N+O<=-1||A<=N+O||(T>=0&&T<=6&&(O===0||O===6)||O>=0&&O<=6&&(T===0||T===6)||T>=2&&T<=4&&O>=2&&O<=4?b.set(B+T,N+O,!0,!0):b.set(B+T,N+O,!1,!0))}}function d(b){const S=b.size;for(let A=8;A<S-8;A++){const C=A%2===0;b.set(A,6,C,!0),b.set(6,A,C,!0)}}function p(b,S){const A=o.getPositions(S);for(let C=0;C<A.length;C++){const L=A[C][0],B=A[C][1];for(let N=-2;N<=2;N++)for(let T=-2;T<=2;T++)N===-2||N===2||T===-2||T===2||N===0&&T===0?b.set(L+N,B+T,!0,!0):b.set(L+N,B+T,!1,!0)}}function g(b,S){const A=b.size,C=l.getEncodedBits(S);let L,B,N;for(let T=0;T<18;T++)L=Math.floor(T/3),B=T%3+A-8-3,N=(C>>T&1)===1,b.set(L,B,N,!0),b.set(B,L,N,!0)}function w(b,S,A){const C=b.size,L=f.getEncodedBits(S,A);let B,N;for(B=0;B<15;B++)N=(L>>B&1)===1,B<6?b.set(B,8,N,!0):B<8?b.set(B+1,8,N,!0):b.set(C-15+B,8,N,!0),B<8?b.set(8,C-B-1,N,!0):B<9?b.set(8,15-B-1+1,N,!0):b.set(8,15-B-1,N,!0);b.set(C-8,8,1,!0)}function P(b,S){const A=b.size;let C=-1,L=A-1,B=7,N=0;for(let T=A-1;T>0;T-=2)for(T===6&&T--;;){for(let O=0;O<2;O++)if(!b.isReserved(L,T-O)){let z=!1;N<S.length&&(z=(S[N]>>>B&1)===1),b.set(L,T-O,z),B--,B===-1&&(N++,B=7)}if(L+=C,L<0||A<=L){L-=C,C=-C;break}}}function E(b,S,A){const C=new r;A.forEach(function(O){C.put(O.mode.bit,4),C.put(O.getLength(),h.getCharCountIndicator(O.mode,b)),O.write(C)});const L=e.getSymbolTotalCodewords(b),B=a.getTotalCodewordsCount(b,S),N=(L-B)*8;for(C.getLengthInBits()+4<=N&&C.put(0,4);C.getLengthInBits()%8!==0;)C.putBit(0);const T=(N-C.getLengthInBits())/8;for(let O=0;O<T;O++)C.put(O%2?17:236,8);return R(C,b,S)}function R(b,S,A){const C=e.getSymbolTotalCodewords(S),L=a.getTotalCodewordsCount(S,A),B=C-L,N=a.getBlocksCount(S,A),T=C%N,O=N-T,z=Math.floor(C/N),M=Math.floor(B/N),Le=M+1,$=z-M,Ie=new u($);let we=0;const j=new Array(N),K=new Array(N);let ne=0;const ue=new Uint8Array(b.buffer);for(let ce=0;ce<N;ce++){const gt=ce<O?M:Le;j[ce]=ue.slice(we,we+gt),K[ce]=Ie.encode(j[ce]),we+=gt,ne=Math.max(ne,gt)}const le=new Uint8Array(C);let Dn=0,Q,W;for(Q=0;Q<ne;Q++)for(W=0;W<N;W++)Q<j[W].length&&(le[Dn++]=j[W][Q]);for(Q=0;Q<$;Q++)for(W=0;W<N;W++)le[Dn++]=K[W][Q];return le}function _(b,S,A,C){let L;if(Array.isArray(b))L=m.fromArray(b);else if(typeof b=="string"){let z=S;if(!z){const M=m.rawSplit(b);z=l.getBestVersionForData(M,A)}L=m.fromString(b,z||40)}else throw new Error("Invalid data");const B=l.getBestVersionForData(L,A);if(!B)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=B;else if(S<B)throw new Error(`
178
178
  The chosen QR Code version cannot contain this amount of data.
179
179
  Minimum version required to store current data is: `+B+`.
180
- `);const N=E(S,A,L),T=e.getSymbolSize(S),O=new n(T);return y(O,S),d(O),p(O,S),w(O,A,0),S>=7&&g(O,S),P(O,N),isNaN(C)&&(C=s.getBestMask(O,w.bind(null,O,A))),s.applyMask(C,O),w(O,A,C),{modules:O,version:S,errorCorrectionLevel:A,maskPattern:C,segments:L}}return Ve.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let C=t.M,L,B;return typeof A<"u"&&(C=t.from(A.errorCorrectionLevel,t.M),L=l.from(A.version),B=s.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),_(S,L,C,B)},Ve}var ft={},dt={},Ln;function In(){return Ln||(Ln=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),l=Math.floor((s+i.margin*2)*u),f=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m<l;m++)for(let y=0;y<l;y++){let d=(m*l+y)*4,p=i.color.light;if(m>=f&&y>=f&&m<l-f&&y<l-f){const g=Math.floor((m-f)/u),w=Math.floor((y-f)/u);p=h[a[g*s+w]?1:0]}n[d++]=p.r,n[d++]=p.g,n[d++]=p.b,n[d]=p.a}}})(dt)),dt}var _n;function Io(){return _n||(_n=1,(function(e){const t=In();function r(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=n()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),h=l.getContext("2d"),m=h.createImageData(f,f);return t.qrToImageData(m.data,i,u),r(h,l,f),h.putImageData(m,0,0),l},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(i,s,u),f=u.type||"image/png",h=u.rendererOpts||{};return l.toDataURL(f,h.quality)}})(ft)),ft}var ht={},Un;function _o(){if(Un)return ht;Un=1;const e=In();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function r(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function n(o,i,s){let a="",u=0,l=!1,f=0;for(let h=0;h<o.length;h++){const m=Math.floor(h%i),y=Math.floor(h/i);!m&&!l&&(l=!0),o[h]?(f++,h>0&&m>0&&o[h-1]||(a+=l?r("M",m+s,.5+y+s):r("m",u,0),u=0,l=!1),m+1<i&&o[h+1]||(a+=r("h",f),f=0)):u++}return a}return ht.render=function(i,s,a){const u=e.getOptions(s),l=i.modules.size,f=i.modules.data,h=l+u.margin*2,m=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",y="<path "+t(u.color.dark,"stroke")+' d="'+n(f,l,u.margin)+'"/>',d='viewBox="0 0 '+h+" "+h+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+d+' shape-rendering="crispEdges">'+m+y+`</svg>
181
- `;return typeof a=="function"&&a(null,g),g},ht}var vn;function Uo(){if(vn)return ae;vn=1;const e=ho(),t=Lo(),r=Io(),n=_o();function o(i,s,a,u,l){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof l>"u"?(l=u,u=void 0):(l=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);l(null,i(y,s,u))}catch(y){l(y)}}return ae.create=t.create,ae.toCanvas=o.bind(null,r.render),ae.toDataURL=o.bind(null,r.renderToDataURL),ae.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),ae}var vo=Uo();class Fo{constructor(){D(this,"overlay",null);D(this,"isOpen",!1);D(this,"errorCallback",null);D(this,"authEvent",null);D(this,"contentContainer",null);D(this,"loader",null);D(this,"qrContainer",null);D(this,"separator",null);D(this,"loginButton",null);D(this,"errorContainer",null);D(this,"timerContainer",null);D(this,"timerInterval",null);D(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{r.target===this.overlay&&this.close()}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await vo.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t+"Z").getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=t.links[0].link;this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=xn(()=>this.close(),n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
180
+ `);const N=E(S,A,L),T=e.getSymbolSize(S),O=new n(T);return y(O,S),d(O),p(O,S),w(O,A,0),S>=7&&g(O,S),P(O,N),isNaN(C)&&(C=s.getBestMask(O,w.bind(null,O,A))),s.applyMask(C,O),w(O,A,C),{modules:O,version:S,errorCorrectionLevel:A,maskPattern:C,segments:L}}return Ve.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let C=t.M,L,B;return typeof A<"u"&&(C=t.from(A.errorCorrectionLevel,t.M),L=l.from(A.version),B=s.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),_(S,L,C,B)},Ve}var ft={},dt={},Ln;function In(){return Ln||(Ln=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),l=Math.floor((s+i.margin*2)*u),f=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m<l;m++)for(let y=0;y<l;y++){let d=(m*l+y)*4,p=i.color.light;if(m>=f&&y>=f&&m<l-f&&y<l-f){const g=Math.floor((m-f)/u),w=Math.floor((y-f)/u);p=h[a[g*s+w]?1:0]}n[d++]=p.r,n[d++]=p.g,n[d++]=p.b,n[d]=p.a}}})(dt)),dt}var _n;function Io(){return _n||(_n=1,(function(e){const t=In();function r(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=n()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),h=l.getContext("2d"),m=h.createImageData(f,f);return t.qrToImageData(m.data,i,u),r(h,l,f),h.putImageData(m,0,0),l},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(i,s,u),f=u.type||"image/png",h=u.rendererOpts||{};return l.toDataURL(f,h.quality)}})(ft)),ft}var ht={},vn;function _o(){if(vn)return ht;vn=1;const e=In();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function r(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function n(o,i,s){let a="",u=0,l=!1,f=0;for(let h=0;h<o.length;h++){const m=Math.floor(h%i),y=Math.floor(h/i);!m&&!l&&(l=!0),o[h]?(f++,h>0&&m>0&&o[h-1]||(a+=l?r("M",m+s,.5+y+s):r("m",u,0),u=0,l=!1),m+1<i&&o[h+1]||(a+=r("h",f),f=0)):u++}return a}return ht.render=function(i,s,a){const u=e.getOptions(s),l=i.modules.size,f=i.modules.data,h=l+u.margin*2,m=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",y="<path "+t(u.color.dark,"stroke")+' d="'+n(f,l,u.margin)+'"/>',d='viewBox="0 0 '+h+" "+h+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+d+' shape-rendering="crispEdges">'+m+y+`</svg>
181
+ `;return typeof a=="function"&&a(null,g),g},ht}var Un;function vo(){if(Un)return ae;Un=1;const e=ho(),t=Lo(),r=Io(),n=_o();function o(i,s,a,u,l){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof l>"u"?(l=u,u=void 0):(l=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);l(null,i(y,s,u))}catch(y){l(y)}}return ae.create=t.create,ae.toCanvas=o.bind(null,r.render),ae.toDataURL=o.bind(null,r.renderToDataURL),ae.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),ae}var Uo=vo();class Fo{constructor(){x(this,"overlay",null);x(this,"isOpen",!1);x(this,"authEvent",null);x(this,"contentContainer",null);x(this,"loader",null);x(this,"qrContainer",null);x(this,"separator",null);x(this,"loginButton",null);x(this,"errorContainer",null);x(this,"timerContainer",null);x(this,"timerInterval",null);x(this,"resolvePromise",null);x(this,"rejectPromise",null);x(this,"currentPromise",null);x(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{var n;r.target===this.overlay&&(this.close(),((n=this.errorContainer)==null?void 0:n.style.display)=="block"&&this.rejectPromise())}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await Uo.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t).getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=t.links[0].link;this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=xn(()=>{this.close(),this.resolvePromise()},n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
182
182
  <p class="oauth-error-message">Ошибка: ${t.message||"Неизвестная ошибка"}</p>
183
183
  <button class="oauth-retry-button">Повторить</button>
184
184
  `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}renderExpiredState(){this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
185
185
  <p class="oauth-error-message">Срок действия ссылки истек.</p>
186
186
  <button class="oauth-retry-button">Обновить</button>
187
- `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}async show(t,r){this.isOpen||(this.requestData=t,this.errorCallback=r||null,this.overlay||this.createModal(),this.isOpen=!0,setTimeout(()=>{var n;return(n=this.overlay)==null?void 0:n.classList.add("active")},10),this.startAuthFlow())}async startAuthFlow(){if(this.requestData){this.setLoadingState();try{const t=await Mn(this.requestData);this.renderSuccessState(t)}catch(t){this.renderErrorState(t),this.errorCallback&&this.errorCallback(t)}}}close(){!this.isOpen||!this.overlay||(this.authEvent&&this.authEvent.close(),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null),this.overlay.classList.remove("active"),setTimeout(()=>{this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.isOpen=!1,this.requestData=null},400))}}ko();const ye=mt(),Fn=U.create({baseURL:ye.baseUrl}),pt=new Fo;function Mo(e={}){pt.show(e)}function xo(){pt.close()}async function Mn(e={}){return(await Fn.post(ye.createEndpoint,e,{withCredentials:!0})).data}function xn(e=()=>pt.close(),t=()=>{}){const r=new URL(ye.authEventEndpoint,ye.baseUrl),n=new EventSource(r,{withCredentials:!0});return n.addEventListener("auth-success",async o=>{try{await Fn.post(ye.authConfirmEndpoint,null,{withCredentials:!0}),e()}catch(i){console.error(i),t(i)}finally{n.close()}}),n.onerror=o=>{console.error("EventSource failed:",o),n.close()},n}function ko(){if(document.getElementById("oauth0-js-lib-styles"))return;const e=document.createElement("style");e.id="oauth0-js-lib-styles",e.innerHTML=fo,document.head.appendChild(e)}v.closeQrLogin=xo,v.createAuthEvent=xn,v.createAuthSession=Mn,v.getConfig=mt,v.setConfig=jn,v.showQrLogin=Mo,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})}));
187
+ `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}async show(t){return this.isOpen?this.currentPromise:(this.requestData=t,this.currentPromise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n}),this.overlay||this.createModal(),this.isOpen=!0,setTimeout(()=>{var r;return(r=this.overlay)==null?void 0:r.classList.add("active")},10),this.startAuthFlow(),this.currentPromise)}async startAuthFlow(){if(this.requestData){this.setLoadingState();try{const t=await Mn(this.requestData);this.renderSuccessState(t)}catch(t){this.renderErrorState(t)}}}close(){!this.isOpen||!this.overlay||(this.authEvent&&this.authEvent.close(),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null),this.overlay.classList.remove("active"),setTimeout(()=>{this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.isOpen=!1,this.requestData=null},400))}}Do();const ye=mt(),Fn=v.create({baseURL:ye.baseUrl}),pt=new Fo;async function Mo(e={}){return pt.show(e)}function xo(){pt.close()}async function Mn(e={}){return(await Fn.post(ye.createEndpoint,e,{withCredentials:!0})).data}function xn(e=()=>pt.close(),t=()=>{}){const r=new URL(ye.authEventEndpoint,ye.baseUrl),n=new EventSource(r,{withCredentials:!0});return n.addEventListener("auth-success",async o=>{try{await Fn.post(ye.authConfirmEndpoint,null,{withCredentials:!0}),e()}catch(i){console.error(i),t(i)}finally{n.close()}}),n.onerror=o=>{console.error("EventSource failed:",o),n.close()},n}function Do(){if(document.getElementById("oauth0-js-lib-styles"))return;const e=document.createElement("style");e.id="oauth0-js-lib-styles",e.innerHTML=fo,document.head.appendChild(e)}U.closeQrLogin=xo,U.createAuthEvent=xn,U.createAuthSession=Mn,U.getConfig=mt,U.setConfig=jn,U.showQrLogin=Mo,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
package/dist/main.d.ts CHANGED
@@ -9,7 +9,7 @@ export interface AuthSession {
9
9
  sessionId: string;
10
10
  validUntil: string | null;
11
11
  }
12
- export declare function showQrLogin(sessionTime?: AuthSessionTime): void;
12
+ export declare function showQrLogin(sessionTime?: AuthSessionTime): Promise<void>;
13
13
  export declare function closeQrLogin(): void;
14
14
  export declare function createAuthSession(sessionTime?: AuthSessionTime): Promise<AuthSession>;
15
15
  export declare function createAuthEvent(successCallback?: Function, errorCallback?: Function): EventSource;
package/dist/modal.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { AuthSessionTime } from './main.js';
2
- export type ErrorCallback = (error: any) => void;
3
2
  export declare class QRModal {
4
3
  private overlay;
5
4
  private isOpen;
6
- private errorCallback;
7
5
  private authEvent;
8
6
  private contentContainer;
9
7
  private loader;
@@ -13,6 +11,9 @@ export declare class QRModal {
13
11
  private errorContainer;
14
12
  private timerContainer;
15
13
  private timerInterval;
14
+ private resolvePromise;
15
+ private rejectPromise;
16
+ private currentPromise;
16
17
  private createElement;
17
18
  private createModal;
18
19
  private generateQR;
@@ -22,7 +23,7 @@ export declare class QRModal {
22
23
  private renderErrorState;
23
24
  private renderExpiredState;
24
25
  private requestData;
25
- show(requestData: AuthSessionTime, onError?: ErrorCallback): Promise<void>;
26
+ show(requestData: AuthSessionTime): Promise<void>;
26
27
  private startAuthFlow;
27
28
  close(): void;
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oauth0-js-lib",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",