{"version":3,"sources":["webpack:///./vue_shared/components/file_finder/index.vue?41f0","webpack:///./vue_shared/components/file_finder/item.vue?1f54","webpack:///./lib/utils/keycodes.js","webpack:///./vue_shared/components/file_finder/index.vue","webpack:///vue_shared/components/file_finder/item.vue","webpack:///./vue_shared/components/file_finder/item.vue?b763","webpack:///./vue_shared/components/file_finder/item.vue?408b","webpack:///./vue_shared/components/file_finder/item.vue?f54c","webpack:///./vue_shared/components/file_finder/item.vue","webpack:///vue_shared/components/file_finder/index.vue","webpack:///./vue_shared/components/file_finder/index.vue?0966","webpack:///./vue_shared/components/file_finder/index.vue?1dcb","webpack:///./vue_shared/components/file_finder/index.vue?33ea"],"names":["module","exports","push","i","BACKSPACE_KEY_CODE","TAB_KEY_CODE","ENTER_KEY_CODE","ESC_KEY_CODE","UP_KEY_CODE","DOWN_KEY_CODE","DELETE_KEY_CODE","components","GlIcon","ChangedFileIcon","FileIcon","props","file","type","Object","required","focused","Boolean","searchText","String","index","Number","showDiffStats","default","computed","pathWithEllipsis","path","length","substr","nameSearchTextOccurences","fuzzaldrinPlus","match","name","pathSearchTextOccurences","methods","clickRow","$emit","mouseOverRow","mouseMove","options","locals","_vm","this","_c","_self","staticClass","class","attrs","on","$event","preventDefault","apply","arguments","_v","_l","split","char","charIndex","key","highlighted","indexOf","domProps","_s","changed","tempFile","_m","_e","addedLines","removedLines","MAX_FILE_FINDER_RESULTS","FILE_FINDER_ROW_HEIGHT","GlLoadingIcon","Item","VirtualList","files","Array","visible","loading","clearSearchOnClose","data","focusedIndex","mouseOver","cancelMouseOver","filteredBlobs","trim","slice","filter","maxResults","filteredBlobsLength","listShowCount","Math","min","listHeight","showClearInputButton","watch","_this","$nextTick","$refs","searchInput","focus","_this2","_this3","_this3$$refs$virtualS","virtualScrollList","$el","el","scrollTop","bottom","mounted","_this4","Mousetrap","bind","keysFor","MR_GO_TO_FILE","e","toggle","addStopCallback","combo","classList","contains","clearSearchInput","_this5","onKeydown","keyCode","onKeyup","openFile","onMouseOver","onMouseMove","target","currentTarget","directives","rawName","value","expression","ref","__","composing","hidden"],"mappings":"gFAAUA,EAAOC,QAAU,EAAQ,OAAR,EAAyE,IAE5FC,KAAK,CAACF,EAAOG,EAAI,yTAA0T,M,wBCFzUH,EAAOC,QAAU,EAAQ,OAAR,EAAyE,IAE5FC,KAAK,CAACF,EAAOG,EAAI,iFAAkF,M,kCCF3G,8OAGO,MAAMC,EAAqB,EACrBC,EAAe,EACfC,EAAiB,GACjBC,EAAe,GACfC,EAAc,GACdC,EAAgB,GAChBC,EAAkB,I,sLCT/B,I,8HCSe,ICT2Q,EDS3Q,CACfC,WAAA,CACAC,WACAC,oBACAC,cAEAC,MAAA,CACAC,KAAA,CACAC,KAAAC,OACAC,UAAA,GAEAC,QAAA,CACAH,KAAAI,QACAF,UAAA,GAEAG,WAAA,CACAL,KAAAM,OACAJ,UAAA,GAEAK,MAAA,CACAP,KAAAQ,OACAN,UAAA,GAEAO,cAAA,CACAT,KAAAI,QACAF,UAAA,EACAQ,SAAA,IAGAC,SAAA,CACAC,mBACA,WAAAC,GAAA,KAAAd,KAEA,OAAAc,EAAAC,OAnCA,GAoCAD,EACA,MAAAA,EAAAE,OAAAF,EAAAC,OArCA,KAuCAE,2BACA,OAAAC,IAAAC,MAAA,KAAAnB,KAAAoB,KAAA,KAAAd,aAEAe,2BACA,OAAAH,IAAAC,MAAA,KAAAN,iBAAA,KAAAP,cAGAgB,QAAA,CACAC,WACA,KAAAC,MAAA,aAAAxB,OAEAyB,eACA,KAAAD,MAAA,iBAAAhB,QAEAkB,YACA,KAAAF,MAAA,iBAAAhB,U,0CE1DImB,EAAU,CAEd,OAAiB,OACjB,WAAoB,G,GAEP,IAAI,IAASA,GAIX,IAAQC,O,WCOR,EAXC,YACd,GCTW,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,SAAS,CAACE,YAAY,oBAAoBC,MAAM,CAClH,aAAcL,EAAIzB,SAClB+B,M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time/api.js\")(false);\n// Module\nexports.push([module.id, \"\\n.file-finder-overlay[data-v-29b84264] {\\n  position: absolute;\\n  top: 0;\\n  right: 0;\\n  bottom: 0;\\n  left: 0;\\n  z-index: 200;\\n}\\n.file-finder[data-v-29b84264] {\\n  top: 10px;\\n  left: 50%;\\n  transform: translateX(-50%);\\n}\\n.diff-file-changes[data-v-29b84264] {\\n  top: 50px;\\n  max-height: 327px;\\n}\\n\", \"\"]);\n\n","exports = module.exports = require(\"../../../../../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"\\n.highlighted[data-v-2107b802] {\\n  color: #1f78d1;\\n  font-weight: 600;\\n}\\n\", \"\"]);\n\n","// `e.keyCode` is deprecated, these values should be migrated\n// See: https://gitlab.com/gitlab-org/gitlab/-/issues/216102\n\nexport const BACKSPACE_KEY_CODE = 8;\nexport const TAB_KEY_CODE = 9;\nexport const ENTER_KEY_CODE = 13;\nexport const ESC_KEY_CODE = 27;\nexport const UP_KEY_CODE = 38;\nexport const DOWN_KEY_CODE = 40;\nexport const DELETE_KEY_CODE = 46;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.visible)?_c('div',{staticClass:\"file-finder-overlay\",attrs:{\"data-testid\":\"overlay\"},on:{\"mousedown\":function($event){if($event.target !== $event.currentTarget)return null;return _vm.toggle(false)}}},[_c('div',{staticClass:\"dropdown-menu diff-file-changes file-finder show\"},[_c('div',{staticClass:\"dropdown-input\",class:{ 'has-value': _vm.showClearInputButton }},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.searchText),expression:\"searchText\"}],ref:\"searchInput\",staticClass:\"dropdown-input-field\",attrs:{\"placeholder\":_vm.__('Search files'),\"type\":\"search\",\"autocomplete\":\"off\",\"data-testid\":\"search-input\"},domProps:{\"value\":(_vm.searchText)},on:{\"keydown\":function($event){return _vm.onKeydown($event)},\"keyup\":function($event){return _vm.onKeyup($event)},\"input\":function($event){if($event.target.composing)return;_vm.searchText=$event.target.value}}}),_vm._v(\" \"),_c('gl-icon',{staticClass:\"dropdown-input-search\",class:{ hidden: _vm.showClearInputButton },attrs:{\"name\":\"search\"}}),_vm._v(\" \"),_c('gl-icon',{staticClass:\"dropdown-input-clear\",attrs:{\"name\":\"close\",\"data-testid\":\"clear-search-input\",\"role\":\"button\",\"aria-label\":_vm.__('Clear search input')},on:{\"click\":_vm.clearSearchInput}})],1),_vm._v(\" \"),_c('div',[_c('virtual-list',{ref:\"virtualScrollList\",attrs:{\"size\":_vm.listHeight,\"remain\":_vm.listShowCount,\"wtag\":\"ul\"}},[(_vm.filteredBlobsLength)?_vm._l((_vm.filteredBlobs),function(file,index){return _c('li',{key:file.key},[_c('item',{staticClass:\"disable-hover\",attrs:{\"file\":file,\"search-text\":_vm.searchText,\"focused\":index === _vm.focusedIndex,\"index\":index,\"show-diff-stats\":_vm.showDiffStats},on:{\"click\":_vm.openFile,\"mouseover\":_vm.onMouseOver,\"mousemove\":_vm.onMouseMove}})],1)}):_c('li',{staticClass:\"dropdown-menu-empty-item\"},[_c('div',{staticClass:\"gl-mb-3 gl-ml-3 gl-mr-3 gl-mt-5\"},[(_vm.loading)?[_c('gl-loading-icon')]:[_vm._v(\"\\n              \"+_vm._s(_vm.__('No files found.'))+\"\\n            \")]],2)])],2)],1)])]):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!-- eslint-disable vue/multi-word-component-names -->\n<script>\nimport { GlIcon } from '@gitlab/ui';\nimport fuzzaldrinPlus from 'fuzzaldrin-plus';\nimport ChangedFileIcon from '../changed_file_icon.vue';\nimport FileIcon from '../file_icon.vue';\n\nconst MAX_PATH_LENGTH = 60;\n\nexport default {\n  components: {\n    GlIcon,\n    ChangedFileIcon,\n    FileIcon,\n  },\n  props: {\n    file: {\n      type: Object,\n      required: true,\n    },\n    focused: {\n      type: Boolean,\n      required: true,\n    },\n    searchText: {\n      type: String,\n      required: true,\n    },\n    index: {\n      type: Number,\n      required: true,\n    },\n    showDiffStats: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n  },\n  computed: {\n    pathWithEllipsis() {\n      const { path } = this.file;\n\n      return path.length < MAX_PATH_LENGTH\n        ? path\n        : `...${path.substr(path.length - MAX_PATH_LENGTH)}`;\n    },\n    nameSearchTextOccurences() {\n      return fuzzaldrinPlus.match(this.file.name, this.searchText);\n    },\n    pathSearchTextOccurences() {\n      return fuzzaldrinPlus.match(this.pathWithEllipsis, this.searchText);\n    },\n  },\n  methods: {\n    clickRow() {\n      this.$emit('click', this.file);\n    },\n    mouseOverRow() {\n      this.$emit('mouseover', this.index);\n    },\n    mouseMove() {\n      this.$emit('mousemove', this.index);\n    },\n  },\n};\n</script>\n\n<template>\n  <button\n    :class=\"{\n      'is-focused': focused,\n    }\"\n    type=\"button\"\n    class=\"diff-changed-file\"\n    @click.prevent=\"clickRow\"\n    @mouseover=\"mouseOverRow\"\n    @mousemove=\"mouseMove\"\n  >\n    <file-icon :file-name=\"file.name\" :size=\"16\" css-classes=\"diff-file-changed-icon gl-mr-3\" />\n    <span class=\"diff-changed-file-content gl-mr-3\">\n      <strong class=\"diff-changed-file-name\">\n        <span\n          v-for=\"(char, charIndex) in file.name.split('')\"\n          :key=\"charIndex + char\"\n          :class=\"{\n            highlighted: nameSearchTextOccurences.indexOf(charIndex) >= 0,\n          }\"\n          v-text=\"char\"\n        >\n        </span>\n      </strong>\n      <span class=\"diff-changed-file-path gl-mt-2\">\n        <span\n          v-for=\"(char, charIndex) in pathWithEllipsis.split('')\"\n          :key=\"charIndex + char\"\n          :class=\"{\n            highlighted: pathSearchTextOccurences.indexOf(charIndex) >= 0,\n          }\"\n          v-text=\"char\"\n        >\n        </span>\n      </span>\n    </span>\n    <span v-if=\"file.changed || file.tempFile\" v-once class=\"diff-changed-stats\">\n      <span v-if=\"showDiffStats\">\n        <span class=\"gl-font-bold gl-text-success\">\n          <gl-icon name=\"file-addition\" class=\"align-text-top\" /> {{ file.addedLines }}\n        </span>\n        <span class=\"ml-1 gl-font-bold gl-text-danger\">\n          <gl-icon name=\"file-deletion\" class=\"align-text-top\" /> {{ file.removedLines }}\n        </span>\n      </span>\n      <changed-file-icon v-else :file=\"file\" />\n    </span>\n  </button>\n</template>\n\n<style scoped>\n.highlighted {\n  color: #1f78d1;\n  font-weight: 600;\n}\n</style>\n","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!./item.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!./item.vue?vue&type=script&lang=js\"","import api from \"!../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n            import content from \"!!../../../../../../node_modules/css-loader/dist/cjs.js??ref--20-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./item.vue?vue&type=style&index=0&id=2107b802&prod&scoped=true&lang=css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./item.vue?vue&type=template&id=2107b802&scoped=true\"\nimport script from \"./item.vue?vue&type=script&lang=js\"\nexport * from \"./item.vue?vue&type=script&lang=js\"\nimport style0 from \"./item.vue?vue&type=style&index=0&id=2107b802&prod&scoped=true&lang=css\"\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  \"2107b802\",\n  null\n  \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('button',{staticClass:\"diff-changed-file\",class:{\n    'is-focused': _vm.focused,\n  },attrs:{\"type\":\"button\"},on:{\"click\":function($event){$event.preventDefault();return _vm.clickRow.apply(null, arguments)},\"mouseover\":_vm.mouseOverRow,\"mousemove\":_vm.mouseMove}},[_c('file-icon',{attrs:{\"file-name\":_vm.file.name,\"size\":16,\"css-classes\":\"diff-file-changed-icon gl-mr-3\"}}),_vm._v(\" \"),_c('span',{staticClass:\"diff-changed-file-content gl-mr-3\"},[_c('strong',{staticClass:\"diff-changed-file-name\"},_vm._l((_vm.file.name.split('')),function(char,charIndex){return _c('span',{key:charIndex + char,class:{\n          highlighted: _vm.nameSearchTextOccurences.indexOf(charIndex) >= 0,\n        },domProps:{\"textContent\":_vm._s(char)}})}),0),_vm._v(\" \"),_c('span',{staticClass:\"diff-changed-file-path gl-mt-2\"},_vm._l((_vm.pathWithEllipsis.split('')),function(char,charIndex){return _c('span',{key:charIndex + char,class:{\n          highlighted: _vm.pathSearchTextOccurences.indexOf(charIndex) >= 0,\n        },domProps:{\"textContent\":_vm._s(char)}})}),0)]),_vm._v(\" \"),(_vm.file.changed || _vm.file.tempFile)?_vm._m(0):_vm._e()],1)\n}\nvar staticRenderFns = [function (){var _vm=this,_c=_vm._self._c;return _c('span',{staticClass:\"diff-changed-stats\"},[(_vm.showDiffStats)?_c('span',[_c('span',{staticClass:\"gl-font-bold gl-text-success\"},[_c('gl-icon',{staticClass:\"align-text-top\",attrs:{\"name\":\"file-addition\"}}),_vm._v(\" \"+_vm._s(_vm.file.addedLines)+\"\\n      \")],1),_vm._v(\" \"),_c('span',{staticClass:\"ml-1 gl-font-bold gl-text-danger\"},[_c('gl-icon',{staticClass:\"align-text-top\",attrs:{\"name\":\"file-deletion\"}}),_vm._v(\" \"+_vm._s(_vm.file.removedLines)+\"\\n      \")],1)]):_c('changed-file-icon',{attrs:{\"file\":_vm.file}})],1)\n}]\n\nexport { render, staticRenderFns }","<!-- eslint-disable vue/multi-word-component-names -->\n<script>\nimport { GlIcon, GlLoadingIcon } from '@gitlab/ui';\nimport fuzzaldrinPlus from 'fuzzaldrin-plus';\nimport VirtualList from 'vue-virtual-scroll-list';\nimport { Mousetrap, addStopCallback } from '~/lib/mousetrap';\nimport { keysFor, MR_GO_TO_FILE } from '~/behaviors/shortcuts/keybindings';\nimport { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes';\nimport Item from './item.vue';\n\nexport const MAX_FILE_FINDER_RESULTS = 40;\nexport const FILE_FINDER_ROW_HEIGHT = 55;\n\nexport default {\n  components: {\n    GlIcon,\n    GlLoadingIcon,\n    Item,\n    VirtualList,\n  },\n  props: {\n    files: {\n      type: Array,\n      required: true,\n    },\n    visible: {\n      type: Boolean,\n      required: true,\n    },\n    loading: {\n      type: Boolean,\n      required: true,\n    },\n    showDiffStats: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    clearSearchOnClose: {\n      type: Boolean,\n      required: false,\n      default: true,\n    },\n  },\n  data() {\n    return {\n      focusedIndex: -1,\n      searchText: '',\n      mouseOver: false,\n      cancelMouseOver: false,\n    };\n  },\n  computed: {\n    filteredBlobs() {\n      const searchText = this.searchText.trim();\n\n      if (searchText === '') {\n        return this.files.slice(0, MAX_FILE_FINDER_RESULTS);\n      }\n\n      return fuzzaldrinPlus.filter(this.files, searchText, {\n        key: 'path',\n        maxResults: MAX_FILE_FINDER_RESULTS,\n      });\n    },\n    filteredBlobsLength() {\n      return this.filteredBlobs.length;\n    },\n    listShowCount() {\n      return this.filteredBlobsLength ? Math.min(this.filteredBlobsLength, 5) : 1;\n    },\n    listHeight() {\n      return FILE_FINDER_ROW_HEIGHT;\n    },\n    showClearInputButton() {\n      return this.searchText.trim() !== '';\n    },\n  },\n  watch: {\n    visible() {\n      this.$nextTick(() => {\n        if (!this.visible) {\n          if (this.clearSearchOnClose) {\n            this.searchText = '';\n          }\n        } else {\n          this.focusedIndex = 0;\n\n          if (this.$refs.searchInput) {\n            this.$refs.searchInput.focus();\n          }\n        }\n      });\n    },\n    searchText() {\n      this.focusedIndex = -1;\n\n      this.$nextTick(() => {\n        this.focusedIndex = 0;\n      });\n    },\n    focusedIndex() {\n      if (!this.mouseOver) {\n        this.$nextTick(() => {\n          if (!this.$refs.virtualScrollList?.$el) {\n            return;\n          }\n          const el = this.$refs.virtualScrollList.$el;\n          const scrollTop = this.focusedIndex * FILE_FINDER_ROW_HEIGHT;\n          const bottom = this.listShowCount * FILE_FINDER_ROW_HEIGHT;\n\n          if (this.focusedIndex === 0) {\n            // if index is the first index, scroll straight to start\n            el.scrollTop = 0;\n          } else if (this.focusedIndex === this.filteredBlobsLength - 1) {\n            // if index is the last index, scroll to the end\n            el.scrollTop = this.filteredBlobsLength * FILE_FINDER_ROW_HEIGHT;\n          } else if (scrollTop >= bottom + el.scrollTop) {\n            // if element is off the bottom of the scroll list, scroll down one item\n            el.scrollTop = scrollTop - bottom + FILE_FINDER_ROW_HEIGHT;\n          } else if (scrollTop < el.scrollTop) {\n            // if element is off the top of the scroll list, scroll up one item\n            el.scrollTop = scrollTop;\n          }\n        });\n      }\n    },\n  },\n  mounted() {\n    if (this.files.length) {\n      this.focusedIndex = 0;\n    }\n\n    Mousetrap.bind(keysFor(MR_GO_TO_FILE), (e) => {\n      if (e.preventDefault) {\n        e.preventDefault();\n      }\n\n      this.toggle(!this.visible);\n    });\n\n    addStopCallback((e, el, combo) => {\n      if (\n        (combo === 't' && el.classList.contains('dropdown-input-field')) ||\n        el.classList.contains('inputarea')\n      ) {\n        return true;\n      }\n      if (combo === 'mod+p') {\n        return false;\n      }\n\n      return undefined;\n    });\n  },\n  methods: {\n    toggle(visible) {\n      this.$emit('toggle', visible);\n    },\n    clearSearchInput() {\n      this.searchText = '';\n\n      this.$nextTick(() => {\n        this.$refs.searchInput.focus();\n      });\n    },\n    onKeydown(e) {\n      switch (e.keyCode) {\n        case UP_KEY_CODE:\n          e.preventDefault();\n          this.mouseOver = false;\n          this.cancelMouseOver = true;\n          if (this.focusedIndex > 0) {\n            this.focusedIndex -= 1;\n          } else {\n            this.focusedIndex = this.filteredBlobsLength - 1;\n          }\n          break;\n        case DOWN_KEY_CODE:\n          e.preventDefault();\n          this.mouseOver = false;\n          this.cancelMouseOver = true;\n          if (this.focusedIndex < this.filteredBlobsLength - 1) {\n            this.focusedIndex += 1;\n          } else {\n            this.focusedIndex = 0;\n          }\n          break;\n        default:\n          break;\n      }\n    },\n    onKeyup(e) {\n      switch (e.keyCode) {\n        case ENTER_KEY_CODE:\n          this.openFile(this.filteredBlobs[this.focusedIndex]);\n          break;\n        case ESC_KEY_CODE:\n          this.toggle(false);\n          break;\n        default:\n          break;\n      }\n    },\n    openFile(file) {\n      this.toggle(false);\n      this.$emit('click', file);\n    },\n    onMouseOver(index) {\n      if (!this.cancelMouseOver) {\n        this.mouseOver = true;\n        this.focusedIndex = index;\n      }\n    },\n    onMouseMove(index) {\n      this.cancelMouseOver = false;\n      this.onMouseOver(index);\n    },\n  },\n};\n</script>\n\n<template>\n  <div\n    v-if=\"visible\"\n    data-testid=\"overlay\"\n    class=\"file-finder-overlay\"\n    @mousedown.self=\"toggle(false)\"\n  >\n    <div class=\"dropdown-menu diff-file-changes file-finder show\">\n      <div :class=\"{ 'has-value': showClearInputButton }\" class=\"dropdown-input\">\n        <input\n          ref=\"searchInput\"\n          v-model=\"searchText\"\n          :placeholder=\"__('Search files')\"\n          type=\"search\"\n          class=\"dropdown-input-field\"\n          autocomplete=\"off\"\n          data-testid=\"search-input\"\n          @keydown=\"onKeydown($event)\"\n          @keyup=\"onKeyup($event)\"\n        />\n        <gl-icon\n          name=\"search\"\n          class=\"dropdown-input-search\"\n          :class=\"{ hidden: showClearInputButton }\"\n        />\n        <gl-icon\n          name=\"close\"\n          data-testid=\"clear-search-input\"\n          class=\"dropdown-input-clear\"\n          role=\"button\"\n          :aria-label=\"__('Clear search input')\"\n          @click=\"clearSearchInput\"\n        />\n      </div>\n      <div>\n        <virtual-list ref=\"virtualScrollList\" :size=\"listHeight\" :remain=\"listShowCount\" wtag=\"ul\">\n          <template v-if=\"filteredBlobsLength\">\n            <li v-for=\"(file, index) in filteredBlobs\" :key=\"file.key\">\n              <item\n                :file=\"file\"\n                :search-text=\"searchText\"\n                :focused=\"index === focusedIndex\"\n                :index=\"index\"\n                :show-diff-stats=\"showDiffStats\"\n                class=\"disable-hover\"\n                @click=\"openFile\"\n                @mouseover=\"onMouseOver\"\n                @mousemove=\"onMouseMove\"\n              />\n            </li>\n          </template>\n          <li v-else class=\"dropdown-menu-empty-item\">\n            <div class=\"gl-mb-3 gl-ml-3 gl-mr-3 gl-mt-5\">\n              <template v-if=\"loading\">\n                <gl-loading-icon />\n              </template>\n              <template v-else>\n                {{ __('No files found.') }}\n              </template>\n            </div>\n          </li>\n        </virtual-list>\n      </div>\n    </div>\n  </div>\n</template>\n\n<style scoped>\n.file-finder-overlay {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: 200;\n}\n\n.file-finder {\n  top: 10px;\n  left: 50%;\n  transform: translateX(-50%);\n}\n\n.diff-file-changes {\n  top: 50px;\n  max-height: 327px;\n}\n</style>\n","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!./index.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!./index.vue?vue&type=script&lang=js\"","import api from \"!../../../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n            import content from \"!!../../../../../../node_modules/css-loader/dist/cjs.js??ref--20-1!../../../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=style&index=0&id=29b84264&prod&scoped=true&lang=css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=29b84264&scoped=true\"\nimport script from \"./index.vue?vue&type=script&lang=js\"\nexport * from \"./index.vue?vue&type=script&lang=js\"\nimport style0 from \"./index.vue?vue&type=style&index=0&id=29b84264&prod&scoped=true&lang=css\"\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  \"29b84264\",\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}