@luizleon/sf.prefeiturasp.vuecomponents 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.es.js +1 -1
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/keycloak.js +3 -1
- package/src/style/src/components/_tab-navigation.scss +5 -3
package/dist/lib.umd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
6
|
* @copyright Chen, Yi-Cyuan 2014-2023
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/(function(l){(function(){var o="input is invalid type",h=typeof window=="object",k=h?window:{};k.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!k.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?k=ke:U&&(k=self);var I=!k.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!k.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],z=[24,16,8,0],X=[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],ae=["hex","array","digest","arrayBuffer"],j=[];(k.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(k.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",v;A.from&&!k.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(v(g)).digest("hex"):d(g)};return i},Te=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Te("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,v){return C.create(E).update(v)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Te(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(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=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,v,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,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),C)for(v=this.start;E<i&&v<64;++E)g[v>>2]|=d[E]<<z[v++&3];else for(v=this.start;E<i&&v<64;++E)A=d.charCodeAt(E),A<128?g[v>>2]|=A<<z[v++&3]:A<2048?(g[v>>2]|=(192|A>>6)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):A<55296||A>=57344?(g[v>>2]|=(224|A>>12)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[v>>2]|=(240|A>>18)<<z[v++&3],g[v>>2]|=(128|A>>12&63)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=g[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=this.blocks,$,q,F,G,N,te,s,a,m,b,u;for($=16;$<64;++$)N=T[$-15],q=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[$-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[$]=T[$-16]+q+T[$-7]+F<<0;for(u=C&L,$=0;$<64;$+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):(q=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&v^~E&i,N=g+F+s+X[$]+T[$],te=q+G,g=A+N<<0,A=N+te<<0),q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&v,N=i+F+s+X[$+1]+T[$+1],te=q+G,i=L+N<<0,L=N+te<<0,q=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=v+F+s+X[$+2]+T[$+2],te=q+G,v=C+N<<0,C=N+te<<0,q=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),u=C&L,G=u^C&A^b,s=v&i^~v&g,N=E+F+s+X[$+3]+T[$+3],te=q+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+v<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[v>>28&15]+p[v>>24&15]+p[v>>20&15]+p[v>>16&15]+p[v>>12&15]+p[v>>8&15]+p[v>>4&15]+p[v&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,v>>24&255,v>>16&255,v>>8&255,v&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var v=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?v[g++]=T:T<2048?(v[g++]=192|T>>6,v[g++]=128|T&63):T<55296||T>=57344?(v[g++]=224|T>>12,v[g++]=128|T>>6&63,v[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),v[g++]=240|T>>18,v[g++]=128|T>>12&63,v[g++]=128|T>>6&63,v[g++]=128|T&63);d=v}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var $=[],q=[];for(A=0;A<64;++A){var F=d[A]||0;$[A]=92^F,q[A]=54^F}J.call(this,C,L),this.update(q),this.oKeyPad=$,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(k.sha256=Z.sha256,k.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Ve extends Error{}Ve.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let k=h.charCodeAt(0).toString(16).toUpperCase();return k.length<2&&(k="0"+k),"%"+k}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Ve("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,k=l.split(".")[h];if(typeof k!="string")throw new Ve(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(k)}catch(x){throw new Ve(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Ve(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,k=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),z=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=q(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=q("cordova"):h=q(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.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=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},B=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?B():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?B():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(B){b.setError(B)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(B){B?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(B){b.setError(B)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(B){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(B)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),B=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",B),_.setSuccess())};return document.addEventListener("readystatechange",B),B(),_.promise}return u.then(function(){y().then($).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var B=ae(96);u.pkceCodeVerifier=B;var M=Ce(o.pkceMethod,B);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(k.push(a),k.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var B=JSON.parse(y.responseText);Z(B.access_token,B.refresh_token,B.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=k.pop();M!=null;M=k.pop())M.setSuccess(!0)}else{z("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=k.pop();M!=null;M=k.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Te(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),B=new XMLHttpRequest;B.open("POST",_,!0),B.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),B.withCredentials=!0,B.onreadystatechange=function(){if(B.readyState==4)if(B.status==200){var H=JSON.parse(B.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},B.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m="keycloak.json";function b(B){B?o.endpoints={authorize:function(){return B.authorization_endpoint},token:function(){return B.token_endpoint},logout:function(){if(!B.end_session_endpoint)throw"Not supported by the OIDC server";return B.end_session_endpoint},checkSessionIframe:function(){if(!B.check_session_iframe)throw"Not supported by the OIDC server";return B.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!B.userinfo_endpoint)throw"Not supported by the OIDC server";return B.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var B=JSON.parse(u.responseText);o.authServerUrl=B["auth-server-url"],o.realm=B.realm,o.clientId=B.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),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,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function v(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Te():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function $(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(z(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
8
|
+
*/(function(l){(function(){var o="input is invalid type",h=typeof window=="object",k=h?window:{};k.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!k.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?k=ke:U&&(k=self);var I=!k.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!k.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],z=[24,16,8,0],X=[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],ae=["hex","array","digest","arrayBuffer"],j=[];(k.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(k.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",v;A.from&&!k.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(v(g)).digest("hex"):d(g)};return i},Te=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Te("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,v){return C.create(E).update(v)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Te(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(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=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,v,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,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),C)for(v=this.start;E<i&&v<64;++E)g[v>>2]|=d[E]<<z[v++&3];else for(v=this.start;E<i&&v<64;++E)A=d.charCodeAt(E),A<128?g[v>>2]|=A<<z[v++&3]:A<2048?(g[v>>2]|=(192|A>>6)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):A<55296||A>=57344?(g[v>>2]|=(224|A>>12)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[v>>2]|=(240|A>>18)<<z[v++&3],g[v>>2]|=(128|A>>12&63)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=g[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=this.blocks,$,q,F,G,N,te,s,a,m,b,u;for($=16;$<64;++$)N=T[$-15],q=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[$-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[$]=T[$-16]+q+T[$-7]+F<<0;for(u=C&L,$=0;$<64;$+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):(q=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&v^~E&i,N=g+F+s+X[$]+T[$],te=q+G,g=A+N<<0,A=N+te<<0),q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&v,N=i+F+s+X[$+1]+T[$+1],te=q+G,i=L+N<<0,L=N+te<<0,q=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=v+F+s+X[$+2]+T[$+2],te=q+G,v=C+N<<0,C=N+te<<0,q=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),u=C&L,G=u^C&A^b,s=v&i^~v&g,N=E+F+s+X[$+3]+T[$+3],te=q+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+v<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[v>>28&15]+p[v>>24&15]+p[v>>20&15]+p[v>>16&15]+p[v>>12&15]+p[v>>8&15]+p[v>>4&15]+p[v&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,v>>24&255,v>>16&255,v>>8&255,v&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var v=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?v[g++]=T:T<2048?(v[g++]=192|T>>6,v[g++]=128|T&63):T<55296||T>=57344?(v[g++]=224|T>>12,v[g++]=128|T>>6&63,v[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),v[g++]=240|T>>18,v[g++]=128|T>>12&63,v[g++]=128|T>>6&63,v[g++]=128|T&63);d=v}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var $=[],q=[];for(A=0;A<64;++A){var F=d[A]||0;$[A]=92^F,q[A]=54^F}J.call(this,C,L),this.update(q),this.oKeyPad=$,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(k.sha256=Z.sha256,k.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Ve extends Error{}Ve.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let k=h.charCodeAt(0).toString(16).toUpperCase();return k.length<2&&(k="0"+k),"%"+k}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Ve("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,k=l.split(".")[h];if(typeof k!="string")throw new Ve(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(k)}catch(x){throw new Ve(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Ve(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,k=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),z=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=q(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=q("cordova"):h=q(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.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=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},B=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?B():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?B():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(B){b.setError(B)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(B){B?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(B){b.setError(B)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(B){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(B)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),B=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",B),_.setSuccess())};return document.addEventListener("readystatechange",B),B(),_.promise}return u.then(function(){y().then($).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var B=ae(96);u.pkceCodeVerifier=B;var M=Ce(o.pkceMethod,B);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(k.push(a),k.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var B=JSON.parse(y.responseText);Z(B.access_token,B.refresh_token,B.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=k.pop();M!=null;M=k.pop())M.setSuccess(!0)}else{z("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=k.pop();M!=null;M=k.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Te(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),B=new XMLHttpRequest;B.open("POST",_,!0),B.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),B.withCredentials=!0,B.onreadystatechange=function(){if(B.readyState==4)if(B.status==200){var H=JSON.parse(B.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},B.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m=location.origin+"/keycloak.json";function b(B){B?o.endpoints={authorize:function(){return B.authorization_endpoint},token:function(){return B.token_endpoint},logout:function(){if(!B.end_session_endpoint)throw"Not supported by the OIDC server";return B.end_session_endpoint},checkSessionIframe:function(){if(!B.check_session_iframe)throw"Not supported by the OIDC server";return B.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!B.userinfo_endpoint)throw"Not supported by the OIDC server";return B.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var B=JSON.parse(u.responseText);o.authServerUrl=B["auth-server-url"],o.realm=B.realm,o.clientId=B.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),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,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function v(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Te():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function $(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(z(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
9
9
|
|
|
10
10
|
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
11
11
|
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|