{"version":3,"file":"swapd-interested.js","names":["define","_exports","_pluginApi","_ajax","_I18n","_ajaxError","Object","defineProperty","value","default","name","initialize","container","lookup","swapd_interested_enabled","withPluginApi","api","registerTopicFooterButton","id","icon","priority","title","this","get","label","action","ajax","topic","type","then","result","set","alert","t","catch","popupAjaxError","dropdown","classNames","dependentKeys","displayed","disabled","registerTopicFooterButtons","addPostSmallActionIcon","_templateFactory","createTemplateFactory","block","moduleName","isStrictMode"],"sources":["discourse/plugins/swapd-interested/discourse/initializers/extend-for-interested.js","discourse/plugins/swapd-interested/discourse/templates/connectors/category-custom-settings/interested-settings.js"],"sourcesContent":["define(\"discourse/plugins/swapd-interested/discourse/initializers/extend-for-interested\", [\"exports\", \"discourse/lib/plugin-api\", \"discourse/lib/ajax\", \"I18n\", \"discourse/lib/ajax-error\"], function (_exports, _pluginApi, _ajax, _I18n, _ajaxError) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  function registerTopicFooterButtons(api, container) {\n    api.registerTopicFooterButton({\n      id: \"swapd-interested\",\n      icon: \"comment-medical\",\n      priority: 250,\n      title() {\n        return this.get(\"topic.interested_button_enabled\") ? \"swapd_interested.button.title\" : \"swapd_interested.button.title_disabled\";\n      },\n      label: \"swapd_interested.button.label\",\n      action() {\n        return (0, _ajax.ajax)(`/t/${this.topic.id}/interested`, {\n          type: \"POST\"\n        }).then(result => {\n          this.set(\"topic.interested_button_enabled\", false);\n          const dialog = container.lookup(\"service:dialog\");\n          dialog.alert(_I18n.default.t(\"swapd_interested.confirmation\"));\n        }).catch(_ajaxError.popupAjaxError);\n      },\n      dropdown() {\n        return false;\n      },\n      classNames: [\"swapd-interested\"],\n      dependentKeys: [\"topic.interested_button_present\", \"topic.interested_button_enabled\"],\n      displayed() {\n        return this.get(\"topic.interested_button_present\");\n      },\n      disabled() {\n        return !this.get(\"topic.interested_button_enabled\");\n      }\n    });\n  }\n  var _default = _exports.default = {\n    name: \"extend-for-interested\",\n    initialize(container) {\n      const siteSettings = container.lookup(\"site-settings:main\");\n      if (!siteSettings.swapd_interested_enabled) {\n        return;\n      }\n      (0, _pluginApi.withPluginApi)(\"0.8.28\", api => registerTopicFooterButtons(api, container));\n      (0, _pluginApi.withPluginApi)(\"0.8.28\", api => api.addPostSmallActionIcon(\"interested\", \"comment-medical\"));\n    }\n  };\n});","define(\"discourse/plugins/swapd-interested/discourse/templates/connectors/category-custom-settings/interested-settings\", [\"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  var _default = _exports.default = (0, _templateFactory.createTemplateFactory)(\n  /*\n    {{#if this.siteSettings.swapd_interested_enabled}}\n    <h3>{{i18n \"swapd_interested.title\"}}</h3>\n    <section class=\"field\">\n      <div class=\"allow-interested\">\n        <label class=\"checkbox-label\">\n          {{input\n            type=\"checkbox\"\n            checked=this.category.custom_fields.allow_interested\n          }}\n          {{i18n \"swapd_interested.allow_interested\"}}\n        </label>\n      </div>\n    </section>\n  {{/if}}\n  */\n  {\n    \"id\": \"K3I94Vz+\",\n    \"block\": \"[[[41,[30,0,[\\\"siteSettings\\\",\\\"swapd_interested_enabled\\\"]],[[[1,\\\"  \\\"],[10,\\\"h3\\\"],[12],[1,[28,[35,2],[\\\"swapd_interested.title\\\"],null]],[13],[1,\\\"\\\\n  \\\"],[10,\\\"section\\\"],[14,0,\\\"field\\\"],[12],[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"allow-interested\\\"],[12],[1,\\\"\\\\n      \\\"],[10,\\\"label\\\"],[14,0,\\\"checkbox-label\\\"],[12],[1,\\\"\\\\n        \\\"],[1,[28,[35,6],null,[[\\\"type\\\",\\\"checked\\\"],[\\\"checkbox\\\",[30,0,[\\\"category\\\",\\\"custom_fields\\\",\\\"allow_interested\\\"]]]]]],[1,\\\"\\\\n        \\\"],[1,[28,[35,2],[\\\"swapd_interested.allow_interested\\\"],null]],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[],false,[\\\"if\\\",\\\"h3\\\",\\\"i18n\\\",\\\"section\\\",\\\"div\\\",\\\"label\\\",\\\"input\\\"]]\",\n    \"moduleName\": \"discourse/plugins/swapd-interested/discourse/templates/connectors/category-custom-settings/interested-settings.hbs\",\n    \"isStrictMode\": false\n  });\n});"],"mappings":"AAAAA,OAAA,yLAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAAN,EAAA,cACAO,OAAA,IAEAP,EAAAQ,aAAA;AAgCAR,EAAAQ,QAAA,CACAC,KAAA,wBACA,UAAAC,CAAAC,GACAA,EAAAC,OAAA,sBACAC,4BAGA,EAAAZ,EAAAa,eAAA,SAAAC,GAtCA,SAAAA,EAAAJ,GACAI,EAAAC,0BAAA,CACAC,GAAA,mBACAC,KAAA,kBACAC,SAAA,IACA,KAAAC,GACA,OAAAC,KAAAC,IAAA,2GACA,EACAC,MAAA,gCACA,MAAAC,GACA,SAAAtB,EAAAuB,MAAA,MAAAJ,KAAAK,MAAAT,gBAAA,CACAU,KAAA,SACAC,KAAAC,IACAR,KAAAS,IAAA,sCACAnB,EAAAC,OAAA,kBACAmB,MAAA5B,EAAAK,QAAAwB,EAAA,oCACAC,MAAA7B,EAAA8B,eACA,EACAC,SAAA,KACA,EAEAC,WAAA,qBACAC,cAAA,sEACA,SAAAC,GACA,OAAAjB,KAAAC,IAAA,kCACA,EACA,QAAAiB,GACA,OAAAlB,KAAAC,IAAA,kCACA,GAEA,CAQAkB,CAAAzB,EAAAJ,KACA,EAAAV,EAAAa,eAAA,SAAAC,KAAA0B,uBAAA,iCACA,E,GC/CA1C,OAAA,gKAAAC,EAAA0C,GACA;AAEArC,OAAAC,eAAAN,EAAA,cACAO,OAAA,IAEAP,EAAAQ,aAAA;AACAR,EAAAQ,SAAA,EAAAkC,EAAAC,uBAiBA,CACA1B,GAAA,WACA2B,MAAA,goBACAC,WAAA,qHACAC,cAAA,G","ignoreList":[]}