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.
1 line
55 KiB
1 line
55 KiB
{"version":3,"sources":["(webpack)/buildin/amd-define.js","node_modules/matrix-react-sdk/lib/async-components/views/dialogs/keybackup/CreateKeyBackupDialog.js","node_modules/file-saver/FileSaver.js"],"names":["module","exports","Error","Object","defineProperty","value","_promise2","_interopRequireDefault","__webpack_require__","_regenerator2","_bluebird","_react2","_index2","_MatrixClientPeg2","_PasswordScorer","_fileSaver2","_languageHandler","obj","__esModule","default","PHASE_PASSPHRASE","PHASE_DONE","createClass","displayName","getInitialState","phase","passPhrase","passPhraseConfirm","copied","downloaded","zxcvbnResult","setPassPhrase","componentWillMount","this","_recoveryKeyNode","_keyBackupInfo","_setZxcvbnResultTimeout","componentWillUnmount","clearTimeout","_collectRecoveryKeyNode","n","_onCopyClick","target","range","document","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","selectText","execCommand","setState","_onDownloadClick","blob","Blob","recovery_key","type","saveAs","_createBackup","_ref","coroutine","mark","_callee","info","wrap","_context","prev","next","error","resolve","get","createKeyBackupVersion","sent","scheduleAllGroupSessionsForBackup","t0","console","log","deleteKeyBackupVersion","version","stop","apply","arguments","_onCancel","props","onFinished","_onDone","_onOptOutClick","_onSetUpClick","_onSkipPassPhraseClick","_ref2","_callee2","_context2","prepareKeyBackupVersion","_onPassPhraseNextClick","_onPassPhraseKeyPress","_ref3","_callee3","e","_this","_context3","key","scorePassword","state","_passPhraseIsValid","_x","_onPassPhraseConfirmNextClick","_ref4","_callee4","_context4","_onPassPhraseConfirmKeyPress","_onSetAgainClick","_onKeepItSafeBackClick","_onPassPhraseChange","_this2","setTimeout","_onPassPhraseConfirmChange","score","_renderPhasePassPhrase","DialogButtons","getComponent","strengthMeter","helpText","_t","suggestions","i","feedback","length","push","createElement","suggestionBlock","warning","max","b","sub","className","onChange","onKeyPress","placeholder","autoFocus","primaryButton","onPrimaryButtonClick","hasCancel","disabled","onClick","_renderPhasePassPhraseConfirm","AccessibleButton","matchText","startsWith","passPhraseMatch","element","_renderPhaseShowKey","bodyText","ref","_renderPhaseKeepItSafe","introText","s","_renderBusyPhase","text","Spinner","_renderPhaseDone","_renderPhaseOptOutConfirm","_titleForPhase","render","BaseDialog","content","onCancel","title","includes","__WEBPACK_AMD_DEFINE_RESULT__","view","navigator","test","userAgent","doc","get_URL","URL","webkitURL","save_link","createElementNS","can_use_save_link","is_safari","HTMLElement","safari","is_chrome_ios","throw_outside","ex","setImmediate","revoke","file","revokeObjectURL","remove","auto_bom","String","fromCharCode","FileSaver","name","no_auto_bom","object_url","filesaver","force","dispatch_all","event_types","event","concat","listener","call","dispatch","split","readyState","INIT","createObjectURL","node","href","download","MouseEvent","dispatchEvent","DONE","FileReader","reader","onloadend","url","result","replace","open","location","undefined","readAsDataURL","fs_error","FS_proto","prototype","msSaveOrOpenBlob","abort","WRITING","onwritestart","onprogress","onwrite","onabort","onerror","onwriteend","self"],"mappings":"4EAAAA,EAAAC,QAAA,WACA,UAAAC,MAAA,qECCAC,OAAAC,eAAAH,EAAA,cACAI,OAAA,IAGA,IAEAC,EAAAC,EAFeC,EAAQ,KAMvBC,EAAAF,EAFmBC,EAAQ,KAI3BE,EAAgBF,EAAQ,IAIxBG,EAAAJ,EAFaC,EAAQ,IAMrBI,EAAAL,EAFaC,EAAQ,IAMrBK,EAAAN,EAFuBC,EAAQ,IAI/BM,EAAsBN,EAAQ,KAI9BO,EAAAR,EAFiBC,EAAQ,MAIzBQ,EAAuBR,EAAQ,GAE/B,SAAAD,EAAAU,GAAsC,OAAAA,KAAAC,WAAAD,EAAA,CAAuCE,QAAAF,GAkB7E,IAAAG,EAAA,EAKAC,EAAA,EAoBApB,EAAAkB,QAAAR,EAAAQ,QAAAG,YAAA,CACAC,YAAA,wBAEAC,gBAAA,WACA,OACAC,MAAAL,EACAM,WAAA,GACAC,kBAAA,GACAC,QAAA,EACAC,YAAA,EACAC,aAAA,KACAC,eAAA,IAIAC,mBAA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,EAAAC,QACjCD,EAAAC,QAAA2D,SACmD,OAANpD,EAAA,OAA+B,OAAVA,EAAA,YAG/D4N,KAFDzD,EAAA,WACF,OAAA/G,GACGoJ,KAAA/M,EAAAO,EAAAP,EAAAD,QAAAC,QAAA0K","file":"bundles/e9b8313cd5591059cfdc/1.js","sourcesContent":["module.exports = function() {\n\tthrow new Error(\"define cannot be used indirect\");\n};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = require('babel-runtime/core-js/promise');\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _regenerator = require('babel-runtime/regenerator');\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _bluebird = require('bluebird');\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _index = require('../../../../index');\n\nvar _index2 = _interopRequireDefault(_index);\n\nvar _MatrixClientPeg = require('../../../../MatrixClientPeg');\n\nvar _MatrixClientPeg2 = _interopRequireDefault(_MatrixClientPeg);\n\nvar _PasswordScorer = require('../../../../utils/PasswordScorer');\n\nvar _fileSaver = require('file-saver');\n\nvar _fileSaver2 = _interopRequireDefault(_fileSaver);\n\nvar _languageHandler = require('../../../../languageHandler');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/*\nCopyright 2018, 2019 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nvar PHASE_PASSPHRASE = 0;\nvar PHASE_PASSPHRASE_CONFIRM = 1;\nvar PHASE_SHOWKEY = 2;\nvar PHASE_KEEPITSAFE = 3;\nvar PHASE_BACKINGUP = 4;\nvar PHASE_DONE = 5;\nvar PHASE_OPTOUT_CONFIRM = 6;\n\nvar PASSWORD_MIN_SCORE = 4; // So secure, many characters, much complex, wow, etc, etc.\nvar PASSPHRASE_FEEDBACK_DELAY = 500; // How long after keystroke to offer passphrase feedback, ms.\n\n// XXX: copied from ShareDialog: factor out into utils\nfunction selectText(target) {\n var range = document.createRange();\n range.selectNodeContents(target);\n\n var selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n}\n\n/**\n * Walks the user through the process of creating an e2e key backup\n * on the server.\n */\nexports.default = _react2.default.createClass({\n displayName: 'CreateKeyBackupDialog',\n\n getInitialState: function getInitialState() {\n return {\n phase: PHASE_PASSPHRASE,\n passPhrase: '',\n passPhraseConfirm: '',\n copied: false,\n downloaded: false,\n zxcvbnResult: null,\n setPassPhrase: false\n };\n },\n\n componentWillMount: function componentWillMount() {\n this._recoveryKeyNode = null;\n this._keyBackupInfo = null;\n this._setZxcvbnResultTimeout = null;\n },\n\n componentWillUnmount: function componentWillUnmount() {\n if (this._setZxcvbnResultTimeout !== null) {\n clearTimeout(this._setZxcvbnResultTimeout);\n }\n },\n\n _collectRecoveryKeyNode: function _collectRecoveryKeyNode(n) {\n this._recoveryKeyNode = n;\n },\n\n _onCopyClick: function _onCopyClick() {\n selectText(this._recoveryKeyNode);\n var successful = document.execCommand('copy');\n if (successful) {\n this.setState({\n copied: true,\n phase: PHASE_KEEPITSAFE\n });\n }\n },\n\n _onDownloadClick: function _onDownloadClick() {\n var blob = new Blob([this._keyBackupInfo.recovery_key], {\n type: 'text/plain;charset=us-ascii'\n });\n _fileSaver2.default.saveAs(blob, 'recovery-key.txt');\n\n this.setState({\n downloaded: true,\n phase: PHASE_KEEPITSAFE\n });\n },\n\n _createBackup: function () {\n var _ref = (0, _bluebird.coroutine)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {\n var info;\n return _regenerator2.default.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.setState({\n phase: PHASE_BACKINGUP,\n error: null\n });\n info = void 0;\n _context.prev = 2;\n _context.next = 5;\n return (0, _bluebird.resolve)(_MatrixClientPeg2.default.get().createKeyBackupVersion(this._keyBackupInfo));\n\n case 5:\n info = _context.sent;\n _context.next = 8;\n return (0, _bluebird.resolve)(_MatrixClientPeg2.default.get().scheduleAllGroupSessionsForBackup());\n\n case 8:\n this.setState({\n phase: PHASE_DONE\n });\n _context.next = 16;\n break;\n\n case 11:\n _context.prev = 11;\n _context.t0 = _context['catch'](2);\n\n console.log(\"Error creating key backup\", _context.t0);\n // TODO: If creating a version succeeds, but backup fails, should we\n // delete the version, disable backup, or do nothing? If we just\n // disable without deleting, we'll enable on next app reload since\n // it is trusted.\n if (info) {\n _MatrixClientPeg2.default.get().deleteKeyBackupVersion(info.version);\n }\n this.setState({\n error: _context.t0\n });\n\n case 16:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, this, [[2, 11]]);\n }));\n\n function _createBackup() {\n return _ref.apply(this, arguments);\n }\n\n return _createBackup;\n }(),\n\n _onCancel: function _onCancel() {\n this.props.onFinished(false);\n },\n\n _onDone: function _onDone() {\n this.props.onFinished(true);\n },\n\n _onOptOutClick: function _onOptOutClick() {\n this.setState({ phase: PHASE_OPTOUT_CONFIRM });\n },\n\n _onSetUpClick: function _onSetUpClick() {\n this.setState({ phase: PHASE_PASSPHRASE });\n },\n\n _onSkipPassPhraseClick: function () {\n var _ref2 = (0, _bluebird.coroutine)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {\n return _regenerator2.default.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0, _bluebird.resolve)(_MatrixClientPeg2.default.get().prepareKeyBackupVersion());\n\n case 2:\n this._keyBackupInfo = _context2.sent;\n\n this.setState({\n copied: false,\n downloaded: false,\n phase: PHASE_SHOWKEY\n });\n\n case 4:\n case 'end':\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function _onSkipPassPhraseClick() {\n return _ref2.apply(this, arguments);\n }\n\n return _onSkipPassPhraseClick;\n }(),\n\n _onPassPhraseNextClick: function _onPassPhraseNextClick() {\n this.setState({ phase: PHASE_PASSPHRASE_CONFIRM });\n },\n\n _onPassPhraseKeyPress: function () {\n var _ref3 = (0, _bluebird.coroutine)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(e) {\n var _this = this;\n\n return _regenerator2.default.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n if (!(e.key === 'Enter')) {\n _context3.next = 7;\n break;\n }\n\n if (!(this._setZxcvbnResultTimeout !== null)) {\n _context3.next = 6;\n break;\n }\n\n clearTimeout(this._setZxcvbnResultTimeout);\n this._setZxcvbnResultTimeout = null;\n _context3.next = 6;\n return (0, _bluebird.resolve)(new _promise2.default(function (resolve) {\n _this.setState({\n zxcvbnResult: (0, _PasswordScorer.scorePassword)(_this.state.passPhrase)\n }, resolve);\n }));\n\n case 6:\n if (this._passPhraseIsValid()) {\n this._onPassPhraseNextClick();\n }\n\n case 7:\n case 'end':\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function _onPassPhraseKeyPress(_x) {\n return _ref3.apply(this, arguments);\n }\n\n return _onPassPhraseKeyPress;\n }(),\n\n _onPassPhraseConfirmNextClick: function () {\n var _ref4 = (0, _bluebird.coroutine)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {\n return _regenerator2.default.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return (0, _bluebird.resolve)(_MatrixClientPeg2.default.get().prepareKeyBackupVersion(this.state.passPhrase));\n\n case 2:\n this._keyBackupInfo = _context4.sent;\n\n this.setState({\n setPassPhrase: true,\n copied: false,\n downloaded: false,\n phase: PHASE_SHOWKEY\n });\n\n case 4:\n case 'end':\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function _onPassPhraseConfirmNextClick() {\n return _ref4.apply(this, arguments);\n }\n\n return _onPassPhraseConfirmNextClick;\n }(),\n\n _onPassPhraseConfirmKeyPress: function _onPassPhraseConfirmKeyPress(e) {\n if (e.key === 'Enter' && this.state.passPhrase === this.state.passPhraseConfirm) {\n this._onPassPhraseConfirmNextClick();\n }\n },\n\n _onSetAgainClick: function _onSetAgainClick() {\n this.setState({\n passPhrase: '',\n passPhraseConfirm: '',\n phase: PHASE_PASSPHRASE,\n zxcvbnResult: null\n });\n },\n\n _onKeepItSafeBackClick: function _onKeepItSafeBackClick() {\n this.setState({\n phase: PHASE_SHOWKEY\n });\n },\n\n _onPassPhraseChange: function _onPassPhraseChange(e) {\n var _this2 = this;\n\n this.setState({\n passPhrase: e.target.value\n });\n\n if (this._setZxcvbnResultTimeout !== null) {\n clearTimeout(this._setZxcvbnResultTimeout);\n }\n this._setZxcvbnResultTimeout = setTimeout(function () {\n _this2._setZxcvbnResultTimeout = null;\n _this2.setState({\n // precompute this and keep it in state: zxcvbn is fast but\n // we use it in a couple of different places so no point recomputing\n // it unnecessarily.\n zxcvbnResult: (0, _PasswordScorer.scorePassword)(_this2.state.passPhrase)\n });\n }, PASSPHRASE_FEEDBACK_DELAY);\n },\n\n _onPassPhraseConfirmChange: function _onPassPhraseConfirmChange(e) {\n this.setState({\n passPhraseConfirm: e.target.value\n });\n },\n\n _passPhraseIsValid: function _passPhraseIsValid() {\n return this.state.zxcvbnResult && this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE;\n },\n\n _renderPhasePassPhrase: function _renderPhasePassPhrase() {\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n\n var strengthMeter = void 0;\n var helpText = void 0;\n if (this.state.zxcvbnResult) {\n if (this.state.zxcvbnResult.score >= PASSWORD_MIN_SCORE) {\n helpText = (0, _languageHandler._t)(\"Great! This passphrase looks strong enough.\");\n } else {\n var suggestions = [];\n for (var i = 0; i < this.state.zxcvbnResult.feedback.suggestions.length; ++i) {\n suggestions.push(_react2.default.createElement(\n 'div',\n { key: i },\n this.state.zxcvbnResult.feedback.suggestions[i]\n ));\n }\n var suggestionBlock = _react2.default.createElement(\n 'div',\n null,\n suggestions.length > 0 ? suggestions : (0, _languageHandler._t)(\"Keep going...\")\n );\n\n helpText = _react2.default.createElement(\n 'div',\n null,\n this.state.zxcvbnResult.feedback.warning,\n suggestionBlock\n );\n }\n strengthMeter = _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('progress', { max: PASSWORD_MIN_SCORE, value: this.state.zxcvbnResult.score })\n );\n }\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"<b>Warning</b>: you should only set up key backup from a trusted computer.\", {}, { b: function b(sub) {\n return _react2.default.createElement(\n 'b',\n null,\n sub\n );\n } })\n ),\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"We'll store an encrypted copy of your keys on our server. \" + \"Protect your backup with a passphrase to keep it secure.\")\n ),\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"For maximum security, this should be different from your account password.\")\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_primaryContainer' },\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_passPhraseContainer' },\n _react2.default.createElement('input', { type: 'password',\n onChange: this._onPassPhraseChange,\n onKeyPress: this._onPassPhraseKeyPress,\n value: this.state.passPhrase,\n className: 'mx_CreateKeyBackupDialog_passPhraseInput',\n placeholder: (0, _languageHandler._t)(\"Enter a passphrase...\"),\n autoFocus: true\n }),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_passPhraseHelp' },\n strengthMeter,\n helpText\n )\n )\n ),\n _react2.default.createElement(DialogButtons, { primaryButton: (0, _languageHandler._t)('Next'),\n onPrimaryButtonClick: this._onPassPhraseNextClick,\n hasCancel: false,\n disabled: !this._passPhraseIsValid()\n }),\n _react2.default.createElement(\n 'details',\n null,\n _react2.default.createElement(\n 'summary',\n null,\n (0, _languageHandler._t)(\"Advanced\")\n ),\n _react2.default.createElement(\n 'p',\n null,\n _react2.default.createElement(\n 'button',\n { onClick: this._onSkipPassPhraseClick },\n (0, _languageHandler._t)(\"Set up with a Recovery Key\")\n )\n )\n )\n );\n },\n\n _renderPhasePassPhraseConfirm: function _renderPhasePassPhraseConfirm() {\n var AccessibleButton = _index2.default.getComponent('elements.AccessibleButton');\n\n var matchText = void 0;\n if (this.state.passPhraseConfirm === this.state.passPhrase) {\n matchText = (0, _languageHandler._t)(\"That matches!\");\n } else if (!this.state.passPhrase.startsWith(this.state.passPhraseConfirm)) {\n // only tell them they're wrong if they've actually gone wrong.\n // Security concious readers will note that if you left riot-web unattended\n // on this screen, this would make it easy for a malicious person to guess\n // your passphrase one letter at a time, but they could get this faster by\n // just opening the browser's developer tools and reading it.\n // Note that not having typed anything at all will not hit this clause and\n // fall through so empty box === no hint.\n matchText = (0, _languageHandler._t)(\"That doesn't match.\");\n }\n\n var passPhraseMatch = null;\n if (matchText) {\n passPhraseMatch = _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_passPhraseMatch' },\n _react2.default.createElement(\n 'div',\n null,\n matchText\n ),\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n AccessibleButton,\n { element: 'span', className: 'mx_linkButton', onClick: this._onSetAgainClick },\n (0, _languageHandler._t)(\"Go back to set it again.\")\n )\n )\n );\n }\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"Please enter your passphrase a second time to confirm.\")\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_primaryContainer' },\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_passPhraseContainer' },\n _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement('input', { type: 'password',\n onChange: this._onPassPhraseConfirmChange,\n onKeyPress: this._onPassPhraseConfirmKeyPress,\n value: this.state.passPhraseConfirm,\n className: 'mx_CreateKeyBackupDialog_passPhraseInput',\n placeholder: (0, _languageHandler._t)(\"Repeat your passphrase...\"),\n autoFocus: true\n })\n ),\n passPhraseMatch\n )\n ),\n _react2.default.createElement(DialogButtons, { primaryButton: (0, _languageHandler._t)('Next'),\n onPrimaryButtonClick: this._onPassPhraseConfirmNextClick,\n hasCancel: false,\n disabled: this.state.passPhrase !== this.state.passPhraseConfirm\n })\n );\n },\n\n _renderPhaseShowKey: function _renderPhaseShowKey() {\n var bodyText = void 0;\n if (this.state.setPassPhrase) {\n bodyText = (0, _languageHandler._t)(\"As a safety net, you can use it to restore your encrypted message \" + \"history if you forget your Recovery Passphrase.\");\n } else {\n bodyText = (0, _languageHandler._t)(\"As a safety net, you can use it to restore your encrypted message history.\");\n }\n\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"Your recovery key is a safety net - you can use it to restore \" + \"access to your encrypted messages if you forget your passphrase.\")\n ),\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"Keep your recovery key somewhere very secure, like a password manager (or a safe)\")\n ),\n _react2.default.createElement(\n 'p',\n null,\n bodyText\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_primaryContainer' },\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_recoveryKeyHeader' },\n (0, _languageHandler._t)(\"Your Recovery Key\")\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_recoveryKeyContainer' },\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_recoveryKey' },\n _react2.default.createElement(\n 'code',\n { ref: this._collectRecoveryKeyNode },\n this._keyBackupInfo.recovery_key\n )\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_CreateKeyBackupDialog_recoveryKeyButtons' },\n _react2.default.createElement(\n 'button',\n { className: 'mx_Dialog_primary', onClick: this._onCopyClick },\n (0, _languageHandler._t)(\"Copy to clipboard\")\n ),\n _react2.default.createElement(\n 'button',\n { className: 'mx_Dialog_primary', onClick: this._onDownloadClick },\n (0, _languageHandler._t)(\"Download\")\n )\n )\n )\n )\n );\n },\n\n _renderPhaseKeepItSafe: function _renderPhaseKeepItSafe() {\n var introText = void 0;\n if (this.state.copied) {\n introText = (0, _languageHandler._t)(\"Your Recovery Key has been <b>copied to your clipboard</b>, paste it to:\", {}, { b: function b(s) {\n return _react2.default.createElement(\n 'b',\n null,\n s\n );\n } });\n } else if (this.state.downloaded) {\n introText = (0, _languageHandler._t)(\"Your Recovery Key is in your <b>Downloads</b> folder.\", {}, { b: function b(s) {\n return _react2.default.createElement(\n 'b',\n null,\n s\n );\n } });\n }\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n return _react2.default.createElement(\n 'div',\n null,\n introText,\n _react2.default.createElement(\n 'ul',\n null,\n _react2.default.createElement(\n 'li',\n null,\n (0, _languageHandler._t)(\"<b>Print it</b> and store it somewhere safe\", {}, { b: function b(s) {\n return _react2.default.createElement(\n 'b',\n null,\n s\n );\n } })\n ),\n _react2.default.createElement(\n 'li',\n null,\n (0, _languageHandler._t)(\"<b>Save it</b> on a USB key or backup drive\", {}, { b: function b(s) {\n return _react2.default.createElement(\n 'b',\n null,\n s\n );\n } })\n ),\n _react2.default.createElement(\n 'li',\n null,\n (0, _languageHandler._t)(\"<b>Copy it</b> to your personal cloud storage\", {}, { b: function b(s) {\n return _react2.default.createElement(\n 'b',\n null,\n s\n );\n } })\n )\n ),\n _react2.default.createElement(\n DialogButtons,\n { primaryButton: (0, _languageHandler._t)(\"OK\"),\n onPrimaryButtonClick: this._createBackup,\n hasCancel: false },\n _react2.default.createElement(\n 'button',\n { onClick: this._onKeepItSafeBackClick },\n (0, _languageHandler._t)(\"Back\")\n )\n )\n );\n },\n\n _renderBusyPhase: function _renderBusyPhase(text) {\n var Spinner = _index2.default.getComponent('views.elements.Spinner');\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(Spinner, null)\n );\n },\n\n _renderPhaseDone: function _renderPhaseDone() {\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n return _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"Your keys are being backed up (the first backup could take a few minutes).\")\n ),\n _react2.default.createElement(DialogButtons, { primaryButton: (0, _languageHandler._t)('Okay'),\n onPrimaryButtonClick: this._onDone,\n hasCancel: false\n })\n );\n },\n\n _renderPhaseOptOutConfirm: function _renderPhaseOptOutConfirm() {\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n return _react2.default.createElement(\n 'div',\n null,\n (0, _languageHandler._t)(\"Without setting up Secure Message Recovery, you won't be able to restore your \" + \"encrypted message history if you log out or use another device.\"),\n _react2.default.createElement(\n DialogButtons,\n { primaryButton: (0, _languageHandler._t)('Set up Secure Message Recovery'),\n onPrimaryButtonClick: this._onSetUpClick,\n hasCancel: false\n },\n _react2.default.createElement(\n 'button',\n { onClick: this._onCancel },\n 'I understand, continue without'\n )\n )\n );\n },\n\n _titleForPhase: function _titleForPhase(phase) {\n switch (phase) {\n case PHASE_PASSPHRASE:\n return (0, _languageHandler._t)('Secure your backup with a passphrase');\n case PHASE_PASSPHRASE_CONFIRM:\n return (0, _languageHandler._t)('Confirm your passphrase');\n case PHASE_OPTOUT_CONFIRM:\n return (0, _languageHandler._t)('Warning!');\n case PHASE_SHOWKEY:\n return (0, _languageHandler._t)('Recovery key');\n case PHASE_KEEPITSAFE:\n return (0, _languageHandler._t)('Keep it safe');\n case PHASE_BACKINGUP:\n return (0, _languageHandler._t)('Starting backup...');\n case PHASE_DONE:\n return (0, _languageHandler._t)('Success!');\n default:\n return (0, _languageHandler._t)(\"Create Key Backup\");\n }\n },\n\n render: function render() {\n var BaseDialog = _index2.default.getComponent('views.dialogs.BaseDialog');\n\n var content = void 0;\n if (this.state.error) {\n var DialogButtons = _index2.default.getComponent('views.elements.DialogButtons');\n content = _react2.default.createElement(\n 'div',\n null,\n _react2.default.createElement(\n 'p',\n null,\n (0, _languageHandler._t)(\"Unable to create key backup\")\n ),\n _react2.default.createElement(\n 'div',\n { className: 'mx_Dialog_buttons' },\n _react2.default.createElement(DialogButtons, { primaryButton: (0, _languageHandler._t)('Retry'),\n onPrimaryButtonClick: this._createBackup,\n hasCancel: true,\n onCancel: this._onCancel\n })\n )\n );\n } else {\n switch (this.state.phase) {\n case PHASE_PASSPHRASE:\n content = this._renderPhasePassPhrase();\n break;\n case PHASE_PASSPHRASE_CONFIRM:\n content = this._renderPhasePassPhraseConfirm();\n break;\n case PHASE_SHOWKEY:\n content = this._renderPhaseShowKey();\n break;\n case PHASE_KEEPITSAFE:\n content = this._renderPhaseKeepItSafe();\n break;\n case PHASE_BACKINGUP:\n content = this._renderBusyPhase();\n break;\n case PHASE_DONE:\n content = this._renderPhaseDone();\n break;\n case PHASE_OPTOUT_CONFIRM:\n content = this._renderPhaseOptOutConfirm();\n break;\n }\n }\n\n return _react2.default.createElement(\n BaseDialog,\n { className: 'mx_CreateKeyBackupDialog',\n onFinished: this.props.onFinished,\n title: this._titleForPhase(this.state.phase),\n hasCancel: [PHASE_PASSPHRASE, PHASE_DONE].includes(this.state.phase)\n },\n _react2.default.createElement(\n 'div',\n null,\n content\n )\n );\n }\n});\nmodule.exports = exports['default'];\n//# sourceMappingURL=CreateKeyBackupDialog.js.map","/* FileSaver.js\n * A saveAs() FileSaver implementation.\n * 1.3.2\n * 2016-06-16 18:25:19\n *\n * By Eli Grey, http://eligrey.com\n * License: MIT\n * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md\n */\n\n/*global self */\n/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */\n\n/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */\n\nvar saveAs = saveAs || (function(view) {\n\t\"use strict\";\n\t// IE <10 is explicitly unsupported\n\tif (typeof view === \"undefined\" || typeof navigator !== \"undefined\" && /MSIE [1-9]\\./.test(navigator.userAgent)) {\n\t\treturn;\n\t}\n\tvar\n\t\t doc = view.document\n\t\t // only get URL when necessary in case Blob.js hasn't overridden it yet\n\t\t, get_URL = function() {\n\t\t\treturn view.URL || view.webkitURL || view;\n\t\t}\n\t\t, save_link = doc.createElementNS(\"http://www.w3.org/1999/xhtml\", \"a\")\n\t\t, can_use_save_link = \"download\" in save_link\n\t\t, click = function(node) {\n\t\t\tvar event = new MouseEvent(\"click\");\n\t\t\tnode.dispatchEvent(event);\n\t\t}\n\t\t, is_safari = /constructor/i.test(view.HTMLElement) || view.safari\n\t\t, is_chrome_ios =/CriOS\\/[\\d]+/.test(navigator.userAgent)\n\t\t, throw_outside = function(ex) {\n\t\t\t(view.setImmediate || view.setTimeout)(function() {\n\t\t\t\tthrow ex;\n\t\t\t}, 0);\n\t\t}\n\t\t, force_saveable_type = \"application/octet-stream\"\n\t\t// the Blob API is fundamentally broken as there is no \"downloadfinished\" event to subscribe to\n\t\t, arbitrary_revoke_timeout = 1000 * 40 // in ms\n\t\t, revoke = function(file) {\n\t\t\tvar revoker = function() {\n\t\t\t\tif (typeof file === \"string\") { // file is an object URL\n\t\t\t\t\tget_URL().revokeObjectURL(file);\n\t\t\t\t} else { // file is a File\n\t\t\t\t\tfile.remove();\n\t\t\t\t}\n\t\t\t};\n\t\t\tsetTimeout(revoker, arbitrary_revoke_timeout);\n\t\t}\n\t\t, dispatch = function(filesaver, event_types, event) {\n\t\t\tevent_types = [].concat(event_types);\n\t\t\tvar i = event_types.length;\n\t\t\twhile (i--) {\n\t\t\t\tvar listener = filesaver[\"on\" + event_types[i]];\n\t\t\t\tif (typeof listener === \"function\") {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlistener.call(filesaver, event || filesaver);\n\t\t\t\t\t} catch (ex) {\n\t\t\t\t\t\tthrow_outside(ex);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t, auto_bom = function(blob) {\n\t\t\t// prepend BOM for UTF-8 XML and text/* types (including HTML)\n\t\t\t// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n\t\t\tif (/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n\t\t\t\treturn new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});\n\t\t\t}\n\t\t\treturn blob;\n\t\t}\n\t\t, FileSaver = function(blob, name, no_auto_bom) {\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\t// First try a.download, then web filesystem, then object URLs\n\t\t\tvar\n\t\t\t\t filesaver = this\n\t\t\t\t, type = blob.type\n\t\t\t\t, force = type === force_saveable_type\n\t\t\t\t, object_url\n\t\t\t\t, dispatch_all = function() {\n\t\t\t\t\tdispatch(filesaver, \"writestart progress write writeend\".split(\" \"));\n\t\t\t\t}\n\t\t\t\t// on any filesys errors revert to saving with object URLs\n\t\t\t\t, fs_error = function() {\n\t\t\t\t\tif ((is_chrome_ios || (force && is_safari)) && view.FileReader) {\n\t\t\t\t\t\t// Safari doesn't allow downloading of blob urls\n\t\t\t\t\t\tvar reader = new FileReader();\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');\n\t\t\t\t\t\t\tvar popup = view.open(url, '_blank');\n\t\t\t\t\t\t\tif(!popup) view.location.href = url;\n\t\t\t\t\t\t\turl=undefined; // release reference before dispatching\n\t\t\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\t\t\tdispatch_all();\n\t\t\t\t\t\t};\n\t\t\t\t\t\treader.readAsDataURL(blob);\n\t\t\t\t\t\tfilesaver.readyState = filesaver.INIT;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// don't create more object URLs than needed\n\t\t\t\t\tif (!object_url) {\n\t\t\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\t\t}\n\t\t\t\t\tif (force) {\n\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar opened = view.open(object_url, \"_blank\");\n\t\t\t\t\t\tif (!opened) {\n\t\t\t\t\t\t\t// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html\n\t\t\t\t\t\t\tview.location.href = object_url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t}\n\t\t\t;\n\t\t\tfilesaver.readyState = filesaver.INIT;\n\n\t\t\tif (can_use_save_link) {\n\t\t\t\tobject_url = get_URL().createObjectURL(blob);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsave_link.href = object_url;\n\t\t\t\t\tsave_link.download = name;\n\t\t\t\t\tclick(save_link);\n\t\t\t\t\tdispatch_all();\n\t\t\t\t\trevoke(object_url);\n\t\t\t\t\tfilesaver.readyState = filesaver.DONE;\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfs_error();\n\t\t}\n\t\t, FS_proto = FileSaver.prototype\n\t\t, saveAs = function(blob, name, no_auto_bom) {\n\t\t\treturn new FileSaver(blob, name || blob.name || \"download\", no_auto_bom);\n\t\t}\n\t;\n\t// IE 10+ (native saveAs)\n\tif (typeof navigator !== \"undefined\" && navigator.msSaveOrOpenBlob) {\n\t\treturn function(blob, name, no_auto_bom) {\n\t\t\tname = name || blob.name || \"download\";\n\n\t\t\tif (!no_auto_bom) {\n\t\t\t\tblob = auto_bom(blob);\n\t\t\t}\n\t\t\treturn navigator.msSaveOrOpenBlob(blob, name);\n\t\t};\n\t}\n\n\tFS_proto.abort = function(){};\n\tFS_proto.readyState = FS_proto.INIT = 0;\n\tFS_proto.WRITING = 1;\n\tFS_proto.DONE = 2;\n\n\tFS_proto.error =\n\tFS_proto.onwritestart =\n\tFS_proto.onprogress =\n\tFS_proto.onwrite =\n\tFS_proto.onabort =\n\tFS_proto.onerror =\n\tFS_proto.onwriteend =\n\t\tnull;\n\n\treturn saveAs;\n}(\n\t typeof self !== \"undefined\" && self\n\t|| typeof window !== \"undefined\" && window\n\t|| this.content\n));\n// `self` is undefined in Firefox for Android content script context\n// while `this` is nsIContentFrameMessageManager\n// with an attribute `content` that corresponds to the window\n\nif (typeof module !== \"undefined\" && module.exports) {\n module.exports.saveAs = saveAs;\n} else if ((typeof define !== \"undefined\" && define !== null) && (define.amd !== null)) {\n define(\"FileSaver.js\", function() {\n return saveAs;\n });\n}\n"],"sourceRoot":""} |