@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 19.6 kB
JavaScript
!function(){var e=null;window.OneDriveClient=function(e,t,i,n){null==t&&null!=window.urlParams&&"1"==window.urlParams.extAuth&&(t=!0),null==i&&(i=null==window.Editor||Editor.oneDriveInlinePicker),null==n&&null!=window.urlParams&&"1"==window.urlParams.noLogoutOD&&(n=!0),DrawioClient.call(this,e,t?"oneDriveExtAuthInfo":"oneDriveAuthInfo"),this.isExtAuth=t,this.inlinePicker=i,this.noLogout=n;var s=JSON.parse(this.token);null!=s&&(this.endpointHint=null!=s.endpointHint?s.endpointHint.replace("/Documents","/_layouts/15/onedrive.aspx"):s.endpointHint)},mxUtils.extend(OneDriveClient,DrawioClient),OneDriveClient.prototype.clientId=window.DRAWIO_MSGRAPH_CLIENT_ID||("test.draw.io"==window.location.hostname?"2e598409-107f-4b59-89ca-d7723c8e00a4":"45c10911-200f-4e27-a666-9e9fca147395"),OneDriveClient.prototype.clientId="app.diagrams.net"==window.location.hostname?"b5ff67d6-3155-4fca-965a-59a3655c4476":OneDriveClient.prototype.clientId,OneDriveClient.prototype.clientId="viewer.diagrams.net"==window.location.hostname?"417a451a-a343-4788-b6c1-901e63182565":OneDriveClient.prototype.clientId,OneDriveClient.prototype.scopes="user.read files.readwrite.all sites.read.all",OneDriveClient.prototype.redirectUri=window.location.protocol+"//"+window.location.host+"/microsoft",OneDriveClient.prototype.pickerRedirectUri=window.location.protocol+"//"+window.location.host+"/onedrive3.html",OneDriveClient.prototype.defEndpointHint="api.onedrive.com",OneDriveClient.prototype.endpointHint=OneDriveClient.prototype.defEndpointHint,OneDriveClient.prototype.extension=".drawio",OneDriveClient.prototype.baseUrl="https://graph.microsoft.com/v1.0",OneDriveClient.prototype.emptyFn=function(){},OneDriveClient.prototype.invalidFilenameRegExs=[/[~"#%\*:<>\?\/\\{\|}]/,/^\.lock$/i,/^CON$/i,/^PRN$/i,/^AUX$/i,/^NUL$/i,/^COM\d$/i,/^LPT\d$/i,/^desktop\.ini$/i,/_vti_/i],OneDriveClient.prototype.isValidFilename=function(e){if(null==e||""===e)return!1;for(var t=0;t<this.invalidFilenameRegExs.length;t++)if(this.invalidFilenameRegExs[t].test(e))return!1;return!0},OneDriveClient.prototype.get=function(t,i,n){var s=new mxXmlRequest(t,null,"GET");return s.setRequestHeaders=mxUtils.bind(this,(function(t,i){t.setRequestHeader("Authorization","Bearer "+e)})),s.send(i,n),s},OneDriveClient.prototype.updateUser=function(e,t,i){var n=!0,s=window.setTimeout(mxUtils.bind(this,(function(){n=!1,t({code:App.ERROR_TIMEOUT})})),this.ui.timeout);this.get(this.baseUrl+"/me",mxUtils.bind(this,(function(o){if(window.clearTimeout(s),n)if(o.getStatus()<200||o.getStatus()>=300)i?t({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,(function(){this.updateUser(e,t,!0)})),t));else{var r=JSON.parse(o.getText());this.setUser(new DrawioUser(r.id,r.mail,r.displayName)),e()}})),mxUtils.bind(this,(function(e){window.clearTimeout(s),n&&t(e)})))},OneDriveClient.prototype.resetTokenRefresh=function(e){null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null),e>0&&(this.tokenRefreshInterval=1e3*e,this.tokenRefreshThread=window.setTimeout(mxUtils.bind(this,(function(){this.authenticate(this.emptyFn,this.emptyFn,!0)})),900*e))},OneDriveClient.prototype.authenticate=function(e,t,i){this.isExtAuth?window.parent.oneDriveAuth(mxUtils.bind(this,(function(i){this.updateAuthInfo(i,!0,null==this.endpointHint,e,t)})),t,null!=window.urlParams&&"1"==urlParams.odAuthCancellable):new mxXmlRequest(this.redirectUri+"?getState=1",null,"GET").send(mxUtils.bind(this,(function(n){n.getStatus()>=200&&n.getStatus()<=299?this.authenticateStep2(n.getText(),e,t,i):null!=t&&t(n)})),t)},OneDriveClient.prototype.updateAuthInfo=function(t,i,n,s,o){n&&this.setUser(null),e=t.access_token,delete t.access_token,t.expiresOn=Date.now()+1e3*t.expires_in,this.tokenExpiresOn=t.expiresOn,t.remember=i,this.setPersistentToken(JSON.stringify(t),!i),this.resetTokenRefresh(t.expires_in),n?this.getAccountTypeAndEndpoint(mxUtils.bind(this,(function(){s()})),o):s()},OneDriveClient.prototype.authenticateStep2=function(t,i,n,s){if(null==window.onOneDriveCallback){var o=mxUtils.bind(this,(function(){var r=!0,l=JSON.parse(this.getPersistentToken(!0));null!=l?new mxXmlRequest(this.redirectUri+"?state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&token="+t),null,"GET").send(mxUtils.bind(this,(function(t){t.getStatus()>=200&&t.getStatus()<=299?this.updateAuthInfo(JSON.parse(t.getText()),l.remember,!1,i,n):(this.clearPersistentToken(),this.setUser(null),e=null,401!=t.getStatus()||s?n({message:mxResources.get("accessDenied"),retry:o}):o())})),n):this.ui.showAuthDialog(this,!0,mxUtils.bind(this,(function(e,s){var l="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id="+this.clientId+"&response_type=code&redirect_uri="+encodeURIComponent(this.redirectUri)+"&scope="+encodeURIComponent(this.scopes+(e?" offline_access":""))+"&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname+"&token="+t),a=window.screenX,u=window.screenY,c=window.outerWidth,h=window.outerHeight,d=a+Math.max(c-525,0)/2,m=["width=525","height=525","top="+(u+Math.max(h-525,0)/2),"left="+d,"status=no","resizable=yes","toolbar=no","menubar=no","scrollbars=yes"],p=window.open(l,"odauth",m.join(","));null!=p&&(window.onOneDriveCallback=mxUtils.bind(this,(function(t,l){if(r){window.onOneDriveCallback=null,r=!1;try{null==t?n({message:mxResources.get("accessDenied"),retry:o}):(null!=s&&s(),this.updateAuthInfo(t,e,!0,i,n))}catch(e){n(e)}finally{null!=l&&l.close()}}else null!=l&&l.close()})),p.focus())})),mxUtils.bind(this,(function(){r&&(window.onOneDriveCallback=null,r=!1,n({message:mxResources.get("accessDenied"),retry:o}))})))}));o()}else n({code:App.ERROR_BUSY})},OneDriveClient.prototype.getAccountTypeAndEndpoint=function(e,t){this.get(this.baseUrl+"/me/drive/root",mxUtils.bind(this,(function(i){try{if(i.getStatus()>=200&&i.getStatus()<=299){var n=JSON.parse(i.getText());n.webUrl.indexOf(".sharepoint.com")>0?this.endpointHint=n.webUrl.replace("/Documents","/_layouts/15/onedrive.aspx"):this.endpointHint=this.defEndpointHint;var s=JSON.parse(this.getPersistentToken(!0));return null!=s&&(s.endpointHint=this.endpointHint,this.setPersistentToken(JSON.stringify(s),!s.remember)),void e()}}catch(e){}t({message:mxResources.get("unknownError")+" (Code: "+i.getStatus()+")"})})),t)},OneDriveClient.prototype.executeRequest=function(t,i,n){var s=mxUtils.bind(this,(function(e){var o=!0,r=window.setTimeout(mxUtils.bind(this,(function(){o=!1,n({code:App.ERROR_TIMEOUT,retry:s})})),this.ui.timeout);this.get(t,mxUtils.bind(this,(function(t){window.clearTimeout(r),o&&(t.getStatus()>=200&&t.getStatus()<=299||404==t.getStatus()?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),i(t)):e||401!==t.getStatus()&&400!==t.getStatus()?n(this.parseRequestText(t)):this.authenticate((function(){s(!0)}),n,e))})),mxUtils.bind(this,(function(e){window.clearTimeout(r),o&&n(e)})))}));null==e||this.tokenExpiresOn-Date.now()<6e4?this.authenticate((function(){s(!0)}),n):s(!1)},OneDriveClient.prototype.checkToken=function(t){null==e||null==this.tokenRefreshThread||this.tokenExpiresOn-Date.now()<6e4?this.authenticate(t,this.emptyFn):t()},OneDriveClient.prototype.getItemRef=function(e){var t=e.split("/");return t.length>1?{driveId:t[0],id:t[1]}:{id:e}},OneDriveClient.prototype.getItemURL=function(e,t){var i=e.split("/");if(i.length>1){var n=i[0],s=i[1];return(t?"":this.baseUrl)+"/drives/"+n+("root"==s?"/root":"/items/"+s)}return(t?"":this.baseUrl)+"/me/drive/items/"+e},OneDriveClient.prototype.getLibrary=function(e,t,i){this.getFile(e,t,i,!1,!0)},OneDriveClient.prototype.removeExtraHtmlContent=function(e){var t=e.lastIndexOf('<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" ');return t>0&&(e=e.substring(0,t)),e},OneDriveClient.prototype.getFile=function(e,t,i,n,s){s=null!=s&&s,this.executeRequest(this.getItemURL(e),mxUtils.bind(this,(function(e){if(e.getStatus()>=200&&e.getStatus()<=299){var n=JSON.parse(e.getText()),o=/\.png$/i.test(n.name);if(/\.v(dx|sdx?)$/i.test(n.name)||/\.gliffy$/i.test(n.name)||/\.pdf$/i.test(n.name)||!this.ui.useCanvasForExport&&o){var r=null!=n.file?n.file.mimeType:null;this.ui.convertFile(n["@microsoft.graph.downloadUrl"],n.name,r,this.extension,t,i)}else{var l=!0,a=window.setTimeout(mxUtils.bind(this,(function(){l=!1,i({code:App.ERROR_TIMEOUT})})),this.ui.timeout);this.ui.editor.loadUrl(n["@microsoft.graph.downloadUrl"],mxUtils.bind(this,(function(e){try{if(window.clearTimeout(a),l){/\.html$/i.test(n.name)&&(e=this.removeExtraHtmlContent(e));var r=o?e.lastIndexOf(","):-1,u=null;if(r>0){var c=this.ui.extractGraphModelFromPng(e);null!=c&&c.length>0?e=c:u=new LocalFile(this.ui,e,n.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==e.substring(0,32)){var h=e.substring(22);e=window.atob&&!mxClient.IS_SF?atob(h):Base64.decode(h)}Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(e,n["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,(function(e){try{4==e.readyState&&(e.status>=200&&e.status<=299?t(new LocalFile(this.ui,e.responseText,n.name+this.extension,!0)):null!=i&&i({message:mxResources.get("errorLoadingFile")}))}catch(e){if(null==i)throw e;i(e)}})),n.name):t(null!=u?u:s?new OneDriveLibrary(this.ui,e,n):new OneDriveFile(this.ui,e,n))}}catch(e){if(null==i)throw e;i(e)}})),mxUtils.bind(this,(function(e){window.clearTimeout(a),l&&i(this.parseRequestText(e))})),o||null!=n.file&&null!=n.file.mimeType&&("image/"==n.file.mimeType.substring(0,6)&&"image/svg"!=n.file.mimeType.substring(0,9)||"application/pdf"==n.file.mimeType))}}else this.isExtAuth?i({message:mxResources.get("fileNotFoundOrDenied"),ownerEmail:null!=window.urlParams?urlParams.ownerEml:null}):i(this.parseRequestText(e))})),i)},OneDriveClient.prototype.renameFile=function(e,t,i,n){if(null!=e&&null!=t){if(!this.isValidFilename(t))return void n({message:this.invalidFilenameRegExs[0].test(t)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")});this.checkExists(e.getParentId(),t,!1,mxUtils.bind(this,(function(s){s?this.writeFile(this.getItemURL(e.getId()),JSON.stringify({name:t}),"PATCH","application/json",i,n):n()})))}},OneDriveClient.prototype.moveFile=function(e,t,i,n){var s=this.getItemRef(t),o=this.getItemRef(e);s.driveId!=o.driveId?n({message:mxResources.get("cannotMoveOneDrive",null,"Moving a file between accounts is not supported yet.")}):this.writeFile(this.getItemURL(e),JSON.stringify({parentReference:s}),"PATCH","application/json",i,n)},OneDriveClient.prototype.insertLibrary=function(e,t,i,n,s){this.insertFile(e,t,i,n,!0,s)},OneDriveClient.prototype.insertFile=function(e,t,i,n,s,o){this.isValidFilename(e)?(s=null!=s&&s,this.checkExists(o,e,!0,mxUtils.bind(this,(function(r){if(r){var l="/me/drive/root";null!=o&&(l=this.getItemURL(o,!0));var a=mxUtils.bind(this,(function(e){i(s?new OneDriveLibrary(this.ui,t,e):new OneDriveFile(this.ui,t,e))})),u=this.baseUrl+l+"/children/"+encodeURIComponent(e)+"/content";t.length>=4e6?this.writeFile(u,"","PUT",null,mxUtils.bind(this,(function(e){this.writeLargeFile(this.getItemURL(e.id),t,a,n)})),n):this.writeFile(u,t,"PUT",null,a,n)}else n()})))):n({message:this.invalidFilenameRegExs[0].test(e)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")})},OneDriveClient.prototype.checkExists=function(e,t,i,n){var s="/me/drive/root";null!=e&&(s=this.getItemURL(e,!0)),this.executeRequest(this.baseUrl+s+"/children/"+encodeURIComponent(t),mxUtils.bind(this,(function(e){404==e.getStatus()?n(!0):i?(this.ui.spinner.stop(),this.ui.confirm(mxResources.get("replaceIt",[t]),(function(){n(!0)}),(function(){n(!1)}))):(this.ui.spinner.stop(),this.ui.showError(mxResources.get("error"),mxResources.get("fileExists"),mxResources.get("ok"),(function(){n(!1)})))})),(function(e){n(!1)}),!0)},OneDriveClient.prototype.saveFile=function(e,t,i,n){try{var s=e.getData(),o=mxUtils.bind(this,(function(o){var r=mxUtils.bind(this,(function(e){t(e,s)})),l=this.getItemURL(e.getId());o.length>=4e6?this.writeLargeFile(l,o,r,i,n):this.writeFile(l+"/content/",o,"PUT",null,r,i,n)}));if(this.ui.useCanvasForExport&&/(\.png)$/i.test(e.meta.name)){var r=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,(function(e){o(this.ui.base64ToBlob(e,"image/png"))})),i,this.ui.getCurrentFile()!=e?s:null,r.scale,r.border)}else o(s)}catch(e){i(e)}},OneDriveClient.prototype.writeLargeFile=function(t,i,n,s,o){try{if(null!=i){var r=mxUtils.bind(this,(function(e,t,o){try{o=o||0;var l,a=!0;l=window.setTimeout(mxUtils.bind(this,(function(){a=!1,s({code:App.ERROR_TIMEOUT})})),this.ui.timeout);var u=i.substr(t,4194304),c=new mxXmlRequest(e,u,"PUT");c.setRequestHeaders=mxUtils.bind(this,(function(e,n){e.setRequestHeader("Content-Length",u.length),e.setRequestHeader("Content-Range","bytes "+t+"-"+(t+u.length-1)+"/"+i.length)})),c.send(mxUtils.bind(this,(function(c){if(window.clearTimeout(l),a){var h=c.getStatus();if(h>=200&&h<=299){var d=t+u.length;d==i.length?n(JSON.parse(c.getText())):r(e,d,o)}else h>=500&&h<=599&&o<2?(o++,r(e,t,o)):s(this.parseRequestText(c),c)}})),mxUtils.bind(this,(function(e){window.clearTimeout(l),a&&s(this.parseRequestText(e))})))}catch(e){s(e)}})),l=mxUtils.bind(this,(function(i){try{var n=!0,a=null;try{a=window.setTimeout(mxUtils.bind(this,(function(){n=!1,s({code:App.ERROR_TIMEOUT})})),this.ui.timeout)}catch(e){}var u=new mxXmlRequest(t+"/createUploadSession","{}","POST");u.setRequestHeaders=mxUtils.bind(this,(function(t,i){t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Authorization","Bearer "+e),null!=o&&t.setRequestHeader("If-Match",o)})),u.send(mxUtils.bind(this,(function(e){if(window.clearTimeout(a),n)if(e.getStatus()>=200&&e.getStatus()<=299){var t=JSON.parse(e.getText());r(t.uploadUrl,0)}else i||401!==e.getStatus()?s(this.parseRequestText(e),e):this.authenticate((function(){l(!0)}),s,i)})),mxUtils.bind(this,(function(e){window.clearTimeout(a),n&&s(this.parseRequestText(e))})))}catch(e){s(e)}}));null==e||this.tokenExpiresOn-Date.now()<6e4?this.authenticate((function(){l(!0)}),s):l(!1)}else s({message:mxResources.get("unknownError")})}catch(e){s(e)}},OneDriveClient.prototype.writeFile=function(t,i,n,s,o,r,l){try{if(null!=t&&null!=i){var a=mxUtils.bind(this,(function(u){try{var c=!0,h=null;try{h=window.setTimeout(mxUtils.bind(this,(function(){c=!1,r({code:App.ERROR_TIMEOUT})})),this.ui.timeout)}catch(e){}var d=new mxXmlRequest(t,i,n);d.setRequestHeaders=mxUtils.bind(this,(function(t,i){t.setRequestHeader("Content-Type",s||" "),t.setRequestHeader("Authorization","Bearer "+e),null!=l&&t.setRequestHeader("If-Match",l)})),d.send(mxUtils.bind(this,(function(e){window.clearTimeout(h),c&&(e.getStatus()>=200&&e.getStatus()<=299?(null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0),o(JSON.parse(e.getText()))):u||401!==e.getStatus()?r(this.parseRequestText(e),e):this.authenticate((function(){a(!0)}),r,u))})),mxUtils.bind(this,(function(e){window.clearTimeout(h),c&&r(this.parseRequestText(e))})))}catch(e){r(e)}}));null==e||this.tokenExpiresOn-Date.now()<6e4?this.authenticate((function(){a(!0)}),r):a(!1)}else r({message:mxResources.get("unknownError")})}catch(e){r(e)}},OneDriveClient.prototype.parseRequestText=function(e){var t={message:mxResources.get("unknownError")};try{(t=JSON.parse(e.getText())).status=e.getStatus(),t.error&&(t.error.status=t.status,t.error.code=t.status)}catch(e){}return t},OneDriveClient.prototype.pickLibrary=function(e){this.pickFile((function(t){e(t)}))},OneDriveClient.prototype.createInlinePicker=function(e,t){return mxUtils.bind(this,(function(){var i=null,n=document.createElement("div");n.style.position="relative";var s=new CustomDialog(this.ui,n,mxUtils.bind(this,(function(){var n=i.getSelectedItem();if(null!=n){if(t&&"object"==typeof n.folder)return void e({value:[n]});if(!n.folder)return void e(OneDriveFile.prototype.getIdOf(n))}return mxResources.get("invalidSel",null,"Invalid selection")})),null,mxResources.get(t?"save":"open"),null,null,null,null,!0);this.ui.showDialog(s.container,550,500,!0,!0),n.style.width=s.container.parentNode.style.width,n.style.height=parseInt(s.container.parentNode.style.height)-60+"px",i=new mxODPicker(n,null,mxUtils.bind(this,(function(e,t,i){this.executeRequest(this.baseUrl+e,(function(e){t(JSON.parse(e.getText()))}),i)})),mxUtils.bind(this,(function(e,t,i,n){this.executeRequest(this.baseUrl+"/drives/"+t+"/items/"+e,(function(e){i(JSON.parse(e.getText()))}),n)})),null,null,(function(i){e(t?{value:[i]}:OneDriveFile.prototype.getIdOf(i))}),mxUtils.bind(this,(function(e){this.ui.showError(mxResources.get("error"),e)})),t)}))},OneDriveClient.prototype.pickFolder=function(t,i){var n=mxUtils.bind(this,(function(e){this.ui.showError(mxResources.get("error"),e&&e.message?e.message:e)})),s=mxUtils.bind(this,(function(i){var s=this.inlinePicker?this.createInlinePicker(t,!0):mxUtils.bind(this,(function(){OneDrive.save({clientId:this.clientId,action:"query",openInNewWindow:!0,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:e,isConsumerAccount:!1},success:mxUtils.bind(this,(function(i){t(i),mxClient.IS_IE11&&(e=i.accessToken)})),cancel:mxUtils.bind(this,(function(){})),error:n})}));i?s():this.ui.confirm(mxResources.get("useRootFolder"),mxUtils.bind(this,(function(){t({value:[{id:"root",name:"root",parentReference:{driveId:"me"}}]})})),s,mxResources.get("yes"),mxResources.get("noPickFolder")+"...",!0),null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)}));null==e||this.tokenExpiresOn-Date.now()<6e4?this.authenticate(mxUtils.bind(this,(function(){s(!1)})),n):s(i)},OneDriveClient.prototype.pickFile=function(t){t=null!=t?t:mxUtils.bind(this,(function(e){this.ui.loadFile("W"+encodeURIComponent(e))}));var i=mxUtils.bind(this,(function(e){this.ui.showError(mxResources.get("error"),e&&e.message?e.message:e)})),n=this.inlinePicker?this.createInlinePicker(t):mxUtils.bind(this,(function(){OneDrive.open({clientId:this.clientId,action:"query",multiSelect:!1,advanced:{endpointHint:mxClient.IS_IE11?null:this.endpointHint,redirectUri:this.pickerRedirectUri,queryParameters:"select=id,name,parentReference",accessToken:e,isConsumerAccount:!1},success:mxUtils.bind(this,(function(i){null!=i&&null!=i.value&&i.value.length>0&&(mxClient.IS_IE11&&(e=i.accessToken),t(OneDriveFile.prototype.getIdOf(i.value[0]),i))})),cancel:mxUtils.bind(this,(function(){})),error:i}),null==this.user&&this.updateUser(this.emptyFn,this.emptyFn,!0)}));null==e||this.tokenExpiresOn-Date.now()<6e4?this.authenticate(mxUtils.bind(this,(function(){this.inlinePicker?(this.ui.hideDialog(),n()):this.ui.showDialog(new BtnDialog(this.ui,this,mxResources.get("open"),mxUtils.bind(this,(function(){this.ui.hideDialog(),n()}))).container,300,140,!0,!0)})),i):n()},OneDriveClient.prototype.logout=function(){if(isLocalStorage){var t=localStorage.getItem("odpickerv7cache");null!=t&&'{"odsdkLoginHint":{'==t.substring(0,19)&&localStorage.removeItem("odpickerv7cache")}window.open("https://login.microsoftonline.com/common/oauth2/v2.0/logout","logout","width=525,height=525,status=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes"),this.ui.editor.loadUrl(this.redirectUri+"?doLogout=1&state="+encodeURIComponent("cId="+this.clientId+"&domain="+window.location.hostname)),this.clearPersistentToken(),this.setUser(null),e=null}}();