{"version":3,"sources":["webpack:///filtered_search.22aa5fab57212df42769.bundle.js","webpack:///./droplab/plugins/ajax.js","webpack:///./droplab/plugins/filter.js","webpack:///./filtered_search/dropdown_emoji.js","webpack:///./filtered_search/dropdown_hint.js","webpack:///./filtered_search/dropdown_non_user.js","webpack:///./droplab/plugins/ajax_filter.js","webpack:///./lib/utils/dom_utils.js","webpack:///./filtered_search/dropdown_user.js","webpack:///./filtered_search/filtered_search_dropdown_manager.js","webpack:///./filtered_search/event_hub.js","webpack:///./filtered_search/components/recent_searches_dropdown_content.js","webpack:///./filtered_search/recent_searches_root.js","webpack:///./filtered_search/stores/recent_searches_store.js","webpack:///./filtered_search/services/recent_searches_service_error.js","webpack:///./filtered_search/services/recent_searches_service.js","webpack:///./filtered_search/filtered_search_manager.js","webpack:///./filtered_search/filtered_search_tokenizer.js","webpack:///./lib/utils/users_cache.js","webpack:///./filtered_search/filtered_search_visual_tokens.js","webpack:///./filtered_search/filtered_search_dropdown.js","webpack:///./filtered_search/filtered_search_token_keys.js"],"names":["webpackJsonp","./filtered_search/filtered_search_bundle.js","module","__webpack_exports__","__webpack_require__","_toConsumableArray","arr","Array","isArray","i","arr2","length","from","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","dropdown_hint__classCallCheck","dropdown_hint__possibleConstructorReturn","dropdown_hint__inherits","dropdown_non_user__classCallCheck","dropdown_non_user__possibleConstructorReturn","dropdown_non_user__inherits","dropdown_user__classCallCheck","dropdown_user__possibleConstructorReturn","dropdown_user__inherits","filtered_search_dropdown_manager__classCallCheck","recent_searches_root__classCallCheck","recent_searches_store__classCallCheck","recent_searches_service_error__classCallCheck","recent_searches_service__classCallCheck","filtered_search_manager__classCallCheck","filtered_search_tokenizer__classCallCheck","users_cache__classCallCheck","users_cache__possibleConstructorReturn","users_cache__inherits","filtered_search_visual_tokens__classCallCheck","defineProperty","flash","ajax_cache","Ajax","_loadData","data","config","loadingTemplate","dataLoadingTemplate","hook","list","querySelector","outerHTML","listTemplate","destroyed","method","preprocessing","results","preprocessed","override","endpoint","init","this","dynamicList","document","createElement","innerHTML","setAttribute","retrieve","then","bind","catch","onError","destroy","ajax","Filter","keydown","e","filterFunction","hiddenCount","dataHiddenCount","detail","trigger","toLowerCase","matches","o","droplab_hidden","template","indexOf","filter","map","setData","currentIndex","debounceKeydown","which","keyCode","timeout","clearTimeout","setTimeout","eventWrapper","addEventListener","removeEventListener","_createClass","defineProperties","target","props","descriptor","key","protoProps","staticProps","_get","get","object","property","receiver","Function","desc","getOwnPropertyDescriptor","undefined","parent","getPrototypeOf","getter","dropdown_emoji_DropdownEmoji","_gl$FilteredSearchDro","DropdownEmoji","options","arguments","_this","gon","relative_url_root","_ref","glEmojiTag","unbindEvents","bindEvents","listRenderedWrapper","listRendered","dropdown","replaceEmojiElement","selected","name","innerText","trim","gl","DropdownUtils","getEscapedText","forceShowList","droplab","changeHookList","hookId","_this2","dropdownItems","querySelectorAll","forEach","dropdownItem","emojiTag","addHook","input","FilteredSearchDropdown","window","dropdown_hint__createClass","dropdown_hint_DropdownHint","DropdownHint","tokenKeys","filterHint","allowedKeys","getKeys","tagName","hasAttribute","dismissDropdown","getAttribute","dispatchFormSubmitEvent","token","tag","previousInputValues","split","searchTerms","index","push","pop","FilteredSearchVisualTokens","addSearchVisualToken","join","FilteredSearchDropdownManager","addWordToInput","replace","container","dispatchInputEvent","dropdownData","tokenKey","icon","hint","type","dropdown_non_user__createClass","dropdown_non_user__get","dropdown_non_user_DropdownNonUser","DropdownNonUser","symbol","filterWithSymbol","title","AjaxFilter","notLoading","debounceTrigger","loading","NON_CHARACTER_KEYS","invalidKeyPressed","focusEvent","getEntireList","searchValue","searchKey","searchValueFunction","show","params","url","buildParams","onLoadingFinished","hookListChildren","children","hide","keys","param","ajax_filter","addClassIfElementExists","element","className","classList","add","dropdown_user__createClass","dropdown_user__get","dropdown_user_DropdownUser","DropdownUser","per_page","active","group_id","getGroupId","project_id","getProjectId","current_user","getSearchInput","hideCurrentUser","query","_gl$FilteredSearchTok","FilteredSearchTokenizer","processTokens","lastToken","slice","drop_lab","filtered_search_dropdown_manager__createClass","filtered_search_dropdown_manager_FilteredSearchDropdownManager","baseEndpoint","tokenizer","page","filteredSearchTokenKeys","FilteredSearchTokenKeys","filteredSearchInput","setupMapping","cleanupWrapper","cleanup","mapping","author","reference","assignee","milestone","extraArguments","label","duplicateLabelPreprocessing","my-reaction","updateDropdownOffset","currentDropdown","offset","getBoundingClientRect","left","currentDropdownWidth","clientWidth","offsetMaxWidth","setOffset","firstLoad","mappingKey","glClass","defaultArguments","glArguments","assign","apply","render","dropdownName","match","searchByKey","shouldOpenFilterDropdown","shouldOpenHintDropdown","load","getSearchQuery","_tokenizer$processTok","searchToken","updateCurrentDropdownOffset","_","last","loadDropdown","hideDropdown","setDropdown","resetFilters","tokenName","tokenValue","clicked","addFilterVisualToken","moveInputToTheRight","vue_esm","event_hub","recent_searches_dropdown_content","items","required","isLocalStorageAvailable","Boolean","default","computed","processedItems","item","tokens","text","prefix","suffix","hasItems","methods","onItemActivated","$emit","onRequestClearRecentSearches","stopPropagation","recent_searches_root__createClass","recent_searches_root_RecentSearchesRoot","RecentSearchesRoot","recentSearchesStore","recentSearchesService","wrapperElement","store","service","onRequestClearRecentSearchesWrapper","$on","$off","state","vm","el","components","recent-searches-dropdown-content","resultantSearches","setRecentSearches","save","$destroy","recent_searches_root","underscore","underscore_default","n","recent_searches_store__createClass","recent_searches_store_RecentSearchesStore","RecentSearchesStore","initialState","recentSearches","newSearch","concat","searches","trimmedSearches","search","a","uniq","recent_searches_store","RecentSearchesServiceError","message","Error","recent_searches_service_error","accessor","recent_searches_service__createClass","recent_searches_service_RecentSearchesService","RecentSearchesService","localStorageKey","isAvailable","error","Promise","reject","localStorage","getItem","JSON","parse","err","resolve","setItem","stringify","isLocalStorageAccessSafe","recent_searches_service","filtered_search_manager__createClass","filtered_search_manager_FilteredSearchManager","FilteredSearchManager","filteredSearchInputForm","form","clearSearchButton","tokensContainer","searchHistoryDropdownElement","fullPath","dataset","recentSearchesPagePrefix","recentSearchesKey","fetchingRecentSearchesPromise","fetch","dropdownManager","recentSearchesRoot","loadSearchParamsFromURL","stateFilters","searchStateWrapper","searchState","mergedState","handleFormSubmit","setDropdownWrapper","toggleClearSearchButtonWrapper","toggleClearSearchButton","handleInputPlaceholderWrapper","handleInputPlaceholder","handleInputVisualTokenWrapper","handleInputVisualToken","checkForEnterWrapper","checkForEnter","onClearSearchWrapper","onClearSearch","checkForBackspaceWrapper","checkForBackspace","removeSelectedTokenKeydownWrapper","removeSelectedTokenKeydown","unselectEditTokensWrapper","unselectEditTokens","editTokenWrapper","editToken","tokenChange","addInputContainerFocusWrapper","addInputContainerFocus","removeInputContainerFocusWrapper","removeInputContainerFocus","onrecentSearchesItemSelectedWrapper","onrecentSearchesItemSelected","removeTokenWrapper","removeToken","bindStateEvents","unbindStateEvents","_gl$FilteredSearchVis","getLastVisualTokenBeforeInput","lastVisualToken","_gl$DropdownUtils$get","getVisualTokenValues","canEdit","getLastTokenPartial","removeLastTokenPartial","selectionStart","preventDefault","setSelectionRange","dropdownEl","activeElements","isHandledAsync","stopImmediatePropagation","blur","resetDropdowns","destroyDroplab","closest","inputContainer","isElementInFilteredSearch","contains","isElementInDynamicFilterDropdown","isElementInStaticFilterDropdown","remove","button","selectToken","removeSelectedToken","isElementInFilterDropdown","isElementTokensContainer","sanitizedTokenName","textContent","hasHidden","currentPlaceholder","placeholder","clearSearch","removeElements","t","canClearToken","_gl$DropdownUtils$get2","parentElement","removeChild","isLastVisualTokenValid","fragments","inputValues","valueCompletedRegex","_this3","searchQuery","addRecentSearch","urlParams","modifyUrlParams","_this4","utils","getUrlParamsArray","getAllParams","usernameParams","getUsernameParams","hasFilteredSearch","p","keyParam","decodeURIComponent","condition","searchByConditionUrl","sanitizedValue","searchByKeyParam","lastIndexOf","sanitizedKey","quotationsToUse","id","parseInt","saveCurrentSearchQuery","currentTarget","_this5","paths","_tokenizer$processTok2","currentState","getParameterByName","searchByConditionKeyValue","underscoredKey","tokenPath","encodeURIComponent","sanitized","parameterizedUrl","updateObject","visitUrl","usernamesById","attribute","user","username","currentDropdownRef","dispatchEvent","CustomEvent","filtered_search_tokenizer__createClass","tokenRegex","RegExp","tokenIndexes","v1","v2","v3","tokenSymbol","tokenIndex","lastString","api","cache","users_cache__createClass","users_cache_UsersCache","_Cache","UsersCache","hasData","users","internalStorage","users_cache","filtered_search_visual_tokens__createClass","filtered_search_visual_tokens_FilteredSearchVisualTokens","inputLi","previousElementSibling","otherTokens","tokenButton","forceSelection","unselectTokens","li","tokenContainer","backgroundColor","textColor","style","color","labelsEndpoint","labels","processed","tokenValueContainer","preprocessLabel","matchingLabel","find","setTokenStyle","text_color","tokenValueElement","originalValue","avatar_url","escape","Emoji","isEmojiNameValid","tokenType","updateLabelTokenColor","updateUserTokenAppearance","updateEmojiTokenAppearance","isSearchTerm","createVisualTokenElementHTML","renderVisualTokenValue","insertBefore","_FilteredSearchVisual","_FilteredSearchVisual2","addVisualTokenElement","previousTokenName","searchTerm","_FilteredSearchVisual3","_FilteredSearchVisual4","valueContainer","valueText","nameText","_FilteredSearchVisual5","addValueToPreviousVisualTokenElement","tokenizeInput","replaceChild","nameElement","valueContainerElement","inputEvent","Event","focus","lastElementChild","isEqualNode","lastPartial","appendChild","./filtered_search/filtered_search_dropdown.js","exports","itemClickedWrapper","itemClicked","hooks","h","getValueFunction","setDataValueIfSelected","innerWidth","currentHook","getCurrentHook","hidden","forceRenderContent","setAsDropdown","renderContent","bubbles","cancelable","updated","./filtered_search/filtered_search_token_keys.js","current_user_id","alternativeTokenKeys","tokenKeysWithAlternative","conditions","tokenKeyParam"],"mappings":"AAAAA,cAAc,oBAERC,8CACA,SAAUC,EAAQC,EAAqBC,GAE7C,YAoKA,SAASC,GAAmBC,GAAO,GAAIC,MAAMC,QAAQF,GAAM,CAAE,IA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EAAS+B,QACX6Z,OAAqB5b,EAAS+B,OAGzBqR,IAAawI,KAChB,QrB+hFN7gB,IAAK,uBACL7F,MAAO,SqB7hFmBsM,GAC1B,MAAOma,GAAW9D,KAAK,SAAAvE,GAAA,MAAaA,GAAU9R,MAAQA,KAAQ,QrBkiF9DzG,IAAK,4BACL7F,MAAO,SqBhiFwB6F,EAAK7F,GACpC,MAAOymB,GACJ9D,KAAK,SAAAvE,GAAA,MAAaA,GAAUtT,WAAajF,GAAOuY,EAAUpe,QAAUA,KAAU,SrBqiF5E8O,IqBjiFT9F,QAAOhB,GAAKgB,OAAOhB,OACnBA,GAAG8G,wBAA0BA,KrBwiF1B","file":"filtered_search.22aa5fab57212df42769.bundle.js","sourcesContent":["webpackJsonp([\"filtered_search\"],{\n\n/***/ \"./filtered_search/filtered_search_bundle.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n\n// EXTERNAL MODULE: ./flash.js\nvar flash = __webpack_require__(\"./flash.js\");\n\n// EXTERNAL MODULE: ./lib/utils/ajax_cache.js\nvar ajax_cache = __webpack_require__(\"./lib/utils/ajax_cache.js\");\n\n// CONCATENATED MODULE: ./droplab/plugins/ajax.js\n/* eslint-disable */\n\n\n\nvar Ajax = {\n _loadData: function _loadData(data, config, self) {\n if (config.loadingTemplate) {\n var dataLoadingTemplate = self.hook.list.list.querySelector('[data-loading-template]');\n if (dataLoadingTemplate) dataLoadingTemplate.outerHTML = self.listTemplate;\n }\n\n if (!self.destroyed) self.hook.list[config.method].call(self.hook.list, data);\n },\n preprocessing: function preprocessing(config, data) {\n var results = data;\n\n if (config.preprocessing && !data.preprocessed) {\n results = config.preprocessing(data);\n ajax_cache[\"a\" /* default */].override(config.endpoint, results);\n }\n\n return results;\n },\n init: function init(hook) {\n var self = this;\n self.destroyed = false;\n var config = hook.config.Ajax;\n this.hook = hook;\n if (!config || !config.endpoint || !config.method) {\n return;\n }\n if (config.method !== 'setData' && config.method !== 'addData') {\n return;\n }\n if (config.loadingTemplate) {\n var dynamicList = hook.list.list.querySelector('[data-dynamic]');\n var loadingTemplate = document.createElement('div');\n loadingTemplate.innerHTML = config.loadingTemplate;\n loadingTemplate.setAttribute('data-loading-template', '');\n this.listTemplate = dynamicList.outerHTML;\n dynamicList.outerHTML = loadingTemplate.outerHTML;\n }\n\n return ajax_cache[\"a\" /* default */].retrieve(config.endpoint).then(self.preprocessing.bind(null, config)).then(function (data) {\n return self._loadData(data, config, self);\n }).catch(config.onError);\n },\n destroy: function destroy() {\n this.destroyed = true;\n }\n};\n\n/* harmony default export */ var ajax = (Ajax);\n// CONCATENATED MODULE: ./droplab/plugins/filter.js\n/* eslint-disable */\n\nvar Filter = {\n keydown: function keydown(e) {\n if (this.destroyed) return;\n\n var hiddenCount = 0;\n var dataHiddenCount = 0;\n\n var list = e.detail.hook.list;\n var data = list.data;\n var value = e.detail.hook.trigger.value.toLowerCase();\n var config = e.detail.hook.config.Filter;\n var matches = [];\n var filterFunction;\n // will only work on dynamically set data\n if (!data) {\n return;\n }\n\n if (config && config.filterFunction && typeof config.filterFunction === 'function') {\n filterFunction = config.filterFunction;\n } else {\n filterFunction = function filterFunction(o) {\n // cheap string search\n o.droplab_hidden = o[config.template].toLowerCase().indexOf(value) === -1;\n return o;\n };\n }\n\n dataHiddenCount = data.filter(function (o) {\n return !o.droplab_hidden;\n }).length;\n\n matches = data.map(function (o) {\n return filterFunction(o, value);\n });\n\n hiddenCount = matches.filter(function (o) {\n return !o.droplab_hidden;\n }).length;\n\n if (dataHiddenCount !== hiddenCount) {\n list.setData(matches);\n list.currentIndex = 0;\n }\n },\n\n debounceKeydown: function debounceKeydown(e) {\n if ([13, // enter\n 16, // shift\n 17, // ctrl\n 18, // alt\n 20, // caps lock\n 37, // left arrow\n 38, // up arrow\n 39, // right arrow\n 40, // down arrow\n 91, // left window\n 92, // right window\n 93].indexOf(e.detail.which || e.detail.keyCode) > -1) return;\n\n if (this.timeout) clearTimeout(this.timeout);\n this.timeout = setTimeout(this.keydown.bind(this, e), 200);\n },\n\n init: function init(hook) {\n var config = hook.config.Filter;\n\n if (!config || !config.template) return;\n\n this.hook = hook;\n this.destroyed = false;\n\n this.eventWrapper = {};\n this.eventWrapper.debounceKeydown = this.debounceKeydown.bind(this);\n\n this.hook.trigger.addEventListener('keydown.dl', this.eventWrapper.debounceKeydown);\n this.hook.trigger.addEventListener('mousedown.dl', this.eventWrapper.debounceKeydown);\n },\n\n destroy: function destroy() {\n if (this.timeout) clearTimeout(this.timeout);\n this.destroyed = true;\n\n this.hook.trigger.removeEventListener('keydown.dl', this.eventWrapper.debounceKeydown);\n this.hook.trigger.removeEventListener('mousedown.dl', this.eventWrapper.debounceKeydown);\n }\n};\n\n/* harmony default export */ var filter = (Filter);\n// EXTERNAL MODULE: ./filtered_search/filtered_search_dropdown.js\nvar filtered_search_dropdown = __webpack_require__(\"./filtered_search/filtered_search_dropdown.js\");\nvar filtered_search_dropdown_default = /*#__PURE__*/__webpack_require__.n(filtered_search_dropdown);\n\n// CONCATENATED MODULE: ./filtered_search/dropdown_emoji.js\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar dropdown_emoji_DropdownEmoji = function (_gl$FilteredSearchDro) {\n _inherits(DropdownEmoji, _gl$FilteredSearchDro);\n\n function DropdownEmoji() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, DropdownEmoji);\n\n var _this = _possibleConstructorReturn(this, (DropdownEmoji.__proto__ || Object.getPrototypeOf(DropdownEmoji)).call(this, options));\n\n _this.config = {\n Ajax: {\n endpoint: (gon.relative_url_root || '') + '/autocomplete/award_emojis',\n method: 'setData',\n loadingTemplate: _this.loadingTemplate,\n onError: function onError() {\n /* eslint-disable no-new */\n new flash[\"a\" /* default */]('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n }\n },\n Filter: {\n template: 'name'\n }\n };\n\n __webpack_require__.e/* import() */(\"emoji\").then(__webpack_require__.bind(null, \"./emoji/index.js\")).then(function (_ref) {\n var glEmojiTag = _ref.glEmojiTag;\n _this.glEmojiTag = glEmojiTag;\n }).catch(function () {/* ignore error and leave emoji name in the search bar */});\n\n _this.unbindEvents();\n _this.bindEvents();\n return _this;\n }\n\n _createClass(DropdownEmoji, [{\n key: 'bindEvents',\n value: function bindEvents() {\n _get(DropdownEmoji.prototype.__proto__ || Object.getPrototypeOf(DropdownEmoji.prototype), 'bindEvents', this).call(this);\n\n this.listRenderedWrapper = this.listRendered.bind(this);\n this.dropdown.addEventListener('render.dl', this.listRenderedWrapper);\n }\n }, {\n key: 'unbindEvents',\n value: function unbindEvents() {\n this.dropdown.removeEventListener('render.dl', this.listRenderedWrapper);\n _get(DropdownEmoji.prototype.__proto__ || Object.getPrototypeOf(DropdownEmoji.prototype), 'unbindEvents', this).call(this);\n }\n }, {\n key: 'listRendered',\n value: function listRendered() {\n this.replaceEmojiElement();\n }\n }, {\n key: 'itemClicked',\n value: function itemClicked(e) {\n _get(DropdownEmoji.prototype.__proto__ || Object.getPrototypeOf(DropdownEmoji.prototype), 'itemClicked', this).call(this, e, function (selected) {\n var name = selected.querySelector('.js-data-value').innerText.trim();\n return gl.DropdownUtils.getEscapedText(name);\n });\n }\n }, {\n key: 'renderContent',\n value: function renderContent() {\n var forceShowList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.droplab.changeHookList(this.hookId, this.dropdown, [ajax, filter], this.config);\n _get(DropdownEmoji.prototype.__proto__ || Object.getPrototypeOf(DropdownEmoji.prototype), 'renderContent', this).call(this, forceShowList);\n }\n }, {\n key: 'replaceEmojiElement',\n value: function replaceEmojiElement() {\n var _this2 = this;\n\n if (!this.glEmojiTag) return;\n\n // Replace empty gl-emoji tag to real content\n var dropdownItems = [].concat(_toConsumableArray(this.dropdown.querySelectorAll('.filter-dropdown-item')));\n dropdownItems.forEach(function (dropdownItem) {\n var name = dropdownItem.querySelector('.js-data-value').innerText;\n var emojiTag = _this2.glEmojiTag(name);\n var emojiElement = dropdownItem.querySelector('gl-emoji');\n emojiElement.outerHTML = emojiTag;\n });\n }\n }, {\n key: 'init',\n value: function init() {\n this.droplab.addHook(this.input, this.dropdown, [ajax, filter], this.config).init();\n }\n }]);\n\n return DropdownEmoji;\n}(gl.FilteredSearchDropdown);\n\nwindow.gl = window.gl || {};\ngl.DropdownEmoji = dropdown_emoji_DropdownEmoji;\n// CONCATENATED MODULE: ./filtered_search/dropdown_hint.js\nvar dropdown_hint__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction dropdown_hint__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction dropdown_hint__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction dropdown_hint__inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar dropdown_hint_DropdownHint = function (_gl$FilteredSearchDro) {\n dropdown_hint__inherits(DropdownHint, _gl$FilteredSearchDro);\n\n function DropdownHint() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n dropdown_hint__classCallCheck(this, DropdownHint);\n\n var input = options.input,\n tokenKeys = options.tokenKeys;\n\n var _this = dropdown_hint__possibleConstructorReturn(this, (DropdownHint.__proto__ || Object.getPrototypeOf(DropdownHint)).call(this, options));\n\n _this.config = {\n Filter: {\n template: 'hint',\n filterFunction: gl.DropdownUtils.filterHint.bind(null, {\n input: input,\n allowedKeys: tokenKeys.getKeys()\n })\n }\n };\n _this.tokenKeys = tokenKeys;\n return _this;\n }\n\n dropdown_hint__createClass(DropdownHint, [{\n key: 'itemClicked',\n value: function itemClicked(e) {\n var selected = e.detail.selected;\n\n\n if (selected.tagName === 'LI') {\n if (selected.hasAttribute('data-value')) {\n this.dismissDropdown();\n } else if (selected.getAttribute('data-action') === 'submit') {\n this.dismissDropdown();\n this.dispatchFormSubmitEvent();\n } else {\n var token = selected.querySelector('.js-filter-hint').innerText.trim();\n var tag = selected.querySelector('.js-filter-tag').innerText.trim();\n\n if (tag.length) {\n // Get previous input values in the input field and convert them into visual tokens\n var previousInputValues = this.input.value.split(' ');\n var searchTerms = [];\n\n previousInputValues.forEach(function (value, index) {\n searchTerms.push(value);\n\n if (index === previousInputValues.length - 1 && token.indexOf(value.toLowerCase()) !== -1) {\n searchTerms.pop();\n }\n });\n\n if (searchTerms.length > 0) {\n gl.FilteredSearchVisualTokens.addSearchVisualToken(searchTerms.join(' '));\n }\n\n gl.FilteredSearchDropdownManager.addWordToInput(token.replace(':', ''), '', false, this.container);\n }\n this.dismissDropdown();\n this.dispatchInputEvent();\n }\n }\n }\n }, {\n key: 'renderContent',\n value: function renderContent() {\n var dropdownData = this.tokenKeys.get().map(function (tokenKey) {\n return {\n icon: 'fa-' + tokenKey.icon,\n hint: tokenKey.key,\n tag: ':' + tokenKey.tag,\n type: tokenKey.type\n };\n });\n\n this.droplab.changeHookList(this.hookId, this.dropdown, [filter], this.config);\n this.droplab.setData(this.hookId, dropdownData);\n }\n }, {\n key: 'init',\n value: function init() {\n this.droplab.addHook(this.input, this.dropdown, [filter], this.config).init();\n }\n }]);\n\n return DropdownHint;\n}(gl.FilteredSearchDropdown);\n\nwindow.gl = window.gl || {};\ngl.DropdownHint = dropdown_hint_DropdownHint;\n// CONCATENATED MODULE: ./filtered_search/dropdown_non_user.js\nvar dropdown_non_user__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar dropdown_non_user__get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction dropdown_non_user__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction dropdown_non_user__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction dropdown_non_user__inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar dropdown_non_user_DropdownNonUser = function (_gl$FilteredSearchDro) {\n dropdown_non_user__inherits(DropdownNonUser, _gl$FilteredSearchDro);\n\n function DropdownNonUser() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n dropdown_non_user__classCallCheck(this, DropdownNonUser);\n\n var input = options.input,\n endpoint = options.endpoint,\n symbol = options.symbol,\n preprocessing = options.preprocessing;\n\n var _this = dropdown_non_user__possibleConstructorReturn(this, (DropdownNonUser.__proto__ || Object.getPrototypeOf(DropdownNonUser)).call(this, options));\n\n _this.symbol = symbol;\n _this.config = {\n Ajax: {\n endpoint: endpoint,\n method: 'setData',\n loadingTemplate: _this.loadingTemplate,\n preprocessing: preprocessing,\n onError: function onError() {\n /* eslint-disable no-new */\n new flash[\"a\" /* default */]('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n }\n },\n Filter: {\n filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, _this.symbol, input),\n template: 'title'\n }\n };\n return _this;\n }\n\n dropdown_non_user__createClass(DropdownNonUser, [{\n key: 'itemClicked',\n value: function itemClicked(e) {\n var _this2 = this;\n\n dropdown_non_user__get(DropdownNonUser.prototype.__proto__ || Object.getPrototypeOf(DropdownNonUser.prototype), 'itemClicked', this).call(this, e, function (selected) {\n var title = selected.querySelector('.js-data-value').innerText.trim();\n return '' + _this2.symbol + gl.DropdownUtils.getEscapedText(title);\n });\n }\n }, {\n key: 'renderContent',\n value: function renderContent() {\n var forceShowList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.droplab.changeHookList(this.hookId, this.dropdown, [ajax, filter], this.config);\n dropdown_non_user__get(DropdownNonUser.prototype.__proto__ || Object.getPrototypeOf(DropdownNonUser.prototype), 'renderContent', this).call(this, forceShowList);\n }\n }, {\n key: 'init',\n value: function init() {\n this.droplab.addHook(this.input, this.dropdown, [ajax, filter], this.config).init();\n }\n }]);\n\n return DropdownNonUser;\n}(gl.FilteredSearchDropdown);\n\nwindow.gl = window.gl || {};\ngl.DropdownNonUser = dropdown_non_user_DropdownNonUser;\n// CONCATENATED MODULE: ./droplab/plugins/ajax_filter.js\n/* eslint-disable */\n\n\nvar AjaxFilter = {\n init: function init(hook) {\n this.destroyed = false;\n this.hook = hook;\n this.notLoading();\n\n this.eventWrapper = {};\n this.eventWrapper.debounceTrigger = this.debounceTrigger.bind(this);\n this.hook.trigger.addEventListener('keydown.dl', this.eventWrapper.debounceTrigger);\n this.hook.trigger.addEventListener('focus', this.eventWrapper.debounceTrigger);\n\n this.trigger(true);\n },\n\n notLoading: function notLoading() {\n this.loading = false;\n },\n\n debounceTrigger: function debounceTrigger(e) {\n var NON_CHARACTER_KEYS = [16, 17, 18, 20, 37, 38, 39, 40, 91, 93];\n var invalidKeyPressed = NON_CHARACTER_KEYS.indexOf(e.detail.which || e.detail.keyCode) > -1;\n var focusEvent = e.type === 'focus';\n if (invalidKeyPressed || this.loading) {\n return;\n }\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(this.trigger.bind(this, focusEvent), 200);\n },\n\n trigger: function trigger(getEntireList) {\n var _this = this;\n\n var config = this.hook.config.AjaxFilter;\n var searchValue = this.trigger.value;\n if (!config || !config.endpoint || !config.searchKey) {\n return;\n }\n if (config.searchValueFunction) {\n searchValue = config.searchValueFunction();\n }\n if (config.loadingTemplate && this.hook.list.data === undefined || this.hook.list.data.length === 0) {\n var dynamicList = this.hook.list.list.querySelector('[data-dynamic]');\n var loadingTemplate = document.createElement('div');\n loadingTemplate.innerHTML = config.loadingTemplate;\n loadingTemplate.setAttribute('data-loading-template', true);\n this.listTemplate = dynamicList.outerHTML;\n dynamicList.outerHTML = loadingTemplate.outerHTML;\n }\n if (getEntireList) {\n searchValue = '';\n }\n if (config.searchKey === searchValue) {\n return this.list.show();\n }\n this.loading = true;\n var params = config.params || {};\n params[config.searchKey] = searchValue;\n var url = config.endpoint + this.buildParams(params);\n return ajax_cache[\"a\" /* default */].retrieve(url).then(function (data) {\n _this._loadData(data, config);\n if (config.onLoadingFinished) {\n config.onLoadingFinished(data);\n }\n }).catch(config.onError);\n },\n\n _loadData: function _loadData(data, config) {\n var list = this.hook.list;\n if (config.loadingTemplate && list.data === undefined || list.data.length === 0) {\n var dataLoadingTemplate = list.list.querySelector('[data-loading-template]');\n if (dataLoadingTemplate) {\n dataLoadingTemplate.outerHTML = this.listTemplate;\n }\n }\n if (!this.destroyed) {\n var hookListChildren = list.list.children;\n var onlyDynamicList = hookListChildren.length === 1 && hookListChildren[0].hasAttribute('data-dynamic');\n if (onlyDynamicList && data.length === 0) {\n list.hide();\n }\n list.setData.call(list, data);\n }\n this.notLoading();\n list.currentIndex = 0;\n },\n\n\n buildParams: function buildParams(params) {\n if (!params) return '';\n var paramsArray = Object.keys(params).map(function (param) {\n return param + '=' + (params[param] || '');\n });\n return '?' + paramsArray.join('&');\n },\n\n destroy: function destroy() {\n if (this.timeout) clearTimeout(this.timeout);\n this.destroyed = true;\n\n this.hook.trigger.removeEventListener('keydown.dl', this.eventWrapper.debounceTrigger);\n this.hook.trigger.removeEventListener('focus', this.eventWrapper.debounceTrigger);\n }\n};\n\n/* harmony default export */ var ajax_filter = (AjaxFilter);\n// CONCATENATED MODULE: ./lib/utils/dom_utils.js\n/* eslint-disable import/prefer-default-export */\n\nvar addClassIfElementExists = function addClassIfElementExists(element, className) {\n if (element) {\n element.classList.add(className);\n }\n};\n// CONCATENATED MODULE: ./filtered_search/dropdown_user.js\nvar dropdown_user__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar dropdown_user__get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nfunction dropdown_user__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction dropdown_user__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction dropdown_user__inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\n\n\nvar dropdown_user_DropdownUser = function (_gl$FilteredSearchDro) {\n dropdown_user__inherits(DropdownUser, _gl$FilteredSearchDro);\n\n function DropdownUser() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n dropdown_user__classCallCheck(this, DropdownUser);\n\n var tokenKeys = options.tokenKeys;\n\n var _this = dropdown_user__possibleConstructorReturn(this, (DropdownUser.__proto__ || Object.getPrototypeOf(DropdownUser)).call(this, options));\n\n _this.config = {\n AjaxFilter: {\n endpoint: (gon.relative_url_root || '') + '/autocomplete/users.json',\n searchKey: 'search',\n params: {\n per_page: 20,\n active: true,\n group_id: _this.getGroupId(),\n project_id: _this.getProjectId(),\n current_user: true\n },\n searchValueFunction: _this.getSearchInput.bind(_this),\n loadingTemplate: _this.loadingTemplate,\n onLoadingFinished: function onLoadingFinished() {\n _this.hideCurrentUser();\n },\n onError: function onError() {\n /* eslint-disable no-new */\n new flash[\"a\" /* default */]('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n }\n }\n };\n _this.tokenKeys = tokenKeys;\n return _this;\n }\n\n dropdown_user__createClass(DropdownUser, [{\n key: 'hideCurrentUser',\n value: function hideCurrentUser() {\n addClassIfElementExists(this.dropdown.querySelector('.js-current-user'), 'hidden');\n }\n }, {\n key: 'itemClicked',\n value: function itemClicked(e) {\n dropdown_user__get(DropdownUser.prototype.__proto__ || Object.getPrototypeOf(DropdownUser.prototype), 'itemClicked', this).call(this, e, function (selected) {\n return selected.querySelector('.dropdown-light-content').innerText.trim();\n });\n }\n }, {\n key: 'renderContent',\n value: function renderContent() {\n var forceShowList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n this.droplab.changeHookList(this.hookId, this.dropdown, [ajax_filter], this.config);\n dropdown_user__get(DropdownUser.prototype.__proto__ || Object.getPrototypeOf(DropdownUser.prototype), 'renderContent', this).call(this, forceShowList);\n }\n }, {\n key: 'getGroupId',\n value: function getGroupId() {\n return this.input.getAttribute('data-group-id');\n }\n }, {\n key: 'getProjectId',\n value: function getProjectId() {\n return this.input.getAttribute('data-project-id');\n }\n }, {\n key: 'getSearchInput',\n value: function getSearchInput() {\n var query = gl.DropdownUtils.getSearchInput(this.input);\n\n var _gl$FilteredSearchTok = gl.FilteredSearchTokenizer.processTokens(query, this.tokenKeys.get()),\n lastToken = _gl$FilteredSearchTok.lastToken;\n\n var value = lastToken || '';\n\n if (value[0] === '@') {\n value = value.slice(1);\n }\n\n // Removes the first character if it is a quotation so that we can search\n // with multiple words\n if (value[0] === '\"' || value[0] === '\\'') {\n value = value.slice(1);\n }\n\n return value;\n }\n }, {\n key: 'init',\n value: function init() {\n this.droplab.addHook(this.input, this.dropdown, [ajax_filter], this.config).init();\n }\n }]);\n\n return DropdownUser;\n}(gl.FilteredSearchDropdown);\n\nwindow.gl = window.gl || {};\ngl.DropdownUser = dropdown_user_DropdownUser;\n// EXTERNAL MODULE: ./filtered_search/dropdown_utils.js\nvar dropdown_utils = __webpack_require__(\"./filtered_search/dropdown_utils.js\");\n\n// EXTERNAL MODULE: ./filtered_search/filtered_search_token_keys.js\nvar filtered_search_token_keys = __webpack_require__(\"./filtered_search/filtered_search_token_keys.js\");\nvar filtered_search_token_keys_default = /*#__PURE__*/__webpack_require__.n(filtered_search_token_keys);\n\n// EXTERNAL MODULE: ./droplab/drop_lab.js + 7 modules\nvar drop_lab = __webpack_require__(\"./droplab/drop_lab.js\");\n\n// EXTERNAL MODULE: ./filtered_search/container.js\nvar container = __webpack_require__(\"./filtered_search/container.js\");\n\n// CONCATENATED MODULE: ./filtered_search/filtered_search_dropdown_manager.js\nvar filtered_search_dropdown_manager__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction filtered_search_dropdown_manager__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\nvar filtered_search_dropdown_manager_FilteredSearchDropdownManager = function () {\n function FilteredSearchDropdownManager() {\n var baseEndpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var tokenizer = arguments[1];\n var page = arguments[2];\n\n filtered_search_dropdown_manager__classCallCheck(this, FilteredSearchDropdownManager);\n\n this.container = container[\"a\" /* default */].container;\n this.baseEndpoint = baseEndpoint.replace(/\\/$/, '');\n this.tokenizer = tokenizer;\n this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeys;\n this.filteredSearchInput = this.container.querySelector('.filtered-search');\n this.page = page;\n\n this.setupMapping();\n\n this.cleanupWrapper = this.cleanup.bind(this);\n document.addEventListener('beforeunload', this.cleanupWrapper);\n }\n\n filtered_search_dropdown_manager__createClass(FilteredSearchDropdownManager, [{\n key: 'cleanup',\n value: function cleanup() {\n if (this.droplab) {\n this.droplab.destroy();\n this.droplab = null;\n }\n\n this.setupMapping();\n\n document.removeEventListener('beforeunload', this.cleanupWrapper);\n }\n }, {\n key: 'setupMapping',\n value: function setupMapping() {\n this.mapping = {\n author: {\n reference: null,\n gl: 'DropdownUser',\n element: this.container.querySelector('#js-dropdown-author')\n },\n assignee: {\n reference: null,\n gl: 'DropdownUser',\n element: this.container.querySelector('#js-dropdown-assignee')\n },\n milestone: {\n reference: null,\n gl: 'DropdownNonUser',\n extraArguments: {\n endpoint: this.baseEndpoint + '/milestones.json',\n symbol: '%'\n },\n element: this.container.querySelector('#js-dropdown-milestone')\n },\n label: {\n reference: null,\n gl: 'DropdownNonUser',\n extraArguments: {\n endpoint: this.baseEndpoint + '/labels.json',\n symbol: '~',\n preprocessing: gl.DropdownUtils.duplicateLabelPreprocessing\n },\n element: this.container.querySelector('#js-dropdown-label')\n },\n 'my-reaction': {\n reference: null,\n gl: 'DropdownEmoji',\n element: this.container.querySelector('#js-dropdown-my-reaction')\n },\n hint: {\n reference: null,\n gl: 'DropdownHint',\n element: this.container.querySelector('#js-dropdown-hint')\n }\n };\n }\n }, {\n key: 'updateCurrentDropdownOffset',\n value: function updateCurrentDropdownOffset() {\n this.updateDropdownOffset(this.currentDropdown);\n }\n }, {\n key: 'updateDropdownOffset',\n value: function updateDropdownOffset(key) {\n // Always align dropdown with the input field\n var offset = this.filteredSearchInput.getBoundingClientRect().left - this.container.querySelector('.scroll-container').getBoundingClientRect().left;\n\n var maxInputWidth = 240;\n var currentDropdownWidth = this.mapping[key].element.clientWidth || maxInputWidth;\n\n // Make sure offset never exceeds the input container\n var offsetMaxWidth = this.container.querySelector('.scroll-container').clientWidth - currentDropdownWidth;\n if (offsetMaxWidth < offset) {\n offset = offsetMaxWidth;\n }\n\n this.mapping[key].reference.setOffset(offset);\n }\n }, {\n key: 'load',\n value: function load(key) {\n var firstLoad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var mappingKey = this.mapping[key];\n var glClass = mappingKey.gl;\n var element = mappingKey.element;\n var forceShowList = false;\n\n if (!mappingKey.reference) {\n var defaultArguments = {\n droplab: this.droplab,\n dropdown: element,\n input: this.filteredSearchInput,\n tokenKeys: this.filteredSearchTokenKeys,\n filter: key\n };\n var extraArguments = mappingKey.extraArguments || {};\n var glArguments = Object.assign({}, defaultArguments, extraArguments);\n\n // Passing glArguments to `new gl[glClass]()`\n mappingKey.reference = new (Function.prototype.bind.apply(gl[glClass], [null, glArguments]))();\n }\n\n if (firstLoad) {\n mappingKey.reference.init();\n }\n\n if (this.currentDropdown === 'hint') {\n // Force the dropdown to show if it was clicked from the hint dropdown\n forceShowList = true;\n }\n\n this.updateDropdownOffset(key);\n mappingKey.reference.render(firstLoad, forceShowList);\n\n this.currentDropdown = key;\n }\n }, {\n key: 'loadDropdown',\n value: function loadDropdown() {\n var dropdownName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var firstLoad = false;\n\n if (!this.droplab) {\n firstLoad = true;\n this.droplab = new drop_lab[\"a\" /* default */]();\n }\n\n var match = this.filteredSearchTokenKeys.searchByKey(dropdownName.toLowerCase());\n var shouldOpenFilterDropdown = match && this.currentDropdown !== match.key && this.mapping[match.key];\n var shouldOpenHintDropdown = !match && this.currentDropdown !== 'hint';\n\n if (shouldOpenFilterDropdown || shouldOpenHintDropdown) {\n var key = match && match.key ? match.key : 'hint';\n this.load(key, firstLoad);\n }\n }\n }, {\n key: 'setDropdown',\n value: function setDropdown() {\n var query = gl.DropdownUtils.getSearchQuery(true);\n\n var _tokenizer$processTok = this.tokenizer.processTokens(query, this.filteredSearchTokenKeys.getKeys()),\n lastToken = _tokenizer$processTok.lastToken,\n searchToken = _tokenizer$processTok.searchToken;\n\n if (this.currentDropdown) {\n this.updateCurrentDropdownOffset();\n }\n\n if (lastToken === searchToken && lastToken !== null) {\n // Token is not fully initialized yet because it has no value\n // Eg. token = 'label:'\n\n var split = lastToken.split(':');\n var dropdownName = _.last(split[0].split(' '));\n this.loadDropdown(split.length > 1 ? dropdownName : '');\n } else if (lastToken) {\n // Token has been initialized into an object because it has a value\n this.loadDropdown(lastToken.key);\n } else {\n this.loadDropdown('hint');\n }\n }\n }, {\n key: 'resetDropdowns',\n value: function resetDropdowns() {\n if (!this.currentDropdown) {\n return;\n }\n\n // Force current dropdown to hide\n this.mapping[this.currentDropdown].reference.hideDropdown();\n\n // Re-Load dropdown\n this.setDropdown();\n\n // Reset filters for current dropdown\n this.mapping[this.currentDropdown].reference.resetFilters();\n\n // Reposition dropdown so that it is aligned with cursor\n this.updateDropdownOffset(this.currentDropdown);\n }\n }, {\n key: 'destroyDroplab',\n value: function destroyDroplab() {\n this.droplab.destroy();\n }\n }], [{\n key: 'addWordToInput',\n value: function addWordToInput(tokenName) {\n var tokenValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var clicked = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var input = container[\"a\" /* default */].container.querySelector('.filtered-search');\n\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenName, tokenValue);\n input.value = '';\n\n if (clicked) {\n gl.FilteredSearchVisualTokens.moveInputToTheRight();\n }\n }\n }]);\n\n return FilteredSearchDropdownManager;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchDropdownManager = filtered_search_dropdown_manager_FilteredSearchDropdownManager;\n// EXTERNAL MODULE: /opt/gitlab/embedded/service/gitlab-rails/node_modules/vue/dist/vue.esm.js\nvar vue_esm = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n\n// CONCATENATED MODULE: ./filtered_search/event_hub.js\n\n\n/* harmony default export */ var event_hub = (new vue_esm[\"a\" /* default */]());\n// CONCATENATED MODULE: ./filtered_search/components/recent_searches_dropdown_content.js\n\n\n/* harmony default export */ var recent_searches_dropdown_content = ({\n name: 'RecentSearchesDropdownContent',\n\n props: {\n items: {\n type: Array,\n required: true\n },\n isLocalStorageAvailable: {\n type: Boolean,\n required: false,\n default: true\n },\n allowedKeys: {\n type: Array,\n required: true\n }\n },\n\n computed: {\n processedItems: function processedItems() {\n var _this = this;\n\n return this.items.map(function (item) {\n var _gl$FilteredSearchTok = gl.FilteredSearchTokenizer.processTokens(item, _this.allowedKeys),\n tokens = _gl$FilteredSearchTok.tokens,\n searchToken = _gl$FilteredSearchTok.searchToken;\n\n var resultantTokens = tokens.map(function (token) {\n return {\n prefix: token.key + ':',\n suffix: '' + token.symbol + token.value\n };\n });\n\n return {\n text: item,\n tokens: resultantTokens,\n searchToken: searchToken\n };\n });\n },\n hasItems: function hasItems() {\n return this.items.length > 0;\n }\n },\n\n methods: {\n onItemActivated: function onItemActivated(text) {\n event_hub.$emit('recentSearchesItemSelected', text);\n },\n onRequestClearRecentSearches: function onRequestClearRecentSearches(e) {\n // Stop the dropdown from closing\n e.stopPropagation();\n\n event_hub.$emit('requestClearRecentSearches');\n }\n },\n\n template: '\\n
\\n \\n This feature requires local storage to be enabled\\n
\\n \\n \\n \\u60A8\\u6700\\u8FD1\\u6CA1\\u6709\\u4EFB\\u4F55\\u641C\\u7D22\\n \\n \\n '\n});\n// CONCATENATED MODULE: ./filtered_search/recent_searches_root.js\nvar recent_searches_root__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction recent_searches_root__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\nvar recent_searches_root_RecentSearchesRoot = function () {\n function RecentSearchesRoot(recentSearchesStore, recentSearchesService, wrapperElement) {\n recent_searches_root__classCallCheck(this, RecentSearchesRoot);\n\n this.store = recentSearchesStore;\n this.service = recentSearchesService;\n this.wrapperElement = wrapperElement;\n }\n\n recent_searches_root__createClass(RecentSearchesRoot, [{\n key: 'init',\n value: function init() {\n this.bindEvents();\n this.render();\n }\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n this.onRequestClearRecentSearchesWrapper = this.onRequestClearRecentSearches.bind(this);\n\n event_hub.$on('requestClearRecentSearches', this.onRequestClearRecentSearchesWrapper);\n }\n }, {\n key: 'unbindEvents',\n value: function unbindEvents() {\n event_hub.$off('requestClearRecentSearches', this.onRequestClearRecentSearchesWrapper);\n }\n }, {\n key: 'render',\n value: function render() {\n var state = this.store.state;\n this.vm = new vue_esm[\"a\" /* default */]({\n el: this.wrapperElement,\n data: function data() {\n return state;\n },\n\n template: '\\n \\n ',\n components: {\n 'recent-searches-dropdown-content': recent_searches_dropdown_content\n }\n });\n }\n }, {\n key: 'onRequestClearRecentSearches',\n value: function onRequestClearRecentSearches() {\n var resultantSearches = this.store.setRecentSearches([]);\n this.service.save(resultantSearches);\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n this.unbindEvents();\n if (this.vm) {\n this.vm.$destroy();\n }\n }\n }]);\n\n return RecentSearchesRoot;\n}();\n\n/* harmony default export */ var recent_searches_root = (recent_searches_root_RecentSearchesRoot);\n// EXTERNAL MODULE: /opt/gitlab/embedded/service/gitlab-rails/node_modules/underscore/underscore.js\nvar underscore = __webpack_require__(\"../../../node_modules/underscore/underscore.js\");\nvar underscore_default = /*#__PURE__*/__webpack_require__.n(underscore);\n\n// CONCATENATED MODULE: ./filtered_search/stores/recent_searches_store.js\nvar recent_searches_store__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction recent_searches_store__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\nvar recent_searches_store_RecentSearchesStore = function () {\n function RecentSearchesStore() {\n var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var allowedKeys = arguments[1];\n\n recent_searches_store__classCallCheck(this, RecentSearchesStore);\n\n this.state = Object.assign({\n isLocalStorageAvailable: true,\n recentSearches: [],\n allowedKeys: allowedKeys\n }, initialState);\n }\n\n recent_searches_store__createClass(RecentSearchesStore, [{\n key: 'addRecentSearch',\n value: function addRecentSearch(newSearch) {\n this.setRecentSearches([newSearch].concat(this.state.recentSearches));\n\n return this.state.recentSearches;\n }\n }, {\n key: 'setRecentSearches',\n value: function setRecentSearches() {\n var searches = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n var trimmedSearches = searches.map(function (search) {\n return search.trim();\n });\n this.state.recentSearches = underscore_default.a.uniq(trimmedSearches).slice(0, 5);\n return this.state.recentSearches;\n }\n }]);\n\n return RecentSearchesStore;\n}();\n\n/* harmony default export */ var recent_searches_store = (recent_searches_store_RecentSearchesStore);\n// CONCATENATED MODULE: ./filtered_search/services/recent_searches_service_error.js\nfunction recent_searches_service_error__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar RecentSearchesServiceError = function RecentSearchesServiceError(message) {\n recent_searches_service_error__classCallCheck(this, RecentSearchesServiceError);\n\n this.name = 'RecentSearchesServiceError';\n this.message = message || 'Recent Searches Service is unavailable';\n};\n\n// Can't use `extends` for builtin prototypes and get true inheritance yet\n\n\nRecentSearchesServiceError.prototype = Error.prototype;\n\n/* harmony default export */ var recent_searches_service_error = (RecentSearchesServiceError);\n// EXTERNAL MODULE: ./lib/utils/accessor.js\nvar accessor = __webpack_require__(\"./lib/utils/accessor.js\");\n\n// CONCATENATED MODULE: ./filtered_search/services/recent_searches_service.js\nvar recent_searches_service__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction recent_searches_service__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\nvar recent_searches_service_RecentSearchesService = function () {\n function RecentSearchesService() {\n var localStorageKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'issuable-recent-searches';\n\n recent_searches_service__classCallCheck(this, RecentSearchesService);\n\n this.localStorageKey = localStorageKey;\n }\n\n recent_searches_service__createClass(RecentSearchesService, [{\n key: 'fetch',\n value: function fetch() {\n if (!RecentSearchesService.isAvailable()) {\n var error = new recent_searches_service_error();\n return Promise.reject(error);\n }\n\n var input = window.localStorage.getItem(this.localStorageKey);\n\n var searches = [];\n if (input && input.length > 0) {\n try {\n searches = JSON.parse(input);\n } catch (err) {\n return Promise.reject(err);\n }\n }\n\n return Promise.resolve(searches);\n }\n }, {\n key: 'save',\n value: function save() {\n var searches = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (!RecentSearchesService.isAvailable()) return;\n\n window.localStorage.setItem(this.localStorageKey, JSON.stringify(searches));\n }\n }], [{\n key: 'isAvailable',\n value: function isAvailable() {\n return accessor[\"a\" /* default */].isLocalStorageAccessSafe();\n }\n }]);\n\n return RecentSearchesService;\n}();\n\n/* harmony default export */ var recent_searches_service = (recent_searches_service_RecentSearchesService);\n// CONCATENATED MODULE: ./filtered_search/filtered_search_manager.js\nvar filtered_search_manager__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction filtered_search_manager__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\n\n\n\n\nvar filtered_search_manager_FilteredSearchManager = function () {\n function FilteredSearchManager(page) {\n filtered_search_manager__classCallCheck(this, FilteredSearchManager);\n\n this.page = page;\n this.container = container[\"a\" /* default */].container;\n this.filteredSearchInput = this.container.querySelector('.filtered-search');\n this.filteredSearchInputForm = this.filteredSearchInput.form;\n this.clearSearchButton = this.container.querySelector('.clear-search');\n this.tokensContainer = this.container.querySelector('.tokens-container');\n this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeys;\n\n this.recentSearchesStore = new recent_searches_store({\n isLocalStorageAvailable: recent_searches_service.isAvailable(),\n allowedKeys: this.filteredSearchTokenKeys.getKeys()\n });\n this.searchHistoryDropdownElement = document.querySelector('.js-filtered-search-history-dropdown');\n var fullPath = this.searchHistoryDropdownElement ? this.searchHistoryDropdownElement.dataset.fullPath : 'project';\n var recentSearchesPagePrefix = 'issue-recent-searches';\n if (this.page === 'merge_requests') {\n recentSearchesPagePrefix = 'merge-request-recent-searches';\n }\n var recentSearchesKey = fullPath + '-' + recentSearchesPagePrefix;\n this.recentSearchesService = new recent_searches_service(recentSearchesKey);\n }\n\n filtered_search_manager__createClass(FilteredSearchManager, [{\n key: 'setup',\n value: function setup() {\n var _this = this;\n\n // Fetch recent searches from localStorage\n this.fetchingRecentSearchesPromise = this.recentSearchesService.fetch().catch(function (error) {\n if (error.name === 'RecentSearchesServiceError') return undefined;\n // eslint-disable-next-line no-new\n new flash[\"a\" /* default */]('An error occurred while parsing recent searches');\n // Gracefully fail to empty array\n return [];\n }).then(function (searches) {\n if (!searches) {\n return;\n }\n\n // Put any searches that may have come in before\n // we fetched the saved searches ahead of the already saved ones\n var resultantSearches = _this.recentSearchesStore.setRecentSearches(_this.recentSearchesStore.state.recentSearches.concat(searches));\n _this.recentSearchesService.save(resultantSearches);\n });\n\n if (this.filteredSearchInput) {\n this.tokenizer = gl.FilteredSearchTokenizer;\n this.dropdownManager = new gl.FilteredSearchDropdownManager(this.filteredSearchInput.getAttribute('data-base-endpoint') || '', this.tokenizer, this.page);\n\n this.recentSearchesRoot = new recent_searches_root(this.recentSearchesStore, this.recentSearchesService, this.searchHistoryDropdownElement);\n this.recentSearchesRoot.init();\n\n this.bindEvents();\n this.loadSearchParamsFromURL();\n this.dropdownManager.setDropdown();\n\n this.cleanupWrapper = this.cleanup.bind(this);\n document.addEventListener('beforeunload', this.cleanupWrapper);\n }\n }\n }, {\n key: 'cleanup',\n value: function cleanup() {\n this.unbindEvents();\n document.removeEventListener('beforeunload', this.cleanupWrapper);\n\n if (this.recentSearchesRoot) {\n this.recentSearchesRoot.destroy();\n }\n }\n }, {\n key: 'bindStateEvents',\n value: function bindStateEvents() {\n this.stateFilters = document.querySelector('.container-fluid .issues-state-filters');\n\n if (this.stateFilters) {\n this.searchStateWrapper = this.searchState.bind(this);\n\n this.stateFilters.querySelector('[data-state=\"opened\"]').addEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"closed\"]').addEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"all\"]').addEventListener('click', this.searchStateWrapper);\n\n this.mergedState = this.stateFilters.querySelector('[data-state=\"merged\"]');\n if (this.mergedState) {\n this.mergedState.addEventListener('click', this.searchStateWrapper);\n }\n }\n }\n }, {\n key: 'unbindStateEvents',\n value: function unbindStateEvents() {\n if (this.stateFilters) {\n this.stateFilters.querySelector('[data-state=\"opened\"]').removeEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"closed\"]').removeEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"all\"]').removeEventListener('click', this.searchStateWrapper);\n\n if (this.mergedState) {\n this.mergedState.removeEventListener('click', this.searchStateWrapper);\n }\n }\n }\n }, {\n key: 'bindEvents',\n value: function bindEvents() {\n this.handleFormSubmit = this.handleFormSubmit.bind(this);\n this.setDropdownWrapper = this.dropdownManager.setDropdown.bind(this.dropdownManager);\n this.toggleClearSearchButtonWrapper = this.toggleClearSearchButton.bind(this);\n this.handleInputPlaceholderWrapper = this.handleInputPlaceholder.bind(this);\n this.handleInputVisualTokenWrapper = this.handleInputVisualToken.bind(this);\n this.checkForEnterWrapper = this.checkForEnter.bind(this);\n this.onClearSearchWrapper = this.onClearSearch.bind(this);\n this.checkForBackspaceWrapper = this.checkForBackspace.bind(this);\n this.removeSelectedTokenKeydownWrapper = this.removeSelectedTokenKeydown.bind(this);\n this.unselectEditTokensWrapper = this.unselectEditTokens.bind(this);\n this.editTokenWrapper = this.editToken.bind(this);\n this.tokenChange = this.tokenChange.bind(this);\n this.addInputContainerFocusWrapper = this.addInputContainerFocus.bind(this);\n this.removeInputContainerFocusWrapper = this.removeInputContainerFocus.bind(this);\n this.onrecentSearchesItemSelectedWrapper = this.onrecentSearchesItemSelected.bind(this);\n this.removeTokenWrapper = this.removeToken.bind(this);\n\n this.filteredSearchInputForm.addEventListener('submit', this.handleFormSubmit);\n this.filteredSearchInput.addEventListener('input', this.setDropdownWrapper);\n this.filteredSearchInput.addEventListener('input', this.toggleClearSearchButtonWrapper);\n this.filteredSearchInput.addEventListener('input', this.handleInputPlaceholderWrapper);\n this.filteredSearchInput.addEventListener('input', this.handleInputVisualTokenWrapper);\n this.filteredSearchInput.addEventListener('keydown', this.checkForEnterWrapper);\n this.filteredSearchInput.addEventListener('keyup', this.checkForBackspaceWrapper);\n this.filteredSearchInput.addEventListener('click', this.tokenChange);\n this.filteredSearchInput.addEventListener('keyup', this.tokenChange);\n this.filteredSearchInput.addEventListener('focus', this.addInputContainerFocusWrapper);\n this.tokensContainer.addEventListener('click', this.removeTokenWrapper);\n this.tokensContainer.addEventListener('click', this.editTokenWrapper);\n this.clearSearchButton.addEventListener('click', this.onClearSearchWrapper);\n document.addEventListener('click', this.unselectEditTokensWrapper);\n document.addEventListener('click', this.removeInputContainerFocusWrapper);\n document.addEventListener('keydown', this.removeSelectedTokenKeydownWrapper);\n event_hub.$on('recentSearchesItemSelected', this.onrecentSearchesItemSelectedWrapper);\n\n this.bindStateEvents();\n }\n }, {\n key: 'unbindEvents',\n value: function unbindEvents() {\n this.filteredSearchInputForm.removeEventListener('submit', this.handleFormSubmit);\n this.filteredSearchInput.removeEventListener('input', this.setDropdownWrapper);\n this.filteredSearchInput.removeEventListener('input', this.toggleClearSearchButtonWrapper);\n this.filteredSearchInput.removeEventListener('input', this.handleInputPlaceholderWrapper);\n this.filteredSearchInput.removeEventListener('input', this.handleInputVisualTokenWrapper);\n this.filteredSearchInput.removeEventListener('keydown', this.checkForEnterWrapper);\n this.filteredSearchInput.removeEventListener('keyup', this.checkForBackspaceWrapper);\n this.filteredSearchInput.removeEventListener('click', this.tokenChange);\n this.filteredSearchInput.removeEventListener('keyup', this.tokenChange);\n this.filteredSearchInput.removeEventListener('focus', this.addInputContainerFocusWrapper);\n this.tokensContainer.removeEventListener('click', this.removeTokenWrapper);\n this.tokensContainer.removeEventListener('click', this.editTokenWrapper);\n this.clearSearchButton.removeEventListener('click', this.onClearSearchWrapper);\n document.removeEventListener('click', this.unselectEditTokensWrapper);\n document.removeEventListener('click', this.removeInputContainerFocusWrapper);\n document.removeEventListener('keydown', this.removeSelectedTokenKeydownWrapper);\n event_hub.$off('recentSearchesItemSelected', this.onrecentSearchesItemSelectedWrapper);\n\n this.unbindStateEvents();\n }\n }, {\n key: 'checkForBackspace',\n value: function checkForBackspace(e) {\n // 8 = Backspace Key\n // 46 = Delete Key\n if (e.keyCode === 8 || e.keyCode === 46) {\n var _gl$FilteredSearchVis = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _gl$FilteredSearchVis.lastVisualToken;\n\n var _gl$DropdownUtils$get = gl.DropdownUtils.getVisualTokenValues(lastVisualToken),\n tokenName = _gl$DropdownUtils$get.tokenName,\n tokenValue = _gl$DropdownUtils$get.tokenValue;\n\n var canEdit = tokenName && this.canEdit && this.canEdit(tokenName, tokenValue);\n if (this.filteredSearchInput.value === '' && lastVisualToken && canEdit) {\n this.filteredSearchInput.value = gl.FilteredSearchVisualTokens.getLastTokenPartial();\n gl.FilteredSearchVisualTokens.removeLastTokenPartial();\n }\n\n // Reposition dropdown so that it is aligned with cursor\n this.dropdownManager.updateCurrentDropdownOffset();\n }\n }\n }, {\n key: 'checkForEnter',\n value: function checkForEnter(e) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n var selectionStart = this.filteredSearchInput.selectionStart;\n\n e.preventDefault();\n this.filteredSearchInput.setSelectionRange(selectionStart, selectionStart);\n }\n\n if (e.keyCode === 13) {\n var dropdown = this.dropdownManager.mapping[this.dropdownManager.currentDropdown];\n var dropdownEl = dropdown.element;\n var activeElements = dropdownEl.querySelectorAll('.droplab-item-active');\n\n e.preventDefault();\n\n if (!activeElements.length) {\n if (this.isHandledAsync) {\n e.stopImmediatePropagation();\n\n this.filteredSearchInput.blur();\n this.dropdownManager.resetDropdowns();\n } else {\n // Prevent droplab from opening dropdown\n this.dropdownManager.destroyDroplab();\n }\n\n this.search();\n }\n }\n }\n }, {\n key: 'addInputContainerFocus',\n value: function addInputContainerFocus() {\n addClassIfElementExists(this.filteredSearchInput.closest('.filtered-search-box'), 'focus');\n }\n }, {\n key: 'removeInputContainerFocus',\n value: function removeInputContainerFocus(e) {\n var inputContainer = this.filteredSearchInput.closest('.filtered-search-box');\n var isElementInFilteredSearch = inputContainer && inputContainer.contains(e.target);\n var isElementInDynamicFilterDropdown = e.target.closest('.filter-dropdown') !== null;\n var isElementInStaticFilterDropdown = e.target.closest('ul[data-dropdown]') !== null;\n\n if (!isElementInFilteredSearch && !isElementInDynamicFilterDropdown && !isElementInStaticFilterDropdown && inputContainer) {\n inputContainer.classList.remove('focus');\n }\n }\n }, {\n key: 'removeToken',\n value: function removeToken(e) {\n var removeButtonSelected = e.target.closest('.remove-token');\n\n if (removeButtonSelected) {\n e.preventDefault();\n // Prevent editToken from being triggered after token is removed\n e.stopImmediatePropagation();\n\n var button = e.target.closest('.selectable');\n gl.FilteredSearchVisualTokens.selectToken(button, true);\n this.removeSelectedToken();\n }\n }\n }, {\n key: 'unselectEditTokens',\n value: function unselectEditTokens(e) {\n var inputContainer = this.container.querySelector('.filtered-search-box');\n var isElementInFilteredSearch = inputContainer && inputContainer.contains(e.target);\n var isElementInFilterDropdown = e.target.closest('.filter-dropdown') !== null;\n var isElementTokensContainer = e.target.classList.contains('tokens-container');\n\n if (!isElementInFilteredSearch && !isElementInFilterDropdown || isElementTokensContainer) {\n gl.FilteredSearchVisualTokens.moveInputToTheRight();\n this.dropdownManager.resetDropdowns();\n }\n }\n }, {\n key: 'editToken',\n value: function editToken(e) {\n var token = e.target.closest('.js-visual-token');\n var sanitizedTokenName = token && token.querySelector('.name').textContent.trim();\n var canEdit = this.canEdit && this.canEdit(sanitizedTokenName);\n\n if (token && canEdit) {\n e.preventDefault();\n e.stopPropagation();\n gl.FilteredSearchVisualTokens.editToken(token);\n this.tokenChange();\n }\n }\n }, {\n key: 'toggleClearSearchButton',\n value: function toggleClearSearchButton() {\n var query = gl.DropdownUtils.getSearchQuery();\n var hidden = 'hidden';\n var hasHidden = this.clearSearchButton.classList.contains(hidden);\n\n if (query.length === 0 && !hasHidden) {\n this.clearSearchButton.classList.add(hidden);\n } else if (query.length && hasHidden) {\n this.clearSearchButton.classList.remove(hidden);\n }\n }\n }, {\n key: 'handleInputPlaceholder',\n value: function handleInputPlaceholder() {\n var query = gl.DropdownUtils.getSearchQuery();\n var placeholder = 'Search or filter results...';\n var currentPlaceholder = this.filteredSearchInput.placeholder;\n\n if (query.length === 0 && currentPlaceholder !== placeholder) {\n this.filteredSearchInput.placeholder = placeholder;\n } else if (query.length > 0 && currentPlaceholder !== '') {\n this.filteredSearchInput.placeholder = '';\n }\n }\n }, {\n key: 'removeSelectedTokenKeydown',\n value: function removeSelectedTokenKeydown(e) {\n // 8 = Backspace Key\n // 46 = Delete Key\n if (e.keyCode === 8 || e.keyCode === 46) {\n this.removeSelectedToken();\n }\n }\n }, {\n key: 'removeSelectedToken',\n value: function removeSelectedToken() {\n gl.FilteredSearchVisualTokens.removeSelectedToken();\n this.handleInputPlaceholder();\n this.toggleClearSearchButton();\n this.dropdownManager.updateCurrentDropdownOffset();\n }\n }, {\n key: 'onClearSearch',\n value: function onClearSearch(e) {\n e.preventDefault();\n this.clearSearch();\n }\n }, {\n key: 'clearSearch',\n value: function clearSearch() {\n var _this2 = this;\n\n this.filteredSearchInput.value = '';\n\n var removeElements = [];\n\n [].forEach.call(this.tokensContainer.children, function (t) {\n var canClearToken = t.classList.contains('js-visual-token');\n\n if (canClearToken) {\n var _gl$DropdownUtils$get2 = gl.DropdownUtils.getVisualTokenValues(t),\n tokenName = _gl$DropdownUtils$get2.tokenName,\n tokenValue = _gl$DropdownUtils$get2.tokenValue;\n\n canClearToken = _this2.canEdit && _this2.canEdit(tokenName, tokenValue);\n }\n\n if (canClearToken) {\n removeElements.push(t);\n }\n });\n\n removeElements.forEach(function (el) {\n el.parentElement.removeChild(el);\n });\n\n this.clearSearchButton.classList.add('hidden');\n this.handleInputPlaceholder();\n\n this.dropdownManager.resetDropdowns();\n\n if (this.isHandledAsync) {\n this.search();\n }\n }\n }, {\n key: 'handleInputVisualToken',\n value: function handleInputVisualToken() {\n var input = this.filteredSearchInput;\n\n var _tokenizer$processTok = this.tokenizer.processTokens(input.value, this.filteredSearchTokenKeys.getKeys()),\n tokens = _tokenizer$processTok.tokens,\n searchToken = _tokenizer$processTok.searchToken;\n\n var _gl$FilteredSearchVis2 = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n isLastVisualTokenValid = _gl$FilteredSearchVis2.isLastVisualTokenValid;\n\n if (isLastVisualTokenValid) {\n tokens.forEach(function (t) {\n input.value = input.value.replace(t.key + ':' + t.symbol + t.value, '');\n gl.FilteredSearchVisualTokens.addFilterVisualToken(t.key, '' + t.symbol + t.value);\n });\n\n var fragments = searchToken.split(':');\n if (fragments.length > 1) {\n var inputValues = fragments[0].split(' ');\n var tokenKey = _.last(inputValues);\n\n if (inputValues.length > 1) {\n inputValues.pop();\n var searchTerms = inputValues.join(' ');\n\n input.value = input.value.replace(searchTerms, '');\n gl.FilteredSearchVisualTokens.addSearchVisualToken(searchTerms);\n }\n\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenKey);\n input.value = input.value.replace(tokenKey + ':', '');\n }\n } else {\n // Keep listening to token until we determine that the user is done typing the token value\n var valueCompletedRegex = /([~%@]{0,1}\".+\")|([~%@]{0,1}'.+')|^((?![~%@]')(?![~%@]\")(?!')(?!\")).*/g;\n\n if (searchToken.match(valueCompletedRegex) && input.value[input.value.length - 1] === ' ') {\n gl.FilteredSearchVisualTokens.addFilterVisualToken(searchToken);\n\n // Trim the last space as seen in the if statement above\n input.value = input.value.replace(searchToken, '').trim();\n }\n }\n }\n }, {\n key: 'handleFormSubmit',\n value: function handleFormSubmit(e) {\n e.preventDefault();\n this.search();\n }\n }, {\n key: 'saveCurrentSearchQuery',\n value: function saveCurrentSearchQuery() {\n var _this3 = this;\n\n // Don't save before we have fetched the already saved searches\n this.fetchingRecentSearchesPromise.then(function () {\n var searchQuery = gl.DropdownUtils.getSearchQuery();\n if (searchQuery.length > 0) {\n var resultantSearches = _this3.recentSearchesStore.addRecentSearch(searchQuery);\n _this3.recentSearchesService.save(resultantSearches);\n }\n }).catch(function () {\n // https://gitlab.com/gitlab-org/gitlab-ce/issues/30821\n });\n }\n\n // allows for modifying params array when a param can't be included in the URL (e.g. Service Desk)\n\n }, {\n key: 'getAllParams',\n value: function getAllParams(urlParams) {\n return this.modifyUrlParams ? this.modifyUrlParams(urlParams) : urlParams;\n }\n }, {\n key: 'loadSearchParamsFromURL',\n value: function loadSearchParamsFromURL() {\n var _this4 = this;\n\n var urlParams = gl.utils.getUrlParamsArray();\n var params = this.getAllParams(urlParams);\n var usernameParams = this.getUsernameParams();\n var hasFilteredSearch = false;\n\n params.forEach(function (p) {\n var split = p.split('=');\n var keyParam = decodeURIComponent(split[0]);\n var value = split[1];\n\n // Check if it matches edge conditions listed in this.filteredSearchTokenKeys\n var condition = _this4.filteredSearchTokenKeys.searchByConditionUrl(p);\n\n if (condition) {\n hasFilteredSearch = true;\n var canEdit = _this4.canEdit && _this4.canEdit(condition.tokenKey);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(condition.tokenKey, condition.value, canEdit);\n } else {\n // Sanitize value since URL converts spaces into +\n // Replace before decode so that we know what was originally + versus the encoded +\n var sanitizedValue = value ? decodeURIComponent(value.replace(/\\+/g, ' ')) : value;\n var match = _this4.filteredSearchTokenKeys.searchByKeyParam(keyParam);\n\n if (match) {\n // Use lastIndexOf because the token key is allowed to contain underscore\n // e.g. 'my_reaction' is the token key of 'my_reaction_emoji'\n var lastIndexOf = keyParam.lastIndexOf('_');\n var sanitizedKey = lastIndexOf !== -1 ? keyParam.slice(0, lastIndexOf) : keyParam;\n // Replace underscore with hyphen in the sanitizedkey.\n // e.g. 'my_reaction' => 'my-reaction'\n sanitizedKey = sanitizedKey.replace('_', '-');\n var symbol = match.symbol;\n var quotationsToUse = '';\n\n if (sanitizedValue.indexOf(' ') !== -1) {\n // Prefer \", but use ' if required\n quotationsToUse = sanitizedValue.indexOf('\"') === -1 ? '\"' : '\\'';\n }\n\n hasFilteredSearch = true;\n var _canEdit = _this4.canEdit && _this4.canEdit(sanitizedKey, sanitizedValue);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(sanitizedKey, '' + symbol + quotationsToUse + sanitizedValue + quotationsToUse, _canEdit);\n } else if (!match && keyParam === 'assignee_id') {\n var id = parseInt(value, 10);\n if (usernameParams[id]) {\n hasFilteredSearch = true;\n var tokenName = 'assignee';\n var _canEdit2 = _this4.canEdit && _this4.canEdit(tokenName);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenName, '@' + usernameParams[id], _canEdit2);\n }\n } else if (!match && keyParam === 'author_id') {\n var _id = parseInt(value, 10);\n if (usernameParams[_id]) {\n hasFilteredSearch = true;\n var _tokenName = 'author';\n var _canEdit3 = _this4.canEdit && _this4.canEdit(_tokenName);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(_tokenName, '@' + usernameParams[_id], _canEdit3);\n }\n } else if (!match && keyParam === 'search') {\n hasFilteredSearch = true;\n _this4.filteredSearchInput.value = sanitizedValue;\n }\n }\n });\n\n this.saveCurrentSearchQuery();\n\n if (hasFilteredSearch) {\n this.clearSearchButton.classList.remove('hidden');\n this.handleInputPlaceholder();\n }\n }\n }, {\n key: 'searchState',\n value: function searchState(e) {\n e.preventDefault();\n var target = e.currentTarget;\n // remove focus outline after click\n target.blur();\n\n var state = target.dataset && target.dataset.state;\n\n if (state) {\n this.search(state);\n }\n }\n }, {\n key: 'search',\n value: function search() {\n var _this5 = this;\n\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n var paths = [];\n var searchQuery = gl.DropdownUtils.getSearchQuery();\n\n this.saveCurrentSearchQuery();\n\n var _tokenizer$processTok2 = this.tokenizer.processTokens(searchQuery, this.filteredSearchTokenKeys.getKeys()),\n tokens = _tokenizer$processTok2.tokens,\n searchToken = _tokenizer$processTok2.searchToken;\n\n var currentState = state || gl.utils.getParameterByName('state') || 'opened';\n paths.push('state=' + currentState);\n\n tokens.forEach(function (token) {\n var condition = _this5.filteredSearchTokenKeys.searchByConditionKeyValue(token.key, token.value.toLowerCase());\n\n var _ref = _this5.filteredSearchTokenKeys.searchByKey(token.key) || {},\n param = _ref.param;\n // Replace hyphen with underscore to use as request parameter\n // e.g. 'my-reaction' => 'my_reaction'\n\n\n var underscoredKey = token.key.replace('-', '_');\n var keyParam = param ? underscoredKey + '_' + param : underscoredKey;\n var tokenPath = '';\n\n if (condition) {\n tokenPath = condition.url;\n } else {\n var tokenValue = token.value;\n\n if (tokenValue[0] === '\\'' && tokenValue[tokenValue.length - 1] === '\\'' || tokenValue[0] === '\"' && tokenValue[tokenValue.length - 1] === '\"') {\n tokenValue = tokenValue.slice(1, tokenValue.length - 1);\n }\n\n tokenPath = keyParam + '=' + encodeURIComponent(tokenValue);\n }\n\n paths.push(tokenPath);\n });\n\n if (searchToken) {\n var sanitized = searchToken.split(' ').map(function (t) {\n return encodeURIComponent(t);\n }).join('+');\n paths.push('search=' + sanitized);\n }\n\n var parameterizedUrl = '?scope=all&utf8=%E2%9C%93&' + paths.join('&');\n\n if (this.updateObject) {\n this.updateObject(parameterizedUrl);\n } else {\n gl.utils.visitUrl(parameterizedUrl);\n }\n }\n }, {\n key: 'getUsernameParams',\n value: function getUsernameParams() {\n var usernamesById = {};\n try {\n var attribute = this.filteredSearchInput.getAttribute('data-username-params');\n JSON.parse(attribute).forEach(function (user) {\n usernamesById[user.id] = user.username;\n });\n } catch (e) {\n // do nothing\n }\n return usernamesById;\n }\n }, {\n key: 'tokenChange',\n value: function tokenChange() {\n var dropdown = this.dropdownManager.mapping[this.dropdownManager.currentDropdown];\n\n if (dropdown) {\n var currentDropdownRef = dropdown.reference;\n\n this.setDropdownWrapper();\n currentDropdownRef.dispatchInputEvent();\n }\n }\n }, {\n key: 'onrecentSearchesItemSelected',\n value: function onrecentSearchesItemSelected(text) {\n this.clearSearch();\n this.filteredSearchInput.value = text;\n this.filteredSearchInput.dispatchEvent(new CustomEvent('input'));\n this.search();\n }\n\n // eslint-disable-next-line class-methods-use-this\n\n }, {\n key: 'canEdit',\n value: function canEdit() {\n return true;\n }\n }]);\n\n return FilteredSearchManager;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchManager = filtered_search_manager_FilteredSearchManager;\n// CONCATENATED MODULE: ./filtered_search/filtered_search_tokenizer.js\nvar filtered_search_tokenizer__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction filtered_search_tokenizer__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\nvar FilteredSearchTokenizer = function () {\n function FilteredSearchTokenizer() {\n filtered_search_tokenizer__classCallCheck(this, FilteredSearchTokenizer);\n }\n\n filtered_search_tokenizer__createClass(FilteredSearchTokenizer, null, [{\n key: 'processTokens',\n value: function processTokens(input, allowedKeys) {\n // Regex extracts `(token):(symbol)(value)`\n // Values that start with a double quote must end in a double quote (same for single)\n var tokenRegex = new RegExp('(' + allowedKeys.join('|') + '):([~%@]?)(?:(\\'[^\\']*\\'{0,1})|(\"[^\"]*\"{0,1})|(\\\\S+))', 'g');\n var tokens = [];\n var tokenIndexes = []; // stores key+value for simple search\n var lastToken = null;\n var searchToken = input.replace(tokenRegex, function (match, key, symbol, v1, v2, v3) {\n var tokenValue = v1 || v2 || v3;\n var tokenSymbol = symbol;\n var tokenIndex = '';\n\n if (tokenValue === '~' || tokenValue === '%' || tokenValue === '@') {\n tokenSymbol = tokenValue;\n tokenValue = '';\n }\n\n tokenIndex = key + ':' + tokenValue;\n\n // Prevent adding duplicates\n if (tokenIndexes.indexOf(tokenIndex) === -1) {\n tokenIndexes.push(tokenIndex);\n\n tokens.push({\n key: key,\n value: tokenValue || '',\n symbol: tokenSymbol || ''\n });\n }\n\n return '';\n }).replace(/\\s{2,}/g, ' ').trim() || '';\n\n if (tokens.length > 0) {\n var last = tokens[tokens.length - 1];\n var lastString = last.key + ':' + last.symbol + last.value;\n lastToken = input.lastIndexOf(lastString) === input.length - lastString.length ? last : searchToken;\n } else {\n lastToken = searchToken;\n }\n\n return {\n tokens: tokens,\n lastToken: lastToken,\n searchToken: searchToken\n };\n }\n }]);\n\n return FilteredSearchTokenizer;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchTokenizer = FilteredSearchTokenizer;\n// EXTERNAL MODULE: ./api.js\nvar api = __webpack_require__(\"./api.js\");\n\n// EXTERNAL MODULE: ./lib/utils/cache.js\nvar cache = __webpack_require__(\"./lib/utils/cache.js\");\n\n// CONCATENATED MODULE: ./lib/utils/users_cache.js\nvar users_cache__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction users_cache__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction users_cache__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction users_cache__inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\n\nvar users_cache_UsersCache = function (_Cache) {\n users_cache__inherits(UsersCache, _Cache);\n\n function UsersCache() {\n users_cache__classCallCheck(this, UsersCache);\n\n return users_cache__possibleConstructorReturn(this, (UsersCache.__proto__ || Object.getPrototypeOf(UsersCache)).apply(this, arguments));\n }\n\n users_cache__createClass(UsersCache, [{\n key: 'retrieve',\n value: function retrieve(username) {\n var _this2 = this;\n\n if (this.hasData(username)) {\n return Promise.resolve(this.get(username));\n }\n\n return api[\"a\" /* default */].users('', { username: username }).then(function (users) {\n if (!users.length) {\n throw new Error('User \"' + username + '\" could not be found!');\n }\n\n if (users.length > 1) {\n throw new Error('Expected username \"' + username + '\" to be unique!');\n }\n\n var user = users[0];\n _this2.internalStorage[username] = user;\n return user;\n });\n // missing catch is intentional, error handling depends on use case\n }\n }]);\n\n return UsersCache;\n}(cache[\"a\" /* default */]);\n\n/* harmony default export */ var users_cache = (new users_cache_UsersCache());\n// CONCATENATED MODULE: ./filtered_search/filtered_search_visual_tokens.js\nvar filtered_search_visual_tokens__createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction filtered_search_visual_tokens__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n\n\n\n\n\nvar filtered_search_visual_tokens_FilteredSearchVisualTokens = function () {\n function FilteredSearchVisualTokens() {\n filtered_search_visual_tokens__classCallCheck(this, FilteredSearchVisualTokens);\n }\n\n filtered_search_visual_tokens__createClass(FilteredSearchVisualTokens, null, [{\n key: 'getLastVisualTokenBeforeInput',\n value: function getLastVisualTokenBeforeInput() {\n var inputLi = container[\"a\" /* default */].container.querySelector('.input-token');\n var lastVisualToken = inputLi && inputLi.previousElementSibling;\n\n return {\n lastVisualToken: lastVisualToken,\n isLastVisualTokenValid: lastVisualToken === null || lastVisualToken.className.indexOf('filtered-search-term') !== -1 || lastVisualToken && lastVisualToken.querySelector('.value') !== null\n };\n }\n }, {\n key: 'unselectTokens',\n value: function unselectTokens() {\n var otherTokens = container[\"a\" /* default */].container.querySelectorAll('.js-visual-token .selectable.selected');\n [].forEach.call(otherTokens, function (t) {\n return t.classList.remove('selected');\n });\n }\n }, {\n key: 'selectToken',\n value: function selectToken(tokenButton) {\n var forceSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var selected = tokenButton.classList.contains('selected');\n FilteredSearchVisualTokens.unselectTokens();\n\n if (!selected || forceSelection) {\n tokenButton.classList.add('selected');\n }\n }\n }, {\n key: 'removeSelectedToken',\n value: function removeSelectedToken() {\n var selected = container[\"a\" /* default */].container.querySelector('.js-visual-token .selected');\n\n if (selected) {\n var li = selected.closest('.js-visual-token');\n li.parentElement.removeChild(li);\n }\n }\n }, {\n key: 'createVisualTokenElementHTML',\n value: function createVisualTokenElementHTML() {\n var canEdit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n return '\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n ';\n }\n }, {\n key: 'setTokenStyle',\n value: function setTokenStyle(tokenContainer, backgroundColor, textColor) {\n var token = tokenContainer;\n\n // Labels with linear gradient should not override default background color\n if (backgroundColor.indexOf('linear-gradient') === -1) {\n token.style.backgroundColor = backgroundColor;\n }\n\n token.style.color = textColor;\n\n if (textColor === '#FFFFFF') {\n var removeToken = token.querySelector('.remove-token');\n removeToken.classList.add('inverted');\n }\n\n return token;\n }\n }, {\n key: 'preprocessLabel',\n value: function preprocessLabel(labelsEndpoint, labels) {\n var processed = labels;\n\n if (!labels.preprocessed) {\n processed = gl.DropdownUtils.duplicateLabelPreprocessing(labels);\n ajax_cache[\"a\" /* default */].override(labelsEndpoint, processed);\n processed.preprocessed = true;\n }\n\n return processed;\n }\n }, {\n key: 'updateLabelTokenColor',\n value: function updateLabelTokenColor(tokenValueContainer, tokenValue) {\n var filteredSearchInput = container[\"a\" /* default */].container.querySelector('.filtered-search');\n var baseEndpoint = filteredSearchInput.dataset.baseEndpoint;\n var labelsEndpoint = baseEndpoint + '/labels.json';\n\n return ajax_cache[\"a\" /* default */].retrieve(labelsEndpoint).then(FilteredSearchVisualTokens.preprocessLabel.bind(null, labelsEndpoint)).then(function (labels) {\n var matchingLabel = (labels || []).find(function (label) {\n return '~' + gl.DropdownUtils.getEscapedText(label.title) === tokenValue;\n });\n\n if (!matchingLabel) {\n return;\n }\n\n FilteredSearchVisualTokens.setTokenStyle(tokenValueContainer, matchingLabel.color, matchingLabel.text_color);\n }).catch(function () {\n return new flash[\"a\" /* default */]('An error occurred while fetching label colors.');\n });\n }\n }, {\n key: 'updateUserTokenAppearance',\n value: function updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) {\n if (tokenValue === 'none') {\n return Promise.resolve();\n }\n\n var username = tokenValue.replace(/^@/, '');\n return users_cache.retrieve(username).then(function (user) {\n if (!user) {\n return;\n }\n\n /* eslint-disable no-param-reassign */\n tokenValueContainer.dataset.originalValue = tokenValue;\n tokenValueElement.innerHTML = '\\n \"\"\\n ' + _.escape(user.name) + '\\n ';\n /* eslint-enable no-param-reassign */\n })\n // ignore error and leave username in the search bar\n .catch(function () {});\n }\n }, {\n key: 'updateEmojiTokenAppearance',\n value: function updateEmojiTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) {\n var container = tokenValueContainer;\n var element = tokenValueElement;\n\n return __webpack_require__.e/* import() */(\"emoji\").then(__webpack_require__.bind(null, \"./emoji/index.js\")).then(function (Emoji) {\n if (!Emoji.isEmojiNameValid(tokenValue)) {\n return;\n }\n\n container.dataset.originalValue = tokenValue;\n element.innerHTML = Emoji.glEmojiTag(tokenValue);\n })\n // ignore error and leave emoji name in the search bar\n .catch(function () {});\n }\n }, {\n key: 'renderVisualTokenValue',\n value: function renderVisualTokenValue(parentElement, tokenName, tokenValue) {\n var tokenValueContainer = parentElement.querySelector('.value-container');\n var tokenValueElement = tokenValueContainer.querySelector('.value');\n tokenValueElement.innerText = tokenValue;\n\n var tokenType = tokenName.toLowerCase();\n if (tokenType === 'label') {\n FilteredSearchVisualTokens.updateLabelTokenColor(tokenValueContainer, tokenValue);\n } else if (tokenType === 'author' || tokenType === 'assignee') {\n FilteredSearchVisualTokens.updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue);\n } else if (tokenType === 'my-reaction') {\n FilteredSearchVisualTokens.updateEmojiTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue);\n }\n }\n }, {\n key: 'addVisualTokenElement',\n value: function addVisualTokenElement(name, value, isSearchTerm, canEdit) {\n var li = document.createElement('li');\n li.classList.add('js-visual-token');\n li.classList.add(isSearchTerm ? 'filtered-search-term' : 'filtered-search-token');\n\n if (value) {\n li.innerHTML = FilteredSearchVisualTokens.createVisualTokenElementHTML(canEdit);\n FilteredSearchVisualTokens.renderVisualTokenValue(li, name, value);\n } else {\n li.innerHTML = '
';\n }\n li.querySelector('.name').innerText = name;\n\n var tokensContainer = container[\"a\" /* default */].container.querySelector('.tokens-container');\n var input = container[\"a\" /* default */].container.querySelector('.filtered-search');\n tokensContainer.insertBefore(li, input.parentElement);\n }\n }, {\n key: 'addValueToPreviousVisualTokenElement',\n value: function addValueToPreviousVisualTokenElement(value) {\n var _FilteredSearchVisual = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _FilteredSearchVisual.lastVisualToken,\n isLastVisualTokenValid = _FilteredSearchVisual.isLastVisualTokenValid;\n\n if (!isLastVisualTokenValid && lastVisualToken.classList.contains('filtered-search-token')) {\n var name = FilteredSearchVisualTokens.getLastTokenPartial();\n lastVisualToken.innerHTML = FilteredSearchVisualTokens.createVisualTokenElementHTML();\n lastVisualToken.querySelector('.name').innerText = name;\n FilteredSearchVisualTokens.renderVisualTokenValue(lastVisualToken, name, value);\n }\n }\n }, {\n key: 'addFilterVisualToken',\n value: function addFilterVisualToken(tokenName, tokenValue, canEdit) {\n var _FilteredSearchVisual2 = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _FilteredSearchVisual2.lastVisualToken,\n isLastVisualTokenValid = _FilteredSearchVisual2.isLastVisualTokenValid;\n\n var addVisualTokenElement = FilteredSearchVisualTokens.addVisualTokenElement;\n\n if (isLastVisualTokenValid) {\n addVisualTokenElement(tokenName, tokenValue, false, canEdit);\n } else {\n var previousTokenName = lastVisualToken.querySelector('.name').innerText;\n var tokensContainer = container[\"a\" /* default */].container.querySelector('.tokens-container');\n tokensContainer.removeChild(lastVisualToken);\n\n var value = tokenValue || tokenName;\n addVisualTokenElement(previousTokenName, value, false, canEdit);\n }\n }\n }, {\n key: 'addSearchVisualToken',\n value: function addSearchVisualToken(searchTerm) {\n var _FilteredSearchVisual3 = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _FilteredSearchVisual3.lastVisualToken;\n\n if (lastVisualToken && lastVisualToken.classList.contains('filtered-search-term')) {\n lastVisualToken.querySelector('.name').innerText += ' ' + searchTerm;\n } else {\n FilteredSearchVisualTokens.addVisualTokenElement(searchTerm, null, true);\n }\n }\n }, {\n key: 'getLastTokenPartial',\n value: function getLastTokenPartial() {\n var _FilteredSearchVisual4 = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _FilteredSearchVisual4.lastVisualToken;\n\n if (!lastVisualToken) return '';\n\n var valueContainer = lastVisualToken.querySelector('.value-container');\n var originalValue = valueContainer && valueContainer.dataset.originalValue;\n if (originalValue) {\n return originalValue;\n }\n\n var value = lastVisualToken.querySelector('.value');\n var name = lastVisualToken.querySelector('.name');\n\n var valueText = value ? value.innerText : '';\n var nameText = name ? name.innerText : '';\n\n return valueText || nameText;\n }\n }, {\n key: 'removeLastTokenPartial',\n value: function removeLastTokenPartial() {\n var _FilteredSearchVisual5 = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n lastVisualToken = _FilteredSearchVisual5.lastVisualToken;\n\n if (lastVisualToken) {\n var value = lastVisualToken.querySelector('.value');\n\n if (value) {\n var button = lastVisualToken.querySelector('.selectable');\n var valueContainer = lastVisualToken.querySelector('.value-container');\n button.removeChild(valueContainer);\n lastVisualToken.innerHTML = button.innerHTML;\n } else {\n lastVisualToken.closest('.tokens-container').removeChild(lastVisualToken);\n }\n }\n }\n }, {\n key: 'tokenizeInput',\n value: function tokenizeInput() {\n var input = container[\"a\" /* default */].container.querySelector('.filtered-search');\n\n var _gl$FilteredSearchVis = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n isLastVisualTokenValid = _gl$FilteredSearchVis.isLastVisualTokenValid;\n\n if (input.value) {\n if (isLastVisualTokenValid) {\n gl.FilteredSearchVisualTokens.addSearchVisualToken(input.value);\n } else {\n FilteredSearchVisualTokens.addValueToPreviousVisualTokenElement(input.value);\n }\n\n input.value = '';\n }\n }\n }, {\n key: 'editToken',\n value: function editToken(token) {\n var input = container[\"a\" /* default */].container.querySelector('.filtered-search');\n\n FilteredSearchVisualTokens.tokenizeInput();\n\n // Replace token with input field\n var tokenContainer = token.parentElement;\n var inputLi = input.parentElement;\n tokenContainer.replaceChild(inputLi, token);\n\n var nameElement = token.querySelector('.name');\n var value = void 0;\n\n if (token.classList.contains('filtered-search-token')) {\n FilteredSearchVisualTokens.addFilterVisualToken(nameElement.innerText);\n\n var valueContainerElement = token.querySelector('.value-container');\n value = valueContainerElement.dataset.originalValue;\n\n if (!value) {\n var valueElement = valueContainerElement.querySelector('.value');\n value = valueElement.innerText;\n }\n }\n\n // token is a search term\n if (!value) {\n value = nameElement.innerText;\n }\n\n input.value = value;\n\n // Opens dropdown\n var inputEvent = new Event('input');\n input.dispatchEvent(inputEvent);\n\n // Adds cursor to input\n input.focus();\n }\n }, {\n key: 'moveInputToTheRight',\n value: function moveInputToTheRight() {\n var input = container[\"a\" /* default */].container.querySelector('.filtered-search');\n\n if (!input) return;\n\n var inputLi = input.parentElement;\n var tokenContainer = container[\"a\" /* default */].container.querySelector('.tokens-container');\n\n FilteredSearchVisualTokens.tokenizeInput();\n\n if (!tokenContainer.lastElementChild.isEqualNode(inputLi)) {\n var _gl$FilteredSearchVis2 = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput(),\n isLastVisualTokenValid = _gl$FilteredSearchVis2.isLastVisualTokenValid;\n\n if (!isLastVisualTokenValid) {\n var lastPartial = gl.FilteredSearchVisualTokens.getLastTokenPartial();\n gl.FilteredSearchVisualTokens.removeLastTokenPartial();\n gl.FilteredSearchVisualTokens.addSearchVisualToken(lastPartial);\n }\n\n tokenContainer.removeChild(inputLi);\n tokenContainer.appendChild(inputLi);\n }\n }\n }]);\n\n return FilteredSearchVisualTokens;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchVisualTokens = filtered_search_visual_tokens_FilteredSearchVisualTokens;\n// CONCATENATED MODULE: ./filtered_search/filtered_search_bundle.js\n\n\n\n\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ \"./filtered_search/filtered_search_dropdown.js\":\n/***/ (function(module, exports) {\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar DATA_DROPDOWN_TRIGGER = 'data-dropdown-trigger';\n\nvar FilteredSearchDropdown = function () {\n function FilteredSearchDropdown(_ref) {\n var droplab = _ref.droplab,\n dropdown = _ref.dropdown,\n input = _ref.input,\n filter = _ref.filter;\n\n _classCallCheck(this, FilteredSearchDropdown);\n\n this.droplab = droplab;\n this.hookId = input && input.id;\n this.input = input;\n this.filter = filter;\n this.dropdown = dropdown;\n this.loadingTemplate = '
\\n \\n
';\n this.bindEvents();\n }\n\n _createClass(FilteredSearchDropdown, [{\n key: 'bindEvents',\n value: function bindEvents() {\n this.itemClickedWrapper = this.itemClicked.bind(this);\n this.dropdown.addEventListener('click.dl', this.itemClickedWrapper);\n }\n }, {\n key: 'unbindEvents',\n value: function unbindEvents() {\n this.dropdown.removeEventListener('click.dl', this.itemClickedWrapper);\n }\n }, {\n key: 'getCurrentHook',\n value: function getCurrentHook() {\n var _this = this;\n\n return this.droplab.hooks.filter(function (h) {\n return h.id === _this.hookId;\n })[0] || null;\n }\n }, {\n key: 'itemClicked',\n value: function itemClicked(e, getValueFunction) {\n var selected = e.detail.selected;\n\n\n if (selected.tagName === 'LI' && selected.innerHTML) {\n var dataValueSet = gl.DropdownUtils.setDataValueIfSelected(this.filter, selected);\n\n if (!dataValueSet) {\n var value = getValueFunction(selected);\n gl.FilteredSearchDropdownManager.addWordToInput(this.filter, value, true);\n }\n\n this.resetFilters();\n this.dismissDropdown();\n this.dispatchInputEvent();\n }\n }\n }, {\n key: 'setAsDropdown',\n value: function setAsDropdown() {\n this.input.setAttribute(DATA_DROPDOWN_TRIGGER, '#' + this.dropdown.id);\n }\n }, {\n key: 'setOffset',\n value: function setOffset() {\n var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n if (window.innerWidth > 480) {\n this.dropdown.style.left = offset + 'px';\n } else {\n this.dropdown.style.left = '0px';\n }\n }\n }, {\n key: 'renderContent',\n value: function renderContent() {\n var forceShowList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var currentHook = this.getCurrentHook();\n if (forceShowList && currentHook && currentHook.list.hidden) {\n currentHook.list.show();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var forceRenderContent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var forceShowList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n this.setAsDropdown();\n\n var currentHook = this.getCurrentHook();\n var firstTimeInitialized = currentHook === null;\n\n if (firstTimeInitialized || forceRenderContent) {\n this.renderContent(forceShowList);\n } else if (currentHook.list.list.id !== this.dropdown.id) {\n this.renderContent(forceShowList);\n }\n }\n }, {\n key: 'dismissDropdown',\n value: function dismissDropdown() {\n // Focusing on the input will dismiss dropdown\n // (default droplab functionality)\n this.input.focus();\n }\n }, {\n key: 'dispatchInputEvent',\n value: function dispatchInputEvent() {\n // Propogate input change to FilteredSearchDropdownManager\n // so that it can determine which dropdowns to open\n this.input.dispatchEvent(new CustomEvent('input', {\n bubbles: true,\n cancelable: true\n }));\n }\n }, {\n key: 'dispatchFormSubmitEvent',\n value: function dispatchFormSubmitEvent() {\n // dispatchEvent() is necessary as form.submit() does not\n // trigger event handlers\n this.input.form.dispatchEvent(new Event('submit'));\n }\n }, {\n key: 'hideDropdown',\n value: function hideDropdown() {\n var currentHook = this.getCurrentHook();\n if (currentHook) {\n currentHook.list.hide();\n }\n }\n }, {\n key: 'resetFilters',\n value: function resetFilters() {\n var hook = this.getCurrentHook();\n\n if (hook) {\n var data = hook.list.data || [];\n var results = data.map(function (o) {\n var updated = o;\n updated.droplab_hidden = false;\n return updated;\n });\n hook.list.render(results);\n }\n }\n }]);\n\n return FilteredSearchDropdown;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchDropdown = FilteredSearchDropdown;\n\n/***/ }),\n\n/***/ \"./filtered_search/filtered_search_token_keys.js\":\n/***/ (function(module, exports) {\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar tokenKeys = [{\n key: 'author',\n type: 'string',\n param: 'username',\n symbol: '@',\n icon: 'pencil',\n tag: '@author'\n}, {\n key: 'assignee',\n type: 'string',\n param: 'username',\n symbol: '@',\n icon: 'user',\n tag: '@assignee'\n}, {\n key: 'milestone',\n type: 'string',\n param: 'title',\n symbol: '%',\n icon: 'clock-o',\n tag: '%milestone'\n}, {\n key: 'label',\n type: 'array',\n param: 'name[]',\n symbol: '~',\n icon: 'tag',\n tag: '~label'\n}];\n\nif (gon.current_user_id) {\n // Appending tokenkeys only logged-in\n tokenKeys.push({\n key: 'my-reaction',\n type: 'string',\n param: 'emoji',\n symbol: '',\n icon: 'thumbs-up',\n tag: 'emoji'\n });\n}\n\nvar alternativeTokenKeys = [{\n key: 'label',\n type: 'string',\n param: 'name',\n symbol: '~'\n}];\n\nvar tokenKeysWithAlternative = tokenKeys.concat(alternativeTokenKeys);\n\nvar conditions = [{\n url: 'assignee_id=0',\n tokenKey: 'assignee',\n value: 'none'\n}, {\n url: 'milestone_title=No+Milestone',\n tokenKey: 'milestone',\n value: 'none'\n}, {\n url: 'milestone_title=%23upcoming',\n tokenKey: 'milestone',\n value: 'upcoming'\n}, {\n url: 'milestone_title=%23started',\n tokenKey: 'milestone',\n value: 'started'\n}, {\n url: 'label_name[]=No+Label',\n tokenKey: 'label',\n value: 'none'\n}];\n\nvar FilteredSearchTokenKeys = function () {\n function FilteredSearchTokenKeys() {\n _classCallCheck(this, FilteredSearchTokenKeys);\n }\n\n _createClass(FilteredSearchTokenKeys, null, [{\n key: 'get',\n value: function get() {\n return tokenKeys;\n }\n }, {\n key: 'getKeys',\n value: function getKeys() {\n return tokenKeys.map(function (i) {\n return i.key;\n });\n }\n }, {\n key: 'getAlternatives',\n value: function getAlternatives() {\n return alternativeTokenKeys;\n }\n }, {\n key: 'getConditions',\n value: function getConditions() {\n return conditions;\n }\n }, {\n key: 'searchByKey',\n value: function searchByKey(key) {\n return tokenKeys.find(function (tokenKey) {\n return tokenKey.key === key;\n }) || null;\n }\n }, {\n key: 'searchBySymbol',\n value: function searchBySymbol(symbol) {\n return tokenKeys.find(function (tokenKey) {\n return tokenKey.symbol === symbol;\n }) || null;\n }\n }, {\n key: 'searchByKeyParam',\n value: function searchByKeyParam(keyParam) {\n return tokenKeysWithAlternative.find(function (tokenKey) {\n var tokenKeyParam = tokenKey.key;\n\n // Replace hyphen with underscore to compare keyParam with tokenKeyParam\n // e.g. 'my-reaction' => 'my_reaction'\n tokenKeyParam = tokenKeyParam.replace('-', '_');\n\n if (tokenKey.param) {\n tokenKeyParam += '_' + tokenKey.param;\n }\n\n return keyParam === tokenKeyParam;\n }) || null;\n }\n }, {\n key: 'searchByConditionUrl',\n value: function searchByConditionUrl(url) {\n return conditions.find(function (condition) {\n return condition.url === url;\n }) || null;\n }\n }, {\n key: 'searchByConditionKeyValue',\n value: function searchByConditionKeyValue(key, value) {\n return conditions.find(function (condition) {\n return condition.tokenKey === key && condition.value === value;\n }) || null;\n }\n }]);\n\n return FilteredSearchTokenKeys;\n}();\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchTokenKeys = FilteredSearchTokenKeys;\n\n/***/ })\n\n},[\"./filtered_search/filtered_search_bundle.js\"]);\n\n\n// WEBPACK FOOTER //\n// filtered_search.22aa5fab57212df42769.bundle.js","/* eslint-disable */\n\nimport AjaxCache from '~/lib/utils/ajax_cache';\n\nconst Ajax = {\n _loadData: function _loadData(data, config, self) {\n if (config.loadingTemplate) {\n var dataLoadingTemplate = self.hook.list.list.querySelector('[data-loading-template]');\n if (dataLoadingTemplate) dataLoadingTemplate.outerHTML = self.listTemplate;\n }\n\n if (!self.destroyed) self.hook.list[config.method].call(self.hook.list, data);\n },\n preprocessing: function preprocessing(config, data) {\n let results = data;\n\n if (config.preprocessing && !data.preprocessed) {\n results = config.preprocessing(data);\n AjaxCache.override(config.endpoint, results);\n }\n\n return results;\n },\n init: function init(hook) {\n var self = this;\n self.destroyed = false;\n var config = hook.config.Ajax;\n this.hook = hook;\n if (!config || !config.endpoint || !config.method) {\n return;\n }\n if (config.method !== 'setData' && config.method !== 'addData') {\n return;\n }\n if (config.loadingTemplate) {\n var dynamicList = hook.list.list.querySelector('[data-dynamic]');\n var loadingTemplate = document.createElement('div');\n loadingTemplate.innerHTML = config.loadingTemplate;\n loadingTemplate.setAttribute('data-loading-template', '');\n this.listTemplate = dynamicList.outerHTML;\n dynamicList.outerHTML = loadingTemplate.outerHTML;\n }\n\n return AjaxCache.retrieve(config.endpoint)\n .then(self.preprocessing.bind(null, config))\n .then((data) => self._loadData(data, config, self))\n .catch(config.onError);\n },\n destroy: function() {\n this.destroyed = true;\n }\n};\n\nexport default Ajax;\n\n\n\n// WEBPACK FOOTER //\n// ./droplab/plugins/ajax.js","/* eslint-disable */\n\nconst Filter = {\n keydown: function(e){\n if (this.destroyed) return;\n\n var hiddenCount = 0;\n var dataHiddenCount = 0;\n\n var list = e.detail.hook.list;\n var data = list.data;\n var value = e.detail.hook.trigger.value.toLowerCase();\n var config = e.detail.hook.config.Filter;\n var matches = [];\n var filterFunction;\n // will only work on dynamically set data\n if(!data){\n return;\n }\n\n if (config && config.filterFunction && typeof config.filterFunction === 'function') {\n filterFunction = config.filterFunction;\n } else {\n filterFunction = function(o){\n // cheap string search\n o.droplab_hidden = o[config.template].toLowerCase().indexOf(value) === -1;\n return o;\n };\n }\n\n dataHiddenCount = data.filter(function(o) {\n return !o.droplab_hidden;\n }).length;\n\n matches = data.map(function(o) {\n return filterFunction(o, value);\n });\n\n hiddenCount = matches.filter(function(o) {\n return !o.droplab_hidden;\n }).length;\n\n if (dataHiddenCount !== hiddenCount) {\n list.setData(matches);\n list.currentIndex = 0;\n }\n },\n\n debounceKeydown: function debounceKeydown(e) {\n if ([\n 13, // enter\n 16, // shift\n 17, // ctrl\n 18, // alt\n 20, // caps lock\n 37, // left arrow\n 38, // up arrow\n 39, // right arrow\n 40, // down arrow\n 91, // left window\n 92, // right window\n 93, // select\n ].indexOf(e.detail.which || e.detail.keyCode) > -1) return;\n\n if (this.timeout) clearTimeout(this.timeout);\n this.timeout = setTimeout(this.keydown.bind(this, e), 200);\n },\n\n init: function init(hook) {\n var config = hook.config.Filter;\n\n if (!config || !config.template) return;\n\n this.hook = hook;\n this.destroyed = false;\n\n this.eventWrapper = {};\n this.eventWrapper.debounceKeydown = this.debounceKeydown.bind(this);\n\n this.hook.trigger.addEventListener('keydown.dl', this.eventWrapper.debounceKeydown);\n this.hook.trigger.addEventListener('mousedown.dl', this.eventWrapper.debounceKeydown);\n },\n\n destroy: function destroy() {\n if (this.timeout) clearTimeout(this.timeout);\n this.destroyed = true;\n\n this.hook.trigger.removeEventListener('keydown.dl', this.eventWrapper.debounceKeydown);\n this.hook.trigger.removeEventListener('mousedown.dl', this.eventWrapper.debounceKeydown);\n }\n};\n\nexport default Filter;\n\n\n\n// WEBPACK FOOTER //\n// ./droplab/plugins/filter.js","import Flash from '../flash';\nimport Ajax from '../droplab/plugins/ajax';\nimport Filter from '../droplab/plugins/filter';\nimport './filtered_search_dropdown';\n\nclass DropdownEmoji extends gl.FilteredSearchDropdown {\n constructor(options = {}) {\n super(options);\n this.config = {\n Ajax: {\n endpoint: `${gon.relative_url_root || ''}/autocomplete/award_emojis`,\n method: 'setData',\n loadingTemplate: this.loadingTemplate,\n onError() {\n /* eslint-disable no-new */\n new Flash('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n },\n },\n Filter: {\n template: 'name',\n },\n };\n\n import(/* webpackChunkName: 'emoji' */ '~/emoji')\n .then(({ glEmojiTag }) => { this.glEmojiTag = glEmojiTag; })\n .catch(() => { /* ignore error and leave emoji name in the search bar */ });\n\n this.unbindEvents();\n this.bindEvents();\n }\n\n bindEvents() {\n super.bindEvents();\n\n this.listRenderedWrapper = this.listRendered.bind(this);\n this.dropdown.addEventListener('render.dl', this.listRenderedWrapper);\n }\n\n unbindEvents() {\n this.dropdown.removeEventListener('render.dl', this.listRenderedWrapper);\n super.unbindEvents();\n }\n\n listRendered() {\n this.replaceEmojiElement();\n }\n\n itemClicked(e) {\n super.itemClicked(e, (selected) => {\n const name = selected.querySelector('.js-data-value').innerText.trim();\n return gl.DropdownUtils.getEscapedText(name);\n });\n }\n\n renderContent(forceShowList = false) {\n this.droplab.changeHookList(this.hookId, this.dropdown, [Ajax, Filter], this.config);\n super.renderContent(forceShowList);\n }\n\n replaceEmojiElement() {\n if (!this.glEmojiTag) return;\n\n // Replace empty gl-emoji tag to real content\n const dropdownItems = [...this.dropdown.querySelectorAll('.filter-dropdown-item')];\n dropdownItems.forEach((dropdownItem) => {\n const name = dropdownItem.querySelector('.js-data-value').innerText;\n const emojiTag = this.glEmojiTag(name);\n const emojiElement = dropdownItem.querySelector('gl-emoji');\n emojiElement.outerHTML = emojiTag;\n });\n }\n\n init() {\n this.droplab\n .addHook(this.input, this.dropdown, [Ajax, Filter], this.config).init();\n }\n}\n\nwindow.gl = window.gl || {};\ngl.DropdownEmoji = DropdownEmoji;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/dropdown_emoji.js","import Filter from '~/droplab/plugins/filter';\nimport './filtered_search_dropdown';\n\nclass DropdownHint extends gl.FilteredSearchDropdown {\n constructor(options = {}) {\n const { input, tokenKeys } = options;\n super(options);\n this.config = {\n Filter: {\n template: 'hint',\n filterFunction: gl.DropdownUtils.filterHint.bind(null, {\n input,\n allowedKeys: tokenKeys.getKeys(),\n }),\n },\n };\n this.tokenKeys = tokenKeys;\n }\n\n itemClicked(e) {\n const { selected } = e.detail;\n\n if (selected.tagName === 'LI') {\n if (selected.hasAttribute('data-value')) {\n this.dismissDropdown();\n } else if (selected.getAttribute('data-action') === 'submit') {\n this.dismissDropdown();\n this.dispatchFormSubmitEvent();\n } else {\n const token = selected.querySelector('.js-filter-hint').innerText.trim();\n const tag = selected.querySelector('.js-filter-tag').innerText.trim();\n\n if (tag.length) {\n // Get previous input values in the input field and convert them into visual tokens\n const previousInputValues = this.input.value.split(' ');\n const searchTerms = [];\n\n previousInputValues.forEach((value, index) => {\n searchTerms.push(value);\n\n if (index === previousInputValues.length - 1\n && token.indexOf(value.toLowerCase()) !== -1) {\n searchTerms.pop();\n }\n });\n\n if (searchTerms.length > 0) {\n gl.FilteredSearchVisualTokens.addSearchVisualToken(searchTerms.join(' '));\n }\n\n gl.FilteredSearchDropdownManager.addWordToInput(token.replace(':', ''), '', false, this.container);\n }\n this.dismissDropdown();\n this.dispatchInputEvent();\n }\n }\n }\n\n renderContent() {\n const dropdownData = this.tokenKeys.get()\n .map(tokenKey => ({\n icon: `fa-${tokenKey.icon}`,\n hint: tokenKey.key,\n tag: `:${tokenKey.tag}`,\n type: tokenKey.type,\n }));\n\n this.droplab.changeHookList(this.hookId, this.dropdown, [Filter], this.config);\n this.droplab.setData(this.hookId, dropdownData);\n }\n\n init() {\n this.droplab.addHook(this.input, this.dropdown, [Filter], this.config).init();\n }\n}\n\nwindow.gl = window.gl || {};\ngl.DropdownHint = DropdownHint;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/dropdown_hint.js","import Flash from '../flash';\nimport Ajax from '../droplab/plugins/ajax';\nimport Filter from '../droplab/plugins/filter';\nimport './filtered_search_dropdown';\n\nclass DropdownNonUser extends gl.FilteredSearchDropdown {\n constructor(options = {}) {\n const { input, endpoint, symbol, preprocessing } = options;\n super(options);\n this.symbol = symbol;\n this.config = {\n Ajax: {\n endpoint,\n method: 'setData',\n loadingTemplate: this.loadingTemplate,\n preprocessing,\n onError() {\n /* eslint-disable no-new */\n new Flash('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n },\n },\n Filter: {\n filterFunction: gl.DropdownUtils.filterWithSymbol.bind(null, this.symbol, input),\n template: 'title',\n },\n };\n }\n\n itemClicked(e) {\n super.itemClicked(e, (selected) => {\n const title = selected.querySelector('.js-data-value').innerText.trim();\n return `${this.symbol}${gl.DropdownUtils.getEscapedText(title)}`;\n });\n }\n\n renderContent(forceShowList = false) {\n this.droplab\n .changeHookList(this.hookId, this.dropdown, [Ajax, Filter], this.config);\n super.renderContent(forceShowList);\n }\n\n init() {\n this.droplab\n .addHook(this.input, this.dropdown, [Ajax, Filter], this.config).init();\n }\n}\n\nwindow.gl = window.gl || {};\ngl.DropdownNonUser = DropdownNonUser;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/dropdown_non_user.js","/* eslint-disable */\nimport AjaxCache from '../../lib/utils/ajax_cache';\n\nconst AjaxFilter = {\n init: function(hook) {\n this.destroyed = false;\n this.hook = hook;\n this.notLoading();\n\n this.eventWrapper = {};\n this.eventWrapper.debounceTrigger = this.debounceTrigger.bind(this);\n this.hook.trigger.addEventListener('keydown.dl', this.eventWrapper.debounceTrigger);\n this.hook.trigger.addEventListener('focus', this.eventWrapper.debounceTrigger);\n\n this.trigger(true);\n },\n\n notLoading: function notLoading() {\n this.loading = false;\n },\n\n debounceTrigger: function debounceTrigger(e) {\n var NON_CHARACTER_KEYS = [16, 17, 18, 20, 37, 38, 39, 40, 91, 93];\n var invalidKeyPressed = NON_CHARACTER_KEYS.indexOf(e.detail.which || e.detail.keyCode) > -1;\n var focusEvent = e.type === 'focus';\n if (invalidKeyPressed || this.loading) {\n return;\n }\n if (this.timeout) {\n clearTimeout(this.timeout);\n }\n this.timeout = setTimeout(this.trigger.bind(this, focusEvent), 200);\n },\n\n trigger: function trigger(getEntireList) {\n var config = this.hook.config.AjaxFilter;\n var searchValue = this.trigger.value;\n if (!config || !config.endpoint || !config.searchKey) {\n return;\n }\n if (config.searchValueFunction) {\n searchValue = config.searchValueFunction();\n }\n if (config.loadingTemplate && this.hook.list.data === undefined ||\n this.hook.list.data.length === 0) {\n var dynamicList = this.hook.list.list.querySelector('[data-dynamic]');\n var loadingTemplate = document.createElement('div');\n loadingTemplate.innerHTML = config.loadingTemplate;\n loadingTemplate.setAttribute('data-loading-template', true);\n this.listTemplate = dynamicList.outerHTML;\n dynamicList.outerHTML = loadingTemplate.outerHTML;\n }\n if (getEntireList) {\n searchValue = '';\n }\n if (config.searchKey === searchValue) {\n return this.list.show();\n }\n this.loading = true;\n var params = config.params || {};\n params[config.searchKey] = searchValue;\n var url = config.endpoint + this.buildParams(params);\n return AjaxCache.retrieve(url)\n .then((data) => {\n this._loadData(data, config);\n if (config.onLoadingFinished) {\n config.onLoadingFinished(data);\n }\n })\n .catch(config.onError);\n },\n\n _loadData(data, config) {\n const list = this.hook.list;\n if (config.loadingTemplate && list.data === undefined ||\n list.data.length === 0) {\n const dataLoadingTemplate = list.list.querySelector('[data-loading-template]');\n if (dataLoadingTemplate) {\n dataLoadingTemplate.outerHTML = this.listTemplate;\n }\n }\n if (!this.destroyed) {\n var hookListChildren = list.list.children;\n var onlyDynamicList = hookListChildren.length === 1 && hookListChildren[0].hasAttribute('data-dynamic');\n if (onlyDynamicList && data.length === 0) {\n list.hide();\n }\n list.setData.call(list, data);\n }\n this.notLoading();\n list.currentIndex = 0;\n },\n\n buildParams: function(params) {\n if (!params) return '';\n var paramsArray = Object.keys(params).map(function(param) {\n return param + '=' + (params[param] || '');\n });\n return '?' + paramsArray.join('&');\n },\n\n destroy: function destroy() {\n if (this.timeout)clearTimeout(this.timeout);\n this.destroyed = true;\n\n this.hook.trigger.removeEventListener('keydown.dl', this.eventWrapper.debounceTrigger);\n this.hook.trigger.removeEventListener('focus', this.eventWrapper.debounceTrigger);\n }\n};\n\nexport default AjaxFilter;\n\n\n\n// WEBPACK FOOTER //\n// ./droplab/plugins/ajax_filter.js","/* eslint-disable import/prefer-default-export */\n\nexport const addClassIfElementExists = (element, className) => {\n if (element) {\n element.classList.add(className);\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/utils/dom_utils.js","import Flash from '../flash';\nimport AjaxFilter from '../droplab/plugins/ajax_filter';\nimport './filtered_search_dropdown';\nimport { addClassIfElementExists } from '../lib/utils/dom_utils';\n\nclass DropdownUser extends gl.FilteredSearchDropdown {\n constructor(options = {}) {\n const { tokenKeys } = options;\n super(options);\n this.config = {\n AjaxFilter: {\n endpoint: `${gon.relative_url_root || ''}/autocomplete/users.json`,\n searchKey: 'search',\n params: {\n per_page: 20,\n active: true,\n group_id: this.getGroupId(),\n project_id: this.getProjectId(),\n current_user: true,\n },\n searchValueFunction: this.getSearchInput.bind(this),\n loadingTemplate: this.loadingTemplate,\n onLoadingFinished: () => {\n this.hideCurrentUser();\n },\n onError() {\n /* eslint-disable no-new */\n new Flash('An error occurred fetching the dropdown data.');\n /* eslint-enable no-new */\n },\n },\n };\n this.tokenKeys = tokenKeys;\n }\n\n hideCurrentUser() {\n addClassIfElementExists(this.dropdown.querySelector('.js-current-user'), 'hidden');\n }\n\n itemClicked(e) {\n super.itemClicked(e,\n selected => selected.querySelector('.dropdown-light-content').innerText.trim());\n }\n\n renderContent(forceShowList = false) {\n this.droplab.changeHookList(this.hookId, this.dropdown, [AjaxFilter], this.config);\n super.renderContent(forceShowList);\n }\n\n getGroupId() {\n return this.input.getAttribute('data-group-id');\n }\n\n getProjectId() {\n return this.input.getAttribute('data-project-id');\n }\n\n getSearchInput() {\n const query = gl.DropdownUtils.getSearchInput(this.input);\n const { lastToken } = gl.FilteredSearchTokenizer.processTokens(query, this.tokenKeys.get());\n\n let value = lastToken || '';\n\n if (value[0] === '@') {\n value = value.slice(1);\n }\n\n // Removes the first character if it is a quotation so that we can search\n // with multiple words\n if (value[0] === '\"' || value[0] === '\\'') {\n value = value.slice(1);\n }\n\n return value;\n }\n\n init() {\n this.droplab.addHook(this.input, this.dropdown, [AjaxFilter], this.config).init();\n }\n}\n\nwindow.gl = window.gl || {};\ngl.DropdownUser = DropdownUser;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/dropdown_user.js","import DropLab from '~/droplab/drop_lab';\nimport FilteredSearchContainer from './container';\n\nclass FilteredSearchDropdownManager {\n constructor(baseEndpoint = '', tokenizer, page) {\n this.container = FilteredSearchContainer.container;\n this.baseEndpoint = baseEndpoint.replace(/\\/$/, '');\n this.tokenizer = tokenizer;\n this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeys;\n this.filteredSearchInput = this.container.querySelector('.filtered-search');\n this.page = page;\n\n this.setupMapping();\n\n this.cleanupWrapper = this.cleanup.bind(this);\n document.addEventListener('beforeunload', this.cleanupWrapper);\n }\n\n cleanup() {\n if (this.droplab) {\n this.droplab.destroy();\n this.droplab = null;\n }\n\n this.setupMapping();\n\n document.removeEventListener('beforeunload', this.cleanupWrapper);\n }\n\n setupMapping() {\n this.mapping = {\n author: {\n reference: null,\n gl: 'DropdownUser',\n element: this.container.querySelector('#js-dropdown-author'),\n },\n assignee: {\n reference: null,\n gl: 'DropdownUser',\n element: this.container.querySelector('#js-dropdown-assignee'),\n },\n milestone: {\n reference: null,\n gl: 'DropdownNonUser',\n extraArguments: {\n endpoint: `${this.baseEndpoint}/milestones.json`,\n symbol: '%',\n },\n element: this.container.querySelector('#js-dropdown-milestone'),\n },\n label: {\n reference: null,\n gl: 'DropdownNonUser',\n extraArguments: {\n endpoint: `${this.baseEndpoint}/labels.json`,\n symbol: '~',\n preprocessing: gl.DropdownUtils.duplicateLabelPreprocessing,\n },\n element: this.container.querySelector('#js-dropdown-label'),\n },\n 'my-reaction': {\n reference: null,\n gl: 'DropdownEmoji',\n element: this.container.querySelector('#js-dropdown-my-reaction'),\n },\n hint: {\n reference: null,\n gl: 'DropdownHint',\n element: this.container.querySelector('#js-dropdown-hint'),\n },\n };\n }\n\n static addWordToInput(tokenName, tokenValue = '', clicked = false) {\n const input = FilteredSearchContainer.container.querySelector('.filtered-search');\n\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenName, tokenValue);\n input.value = '';\n\n if (clicked) {\n gl.FilteredSearchVisualTokens.moveInputToTheRight();\n }\n }\n\n updateCurrentDropdownOffset() {\n this.updateDropdownOffset(this.currentDropdown);\n }\n\n updateDropdownOffset(key) {\n // Always align dropdown with the input field\n let offset = this.filteredSearchInput.getBoundingClientRect().left - this.container.querySelector('.scroll-container').getBoundingClientRect().left;\n\n const maxInputWidth = 240;\n const currentDropdownWidth = this.mapping[key].element.clientWidth || maxInputWidth;\n\n // Make sure offset never exceeds the input container\n const offsetMaxWidth = this.container.querySelector('.scroll-container').clientWidth - currentDropdownWidth;\n if (offsetMaxWidth < offset) {\n offset = offsetMaxWidth;\n }\n\n this.mapping[key].reference.setOffset(offset);\n }\n\n load(key, firstLoad = false) {\n const mappingKey = this.mapping[key];\n const glClass = mappingKey.gl;\n const element = mappingKey.element;\n let forceShowList = false;\n\n if (!mappingKey.reference) {\n const defaultArguments = {\n droplab: this.droplab,\n dropdown: element,\n input: this.filteredSearchInput,\n tokenKeys: this.filteredSearchTokenKeys,\n filter: key,\n };\n const extraArguments = mappingKey.extraArguments || {};\n const glArguments = Object.assign({}, defaultArguments, extraArguments);\n\n // Passing glArguments to `new gl[glClass]()`\n mappingKey.reference =\n new (Function.prototype.bind.apply(gl[glClass], [null, glArguments]))();\n }\n\n if (firstLoad) {\n mappingKey.reference.init();\n }\n\n if (this.currentDropdown === 'hint') {\n // Force the dropdown to show if it was clicked from the hint dropdown\n forceShowList = true;\n }\n\n this.updateDropdownOffset(key);\n mappingKey.reference.render(firstLoad, forceShowList);\n\n this.currentDropdown = key;\n }\n\n loadDropdown(dropdownName = '') {\n let firstLoad = false;\n\n if (!this.droplab) {\n firstLoad = true;\n this.droplab = new DropLab();\n }\n\n const match = this.filteredSearchTokenKeys.searchByKey(dropdownName.toLowerCase());\n const shouldOpenFilterDropdown = match && this.currentDropdown !== match.key\n && this.mapping[match.key];\n const shouldOpenHintDropdown = !match && this.currentDropdown !== 'hint';\n\n if (shouldOpenFilterDropdown || shouldOpenHintDropdown) {\n const key = match && match.key ? match.key : 'hint';\n this.load(key, firstLoad);\n }\n }\n\n setDropdown() {\n const query = gl.DropdownUtils.getSearchQuery(true);\n const { lastToken, searchToken } =\n this.tokenizer.processTokens(query, this.filteredSearchTokenKeys.getKeys());\n\n if (this.currentDropdown) {\n this.updateCurrentDropdownOffset();\n }\n\n if (lastToken === searchToken && lastToken !== null) {\n // Token is not fully initialized yet because it has no value\n // Eg. token = 'label:'\n\n const split = lastToken.split(':');\n const dropdownName = _.last(split[0].split(' '));\n this.loadDropdown(split.length > 1 ? dropdownName : '');\n } else if (lastToken) {\n // Token has been initialized into an object because it has a value\n this.loadDropdown(lastToken.key);\n } else {\n this.loadDropdown('hint');\n }\n }\n\n resetDropdowns() {\n if (!this.currentDropdown) {\n return;\n }\n\n // Force current dropdown to hide\n this.mapping[this.currentDropdown].reference.hideDropdown();\n\n // Re-Load dropdown\n this.setDropdown();\n\n // Reset filters for current dropdown\n this.mapping[this.currentDropdown].reference.resetFilters();\n\n // Reposition dropdown so that it is aligned with cursor\n this.updateDropdownOffset(this.currentDropdown);\n }\n\n destroyDroplab() {\n this.droplab.destroy();\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchDropdownManager = FilteredSearchDropdownManager;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_dropdown_manager.js","import Vue from 'vue';\n\nexport default new Vue();\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/event_hub.js","import eventHub from '../event_hub';\n\nexport default {\n name: 'RecentSearchesDropdownContent',\n\n props: {\n items: {\n type: Array,\n required: true,\n },\n isLocalStorageAvailable: {\n type: Boolean,\n required: false,\n default: true,\n },\n allowedKeys: {\n type: Array,\n required: true,\n },\n },\n\n computed: {\n processedItems() {\n return this.items.map((item) => {\n const { tokens, searchToken }\n = gl.FilteredSearchTokenizer.processTokens(item, this.allowedKeys);\n\n const resultantTokens = tokens.map(token => ({\n prefix: `${token.key}:`,\n suffix: `${token.symbol}${token.value}`,\n }));\n\n return {\n text: item,\n tokens: resultantTokens,\n searchToken,\n };\n });\n },\n hasItems() {\n return this.items.length > 0;\n },\n },\n\n methods: {\n onItemActivated(text) {\n eventHub.$emit('recentSearchesItemSelected', text);\n },\n onRequestClearRecentSearches(e) {\n // Stop the dropdown from closing\n e.stopPropagation();\n\n eventHub.$emit('requestClearRecentSearches');\n },\n },\n\n template: `\n
\n \n This feature requires local storage to be enabled\n
\n
    \n \n \n \n \n {{ token.prefix }}{{ token.suffix }}\n \n \n \n {{ item.searchToken }}\n \n \n \n
  • \n
  • \n \n Clear recent searches\n \n
  • \n
\n \n 您最近没有任何搜索\n \n \n `,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/components/recent_searches_dropdown_content.js","import Vue from 'vue';\nimport RecentSearchesDropdownContent from './components/recent_searches_dropdown_content';\nimport eventHub from './event_hub';\n\nclass RecentSearchesRoot {\n constructor(\n recentSearchesStore,\n recentSearchesService,\n wrapperElement,\n ) {\n this.store = recentSearchesStore;\n this.service = recentSearchesService;\n this.wrapperElement = wrapperElement;\n }\n\n init() {\n this.bindEvents();\n this.render();\n }\n\n bindEvents() {\n this.onRequestClearRecentSearchesWrapper = this.onRequestClearRecentSearches.bind(this);\n\n eventHub.$on('requestClearRecentSearches', this.onRequestClearRecentSearchesWrapper);\n }\n\n unbindEvents() {\n eventHub.$off('requestClearRecentSearches', this.onRequestClearRecentSearchesWrapper);\n }\n\n render() {\n const state = this.store.state;\n this.vm = new Vue({\n el: this.wrapperElement,\n data() { return state; },\n template: `\n \n `,\n components: {\n 'recent-searches-dropdown-content': RecentSearchesDropdownContent,\n },\n });\n }\n\n onRequestClearRecentSearches() {\n const resultantSearches = this.store.setRecentSearches([]);\n this.service.save(resultantSearches);\n }\n\n destroy() {\n this.unbindEvents();\n if (this.vm) {\n this.vm.$destroy();\n }\n }\n\n}\n\nexport default RecentSearchesRoot;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/recent_searches_root.js","import _ from 'underscore';\n\nclass RecentSearchesStore {\n constructor(initialState = {}, allowedKeys) {\n this.state = Object.assign({\n isLocalStorageAvailable: true,\n recentSearches: [],\n allowedKeys,\n }, initialState);\n }\n\n addRecentSearch(newSearch) {\n this.setRecentSearches([newSearch].concat(this.state.recentSearches));\n\n return this.state.recentSearches;\n }\n\n setRecentSearches(searches = []) {\n const trimmedSearches = searches.map(search => search.trim());\n this.state.recentSearches = _.uniq(trimmedSearches).slice(0, 5);\n return this.state.recentSearches;\n }\n}\n\nexport default RecentSearchesStore;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/stores/recent_searches_store.js","class RecentSearchesServiceError {\n constructor(message) {\n this.name = 'RecentSearchesServiceError';\n this.message = message || 'Recent Searches Service is unavailable';\n }\n}\n\n// Can't use `extends` for builtin prototypes and get true inheritance yet\nRecentSearchesServiceError.prototype = Error.prototype;\n\nexport default RecentSearchesServiceError;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/services/recent_searches_service_error.js","import RecentSearchesServiceError from './recent_searches_service_error';\nimport AccessorUtilities from '../../lib/utils/accessor';\n\nclass RecentSearchesService {\n constructor(localStorageKey = 'issuable-recent-searches') {\n this.localStorageKey = localStorageKey;\n }\n\n fetch() {\n if (!RecentSearchesService.isAvailable()) {\n const error = new RecentSearchesServiceError();\n return Promise.reject(error);\n }\n\n const input = window.localStorage.getItem(this.localStorageKey);\n\n let searches = [];\n if (input && input.length > 0) {\n try {\n searches = JSON.parse(input);\n } catch (err) {\n return Promise.reject(err);\n }\n }\n\n return Promise.resolve(searches);\n }\n\n save(searches = []) {\n if (!RecentSearchesService.isAvailable()) return;\n\n window.localStorage.setItem(this.localStorageKey, JSON.stringify(searches));\n }\n\n static isAvailable() {\n return AccessorUtilities.isLocalStorageAccessSafe();\n }\n}\n\nexport default RecentSearchesService;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/services/recent_searches_service.js","import Flash from '../flash';\nimport FilteredSearchContainer from './container';\nimport RecentSearchesRoot from './recent_searches_root';\nimport RecentSearchesStore from './stores/recent_searches_store';\nimport RecentSearchesService from './services/recent_searches_service';\nimport eventHub from './event_hub';\nimport { addClassIfElementExists } from '../lib/utils/dom_utils';\n\nclass FilteredSearchManager {\n constructor(page) {\n this.page = page;\n this.container = FilteredSearchContainer.container;\n this.filteredSearchInput = this.container.querySelector('.filtered-search');\n this.filteredSearchInputForm = this.filteredSearchInput.form;\n this.clearSearchButton = this.container.querySelector('.clear-search');\n this.tokensContainer = this.container.querySelector('.tokens-container');\n this.filteredSearchTokenKeys = gl.FilteredSearchTokenKeys;\n\n this.recentSearchesStore = new RecentSearchesStore({\n isLocalStorageAvailable: RecentSearchesService.isAvailable(),\n allowedKeys: this.filteredSearchTokenKeys.getKeys(),\n });\n this.searchHistoryDropdownElement = document.querySelector('.js-filtered-search-history-dropdown');\n const fullPath = this.searchHistoryDropdownElement ?\n this.searchHistoryDropdownElement.dataset.fullPath : 'project';\n let recentSearchesPagePrefix = 'issue-recent-searches';\n if (this.page === 'merge_requests') {\n recentSearchesPagePrefix = 'merge-request-recent-searches';\n }\n const recentSearchesKey = `${fullPath}-${recentSearchesPagePrefix}`;\n this.recentSearchesService = new RecentSearchesService(recentSearchesKey);\n }\n\n setup() {\n // Fetch recent searches from localStorage\n this.fetchingRecentSearchesPromise = this.recentSearchesService.fetch()\n .catch((error) => {\n if (error.name === 'RecentSearchesServiceError') return undefined;\n // eslint-disable-next-line no-new\n new Flash('An error occurred while parsing recent searches');\n // Gracefully fail to empty array\n return [];\n })\n .then((searches) => {\n if (!searches) {\n return;\n }\n\n // Put any searches that may have come in before\n // we fetched the saved searches ahead of the already saved ones\n const resultantSearches = this.recentSearchesStore.setRecentSearches(\n this.recentSearchesStore.state.recentSearches.concat(searches),\n );\n this.recentSearchesService.save(resultantSearches);\n });\n\n if (this.filteredSearchInput) {\n this.tokenizer = gl.FilteredSearchTokenizer;\n this.dropdownManager = new gl.FilteredSearchDropdownManager(this.filteredSearchInput.getAttribute('data-base-endpoint') || '', this.tokenizer, this.page);\n\n this.recentSearchesRoot = new RecentSearchesRoot(\n this.recentSearchesStore,\n this.recentSearchesService,\n this.searchHistoryDropdownElement,\n );\n this.recentSearchesRoot.init();\n\n this.bindEvents();\n this.loadSearchParamsFromURL();\n this.dropdownManager.setDropdown();\n\n this.cleanupWrapper = this.cleanup.bind(this);\n document.addEventListener('beforeunload', this.cleanupWrapper);\n }\n }\n\n cleanup() {\n this.unbindEvents();\n document.removeEventListener('beforeunload', this.cleanupWrapper);\n\n if (this.recentSearchesRoot) {\n this.recentSearchesRoot.destroy();\n }\n }\n\n bindStateEvents() {\n this.stateFilters = document.querySelector('.container-fluid .issues-state-filters');\n\n if (this.stateFilters) {\n this.searchStateWrapper = this.searchState.bind(this);\n\n this.stateFilters.querySelector('[data-state=\"opened\"]')\n .addEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"closed\"]')\n .addEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"all\"]')\n .addEventListener('click', this.searchStateWrapper);\n\n this.mergedState = this.stateFilters.querySelector('[data-state=\"merged\"]');\n if (this.mergedState) {\n this.mergedState.addEventListener('click', this.searchStateWrapper);\n }\n }\n }\n\n unbindStateEvents() {\n if (this.stateFilters) {\n this.stateFilters.querySelector('[data-state=\"opened\"]')\n .removeEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"closed\"]')\n .removeEventListener('click', this.searchStateWrapper);\n this.stateFilters.querySelector('[data-state=\"all\"]')\n .removeEventListener('click', this.searchStateWrapper);\n\n if (this.mergedState) {\n this.mergedState.removeEventListener('click', this.searchStateWrapper);\n }\n }\n }\n\n bindEvents() {\n this.handleFormSubmit = this.handleFormSubmit.bind(this);\n this.setDropdownWrapper = this.dropdownManager.setDropdown.bind(this.dropdownManager);\n this.toggleClearSearchButtonWrapper = this.toggleClearSearchButton.bind(this);\n this.handleInputPlaceholderWrapper = this.handleInputPlaceholder.bind(this);\n this.handleInputVisualTokenWrapper = this.handleInputVisualToken.bind(this);\n this.checkForEnterWrapper = this.checkForEnter.bind(this);\n this.onClearSearchWrapper = this.onClearSearch.bind(this);\n this.checkForBackspaceWrapper = this.checkForBackspace.bind(this);\n this.removeSelectedTokenKeydownWrapper = this.removeSelectedTokenKeydown.bind(this);\n this.unselectEditTokensWrapper = this.unselectEditTokens.bind(this);\n this.editTokenWrapper = this.editToken.bind(this);\n this.tokenChange = this.tokenChange.bind(this);\n this.addInputContainerFocusWrapper = this.addInputContainerFocus.bind(this);\n this.removeInputContainerFocusWrapper = this.removeInputContainerFocus.bind(this);\n this.onrecentSearchesItemSelectedWrapper = this.onrecentSearchesItemSelected.bind(this);\n this.removeTokenWrapper = this.removeToken.bind(this);\n\n this.filteredSearchInputForm.addEventListener('submit', this.handleFormSubmit);\n this.filteredSearchInput.addEventListener('input', this.setDropdownWrapper);\n this.filteredSearchInput.addEventListener('input', this.toggleClearSearchButtonWrapper);\n this.filteredSearchInput.addEventListener('input', this.handleInputPlaceholderWrapper);\n this.filteredSearchInput.addEventListener('input', this.handleInputVisualTokenWrapper);\n this.filteredSearchInput.addEventListener('keydown', this.checkForEnterWrapper);\n this.filteredSearchInput.addEventListener('keyup', this.checkForBackspaceWrapper);\n this.filteredSearchInput.addEventListener('click', this.tokenChange);\n this.filteredSearchInput.addEventListener('keyup', this.tokenChange);\n this.filteredSearchInput.addEventListener('focus', this.addInputContainerFocusWrapper);\n this.tokensContainer.addEventListener('click', this.removeTokenWrapper);\n this.tokensContainer.addEventListener('click', this.editTokenWrapper);\n this.clearSearchButton.addEventListener('click', this.onClearSearchWrapper);\n document.addEventListener('click', this.unselectEditTokensWrapper);\n document.addEventListener('click', this.removeInputContainerFocusWrapper);\n document.addEventListener('keydown', this.removeSelectedTokenKeydownWrapper);\n eventHub.$on('recentSearchesItemSelected', this.onrecentSearchesItemSelectedWrapper);\n\n this.bindStateEvents();\n }\n\n unbindEvents() {\n this.filteredSearchInputForm.removeEventListener('submit', this.handleFormSubmit);\n this.filteredSearchInput.removeEventListener('input', this.setDropdownWrapper);\n this.filteredSearchInput.removeEventListener('input', this.toggleClearSearchButtonWrapper);\n this.filteredSearchInput.removeEventListener('input', this.handleInputPlaceholderWrapper);\n this.filteredSearchInput.removeEventListener('input', this.handleInputVisualTokenWrapper);\n this.filteredSearchInput.removeEventListener('keydown', this.checkForEnterWrapper);\n this.filteredSearchInput.removeEventListener('keyup', this.checkForBackspaceWrapper);\n this.filteredSearchInput.removeEventListener('click', this.tokenChange);\n this.filteredSearchInput.removeEventListener('keyup', this.tokenChange);\n this.filteredSearchInput.removeEventListener('focus', this.addInputContainerFocusWrapper);\n this.tokensContainer.removeEventListener('click', this.removeTokenWrapper);\n this.tokensContainer.removeEventListener('click', this.editTokenWrapper);\n this.clearSearchButton.removeEventListener('click', this.onClearSearchWrapper);\n document.removeEventListener('click', this.unselectEditTokensWrapper);\n document.removeEventListener('click', this.removeInputContainerFocusWrapper);\n document.removeEventListener('keydown', this.removeSelectedTokenKeydownWrapper);\n eventHub.$off('recentSearchesItemSelected', this.onrecentSearchesItemSelectedWrapper);\n\n this.unbindStateEvents();\n }\n\n checkForBackspace(e) {\n // 8 = Backspace Key\n // 46 = Delete Key\n if (e.keyCode === 8 || e.keyCode === 46) {\n const { lastVisualToken } = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n const { tokenName, tokenValue } = gl.DropdownUtils.getVisualTokenValues(lastVisualToken);\n const canEdit = tokenName && this.canEdit && this.canEdit(tokenName, tokenValue);\n if (this.filteredSearchInput.value === '' && lastVisualToken && canEdit) {\n this.filteredSearchInput.value = gl.FilteredSearchVisualTokens.getLastTokenPartial();\n gl.FilteredSearchVisualTokens.removeLastTokenPartial();\n }\n\n // Reposition dropdown so that it is aligned with cursor\n this.dropdownManager.updateCurrentDropdownOffset();\n }\n }\n\n checkForEnter(e) {\n if (e.keyCode === 38 || e.keyCode === 40) {\n const selectionStart = this.filteredSearchInput.selectionStart;\n\n e.preventDefault();\n this.filteredSearchInput.setSelectionRange(selectionStart, selectionStart);\n }\n\n if (e.keyCode === 13) {\n const dropdown = this.dropdownManager.mapping[this.dropdownManager.currentDropdown];\n const dropdownEl = dropdown.element;\n const activeElements = dropdownEl.querySelectorAll('.droplab-item-active');\n\n e.preventDefault();\n\n if (!activeElements.length) {\n if (this.isHandledAsync) {\n e.stopImmediatePropagation();\n\n this.filteredSearchInput.blur();\n this.dropdownManager.resetDropdowns();\n } else {\n // Prevent droplab from opening dropdown\n this.dropdownManager.destroyDroplab();\n }\n\n this.search();\n }\n }\n }\n\n addInputContainerFocus() {\n addClassIfElementExists(this.filteredSearchInput.closest('.filtered-search-box'), 'focus');\n }\n\n removeInputContainerFocus(e) {\n const inputContainer = this.filteredSearchInput.closest('.filtered-search-box');\n const isElementInFilteredSearch = inputContainer && inputContainer.contains(e.target);\n const isElementInDynamicFilterDropdown = e.target.closest('.filter-dropdown') !== null;\n const isElementInStaticFilterDropdown = e.target.closest('ul[data-dropdown]') !== null;\n\n if (!isElementInFilteredSearch && !isElementInDynamicFilterDropdown &&\n !isElementInStaticFilterDropdown && inputContainer) {\n inputContainer.classList.remove('focus');\n }\n }\n\n removeToken(e) {\n const removeButtonSelected = e.target.closest('.remove-token');\n\n if (removeButtonSelected) {\n e.preventDefault();\n // Prevent editToken from being triggered after token is removed\n e.stopImmediatePropagation();\n\n const button = e.target.closest('.selectable');\n gl.FilteredSearchVisualTokens.selectToken(button, true);\n this.removeSelectedToken();\n }\n }\n\n unselectEditTokens(e) {\n const inputContainer = this.container.querySelector('.filtered-search-box');\n const isElementInFilteredSearch = inputContainer && inputContainer.contains(e.target);\n const isElementInFilterDropdown = e.target.closest('.filter-dropdown') !== null;\n const isElementTokensContainer = e.target.classList.contains('tokens-container');\n\n if ((!isElementInFilteredSearch && !isElementInFilterDropdown) || isElementTokensContainer) {\n gl.FilteredSearchVisualTokens.moveInputToTheRight();\n this.dropdownManager.resetDropdowns();\n }\n }\n\n editToken(e) {\n const token = e.target.closest('.js-visual-token');\n const sanitizedTokenName = token && token.querySelector('.name').textContent.trim();\n const canEdit = this.canEdit && this.canEdit(sanitizedTokenName);\n\n if (token && canEdit) {\n e.preventDefault();\n e.stopPropagation();\n gl.FilteredSearchVisualTokens.editToken(token);\n this.tokenChange();\n }\n }\n\n toggleClearSearchButton() {\n const query = gl.DropdownUtils.getSearchQuery();\n const hidden = 'hidden';\n const hasHidden = this.clearSearchButton.classList.contains(hidden);\n\n if (query.length === 0 && !hasHidden) {\n this.clearSearchButton.classList.add(hidden);\n } else if (query.length && hasHidden) {\n this.clearSearchButton.classList.remove(hidden);\n }\n }\n\n handleInputPlaceholder() {\n const query = gl.DropdownUtils.getSearchQuery();\n const placeholder = 'Search or filter results...';\n const currentPlaceholder = this.filteredSearchInput.placeholder;\n\n if (query.length === 0 && currentPlaceholder !== placeholder) {\n this.filteredSearchInput.placeholder = placeholder;\n } else if (query.length > 0 && currentPlaceholder !== '') {\n this.filteredSearchInput.placeholder = '';\n }\n }\n\n removeSelectedTokenKeydown(e) {\n // 8 = Backspace Key\n // 46 = Delete Key\n if (e.keyCode === 8 || e.keyCode === 46) {\n this.removeSelectedToken();\n }\n }\n\n removeSelectedToken() {\n gl.FilteredSearchVisualTokens.removeSelectedToken();\n this.handleInputPlaceholder();\n this.toggleClearSearchButton();\n this.dropdownManager.updateCurrentDropdownOffset();\n }\n\n onClearSearch(e) {\n e.preventDefault();\n this.clearSearch();\n }\n\n clearSearch() {\n this.filteredSearchInput.value = '';\n\n const removeElements = [];\n\n [].forEach.call(this.tokensContainer.children, (t) => {\n let canClearToken = t.classList.contains('js-visual-token');\n\n if (canClearToken) {\n const { tokenName, tokenValue } = gl.DropdownUtils.getVisualTokenValues(t);\n canClearToken = this.canEdit && this.canEdit(tokenName, tokenValue);\n }\n\n if (canClearToken) {\n removeElements.push(t);\n }\n });\n\n removeElements.forEach((el) => {\n el.parentElement.removeChild(el);\n });\n\n this.clearSearchButton.classList.add('hidden');\n this.handleInputPlaceholder();\n\n this.dropdownManager.resetDropdowns();\n\n if (this.isHandledAsync) {\n this.search();\n }\n }\n\n handleInputVisualToken() {\n const input = this.filteredSearchInput;\n const { tokens, searchToken }\n = this.tokenizer.processTokens(input.value, this.filteredSearchTokenKeys.getKeys());\n const { isLastVisualTokenValid }\n = gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (isLastVisualTokenValid) {\n tokens.forEach((t) => {\n input.value = input.value.replace(`${t.key}:${t.symbol}${t.value}`, '');\n gl.FilteredSearchVisualTokens.addFilterVisualToken(t.key, `${t.symbol}${t.value}`);\n });\n\n const fragments = searchToken.split(':');\n if (fragments.length > 1) {\n const inputValues = fragments[0].split(' ');\n const tokenKey = _.last(inputValues);\n\n if (inputValues.length > 1) {\n inputValues.pop();\n const searchTerms = inputValues.join(' ');\n\n input.value = input.value.replace(searchTerms, '');\n gl.FilteredSearchVisualTokens.addSearchVisualToken(searchTerms);\n }\n\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenKey);\n input.value = input.value.replace(`${tokenKey}:`, '');\n }\n } else {\n // Keep listening to token until we determine that the user is done typing the token value\n const valueCompletedRegex = /([~%@]{0,1}\".+\")|([~%@]{0,1}'.+')|^((?![~%@]')(?![~%@]\")(?!')(?!\")).*/g;\n\n if (searchToken.match(valueCompletedRegex) && input.value[input.value.length - 1] === ' ') {\n gl.FilteredSearchVisualTokens.addFilterVisualToken(searchToken);\n\n // Trim the last space as seen in the if statement above\n input.value = input.value.replace(searchToken, '').trim();\n }\n }\n }\n\n handleFormSubmit(e) {\n e.preventDefault();\n this.search();\n }\n\n saveCurrentSearchQuery() {\n // Don't save before we have fetched the already saved searches\n this.fetchingRecentSearchesPromise.then(() => {\n const searchQuery = gl.DropdownUtils.getSearchQuery();\n if (searchQuery.length > 0) {\n const resultantSearches = this.recentSearchesStore.addRecentSearch(searchQuery);\n this.recentSearchesService.save(resultantSearches);\n }\n }).catch(() => {\n // https://gitlab.com/gitlab-org/gitlab-ce/issues/30821\n });\n }\n\n // allows for modifying params array when a param can't be included in the URL (e.g. Service Desk)\n getAllParams(urlParams) {\n return this.modifyUrlParams ? this.modifyUrlParams(urlParams) : urlParams;\n }\n\n loadSearchParamsFromURL() {\n const urlParams = gl.utils.getUrlParamsArray();\n const params = this.getAllParams(urlParams);\n const usernameParams = this.getUsernameParams();\n let hasFilteredSearch = false;\n\n params.forEach((p) => {\n const split = p.split('=');\n const keyParam = decodeURIComponent(split[0]);\n const value = split[1];\n\n // Check if it matches edge conditions listed in this.filteredSearchTokenKeys\n const condition = this.filteredSearchTokenKeys.searchByConditionUrl(p);\n\n if (condition) {\n hasFilteredSearch = true;\n const canEdit = this.canEdit && this.canEdit(condition.tokenKey);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(\n condition.tokenKey,\n condition.value,\n canEdit,\n );\n } else {\n // Sanitize value since URL converts spaces into +\n // Replace before decode so that we know what was originally + versus the encoded +\n const sanitizedValue = value ? decodeURIComponent(value.replace(/\\+/g, ' ')) : value;\n const match = this.filteredSearchTokenKeys.searchByKeyParam(keyParam);\n\n if (match) {\n // Use lastIndexOf because the token key is allowed to contain underscore\n // e.g. 'my_reaction' is the token key of 'my_reaction_emoji'\n const lastIndexOf = keyParam.lastIndexOf('_');\n let sanitizedKey = lastIndexOf !== -1 ? keyParam.slice(0, lastIndexOf) : keyParam;\n // Replace underscore with hyphen in the sanitizedkey.\n // e.g. 'my_reaction' => 'my-reaction'\n sanitizedKey = sanitizedKey.replace('_', '-');\n const symbol = match.symbol;\n let quotationsToUse = '';\n\n if (sanitizedValue.indexOf(' ') !== -1) {\n // Prefer \", but use ' if required\n quotationsToUse = sanitizedValue.indexOf('\"') === -1 ? '\"' : '\\'';\n }\n\n hasFilteredSearch = true;\n const canEdit = this.canEdit && this.canEdit(sanitizedKey, sanitizedValue);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(\n sanitizedKey,\n `${symbol}${quotationsToUse}${sanitizedValue}${quotationsToUse}`,\n canEdit,\n );\n } else if (!match && keyParam === 'assignee_id') {\n const id = parseInt(value, 10);\n if (usernameParams[id]) {\n hasFilteredSearch = true;\n const tokenName = 'assignee';\n const canEdit = this.canEdit && this.canEdit(tokenName);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenName, `@${usernameParams[id]}`, canEdit);\n }\n } else if (!match && keyParam === 'author_id') {\n const id = parseInt(value, 10);\n if (usernameParams[id]) {\n hasFilteredSearch = true;\n const tokenName = 'author';\n const canEdit = this.canEdit && this.canEdit(tokenName);\n gl.FilteredSearchVisualTokens.addFilterVisualToken(tokenName, `@${usernameParams[id]}`, canEdit);\n }\n } else if (!match && keyParam === 'search') {\n hasFilteredSearch = true;\n this.filteredSearchInput.value = sanitizedValue;\n }\n }\n });\n\n this.saveCurrentSearchQuery();\n\n if (hasFilteredSearch) {\n this.clearSearchButton.classList.remove('hidden');\n this.handleInputPlaceholder();\n }\n }\n\n searchState(e) {\n e.preventDefault();\n const target = e.currentTarget;\n // remove focus outline after click\n target.blur();\n\n const state = target.dataset && target.dataset.state;\n\n if (state) {\n this.search(state);\n }\n }\n\n search(state = null) {\n const paths = [];\n const searchQuery = gl.DropdownUtils.getSearchQuery();\n\n this.saveCurrentSearchQuery();\n\n const { tokens, searchToken }\n = this.tokenizer.processTokens(searchQuery, this.filteredSearchTokenKeys.getKeys());\n const currentState = state || gl.utils.getParameterByName('state') || 'opened';\n paths.push(`state=${currentState}`);\n\n tokens.forEach((token) => {\n const condition = this.filteredSearchTokenKeys\n .searchByConditionKeyValue(token.key, token.value.toLowerCase());\n const { param } = this.filteredSearchTokenKeys.searchByKey(token.key) || {};\n // Replace hyphen with underscore to use as request parameter\n // e.g. 'my-reaction' => 'my_reaction'\n const underscoredKey = token.key.replace('-', '_');\n const keyParam = param ? `${underscoredKey}_${param}` : underscoredKey;\n let tokenPath = '';\n\n if (condition) {\n tokenPath = condition.url;\n } else {\n let tokenValue = token.value;\n\n if ((tokenValue[0] === '\\'' && tokenValue[tokenValue.length - 1] === '\\'') ||\n (tokenValue[0] === '\"' && tokenValue[tokenValue.length - 1] === '\"')) {\n tokenValue = tokenValue.slice(1, tokenValue.length - 1);\n }\n\n tokenPath = `${keyParam}=${encodeURIComponent(tokenValue)}`;\n }\n\n paths.push(tokenPath);\n });\n\n if (searchToken) {\n const sanitized = searchToken.split(' ').map(t => encodeURIComponent(t)).join('+');\n paths.push(`search=${sanitized}`);\n }\n\n const parameterizedUrl = `?scope=all&utf8=%E2%9C%93&${paths.join('&')}`;\n\n if (this.updateObject) {\n this.updateObject(parameterizedUrl);\n } else {\n gl.utils.visitUrl(parameterizedUrl);\n }\n }\n\n getUsernameParams() {\n const usernamesById = {};\n try {\n const attribute = this.filteredSearchInput.getAttribute('data-username-params');\n JSON.parse(attribute).forEach((user) => {\n usernamesById[user.id] = user.username;\n });\n } catch (e) {\n // do nothing\n }\n return usernamesById;\n }\n\n tokenChange() {\n const dropdown = this.dropdownManager.mapping[this.dropdownManager.currentDropdown];\n\n if (dropdown) {\n const currentDropdownRef = dropdown.reference;\n\n this.setDropdownWrapper();\n currentDropdownRef.dispatchInputEvent();\n }\n }\n\n onrecentSearchesItemSelected(text) {\n this.clearSearch();\n this.filteredSearchInput.value = text;\n this.filteredSearchInput.dispatchEvent(new CustomEvent('input'));\n this.search();\n }\n\n // eslint-disable-next-line class-methods-use-this\n canEdit() {\n return true;\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchManager = FilteredSearchManager;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_manager.js","import './filtered_search_token_keys';\n\nclass FilteredSearchTokenizer {\n static processTokens(input, allowedKeys) {\n // Regex extracts `(token):(symbol)(value)`\n // Values that start with a double quote must end in a double quote (same for single)\n const tokenRegex = new RegExp(`(${allowedKeys.join('|')}):([~%@]?)(?:('[^']*'{0,1})|(\"[^\"]*\"{0,1})|(\\\\S+))`, 'g');\n const tokens = [];\n const tokenIndexes = []; // stores key+value for simple search\n let lastToken = null;\n const searchToken = input.replace(tokenRegex, (match, key, symbol, v1, v2, v3) => {\n let tokenValue = v1 || v2 || v3;\n let tokenSymbol = symbol;\n let tokenIndex = '';\n\n if (tokenValue === '~' || tokenValue === '%' || tokenValue === '@') {\n tokenSymbol = tokenValue;\n tokenValue = '';\n }\n\n tokenIndex = `${key}:${tokenValue}`;\n\n // Prevent adding duplicates\n if (tokenIndexes.indexOf(tokenIndex) === -1) {\n tokenIndexes.push(tokenIndex);\n\n tokens.push({\n key,\n value: tokenValue || '',\n symbol: tokenSymbol || '',\n });\n }\n\n return '';\n }).replace(/\\s{2,}/g, ' ').trim() || '';\n\n if (tokens.length > 0) {\n const last = tokens[tokens.length - 1];\n const lastString = `${last.key}:${last.symbol}${last.value}`;\n lastToken = input.lastIndexOf(lastString) ===\n input.length - lastString.length ? last : searchToken;\n } else {\n lastToken = searchToken;\n }\n\n return {\n tokens,\n lastToken,\n searchToken,\n };\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchTokenizer = FilteredSearchTokenizer;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_tokenizer.js","import Api from '../../api';\nimport Cache from './cache';\n\nclass UsersCache extends Cache {\n retrieve(username) {\n if (this.hasData(username)) {\n return Promise.resolve(this.get(username));\n }\n\n return Api.users('', { username })\n .then((users) => {\n if (!users.length) {\n throw new Error(`User \"${username}\" could not be found!`);\n }\n\n if (users.length > 1) {\n throw new Error(`Expected username \"${username}\" to be unique!`);\n }\n\n const user = users[0];\n this.internalStorage[username] = user;\n return user;\n });\n // missing catch is intentional, error handling depends on use case\n }\n}\n\nexport default new UsersCache();\n\n\n\n// WEBPACK FOOTER //\n// ./lib/utils/users_cache.js","import AjaxCache from '../lib/utils/ajax_cache';\nimport Flash from '../flash';\nimport FilteredSearchContainer from './container';\nimport UsersCache from '../lib/utils/users_cache';\n\nclass FilteredSearchVisualTokens {\n static getLastVisualTokenBeforeInput() {\n const inputLi = FilteredSearchContainer.container.querySelector('.input-token');\n const lastVisualToken = inputLi && inputLi.previousElementSibling;\n\n return {\n lastVisualToken,\n isLastVisualTokenValid: lastVisualToken === null || lastVisualToken.className.indexOf('filtered-search-term') !== -1 || (lastVisualToken && lastVisualToken.querySelector('.value') !== null),\n };\n }\n\n static unselectTokens() {\n const otherTokens = FilteredSearchContainer.container.querySelectorAll('.js-visual-token .selectable.selected');\n [].forEach.call(otherTokens, t => t.classList.remove('selected'));\n }\n\n static selectToken(tokenButton, forceSelection = false) {\n const selected = tokenButton.classList.contains('selected');\n FilteredSearchVisualTokens.unselectTokens();\n\n if (!selected || forceSelection) {\n tokenButton.classList.add('selected');\n }\n }\n\n static removeSelectedToken() {\n const selected = FilteredSearchContainer.container.querySelector('.js-visual-token .selected');\n\n if (selected) {\n const li = selected.closest('.js-visual-token');\n li.parentElement.removeChild(li);\n }\n }\n\n static createVisualTokenElementHTML(canEdit = true) {\n return `\n
\n
\n
\n
\n
\n \n
\n
\n
\n `;\n }\n\n static setTokenStyle(tokenContainer, backgroundColor, textColor) {\n const token = tokenContainer;\n\n // Labels with linear gradient should not override default background color\n if (backgroundColor.indexOf('linear-gradient') === -1) {\n token.style.backgroundColor = backgroundColor;\n }\n\n token.style.color = textColor;\n\n if (textColor === '#FFFFFF') {\n const removeToken = token.querySelector('.remove-token');\n removeToken.classList.add('inverted');\n }\n\n return token;\n }\n\n static preprocessLabel(labelsEndpoint, labels) {\n let processed = labels;\n\n if (!labels.preprocessed) {\n processed = gl.DropdownUtils.duplicateLabelPreprocessing(labels);\n AjaxCache.override(labelsEndpoint, processed);\n processed.preprocessed = true;\n }\n\n return processed;\n }\n\n static updateLabelTokenColor(tokenValueContainer, tokenValue) {\n const filteredSearchInput = FilteredSearchContainer.container.querySelector('.filtered-search');\n const baseEndpoint = filteredSearchInput.dataset.baseEndpoint;\n const labelsEndpoint = `${baseEndpoint}/labels.json`;\n\n return AjaxCache.retrieve(labelsEndpoint)\n .then(FilteredSearchVisualTokens.preprocessLabel.bind(null, labelsEndpoint))\n .then((labels) => {\n const matchingLabel = (labels || []).find(label => `~${gl.DropdownUtils.getEscapedText(label.title)}` === tokenValue);\n\n if (!matchingLabel) {\n return;\n }\n\n FilteredSearchVisualTokens\n .setTokenStyle(tokenValueContainer, matchingLabel.color, matchingLabel.text_color);\n })\n .catch(() => new Flash('An error occurred while fetching label colors.'));\n }\n\n static updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) {\n if (tokenValue === 'none') {\n return Promise.resolve();\n }\n\n const username = tokenValue.replace(/^@/, '');\n return UsersCache.retrieve(username)\n .then((user) => {\n if (!user) {\n return;\n }\n\n /* eslint-disable no-param-reassign */\n tokenValueContainer.dataset.originalValue = tokenValue;\n tokenValueElement.innerHTML = `\n \"\"\n ${_.escape(user.name)}\n `;\n /* eslint-enable no-param-reassign */\n })\n // ignore error and leave username in the search bar\n .catch(() => { });\n }\n\n static updateEmojiTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) {\n const container = tokenValueContainer;\n const element = tokenValueElement;\n\n return import(/* webpackChunkName: 'emoji' */ '../emoji')\n .then((Emoji) => {\n if (!Emoji.isEmojiNameValid(tokenValue)) {\n return;\n }\n\n container.dataset.originalValue = tokenValue;\n element.innerHTML = Emoji.glEmojiTag(tokenValue);\n })\n // ignore error and leave emoji name in the search bar\n .catch(() => { });\n }\n\n static renderVisualTokenValue(parentElement, tokenName, tokenValue) {\n const tokenValueContainer = parentElement.querySelector('.value-container');\n const tokenValueElement = tokenValueContainer.querySelector('.value');\n tokenValueElement.innerText = tokenValue;\n\n const tokenType = tokenName.toLowerCase();\n if (tokenType === 'label') {\n FilteredSearchVisualTokens.updateLabelTokenColor(tokenValueContainer, tokenValue);\n } else if ((tokenType === 'author') || (tokenType === 'assignee')) {\n FilteredSearchVisualTokens.updateUserTokenAppearance(\n tokenValueContainer, tokenValueElement, tokenValue,\n );\n } else if (tokenType === 'my-reaction') {\n FilteredSearchVisualTokens.updateEmojiTokenAppearance(\n tokenValueContainer, tokenValueElement, tokenValue,\n );\n }\n }\n\n static addVisualTokenElement(name, value, isSearchTerm, canEdit) {\n const li = document.createElement('li');\n li.classList.add('js-visual-token');\n li.classList.add(isSearchTerm ? 'filtered-search-term' : 'filtered-search-token');\n\n if (value) {\n li.innerHTML = FilteredSearchVisualTokens.createVisualTokenElementHTML(canEdit);\n FilteredSearchVisualTokens.renderVisualTokenValue(li, name, value);\n } else {\n li.innerHTML = '
';\n }\n li.querySelector('.name').innerText = name;\n\n const tokensContainer = FilteredSearchContainer.container.querySelector('.tokens-container');\n const input = FilteredSearchContainer.container.querySelector('.filtered-search');\n tokensContainer.insertBefore(li, input.parentElement);\n }\n\n static addValueToPreviousVisualTokenElement(value) {\n const { lastVisualToken, isLastVisualTokenValid } =\n FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (!isLastVisualTokenValid && lastVisualToken.classList.contains('filtered-search-token')) {\n const name = FilteredSearchVisualTokens.getLastTokenPartial();\n lastVisualToken.innerHTML = FilteredSearchVisualTokens.createVisualTokenElementHTML();\n lastVisualToken.querySelector('.name').innerText = name;\n FilteredSearchVisualTokens.renderVisualTokenValue(lastVisualToken, name, value);\n }\n }\n\n static addFilterVisualToken(tokenName, tokenValue, canEdit) {\n const { lastVisualToken, isLastVisualTokenValid }\n = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n const addVisualTokenElement = FilteredSearchVisualTokens.addVisualTokenElement;\n\n if (isLastVisualTokenValid) {\n addVisualTokenElement(tokenName, tokenValue, false, canEdit);\n } else {\n const previousTokenName = lastVisualToken.querySelector('.name').innerText;\n const tokensContainer = FilteredSearchContainer.container.querySelector('.tokens-container');\n tokensContainer.removeChild(lastVisualToken);\n\n const value = tokenValue || tokenName;\n addVisualTokenElement(previousTokenName, value, false, canEdit);\n }\n }\n\n static addSearchVisualToken(searchTerm) {\n const { lastVisualToken } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (lastVisualToken && lastVisualToken.classList.contains('filtered-search-term')) {\n lastVisualToken.querySelector('.name').innerText += ` ${searchTerm}`;\n } else {\n FilteredSearchVisualTokens.addVisualTokenElement(searchTerm, null, true);\n }\n }\n\n static getLastTokenPartial() {\n const { lastVisualToken } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (!lastVisualToken) return '';\n\n const valueContainer = lastVisualToken.querySelector('.value-container');\n const originalValue = valueContainer && valueContainer.dataset.originalValue;\n if (originalValue) {\n return originalValue;\n }\n\n const value = lastVisualToken.querySelector('.value');\n const name = lastVisualToken.querySelector('.name');\n\n const valueText = value ? value.innerText : '';\n const nameText = name ? name.innerText : '';\n\n return valueText || nameText;\n }\n\n static removeLastTokenPartial() {\n const { lastVisualToken } = FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (lastVisualToken) {\n const value = lastVisualToken.querySelector('.value');\n\n if (value) {\n const button = lastVisualToken.querySelector('.selectable');\n const valueContainer = lastVisualToken.querySelector('.value-container');\n button.removeChild(valueContainer);\n lastVisualToken.innerHTML = button.innerHTML;\n } else {\n lastVisualToken.closest('.tokens-container').removeChild(lastVisualToken);\n }\n }\n }\n\n static tokenizeInput() {\n const input = FilteredSearchContainer.container.querySelector('.filtered-search');\n const { isLastVisualTokenValid } =\n gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (input.value) {\n if (isLastVisualTokenValid) {\n gl.FilteredSearchVisualTokens.addSearchVisualToken(input.value);\n } else {\n FilteredSearchVisualTokens.addValueToPreviousVisualTokenElement(input.value);\n }\n\n input.value = '';\n }\n }\n\n static editToken(token) {\n const input = FilteredSearchContainer.container.querySelector('.filtered-search');\n\n FilteredSearchVisualTokens.tokenizeInput();\n\n // Replace token with input field\n const tokenContainer = token.parentElement;\n const inputLi = input.parentElement;\n tokenContainer.replaceChild(inputLi, token);\n\n const nameElement = token.querySelector('.name');\n let value;\n\n if (token.classList.contains('filtered-search-token')) {\n FilteredSearchVisualTokens.addFilterVisualToken(nameElement.innerText);\n\n const valueContainerElement = token.querySelector('.value-container');\n value = valueContainerElement.dataset.originalValue;\n\n if (!value) {\n const valueElement = valueContainerElement.querySelector('.value');\n value = valueElement.innerText;\n }\n }\n\n // token is a search term\n if (!value) {\n value = nameElement.innerText;\n }\n\n input.value = value;\n\n // Opens dropdown\n const inputEvent = new Event('input');\n input.dispatchEvent(inputEvent);\n\n // Adds cursor to input\n input.focus();\n }\n\n static moveInputToTheRight() {\n const input = FilteredSearchContainer.container.querySelector('.filtered-search');\n\n if (!input) return;\n\n const inputLi = input.parentElement;\n const tokenContainer = FilteredSearchContainer.container.querySelector('.tokens-container');\n\n FilteredSearchVisualTokens.tokenizeInput();\n\n if (!tokenContainer.lastElementChild.isEqualNode(inputLi)) {\n const { isLastVisualTokenValid } =\n gl.FilteredSearchVisualTokens.getLastVisualTokenBeforeInput();\n\n if (!isLastVisualTokenValid) {\n const lastPartial = gl.FilteredSearchVisualTokens.getLastTokenPartial();\n gl.FilteredSearchVisualTokens.removeLastTokenPartial();\n gl.FilteredSearchVisualTokens.addSearchVisualToken(lastPartial);\n }\n\n tokenContainer.removeChild(inputLi);\n tokenContainer.appendChild(inputLi);\n }\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchVisualTokens = FilteredSearchVisualTokens;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_visual_tokens.js","const DATA_DROPDOWN_TRIGGER = 'data-dropdown-trigger';\n\nclass FilteredSearchDropdown {\n constructor({ droplab, dropdown, input, filter }) {\n this.droplab = droplab;\n this.hookId = input && input.id;\n this.input = input;\n this.filter = filter;\n this.dropdown = dropdown;\n this.loadingTemplate = `
\n \n
`;\n this.bindEvents();\n }\n\n bindEvents() {\n this.itemClickedWrapper = this.itemClicked.bind(this);\n this.dropdown.addEventListener('click.dl', this.itemClickedWrapper);\n }\n\n unbindEvents() {\n this.dropdown.removeEventListener('click.dl', this.itemClickedWrapper);\n }\n\n getCurrentHook() {\n return this.droplab.hooks.filter(h => h.id === this.hookId)[0] || null;\n }\n\n itemClicked(e, getValueFunction) {\n const { selected } = e.detail;\n\n if (selected.tagName === 'LI' && selected.innerHTML) {\n const dataValueSet = gl.DropdownUtils.setDataValueIfSelected(this.filter, selected);\n\n if (!dataValueSet) {\n const value = getValueFunction(selected);\n gl.FilteredSearchDropdownManager.addWordToInput(this.filter, value, true);\n }\n\n this.resetFilters();\n this.dismissDropdown();\n this.dispatchInputEvent();\n }\n }\n\n setAsDropdown() {\n this.input.setAttribute(DATA_DROPDOWN_TRIGGER, `#${this.dropdown.id}`);\n }\n\n setOffset(offset = 0) {\n if (window.innerWidth > 480) {\n this.dropdown.style.left = `${offset}px`;\n } else {\n this.dropdown.style.left = '0px';\n }\n }\n\n renderContent(forceShowList = false) {\n const currentHook = this.getCurrentHook();\n if (forceShowList && currentHook && currentHook.list.hidden) {\n currentHook.list.show();\n }\n }\n\n render(forceRenderContent = false, forceShowList = false) {\n this.setAsDropdown();\n\n const currentHook = this.getCurrentHook();\n const firstTimeInitialized = currentHook === null;\n\n if (firstTimeInitialized || forceRenderContent) {\n this.renderContent(forceShowList);\n } else if (currentHook.list.list.id !== this.dropdown.id) {\n this.renderContent(forceShowList);\n }\n }\n\n dismissDropdown() {\n // Focusing on the input will dismiss dropdown\n // (default droplab functionality)\n this.input.focus();\n }\n\n dispatchInputEvent() {\n // Propogate input change to FilteredSearchDropdownManager\n // so that it can determine which dropdowns to open\n this.input.dispatchEvent(new CustomEvent('input', {\n bubbles: true,\n cancelable: true,\n }));\n }\n\n dispatchFormSubmitEvent() {\n // dispatchEvent() is necessary as form.submit() does not\n // trigger event handlers\n this.input.form.dispatchEvent(new Event('submit'));\n }\n\n hideDropdown() {\n const currentHook = this.getCurrentHook();\n if (currentHook) {\n currentHook.list.hide();\n }\n }\n\n resetFilters() {\n const hook = this.getCurrentHook();\n\n if (hook) {\n const data = hook.list.data || [];\n const results = data.map((o) => {\n const updated = o;\n updated.droplab_hidden = false;\n return updated;\n });\n hook.list.render(results);\n }\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchDropdown = FilteredSearchDropdown;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_dropdown.js","const tokenKeys = [{\n key: 'author',\n type: 'string',\n param: 'username',\n symbol: '@',\n icon: 'pencil',\n tag: '@author',\n}, {\n key: 'assignee',\n type: 'string',\n param: 'username',\n symbol: '@',\n icon: 'user',\n tag: '@assignee',\n}, {\n key: 'milestone',\n type: 'string',\n param: 'title',\n symbol: '%',\n icon: 'clock-o',\n tag: '%milestone',\n}, {\n key: 'label',\n type: 'array',\n param: 'name[]',\n symbol: '~',\n icon: 'tag',\n tag: '~label',\n}];\n\nif (gon.current_user_id) {\n // Appending tokenkeys only logged-in\n tokenKeys.push({\n key: 'my-reaction',\n type: 'string',\n param: 'emoji',\n symbol: '',\n icon: 'thumbs-up',\n tag: 'emoji',\n });\n}\n\nconst alternativeTokenKeys = [{\n key: 'label',\n type: 'string',\n param: 'name',\n symbol: '~',\n}];\n\nconst tokenKeysWithAlternative = tokenKeys.concat(alternativeTokenKeys);\n\nconst conditions = [{\n url: 'assignee_id=0',\n tokenKey: 'assignee',\n value: 'none',\n}, {\n url: 'milestone_title=No+Milestone',\n tokenKey: 'milestone',\n value: 'none',\n}, {\n url: 'milestone_title=%23upcoming',\n tokenKey: 'milestone',\n value: 'upcoming',\n}, {\n url: 'milestone_title=%23started',\n tokenKey: 'milestone',\n value: 'started',\n}, {\n url: 'label_name[]=No+Label',\n tokenKey: 'label',\n value: 'none',\n}];\n\nclass FilteredSearchTokenKeys {\n static get() {\n return tokenKeys;\n }\n\n static getKeys() {\n return tokenKeys.map(i => i.key);\n }\n\n static getAlternatives() {\n return alternativeTokenKeys;\n }\n\n static getConditions() {\n return conditions;\n }\n\n static searchByKey(key) {\n return tokenKeys.find(tokenKey => tokenKey.key === key) || null;\n }\n\n static searchBySymbol(symbol) {\n return tokenKeys.find(tokenKey => tokenKey.symbol === symbol) || null;\n }\n\n static searchByKeyParam(keyParam) {\n return tokenKeysWithAlternative.find((tokenKey) => {\n let tokenKeyParam = tokenKey.key;\n\n // Replace hyphen with underscore to compare keyParam with tokenKeyParam\n // e.g. 'my-reaction' => 'my_reaction'\n tokenKeyParam = tokenKeyParam.replace('-', '_');\n\n if (tokenKey.param) {\n tokenKeyParam += `_${tokenKey.param}`;\n }\n\n return keyParam === tokenKeyParam;\n }) || null;\n }\n\n static searchByConditionUrl(url) {\n return conditions.find(condition => condition.url === url) || null;\n }\n\n static searchByConditionKeyValue(key, value) {\n return conditions\n .find(condition => condition.tokenKey === key && condition.value === value) || null;\n }\n}\n\nwindow.gl = window.gl || {};\ngl.FilteredSearchTokenKeys = FilteredSearchTokenKeys;\n\n\n\n// WEBPACK FOOTER //\n// ./filtered_search/filtered_search_token_keys.js"],"sourceRoot":""}