{"version":3,"sources":["webpack:///./vue_shared/components/filtered_search_bar/tokens/label_token.vue","webpack:///./vue_shared/components/filtered_search_bar/tokens/label_token.vue?e7a0","webpack:///vue_shared/components/filtered_search_bar/tokens/label_token.vue","webpack:///./vue_shared/components/filtered_search_bar/tokens/label_token.vue?33ed","webpack:////build/source/node_modules/lodash/fp/fill.js","webpack:////build/source/node_modules/lodash/toLength.js","webpack:///./vue_shared/components/filtered_search_bar/tokens/base_token.vue","webpack:///./vue_shared/components/filtered_search_bar/tokens/base_token.vue?9c7d","webpack:///vue_shared/components/filtered_search_bar/tokens/base_token.vue","webpack:///./vue_shared/components/filtered_search_bar/tokens/base_token.vue?71c7","webpack:////build/source/node_modules/lodash/clone.js","webpack:////build/source/node_modules/lodash/_createFlow.js","webpack:////build/source/node_modules/lodash/fp/flowRight.js","webpack:////build/source/node_modules/lodash/fp/filter.js","webpack:////build/source/node_modules/lodash/fill.js","webpack:////build/source/node_modules/lodash/fp/compose.js","webpack:////build/source/node_modules/lodash/_baseFill.js","webpack:////build/source/node_modules/lodash/_baseFilter.js","webpack:////build/source/node_modules/lodash/flowRight.js","webpack:////build/source/node_modules/@gitlab/ui/dist/components/utilities/intersperse/intersperse.js","webpack:////build/source/node_modules/lodash/filter.js"],"names":["components","BaseToken","GlIcon","GlFilteredSearchSuggestion","GlIntersperse","GlLabel","inject","props","config","type","Object","required","value","active","Boolean","data","labels","initialLabels","allLabels","loading","computed","defaultLabels","OPTIONS_NONE_ANY","methods","getActiveLabel","_this","find","label","getLabelName","stripQuotes","findLabelByName","name","_this2","findLabelById","id","showScopedLabel","labelName","isScopedLabel","hasScopedLabelsFeature","getLabelBackgroundColor","color","title","updateListOfAllLabels","_this3","forEach","push","fetchLabels","searchTerm","_this4","then","res","Array","isArray","fetchLatestLabels","catch","createAlert","message","__","finally","_this5","component","_vm","this","_c","_self","_g","_b","attrs","on","scopedSlots","_u","key","fn","viewTokenProps","inputValue","activeTokenValue","selectedTokens","length","_l","staticClass","suggestions","selections","class","includes","_e","_v","style","backgroundColor","_s","$attrs","$listeners","func","convert","placeholder","module","exports","baseClamp","toInteger","GlFilteredSearchToken","GlDropdownDivider","GlDropdownSectionHeader","GlDropdownText","GlLoadingIcon","suggestionsLoading","default","getActiveTokenValue","Function","defaultSuggestions","preloadedSuggestions","valueIdentifier","token","searchBy","String","undefined","appliedTokens","_getRecentlyUsedSugge","hasFetched","searchKey","recentSuggestions","recentSuggestionsStorageKey","getRecentlyUsedSuggestions","isRecentSuggestionsEnabled","suggestionsEnabled","suggestionsDisabled","recentTokenIds","map","preloadedTokenIds","multiSelectEnabled","_last","availableDefaultSuggestions","OPERATOR_NOT","OPERATOR_OR","operator","filter","suggestion","FILTERS_NONE_ANY","availableSuggestions","tokenValue","applyMaxSuggestions","showDefaultSuggestions","showNoMatchesText","showRecentSuggestions","showPreloadedSuggestions","showAvailableSuggestions","multiSelect","OPERATORS_TO_GROUP","validatedConfig","watch","immediate","handler","flat","item","search","$emit","deep","newValue","concat","handleInput","_debounce","startsWith","endsWith","slice","DEBOUNCE_DELAY","handleTokenValueSelected","selectedValue","index","indexOf","splice","setTokenValueToRecentlyUsed","maxSuggestions","_t","text","proxy","baseClone","LodashWrapper","flatRest","getData","getFuncName","isLaziable","fromRight","funcs","prereq","prototype","thru","reverse","TypeError","wrapper","funcName","apply","args","arguments","plant","result","call","baseFill","isIterateeCall","array","start","end","toLength","baseEach","collection","predicate","flowRight","createFlow","filterEmptyNodesVue2","vNode","tag","trim","Fragment","filterEmptyNodes","version","reduce","acc","node","children","insertAfterSecondLastItem","replaceSecondLastItem","__vue_script__","functional","separator","lastSeparator","createElement","context","slots","items","addLastSeparator","filterAndSeparate","__vue_component__","arrayFilter","baseFilter","baseIteratee"],"mappings":"6JAAA,I,4GCA0S,ECW3R,CACfA,WAAA,CACAC,U,UAAAA,EACAC,WACAC,+BACAC,kBACAC,aAEAC,OAAA,2BACAC,MAAA,CACAC,OAAA,CACAC,KAAAC,OACAC,UAAA,GAEAC,MA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f,IAAIoH,EAAc,EAAQ,QACtBC,EAAa,EAAQ,QACrBC,EAAe,EAAQ,QACvBnL,EAAU,EAAQ,QAgDtB0C,EAAOC,QALP,SAAgB0G,EAAYC,GAE1B,OADWtJ,EAAQqJ,GAAc4B,EAAcC,GACnC7B,EAAY8B,EAAa7B,EAAW","file":"35.894d1366.chunk.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('base-token',_vm._g(_vm._b({attrs:{\"config\":_vm.config,\"value\":_vm.value,\"active\":_vm.active,\"suggestions-loading\":_vm.loading,\"suggestions\":_vm.labels,\"get-active-token-value\":_vm.getActiveLabel,\"default-suggestions\":_vm.defaultLabels,\"value-identifier\":_vm.getLabelName},on:{\"fetch-suggestions\":_vm.fetchLabels},scopedSlots:_vm._u([{key:\"view\",fn:function({ viewTokenProps: { inputValue, activeTokenValue, selectedTokens } }){return [(selectedTokens.length > 0)?_c('gl-intersperse',{attrs:{\"separator\":\", \"}},_vm._l((selectedTokens),function(label){return _c('gl-label',{key:label,staticClass:\"js-no-trigger\",attrs:{\"background-color\":_vm.getLabelBackgroundColor(label),\"scoped\":_vm.showScopedLabel(label),\"title\":label}})}),1):[_c('gl-label',{staticClass:\"js-no-trigger\",attrs:{\"background-color\":_vm.getLabelBackgroundColor(activeTokenValue ? _vm.getLabelName(activeTokenValue) : inputValue),\"scoped\":_vm.showScopedLabel(activeTokenValue ? _vm.getLabelName(activeTokenValue) : inputValue),\"title\":activeTokenValue ? _vm.getLabelName(activeTokenValue) : inputValue}})]]}},{key:\"suggestions-list\",fn:function({ suggestions, selections = [] }){return _vm._l((suggestions),function(label){return _c('gl-filtered-search-suggestion',{key:label.id,attrs:{\"value\":_vm.getLabelName(label)}},[_c('div',{staticClass:\"gl-flex gl-items-center\",class:{ 'gl-pl-6': !selections.includes(label.title) }},[(selections.includes(label.title))?_c('gl-icon',{staticClass:\"gl-mr-3 gl-shrink-0\",attrs:{\"name\":\"check\",\"variant\":\"subtle\"}}):_vm._e(),_vm._v(\" \"),_c('span',{staticClass:\"gl-mr-3 gl-inline-block gl-p-3\",style:({ backgroundColor: label.color })}),_vm._v(\" \"),_c('div',[_vm._v(_vm._s(_vm.getLabelName(label)))])],1)])})}}])},'base-token',_vm.$attrs,false),_vm.$listeners))\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./label_token.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./label_token.vue?vue&type=script&lang=js\"","<script>\nimport { GlIcon, GlIntersperse, GlFilteredSearchSuggestion, GlLabel } from '@gitlab/ui';\nimport { createAlert } from '~/alert';\nimport { isScopedLabel } from '~/lib/utils/common_utils';\nimport { stripQuotes } from '~/lib/utils/text_utility';\nimport { __ } from '~/locale';\n\nimport { OPTIONS_NONE_ANY } from '../constants';\n\nimport BaseToken from './base_token.vue';\n\nexport default {\n  components: {\n    BaseToken,\n    GlIcon,\n    GlFilteredSearchSuggestion,\n    GlIntersperse,\n    GlLabel,\n  },\n  inject: ['hasScopedLabelsFeature'],\n  props: {\n    config: {\n      type: Object,\n      required: true,\n    },\n    value: {\n      type: Object,\n      required: true,\n    },\n    active: {\n      type: Boolean,\n      required: true,\n    },\n  },\n  data() {\n    return {\n      labels: this.config.initialLabels || [],\n      allLabels: this.config.initialLabels || [],\n      loading: false,\n    };\n  },\n  computed: {\n    defaultLabels() {\n      return this.config.defaultLabels || OPTIONS_NONE_ANY;\n    },\n  },\n  methods: {\n    getActiveLabel(labels, data) {\n      return labels.find((label) => this.getLabelName(label) === stripQuotes(data));\n    },\n    findLabelByName(name) {\n      return this.allLabels.find((label) => this.getLabelName(label) === name);\n    },\n    findLabelById(id) {\n      return this.allLabels.find((label) => label.id === id);\n    },\n    showScopedLabel(labelName) {\n      const label = this.findLabelByName(labelName);\n      return isScopedLabel(label) && this.hasScopedLabelsFeature;\n    },\n    getLabelBackgroundColor(labelName) {\n      const label = this.findLabelByName(labelName);\n      const backgroundColor = label?.color || '#fff0';\n      return backgroundColor;\n    },\n    /**\n     * There's an inconsistency between private and public API\n     * for labels where label name is included in a different\n     * property;\n     *\n     * Private API => `label.title`\n     * Public API => `label.name`\n     *\n     * This method allows compatibility as there may be instances\n     * where `config.fetchLabels` provided externally may still be\n     * using either of the two APIs.\n     */\n    getLabelName(label) {\n      return label.name || label.title;\n    },\n    updateListOfAllLabels() {\n      this.labels.forEach((label) => {\n        if (!this.findLabelById(label.id)) {\n          this.allLabels.push(label);\n        }\n      });\n    },\n    fetchLabels(searchTerm) {\n      this.loading = true;\n      this.config\n        .fetchLabels(searchTerm)\n        .then((res) => {\n          // We'd want to avoid doing this check but\n          // labels.json and /groups/:id/labels & /projects/:id/labels\n          // return response differently.\n          this.labels = Array.isArray(res) ? res : res.data;\n          this.updateListOfAllLabels();\n\n          if (this.config.fetchLatestLabels) {\n            this.fetchLatestLabels(searchTerm);\n          }\n        })\n        .catch(() =>\n          createAlert({\n            message: __('There was a problem fetching labels.'),\n          }),\n        )\n        .finally(() => {\n          this.loading = false;\n        });\n    },\n    fetchLatestLabels(searchTerm) {\n      this.config\n        .fetchLatestLabels(searchTerm)\n        .then((res) => {\n          // We'd want to avoid doing this check but\n          // labels.json and /groups/:id/labels & /projects/:id/labels\n          // return response differently.\n          this.labels = Array.isArray(res) ? res : res.data;\n          this.updateListOfAllLabels();\n        })\n        .catch(() =>\n          createAlert({\n            message: __('There was a problem fetching latest labels.'),\n          }),\n        );\n    },\n  },\n};\n</script>\n\n<template>\n  <base-token\n    :config=\"config\"\n    :value=\"value\"\n    :active=\"active\"\n    :suggestions-loading=\"loading\"\n    :suggestions=\"labels\"\n    :get-active-token-value=\"getActiveLabel\"\n    :default-suggestions=\"defaultLabels\"\n    :value-identifier=\"getLabelName\"\n    v-bind=\"$attrs\"\n    @fetch-suggestions=\"fetchLabels\"\n    v-on=\"$listeners\"\n  >\n    <template #view=\"{ viewTokenProps: { inputValue, activeTokenValue, selectedTokens } }\">\n      <gl-intersperse v-if=\"selectedTokens.length > 0\" separator=\", \">\n        <gl-label\n          v-for=\"label in selectedTokens\"\n          :key=\"label\"\n          class=\"js-no-trigger\"\n          :background-color=\"getLabelBackgroundColor(label)\"\n          :scoped=\"showScopedLabel(label)\"\n          :title=\"label\"\n        />\n      </gl-intersperse>\n      <template v-else>\n        <gl-label\n          class=\"js-no-trigger\"\n          :background-color=\"\n            getLabelBackgroundColor(activeTokenValue ? getLabelName(activeTokenValue) : inputValue)\n          \"\n          :scoped=\"showScopedLabel(activeTokenValue ? getLabelName(activeTokenValue) : inputValue)\"\n          :title=\"activeTokenValue ? getLabelName(activeTokenValue) : inputValue\"\n      /></template>\n    </template>\n    <template #suggestions-list=\"{ suggestions, selections = [] }\">\n      <gl-filtered-search-suggestion\n        v-for=\"label in suggestions\"\n        :key=\"label.id\"\n        :value=\"getLabelName(label)\"\n      >\n        <div\n          class=\"gl-flex gl-items-center\"\n          :class=\"{ 'gl-pl-6': !selections.includes(label.title) }\"\n        >\n          <gl-icon\n            v-if=\"selections.includes(label.title)\"\n            name=\"check\"\n            class=\"gl-mr-3 gl-shrink-0\"\n            variant=\"subtle\"\n          />\n          <span\n            :style=\"{ backgroundColor: label.color }\"\n            class=\"gl-mr-3 gl-inline-block gl-p-3\"\n          ></span>\n          <div>{{ getLabelName(label) }}</div>\n        </div>\n      </gl-filtered-search-suggestion>\n    </template>\n  </base-token>\n</template>\n","import { render, staticRenderFns } from \"./label_token.vue?vue&type=template&id=28a8a64f\"\nimport script from \"./label_token.vue?vue&type=script&lang=js\"\nexport * from \"./label_token.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var convert = require('./convert'),\n    func = convert('fill', require('../fill'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var baseClamp = require('./_baseClamp'),\n    toInteger = require('./toInteger');\n\n/** Used as references for the maximum length and index of an array. */\nvar MAX_ARRAY_LENGTH = 4294967295;\n\n/**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\nfunction toLength(value) {\n  return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n}\n\nmodule.exports = toLength;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('gl-filtered-search-token',_vm._g(_vm._b({attrs:{\"config\":_vm.validatedConfig,\"value\":_vm.value,\"active\":_vm.active,\"multi-select-values\":_vm.selectedTokens},on:{\"input\":_vm.handleInput,\"select\":_vm.handleTokenValueSelected},scopedSlots:_vm._u([{key:\"view-token\",fn:function(viewTokenProps){return [_vm._t(\"view-token\",null,{\"viewTokenProps\":/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ {\n        ...viewTokenProps,\n        activeTokenValue: _vm.activeTokenValue,\n        selectedTokens: _vm.selectedTokens,\n      } /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */})]}},{key:\"view\",fn:function(viewTokenProps){return [_vm._t(\"view\",null,{\"viewTokenProps\":/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ {\n        ...viewTokenProps,\n        activeTokenValue: _vm.activeTokenValue,\n        selectedTokens: _vm.selectedTokens,\n      } /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */})]}},(_vm.suggestionsEnabled)?{key:\"suggestions\",fn:function(){return [(_vm.showDefaultSuggestions)?[_vm._l((_vm.availableDefaultSuggestions),function(token){return _c('gl-filtered-search-suggestion',{key:token.value,attrs:{\"value\":token.value}},[_vm._v(\"\\n        \"+_vm._s(token.text)+\"\\n      \")])}),_vm._v(\" \"),_c('gl-dropdown-divider')]:_vm._e(),_vm._v(\" \"),(_vm.showRecentSuggestions)?[_c('gl-dropdown-section-header',[_vm._v(_vm._s(_vm.__('Recently used')))]),_vm._v(\" \"),_vm._t(\"suggestions-list\",null,{\"suggestions\":_vm.recentSuggestions,\"selections\":_vm.selectedTokens}),_vm._v(\" \"),_c('gl-dropdown-divider')]:_vm._e(),_vm._v(\" \"),(_vm.showPreloadedSuggestions)?_vm._t(\"suggestions-list\",null,{\"suggestions\":_vm.preloadedSuggestions,\"selections\":_vm.selectedTokens}):_vm._e(),_vm._v(\" \"),(_vm.suggestionsLoading)?_c('gl-loading-icon',{attrs:{\"size\":\"sm\"}}):(_vm.showAvailableSuggestions)?[_vm._t(\"suggestions-list\",null,{\"suggestions\":_vm.availableSuggestions,\"selections\":_vm.selectedTokens})]:(_vm.showNoMatchesText)?_c('gl-dropdown-text',[_vm._v(\"\\n      \"+_vm._s(_vm.__('No matches found'))+\"\\n    \")]):(_vm.hasFetched)?_c('gl-dropdown-text',[_vm._v(_vm._s(_vm.__('No suggestions found')))]):_vm._e(),_vm._v(\" \"),_vm._t(\"footer\")]},proxy:true}:null],null,true)},'gl-filtered-search-token',_vm.$attrs,false),_vm.$listeners))\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./base_token.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./base_token.vue?vue&type=script&lang=js\"","<script>\nimport {\n  GlFilteredSearchToken,\n  GlFilteredSearchSuggestion,\n  GlDropdownDivider,\n  GlDropdownSectionHeader,\n  GlDropdownText,\n  GlLoadingIcon,\n} from '@gitlab/ui';\nimport { debounce, last } from 'lodash';\n\nimport { stripQuotes } from '~/lib/utils/text_utility';\nimport {\n  DEBOUNCE_DELAY,\n  FILTERS_NONE_ANY,\n  OPERATOR_NOT,\n  OPERATOR_OR,\n  OPERATORS_TO_GROUP,\n} from '../constants';\nimport { getRecentlyUsedSuggestions, setTokenValueToRecentlyUsed } from '../filtered_search_utils';\n\nexport default {\n  components: {\n    GlFilteredSearchToken,\n    GlFilteredSearchSuggestion,\n    GlDropdownDivider,\n    GlDropdownSectionHeader,\n    GlDropdownText,\n    GlLoadingIcon,\n  },\n  props: {\n    config: {\n      type: Object,\n      required: true,\n    },\n    value: {\n      type: Object,\n      required: true,\n    },\n    active: {\n      type: Boolean,\n      required: true,\n    },\n    suggestionsLoading: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    suggestions: {\n      type: Array,\n      required: false,\n      default: () => [],\n    },\n    getActiveTokenValue: {\n      type: Function,\n      required: false,\n      default: (suggestions, data) => suggestions.find(({ value }) => value === data),\n    },\n    defaultSuggestions: {\n      type: Array,\n      required: false,\n      default: () => [],\n    },\n    preloadedSuggestions: {\n      type: Array,\n      required: false,\n      default: () => [],\n    },\n    valueIdentifier: {\n      type: Function,\n      required: false,\n      default: (token) => token.id,\n    },\n    searchBy: {\n      type: String,\n      required: false,\n      default: undefined,\n    },\n    appliedTokens: {\n      type: Array,\n      required: false,\n      default: () => [],\n    },\n  },\n  data() {\n    return {\n      hasFetched: false, // use this to avoid flash of `No suggestions found` before fetching\n      searchKey: '',\n      selectedTokens: [],\n      recentSuggestions: this.config.recentSuggestionsStorageKey\n        ? getRecentlyUsedSuggestions(\n            this.config.recentSuggestionsStorageKey,\n            this.appliedTokens,\n            this.valueIdentifier,\n          ) ?? []\n        : [],\n    };\n  },\n  computed: {\n    isRecentSuggestionsEnabled() {\n      return Boolean(this.config.recentSuggestionsStorageKey);\n    },\n    suggestionsEnabled() {\n      return !this.config.suggestionsDisabled;\n    },\n    recentTokenIds() {\n      return this.recentSuggestions.map(this.valueIdentifier);\n    },\n    preloadedTokenIds() {\n      return this.preloadedSuggestions.map(this.valueIdentifier);\n    },\n    activeTokenValue() {\n      const data =\n        this.multiSelectEnabled && Array.isArray(this.value.data)\n          ? last(this.value.data)\n          : this.value.data;\n      return this.getActiveTokenValue(this.suggestions, data);\n    },\n    availableDefaultSuggestions() {\n      if ([OPERATOR_NOT, OPERATOR_OR].includes(this.value.operator)) {\n        return this.defaultSuggestions.filter(\n          (suggestion) => !FILTERS_NONE_ANY.includes(suggestion.value),\n        );\n      }\n      return this.defaultSuggestions;\n    },\n    /**\n     * Return all the suggestions when searchKey is present\n     * otherwise return only the suggestions which aren't\n     * present in \"Recently used\"\n     */\n    availableSuggestions() {\n      const suggestions = this.searchKey\n        ? this.suggestions\n        : this.suggestions.filter(\n            (tokenValue) =>\n              !this.recentTokenIds.includes(this.valueIdentifier(tokenValue)) &&\n              !this.preloadedTokenIds.includes(this.valueIdentifier(tokenValue)),\n          );\n\n      return this.applyMaxSuggestions(suggestions);\n    },\n    showDefaultSuggestions() {\n      return this.availableDefaultSuggestions.length > 0;\n    },\n    showNoMatchesText() {\n      return this.searchKey && !this.availableSuggestions.length;\n    },\n    showRecentSuggestions() {\n      return (\n        this.isRecentSuggestionsEnabled && this.recentSuggestions.length > 0 && !this.searchKey\n      );\n    },\n    showPreloadedSuggestions() {\n      return this.preloadedSuggestions.length > 0 && !this.searchKey;\n    },\n    showAvailableSuggestions() {\n      return this.availableSuggestions.length > 0;\n    },\n    searchTerm() {\n      return this.searchBy && this.activeTokenValue\n        ? this.activeTokenValue[this.searchBy]\n        : undefined;\n    },\n    multiSelectEnabled() {\n      return this.config.multiSelect && OPERATORS_TO_GROUP.includes(this.value.operator);\n    },\n    validatedConfig() {\n      if (this.config.multiSelect && !this.multiSelectEnabled) {\n        return {\n          ...this.config,\n          multiSelect: false,\n        };\n      }\n      return this.config;\n    },\n  },\n  watch: {\n    active: {\n      immediate: true,\n      handler(active) {\n        if (!active && !this.suggestions.length) {\n          // data could be a string or an array of strings\n          const selectedItems = [this.value.data].flat();\n          selectedItems.forEach((item) => {\n            const search = this.searchTerm ? this.searchTerm : item;\n            this.$emit('fetch-suggestions', search);\n          });\n        }\n      },\n    },\n    suggestionsLoading: {\n      handler(loading) {\n        if (loading) {\n          this.hasFetched = true;\n        }\n      },\n    },\n    value: {\n      deep: true,\n      immediate: true,\n      handler(newValue) {\n        const { data } = newValue;\n\n        if (!this.multiSelectEnabled) {\n          return;\n        }\n\n        // don't add empty values to selectedUsernames\n        if (!data) {\n          return;\n        }\n\n        if (Array.isArray(data)) {\n          this.selectedTokens = data;\n          // !active so we don't add strings while searching, e.g. r, ro, roo\n          // !includes so we don't add the same usernames (if @input is emitted twice)\n        } else if (!this.active && !this.selectedTokens.includes(data)) {\n          this.selectedTokens = this.selectedTokens.concat(data);\n        }\n      },\n    },\n  },\n  methods: {\n    handleInput: debounce(function debouncedSearch({ data, operator }) {\n      // in multiSelect mode, data could be an array\n      if (Array.isArray(data)) return;\n\n      // Prevent fetching suggestions when data or operator is not present\n      if (data || operator) {\n        this.searchKey = data;\n\n        if (!this.activeTokenValue) {\n          let search = this.searchTerm ? this.searchTerm : data;\n\n          if (search.startsWith('\"') && search.endsWith('\"')) {\n            search = stripQuotes(search);\n          } else if (search.startsWith('\"')) {\n            search = search.slice(1, search.length);\n          }\n\n          this.$emit('fetch-suggestions', search);\n        }\n      }\n    }, DEBOUNCE_DELAY),\n    handleTokenValueSelected(selectedValue) {\n      if (this.multiSelectEnabled) {\n        const index = this.selectedTokens.indexOf(selectedValue);\n        if (index > -1) {\n          this.selectedTokens.splice(index, 1);\n        } else {\n          this.selectedTokens.push(selectedValue);\n        }\n\n        // need to clear search\n        this.$emit('input', { ...this.value, data: '' });\n      }\n\n      const activeTokenValue = this.getActiveTokenValue(this.suggestions, selectedValue);\n      // Make sure that;\n      // 1. Recently used values feature is enabled\n      // 2. User has actually selected a value\n      // 3. Selected value is not part of preloaded list.\n      if (\n        this.isRecentSuggestionsEnabled &&\n        activeTokenValue &&\n        !this.preloadedTokenIds.includes(this.valueIdentifier(activeTokenValue))\n      ) {\n        setTokenValueToRecentlyUsed(this.config.recentSuggestionsStorageKey, activeTokenValue);\n      }\n    },\n    applyMaxSuggestions(suggestions) {\n      const { maxSuggestions } = this.config;\n      if (!maxSuggestions || maxSuggestions <= 0) return suggestions;\n\n      return suggestions.slice(0, maxSuggestions);\n    },\n  },\n};\n</script>\n\n<template>\n  <gl-filtered-search-token\n    :config=\"validatedConfig\"\n    :value=\"value\"\n    :active=\"active\"\n    :multi-select-values=\"selectedTokens\"\n    v-bind=\"$attrs\"\n    v-on=\"$listeners\"\n    @input=\"handleInput\"\n    @select=\"handleTokenValueSelected\"\n  >\n    <template #view-token=\"viewTokenProps\">\n      <slot\n        name=\"view-token\"\n        :view-token-props=\"/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ {\n          ...viewTokenProps,\n          activeTokenValue,\n          selectedTokens,\n        } /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */\"\n      ></slot>\n    </template>\n    <template #view=\"viewTokenProps\">\n      <slot\n        name=\"view\"\n        :view-token-props=\"/* eslint-disable @gitlab/vue-no-new-non-primitive-in-template */ {\n          ...viewTokenProps,\n          activeTokenValue,\n          selectedTokens,\n        } /* eslint-enable @gitlab/vue-no-new-non-primitive-in-template */\"\n      ></slot>\n    </template>\n    <template v-if=\"suggestionsEnabled\" #suggestions>\n      <template v-if=\"showDefaultSuggestions\">\n        <gl-filtered-search-suggestion\n          v-for=\"token in availableDefaultSuggestions\"\n          :key=\"token.value\"\n          :value=\"token.value\"\n        >\n          {{ token.text }}\n        </gl-filtered-search-suggestion>\n        <gl-dropdown-divider />\n      </template>\n      <template v-if=\"showRecentSuggestions\">\n        <gl-dropdown-section-header>{{ __('Recently used') }}</gl-dropdown-section-header>\n        <slot\n          name=\"suggestions-list\"\n          :suggestions=\"recentSuggestions\"\n          :selections=\"selectedTokens\"\n        ></slot>\n        <gl-dropdown-divider />\n      </template>\n      <slot\n        v-if=\"showPreloadedSuggestions\"\n        name=\"suggestions-list\"\n        :suggestions=\"preloadedSuggestions\"\n        :selections=\"selectedTokens\"\n      ></slot>\n      <gl-loading-icon v-if=\"suggestionsLoading\" size=\"sm\" />\n      <template v-else-if=\"showAvailableSuggestions\">\n        <slot\n          name=\"suggestions-list\"\n          :suggestions=\"availableSuggestions\"\n          :selections=\"selectedTokens\"\n        ></slot>\n      </template>\n      <gl-dropdown-text v-else-if=\"showNoMatchesText\">\n        {{ __('No matches found') }}\n      </gl-dropdown-text>\n      <gl-dropdown-text v-else-if=\"hasFetched\">{{ __('No suggestions found') }}</gl-dropdown-text>\n      <slot name=\"footer\"></slot>\n    </template>\n  </gl-filtered-search-token>\n</template>\n","import { render, staticRenderFns } from \"./base_token.vue?vue&type=template&id=bd574ef6\"\nimport script from \"./base_token.vue?vue&type=script&lang=js\"\nexport * from \"./base_token.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n  return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n","var LodashWrapper = require('./_LodashWrapper'),\n    flatRest = require('./_flatRest'),\n    getData = require('./_getData'),\n    getFuncName = require('./_getFuncName'),\n    isArray = require('./isArray'),\n    isLaziable = require('./_isLaziable');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_CURRY_FLAG = 8,\n    WRAP_PARTIAL_FLAG = 32,\n    WRAP_ARY_FLAG = 128,\n    WRAP_REARG_FLAG = 256;\n\n/**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\nfunction createFlow(fromRight) {\n  return flatRest(function(funcs) {\n    var length = funcs.length,\n        index = length,\n        prereq = LodashWrapper.prototype.thru;\n\n    if (fromRight) {\n      funcs.reverse();\n    }\n    while (index--) {\n      var func = funcs[index];\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n        var wrapper = new LodashWrapper([], true);\n      }\n    }\n    index = wrapper ? index : length;\n    while (++index < length) {\n      func = funcs[index];\n\n      var funcName = getFuncName(func),\n          data = funcName == 'wrapper' ? getData(func) : undefined;\n\n      if (data && isLaziable(data[0]) &&\n            data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n            !data[4].length && data[9] == 1\n          ) {\n        wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n      } else {\n        wrapper = (func.length == 1 && isLaziable(func))\n          ? wrapper[funcName]()\n          : wrapper.thru(func);\n      }\n    }\n    return function() {\n      var args = arguments,\n          value = args[0];\n\n      if (wrapper && args.length == 1 && isArray(value)) {\n        return wrapper.plant(value).value();\n      }\n      var index = 0,\n          result = length ? funcs[index].apply(this, args) : value;\n\n      while (++index < length) {\n        result = funcs[index].call(this, result);\n      }\n      return result;\n    };\n  });\n}\n\nmodule.exports = createFlow;\n","var convert = require('./convert'),\n    func = convert('flowRight', require('../flowRight'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var convert = require('./convert'),\n    func = convert('filter', require('../filter'));\n\nfunc.placeholder = require('./placeholder');\nmodule.exports = func;\n","var baseFill = require('./_baseFill'),\n    isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\nfunction fill(array, value, start, end) {\n  var length = array == null ? 0 : array.length;\n  if (!length) {\n    return [];\n  }\n  if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n    start = 0;\n    end = length;\n  }\n  return baseFill(array, value, start, end);\n}\n\nmodule.exports = fill;\n","module.exports = require('./flowRight');\n","var toInteger = require('./toInteger'),\n    toLength = require('./toLength');\n\n/**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\nfunction baseFill(array, value, start, end) {\n  var length = array.length;\n\n  start = toInteger(start);\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = (end === undefined || end > length) ? length : toInteger(end);\n  if (end < 0) {\n    end += length;\n  }\n  end = start > end ? 0 : toLength(end);\n  while (start < end) {\n    array[start++] = value;\n  }\n  return array;\n}\n\nmodule.exports = baseFill;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n  var result = [];\n  baseEach(collection, function(value, index, collection) {\n    if (predicate(value, index, collection)) {\n      result.push(value);\n    }\n  });\n  return result;\n}\n\nmodule.exports = baseFilter;\n","var createFlow = require('./_createFlow');\n\n/**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n *   return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\nvar flowRight = createFlow(true);\n\nmodule.exports = flowRight;\n","import Vue from 'vue';\nimport compose from 'lodash/fp/compose';\nimport fill from 'lodash/fp/fill';\nimport filter from 'lodash/fp/filter';\nimport { insert, intersperse } from '../../../utils/data_utils';\nimport { isVnodeEmpty } from '../../../utils/is_slot_empty';\nimport __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';\n\n//\nconst filterEmptyNodesVue2 = filter(vNode => typeof vNode.tag === 'string' || vNode.text.trim() !== '');\nconst {\n  Fragment\n} = Vue;\nconst filterEmptyNodesVue3 = vNode => {\n  return vNode.reduce((acc, node) => {\n    if (Fragment && node.type === Fragment && Array.isArray(node.children)) {\n      acc.push(...node.children);\n    } else {\n      acc.push(node);\n    }\n    return acc;\n  }, []).filter(node => !isVnodeEmpty(node));\n};\nconst filterEmptyNodes = Vue.version.startsWith('3') ? filterEmptyNodesVue3 : filterEmptyNodesVue2;\nconst insertAfterSecondLastItem = insert(-1);\nconst replaceSecondLastItem = fill(-2, -1);\n\n// handles the addition of the lastSeparator in these two cases:\n// item1, item2, item3 => item1, item2, and item3\n// item1, item2 => item1 and item2\nconst addLastSeparator = lastSeparator => items => {\n  if (!lastSeparator) {\n    return items;\n  }\n  return items.length > 3 ? insertAfterSecondLastItem(lastSeparator, items) : replaceSecondLastItem(lastSeparator, items);\n};\nvar script = {\n  name: 'GlIntersperse',\n  functional: true,\n  props: {\n    separator: {\n      type: String,\n      default: ', ',\n      required: false\n    },\n    lastSeparator: {\n      type: String,\n      default: '',\n      required: false\n    }\n  },\n  render(createElement, context) {\n    const {\n      props: {\n        separator,\n        lastSeparator\n      },\n      slots,\n      data\n    } = context;\n    const filterAndSeparate = compose(addLastSeparator(lastSeparator), intersperse(separator), filterEmptyNodes);\n    return createElement('span', data, filterAndSeparate(slots().default));\n  }\n};\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n  /* style */\n  const __vue_inject_styles__ = undefined;\n  /* scoped */\n  const __vue_scope_id__ = undefined;\n  /* module identifier */\n  const __vue_module_identifier__ = undefined;\n  /* functional template */\n  const __vue_is_functional_template__ = undefined;\n  /* style inject */\n  \n  /* style inject SSR */\n  \n  /* style inject shadow dom */\n  \n\n  \n  const __vue_component__ = __vue_normalize__(\n    {},\n    __vue_inject_styles__,\n    __vue_script__,\n    __vue_scope_id__,\n    __vue_is_functional_template__,\n    __vue_module_identifier__,\n    false,\n    undefined,\n    undefined,\n    undefined\n  );\n\nexport default __vue_component__;\n","var arrayFilter = require('./_arrayFilter'),\n    baseFilter = require('./_baseFilter'),\n    baseIteratee = require('./_baseIteratee'),\n    isArray = require('./isArray');\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': true },\n *   { 'user': 'fred',   'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n  var func = isArray(collection) ? arrayFilter : baseFilter;\n  return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.exports = filter;\n"],"sourceRoot":""}