Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

keycloak-js

Package Overview
Dependencies
Maintainers
4
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keycloak-js - npm Package Compare versions

Comparing version 22.0.5 to 23.0.0

22

dist/keycloak.d.ts

@@ -179,2 +179,9 @@ /*

/**
* Configures the 'acr_values' query param in compliance with section 3.1.2.1
* of the OIDC 1.0 specification.
* Used to tell Keycloak what level of authentication the user needs.
*/
acrValues?: string;
/**
* Enables logging messages from Keycloak to the console.

@@ -255,2 +262,9 @@ * @default false

/**
* Configures the 'acr_values' query param in compliance with section 3.1.2.1
* of the OIDC 1.0 specification.
* Used to tell Keycloak what level of authentication the user needs.
*/
acrValues?: string;
/**
* Used to tell Keycloak which IDP the user wants to authenticate with.

@@ -454,7 +468,2 @@ */

*/
clientSecret?: string;
/**
* @private Undocumented.
*/
redirectUri?: string;

@@ -586,2 +595,3 @@

* checked.
* @param minValidity If not specified, `5` is used.
* @returns A promise to set functions that can be invoked if the token is

@@ -601,3 +611,3 @@ * still valid, or if the token is no longer valid.

*/
updateToken(minValidity: number): Promise<boolean>;
updateToken(minValidity?: number): Promise<boolean>;

