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.

3 lines
15 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1022:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},1023:function(e,t){(function(t){e.exports=t}).call(this,{})},216:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=p(a(41)),s=p(a(14)),r=a(9),o=p(a(0)),l=p(a(11)),i=p(a(5)),u=p(a(10)),c=a(518),d=p(a(510)),h=a(4);function p(e){return e&&e.__esModule?e:{default:e}}var f,m,y,v,_=0,k=5;t.default=(0,l.default)({displayName:"CreateKeyBackupDialog",getInitialState:function(){return{phase:_,passPhrase:"",passPhraseConfirm:"",copied:!1,downloaded:!1,zxcvbnResult:null,setPassPhrase:!1}},componentWillMount:function(){this._recoveryKeyNode=null,this._keyBackupInfo=null,this._setZxcvbnResultTimeout=null},componentWillUnmount:function(){null!==this._setZxcvbnResultTimeout&&clearTimeout(this._setZxcvbnResultTimeout)},_collectRecoveryKeyNode:function(e){this._recoveryKeyNode=e},_onCopyClick:function(){!function(e){var t=document.createRange();t.selectNodeContents(e);var a=window.getSelection();a.removeAllRanges(),a.addRange(t)}(this._recoveryKeyNode),document.execCommand("copy")&&this.setState({copied:!0,phase:3})},_onDownloadClick:function(){var e=new Blob([this._keyBackupInfo.recovery_key],{type:"text/plain;charset=us-ascii"});d.default.saveAs(e,"recovery-key.txt"),this.setState({downloaded:!0,phase:3})},_createBackup:(v=(0,r.coroutine)(s.default.mark((function e(){var t;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({phase:4,error:null}),t=void 0,e.prev=2,e.next=5,(0,r.resolve)(u.default.get().createKeyBackupVersion(this._keyBackupInfo));case 5:return t=e.sent,e.next=8,(0,r.resolve)(u.default.get().scheduleAllGroupSessionsForBackup());case 8:this.setState({phase:k}),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),console.log("Error creating key backup",e.t0),t&&u.default.get().deleteKeyBackupVersion(t.version),this.setState({error:e.t0});case 16:case"end":return e.stop()}}),e,this,[[2,11]])}))),function(){return v.apply(this,arguments)}),_onCancel:function(){this.props.onFinished(!1)},_onDone:function(){this.props.onFinished(!0)},_onOptOutClick:function(){this.setState({phase:6})},_onSetUpClick:function(){this.setState({phase:_})},_onSkipPassPhraseClick:(y=(0,r.coroutine)(s.default.mark((function e(){return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,r.resolve)(u.default.get().prepareKeyBackupVersion());case 2:this._keyBackupInfo=e.sent,this.setState({copied:!1,downloaded:!1,phase:2});case 4:case"end":return e.stop()}}),e,this)}))),function(){return y.apply(this,arguments)}),_onPassPhraseNextClick:function(){this.setState({phase:1})},_onPassPhraseKeyPress:(m=(0,r.coroutine)(s.default.mark((function e(t){var a=this;return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==t.key){e.next=7;break}if(null===this._setZxcvbnResultTimeout){e.next=6;break}return clearTimeout(this._setZxcvbnResultTimeout),this._setZxcvbnResultTimeout=null,e.next=6,(0,r.resolve)(new n.default((function(e){a.setState({zxcvbnResult:(0,c.scorePassword)(a.state.passPhrase)},e)})));case 6:this._passPhraseIsValid()&&this._onPassPhraseNextClick();case 7:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)}),_onPassPhraseConfirmNextClick:(f=(0,r.coroutine)(s.default.mark((function e(){return s.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,r.resolve)(u.default.get().prepareKeyBackupVersion(this.state.passPhrase));case 2:this._keyBackupInfo=e.sent,this.setState({setPassPhrase:!0,copied:!1,downloaded:!1,phase:2});case 4:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)}),_onPassPhraseConfirmKeyPress:function(e){"Enter"===e.key&&this.state.passPhrase===this.state.passPhraseConfirm&&this._onPassPhraseConfirmNextClick()},_onSetAgainClick:function(){this.setState({passPhrase:"",passPhraseConfirm:"",phase:_,zxcvbnResult:null})},_onKeepItSafeBackClick:function(){this.setState({phase:2})},_o
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=s:null!==a(1022)&&null!==a(1023)&&(void 0===(n=function(){return s}.call(t,a,t,e))||(e.exports=n))}}]);
//# sourceMappingURL=1.js.map