!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}([function(e,t,r){var n=r(8)();e.exports=n;try{regeneratorRuntime=n}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t){function r(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,c,"next",e)}function c(e){r(a,o,i,s,c,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jwtDecode=t.InvalidTokenError=void 0;class n extends Error{}function o(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(r){return atob(t)}}t.InvalidTokenError=n,n.prototype.name="InvalidTokenError",t.jwtDecode=function(e,t){if("string"!==typeof e)throw new n("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,i=e.split(".")[r];if("string"!==typeof i)throw new n(`Invalid token specified: missing part #${r+1}`);let a;try{a=o(i)}catch(s){throw new n(`Invalid token specified: invalid base64 for part #${r+1} (${s.message})`)}try{return JSON.parse(a)}catch(s){throw new n(`Invalid token specified: invalid json for part #${r+1} (${s.message})`)}}},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(6);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){(function(t,n){var o;!function(){"use strict";var i="input is invalid type",a="object"===typeof window,s=a?window:{};s.JS_SHA256_NO_WINDOW&&(a=!1);var c=!a&&"object"===typeof self,u=!s.JS_SHA256_NO_NODE_JS&&"object"===typeof t&&t.versions&&t.versions.node;u?s=n:c&&(s=self);var l=!s.JS_SHA256_NO_COMMON_JS&&"object"===typeof e&&e.exports,d=r(11),f=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,h="0123456789abcdef".split(""),p=[-2147483648,8388608,32768,128],m=[24,16,8,0],w=[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"],g=[];!s.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!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 y=function(e,t){return function(r){return new x(t,!0).update(r)[e]()}},k=function(e){var t=y("hex",e);u&&(t=b(t,e)),t.create=function(){return new x(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<v.length;++r){var n=v[r];t[n]=y(n,e)}return t},b=function(e,t){var n,o=r(12),a=r(13).Buffer,c=t?"sha224":"sha256";n=a.from&&!s.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)};return function(t){if("string"===typeof t)return o.createHash(c).update(t,"utf8").digest("hex");if(null===t||void 0===t)throw new Error(i);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===a?o.createHash(c).update(n(t)).digest("hex"):e(t)}},S=function(e,t){return function(r,n){return new E(r,t,!0).update(n)[e]()}},_=function(e){var t=S("hex",e);t.create=function(t){return new E(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]=S(n,e)}return t};function x(e,t){t?(g[0]=g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0,this.blocks=g):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 E(e,t,r){var n,o=typeof e;if("string"===o){var a,s=[],c=e.length,u=0;for(n=0;n<c;++n)(a=e.charCodeAt(n))<128?s[u++]=a:a<2048?(s[u++]=192|a>>>6,s[u++]=128|63&a):a<55296||a>=57344?(s[u++]=224|a>>>12,s[u++]=128|a>>>6&63,s[u++]=128|63&a):(a=65536+((1023&a)<<10|1023&e.charCodeAt(++n)),s[u++]=240|a>>>18,s[u++]=128|a>>>12&63,s[u++]=128|a>>>6&63,s[u++]=128|63&a);e=s}else{if("object"!==o)throw new Error(i);if(null===e)throw new Error(i);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(i)}e.length>64&&(e=new x(t,!0).update(e).array());var l=[],d=[];for(n=0;n<64;++n){var h=e[n]||0;l[n]=92^h,d[n]=54^h}x.call(this,t,r),this.update(d),this.oKeyPad=l,this.inner=!0,this.sharedMemory=r}x.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!f||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=0,s=e.length,c=this.blocks;a<s;){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),t)for(o=this.start;a<s&&o<64;++a)c[o>>>2]|=e[a]<<m[3&o++];else for(o=this.start;a<s&&o<64;++a)(n=e.charCodeAt(a))<128?c[o>>>2]|=n<<m[3&o++]:n<2048?(c[o>>>2]|=(192|n>>>6)<<m[3&o++],c[o>>>2]|=(128|63&n)<<m[3&o++]):n<55296||n>=57344?(c[o>>>2]|=(224|n>>>12)<<m[3&o++],c[o>>>2]|=(128|n>>>6&63)<<m[3&o++],c[o>>>2]|=(128|63&n)<<m[3&o++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++a)),c[o>>>2]|=(240|n>>>18)<<m[3&o++],c[o>>>2]|=(128|n>>>12&63)<<m[3&o++],c[o>>>2]|=(128|n>>>6&63)<<m[3&o++],c[o>>>2]|=(128|63&n)<<m[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=c[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}},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=p[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()}},x.prototype.hash=function(){var e,t,r,n,o,i,a,s,c,u=this.h0,l=this.h1,d=this.h2,f=this.h3,h=this.h4,p=this.h5,m=this.h6,v=this.h7,g=this.blocks;for(e=16;e<64;++e)t=((o=g[e-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,r=((o=g[e-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,g[e]=g[e-16]+t+g[e-7]+r<<0;for(c=l&d,e=0;e<64;e+=4)this.first?(this.is224?(i=300032,v=(o=g[0]-1413257819)-150054599<<0,f=o+24177077<<0):(i=704751109,v=(o=g[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,v=f+(o=v+(r=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&p^~h&m)+w[e]+g[e])<<0,f=o+(t+n)<<0),t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(a=f&u)^f&l^i,m=d+(o=m+(r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&h^~v&p)+w[e+1]+g[e+1])<<0,t=((d=o+(t+n)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(s=d&f)^d&u^a,p=l+(o=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&v^~m&h)+w[e+2]+g[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^s,h=u+(o=h+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&v)+w[e+3]+g[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+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+v<<0},x.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,c=h[e>>>28&15]+h[e>>>24&15]+h[e>>>20&15]+h[e>>>16&15]+h[e>>>12&15]+h[e>>>8&15]+h[e>>>4&15]+h[15&e]+h[t>>>28&15]+h[t>>>24&15]+h[t>>>20&15]+h[t>>>16&15]+h[t>>>12&15]+h[t>>>8&15]+h[t>>>4&15]+h[15&t]+h[r>>>28&15]+h[r>>>24&15]+h[r>>>20&15]+h[r>>>16&15]+h[r>>>12&15]+h[r>>>8&15]+h[r>>>4&15]+h[15&r]+h[n>>>28&15]+h[n>>>24&15]+h[n>>>20&15]+h[n>>>16&15]+h[n>>>12&15]+h[n>>>8&15]+h[n>>>4&15]+h[15&n]+h[o>>>28&15]+h[o>>>24&15]+h[o>>>20&15]+h[o>>>16&15]+h[o>>>12&15]+h[o>>>8&15]+h[o>>>4&15]+h[15&o]+h[i>>>28&15]+h[i>>>24&15]+h[i>>>20&15]+h[i>>>16&15]+h[i>>>12&15]+h[i>>>8&15]+h[i>>>4&15]+h[15&i]+h[a>>>28&15]+h[a>>>24&15]+h[a>>>20&15]+h[a>>>16&15]+h[a>>>12&15]+h[a>>>8&15]+h[a>>>4&15]+h[15&a];return this.is224||(c+=h[s>>>28&15]+h[s>>>24&15]+h[s>>>20&15]+h[s>>>16&15]+h[s>>>12&15]+h[s>>>8&15]+h[s>>>4&15]+h[15&s]),c},x.prototype.toString=x.prototype.hex,x.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=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,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||c.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),c},x.prototype.array=x.prototype.digest,x.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},E.prototype=new x,E.prototype.finalize=function(){if(x.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();x.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),x.prototype.finalize.call(this)}};var T=k();T.sha256=T,T.sha224=k(!0),T.sha256.hmac=_(),T.sha224.hmac=_(!0),l?e.exports=T:(s.sha256=T.sha256,s.sha224=T.sha224,d&&(void 0===(o=function(){return T}.call(T,r,T,e))||(e.exports=o)))}()}).call(this,r(9),r(10))},function(e,t,r){var n=r(3).default,o=r(7);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(3).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(3).default;function o(){"use strict";e.exports=o=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(L){d=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),s=new O(n||[]);return a(i,"_invoke",{value:x(e,r,s)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(L){return{type:"throw",arg:L}}}t.wrap=f;var p={};function m(){}function w(){}function v(){}var g={};d(g,c,(function(){return this}));var y=Object.getPrototypeOf,k=y&&y(y(I([])));k&&k!==r&&i.call(k,c)&&(g=k);var b=v.prototype=m.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,a,s,c){var u=h(e[o],e,a);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==n(d)&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function x(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return U()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=h(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(i.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:U}}function U(){return{value:void 0,done:!0}}return w.prototype=v,a(b,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:w,configurable:!0}),w.displayName=d(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,d(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},S(_.prototype),d(_.prototype,u,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(b),d(b,l,"Generator"),d(b,c,(function(){return this})),d(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"===typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}e.exports=r},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t){},function(e,t){},function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),i=r(1),a=r.n(i),s=r(0),c=r.n(s),u=r(5),l=r.n(u),d=r(2);function f(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,o)}function m(e){return m="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}if("undefined"===typeof Promise)throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}window.waitForKeycloakInit=function(e){var t=Date.now();return new Promise((function r(n,o){window.keycloak&&window.keycloak.isAdapterInitialized||e&&Date.now()-t>=e?n():setTimeout(r.bind(this,n,o),30)}))};var g=window.rapplerKeycloak,y=g.url,k=g.realm,b=g.client_id,S=new function e(t){if(!(this instanceof e))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var r,n,o=this,i=[],a={enable:!0,callbackList:[],interval:5},s=document.getElementsByTagName("script"),c=0;c<s.length;c++)-1===s[c].src.indexOf("keycloak.js")&&-1===s[c].src.indexOf("keycloak.min.js")||-1===s[c].src.indexOf("version=")||(o.iframeVersion=s[c].src.substring(s[c].src.indexOf("version=")+8).split("&")[0]);var u=!0,h=P(console.info),w=P(console.warn);function v(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 g(e,t){if("S256"!==e)throw new TypeError("Invalid value for 'pkceMethod', expected 'S256' but got '".concat(e,"'."));return function(e){var t=String.fromCodePoint.apply(String,f(e));return btoa(t)}(new Uint8Array(l.a.arrayBuffer(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}function y(){return"undefined"!==typeof o.authServerUrl?"/"==o.authServerUrl.charAt(o.authServerUrl.length-1)?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm):void 0}function k(e,t){var r=e.code,n=e.error,i=e.prompt,a=(new Date).getTime();if(e.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(e.kc_action_status),n)if("none"!=i)if(e.error_description&&"authentication_expired"===e.error_description)o.login(e.loginOptions);else{var s={error:n,error_description:e.error_description};o.onAuthError&&o.onAuthError(s),t&&t.setError(s)}else t&&t.setSuccess();else if("standard"!=o.flow&&(e.access_token||e.id_token)&&f(e.access_token,null,e.id_token,!0),"implicit"!=o.flow&&r){var c="code="+r+"&grant_type=authorization_code",l=o.endpoints.token(),d=new XMLHttpRequest;d.open("POST",l,!0),d.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),d.withCredentials=!0,d.onreadystatechange=function(){if(4==d.readyState)if(200==d.status){var e=JSON.parse(d.responseText);f(e.access_token,e.refresh_token,e.id_token,"standard"===o.flow),O()}else o.onAuthError&&o.onAuthError(),t&&t.setError()},d.send(c)}function f(r,n,i,s){S(r,n,i,a=(a+(new Date).getTime())/2),u&&o.idTokenParsed&&o.idTokenParsed.nonce!=e.storedNonce?(h("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),t&&t.setError()):s&&(o.onAuthSuccess&&o.onAuthSuccess(),t&&t.setSuccess())}}function b(e){return 0==e.status&&e.responseText&&e.responseURL.startsWith("file:")}function S(e,t,r,n){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),t?(o.refreshToken=t,o.refreshTokenParsed=Object(d.jwtDecode)(t)):(delete o.refreshToken,delete o.refreshTokenParsed),r?(o.idToken=r,o.idTokenParsed=Object(d.jwtDecode)(r)):(delete o.idToken,delete o.idTokenParsed),e){if(o.token=e,o.tokenParsed=Object(d.jwtDecode)(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,n&&(o.timeSkew=Math.floor(n/1e3)-o.tokenParsed.iat),null!=o.timeSkew&&(h("[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);h("[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 _(){var e="0123456789abcdef",t=v(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 x(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("?"),a=e.indexOf("#");"query"===o.responseMode&&-1!==i?(r=e.substring(0,i),""!==(n=E(e.substring(i+1,-1!==a?a:e.length),t)).paramsString&&(r+="?"+n.paramsString),-1!==a&&(r+=e.substring(a))):"fragment"===o.responseMode&&-1!==a&&(r=e.substring(0,a),""!==(n=E(e.substring(a+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.loginOptions=r.loginOptions),t}}function E(e,t){for(var r=e.split("&"),n={paramsString:"",oauthParams:{}},o=0;o<r.length;o++){var i=r[o].indexOf("="),a=r[o].slice(0,i);-1!==t.indexOf(a)?n.oauthParams[a]=r[o].slice(i+1):(""!==n.paramsString&&(n.paramsString+="&"),n.paramsString+=r[o])}return n}function T(){var e={setSuccess:function(t){e.resolve(t)},setError:function(t){e.reject(t)}};return e.promise=new Promise((function(t,r){e.resolve=t,e.reject=r})),e}function A(){var e=T();if(!a.enable)return e.setSuccess(),e.promise;if(a.iframe)return e.setSuccess(),e.promise;var t=document.createElement("iframe");a.iframe=t,t.onload=function(){var t=o.endpoints.authorize();"/"===t.charAt(0)?a.iframeOrigin=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""):a.iframeOrigin=t.substring(0,t.indexOf("/",8)),e.setSuccess()};var r=o.endpoints.checkSessionIframe();t.setAttribute("src",r),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);return window.addEventListener("message",(function(e){if(e.origin===a.iframeOrigin&&a.iframe.contentWindow===e.source&&("unchanged"==e.data||"changed"==e.data||"error"==e.data)){"unchanged"!=e.data&&o.clearToken();for(var t=a.callbackList.splice(0,a.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 O(){a.enable&&o.token&&setTimeout((function(){I().then((function(e){e&&O()}))}),1e3*a.interval)}function I(){var e=T();if(a.iframe&&a.iframeOrigin){var t=o.clientId+" "+(o.sessionId?o.sessionId:"");a.callbackList.push(e);var r=a.iframeOrigin;1==a.callbackList.length&&a.iframe.contentWindow.postMessage(t,r)}else e.setSuccess();return e.promise}function U(){var e=T();if(a.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);window.addEventListener("message",(function r(n){t.contentWindow===n.source&&("supported"!==n.data&&"unsupported"!==n.data||("unsupported"===n.data&&(w("[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"),a.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(t),window.removeEventListener("message",r),e.setSuccess()))}),!1)}else e.setSuccess();return function(e,t,r){var n=null,o=new Promise((function(e,o){n=setTimeout((function(){o({error:r})}),t)}));return Promise.race([e,o]).finally((function(){clearTimeout(n)}))}(e.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function L(e){if(!e||"default"==e)return{login:function(e){return window.location.assign(o.createLoginUrl(e)),T().promise},logout:function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var n,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("GET"!==(null!==(n=null===t||void 0===t?void 0:t.logoutMethod)&&void 0!==n?n:o.logoutMethod)){e.next=4;break}return window.location.replace(o.createLogoutUrl(t)),e.abrupt("return");case 4:return i=o.createLogoutUrl(t),e.next=7,fetch(i,{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:r.redirectUri(t,!1)})});case 7:if(!(a=e.sent).redirected){e.next=11;break}return window.location.href=a.url,e.abrupt("return");case 11:if(!a.ok){e.next=14;break}return window.location.reload(),e.abrupt("return");case 14:throw new Error("Logout failed, request returned an error code.");case 15:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,s,"next",e)}function s(e){p(i,n,o,a,s,"throw",e)}a(void 0)}))});return function(e){return t.apply(this,arguments)}}(),register:function(e){return window.location.assign(o.createRegisterUrl(e)),T().promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof e)throw"Not supported by the OIDC server";return window.location.href=e,T().promise},redirectUri:function(e,t){return e&&e.redirectUri?e.redirectUri:o.redirectUri?o.redirectUri:location.href}};if("cordova"==e){a.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)},n=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)},i=function(){return o.redirectUri||"http://localhost"};return{login:function(e){var r=T(),a=n(e),s=o.createLoginUrl(e),c=t(s,"_blank",a),u=!1,l=!1,d=function(){l=!0,c.close()};return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(k(x(e.url),r),d(),u=!0)})),c.addEventListener("loaderror",(function(e){u||(0==e.url.indexOf(i())?(k(x(e.url),r),d(),u=!0):(r.setError(),d()))})),c.addEventListener("exit",(function(e){l||r.setError({reason:"closed_by_user"})})),r.promise},logout:function(e){var r,n=T(),a=o.createLogoutUrl(e),s=t(a,"_blank","location=no,hidden=yes,clearcache=yes");return s.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&s.close()})),s.addEventListener("loaderror",(function(e){0==e.url.indexOf(i())||(r=!0),s.close()})),s.addEventListener("exit",(function(e){r?n.setError():(o.clearToken(),n.setSuccess())})),n.promise},register:function(e){var r=T(),a=o.createRegisterUrl(),s=n(e),c=t(a,"_blank",s);return c.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&(c.close(),k(x(e.url),r))})),r.promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof e)throw"Not supported by the OIDC server";var r=t(e,"_blank","location=no");r.addEventListener("loadstart",(function(e){0==e.url.indexOf(i())&&r.close()}))},redirectUri:function(e){return i()}}}if("cordova-native"==e)return a.enable=!1,{login:function(e){var t=T(),r=o.createLoginUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),k(x(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},logout:function(e){var t=T(),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=T(),r=o.createRegisterUrl(e);return universalLinks.subscribe("keycloak",(function(e){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),k(x(e.url),t)})),window.cordova.plugins.browsertab.openUrl(r),t.promise},accountManagement:function(){var e=o.createAccountUrl();if("undefined"===typeof 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 C}catch(e){}return new R}();if(r=e&&["default","cordova","cordova-native"].indexOf(e.adapter)>-1?L(e.adapter):e&&"object"===m(e.adapter)?e.adapter:window.Cordova||window.cordova?L("cordova"):L(),e){if("undefined"!==typeof e.useNonce&&(u=e.useNonce),"undefined"!==typeof e.checkLoginIframe&&(a.enable=e.checkLoginIframe),e.checkLoginIframeInterval&&(a.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,"undefined"!==typeof e.pkceMethod){if("S256"!==e.pkceMethod&&!1!==e.pkceMethod)throw new TypeError("Invalid value for pkceMethod', expected 'S256' or false but got ".concat(e.pkceMethod,"."));o.pkceMethod=e.pkceMethod}else o.pkceMethod="S256";"boolean"===typeof e.enableLogging?o.enableLogging=e.enableLogging:o.enableLogging=!1,"POST"===e.logoutMethod?o.logoutMethod="POST":o.logoutMethod="GET","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=T(),s=T();s.promise.then((function(){o.onReady&&o.onReady(o.authenticated),i.setSuccess(o.authenticated)})).catch((function(e){i.setError(e)}));var c=function(e){var r,n=T();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 y()+"/protocol/openid-connect/auth"},token:function(){return y()+"/protocol/openid-connect/token"},logout:function(){return y()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var e=y()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},thirdPartyCookiesIframe:function(){var e=y()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(e=e+"?version="+o.iframeVersion),e},register:function(){return y()+"/protocol/openid-connect/registrations"},userinfo:function(){return y()+"/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||b(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 a=t.oidcProvider;if(a){var s,c;if("string"===typeof a)s="/"==a.charAt(a.length-1)?a+".well-known/openid-configuration":a+"/.well-known/openid-configuration",(c=new XMLHttpRequest).open("GET",s,!0),c.setRequestHeader("Accept","application/json"),c.onreadystatechange=function(){4==c.readyState&&(200==c.status||b(c)?(i(JSON.parse(c.responseText)),n.setSuccess()):n.setError())},c.send();else i(a),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 l(){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-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);window.addEventListener("message",(function t(r){r.origin===window.location.origin&&e.contentWindow===r.source&&(k(x(r.data),s),document.body.removeChild(e),window.removeEventListener("message",t))}))},n={};switch(e.onLoad){case"check-sso":a.enable?A().then((function(){I().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 d(){var t=x(window.location.href);if(t&&window.history.replaceState(window.history.state,null,t.newUrl),t&&t.valid)return A().then((function(){k(t,s)})).catch((function(e){s.setError(e)}));e?e.token&&e.refreshToken?(S(e.token,e.refreshToken,e.idToken),a.enable?A().then((function(){I().then((function(e){e?(o.onAuthSuccess&&o.onAuthSuccess(),s.setSuccess(),O()):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?l():s.setError(t)}))):e.onLoad?l():s.setSuccess():s.setSuccess()}return c.then((function(){(function(){var e=T(),t=function t(){"interactive"!==document.readyState&&"complete"!==document.readyState||(document.removeEventListener("readystatechange",t),e.setSuccess())};return document.addEventListener("readystatechange",t),t(),e.promise})().then(U).then(d).catch((function(e){i.setError(e)}))})),c.catch((function(e){i.setError(e)})),i.promise},o.login=function(e){return r.login(e)},o.createLoginUrl=function(e){var t,i=_(),a=_(),s=r.redirectUri(e),c={state:i,nonce:a,redirectUri:encodeURIComponent(s),loginOptions:e};e&&e.prompt&&(c.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 d=t+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(s)+"&state="+encodeURIComponent(i)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(l);if(u&&(d=d+"&nonce="+encodeURIComponent(a)),e&&e.prompt&&(d+="&prompt="+encodeURIComponent(e.prompt)),e&&e.maxAge&&(d+="&max_age="+encodeURIComponent(e.maxAge)),e&&e.loginHint&&(d+="&login_hint="+encodeURIComponent(e.loginHint)),e&&e.idpHint&&(d+="&kc_idp_hint="+encodeURIComponent(e.idpHint)),e&&e.action&&"register"!=e.action&&(d+="&kc_action="+encodeURIComponent(e.action)),e&&e.locale&&(d+="&ui_locales="+encodeURIComponent(e.locale)),e&&e.acr){var f=function(e){var t={id_token:{acr:e}};return JSON.stringify(t)}(e.acr);d+="&claims="+encodeURIComponent(f)}if((e&&e.acrValues||o.acrValues)&&(d+="&acr_values="+encodeURIComponent(e.acrValues||o.acrValues)),o.pkceMethod){var h=v(96,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");c.pkceCodeVerifier=h,d+="&code_challenge="+g(o.pkceMethod,h),d+="&code_challenge_method="+o.pkceMethod}return n.add(c),d},o.logout=function(e){return r.logout(e)},o.createLogoutUrl=function(e){var t;if("POST"===(null!==(t=null===e||void 0===e?void 0:e.logoutMethod)&&void 0!==t?t:o.logoutMethod))return o.endpoints.logout();var n=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(r.redirectUri(e,!1));return o.idToken&&(n+="&id_token_hint="+encodeURIComponent(o.idToken)),n},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=y(),n=void 0;return"undefined"!==typeof 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=y()+"/account",t=new XMLHttpRequest;t.open("GET",e,!0),t.setRequestHeader("Accept","application/json"),t.setRequestHeader("Authorization","bearer "+o.token);var r=T();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=T();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 h("[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=T();if(!o.refreshToken)return t.setError(),t.promise;e=e||5;var r=function(){var r=!1;if(-1==e?(r=!0,h("[KEYCLOAK] Refreshing token: forced refresh")):o.tokenParsed&&!o.isTokenExpired(e)||(r=!0,h("[KEYCLOAK] Refreshing token: token expired")),r){var n="grant_type=refresh_token&refresh_token="+o.refreshToken,a=o.endpoints.token();if(i.push(t),1==i.length){var s=new XMLHttpRequest;s.open("POST",a,!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){h("[KEYCLOAK] Token refreshed"),c=(c+(new Date).getTime())/2;var e=JSON.parse(s.responseText);S(e.access_token,e.refresh_token,e.id_token,c),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var t=i.pop();null!=t;t=i.pop())t.setSuccess(!0)}else{w("[KEYCLOAK] Failed to refresh token"),400==s.status&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(t=i.pop();null!=t;t=i.pop())t.setError(!0)}},s.send(n)}}else t.setSuccess(!1)};a.enable?I().then((function(){r()})).catch((function(e){t.setError(e)})):r();return t.promise},o.clearToken=function(){o.token&&(S(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};var C=function e(){if(!(this instanceof e))return new e;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");function t(){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(i){localStorage.removeItem(r)}}}}this.get=function(e){if(e){var r="kc-callback-"+e,n=localStorage.getItem(r);return n&&(localStorage.removeItem(r),n=JSON.parse(n)),t(),n}},this.add=function(e){t();var r="kc-callback-"+e.state;e.expires=(new Date).getTime()+36e5,localStorage.setItem(r,JSON.stringify(e))}},R=function e(){if(!(this instanceof e))return new e;var t=this;t.get=function(e){if(e){var t=n("kc-callback-"+e);return o("kc-callback-"+e,"",r(-100)),t?JSON.parse(t):void 0}},t.add=function(e){o("kc-callback-"+e.state,JSON.stringify(e),r(60))},t.removeItem=function(e){o(e,"",r(-100))};var r=function(e){var t=new Date;return t.setTime(t.getTime()+60*e*1e3),t},n=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""},o=function(e,t,r){var n=e+"="+t+"; expires="+r.toUTCString()+"; ";document.cookie=n}};function P(e){return function(){o.enableLogging&&e.apply(console,Array.prototype.slice.call(arguments))}}}({url:y,realm:k,clientId:b});function _(){var e=window.localStorage.getItem("kc-token"),t=window.localStorage.getItem("kc-refreshToken"),r=window.localStorage.getItem("kc-idToken"),n=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;return!!e&&!!t&&!!r&&n}function x(e){var t=document.getElementById(e);if(!t)throw new Error("Template not found: ".concat(e));return t.content.cloneNode(!0)}function E(){if(window.matchMedia("(max-width: 1024px)").matches)window.dispatchEvent(new CustomEvent("rappler-toggle-burger-nav"));else{var e=document.querySelector(".masthead__profile-dropdown");e&&e.classList.toggle("show")}}function T(){var e,t,r=document.getElementById("masthead__secondary-profile");if(r){var n;n=x("tmpl-piano-profile-logged-in");var o=window.rapplerNameInitials();null===(e=n.querySelector(".piano-user-initials"))||void 0===e||e.appendChild(document.createTextNode(o));var i=window.rapplerPianoGetUser().firstName;null===(t=n.querySelector(".piano-username"))||void 0===t||t.appendChild(document.createTextNode(i));var a,s=n.querySelector(".masthead__profile-body"),c=x("tmpl-piano-profile-loading");s.innerHTML=(a=c,[].map.call(a.children,(function(e){return e.outerHTML})).join("\n"));var u=n.querySelector(".masthead__profile-initials");u&&u.addEventListener("click",E),window.addEventListener("fixed-header-scroll",(function(e){2===e.detail.direction&&e.detail.curScroll>64&&document.querySelector(".masthead__profile-dropdown").classList.remove("show")})),n.querySelector(".piano-logout").addEventListener("click",(function(){window.rapplerLogout()})),r.querySelector(".masthead__profile--logged-out").remove(),r.appendChild(n)}}function A(){var e=document.querySelector(".masthead__profile--logged-out"),t=document.querySelector(".masthead__profile button");e&&t&&(e.style.opacity=1,t.style.cursor="pointer",t.addEventListener("click",(function(){window.rapplerPianoSignIn()})))}function O(){window.localStorage.removeItem("kc-token"),window.localStorage.removeItem("kc-refreshToken"),window.localStorage.removeItem("kc-idToken")}S.onTokenExpired=a()(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,S.updateToken(5);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),window.location.reload();case 8:case"end":return e.stop()}}),e,null,[[0,5]])}))),S.onAuthSuccess=function(){window.tp=window.tp||[],window.tp.push(["init",function(){window.tp.push(["setExternalJWT",S.idToken])}])},S.onReady=function(){window.keycloak.isAdapterInitialized=!0},S.onAuthLogout=function(){O(),window.location.reload()},S.isSafari=function(){return/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!==typeof safari&&window.safari.pushNotification).toString()},window.rapplerPianoSignIn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"login";if(!S.authenticated||"UPDATE_PASSWORD"===e){var t=document.getElementById("keycloak-login-page");if(!t&&["login","register","UPDATE_PASSWORD"].includes(e)){var r={redirectUri:window.location.origin+"/sso-redirect/",action:"login"===e?void 0:e};if(window.keycloak.isSafari())return S.login(r);window.localStorage.setItem("ra-keycloak-redirect",window.location.href);var n=S.createLoginUrl(r),o=document.createElement("div");o.id="keycloak-login-page";var i=document.createElement("div");i.classList.add("container");var a=document.createElement("iframe");a.src=n;var s=document.createElement("div");s.classList.add("close"),s.addEventListener("click",(function(){document.body.style.overflow="auto",document.body.removeChild(o)})),o.addEventListener("click",(function(e){e.target===o&&(document.body.style.overflow="auto",document.body.removeChild(o))})),i.appendChild(a),i.appendChild(s),o.appendChild(i),document.body.style.overflow="hidden",document.body.appendChild(o)}}},window.rapplerLogout=function(){window.tp=window.tp||[],window.tp.push(["init",a()(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.tp.push(["setExternalJWT",null]),window.localStorage.removeItem("ra-user-role"),window.localStorage.removeItem("ra-keycloak-redirect"),O(),e.next=6,S.logout({redirectUri:window.location.href});case 6:case"end":return e.stop()}}),e)})))])},window.rapplerPianoGetUser=function(){var e=null===S||void 0===S?void 0:S.idTokenParsed;if(e)return v(v({},e),{},{firstName:e.given_name,lastName:e.family_name})},window.rapplerNameWithInitial=function(){var e=window.rapplerPianoGetUser(),t=e.firstName,r=e.lastName,n="";return r&&(n=r.charAt(0)),"".concat(t," ").concat(n)},window.rapplerNameInitials=function(){var e=window.rapplerPianoGetUser(),t=e.firstName.charAt(0),r=e.lastName,n="";return r&&(n=r.charAt(0)),"".concat(t).concat(n)},window.rapplerPianoGetToken=function(){return null===S||void 0===S?void 0:S.idToken},window.rapplerPianoIsLoggedIn=function(){return(null===S||void 0===S?void 0:S.authenticated)||!1},window.addEventListener("message",(function(e){if(e.origin===y&&"resize"===e.data.event){var t=document.querySelector("#keycloak-login-page .container");t&&(t.style.height=e.data.value)}}),!1),a()(c.a.mark((function e(){var t,r,n,o,i,a,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t={onLoad:"check-sso",silentCheckSsoRedirectUri:window.location.origin+"/silent-check-sso/"},_()&&(null===(r=document.querySelector(".burger-nav__profile-top-url"))||void 0===r||r.classList.add("hide"),t.token=null!==(n=window.localStorage.getItem("kc-token"))&&void 0!==n?n:void 0,t.refreshToken=null!==(o=window.localStorage.getItem("kc-refreshToken"))&&void 0!==o?o:void 0,t.idToken=null!==(i=window.localStorage.getItem("kc-idToken"))&&void 0!==i?i:void 0,t.checkLoginIframe=!1),e.next=5,S.init(t);case 5:if(a=e.sent,!window.location.pathname.includes("sso-redirect")){e.next=20;break}if(!a){e.next=16;break}if(window.parent===window.self){e.next=11;break}return window.parent.location.reload(),e.abrupt("return");case 11:return s=window.localStorage.getItem("ra-keycloak-redirect"),window.location.href=s||window.location.origin,e.abrupt("return");case 16:return window.location.href=window.location.origin,e.abrupt("return");case 18:e.next=21;break;case 20:a?a&&T():A();case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(0),console.error("Failed to initialize keycloak adapter",e.t0);case 26:case"end":return e.stop()}}),e,null,[[0,23]])})))(),window.keycloak=S}]);