/* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./public/js/databases.js": /*!********************************!*\ !*** ./public/js/databases.js ***! \********************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Databases\": () => (/* binding */ Databases)\n/* harmony export */ });\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 underscore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! underscore */ \"./node_modules/underscore/modules/index-all.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); 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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\nvar Databases = /*#__PURE__*/function (_Component) {\n _inherits(Databases, _Component);\n\n var _super = _createSuper(Databases);\n\n function Databases(props) {\n var _this;\n\n _classCallCheck(this, Databases);\n\n _this = _super.call(this, props);\n _this.state = {\n type: ''\n };\n _this.preSelectedDbs = _this.props.preSelectedDbs;\n _this.databases = _this.databases.bind(_assertThisInitialized(_this));\n _this.nselected = _this.nselected.bind(_assertThisInitialized(_this));\n _this.categories = _this.categories.bind(_assertThisInitialized(_this));\n _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));\n _this.handleToggle = _this.handleToggle.bind(_assertThisInitialized(_this));\n _this.renderDatabases = _this.renderDatabases.bind(_assertThisInitialized(_this));\n _this.renderDatabase = _this.renderDatabase.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Databases, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (this.databases() && this.databases().length === 1) {\n $('.databases').find('input').prop('checked', true);\n this.handleClick(this.databases()[0]);\n }\n\n if (this.preSelectedDbs) {\n var selectors = this.preSelectedDbs.map(function (db) {\n return \"input[value=\".concat(db.id, \"]\");\n });\n $(selectors.join(',')).prop('checked', true);\n this.handleClick(this.preSelectedDbs[0]);\n this.preSelectedDbs = null;\n }\n\n this.props.onDatabaseTypeChanged(this.state.type);\n }\n }, {\n key: \"databases\",\n value: function databases(category) {\n var databases = this.props.databases;\n\n if (category) {\n databases = underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].select(databases, function (database) {\n return database.type === category;\n });\n }\n\n return underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sortBy(databases, 'title');\n }\n }, {\n key: \"nselected\",\n value: function nselected() {\n return $('input[name=\"databases[]\"]:checked').length;\n }\n }, {\n key: \"categories\",\n value: function categories() {\n return underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].uniq(underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.props.databases, underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].iteratee('type'))).sort();\n }\n }, {\n key: \"handleClick\",\n value: function handleClick(database) {\n var type = this.nselected() ? database.type : '';\n if (type != this.state.type) this.setState({\n type: type\n });\n }\n }, {\n key: \"handleToggle\",\n value: function handleToggle(toggleState, type) {\n switch (toggleState) {\n case '[Select all]':\n $(\".\".concat(type, \" .database input:not(:checked)\")).click();\n break;\n\n case '[Deselect all]':\n $(\".\".concat(type, \" .database input:checked\")).click();\n break;\n }\n\n this.forceUpdate();\n }\n }, {\n key: \"renderDatabases\",\n value: function renderDatabases(category) {\n // Panel name and column width.\n var panelTitle = category[0].toUpperCase() + category.substring(1).toLowerCase() + ' databases';\n var columnClass = this.categories().length === 1 ? 'col-md-12' : 'col-md-6'; // Toggle button.\n\n var toggleState = '[Select all]';\n var toggleClass = 'btn-link';\n var toggleShown = this.databases(category).length > 1;\n var toggleDisabled = this.state.type && this.state.type !== category;\n if (toggleShown && toggleDisabled) toggleClass += ' disabled';\n if (!toggleShown) toggleClass += ' hidden';\n\n if (this.nselected() === this.databases(category).length) {\n toggleState = '[Deselect all]';\n } // JSX.\n\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: columnClass,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: \"panel panel-default\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: \"panel-heading\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"h4\", {\n style: {\n display: 'inline'\n },\n children: panelTitle\n }), \" \\xA0\\xA0\", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"button\", {\n type: \"button\",\n className: toggleClass,\n disabled: toggleDisabled,\n onClick: function () {\n this.handleToggle(toggleState, category);\n }.bind(this),\n children: toggleState\n })]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"ul\", {\n className: 'list-group databases ' + category,\n children: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.databases(category), underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].bind(function (database, index) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"li\", {\n className: \"list-group-item\",\n children: this.renderDatabase(database)\n }, 'DB_' + category + index);\n }, this))\n })]\n })\n }, 'DB_' + category);\n }\n }, {\n key: \"renderDatabase\",\n value: function renderDatabase(database) {\n var disabled = this.state.type && this.state.type !== database.type;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"label\", {\n className: disabled && 'disabled database' || 'database',\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"input\", {\n type: \"checkbox\",\n name: \"databases[]\",\n value: database.id,\n \"data-type\": database.type,\n disabled: disabled,\n onChange: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].bind(function () {\n this.handleClick(database);\n }, this)\n }), ' ' + (database.title || database.name)]\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: \"form-group databases-container\",\n children: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.categories(), this.renderDatabases)\n });\n }\n }]);\n\n return Databases;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\n//# sourceURL=webpack://SequenceServer/./public/js/databases.js?"); /***/ }), /***/ "./public/js/databases_tree.js": /*!*************************************!*\ !*** ./public/js/databases_tree.js ***! \*************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _default)\n/* harmony export */ });\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 underscore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! underscore */ \"./node_modules/underscore/modules/index-all.js\");\n/* harmony import */ var jstree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jstree */ \"./node_modules/jstree/dist/jstree.js\");\n/* harmony import */ var jstree__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jstree__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _databases__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./databases */ \"./public/js/databases.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); 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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\nvar _default = /*#__PURE__*/function (_Databases) {\n _inherits(_default, _Databases);\n\n var _super = _createSuper(_default);\n\n function _default(props) {\n var _this;\n\n _classCallCheck(this, _default);\n\n _this = _super.call(this, props);\n _this.handleLoadTree = _this.handleLoadTree.bind(_assertThisInitialized(_this));\n _this.renderDatabases = _this.renderDatabases.bind(_assertThisInitialized(_this));\n _this.renderDatabaseSearch = _this.renderDatabaseSearch.bind(_assertThisInitialized(_this));\n _this.renderDatabaseTree = _this.renderDatabaseTree.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(_default, [{\n key: \"handleLoadTree\",\n value: function handleLoadTree(category) {\n var tree_id = '#' + category + '_database_tree'; // hack that is needed to sync the selected tree db with the hidden main db\n\n window.jstree_node_change_timeout = null; // when a tree database gets selected\n\n $(tree_id).on('select_node.jstree deselect_node.jstree', function (e, data) {\n if (window.jstree_node_change_timeout) {\n clearTimeout(window.jstree_node_change_timeout);\n window.jstree_node_change_timeout = null;\n }\n\n window.jstree_node_change_timeout = setTimeout(function () {\n // uncheck all input\n $('div#database_list input[type=\"checkbox\"]:checked').click();\n setTimeout(function () {\n // get all selected tree dbs. Also includes folders. Therefore, the id must have a length of 32\n // this id is used to find the corresponding element from the hidden main form\n var selected = $(tree_id).jstree('get_selected').filter(function (selected) {\n return selected.length == 32;\n });\n $.each(selected, function (index, value) {\n // select hidden element to trigger original sequenceserver behavior, like blast algorithm, ...\n $('input[value=\"' + value + '\"]').click();\n });\n }, 100);\n }, 100);\n });\n $(tree_id).jstree({\n 'core': {\n 'data': this.props.tree[category]\n },\n 'plugins': ['checkbox', 'search', 'sort'],\n 'checkbox': {\n 'keep_selected_style': false\n }\n });\n }\n }, {\n key: \"handleTreeSearch\",\n value: function handleTreeSearch(category, tree_id, search_id) {\n var search_for = $('#' + search_id).val();\n $('#' + tree_id).jstree(true).search(search_for);\n }\n }, {\n key: \"renderDatabases\",\n value: function renderDatabases(category) {\n // Panel name and column width.\n var panelTitle = category[0].toUpperCase() + category.substring(1).toLowerCase() + ' databases';\n var columnClass = this.categories().length === 1 ? 'col-md-12' : 'col-md-6'; // Toggle button.\n\n var toggleState = '[Select all]';\n var toggleClass = 'btn-link';\n var toggleShown = this.databases(category).length > 1;\n var toggleDisabled = this.state.type && this.state.type !== category;\n if (toggleShown && toggleDisabled) toggleClass += ' disabled';\n if (!toggleShown) toggleClass += ' hidden';\n\n if (this.nselected() === this.databases(category).length) {\n toggleState = '[Deselect all]';\n } // JSX.\n\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(\"div\", {\n className: columnClass,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(\"div\", {\n className: \"panel panel-default\",\n id: \"database_list\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(\"div\", {\n className: \"panel-heading\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"h4\", {\n style: {\n display: 'inline'\n },\n children: panelTitle\n }), \" \\xA0\\xA0\", this.renderDatabaseSearch(category), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"button\", {\n type: \"button\",\n className: toggleClass,\n disabled: toggleDisabled,\n style: {\n display: 'none'\n },\n onClick: function () {\n this.handleToggle(toggleState, category);\n }.bind(this),\n children: toggleState\n })]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"ul\", {\n className: 'list-group databases ' + category,\n style: {\n display: 'none'\n },\n children: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.databases(category), underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].bind(function (database, index) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"li\", {\n className: \"list-group-item\",\n children: this.renderDatabase(database)\n }, 'DB_' + category + index);\n }, this))\n })]\n }), this.renderDatabaseTree(category)]\n }, 'DB_' + category);\n }\n }, {\n key: \"renderDatabaseSearch\",\n value: function renderDatabaseSearch(category) {\n var tree_id = category + '_database_tree';\n var search_id = tree_id + '_search';\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"input\", {\n type: \"text\",\n id: search_id,\n \"class\": \"input\",\n onKeyUp: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].bind(function () {\n this.handleTreeSearch(category, tree_id, search_id);\n }, this)\n });\n }\n }, {\n key: \"renderDatabaseTree\",\n value: function renderDatabaseTree(category) {\n var tree_id = category + '_database_tree';\n var data = this.props.tree[category];\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n id: tree_id,\n className: 'jstree_div',\n onClick: underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].bind(function () {\n this.handleLoadTree(category);\n }, this)\n });\n }\n }]);\n\n return _default;\n}(_databases__WEBPACK_IMPORTED_MODULE_3__.Databases);\n\n\n\n//# sourceURL=webpack://SequenceServer/./public/js/databases_tree.js?"); /***/ }), /***/ "./public/js/dnd.js": /*!**************************!*\ !*** ./public/js/dnd.js ***! \**************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DnD\": () => (/* binding */ DnD)\n/* harmony export */ });\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_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); 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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n/** \n * Drag n drop widget.\n */\n\n\n\nvar DnD = /*#__PURE__*/function (_Component) {\n _inherits(DnD, _Component);\n\n var _super = _createSuper(DnD);\n\n function DnD(props) {\n var _this;\n\n _classCallCheck(this, DnD);\n\n _this = _super.call(this, props);\n _this.state = {\n query: null\n };\n return _this;\n }\n\n _createClass(DnD, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var self = this;\n var FASTA_FORMAT = /^>/;\n $(document).ready(function () {\n var tgtMarker = $('.dnd-overlay');\n\n var dndError = function dndError(id) {\n $('.dnd-error').hide();\n $('#' + id + '-notification').show();\n tgtMarker.effect('fade', 2500);\n };\n\n $(document).on('dragenter', function (evt) {\n // Do not activate DnD if a modal is active.\n if ($.modalActive()) return; // Based on http://stackoverflow.com/a/8494918/1205465.\n // Contrary to what the above link says, the snippet below can't\n // distinguish directories from files. We handle that on drop.\n\n var dt = evt.originalEvent.dataTransfer;\n var isFile = dt.types && (dt.types.indexOf && // Chrome and Safari\n dt.types.indexOf('Files') != -1 || dt.types.contains && // Firefox\n dt.types.contains('application/x-moz-file'));\n\n if (!isFile) {\n return;\n }\n\n $('.dnd-error').hide();\n tgtMarker.stop(true, true);\n tgtMarker.show();\n dt.effectAllowed = 'copy';\n\n if (self.state.query.isEmpty()) {\n $('.dnd-overlay-overwrite').hide();\n $('.dnd-overlay-drop').show('drop', {\n direction: 'down'\n }, 'fast');\n } else {\n $('.dnd-overlay-drop').hide();\n $('.dnd-overlay-overwrite').show('drop', {\n direction: 'down'\n }, 'fast');\n }\n }).on('dragleave', '.dnd-overlay', function (evt) {\n tgtMarker.hide();\n $('.dnd-overlay-drop').hide();\n $('.dnd-overlay-overwrite').hide();\n }).on('dragover', '.dnd-overlay', function (evt) {\n evt.originalEvent.dataTransfer.dropEffect = 'copy';\n evt.preventDefault();\n }).on('drop', '.dnd-overlay', function (evt) {\n evt.preventDefault();\n evt.stopPropagation();\n var indicator = $('#sequence-file');\n self.state.query.focus();\n var files = evt.originalEvent.dataTransfer.files;\n\n if (files.length > 1) {\n dndError('dnd-multi');\n return;\n }\n\n var file = files[0];\n\n if (file.size > 10 * 1048576) {\n dndError('dnd-large-file');\n return;\n }\n\n var reader = new FileReader();\n\n reader.onload = function (e) {\n var content = e.target.result;\n\n if (FASTA_FORMAT.test(content)) {\n indicator.text(file.name + ' ');\n self.state.query.value(content);\n tgtMarker.hide();\n } else {\n // apparently not FASTA\n dndError('dnd-format');\n }\n };\n\n reader.onerror = function (e) {\n // Couldn't read. Means dropped stuff wasn't FASTA file.\n dndError('dnd-format');\n };\n\n reader.readAsText(file);\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"dnd-overlay\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"container dnd-overlay-container\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"row\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"div\", {\n className: \"col-md-offset-2 col-md-10\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"p\", {\n className: \"dnd-overlay-drop\",\n style: {\n display: 'none'\n },\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"i\", {\n className: \"fa fa-2x fa-file-o\"\n }), \"Drop query sequence file here\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"p\", {\n className: \"dnd-overlay-overwrite\",\n style: {\n display: 'none'\n },\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"i\", {\n className: \"fa fa-2x fa-file-o\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"span\", {\n style: {\n color: 'red'\n },\n children: \"Overwrite\"\n }), \" query sequence file\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(\"div\", {\n className: \"dnd-errors\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"dnd-error row\",\n id: \"dnd-multi-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"col-md-6 col-md-offset-3\",\n children: \"One file at a time please.\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"dnd-error row\",\n id: \"dnd-large-file-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"col-md-6 col-md-offset-3\",\n children: \"Too big a file. Can only do less than 10 MB. >_<\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"dnd-error row\",\n id: \"dnd-format-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"div\", {\n className: \"col-md-6 col-md-offset-3\",\n children: \"Only FASTA files please.\"\n })\n })]\n })]\n })\n })\n })\n });\n }\n }]);\n\n return DnD;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\n//# sourceURL=webpack://SequenceServer/./public/js/dnd.js?"); /***/ }), /***/ "./public/js/exporter.js": /*!*******************************!*\ !*** ./public/js/exporter.js ***! \*******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"download_blob\": () => (/* binding */ download_blob),\n/* harmony export */ \"download_url\": () => (/* binding */ download_url),\n/* harmony export */ \"generate_blob_url\": () => (/* binding */ generate_blob_url),\n/* harmony export */ \"sanitize_filename\": () => (/* binding */ sanitize_filename)\n/* harmony export */ });\nfunction download_url(url, filename) {\n var a = d3.select('body').append('a').attr('download', filename).style('display', 'none').attr('href', url);\n a.node().click();\n setTimeout(function () {\n a.remove();\n }, 100);\n}\nfunction generate_blob_url(blob) {\n var url = window.URL.createObjectURL(blob);\n return url;\n}\nfunction download_blob(blob, filename) {\n if (typeof window.navigator.msSaveOrOpenBlob !== 'undefined') {\n window.navigator.msSaveOrOpenBlob(blob, filename);\n } else {\n download_url(generate_blob_url(blob), filename);\n }\n}\nfunction sanitize_filename(str) {\n var san = str.replace(/[^a-zA-Z0-9=_\\-]/g, '_'); // Replace runs of underscores with single one.\n\n san = san.replace(/_{2,}/g, '_'); // Remove any leading or trailing underscores.\n\n san = san.replace(/^_/, '').replace(/_$/, '');\n return san;\n}\n\n//# sourceURL=webpack://SequenceServer/./public/js/exporter.js?"); /***/ }), /***/ "./public/js/form.js": /*!***************************!*\ !*** ./public/js/form.js ***! \***************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Form\": () => (/* binding */ Form)\n/* harmony export */ });\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 _search_button__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./search_button */ \"./public/js/search_button.js\");\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./query */ \"./public/js/query.js\");\n/* harmony import */ var _databases_tree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./databases_tree */ \"./public/js/databases_tree.js\");\n/* harmony import */ var _databases__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./databases */ \"./public/js/databases.js\");\n/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! underscore */ \"./node_modules/underscore/modules/index-all.js\");\n/* harmony import */ var _options__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./options */ \"./public/js/options.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); 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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n\n\n/**\n * Search form.\n *\n * Top level component that initialises and holds all other components, and\n * facilitates communication between them.\n */\n\n\n\nvar Form = /*#__PURE__*/function (_Component) {\n _inherits(Form, _Component);\n\n var _super = _createSuper(Form);\n\n function Form(props) {\n var _this;\n\n _classCallCheck(this, Form);\n\n _this = _super.call(this, props);\n _this.state = {\n databases: [],\n preDefinedOpts: {},\n tree: {}\n };\n _this.useTreeWidget = _this.useTreeWidget.bind(_assertThisInitialized(_this));\n _this.determineBlastMethod = _this.determineBlastMethod.bind(_assertThisInitialized(_this));\n _this.handleSequenceTypeChanged = _this.handleSequenceTypeChanged.bind(_assertThisInitialized(_this));\n _this.handleDatabaseTypeChanaged = _this.handleDatabaseTypeChanaged.bind(_assertThisInitialized(_this));\n _this.handleAlgoChanged = _this.handleAlgoChanged.bind(_assertThisInitialized(_this));\n _this.handleFormSubmission = _this.handleFormSubmission.bind(_assertThisInitialized(_this));\n _this.formRef = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)();\n return _this;\n }\n\n _createClass(Form, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n /** \n * Fetch data to initialise the search interface from the server. These\n * include list of databases to search against, advanced options to\n * apply when an algorithm is selected, and a query sequence that\n * the user may want to search in the databases.\n */\n var search = location.search.split(/\\?|&/).filter(Boolean);\n var job_id = sessionStorage.getItem('job_id');\n\n if (job_id) {\n search.unshift(\"job_id=\".concat(job_id));\n }\n\n $.getJSON(\"searchdata.json?\".concat(search.join('&')), function (data) {\n /* Update form state (i.e., list of databases and predefined\n * advanced options.\n */\n this.setState({\n tree: data['tree'],\n databases: data['database'],\n preSelectedDbs: data['preSelectedDbs'],\n preDefinedOpts: data['options']\n });\n /* Pre-populate the form with server sent query sequences\n * (if any).\n */\n\n if (data['query']) {\n this.refs.query.value(data['query']);\n }\n\n setTimeout(function () {\n $('.jstree_div').click();\n }, 1000);\n }.bind(this));\n /* Enable submitting form on Cmd+Enter */\n\n $(document).on('keydown', function (e) {\n var $button = $('#method');\n\n if (!$button.is(':disabled') && e.ctrlKey && e.key === 'Enter') {\n $button.trigger('click');\n }\n }); // show overlay to create visual feedback on button click \n\n $('#method').on('click', function () {\n $('#overlay').css('display', 'block');\n });\n }\n }, {\n key: \"useTreeWidget\",\n value: function useTreeWidget() {\n return !underscore__WEBPACK_IMPORTED_MODULE_5__[\"default\"].isEmpty(this.state.tree);\n }\n }, {\n key: \"handleFormSubmission\",\n value: function handleFormSubmission(evt) {\n evt.preventDefault();\n var form = this.formRef.current;\n var formData = new FormData(form);\n formData.append('method', this.refs.button.state.methods[0]);\n fetch(window.location.href, {\n method: 'POST',\n body: formData\n }).then(function (res) {\n //remove overlay when form is submitted\n $('#overlay').css('display', 'none'); // redirect\n\n if (res.redirected && res.url) {\n // setTimeout is needed here as a workaround because safari doesnt allow async calling of window.open\n // so setTimeout makes the method get called on the main thread.\n setTimeout(function () {\n window.open(res.url, $('#toggleNewTab').is(':checked') ? '_blank' : '_self');\n }, 0);\n }\n });\n }\n }, {\n key: \"determineBlastMethod\",\n value: function determineBlastMethod() {\n var database_type = this.databaseType;\n var sequence_type = this.sequenceType;\n\n if (this.refs.query.isEmpty()) {\n return [];\n } //database type is always known\n\n\n switch (database_type) {\n case 'protein':\n switch (sequence_type) {\n case undefined:\n return ['blastp', 'blastx'];\n\n case 'protein':\n return ['blastp'];\n\n case 'nucleotide':\n return ['blastx'];\n }\n\n break;\n\n case 'nucleotide':\n switch (sequence_type) {\n case undefined:\n return ['tblastn', 'blastn', 'tblastx'];\n\n case 'protein':\n return ['tblastn'];\n\n case 'nucleotide':\n return ['blastn', 'tblastx'];\n }\n\n break;\n }\n\n return [];\n }\n }, {\n key: \"handleSequenceTypeChanged\",\n value: function handleSequenceTypeChanged(type) {\n this.sequenceType = type;\n this.refs.button.setState({\n hasQuery: !this.refs.query.isEmpty(),\n hasDatabases: !!this.databaseType,\n methods: this.determineBlastMethod()\n });\n }\n }, {\n key: \"handleDatabaseTypeChanaged\",\n value: function handleDatabaseTypeChanaged(type) {\n this.databaseType = type;\n this.refs.button.setState({\n hasQuery: !this.refs.query.isEmpty(),\n hasDatabases: !!this.databaseType,\n methods: this.determineBlastMethod()\n });\n }\n }, {\n key: \"handleAlgoChanged\",\n value: function handleAlgoChanged(algo) {\n if (algo in this.state.preDefinedOpts) {\n var preDefinedOpts = this.state.preDefinedOpts[algo];\n this.refs.opts.setState({\n method: algo,\n preOpts: preDefinedOpts,\n value: (preDefinedOpts['last search'] || preDefinedOpts['default']).join(' ')\n });\n } else {\n this.refs.opts.setState({\n preOpts: {},\n value: '',\n method: ''\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(\"div\", {\n className: \"container\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n id: \"overlay\",\n style: {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100vw',\n height: '100vw',\n background: 'rgba(0, 0, 0, 0.2)',\n display: 'none',\n zIndex: 99\n }\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(\"form\", {\n id: \"blast\",\n ref: this.formRef,\n onSubmit: this.handleFormSubmission,\n className: \"form-horizontal\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"form-group query-container\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_query__WEBPACK_IMPORTED_MODULE_2__.SearchQueryWidget, {\n ref: \"query\",\n onSequenceTypeChanged: this.handleSequenceTypeChanged\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(\"div\", {\n className: \"notifications\",\n id: \"notifications\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(NucleotideNotification, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(ProteinNotification, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(MixedNotification, {})]\n }), this.useTreeWidget() ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_databases_tree__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n ref: \"databases\",\n databases: this.state.databases,\n tree: this.state.tree,\n preSelectedDbs: this.state.preSelectedDbs,\n onDatabaseTypeChanged: this.handleDatabaseTypeChanaged\n }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_databases__WEBPACK_IMPORTED_MODULE_4__.Databases, {\n ref: \"databases\",\n databases: this.state.databases,\n preSelectedDbs: this.state.preSelectedDbs,\n onDatabaseTypeChanged: this.handleDatabaseTypeChanaged\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(\"div\", {\n className: \"form-group\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_options__WEBPACK_IMPORTED_MODULE_6__.Options, {\n ref: \"opts\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"col-md-2\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"form-group\",\n style: {\n 'textAlign': 'center',\n 'padding': '7px 0'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(\"label\", {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"input\", {\n type: \"checkbox\",\n id: \"toggleNewTab\"\n }), \" Open results in new tab\"]\n })\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_search_button__WEBPACK_IMPORTED_MODULE_1__.SearchButton, {\n ref: \"button\",\n onAlgoChanged: this.handleAlgoChanged\n })]\n })]\n })]\n });\n }\n }]);\n\n return Form;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\nvar ProteinNotification = /*#__PURE__*/function (_Component2) {\n _inherits(ProteinNotification, _Component2);\n\n var _super2 = _createSuper(ProteinNotification);\n\n function ProteinNotification() {\n _classCallCheck(this, ProteinNotification);\n\n return _super2.apply(this, arguments);\n }\n\n _createClass(ProteinNotification, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"notification row\",\n id: \"protein-sequence-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"alert-info col-md-6 col-md-offset-3\",\n children: \"Detected: amino-acid sequence(s).\"\n })\n });\n }\n }]);\n\n return ProteinNotification;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\nvar NucleotideNotification = /*#__PURE__*/function (_Component3) {\n _inherits(NucleotideNotification, _Component3);\n\n var _super3 = _createSuper(NucleotideNotification);\n\n function NucleotideNotification() {\n _classCallCheck(this, NucleotideNotification);\n\n return _super3.apply(this, arguments);\n }\n\n _createClass(NucleotideNotification, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"notification row\",\n id: \"nucleotide-sequence-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"alert-info col-md-6 col-md-offset-3\",\n children: \"Detected: nucleotide sequence(s).\"\n })\n });\n }\n }]);\n\n return NucleotideNotification;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\nvar MixedNotification = /*#__PURE__*/function (_Component4) {\n _inherits(MixedNotification, _Component4);\n\n var _super4 = _createSuper(MixedNotification);\n\n function MixedNotification() {\n _classCallCheck(this, MixedNotification);\n\n return _super4.apply(this, arguments);\n }\n\n _createClass(MixedNotification, [{\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"notification row\",\n id: \"mixed-sequence-notification\",\n style: {\n display: 'none'\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(\"div\", {\n className: \"alert-danger col-md-10 col-md-offset-1\",\n children: \"Error: mixed nucleotide and amino-acid sequences detected.\"\n })\n });\n }\n }]);\n\n return MixedNotification;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\n//# sourceURL=webpack://SequenceServer/./public/js/form.js?"); /***/ }), /***/ "./public/js/grapher.js": /*!******************************!*\ !*** ./public/js/grapher.js ***! \******************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Grapher)\n/* harmony export */ });\n/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! underscore */ \"./node_modules/underscore/modules/index-all.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _svgExporter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./svgExporter */ \"./public/js/svgExporter.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\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 } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); 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 _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n // create handlers for SVG and PNG download buttons\n// Each instance of Grapher is added to this object once the component has been\n// mounted. This is so that grapher can be iterated over and redrawn on window\n// resize event.\n\n\n\nvar Graphers = {}; // Grapher is a function that takes a Graph class and returns a React component.\n// This React component provides HTML boilerplate to add heading, to make the\n// graphs collapsible, to redraw graphs when window is resized, and SVG and PNG\n// export buttons and functionality.\n\nfunction Grapher(Graph) {\n return /*#__PURE__*/function (_React$Component) {\n _inherits(_class, _React$Component);\n\n var _super = _createSuper(_class);\n\n function _class(props) {\n var _this;\n\n _classCallCheck(this, _class);\n\n _this = _super.call(this, props);\n _this.state = {\n collapsed: _this.props.collapsed\n };\n _this.svgContainerRef = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createRef)();\n return _this;\n }\n\n _createClass(_class, [{\n key: \"collapseId\",\n value: function collapseId() {\n return Graph.collapseId(this.props);\n }\n }, {\n key: \"render\",\n value: function render() {\n var cssClasses = Graph.className() + \" grapher\";\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n ref: \"grapher\",\n className: cssClasses,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: \"grapher-header\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"h4\", {\n className: \"caption\",\n \"data-toggle\": \"collapse\",\n \"data-target\": \"#\" + this.collapseId(),\n children: [this.state.collapsed ? this.plusIcon() : this.minusIcon(), \"\\xA0\", Graph.name()]\n }), !this.state.collapsed && this.graphLinksJSX()]\n }), this.svgContainerJSX()]\n });\n }\n }, {\n key: \"minusIcon\",\n value: function minusIcon() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"i\", {\n className: \"fa fa-minus-square-o\"\n });\n }\n }, {\n key: \"plusIcon\",\n value: function plusIcon() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"i\", {\n className: \"fa fa-plus-square-o\"\n });\n }\n }, {\n key: \"graphLinksJSX\",\n value: function graphLinksJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: \"hit-links graph-links\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link export-to-svg\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"i\", {\n className: \"fa fa-download\"\n }), \" SVG\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"span\", {\n className: \"line\",\n children: \"|\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link export-to-png\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"i\", {\n className: \"fa fa-download\"\n }), \" PNG\"]\n })]\n });\n }\n }, {\n key: \"svgContainerJSX\",\n value: function svgContainerJSX() {\n var cssClasses = Graph.className() + \" svg-container collapse\";\n if (!this.state.collapsed) cssClasses += \" in\";\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n ref: this.svgContainerRef,\n id: this.collapseId(),\n className: cssClasses\n });\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n Graphers[this.collapseId()] = this; // Draw visualisation for the first time. Visualisations are\n // redrawn when browser window is resized.\n\n this.draw();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n // Re-draw visualisation when the component change state.\n this.draw();\n }\n }, {\n key: \"svgContainer\",\n value: function svgContainer() {\n return $(this.svgContainerRef.current);\n }\n }, {\n key: \"draw\",\n value: function draw() {\n // Clean slate.\n this.svgContainer().empty();\n this.graph = null; // Draw if uncollapsed.\n\n if (this.state.collapsed) {\n return;\n }\n\n this.graph = new Graph(this.svgContainer(), this.props);\n this.svgContainer().find(\"svg\").attr(\"data-name\", Graph.dataName(this.props));\n }\n }]);\n\n return _class;\n }((react__WEBPACK_IMPORTED_MODULE_1___default().Component));\n} // Redraw if window resized.\n\n$(window).resize(underscore__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debounce(function () {\n underscore__WEBPACK_IMPORTED_MODULE_0__[\"default\"].each(Graphers, function (grapher) {\n grapher.draw();\n });\n}, 125)); // Swap-icon and toggle .graph-links on collapse.\n\n$(\"body\").on(\"hidden.bs.collapse\", \".collapse\", function () {\n var component = Graphers[$(this).attr(\"id\")];\n\n if (component) {\n component.setState({\n collapsed: true\n });\n }\n});\n$(\"body\").on(\"shown.bs.collapse\", \".collapse\", function () {\n var component = Graphers[$(this).attr(\"id\")];\n\n if (component) {\n component.setState({\n collapsed: false\n });\n }\n});\n\n//# sourceURL=webpack://SequenceServer/./public/js/grapher.js?"); /***/ }), /***/ "./public/js/hits_overview.js": /*!************************************!*\ !*** ./public/js/hits_overview.js ***! \************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ \"./node_modules/d3/d3.js\");\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! underscore */ \"./node_modules/underscore/modules/index-all.js\");\n/* harmony import */ var _grapher__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./grapher */ \"./public/js/grapher.js\");\n/* harmony import */ var _visualisation_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./visualisation_helpers */ \"./public/js/visualisation_helpers.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./public/js/utils.js\");\n/* provided dependency */ var $ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\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); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n\n\n\n\n\n\nvar Graph = /*#__PURE__*/function () {\n function Graph($svgContainer, props) {\n _classCallCheck(this, Graph);\n\n this.svg_container = $svgContainer;\n var $queryDiv = $svgContainer.parents('.resultn');\n var hits = this.extractData(props.query.hits, props.query.number);\n this.graphIt($queryDiv, $svgContainer, 0, 20, null, hits);\n }\n\n _createClass(Graph, [{\n key: \"extractData\",\n value: function extractData(query_hits, number) {\n var hits = [];\n query_hits.map(function (hit) {\n var _hsps = [];\n var hsps = hit.hsps;\n\n underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].each(hsps, function (hsp) {\n var _hsp = {};\n _hsp.hspEvalue = hsp.evalue;\n _hsp.hspStart = hsp.qstart;\n _hsp.hspEnd = hsp.qend;\n _hsp.hspFrame = hsp.sframe;\n _hsp.hspId = 'Query_' + number + '_hit_' + hit.number + '_hsp_' + hsp.number;\n _hsp.hspIdentity = hsp.identity;\n _hsp.hspGaps = hsp.gaps;\n _hsp.hspPositives = hsp.positives;\n _hsp.hspLength = hsp.length;\n\n _hsps.push(_hsp);\n });\n\n _hsps.hitId = hit.id;\n _hsps.hitDef = 'Query_' + number + '_hit_' + hit.number;\n _hsps.hitEvalue = hit.hsps[0].evalue;\n hits.push(_hsps);\n });\n return hits;\n }\n }, {\n key: \"setupTooltip\",\n value: function setupTooltip() {\n this.svg_container.find('[data-toggle=\"tooltip\"]').tooltip({\n 'placement': 'top',\n 'container': 'body',\n 'html': 'true',\n 'delay': 0,\n 'white-space': 'nowrap'\n });\n }\n }, {\n key: \"setupClick\",\n value: function setupClick($graphDiv) {\n $('a', $graphDiv).click(function (evt) {\n evt.preventDefault();\n evt.stopPropagation();\n window.location.hash = $(this).attr('href');\n });\n }\n }, {\n key: \"graphControls\",\n value: function graphControls($queryDiv, $graphDiv, isInit, opts, hits) {\n var MIN_HITS_TO_SHOW = 20;\n var totalHits, shownHits, lessButton, moreButton;\n\n var countHits = function countHits() {\n totalHits = hits.length;\n shownHits = $queryDiv.find('.ghit > g').length;\n };\n\n var setupButtons = function setupButtons($queryDiv, $graphDiv) {\n $graphDiv.append($('