@onhand-bi/sdk 0.1.11 → 0.1.12
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/core/client.d.ts +4 -4
- package/core/token-manager/base-token-manager.d.ts +45 -7
- package/index.js +1 -1
- package/index.node.js +1 -1
- package/package.json +1 -1
package/core/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Report } from '../models';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseTokenManager } from './token-manager/base-token-manager';
|
|
3
3
|
export declare class Client {
|
|
4
4
|
private tokenManager;
|
|
5
|
-
constructor(tokenManager:
|
|
6
|
-
getTokenManager():
|
|
7
|
-
setTokenManager(tokenManager:
|
|
5
|
+
constructor(tokenManager: BaseTokenManager);
|
|
6
|
+
getTokenManager(): BaseTokenManager;
|
|
7
|
+
setTokenManager(tokenManager: BaseTokenManager): void;
|
|
8
8
|
getReports(page?: number, searchText?: string): Promise<Report | never[]>;
|
|
9
9
|
getSubscriberReports(page?: number, searchText?: string): Promise<Report | never[]>;
|
|
10
10
|
getTemplateReports(page?: number, searchText?: string): Promise<Report | never[]>;
|
|
@@ -1,9 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
type TokenDecode = {
|
|
2
|
+
exp: number;
|
|
3
|
+
iat: number;
|
|
4
|
+
jti: string;
|
|
5
|
+
iss: string;
|
|
6
|
+
aud: string;
|
|
7
|
+
sub: string;
|
|
8
|
+
typ: string;
|
|
9
|
+
azp: string;
|
|
10
|
+
session_state: string;
|
|
11
|
+
acr: string;
|
|
12
|
+
'allowed-origins': string[];
|
|
13
|
+
realm_access: {
|
|
14
|
+
roles: string[];
|
|
15
|
+
};
|
|
16
|
+
resource_access: {
|
|
17
|
+
[resource: string]: {
|
|
18
|
+
roles: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
scope: string;
|
|
22
|
+
sid: string;
|
|
23
|
+
email_verified: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
preferred_username: string;
|
|
26
|
+
given_name: string;
|
|
27
|
+
family_name: string;
|
|
28
|
+
email: string;
|
|
29
|
+
};
|
|
30
|
+
type Permission = {
|
|
31
|
+
scopes: string[];
|
|
32
|
+
rsid: string;
|
|
33
|
+
rsname: string;
|
|
34
|
+
};
|
|
35
|
+
export type PermissionTokenDecode = TokenDecode & {
|
|
36
|
+
authorization: {
|
|
37
|
+
permissions: Array<Permission>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
7
40
|
export declare abstract class BaseTokenManager {
|
|
8
41
|
protected realm: string;
|
|
9
42
|
protected accessToken: string;
|
|
@@ -11,10 +44,14 @@ export declare abstract class BaseTokenManager {
|
|
|
11
44
|
protected idToken: string;
|
|
12
45
|
private expirationBuffer;
|
|
13
46
|
private requestingPartyToken;
|
|
47
|
+
private tokenDecode;
|
|
48
|
+
private handleAfterRefreshToken;
|
|
14
49
|
private lock;
|
|
15
50
|
constructor(realm: string, accessToken: string, refreshToken: string, idToken?: string, expirationBuffer?: number);
|
|
16
51
|
protected abstract handleRefreshTokenExpired(): void | Promise<void>;
|
|
17
|
-
|
|
52
|
+
setHandleAfterRefreshToken(func: (decodedToken: PermissionTokenDecode) => void): void;
|
|
53
|
+
tokenParsed(): PermissionTokenDecode;
|
|
54
|
+
getPermissions(): Permission[];
|
|
18
55
|
getToken(): Promise<string>;
|
|
19
56
|
logout(): void | Promise<void>;
|
|
20
57
|
createLogoutUrl(logougRedirectUri: string): string;
|
|
@@ -26,3 +63,4 @@ export declare abstract class BaseTokenManager {
|
|
|
26
63
|
private isTokenCloseToExprie;
|
|
27
64
|
protected handleError(error: any, context: string): void;
|
|
28
65
|
}
|
|
66
|
+
export {};
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OHBI=t():e.OHBI=t()}(this,(()=>(()=>{var e={501:function(e,t,n){var r;e=n.nmd(e),function(o){var i=(e&&e.exports,"object"==typeof n.g&&n.g);i.global!==i&&i.window;var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var a=function(e){throw new s(e)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,o,i=e.length%3,s="",u=-1,l=e.length-i;++u<l;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),s+=c.charAt((o=t+n+r)>>18&63)+c.charAt(o>>12&63)+c.charAt(o>>6&63)+c.charAt(63&o);return 2==i?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),s+=c.charAt((o=t+n)>>10)+c.charAt(o>>4&63)+c.charAt(o<<2&63)+"="):1==i&&(o=e.charCodeAt(u),s+=c.charAt(o>>2)+c.charAt(o<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,o=0,i="",s=-1;++s<t;)r=c.indexOf(e.charAt(s)),n=o%4?64*n+r:r,o++%4&&(i+=String.fromCharCode(255&n>>(-2*o&6)));return i},version:"1.0.0"};void 0===(r=function(){return l}.call(t,n,t,e))||(e.exports=r)}()},23:(e,t,n)=>{var r;!function(){"use strict";var t="input is invalid type",o="object"==typeof window,i=o?window:{};i.JS_SHA256_NO_WINDOW&&(o=!1);var s=!o&&"object"==typeof self,a=!i.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?i=n.g:s&&(i=self);var c=!i.JS_SHA256_NO_COMMON_JS&&e.exports,u=n.amdO,l=!i.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],h=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],m=[];!i.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(n){return new k(t,!0).update(n)[e]()}},v=function(e){var t=y("hex",e);a&&(t=w(t,e)),t.create=function(){return new k(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<g.length;++n){var r=g[n];t[r]=y(r,e)}return t},w=function(e,r){var o,s=n(127),a=n(371).Buffer,c=r?"sha224":"sha256";return o=a.from&&!i.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(n){if("string"==typeof n)return s.createHash(c).update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===a?s.createHash(c).update(o(n)).digest("hex"):e(n)}},_=function(e,t){return function(n,r){return new O(n,t,!0).update(r)[e]()}},b=function(e){var t=_("hex",e);t.create=function(t){return new O(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<g.length;++n){var r=g[n];t[r]=_(r,e)}return t};function k(e,t){t?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function O(e,n,r){var o,i=typeof e;if("string"===i){var s,a=[],c=e.length,u=0;for(o=0;o<c;++o)(s=e.charCodeAt(o))<128?a[u++]=s:s<2048?(a[u++]=192|s>>>6,a[u++]=128|63&s):s<55296||s>=57344?(a[u++]=224|s>>>12,a[u++]=128|s>>>6&63,a[u++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),a[u++]=240|s>>>18,a[u++]=128|s>>>12&63,a[u++]=128|s>>>6&63,a[u++]=128|63&s);e=a}else{if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new k(n,!0).update(e).array());var d=[],f=[];for(o=0;o<64;++o){var h=e[o]||0;d[o]=92^h,f[o]=54^h}k.call(this,n,r),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}k.prototype.update=function(e){if(!this.finalized){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var o,i,s=0,a=e.length,c=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),n)for(i=this.start;s<a&&i<64;++s)c[i>>>2]|=e[s]<<h[3&i++];else for(i=this.start;s<a&&i<64;++s)(o=e.charCodeAt(s))<128?c[i>>>2]|=o<<h[3&i++]:o<2048?(c[i>>>2]|=(192|o>>>6)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]):o<55296||o>=57344?(c[i>>>2]|=(224|o>>>12)<<h[3&i++],c[i>>>2]|=(128|o>>>6&63)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),c[i>>>2]|=(240|o>>>18)<<h[3&i++],c[i>>>2]|=(128|o>>>12&63)<<h[3&i++],c[i>>>2]|=(128|o>>>6&63)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=c[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},k.prototype.hash=function(){var e,t,n,r,o,i,s,a,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,g=this.h5,m=this.h6,y=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((o=v[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,n=((o=v[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,v[e]=v[e-16]+t+v[e-7]+n<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,y=(o=v[0]-1413257819)-150054599<<0,f=o+24177077<<0):(i=704751109,y=(o=v[0]-210244248)-1521486534<<0,f=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(i=u&l)^u&d^c,y=f+(o=y+(n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&g^~h&m)+p[e]+v[e])<<0,f=o+(t+r)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(s=f&u)^f&l^i,m=d+(o=m+(n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&g)+p[e+1]+v[e+1])<<0,t=((d=o+(t+r)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(a=d&f)^d&u^s,g=l+(o=g+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&y^~m&h)+p[e+2]+v[e+2])<<0,t=((l=o+(t+r)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&d)^l&f^a,h=u+(o=h+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&m^~g&y)+p[e+3]+v[e+3])<<0,u=o+(t+r)<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+d<<0,this.h3=this.h3+f<<0,this.h4=this.h4+h<<0,this.h5=this.h5+g<<0,this.h6=this.h6+m<<0,this.h7=this.h7+y<<0},k.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=d[e>>>28&15]+d[e>>>24&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>4&15]+d[15&e]+d[t>>>28&15]+d[t>>>24&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>4&15]+d[15&t]+d[n>>>28&15]+d[n>>>24&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>4&15]+d[15&n]+d[r>>>28&15]+d[r>>>24&15]+d[r>>>20&15]+d[r>>>16&15]+d[r>>>12&15]+d[r>>>8&15]+d[r>>>4&15]+d[15&r]+d[o>>>28&15]+d[o>>>24&15]+d[o>>>20&15]+d[o>>>16&15]+d[o>>>12&15]+d[o>>>8&15]+d[o>>>4&15]+d[15&o]+d[i>>>28&15]+d[i>>>24&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>4&15]+d[15&i]+d[s>>>28&15]+d[s>>>24&15]+d[s>>>20&15]+d[s>>>16&15]+d[s>>>12&15]+d[s>>>8&15]+d[s>>>4&15]+d[15&s];return this.is224||(c+=d[a>>>28&15]+d[a>>>24&15]+d[a>>>20&15]+d[a>>>16&15]+d[a>>>12&15]+d[a>>>8&15]+d[a>>>4&15]+d[15&a]),c},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},O.prototype=new k,O.prototype.finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();k.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),k.prototype.finalize.call(this)}};var E=v();E.sha256=E,E.sha224=v(!0),E.sha256.hmac=b(),E.sha224.hmac=b(!0),c?e.exports=E:(i.sha256=E.sha256,i.sha224=E.sha224,u&&(void 0===(r=function(){return E}.call(E,n,E,e))||(e.exports=r)))}()},245:(e,t,n)=>{"use strict";function r(e){this.message=e}n.r(t),n.d(t,{InvalidTokenError:()=>s,default:()=>a}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,i=0,s=0,a="";o=t.charAt(s++);~o&&(n=i%4?64*n+o:o,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};function i(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(o(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return o(t)}}function s(e){this.message=e}s.prototype=new Error,s.prototype.name="InvalidTokenError";const a=function(e,t){if("string"!=typeof e)throw new s("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(i(e.split(".")[n]))}catch(e){throw new s("Invalid token specified: "+e.message)}}},645:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(949),t)},949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.API_URLS=void 0;const r=n(333);t.API_URLS={VALIDATE_TOKEN:r.API_DOMAIN+"/health_check",GET_REPORTS:r.API_DOMAIN+"/reports/list",GET_SUBSCRIBER_REPORTS:r.API_DOMAIN+"/reports/shared-list",GET_TEMPLATE_REPORTS:r.API_DOMAIN+"/reports/list-template",GET_SHARED_REPORT:r.API_DOMAIN+"/reports/shared",GET_OWN_REPORT:r.API_DOMAIN+"/reports",GET_APP:r.API_DOMAIN+"/apps",GET_REPORT_CONFIG:r.API_REPORT_DOMAIN+"/getembedinfo",BUSINESS_GET_TOKEN:r.API_DOMAIN+"/organizations/access-token",BUSINESS_GET_REPORTS:r.API_DOMAIN+"/organizations/reports",BUSINESS_GET_REPORT_ACCESS_TOKEN:r.API_DOMAIN+"/organizations/report-token",GET_RPT:`${r.API_DOMAIN}/rpt`}},647:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(645),t)},716:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.newCClient=void 0;const o=n(108);t.newCClient=function(e){return r(this,void 0,void 0,(function*(){const t=new o.CClient(e);return yield t.checkCredential(),t}))}},640:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.newOHBI=void 0;const o=n(108),i=n(698);t.newOHBI=function(e){return r(this,void 0,void 0,(function*(){const t=new i.InternalTokenManager(e);return yield t.initialize(),new o.Client(t)}))}},972:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(640),t),o(n(716),t)},543:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CClient=void 0;const i=n(333),s=n(650),a=o(n(245)),c=n(501);t.CClient=class{constructor(e){this.credential=e,this.accessToken=""}getCredential(){return this.credential}checkCredential(){return r(this,void 0,void 0,(function*(){yield this.ensureAccessTokenValid()}))}getReports(){return r(this,void 0,void 0,(function*(){try{return yield this.ensureAccessTokenValid(),yield s.CClientService.getReports(this.accessToken)}catch(e){return yield this.getAccessToken(),s.CClientService.getReports(this.accessToken)}}))}getReportEmbbed(e,t){return r(this,void 0,void 0,(function*(){try{yield this.ensureAccessTokenValid();const n=yield s.CClientService.getReportAccessToken(this.accessToken,t),r=(0,c.encode)((0,c.encode)(e.toString()));return`${i.ORG_REPORT_DOMAIN}/${r}?token=${n.data.accessToken}`}catch(n){return yield this.getAccessToken(),this.getReportEmbbed(e,t)}}))}ensureAccessTokenValid(){return r(this,void 0,void 0,(function*(){try{const e=(0,a.default)(this.accessToken);(new Date).getTime()/1e3>e.exp-60&&(yield this.getAccessToken())}catch(e){yield this.getAccessToken()}}))}getAccessToken(){return r(this,void 0,void 0,(function*(){this.accessToken=yield s.CClientService.getAccessToken(this.credential)}))}}},643:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Client=void 0;const i=n(650),s=o(n(501)),a=n(333);t.Client=class{constructor(e){this.tokenManager=e}getTokenManager(){return this.tokenManager}setTokenManager(e){this.tokenManager=e}getReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getSubscriberReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getSubscriberReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getTemplateReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getTemplateReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getReport(e,t=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.tokenManager.getToken();return yield i.ClientService.getReport(n,e,t)}catch(e){return null}}))}loadReport(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{if(!e||!t)return;const r=yield this.tokenManager.getToken(),o=document.getElementById(t);if(!o)return;const i=s.default.encode(s.default.encode(`${e}`)),c=document.createElement("iframe");return c.src=a.REPORT_DOMAIN+`/${i}?token=${r}&isOwn=${n}`,c.allowFullscreen=!0,o.innerHTML="",o.appendChild(c),c}catch(e){console.log(e)}}))}loadApp(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{if(!e||!t)return;const r=document.getElementById(t);if(!r)return;const o=yield this.tokenManager.getToken(),i=s.default.encode(s.default.encode(`${e}`)),c=document.createElement("iframe");return c.src=a.APP_DOMAIN+`/${i}?token=${o}&isOwn=${n}`,c.allowFullscreen=!0,r.innerHTML="",r.appendChild(c),c}catch(e){console.log(e)}}))}getApp(e,t=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.tokenManager.getToken();return yield i.ClientService.getApp(n,e,t)}catch(e){return console.log(e),null}}))}getApps(e=1,t="",n=!1){return r(this,void 0,void 0,(function*(){try{const r=yield this.tokenManager.getToken(),o={page:e,params:{searchText:t}},s=n?i.ClientService.getAppsOwner:i.ClientService.getAppsSubscribes;return yield s(r,o)}catch(e){return console.log(e),[]}}))}}},108:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(643),t),o(n(543),t),o(n(698),t)},335:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTokenManager=void 0;const i=o(n(245)),s=n(650),a=n(333);t.BaseTokenManager=class{constructor(e,t,n,r="",o=10){this.realm=e,this.accessToken=t,this.refreshToken=n,this.idToken=r,this.expirationBuffer=o,this.requestingPartyToken="",this.lock={fetchRequestingPartyToken:null}}tokenParsed(){return(0,i.default)(this.requestingPartyToken)}getToken(){return this.getRequestingPartytoken()}logout(){return this.handleRefreshTokenExpired()}createLogoutUrl(e){return`${a.SSO_DOMAIN}/realms/${this.realm}/protocol/openid-connect/logout?post_logout_redirect_uri=${encodeURIComponent(e)}&id_token_hint=${this.idToken}&client_id=${a.LOGIN_CLIEN_ID}`}getAccessToken(){return r(this,void 0,void 0,(function*(){return this.isTokenCloseToExprie(this.accessToken)&&(yield this.fetchAccessToken()),this.accessToken}))}fetchAccessToken(){return r(this,void 0,void 0,(function*(){try{const e=yield s.CClientService.refreshToken(this.realm,this.refreshToken);this.accessToken=e.access_token}catch(e){this.handleError(e,"refreshing token"),this.handleRefreshTokenExpired()}}))}getRequestingPartytoken(){return r(this,void 0,void 0,(function*(){return this.requestingPartyToken&&!this.isTokenCloseToExprie(this.requestingPartyToken)||(yield this.fetchRequestingPartyToken()),this.requestingPartyToken}))}fetchRequestingPartyToken(){return r(this,void 0,void 0,(function*(){this.lock.fetchRequestingPartyToken||(this.lock.fetchRequestingPartyToken=this.fetchRequestingPartyTokenAction()),yield this.lock.fetchRequestingPartyToken,this.lock.fetchRequestingPartyToken=null}))}fetchRequestingPartyTokenAction(){return r(this,void 0,void 0,(function*(){const e=yield this.getAccessToken(),t=yield s.CClientService.getRequestingPartyToken(this.realm,e);this.requestingPartyToken=t.access_token}))}isTokenCloseToExprie(e){try{const t=(0,i.default)(e);return(null==t?void 0:t.exp)&&t.exp-this.expirationBuffer<(new Date).getTime()/1e3}catch(e){return this.handleError(e,"parsing token"),!0}}handleError(e,t){console.log(`Error while ${t}`,e)}}},698:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(335),t),o(n(948),t)},948:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InternalTokenManager=void 0;const i=n(333),s=o(n(287)),a=n(335);class c extends a.BaseTokenManager{constructor(e){super(e,"",""),this.isUseKeycloak=!1,this.keycloak=new s.default({realm:e,url:i.SSO_DOMAIN,clientId:i.LOGIN_CLIEN_ID})}initialize(){return r(this,void 0,void 0,(function*(){let e=localStorage.getItem(i.ID_TOKEN_COOKIE_KEY)||"",t=localStorage.getItem(i.TOKEN_COOKIE_KEY)||"",n=localStorage.getItem(i.REFRESH_TOKEN_COOKIE_KEY)||"";t&&n||(yield this.keycloak.init({onLoad:"login-required"}),this.isUseKeycloak=!0,t=this.keycloak.token,n=this.keycloak.refreshToken,e=this.keycloak.idToken,localStorage.setItem(i.ID_TOKEN_COOKIE_KEY,e),localStorage.setItem(i.TOKEN_COOKIE_KEY,t),localStorage.setItem(i.REFRESH_TOKEN_COOKIE_KEY,n)),this.accessToken=t,this.refreshToken=n,this.idToken=e}))}logout(){localStorage.clear();const e=this.createLogoutUrl(window.location.origin);window.location.href=e}handleRefreshTokenExpired(){localStorage.removeItem(i.ID_TOKEN_COOKIE_KEY),localStorage.removeItem(i.TOKEN_COOKIE_KEY),localStorage.removeItem(i.REFRESH_TOKEN_COOKIE_KEY),this.isUseKeycloak?this.keycloak.logout():this.keycloak.init({onLoad:"login-required"})}}t.InternalTokenManager=c},333:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID_TOKEN_COOKIE_KEY=t.REFRESH_TOKEN_COOKIE_KEY=t.TOKEN_COOKIE_KEY=t.ORG_REPORT_DOMAIN=t.REPORT_DOMAIN=t.APP_DOMAIN=t.SERVER_CLIENT_ID=t.LOGIN_CLIEN_ID=t.SSO_DOMAIN=t.API_REPORT_DOMAIN=t.REPORT_FE_DOMAIN=t.API_DOMAIN=void 0,t.API_DOMAIN="https://api.onhandbi.com/v1",t.REPORT_FE_DOMAIN="https://report.onhandbi.com",t.API_REPORT_DOMAIN="https://api.onhandbi.com/report",t.SSO_DOMAIN="https://sso.onhandbi.com",t.LOGIN_CLIEN_ID="security-admin-console-dev",t.SERVER_CLIENT_ID="ohbi-admin-server",t.APP_DOMAIN=`${t.REPORT_FE_DOMAIN}/app`,t.REPORT_DOMAIN=`${t.REPORT_FE_DOMAIN}/report`,t.ORG_REPORT_DOMAIN=`${t.REPORT_FE_DOMAIN}/org/report`,t.TOKEN_COOKIE_KEY="_tk_landing_",t.REFRESH_TOKEN_COOKIE_KEY="_rf_tk_landing_",t.ID_TOKEN_COOKIE_KEY="_id_tk_landing_"},761:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ajaxHelpers=void 0;const o=r(n(218));t.ajaxHelpers={get:(e,t,n)=>o.default.get(e,Object.assign({params:t},n)),post:(e,t,n)=>o.default.post(e,t,n),put:(e,t,n)=>o.default.put(e,t,n),delete:(e,t,n)=>o.default.delete(e,n)}},829:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(761),t),o(n(111),t),o(n(565),t)},111:(e,t)=>{"use strict";function n(e){return e?{Authorization:`Bearer ${e}`,"Access-Control-Allow-Origin":"*"}:{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestOptions=t.getAuthHeaders=void 0,t.getAuthHeaders=n,t.getRequestOptions=function(e,t=!0){const r={};return r.headers=e&&t?n(e):{},r}},565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleResponse=void 0,t.handleResponse=function(e){return e.then((e=>e.data)).catch((e=>{var t;return 401===(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)&&console.log(e),Promise.reject(e)}))}},499:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CClientService=void 0;const o=n(647),i=n(333),s=n(829),a=n(299);t.CClientService=class{static getAccessToken(e){return r(this,void 0,void 0,(function*(){const t=new URLSearchParams;return t.append("client_id",e.clientId),t.append("client_token",e.clientToken),(yield(0,s.handleResponse)(s.ajaxHelpers.post(o.API_URLS.BUSINESS_GET_TOKEN,t,{}))).data.accessToken}))}static getReports(e){const t=(0,s.getRequestOptions)(e);return(0,s.handleResponse)(s.ajaxHelpers.get(o.API_URLS.BUSINESS_GET_REPORTS,{},t))}static getReportAccessToken(e,t){const n=(0,s.getRequestOptions)(e);return(0,s.handleResponse)(s.ajaxHelpers.post(o.API_URLS.BUSINESS_GET_REPORT_ACCESS_TOKEN,{email:t},n))}static getRequestingPartyToken(e,t){const n=(0,s.getRequestOptions)(t),r=(0,a.createRequestingPartyTokenUrl)(e);return n.headers["Content-Type"]="application/x-www-form-urlencoded",(0,s.handleResponse)(s.ajaxHelpers.post(r,{grant_type:"urn:ietf:params:oauth:grant-type:uma-ticket",audience:i.SERVER_CLIENT_ID},n))}static refreshToken(e,t){const n=(0,s.getRequestOptions)(t,!1),r=(0,a.createTokenUrl)(e);return n.headers["Content-Type"]="application/x-www-form-urlencoded",(0,s.handleResponse)(s.ajaxHelpers.post(r,{grant_type:"refresh_token",client_id:i.LOGIN_CLIEN_ID,refresh_token:t},n))}}},539:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientService=void 0;const o=n(647),i=n(829);t.ClientService=class{static validateToken(e){return r(this,void 0,void 0,(function*(){const t=(0,i.getRequestOptions)(e);return yield i.ajaxHelpers.get(o.API_URLS.VALIDATE_TOKEN,{},t)}))}static getReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_REPORTS,Object.assign({page:r},s),n))}))}static getSubscriberReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_SUBSCRIBER_REPORTS,Object.assign({page:r},s),n))}))}static getTemplateReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_TEMPLATE_REPORTS,Object.assign({page:r},s),n))}))}static getAppsOwner(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_APP,Object.assign({page:r},s),n))}))}static getAppsSubscribes(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_APP+"/subscribes",Object.assign({page:r},s),n))}))}static getReport(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=(0,i.getRequestOptions)(e),s=n?o.API_URLS.GET_OWN_REPORT:o.API_URLS.GET_SHARED_REPORT;return yield(0,i.handleResponse)(i.ajaxHelpers.get(s+`/${t}`,{},r))}))}static getApp(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=(0,i.getRequestOptions)(e),s=n?o.API_URLS.GET_APP+`/${t}`:o.API_URLS.GET_APP+`/${t}/view`;return yield(0,i.handleResponse)(i.ajaxHelpers.get(s,{},r))}))}}},650:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(539),t),o(n(499),t)},299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestingPartyTokenUrl=t.createTokenUrl=void 0;const r=n(333);t.createTokenUrl=e=>`${r.SSO_DOMAIN}/realms/${e}/protocol/openid-connect/token`,t.createRequestingPartyTokenUrl=e=>`${r.API_DOMAIN}/realms/${e}/protocol/openid-connect/token`},371:()=>{},127:()=>{},218:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,d=u("undefined"),f=c("ArrayBuffer"),h=u("string"),p=u("function"),g=u("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=c("Date"),w=c("File"),_=c("Blob"),b=c("FileList"),k=c("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function E(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,T=e=>!d(e)&&e!==S,R=(A="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>A&&e instanceof A);var A;const P=c("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),C=c("RegExp"),x=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",N="0123456789",j={DIGIT:N,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+N},M=c("AsyncFunction");var L={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:d,isDate:v,isFile:w,isBlob:_,isRegExp:C,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:k,isTypedArray:R,isFileList:b,forEach:O,merge:function e(){const{caseless:t}=T(this)&&this||{},n={},r=(r,o)=>{const i=t&&E(n,o)||o;y(n[i])&&y(r)?n[i]=e(n[i],r):y(r)?n[i]=e({},r):l(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:o}={})=>(O(t,((t,o)=>{n&&p(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:P,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:x,freezeMethods:e=>{x(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:S,isContextDefined:T,ALPHABET:j,generateString:(e=16,t=j.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return O(e,((e,t)=>{const i=n(e,r+1);!d(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:M,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch)};function D(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}L.inherits(D,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:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=D.prototype,F={};function q(e){return L.isPlainObject(e)||L.isArray(e)}function K(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function H(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["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=>{F[e]={value:e}})),Object.defineProperties(D,F),Object.defineProperty(B,"isAxiosError",{value:!0}),D.from=(e,t,n,r,o,i)=>{const s=Object.create(B);return L.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const z=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!a&&L.isBlob(e))throw new D("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(q)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(a=L.toArray(e)))return n=K(n),a.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===s?H([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!q(e)||(t.append(H(o,n,i),c(e)),!1)}const l=[],d=Object.assign(z,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),L.forEach(n,(function(n,i){!0===(!(L.isUndefined(n)||null===n)&&o.call(t,n,L.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function G(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function J(e,t){this._pairs=[],e&&V(e,this,t)}const $=J.prototype;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function W(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let i;if(i=o?o(t,n):L.isURLSearchParams(t)?t.toString():new J(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:J,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ee="undefined"!=typeof window&&"undefined"!=typeof document,te=(ne="undefined"!=typeof navigator&&navigator.product,ee&&["ReactNative","NativeScript","NS"].indexOf(ne)<0);var ne;const re="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var oe={...Object.freeze({__proto__:null,hasBrowserEnv:ee,hasStandardBrowserWebWorkerEnv:re,hasStandardBrowserEnv:te}),...Z};function ie(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&L.isArray(r)?r.length:i,a?(L.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&L.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&L.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const se={transitional:Q,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=L.isObject(e);if(o&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r&&r?JSON.stringify(ie(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return oe.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(0,JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw D.from(e,D.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],(e=>{se.headers[e]={}}));var ae=se;const ce=L.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"]),ue=Symbol("internals");function le(e){return e&&String(e).trim().toLowerCase()}function de(e){return!1===e||null==e?e:L.isArray(e)?e.map(de):String(e)}function fe(e,t,n,r,o){return L.isFunction(r)?r.call(this,t,n):(o&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=le(t);if(!o)throw new Error("header name must be a non-empty string");const i=L.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=de(e))}const i=(e,t)=>L.forEach(e,((e,n)=>o(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?i(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ce[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=le(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=le(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!fe(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=le(e)){const o=L.findKey(n,e);!o||t&&!fe(0,n[o],o,t)||(delete n[o],r=!0)}}return L.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!fe(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,o)=>{const i=L.findKey(n,o);if(i)return t[i]=de(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=de(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ue]=this[ue]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=le(e);t[r]||(function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(he.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),L.freezeMethods(he);var pe=he;function ge(e,t){const n=this||ae,r=t||n,o=pe.from(r.headers);let i=r.data;return L.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function me(e){return!(!e||!e.__CANCEL__)}function ye(e,t,n){D.call(this,null==e?"canceled":e,D.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(ye,D,{__CANCEL__:!0});var ve=oe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];L.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),L.isString(r)&&s.push("path="+r),L.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function we(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var _e=oe.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function be(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,c=r(a);n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const ke={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=pe.from(e.headers).normalize();let i,s,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}if(L.isFormData(r))if(oe.hasStandardBrowserEnv||oe.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(s=o.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=we(e.baseURL,e.url);function f(){if(!l)return;const r=pe.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new D("Request failed with status code "+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),W(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new D("Request aborted",D.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new D("Network Error",D.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Q;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new D(t,r.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,l)),l=null},oe.hasStandardBrowserEnv&&(c&&L.isFunction(c)&&(c=c(e)),c||!1!==c&&_e(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&ve.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&L.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",be(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",be(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(n(!t||t.type?new ye(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);h&&-1===oe.protocols.indexOf(h)?n(new D("Unsupported protocol "+h+":",D.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};L.forEach(ke,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Oe=e=>`- ${e}`,Ee=e=>L.isFunction(e)||null===e||!1===e;var Se=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Ee(n)&&(r=ke[(t=String(n)).toLowerCase()],void 0===r))throw new D(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new D("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Oe).join("\n"):" "+Oe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Te(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Re(e){return Te(e),e.headers=pe.from(e.headers),e.data=ge.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se(e.adapter||ae.adapter)(e).then((function(t){return Te(e),t.data=ge.call(e,e.transformResponse,t),t.headers=pe.from(t.headers),t}),(function(t){return me(t)||(Te(e),t&&t.response&&(t.response.data=ge.call(e,e.transformResponse,t.response),t.response.headers=pe.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof pe?e.toJSON():e;function Pe(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function o(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!L.isUndefined(t))return r(void 0,t)}function s(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={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:(e,t)=>o(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);L.isUndefined(s)&&i!==a||(n[r]=s)})),n}const Ie={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ie[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ce={};Ie.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new D(r(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Ce[o]&&(Ce[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var xe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new D("option "+i+" must be "+n,D.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}},validators:Ie};const Ue=xe.validators;class Ne{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&xe.assertOptions(n,{silentJSONParsing:Ue.transitional(Ue.boolean),forcedJSONParsing:Ue.transitional(Ue.boolean),clarifyTimeoutError:Ue.transitional(Ue.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:xe.assertOptions(r,{encode:Ue.function,serialize:Ue.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&L.merge(o.common,o[t.method]);o&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=pe.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Re.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(d=0;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Re.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return W(we((e=Pe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}L.forEach(["delete","get","head","options"],(function(e){Ne.prototype[e]=function(t,n){return this.request(Pe(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Pe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ne.prototype[e]=t(),Ne.prototype[e+"Form"]=t(!0)}));var je=Ne;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ye(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}var Le=Me;const De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(De).forEach((([e,t])=>{De[t]=e}));var Be=De;const Fe=function e(t){const n=new je(t),o=r(je.prototype.request,n);return L.extend(o,je.prototype,n,{allOwnKeys:!0}),L.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Pe(t,n))},o}(ae);Fe.Axios=je,Fe.CanceledError=ye,Fe.CancelToken=Le,Fe.isCancel=me,Fe.VERSION="1.6.2",Fe.toFormData=V,Fe.AxiosError=D,Fe.Cancel=Fe.CanceledError,Fe.all=function(e){return Promise.all(e)},Fe.spread=function(e){return function(t){return e.apply(null,t)}},Fe.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},Fe.mergeConfig=Pe,Fe.AxiosHeaders=pe,Fe.formToJSON=e=>ie(L.isHTMLForm(e)?new FormData(e):e),Fe.getAdapter=Se,Fe.HttpStatusCode=Be,Fe.default=Fe,e.exports=Fe},287:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(23);class o extends Error{}function i(e,t){if("string"!=typeof e)throw new o("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new o(`Invalid token specified: missing part #${n+1}`);let i;try{i=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return atob(t)}}(r)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(o.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function s(e){if(!(this instanceof s))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,a=[],c={enable:!0,callbackList:[],interval:5},u=document.getElementsByTagName("script"),l=0;l<u.length;l++)-1===u[l].src.indexOf("keycloak.js")&&-1===u[l].src.indexOf("keycloak.min.js")||-1===u[l].src.indexOf("version=")||(o.iframeVersion=u[l].src.substring(u[l].src.indexOf("version=")+8).split("&")[0]);var d=!0,f=I(console.info),h=I(console.warn);function p(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=new Array(e);for(var r=0;r<t.length;r++)t[r]=Math.floor(256*Math.random());return t}(e),r=new Array(e),o=0;o<e;o++)r[o]=t.charCodeAt(n[o]%t.length);return String.fromCharCode.apply(null,r)}function g(){return void 0!==o.authServerUrl?"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm):void 0}function m(e,t){var n=e.code,r=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r)if("none"!=i){var a={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=o.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),l=new XMLHttpRequest;l.open("POST",u,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId),c+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),l.withCredentials=!0,l.onreadystatechange=function(){if(4==l.readyState)if(200==l.status){var e=JSON.parse(l.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),E()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},l.send(c)}function h(n,r,i,a){v(n,r,i,s=(s+(new Date).getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(f("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):a&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function y(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function v(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=i(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=i(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=i(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(f("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var s=1e3*(o.tokenParsed.exp-(new Date).getTime()/1e3+o.timeSkew);f("[KEYCLOAK] Token expires in "+Math.round(s/1e3)+" s"),s<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,s)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function w(){var e="0123456789abcdef",t=p(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function _(e){var t=function(e){var t;switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var n,r,i=e.indexOf("?"),s=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=b(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==s&&(n+=e.substring(s))):"fragment"===o.responseMode&&-1!==s&&(n=e.substring(0,s),""!==(r=b(e.substring(s+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams)if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier),t}}function b(e,t){for(var n=e.split("&"),r={paramsString:"",oauthParams:{}},o=0;o<n.length;o++){var i=n[o].indexOf("="),s=n[o].slice(0,i);-1!==t.indexOf(s)?r.oauthParams[s]=n[o].slice(i+1):(""!==r.paramsString&&(r.paramsString+="&"),r.paramsString+=n[o])}return r}function k(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}function O(){var e=k();if(!c.enable)return e.setSuccess(),e.promise;if(c.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");c.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?c.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):c.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",(function(e){if(e.origin===c.iframeOrigin&&c.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=c.callbackList.splice(0,c.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function E(){c.enable&&o.token&&setTimeout((function(){S().then((function(e){e&&E()}))}),1e3*c.interval)}function S(){var e=k();if(c.iframe&&c.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");c.callbackList.push(e);var n=c.iframeOrigin;1==c.callbackList.length&&c.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function T(){var e=k();if(c.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(r){t.contentWindow===r.source&&("supported"!==r.data&&"unsupported"!==r.data||("unsupported"===r.data&&(h("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),c.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess()))};window.addEventListener("message",n,!1)}else e.setSuccess();return function(e,t,n){var r=null,o=new Promise((function(e,n){r=setTimeout((function(){n({error:"Timeout when waiting for 3rd party check iframe message."})}),t)}));return Promise.race([e,o]).finally((function(){clearTimeout(r)}))}(e.promise,o.messageReceiveTimeout)}function R(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),k().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));const n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected)window.location.href=r.url;else{if(!r.ok)throw new Error("Logout failed, request returned an error code.");window.location.reload()}},register:function(e){return window.location.assign(o.createRegisterUrl(e)),k().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,k().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){c.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,n){return t[n]=e.cordovaOptions[n],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,n){return t.push(n+"="+e[n]),t}),[]).join(",")}(t)},i=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=k(),s=r(e),a=o.createLoginUrl(e),c=n(a,"_blank",s),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(m(_(e.url),t),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(i())?(m(_(e.url),t),d(),u=!0):(t.setError(),d()))})),c.addEventListener("exit",(function(e){l||t.setError({reason:"closed_by_user"})})),t.promise},logout:function(e){var t,r=k(),s=o.createLogoutUrl(e),a=n(s,"_blank","location=no,hidden=yes,clearcache=yes");return a.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&a.close()})),a.addEventListener("loaderror",(function(e){0==e.url.indexOf(i())||(t=!0),a.close()})),a.addEventListener("exit",(function(e){t?r.setError():(o.clearToken(),r.setSuccess())})),r.promise},register:function(e){var t=k(),s=o.createRegisterUrl(),a=r(e),c=n(s,"_blank",a);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(c.close(),m(_(e.url),t))})),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var t=n(e,"_blank","location=no");t.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&t.close()}))},redirectUri:function(e){return i()}}}if("cordova-native"==e)return c.enable=!1,{login:function(e){var t=k(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=k(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=k(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new A}catch(e){}return new P}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?R(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?R("cordova"):R(),r){if(void 0!==r.useNonce&&(d=r.useNonce),void 0!==r.checkLoginIframe&&(c.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(c.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode){if("query"!==r.responseMode&&"fragment"!==r.responseMode)throw"Invalid value for responseMode";o.responseMode=r.responseMode}if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var i=k(),s=k();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),i.setSuccess(o.authenticated)})).catch((function(e){i.setError(e)}));var a=function(t){var n,r=k();function i(e){o.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return g()+"/protocol/openid-connect/auth"},token:function(){return g()+"/protocol/openid-connect/token"},logout:function(){return g()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=g()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=g()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return g()+"/protocol/openid-connect/registrations"},userinfo:function(){return g()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(n=e):n="keycloak.json",n)(c=new XMLHttpRequest).open("GET",n,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||y(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),r.setSuccess()}else r.setError()},c.send();else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;"string"==typeof s?(a="/"==s.charAt(s.length-1)?s+".well-known/openid-configuration":s+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||y(c)?(i(JSON.parse(c.responseText)),r.setSuccess()):r.setError())},c.send()):(i(s),r.setSuccess())}else{if(!e.url)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++)if(u[l].src.match(/.*keycloak\.js/)){e.url=u[l].src.substr(0,u[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,i(null),r.setSuccess()}}return r.promise}();function u(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then((function(){s.setSuccess()})).catch((function(e){s.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":c.enable?O().then((function(){S().then((function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){s.setError(e)}))})):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function l(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return O().then((function(){m(e,s)})).catch((function(e){s.setError(e)}));r?r.token&&r.refreshToken?(v(r.token,r.refreshToken,r.idToken),c.enable?O().then((function(){S().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),E()):s.setSuccess()})).catch((function(e){s.setError(e)}))})):o.updateToken(-1).then((function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()})).catch((function(e){o.onAuthError&&o.onAuthError(),r.onLoad?u():s.setError(e)}))):r.onLoad?u():s.setSuccess():s.setSuccess()}return a.then((function(){(function(){var e=k(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(T).then(l).catch((function(e){i.setError(e)}))})),a.catch((function(e){i.setError(e)})),i.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,s=w(),a=w(),c=t.redirectUri(e),u={state:s,nonce:a,redirectUri:encodeURIComponent(c)};e&&e.prompt&&(u.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var l=e&&e.scope||o.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var f,h=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(c)+"&state="+encodeURIComponent(s)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(d&&(h=h+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(h+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(h+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(h+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(h+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(h+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(h+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var g=(f={id_token:{acr:e.acr}},JSON.stringify(f));h+="&claims="+encodeURIComponent(g)}if((e&&e.acrValues||o.acrValues)&&(h+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var m=p(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");u.pkceCodeVerifier=m,h+="&code_challenge="+function(e,t){if("S256"!==e)throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return function(e){const t=String.fromCodePoint(...e);return btoa(t)}(new Uint8Array(r.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,m),h+="&code_challenge_method="+o.pkceMethod}return n.add(u),h},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=g(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=g()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=k();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=k();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return f("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=k();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,f("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(n=!0,f("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,i=o.endpoints.token();if(a.push(t),1==a.length){var s=new XMLHttpRequest;s.open("POST",i,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(o.clientId);var c=(new Date).getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){f("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);v(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=a.pop();null!=t;t=a.pop())t.setSuccess(!0)}else for(h("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError(),t=a.pop();null!=t;t=a.pop())t.setError(!0)},s.send(r)}}else t.setSuccess(!1)};return c.enable?S().then((function(){n()})).catch((function(e){t.setError(e)})):n(),t.promise},o.clearToken=function(){o.token&&(v(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var A=function(){if(!(this instanceof A))return new A;function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var r=localStorage.getItem(n);if(r)try{var o=JSON.parse(r).expires;(!o||o<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,r=localStorage.getItem(n);return r&&(localStorage.removeItem(n),r=JSON.parse(r)),e(),r}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},P=function(){if(!(this instanceof P))return new P;var e=this;e.get=function(e){if(e){var o=n("kc-callback-"+e);return r("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){r("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){r(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},r=function(e,t,n){var r=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=r}};function I(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.amdO={},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.OHBIFactory=e.Client=e.BaseTokenManager=void 0;const t=n(335);Object.defineProperty(e,"BaseTokenManager",{enumerable:!0,get:function(){return t.BaseTokenManager}});const o=n(643);Object.defineProperty(e,"Client",{enumerable:!0,get:function(){return o.Client}});const i=n(972);e.OHBIFactory={newOHBI:i.newOHBI,newCClient:i.newCClient}})(),r})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OHBI=t():e.OHBI=t()}(this,(()=>(()=>{var e={501:function(e,t,n){var r;e=n.nmd(e),function(o){var i=(e&&e.exports,"object"==typeof n.g&&n.g);i.global!==i&&i.window;var s=function(e){this.message=e};(s.prototype=new Error).name="InvalidCharacterError";var a=function(e){throw new s(e)},c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=/[\t\n\f\r ]/g,l={encode:function(e){e=String(e),/[^\0-\xFF]/.test(e)&&a("The string to be encoded contains characters outside of the Latin1 range.");for(var t,n,r,o,i=e.length%3,s="",u=-1,l=e.length-i;++u<l;)t=e.charCodeAt(u)<<16,n=e.charCodeAt(++u)<<8,r=e.charCodeAt(++u),s+=c.charAt((o=t+n+r)>>18&63)+c.charAt(o>>12&63)+c.charAt(o>>6&63)+c.charAt(63&o);return 2==i?(t=e.charCodeAt(u)<<8,n=e.charCodeAt(++u),s+=c.charAt((o=t+n)>>10)+c.charAt(o>>4&63)+c.charAt(o<<2&63)+"="):1==i&&(o=e.charCodeAt(u),s+=c.charAt(o>>2)+c.charAt(o<<4&63)+"=="),s},decode:function(e){var t=(e=String(e).replace(u,"")).length;t%4==0&&(t=(e=e.replace(/==?$/,"")).length),(t%4==1||/[^+a-zA-Z0-9/]/.test(e))&&a("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,o=0,i="",s=-1;++s<t;)r=c.indexOf(e.charAt(s)),n=o%4?64*n+r:r,o++%4&&(i+=String.fromCharCode(255&n>>(-2*o&6)));return i},version:"1.0.0"};void 0===(r=function(){return l}.call(t,n,t,e))||(e.exports=r)}()},23:(e,t,n)=>{var r;!function(){"use strict";var t="input is invalid type",o="object"==typeof window,i=o?window:{};i.JS_SHA256_NO_WINDOW&&(o=!1);var s=!o&&"object"==typeof self,a=!i.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;a?i=n.g:s&&(i=self);var c=!i.JS_SHA256_NO_COMMON_JS&&e.exports,u=n.amdO,l=!i.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),f=[-2147483648,8388608,32768,128],h=[24,16,8,0],p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],g=["hex","array","digest","arrayBuffer"],m=[];!i.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var y=function(e,t){return function(n){return new k(t,!0).update(n)[e]()}},v=function(e){var t=y("hex",e);a&&(t=w(t,e)),t.create=function(){return new k(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<g.length;++n){var r=g[n];t[r]=y(r,e)}return t},w=function(e,r){var o,s=n(127),a=n(371).Buffer,c=r?"sha224":"sha256";return o=a.from&&!i.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(n){if("string"==typeof n)return s.createHash(c).update(n,"utf8").digest("hex");if(null==n)throw new Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===a?s.createHash(c).update(o(n)).digest("hex"):e(n)}},_=function(e,t){return function(n,r){return new O(n,t,!0).update(r)[e]()}},b=function(e){var t=_("hex",e);t.create=function(t){return new O(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<g.length;++n){var r=g[n];t[r]=_(r,e)}return t};function k(e,t){t?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function O(e,n,r){var o,i=typeof e;if("string"===i){var s,a=[],c=e.length,u=0;for(o=0;o<c;++o)(s=e.charCodeAt(o))<128?a[u++]=s:s<2048?(a[u++]=192|s>>>6,a[u++]=128|63&s):s<55296||s>=57344?(a[u++]=224|s>>>12,a[u++]=128|s>>>6&63,a[u++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),a[u++]=240|s>>>18,a[u++]=128|s>>>12&63,a[u++]=128|s>>>6&63,a[u++]=128|63&s);e=a}else{if("object"!==i)throw new Error(t);if(null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t)}e.length>64&&(e=new k(n,!0).update(e).array());var d=[],f=[];for(o=0;o<64;++o){var h=e[o]||0;d[o]=92^h,f[o]=54^h}k.call(this,n,r),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}k.prototype.update=function(e){if(!this.finalized){var n,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(t);if(null===e)throw new Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(t);n=!0}for(var o,i,s=0,a=e.length,c=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),n)for(i=this.start;s<a&&i<64;++s)c[i>>>2]|=e[s]<<h[3&i++];else for(i=this.start;s<a&&i<64;++s)(o=e.charCodeAt(s))<128?c[i>>>2]|=o<<h[3&i++]:o<2048?(c[i>>>2]|=(192|o>>>6)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]):o<55296||o>=57344?(c[i>>>2]|=(224|o>>>12)<<h[3&i++],c[i>>>2]|=(128|o>>>6&63)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),c[i>>>2]|=(240|o>>>18)<<h[3&i++],c[i>>>2]|=(128|o>>>12&63)<<h[3&i++],c[i>>>2]|=(128|o>>>6&63)<<h[3&i++],c[i>>>2]|=(128|63&o)<<h[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=c[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},k.prototype.hash=function(){var e,t,n,r,o,i,s,a,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,g=this.h5,m=this.h6,y=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((o=v[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,n=((o=v[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,v[e]=v[e-16]+t+v[e-7]+n<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,y=(o=v[0]-1413257819)-150054599<<0,f=o+24177077<<0):(i=704751109,y=(o=v[0]-210244248)-1521486534<<0,f=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),r=(i=u&l)^u&d^c,y=f+(o=y+(n=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&g^~h&m)+p[e]+v[e])<<0,f=o+(t+r)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(s=f&u)^f&l^i,m=d+(o=m+(n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&h^~y&g)+p[e+1]+v[e+1])<<0,t=((d=o+(t+r)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(a=d&f)^d&u^s,g=l+(o=g+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&y^~m&h)+p[e+2]+v[e+2])<<0,t=((l=o+(t+r)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&d)^l&f^a,h=u+(o=h+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&m^~g&y)+p[e+3]+v[e+3])<<0,u=o+(t+r)<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+d<<0,this.h3=this.h3+f<<0,this.h4=this.h4+h<<0,this.h5=this.h5+g<<0,this.h6=this.h6+m<<0,this.h7=this.h7+y<<0},k.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=d[e>>>28&15]+d[e>>>24&15]+d[e>>>20&15]+d[e>>>16&15]+d[e>>>12&15]+d[e>>>8&15]+d[e>>>4&15]+d[15&e]+d[t>>>28&15]+d[t>>>24&15]+d[t>>>20&15]+d[t>>>16&15]+d[t>>>12&15]+d[t>>>8&15]+d[t>>>4&15]+d[15&t]+d[n>>>28&15]+d[n>>>24&15]+d[n>>>20&15]+d[n>>>16&15]+d[n>>>12&15]+d[n>>>8&15]+d[n>>>4&15]+d[15&n]+d[r>>>28&15]+d[r>>>24&15]+d[r>>>20&15]+d[r>>>16&15]+d[r>>>12&15]+d[r>>>8&15]+d[r>>>4&15]+d[15&r]+d[o>>>28&15]+d[o>>>24&15]+d[o>>>20&15]+d[o>>>16&15]+d[o>>>12&15]+d[o>>>8&15]+d[o>>>4&15]+d[15&o]+d[i>>>28&15]+d[i>>>24&15]+d[i>>>20&15]+d[i>>>16&15]+d[i>>>12&15]+d[i>>>8&15]+d[i>>>4&15]+d[15&i]+d[s>>>28&15]+d[s>>>24&15]+d[s>>>20&15]+d[s>>>16&15]+d[s>>>12&15]+d[s>>>8&15]+d[s>>>4&15]+d[15&s];return this.is224||(c+=d[a>>>28&15]+d[a>>>24&15]+d[a>>>20&15]+d[a>>>16&15]+d[a>>>12&15]+d[a>>>8&15]+d[a>>>4&15]+d[15&a]),c},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},O.prototype=new k,O.prototype.finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();k.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),k.prototype.finalize.call(this)}};var E=v();E.sha256=E,E.sha224=v(!0),E.sha256.hmac=b(),E.sha224.hmac=b(!0),c?e.exports=E:(i.sha256=E.sha256,i.sha224=E.sha224,u&&(void 0===(r=function(){return E}.call(E,n,E,e))||(e.exports=r)))}()},245:(e,t,n)=>{"use strict";function r(e){this.message=e}n.r(t),n.d(t,{InvalidTokenError:()=>s,default:()=>a}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,i=0,s=0,a="";o=t.charAt(s++);~o&&(n=i%4?64*n+o:o,i++%4)?a+=String.fromCharCode(255&n>>(-2*i&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};function i(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(o(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return o(t)}}function s(e){this.message=e}s.prototype=new Error,s.prototype.name="InvalidTokenError";const a=function(e,t){if("string"!=typeof e)throw new s("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(i(e.split(".")[n]))}catch(e){throw new s("Invalid token specified: "+e.message)}}},645:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(949),t)},949:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.API_URLS=void 0;const r=n(333);t.API_URLS={VALIDATE_TOKEN:r.API_DOMAIN+"/health_check",GET_REPORTS:r.API_DOMAIN+"/reports/list",GET_SUBSCRIBER_REPORTS:r.API_DOMAIN+"/reports/shared-list",GET_TEMPLATE_REPORTS:r.API_DOMAIN+"/reports/list-template",GET_SHARED_REPORT:r.API_DOMAIN+"/reports/shared",GET_OWN_REPORT:r.API_DOMAIN+"/reports",GET_APP:r.API_DOMAIN+"/apps",GET_REPORT_CONFIG:r.API_REPORT_DOMAIN+"/getembedinfo",BUSINESS_GET_TOKEN:r.API_DOMAIN+"/organizations/access-token",BUSINESS_GET_REPORTS:r.API_DOMAIN+"/organizations/reports",BUSINESS_GET_REPORT_ACCESS_TOKEN:r.API_DOMAIN+"/organizations/report-token",GET_RPT:`${r.API_DOMAIN}/rpt`}},647:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(645),t)},716:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.newCClient=void 0;const o=n(108);t.newCClient=function(e){return r(this,void 0,void 0,(function*(){const t=new o.CClient(e);return yield t.checkCredential(),t}))}},640:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.newOHBI=void 0;const o=n(108),i=n(698);t.newOHBI=function(e){return r(this,void 0,void 0,(function*(){const t=new i.InternalTokenManager(e);return yield t.initialize(),new o.Client(t)}))}},972:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(640),t),o(n(716),t)},543:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CClient=void 0;const i=n(333),s=n(650),a=o(n(245)),c=n(501);t.CClient=class{constructor(e){this.credential=e,this.accessToken=""}getCredential(){return this.credential}checkCredential(){return r(this,void 0,void 0,(function*(){yield this.ensureAccessTokenValid()}))}getReports(){return r(this,void 0,void 0,(function*(){try{return yield this.ensureAccessTokenValid(),yield s.CClientService.getReports(this.accessToken)}catch(e){return yield this.getAccessToken(),s.CClientService.getReports(this.accessToken)}}))}getReportEmbbed(e,t){return r(this,void 0,void 0,(function*(){try{yield this.ensureAccessTokenValid();const n=yield s.CClientService.getReportAccessToken(this.accessToken,t),r=(0,c.encode)((0,c.encode)(e.toString()));return`${i.ORG_REPORT_DOMAIN}/${r}?token=${n.data.accessToken}`}catch(n){return yield this.getAccessToken(),this.getReportEmbbed(e,t)}}))}ensureAccessTokenValid(){return r(this,void 0,void 0,(function*(){try{const e=(0,a.default)(this.accessToken);(new Date).getTime()/1e3>e.exp-60&&(yield this.getAccessToken())}catch(e){yield this.getAccessToken()}}))}getAccessToken(){return r(this,void 0,void 0,(function*(){this.accessToken=yield s.CClientService.getAccessToken(this.credential)}))}}},643:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Client=void 0;const i=n(650),s=o(n(501)),a=n(333);t.Client=class{constructor(e){this.tokenManager=e}getTokenManager(){return this.tokenManager}setTokenManager(e){this.tokenManager=e}getReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getSubscriberReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getSubscriberReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getTemplateReports(e=1,t=""){return r(this,void 0,void 0,(function*(){try{const n={page:e,params:{searchText:t}},r=yield this.tokenManager.getToken();return yield i.ClientService.getTemplateReports(r,n)}catch(e){return console.log("getReports",e),[]}}))}getReport(e,t=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.tokenManager.getToken();return yield i.ClientService.getReport(n,e,t)}catch(e){return null}}))}loadReport(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{if(!e||!t)return;const r=yield this.tokenManager.getToken(),o=document.getElementById(t);if(!o)return;const i=s.default.encode(s.default.encode(`${e}`)),c=document.createElement("iframe");return c.src=a.REPORT_DOMAIN+`/${i}?token=${r}&isOwn=${n}`,c.allowFullscreen=!0,o.innerHTML="",o.appendChild(c),c}catch(e){console.log(e)}}))}loadApp(e,t,n=!1){return r(this,void 0,void 0,(function*(){try{if(!e||!t)return;const r=document.getElementById(t);if(!r)return;const o=yield this.tokenManager.getToken(),i=s.default.encode(s.default.encode(`${e}`)),c=document.createElement("iframe");return c.src=a.APP_DOMAIN+`/${i}?token=${o}&isOwn=${n}`,c.allowFullscreen=!0,r.innerHTML="",r.appendChild(c),c}catch(e){console.log(e)}}))}getApp(e,t=!1){return r(this,void 0,void 0,(function*(){try{const n=yield this.tokenManager.getToken();return yield i.ClientService.getApp(n,e,t)}catch(e){return console.log(e),null}}))}getApps(e=1,t="",n=!1){return r(this,void 0,void 0,(function*(){try{const r=yield this.tokenManager.getToken(),o={page:e,params:{searchText:t}},s=n?i.ClientService.getAppsOwner:i.ClientService.getAppsSubscribes;return yield s(r,o)}catch(e){return console.log(e),[]}}))}}},108:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(643),t),o(n(543),t),o(n(698),t)},335:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTokenManager=void 0;const i=o(n(245)),s=n(650),a=n(333);t.BaseTokenManager=class{constructor(e,t,n,r="",o=30){this.realm=e,this.accessToken=t,this.refreshToken=n,this.idToken=r,this.expirationBuffer=o,this.requestingPartyToken="",this.tokenDecode=null,this.handleAfterRefreshToken=null,this.lock={fetchRequestingPartyToken:null}}setHandleAfterRefreshToken(e){this.handleAfterRefreshToken=e}tokenParsed(){return this.tokenDecode||(this.tokenDecode=(0,i.default)(this.requestingPartyToken)),this.tokenDecode}getPermissions(){return this.tokenParsed().authorization.permissions}getToken(){return this.getRequestingPartytoken()}logout(){return this.handleRefreshTokenExpired()}createLogoutUrl(e){return`${a.SSO_DOMAIN}/realms/${this.realm}/protocol/openid-connect/logout?post_logout_redirect_uri=${encodeURIComponent(e)}&id_token_hint=${this.idToken}&client_id=${a.LOGIN_CLIEN_ID}`}getAccessToken(){return r(this,void 0,void 0,(function*(){return this.isTokenCloseToExprie(this.accessToken)&&(yield this.fetchAccessToken()),this.accessToken}))}fetchAccessToken(){return r(this,void 0,void 0,(function*(){try{const e=yield s.CClientService.refreshToken(this.realm,this.refreshToken);this.accessToken=e.access_token}catch(e){this.handleError(e,"refreshing token"),this.handleRefreshTokenExpired()}}))}getRequestingPartytoken(){return r(this,void 0,void 0,(function*(){return this.requestingPartyToken&&!this.isTokenCloseToExprie(this.requestingPartyToken)||(yield this.fetchRequestingPartyToken()),this.requestingPartyToken}))}fetchRequestingPartyToken(){return r(this,void 0,void 0,(function*(){this.lock.fetchRequestingPartyToken||(this.lock.fetchRequestingPartyToken=this.fetchRequestingPartyTokenAction()),yield this.lock.fetchRequestingPartyToken,this.lock.fetchRequestingPartyToken=null}))}fetchRequestingPartyTokenAction(){return r(this,void 0,void 0,(function*(){const e=yield this.getAccessToken(),t=yield s.CClientService.getRequestingPartyToken(this.realm,e);this.requestingPartyToken=t.access_token,this.tokenDecode=null,this.handleAfterRefreshToken&&this.handleAfterRefreshToken(this.tokenParsed())}))}isTokenCloseToExprie(e){try{const t=(0,i.default)(e);return(null==t?void 0:t.exp)&&t.exp-this.expirationBuffer<(new Date).getTime()/1e3}catch(e){return this.handleError(e,"parsing token"),!0}}handleError(e,t){console.log(`Error while ${t}`,e)}}},698:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(335),t),o(n(948),t)},948:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InternalTokenManager=void 0;const i=n(333),s=o(n(287)),a=n(335);class c extends a.BaseTokenManager{constructor(e){super(e,"",""),this.isUseKeycloak=!1,this.keycloak=new s.default({realm:e,url:i.SSO_DOMAIN,clientId:i.LOGIN_CLIEN_ID})}initialize(){return r(this,void 0,void 0,(function*(){let e=localStorage.getItem(i.ID_TOKEN_COOKIE_KEY)||"",t=localStorage.getItem(i.TOKEN_COOKIE_KEY)||"",n=localStorage.getItem(i.REFRESH_TOKEN_COOKIE_KEY)||"";t&&n||(yield this.keycloak.init({onLoad:"login-required"}),this.isUseKeycloak=!0,t=this.keycloak.token,n=this.keycloak.refreshToken,e=this.keycloak.idToken,localStorage.setItem(i.ID_TOKEN_COOKIE_KEY,e),localStorage.setItem(i.TOKEN_COOKIE_KEY,t),localStorage.setItem(i.REFRESH_TOKEN_COOKIE_KEY,n)),this.accessToken=t,this.refreshToken=n,this.idToken=e}))}logout(){localStorage.clear();const e=this.createLogoutUrl(window.location.origin);window.location.href=e}handleRefreshTokenExpired(){localStorage.removeItem(i.ID_TOKEN_COOKIE_KEY),localStorage.removeItem(i.TOKEN_COOKIE_KEY),localStorage.removeItem(i.REFRESH_TOKEN_COOKIE_KEY),this.isUseKeycloak?this.keycloak.logout():this.keycloak.init({onLoad:"login-required"})}}t.InternalTokenManager=c},333:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ID_TOKEN_COOKIE_KEY=t.REFRESH_TOKEN_COOKIE_KEY=t.TOKEN_COOKIE_KEY=t.ORG_REPORT_DOMAIN=t.REPORT_DOMAIN=t.APP_DOMAIN=t.SERVER_CLIENT_ID=t.LOGIN_CLIEN_ID=t.SSO_DOMAIN=t.API_REPORT_DOMAIN=t.REPORT_FE_DOMAIN=t.API_DOMAIN=void 0,t.API_DOMAIN="https://api.onhandbi.com/v1",t.REPORT_FE_DOMAIN="https://report.onhandbi.com",t.API_REPORT_DOMAIN="https://api.onhandbi.com/report",t.SSO_DOMAIN="https://sso.onhandbi.com",t.LOGIN_CLIEN_ID="security-admin-console-dev",t.SERVER_CLIENT_ID="ohbi-admin-server",t.APP_DOMAIN=`${t.REPORT_FE_DOMAIN}/app`,t.REPORT_DOMAIN=`${t.REPORT_FE_DOMAIN}/report`,t.ORG_REPORT_DOMAIN=`${t.REPORT_FE_DOMAIN}/org/report`,t.TOKEN_COOKIE_KEY="_tk_landing_",t.REFRESH_TOKEN_COOKIE_KEY="_rf_tk_landing_",t.ID_TOKEN_COOKIE_KEY="_id_tk_landing_"},761:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ajaxHelpers=void 0;const o=r(n(218));t.ajaxHelpers={get:(e,t,n)=>o.default.get(e,Object.assign({params:t},n)),post:(e,t,n)=>o.default.post(e,t,n),put:(e,t,n)=>o.default.put(e,t,n),delete:(e,t,n)=>o.default.delete(e,n)}},829:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(761),t),o(n(111),t),o(n(565),t)},111:(e,t)=>{"use strict";function n(e){return e?{Authorization:`Bearer ${e}`,"Access-Control-Allow-Origin":"*"}:{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestOptions=t.getAuthHeaders=void 0,t.getAuthHeaders=n,t.getRequestOptions=function(e,t=!0){const r={};return r.headers=e&&t?n(e):{},r}},565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleResponse=void 0,t.handleResponse=function(e){return e.then((e=>e.data)).catch((e=>{var t;return 401===(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)&&console.log(e),Promise.reject(e)}))}},499:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.CClientService=void 0;const o=n(647),i=n(333),s=n(829),a=n(299);t.CClientService=class{static getAccessToken(e){return r(this,void 0,void 0,(function*(){const t=new URLSearchParams;return t.append("client_id",e.clientId),t.append("client_token",e.clientToken),(yield(0,s.handleResponse)(s.ajaxHelpers.post(o.API_URLS.BUSINESS_GET_TOKEN,t,{}))).data.accessToken}))}static getReports(e){const t=(0,s.getRequestOptions)(e);return(0,s.handleResponse)(s.ajaxHelpers.get(o.API_URLS.BUSINESS_GET_REPORTS,{},t))}static getReportAccessToken(e,t){const n=(0,s.getRequestOptions)(e);return(0,s.handleResponse)(s.ajaxHelpers.post(o.API_URLS.BUSINESS_GET_REPORT_ACCESS_TOKEN,{email:t},n))}static getRequestingPartyToken(e,t){const n=(0,s.getRequestOptions)(t),r=(0,a.createRequestingPartyTokenUrl)(e);return n.headers["Content-Type"]="application/x-www-form-urlencoded",(0,s.handleResponse)(s.ajaxHelpers.post(r,{grant_type:"urn:ietf:params:oauth:grant-type:uma-ticket",audience:i.SERVER_CLIENT_ID},n))}static refreshToken(e,t){const n=(0,s.getRequestOptions)(t,!1),r=(0,a.createTokenUrl)(e);return n.headers["Content-Type"]="application/x-www-form-urlencoded",(0,s.handleResponse)(s.ajaxHelpers.post(r,{grant_type:"refresh_token",client_id:i.LOGIN_CLIEN_ID,refresh_token:t},n))}}},539:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientService=void 0;const o=n(647),i=n(829);t.ClientService=class{static validateToken(e){return r(this,void 0,void 0,(function*(){const t=(0,i.getRequestOptions)(e);return yield i.ajaxHelpers.get(o.API_URLS.VALIDATE_TOKEN,{},t)}))}static getReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_REPORTS,Object.assign({page:r},s),n))}))}static getSubscriberReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_SUBSCRIBER_REPORTS,Object.assign({page:r},s),n))}))}static getTemplateReports(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_TEMPLATE_REPORTS,Object.assign({page:r},s),n))}))}static getAppsOwner(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_APP,Object.assign({page:r},s),n))}))}static getAppsSubscribes(e,t={}){return r(this,void 0,void 0,(function*(){const n=(0,i.getRequestOptions)(e),{page:r,params:s}=t;return yield(0,i.handleResponse)(i.ajaxHelpers.get(o.API_URLS.GET_APP+"/subscribes",Object.assign({page:r},s),n))}))}static getReport(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=(0,i.getRequestOptions)(e),s=n?o.API_URLS.GET_OWN_REPORT:o.API_URLS.GET_SHARED_REPORT;return yield(0,i.handleResponse)(i.ajaxHelpers.get(s+`/${t}`,{},r))}))}static getApp(e,t,n=!1){return r(this,void 0,void 0,(function*(){const r=(0,i.getRequestOptions)(e),s=n?o.API_URLS.GET_APP+`/${t}`:o.API_URLS.GET_APP+`/${t}/view`;return yield(0,i.handleResponse)(i.ajaxHelpers.get(s,{},r))}))}}},650:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(539),t),o(n(499),t)},299:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRequestingPartyTokenUrl=t.createTokenUrl=void 0;const r=n(333);t.createTokenUrl=e=>`${r.SSO_DOMAIN}/realms/${e}/protocol/openid-connect/token`,t.createRequestingPartyTokenUrl=e=>`${r.API_DOMAIN}/realms/${e}/protocol/openid-connect/token`},371:()=>{},127:()=>{},218:(e,t,n)=>{"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,s=(a=Object.create(null),e=>{const t=o.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,d=u("undefined"),f=c("ArrayBuffer"),h=u("string"),p=u("function"),g=u("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=c("Date"),w=c("File"),_=c("Blob"),b=c("FileList"),k=c("URLSearchParams");function O(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function E(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,S=e=>!d(e)&&e!==T,R=(A="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>A&&e instanceof A);var A;const P=c("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),C=c("RegExp"),x=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};O(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",N="0123456789",j={DIGIT:N,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+N},M=c("AsyncFunction");var L={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:d,isDate:v,isFile:w,isBlob:_,isRegExp:C,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:k,isTypedArray:R,isFileList:b,forEach:O,merge:function e(){const{caseless:t}=S(this)&&this||{},n={},r=(r,o)=>{const i=t&&E(n,o)||o;y(n[i])&&y(r)?n[i]=e(n[i],r):y(r)?n[i]=e({},r):l(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&O(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:o}={})=>(O(t,((t,o)=>{n&&p(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:P,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:x,freezeMethods:e=>{x(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:T,isContextDefined:S,ALPHABET:j,generateString:(e=16,t=j.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return O(e,((e,t)=>{const i=n(e,r+1);!d(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:M,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch)};function D(e,t,n,r,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),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}L.inherits(D,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:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=D.prototype,F={};function q(e){return L.isPlainObject(e)||L.isArray(e)}function K(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function H(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["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=>{F[e]={value:e}})),Object.defineProperties(D,F),Object.defineProperty(B,"isAxiosError",{value:!0}),D.from=(e,t,n,r,o,i)=>{const s=Object.create(B);return L.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),D.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const z=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!a&&L.isBlob(e))throw new D("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(q)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(a=L.toArray(e)))return n=K(n),a.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===s?H([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!q(e)||(t.append(H(o,n,i),c(e)),!1)}const l=[],d=Object.assign(z,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),L.forEach(n,(function(n,i){!0===(!(L.isUndefined(n)||null===n)&&o.call(t,n,L.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function G(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function J(e,t){this._pairs=[],e&&V(e,this,t)}const $=J.prototype;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function W(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let i;if(i=o?o(t,n):L.isURLSearchParams(t)?t.toString():new J(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:J,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ee="undefined"!=typeof window&&"undefined"!=typeof document,te=(ne="undefined"!=typeof navigator&&navigator.product,ee&&["ReactNative","NativeScript","NS"].indexOf(ne)<0);var ne;const re="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var oe={...Object.freeze({__proto__:null,hasBrowserEnv:ee,hasStandardBrowserWebWorkerEnv:re,hasStandardBrowserEnv:te}),...Z};function ie(e){function t(e,n,r,o){let i=e[o++];const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&L.isArray(r)?r.length:i,a?(L.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&L.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&L.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const se={transitional:Q,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=L.isObject(e);if(o&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return r&&r?JSON.stringify(ie(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new oe.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return oe.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(0,JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||se.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw D.from(e,D.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:oe.classes.FormData,Blob:oe.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],(e=>{se.headers[e]={}}));var ae=se;const ce=L.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"]),ue=Symbol("internals");function le(e){return e&&String(e).trim().toLowerCase()}function de(e){return!1===e||null==e?e:L.isArray(e)?e.map(de):String(e)}function fe(e,t,n,r,o){return L.isFunction(r)?r.call(this,t,n):(o&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}class he{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=le(t);if(!o)throw new Error("header name must be a non-empty string");const i=L.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=de(e))}const i=(e,t)=>L.forEach(e,((e,n)=>o(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?i(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&ce[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=le(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=le(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!fe(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=le(e)){const o=L.findKey(n,e);!o||t&&!fe(0,n[o],o,t)||(delete n[o],r=!0)}}return L.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!fe(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,o)=>{const i=L.findKey(n,o);if(i)return t[i]=de(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=de(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ue]=this[ue]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=le(e);t[r]||(function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}}he.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(he.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),L.freezeMethods(he);var pe=he;function ge(e,t){const n=this||ae,r=t||n,o=pe.from(r.headers);let i=r.data;return L.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function me(e){return!(!e||!e.__CANCEL__)}function ye(e,t,n){D.call(this,null==e?"canceled":e,D.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(ye,D,{__CANCEL__:!0});var ve=oe.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];L.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),L.isString(r)&&s.push("path="+r),L.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function we(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var _e=oe.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function be(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,d=0;for(;l!==i;)d+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,c=r(a);n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const ke={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=pe.from(e.headers).normalize();let i,s,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}if(L.isFormData(r))if(oe.hasStandardBrowserEnv||oe.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(s=o.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=we(e.baseURL,e.url);function f(){if(!l)return;const r=pe.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new D("Request failed with status code "+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),W(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new D("Request aborted",D.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new D("Network Error",D.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Q;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new D(t,r.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,l)),l=null},oe.hasStandardBrowserEnv&&(c&&L.isFunction(c)&&(c=c(e)),c||!1!==c&&_e(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&ve.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&L.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",be(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",be(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{l&&(n(!t||t.type?new ye(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const h=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);h&&-1===oe.protocols.indexOf(h)?n(new D("Unsupported protocol "+h+":",D.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};L.forEach(ke,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Oe=e=>`- ${e}`,Ee=e=>L.isFunction(e)||null===e||!1===e;var Te=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Ee(n)&&(r=ke[(t=String(n)).toLowerCase()],void 0===r))throw new D(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new D("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Oe).join("\n"):" "+Oe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Re(e){return Se(e),e.headers=pe.from(e.headers),e.data=ge.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Te(e.adapter||ae.adapter)(e).then((function(t){return Se(e),t.data=ge.call(e,e.transformResponse,t),t.headers=pe.from(t.headers),t}),(function(t){return me(t)||(Se(e),t&&t.response&&(t.response.data=ge.call(e,e.transformResponse,t.response),t.response.headers=pe.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof pe?e.toJSON():e;function Pe(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function o(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!L.isUndefined(t))return r(void 0,t)}function s(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={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:(e,t)=>o(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);L.isUndefined(s)&&i!==a||(n[r]=s)})),n}const Ie={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ie[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ce={};Ie.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new D(r(o," has been removed"+(t?" in "+t:"")),D.ERR_DEPRECATED);return t&&!Ce[o]&&(Ce[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var xe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new D("options must be an object",D.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new D("option "+i+" must be "+n,D.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new D("Unknown option "+i,D.ERR_BAD_OPTION)}},validators:Ie};const Ue=xe.validators;class Ne{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&xe.assertOptions(n,{silentJSONParsing:Ue.transitional(Ue.boolean),forcedJSONParsing:Ue.transitional(Ue.boolean),clarifyTimeoutError:Ue.transitional(Ue.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:xe.assertOptions(r,{encode:Ue.function,serialize:Ue.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&L.merge(o.common,o[t.method]);o&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=pe.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Re.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(d=0;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Re.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return W(we((e=Pe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}L.forEach(["delete","get","head","options"],(function(e){Ne.prototype[e]=function(t,n){return this.request(Pe(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Pe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ne.prototype[e]=t(),Ne.prototype[e+"Form"]=t(!0)}));var je=Ne;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new ye(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}var Le=Me;const De={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(De).forEach((([e,t])=>{De[t]=e}));var Be=De;const Fe=function e(t){const n=new je(t),o=r(je.prototype.request,n);return L.extend(o,je.prototype,n,{allOwnKeys:!0}),L.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Pe(t,n))},o}(ae);Fe.Axios=je,Fe.CanceledError=ye,Fe.CancelToken=Le,Fe.isCancel=me,Fe.VERSION="1.6.2",Fe.toFormData=V,Fe.AxiosError=D,Fe.Cancel=Fe.CanceledError,Fe.all=function(e){return Promise.all(e)},Fe.spread=function(e){return function(t){return e.apply(null,t)}},Fe.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},Fe.mergeConfig=Pe,Fe.AxiosHeaders=pe,Fe.formToJSON=e=>ie(L.isHTMLForm(e)?new FormData(e):e),Fe.getAdapter=Te,Fe.HttpStatusCode=Be,Fe.default=Fe,e.exports=Fe},287:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(23);class o extends Error{}function i(e,t){if("string"!=typeof e)throw new o("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new o(`Invalid token specified: missing part #${n+1}`);let i;try{i=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return atob(t)}}(r)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}if(o.prototype.name="InvalidTokenError","undefined"==typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function s(e){if(!(this instanceof s))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,n,o=this,a=[],c={enable:!0,callbackList:[],interval:5},u=document.getElementsByTagName("script"),l=0;l<u.length;l++)-1===u[l].src.indexOf("keycloak.js")&&-1===u[l].src.indexOf("keycloak.min.js")||-1===u[l].src.indexOf("version=")||(o.iframeVersion=u[l].src.substring(u[l].src.indexOf("version=")+8).split("&")[0]);var d=!0,f=I(console.info),h=I(console.warn);function p(e,t){for(var n=function(e){var t=null,n=window.crypto||window.msCrypto;if(n&&n.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),n.getRandomValues(t),t;t=new Array(e);for(var r=0;r<t.length;r++)t[r]=Math.floor(256*Math.random());return t}(e),r=new Array(e),o=0;o<e;o++)r[o]=t.charCodeAt(n[o]%t.length);return String.fromCharCode.apply(null,r)}function g(){return void 0!==o.authServerUrl?"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm):void 0}function m(e,t){var n=e.code,r=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),r)if("none"!=i){var a={error:r,error_description:e.error_description};o.onAuthError&&o.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=o.flow&&(e.access_token||e.id_token)&&h(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&n){var c="code="+n+"&grant_type=authorization_code",u=o.endpoints.token(),l=new XMLHttpRequest;l.open("POST",u,!0),l.setRequestHeader("Content-type","application/x-www-form-urlencoded"),c+="&client_id="+encodeURIComponent(o.clientId),c+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(c+="&code_verifier="+e.pkceCodeVerifier),l.withCredentials=!0,l.onreadystatechange=function(){if(4==l.readyState)if(200==l.status){var e=JSON.parse(l.responseText);h(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),E()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},l.send(c)}function h(n,r,i,a){v(n,r,i,s=(s+(new Date).getTime())/2),d&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(f("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):a&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function y(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function v(e,t,n,r){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=i(t)):(delete o.refreshToken,delete o.refreshTokenParsed),n?(o.idToken=n,o.idTokenParsed=i(n)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=i(e),o.sessionId=o.tokenParsed.sid,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,r&&(o.timeSkew=Math.floor(r/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(f("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var s=1e3*(o.tokenParsed.exp-(new Date).getTime()/1e3+o.timeSkew);f("[KEYCLOAK] Token expires in "+Math.round(s/1e3)+" s"),s<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,s)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function w(){var e="0123456789abcdef",t=p(36,e).split("");return t[14]="4",t[19]=e.substr(3&t[19]|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function _(e){var t=function(e){var t;switch(o.flow){case"standard":t=["code","state","session_state","kc_action_status","iss"];break;case"implicit":t=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":t=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"]}t.push("error"),t.push("error_description"),t.push("error_uri");var n,r,i=e.indexOf("?"),s=e.indexOf("#");if("query"===o.responseMode&&-1!==i?(n=e.substring(0,i),""!==(r=b(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(n+="?"+r.paramsString),-1!==s&&(n+=e.substring(s))):"fragment"===o.responseMode&&-1!==s&&(n=e.substring(0,s),""!==(r=b(e.substring(s+1),t)).paramsString&&(n+="#"+r.paramsString)),r&&r.oauthParams)if("standard"===o.flow||"hybrid"===o.flow){if((r.oauthParams.code||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}else if("implicit"===o.flow&&(r.oauthParams.access_token||r.oauthParams.error)&&r.oauthParams.state)return r.oauthParams.newUrl=n,r.oauthParams}(e);if(t){var r=n.get(t.state);return r&&(t.valid=!0,t.redirectUri=r.redirectUri,t.storedNonce=r.nonce,t.prompt=r.prompt,t.pkceCodeVerifier=r.pkceCodeVerifier),t}}function b(e,t){for(var n=e.split("&"),r={paramsString:"",oauthParams:{}},o=0;o<n.length;o++){var i=n[o].indexOf("="),s=n[o].slice(0,i);-1!==t.indexOf(s)?r.oauthParams[s]=n[o].slice(i+1):(""!==r.paramsString&&(r.paramsString+="&"),r.paramsString+=n[o])}return r}function k(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}function O(){var e=k();if(!c.enable)return e.setSuccess(),e.promise;if(c.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");c.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?c.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):c.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var n=o.endpoints.checkSessionIframe();return t.setAttribute("src",n),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t),window.addEventListener("message",(function(e){if(e.origin===c.iframeOrigin&&c.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=c.callbackList.splice(0,c.callbackList.length),n=t.length-1;n>=0;--n){var r=t[n];"error"==e.data?r.setError():r.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function E(){c.enable&&o.token&&setTimeout((function(){T().then((function(e){e&&E()}))}),1e3*c.interval)}function T(){var e=k();if(c.iframe&&c.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");c.callbackList.push(e);var n=c.iframeOrigin;1==c.callbackList.length&&c.iframe.contentWindow.postMessage(t,n)}else e.setSuccess();return e.promise}function S(){var e=k();if(c.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var n=function(r){t.contentWindow===r.source&&("supported"!==r.data&&"unsupported"!==r.data||("unsupported"===r.data&&(h("[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\nFor more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers"),c.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",n),e.setSuccess()))};window.addEventListener("message",n,!1)}else e.setSuccess();return function(e,t,n){var r=null,o=new Promise((function(e,n){r=setTimeout((function(){n({error:"Timeout when waiting for 3rd party check iframe message."})}),t)}));return Promise.race([e,o]).finally((function(){clearTimeout(r)}))}(e.promise,o.messageReceiveTimeout)}function R(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),k().promise},logout:async function(e){if("GET"===(e?.logoutMethod??o.logoutMethod))return void window.location.replace(o.createLogoutUrl(e));const n=o.createLogoutUrl(e),r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({id_token_hint:o.idToken,client_id:o.clientId,post_logout_redirect_uri:t.redirectUri(e,!1)})});if(r.redirected)window.location.href=r.url;else{if(!r.ok)throw new Error("Logout failed, request returned an error code.");window.location.reload()}},register:function(e){return window.location.assign(o.createRegisterUrl(e)),k().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,k().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){c.enable=!1;var n=function(e,t,n){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,n):window.open(e,t,n)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,n){return t[n]=e.cordovaOptions[n],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,n){return t.push(n+"="+e[n]),t}),[]).join(",")}(t)},i=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var t=k(),s=r(e),a=o.createLoginUrl(e),c=n(a,"_blank",s),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(m(_(e.url),t),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(i())?(m(_(e.url),t),d(),u=!0):(t.setError(),d()))})),c.addEventListener("exit",(function(e){l||t.setError({reason:"closed_by_user"})})),t.promise},logout:function(e){var t,r=k(),s=o.createLogoutUrl(e),a=n(s,"_blank","location=no,hidden=yes,clearcache=yes");return a.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&a.close()})),a.addEventListener("loaderror",(function(e){0==e.url.indexOf(i())||(t=!0),a.close()})),a.addEventListener("exit",(function(e){t?r.setError():(o.clearToken(),r.setSuccess())})),r.promise},register:function(e){var t=k(),s=o.createRegisterUrl(),a=r(e),c=n(s,"_blank",a);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(c.close(),m(_(e.url),t))})),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var t=n(e,"_blank","location=no");t.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&t.close()}))},redirectUri:function(e){return i()}}}if("cordova-native"==e)return c.enable=!1,{login:function(e){var t=k(),n=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},logout:function(e){var t=k(),n=o.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(n),t.promise},register:function(e){var t=k(),n=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),m(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(n),t.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";window.cordova.plugins.browsertab.openUrl(e)},redirectUri:function(e){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}o.init=function(r){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");if(o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new A}catch(e){}return new P}(),t=r&&["default","cordova","cordova-native"].indexOf(r.adapter)>-1?R(r.adapter):r&&"object"==typeof r.adapter?r.adapter:window.Cordova||window.cordova?R("cordova"):R(),r){if(void 0!==r.useNonce&&(d=r.useNonce),void 0!==r.checkLoginIframe&&(c.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(c.interval=r.checkLoginIframeInterval),"login-required"===r.onLoad&&(o.loginRequired=!0),r.responseMode){if("query"!==r.responseMode&&"fragment"!==r.responseMode)throw"Invalid value for responseMode";o.responseMode=r.responseMode}if(r.flow){switch(r.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=r.flow}if(null!=r.timeSkew&&(o.timeSkew=r.timeSkew),r.redirectUri&&(o.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),"boolean"==typeof r.silentCheckSsoFallback?o.silentCheckSsoFallback=r.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,void 0!==r.pkceMethod){if("S256"!==r.pkceMethod&&!1!==r.pkceMethod)throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);o.pkceMethod=r.pkceMethod}else o.pkceMethod="S256";"boolean"==typeof r.enableLogging?o.enableLogging=r.enableLogging:o.enableLogging=!1,"POST"===r.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","string"==typeof r.scope&&(o.scope=r.scope),"string"==typeof r.acrValues&&(o.acrValues=r.acrValues),"number"==typeof r.messageReceiveTimeout&&r.messageReceiveTimeout>0?o.messageReceiveTimeout=r.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var i=k(),s=k();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),i.setSuccess(o.authenticated)})).catch((function(e){i.setError(e)}));var a=function(t){var n,r=k();function i(e){o.endpoints=e?{authorize:function(){return e.authorization_endpoint},token:function(){return e.token_endpoint},logout:function(){if(!e.end_session_endpoint)throw"Not supported by the OIDC server";return e.end_session_endpoint},checkSessionIframe:function(){if(!e.check_session_iframe)throw"Not supported by the OIDC server";return e.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!e.userinfo_endpoint)throw"Not supported by the OIDC server";return e.userinfo_endpoint}}:{authorize:function(){return g()+"/protocol/openid-connect/auth"},token:function(){return g()+"/protocol/openid-connect/token"},logout:function(){return g()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=g()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=g()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return g()+"/protocol/openid-connect/registrations"},userinfo:function(){return g()+"/protocol/openid-connect/userinfo"}}}if(e?"string"==typeof e&&(n=e):n="keycloak.json",n)(c=new XMLHttpRequest).open("GET",n,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||y(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),r.setSuccess()}else r.setError()},c.send();else{if(!e.clientId)throw"clientId missing";o.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;"string"==typeof s?(a="/"==s.charAt(s.length-1)?s+".well-known/openid-configuration":s+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||y(c)?(i(JSON.parse(c.responseText)),r.setSuccess()):r.setError())},c.send()):(i(s),r.setSuccess())}else{if(!e.url)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++)if(u[l].src.match(/.*keycloak\.js/)){e.url=u[l].src.substr(0,u[l].src.indexOf("/js/keycloak.js"));break}if(!e.realm)throw"realm missing";o.authServerUrl=e.url,o.realm=e.realm,i(null),r.setSuccess()}}return r.promise}();function u(){var e=function(e){e||(n.prompt="none"),r&&r.locale&&(n.locale=r.locale),o.login(n).then((function(){s.setSuccess()})).catch((function(e){s.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-storage-access-by-user-activation allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var n=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(m(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",n))};window.addEventListener("message",n)},n={};switch(r.onLoad){case"check-sso":c.enable?O().then((function(){T().then((function(n){n?s.setSuccess():o.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){s.setError(e)}))})):o.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function l(){var e=_(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return O().then((function(){m(e,s)})).catch((function(e){s.setError(e)}));r?r.token&&r.refreshToken?(v(r.token,r.refreshToken,r.idToken),c.enable?O().then((function(){T().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),E()):s.setSuccess()})).catch((function(e){s.setError(e)}))})):o.updateToken(-1).then((function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()})).catch((function(e){o.onAuthError&&o.onAuthError(),r.onLoad?u():s.setError(e)}))):r.onLoad?u():s.setSuccess():s.setSuccess()}return a.then((function(){(function(){var e=k(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(S).then(l).catch((function(e){i.setError(e)}))})),a.catch((function(e){i.setError(e)})),i.promise},o.login=function(e){return t.login(e)},o.createLoginUrl=function(e){var i,s=w(),a=w(),c=t.redirectUri(e),u={state:s,nonce:a,redirectUri:encodeURIComponent(c)};e&&e.prompt&&(u.prompt=e.prompt),i=e&&"register"==e.action?o.endpoints.register():o.endpoints.authorize();var l=e&&e.scope||o.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var f,h=i+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(c)+"&state="+encodeURIComponent(s)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(d&&(h=h+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(h+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(h+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(h+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(h+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(h+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(h+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var g=(f={id_token:{acr:e.acr}},JSON.stringify(f));h+="&claims="+encodeURIComponent(g)}if((e&&e.acrValues||o.acrValues)&&(h+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var m=p(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");u.pkceCodeVerifier=m,h+="&code_challenge="+function(e,t){if("S256"!==e)throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${e}'.`);return function(e){const t=String.fromCodePoint(...e);return btoa(t)}(new Uint8Array(r.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}(o.pkceMethod,m),h+="&code_challenge_method="+o.pkceMethod}return n.add(u),h},o.logout=function(e){return t.logout(e)},o.createLogoutUrl=function(e){if("POST"===(e?.logoutMethod??o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},o.register=function(e){return t.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var n=g(),r=void 0;return void 0!==n&&(r=n+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),r},o.accountManagement=function(){return t.accountManagement()},o.hasRealmRole=function(e){var t=o.realmAccess;return!!t&&t.roles.indexOf(e)>=0},o.hasResourceRole=function(e,t){if(!o.resourceAccess)return!1;var n=o.resourceAccess[t||o.clientId];return!!n&&n.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=g()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=k();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),n.setSuccess(o.profile)):n.setError())},t.send(),n.promise},o.loadUserInfo=function(){var e=o.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var n=k();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),n.setSuccess(o.userInfo)):n.setError())},t.send(),n.promise},o.isTokenExpired=function(e){if(!o.tokenParsed||!o.refreshToken&&"implicit"!=o.flow)throw"Not authenticated";if(null==o.timeSkew)return f("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=o.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+o.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},o.updateToken=function(e){var t=k();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var n=function(){var n=!1;if(-1==e?(n=!0,f("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(n=!0,f("[KEYCLOAK] Refreshing token: token expired")),n){var r="grant_type=refresh_token&refresh_token="+o.refreshToken,i=o.endpoints.token();if(a.push(t),1==a.length){var s=new XMLHttpRequest;s.open("POST",i,!0),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),s.withCredentials=!0,r+="&client_id="+encodeURIComponent(o.clientId);var c=(new Date).getTime();s.onreadystatechange=function(){if(4==s.readyState)if(200==s.status){f("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);v(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=a.pop();null!=t;t=a.pop())t.setSuccess(!0)}else for(h("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError(),t=a.pop();null!=t;t=a.pop())t.setError(!0)},s.send(r)}}else t.setSuccess(!1)};return c.enable?T().then((function(){n()})).catch((function(e){t.setError(e)})):n(),t.promise},o.clearToken=function(){o.token&&(v(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var A=function(){if(!(this instanceof A))return new A;function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var n=localStorage.key(t);if(n&&0==n.indexOf("kc-callback-")){var r=localStorage.getItem(n);if(r)try{var o=JSON.parse(r).expires;(!o||o<e)&&localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}}}localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test"),this.get=function(t){if(t){var n="kc-callback-"+t,r=localStorage.getItem(n);return r&&(localStorage.removeItem(n),r=JSON.parse(r)),e(),r}},this.add=function(t){e();var n="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(n,JSON.stringify(t))}},P=function(){if(!(this instanceof P))return new P;var e=this;e.get=function(e){if(e){var o=n("kc-callback-"+e);return r("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){r("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){r(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},r=function(e,t,n){var r=e+"="+t+"; expires="+n.toUTCString()+"; ";document.cookie=r}};function I(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.amdO={},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.OHBIFactory=e.Client=e.BaseTokenManager=void 0;const t=n(335);Object.defineProperty(e,"BaseTokenManager",{enumerable:!0,get:function(){return t.BaseTokenManager}});const o=n(643);Object.defineProperty(e,"Client",{enumerable:!0,get:function(){return o.Client}});const i=n(972);e.OHBIFactory={newOHBI:i.newOHBI,newCClient:i.newCClient}})(),r})()));
|