You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
14 KiB

/*! For license information please see 1.js.LICENSE */
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1499:function(e,t,a){var s,n=n||function(e){"use strict";if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,a=function(){return e.URL||e.webkitURL||e},s=t.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in s,r=/constructor/i.test(e.HTMLElement)||e.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),i=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},c=function(e){setTimeout((function(){"string"==typeof e?a().revokeObjectURL(e):e.remove()}),4e4)},l=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},u=function(t,u,h){h||(t=l(t));var p,m=this,d="application/octet-stream"===t.type,y=function(){!function(e,t,a){for(var s=(t=[].concat(t)).length;s--;){var n=e["on"+t[s]];if("function"==typeof n)try{n.call(e,a||e)}catch(e){i(e)}}}(m,"writestart progress write writeend".split(" "))};if(m.readyState=m.INIT,n)return p=a().createObjectURL(t),void setTimeout((function(){var e,t;s.href=p,s.download=u,e=s,t=new MouseEvent("click"),e.dispatchEvent(t),y(),c(p),m.readyState=m.DONE}));!function(){if((o||d&&r)&&e.FileReader){var s=new FileReader;return s.onloadend=function(){var t=o?s.result:s.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,m.readyState=m.DONE,y()},s.readAsDataURL(t),void(m.readyState=m.INIT)}(p||(p=a().createObjectURL(t)),d)?e.location.href=p:e.open(p,"_blank")||(e.location.href=p);m.readyState=m.DONE,y(),c(p)}()},h=u.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,a){return t=t||e.name||"download",a||(e=l(e)),navigator.msSaveOrOpenBlob(e,t)}:(h.abort=function(){},h.readyState=h.INIT=0,h.WRITING=1,h.DONE=2,h.error=h.onwritestart=h.onprogress=h.onwrite=h.onabort=h.onerror=h.onwriteend=null,function(e,t,a){return new u(e,t||e.name||"download",a)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);e.exports?e.exports.saveAs=n:null!==a(1500)&&null!==a(1501)&&(void 0===(s=function(){return n}.call(t,a,t,e))||(e.exports=s))},1500:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},1501:function(e,t){(function(t){e.exports=t}).call(this,{})},1506:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return f}));var s=a(5),n=a.n(s),r=a(0),o=a.n(r),i=a(1499),c=a.n(i),l=a(3),u=a(4),h=a(2),p=a.n(h),m=a(1504),d=a(1),y=a(98),b=a(7),k=a(12);const v=0,_=5;class f extends o.a.PureComponent{constructor(e){super(e),n()(this,"_collectRecoveryKeyNode",e=>{this._recoveryKeyNode=e}),n()(this,"_onCopyClick",()=>{!function(e){const t=document.createRange();t.selectNodeContents(e);const a=window.getSelection();a.removeAllRanges(),a.addRange(t)}(this._recoveryKeyNode),document.execCommand("copy")&&this.setState({copied:!0,phase:3})}),n()(this,"_onDownloadClick",()=>{const e=new Blob([this._keyBackupInfo.recovery_key],{type:"text/plain;charset=us-ascii"});c.a.saveAs(e,"recovery-key.txt"),this.setState({downloaded:!0,phase:3})}),n()(this,"_createBackup",async()=>{const{secureSecretStorage:e}=this.state;let t;this.setState({phase:4,error:null});try{e?await Object(y.b)(async()=>{t=await u.a.get().prepareKeyBackupVersion(null,{secureSecretStorage:!0}),t=await u.a.get().createKeyBackupVersion(t)}):t=await u.a.get().createKeyBackupVersion(this._keyBackupInfo),await u.a.get().scheduleAllGroupSessionsForBackup(),this.setState({phase:_})}catch(e){console.error("Error creating key backup",e),t&&u.a.get().deleteKeyBackupVersion(t.version),this.setState({error:e})}}),n()(this,"_onCancel",()=>{this.props.onFinished(!1)}),n()(this,"_onDone",()=>{this.props.onFinished(!0)}),n()(this,"_onOptOutClick",()=>{this.setState({phase:6})}),n()(this,"_onSetUpClick",()=>{this.setState({phase:v})}),n()(this,"_onSkipPassPhraseClick",async()=>{this._keyBackupInfo=await u.a.get().prepareKeyBackupVersion(),this.setState({copied:!1,downloaded:!1,phase: