var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); MeControlDefine("meBoot",["exports","@mecontrol/web-inline"],function(t,S){"use strict";var c=function(){},i={},u=[],p=[];function O(t,e){var r,n,o,i,a=p;for(i=arguments.length;2a[0]&&e[1]>>e&24),2!=e&&t.length-a!=1||(n+=String.fromCharCode(vt(i>>>18&63),vt(i>>>12&63),vt(i>>>6&63),vt(63&i)),i=0);if(0==r)return n;var s=n.substring(0,n.length-r);return 1==r?s+"=":s+"=="}(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function vt(t){return t<26?t+65:t<52?t+71:t<62?t-4:62===t?43:63===t?47:65}var It=(At.prototype.initCodeFlow=function(){var r=this;return function(){return W(this,void 0,S.Promise,function(){var e,r,n;return G(this,function(t){switch(t.label){case 0:return e=window.crypto,window.msCrypto&&!e&&(e=window.msCrypto),r=function(t){var e=new Uint8Array(32);return t.getRandomValues(e),yt(e)}(e),[4,St(e,r)];case 1:return n=t.sent(),[2,{verifier:r,challenge:n}]}})})}().then(function(t){var e;r.code=t,r.state=null!=(e=r.state)?e:wt()})},At.prototype.getCodeReqUrl=function(){return ht(S.ME.Config.graphinfo.graphcodeurl,this.GetCodeQueryParams(),!1)},At.prototype.GetCodeQueryParams=function(){var t,e,r={client_id:this.client_id,scope:this.scope,code_challenge:null===(t=this.code)||void 0===t?void 0:t.challenge,code_challenge_method:this.code_challenge_method,prompt:this.prompt,redirect_uri:this.redirect_uri,response_mode:this.response_mode,response_type:this.response_type,state:(e=this.state,null!=e?e:wt())};if("aad"===this.account.type&&this.account.sessionId)r.sid=this.account.sessionId;else if(this.account.login_hint)r.login_hint=this.account.login_hint;else{if(!this.account.memberName)throw"Fatal Error: Account is missing critical id info.";r.login_hint=this.account.memberName}return r},At.prototype.GetFrameInitResponse=function(){if(!this.state)throw"Critical error: Missing state of transaction.";return{accountId:this.accountId,state:this.state,qParams:{code_verifier:this.code.verifier,client_id:this.client_id,scope:this.scope,redirect_uri:this.redirect_uri,grant_type:this.grant_type},graphResources:this.graphResources}},At);function At(t,e,r,n,o){this.account=t,this.accountId=e,this.graphResources=r,this.state=n,this.code={challenge:"",verifier:""},this.client_id=S.ME.Config.graphinfo.graphclientid,this.scope=S.ME.Config.graphinfo.graphscope,this.code_challenge_method="S256",this.grant_type="authorization_code",this.response_type="code",this.response_mode="fragment",this.prompt="none",this.code_challenge_method,this.response_type="code",this.response_mode="fragment",this.redirect_uri=null!=o?o:S.ME.Config.graphinfo.graphredirecturi}function wt(){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",e="0123456789abcdef",r=0,n="",o=0;o<36;o++)"-"!==t[o]&&"4"!==t[o]&&(r=16*Math.random()|0),"x"===t[o]?n+=e[r]:"y"===t[o]?(r&=3,n+=e[r|=8]):n+=t[o];return n}function St(n,r){return W(this,void 0,S.Promise,function(){var e;return G(this,function(t){switch(t.label){case 0:return e=function(t){for(var e,r=0,n=t.length,o=0;o>>6):(e<65536?i[a++]=224+(e>>>12):(e<2097152?i[a++]=240+(e>>>18):(e<67108864?i[a++]=248+(e>>>24):(i[a++]=252+(e>>>30),i[a++]=128+(e>>>24&63)),i[a++]=128+(e>>>18&63)),i[a++]=128+(e>>>12&63)),i[a++]=128+(e>>>6&63)),i[a++]=128+(63&e));return i}(r),window.crypto?[4,function(t){return window.crypto.subtle?window.crypto.subtle.digest("SHA-256",t).then(function(t){return yt(new Uint8Array(t))}):S.Promise.resolve("")}(e)]:[3,2];case 1:return[2,t.sent()];case 2:return[2,new S.Promise(function(r,t){n.subtle&&(n.subtle.digest("SHA-256",e).oncomplete=function(t){var e=t.target.result;r(yt(new Uint8Array(e)))})})];case 3:return[2]}})})}var Ot={expect:!1,received:!1},bt=0,Et=5e4,Tt=(_t.prototype.postMessageToIframe=function(t){this.iframeHandle.contentWindow&&this.iframeHandle.contentWindow.postMessage(t,this.iframeTargetOrigin)},_t.prototype.pushResult=function(t){this.messages.push(t)},_t);function _t(t,e){this.src=t,this.messages=[],this.iframeHandle=document.createElement("iframe"),this.iframeHandle.id="mecontrol-iframe-"+bt++,this.iframeHandle.sandbox="allow-forms allow-scripts allow-same-origin",this.iframeHandle.src=t,this.iframeHandle.style.display="none",this.iframeTargetOrigin=null!=e?e:Rt(t)}function Ut(t,e,r,n,o){return void 0===r&&(r=1),void 0===n&&(n=function(){return!0}),void 0===o&&(o=void 0),Ot.expect=!1,Pt(t,e,r,n,o)}function Ct(n,t){Ot.expect=!0;var e=Rt(n.redirect_uri);return Pt(n.getCodeReqUrl(),t,1,void 0,void 0,function(t,e){var r=t.data;if(n.state==r.state)switch(r.status){case"INI":Ot.received=!0,e.postMessageToIframe(n.GetFrameInitResponse());break;default:e.pushResult(r)}},e)}function Ft(n,o,t){Ot.expect=!0;var e=S.getRootDomainUrl(),i=wt(),a=S.ME.Config.ptn;return Pt(e+"/me/mecache?partner="+a+"&wreply="+window.encodeURIComponent(window.location.origin),t,(n?n.length:0)+(o?o.length:0),void 0,void 0,function(t,e){var r=t.data;if(i===r.state||a===r.state)switch(r.status){case"INI":Ot.received=!0,e.postMessageToIframe({state:i,gets:n,sets:o});break;default:e.pushResult(r)}},e)}function Pt(p,d,l,f,t,h,e){return void 0===l&&(l=1),void 0===f&&(f=function(){return!0}),void 0===t&&(t=void 0),new S.Promise(function(r,n){S.w.postMessage||n(S.createError("window.postMessage not supported in this browser")),"https:"!==S.getPageLocation().protocol&&n(S.createError("Iframes can only be opened on pages that are HTTPS secured"));var o=S.perfNow(),i=new Tt(p,e),a=setTimeout(c,t?1e4:Et);function s(t){try{if(t.origin!==i.iframeTargetOrigin||i.iframeHandle.contentWindow!=t.source)return;if(!f(t.data))return;h?h(t,i):i.messages.push(t.data),i.messages.length===l?(u(!0),r(i.messages)):(clearTimeout(a),a=setTimeout(c,Et))}catch(t){if(t instanceof Error)u(!1,t.stack?t.stack:t.toString()),n(t);else{var e="Failure in handler.";u(!1,e),n(S.createError(e,!1))}}}function c(){var t="Iframe operation to "+i.iframeTargetOrigin+" timed out. ";Ot.expect&&!Ot.received?t+="Iframe failed to load and send first INIT trigger to parent.":Ot.expect&&(t+="Iframe succeeded to load and send INIT trigger to parent."),u(!1,t),n(S.createError(t,!0))}function u(t,e){clearTimeout(a),S.w.removeEventListener("message",s),null!==i.iframeHandle.parentNode&&i.iframeHandle.parentNode.removeChild(i.iframeHandle);try{!function(t,e,r,n,o){var i=t,a=S.perfNow()-r;S.logTelemetryEvent({eventType:"OutgoingRequest",serviceOperation:i.operation,service:i.service,url:e,success:n,duration:a,message:o})}(d,p,o,t,e)}catch(t){}}0>>0;if("function"!=typeof e)throw TypeError("predicate must be a function");for(var i=r,a=0;at.clientWidth&&c++<10;)a-=2,i.font=a+"px "+r,s=i.measureText(t.innerHTML).width;o!=a?(t.style.fontSize=a+"px",this.computedSizesCache[t.innerHTML]=t.style.fontSize):this.computedSizesCache[t.innerHTML]=""},Qe.prototype.getPictureStatus=function(t,e){return e[t]||{status:"None",tries:0}},Qe.prototype.getValidGlyph=function(t,e){return t||(e?"aad"===e.type?"glyph_aadAccount_circle":"glyph_account_circle":"mectrl_signIn_circle_glyph")},Qe.prototype.shouldRenderInitials=function(t){return!!t&&!!t.initials&&1<=t.initials.length&&t.initials.length<=2},Qe);function Qe(t){var e=ze.call(this,t)||this;return e.computedSizesCache={},e.isComputingInitials=!1,e}var Ke=rt(function(t){return{picturesStatus:t.picturesStatus}},function(r){return{loadPicture:function(t,e){r(Ue(t,e))},fetchMSGraphPicture:function(t){r(function(a){return function(c,t){if(!S.ME.Config.graphv2)return S.Promise.resolve();var o=a&&zt(a)||"";if(""===o)return S.Promise.resolve();c({type:"GET_GRAPH_PIC_START",payload:{accountId:o}});var u={eventType:"TrackedScenario",scenario:"Get Graph Picture",action:"",previousAction:"START",success:!0,durationMs:0,details:""},e=window.crypto||window.msCrypto,p={};return St(e,o).then(function(t){var e=a.cacheMeta?a.cacheMeta.pictureUrl:void 0,r=[{key:t,resourceType:"pictureUrl",resourceName:"pictureUrl",resourceUrl:S.ME.Config.graphinfo.graphphotourl,resourceETag:e,resource:null}];p[t]=o;var n=new It(a,t,r);return n.initCodeFlow().then(function(){return Ct(n,Ce).then(i).catch(function(t){u.action="BAD",u.details=t.message,u.success=!1,S.logTelemetryEvent(u)})})});function i(t){var e,r,n,o,i;if(void 0!==t){var a=t[0];u.action=a.status;var s=null!=(e=a.payload.resource)?e:a.payload.pictureUrl;"OK"===a.status&&s?c({type:"GET_GRAPH_PIC_SUCCESS",payload:{accountId:p[(r=a.payload.key,null!=r?r:a.accountId)],pictureUrl:s}}):"NOOP"===(null===(n=a)||void 0===n?void 0:n.status)?u.details="Graph call: 304 Not Modified":(u.details=null!=(i=null!=(o=a.error_description)?o:a.error)?i:"Graph call: Failed",u.success=!1),S.logTelemetryEvent(u)}}}}(t))}}})(Je);function Xe(t){return t}var $e,Ye=0,Ze=(w(tr,$e=v),tr.prototype.dismissHandler=function(t){if(this.state.show)switch(t.key){case"Escape":case"Esc":this.changeVisibility(!1)}},tr.prototype.changeVisibility=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r=!1),void 0===n&&(n=void 0),this.setState({show:t,isFocusTriggered:e,immediate:r,timeout:n})},tr.prototype.showOnClick=function(){var t=this,e=setTimeout(function(){t.changeVisibility(!1,!1)},4e3);this.changeVisibility(!0,!1,!0,e)},tr.prototype.removeTooltip=function(){try{this.state.timeout&&clearTimeout(this.state.timeout)}catch(t){}this.changeVisibility(!1,!1)},tr.prototype.renderTooltip=function(t){if(t){var e=O("span",{id:this.id,class:"mectrl_tooltip",role:"tooltip"},this.props.text);this.element=I(e,document.body,this.element)}else this.element&&(this.element=I(null,document.body,this.element))},tr.prototype.componentDidUpdate=function(t,e){var r=this,n=this.state,o=n.show,i=n.isFocusTriggered,a=document.querySelector(".mectrl_root.mectrl_focus_visible");this.props.hideOverride?this.renderTooltip(!1):e.show===o&&e.isFocusTriggered===i&&t.text===this.props.text||(!o||i&&!a?this.renderTooltip(!1):(this.renderTooltip(!0),setTimeout(function(){fe(function(){kt(r.element)&&kt(r.base)&&function(t,e){var r=he(t),n=he(e),o=ge(),i=n.top>=r.height+7?n.top-7-r.height:n.bottom+7,a=n.width/2+n.left-r.width/2;a+r.width>o.right&&(a=o.right-r.width),a<0&&(a=0),t&&t.style&&(t.style.left=a+"px",t.style.top=i+"px",t.style.right="auto",t.style.bottom="auto",t.style.visibility="visible")}(r.element,r.base)})},this.state.immediate?0:700)))},tr.prototype.componentWillUnmount=function(){this.renderTooltip(!1)},tr.prototype.render=function(){var e=this,t=Xe(this.props.children).map(function(t){return function(t,e){return O(t.nodeName,T(T({},t.attributes),e),2=this.props.width)},mr.prototype.breakpointCheck=function(t){this.mounted&&t!=this.state.valueExceeded&&this.setState({valueExceeded:t})},mr.prototype.setupWatcher=function(){this.watching||(this.watching=!0,window.matchMedia?(this.mediaQueryWatcher=window.matchMedia("(min-width: "+this.props.width+"px)"),this.mediaQueryWatcher.addListener(this.mediaQueryHandler)):window.addEventListener("resize",this.resizeDebouncer))},mr.prototype.clearWatcher=function(){this.watching&&(this.watching=!1,this.mediaQueryWatcher?this.mediaQueryWatcher.removeListener(this.mediaQueryHandler):(this.resizeDebouncer.cancel(),window.removeEventListener("resize",this.resizeDebouncer)))},mr.prototype.componentDidMount=function(){this.mounted=!0,"auto"===this.props.mode&&this.setupWatcher()},mr.prototype.componentWillUnmount=function(){this.mounted=!1,this.clearWatcher()},mr.prototype.componentDidUpdate=function(){"auto"===this.props.mode?this.setupWatcher():this.clearWatcher()},mr.prototype.render=function(){var t="auto"===this.props.mode&&this.state.valueExceeded||"standard"===this.props.mode;return this.props.render(t)},mr);function mr(t){var e=hr.call(this,t)||this;e.mediaQueryHandler=e.mediaQueryHandler.bind(e),e.resizeDebouncer=pe(e.resizeHandler.bind(e));var r=window.innerWidth>=e.props.width;return e.state={valueExceeded:r},e.mounted=!1,e.watching=!1,e}function yr(t){return O("span",{class:"mectrl_screen_reader_text"},t.children)}var vr,Ir,Ar=(wr.prototype.isOperationSupported=function(t){return"function"==typeof this.config[t]},wr.prototype.signIn=function(t){return this.config.signIn(t)},wr.prototype.signInTo=function(t){if(this.isOperationSupported("signInTo"))return this.config.signInTo(t);throw S.createError("switch is not supported")},wr.prototype.signOutFromApp=function(t){return this.config.signOutFromApp(t)},wr.prototype.signOutFromIdp=function(t){if(this.isOperationSupported("signOutFromIdp"))return S.Promise.resolve(this.config.signOutFromIdp(t));throw S.createError("switch is not supported")},wr.prototype.signOutAndForgetFromIdp=function(t){if(this.isOperationSupported("signOutFromIdp"))return S.Promise.resolve(this.config.signOutAndForgetFromIdp(t));throw S.createError("switch is not supported")},wr.prototype.switch=function(t){if(this.isOperationSupported("switch"))return this.config.switch(t);throw S.createError("switch is not supported")},wr.prototype.switchTo=function(t){if(this.isOperationSupported("switchTo"))return this.config.switchTo(t);throw S.createError("switchTo is not supported")},wr.prototype.getRememberedAccounts=function(){if(this.isOperationSupported("getRememberedAccounts"))return S.Promise.resolve(this.config.getRememberedAccounts());throw S.createError("getRememberedAccounts is not supported")},wr);function wr(t){this.config=t,this.supportedSignInAccountTypes=this.config.signInExperienceTypes}var Sr=((vr={}).aad="aad",vr.msa="msa",vr.msaFed="msaFed",vr),Or=((Ir={})[3]="notSignedIn",Ir[1]="signedIn",Ir[2]="signedInIDPOnly",Ir);function br(t){var e,r=t,n=t,o=Or[t.authenticatedState];return o||(o=Or[3],S.logTelemetryEvent({eventType:"ClientError",name:"Undefined Authenticated State",type:"UndefinedAuthState",details:"An unsupported authenticated state was supplied: "+t.authenticatedState,severity:3,displayed:!1})),{type:Sr[t.idp],memberName:me(t.memberName),authenticatedState:(e=o,"signedIn"===e?"signedInIDPOnly":e),firstName:me(t.firstName),lastName:me(t.lastName),pictureUrl:t.tileUrl,cid:r.cid,hA:r.hA,displayName:me(n.displayName),orgName:me(n.orgName),orgLogoUrl:n.orgLogoUrl,sessionId:n.sessionId,roleName:me(n.roleName),isWindowsSso:n.isWindowsSso}}var Er="login_hint",Tr="ru",_r="sessionId";function Ur(t,e,r){var n={};return gt(t,"ru")||(n[Tr]=S.getPageLocation().href),e&&(n[Er]=e),r&&(n[_r]=r),ht(t,n)}function Cr(t){return Ur(t)}function Fr(t,e){return Ur(t,e.nextAccount.memberName)}function Pr(t,e){return Ur(t,void 0,e.currentAccount.sessionId)}function Rr(t,e){var r;return ht(t,((r={})[_r]=e.account.sessionId,r.shouldForgetUser="false",r.isIframe="true",r))}function Nr(t,e){var r;return ht(t,((r={})[_r]=e.account.sessionId,r.shouldForgetUser="true",r.isIframe="true",r))}var Dr={proxyToOtherIdp:!1};function xr(t,e){return void 0===e&&(e=H({},Dr)),new Hr(t,{proxyToOtherIdp:e.proxyToOtherIdp&&S.ME.Config.aad&&S.ME.Config.pxy})}function Mr(t,e){return void 0===e&&(e=H({},Dr)),new kr(t,{proxyToOtherIdp:e.proxyToOtherIdp&&S.ME.Config.pxy})}var kr=(Lr.prototype.signOutFromIdp=function(t,e){var r=zr(this.idpName),n=this.getSignOutIframeUrl(t);return this.openSignOutIframe(n,t.account,!1,r,e)},Lr.prototype.signOutAndForgetFromIdp=function(e,t){var r=this;if("notSignedIn"===e.account.authenticatedState){var n=Qr(this.idpName);return Ut(o=this.getForgetIframeUrl(e),n,0).then(function(){return t?t.getRememberedAccounts():r.getRememberedAccounts()}).then(function(t){if(null!=Yt(t,e.account))throw S.createError("Forget user failed. IDP getRememberedAccounts contains account user attempted to forget.")})}n=Jr(this.idpName);var o=this.getSignOutAndForgetIframeUrl(e);return this.openSignOutIframe(o,e.account,!0,n,t)},Lr.prototype.getRememberedAccounts=function(){if(!S.ME.Config.aad)return S.Promise.reject(S.createError("AAD Remembered Accounts disabled"));var t=qr(this.idpName);return Gr(this.config.rememberedAccountsUrl,this.options,t)},Lr.prototype.getSignOutIframeUrl=function(t){if(!this.config.signOutUrl)throw S.createError("AadWebIdp is not configured for signOutFromIdp.");switch(t.account.type){case"aad":case"msaFed":return Nt(this.config.signOutUrl)?Rr(this.config.signOutUrl,t):this.config.signOutUrl(t);default:throw S.createError("AadWebAccountsProvider: SignOut operation not supported for "+t.account.type)}},Lr.prototype.getSignOutAndForgetIframeUrl=function(t){if(!this.config.signOutAndForgetUrl)throw S.createError("AadWebIdp is not configured for signOutAndForgetFromIdp.");switch(t.account.type){case"msaFed":case"aad":return Nt(this.config.signOutAndForgetUrl)?Nr(this.config.signOutAndForgetUrl,t):this.config.signOutAndForgetUrl(t);default:throw S.createError("AadWebAccountsProvider: SignOutAndForget operation not supported for "+t.account.type)}},Lr.prototype.getForgetIframeUrl=function(t){if(!this.config.forgetUrl)throw S.createError("AadWebIdp is not configured for forgetFromIdp");switch(t.account.type){case"msaFed":case"aad":return Nt(this.config.forgetUrl)?function(t,e){var r;return ht(t,((r={})[_r]=e.account.sessionId,r))}(this.config.forgetUrl,t):this.config.forgetUrl(t);default:throw S.createError("AadWebAccountsProvider: ForgetFromIdp operation not supported for "+t.account.type)}},Lr.prototype.openSignOutIframe=function(t,r,n,e,o){var i=this;return Ut(t,e,1).then(Br).then(function(){return o?o.getRememberedAccounts():i.getRememberedAccounts()}).then(function(t){var e=Yt(t,r);if(n&&null!=e)throw S.createError("Sign out failed. IDP getRememberedAccounts contains account user attempted to remove.");if(e&&"notSignedIn"!==e.authenticatedState)throw S.createError("Sign out failed. IDP did not indicate the account was signed out successfully.")})},Lr);function Lr(t,e){this.config=t,this.options=e,this.idpName="AAD"}var Hr=(jr.prototype.signOutFromIdp=function(t){return S.Promise.reject(S.createError("MsaWebIdp does not support signOutFromIdp."))},jr.prototype.signOutAndForgetFromIdp=function(t,e){var r=Jr(this.idpName),n=this.getSignOutAndForgetIframeUrl(t);return this.openSignOutIframe(n,t.account,r,e)},jr.prototype.getRememberedAccounts=function(){if(!this.config.rememberedAccountsUrl)return S.Promise.reject(S.createError("MSA Remembered Accounts disabled"));var t=qr(this.idpName);return Gr(this.config.rememberedAccountsUrl,this.options,t)},jr.prototype.getSignOutAndForgetIframeUrl=function(t){if(!this.config.signOutAndForgetUrl)throw S.createError("Partner failed to provide a URL or callback to generate a URL for SignOutAndForget.");switch(t.account.type){case"aad":case"msaFed":throw S.createError("MsaWebAccountsProvider: SignOutAndForget operation not supported for "+t.account.type);case"msa":return Nt(this.config.signOutAndForgetUrl)?Nr(this.config.signOutAndForgetUrl,t):this.config.signOutAndForgetUrl(t)}},jr.prototype.openSignOutIframe=function(t,e,r,n){var o=this;return n&&"webAadWithMsaProxy"===n.config.type?Ut(t,r,1,function(){return!0},n).then(Br).then(function(){return n?n.getRememberedAccounts():o.getRememberedAccounts()}).then(function(t){if(null!=Yt(t,e))throw S.createError("Sign out failed. IDP getRememberedAccounts contains account user attempted to remove.")}).catch(function(){(n?n.getRememberedAccounts():o.getRememberedAccounts()).then(function(t){if(null!=Yt(t,e))throw S.createError("Sign out failed. IDP getRememberedAccounts contains account user attempted to remove.")})}):Ut(t,r,1).then(Br).then(function(){return n?n.getRememberedAccounts():o.getRememberedAccounts()}).then(function(t){if(null!=Yt(t,e))throw S.createError("Sign out failed. IDP getRememberedAccounts contains account user attempted to remove.")})},jr);function jr(t,e){this.config=t,this.options=e,this.idpName="MSA"}function Wr(t){if("string"!=typeof t)return!1;var e;try{e=JSON.parse(t)}catch(t){return!1}return"object"==typeof e&&null!=e&&("error"in e||"userList"in e)}function Gr(t,e,r){if(!S.ME.Config.remAcc)return S.Promise.reject(S.createError("Remembered Accounts disabled"));if(!t)return S.Promise.reject(S.createError(r.service+"WebIdp not configured for getRememberedAccounts."));var n;n=ht(n="function"==typeof t?t():t,{uaid:S.id,partnerId:S.ME.Config.ptn}),e.proxyToOtherIdp&&(n=ht(n,{idpflag:"proxy"}));var o=1;return e.proxyToOtherIdp&&(o=2),Ut(n,r,o,Wr).then(function(t){return t.map(Vr).reduce(function(t,e){return t.concat(e)},[])})}function Vr(t){if("string"!=typeof t)throw S.createError("Invalid message from IDP. Was not a string.");var e=JSON.parse(t);if(e&&e.error){if("8004100C"===e.error)return[];throw"InvalidProxiedDomain"===e.error?(S.logTelemetryEvent({eventType:"ClientError",name:"Invalid proxy domain used for get remembered accounts iFrame",type:"RememberedAccountsProxyFailure",details:"iFrame hostname: "+window.location.hostname,displayed:!1}),S.createError("Invalid proxy domain used for get remembered accounts iFrame")):S.createError("Remembered Accounts API returned an error: "+e.error)}if(e&&e.userList)return e.userList.map(br);throw S.createError("MSA Remembered Accounts API returned invalid data")}function Br(t){var e=t[0];if("string"!=typeof e)throw S.createError("Invalid message from IDP. Was not a string.");if("signedout"!==e){var r=JSON.parse(e);if(r.error&&"InvalidProxiedDomain"===r.error)throw S.logTelemetryEvent({eventType:"ClientError",name:"Invalid proxy domain used for sign out of remembered account iFrame",type:"RememberedAccountsProxyFailure",details:"iFrame hostname: "+window.location.hostname,displayed:!1}),S.createError("Sign out operation failed due to Invalid proxy domain used for sign out of remembered account iFrame");var n=r.signoutStatus;if("true"!==n.toString())throw S.createError("Sign out operation failed with signoutStatus: "+n.toString())}}var qr=function(t){return{name:"GetRememberedAccounts",operation:"GetRememberedAccounts",service:t.toUpperCase()}},zr=function(t){return{name:"SignOutFromIdp",operation:"SignOut",service:t.toUpperCase()}},Jr=function(t){return{name:"SignOutAndForgetFromIdp",operation:"SignOut",service:t.toUpperCase()}},Qr=function(t){return{name:"ForgetFromIdp",operation:"ForgetAccount",service:t.toUpperCase()}};function Kr(t,e){return t.isOperationSupported("switchTo",e)||t.isOperationSupported("signInTo",e)}function Xr(t){var e="getRememberedAccounts";return t.isOperationSupported(e,"msa")||t.isOperationSupported(e,"msaFed")||t.isOperationSupported(e,"aad")}var $r=(Yr.prototype.getSignInUrl=function(t){return Nt(this.config.appSignInUrl)?Cr(this.config.appSignInUrl):this.config.appSignInUrl()},Yr.prototype.getSignInToUrl=function(t){return Nt(this.config.appSignInToUrl)?Fr(this.config.appSignInToUrl,t):this.config.appSignInToUrl(t)},Yr.prototype.getSignOutFromAppUrl=function(t){return Nt(this.config.appSignOutUrl)?Pr(this.config.appSignOutUrl,t):this.config.appSignOutUrl(t)},Yr.prototype.getSignOutFromIdpUrl=function(t){},Yr.prototype.getSignOutAndForgetFromIdpUrl=function(t){},Yr.prototype.getSwitchUrl=function(t){return Nt(this.config.appSwitchUrl)?function(t){return Ur(t)}(this.config.appSwitchUrl):this.config.appSwitchUrl(t)},Yr.prototype.getSwitchToUrl=function(t){return Nt(this.config.appSwitchToUrl)?function(t,e){return Ur(t,e.nextAccount.memberName)}(this.config.appSwitchToUrl,t):this.config.appSwitchToUrl(t)},Yr);function Yr(t){this.config=t}var Zr=(tn.prototype.isOperationSupported=function(t,e){var r,n,o,i,a;switch(t){case"signIn":return xt(this.config.appSignInUrl);case"signInTo":return xt(this.config.appSignInToUrl);case"signOutFromApp":return xt(this.config.appSignOutUrl);case"signOutFromIdp":return("aad"===e||"msaFed"===e)&&xt(null===(r=this.config.aad)||void 0===r?void 0:r.signOutUrl);case"signOutAndForgetFromIdp":return("aad"===e||"msaFed"==e)&&xt(null===(n=this.config.aad)||void 0===n?void 0:n.signOutAndForgetUrl)||"msa"===e&&xt(null===(o=this.config.msa)||void 0===o?void 0:o.signOutAndForgetUrl);case"switch":return xt(this.config.appSwitchUrl);case"switchTo":return xt(this.config.appSwitchToUrl);case"getRememberedAccounts":return S.ME.Config.remAcc&&Kr(this,e)&&("aad"===e&&xt(null===(i=this.config.aad)||void 0===i?void 0:i.rememberedAccountsUrl)||"msa"===e&&xt(null===(a=this.config.msa)||void 0===a?void 0:a.rememberedAccountsUrl))}S.assertNever(t,'Operation "'+t+'" was unhandled.')},tn.prototype.signIn=function(t){},tn.prototype.signInTo=function(t){},tn.prototype.signOutFromApp=function(t){},tn.prototype.signOutFromIdp=function(t){var e=t.account.type;if(this.isOperationSupported("signOutFromIdp",e))switch(e){case"aad":case"msaFed":return this.aadAccountsProvider.signOutFromIdp(t);case"msa":return this.msaAccountsProvider.signOutFromIdp(t)}return S.Promise.reject(S.createError("signOutFromIdp is not supported"))},tn.prototype.signOutAndForgetFromIdp=function(t){var e=t.account.type;if(this.isOperationSupported("signOutAndForgetFromIdp",e))switch(e){case"aad":case"msaFed":return this.aadAccountsProvider.signOutAndForgetFromIdp(t);case"msa":return this.msaAccountsProvider.signOutAndForgetFromIdp(t)}return S.Promise.reject(S.createError("signOutAndForgetFromIdp is not supported"))},tn.prototype.switch=function(t){},tn.prototype.switchTo=function(t){},tn.prototype.getRememberedAccounts=function(){function t(e){return function(t){return S.logTelemetryEvent({eventType:"ClientError",name:"Failed to retrieve rememebered accounts for "+e,type:"RememberedAccountsFailure",details:JSON.stringify(S.toJsonable(t)),displayed:!1}),[]}}var e=this.isOperationSupported("getRememberedAccounts","msa"),r=this.isOperationSupported("getRememberedAccounts","aad");if(!e&&!r)return S.Promise.reject(S.createError("getRememberedAccounts is not supported"));var n=e?this.msaAccountsProvider.getRememberedAccounts().catch(t("msa")).then(function(t){return t.filter(function(t){return"msa"==t.type})}):S.Promise.resolve([]),o=r?this.aadAccountsProvider.getRememberedAccounts().catch(t("aad")).then(function(t){return t.filter(function(t){return"aad"==t.type})}):S.Promise.resolve([]);return S.Promise.all([n,o]).then(function(t){return t.reduce(function(t,e){return t.concat(e)},[])})},tn);function tn(t){this.config=t,this.supportedSignInAccountTypes=1,this.navProvider=new $r(this.config),this.msaAccountsProvider=xr(this.config.msa),this.aadAccountsProvider=Mr(this.config.aad)}var en=(rn.prototype.isOperationSupported=function(t,e){var r,n;if("msa"!==e)return!1;switch(t){case"signIn":return xt(this.config.appSignInUrl);case"signInTo":return xt(this.config.appSignInToUrl);case"signOutFromApp":return xt(this.config.appSignOutUrl);case"signOutFromIdp":return!1;case"signOutAndForgetFromIdp":return xt(null===(r=this.config.msa)||void 0===r?void 0:r.signOutAndForgetUrl);case"switch":return xt(this.config.appSwitchUrl);case"switchTo":return xt(this.config.appSwitchToUrl);case"getRememberedAccounts":return S.ME.Config.remAcc&&Kr(this,e)&&xt(null===(n=this.config.msa)||void 0===n?void 0:n.rememberedAccountsUrl)}S.assertNever(t,'Operation "'+t+'" was unhandled.')},rn.prototype.signIn=function(t){},rn.prototype.signInTo=function(t){},rn.prototype.signOutFromApp=function(t){},rn.prototype.signOutFromIdp=function(t){return this.isOperationSupported("signOutFromIdp",t.account.type)?this.msaAccountsProvider.signOutFromIdp(t):S.Promise.reject(S.createError("signOutFromIdp is not supported"))},rn.prototype.signOutAndForgetFromIdp=function(t){return this.isOperationSupported("signOutAndForgetFromIdp",t.account.type)?this.msaAccountsProvider.signOutAndForgetFromIdp(t):S.Promise.reject(S.createError("signOutAndForgetFromIdp is not supported"))},rn.prototype.switch=function(t){},rn.prototype.switchTo=function(t){},rn.prototype.getRememberedAccounts=function(){return this.isOperationSupported("getRememberedAccounts","msa")?this.msaAccountsProvider.getRememberedAccounts():S.Promise.reject(S.createError("getRememberedAccounts is not supported"))},rn);function rn(t){this.config=t,this.supportedSignInAccountTypes=2,this.navProvider=new $r(this.config),this.msaAccountsProvider=xr(this.config.msa)}var nn=(on.prototype.isOperationSupported=function(t,e){var r,n,o;if("aad"!==e)return!1;switch(t){case"signIn":return xt(this.config.appSignInUrl);case"signInTo":return xt(this.config.appSignInToUrl);case"switch":return xt(this.config.appSwitchUrl);case"switchTo":return xt(this.config.appSwitchToUrl);case"signOutFromApp":return xt(this.config.appSignOutUrl);case"signOutFromIdp":return xt(null===(r=this.config.aad)||void 0===r?void 0:r.signOutUrl);case"signOutAndForgetFromIdp":return xt(null===(n=this.config.aad)||void 0===n?void 0:n.signOutAndForgetUrl);case"getRememberedAccounts":return S.ME.Config.aad&&S.ME.Config.remAcc&&Kr(this,e)&&xt(null===(o=this.config.aad)||void 0===o?void 0:o.rememberedAccountsUrl)}S.assertNever(t,'Operation "'+t+'" was unhandled.')},on.prototype.signIn=function(t){},on.prototype.signInTo=function(t){},on.prototype.signOutFromApp=function(t){},on.prototype.signOutFromIdp=function(t){return this.isOperationSupported("signOutFromIdp",t.account.type)?this.aadAccountsProvider.signOutFromIdp(t):S.Promise.reject(S.createError("signOutFromIdp is not supported"))},on.prototype.signOutAndForgetFromIdp=function(t){return this.isOperationSupported("signOutAndForgetFromIdp",t.account.type)?this.aadAccountsProvider.signOutAndForgetFromIdp(t):S.Promise.reject(S.createError("signOutAndForgetFromIdp is not supported"))},on.prototype.switch=function(t){},on.prototype.switchTo=function(t){},on.prototype.getRememberedAccounts=function(){return this.isOperationSupported("getRememberedAccounts","aad")?this.aadAccountsProvider.getRememberedAccounts().then(function(t){return t.filter(function(t){return"msaFed"!==t.type})}):S.Promise.reject(S.createError("getRememberedAccounts is not supported"))},on);function on(t){this.config=t,this.supportedSignInAccountTypes=4,this.navProvider=new $r(this.config),this.aadAccountsProvider=Mr(this.config.aad)}var an=(sn.prototype.isOperationSupported=function(t,e){var r,n,o;if("aad"!==e&&"msaFed"!==e)return!1;switch(t){case"signIn":return xt(this.config.appSignInUrl);case"signInTo":return xt(this.config.appSignInToUrl);case"switch":return xt(this.config.appSwitchUrl);case"switchTo":return xt(this.config.appSwitchToUrl);case"signOutFromApp":return xt(this.config.appSignOutUrl);case"signOutFromIdp":return xt(null===(r=this.config.aad)||void 0===r?void 0:r.signOutUrl);case"signOutAndForgetFromIdp":return xt(null===(n=this.config.aad)||void 0===n?void 0:n.signOutAndForgetUrl);case"getRememberedAccounts":return S.ME.Config.aad&&S.ME.Config.remAcc&&Kr(this,e)&&xt(null===(o=this.config.aad)||void 0===o?void 0:o.rememberedAccountsUrl)}S.assertNever(t,'Operation "'+t+'" was unhandled.')},sn.prototype.signIn=function(t){},sn.prototype.signInTo=function(t){},sn.prototype.signOutFromApp=function(t){},sn.prototype.signOutFromIdp=function(t){return this.isOperationSupported("signOutFromIdp",t.account.type)?this.webAadIdpProvider.signOutFromIdp(t):S.Promise.reject(S.createError("signOutFromIdp is not supported"))},sn.prototype.signOutAndForgetFromIdp=function(t){return this.isOperationSupported("signOutAndForgetFromIdp",t.account.type)?this.webAadIdpProvider.signOutAndForgetFromIdp(t):S.Promise.reject(S.createError("signOutAndForgetFromIdp is not supported"))},sn.prototype.switch=function(t){},sn.prototype.switchTo=function(t){},sn.prototype.getRememberedAccounts=function(){return this.isOperationSupported("getRememberedAccounts","aad")?this.webAadIdpProvider.getRememberedAccounts():S.Promise.reject(S.createError("getRememberedAccounts is not supported"))},sn);function sn(t){this.config=t,this.supportedSignInAccountTypes=4,this.navProvider=new $r(this.config),this.webAadIdpProvider=Mr(this.config.aad)}function cn(t){return new un(t)}var un=(pn.prototype.supportsMsaFed=function(){return"adalJsWithMsaFed"===this.config.type},pn.prototype.isOperationSupported=function(t,e){var r,n,o;if("aad"!==e&&"msaFed"!==e)return!1;switch(t){case"signOutFromIdp":return xt(null===(r=this.config.aad)||void 0===r?void 0:r.signOutUrl);case"signOutAndForgetFromIdp":return xt(null===(n=this.config.aad)||void 0===n?void 0:n.signOutAndForgetUrl);case"getRememberedAccounts":return S.ME.Config.aad&&S.ME.Config.remAcc&&Kr(this,"aad")&&xt(null===(o=this.config.aad)||void 0===o?void 0:o.rememberedAccountsUrl);default:return"function"==typeof this.config[t]}},pn.prototype.signIn=function(t){this.config.signIn(t)},pn.prototype.signInTo=function(t){if(!this.isOperationSupported("signInTo",t.nextAccount.type))throw S.createError("signInTo is not supported");this.config.signInTo(t)},pn.prototype.signOutFromApp=function(t){this.config.signOutFromApp(t)},pn.prototype.switch=function(t){if(!this.isOperationSupported("switch","aad"))throw S.createError("switch is not supported");this.config.switch(t)},pn.prototype.switchTo=function(t){if(!this.isOperationSupported("switchTo",t.nextAccount.type))throw S.createError("switchTo is not supported");this.config.switchTo(t)},pn.prototype.signOutFromIdp=function(t){return this.isOperationSupported("signOutFromIdp",t.account.type)?this.webAadIdpProvider.signOutFromIdp(t):Ne.reject(S.createError("signOutFromIdp is not supported"))},pn.prototype.signOutAndForgetFromIdp=function(t){return this.isOperationSupported("signOutAndForgetFromIdp",t.account.type)?this.webAadIdpProvider.signOutAndForgetFromIdp(t):Ne.reject(S.createError("signOutAndForgetFromIdp is not supported"))},pn.prototype.getRememberedAccounts=function(){if(this.isOperationSupported("getRememberedAccounts","aad")){var t=this.webAadIdpProvider.getRememberedAccounts();return this.supportsMsaFed()?t:t.then(function(t){return t.filter(function(t){return"msaFed"!==t.type})})}return Ne.reject(S.createError("getRememberedAccounts is not supported"))},pn);function pn(t){this.config=t,this.supportedSignInAccountTypes=4,this.webAadIdpProvider=Mr(t.aad)}var dn=(ln.prototype.isOperationSupported=function(t,e){if("aad"==e||"msaFed"==e)switch(t){case"signIn":return Dt(this.rpData.aadInfo.signInUrl);case"switch":return this.rpData.aadInfo.allowNonAadUrls||gt(this.rpData.aadInfo.signInUrl,"client_id")&>(this.rpData.aadInfo.signInUrl,"redirect_uri");case"signOutFromApp":return Dt(this.rpData.aadInfo.signOutUrl);case"signInTo":case"switchTo":case"signOutFromIdp":case"signOutAndForgetFromIdp":case"getRememberedAccounts":default:return!1}else if("msa"==e)switch(t){case"signIn":return Dt(this.rpData.msaInfo.signInUrl);case"switch":return gn(this.rpData.msaInfo.signInUrl)&>(this.rpData.msaInfo.signOutUrl,"ru")&>(this.rpData.msaInfo.signInUrl,"wreply");case"signInTo":return gn(this.rpData.msaInfo.signInUrl);case"signOutFromApp":return Dt(this.rpData.msaInfo.signOutUrl);case"signOutAndForgetFromIdp":return gn(this.rpData.msaInfo.signOutUrl)&&gn(this.rpData.msaInfo.meUrl);case"getRememberedAccounts":return gn(this.rpData.msaInfo.meUrl);case"switchTo":case"signOutFromIdp":default:return!1}return!1},ln.prototype.signIn=function(t){},ln.prototype.signInTo=function(t){},ln.prototype.signOutFromApp=function(t){},ln.prototype.signOutFromIdp=function(t){switch(t.account.type){case"aad":case"msaFed":return this.aadAccountsProvider?this.aadAccountsProvider.signOutFromIdp(t):S.Promise.reject("SignOut was requested for an account of type AAD or MSA_FED but V1 config didn't provide any usable supporting details in the 'rpData' property for AAD or MSA_FED accounts.");case"msa":return this.msaAccountsProvider?this.msaAccountsProvider.signOutFromIdp(t):S.Promise.reject("SignOut was requested for an account of type MSA but V1 config didn't provide any usable supporting details in the 'rpData' property for MSA accounts.")}},ln.prototype.signOutAndForgetFromIdp=function(t){switch(t.account.type){case"aad":case"msaFed":return this.aadAccountsProvider?this.aadAccountsProvider.signOutAndForgetFromIdp(t):S.Promise.reject("SignOutAndForgetFromIdp was requested for an account of type AAD or MSA_FED but V1 config didn't provide any usable supporting details in the 'rpData' property for AAD or MSA_FED accounts.");case"msa":return this.msaAccountsProvider?this.msaAccountsProvider.signOutAndForgetFromIdp(t):S.Promise.reject("SignOutAndForgetFromIdp was requested for an account of type MSA but V1 config didn't provide any usable supporting details in the 'rpData' property for MSA accounts.")}},ln.prototype.switch=function(t){},ln.prototype.switchTo=function(t){},ln.prototype.getRememberedAccounts=function(){return S.Promise.all([this.msaAccountsProvider?this.msaAccountsProvider.getRememberedAccounts():[],this.aadAccountsProvider?this.aadAccountsProvider.getRememberedAccounts():[]]).then(function(t){return t.reduce(function(t,e){return t.concat(e)},[])})},ln);function ln(t){var e=this;if(this.config=t,this.rpData=t.rpData,Dt(this.rpData.msaInfo.signInUrl))Dt(this.rpData.aadInfo.signInUrl)?(this.rpData.aadInfo.blockMsaFed,this.supportedSignInAccountTypes=1):this.supportedSignInAccountTypes=2;else if(Dt(this.rpData.aadInfo.signInUrl))this.rpData.aadInfo.blockMsaFed?this.supportedSignInAccountTypes=4:this.supportedSignInAccountTypes=1;else{var r=Wt("https://web.archive.org/web/20241212154957/https://login.microsoftonline.com/common/oauth2/authorize?response_type=id_token&client_id={0}&scope=openid&nonce={1}&response_mode=form_post&redirect_uri={2}",this.rpData.aadInfo.appId,S.id,location.href);"aad"==this.rpData.preferredIdp?this.rpData.aadInfo.signInUrl=r:this.rpData.msaInfo.signInUrl=r;var n="WARNING: Unable to find signInUrl from the rpData object provided. Attempting to construct redirect uri from location.href!";S.logTelemetryEvent({eventType:"ClientError",name:"Undefined signInUrl",type:"UndefinedAuthState",details:n,severity:3,displayed:!1}),console.warn(n)}this.navProvider=new fn(this.config),Dt(t.rpData.msaInfo.signInUrl)&&this.rpData.msaInfo.meUrl&&(this.msaAccountsProvider=xr({signOutAndForgetUrl:function(t){return e.rpData.msaInfo.signOutUrl},rememberedAccountsUrl:this.rpData.msaInfo.meUrl})),Dt(t.rpData.aadInfo.signInUrl)&&this.rpData.aadInfo.meUrl&&(this.aadAccountsProvider=Mr({signOutUrl:this.rpData.aadInfo.signOutUrl,signOutAndForgetUrl:this.rpData.aadInfo.signOutUrl,rememberedAccountsUrl:this.rpData.aadInfo.meUrl,forgetUrl:Wt("https://{0}/forgetuser",mt(this.rpData.aadInfo.meUrl))}))}var fn=(hn.prototype.getSignInUrl=function(t){switch(t.signInType){case 2:if(Dt(this.config.rpData.msaInfo.signInUrl)){var e=this.config.rpData.msaInfo.signInUrl;return Mt(this.config.rpData.msaInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.msaInfo.generateSignInReturnUrl()})),Cr(e)}throw new Error("Got signInUrl request for MSA, but we don't have usable MSA info from V1 config.");case 4:if(Dt(this.config.rpData.aadInfo.signInUrl))return e=this.config.rpData.aadInfo.signInUrl,Mt(this.config.rpData.aadInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.aadInfo.generateSignInReturnUrl()})),this.config.rpData.aadInfo.blockMsaFed&&(e=ht(e,{msafed:"0"})),Cr(e);throw new Error("Got signInUrl request for AAD, but we don't have usable AAD info from V1 config.");case 1:if("aad"===this.config.rpData.preferredIdp&&Dt(this.config.rpData.aadInfo.signInUrl))return e=this.config.rpData.aadInfo.signInUrl,Mt(this.config.rpData.aadInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.aadInfo.generateSignInReturnUrl()})),this.config.rpData.aadInfo.blockMsaFed&&(e=ht(e,{msafed:"0"})),Cr(e);if(Dt(this.config.rpData.msaInfo.signInUrl))return e=this.config.rpData.msaInfo.signInUrl,Mt(this.config.rpData.msaInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.msaInfo.generateSignInReturnUrl()})),Cr(e);throw new Error("Got signInUrl request for converged experience, but we don't have usable AAD info (or MSA info either) from V1 config.")}},hn.prototype.getSignInToUrl=function(t){switch(t.nextAccount.type){case"msa":if(Dt(this.config.rpData.msaInfo.signInUrl)){var e=this.config.rpData.msaInfo.signInUrl;return Mt(this.config.rpData.msaInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.msaInfo.generateSignInReturnUrl()})),gn(e)?ht(e,{username:t.nextAccount.memberName}):Fr(e,t)}throw new Error("Got signInToUrl request for MSA, but we don't have usable MSA info from V1 config.");case"aad":case"msaFed":if(Dt(this.config.rpData.aadInfo.signInUrl))return e=this.config.rpData.aadInfo.signInUrl,Mt(this.config.rpData.aadInfo.generateSignInReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.aadInfo.generateSignInReturnUrl()})),this.config.rpData.aadInfo.blockMsaFed&&(e=ht(e,{msafed:"0"})),Fr(e,t);throw new Error("Got signInToUrl request for AAD, but we don't have usable AAD info from V1 config.")}},hn.prototype.getSignOutFromAppUrl=function(t){switch(t.currentAccount.type){case"msa":if(Dt(this.config.rpData.msaInfo.signOutUrl)){var e=this.config.rpData.msaInfo.signOutUrl;return Mt(this.config.rpData.msaInfo.generateSignOutReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.msaInfo.generateSignOutReturnUrl()})),Pr(e,t)}throw new Error("Got signOutFromAppUrl request for MSA, but we don't have usable MSA info from V1 config.");case"aad":case"msaFed":if(Dt(this.config.rpData.aadInfo.signOutUrl))return e=this.config.rpData.aadInfo.signOutUrl,Mt(this.config.rpData.aadInfo.generateSignOutReturnUrl)&&(e=ht(e,{wreply:this.config.rpData.aadInfo.generateSignOutReturnUrl()})),Pr(e,t);throw new Error("Got signOutFromAppUrl request for AAD, but we don't have usable AAD info from V1 config.")}},hn.prototype.getSignOutFromIdpUrl=function(t){switch(t.account.type){case"msa":case"msaFed":throw new Error("Method not supported for MSA and MSA_FED Accounts.");case"aad":if(Dt(this.config.rpData.aadInfo.signOutUrl))return Rr(this.config.rpData.aadInfo.signOutUrl,t);throw new Error("Got signOutFromAppUrl request for AAD, but we don't have usable AAD info from V1 config.")}},hn.prototype.getSignOutAndForgetFromIdpUrl=function(t){switch(t.account.type){case"msa":if(Dt(this.config.rpData.msaInfo.signOutUrl))return Nr(this.config.rpData.msaInfo.signOutUrl,t);throw new Error("Got signOutFromAppUrl request for MSA, but we don't have usable AAD info from V1 config.");case"aad":case"msaFed":if(Dt(this.config.rpData.aadInfo.signOutUrl))return Rr(this.config.rpData.aadInfo.signOutUrl,t);throw new Error("Got signOutAndForgetFromAppUrl request for AAD, but we don't have usable AAD info from V1 config.")}},hn.prototype.getSwitchUrl=function(t){return this.getSwitchOrSwitchToUrl(t,!0)},hn.prototype.getSwitchToUrl=function(t){return this.getSwitchOrSwitchToUrl(t,!1)},hn.prototype.getSwitchOrSwitchToUrl=function(t,e){var r=t.signInType||"msa"===this.config.rpData.preferredIdp?2:4,n=e?this.getSignInUrl({signInType:r}):this.getSignInToUrl({nextAccount:t.nextAccount});if("aad"===t.currentAccount.type)return ht(n,{prompt:"select_account"});if(gn(n)){var o=this.getSignOutFromAppUrl({currentAccount:t.currentAccount});return o?"aad"===this.config.rpData.preferredIdp?ht(o,{wreply:n}):ht(o,{ru:n,lru:n}):n}return n},hn);function hn(t){this.config=t}function gn(t){return!!t&&-1