{"version":3,"sources":["webpack:///blob.451528c644c00014c31a.bundle.js","webpack:///./blob/blob_file_dropzone.js","webpack:///./blob/file_template_mediator.js","webpack:///./blob/file_template_selector.js","webpack:///./blob/template_selectors/ci_yaml_selector.js","webpack:///./blob/template_selectors/dockerfile_selector.js","webpack:///./blob/template_selectors/gitignore_selector.js","webpack:///./blob/template_selectors/license_selector.js","webpack:///./blob/template_selectors/type_selector.js","webpack:///./blob_edit/blob_bundle.js","webpack:///./blob_edit/edit_blob.js","webpack:///./lib/utils/constants.js"],"names":["webpackJsonp","./blob/blob_file_dropzone.js","module","__webpack_exports__","__webpack_require__","$","_classCallCheck","instance","Constructor","TypeError","toggleLoading","$el","$icon","loading","disable","removeClass","__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__","enable","addClass","__WEBPACK_IMPORTED_MODULE_0_dropzone__","__WEBPACK_IMPORTED_MODULE_0_dropzone___default","n","__WEBPACK_IMPORTED_MODULE_3__lib_utils_csrf__","BlobFileDropzone","form","method","this","formDropzone","find","submitButton","submitButtonLoadingIcon","dropzoneMessage","a","autoDiscover","dropzone","autoProcessQueue","url","attr","clickable","uploadMultiple","paramName","maxFilesize","gon","max_file_size","parallelUploads","maxFiles","addRemoveLinks","previewsContainer","headers","init","on","html","hide","header","response","modal","window","gl","utils","visitUrl","filePath","file","removeFile","xhr","formData","append","val","error","errorMessage","stripped","text","show","e","preventDefault","stopPropagation","getQueuedFiles","length","alert","processQueue","call","./blob/file_template_mediator.js","__WEBPACK_IMPORTED_MODULE_0__flash__","__WEBPACK_IMPORTED_MODULE_1__template_selectors_type_selector__","__WEBPACK_IMPORTED_MODULE_2__template_selectors_ci_yaml_selector__","__WEBPACK_IMPORTED_MODULE_3__template_selectors_dockerfile_selector__","__WEBPACK_IMPORTED_MODULE_4__template_selectors_gitignore_selector__","__WEBPACK_IMPORTED_MODULE_5__template_selectors_license_selector__","_createClass","defineProperties","target","props","i","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","FileTemplateMediator","_ref","editor","currentAction","initTemplateSelectors","initTemplateTypeSelector","initDomElements","initDropdowns","initPageEvents","value","_this","templateSelectors","map","TemplateSelectorClass","mediator","typeSelector","dropdownData","templateSelector","cfg","config","name","$templatesMenu","$undoMenu","$fileEditor","$undoBtn","$templateSelectors","$filenameInput","$fileContent","$commitForm","$navLinks","hideTemplateSelectorMenu","displayMatchedTemplateSelector","listenForFilenameInput","prepFileContentForSubmit","listenForPreviewMode","_this2","_this3","submit","getValue","_this4","urlPieces","href","split","hash","showTemplateSelectorMenu","item","forEach","selector","setToggleText","cacheToggleText","options","selectTemplateType","selectedObj","query","data","_this5","renderLoading","destroyUndoMenu","fetchFileTemplate","endpoint","then","showUndoMenu","setEditorContent","setFilename","renderLoaded","catch","err","_this6","currentInput","getFilename","pattern","test","apiCall","Promise","resolve","resolveFile","newValue","content","setValue","focus","navigateFileStart","_this7","restoreFromCache","cacheFileContents","off","cachedToggleText","getTemplateSelectorToggleText","cachedContent","cachedFilename","setTemplateSelectorToggleText","getToggleText","selected","./blob/file_template_selector.js","FileTemplateSelector","$dropdown","$wrapper","dropdown","wrapper","$loadingIcon","$dropdownToggleText","initDropdown","selectTemplateFile","opts","reportSelection","./blob/template_selectors/ci_yaml_selector.js","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","__WEBPACK_IMPORTED_MODULE_0__api__","__WEBPACK_IMPORTED_MODULE_1__file_template_selector__","BlobCiYamlSelector","_FileTemplateSelector","getPrototypeOf","gitlabCiYml","glDropdown","filterable","selectable","toggleLabel","search","fields","clicked","reportSelectionName","./blob/template_selectors/dockerfile_selector.js","DockerfileSelector","dockerfileYml","./blob/template_selectors/gitignore_selector.js","BlobGitignoreSelector","gitignoreText","./blob/template_selectors/license_selector.js","BlobLicenseSelector","licenseText","el","project","fullname","id","./blob/template_selectors/type_selector.js","__WEBPACK_IMPORTED_MODULE_0__file_template_selector__","FileTemplateTypeSelector","selectTemplateTypeOptions","./blob_edit/blob_bundle.js","__WEBPACK_IMPORTED_MODULE_0__new_commit_form__","__WEBPACK_IMPORTED_MODULE_1__edit_blob__","__WEBPACK_IMPORTED_MODULE_2__blob_blob_file_dropzone__","editBlobForm","uploadBlobForm","deleteBlobForm","urlRoot","assetsPath","blobLanguage","disableButtonIfEmptyField","./blob_edit/edit_blob.js","__WEBPACK_IMPORTED_MODULE_0__blob_file_template_mediator__","EditBlob","aceMode","configureAceEditor","initModePanesAndLinks","initSoftWrap","initFileSelectors","ace","set","loadModule","edit","$blockScrolling","Infinity","getSession","setMode","fileTemplateMediator","$editModePanes","$editModeLinks","editModeLinkClickHandler","currentLink","paneId","currentPane","filter","parent","fadeIn","$toggleButton","post","empty","renderGFM","isSoftWrapped","toggleSoftWrap","toggleClass","setUseWrapMode","./lib/utils/constants.js","d","BYTES_IN_KIB","HIDDEN_CLASS"],"mappings":"AAAAA,cAAc,SAERC,+BACA,SAAUC,EAAQC,EAAqBC,GAE7C,cAC4B,SAASC,GAKrC,QAASC,GAAgBC,EAAUC,GAAe,KAAMD,YAAoBC,IAAgB,KAAM,IAAIC,WAAU,qCCLhH,QAASC,GAAcC,EAAKC,EAAOC,GAC7BA,GACFF,EAAIG,UACJF,EAAMG,YAAYC,EAAA,KAElBL,EAAIM,SACJL,EAAMM,SAASF,EAAA,IDN2C,GAAIG,GAAyCf,EAAoB,mDACtGgB,EAAiDhB,EAAoBiB,EAAEF,GAEvEH,GADuDZ,EAAoB,8BACtBA,EAAoB,6BACzEkB,EAAgDlB,EAAoB,uBCKxEmB,EACnB,QAAAA,GAAYC,EAAMC,GAAQnB,EAAAoB,KAAAH,EACxB,IAAMI,GAAeH,EAAKI,KAAK,aACzBC,EAAeL,EAAKI,KAAK,eACzBE,EAA0BD,EAAaD,KAAK,oBAC5CG,EAAkBP,EAAKI,KAAK,cAClCR,GAAAY,EAASC,cAAe,CAExB,IAAMC,GAAWP,EAAaO,UAC5BD,cAAc,EACdE,kBAAkB,EA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,QAAQ9N,OAAOX,GACpBmO,EAAYO,gBAIvBtQ,KAAKmQ,cAActN,OAEZ7C,KAAK8E,OAAO6E,YVi7BnBnF,IAAK,eACLa,MAAO,WU/6BM,GAAA0B,GAAA/G,IACbA,MAAKuQ,eAAgB,EACrBvQ,KAAKmQ,cAAgBxR,EAAE,qBACvBqB,KAAKmQ,cAAc3O,GAAG,QAAS,iBAAMuF,GAAKyJ,sBVs7B1ChM,IAAK,iBACLa,MAAO,WUn7BPrF,KAAKuQ,eAAiBvQ,KAAKuQ,cAC3BvQ,KAAKmQ,cAAcM,YAAY,mBAAoBzQ,KAAKuQ,eACxDvQ,KAAK8E,OAAOyK,aAAamB,eAAe1Q,KAAKuQ,mBVw7BxC5B,IAGoBlQ,GAAuB,EAAI,IAC3B4E,KAAK5E,EAAqBC,EAAoB,iDAIrEiS,2BACA,SAAUnS,EAAQC,EAAqBC,GAE7C,YAC+BA,GAAoBkS,EAAEnS,EAAqB,IAAK,WAAa,MAAOoS,KWphCnGnS,EAAAkS,EAAAnS,EAAA,qBAAAqS,IACO,IAAMD,GAAe,KACfC,EAAe,YX0hCzB","file":"blob.451528c644c00014c31a.bundle.js","sourcesContent":["webpackJsonp([\"blob\"],{\n\n/***/ \"./blob/blob_file_dropzone.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_dropzone__ = __webpack_require__(\"../../../node_modules/dropzone/dist/dropzone.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_dropzone___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_dropzone__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__lib_utils_url_utility__ = __webpack_require__(\"./lib/utils/url_utility.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__ = __webpack_require__(\"./lib/utils/constants.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__lib_utils_csrf__ = __webpack_require__(\"./lib/utils/csrf.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable func-names, object-shorthand, prefer-arrow-callback */\n\n\n\n\n\nfunction toggleLoading($el, $icon, loading) {\n if (loading) {\n $el.disable();\n $icon.removeClass(__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__[\"b\" /* HIDDEN_CLASS */]);\n } else {\n $el.enable();\n $icon.addClass(__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__[\"b\" /* HIDDEN_CLASS */]);\n }\n}\n\nvar BlobFileDropzone = function BlobFileDropzone(form, method) {\n _classCallCheck(this, BlobFileDropzone);\n\n var formDropzone = form.find('.dropzone');\n var submitButton = form.find('#submit-all');\n var submitButtonLoadingIcon = submitButton.find('.js-loading-icon');\n var dropzoneMessage = form.find('.dz-message');\n __WEBPACK_IMPORTED_MODULE_0_dropzone___default.a.autoDiscover = false;\n\n var dropzone = formDropzone.dropzone({\n autoDiscover: false,\n autoProcessQueue: false,\n url: form.attr('action'),\n // Rails uses a hidden input field for PUT\n // http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails\n method: method,\n clickable: true,\n uploadMultiple: false,\n paramName: 'file',\n maxFilesize: gon.max_file_size || 10,\n parallelUploads: 1,\n maxFiles: 1,\n addRemoveLinks: true,\n previewsContainer: '.dropzone-previews',\n headers: __WEBPACK_IMPORTED_MODULE_3__lib_utils_csrf__[\"a\" /* default */].headers,\n init: function init() {\n this.on('addedfile', function () {\n toggleLoading(submitButton, submitButtonLoadingIcon, false);\n dropzoneMessage.addClass(__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__[\"b\" /* HIDDEN_CLASS */]);\n $('.dropzone-alerts').html('').hide();\n });\n this.on('removedfile', function () {\n toggleLoading(submitButton, submitButtonLoadingIcon, false);\n dropzoneMessage.removeClass(__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__[\"b\" /* HIDDEN_CLASS */]);\n });\n this.on('success', function (header, response) {\n $('#modal-upload-blob').modal('hide');\n window.gl.utils.visitUrl(response.filePath);\n });\n this.on('maxfilesexceeded', function (file) {\n dropzoneMessage.addClass(__WEBPACK_IMPORTED_MODULE_2__lib_utils_constants__[\"b\" /* HIDDEN_CLASS */]);\n this.removeFile(file);\n });\n this.on('sending', function (file, xhr, formData) {\n formData.append('branch_name', form.find('.js-branch-name').val());\n formData.append('create_merge_request', form.find('.js-create-merge-request').val());\n formData.append('commit_message', form.find('.js-commit-message').val());\n });\n },\n // Override behavior of adding error underneath preview\n error: function error(file, errorMessage) {\n var stripped = $('
').html(errorMessage).text();\n $('.dropzone-alerts').html('Error uploading file: \"' + stripped + '\"').show();\n this.removeFile(file);\n }\n });\n\n submitButton.on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n if (dropzone[0].dropzone.getQueuedFiles().length === 0) {\n // eslint-disable-next-line no-alert\n alert('Please select a file');\n return false;\n }\n toggleLoading(submitButton, submitButtonLoadingIcon, true);\n dropzone[0].dropzone.processQueue();\n return false;\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (BlobFileDropzone);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./blob/file_template_mediator.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flash__ = __webpack_require__(\"./flash.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__template_selectors_type_selector__ = __webpack_require__(\"./blob/template_selectors/type_selector.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__template_selectors_ci_yaml_selector__ = __webpack_require__(\"./blob/template_selectors/ci_yaml_selector.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__template_selectors_dockerfile_selector__ = __webpack_require__(\"./blob/template_selectors/dockerfile_selector.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__template_selectors_gitignore_selector__ = __webpack_require__(\"./blob/template_selectors/gitignore_selector.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__template_selectors_license_selector__ = __webpack_require__(\"./blob/template_selectors/license_selector.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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable class-methods-use-this */\n\n\n\n\n\n\n\nvar FileTemplateMediator = function () {\n function FileTemplateMediator(_ref) {\n var editor = _ref.editor,\n currentAction = _ref.currentAction;\n\n _classCallCheck(this, FileTemplateMediator);\n\n this.editor = editor;\n this.currentAction = currentAction;\n\n this.initTemplateSelectors();\n this.initTemplateTypeSelector();\n this.initDomElements();\n this.initDropdowns();\n this.initPageEvents();\n }\n\n _createClass(FileTemplateMediator, [{\n key: 'initTemplateSelectors',\n value: function initTemplateSelectors() {\n var _this = this;\n\n // Order dictates template type dropdown item order\n this.templateSelectors = [__WEBPACK_IMPORTED_MODULE_4__template_selectors_gitignore_selector__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_2__template_selectors_ci_yaml_selector__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_3__template_selectors_dockerfile_selector__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_5__template_selectors_license_selector__[\"a\" /* default */]].map(function (TemplateSelectorClass) {\n return new TemplateSelectorClass({ mediator: _this });\n });\n }\n }, {\n key: 'initTemplateTypeSelector',\n value: function initTemplateTypeSelector() {\n this.typeSelector = new __WEBPACK_IMPORTED_MODULE_1__template_selectors_type_selector__[\"a\" /* default */]({\n mediator: this,\n dropdownData: this.templateSelectors.map(function (templateSelector) {\n var cfg = templateSelector.config;\n\n return {\n name: cfg.name,\n key: cfg.key\n };\n })\n });\n }\n }, {\n key: 'initDomElements',\n value: function initDomElements() {\n var $templatesMenu = $('.template-selectors-menu');\n var $undoMenu = $templatesMenu.find('.template-selectors-undo-menu');\n var $fileEditor = $('.file-editor');\n\n this.$templatesMenu = $templatesMenu;\n this.$undoMenu = $undoMenu;\n this.$undoBtn = $undoMenu.find('button');\n this.$templateSelectors = $templatesMenu.find('.template-selector-dropdowns-wrap');\n this.$filenameInput = $fileEditor.find('.js-file-path-name-input');\n this.$fileContent = $fileEditor.find('#file-content');\n this.$commitForm = $fileEditor.find('form');\n this.$navLinks = $fileEditor.find('.nav-links');\n }\n }, {\n key: 'initDropdowns',\n value: function initDropdowns() {\n if (this.currentAction === 'create') {\n this.typeSelector.show();\n } else {\n this.hideTemplateSelectorMenu();\n }\n\n this.displayMatchedTemplateSelector();\n }\n }, {\n key: 'initPageEvents',\n value: function initPageEvents() {\n this.listenForFilenameInput();\n this.prepFileContentForSubmit();\n this.listenForPreviewMode();\n }\n }, {\n key: 'listenForFilenameInput',\n value: function listenForFilenameInput() {\n var _this2 = this;\n\n this.$filenameInput.on('keyup blur', function () {\n _this2.displayMatchedTemplateSelector();\n });\n }\n }, {\n key: 'prepFileContentForSubmit',\n value: function prepFileContentForSubmit() {\n var _this3 = this;\n\n this.$commitForm.submit(function () {\n _this3.$fileContent.val(_this3.editor.getValue());\n });\n }\n }, {\n key: 'listenForPreviewMode',\n value: function listenForPreviewMode() {\n var _this4 = this;\n\n this.$navLinks.on('click', 'a', function (e) {\n var urlPieces = e.target.href.split('#');\n var hash = urlPieces[1];\n if (hash === 'preview') {\n _this4.hideTemplateSelectorMenu();\n } else if (hash === 'editor') {\n _this4.showTemplateSelectorMenu();\n }\n });\n }\n }, {\n key: 'selectTemplateType',\n value: function selectTemplateType(item, e) {\n if (e) {\n e.preventDefault();\n }\n\n this.templateSelectors.forEach(function (selector) {\n if (selector.config.key === item.key) {\n selector.show();\n } else {\n selector.hide();\n }\n });\n\n this.typeSelector.setToggleText(item.name);\n\n this.cacheToggleText();\n }\n }, {\n key: 'selectTemplateTypeOptions',\n value: function selectTemplateTypeOptions(options) {\n this.selectTemplateType(options.selectedObj, options.e);\n }\n }, {\n key: 'selectTemplateFile',\n value: function selectTemplateFile(selector, query, data) {\n var _this5 = this;\n\n selector.renderLoading();\n // in case undo menu is already already there\n this.destroyUndoMenu();\n this.fetchFileTemplate(selector.config.endpoint, query, data).then(function (file) {\n _this5.showUndoMenu();\n _this5.setEditorContent(file);\n _this5.setFilename(selector.config.name);\n selector.renderLoaded();\n }).catch(function (err) {\n return new __WEBPACK_IMPORTED_MODULE_0__flash__[\"a\" /* default */]('An error occurred while fetching the template: ' + err);\n });\n }\n }, {\n key: 'displayMatchedTemplateSelector',\n value: function displayMatchedTemplateSelector() {\n var _this6 = this;\n\n var currentInput = this.getFilename();\n this.templateSelectors.forEach(function (selector) {\n var match = selector.config.pattern.test(currentInput);\n\n if (match) {\n _this6.typeSelector.show();\n _this6.selectTemplateType(selector.config);\n _this6.showTemplateSelectorMenu();\n }\n });\n }\n }, {\n key: 'fetchFileTemplate',\n value: function fetchFileTemplate(apiCall, query, data) {\n return new Promise(function (resolve) {\n var resolveFile = function resolveFile(file) {\n return resolve(file);\n };\n\n if (!data) {\n apiCall(query, resolveFile);\n } else {\n apiCall(query, data, resolveFile);\n }\n });\n }\n }, {\n key: 'setEditorContent',\n value: function setEditorContent(file) {\n if (!file && file !== '') return;\n\n var newValue = file.content || file;\n\n this.editor.setValue(newValue, 1);\n\n this.editor.focus();\n\n this.editor.navigateFileStart();\n }\n }, {\n key: 'findTemplateSelectorByKey',\n value: function findTemplateSelectorByKey(key) {\n return this.templateSelectors.find(function (selector) {\n return selector.config.key === key;\n });\n }\n }, {\n key: 'showUndoMenu',\n value: function showUndoMenu() {\n var _this7 = this;\n\n this.$undoMenu.removeClass('hidden');\n\n this.$undoBtn.on('click', function () {\n _this7.restoreFromCache();\n _this7.destroyUndoMenu();\n });\n }\n }, {\n key: 'destroyUndoMenu',\n value: function destroyUndoMenu() {\n this.cacheFileContents();\n this.cacheToggleText();\n this.$undoMenu.addClass('hidden');\n this.$undoBtn.off('click');\n }\n }, {\n key: 'hideTemplateSelectorMenu',\n value: function hideTemplateSelectorMenu() {\n this.$templatesMenu.hide();\n }\n }, {\n key: 'showTemplateSelectorMenu',\n value: function showTemplateSelectorMenu() {\n this.$templatesMenu.show();\n }\n }, {\n key: 'cacheToggleText',\n value: function cacheToggleText() {\n this.cachedToggleText = this.getTemplateSelectorToggleText();\n }\n }, {\n key: 'cacheFileContents',\n value: function cacheFileContents() {\n this.cachedContent = this.editor.getValue();\n this.cachedFilename = this.getFilename();\n }\n }, {\n key: 'restoreFromCache',\n value: function restoreFromCache() {\n this.setEditorContent(this.cachedContent);\n this.setFilename(this.cachedFilename);\n this.setTemplateSelectorToggleText();\n }\n }, {\n key: 'getTemplateSelectorToggleText',\n value: function getTemplateSelectorToggleText() {\n return this.$templateSelectors.find('.js-template-selector-wrap:visible .dropdown-toggle-text').text();\n }\n }, {\n key: 'setTemplateSelectorToggleText',\n value: function setTemplateSelectorToggleText() {\n return this.$templateSelectors.find('.js-template-selector-wrap:visible .dropdown-toggle-text').text(this.cachedToggleText);\n }\n }, {\n key: 'getTypeSelectorToggleText',\n value: function getTypeSelectorToggleText() {\n return this.typeSelector.getToggleText();\n }\n }, {\n key: 'getFilename',\n value: function getFilename() {\n return this.$filenameInput.val();\n }\n }, {\n key: 'setFilename',\n value: function setFilename(name) {\n this.$filenameInput.val(name);\n }\n }, {\n key: 'getSelected',\n value: function getSelected() {\n return this.templateSelectors.find(function (selector) {\n return selector.selected;\n });\n }\n }]);\n\n return FileTemplateMediator;\n}();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (FileTemplateMediator);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./blob/file_template_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {var _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 FileTemplateSelector = function () {\n function FileTemplateSelector(mediator) {\n _classCallCheck(this, FileTemplateSelector);\n\n this.mediator = mediator;\n this.$dropdown = null;\n this.$wrapper = null;\n }\n\n _createClass(FileTemplateSelector, [{\n key: 'init',\n value: function init() {\n var cfg = this.config;\n\n this.$dropdown = $(cfg.dropdown);\n this.$wrapper = $(cfg.wrapper);\n this.$loadingIcon = this.$wrapper.find('.fa-chevron-down');\n this.$dropdownToggleText = this.$wrapper.find('.dropdown-toggle-text');\n\n this.initDropdown();\n }\n }, {\n key: 'show',\n value: function show() {\n if (this.$dropdown === null) {\n this.init();\n }\n\n this.$wrapper.removeClass('hidden');\n }\n }, {\n key: 'hide',\n value: function hide() {\n if (this.$dropdown !== null) {\n this.$wrapper.addClass('hidden');\n }\n }\n }, {\n key: 'getToggleText',\n value: function getToggleText() {\n return this.$dropdownToggleText.text();\n }\n }, {\n key: 'setToggleText',\n value: function setToggleText(text) {\n this.$dropdownToggleText.text(text);\n }\n }, {\n key: 'renderLoading',\n value: function renderLoading() {\n this.$loadingIcon.addClass('fa-spinner fa-spin').removeClass('fa-chevron-down');\n }\n }, {\n key: 'renderLoaded',\n value: function renderLoaded() {\n this.$loadingIcon.addClass('fa-chevron-down').removeClass('fa-spinner fa-spin');\n }\n }, {\n key: 'reportSelection',\n value: function reportSelection(options) {\n var query = options.query,\n e = options.e,\n data = options.data;\n\n e.preventDefault();\n return this.mediator.selectTemplateFile(this, query, data);\n }\n }, {\n key: 'reportSelectionName',\n value: function reportSelectionName(options) {\n var opts = options;\n opts.query = options.selectedObj.name;\n\n this.reportSelection(opts);\n }\n }]);\n\n return FileTemplateSelector;\n}();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (FileTemplateSelector);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./blob/template_selectors/ci_yaml_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(\"./api.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__file_template_selector__ = __webpack_require__(\"./blob/file_template_selector.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\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\nvar BlobCiYamlSelector = function (_FileTemplateSelector) {\n _inherits(BlobCiYamlSelector, _FileTemplateSelector);\n\n function BlobCiYamlSelector(_ref) {\n var mediator = _ref.mediator;\n\n _classCallCheck(this, BlobCiYamlSelector);\n\n var _this = _possibleConstructorReturn(this, (BlobCiYamlSelector.__proto__ || Object.getPrototypeOf(BlobCiYamlSelector)).call(this, mediator));\n\n _this.config = {\n key: 'gitlab-ci-yaml',\n name: '.gitlab-ci.yml',\n pattern: /(.gitlab-ci.yml)/,\n endpoint: __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].gitlabCiYml,\n dropdown: '.js-gitlab-ci-yml-selector',\n wrapper: '.js-gitlab-ci-yml-selector-wrap'\n };\n return _this;\n }\n\n _createClass(BlobCiYamlSelector, [{\n key: 'initDropdown',\n value: function initDropdown() {\n var _this2 = this;\n\n // maybe move to super class as well\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: function toggleLabel(item) {\n return item.name;\n },\n search: {\n fields: ['name']\n },\n clicked: function clicked(options) {\n return _this2.reportSelectionName(options);\n },\n text: function text(item) {\n return item.name;\n }\n });\n }\n }]);\n\n return BlobCiYamlSelector;\n}(__WEBPACK_IMPORTED_MODULE_1__file_template_selector__[\"a\" /* default */]);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (BlobCiYamlSelector);\n\n/***/ }),\n\n/***/ \"./blob/template_selectors/dockerfile_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(\"./api.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__file_template_selector__ = __webpack_require__(\"./blob/file_template_selector.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\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\nvar DockerfileSelector = function (_FileTemplateSelector) {\n _inherits(DockerfileSelector, _FileTemplateSelector);\n\n function DockerfileSelector(_ref) {\n var mediator = _ref.mediator;\n\n _classCallCheck(this, DockerfileSelector);\n\n var _this = _possibleConstructorReturn(this, (DockerfileSelector.__proto__ || Object.getPrototypeOf(DockerfileSelector)).call(this, mediator));\n\n _this.config = {\n key: 'dockerfile',\n name: 'Dockerfile',\n pattern: /(Dockerfile)/,\n endpoint: __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].dockerfileYml,\n dropdown: '.js-dockerfile-selector',\n wrapper: '.js-dockerfile-selector-wrap'\n };\n return _this;\n }\n\n _createClass(DockerfileSelector, [{\n key: 'initDropdown',\n value: function initDropdown() {\n var _this2 = this;\n\n // maybe move to super class as well\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: function toggleLabel(item) {\n return item.name;\n },\n search: {\n fields: ['name']\n },\n clicked: function clicked(options) {\n return _this2.reportSelectionName(options);\n },\n text: function text(item) {\n return item.name;\n }\n });\n }\n }]);\n\n return DockerfileSelector;\n}(__WEBPACK_IMPORTED_MODULE_1__file_template_selector__[\"a\" /* default */]);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (DockerfileSelector);\n\n/***/ }),\n\n/***/ \"./blob/template_selectors/gitignore_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(\"./api.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__file_template_selector__ = __webpack_require__(\"./blob/file_template_selector.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\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\nvar BlobGitignoreSelector = function (_FileTemplateSelector) {\n _inherits(BlobGitignoreSelector, _FileTemplateSelector);\n\n function BlobGitignoreSelector(_ref) {\n var mediator = _ref.mediator;\n\n _classCallCheck(this, BlobGitignoreSelector);\n\n var _this = _possibleConstructorReturn(this, (BlobGitignoreSelector.__proto__ || Object.getPrototypeOf(BlobGitignoreSelector)).call(this, mediator));\n\n _this.config = {\n key: 'gitignore',\n name: '.gitignore',\n pattern: /(.gitignore)/,\n endpoint: __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].gitignoreText,\n dropdown: '.js-gitignore-selector',\n wrapper: '.js-gitignore-selector-wrap'\n };\n return _this;\n }\n\n _createClass(BlobGitignoreSelector, [{\n key: 'initDropdown',\n value: function initDropdown() {\n var _this2 = this;\n\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: function toggleLabel(item) {\n return item.name;\n },\n search: {\n fields: ['name']\n },\n clicked: function clicked(options) {\n return _this2.reportSelectionName(options);\n },\n text: function text(item) {\n return item.name;\n }\n });\n }\n }]);\n\n return BlobGitignoreSelector;\n}(__WEBPACK_IMPORTED_MODULE_1__file_template_selector__[\"a\" /* default */]);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (BlobGitignoreSelector);\n\n/***/ }),\n\n/***/ \"./blob/template_selectors/license_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(\"./api.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__file_template_selector__ = __webpack_require__(\"./blob/file_template_selector.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\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\nvar BlobLicenseSelector = function (_FileTemplateSelector) {\n _inherits(BlobLicenseSelector, _FileTemplateSelector);\n\n function BlobLicenseSelector(_ref) {\n var mediator = _ref.mediator;\n\n _classCallCheck(this, BlobLicenseSelector);\n\n var _this = _possibleConstructorReturn(this, (BlobLicenseSelector.__proto__ || Object.getPrototypeOf(BlobLicenseSelector)).call(this, mediator));\n\n _this.config = {\n key: 'license',\n name: 'LICENSE',\n pattern: /^(.+\\/)?(licen[sc]e|copying)($|\\.)/i,\n endpoint: __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].licenseText,\n dropdown: '.js-license-selector',\n wrapper: '.js-license-selector-wrap'\n };\n return _this;\n }\n\n _createClass(BlobLicenseSelector, [{\n key: 'initDropdown',\n value: function initDropdown() {\n var _this2 = this;\n\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: function toggleLabel(item) {\n return item.name;\n },\n search: {\n fields: ['name']\n },\n clicked: function clicked(options) {\n var e = options.e;\n\n var el = options.$el;\n var query = options.selectedObj;\n\n var data = {\n project: _this2.$dropdown.data('project'),\n fullname: _this2.$dropdown.data('fullname')\n };\n\n _this2.reportSelection({\n query: query.id,\n el: el,\n e: e,\n data: data\n });\n },\n text: function text(item) {\n return item.name;\n }\n });\n }\n }]);\n\n return BlobLicenseSelector;\n}(__WEBPACK_IMPORTED_MODULE_1__file_template_selector__[\"a\" /* default */]);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (BlobLicenseSelector);\n\n/***/ }),\n\n/***/ \"./blob/template_selectors/type_selector.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__file_template_selector__ = __webpack_require__(\"./blob/file_template_selector.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\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\nvar FileTemplateTypeSelector = function (_FileTemplateSelector) {\n _inherits(FileTemplateTypeSelector, _FileTemplateSelector);\n\n function FileTemplateTypeSelector(_ref) {\n var mediator = _ref.mediator,\n dropdownData = _ref.dropdownData;\n\n _classCallCheck(this, FileTemplateTypeSelector);\n\n var _this = _possibleConstructorReturn(this, (FileTemplateTypeSelector.__proto__ || Object.getPrototypeOf(FileTemplateTypeSelector)).call(this, mediator));\n\n _this.mediator = mediator;\n _this.config = {\n dropdown: '.js-template-type-selector',\n wrapper: '.js-template-type-selector-wrap',\n dropdownData: dropdownData\n };\n return _this;\n }\n\n _createClass(FileTemplateTypeSelector, [{\n key: 'initDropdown',\n value: function initDropdown() {\n var _this2 = this;\n\n this.$dropdown.glDropdown({\n data: this.config.dropdownData,\n filterable: false,\n selectable: true,\n toggleLabel: function toggleLabel(item) {\n return item.name;\n },\n clicked: function clicked(options) {\n return _this2.mediator.selectTemplateTypeOptions(options);\n },\n text: function text(item) {\n return item.name;\n }\n });\n }\n }]);\n\n return FileTemplateTypeSelector;\n}(__WEBPACK_IMPORTED_MODULE_0__file_template_selector__[\"a\" /* default */]);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (FileTemplateTypeSelector);\n\n/***/ }),\n\n/***/ \"./blob_edit/blob_bundle.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__new_commit_form__ = __webpack_require__(\"./new_commit_form.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__edit_blob__ = __webpack_require__(\"./blob_edit/edit_blob.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__blob_blob_file_dropzone__ = __webpack_require__(\"./blob/blob_file_dropzone.js\");\n/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */\n/* global EditBlob */\n\n\n\n\n$(function () {\n var editBlobForm = $('.js-edit-blob-form');\n var uploadBlobForm = $('.js-upload-blob-form');\n var deleteBlobForm = $('.js-delete-blob-form');\n\n if (editBlobForm.length) {\n var urlRoot = editBlobForm.data('relative-url-root');\n var assetsPath = editBlobForm.data('assets-prefix');\n var blobLanguage = editBlobForm.data('blob-language');\n var currentAction = $('.js-file-title').data('current-action');\n\n new __WEBPACK_IMPORTED_MODULE_1__edit_blob__[\"a\" /* default */]('' + urlRoot + assetsPath, blobLanguage, currentAction);\n new __WEBPACK_IMPORTED_MODULE_0__new_commit_form__[\"a\" /* default */](editBlobForm);\n }\n\n if (uploadBlobForm.length) {\n var method = uploadBlobForm.data('method');\n\n new __WEBPACK_IMPORTED_MODULE_2__blob_blob_file_dropzone__[\"a\" /* default */](uploadBlobForm, method);\n new __WEBPACK_IMPORTED_MODULE_0__new_commit_form__[\"a\" /* default */](uploadBlobForm);\n\n window.gl.utils.disableButtonIfEmptyField(uploadBlobForm.find('.js-commit-message'), '.btn-upload-file');\n }\n\n if (deleteBlobForm.length) {\n new __WEBPACK_IMPORTED_MODULE_0__new_commit_form__[\"a\" /* default */](deleteBlobForm);\n }\n});\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./blob_edit/edit_blob.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__blob_file_template_mediator__ = __webpack_require__(\"./blob/file_template_mediator.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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* global ace */\n\n\n\nvar EditBlob = function () {\n function EditBlob(assetsPath, aceMode, currentAction) {\n _classCallCheck(this, EditBlob);\n\n this.configureAceEditor(aceMode, assetsPath);\n this.initModePanesAndLinks();\n this.initSoftWrap();\n this.initFileSelectors(currentAction);\n }\n\n _createClass(EditBlob, [{\n key: 'configureAceEditor',\n value: function configureAceEditor(aceMode, assetsPath) {\n ace.config.set('modePath', assetsPath + '/ace');\n ace.config.loadModule('ace/ext/searchbox');\n\n this.editor = ace.edit('editor');\n\n // This prevents warnings re: automatic scrolling being logged\n this.editor.$blockScrolling = Infinity;\n\n this.editor.focus();\n\n if (aceMode) {\n this.editor.getSession().setMode('ace/mode/' + aceMode);\n }\n }\n }, {\n key: 'initFileSelectors',\n value: function initFileSelectors(currentAction) {\n this.fileTemplateMediator = new __WEBPACK_IMPORTED_MODULE_0__blob_file_template_mediator__[\"a\" /* default */]({\n currentAction: currentAction,\n editor: this.editor\n });\n }\n }, {\n key: 'initModePanesAndLinks',\n value: function initModePanesAndLinks() {\n var _this = this;\n\n this.$editModePanes = $('.js-edit-mode-pane');\n this.$editModeLinks = $('.js-edit-mode a');\n this.$editModeLinks.on('click', function (e) {\n return _this.editModeLinkClickHandler(e);\n });\n }\n }, {\n key: 'editModeLinkClickHandler',\n value: function editModeLinkClickHandler(e) {\n e.preventDefault();\n\n var currentLink = $(e.target);\n var paneId = currentLink.attr('href');\n var currentPane = this.$editModePanes.filter(paneId);\n\n this.$editModeLinks.parent().removeClass('active hover');\n\n currentLink.parent().addClass('active hover');\n\n this.$editModePanes.hide();\n\n currentPane.fadeIn(200);\n\n if (paneId === '#preview') {\n this.$toggleButton.hide();\n return $.post(currentLink.data('preview-url'), {\n content: this.editor.getValue()\n }, function (response) {\n currentPane.empty().append(response);\n return currentPane.renderGFM();\n });\n }\n\n this.$toggleButton.show();\n\n return this.editor.focus();\n }\n }, {\n key: 'initSoftWrap',\n value: function initSoftWrap() {\n var _this2 = this;\n\n this.isSoftWrapped = false;\n this.$toggleButton = $('.soft-wrap-toggle');\n this.$toggleButton.on('click', function () {\n return _this2.toggleSoftWrap();\n });\n }\n }, {\n key: 'toggleSoftWrap',\n value: function toggleSoftWrap() {\n this.isSoftWrapped = !this.isSoftWrapped;\n this.$toggleButton.toggleClass('soft-wrap-active', this.isSoftWrapped);\n this.editor.getSession().setUseWrapMode(this.isSoftWrapped);\n }\n }]);\n\n return EditBlob;\n}();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (EditBlob);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./lib/utils/constants.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return BYTES_IN_KIB; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return HIDDEN_CLASS; });\n/* eslint-disable import/prefer-default-export */\nvar BYTES_IN_KIB = 1024;\nvar HIDDEN_CLASS = 'hidden';\n\n/***/ })\n\n},[\"./blob_edit/blob_bundle.js\"]);\n\n\n// WEBPACK FOOTER //\n// blob.451528c644c00014c31a.bundle.js","/* eslint-disable func-names, object-shorthand, prefer-arrow-callback */\nimport Dropzone from 'dropzone';\nimport '../lib/utils/url_utility';\nimport { HIDDEN_CLASS } from '../lib/utils/constants';\nimport csrf from '../lib/utils/csrf';\n\nfunction toggleLoading($el, $icon, loading) {\n if (loading) {\n $el.disable();\n $icon.removeClass(HIDDEN_CLASS);\n } else {\n $el.enable();\n $icon.addClass(HIDDEN_CLASS);\n }\n}\nexport default class BlobFileDropzone {\n constructor(form, method) {\n const formDropzone = form.find('.dropzone');\n const submitButton = form.find('#submit-all');\n const submitButtonLoadingIcon = submitButton.find('.js-loading-icon');\n const dropzoneMessage = form.find('.dz-message');\n Dropzone.autoDiscover = false;\n\n const dropzone = formDropzone.dropzone({\n autoDiscover: false,\n autoProcessQueue: false,\n url: form.attr('action'),\n // Rails uses a hidden input field for PUT\n // http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails\n method: method,\n clickable: true,\n uploadMultiple: false,\n paramName: 'file',\n maxFilesize: gon.max_file_size || 10,\n parallelUploads: 1,\n maxFiles: 1,\n addRemoveLinks: true,\n previewsContainer: '.dropzone-previews',\n headers: csrf.headers,\n init: function () {\n this.on('addedfile', function () {\n toggleLoading(submitButton, submitButtonLoadingIcon, false);\n dropzoneMessage.addClass(HIDDEN_CLASS);\n $('.dropzone-alerts').html('').hide();\n });\n this.on('removedfile', function () {\n toggleLoading(submitButton, submitButtonLoadingIcon, false);\n dropzoneMessage.removeClass(HIDDEN_CLASS);\n });\n this.on('success', function (header, response) {\n $('#modal-upload-blob').modal('hide');\n window.gl.utils.visitUrl(response.filePath);\n });\n this.on('maxfilesexceeded', function (file) {\n dropzoneMessage.addClass(HIDDEN_CLASS);\n this.removeFile(file);\n });\n this.on('sending', function (file, xhr, formData) {\n formData.append('branch_name', form.find('.js-branch-name').val());\n formData.append('create_merge_request', form.find('.js-create-merge-request').val());\n formData.append('commit_message', form.find('.js-commit-message').val());\n });\n },\n // Override behavior of adding error underneath preview\n error: function (file, errorMessage) {\n const stripped = $('
').html(errorMessage).text();\n $('.dropzone-alerts').html(`Error uploading file: \"${stripped}\"`).show();\n this.removeFile(file);\n },\n });\n\n submitButton.on('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (dropzone[0].dropzone.getQueuedFiles().length === 0) {\n // eslint-disable-next-line no-alert\n alert('Please select a file');\n return false;\n }\n toggleLoading(submitButton, submitButtonLoadingIcon, true);\n dropzone[0].dropzone.processQueue();\n return false;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/blob_file_dropzone.js","/* eslint-disable class-methods-use-this */\nimport Flash from '../flash';\nimport FileTemplateTypeSelector from './template_selectors/type_selector';\nimport BlobCiYamlSelector from './template_selectors/ci_yaml_selector';\nimport DockerfileSelector from './template_selectors/dockerfile_selector';\nimport GitignoreSelector from './template_selectors/gitignore_selector';\nimport LicenseSelector from './template_selectors/license_selector';\n\nexport default class FileTemplateMediator {\n constructor({ editor, currentAction }) {\n this.editor = editor;\n this.currentAction = currentAction;\n\n this.initTemplateSelectors();\n this.initTemplateTypeSelector();\n this.initDomElements();\n this.initDropdowns();\n this.initPageEvents();\n }\n\n initTemplateSelectors() {\n // Order dictates template type dropdown item order\n this.templateSelectors = [\n GitignoreSelector,\n BlobCiYamlSelector,\n DockerfileSelector,\n LicenseSelector,\n ].map(TemplateSelectorClass => new TemplateSelectorClass({ mediator: this }));\n }\n\n initTemplateTypeSelector() {\n this.typeSelector = new FileTemplateTypeSelector({\n mediator: this,\n dropdownData: this.templateSelectors\n .map((templateSelector) => {\n const cfg = templateSelector.config;\n\n return {\n name: cfg.name,\n key: cfg.key,\n };\n }),\n });\n }\n\n initDomElements() {\n const $templatesMenu = $('.template-selectors-menu');\n const $undoMenu = $templatesMenu.find('.template-selectors-undo-menu');\n const $fileEditor = $('.file-editor');\n\n this.$templatesMenu = $templatesMenu;\n this.$undoMenu = $undoMenu;\n this.$undoBtn = $undoMenu.find('button');\n this.$templateSelectors = $templatesMenu.find('.template-selector-dropdowns-wrap');\n this.$filenameInput = $fileEditor.find('.js-file-path-name-input');\n this.$fileContent = $fileEditor.find('#file-content');\n this.$commitForm = $fileEditor.find('form');\n this.$navLinks = $fileEditor.find('.nav-links');\n }\n\n initDropdowns() {\n if (this.currentAction === 'create') {\n this.typeSelector.show();\n } else {\n this.hideTemplateSelectorMenu();\n }\n\n this.displayMatchedTemplateSelector();\n }\n\n initPageEvents() {\n this.listenForFilenameInput();\n this.prepFileContentForSubmit();\n this.listenForPreviewMode();\n }\n\n listenForFilenameInput() {\n this.$filenameInput.on('keyup blur', () => {\n this.displayMatchedTemplateSelector();\n });\n }\n\n prepFileContentForSubmit() {\n this.$commitForm.submit(() => {\n this.$fileContent.val(this.editor.getValue());\n });\n }\n\n listenForPreviewMode() {\n this.$navLinks.on('click', 'a', (e) => {\n const urlPieces = e.target.href.split('#');\n const hash = urlPieces[1];\n if (hash === 'preview') {\n this.hideTemplateSelectorMenu();\n } else if (hash === 'editor') {\n this.showTemplateSelectorMenu();\n }\n });\n }\n\n selectTemplateType(item, e) {\n if (e) {\n e.preventDefault();\n }\n\n this.templateSelectors.forEach((selector) => {\n if (selector.config.key === item.key) {\n selector.show();\n } else {\n selector.hide();\n }\n });\n\n this.typeSelector.setToggleText(item.name);\n\n this.cacheToggleText();\n }\n\n selectTemplateTypeOptions(options) {\n this.selectTemplateType(options.selectedObj, options.e);\n }\n\n selectTemplateFile(selector, query, data) {\n selector.renderLoading();\n // in case undo menu is already already there\n this.destroyUndoMenu();\n this.fetchFileTemplate(selector.config.endpoint, query, data)\n .then((file) => {\n this.showUndoMenu();\n this.setEditorContent(file);\n this.setFilename(selector.config.name);\n selector.renderLoaded();\n })\n .catch(err => new Flash(`An error occurred while fetching the template: ${err}`));\n }\n\n displayMatchedTemplateSelector() {\n const currentInput = this.getFilename();\n this.templateSelectors.forEach((selector) => {\n const match = selector.config.pattern.test(currentInput);\n\n if (match) {\n this.typeSelector.show();\n this.selectTemplateType(selector.config);\n this.showTemplateSelectorMenu();\n }\n });\n }\n\n fetchFileTemplate(apiCall, query, data) {\n return new Promise((resolve) => {\n const resolveFile = file => resolve(file);\n\n if (!data) {\n apiCall(query, resolveFile);\n } else {\n apiCall(query, data, resolveFile);\n }\n });\n }\n\n setEditorContent(file) {\n if (!file && file !== '') return;\n\n const newValue = file.content || file;\n\n this.editor.setValue(newValue, 1);\n\n this.editor.focus();\n\n this.editor.navigateFileStart();\n }\n\n findTemplateSelectorByKey(key) {\n return this.templateSelectors.find(selector => selector.config.key === key);\n }\n\n showUndoMenu() {\n this.$undoMenu.removeClass('hidden');\n\n this.$undoBtn.on('click', () => {\n this.restoreFromCache();\n this.destroyUndoMenu();\n });\n }\n\n destroyUndoMenu() {\n this.cacheFileContents();\n this.cacheToggleText();\n this.$undoMenu.addClass('hidden');\n this.$undoBtn.off('click');\n }\n\n hideTemplateSelectorMenu() {\n this.$templatesMenu.hide();\n }\n\n showTemplateSelectorMenu() {\n this.$templatesMenu.show();\n }\n\n cacheToggleText() {\n this.cachedToggleText = this.getTemplateSelectorToggleText();\n }\n\n cacheFileContents() {\n this.cachedContent = this.editor.getValue();\n this.cachedFilename = this.getFilename();\n }\n\n restoreFromCache() {\n this.setEditorContent(this.cachedContent);\n this.setFilename(this.cachedFilename);\n this.setTemplateSelectorToggleText();\n }\n\n getTemplateSelectorToggleText() {\n return this.$templateSelectors\n .find('.js-template-selector-wrap:visible .dropdown-toggle-text')\n .text();\n }\n\n setTemplateSelectorToggleText() {\n return this.$templateSelectors\n .find('.js-template-selector-wrap:visible .dropdown-toggle-text')\n .text(this.cachedToggleText);\n }\n\n getTypeSelectorToggleText() {\n return this.typeSelector.getToggleText();\n }\n\n getFilename() {\n return this.$filenameInput.val();\n }\n\n setFilename(name) {\n this.$filenameInput.val(name);\n }\n\n getSelected() {\n return this.templateSelectors.find(selector => selector.selected);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/file_template_mediator.js","export default class FileTemplateSelector {\n constructor(mediator) {\n this.mediator = mediator;\n this.$dropdown = null;\n this.$wrapper = null;\n }\n\n init() {\n const cfg = this.config;\n\n this.$dropdown = $(cfg.dropdown);\n this.$wrapper = $(cfg.wrapper);\n this.$loadingIcon = this.$wrapper.find('.fa-chevron-down');\n this.$dropdownToggleText = this.$wrapper.find('.dropdown-toggle-text');\n\n this.initDropdown();\n }\n\n show() {\n if (this.$dropdown === null) {\n this.init();\n }\n\n this.$wrapper.removeClass('hidden');\n }\n\n hide() {\n if (this.$dropdown !== null) {\n this.$wrapper.addClass('hidden');\n }\n }\n\n getToggleText() {\n return this.$dropdownToggleText.text();\n }\n\n setToggleText(text) {\n this.$dropdownToggleText.text(text);\n }\n\n renderLoading() {\n this.$loadingIcon\n .addClass('fa-spinner fa-spin')\n .removeClass('fa-chevron-down');\n }\n\n renderLoaded() {\n this.$loadingIcon\n .addClass('fa-chevron-down')\n .removeClass('fa-spinner fa-spin');\n }\n\n reportSelection(options) {\n const { query, e, data } = options;\n e.preventDefault();\n return this.mediator.selectTemplateFile(this, query, data);\n }\n\n reportSelectionName(options) {\n const opts = options;\n opts.query = options.selectedObj.name;\n\n this.reportSelection(opts);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/file_template_selector.js","import Api from '../../api';\n\nimport FileTemplateSelector from '../file_template_selector';\n\nexport default class BlobCiYamlSelector extends FileTemplateSelector {\n constructor({ mediator }) {\n super(mediator);\n this.config = {\n key: 'gitlab-ci-yaml',\n name: '.gitlab-ci.yml',\n pattern: /(.gitlab-ci.yml)/,\n endpoint: Api.gitlabCiYml,\n dropdown: '.js-gitlab-ci-yml-selector',\n wrapper: '.js-gitlab-ci-yml-selector-wrap',\n };\n }\n\n initDropdown() {\n // maybe move to super class as well\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: item => item.name,\n search: {\n fields: ['name'],\n },\n clicked: options => this.reportSelectionName(options),\n text: item => item.name,\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/template_selectors/ci_yaml_selector.js","import Api from '../../api';\n\nimport FileTemplateSelector from '../file_template_selector';\n\nexport default class DockerfileSelector extends FileTemplateSelector {\n constructor({ mediator }) {\n super(mediator);\n this.config = {\n key: 'dockerfile',\n name: 'Dockerfile',\n pattern: /(Dockerfile)/,\n endpoint: Api.dockerfileYml,\n dropdown: '.js-dockerfile-selector',\n wrapper: '.js-dockerfile-selector-wrap',\n };\n }\n\n initDropdown() {\n // maybe move to super class as well\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: item => item.name,\n search: {\n fields: ['name'],\n },\n clicked: options => this.reportSelectionName(options),\n text: item => item.name,\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/template_selectors/dockerfile_selector.js","import Api from '../../api';\n\nimport FileTemplateSelector from '../file_template_selector';\n\nexport default class BlobGitignoreSelector extends FileTemplateSelector {\n constructor({ mediator }) {\n super(mediator);\n this.config = {\n key: 'gitignore',\n name: '.gitignore',\n pattern: /(.gitignore)/,\n endpoint: Api.gitignoreText,\n dropdown: '.js-gitignore-selector',\n wrapper: '.js-gitignore-selector-wrap',\n };\n }\n\n initDropdown() {\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: item => item.name,\n search: {\n fields: ['name'],\n },\n clicked: options => this.reportSelectionName(options),\n text: item => item.name,\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/template_selectors/gitignore_selector.js","import Api from '../../api';\n\nimport FileTemplateSelector from '../file_template_selector';\n\nexport default class BlobLicenseSelector extends FileTemplateSelector {\n constructor({ mediator }) {\n super(mediator);\n this.config = {\n key: 'license',\n name: 'LICENSE',\n pattern: /^(.+\\/)?(licen[sc]e|copying)($|\\.)/i,\n endpoint: Api.licenseText,\n dropdown: '.js-license-selector',\n wrapper: '.js-license-selector-wrap',\n };\n }\n\n initDropdown() {\n this.$dropdown.glDropdown({\n data: this.$dropdown.data('data'),\n filterable: true,\n selectable: true,\n toggleLabel: item => item.name,\n search: {\n fields: ['name'],\n },\n clicked: (options) => {\n const { e } = options;\n const el = options.$el;\n const query = options.selectedObj;\n\n const data = {\n project: this.$dropdown.data('project'),\n fullname: this.$dropdown.data('fullname'),\n };\n\n this.reportSelection({\n query: query.id,\n el,\n e,\n data,\n });\n },\n text: item => item.name,\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/template_selectors/license_selector.js","import FileTemplateSelector from '../file_template_selector';\n\nexport default class FileTemplateTypeSelector extends FileTemplateSelector {\n constructor({ mediator, dropdownData }) {\n super(mediator);\n this.mediator = mediator;\n this.config = {\n dropdown: '.js-template-type-selector',\n wrapper: '.js-template-type-selector-wrap',\n dropdownData,\n };\n }\n\n initDropdown() {\n this.$dropdown.glDropdown({\n data: this.config.dropdownData,\n filterable: false,\n selectable: true,\n toggleLabel: item => item.name,\n clicked: options => this.mediator.selectTemplateTypeOptions(options),\n text: item => item.name,\n });\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob/template_selectors/type_selector.js","/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */\n/* global EditBlob */\nimport NewCommitForm from '../new_commit_form';\nimport EditBlob from './edit_blob';\nimport BlobFileDropzone from '../blob/blob_file_dropzone';\n\n$(() => {\n const editBlobForm = $('.js-edit-blob-form');\n const uploadBlobForm = $('.js-upload-blob-form');\n const deleteBlobForm = $('.js-delete-blob-form');\n\n if (editBlobForm.length) {\n const urlRoot = editBlobForm.data('relative-url-root');\n const assetsPath = editBlobForm.data('assets-prefix');\n const blobLanguage = editBlobForm.data('blob-language');\n const currentAction = $('.js-file-title').data('current-action');\n\n new EditBlob(`${urlRoot}${assetsPath}`, blobLanguage, currentAction);\n new NewCommitForm(editBlobForm);\n }\n\n if (uploadBlobForm.length) {\n const method = uploadBlobForm.data('method');\n\n new BlobFileDropzone(uploadBlobForm, method);\n new NewCommitForm(uploadBlobForm);\n\n window.gl.utils.disableButtonIfEmptyField(\n uploadBlobForm.find('.js-commit-message'),\n '.btn-upload-file',\n );\n }\n\n if (deleteBlobForm.length) {\n new NewCommitForm(deleteBlobForm);\n }\n});\n\n\n\n// WEBPACK FOOTER //\n// ./blob_edit/blob_bundle.js","/* global ace */\n\nimport TemplateSelectorMediator from '../blob/file_template_mediator';\n\nexport default class EditBlob {\n constructor(assetsPath, aceMode, currentAction) {\n this.configureAceEditor(aceMode, assetsPath);\n this.initModePanesAndLinks();\n this.initSoftWrap();\n this.initFileSelectors(currentAction);\n }\n\n configureAceEditor(aceMode, assetsPath) {\n ace.config.set('modePath', `${assetsPath}/ace`);\n ace.config.loadModule('ace/ext/searchbox');\n\n this.editor = ace.edit('editor');\n\n // This prevents warnings re: automatic scrolling being logged\n this.editor.$blockScrolling = Infinity;\n\n this.editor.focus();\n\n if (aceMode) {\n this.editor.getSession().setMode(`ace/mode/${aceMode}`);\n }\n }\n\n initFileSelectors(currentAction) {\n this.fileTemplateMediator = new TemplateSelectorMediator({\n currentAction,\n editor: this.editor,\n });\n }\n\n initModePanesAndLinks() {\n this.$editModePanes = $('.js-edit-mode-pane');\n this.$editModeLinks = $('.js-edit-mode a');\n this.$editModeLinks.on('click', e => this.editModeLinkClickHandler(e));\n }\n\n editModeLinkClickHandler(e) {\n e.preventDefault();\n\n const currentLink = $(e.target);\n const paneId = currentLink.attr('href');\n const currentPane = this.$editModePanes.filter(paneId);\n\n this.$editModeLinks.parent().removeClass('active hover');\n\n currentLink.parent().addClass('active hover');\n\n this.$editModePanes.hide();\n\n currentPane.fadeIn(200);\n\n if (paneId === '#preview') {\n this.$toggleButton.hide();\n return $.post(currentLink.data('preview-url'), {\n content: this.editor.getValue(),\n }, (response) => {\n currentPane.empty().append(response);\n return currentPane.renderGFM();\n });\n }\n\n this.$toggleButton.show();\n\n return this.editor.focus();\n }\n\n initSoftWrap() {\n this.isSoftWrapped = false;\n this.$toggleButton = $('.soft-wrap-toggle');\n this.$toggleButton.on('click', () => this.toggleSoftWrap());\n }\n\n toggleSoftWrap() {\n this.isSoftWrapped = !this.isSoftWrapped;\n this.$toggleButton.toggleClass('soft-wrap-active', this.isSoftWrapped);\n this.editor.getSession().setUseWrapMode(this.isSoftWrapped);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./blob_edit/edit_blob.js","/* eslint-disable import/prefer-default-export */\nexport const BYTES_IN_KIB = 1024;\nexport const HIDDEN_CLASS = 'hidden';\n\n\n\n// WEBPACK FOOTER //\n// ./lib/utils/constants.js"],"sourceRoot":""}