From 782f2d1fea6f7c0b7f0f603475fea0b54a0de62b Mon Sep 17 00:00:00 2001 From: or-else Date: Fri, 26 Oct 2018 15:29:33 +0300 Subject: [PATCH] adding back missing and changed dependencies --- src/i18n/en.json | 4 +-- src/i18n/ru.json | 2 +- src/views/create-account-view.jsx | 54 ++++++++++++++++--------------- src/views/login-view.jsx | 15 ++++++--- src/views/sidepanel-view.jsx | 6 ++-- src/views/tinode-web.jsx | 2 -- umd/index.dev.js | 14 ++++---- umd/index.prod.js | 4 +-- 8 files changed, 54 insertions(+), 47 deletions(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index 7f6f53dc..37b3b5fd 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1,7 +1,7 @@ { "contacts_not_found": "You have no chats
¯\\\\_(ツ)_/¯", - "email_prompt": "Email, e.g. jdoe@example.com", "full_name_prompt": "Full name, e.g. John Doe", + "email_prompt": "Email, e.g. jdoe@example.com", "sign_up_button": "Sign up", "login_prompt": "Login", "password_prompt": "Password", @@ -17,4 +17,4 @@ "sidepanel_title_newtpk": "Start New Chat", "sidepanel_title_cred": "Confirm Credentials", "sidepanel_title_reset": "Reset Password" -} \ No newline at end of file +} diff --git a/src/i18n/ru.json b/src/i18n/ru.json index a7e86a5e..a0cb161c 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -1,7 +1,7 @@ { "contacts_not_found": "Чатов нет
¯\\\\_(ツ)_/¯", - "email_prompt": "Email, напр. ivan@example.com", "full_name_prompt": "Полное имя, напр. Иван Петров", + "email_prompt": "Email, напр. ivan@example.com", "sign_up_button": "Создать счет", "login_prompt": "Логин", "password_prompt": "Пароль", diff --git a/src/views/create-account-view.jsx b/src/views/create-account-view.jsx index 7fba80ad..7ad27a2f 100644 --- a/src/views/create-account-view.jsx +++ b/src/views/create-account-view.jsx @@ -1,23 +1,13 @@ // Account registration. import React from 'react'; -import { FormattedMessage, defineMessages } from 'react-intl'; +import { FormattedMessage } from 'react-intl'; import AvatarUpload from '../widgets/avatar-upload.jsx'; import CheckBox from '../widgets/checkbox.jsx'; import VisiblePassword from '../widgets/visible-password.jsx'; -const messages = defineMessages({ - 'email_prompt': { - id: 'email_prompt', - description: 'Input placeholder for email entry', - defaultMessage: 'Email, e.g. jdoe@example.com' - }, - 'full_name_prompt': { - id: 'full_name_prompt', - description: 'Input placeholder for person\'s full name', - defaultMessage: 'Full name, e.g. John Doe' - } -}); +import LocalStorageUtil from '../lib/local-storage.js'; +import vcard from '../lib/utils.js'; export default class CreateAccountView extends React.PureComponent { constructor(props) { @@ -30,7 +20,7 @@ export default class CreateAccountView extends React.PureComponent { fn: '', // full/formatted name imageDataUrl: null, errorCleared: false, - saveToken: localStorage.getObject('keep-logged-in') + saveToken: LocalStorageUtil.getObject('keep-logged-in') }; this.handleLoginChange = this.handleLoginChange.bind(this); @@ -63,7 +53,7 @@ export default class CreateAccountView extends React.PureComponent { } handleToggleSaveToken() { - localStorage.setObject('keep-logged-in', !this.state.saveToken); + LocalStorageUtil.setObject('keep-logged-in', !this.state.saveToken); this.setState({saveToken: !this.state.saveToken}); } @@ -83,33 +73,45 @@ export default class CreateAccountView extends React.PureComponent { if (this.props.disabled) { submitClasses += ' disabled'; } - const {formatMessage} = this.props.intl; + return (
- - + { + (login_prompt) => + } + { + (password_prompt) => + }
- + { + + }
- + { + + }
- + + {(stay_logged_in) => } +
diff --git a/src/views/sidepanel-view.jsx b/src/views/sidepanel-view.jsx index d20a6387..c213cde0 100644 --- a/src/views/sidepanel-view.jsx +++ b/src/views/sidepanel-view.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { defineMessages } from 'react-intl'; +import { defineMessages, injectIntl } from 'react-intl'; import SideNavbar from '../widgets/side-navbar.jsx'; import ErrorPanel from '../widgets/error-panel.jsx'; @@ -52,7 +52,7 @@ const messages = defineMessages({ } }); -export default class SidepanelView extends React.Component { +class SidepanelView extends React.Component { constructor(props) { super(props); @@ -168,3 +168,5 @@ export default class SidepanelView extends React.Component { ); } }; + +export default injectIntl(SidepanelView); diff --git a/src/views/tinode-web.jsx b/src/views/tinode-web.jsx index 83f1446b..265cb85f 100644 --- a/src/views/tinode-web.jsx +++ b/src/views/tinode-web.jsx @@ -20,8 +20,6 @@ import HashNavigation from '../lib/navigation.js'; // Sound to play on message received. export const POP_SOUND = new Audio('audio/msg.mp3'); -console.log(FIREBASE_INIT); - export default class TinodeWeb extends React.Component { constructor(props) { super(props); diff --git a/umd/index.dev.js b/umd/index.dev.js index ce1c25b8..06ce76f6 100644 --- a/umd/index.dev.js +++ b/umd/index.dev.js @@ -680,10 +680,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /*!**************************!*\ !*** ./src/i18n/en.json ***! \**************************/ -/*! exports provided: contacts_not_found, email_prompt, full_name_prompt, login_prompt, password_prompt, stay_logged_in, forgot_password_link, sign_in_button, label_client, label_server, sidepanel_title_login, sidepanel_title_register, sidepanel_title_settings, sidepanel_title_edit_account, sidepanel_title_newtpk, sidepanel_title_cred, sidepanel_title_reset, default */ +/*! exports provided: contacts_not_found, full_name_prompt, email_prompt, sign_up_button, login_prompt, password_prompt, stay_logged_in, forgot_password_link, sign_in_button, label_client, label_server, sidepanel_title_login, sidepanel_title_register, sidepanel_title_settings, sidepanel_title_edit_account, sidepanel_title_newtpk, sidepanel_title_cred, sidepanel_title_reset, default */ /***/ (function(module) { -eval("module.exports = {\"contacts_not_found\":\"You have no chats
¯\\\\\\\\_(ツ)_/¯\",\"email_prompt\":\"Email, e.g jdoe@example.com\",\"full_name_prompt\":\"Full name, e.g. John Doe\",\"login_prompt\":\"Login\",\"password_prompt\":\"Password\",\"stay_logged_in\":\"Stay logged in\",\"forgot_password_link\":\"Forgot password?\",\"sign_in_button\":\"Sign in\",\"label_client\":\"Client:\",\"label_server\":\"Server:\",\"sidepanel_title_login\":\"Sign In\",\"sidepanel_title_register\":\"Create Account\",\"sidepanel_title_settings\":\"Settings\",\"sidepanel_title_edit_account\":\"Edit Account\",\"sidepanel_title_newtpk\":\"Start New Chat\",\"sidepanel_title_cred\":\"Confirm Credentials\",\"sidepanel_title_reset\":\"Reset Password\"};\n\n//# sourceURL=webpack:///./src/i18n/en.json?"); +eval("module.exports = {\"contacts_not_found\":\"You have no chats
¯\\\\\\\\_(ツ)_/¯\",\"full_name_prompt\":\"Full name, e.g. John Doe\",\"email_prompt\":\"Email, e.g. jdoe@example.com\",\"sign_up_button\":\"Sign up\",\"login_prompt\":\"Login\",\"password_prompt\":\"Password\",\"stay_logged_in\":\"Stay logged in\",\"forgot_password_link\":\"Forgot password?\",\"sign_in_button\":\"Sign in\",\"label_client\":\"Client:\",\"label_server\":\"Server:\",\"sidepanel_title_login\":\"Sign In\",\"sidepanel_title_register\":\"Create Account\",\"sidepanel_title_settings\":\"Settings\",\"sidepanel_title_edit_account\":\"Edit Account\",\"sidepanel_title_newtpk\":\"Start New Chat\",\"sidepanel_title_cred\":\"Confirm Credentials\",\"sidepanel_title_reset\":\"Reset Password\"};\n\n//# sourceURL=webpack:///./src/i18n/en.json?"); /***/ }), @@ -691,10 +691,10 @@ eval("module.exports = {\"contacts_not_found\":\"You have no chats
¯\\\\\\ /*!**************************!*\ !*** ./src/i18n/ru.json ***! \**************************/ -/*! exports provided: contacts_not_found, email_prompt, full_name_prompt, login_prompt, password_prompt, stay_logged_in, forgot_password_link, sign_in_button, label_client, label_server, sidepanel_title_login, sidepanel_title_register, sidepanel_title_settings, sidepanel_title_edit_account, sidepanel_title_newtpk, sidepanel_title_cred, sidepanel_title_reset, default */ +/*! exports provided: contacts_not_found, email_prompt, full_name_prompt, sign_up_button, login_prompt, password_prompt, stay_logged_in, forgot_password_link, sign_in_button, label_client, label_server, sidepanel_title_login, sidepanel_title_register, sidepanel_title_settings, sidepanel_title_edit_account, sidepanel_title_newtpk, sidepanel_title_cred, sidepanel_title_reset, default */ /***/ (function(module) { -eval("module.exports = {\"contacts_not_found\":\"Чатов нет
¯\\\\\\\\_(ツ)_/¯\",\"email_prompt\":\"Email, напр. ivan@example.com\",\"full_name_prompt\":\"Полное имя, напр. Иван Петров\",\"login_prompt\":\"Логин\",\"password_prompt\":\"Пароль\",\"stay_logged_in\":\"Запомнить\",\"forgot_password_link\":\"Напомнить пароль\",\"sign_in_button\":\"Войти\",\"label_client\":\"Клиент:\",\"label_server\":\"Сервер:\",\"sidepanel_title_login\":\"Авторизация\",\"sidepanel_title_register\":\"Зарегистрироваться\",\"sidepanel_title_settings\":\"Настройки\",\"sidepanel_title_edit_account\":\"Редактировать счет\",\"sidepanel_title_newtpk\":\"Новый чат\",\"sidepanel_title_cred\":\"Подтвердить\",\"sidepanel_title_reset\":\"Сменить пароль\"};\n\n//# sourceURL=webpack:///./src/i18n/ru.json?"); +eval("module.exports = {\"contacts_not_found\":\"Чатов нет
¯\\\\\\\\_(ツ)_/¯\",\"email_prompt\":\"Email, напр. ivan@example.com\",\"full_name_prompt\":\"Полное имя, напр. Иван Петров\",\"sign_up_button\":\"Создать счет\",\"login_prompt\":\"Логин\",\"password_prompt\":\"Пароль\",\"stay_logged_in\":\"Запомнить\",\"forgot_password_link\":\"Напомнить пароль\",\"sign_in_button\":\"Войти\",\"label_client\":\"Клиент:\",\"label_server\":\"Сервер:\",\"sidepanel_title_login\":\"Авторизация\",\"sidepanel_title_register\":\"Зарегистрироваться\",\"sidepanel_title_settings\":\"Настройки\",\"sidepanel_title_edit_account\":\"Редактировать счет\",\"sidepanel_title_newtpk\":\"Новый чат\",\"sidepanel_title_cred\":\"Подтвердить\",\"sidepanel_title_reset\":\"Сменить пароль\"};\n\n//# sourceURL=webpack:///./src/i18n/ru.json?"); /***/ }), @@ -778,7 +778,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CreateAccountView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'email_prompt': {\n \"id\": \"email_prompt\",\n \"defaultMessage\": \"Email, e.g. jdoe@example.com\"\n },\n 'full_name_prompt': {\n \"id\": \"full_name_prompt\",\n \"defaultMessage\": \"Full name, e.g. John Doe\"\n }\n});\n\nvar CreateAccountView = function (_React$PureComponent) {\n _inherits(CreateAccountView, _React$PureComponent);\n\n function CreateAccountView(props) {\n var _this;\n\n _classCallCheck(this, CreateAccountView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(CreateAccountView).call(this, props));\n _this.state = {\n login: '',\n password: '',\n email: '',\n fn: '',\n imageDataUrl: null,\n errorCleared: false,\n saveToken: localStorage.getObject('keep-logged-in')\n };\n _this.handleLoginChange = _this.handleLoginChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordChange = _this.handlePasswordChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEmailChange = _this.handleEmailChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFnChange = _this.handleFnChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleSaveToken = _this.handleToggleSaveToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(CreateAccountView, [{\n key: \"handleLoginChange\",\n value: function handleLoginChange(e) {\n this.setState({\n login: e.target.value\n });\n }\n }, {\n key: \"handlePasswordChange\",\n value: function handlePasswordChange(password) {\n this.setState({\n password: password\n });\n }\n }, {\n key: \"handleEmailChange\",\n value: function handleEmailChange(e) {\n this.setState({\n email: e.target.value\n });\n }\n }, {\n key: \"handleFnChange\",\n value: function handleFnChange(e) {\n this.setState({\n fn: e.target.value\n });\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n imageDataUrl: img\n });\n }\n }, {\n key: \"handleToggleSaveToken\",\n value: function handleToggleSaveToken() {\n localStorage.setObject('keep-logged-in', !this.state.saveToken);\n this.setState({\n saveToken: !this.state.saveToken\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n this.setState({\n errorCleared: false\n });\n this.props.onCreateAccount(this.state.login.trim(), this.state.password.trim(), vcard(this.state.fn, this.state.imageDataUrl), {\n 'meth': 'email',\n 'val': this.state.email\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var submitClasses = 'blue';\n\n if (this.props.disabled) {\n submitClasses += ' disabled';\n }\n\n var formatMessage = this.props.intl.formatMessage;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n className: \"panel-form-column\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: \"{formatMessage({id: 'login_prompt'})}\",\n autoComplete: \"user-name\",\n value: this.state.login,\n onChange: this.handleLoginChange,\n required: true,\n autoFocus: true\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n placeholder: \"{formatMessage({id: 'password_prompt'})}\",\n autoComplete: \"new-password\",\n value: this.state.password,\n onFinished: this.handlePasswordChange,\n required: true\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n onImageChanged: this.handleImageChanged,\n onError: this.props.onError\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: \"{formatMessage(messages.full_name_prompt)}\",\n autoComplete: \"name\",\n value: this.state.fn,\n onChange: this.handleFnChange,\n required: true\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n placeholder: \"{formatMessage(messages.email_prompt)}\",\n autoComplete: \"email\",\n value: this.state.email,\n onChange: this.handleEmailChange,\n required: true\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n id: \"save-token\",\n name: \"save-token\",\n checked: this.state.saveToken,\n onChange: this.handleToggleSaveToken\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"save-token\"\n }, \"\\xA0\", formatMessage({\n id: 'stay_logged_in'\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: submitClasses,\n type: \"submit\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"sign_up_button\",\n defaultMessage: \"Sign up\"\n }))));\n }\n }]);\n\n return CreateAccountView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/create-account-view.jsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CreateAccountView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/avatar-upload.jsx */ \"./src/widgets/avatar-upload.jsx\");\n/* harmony import */ var _widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/checkbox.jsx */ \"./src/widgets/checkbox.jsx\");\n/* harmony import */ var _widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/visible-password.jsx */ \"./src/widgets/visible-password.jsx\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\nvar CreateAccountView = function (_React$PureComponent) {\n _inherits(CreateAccountView, _React$PureComponent);\n\n function CreateAccountView(props) {\n var _this;\n\n _classCallCheck(this, CreateAccountView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(CreateAccountView).call(this, props));\n _this.state = {\n login: '',\n password: '',\n email: '',\n fn: '',\n imageDataUrl: null,\n errorCleared: false,\n saveToken: localStorage.getObject('keep-logged-in')\n };\n _this.handleLoginChange = _this.handleLoginChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordChange = _this.handlePasswordChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleEmailChange = _this.handleEmailChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleFnChange = _this.handleFnChange.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleImageChanged = _this.handleImageChanged.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleSaveToken = _this.handleToggleSaveToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSubmit = _this.handleSubmit.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(CreateAccountView, [{\n key: \"handleLoginChange\",\n value: function handleLoginChange(e) {\n this.setState({\n login: e.target.value\n });\n }\n }, {\n key: \"handlePasswordChange\",\n value: function handlePasswordChange(password) {\n this.setState({\n password: password\n });\n }\n }, {\n key: \"handleEmailChange\",\n value: function handleEmailChange(e) {\n this.setState({\n email: e.target.value\n });\n }\n }, {\n key: \"handleFnChange\",\n value: function handleFnChange(e) {\n this.setState({\n fn: e.target.value\n });\n }\n }, {\n key: \"handleImageChanged\",\n value: function handleImageChanged(img) {\n this.setState({\n imageDataUrl: img\n });\n }\n }, {\n key: \"handleToggleSaveToken\",\n value: function handleToggleSaveToken() {\n localStorage.setObject('keep-logged-in', !this.state.saveToken);\n this.setState({\n saveToken: !this.state.saveToken\n });\n }\n }, {\n key: \"handleSubmit\",\n value: function handleSubmit(e) {\n e.preventDefault();\n this.setState({\n errorCleared: false\n });\n this.props.onCreateAccount(this.state.login.trim(), this.state.password.trim(), vcard(this.state.fn, this.state.imageDataUrl), {\n 'meth': 'email',\n 'val': this.state.email\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var submitClasses = 'blue';\n\n if (this.props.disabled) {\n submitClasses += ' disabled';\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"form\", {\n className: \"panel-form-column\",\n onSubmit: this.handleSubmit\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-column\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"login_prompt\"\n }, function (login_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: login_prompt,\n autoComplete: \"user-name\",\n value: _this2.state.login,\n onChange: _this2.handleLoginChange,\n required: true,\n autoFocus: true\n });\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"password_prompt\"\n }, function (password_prompt) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_visible_password_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n placeholder: password_prompt,\n autoComplete: \"new-password\",\n value: _this2.state.password,\n onFinished: _this2.handlePasswordChange,\n required: true\n });\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_avatar_upload_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n onImageChanged: this.handleImageChanged,\n onError: this.props.onError\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"full_name_prompt\",\n defaultMessage: \"Full name, e.g. John Doe\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"text\",\n placeholder: full_name_prompt,\n autoComplete: \"name\",\n value: this.state.fn,\n onChange: this.handleFnChange,\n required: true\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"email_prompt\",\n defaultMessage: \"Email, e.g. jdoe@example.com\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n type: \"email\",\n placeholder: email_prompt,\n autoComplete: \"email\",\n value: this.state.email,\n onChange: this.handleEmailChange,\n required: true\n }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panel-form-row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_checkbox_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n id: \"save-token\",\n name: \"save-token\",\n checked: this.state.saveToken,\n onChange: this.handleToggleSaveToken\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"stay_logged_in\"\n }, function (stay_logged_in) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", {\n htmlFor: \"save-token\"\n }, \"\\xA0\", stay_logged_in);\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"dialog-buttons\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", {\n className: submitClasses,\n type: \"submit\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"FormattedMessage\"], {\n id: \"sign_up_button\",\n defaultMessage: \"Sign up\"\n }))));\n }\n }]);\n\n return CreateAccountView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.PureComponent);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/create-account-view.jsx?"); /***/ }), @@ -886,7 +886,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SidepanelView; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/side-navbar.jsx */ \"./src/widgets/side-navbar.jsx\");\n/* harmony import */ var _widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/error-panel.jsx */ \"./src/widgets/error-panel.jsx\");\n/* harmony import */ var _contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contacts-view.jsx */ \"./src/views/contacts-view.jsx\");\n/* harmony import */ var _create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-account-view.jsx */ \"./src/views/create-account-view.jsx\");\n/* harmony import */ var _edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edit-account-view.jsx */ \"./src/views/edit-account-view.jsx\");\n/* harmony import */ var _login_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./login-view.jsx */ \"./src/views/login-view.jsx\");\n/* harmony import */ var _new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./new-topic-view.jsx */ \"./src/views/new-topic-view.jsx\");\n/* harmony import */ var _password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./password-reset-view.jsx */ \"./src/views/password-reset-view.jsx\");\n/* harmony import */ var _settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./settings-view.jsx */ \"./src/views/settings-view.jsx\");\n/* harmony import */ var _validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./validation-view.jsx */ \"./src/views/validation-view.jsx\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'login': {\n \"id\": \"sidepanel_title_login\",\n \"defaultMessage\": \"Sign In\"\n },\n 'register': {\n \"id\": \"sidepanel_title_register\",\n \"defaultMessage\": \"Create Account\"\n },\n 'settings': {\n \"id\": \"sidepanel_title_settings\",\n \"defaultMessage\": \"Settings\"\n },\n 'edit': {\n \"id\": \"sidepanel_title_edit_account\",\n \"defaultMessage\": \"Edit Account\"\n },\n 'newtpk': {\n \"id\": \"sidepanel_title_newtpk\",\n \"defaultMessage\": \"Start New Chat\"\n },\n 'cred': {\n \"id\": \"sidepanel_title_cred\",\n \"defaultMessage\": \"Confirm Credentials\"\n },\n 'reset': {\n \"id\": \"sidepanel_title_reset\",\n \"defaultMessage\": \"Reset Password\"\n }\n});\n\nvar SidepanelView = function (_React$Component) {\n _inherits(SidepanelView, _React$Component);\n\n function SidepanelView(props) {\n var _this;\n\n _classCallCheck(this, SidepanelView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SidepanelView).call(this, props));\n _this.handleLoginRequested = _this.handleLoginRequested.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SidepanelView, [{\n key: \"handleLoginRequested\",\n value: function handleLoginRequested(login, password) {\n this.props.onLoginRequest(login, password);\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var view = this.props.state || (this.props.myUserId ? 'contacts' : 'login');\n var title, avatar;\n\n if (view == 'contacts') {\n title = this.props.title;\n avatar = this.props.avatar ? this.props.avatar : true;\n } else {\n title = formatMessage(messages[view]);\n avatar = false;\n }\n\n var onCancel;\n\n if (view != 'login') {\n onCancel = this.props.onCancel;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"sidepanel\",\n className: this.props.hideSelf ? 'nodisplay' : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n state: view,\n title: title,\n avatar: avatar,\n myUserId: this.props.myUserId,\n onSignUp: this.props.onSignUp,\n onSettings: this.props.onSettings,\n onNewTopic: this.props.onNewTopic,\n onCancel: onCancel\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n level: this.props.errorLevel,\n text: this.props.errorText,\n onClearError: this.props.onError\n }), view === 'login' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_login_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n login: this.props.login,\n disabled: this.props.loginDisabled,\n onLogin: this.handleLoginRequested\n }) : view === 'register' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n onCreateAccount: this.props.onCreateAccount,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'settings' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n transport: this.props.transport,\n serverAddress: this.props.serverAddress,\n onServerAddressChange: this.props.onGlobalSettings,\n onCancel: this.props.onCancel,\n onUpdate: this.props.onGlobalSettings\n }) : view === 'edit' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n messageSounds: this.props.messageSounds,\n desktopAlerts: this.props.desktopAlerts,\n desktopAlertsEnabled: this.props.desktopAlertsEnabled,\n onUpdateAccount: this.props.onUpdateAccount,\n onUpdateTags: this.props.onUpdateAccountTags,\n onTogglePushNotifications: this.props.onTogglePushNotifications,\n onToggleMessageSounds: this.props.onToggleMessageSounds,\n onLogout: this.props.onLogout,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'contacts' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n connected: this.props.connected,\n topicSelected: this.props.topicSelected,\n chatList: this.props.chatList,\n showContextMenu: this.props.showContextMenu,\n onTopicSelected: this.props.onTopicSelected\n }) : view === 'newtpk' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n searchResults: this.props.searchResults,\n onInitFind: this.props.onInitFind,\n onSearchContacts: this.props.onSearchContacts,\n onCreateTopic: this.props.onCreateTopic,\n onError: this.props.onError\n }) : view === 'cred' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n credCode: this.props.credCode,\n credMethod: this.props.credMethod,\n onSubmit: this.props.onValidateCredentials,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'reset' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n onRequest: this.props.onPasswordResetRequest,\n onReset: this.props.onResetPassword\n }) : null);\n }\n }]);\n\n return SidepanelView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/sidepanel-view.jsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ \"./node_modules/react-intl/lib/index.es.js\");\n/* harmony import */ var _widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../widgets/side-navbar.jsx */ \"./src/widgets/side-navbar.jsx\");\n/* harmony import */ var _widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../widgets/error-panel.jsx */ \"./src/widgets/error-panel.jsx\");\n/* harmony import */ var _contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./contacts-view.jsx */ \"./src/views/contacts-view.jsx\");\n/* harmony import */ var _create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-account-view.jsx */ \"./src/views/create-account-view.jsx\");\n/* harmony import */ var _edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./edit-account-view.jsx */ \"./src/views/edit-account-view.jsx\");\n/* harmony import */ var _login_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./login-view.jsx */ \"./src/views/login-view.jsx\");\n/* harmony import */ var _new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./new-topic-view.jsx */ \"./src/views/new-topic-view.jsx\");\n/* harmony import */ var _password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./password-reset-view.jsx */ \"./src/views/password-reset-view.jsx\");\n/* harmony import */ var _settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./settings-view.jsx */ \"./src/views/settings-view.jsx\");\n/* harmony import */ var _validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./validation-view.jsx */ \"./src/views/validation-view.jsx\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar messages = Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"defineMessages\"])({\n 'login': {\n \"id\": \"sidepanel_title_login\",\n \"defaultMessage\": \"Sign In\"\n },\n 'register': {\n \"id\": \"sidepanel_title_register\",\n \"defaultMessage\": \"Create Account\"\n },\n 'settings': {\n \"id\": \"sidepanel_title_settings\",\n \"defaultMessage\": \"Settings\"\n },\n 'edit': {\n \"id\": \"sidepanel_title_edit_account\",\n \"defaultMessage\": \"Edit Account\"\n },\n 'newtpk': {\n \"id\": \"sidepanel_title_newtpk\",\n \"defaultMessage\": \"Start New Chat\"\n },\n 'cred': {\n \"id\": \"sidepanel_title_cred\",\n \"defaultMessage\": \"Confirm Credentials\"\n },\n 'reset': {\n \"id\": \"sidepanel_title_reset\",\n \"defaultMessage\": \"Reset Password\"\n }\n});\n\nvar SidepanelView = function (_React$Component) {\n _inherits(SidepanelView, _React$Component);\n\n function SidepanelView(props) {\n var _this;\n\n _classCallCheck(this, SidepanelView);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SidepanelView).call(this, props));\n _this.handleLoginRequested = _this.handleLoginRequested.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(SidepanelView, [{\n key: \"handleLoginRequested\",\n value: function handleLoginRequested(login, password) {\n this.props.onLoginRequest(login, password);\n }\n }, {\n key: \"render\",\n value: function render() {\n var formatMessage = this.props.intl.formatMessage;\n var view = this.props.state || (this.props.myUserId ? 'contacts' : 'login');\n var title, avatar;\n\n if (view == 'contacts') {\n title = this.props.title;\n avatar = this.props.avatar ? this.props.avatar : true;\n } else {\n title = formatMessage(messages[view]);\n avatar = false;\n }\n\n var onCancel;\n\n if (view != 'login') {\n onCancel = this.props.onCancel;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"sidepanel\",\n className: this.props.hideSelf ? 'nodisplay' : null\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n state: view,\n title: title,\n avatar: avatar,\n myUserId: this.props.myUserId,\n onSignUp: this.props.onSignUp,\n onSettings: this.props.onSettings,\n onNewTopic: this.props.onNewTopic,\n onCancel: onCancel\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_error_panel_jsx__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n level: this.props.errorLevel,\n text: this.props.errorText,\n onClearError: this.props.onError\n }), view === 'login' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_login_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n login: this.props.login,\n disabled: this.props.loginDisabled,\n onLogin: this.handleLoginRequested\n }) : view === 'register' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_create_account_view_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n onCreateAccount: this.props.onCreateAccount,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'settings' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_settings_view_jsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"], {\n transport: this.props.transport,\n serverAddress: this.props.serverAddress,\n onServerAddressChange: this.props.onGlobalSettings,\n onCancel: this.props.onCancel,\n onUpdate: this.props.onGlobalSettings\n }) : view === 'edit' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_edit_account_view_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n messageSounds: this.props.messageSounds,\n desktopAlerts: this.props.desktopAlerts,\n desktopAlertsEnabled: this.props.desktopAlertsEnabled,\n onUpdateAccount: this.props.onUpdateAccount,\n onUpdateTags: this.props.onUpdateAccountTags,\n onTogglePushNotifications: this.props.onTogglePushNotifications,\n onToggleMessageSounds: this.props.onToggleMessageSounds,\n onLogout: this.props.onLogout,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'contacts' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_contacts_view_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n tinode: this.props.tinode,\n myUserId: this.props.myUserId,\n connected: this.props.connected,\n topicSelected: this.props.topicSelected,\n chatList: this.props.chatList,\n showContextMenu: this.props.showContextMenu,\n onTopicSelected: this.props.onTopicSelected\n }) : view === 'newtpk' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_new_topic_view_jsx__WEBPACK_IMPORTED_MODULE_8__[\"default\"], {\n searchResults: this.props.searchResults,\n onInitFind: this.props.onInitFind,\n onSearchContacts: this.props.onSearchContacts,\n onCreateTopic: this.props.onCreateTopic,\n onError: this.props.onError\n }) : view === 'cred' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_validation_view_jsx__WEBPACK_IMPORTED_MODULE_11__[\"default\"], {\n credCode: this.props.credCode,\n credMethod: this.props.credMethod,\n onSubmit: this.props.onValidateCredentials,\n onCancel: this.props.onCancel,\n onError: this.props.onError\n }) : view === 'reset' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_password_reset_view_jsx__WEBPACK_IMPORTED_MODULE_9__[\"default\"], {\n onRequest: this.props.onPasswordResetRequest,\n onReset: this.props.onResetPassword\n }) : null);\n }\n }]);\n\n return SidepanelView;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(react_intl__WEBPACK_IMPORTED_MODULE_1__[\"injectIntl\"])(SidepanelView));\n\n//# sourceURL=webpack:///./src/views/sidepanel-view.jsx?"); /***/ }), @@ -898,7 +898,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POP_SOUND\", function() { return POP_SOUND; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return TinodeWeb; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/app */ \"./node_modules/firebase/app/dist/index.cjs.js\");\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(firebase_app__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var firebase_messaging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! firebase/messaging */ \"./node_modules/firebase/messaging/dist/index.esm.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tinode-sdk */ \"./node_modules/tinode-sdk/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/context-menu.jsx */ \"./src/widgets/context-menu.jsx\");\n/* harmony import */ var _info_view_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./info-view.jsx */ \"./src/views/info-view.jsx\");\n/* harmony import */ var _messages_view_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./messages-view.jsx */ \"./src/views/messages-view.jsx\");\n/* harmony import */ var _sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sidepanel-view.jsx */ \"./src/views/sidepanel-view.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/host-name.js */ \"./src/lib/host-name.js\");\n/* harmony import */ var _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/local-storage.js */ \"./src/lib/local-storage.js\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../lib/navigation.js */ \"./src/lib/navigation.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar POP_SOUND = new Audio('audio/msg.mp3');\nconsole.log(FIREBASE_INIT);\n\nvar TinodeWeb = function (_React$Component) {\n _inherits(TinodeWeb, _React$Component);\n\n function TinodeWeb(props) {\n var _this;\n\n _classCallCheck(this, TinodeWeb);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TinodeWeb).call(this, props));\n _this.state = _this.getBlankState();\n _this.handleResize = _this.handleResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHashRoute = _this.handleHashRoute.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleOnline = _this.handleOnline.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAppVisibility = _this.handleAppVisibility.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleReadTimer = _this.handleReadTimer.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleVisibilityEvent = _this.handleVisibilityEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleError = _this.handleError.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginRequest = _this.handleLoginRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleConnected = _this.handleConnected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.doLogin = _this.doLogin.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCredentialsRequest = _this.handleCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginSuccessful = _this.handleLoginSuccessful.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDisconnect = _this.handleDisconnect.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeMetaDesc = _this.tnMeMetaDesc.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeContactUpdate = _this.tnMeContactUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeSubsUpdated = _this.tnMeSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.resetContactList = _this.resetContactList.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnData = _this.tnData.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnInitFind = _this.tnInitFind.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnFndSubsUpdated = _this.tnFndSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSearchContacts = _this.handleSearchContacts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicSelected = _this.handleTopicSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideMessagesView = _this.handleHideMessagesView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSendMessage = _this.handleSendMessage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccount = _this.handleNewAccount.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccountRequest = _this.handleNewAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountRequest = _this.handleUpdateAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountTagsRequest = _this.handleUpdateAccountTagsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSettings = _this.handleSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleGlobalSettings = _this.handleGlobalSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleMessageSounds = _this.handleToggleMessageSounds.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.initDesktopAlerts = _this.initDesktopAlerts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.togglePushToken = _this.togglePushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestPushToken = _this.requestPushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSidepanelCancel = _this.handleSidepanelCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopic = _this.handleNewTopic.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicRequest = _this.handleNewTopicRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicCreated = _this.handleNewTopicCreated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicUpdateRequest = _this.handleTopicUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleChangePermissions = _this.handleChangePermissions.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsUpdated = _this.handleTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLogout = _this.handleLogout.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLeaveUnsubRequest = _this.handleLeaveUnsubRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDialogCancel = _this.handleDialogCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowContextMenu = _this.handleShowContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.defaultTopicContextMenu = _this.defaultTopicContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideContextMenu = _this.handleHideContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowInfoView = _this.handleShowInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideInfoView = _this.handleHideInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberUpdateRequest = _this.handleMemberUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleValidateCredentialsRequest = _this.handleValidateCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordResetRequest = _this.handlePasswordResetRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleResetPassword = _this.handleResetPassword.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(TinodeWeb, [{\n key: \"getBlankState\",\n value: function getBlankState() {\n var _ref;\n\n var settings = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject(\"settings\") || {};\n return _ref = {\n connected: false,\n transport: settings.transport || null,\n serverAddress: settings.serverAddress || detectServerAddress(),\n serverVersion: \"no connection\",\n messageSounds: !settings.messageSoundsOff,\n desktopAlerts: settings.desktopAlerts,\n desktopAlertsEnabled: (Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isSecureConnection\"])() || Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isLocalHost\"])()) && typeof firebase != 'undefined' && typeof navigator != 'undefined' && typeof FIREBASE_INIT != 'undefined',\n firebaseToken: _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject(\"firebase-token\"),\n errorText: '',\n errorLevel: null,\n sidePanelSelected: 'login',\n sidePanelTitle: null,\n sidePanelAvatar: null,\n dialogSelected: null,\n contextMenuVisible: false,\n login: '',\n password: '',\n myUserId: null,\n liveConnection: navigator.onLine,\n topicSelected: '',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n newGroupTopicParams: null,\n loginDisabled: false,\n displayMobile: window.innerWidth <= _config_js__WEBPACK_IMPORTED_MODULE_8__[\"MEDIA_BREAKPOINT\"],\n showInfoPanel: false,\n mobilePanel: 'sidepanel'\n }, _defineProperty(_ref, \"contextMenuVisible\", false), _defineProperty(_ref, \"contextMenuBounds\", null), _defineProperty(_ref, \"contextMenuClickAt\", null), _defineProperty(_ref, \"contextMenuParams\", null), _defineProperty(_ref, \"contextMenuItems\", []), _defineProperty(_ref, \"chatList\", []), _defineProperty(_ref, \"searchResults\", []), _defineProperty(_ref, \"searchableContacts\", []), _defineProperty(_ref, \"credMethod\", undefined), _defineProperty(_ref, \"credCode\", undefined), _ref;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('online', function (e) {\n _this2.handleOnline(true);\n });\n window.addEventListener('offline', function (e) {\n _this2.handleOnline(false);\n });\n window.addEventListener('hashchange', this.handleHashRoute);\n document.addEventListener('visibilitychange', this.handleVisibilityEvent);\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n\n if (this.state.desktopAlertsEnabled) {\n try {\n this.fbPush = firebase.initializeApp(FIREBASE_INIT, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"APP_NAME\"]).messaging();\n this.fbPush.usePublicVapidKey(FIREBASE_INIT.messagingVapidKey);\n navigator.serviceWorker.register('/service-worker.js').then(function (reg) {\n _this2.fbPush.useServiceWorker(reg);\n\n _this2.initDesktopAlerts();\n\n if (_this2.state.desktopAlerts) {\n if (!_this2.state.firebaseToken) {\n _this2.togglePushToken(true);\n } else {\n _this2.tinode.setDeviceToken(_this2.state.firebaseToken);\n }\n }\n }).catch(function (err) {\n console.log(\"Failed to register service worker:\", err);\n });\n } catch (err) {\n this.handleError(\"Failed to initialize push notifications\", 'err');\n console.log(\"Failed to initialize push notifications\", err);\n this.setState({\n desktopAlertsEnabled: false\n });\n }\n }\n\n var token = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('keep-logged-in') ? _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('auth-token') : undefined;\n var parsedNav = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n\n if (token) {\n token.expires = new Date(token.expires);\n this.tinode.setAuthToken(token);\n this.tinode.connect().catch(function (err) {\n _this2.handleError(err.message, 'err');\n });\n delete parsedNav.params.info;\n delete parsedNav.params.tab;\n parsedNav.path[0] = '';\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsedNav.path, parsedNav.params));\n } else if (!parsedNav.params.token) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n }\n\n this.readTimer = null;\n this.readTimerCallback = null;\n this.handleHashRoute();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('hashchange', this.handleHashRoute);\n document.removeEventListener('visibilitychange', this.handleVisibilityEvent);\n }\n }, {\n key: \"handleResize\",\n value: function handleResize() {\n var mobile = document.documentElement.clientWidth <= _config_js__WEBPACK_IMPORTED_MODULE_8__[\"MEDIA_BREAKPOINT\"];\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n\n if (this.state.displayMobile != mobile) {\n this.setState({\n displayMobile: mobile\n });\n }\n }\n }, {\n key: \"handleHashRoute\",\n value: function handleHashRoute() {\n var hash = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n\n if (hash.path && hash.path.length > 0) {\n if (['register', 'settings', 'edit', 'cred', 'reset', 'newtpk', 'contacts', ''].includes(hash.path[0])) {\n this.setState({\n sidePanelSelected: hash.path[0]\n });\n } else {\n console.log(\"Unknown sidepanel view\", hash.path[0]);\n }\n\n if (hash.path.length > 1 && hash.path[1] != this.state.topicSelected) {\n this.setState({\n topicSelected: tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.topicType(hash.path[1]) ? hash.path[1] : null\n });\n }\n } else {\n this.setState({\n sidePanelSelected: ''\n });\n }\n\n if (hash.params.method) {\n this.setState({\n credMethod: hash.params.method\n });\n }\n\n if (hash.params.code) {\n this.setState({\n credCode: hash.params.code\n });\n }\n\n this.setState({\n showInfoPanel: hash.params.info,\n newTopicTabSelected: hash.params.tab\n });\n }\n }, {\n key: \"handleOnline\",\n value: function handleOnline(online) {\n var newState = {\n liveConnection: online\n };\n\n if (online) {\n this.handleError('', null);\n } else {\n this.handleError(\"No connection\", 'warn');\n }\n\n this.setState({\n liveConnection: online\n });\n }\n }, {\n key: \"handleAppVisibility\",\n value: function handleAppVisibility(visible, callback) {\n clearTimeout(this.readTimer);\n this.readTimerCallback = callback;\n\n if (visible && callback) {\n this.readTimer = setTimeout(callback, READ_DELAY);\n } else {\n this.readTimer = null;\n }\n }\n }, {\n key: \"handleReadTimer\",\n value: function handleReadTimer(callback) {\n this.handleAppVisibility(!document.hidden, callback);\n }\n }, {\n key: \"handleVisibilityEvent\",\n value: function handleVisibilityEvent() {\n this.handleAppVisibility(!document.hidden, this.readTimerCallback);\n }\n }, {\n key: \"handleError\",\n value: function handleError(err, level) {\n this.setState({\n errorText: err,\n errorLevel: level\n });\n }\n }, {\n key: \"handleLoginRequest\",\n value: function handleLoginRequest(login, password) {\n var _this3 = this;\n\n this.setState({\n loginDisabled: true,\n login: login,\n password: password\n });\n this.handleError('', null);\n\n if (this.tinode.isConnected()) {\n this.doLogin(login, password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n } else {\n this.tinode.connect().catch(function (err) {\n _this3.setState({\n loginDisabled: false\n });\n\n _this3.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleConnected\",\n value: function handleConnected() {\n var params = this.tinode.getServerInfo();\n this.setState({\n serverVersion: params.ver + ' ' + (params.build ? params.build : 'none') + '; '\n });\n this.doLogin(this.state.login, this.state.password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n }\n }, {\n key: \"doLogin\",\n value: function doLogin(login, password, cred) {\n var _this4 = this;\n\n if (this.tinode.isAuthenticated()) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n return;\n }\n\n cred = tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.credential(cred);\n var promise = null;\n var token = this.tinode.getAuthToken();\n\n if (login && password) {\n this.setState({\n password: null\n });\n promise = this.tinode.loginBasic(login, password, cred);\n } else if (token) {\n promise = this.tinode.loginToken(token.token, cred);\n }\n\n if (promise) {\n promise.then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {\n if (cred) {\n _this4.handleError(\"Code does not match\", 'warn');\n }\n\n _this4.handleCredentialsRequest(ctrl.params);\n } else {\n _this4.handleLoginSuccessful();\n }\n }).catch(function (err) {\n _this4.setState({\n loginDisabled: false,\n credMethod: undefined,\n credCode: undefined\n });\n\n _this4.handleError(err.message, 'err');\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n });\n } else {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n this.setState({\n loginDisabled: false\n });\n }\n }\n }, {\n key: \"handleCredentialsRequest\",\n value: function handleCredentialsRequest(params) {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = 'cred';\n parsed.params['method'] = params.cred[0];\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n }\n }, {\n key: \"handleLoginSuccessful\",\n value: function handleLoginSuccessful() {\n var _this5 = this;\n\n this.handleError('', null);\n\n if (_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('keep-logged-in')) {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('auth-token', this.tinode.getAuthToken());\n }\n\n var me = this.tinode.getMeTopic();\n me.onMetaDesc = this.tnMeMetaDesc;\n me.onContactUpdate = this.tnMeContactUpdate;\n me.onSubsUpdated = this.tnMeSubsUpdated;\n this.setState({\n connected: true,\n credMethod: undefined,\n credCode: undefined,\n myUserId: this.tinode.getCurrentUserID()\n });\n me.subscribe(me.startMetaQuery().withLaterSub().withDesc().build()).catch(function (err) {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n\n _this5.handleError(err.message, 'err');\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'contacts'));\n }\n }, {\n key: \"handleDisconnect\",\n value: function handleDisconnect(err) {\n this.setState({\n connected: false,\n topicSelectedOnline: false,\n dialogSelected: null,\n errorText: err && err.message ? err.message : \"Disconnected\",\n errorLevel: err && err.message ? 'err' : 'warn',\n loginDisabled: false,\n contextMenuVisible: false,\n serverVersion: \"no connection\"\n });\n }\n }, {\n key: \"tnMeMetaDesc\",\n value: function tnMeMetaDesc(desc) {\n if (desc && desc.public) {\n this.setState({\n sidePanelTitle: desc.public.fn,\n sidePanelAvatar: makeImageUrl(desc.public.photo)\n });\n }\n }\n }, {\n key: \"tnMeContactUpdate\",\n value: function tnMeContactUpdate(what, cont) {\n if (what == 'on' || what == 'off') {\n this.resetContactList();\n\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedOnline: what == 'on'\n });\n }\n } else if (what == 'read') {\n this.resetContactList();\n } else if (what == 'msg') {\n if (this.state.topicSelected != cont.topic) {\n if (this.state.messageSounds) {\n POP_SOUND.play();\n }\n\n this.resetContactList();\n } else if (document.hidden && this.state.messageSounds) {\n POP_SOUND.play();\n }\n } else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {\n if (this.state.topicSelected == cont.topic) {\n this.handleTopicSelected(null);\n }\n\n this.resetContactList();\n } else if (what == 'acs') {\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedAcs: cont.acs\n });\n }\n } else if (what == 'del') {} else {\n console.log(\"Unsupported (yet) presence update:\" + what + \" in: \" + cont.topic);\n }\n }\n }, {\n key: \"tnMeSubsUpdated\",\n value: function tnMeSubsUpdated(unused) {\n this.resetContactList();\n }\n }, {\n key: \"resetContactList\",\n value: function resetContactList() {\n var _this6 = this;\n\n var newState = {\n chatList: []\n };\n this.tinode.getMeTopic().contacts(function (c) {\n newState.chatList.push(c);\n\n if (_this6.state.topicSelected == c.topic) {\n newState.topicSelectedOnline = c.online;\n newState.topicSelectedAcs = c.acs;\n }\n });\n newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);\n this.setState(newState);\n }\n }, {\n key: \"tnData\",\n value: function tnData(data) {\n var _this7 = this;\n\n var topic = this.tinode.getTopic(data.topic);\n\n if (topic.msgStatus(data) >= tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.MESSAGE_STATUS_SENT) {\n clearTimeout(this.receivedTimer);\n this.receivedTimer = setTimeout(function () {\n _this7.receivedTimer = undefined;\n topic.noteRecv(data.seq);\n }, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"RECEIVED_DELAY\"]);\n }\n }\n }, {\n key: \"tnInitFind\",\n value: function tnInitFind() {\n var _this8 = this;\n\n var fnd = this.tinode.getFndTopic();\n\n if (fnd.isSubscribed()) {\n this.tnFndSubsUpdated();\n } else {\n fnd.onSubsUpdated = this.tnFndSubsUpdated;\n fnd.subscribe(fnd.startMetaQuery().withSub().withTags().build()).catch(function (err) {\n _this8.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"tnFndSubsUpdated\",\n value: function tnFndSubsUpdated() {\n var foundContacts = [];\n this.tinode.getFndTopic().contacts(function (s) {\n foundContacts.push(s);\n });\n this.setState({\n searchResults: foundContacts,\n searchableContacts: TinodeWeb.prepareSearchableContacts(this.state.chatList, foundContacts)\n });\n }\n }, {\n key: \"handleSearchContacts\",\n value: function handleSearchContacts(query) {\n var _this9 = this;\n\n var fnd = this.tinode.getFndTopic();\n fnd.setMeta({\n desc: {\n public: query\n }\n }).then(function (ctrl) {\n return fnd.getMeta(fnd.startMetaQuery().withSub().build());\n }).catch(function (err) {\n _this9.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleTopicSelected\",\n value: function handleTopicSelected(topicName, unused_index, online, acs) {\n if (topicName) {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'topic-view',\n showInfoPanel: false\n });\n\n if (this.state.topicSelected != topicName) {\n this.setState({\n topicSelectedOnline: online,\n topicSelectedAcs: acs\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', topicName));\n }\n } else {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'sidepanel',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n showInfoPanel: false\n });\n\n if (this.state.topicSelected) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', null));\n }\n }\n }\n }, {\n key: \"handleHideMessagesView\",\n value: function handleHideMessagesView() {\n this.setState({\n mobilePanel: 'sidepanel'\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic(window.location.hash, null));\n }\n }, {\n key: \"handleSendMessage\",\n value: function handleSendMessage(msg, promise, uploader) {\n var _this10 = this;\n\n var topic = this.tinode.getTopic(this.state.topicSelected);\n msg = topic.createMessage(msg, false);\n msg._uploader = uploader;\n\n if (!topic.isSubscribed()) {\n if (!promise) {\n promise = Promise.resolve();\n }\n\n promise = promise.then(function () {\n return topic.subscribe();\n });\n }\n\n if (promise) {\n promise = promise.catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n\n topic.publishDraft(msg, promise).catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleNewAccount\",\n value: function handleNewAccount() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'register'));\n }\n }, {\n key: \"handleNewAccountRequest\",\n value: function handleNewAccountRequest(login_, password_, public_, cred_, tags_) {\n var _this11 = this;\n\n this.tinode.connect(this.state.serverAddress).then(function () {\n return _this11.tinode.createAccountBasic(login_, password_, {\n public: public_,\n tags: tags_,\n cred: tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.credential(cred_)\n });\n }).then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {\n _this11.handleCredentialsRequest(ctrl.params);\n } else {\n _this11.handleLoginSuccessful(_this11);\n }\n }).catch(function (err) {\n _this11.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleUpdateAccountRequest\",\n value: function handleUpdateAccountRequest(password, pub, defacs) {\n var _this12 = this;\n\n if (pub || defacs) {\n this.tinode.getMeTopic().setMeta({\n desc: {\n public: pub,\n defacs: defacs\n }\n }).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n\n if (password) {\n this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleUpdateAccountTagsRequest\",\n value: function handleUpdateAccountTagsRequest(tags) {\n var _this13 = this;\n\n this.tinode.getFndTopic().setMeta({\n tags: tags\n }).catch(function (err) {\n _this13.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleSettings\",\n value: function handleSettings() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, this.state.myUserId ? 'edit' : 'settings'));\n }\n }, {\n key: \"handleGlobalSettings\",\n value: function handleGlobalSettings(settings) {\n var serverAddress = settings.serverAddress || this.state.serverAddress;\n var transport = settings.transport || this.state.transport;\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.tinode = TinodeWeb.tnSetup(serverAddress, transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n this.setState({\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('settings', {\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, ''));\n }\n }, {\n key: \"initDesktopAlerts\",\n value: function initDesktopAlerts() {\n var _this14 = this;\n\n this.fbPush.onTokenRefresh(function () {\n _this14.requestPushToken(true);\n });\n this.fbPush.onMessage(function (payload) {});\n }\n }, {\n key: \"togglePushToken\",\n value: function togglePushToken(enabled) {\n var _this15 = this;\n\n if (enabled) {\n if (!this.state.firebaseToken) {\n this.fbPush.requestPermission().then(function () {\n _this15.requestPushToken(true);\n }).catch(function (err) {\n _this15.handleError(err.message, 'err');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n console.log(\"Failed to get permission to notify.\", err);\n });\n } else {\n this.setState({\n desktopAlerts: true\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }\n } else if (this.state.firebaseToken) {\n this.fbPush.deleteToken(this.state.firebaseToken).catch(function (err) {\n console.log(\"Unable to delete token.\", err);\n }).finally(function () {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('firebase-token');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n });\n } else {\n this.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n }\n }\n }, {\n key: \"requestPushToken\",\n value: function requestPushToken(sendToServer) {\n var _this16 = this;\n\n this.fbPush.getToken().then(function (refreshedToken) {\n if (refreshedToken != _this16.state.firebaseToken) {\n _this16.tinode.setDeviceToken(refreshedToken, sendToServer);\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('firebase-token', refreshedToken);\n }\n\n _this16.setState({\n firebaseToken: refreshedToken,\n desktopAlerts: true\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }).catch(function (err) {\n _this16.handleError(err.message, 'err');\n\n console.log(\"Failed to retrieve firebase token\", err);\n });\n }\n }, {\n key: \"handleToggleMessageSounds\",\n value: function handleToggleMessageSounds(enabled) {\n this.setState({\n messageSounds: enabled\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n messageSoundsOff: !enabled\n });\n }\n }, {\n key: \"handleSidepanelCancel\",\n value: function handleSidepanelCancel() {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = this.state.myUserId ? 'contacts' : '';\n\n if (parsed.params) {\n delete parsed.params.code;\n delete parsed.params.method;\n delete parsed.params.tab;\n }\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n this.setState({\n errorText: '',\n errorLevel: null\n });\n }\n }, {\n key: \"handleNewTopic\",\n value: function handleNewTopic() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'newtpk'));\n }\n }, {\n key: \"handleNewTopicRequest\",\n value: function handleNewTopicRequest(peerName, pub, priv, tags) {\n var _this17 = this;\n\n var topicName = peerName || this.tinode.newGroupTopicName();\n\n if (!peerName) {\n this.setState({\n newGroupTopicParams: {\n desc: {\n public: pub,\n private: {\n comment: priv\n }\n },\n tags: tags\n }\n }, function () {\n _this17.handleTopicSelected(topicName);\n });\n } else {\n this.handleTopicSelected(topicName);\n }\n }\n }, {\n key: \"handleNewTopicCreated\",\n value: function handleNewTopicCreated(oldName, newName) {\n if (this.state.topicSelected == oldName && oldName != newName) {\n this.setState({\n topicSelected: newName\n }, function () {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', newName));\n });\n }\n }\n }, {\n key: \"handleTopicUpdateRequest\",\n value: function handleTopicUpdateRequest(topicName, pub, priv, permissions) {\n var _this18 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var params = {};\n\n if (pub) {\n params.public = pub;\n }\n\n if (priv) {\n params.private = {\n comment: priv\n };\n }\n\n if (permissions) {\n params.defacs = permissions;\n }\n\n topic.setMeta({\n desc: params\n }).catch(function (err) {\n _this18.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleChangePermissions\",\n value: function handleChangePermissions(topicName, mode, uid) {\n var _this19 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var am = topic.getAccessMode();\n\n if (uid) {\n am.updateGiven(mode);\n mode = am.getGiven();\n } else {\n am.updateWant(mode);\n mode = am.getWant();\n }\n\n topic.setMeta({\n sub: {\n user: uid,\n mode: mode\n }\n }).catch(function (err) {\n _this19.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleTagsUpdated\",\n value: function handleTagsUpdated(topicName, tags) {\n var _this20 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var instance = this;\n topic.setMeta({\n tags: tags\n }).catch(function (err) {\n _this20.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleLogout\",\n value: function handleLogout() {\n updateFavicon(0);\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.setState(this.getBlankState());\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n }\n }, {\n key: \"handleLeaveUnsubRequest\",\n value: function handleLeaveUnsubRequest(topicName) {\n var _this21 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n topic.leave(true).then(function (ctrl) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic(window.location.hash, ''));\n }).catch(function (err) {\n _this21.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleDialogCancel\",\n value: function handleDialogCancel() {\n this.setState({\n dialogSelected: null\n });\n }\n }, {\n key: \"handleShowContextMenu\",\n value: function handleShowContextMenu(params, menuItems) {\n this.setState({\n contextMenuVisible: true,\n contextMenuClickAt: {\n x: params.x,\n y: params.y\n },\n contextMenuParams: params,\n contextMenuItems: menuItems || this.defaultTopicContextMenu(params.topicName),\n contextMenuBounds: ReactDOM.findDOMNode(this).getBoundingClientRect()\n });\n }\n }, {\n key: \"defaultTopicContextMenu\",\n value: function defaultTopicContextMenu(topicName) {\n var muted = false,\n blocked = false,\n subscribed = false,\n deleter = false;\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n if (topic.isSubscribed()) {\n subscribed = true;\n var acs = topic.getAccessMode();\n muted = acs && acs.isMuted();\n blocked = acs && !acs.isJoiner();\n deleter = acs && acs.isDeleter();\n }\n }\n\n return [subscribed ? {\n title: \"Info\",\n handler: this.handleShowInfoView\n } : null, subscribed ? 'messages_clear' : null, subscribed && deleter ? 'messages_clear_hard' : null, subscribed ? muted ? 'topic_unmute' : 'topic_mute' : null, subscribed ? blocked ? 'topic_unblock' : 'topic_block' : null, 'topic_delete'];\n }\n }, {\n key: \"handleHideContextMenu\",\n value: function handleHideContextMenu() {\n this.setState({\n contextMenuVisible: false,\n contextMenuClickAt: null,\n contextMenuParams: null,\n contextMenuBounds: null\n });\n }\n }, {\n key: \"handleShowInfoView\",\n value: function handleShowInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addUrlParam(window.location.hash, 'info', true));\n this.setState({\n showInfoPanel: true\n });\n }\n }, {\n key: \"handleHideInfoView\",\n value: function handleHideInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].removeUrlParam(window.location.hash, 'info'));\n this.setState({\n showInfoPanel: false\n });\n }\n }, {\n key: \"handleMemberUpdateRequest\",\n value: function handleMemberUpdateRequest(topicName, added, removed) {\n var _this22 = this;\n\n if (!topicName) {\n return;\n }\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n if (added && added.length > 0) {\n added.map(function (uid) {\n topic.invite(uid, null).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n\n if (removed && removed.length > 0) {\n removed.map(function (uid) {\n topic.delSubscription(uid).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n }\n }, {\n key: \"handleValidateCredentialsRequest\",\n value: function handleValidateCredentialsRequest(cred, code) {\n this.setState({\n credMethod: cred,\n credCode: code\n });\n this.doLogin(null, null, {\n meth: cred,\n resp: code\n });\n }\n }, {\n key: \"handlePasswordResetRequest\",\n value: function handlePasswordResetRequest(method, value) {\n var _this23 = this;\n\n this.tinode.connect().then(function () {\n return _this23.tinode.requestResetAuthSecret('basic', method, value);\n }).catch(function (err) {\n _this23.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleResetPassword\",\n value: function handleResetPassword(scheme, newPassword, token) {\n var _this24 = this;\n\n token = base64ReEncode(token);\n\n if (!token) {\n this.handleError(\"Invalid security token\", 'err');\n } else {\n this.tinode.connect().then(function () {\n return _this24.tinode.updateAccountBasic(null, null, newPassword, {\n token: token\n });\n }).catch(function (err) {\n _this24.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"app-container\"\n }, this.state.contextMenuVisible ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n tinode: this.tinode,\n bounds: this.state.contextMenuBounds,\n clickAt: this.state.contextMenuClickAt,\n params: this.state.contextMenuParams,\n items: this.state.contextMenuItems,\n hide: this.handleHideContextMenu,\n onAction: this.handleContextMenuAction,\n onError: this.handleError\n }) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n hideSelf: this.state.displayMobile && this.state.mobilePanel !== 'sidepanel',\n state: this.state.sidePanelSelected,\n title: this.state.sidePanelTitle,\n avatar: this.state.sidePanelAvatar,\n login: this.state.login,\n myUserId: this.state.myUserId,\n loginDisabled: this.state.loginDisabled,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n topicSelected: this.state.topicSelected,\n chatList: this.state.chatList,\n credMethod: this.state.credMethod,\n credCode: this.state.credCode,\n transport: this.state.transport,\n messageSounds: this.state.messageSounds,\n desktopAlerts: this.state.desktopAlerts,\n desktopAlertsEnabled: this.state.desktopAlertsEnabled,\n serverAddress: this.state.serverAddress,\n onGlobalSettings: this.handleGlobalSettings,\n onSignUp: this.handleNewAccount,\n onSettings: this.handleSettings,\n onLoginRequest: this.handleLoginRequest,\n onCreateAccount: this.handleNewAccountRequest,\n onUpdateAccount: this.handleUpdateAccountRequest,\n onUpdateAccountTags: this.handleUpdateAccountTagsRequest,\n onTogglePushNotifications: this.togglePushToken,\n onToggleMessageSounds: this.handleToggleMessageSounds,\n onTopicSelected: this.handleTopicSelected,\n onCreateTopic: this.handleNewTopicRequest,\n onNewTopic: this.handleNewTopic,\n onLogout: this.handleLogout,\n onCancel: this.handleSidepanelCancel,\n onError: this.handleError,\n onValidateCredentials: this.handleValidateCredentialsRequest,\n onPasswordResetRequest: this.handlePasswordResetRequest,\n onResetPassword: this.handleResetPassword,\n onInitFind: this.tnInitFind,\n searchResults: this.state.searchResults,\n onSearchContacts: this.handleSearchContacts,\n showContextMenu: this.handleShowContextMenu\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_messages_view_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n online: this.state.topicSelectedOnline,\n acs: this.state.topicSelectedAcs,\n displayMobile: this.state.displayMobile,\n viewportWidth: this.state.viewportWidth,\n hideSelf: this.state.displayMobile && (this.state.mobilePanel !== 'topic-view' || this.state.showInfoPanel),\n topic: this.state.topicSelected,\n myUserId: this.state.myUserId,\n serverVersion: this.state.serverVersion,\n serverAddress: this.state.serverAddress,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n newGroupTopicParams: this.state.newGroupTopicParams,\n onHideMessagesView: this.handleHideMessagesView,\n onData: this.tnData,\n onError: this.handleError,\n onNewTopicCreated: this.handleNewTopicCreated,\n readTimerHandler: this.handleReadTimer,\n showContextMenu: this.handleShowContextMenu,\n sendMessage: this.handleSendMessage\n }), this.state.showInfoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_info_view_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n topic: this.state.topicSelected,\n searchableContacts: this.state.searchableContacts,\n myUserId: this.state.myUserId,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n onTopicDescUpdate: this.handleTopicUpdateRequest,\n onCancel: this.handleHideInfoView,\n onChangePermissions: this.handleChangePermissions,\n onMemberUpdateRequest: this.handleMemberUpdateRequest,\n onLeaveTopic: this.handleLeaveUnsubRequest,\n onAddMember: this.handleManageGroupMembers,\n onTopicTagsUpdate: this.handleTagsUpdated,\n onInitFind: this.tnInitFind,\n onError: this.handleError,\n showContextMenu: this.handleShowContextMenu\n }) : null);\n }\n }], [{\n key: \"tnSetup\",\n value: function tnSetup(serverAddress, transport) {\n var tinode = new tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a(_config_js__WEBPACK_IMPORTED_MODULE_8__[\"APP_NAME\"], serverAddress, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"API_KEY\"], transport, Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isSecureConnection\"])());\n tinode.enableLogging(true, true);\n return tinode;\n }\n }, {\n key: \"prepareSearchableContacts\",\n value: function prepareSearchableContacts(chatList, foundContacts) {\n var merged = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = chatList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var c = _step.value;\n\n if (tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.topicType(c.topic) == 'p2p') {\n merged[c.topic] = {\n user: c.topic,\n updated: c.updated,\n public: c.public,\n private: c.private,\n acs: c.acs\n };\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = foundContacts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _c = _step2.value;\n\n if (!merged[_c.user]) {\n merged[_c.user] = _c;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return Object.values(merged);\n }\n }]);\n\n return TinodeWeb;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/tinode-web.jsx?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"POP_SOUND\", function() { return POP_SOUND; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return TinodeWeb; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! firebase/app */ \"./node_modules/firebase/app/dist/index.cjs.js\");\n/* harmony import */ var firebase_app__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(firebase_app__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var firebase_messaging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! firebase/messaging */ \"./node_modules/firebase/messaging/dist/index.esm.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tinode-sdk */ \"./node_modules/tinode-sdk/umd/tinode.prod.js\");\n/* harmony import */ var tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(tinode_sdk__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../widgets/context-menu.jsx */ \"./src/widgets/context-menu.jsx\");\n/* harmony import */ var _info_view_jsx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./info-view.jsx */ \"./src/views/info-view.jsx\");\n/* harmony import */ var _messages_view_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./messages-view.jsx */ \"./src/views/messages-view.jsx\");\n/* harmony import */ var _sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sidepanel-view.jsx */ \"./src/views/sidepanel-view.jsx\");\n/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../config.js */ \"./src/config.js\");\n/* harmony import */ var _lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../lib/host-name.js */ \"./src/lib/host-name.js\");\n/* harmony import */ var _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../lib/local-storage.js */ \"./src/lib/local-storage.js\");\n/* harmony import */ var _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../lib/navigation.js */ \"./src/lib/navigation.js\");\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar POP_SOUND = new Audio('audio/msg.mp3');\n\nvar TinodeWeb = function (_React$Component) {\n _inherits(TinodeWeb, _React$Component);\n\n function TinodeWeb(props) {\n var _this;\n\n _classCallCheck(this, TinodeWeb);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(TinodeWeb).call(this, props));\n _this.state = _this.getBlankState();\n _this.handleResize = _this.handleResize.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHashRoute = _this.handleHashRoute.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleOnline = _this.handleOnline.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleAppVisibility = _this.handleAppVisibility.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleReadTimer = _this.handleReadTimer.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleVisibilityEvent = _this.handleVisibilityEvent.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleError = _this.handleError.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginRequest = _this.handleLoginRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleConnected = _this.handleConnected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.doLogin = _this.doLogin.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleCredentialsRequest = _this.handleCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLoginSuccessful = _this.handleLoginSuccessful.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDisconnect = _this.handleDisconnect.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeMetaDesc = _this.tnMeMetaDesc.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeContactUpdate = _this.tnMeContactUpdate.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnMeSubsUpdated = _this.tnMeSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.resetContactList = _this.resetContactList.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnData = _this.tnData.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnInitFind = _this.tnInitFind.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.tnFndSubsUpdated = _this.tnFndSubsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSearchContacts = _this.handleSearchContacts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicSelected = _this.handleTopicSelected.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideMessagesView = _this.handleHideMessagesView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSendMessage = _this.handleSendMessage.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccount = _this.handleNewAccount.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewAccountRequest = _this.handleNewAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountRequest = _this.handleUpdateAccountRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleUpdateAccountTagsRequest = _this.handleUpdateAccountTagsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSettings = _this.handleSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleGlobalSettings = _this.handleGlobalSettings.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleToggleMessageSounds = _this.handleToggleMessageSounds.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.initDesktopAlerts = _this.initDesktopAlerts.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.togglePushToken = _this.togglePushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.requestPushToken = _this.requestPushToken.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleSidepanelCancel = _this.handleSidepanelCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopic = _this.handleNewTopic.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicRequest = _this.handleNewTopicRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleNewTopicCreated = _this.handleNewTopicCreated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTopicUpdateRequest = _this.handleTopicUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleChangePermissions = _this.handleChangePermissions.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleTagsUpdated = _this.handleTagsUpdated.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLogout = _this.handleLogout.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleLeaveUnsubRequest = _this.handleLeaveUnsubRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleDialogCancel = _this.handleDialogCancel.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowContextMenu = _this.handleShowContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.defaultTopicContextMenu = _this.defaultTopicContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideContextMenu = _this.handleHideContextMenu.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleShowInfoView = _this.handleShowInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleHideInfoView = _this.handleHideInfoView.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleMemberUpdateRequest = _this.handleMemberUpdateRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleValidateCredentialsRequest = _this.handleValidateCredentialsRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handlePasswordResetRequest = _this.handlePasswordResetRequest.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n _this.handleResetPassword = _this.handleResetPassword.bind(_assertThisInitialized(_assertThisInitialized(_this)));\n return _this;\n }\n\n _createClass(TinodeWeb, [{\n key: \"getBlankState\",\n value: function getBlankState() {\n var _ref;\n\n var settings = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject(\"settings\") || {};\n return _ref = {\n connected: false,\n transport: settings.transport || null,\n serverAddress: settings.serverAddress || detectServerAddress(),\n serverVersion: \"no connection\",\n messageSounds: !settings.messageSoundsOff,\n desktopAlerts: settings.desktopAlerts,\n desktopAlertsEnabled: (Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isSecureConnection\"])() || Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isLocalHost\"])()) && typeof firebase != 'undefined' && typeof navigator != 'undefined' && typeof FIREBASE_INIT != 'undefined',\n firebaseToken: _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject(\"firebase-token\"),\n errorText: '',\n errorLevel: null,\n sidePanelSelected: 'login',\n sidePanelTitle: null,\n sidePanelAvatar: null,\n dialogSelected: null,\n contextMenuVisible: false,\n login: '',\n password: '',\n myUserId: null,\n liveConnection: navigator.onLine,\n topicSelected: '',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n newGroupTopicParams: null,\n loginDisabled: false,\n displayMobile: window.innerWidth <= _config_js__WEBPACK_IMPORTED_MODULE_8__[\"MEDIA_BREAKPOINT\"],\n showInfoPanel: false,\n mobilePanel: 'sidepanel'\n }, _defineProperty(_ref, \"contextMenuVisible\", false), _defineProperty(_ref, \"contextMenuBounds\", null), _defineProperty(_ref, \"contextMenuClickAt\", null), _defineProperty(_ref, \"contextMenuParams\", null), _defineProperty(_ref, \"contextMenuItems\", []), _defineProperty(_ref, \"chatList\", []), _defineProperty(_ref, \"searchResults\", []), _defineProperty(_ref, \"searchableContacts\", []), _defineProperty(_ref, \"credMethod\", undefined), _defineProperty(_ref, \"credCode\", undefined), _ref;\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('online', function (e) {\n _this2.handleOnline(true);\n });\n window.addEventListener('offline', function (e) {\n _this2.handleOnline(false);\n });\n window.addEventListener('hashchange', this.handleHashRoute);\n document.addEventListener('visibilitychange', this.handleVisibilityEvent);\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n\n if (this.state.desktopAlertsEnabled) {\n try {\n this.fbPush = firebase.initializeApp(FIREBASE_INIT, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"APP_NAME\"]).messaging();\n this.fbPush.usePublicVapidKey(FIREBASE_INIT.messagingVapidKey);\n navigator.serviceWorker.register('/service-worker.js').then(function (reg) {\n _this2.fbPush.useServiceWorker(reg);\n\n _this2.initDesktopAlerts();\n\n if (_this2.state.desktopAlerts) {\n if (!_this2.state.firebaseToken) {\n _this2.togglePushToken(true);\n } else {\n _this2.tinode.setDeviceToken(_this2.state.firebaseToken);\n }\n }\n }).catch(function (err) {\n console.log(\"Failed to register service worker:\", err);\n });\n } catch (err) {\n this.handleError(\"Failed to initialize push notifications\", 'err');\n console.log(\"Failed to initialize push notifications\", err);\n this.setState({\n desktopAlertsEnabled: false\n });\n }\n }\n\n var token = _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('keep-logged-in') ? _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('auth-token') : undefined;\n var parsedNav = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n\n if (token) {\n token.expires = new Date(token.expires);\n this.tinode.setAuthToken(token);\n this.tinode.connect().catch(function (err) {\n _this2.handleError(err.message, 'err');\n });\n delete parsedNav.params.info;\n delete parsedNav.params.tab;\n parsedNav.path[0] = '';\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsedNav.path, parsedNav.params));\n } else if (!parsedNav.params.token) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n }\n\n this.readTimer = null;\n this.readTimerCallback = null;\n this.handleHashRoute();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('hashchange', this.handleHashRoute);\n document.removeEventListener('visibilitychange', this.handleVisibilityEvent);\n }\n }, {\n key: \"handleResize\",\n value: function handleResize() {\n var mobile = document.documentElement.clientWidth <= _config_js__WEBPACK_IMPORTED_MODULE_8__[\"MEDIA_BREAKPOINT\"];\n this.setState({\n viewportWidth: document.documentElement.clientWidth\n });\n\n if (this.state.displayMobile != mobile) {\n this.setState({\n displayMobile: mobile\n });\n }\n }\n }, {\n key: \"handleHashRoute\",\n value: function handleHashRoute() {\n var hash = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n\n if (hash.path && hash.path.length > 0) {\n if (['register', 'settings', 'edit', 'cred', 'reset', 'newtpk', 'contacts', ''].includes(hash.path[0])) {\n this.setState({\n sidePanelSelected: hash.path[0]\n });\n } else {\n console.log(\"Unknown sidepanel view\", hash.path[0]);\n }\n\n if (hash.path.length > 1 && hash.path[1] != this.state.topicSelected) {\n this.setState({\n topicSelected: tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.topicType(hash.path[1]) ? hash.path[1] : null\n });\n }\n } else {\n this.setState({\n sidePanelSelected: ''\n });\n }\n\n if (hash.params.method) {\n this.setState({\n credMethod: hash.params.method\n });\n }\n\n if (hash.params.code) {\n this.setState({\n credCode: hash.params.code\n });\n }\n\n this.setState({\n showInfoPanel: hash.params.info,\n newTopicTabSelected: hash.params.tab\n });\n }\n }, {\n key: \"handleOnline\",\n value: function handleOnline(online) {\n var newState = {\n liveConnection: online\n };\n\n if (online) {\n this.handleError('', null);\n } else {\n this.handleError(\"No connection\", 'warn');\n }\n\n this.setState({\n liveConnection: online\n });\n }\n }, {\n key: \"handleAppVisibility\",\n value: function handleAppVisibility(visible, callback) {\n clearTimeout(this.readTimer);\n this.readTimerCallback = callback;\n\n if (visible && callback) {\n this.readTimer = setTimeout(callback, READ_DELAY);\n } else {\n this.readTimer = null;\n }\n }\n }, {\n key: \"handleReadTimer\",\n value: function handleReadTimer(callback) {\n this.handleAppVisibility(!document.hidden, callback);\n }\n }, {\n key: \"handleVisibilityEvent\",\n value: function handleVisibilityEvent() {\n this.handleAppVisibility(!document.hidden, this.readTimerCallback);\n }\n }, {\n key: \"handleError\",\n value: function handleError(err, level) {\n this.setState({\n errorText: err,\n errorLevel: level\n });\n }\n }, {\n key: \"handleLoginRequest\",\n value: function handleLoginRequest(login, password) {\n var _this3 = this;\n\n this.setState({\n loginDisabled: true,\n login: login,\n password: password\n });\n this.handleError('', null);\n\n if (this.tinode.isConnected()) {\n this.doLogin(login, password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n } else {\n this.tinode.connect().catch(function (err) {\n _this3.setState({\n loginDisabled: false\n });\n\n _this3.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleConnected\",\n value: function handleConnected() {\n var params = this.tinode.getServerInfo();\n this.setState({\n serverVersion: params.ver + ' ' + (params.build ? params.build : 'none') + '; '\n });\n this.doLogin(this.state.login, this.state.password, {\n meth: this.state.credMethod,\n resp: this.state.credCode\n });\n }\n }, {\n key: \"doLogin\",\n value: function doLogin(login, password, cred) {\n var _this4 = this;\n\n if (this.tinode.isAuthenticated()) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n return;\n }\n\n cred = tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.credential(cred);\n var promise = null;\n var token = this.tinode.getAuthToken();\n\n if (login && password) {\n this.setState({\n password: null\n });\n promise = this.tinode.loginBasic(login, password, cred);\n } else if (token) {\n promise = this.tinode.loginToken(token.token, cred);\n }\n\n if (promise) {\n promise.then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {\n if (cred) {\n _this4.handleError(\"Code does not match\", 'warn');\n }\n\n _this4.handleCredentialsRequest(ctrl.params);\n } else {\n _this4.handleLoginSuccessful();\n }\n }).catch(function (err) {\n _this4.setState({\n loginDisabled: false,\n credMethod: undefined,\n credCode: undefined\n });\n\n _this4.handleError(err.message, 'err');\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n });\n } else {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n this.setState({\n loginDisabled: false\n });\n }\n }\n }, {\n key: \"handleCredentialsRequest\",\n value: function handleCredentialsRequest(params) {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = 'cred';\n parsed.params['method'] = params.cred[0];\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n }\n }, {\n key: \"handleLoginSuccessful\",\n value: function handleLoginSuccessful() {\n var _this5 = this;\n\n this.handleError('', null);\n\n if (_lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].getObject('keep-logged-in')) {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('auth-token', this.tinode.getAuthToken());\n }\n\n var me = this.tinode.getMeTopic();\n me.onMetaDesc = this.tnMeMetaDesc;\n me.onContactUpdate = this.tnMeContactUpdate;\n me.onSubsUpdated = this.tnMeSubsUpdated;\n this.setState({\n connected: true,\n credMethod: undefined,\n credCode: undefined,\n myUserId: this.tinode.getCurrentUserID()\n });\n me.subscribe(me.startMetaQuery().withLaterSub().withDesc().build()).catch(function (err) {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n\n _this5.handleError(err.message, 'err');\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'contacts'));\n }\n }, {\n key: \"handleDisconnect\",\n value: function handleDisconnect(err) {\n this.setState({\n connected: false,\n topicSelectedOnline: false,\n dialogSelected: null,\n errorText: err && err.message ? err.message : \"Disconnected\",\n errorLevel: err && err.message ? 'err' : 'warn',\n loginDisabled: false,\n contextMenuVisible: false,\n serverVersion: \"no connection\"\n });\n }\n }, {\n key: \"tnMeMetaDesc\",\n value: function tnMeMetaDesc(desc) {\n if (desc && desc.public) {\n this.setState({\n sidePanelTitle: desc.public.fn,\n sidePanelAvatar: makeImageUrl(desc.public.photo)\n });\n }\n }\n }, {\n key: \"tnMeContactUpdate\",\n value: function tnMeContactUpdate(what, cont) {\n if (what == 'on' || what == 'off') {\n this.resetContactList();\n\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedOnline: what == 'on'\n });\n }\n } else if (what == 'read') {\n this.resetContactList();\n } else if (what == 'msg') {\n if (this.state.topicSelected != cont.topic) {\n if (this.state.messageSounds) {\n POP_SOUND.play();\n }\n\n this.resetContactList();\n } else if (document.hidden && this.state.messageSounds) {\n POP_SOUND.play();\n }\n } else if (what == 'recv') {} else if (what == 'gone' || what == 'unsub') {\n if (this.state.topicSelected == cont.topic) {\n this.handleTopicSelected(null);\n }\n\n this.resetContactList();\n } else if (what == 'acs') {\n if (this.state.topicSelected == cont.topic) {\n this.setState({\n topicSelectedAcs: cont.acs\n });\n }\n } else if (what == 'del') {} else {\n console.log(\"Unsupported (yet) presence update:\" + what + \" in: \" + cont.topic);\n }\n }\n }, {\n key: \"tnMeSubsUpdated\",\n value: function tnMeSubsUpdated(unused) {\n this.resetContactList();\n }\n }, {\n key: \"resetContactList\",\n value: function resetContactList() {\n var _this6 = this;\n\n var newState = {\n chatList: []\n };\n this.tinode.getMeTopic().contacts(function (c) {\n newState.chatList.push(c);\n\n if (_this6.state.topicSelected == c.topic) {\n newState.topicSelectedOnline = c.online;\n newState.topicSelectedAcs = c.acs;\n }\n });\n newState.searchableContacts = TinodeWeb.prepareSearchableContacts(newState.chatList, this.state.searchResults);\n this.setState(newState);\n }\n }, {\n key: \"tnData\",\n value: function tnData(data) {\n var _this7 = this;\n\n var topic = this.tinode.getTopic(data.topic);\n\n if (topic.msgStatus(data) >= tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.MESSAGE_STATUS_SENT) {\n clearTimeout(this.receivedTimer);\n this.receivedTimer = setTimeout(function () {\n _this7.receivedTimer = undefined;\n topic.noteRecv(data.seq);\n }, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"RECEIVED_DELAY\"]);\n }\n }\n }, {\n key: \"tnInitFind\",\n value: function tnInitFind() {\n var _this8 = this;\n\n var fnd = this.tinode.getFndTopic();\n\n if (fnd.isSubscribed()) {\n this.tnFndSubsUpdated();\n } else {\n fnd.onSubsUpdated = this.tnFndSubsUpdated;\n fnd.subscribe(fnd.startMetaQuery().withSub().withTags().build()).catch(function (err) {\n _this8.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"tnFndSubsUpdated\",\n value: function tnFndSubsUpdated() {\n var foundContacts = [];\n this.tinode.getFndTopic().contacts(function (s) {\n foundContacts.push(s);\n });\n this.setState({\n searchResults: foundContacts,\n searchableContacts: TinodeWeb.prepareSearchableContacts(this.state.chatList, foundContacts)\n });\n }\n }, {\n key: \"handleSearchContacts\",\n value: function handleSearchContacts(query) {\n var _this9 = this;\n\n var fnd = this.tinode.getFndTopic();\n fnd.setMeta({\n desc: {\n public: query\n }\n }).then(function (ctrl) {\n return fnd.getMeta(fnd.startMetaQuery().withSub().build());\n }).catch(function (err) {\n _this9.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleTopicSelected\",\n value: function handleTopicSelected(topicName, unused_index, online, acs) {\n if (topicName) {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'topic-view',\n showInfoPanel: false\n });\n\n if (this.state.topicSelected != topicName) {\n this.setState({\n topicSelectedOnline: online,\n topicSelectedAcs: acs\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', topicName));\n }\n } else {\n this.setState({\n errorText: '',\n errorLevel: null,\n mobilePanel: 'sidepanel',\n topicSelectedOnline: false,\n topicSelectedAcs: null,\n showInfoPanel: false\n });\n\n if (this.state.topicSelected) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', null));\n }\n }\n }\n }, {\n key: \"handleHideMessagesView\",\n value: function handleHideMessagesView() {\n this.setState({\n mobilePanel: 'sidepanel'\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic(window.location.hash, null));\n }\n }, {\n key: \"handleSendMessage\",\n value: function handleSendMessage(msg, promise, uploader) {\n var _this10 = this;\n\n var topic = this.tinode.getTopic(this.state.topicSelected);\n msg = topic.createMessage(msg, false);\n msg._uploader = uploader;\n\n if (!topic.isSubscribed()) {\n if (!promise) {\n promise = Promise.resolve();\n }\n\n promise = promise.then(function () {\n return topic.subscribe();\n });\n }\n\n if (promise) {\n promise = promise.catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n\n topic.publishDraft(msg, promise).catch(function (err) {\n _this10.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleNewAccount\",\n value: function handleNewAccount() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'register'));\n }\n }, {\n key: \"handleNewAccountRequest\",\n value: function handleNewAccountRequest(login_, password_, public_, cred_, tags_) {\n var _this11 = this;\n\n this.tinode.connect(this.state.serverAddress).then(function () {\n return _this11.tinode.createAccountBasic(login_, password_, {\n public: public_,\n tags: tags_,\n cred: tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.credential(cred_)\n });\n }).then(function (ctrl) {\n if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {\n _this11.handleCredentialsRequest(ctrl.params);\n } else {\n _this11.handleLoginSuccessful(_this11);\n }\n }).catch(function (err) {\n _this11.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleUpdateAccountRequest\",\n value: function handleUpdateAccountRequest(password, pub, defacs) {\n var _this12 = this;\n\n if (pub || defacs) {\n this.tinode.getMeTopic().setMeta({\n desc: {\n public: pub,\n defacs: defacs\n }\n }).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n\n if (password) {\n this.tinode.updateAccountBasic(null, this.tinode.getCurrentLogin(), password).catch(function (err) {\n _this12.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleUpdateAccountTagsRequest\",\n value: function handleUpdateAccountTagsRequest(tags) {\n var _this13 = this;\n\n this.tinode.getFndTopic().setMeta({\n tags: tags\n }).catch(function (err) {\n _this13.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleSettings\",\n value: function handleSettings() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, this.state.myUserId ? 'edit' : 'settings'));\n }\n }, {\n key: \"handleGlobalSettings\",\n value: function handleGlobalSettings(settings) {\n var serverAddress = settings.serverAddress || this.state.serverAddress;\n var transport = settings.transport || this.state.transport;\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.tinode = TinodeWeb.tnSetup(serverAddress, transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n this.setState({\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('settings', {\n serverAddress: serverAddress,\n transport: transport\n });\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, ''));\n }\n }, {\n key: \"initDesktopAlerts\",\n value: function initDesktopAlerts() {\n var _this14 = this;\n\n this.fbPush.onTokenRefresh(function () {\n _this14.requestPushToken(true);\n });\n this.fbPush.onMessage(function (payload) {});\n }\n }, {\n key: \"togglePushToken\",\n value: function togglePushToken(enabled) {\n var _this15 = this;\n\n if (enabled) {\n if (!this.state.firebaseToken) {\n this.fbPush.requestPermission().then(function () {\n _this15.requestPushToken(true);\n }).catch(function (err) {\n _this15.handleError(err.message, 'err');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n console.log(\"Failed to get permission to notify.\", err);\n });\n } else {\n this.setState({\n desktopAlerts: true\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }\n } else if (this.state.firebaseToken) {\n this.fbPush.deleteToken(this.state.firebaseToken).catch(function (err) {\n console.log(\"Unable to delete token.\", err);\n }).finally(function () {\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('firebase-token');\n\n _this15.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n });\n } else {\n this.setState({\n desktopAlerts: false,\n firebaseToken: null\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: false\n });\n }\n }\n }, {\n key: \"requestPushToken\",\n value: function requestPushToken(sendToServer) {\n var _this16 = this;\n\n this.fbPush.getToken().then(function (refreshedToken) {\n if (refreshedToken != _this16.state.firebaseToken) {\n _this16.tinode.setDeviceToken(refreshedToken, sendToServer);\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].setObject('firebase-token', refreshedToken);\n }\n\n _this16.setState({\n firebaseToken: refreshedToken,\n desktopAlerts: true\n });\n\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n desktopAlerts: true\n });\n }).catch(function (err) {\n _this16.handleError(err.message, 'err');\n\n console.log(\"Failed to retrieve firebase token\", err);\n });\n }\n }, {\n key: \"handleToggleMessageSounds\",\n value: function handleToggleMessageSounds(enabled) {\n this.setState({\n messageSounds: enabled\n });\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].updateObject('settings', {\n messageSoundsOff: !enabled\n });\n }\n }, {\n key: \"handleSidepanelCancel\",\n value: function handleSidepanelCancel() {\n var parsed = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].parseUrlHash(window.location.hash);\n parsed.path[0] = this.state.myUserId ? 'contacts' : '';\n\n if (parsed.params) {\n delete parsed.params.code;\n delete parsed.params.method;\n delete parsed.params.tab;\n }\n\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].composeUrlHash(parsed.path, parsed.params));\n this.setState({\n errorText: '',\n errorLevel: null\n });\n }\n }, {\n key: \"handleNewTopic\",\n value: function handleNewTopic() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlSidePanel(window.location.hash, 'newtpk'));\n }\n }, {\n key: \"handleNewTopicRequest\",\n value: function handleNewTopicRequest(peerName, pub, priv, tags) {\n var _this17 = this;\n\n var topicName = peerName || this.tinode.newGroupTopicName();\n\n if (!peerName) {\n this.setState({\n newGroupTopicParams: {\n desc: {\n public: pub,\n private: {\n comment: priv\n }\n },\n tags: tags\n }\n }, function () {\n _this17.handleTopicSelected(topicName);\n });\n } else {\n this.handleTopicSelected(topicName);\n }\n }\n }, {\n key: \"handleNewTopicCreated\",\n value: function handleNewTopicCreated(oldName, newName) {\n if (this.state.topicSelected == oldName && oldName != newName) {\n this.setState({\n topicSelected: newName\n }, function () {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic('', newName));\n });\n }\n }\n }, {\n key: \"handleTopicUpdateRequest\",\n value: function handleTopicUpdateRequest(topicName, pub, priv, permissions) {\n var _this18 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var params = {};\n\n if (pub) {\n params.public = pub;\n }\n\n if (priv) {\n params.private = {\n comment: priv\n };\n }\n\n if (permissions) {\n params.defacs = permissions;\n }\n\n topic.setMeta({\n desc: params\n }).catch(function (err) {\n _this18.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleChangePermissions\",\n value: function handleChangePermissions(topicName, mode, uid) {\n var _this19 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var am = topic.getAccessMode();\n\n if (uid) {\n am.updateGiven(mode);\n mode = am.getGiven();\n } else {\n am.updateWant(mode);\n mode = am.getWant();\n }\n\n topic.setMeta({\n sub: {\n user: uid,\n mode: mode\n }\n }).catch(function (err) {\n _this19.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleTagsUpdated\",\n value: function handleTagsUpdated(topicName, tags) {\n var _this20 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n var instance = this;\n topic.setMeta({\n tags: tags\n }).catch(function (err) {\n _this20.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"handleLogout\",\n value: function handleLogout() {\n updateFavicon(0);\n _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].removeItem('auth-token');\n\n if (this.tinode) {\n this.tinode.onDisconnect = undefined;\n this.tinode.disconnect();\n }\n\n this.setState(this.getBlankState());\n this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport);\n this.tinode.onConnect = this.handleConnected;\n this.tinode.onDisconnect = this.handleDisconnect;\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo('');\n }\n }, {\n key: \"handleLeaveUnsubRequest\",\n value: function handleLeaveUnsubRequest(topicName) {\n var _this21 = this;\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n topic.leave(true).then(function (ctrl) {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].setUrlTopic(window.location.hash, ''));\n }).catch(function (err) {\n _this21.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleDialogCancel\",\n value: function handleDialogCancel() {\n this.setState({\n dialogSelected: null\n });\n }\n }, {\n key: \"handleShowContextMenu\",\n value: function handleShowContextMenu(params, menuItems) {\n this.setState({\n contextMenuVisible: true,\n contextMenuClickAt: {\n x: params.x,\n y: params.y\n },\n contextMenuParams: params,\n contextMenuItems: menuItems || this.defaultTopicContextMenu(params.topicName),\n contextMenuBounds: ReactDOM.findDOMNode(this).getBoundingClientRect()\n });\n }\n }, {\n key: \"defaultTopicContextMenu\",\n value: function defaultTopicContextMenu(topicName) {\n var muted = false,\n blocked = false,\n subscribed = false,\n deleter = false;\n var topic = this.tinode.getTopic(topicName);\n\n if (topic) {\n if (topic.isSubscribed()) {\n subscribed = true;\n var acs = topic.getAccessMode();\n muted = acs && acs.isMuted();\n blocked = acs && !acs.isJoiner();\n deleter = acs && acs.isDeleter();\n }\n }\n\n return [subscribed ? {\n title: \"Info\",\n handler: this.handleShowInfoView\n } : null, subscribed ? 'messages_clear' : null, subscribed && deleter ? 'messages_clear_hard' : null, subscribed ? muted ? 'topic_unmute' : 'topic_mute' : null, subscribed ? blocked ? 'topic_unblock' : 'topic_block' : null, 'topic_delete'];\n }\n }, {\n key: \"handleHideContextMenu\",\n value: function handleHideContextMenu() {\n this.setState({\n contextMenuVisible: false,\n contextMenuClickAt: null,\n contextMenuParams: null,\n contextMenuBounds: null\n });\n }\n }, {\n key: \"handleShowInfoView\",\n value: function handleShowInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].addUrlParam(window.location.hash, 'info', true));\n this.setState({\n showInfoPanel: true\n });\n }\n }, {\n key: \"handleHideInfoView\",\n value: function handleHideInfoView() {\n _lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].removeUrlParam(window.location.hash, 'info'));\n this.setState({\n showInfoPanel: false\n });\n }\n }, {\n key: \"handleMemberUpdateRequest\",\n value: function handleMemberUpdateRequest(topicName, added, removed) {\n var _this22 = this;\n\n if (!topicName) {\n return;\n }\n\n var topic = this.tinode.getTopic(topicName);\n\n if (!topic) {\n return;\n }\n\n if (added && added.length > 0) {\n added.map(function (uid) {\n topic.invite(uid, null).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n\n if (removed && removed.length > 0) {\n removed.map(function (uid) {\n topic.delSubscription(uid).catch(function (err) {\n _this22.handleError(err.message, 'err');\n });\n });\n }\n }\n }, {\n key: \"handleValidateCredentialsRequest\",\n value: function handleValidateCredentialsRequest(cred, code) {\n this.setState({\n credMethod: cred,\n credCode: code\n });\n this.doLogin(null, null, {\n meth: cred,\n resp: code\n });\n }\n }, {\n key: \"handlePasswordResetRequest\",\n value: function handlePasswordResetRequest(method, value) {\n var _this23 = this;\n\n this.tinode.connect().then(function () {\n return _this23.tinode.requestResetAuthSecret('basic', method, value);\n }).catch(function (err) {\n _this23.handleError(err.message, 'err');\n });\n }\n }, {\n key: \"handleResetPassword\",\n value: function handleResetPassword(scheme, newPassword, token) {\n var _this24 = this;\n\n token = base64ReEncode(token);\n\n if (!token) {\n this.handleError(\"Invalid security token\", 'err');\n } else {\n this.tinode.connect().then(function () {\n return _this24.tinode.updateAccountBasic(null, null, newPassword, {\n token: token\n });\n }).catch(function (err) {\n _this24.handleError(err.message, 'err');\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"app-container\"\n }, this.state.contextMenuVisible ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_widgets_context_menu_jsx__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n tinode: this.tinode,\n bounds: this.state.contextMenuBounds,\n clickAt: this.state.contextMenuClickAt,\n params: this.state.contextMenuParams,\n items: this.state.contextMenuItems,\n hide: this.handleHideContextMenu,\n onAction: this.handleContextMenuAction,\n onError: this.handleError\n }) : null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_7__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n hideSelf: this.state.displayMobile && this.state.mobilePanel !== 'sidepanel',\n state: this.state.sidePanelSelected,\n title: this.state.sidePanelTitle,\n avatar: this.state.sidePanelAvatar,\n login: this.state.login,\n myUserId: this.state.myUserId,\n loginDisabled: this.state.loginDisabled,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n topicSelected: this.state.topicSelected,\n chatList: this.state.chatList,\n credMethod: this.state.credMethod,\n credCode: this.state.credCode,\n transport: this.state.transport,\n messageSounds: this.state.messageSounds,\n desktopAlerts: this.state.desktopAlerts,\n desktopAlertsEnabled: this.state.desktopAlertsEnabled,\n serverAddress: this.state.serverAddress,\n onGlobalSettings: this.handleGlobalSettings,\n onSignUp: this.handleNewAccount,\n onSettings: this.handleSettings,\n onLoginRequest: this.handleLoginRequest,\n onCreateAccount: this.handleNewAccountRequest,\n onUpdateAccount: this.handleUpdateAccountRequest,\n onUpdateAccountTags: this.handleUpdateAccountTagsRequest,\n onTogglePushNotifications: this.togglePushToken,\n onToggleMessageSounds: this.handleToggleMessageSounds,\n onTopicSelected: this.handleTopicSelected,\n onCreateTopic: this.handleNewTopicRequest,\n onNewTopic: this.handleNewTopic,\n onLogout: this.handleLogout,\n onCancel: this.handleSidepanelCancel,\n onError: this.handleError,\n onValidateCredentials: this.handleValidateCredentialsRequest,\n onPasswordResetRequest: this.handlePasswordResetRequest,\n onResetPassword: this.handleResetPassword,\n onInitFind: this.tnInitFind,\n searchResults: this.state.searchResults,\n onSearchContacts: this.handleSearchContacts,\n showContextMenu: this.handleShowContextMenu\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_messages_view_jsx__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n online: this.state.topicSelectedOnline,\n acs: this.state.topicSelectedAcs,\n displayMobile: this.state.displayMobile,\n viewportWidth: this.state.viewportWidth,\n hideSelf: this.state.displayMobile && (this.state.mobilePanel !== 'topic-view' || this.state.showInfoPanel),\n topic: this.state.topicSelected,\n myUserId: this.state.myUserId,\n serverVersion: this.state.serverVersion,\n serverAddress: this.state.serverAddress,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n newGroupTopicParams: this.state.newGroupTopicParams,\n onHideMessagesView: this.handleHideMessagesView,\n onData: this.tnData,\n onError: this.handleError,\n onNewTopicCreated: this.handleNewTopicCreated,\n readTimerHandler: this.handleReadTimer,\n showContextMenu: this.handleShowContextMenu,\n sendMessage: this.handleSendMessage\n }), this.state.showInfoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_info_view_jsx__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n tinode: this.tinode,\n connected: this.state.connected,\n displayMobile: this.state.displayMobile,\n topic: this.state.topicSelected,\n searchableContacts: this.state.searchableContacts,\n myUserId: this.state.myUserId,\n errorText: this.state.errorText,\n errorLevel: this.state.errorLevel,\n onTopicDescUpdate: this.handleTopicUpdateRequest,\n onCancel: this.handleHideInfoView,\n onChangePermissions: this.handleChangePermissions,\n onMemberUpdateRequest: this.handleMemberUpdateRequest,\n onLeaveTopic: this.handleLeaveUnsubRequest,\n onAddMember: this.handleManageGroupMembers,\n onTopicTagsUpdate: this.handleTagsUpdated,\n onInitFind: this.tnInitFind,\n onError: this.handleError,\n showContextMenu: this.handleShowContextMenu\n }) : null);\n }\n }], [{\n key: \"tnSetup\",\n value: function tnSetup(serverAddress, transport) {\n var tinode = new tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a(_config_js__WEBPACK_IMPORTED_MODULE_8__[\"APP_NAME\"], serverAddress, _config_js__WEBPACK_IMPORTED_MODULE_8__[\"API_KEY\"], transport, Object(_lib_host_name_js__WEBPACK_IMPORTED_MODULE_9__[\"isSecureConnection\"])());\n tinode.enableLogging(true, true);\n return tinode;\n }\n }, {\n key: \"prepareSearchableContacts\",\n value: function prepareSearchableContacts(chatList, foundContacts) {\n var merged = {};\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = chatList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var c = _step.value;\n\n if (tinode_sdk__WEBPACK_IMPORTED_MODULE_3___default.a.topicType(c.topic) == 'p2p') {\n merged[c.topic] = {\n user: c.topic,\n updated: c.updated,\n public: c.public,\n private: c.private,\n acs: c.acs\n };\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = foundContacts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _c = _step2.value;\n\n if (!merged[_c.user]) {\n merged[_c.user] = _c;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return Object.values(merged);\n }\n }]);\n\n return TinodeWeb;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);\n\n\n;\n\n//# sourceURL=webpack:///./src/views/tinode-web.jsx?"); /***/ }), diff --git a/umd/index.prod.js b/umd/index.prod.js index d7328184..ddaf2beb 100644 --- a/umd/index.prod.js +++ b/umd/index.prod.js @@ -18,7 +18,7 @@ var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__p object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l=2&&i<=4&&(a<12||a>14)?"few":o&&0==i||o&&i>=5&&i<=9||o&&a>=11&&a<=14?"many":"other"},fields:{year:{displayName:"год",relative:{0:"в этом году",1:"в следующем году","-1":"в прошлом году"},relativeTime:{future:{one:"через {0} год",few:"через {0} года",many:"через {0} лет",other:"через {0} года"},past:{one:"{0} год назад",few:"{0} года назад",many:"{0} лет назад",other:"{0} года назад"}}},month:{displayName:"месяц",relative:{0:"в этом месяце",1:"в следующем месяце","-1":"в прошлом месяце"},relativeTime:{future:{one:"через {0} месяц",few:"через {0} месяца",many:"через {0} месяцев",other:"через {0} месяца"},past:{one:"{0} месяц назад",few:"{0} месяца назад",many:"{0} месяцев назад",other:"{0} месяца назад"}}},day:{displayName:"день",relative:{0:"сегодня",1:"завтра",2:"послезавтра","-2":"позавчера","-1":"вчера"},relativeTime:{future:{one:"через {0} день",few:"через {0} дня",many:"через {0} дней",other:"через {0} дня"},past:{one:"{0} день назад",few:"{0} дня назад",many:"{0} дней назад",other:"{0} дня назад"}}},hour:{displayName:"час",relative:{0:"в этом часе"},relativeTime:{future:{one:"через {0} час",few:"через {0} часа",many:"через {0} часов",other:"через {0} часа"},past:{one:"{0} час назад",few:"{0} часа назад",many:"{0} часов назад",other:"{0} часа назад"}}},minute:{displayName:"минута",relative:{0:"в эту минуту"},relativeTime:{future:{one:"через {0} минуту",few:"через {0} минуты",many:"через {0} минут",other:"через {0} минуты"},past:{one:"{0} минуту назад",few:"{0} минуты назад",many:"{0} минут назад",other:"{0} минуты назад"}}},second:{displayName:"секунда",relative:{0:"сейчас"},relativeTime:{future:{one:"через {0} секунду",few:"через {0} секунды",many:"через {0} секунд",other:"через {0} секунды"},past:{one:"{0} секунду назад",few:"{0} секунды назад",many:"{0} секунд назад",other:"{0} секунды назад"}}}}},{locale:"ru-BY",parentLocale:"ru"},{locale:"ru-KG",parentLocale:"ru"},{locale:"ru-KZ",parentLocale:"ru"},{locale:"ru-MD",parentLocale:"ru"},{locale:"ru-UA",parentLocale:"ru"}]}()},function(e){e.exports={contacts_not_found:"You have no chats
¯\\\\_(ツ)_/¯",email_prompt:"Email, e.g jdoe@example.com",full_name_prompt:"Full name, e.g. John Doe",login_prompt:"Login",password_prompt:"Password",stay_logged_in:"Stay logged in",forgot_password_link:"Forgot password?",sign_in_button:"Sign in",label_client:"Client:",label_server:"Server:",sidepanel_title_login:"Sign In",sidepanel_title_register:"Create Account",sidepanel_title_settings:"Settings",sidepanel_title_edit_account:"Edit Account",sidepanel_title_newtpk:"Start New Chat",sidepanel_title_cred:"Confirm Credentials",sidepanel_title_reset:"Reset Password"}},function(e,t,n){e.exports=n(48)},function(e,t,n){"use strict"; +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l=2&&i<=4&&(a<12||a>14)?"few":o&&0==i||o&&i>=5&&i<=9||o&&a>=11&&a<=14?"many":"other"},fields:{year:{displayName:"год",relative:{0:"в этом году",1:"в следующем году","-1":"в прошлом году"},relativeTime:{future:{one:"через {0} год",few:"через {0} года",many:"через {0} лет",other:"через {0} года"},past:{one:"{0} год назад",few:"{0} года назад",many:"{0} лет назад",other:"{0} года назад"}}},month:{displayName:"месяц",relative:{0:"в этом месяце",1:"в следующем месяце","-1":"в прошлом месяце"},relativeTime:{future:{one:"через {0} месяц",few:"через {0} месяца",many:"через {0} месяцев",other:"через {0} месяца"},past:{one:"{0} месяц назад",few:"{0} месяца назад",many:"{0} месяцев назад",other:"{0} месяца назад"}}},day:{displayName:"день",relative:{0:"сегодня",1:"завтра",2:"послезавтра","-2":"позавчера","-1":"вчера"},relativeTime:{future:{one:"через {0} день",few:"через {0} дня",many:"через {0} дней",other:"через {0} дня"},past:{one:"{0} день назад",few:"{0} дня назад",many:"{0} дней назад",other:"{0} дня назад"}}},hour:{displayName:"час",relative:{0:"в этом часе"},relativeTime:{future:{one:"через {0} час",few:"через {0} часа",many:"через {0} часов",other:"через {0} часа"},past:{one:"{0} час назад",few:"{0} часа назад",many:"{0} часов назад",other:"{0} часа назад"}}},minute:{displayName:"минута",relative:{0:"в эту минуту"},relativeTime:{future:{one:"через {0} минуту",few:"через {0} минуты",many:"через {0} минут",other:"через {0} минуты"},past:{one:"{0} минуту назад",few:"{0} минуты назад",many:"{0} минут назад",other:"{0} минуты назад"}}},second:{displayName:"секунда",relative:{0:"сейчас"},relativeTime:{future:{one:"через {0} секунду",few:"через {0} секунды",many:"через {0} секунд",other:"через {0} секунды"},past:{one:"{0} секунду назад",few:"{0} секунды назад",many:"{0} секунд назад",other:"{0} секунды назад"}}}}},{locale:"ru-BY",parentLocale:"ru"},{locale:"ru-KG",parentLocale:"ru"},{locale:"ru-KZ",parentLocale:"ru"},{locale:"ru-MD",parentLocale:"ru"},{locale:"ru-UA",parentLocale:"ru"}]}()},function(e){e.exports={contacts_not_found:"You have no chats
¯\\\\_(ツ)_/¯",full_name_prompt:"Full name, e.g. John Doe",email_prompt:"Email, e.g. jdoe@example.com",sign_up_button:"Sign up",login_prompt:"Login",password_prompt:"Password",stay_logged_in:"Stay logged in",forgot_password_link:"Forgot password?",sign_in_button:"Sign in",label_client:"Client:",label_server:"Server:",sidepanel_title_login:"Sign In",sidepanel_title_register:"Create Account",sidepanel_title_settings:"Settings",sidepanel_title_edit_account:"Edit Account",sidepanel_title_newtpk:"Start New Chat",sidepanel_title_cred:"Confirm Credentials",sidepanel_title_reset:"Reset Password"}},function(e,t,n){e.exports=n(48)},function(e,t,n){"use strict"; /** @license React v16.5.2 * react.production.min.js * @@ -42,4 +42,4 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Object.defineProperty(t,"__esModule",{value:!0});var r=null,o=!1,i=!1,a="object"==typeof performance&&"function"==typeof performance.now,s={timeRemaining:a?function(){var e=m()-performance.now();return 0=x-n){if(!(-1!==O&&O<=n))return void(P||(P=!0,w(j)));e=!0}if(O=-1,n=k,k=null,null!==n){N=!0;try{n(e)}finally{N=!1}}}},!1);var j=function(e){P=!1;var t=e-x+A;tt&&(t=8),A=tn){o=i;break}i=i.next}while(i!==r);null===o?o=r:o===r&&(r=e,l()),(n=o.previous).next=o.previous=e,e.next=o,e.previous=n}return e},t.unstable_cancelScheduledWork=function(e){var t=e.next;if(null!==t){if(t===e)r=null;else{e===r&&(r=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}}},function(e,t,n){"use strict";var r=n(24),o=n(29);r.default.__addLocaleData(o.default),r.default.defaultLocale="en",t.default=r.default},function(e,t,n){"use strict";var r=n(12),o=n(25),i=n(26),a=n(27);function s(e,t,n){var r="string"==typeof e?s.__parse(e):e;if(!r||"messageFormatPattern"!==r.type)throw new TypeError("A message must be provided as a String or AST.");n=this._mergeFormats(s.formats,n),o.defineProperty(this,"_locale",{value:this._resolveLocale(t)});var i=this._findPluralRuleFunction(this._locale),a=this._compilePattern(r,t,n,i),l=this;this.format=function(t){try{return l._format(a,t)}catch(t){throw t.variableId?new Error("The intl string context variable '"+t.variableId+"' was not provided to the string '"+e+"'"):t}}}t.default=s,o.defineProperty(s,"formats",{enumerable:!0,value:{number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}),o.defineProperty(s,"__localeData__",{value:o.objCreate(null)}),o.defineProperty(s,"__addLocaleData",{value:function(e){if(!e||!e.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[e.locale.toLowerCase()]=e}}),o.defineProperty(s,"__parse",{value:a.default.parse}),o.defineProperty(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(e,t,n,r){return new i.default(t,n,r).compile(e)},s.prototype._findPluralRuleFunction=function(e){for(var t=s.__localeData__,n=t[e.toLowerCase()];n;){if(n.pluralRuleFunction)return n.pluralRuleFunction;n=n.parentLocale&&t[n.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+e)},s.prototype._format=function(e,t){var n,o,i,a,s,l,c="";for(n=0,o=e.length;n1?arguments[1]:{},o={},i={start:xe},a=xe,s=function(e){return{type:"messageFormatPattern",elements:e,location:ke()}},l=function(e){var t,n,r,o,i,a="";for(t=0,r=e.length;tEe&&(Ee=ge,Se=[]),Se.push(e))}function Ne(t,n,r,o){return null!==n&&function(e){var t=1;for(e.sort(function(e,t){return e.descriptiont.description?1:0});t1?r.slice(0,-1).join(", ")+" or "+r[e.length-1]:r[0])+" but "+(t?'"'+function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+t(e)})}(t)+'"':"end of input")+" found."}(n,r),n,r,o)}function xe(){return Me()}function Me(){var e,t,n;for(e=ge,t=[],n=Ae();n!==o;)t.push(n),n=Ae();return t!==o&&(_e=e,t=s(t)),e=t}function Ae(){var e;return(e=function(){var e,n;return e=ge,(n=function(){var e,n,r,i,a,s;if(e=ge,n=[],r=ge,(i=Re())!==o&&(a=qe())!==o&&(s=Re())!==o?r=i=[i,a,s]:(ge=r,r=o),r!==o)for(;r!==o;)n.push(r),r=ge,(i=Re())!==o&&(a=qe())!==o&&(s=Re())!==o?r=i=[i,a,s]:(ge=r,r=o);else n=o;return n!==o&&(_e=e,n=l(n)),(e=n)===o&&(e=ge,n=Ie(),e=n!==o?t.substring(e,ge):n),e}())!==o&&(_e=e,n=c(n)),e=n}())===o&&(e=function(){var e,n,r,i,a,s,l;return e=ge,123===t.charCodeAt(ge)?(n=f,ge++):(n=o,0===Te&&Pe(d)),n!==o&&Re()!==o&&(r=function(){var e,n,r;if((e=Le())===o){if(e=ge,n=[],u.test(t.charAt(ge))?(r=t.charAt(ge),ge++):(r=o,0===Te&&Pe(p)),r!==o)for(;r!==o;)n.push(r),u.test(t.charAt(ge))?(r=t.charAt(ge),ge++):(r=o,0===Te&&Pe(p));else n=o;e=n!==o?t.substring(e,ge):n}return e}())!==o&&Re()!==o?(i=ge,44===t.charCodeAt(ge)?(a=h,ge++):(a=o,0===Te&&Pe(m)),a!==o&&(s=Re())!==o&&(l=function(){var e;return(e=function(){var e,n,r,i,a,s;return e=ge,t.substr(ge,6)===g?(n=g,ge+=6):(n=o,0===Te&&Pe(_)),n===o&&(t.substr(ge,4)===w?(n=w,ge+=4):(n=o,0===Te&&Pe(E)),n===o&&(t.substr(ge,4)===S?(n=S,ge+=4):(n=o,0===Te&&Pe(T)))),n!==o&&Re()!==o?(r=ge,44===t.charCodeAt(ge)?(i=h,ge++):(i=o,0===Te&&Pe(m)),i!==o&&(a=Re())!==o&&(s=qe())!==o?r=i=[i,a,s]:(ge=r,r=o),r===o&&(r=null),r!==o?(_e=e,n=k(n,r),e=n):(ge=e,e=o)):(ge=e,e=o),e}())===o&&(e=function(){var e,n,r,i;return e=ge,t.substr(ge,6)===C?(n=C,ge+=6):(n=o,0===Te&&Pe(O)),n!==o&&Re()!==o?(44===t.charCodeAt(ge)?(r=h,ge++):(r=o,0===Te&&Pe(m)),r!==o&&Re()!==o&&(i=je())!==o?(_e=e,n=P(i),e=n):(ge=e,e=o)):(ge=e,e=o),e}())===o&&(e=function(){var e,n,r,i;return e=ge,t.substr(ge,13)===N?(n=N,ge+=13):(n=o,0===Te&&Pe(x)),n!==o&&Re()!==o?(44===t.charCodeAt(ge)?(r=h,ge++):(r=o,0===Te&&Pe(m)),r!==o&&Re()!==o&&(i=je())!==o?(_e=e,n=M(i),e=n):(ge=e,e=o)):(ge=e,e=o),e}())===o&&(e=function(){var e,n,r,i,a;if(e=ge,t.substr(ge,6)===A?(n=A,ge+=6):(n=o,0===Te&&Pe(D)),n!==o)if(Re()!==o)if(44===t.charCodeAt(ge)?(r=h,ge++):(r=o,0===Te&&Pe(m)),r!==o)if(Re()!==o){if(i=[],(a=De())!==o)for(;a!==o;)i.push(a),a=De();else i=o;i!==o?(_e=e,n=j(i),e=n):(ge=e,e=o)}else ge=e,e=o;else ge=e,e=o;else ge=e,e=o;else ge=e,e=o;return e}()),e}())!==o?i=a=[a,s,l]:(ge=i,i=o),i===o&&(i=null),i!==o&&(a=Re())!==o?(125===t.charCodeAt(ge)?(s=y,ge++):(s=o,0===Te&&Pe(v)),s!==o?(_e=e,n=b(r,i),e=n):(ge=e,e=o)):(ge=e,e=o)):(ge=e,e=o),e}()),e}function De(){var e,n,r,i,a;return e=ge,Re()!==o&&(n=function(){var e,n,r,i;return e=ge,n=ge,61===t.charCodeAt(ge)?(r=I,ge++):(r=o,0===Te&&Pe(R)),r!==o&&(i=Le())!==o?n=r=[r,i]:(ge=n,n=o),(e=n!==o?t.substring(e,ge):n)===o&&(e=qe()),e}())!==o&&Re()!==o?(123===t.charCodeAt(ge)?(r=f,ge++):(r=o,0===Te&&Pe(d)),r!==o&&Re()!==o&&(i=Me())!==o&&Re()!==o?(125===t.charCodeAt(ge)?(a=y,ge++):(a=o,0===Te&&Pe(v)),a!==o?(_e=e,e=U(n,i)):(ge=e,e=o)):(ge=e,e=o)):(ge=e,e=o),e}function je(){var e,n,r,i;if(e=ge,(n=function(){var e,n,r;return e=ge,t.substr(ge,7)===F?(n=F,ge+=7):(n=o,0===Te&&Pe(L)),n!==o&&Re()!==o&&(r=Le())!==o?(_e=e,e=n=B(r)):(ge=e,e=o),e}())===o&&(n=null),n!==o)if(Re()!==o){if(r=[],(i=De())!==o)for(;i!==o;)r.push(i),i=De();else r=o;r!==o?(_e=e,e=n=q(n,r)):(ge=e,e=o)}else ge=e,e=o;else ge=e,e=o;return e}function Ie(){var e,n;if(Te++,e=[],V.test(t.charAt(ge))?(n=t.charAt(ge),ge++):(n=o,0===Te&&Pe(K)),n!==o)for(;n!==o;)e.push(n),V.test(t.charAt(ge))?(n=t.charAt(ge),ge++):(n=o,0===Te&&Pe(K));else e=o;return Te--,e===o&&(n=o,0===Te&&Pe(W)),e}function Re(){var e,n,r;for(Te++,e=ge,n=[],r=Ie();r!==o;)n.push(r),r=Ie();return e=n!==o?t.substring(e,ge):n,Te--,e===o&&(n=o,0===Te&&Pe(H)),e}function Ue(){var e;return z.test(t.charAt(ge))?(e=t.charAt(ge),ge++):(e=o,0===Te&&Pe(G)),e}function Fe(){var e;return $.test(t.charAt(ge))?(e=t.charAt(ge),ge++):(e=o,0===Te&&Pe(Y)),e}function Le(){var e,n,r,i,a,s;if(e=ge,48===t.charCodeAt(ge)?(n=X,ge++):(n=o,0===Te&&Pe(Q)),n===o){if(n=ge,r=ge,J.test(t.charAt(ge))?(i=t.charAt(ge),ge++):(i=o,0===Te&&Pe(Z)),i!==o){for(a=[],s=Ue();s!==o;)a.push(s),s=Ue();a!==o?r=i=[i,a]:(ge=r,r=o)}else ge=r,r=o;n=r!==o?t.substring(n,ge):r}return n!==o&&(_e=e,n=ee(n)),e=n}function Be(){var e,n,r,i,a,s,l,c;return te.test(t.charAt(ge))?(e=t.charAt(ge),ge++):(e=o,0===Te&&Pe(ne)),e===o&&(e=ge,t.substr(ge,2)===re?(n=re,ge+=2):(n=o,0===Te&&Pe(oe)),n!==o&&(_e=e,n=ie()),(e=n)===o&&(e=ge,t.substr(ge,2)===ae?(n=ae,ge+=2):(n=o,0===Te&&Pe(se)),n!==o&&(_e=e,n=le()),(e=n)===o&&(e=ge,t.substr(ge,2)===ce?(n=ce,ge+=2):(n=o,0===Te&&Pe(ue)),n!==o&&(_e=e,n=pe()),(e=n)===o&&(e=ge,t.substr(ge,2)===fe?(n=fe,ge+=2):(n=o,0===Te&&Pe(de)),n!==o&&(_e=e,n=he()),(e=n)===o&&(e=ge,t.substr(ge,2)===me?(n=me,ge+=2):(n=o,0===Te&&Pe(ye)),n!==o?(r=ge,i=ge,(a=Fe())!==o&&(s=Fe())!==o&&(l=Fe())!==o&&(c=Fe())!==o?i=a=[a,s,l,c]:(ge=i,i=o),(r=i!==o?t.substring(r,ge):i)!==o?(_e=e,e=n=ve(r)):(ge=e,e=o)):(ge=e,e=o)))))),e}function qe(){var e,t,n;if(e=ge,t=[],(n=Be())!==o)for(;n!==o;)t.push(n),n=Be();else t=o;return t!==o&&(_e=e,t=be(t)),e=t}if((n=a())!==o&&ge===t.length)return n;throw n!==o&&ge=0)return!0;if("string"==typeof e){var t=/s$/.test(e)&&e.substr(0,e.length-1);if(t&&i.arrIndexOf.call(a,t)>=0)throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+t)}throw new Error('"'+e+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+a.join('", "')+'"')},l.prototype._resolveLocale=function(e){"string"==typeof e&&(e=[e]),e=(e||[]).concat(l.defaultLocale);var t,n,r,o,i=l.__localeData__;for(t=0,n=e.length;t=0)return e;throw new Error('"'+e+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+s.join('", "')+'"')},l.prototype._selectUnits=function(e){var t,n,r,o=a.filter(function(e){return e.indexOf("-short")<1});for(t=0,n=o.length;t0?V:W)(e)},H=Math.min,z=function(e){return e>0?H(K(e),9007199254740991):0},G=Array.isArray||function(e){return"Array"==F(e)},$=d["__core-js_shared__"]||(d["__core-js_shared__"]={}),Y=function(e){return $[e]||($[e]={})},X=f(function(e){var t=Y("wks"),n=d.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:A)("Symbol."+e))}).store=t}),Q=X("species"),J=function(e,t){return new(function(e){var t;return G(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!G(t.prototype)||(t=void 0),m(t)&&null===(t=t[Q])&&(t=void 0)),void 0===t?Array:t}(e))(t)},Z=function(e,t){var n=1==e,r=2==e,o=3==e,i=4==e,a=6==e,s=5==e||a,l=t||J;return function(t,c,u){for(var p,f,d=q(t),h=L(d),m=j(c,u,3),y=z(h.length),v=0,b=n?l(t,y):r?l(t,0):void 0;y>v;v++)if((s||v in h)&&(f=m(p=h[v],v,d),e))if(n)b[v]=f;else if(f)switch(e){case 3:return!0;case 5:return p;case 6:return v;case 2:b.push(p)}else if(i)return!1;return a?-1:o||i?i:b}},ee=X("unscopables"),te=Array.prototype;void 0==te[ee]&&O(te,ee,{});var ne=function(e){te[ee][e]=!0},re=Z(5),oe=!0;"find"in[]&&Array(1).find(function(){oe=!1}),R(R.P+R.F*oe,"Array",{find:function(e){return re(this,e,arguments.length>1?arguments[1]:void 0)}}),ne("find");h.Array.find;var ie=Z(6),ae=!0;"findIndex"in[]&&Array(1).findIndex(function(){ae=!1}),R(R.P+R.F*ae,"Array",{findIndex:function(e){return ie(this,e,arguments.length>1?arguments[1]:void 0)}}),ne("findIndex");h.Array.findIndex;var se=function(e){return L(B(e))},le=Math.max,ce=Math.min,ue=Y("keys"),pe=function(e){return ue[e]||(ue[e]=A(e))},fe=function(e){return function(t,n,r){var o,i=se(t),a=z(i.length),s=function(e,t){return(e=K(e))<0?le(e+t,0):ce(e,t)}(r,a);if(e&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}}(!1),de=pe("IE_PROTO"),he=function(e,t){var n,r=se(e),o=0,i=[];for(n in r)n!=de&&N(r,n)&&i.push(n);for(;t.length>o;)N(r,n=t[o++])&&(~fe(i,n)||i.push(n));return i},me="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ye=Object.keys||function(e){return he(e,me)},ve={f:Object.getOwnPropertySymbols},be={f:{}.propertyIsEnumerable},ge=Object.assign,_e=!ge||v(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=ge({},e)[n]||Object.keys(ge({},t)).join("")!=r})?function(e,t){for(var n=q(e),r=arguments.length,o=1,i=ve.f,a=be.f;r>o;)for(var s,l=L(arguments[o++]),c=i?ye(l).concat(i(l)):ye(l),u=c.length,p=0;u>p;)a.call(l,s=c[p++])&&(n[s]=l[s]);return n}:ge;R(R.S+R.F,"Object",{assign:_e});h.Object.assign;var we=X("match"),Ee=function(e,t,n){if(function(e){var t;return m(e)&&(void 0!==(t=e[we])?!!t:"RegExp"==F(e))}(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(B(e))},Se=X("match"),Te="".startsWith;R(R.P+R.F*function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Se]=!1,!"/./"[e](t)}catch(e){}}return!0}("startsWith"),"String",{startsWith:function(e){var t=Ee(this,e,"startsWith"),n=z(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Te?Te.call(t,r,n):t.slice(n,n+r.length)===r}});h.String.startsWith;R(R.P,"String",{repeat:function(e){var t=String(B(this)),n="",r=K(e);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n}});h.String.repeat;var ke=f(function(e){var t=A("meta"),n=k.f,r=0,o=Object.isExtensible||function(){return!0},i=!v(function(){return o(Object.preventExtensions({}))}),a=function(e){n(e,t,{value:{i:"O"+ ++r,w:{}}})},s=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!m(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!N(e,t)){if(!o(e))return"F";if(!n)return"E";a(e)}return e[t].i},getWeak:function(e,n){if(!N(e,t)){if(!o(e))return!0;if(!n)return!1;a(e)}return e[t].w},onFreeze:function(e){return i&&s.NEED&&o(e)&&!N(e,t)&&a(e),e}}}),Ce=(ke.KEY,ke.NEED,ke.fastKey,ke.getWeak,ke.onFreeze,k.f),Oe=X("toStringTag"),Pe=function(e,t,n){e&&!N(e=n?e:e.prototype,Oe)&&Ce(e,Oe,{configurable:!0,value:t})},Ne={f:X},xe=k.f,Me=function(e){var t=h.Symbol||(h.Symbol=d.Symbol||{});"_"==e.charAt(0)||e in t||xe(t,e,{value:Ne.f(e)})},Ae=b?Object.defineProperties:function(e,t){y(e);for(var n,r=ye(t),o=r.length,i=0;o>i;)k.f(e,n=r[i++],t[n]);return e},De=d.document,je=De&&De.documentElement,Ie=pe("IE_PROTO"),Re=function(){},Ue=function(){var e,t=w("iframe"),n=me.length;for(t.style.display="none",je.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("