@@ -604,0 +614,0 @@ /**

@@ -1,10 +0,10 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("keycloak",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Keycloak=t()}(this,(function(){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var es6Promise_min={exports:{}};!function(e,t){e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function r(e){F=e}function n(e){K=e}function o(){return function(){return process.nextTick(u)}}function i(){return void 0!==B?function(){B(u)}:c()}function s(){var e=0,t=new q(u),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function a(){var e=new MessageChannel;return e.port1.onmessage=u,function(){return e.port2.postMessage(0)}}function c(){var e=setTimeout;return function(){return e(u,1)}}function u(){for(var e=0;e<N;e+=2)(0,z[e])(z[e+1]),z[e]=void 0,z[e+1]=void 0;N=0}function l(){try{var e=Function("return this")().require("vertx");return B=e.runOnLoop||e.runOnContext,i()}catch(e){return c()}}function d(e,t){var r=this,n=new this.constructor(f);void 0===n[G]&&U(n);var o=r._state;if(o){var i=arguments[o-1];K((function(){return E(o,n,i,r._result)}))}else A(r,n,e,t);return n}function h(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(f);return _(r,e),r}function f(){}function p(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function v(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function k(e,t,r){K((function(e){var n=!1,o=v(r,t,(function(r){n||(n=!0,t!==r?_(e,r):S(e,r))}),(function(t){n||(n=!0,b(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,b(e,o))}),e)}function g(e,t){t._state===Q?S(e,t._result):t._state===Z?b(e,t._result):A(t,void 0,(function(t){return _(e,t)}),(function(t){return b(e,t)}))}function y(e,r,n){r.constructor===e.constructor&&n===d&&r.constructor.resolve===h?g(e,r):void 0===n?S(e,r):t(n)?k(e,r,n):S(e,r)}function _(t,r){if(t===r)b(t,p());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void b(t,e)}y(t,r,n)}else S(t,r)}function w(e){e._onerror&&e._onerror(e._result),R(e)}function S(e,t){e._state===$&&(e._result=t,e._state=Q,0!==e._subscribers.length&&K(R,e))}function b(e,t){e._state===$&&(e._state=Z,e._result=t,K(w,e))}function A(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+Q]=r,o[i+Z]=n,0===i&&e._state&&K(R,e)}function R(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function E(e,r,n,o){var i=t(n),s=void 0,a=void 0,c=!0;if(i){try{s=n(o)}catch(e){c=!1,a=e}if(r===s)return void b(r,m())}else s=o;r._state!==$||(i&&c?_(r,s):!1===c?b(r,a):e===Q?S(r,s):e===Z&&b(r,s))}function H(e,t){try{t((function(t){_(e,t)}),(function(t){b(e,t)}))}catch(t){b(e,t)}}function C(){return ee++}function U(e){e[G]=ee++,e._state=void 0,e._result=void 0,e._subscribers=[]}function T(){return new Error("Array Methods must be provided an Array")}function O(e){return new te(this,e).promise}function I(e){var t=this;return new t(j(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function x(e){var t=new this(f);return b(t,e),t}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function X(){var e=void 0;if(void 0!==commonjsGlobal)e=commonjsGlobal;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=re}var M=void 0;M=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var j=M,N=0,B=void 0,F=void 0,K=function(e,t){z[N]=e,z[N+1]=t,2===(N+=2)&&(F?F(u):V())},J="undefined"!=typeof window?window:void 0,D=J||{},q=D.MutationObserver||D.WebKitMutationObserver,Y="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),W="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,z=new Array(1e3),V=void 0;V=Y?o():q?s():W?a():void 0===J&&"function"==typeof commonjsRequire?l():c();var G=Math.random().toString(36).substring(2),$=void 0,Q=1,Z=2,ee=0,te=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(f),this.promise[G]||U(this.promise),j(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&S(this.promise,this._result))):b(this.promise,T())}return e.prototype._enumerate=function(e){for(var t=0;this._state===$&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===h){var o=void 0,i=void 0,s=!1;try{o=e.then}catch(e){s=!0,i=e}if(o===d&&e._state!==$)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===re){var a=new r(f);s?b(a,i):y(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===$&&(this._remaining--,e===Z?b(n,r):this._result[t]=r),0===this._remaining&&S(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;A(e,void 0,(function(e){return r._settledAt(Q,t,e)}),(function(e){return r._settledAt(Z,t,e)}))},e}(),re=function(){function e(t){this[G]=C(),this._result=this._state=void 0,this._subscribers=[],f!==t&&("function"!=typeof t&&L(),this instanceof e?H(this,t):P())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return re.prototype.then=d,re.all=O,re.race=I,re.resolve=h,re.reject=x,re._setScheduler=r,re._setAsap=n,re._asap=K,re.polyfill=X,re.Promise=re,re}()}(es6Promise_min);var es6Promise_minExports=es6Promise_min.exports,base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function _byteLength(e,t,r){return 3*(t+r)/4-r}function toByteArray(e){var t,r,n=getLens(e),o=n[0],i=n[1],s=new Arr(_byteLength(e,o,i)),a=0,c=i>0?o-4:o;for(r=0;r<c;r+=4)t=revLookup[e.charCodeAt(r)]<<18|revLookup[e.charCodeAt(r+1)]<<12|revLookup[e.charCodeAt(r+2)]<<6|revLookup[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===i&&(t=revLookup[e.charCodeAt(r)]<<2|revLookup[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===i&&(t=revLookup[e.charCodeAt(r)]<<10|revLookup[e.charCodeAt(r+1)]<<4|revLookup[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[63&e]}function encodeChunk(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(tripletToBase64(n));return o.join("")}function fromByteArray(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,a=r-n;s<a;s+=i)o.push(encodeChunk(e,s,s+i>a?a:s+i));return 1===n?(t=e[r-1],o.push(lookup[t>>2]+lookup[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),o.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;var sha256$1={exports:{}};
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("crypto"),require("buffer")):"function"==typeof define&&define.amd?define("keycloak",["crypto","buffer"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Keycloak=t(e.require$$0,e.require$$1)}(this,(function(e,t){"use strict";var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o={exports:{}};!function(e,t){e.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}function n(e){K=e}function o(e){J=e}function i(){return function(){return process.nextTick(l)}}function s(){return void 0!==q?function(){q(l)}:u()}function a(){var e=0,t=new F(l),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function c(){var e=new MessageChannel;return e.port1.onmessage=l,function(){return e.port2.postMessage(0)}}function u(){var e=setTimeout;return function(){return e(l,1)}}function l(){for(var e=0;e<V;e+=2)(0,$[e])($[e+1]),$[e]=void 0,$[e+1]=void 0;V=0}function d(){try{var e=Function("return this")().require("vertx");return q=e.runOnLoop||e.runOnContext,s()}catch(e){return u()}}function f(e,t){var r=this,n=new this.constructor(p);void 0===n[G]&&O(n);var o=r._state;if(o){var i=arguments[o-1];J((function(){return E(o,n,i,r._result)}))}else U(r,n,e,t);return n}function h(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(p);return b(r,e),r}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function g(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function w(e,t,r){J((function(e){var n=!1,o=g(r,t,(function(r){n||(n=!0,t!==r?b(e,r):A(e,r))}),(function(t){n||(n=!0,S(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,S(e,o))}),e)}function k(e,t){t._state===Z?A(e,t._result):t._state===ee?S(e,t._result):U(t,void 0,(function(t){return b(e,t)}),(function(t){return S(e,t)}))}function y(e,r,n){r.constructor===e.constructor&&n===f&&r.constructor.resolve===h?k(e,r):void 0===n?A(e,r):t(n)?w(e,r,n):A(e,r)}function b(t,r){if(t===r)S(t,v());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void S(t,e)}y(t,r,n)}else A(t,r)}function _(e){e._onerror&&e._onerror(e._result),C(e)}function A(e,t){e._state===Q&&(e._result=t,e._state=Z,0!==e._subscribers.length&&J(C,e))}function S(e,t){e._state===Q&&(e._state=ee,e._result=t,J(_,e))}function U(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+Z]=r,o[i+ee]=n,0===i&&e._state&&J(C,e)}function C(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)n=t[s],o=t[s+r],n?E(r,n,o,i):o(i);e._subscribers.length=0}}function E(e,r,n,o){var i=t(n),s=void 0,a=void 0,c=!0;if(i){try{s=n(o)}catch(e){c=!1,a=e}if(r===s)return void S(r,m())}else s=o;r._state!==Q||(i&&c?b(r,s):!1===c?S(r,a):e===Z?A(r,s):e===ee&&S(r,s))}function T(e,t){try{t((function(t){b(e,t)}),(function(t){S(e,t)}))}catch(t){S(e,t)}}function I(){return te++}function O(e){e[G]=te++,e._state=void 0,e._result=void 0,e._subscribers=[]}function R(){return new Error("Array Methods must be provided an Array")}function x(e){return new re(this,e).promise}function L(e){var t=this;return new t(H(e)?function(r,n){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(r,n)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function P(e){var t=new this(p);return S(t,e),t}function M(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function j(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function N(){var e=void 0;if(void 0!==r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=ne}var B=void 0;B=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var H=B,V=0,q=void 0,K=void 0,J=function(e,t){$[V]=e,$[V+1]=t,2===(V+=2)&&(K?K(l):X())},z="undefined"!=typeof window?window:void 0,D=z||{},F=D.MutationObserver||D.WebKitMutationObserver,Y="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),W="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),X=void 0;X=Y?i():F?a():W?c():void 0===z?d():u();var G=Math.random().toString(36).substring(2),Q=void 0,Z=1,ee=2,te=0,re=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(p),this.promise[G]||O(this.promise),H(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&A(this.promise,this._result))):S(this.promise,R())}return e.prototype._enumerate=function(e){for(var t=0;this._state===Q&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===h){var o=void 0,i=void 0,s=!1;try{o=e.then}catch(e){s=!0,i=e}if(o===f&&e._state!==Q)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===ne){var a=new r(p);s?S(a,i):y(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===Q&&(this._remaining--,e===ee?S(n,r):this._result[t]=r),0===this._remaining&&A(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;U(e,void 0,(function(e){return r._settledAt(Z,t,e)}),(function(e){return r._settledAt(ee,t,e)}))},e}(),ne=function(){function e(t){this[G]=I(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&M(),this instanceof e?T(this,t):j())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return ne.prototype.then=f,ne.all=x,ne.race=L,ne.resolve=h,ne.reject=P,ne._setScheduler=n,ne._setAsap=o,ne._asap=J,ne.polyfill=N,ne.Promise=ne,ne}()}(o);for(var i=o.exports,s={byteLength:function(e){var t=f(e),r=t[0],n=t[1];return 3*(r+n)/4-n},toByteArray:function(e){var t,r,n=f(e),o=n[0],i=n[1],s=new u(function(e,t,r){return 3*(t+r)/4-r}(0,o,i)),a=0,l=i>0?o-4:o;for(r=0;r<l;r+=4)t=c[e.charCodeAt(r)]<<18|c[e.charCodeAt(r+1)]<<12|c[e.charCodeAt(r+2)]<<6|c[e.charCodeAt(r+3)],s[a++]=t>>16&255,s[a++]=t>>8&255,s[a++]=255&t;2===i&&(t=c[e.charCodeAt(r)]<<2|c[e.charCodeAt(r+1)]>>4,s[a++]=255&t);1===i&&(t=c[e.charCodeAt(r)]<<10|c[e.charCodeAt(r+1)]<<4|c[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t);return s},fromByteArray:function(e){for(var t,r=e.length,n=r%3,o=[],i=16383,s=0,c=r-n;s<c;s+=i)o.push(h(e,s,s+i>c?c:s+i));1===n?(t=e[r-1],o.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],o.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return o.join("")}},a=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0;d<64;++d)a[d]=l[d],c[l.charCodeAt(d)]=d;function f(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function h(e,t,r){for(var n,o,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(a[(o=n)>>18&63]+a[o>>12&63]+a[o>>6&63]+a[63&o]);return i.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;var p={exports:{}};
/**
* [js-sha256]{@link https://github.com/emn178/js-sha256}
*
* @version 0.9.0
* @version 0.10.1
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @copyright Chen, Yi-Cyuan 2014-2023
* @license MIT
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createOutputMethod(n,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");if(null==e)throw new Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,n){return new HmacSha256(r,t,!0).update(n)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createHmacOutputMethod(n,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):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 HmacSha256(e,t,r){var n,o=typeof e;if("string"===o){var i,s=[],a=e.length,c=0;for(n=0;n<a;++n)(i=e.charCodeAt(n))<128?s[c++]=i:i<2048?(s[c++]=192|i>>6,s[c++]=128|63&i):i<55296||i>=57344?(s[c++]=224|i>>12,s[c++]=128|i>>6&63,s[c++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++n)),s[c++]=240|i>>18,s[c++]=128|i>>12&63,s[c++]=128|i>>6&63,s[c++]=128|63&i);e=s}else{if("object"!==o)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR)}e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],l=[];for(n=0;n<64;++n){var d=e[n]||0;u[n]=92^d,l[n]=54^d}Sha256.call(this,t,r),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===e)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw new Error(ERROR);t=!0}for(var n,o,i=0,s=e.length,a=this.blocks;i<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(o=this.start;i<s&&o<64;++i)a[o>>2]|=e[i]<<SHIFT[3&o++];else for(o=this.start;i<s&&o<64;++i)(n=e.charCodeAt(i))<128?a[o>>2]|=n<<SHIFT[3&o++]:n<2048?(a[o>>2]|=(192|n>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):n<55296||n>=57344?(a[o>>2]|=(224|n>>12)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++i)),a[o>>2]|=(240|n>>18)<<SHIFT[3&o++],a[o>>2]|=(128|n>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|n>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&n)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=a[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[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()}},Sha256.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,u=this.h0,l=this.h1,d=this.h2,h=this.h3,f=this.h4,p=this.h5,m=this.h6,v=this.h7,k=this.blocks;for(e=16;e<64;++e)t=((o=k[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=k[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,k[e]=k[e-16]+t+k[e-7]+r<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=k[0]-1413257819)-150054599<<0,h=o+24177077<<0):(i=704751109,v=(o=k[0]-210244248)-1521486534<<0,h=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&d^c,v=h+(o=v+(r=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&m)+K[e]+k[e])<<0,h=o+(t+n)<<0),t=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&u)^h&l^i,m=d+(o=m+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&f^~v&p)+K[e+1]+k[e+1])<<0,t=((d=o+(t+n)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(a=d&h)^d&u^s,p=l+(o=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&f)+K[e+2]+k[e+2])<<0,t=((l=o+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&d)^l&h^a,f=u+(o=f+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&v)+K[e+3]+k[e+3])<<0,u=o+(t+n)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+d<<0,this.h3=this.h3+h<<0,this.h4=this.h4+f<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+v<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=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,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,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},Sha256.prototype.array=Sha256.prototype.digest,Sha256.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},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256Exports=sha256$1.exports,sha256=getDefaultExportFromCjs(sha256Exports);if(void 0===es6Promise_minExports.Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function Keycloak(e){if(!(this instanceof Keycloak))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var t,r,n=this,o=[],i={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),a=0;a<s.length;a++)-1===s[a].src.indexOf("keycloak.js")&&-1===s[a].src.indexOf("keycloak.min.js")||-1===s[a].src.indexOf("version=")||(n.iframeVersion=s[a].src.substring(s[a].src.indexOf("version=")+8).split("&")[0]);var c=!0,u=C(console.info),l=C(console.warn);function d(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=new Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=new Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function h(){return void 0!==n.authServerUrl?"/"==n.authServerUrl.charAt(n.authServerUrl.length-1)?n.authServerUrl+"realms/"+encodeURIComponent(n.realm):n.authServerUrl+"/realms/"+encodeURIComponent(n.realm):void 0}function f(e,t){var r=e.code,o=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&n.onActionUpdate&&n.onActionUpdate(e.kc_action_status),o)if("none"!=i){var a={error:o,error_description:e.error_description};n.onAuthError&&n.onAuthError(a),t&&t.setError(a)}else t&&t.setSuccess();else if("standard"!=n.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=n.flow&&r){var l="code="+r+"&grant_type=authorization_code",d=n.endpoints.token(),h=new XMLHttpRequest;h.open("POST",d,!0),h.setRequestHeader("Content-type","application/x-www-form-urlencoded"),l+="&client_id="+encodeURIComponent(n.clientId),l+="&redirect_uri="+e.redirectUri,e.pkceCodeVerifier&&(l+="&code_verifier="+e.pkceCodeVerifier),h.withCredentials=!0,h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status){var e=JSON.parse(h.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===n.flow),S()}else n.onAuthError&&n.onAuthError(),t&&t.setError()},h.send(l)}function f(r,o,i,a){m(r,o,i,s=(s+(new Date).getTime())/2),c&&(n.tokenParsed&&n.tokenParsed.nonce!=e.storedNonce||n.refreshTokenParsed&&n.refreshTokenParsed.nonce!=e.storedNonce||n.idTokenParsed&&n.idTokenParsed.nonce!=e.storedNonce)?(u("[KEYCLOAK] Invalid nonce, clearing token"),n.clearToken(),t&&t.setError()):a&&(n.onAuthSuccess&&n.onAuthSuccess(),t&&t.setSuccess())}}function p(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function m(e,t,r,o){if(n.tokenTimeoutHandle&&(clearTimeout(n.tokenTimeoutHandle),n.tokenTimeoutHandle=null),t?(n.refreshToken=t,n.refreshTokenParsed=v(t)):(delete n.refreshToken,delete n.refreshTokenParsed),r?(n.idToken=r,n.idTokenParsed=v(r)):(delete n.idToken,delete n.idTokenParsed),e){if(n.token=e,n.tokenParsed=v(e),n.sessionId=n.tokenParsed.session_state,n.authenticated=!0,n.subject=n.tokenParsed.sub,n.realmAccess=n.tokenParsed.realm_access,n.resourceAccess=n.tokenParsed.resource_access,o&&(n.timeSkew=Math.floor(o/1e3)-n.tokenParsed.iat),null!=n.timeSkew&&(u("[KEYCLOAK] Estimated time difference between browser and server is "+n.timeSkew+" seconds"),n.onTokenExpired)){var i=1e3*(n.tokenParsed.exp-(new Date).getTime()/1e3+n.timeSkew);u("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?n.onTokenExpired():n.tokenTimeoutHandle=setTimeout(n.onTokenExpired,i)}}else delete n.token,delete n.tokenParsed,delete n.subject,delete n.realmAccess,delete n.resourceAccess,n.authenticated=!1}function v(e){switch((e=(e=(e=e.split(".")[1]).replace(/-/g,"+")).replace(/_/g,"/")).length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Invalid token"}return e=decodeURIComponent(escape(atob(e))),e=JSON.parse(e)}function k(){var e="0123456789abcdef",t=d(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 g(e){var t=function(e){var t;switch(n.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 r,o,i=e.indexOf("?"),s=e.indexOf("#");"query"===n.responseMode&&-1!==i?(r=e.substring(0,i),""!==(o=y(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+o.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===n.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(o=y(e.substring(s+1),t)).paramsString&&(r+="#"+o.paramsString));if(o&&o.oauthParams)if("standard"===n.flow||"hybrid"===n.flow){if((o.oauthParams.code||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}else if("implicit"===n.flow&&(o.oauthParams.access_token||o.oauthParams.error)&&o.oauthParams.state)return o.oauthParams.newUrl=r,o.oauthParams}(e);if(t){var o=r.get(t.state);return o&&(t.valid=!0,t.redirectUri=o.redirectUri,t.storedNonce=o.nonce,t.prompt=o.prompt,t.pkceCodeVerifier=o.pkceCodeVerifier),t}}function y(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function _(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new es6Promise_minExports.Promise((function(t,r){e.resolve=t,e.reject=r})),e}function w(){var e=_();if(!i.enable)return e.setSuccess(),e.promise;if(i.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");i.iframe=t,t.onload=function(){var t=n.endpoints.authorize();"/"===t.charAt(0)?i.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):i.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=n.endpoints.checkSessionIframe();t.setAttribute("src",r),t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t);return window.addEventListener("message",(function(e){if(e.origin===i.iframeOrigin&&i.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&n.clearToken();for(var t=i.callbackList.splice(0,i.callbackList.length),r=t.length-1;r>=0;--r){var o=t[r];"error"==e.data?o.setError():o.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function S(){i.enable&&n.token&&setTimeout((function(){b().then((function(e){e&&S()}))}),1e3*i.interval)}function b(){var e=_();if(i.iframe&&i.iframeOrigin){var t=n.clientId+" "+(n.sessionId?n.sessionId:"");i.callbackList.push(e);var r=i.iframeOrigin;1==i.callbackList.length&&i.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function A(){var e=_();if(i.enable||n.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",n.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var r=function(o){t.contentWindow===o.source&&("supported"!==o.data&&"unsupported"!==o.data||("unsupported"===o.data&&(l("[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"),i.enable=!1,n.silentCheckSsoFallback&&(n.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))};window.addEventListener("message",r,!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new es6Promise_minExports.Promise((function(e,o){n=setTimeout((function(){o({error:r||"Promise is not settled within timeout of "+t+"ms"})}),t)}));return es6Promise_minExports.Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,n.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function R(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(n.createLoginUrl(e)),_().promise},logout:function(e){return window.location.replace(n.createLogoutUrl(e)),_().promise},register:function(e){return window.location.assign(n.createRegisterUrl(e)),_().promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,_().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:n.redirectUri?n.redirectUri:location.href}};if("cordova"==e){i.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)},o=n.redirectUri||"http://localhost";return{login:function(e){var i=_(),s=r(e),a=n.createLoginUrl(e),c=t(a,"_blank",s),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(o)&&(f(g(e.url),i),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(o)?(f(g(e.url),i),d(),u=!0):(i.setError(),d()))})),c.addEventListener("exit",(function(e){l||i.setError({reason:"closed_by_user"})})),i.promise},logout:function(e){var r,i=_(),s=n.createLogoutUrl(e),a=t(s,"_blank","location=no,hidden=yes,clearcache=yes");return a.addEventListener("loadstart",(function(e){0==e.url.indexOf(o)&&a.close()})),a.addEventListener("loaderror",(function(e){0==e.url.indexOf(o)||(r=!0),a.close()})),a.addEventListener("exit",(function(e){r?i.setError():(n.clearToken(),i.setSuccess())})),i.promise},register:function(e){var i=_(),s=n.createRegisterUrl(),a=r(e),c=t(s,"_blank",a);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(o)&&(c.close(),f(g(e.url),i))})),i.promise},accountManagement:function(){var e=n.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf(o)&&r.close()}))},redirectUri:function(e){return o}}}if("cordova-native"==e)return i.enable=!1,{login:function(e){var t=_(),r=n.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=_(),r=n.createLogoutUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),n.clearToken(),t.setSuccess()})),window.cordova.plugins.browsertab.openUrl(r),t.promise},register:function(e){var t=_(),r=n.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),f(g(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=n.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:n.redirectUri?n.redirectUri:"http://localhost"}};throw"invalid adapter type: "+e}n.init=function(o){if(n.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");n.didInitialize=!0,n.authenticated=!1,r=function(){try{return new E}catch(e){}return new H}();if(t=o&&["default","cordova","cordova-native"].indexOf(o.adapter)>-1?R(o.adapter):o&&"object"==typeof o.adapter?o.adapter:window.Cordova||window.cordova?R("cordova"):R(),o){if(void 0!==o.useNonce&&(c=o.useNonce),void 0!==o.checkLoginIframe&&(i.enable=o.checkLoginIframe),o.checkLoginIframeInterval&&(i.interval=o.checkLoginIframeInterval),"login-required"===o.onLoad&&(n.loginRequired=!0),o.responseMode){if("query"!==o.responseMode&&"fragment"!==o.responseMode)throw"Invalid value for responseMode";n.responseMode=o.responseMode}if(o.flow){switch(o.flow){case"standard":n.responseType="code";break;case"implicit":n.responseType="id_token token";break;case"hybrid":n.responseType="code id_token token";break;default:throw"Invalid value for flow"}n.flow=o.flow}if(null!=o.timeSkew&&(n.timeSkew=o.timeSkew),o.redirectUri&&(n.redirectUri=o.redirectUri),o.silentCheckSsoRedirectUri&&(n.silentCheckSsoRedirectUri=o.silentCheckSsoRedirectUri),"boolean"==typeof o.silentCheckSsoFallback?n.silentCheckSsoFallback=o.silentCheckSsoFallback:n.silentCheckSsoFallback=!0,o.pkceMethod){if("S256"!==o.pkceMethod)throw"Invalid value for pkceMethod";n.pkceMethod=o.pkceMethod}"boolean"==typeof o.enableLogging?n.enableLogging=o.enableLogging:n.enableLogging=!1,"string"==typeof o.scope&&(n.scope=o.scope),"number"==typeof o.messageReceiveTimeout&&o.messageReceiveTimeout>0?n.messageReceiveTimeout=o.messageReceiveTimeout:n.messageReceiveTimeout=1e4}n.responseMode||(n.responseMode="fragment"),n.responseType||(n.responseType="code",n.flow="standard");var s=_(),a=_();a.promise.then((function(){n.onReady&&n.onReady(n.authenticated),s.setSuccess(n.authenticated)})).catch((function(e){s.setError(e)}));var u=function(t){var r,o=_();e?"string"==typeof e&&(r=e):r="keycloak.json";function i(e){n.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 h()+"/protocol/openid-connect/auth"},token:function(){return h()+"/protocol/openid-connect/token"},logout:function(){return h()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=h()+"/protocol/openid-connect/login-status-iframe.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=h()+"/protocol/openid-connect/3p-cookies/step1.html";return n.iframeVersion&&(e=e+"?version="+n.iframeVersion),e},register:function(){return h()+"/protocol/openid-connect/registrations"},userinfo:function(){return h()+"/protocol/openid-connect/userinfo"}}}if(r){(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||p(c)){var e=JSON.parse(c.responseText);n.authServerUrl=e["auth-server-url"],n.realm=e.realm,n.clientId=e.resource,i(null),o.setSuccess()}else o.setError()},c.send()}else{if(!e.clientId)throw"clientId missing";n.clientId=e.clientId;var s=e.oidcProvider;if(s){var a,c;if("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||p(c)?(i(JSON.parse(c.responseText)),o.setSuccess()):o.setError())},c.send();else i(s),o.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";n.authServerUrl=e.url,n.realm=e.realm,i(null),o.setSuccess()}}return o.promise}();function l(){var e=function(e){e||(r.prompt="none"),o&&o.locale&&(r.locale=o.locale),n.login(r).then((function(){a.setSuccess()})).catch((function(e){a.setError(e)}))},t=function(){var e=document.createElement("iframe"),t=n.createLoginUrl({prompt:"none",redirectUri:n.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(f(g(t.data),a),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},r={};switch(o.onLoad){case"check-sso":i.enable?w().then((function(){b().then((function(r){r?a.setSuccess():n.silentCheckSsoRedirectUri?t():e(!1)})).catch((function(e){a.setError(e)}))})):n.silentCheckSsoRedirectUri?t():e(!1);break;case"login-required":e(!0);break;default:throw"Invalid value for onLoad"}}function d(){var e=g(window.location.href);if(e&&window.history.replaceState(window.history.state,null,e.newUrl),e&&e.valid)return w().then((function(){f(e,a)})).catch((function(e){a.setError(e)}));o?o.token&&o.refreshToken?(m(o.token,o.refreshToken,o.idToken),i.enable?w().then((function(){b().then((function(e){e?(n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess(),S()):a.setSuccess()})).catch((function(e){a.setError(e)}))})):n.updateToken(-1).then((function(){n.onAuthSuccess&&n.onAuthSuccess(),a.setSuccess()})).catch((function(e){n.onAuthError&&n.onAuthError(),o.onLoad?l():a.setError(e)}))):o.onLoad?l():a.setSuccess():a.setSuccess()}return u.then((function(){(function(){var e=_(),t=function(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(A).then(d).catch((function(e){s.setError(e)}))})),u.catch((function(e){s.setError(e)})),s.promise},n.login=function(e){return t.login(e)},n.createLoginUrl=function(e){var o,i=k(),s=k(),a=t.redirectUri(e),u={state:i,nonce:s,redirectUri:encodeURIComponent(a)};e&&e.prompt&&(u.prompt=e.prompt),o=e&&"register"==e.action?n.endpoints.register():n.endpoints.authorize();var l=e&&e.scope||n.scope;l?-1===l.indexOf("openid")&&(l="openid "+l):l="openid";var h,f,p=o+"?client_id="+encodeURIComponent(n.clientId)+"&redirect_uri="+encodeURIComponent(a)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(n.responseMode)+"&response_type="+encodeURIComponent(n.responseType)+"&scope="+encodeURIComponent(l);if(c&&(p=p+"&nonce="+encodeURIComponent(s)),e&&e.prompt&&(p+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(p+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(p+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(p+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(p+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(p+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var m=(h=e.acr,f={id_token:{acr:h}},JSON.stringify(f));p+="&claims="+encodeURIComponent(m)}if(n.pkceMethod){var v=function(e){return d(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}(96);u.pkceCodeVerifier=v;var g=function(e,t){if("S256"===e){var r=new Uint8Array(sha256.arrayBuffer(t));return base64Js.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}throw"Invalid value for pkceMethod"}(n.pkceMethod,v);p+="&code_challenge="+g,p+="&code_challenge_method="+n.pkceMethod}return r.add(u),p},n.logout=function(e){return t.logout(e)},n.createLogoutUrl=function(e){var r=n.endpoints.logout()+"?client_id="+encodeURIComponent(n.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(t.redirectUri(e,!1));return n.idToken&&(r+="&id_token_hint="+encodeURIComponent(n.idToken)),r},n.register=function(e){return t.register(e)},n.createRegisterUrl=function(e){return e||(e={}),e.action="register",n.createLoginUrl(e)},n.createAccountUrl=function(e){var r=h(),o=void 0;return void 0!==r&&(o=r+"/account?referrer="+encodeURIComponent(n.clientId)+"&referrer_uri="+encodeURIComponent(t.redirectUri(e))),o},n.accountManagement=function(){return t.accountManagement()},n.hasRealmRole=function(e){var t=n.realmAccess;return!!t&&t.roles.indexOf(e)>=0},n.hasResourceRole=function(e,t){if(!n.resourceAccess)return!1;var r=n.resourceAccess[t||n.clientId];return!!r&&r.roles.indexOf(e)>=0},n.loadUserProfile=function(){var e=h()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.profile=JSON.parse(t.responseText),r.setSuccess(n.profile)):r.setError())},t.send(),r.promise},n.loadUserInfo=function(){var e=n.endpoints.userinfo(),t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+n.token);var r=_();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(n.userInfo=JSON.parse(t.responseText),r.setSuccess(n.userInfo)):r.setError())},t.send(),r.promise},n.isTokenExpired=function(e){if(!n.tokenParsed||!n.refreshToken&&"implicit"!=n.flow)throw"Not authenticated";if(null==n.timeSkew)return u("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var t=n.tokenParsed.exp-Math.ceil((new Date).getTime()/1e3)+n.timeSkew;if(e){if(isNaN(e))throw"Invalid minValidity";t-=e}return t<0},n.updateToken=function(e){var t=_();if(!n.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,u("[KEYCLOAK] Refreshing token: forced refresh")):n.tokenParsed&&!n.isTokenExpired(e)||(r=!0,u("[KEYCLOAK] Refreshing token: token expired")),r){var i="grant_type=refresh_token&refresh_token="+n.refreshToken,s=n.endpoints.token();if(o.push(t),1==o.length){var a=new XMLHttpRequest;a.open("POST",s,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.withCredentials=!0,i+="&client_id="+encodeURIComponent(n.clientId);var c=(new Date).getTime();a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){u("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(a.responseText);m(e.access_token,e.refresh_token,e.id_token,c),n.onAuthRefreshSuccess&&n.onAuthRefreshSuccess();for(var t=o.pop();null!=t;t=o.pop())t.setSuccess(!0)}else{l("[KEYCLOAK] Failed to refresh token"),400==a.status&&n.clearToken(),n.onAuthRefreshError&&n.onAuthRefreshError();for(t=o.pop();null!=t;t=o.pop())t.setError(!0)}},a.send(i)}}else t.setSuccess(!1)};i.enable?b().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},n.clearToken=function(){n.token&&(m(null,null,null),n.onAuthLogout&&n.onAuthLogout(),n.loginRequired&&n.login())};var E=function(){if(!(this instanceof E))return new E;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},H=function(){if(!(this instanceof H))return new H;var e=this;e.get=function(e){if(e){var o=r("kc-callback-"+e);return n("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){n("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){n(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},r=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},n=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function C(e){return function(){n.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}return Keycloak}));
*/!function(n){!function(){var o="input is invalid type",i="object"==typeof window,s=i?window:{};s.JS_SHA256_NO_WINDOW&&(i=!1);var a=!i&&"object"==typeof self,c=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;c?s=r:a&&(s=self);var u=!s.JS_SHA256_NO_COMMON_JS&&n.exports,l=!s.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],v=["hex","array","digest","arrayBuffer"],m=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var g=function(e,t){return function(r){return new _(t,!0).update(r)[e]()}},w=function(e){var t=g("hex",e);c&&(t=k(t,e)),t.create=function(){return new _(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<v.length;++r){var n=v[r];t[n]=g(n,e)}return t},k=function(r,n){var i,a=e,c=t.Buffer,u=n?"sha224":"sha256";i=c.from&&!s.JS_SHA256_NO_BUFFER_FROM?c.from:function(e){return new c(e)};return function(e){if("string"==typeof e)return a.createHash(u).update(e,"utf8").digest("hex");if(null==e)throw new Error(o);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===c?a.createHash(u).update(i(e)).digest("hex"):r(e)}},y=function(e,t){return function(r,n){return new A(r,t,!0).update(n)[e]()}},b=function(e){var t=y("hex",e);t.create=function(t){return new A(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<v.length;++r){var n=v[r];t[n]=y(n,e)}return t};function _(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 A(e,t,r){var n,i=typeof e;if("string"===i){var s,a=[],c=e.length,u=0;for(n=0;n<c;++n)(s=e.charCodeAt(n))<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(++n)),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(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(o)}e.length>64&&(e=new _(t,!0).update(e).array());var d=[],f=[];for(n=0;n<64;++n){var h=e[n]||0;d[n]=92^h,f[n]=54^h}_.call(this,t,r),this.update(f),this.oKeyPad=d,this.inner=!0,this.sharedMemory=r}_.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var n,i,s=0,a=e.length,c=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,c[0]=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),t)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)(n=e.charCodeAt(s))<128?c[i>>2]|=n<<h[3&i++]:n<2048?(c[i>>2]|=(192|n>>6)<<h[3&i++],c[i>>2]|=(128|63&n)<<h[3&i++]):n<55296||n>=57344?(c[i>>2]|=(224|n>>12)<<h[3&i++],c[i>>2]|=(128|n>>6&63)<<h[3&i++],c[i>>2]|=(128|63&n)<<h[3&i++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++s)),c[i>>2]|=(240|n>>18)<<h[3&i++],c[i>>2]|=(128|n>>12&63)<<h[3&i++],c[i>>2]|=(128|n>>6&63)<<h[3&i++],c[i>>2]|=(128|63&n)<<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}},_.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()}},_.prototype.hash=function(){var e,t,r,n,o,i,s,a,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,v=this.h5,m=this.h6,g=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((o=w[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=w[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,w[e]=w[e-16]+t+w[e-7]+r<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,g=(o=w[0]-1413257819)-150054599<<0,f=o+24177077<<0):(i=704751109,g=(o=w[0]-210244248)-1521486534<<0,f=o+143694565<<0),this.first=!1):(t=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),n=(i=u&l)^u&d^c,g=f+(o=g+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&v^~h&m)+p[e]+w[e])<<0,f=o+(t+n)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(s=f&u)^f&l^i,m=d+(o=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&h^~g&v)+p[e+1]+w[e+1])<<0,t=((d=o+(t+n)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(a=d&f)^d&u^s,v=l+(o=v+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&h)+p[e+2]+w[e+2])<<0,t=((l=o+(t+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(c=l&d)^l&f^a,h=u+(o=h+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&m^~v&g)+p[e+3]+w[e+3])<<0,u=o+(t+n)<<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+v<<0,this.h6=this.h6+m<<0,this.h7=this.h7+g<<0},_.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=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[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[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[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},_.prototype.toString=_.prototype.hex,_.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=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,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,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},_.prototype.array=_.prototype.digest,_.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},A.prototype=new _,A.prototype.finalize=function(){if(_.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();_.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),_.prototype.finalize.call(this)}};var S=w();S.sha256=S,S.sha224=w(!0),S.sha256.hmac=b(),S.sha224.hmac=b(!0),u?n.exports=S:(s.sha256=S.sha256,s.sha224=S.sha224)}()}(p);var v=n(p.exports);class m extends Error{}function g(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 r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return atob(t)}}function w(e,t){if("string"!=typeof e)throw new m("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!=typeof n)throw new m(`Invalid token specified: missing part #${r+1}`);let o;try{o=g(n)}catch(e){throw new m(`Invalid token specified: invalid base64 for part #${r+1} (${e.message})`)}try{return JSON.parse(o)}catch(e){throw new m(`Invalid token specified: invalid json for part #${r+1} (${e.message})`)}}if(m.prototype.name="InvalidTokenError",void 0===i.Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");return function e(t){if(!(this instanceof e))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var r,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=x(console.info),h=x(console.warn);function p(e,t){for(var r=function(e){var t=null,r=window.crypto||window.msCrypto;if(r&&r.getRandomValues&&window.Uint8Array)return t=new Uint8Array(e),r.getRandomValues(t),t;t=new Array(e);for(var n=0;n<t.length;n++)t[n]=Math.floor(256*Math.random());return t}(e),n=new Array(e),o=0;o<e;o++)n[o]=t.charCodeAt(r[o]%t.length);return String.fromCharCode.apply(null,n)}function m(){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 g(e,t){var r=e.code,n=e.error,i=e.prompt,s=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),n)if("none"!=i){var a={error:n,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&&r){var c="code="+r+"&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),C()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},l.send(c)}function h(r,n,i,a){y(r,n,i,s=(s+(new Date).getTime())/2),d&&(o.tokenParsed&&o.tokenParsed.nonce!=e.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=e.storedNonce||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 k(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function y(e,t,r,n){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=w(t)):(delete o.refreshToken,delete o.refreshTokenParsed),r?(o.idToken=r,o.idTokenParsed=w(r)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=w(e),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,n&&(o.timeSkew=Math.floor(n/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(f("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var i=1e3*(o.tokenParsed.exp-(new Date).getTime()/1e3+o.timeSkew);f("[KEYCLOAK] Token expires in "+Math.round(i/1e3)+" s"),i<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,i)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function b(){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 r,n,i=e.indexOf("?"),s=e.indexOf("#");"query"===o.responseMode&&-1!==i?(r=e.substring(0,i),""!==(n=A(e.substring(i+1,-1!==s?s:e.length),t)).paramsString&&(r+="?"+n.paramsString),-1!==s&&(r+=e.substring(s))):"fragment"===o.responseMode&&-1!==s&&(r=e.substring(0,s),""!==(n=A(e.substring(s+1),t)).paramsString&&(r+="#"+n.paramsString));if(n&&n.oauthParams)if("standard"===o.flow||"hybrid"===o.flow){if((n.oauthParams.code||n.oauthParams.error)&&n.oauthParams.state)return n.oauthParams.newUrl=r,n.oauthParams}else if("implicit"===o.flow&&(n.oauthParams.access_token||n.oauthParams.error)&&n.oauthParams.state)return n.oauthParams.newUrl=r,n.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 A(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),s=r[o].slice(0,i);-1!==t.indexOf(s)?n.oauthParams[s]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function S(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new i.Promise((function(t,r){e.resolve=t,e.reject=r})),e}function U(){var e=S();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 r=o.endpoints.checkSessionIframe();t.setAttribute("src",r),t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-session-iframe"),t.style.display="none",document.body.appendChild(t);return 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),r=t.length-1;r>=0;--r){var n=t[r];"error"==e.data?n.setError():n.setSuccess("unchanged"==e.data)}}}),!1),e.promise}function C(){c.enable&&o.token&&setTimeout((function(){E().then((function(e){e&&C()}))}),1e3*c.interval)}function E(){var e=S();if(c.iframe&&c.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");c.callbackList.push(e);var r=c.iframeOrigin;1==c.callbackList.length&&c.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function T(){var e=S();if(c.enable||o.silentCheckSsoRedirectUri){var t=document.createElement("iframe");t.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),t.setAttribute("sandbox","allow-scripts allow-same-origin"),t.setAttribute("title","keycloak-3p-check-iframe"),t.style.display="none",document.body.appendChild(t);var r=function(n){t.contentWindow===n.source&&("supported"!==n.data&&"unsupported"!==n.data||("unsupported"===n.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",r),e.setSuccess()))};window.addEventListener("message",r,!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new i.Promise((function(e,o){n=setTimeout((function(){o({error:r||"Promise is not settled within timeout of "+t+"ms"})}),t)}));return i.Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function I(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),S().promise},logout:function(e){return window.location.replace(o.createLogoutUrl(e)),S().promise},register:function(e){return window.location.assign(o.createRegisterUrl(e)),S().promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";return window.location.href=e,S().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){c.enable=!1;var t=function(e,t,r){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(e,t,r):window.open(e,t,r)},r=function(e){var t=function(e){return e&&e.cordovaOptions?Object.keys(e.cordovaOptions).reduce((function(t,r){return t[r]=e.cordovaOptions[r],t}),{}):{}}(e);return t.location="no",e&&"none"==e.prompt&&(t.hidden="yes"),function(e){return Object.keys(e).reduce((function(t,r){return t.push(r+"="+e[r]),t}),[]).join(",")}(t)},n=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var i=S(),s=r(e),a=o.createLoginUrl(e),c=t(a,"_blank",s),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(n())&&(g(_(e.url),i),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(n())?(g(_(e.url),i),d(),u=!0):(i.setError(),d()))})),c.addEventListener("exit",(function(e){l||i.setError({reason:"closed_by_user"})})),i.promise},logout:function(e){var r,i=S(),s=o.createLogoutUrl(e),a=t(s,"_blank","location=no,hidden=yes,clearcache=yes");return a.addEventListener("loadstart",(function(e){0==e.url.indexOf(n())&&a.close()})),a.addEventListener("loaderror",(function(e){0==e.url.indexOf(n())||(r=!0),a.close()})),a.addEventListener("exit",(function(e){r?i.setError():(o.clearToken(),i.setSuccess())})),i.promise},register:function(e){var i=S(),s=o.createRegisterUrl(),a=r(e),c=t(s,"_blank",a);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(n())&&(c.close(),g(_(e.url),i))})),i.promise},accountManagement:function(){var e=o.createAccountUrl();if(void 0===e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf(n())&&r.close()}))},redirectUri:function(e){return n()}}}if("cordova-native"==e)return c.enable=!1,{login:function(e){var t=S(),r=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=S(),r=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(r),t.promise},register:function(e){var t=S(),r=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),g(_(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),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(e){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,n=function(){try{return new O}catch(e){}return new R}();if(r=e&&["default","cordova","cordova-native"].indexOf(e.adapter)>-1?I(e.adapter):e&&"object"==typeof e.adapter?e.adapter:window.Cordova||window.cordova?I("cordova"):I(),e){if(void 0!==e.useNonce&&(d=e.useNonce),void 0!==e.checkLoginIframe&&(c.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(c.interval=e.checkLoginIframeInterval),"login-required"===e.onLoad&&(o.loginRequired=!0),e.responseMode){if("query"!==e.responseMode&&"fragment"!==e.responseMode)throw"Invalid value for responseMode";o.responseMode=e.responseMode}if(e.flow){switch(e.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=e.flow}if(null!=e.timeSkew&&(o.timeSkew=e.timeSkew),e.redirectUri&&(o.redirectUri=e.redirectUri),e.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=e.silentCheckSsoRedirectUri),"boolean"==typeof e.silentCheckSsoFallback?o.silentCheckSsoFallback=e.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,e.pkceMethod){if("S256"!==e.pkceMethod)throw"Invalid value for pkceMethod";o.pkceMethod=e.pkceMethod}"boolean"==typeof e.enableLogging?o.enableLogging=e.enableLogging:o.enableLogging=!1,"string"==typeof e.scope&&(o.scope=e.scope),"string"==typeof e.acrValues&&(o.acrValues=e.acrValues),"number"==typeof e.messageReceiveTimeout&&e.messageReceiveTimeout>0?o.messageReceiveTimeout=e.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var i=S(),s=S();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),i.setSuccess(o.authenticated)})).catch((function(e){i.setError(e)}));var a=function(e){var r,n=S();t?"string"==typeof t&&(r=t):r="keycloak.json";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 m()+"/protocol/openid-connect/auth"},token:function(){return m()+"/protocol/openid-connect/token"},logout:function(){return m()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=m()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=m()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return m()+"/protocol/openid-connect/registrations"},userinfo:function(){return m()+"/protocol/openid-connect/userinfo"}}}if(r){(c=new XMLHttpRequest).open("GET",r,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){if(4==c.readyState)if(200==c.status||k(c)){var e=JSON.parse(c.responseText);o.authServerUrl=e["auth-server-url"],o.realm=e.realm,o.clientId=e.resource,i(null),n.setSuccess()}else n.setError()},c.send()}else{if(!t.clientId)throw"clientId missing";o.clientId=t.clientId;var s=t.oidcProvider;if(s){var a,c;if("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||k(c)?(i(JSON.parse(c.responseText)),n.setSuccess()):n.setError())},c.send();else i(s),n.setSuccess()}else{if(!t.url)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++)if(u[l].src.match(/.*keycloak\.js/)){t.url=u[l].src.substr(0,u[l].src.indexOf("/js/keycloak.js"));break}if(!t.realm)throw"realm missing";o.authServerUrl=t.url,o.realm=t.realm,i(null),n.setSuccess()}}return n.promise}();function u(){var t=function(t){t||(n.prompt="none"),e&&e.locale&&(n.locale=e.locale),o.login(n).then((function(){s.setSuccess()})).catch((function(e){s.setError(e)}))},r=function(){var e=document.createElement("iframe"),t=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});e.setAttribute("src",t),e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.setAttribute("title","keycloak-silent-check-sso"),e.style.display="none",document.body.appendChild(e);var r=function(t){t.origin===window.location.origin&&e.contentWindow===t.source&&(g(_(t.data),s),document.body.removeChild(e),window.removeEventListener("message",r))};window.addEventListener("message",r)},n={};switch(e.onLoad){case"check-sso":c.enable?U().then((function(){E().then((function(e){e?s.setSuccess():o.silentCheckSsoRedirectUri?r():t(!1)})).catch((function(e){s.setError(e)}))})):o.silentCheckSsoRedirectUri?r():t(!1);break;case"login-required":t(!0);break;default:throw"Invalid value for onLoad"}}function l(){var t=_(window.location.href);if(t&&window.history.replaceState(window.history.state,null,t.newUrl),t&&t.valid)return U().then((function(){g(t,s)})).catch((function(e){s.setError(e)}));e?e.token&&e.refreshToken?(y(e.token,e.refreshToken,e.idToken),c.enable?U().then((function(){E().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),C()):s.setSuccess()})).catch((function(e){s.setError(e)}))})):o.updateToken(-1).then((function(){o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess()})).catch((function(t){o.onAuthError&&o.onAuthError(),e.onLoad?u():s.setError(t)}))):e.onLoad?u():s.setSuccess():s.setSuccess()}return a.then((function(){(function(){var e=S(),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 r.login(e)},o.createLoginUrl=function(e){var t,i=b(),a=b(),c=r.redirectUri(e),u={state:i,nonce:a,redirectUri:encodeURIComponent(c)};e&&e.prompt&&(u.prompt=e.prompt),t=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,m=t+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(c)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(d&&(m=m+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(m+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(m+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(m+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(m+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(m+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(m+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var g=(f=e.acr,h={id_token:{acr:f}},JSON.stringify(h));m+="&claims="+encodeURIComponent(g)}if((e&&e.acrValues||o.acrValues)&&(m+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var w=function(e){return p(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}(96);u.pkceCodeVerifier=w;var k=function(e,t){if("S256"===e){var r=new Uint8Array(v.arrayBuffer(t));return s.fromByteArray(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}throw"Invalid value for pkceMethod"}(o.pkceMethod,w);m+="&code_challenge="+k,m+="&code_challenge_method="+o.pkceMethod}return n.add(u),m},o.logout=function(e){return r.logout(e)},o.createLogoutUrl=function(e){var t=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(r.redirectUri(e,!1));return o.idToken&&(t+="&id_token_hint="+encodeURIComponent(o.idToken)),t},o.register=function(e){return r.register(e)},o.createRegisterUrl=function(e){return e||(e={}),e.action="register",o.createLoginUrl(e)},o.createAccountUrl=function(e){var t=m(),n=void 0;return void 0!==t&&(n=t+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(r.redirectUri(e))),n},o.accountManagement=function(){return r.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 r=o.resourceAccess[t||o.clientId];return!!r&&r.roles.indexOf(e)>=0},o.loadUserProfile=function(){var e=m()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var r=S();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.profile=JSON.parse(t.responseText),r.setSuccess(o.profile)):r.setError())},t.send(),r.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 r=S();return t.onreadystatechange=function(){4==t.readyState&&(200==t.status?(o.userInfo=JSON.parse(t.responseText),r.setSuccess(o.userInfo)):r.setError())},t.send(),r.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=S();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,f("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(r=!0,f("[KEYCLOAK] Refreshing token: token expired")),r){var n="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,n+="&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);y(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{h("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(t=a.pop();null!=t;t=a.pop())t.setError(!0)}},s.send(n)}}else t.setSuccess(!1)};c.enable?E().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},o.clearToken=function(){o.token&&(y(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var O=function(){if(!(this instanceof O))return new O;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function e(){for(var e=(new Date).getTime(),t=0;t<localStorage.length;t++){var r=localStorage.key(t);if(r&&0==r.indexOf("kc-callback-")){var n=localStorage.getItem(r);if(n)try{var o=JSON.parse(n).expires;(!o||o<e)&&localStorage.removeItem(r)}catch(e){localStorage.removeItem(r)}}}}this.get=function(t){if(t){var r="kc-callback-"+t,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),e(),n}},this.add=function(t){e();var r="kc-callback-"+t.state;t.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(t))}},R=function(){if(!(this instanceof R))return new R;var e=this;e.get=function(e){if(e){var o=r("kc-callback-"+e);return n("kc-callback-"+e,"",t(-100)),o?JSON.parse(o):void 0}},e.add=function(e){n("kc-callback-"+e.state,JSON.stringify(e),t(60))},e.removeItem=function(e){n(e,"",t(-100))};var t=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},r=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},n=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function x(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}}));
//# sourceMappingURL=keycloak.min.js.map
{
"name": "keycloak-js",
"version": "22.0.5",
"version": "23.0.0",
"description": "A client-side JavaScript OpenID Connect library that can be used to secure web applications",

@@ -41,13 +41,14 @@ "main": "./dist/keycloak.js",

"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.2",
"@rollup/plugin-inject": "^5.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.2",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-inject": "^5.0.5",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"es6-promise": "^4.2.8",
"rollup": "^3.26.2"
"rollup": "^4.5.1"
},
"dependencies": {
"base64-js": "^1.5.1",
"js-sha256": "^0.9.0"
"js-sha256": "^0.10.1",
"jwt-decode": "^4.0.0"
},

@@ -54,0 +55,0 @@ "scripts": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc