diff --git a/public/js/sidebar.js b/public/js/sidebar.js index f2f4a0f3..76578a5e 100644 --- a/public/js/sidebar.js +++ b/public/js/sidebar.js @@ -1,4 +1,5 @@ -import { Component } from 'react'; +// eslint-disable-next-line no-unused-vars +import { Component, Fragment } from 'react'; import _ from 'underscore'; import downloadFASTA from './download_fasta'; @@ -353,6 +354,7 @@ export default class extends Component { } sharingPanelJSX() { + const link_class = 'btn-link cursor-pointer'; return (
@@ -361,29 +363,30 @@ export default class extends Component {
{ diff --git a/public/sequenceserver-report.min.js b/public/sequenceserver-report.min.js index 841723cc..2bc3421c 100644 --- a/public/sequenceserver-report.min.js +++ b/public/sequenceserver-report.min.js @@ -236,7 +236,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__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 _download_fasta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./download_fasta */ \"./public/js/download_fasta.js\");\n/* harmony import */ var _mailto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mailto */ \"./public/js/mailto.js\");\n/* harmony import */ var _cloud_share_modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloud_share_modal */ \"./public/js/cloud_share_modal.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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 * checks whether code is being run by jest\n */\n// eslint-disable-next-line no-undef\n\n\n\n\n\nvar isTestMode = function isTestMode() {\n return ({}).JEST_WORKER_ID !== undefined || \"development\" === 'test';\n};\n/**\n * Renders links for downloading hit information in different formats.\n * Renders links for navigating to each query.\n */\n\n\nvar _default = /*#__PURE__*/function (_Component) {\n _inherits(_default, _Component);\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.downloadFastaOfAll = _this.downloadFastaOfAll.bind(_assertThisInitialized(_this));\n _this.downloadFastaOfSelected = _this.downloadFastaOfSelected.bind(_assertThisInitialized(_this));\n _this.topPanelJSX = _this.topPanelJSX.bind(_assertThisInitialized(_this));\n _this.summaryString = _this.summaryString.bind(_assertThisInitialized(_this));\n _this.indexJSX = _this.indexJSX.bind(_assertThisInitialized(_this));\n _this.downloadsPanelJSX = _this.downloadsPanelJSX.bind(_assertThisInitialized(_this));\n _this.handleQueryIndexChange = _this.handleQueryIndexChange.bind(_assertThisInitialized(_this));\n _this.isElementInViewPort = _this.isElementInViewPort.bind(_assertThisInitialized(_this));\n _this.setVisibleQueryIndex = _this.setVisibleQueryIndex.bind(_assertThisInitialized(_this));\n _this.debounceScrolling = _this.debounceScrolling.bind(_assertThisInitialized(_this));\n _this.scrollListener = _this.scrollListener.bind(_assertThisInitialized(_this));\n _this.copyURL = _this.copyURL.bind(_assertThisInitialized(_this));\n _this.shareCloudInit = _this.shareCloudInit.bind(_assertThisInitialized(_this));\n _this.sharingPanelJSX = _this.sharingPanelJSX.bind(_assertThisInitialized(_this));\n _this.timeout = null;\n _this.queryElems = [];\n _this.state = {\n queryIndex: 1\n };\n return _this;\n }\n\n _createClass(_default, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n /**\n * Fixes tooltips in the sidebar, allows tooltip display on click\n */\n $(function () {\n $('.sidebar [data-toggle=\"tooltip\"]').tooltip({\n placement: 'right'\n });\n $('#copyURL').tooltip({\n title: 'Copied!',\n trigger: 'click',\n placement: 'right',\n delay: 0\n });\n }); //keep track of the current queryIndex so it doesn't get lost on page reload\n\n var urlMatch = window.location.href.match(/#Query_(\\d+)/);\n\n if (urlMatch && urlMatch.length > 1) {\n var queryNumber = +urlMatch[1];\n var index = this.props.data.queries.findIndex(function (query) {\n return query.number === queryNumber;\n });\n this.setState({\n queryIndex: index + 1\n });\n }\n\n window.addEventListener('scroll', this.scrollListener);\n $('a[href^=\"#Query_\"]').on('click', this.animateAnchorElements);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('scroll', this.scrollListener);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.allQueriesLoaded && !prevProps.allQueriesLoaded) {\n /**\n * storing all query elements in this variable once they all become available so we don't have to fetch them all over again\n */\n this.queryElems = Array.from(document.querySelectorAll('.resultn'));\n }\n }\n /**\n * to avoid unnecessary computations, we debounce the scroll listener so it only fires after user has stopped scrolling for some milliseconds\n */\n\n }, {\n key: \"scrollListener\",\n value: function scrollListener() {\n this.debounceScrolling(this.setVisibleQueryIndex, 500);\n }\n }, {\n key: \"debounceScrolling\",\n value: function debounceScrolling(callback, timer) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n\n this.timeout = setTimeout(callback, timer);\n }\n /**\n * This method makes the page aware of what query is visible so that clicking previous / next button at any point\n * navigates to the proper query\n */\n\n }, {\n key: \"setVisibleQueryIndex\",\n value: function setVisibleQueryIndex() {\n var queryElems = this.queryElems.length ? this.queryElems : Array.from(document.querySelectorAll('.resultn'));\n var hits = Array.from(document.querySelectorAll('.hit[id^=Query_]')); // get the first visible element and marks it as the current query\n\n var topmostEl = queryElems.find(this.isElementInViewPort) || hits.find(this.isElementInViewPort);\n\n if (topmostEl) {\n var queryIndex = Number(topmostEl.id.match(/Query_(\\d+)/)[1]);\n var hash = \"#Query_\".concat(queryIndex); // if we can guarantee that the browser can handle change in url hash without the page jumping,\n // then we update the url hash after scroll. else, hash is only updated on click of next or prev button\n\n if (window.history.pushState) {\n window.history.pushState(null, null, hash);\n }\n\n this.setState({\n queryIndex: queryIndex\n });\n }\n }\n }, {\n key: \"animateAnchorElements\",\n value: function animateAnchorElements(e) {\n // allow normal behavior in test mode to prevent warnings or errors from jquery\n if (isTestMode()) return;\n e.preventDefault();\n $('html, body').animate({\n scrollTop: $(this.hash).offset().top\n }, 300);\n\n if (window.history.pushState) {\n window.history.pushState(null, null, this.hash);\n } else {\n window.location.hash = this.hash;\n }\n }\n }, {\n key: \"isElementInViewPort\",\n value: function isElementInViewPort(elem) {\n var _elem$getBoundingClie = elem.getBoundingClientRect(),\n top = _elem$getBoundingClie.top,\n left = _elem$getBoundingClie.left,\n right = _elem$getBoundingClie.right,\n bottom = _elem$getBoundingClie.bottom;\n\n return top >= 0 && left >= 0 && bottom <= (window.innerHeight || document.documentElement.clientHeight) && right <= (window.innerWidth || document.documentElement.clientWidth);\n }\n /**\n * Clear sessionStorage - useful to initiate a new search in the same tab.\n * Passing sessionStorage.clear directly as onclick callback didn't work\n * (on macOS Chrome).\n */\n\n }, {\n key: \"clearSession\",\n value: function clearSession() {\n sessionStorage.clear();\n }\n /**\n *\n * handle next and previous query button clicks\n */\n\n }, {\n key: \"handleQueryIndexChange\",\n value: function handleQueryIndexChange(nextQuery) {\n if (nextQuery < 1 || nextQuery > this.props.data.queries.length) return;\n var anchorEl = document.createElement('a'); //indexing at [nextQuery - 1] because array is 0-indexed\n\n anchorEl.setAttribute('href', '#Query_' + this.props.data.queries[nextQuery - 1].number);\n anchorEl.setAttribute('hidden', true);\n document.body.appendChild(anchorEl); // add smooth scrolling animation with jquery\n\n $(anchorEl).on('click', this.animateAnchorElements);\n anchorEl.click();\n document.body.removeChild(anchorEl);\n this.setState({\n queryIndex: nextQuery\n });\n }\n /**\n * Event-handler for downloading fasta of all hits.\n */\n\n }, {\n key: \"downloadFastaOfAll\",\n value: function downloadFastaOfAll() {\n var sequence_ids = [];\n this.props.data.queries.forEach(function (query) {\n return query.hits.forEach(function (hit) {\n return sequence_ids.push(hit.id);\n });\n });\n var database_ids = this.props.data.querydb.map(function (querydb) {\n return querydb.id;\n });\n (0,_download_fasta__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sequence_ids, database_ids);\n return false;\n }\n /**\n * Handles downloading fasta of selected hits.\n */\n\n }, {\n key: \"downloadFastaOfSelected\",\n value: function downloadFastaOfSelected() {\n var sequence_ids = $('.hit-links :checkbox:checked').map(function () {\n return this.value;\n }).get();\n\n var database_ids = underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.props.data.querydb, underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].iteratee('id'));\n\n (0,_download_fasta__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sequence_ids, database_ids);\n return false;\n }\n /**\n * Handles copying the URL into the user's clipboard. Modified from: https://stackoverflow.com/a/49618964/18117380\n * Hides the 'Copied!' tooltip after 3 seconds\n */\n\n }, {\n key: \"copyURL\",\n value: function copyURL() {\n var element = document.createElement('input');\n var url = window.location.href;\n document.body.appendChild(element);\n element.value = url;\n element.select();\n document.execCommand('copy');\n document.body.removeChild(element);\n setTimeout(function () {\n $('#copyURL')._tooltip('destroy');\n }, 3000);\n }\n }, {\n key: \"shareCloudInit\",\n value: function shareCloudInit() {\n this.refs.cloudShareModal.show();\n }\n }, {\n key: \"topPanelJSX\",\n value: function topPanelJSX() {\n var path = location.pathname.split('/'); // Get job id.\n\n var job_id = path.pop(); // Deriving rootURL this way is required for subURI deployments\n // - we cannot just send to '/'.\n\n var rootURL = path.join('/');\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sidebar-top-panel\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: this.summaryString()\n })\n }), this.props.data.queries.length > 12 && this.queryIndexButtons(), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"\".concat(rootURL, \"/?job_id=\").concat(job_id),\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-pencil\"\n }), \" Edit search\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"line\",\n children: \"|\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"\".concat(rootURL, \"/\"),\n onClick: this.clearSession,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-file-o\"\n }), \" New search\"]\n })]\n }), this.props.shouldShowIndex && this.indexJSX()]\n });\n }\n }, {\n key: \"summaryString\",\n value: function summaryString() {\n var program = this.props.data.program;\n var numqueries = this.props.data.queries.length;\n var numquerydb = this.props.data.querydb.length;\n return program.toUpperCase() + ': ' + numqueries + ' ' + (numqueries > 1 ? 'queries' : 'query') + ', ' + numquerydb + ' ' + (numquerydb > 1 ? 'databases' : 'database');\n }\n }, {\n key: \"queryIndexButtons\",\n value: function queryIndexButtons() {\n var _this2 = this;\n\n var buttonStyle = {\n outline: 'none',\n border: 'none',\n background: 'none'\n };\n var buttonClasses = 'btn-link nowrap-ellipsis hover-bold';\n\n var handlePreviousBtnClick = function handlePreviousBtnClick() {\n return _this2.handleQueryIndexChange(_this2.state.queryIndex - 1);\n };\n\n var handleNextBtnClick = function handleNextBtnClick() {\n return _this2.handleQueryIndexChange(_this2.state.queryIndex + 1);\n }; // eslint-disable-next-line no-unused-vars\n\n\n var NavButton = function NavButton(_ref) {\n var text = _ref.text,\n onClick = _ref.onClick;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"button\", {\n className: buttonClasses,\n onClick: onClick,\n style: buttonStyle,\n children: text\n });\n };\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n style: {\n display: 'flex',\n width: '100%',\n margin: '7px 0'\n },\n children: [this.state.queryIndex > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(NavButton, {\n text: \"Previous Query\",\n onClick: handlePreviousBtnClick\n }), this.state.queryIndex > 1 && this.state.queryIndex < this.props.data.queries.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"line\",\n children: \"|\"\n }), this.state.queryIndex < this.props.data.queries.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(NavButton, {\n onClick: handleNextBtnClick,\n text: \"Next Query\"\n })]\n });\n }\n }, {\n key: \"indexJSX\",\n value: function indexJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"ul\", {\n className: \"nav hover-reset active-bold\",\n children: [\" \", underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.props.data.queries, function (query) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link nowrap-ellipsis hover-bold\",\n title: 'Query= ' + query.id + ' ' + query.title,\n href: '#Query_' + query.number,\n children: 'Query= ' + query.id\n })\n }, 'Side_bar_' + query.id);\n })]\n });\n }\n }, {\n key: \"downloadsPanelJSX\",\n value: function downloadsPanelJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"downloads\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: \"Download FASTA, XML, TSV\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"ul\", {\n className: \"nav\",\n children: [!(this.props.data.imported_xml || this.props.data.non_parse_seqids) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n href: \"#\",\n className: \"btn-link download-fasta-of-all \".concat(!this.props.atLeastOneHit && 'disabled'),\n onClick: this.downloadFastaOfAll,\n children: \"FASTA of all hits\"\n })\n }), !(this.props.data.imported_xml || this.props.data.non_parse_seqids) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link download-fasta-of-selected disabled\",\n onClick: this.downloadFastaOfSelected,\n children: [\"FASTA of \", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"text-bold\"\n }), \" selected hit(s)\"]\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n href: \"#\",\n className: \"btn-link download-alignment-of-all \".concat(!this.props.atLeastOneHit && 'disabled'),\n children: \"Alignment of all hits\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link download-alignment-of-selected disabled\",\n children: [\"Alignment of \", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"text-bold\"\n }), \" selected hit(s)\"]\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"15 columns: query and subject ID; scientific name, alignment length, mismatches, gaps, identity, start and end coordinates, e value, bitscore, query coverage per subject and per HSP.\",\n href: 'download/' + this.props.data.search_id + '.std_tsv',\n children: \"Standard tabular report\"\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"44 columns: query and subject ID, GI, accessions, and length; alignment details; taxonomy details of subject sequence(s) and query coverage per subject and per HSP.\",\n href: 'download/' + this.props.data.search_id + '.full_tsv',\n children: \"Full tabular report\"\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"Results in XML format.\",\n href: 'download/' + this.props.data.search_id + '.xml',\n children: \"Full XML report\"\n })\n })]\n })]\n });\n }\n }, {\n key: \"sharingPanelJSX\",\n value: function sharingPanelJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sharing-panel\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: \"Share results\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"ul\", {\n className: \"nav\",\n children: !this.props.cloudSharingEnabled ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n id: \"copyURL\",\n className: \"btn-link copy-URL cursor-pointer\",\n \"data-toggle\": \"tooltip\",\n onClick: this.copyURL,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-copy\"\n }), \" Copy URL to clipboard\"]\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n id: \"sendEmail\",\n className: \"btn-link email-URL cursor-pointer\",\n \"data-toggle\": \"tooltip\",\n title: \"Send by email\",\n href: (0,_mailto__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href),\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-envelope\"\n }), \" Send by email\"]\n })\n })]\n }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"button\", {\n className: \"btn-link cloud-Post cursor-pointer\",\n \"data-toggle\": \"tooltip\",\n title: \"Upload results to SequenceServer Cloud where it will become accessable to everyone who has a link.\",\n onClick: this.shareCloudInit,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-cloud\"\n }), \" Share to cloud\"]\n })\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_cloud_share_modal__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n ref: \"cloudShareModal\",\n querydb: this.props.data.querydb,\n program: this.props.data.program,\n queries: this.props.data.queries\n })]\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sidebar\",\n children: [this.topPanelJSX(), this.downloadsPanelJSX(), this.sharingPanelJSX()]\n });\n }\n }]);\n\n return _default;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\n\n\n//# sourceURL=webpack://SequenceServer/./public/js/sidebar.js?"); +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 _download_fasta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./download_fasta */ \"./public/js/download_fasta.js\");\n/* harmony import */ var _mailto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mailto */ \"./public/js/mailto.js\");\n/* harmony import */ var _cloud_share_modal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloud_share_modal */ \"./public/js/cloud_share_modal.js\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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// eslint-disable-next-line no-unused-vars\n\n\n\n\n\n/**\n * checks whether code is being run by jest\n */\n// eslint-disable-next-line no-undef\n\n\n\n\nvar isTestMode = function isTestMode() {\n return ({}).JEST_WORKER_ID !== undefined || \"development\" === 'test';\n};\n/**\n * Renders links for downloading hit information in different formats.\n * Renders links for navigating to each query.\n */\n\n\nvar _default = /*#__PURE__*/function (_Component) {\n _inherits(_default, _Component);\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.downloadFastaOfAll = _this.downloadFastaOfAll.bind(_assertThisInitialized(_this));\n _this.downloadFastaOfSelected = _this.downloadFastaOfSelected.bind(_assertThisInitialized(_this));\n _this.topPanelJSX = _this.topPanelJSX.bind(_assertThisInitialized(_this));\n _this.summaryString = _this.summaryString.bind(_assertThisInitialized(_this));\n _this.indexJSX = _this.indexJSX.bind(_assertThisInitialized(_this));\n _this.downloadsPanelJSX = _this.downloadsPanelJSX.bind(_assertThisInitialized(_this));\n _this.handleQueryIndexChange = _this.handleQueryIndexChange.bind(_assertThisInitialized(_this));\n _this.isElementInViewPort = _this.isElementInViewPort.bind(_assertThisInitialized(_this));\n _this.setVisibleQueryIndex = _this.setVisibleQueryIndex.bind(_assertThisInitialized(_this));\n _this.debounceScrolling = _this.debounceScrolling.bind(_assertThisInitialized(_this));\n _this.scrollListener = _this.scrollListener.bind(_assertThisInitialized(_this));\n _this.copyURL = _this.copyURL.bind(_assertThisInitialized(_this));\n _this.shareCloudInit = _this.shareCloudInit.bind(_assertThisInitialized(_this));\n _this.sharingPanelJSX = _this.sharingPanelJSX.bind(_assertThisInitialized(_this));\n _this.timeout = null;\n _this.queryElems = [];\n _this.state = {\n queryIndex: 1\n };\n return _this;\n }\n\n _createClass(_default, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n /**\n * Fixes tooltips in the sidebar, allows tooltip display on click\n */\n $(function () {\n $('.sidebar [data-toggle=\"tooltip\"]').tooltip({\n placement: 'right'\n });\n $('#copyURL').tooltip({\n title: 'Copied!',\n trigger: 'click',\n placement: 'right',\n delay: 0\n });\n }); //keep track of the current queryIndex so it doesn't get lost on page reload\n\n var urlMatch = window.location.href.match(/#Query_(\\d+)/);\n\n if (urlMatch && urlMatch.length > 1) {\n var queryNumber = +urlMatch[1];\n var index = this.props.data.queries.findIndex(function (query) {\n return query.number === queryNumber;\n });\n this.setState({\n queryIndex: index + 1\n });\n }\n\n window.addEventListener('scroll', this.scrollListener);\n $('a[href^=\"#Query_\"]').on('click', this.animateAnchorElements);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n window.removeEventListener('scroll', this.scrollListener);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.allQueriesLoaded && !prevProps.allQueriesLoaded) {\n /**\n * storing all query elements in this variable once they all become available so we don't have to fetch them all over again\n */\n this.queryElems = Array.from(document.querySelectorAll('.resultn'));\n }\n }\n /**\n * to avoid unnecessary computations, we debounce the scroll listener so it only fires after user has stopped scrolling for some milliseconds\n */\n\n }, {\n key: \"scrollListener\",\n value: function scrollListener() {\n this.debounceScrolling(this.setVisibleQueryIndex, 500);\n }\n }, {\n key: \"debounceScrolling\",\n value: function debounceScrolling(callback, timer) {\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n\n this.timeout = setTimeout(callback, timer);\n }\n /**\n * This method makes the page aware of what query is visible so that clicking previous / next button at any point\n * navigates to the proper query\n */\n\n }, {\n key: \"setVisibleQueryIndex\",\n value: function setVisibleQueryIndex() {\n var queryElems = this.queryElems.length ? this.queryElems : Array.from(document.querySelectorAll('.resultn'));\n var hits = Array.from(document.querySelectorAll('.hit[id^=Query_]')); // get the first visible element and marks it as the current query\n\n var topmostEl = queryElems.find(this.isElementInViewPort) || hits.find(this.isElementInViewPort);\n\n if (topmostEl) {\n var queryIndex = Number(topmostEl.id.match(/Query_(\\d+)/)[1]);\n var hash = \"#Query_\".concat(queryIndex); // if we can guarantee that the browser can handle change in url hash without the page jumping,\n // then we update the url hash after scroll. else, hash is only updated on click of next or prev button\n\n if (window.history.pushState) {\n window.history.pushState(null, null, hash);\n }\n\n this.setState({\n queryIndex: queryIndex\n });\n }\n }\n }, {\n key: \"animateAnchorElements\",\n value: function animateAnchorElements(e) {\n // allow normal behavior in test mode to prevent warnings or errors from jquery\n if (isTestMode()) return;\n e.preventDefault();\n $('html, body').animate({\n scrollTop: $(this.hash).offset().top\n }, 300);\n\n if (window.history.pushState) {\n window.history.pushState(null, null, this.hash);\n } else {\n window.location.hash = this.hash;\n }\n }\n }, {\n key: \"isElementInViewPort\",\n value: function isElementInViewPort(elem) {\n var _elem$getBoundingClie = elem.getBoundingClientRect(),\n top = _elem$getBoundingClie.top,\n left = _elem$getBoundingClie.left,\n right = _elem$getBoundingClie.right,\n bottom = _elem$getBoundingClie.bottom;\n\n return top >= 0 && left >= 0 && bottom <= (window.innerHeight || document.documentElement.clientHeight) && right <= (window.innerWidth || document.documentElement.clientWidth);\n }\n /**\n * Clear sessionStorage - useful to initiate a new search in the same tab.\n * Passing sessionStorage.clear directly as onclick callback didn't work\n * (on macOS Chrome).\n */\n\n }, {\n key: \"clearSession\",\n value: function clearSession() {\n sessionStorage.clear();\n }\n /**\n *\n * handle next and previous query button clicks\n */\n\n }, {\n key: \"handleQueryIndexChange\",\n value: function handleQueryIndexChange(nextQuery) {\n if (nextQuery < 1 || nextQuery > this.props.data.queries.length) return;\n var anchorEl = document.createElement('a'); //indexing at [nextQuery - 1] because array is 0-indexed\n\n anchorEl.setAttribute('href', '#Query_' + this.props.data.queries[nextQuery - 1].number);\n anchorEl.setAttribute('hidden', true);\n document.body.appendChild(anchorEl); // add smooth scrolling animation with jquery\n\n $(anchorEl).on('click', this.animateAnchorElements);\n anchorEl.click();\n document.body.removeChild(anchorEl);\n this.setState({\n queryIndex: nextQuery\n });\n }\n /**\n * Event-handler for downloading fasta of all hits.\n */\n\n }, {\n key: \"downloadFastaOfAll\",\n value: function downloadFastaOfAll() {\n var sequence_ids = [];\n this.props.data.queries.forEach(function (query) {\n return query.hits.forEach(function (hit) {\n return sequence_ids.push(hit.id);\n });\n });\n var database_ids = this.props.data.querydb.map(function (querydb) {\n return querydb.id;\n });\n (0,_download_fasta__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sequence_ids, database_ids);\n return false;\n }\n /**\n * Handles downloading fasta of selected hits.\n */\n\n }, {\n key: \"downloadFastaOfSelected\",\n value: function downloadFastaOfSelected() {\n var sequence_ids = $('.hit-links :checkbox:checked').map(function () {\n return this.value;\n }).get();\n\n var database_ids = underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.props.data.querydb, underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].iteratee('id'));\n\n (0,_download_fasta__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sequence_ids, database_ids);\n return false;\n }\n /**\n * Handles copying the URL into the user's clipboard. Modified from: https://stackoverflow.com/a/49618964/18117380\n * Hides the 'Copied!' tooltip after 3 seconds\n */\n\n }, {\n key: \"copyURL\",\n value: function copyURL() {\n var element = document.createElement('input');\n var url = window.location.href;\n document.body.appendChild(element);\n element.value = url;\n element.select();\n document.execCommand('copy');\n document.body.removeChild(element);\n setTimeout(function () {\n $('#copyURL')._tooltip('destroy');\n }, 3000);\n }\n }, {\n key: \"shareCloudInit\",\n value: function shareCloudInit() {\n this.refs.cloudShareModal.show();\n }\n }, {\n key: \"topPanelJSX\",\n value: function topPanelJSX() {\n var path = location.pathname.split('/'); // Get job id.\n\n var job_id = path.pop(); // Deriving rootURL this way is required for subURI deployments\n // - we cannot just send to '/'.\n\n var rootURL = path.join('/');\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sidebar-top-panel\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: this.summaryString()\n })\n }), this.props.data.queries.length > 12 && this.queryIndexButtons(), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"\".concat(rootURL, \"/?job_id=\").concat(job_id),\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-pencil\"\n }), \" Edit search\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"line\",\n children: \"|\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"\".concat(rootURL, \"/\"),\n onClick: this.clearSession,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-file-o\"\n }), \" New search\"]\n })]\n }), this.props.shouldShowIndex && this.indexJSX()]\n });\n }\n }, {\n key: \"summaryString\",\n value: function summaryString() {\n var program = this.props.data.program;\n var numqueries = this.props.data.queries.length;\n var numquerydb = this.props.data.querydb.length;\n return program.toUpperCase() + ': ' + numqueries + ' ' + (numqueries > 1 ? 'queries' : 'query') + ', ' + numquerydb + ' ' + (numquerydb > 1 ? 'databases' : 'database');\n }\n }, {\n key: \"queryIndexButtons\",\n value: function queryIndexButtons() {\n var _this2 = this;\n\n var buttonStyle = {\n outline: 'none',\n border: 'none',\n background: 'none'\n };\n var buttonClasses = 'btn-link nowrap-ellipsis hover-bold';\n\n var handlePreviousBtnClick = function handlePreviousBtnClick() {\n return _this2.handleQueryIndexChange(_this2.state.queryIndex - 1);\n };\n\n var handleNextBtnClick = function handleNextBtnClick() {\n return _this2.handleQueryIndexChange(_this2.state.queryIndex + 1);\n }; // eslint-disable-next-line no-unused-vars\n\n\n var NavButton = function NavButton(_ref) {\n var text = _ref.text,\n onClick = _ref.onClick;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"button\", {\n className: buttonClasses,\n onClick: onClick,\n style: buttonStyle,\n children: text\n });\n };\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n style: {\n display: 'flex',\n width: '100%',\n margin: '7px 0'\n },\n children: [this.state.queryIndex > 1 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(NavButton, {\n text: \"Previous Query\",\n onClick: handlePreviousBtnClick\n }), this.state.queryIndex > 1 && this.state.queryIndex < this.props.data.queries.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"line\",\n children: \"|\"\n }), this.state.queryIndex < this.props.data.queries.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(NavButton, {\n onClick: handleNextBtnClick,\n text: \"Next Query\"\n })]\n });\n }\n }, {\n key: \"indexJSX\",\n value: function indexJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"ul\", {\n className: \"nav hover-reset active-bold\",\n children: [\" \", underscore__WEBPACK_IMPORTED_MODULE_1__[\"default\"].map(this.props.data.queries, function (query) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link nowrap-ellipsis hover-bold\",\n title: 'Query= ' + query.id + ' ' + query.title,\n href: '#Query_' + query.number,\n children: 'Query= ' + query.id\n })\n }, 'Side_bar_' + query.id);\n })]\n });\n }\n }, {\n key: \"downloadsPanelJSX\",\n value: function downloadsPanelJSX() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"downloads\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: \"Download FASTA, XML, TSV\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"ul\", {\n className: \"nav\",\n children: [!(this.props.data.imported_xml || this.props.data.non_parse_seqids) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n href: \"#\",\n className: \"btn-link download-fasta-of-all \".concat(!this.props.atLeastOneHit && 'disabled'),\n onClick: this.downloadFastaOfAll,\n children: \"FASTA of all hits\"\n })\n }), !(this.props.data.imported_xml || this.props.data.non_parse_seqids) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link download-fasta-of-selected disabled\",\n onClick: this.downloadFastaOfSelected,\n children: [\"FASTA of \", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"text-bold\"\n }), \" selected hit(s)\"]\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n href: \"#\",\n className: \"btn-link download-alignment-of-all \".concat(!this.props.atLeastOneHit && 'disabled'),\n children: \"Alignment of all hits\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n href: \"#\",\n className: \"btn-link download-alignment-of-selected disabled\",\n children: [\"Alignment of \", /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"span\", {\n className: \"text-bold\"\n }), \" selected hit(s)\"]\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"15 columns: query and subject ID; scientific name, alignment length, mismatches, gaps, identity, start and end coordinates, e value, bitscore, query coverage per subject and per HSP.\",\n href: 'download/' + this.props.data.search_id + '.std_tsv',\n children: \"Standard tabular report\"\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"44 columns: query and subject ID, GI, accessions, and length; alignment details; taxonomy details of subject sequence(s) and query coverage per subject and per HSP.\",\n href: 'download/' + this.props.data.search_id + '.full_tsv',\n children: \"Full tabular report\"\n })\n }), !this.props.data.imported_xml && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"a\", {\n className: \"btn-link download\",\n \"data-toggle\": \"tooltip\",\n title: \"Results in XML format.\",\n href: 'download/' + this.props.data.search_id + '.xml',\n children: \"Full XML report\"\n })\n })]\n })]\n });\n }\n }, {\n key: \"sharingPanelJSX\",\n value: function sharingPanelJSX() {\n var link_class = 'btn-link cursor-pointer';\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sharing-panel\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: \"section-header-sidebar\",\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"h4\", {\n children: \"Share results\"\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"ul\", {\n className: \"nav\",\n children: !this.props.cloudSharingEnabled ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n id: \"copyURL\",\n className: \"\".concat(link_class, \" copy-URL\"),\n \"data-toggle\": \"tooltip\",\n onClick: this.copyURL,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-copy\"\n }), \" Copy URL to clipboard\"]\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"a\", {\n id: \"sendEmail\",\n className: \"\".concat(link_class, \" email-URL\"),\n \"data-toggle\": \"tooltip\",\n title: \"Send by email\",\n href: (0,_mailto__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.props.data.querydb, this.props.data.program, this.props.data.queries, window.location.href),\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-envelope\"\n }), \" Send by email\"]\n })\n })]\n }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"li\", {\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"button\", {\n id: \"shareToCloud\",\n className: \"\".concat(link_class, \" cloud-Post\"),\n \"data-toggle\": \"tooltip\",\n title: \"Upload results to SequenceServer Cloud where it will become accessable to everyone who has a link.\",\n onClick: this.shareCloudInit,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"i\", {\n className: \"fa fa-cloud\"\n }), \" Share to cloud\"]\n })\n })\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_cloud_share_modal__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n ref: \"cloudShareModal\",\n querydb: this.props.data.querydb,\n program: this.props.data.program,\n queries: this.props.data.queries\n })]\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: \"sidebar\",\n children: [this.topPanelJSX(), this.downloadsPanelJSX(), this.sharingPanelJSX()]\n });\n }\n }]);\n\n return _default;\n}(react__WEBPACK_IMPORTED_MODULE_0__.Component);\n\n\n\n//# sourceURL=webpack://SequenceServer/./public/js/sidebar.js?"); /***/ }),