{"version":3,"names":["window","require","registerSettings","New_topic_button_icon","New_topic_button_text","New_topic_button_title","Hide_default_button","define","_exports","_pluginApi","Object","defineProperty","value","default","settings","getObjectForTheme","name","after","initialize","withPluginApi","api","iconNode","decorateWidget","helper","getCurrentUser","container","ntb_text","ntb_title","length","ntb_icon","composerModal","composerController","lookup","h","className","title","onclick","category","get","topicCategory","categoryd","open","action","CREATE_TOPIC","categoryId","draftKey","DRAFT"],"sourceRoot":"theme-26/","sources":["settings.js","discourse/initializers/theme-field-104-common-html-script-1.js"],"sourcesContent":["(function() {\n  if ('require' in window) {\n    require(\"discourse/lib/theme-settings-store\").registerSettings(26, {\"New_topic_button_icon\":\"plus\",\"New_topic_button_text\":\"New Topic\",\"New_topic_button_title\":\"\",\"Hide_default_button\":true});\n  }\n})();\n","if ('define' in window) {\ndefine(\"discourse/theme-26/discourse/initializers/theme-field-104-common-html-script-1\", [\"exports\", \"discourse/lib/plugin-api\"], function (_exports, _pluginApi) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const settings = require(\"discourse/lib/theme-settings-store\").getObjectForTheme(26);\n  const themePrefix = key => `theme_translations.26.${key}`;\n  var _default = _exports.default = {\n    name: \"theme-field-104-common-html-script-1\",\n    after: \"inject-objects\",\n    initialize() {\n      (0, _pluginApi.withPluginApi)(\"0.8\", api => {\n        const {\n          iconNode\n        } = require(\"discourse-common/lib/icon-library\");\n        api.decorateWidget(\"header-buttons:after\", helper => {\n          if (!api.getCurrentUser()) return;\n          let container = api.container,\n            ntb_text = settings.New_topic_button_text,\n            ntb_title = settings.New_topic_button_title.length ? settings.New_topic_button_title : ntb_text,\n            ntb_icon = settings.New_topic_button_icon,\n            ntb_button_class = \"btn btn-default btn btn-icon-text\",\n            ntb_button_helper = \"button#new-create-topic\",\n            ntb_label_helper = \"span.d-button-label\",\n            composerModal = require(\"discourse/models/composer\").default,\n            composerController = container.lookup(\"controller:composer\");\n          const createTopic = function () {\n            const controller = container.lookup(\"controller:navigation/category\"),\n              category = controller.get(\"category.id\"),\n              topicCategory = container.lookup(\"route:topic\").get(\"context.category.id\"),\n              categoryd = topicCategory ? topicCategory : category;\n            composerController.open({\n              action: composerModal.CREATE_TOPIC,\n              categoryId: categoryd,\n              draftKey: composerModal.DRAFT\n            });\n          };\n          return helper.h(ntb_button_helper, {\n            className: ntb_button_class,\n            title: ntb_title,\n            onclick: createTopic\n          }, [iconNode(ntb_icon), helper.h(ntb_label_helper, ntb_text)]);\n        });\n      });\n    }\n  };\n});\n}\n"],"mappings":"AACM,YAAaA,QACfC,QAAQ,sCAAsCC,iBAAiB,GAAI,CAACC,sBAAwB,OAAOC,sBAAwB,YAAYC,uBAAyB,GAAGC,qBAAsB,ICFzL,WAAYN,QAChBO,OAAO,iFAAkF,CAAC,UAAW,6BAA6B,SAAUC,EAAUC,GACpJ;AAEAC,OAAOC,eAAeH,EAAU,aAAc,CAC5CI,OAAO,IAETJ,EAASK,aAAU;AACnB,MAAMC,EAAWb,QAAQ,sCAAsCc,kBAAkB;AAElEP,EAASK,QAAU,CAChCG,KAAM,uCACNC,MAAO,iBACP,UAAAC,IACE,EAAIT,EAAWU,eAAe,OAAOC,IACnC,MAAMC,SACJA,GACEpB,QAAQ;AACZmB,EAAIE,eAAe,wBAAwBC,IACzC,IAAKH,EAAII,iBAAkB;AAC3B,IAAIC,EAAYL,EAAIK,UAClBC,EAAWZ,EAASV,sBACpBuB,EAAYb,EAAST,uBAAuBuB,OAASd,EAAST,uBAAyBqB,EACvFG,EAAWf,EAASX,sBAIpB2B,EAAgB7B,QAAQ,6BAA6BY,QACrDkB,EAAqBN,EAAUO,OAAO;AAYxC,OAAOT,EAAOU,EAfQ,0BAea,CACjCC,UAjBmB,oCAkBnBC,MAAOR,EACPS,QAdkB,WAClB,MACEC,EADiBZ,EAAUO,OAAO,kCACZM,IAAI,eAC1BC,EAAgBd,EAAUO,OAAO,eAAeM,IAAI,uBACpDE,EAAYD,GAAgCF;AAC9CN,EAAmBU,KAAK,CACtBC,OAAQZ,EAAca,aACtBC,WAAYJ,EACZK,SAAUf,EAAcgB,OAE5B,GAKG,CAACzB,EAASQ,GAAWN,EAAOU,EAlBV,sBAkB8BP,IAAW,GAC9D,GAEN,EAEJ"}