{"version":3,"file":"redmine-integration.js","names":["define","_exports","_ajax","_ajaxError","_bootbox","Object","defineProperty","value","default","_default","loading","setupComponent","args","component","set","model","redmine_urls","join","postInput","this","siteSettings","redmine_paid_support_url_enabled","actions","updateRedmineUrls","$","prop","ajax","type","dataType","data","topic_id","id","redmineUrlsInput","redmine_post","redminePostInput","skip_auto_post","skipAutoPost","then","result","empty","each","k","v","append","catch","err","jqXHR","status","responseJSON","error","popupAjaxError","finally","clearRedmineUrls","confirm","I18n","t","confirmed","_templateFactory","createTemplateFactory","block","moduleName","isStrictMode"],"sources":["discourse/plugins/redmine-integration/discourse/connectors/topic-above-suggested/redmine-connector.js","discourse/plugins/redmine-integration/discourse/templates/connectors/topic-above-suggested/redmine-connector.js"],"sourcesContent":["define(\"discourse/plugins/redmine-integration/discourse/connectors/topic-above-suggested/redmine-connector\", [\"exports\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"bootbox\"], function (_exports, _ajax, _ajaxError, _bootbox) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true\n });\n _exports.default = void 0;\n 0; //eaimeta@70e063a35619d71f0,\"discourse/lib/ajax\",0,\"discourse/lib/ajax-error\",0,\"bootbox\"eaimeta@70e063a35619d71f\n var _default = {\n loading: false,\n setupComponent(args, component) {\n component.set(\"skipAutoPost\", false);\n component.set(\"redmineUrlsInput\", args.model.redmine_urls.join(','));\n var postInput = \"@{username}\\nWe have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in {policies_url}.\\n\\n Issue ID(s): {redmine_ids}\\n\\n\";\n if (this.siteSettings.redmine_paid_support_url_enabled) {\n postInput += \"You can obtain {paid_support_url} if you need support on a priority basis, along with the direct access to our Paid Support management team.\";\n }\n component.set(\"redminePostInput\", postInput);\n },\n actions: {\n updateRedmineUrls() {\n $(\"#redmine-update-urls-btn\").prop('disabled', true);\n this.set(\"loading\", true);\n (0, _ajax.ajax)(\"/redmine/link_tickets\", {\n type: \"POST\",\n dataType: \"json\",\n data: {\n topic_id: this.model.id,\n redmine_urls: this.redmineUrlsInput,\n redmine_post: this.redminePostInput,\n skip_auto_post: this.skipAutoPost\n }\n }).then(result => {\n $('#redmine-issues-info-div').empty();\n $.each(result, function (k, v) {\n $('#redmine-issues-info-div').append(\"\" + k + \" ---- Status : \" + v + \"
\");\n });\n }).catch(err => {\n if (err.jqXHR && err.jqXHR.status === 422 && err.jqXHR.responseJSON) {\n $('#redmine-issues-info-div').empty();\n $('#redmine-issues-info-div').append(\"<span style='color:#f00'> \" + data.responseJSON.error + \" </span>\");\n } else {\n (0, _ajaxError.popupAjaxError)(err);\n }\n }).finally(() => {\n this.set(\"loading\", false);\n $(\"#redmine-update-urls-btn\").prop('disabled', false);\n });\n },\n clearRedmineUrls() {\n _bootbox.default.confirm(\"You are about to un-link all redmine issues for this topic. Are you sure you want to continue?\", I18n.t(\"no_value\"), I18n.t(\"yes_value\"), confirmed => {\n if (confirmed) {\n $(\"#redmine-clear-btn\").prop('disabled', true);\n this.set(\"loading\", true);\n (0, _ajax.ajax)(\"/redmine/clear_tickets\", {\n type: 'DELETE',\n data: {\n topic_id: this.model.id\n }\n }).then(result => {\n $('#redmine-issues-info-div').empty();\n this.set(\"redmineUrlsInput\", null);\n }).catch(err => {\n if (err.jqXHR && err.jqXHR.status === 422 && err.jqXHR.responseJSON) {\n $('#redmine-issues-info-div').empty();\n $('#redmine-issues-info-div').append(\"<span style='color:#f00'> \" + data.responseJSON.error + \" </span>\");\n } else {\n (0, _ajaxError.popupAjaxError)(err);\n }\n }).finally(() => {\n $(\"#redmine-clear-btn\").prop('disabled', false);\n this.set(\"loading\", false);\n });\n }\n });\n }\n }\n };\n _exports.default = _default;\n});","define(\"discourse/plugins/redmine-integration/discourse/templates/connectors/topic-above-suggested/redmine-connector\", [\"exports\", \"@ember/template-factory\"], function (_exports, _templateFactory) {\n \"use strict\";\n\n Object.defineProperty(_exports, \"__esModule\", {\n value: true\n });\n _exports.default = void 0;\n 0; //eaimeta@70e063a35619d71f0,\"ember-cli-htmlbars\"eaimeta@70e063a35619d71f\n var _default = (0, _templateFactory.createTemplateFactory)(\n /*\n {{#if siteSettings.redmine_enabled}}\n {{#if currentUser.moderator}}\n