diff --git a/js/dist/admin.js b/js/dist/admin.js
index 8515bd1..16726e4 100644
--- a/js/dist/admin.js
+++ b/js/dist/admin.js
@@ -1,2 +1,2 @@
-(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["admin/app"];var r=t.n(e);const i=flarum.core.compat["common/app"];var n=t.n(i);const a=flarum.core.compat["common/extend"],c=flarum.core.compat["common/components/TextEditor"];var l=t.n(c);const s=flarum.core.compat["common/utils/BasicEditorDriver"];var d=t.n(s);const u=flarum.core.compat["common/utils/styleSelectedText"];var f=t.n(u);function p(t,o){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},p(t,o)}function h(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,p(t,o)}const k=flarum.core.compat["common/Component"];var y=t.n(k),b=function(t){function o(){return t.apply(this,arguments)||this}return h(o,t),o.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},o}(y());const x=flarum.core.compat["common/helpers/icon"];var v=t.n(x);const g=flarum.core.compat["common/components/Tooltip"];var _=t.n(g),w=function(t){function o(){return t.apply(this,arguments)||this}h(o,t);var e=o.prototype;return e.oncreate=function(o){t.prototype.oncreate.call(this,o)},e.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},v()(this.attrs.icon));return this.attrs.title?m(_(),{text:this.attrs.title},t):t},e.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},o}(y());const O=flarum.core.compat["common/utils/ItemList"];var T=t.n(O),P=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",S={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},j=function(t,o){f()(o.el,S[t])};function I(t,o,e){return function(r){r.key===o&&(r.metaKey&&"⌘"===P||r.ctrlKey&&"ctrl"===P)&&(r.preventDefault(),j(t,e))}}function F(t){var o=this,e="function"==typeof t?t():new(T());function r(t,o){return n().translator.trans("flarum-markdown.lib.composer."+t+"_tooltip")+(o?" <"+P+"-"+o+">":"")}var i=function(t){return function(){return j(t,o.attrs.composer.editor)}};return e.add("header",m(w,{title:r("header"),icon:"fas fa-heading",onclick:i("header")}),1e3),e.add("bold",m(w,{title:r("bold","b"),icon:"fas fa-bold",onclick:i("bold")}),900),e.add("italic",m(w,{title:r("italic","i"),icon:"fas fa-italic",onclick:i("italic")}),800),e.add("strikethrough",m(w,{title:r("strikethrough"),icon:"fas fa-strikethrough",onclick:i("strikethrough")}),700),e.add("quote",m(w,{title:r("quote"),icon:"fas fa-quote-left",onclick:i("quote")}),600),e.add("spoiler",m(w,{title:r("spoiler"),icon:"fas fa-exclamation-triangle",onclick:i("spoiler")}),500),e.add("code",m(w,{title:r("code"),icon:"fas fa-code",onclick:i("code")}),400),e.add("link",m(w,{title:r("link"),icon:"fas fa-link",onclick:i("link")}),300),e.add("image",m(w,{title:r("image"),icon:"fas fa-image",onclick:i("image")}),200),e.add("unordered_list",m(w,{title:r("unordered_list"),icon:"fas fa-list-ul",onclick:i("unordered_list")}),100),e.add("ordered_list",m(w,{title:r("ordered_list"),icon:"fas fa-list-ol",onclick:i("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(d().prototype,"keyHandlers",(function(t){t.add("bold",I("bold","b",this)),t.add("italic",I("italic","i",this))})),l().prototype.markdownToolbarItems?(0,a.override)(l().prototype,"markdownToolbarItems",F):l().prototype.markdownToolbarItems=F,(0,a.extend)(l().prototype,"toolbarItems",(function(t){t.add("markdown",m(b,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=o})();
+(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["admin/app"];var r=t.n(e);const i=flarum.core.compat["common/app"];var n=t.n(i);const a=flarum.core.compat["common/extend"],c=flarum.core.compat["common/components/TextEditor"];var l=t.n(c);const s=flarum.core.compat["common/utils/BasicEditorDriver"];var d=t.n(s);const u=flarum.core.compat["common/utils/styleSelectedText"];var f=t.n(u);function p(t,o){return p=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t},p(t,o)}function h(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,p(t,o)}const k=flarum.core.compat["common/Component"];var y=t.n(k),b=function(t){function o(){return t.apply(this,arguments)||this}return h(o,t),o.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},o}(y());const x=flarum.core.compat["common/helpers/icon"];var v=t.n(x);const g=flarum.core.compat["common/components/Tooltip"];var _=t.n(g),w=function(t){function o(){return t.apply(this,arguments)||this}h(o,t);var e=o.prototype;return e.oncreate=function(o){t.prototype.oncreate.call(this,o)},e.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},v()(this.attrs.icon));return this.attrs.title?m(_(),{text:this.attrs.title},t):t},e.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},o}(y());const T=flarum.core.compat["common/utils/ItemList"];var O=t.n(T),S=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",I={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},P=function(t,o){f()(o.el,I[t])};function j(t,o,e){return function(r){r.key===o&&(r.metaKey&&"⌘"===S||r.ctrlKey&&"ctrl"===S)&&(r.preventDefault(),P(t,e))}}function F(t){var o=this,e="function"==typeof t?t():new(O());function r(t,o){return n().translator.trans("flarum-markdown.lib.composer."+t+"_tooltip")+(o?" <"+S+"-"+o+">":"")}var i=function(t){return function(){return P(t,o.attrs.composer.editor)}};return e.add("header",m(w,{title:r("header"),icon:"fas fa-heading",onclick:i("header")}),1e3),e.add("bold",m(w,{title:r("bold","b"),icon:"fas fa-bold",onclick:i("bold")}),900),e.add("italic",m(w,{title:r("italic","i"),icon:"fas fa-italic",onclick:i("italic")}),800),e.add("strikethrough",m(w,{title:r("strikethrough"),icon:"fas fa-strikethrough",onclick:i("strikethrough")}),700),e.add("quote",m(w,{title:r("quote"),icon:"fas fa-quote-left",onclick:i("quote")}),600),e.add("spoiler",m(w,{title:r("spoiler"),icon:"fas fa-exclamation-triangle",onclick:i("spoiler")}),500),e.add("code",m(w,{title:r("code"),icon:"fas fa-code",onclick:i("code")}),400),e.add("link",m(w,{title:r("link"),icon:"fas fa-link",onclick:i("link")}),300),e.add("image",m(w,{title:r("image"),icon:"fas fa-image",onclick:i("image")}),200),e.add("unordered_list",m(w,{title:r("unordered_list"),icon:"fas fa-list-ul",onclick:i("unordered_list")}),100),e.add("ordered_list",m(w,{title:r("ordered_list"),icon:"fas fa-list-ol",onclick:i("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(d().prototype,"keyHandlers",(function(t){t.add("bold",j("bold","b",this)),t.add("italic",j("italic","i",this))})),l().prototype.markdownToolbarItems?(0,a.override)(l().prototype,"markdownToolbarItems",F):l().prototype.markdownToolbarItems=F,(0,a.extend)(l().prototype,"toolbarItems",(function(t){t.add("markdown",m(b,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=o})();
//# sourceMappingURL=admin.js.map
\ No newline at end of file
diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map
index 6105f5f..68939c9 100644
--- a/js/dist/admin.js.map
+++ b/js/dist/admin.js.map
@@ -1 +1 @@
-{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH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arum/markdown/webpack/runtime/compat get default export","webpack://@flarum/markdown/webpack/runtime/define property getters","webpack://@flarum/markdown/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/markdown/webpack/runtime/make namespace object","webpack://@flarum/markdown/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/markdown/./src/common/index.js","webpack://@flarum/markdown/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/BasicEditorDriver'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/styleSelectedText'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return
{vnode.children}
;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport app from 'flarum/common/app';\nimport { extend, override } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n header: { prefix: '### ' },\n bold: { prefix: '**', suffix: '**', trimFirst: true },\n italic: { prefix: '_', suffix: '_', trimFirst: true },\n strikethrough: { prefix: '~~', suffix: '~~', trimFirst: true },\n quote: { prefix: '> ', multiline: true, surroundWithNewlines: true },\n code: { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n link: { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n image: { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n unordered_list: { prefix: '- ', multiline: true, surroundWithNewlines: true },\n ordered_list: { prefix: '1. ', multiline: true, orderedList: true },\n spoiler: { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true },\n};\n\nconst applyStyle = (id, editorDriver) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(editorDriver.el, styles[id]);\n};\n\nfunction makeShortcut(id, key, editorDriver) {\n return function (e) {\n if (e.key === key && ((e.metaKey && modifierKey === '⌘') || (e.ctrlKey && modifierKey === 'ctrl'))) {\n e.preventDefault();\n applyStyle(id, editorDriver);\n }\n };\n}\n\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n\n function tooltip(name, hotkey) {\n return app.translator.trans(`flarum-markdown.lib.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n }\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n\n items.add('header', , 1000);\n items.add('bold', , 900);\n items.add('italic', , 800);\n items.add(\n 'strikethrough',\n ,\n 700\n );\n items.add('quote', , 600);\n items.add('spoiler', , 500);\n items.add('code', , 400);\n items.add('link', , 300);\n items.add('image', , 200);\n items.add(\n 'unordered_list',\n ,\n 100\n );\n items.add('ordered_list', , 0);\n\n return items;\n}\n\nexport function initialize(app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b', this));\n items.add('italic', makeShortcut('italic', 'i', this));\n });\n\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n (shortcutHandler = handler)}>\n {this.markdownToolbarItems().toArray()}\n ,\n 100\n );\n });\n}\n","import app from 'flarum/admin/app';\nimport { initialize } from '../common/index';\n\napp.initializers.add('flarum-markdown', initialize);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","this","attrs","hotkey","onkeydown","keydown","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","header","prefix","bold","suffix","trimFirst","italic","strikethrough","quote","multiline","surroundWithNewlines","code","blockPrefix","blockSuffix","link","replaceNext","scanFor","image","unordered_list","ordered_list","orderedList","spoiler","applyStyle","id","editorDriver","styleSelectedText","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","ItemList","tooltip","name","app","makeApplyStyle","composer","editor","add","extend","BasicEditorDriver","TextEditor","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,c,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,kC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,kC,aCAzC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,eAAe,SAAUV,GAC3DA,EAAMQ,IAAI,OAAQd,EAAa,OAAQ,IAAK7C,OAC5CmD,EAAMQ,IAAI,SAAUd,EAAa,SAAU,IAAK7C,MACjD,IAEG8D,IAAAA,UAAAA,sBACFC,EAAAA,EAAAA,UAASD,IAAAA,UAAsB,uBAAwBb,GAEvDa,IAAAA,UAAAA,qBAA4Cb,GAG9CW,EAAAA,EAAAA,QAAOE,IAAAA,UAAsB,gBAAgB,SAAUX,GACrDA,EAAMQ,IACJ,WACA,EAACtE,EAAD,CAAiB2E,IAAKhE,KAAKiE,WAAYC,mBAAoB,SAACC,GAAD,OAAcC,gBAAkBD,CAAhC,GACxDnE,KAAKiD,uBAAuBoB,WAE/B,IAEH,GACF,G","sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/webpack/runtime/compat get default export","webpack://@flarum/markdown/webpack/runtime/define property getters","webpack://@flarum/markdown/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/markdown/webpack/runtime/make namespace object","webpack://@flarum/markdown/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/markdown/./src/common/index.js","webpack://@flarum/markdown/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/BasicEditorDriver'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/styleSelectedText'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return {vnode.children}
;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport app from 'flarum/common/app';\nimport { extend, override } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n header: { prefix: '### ' },\n bold: { prefix: '**', suffix: '**', trimFirst: true },\n italic: { prefix: '_', suffix: '_', trimFirst: true },\n strikethrough: { prefix: '~~', suffix: '~~', trimFirst: true },\n quote: { prefix: '> ', multiline: true, surroundWithNewlines: true },\n code: { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n link: { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n image: { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n unordered_list: { prefix: '- ', multiline: true, surroundWithNewlines: true },\n ordered_list: { prefix: '1. ', multiline: true, orderedList: true },\n spoiler: { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true },\n};\n\nconst applyStyle = (id, editorDriver) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(editorDriver.el, styles[id]);\n};\n\nfunction makeShortcut(id, key, editorDriver) {\n return function (e) {\n if (e.key === key && ((e.metaKey && modifierKey === '⌘') || (e.ctrlKey && modifierKey === 'ctrl'))) {\n e.preventDefault();\n applyStyle(id, editorDriver);\n }\n };\n}\n\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n\n function tooltip(name, hotkey) {\n return app.translator.trans(`flarum-markdown.lib.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n }\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n\n items.add('header', , 1000);\n items.add('bold', , 900);\n items.add('italic', , 800);\n items.add(\n 'strikethrough',\n ,\n 700\n );\n items.add('quote', , 600);\n items.add('spoiler', , 500);\n items.add('code', , 400);\n items.add('link', , 300);\n items.add('image', , 200);\n items.add(\n 'unordered_list',\n ,\n 100\n );\n items.add('ordered_list', , 0);\n\n return items;\n}\n\nexport function initialize(app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b', this));\n items.add('italic', makeShortcut('italic', 'i', this));\n });\n\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n (shortcutHandler = handler)}>\n {this.markdownToolbarItems().toArray()}\n ,\n 100\n );\n });\n}\n","import app from 'flarum/admin/app';\nimport { initialize } from '../common/index';\n\napp.initializers.add('flarum-markdown', initialize);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","this","attrs","hotkey","onkeydown","keydown","bind","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","header","prefix","bold","suffix","trimFirst","italic","strikethrough","quote","multiline","surroundWithNewlines","code","blockPrefix","blockSuffix","link","replaceNext","scanFor","image","unordered_list","ordered_list","orderedList","spoiler","applyStyle","id","editorDriver","styleSelectedText","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","ItemList","tooltip","name","app","makeApplyStyle","composer","editor","add","extend","BasicEditorDriver","TextEditor","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""}
\ No newline at end of file
diff --git a/js/dist/forum.js b/js/dist/forum.js
index c4c1943..a14d9a5 100644
--- a/js/dist/forum.js
+++ b/js/dist/forum.js
@@ -1,2 +1,2 @@
-(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const i=flarum.core.compat["common/app"];var n=t.n(i);const a=flarum.core.compat["common/extend"],c=flarum.core.compat["common/components/TextEditor"];var l=t.n(c);const s=flarum.core.compat["common/utils/BasicEditorDriver"];var d=t.n(s);const u=flarum.core.compat["common/utils/styleSelectedText"];var f=t.n(u);function p(t,o){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},p(t,o)}function h(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,p(t,o)}const k=flarum.core.compat["common/Component"];var y=t.n(k),b=function(t){function o(){return t.apply(this,arguments)||this}return h(o,t),o.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},o}(y());const x=flarum.core.compat["common/helpers/icon"];var v=t.n(x);const g=flarum.core.compat["common/components/Tooltip"];var _=t.n(g),w=function(t){function o(){return t.apply(this,arguments)||this}h(o,t);var e=o.prototype;return e.oncreate=function(o){t.prototype.oncreate.call(this,o)},e.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},v()(this.attrs.icon));return this.attrs.title?m(_(),{text:this.attrs.title},t):t},e.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},o}(y());const O=flarum.core.compat["common/utils/ItemList"];var T=t.n(O),P=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",S={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},j=function(t,o){f()(o.el,S[t])};function I(t,o,e){return function(r){r.key===o&&(r.metaKey&&"⌘"===P||r.ctrlKey&&"ctrl"===P)&&(r.preventDefault(),j(t,e))}}function F(t){var o=this,e="function"==typeof t?t():new(T());function r(t,o){return n().translator.trans("flarum-markdown.lib.composer."+t+"_tooltip")+(o?" <"+P+"-"+o+">":"")}var i=function(t){return function(){return j(t,o.attrs.composer.editor)}};return e.add("header",m(w,{title:r("header"),icon:"fas fa-heading",onclick:i("header")}),1e3),e.add("bold",m(w,{title:r("bold","b"),icon:"fas fa-bold",onclick:i("bold")}),900),e.add("italic",m(w,{title:r("italic","i"),icon:"fas fa-italic",onclick:i("italic")}),800),e.add("strikethrough",m(w,{title:r("strikethrough"),icon:"fas fa-strikethrough",onclick:i("strikethrough")}),700),e.add("quote",m(w,{title:r("quote"),icon:"fas fa-quote-left",onclick:i("quote")}),600),e.add("spoiler",m(w,{title:r("spoiler"),icon:"fas fa-exclamation-triangle",onclick:i("spoiler")}),500),e.add("code",m(w,{title:r("code"),icon:"fas fa-code",onclick:i("code")}),400),e.add("link",m(w,{title:r("link"),icon:"fas fa-link",onclick:i("link")}),300),e.add("image",m(w,{title:r("image"),icon:"fas fa-image",onclick:i("image")}),200),e.add("unordered_list",m(w,{title:r("unordered_list"),icon:"fas fa-list-ul",onclick:i("unordered_list")}),100),e.add("ordered_list",m(w,{title:r("ordered_list"),icon:"fas fa-list-ol",onclick:i("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(d().prototype,"keyHandlers",(function(t){t.add("bold",I("bold","b",this)),t.add("italic",I("italic","i",this))})),l().prototype.markdownToolbarItems?(0,a.override)(l().prototype,"markdownToolbarItems",F):l().prototype.markdownToolbarItems=F,(0,a.extend)(l().prototype,"toolbarItems",(function(t){t.add("markdown",m(b,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=o})();
+(()=>{var t={n:o=>{var e=o&&o.__esModule?()=>o.default:()=>o;return t.d(e,{a:e}),e},d:(o,e)=>{for(var r in e)t.o(e,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:e[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const e=flarum.core.compat["forum/app"];var r=t.n(e);const i=flarum.core.compat["common/app"];var n=t.n(i);const a=flarum.core.compat["common/extend"],c=flarum.core.compat["common/components/TextEditor"];var l=t.n(c);const s=flarum.core.compat["common/utils/BasicEditorDriver"];var d=t.n(s);const u=flarum.core.compat["common/utils/styleSelectedText"];var f=t.n(u);function p(t,o){return p=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t},p(t,o)}function h(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,p(t,o)}const k=flarum.core.compat["common/Component"];var y=t.n(k),b=function(t){function o(){return t.apply(this,arguments)||this}return h(o,t),o.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},o}(y());const x=flarum.core.compat["common/helpers/icon"];var v=t.n(x);const g=flarum.core.compat["common/components/Tooltip"];var _=t.n(g),w=function(t){function o(){return t.apply(this,arguments)||this}h(o,t);var e=o.prototype;return e.oncreate=function(o){t.prototype.oncreate.call(this,o)},e.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},v()(this.attrs.icon));return this.attrs.title?m(_(),{text:this.attrs.title},t):t},e.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},o}(y());const T=flarum.core.compat["common/utils/ItemList"];var O=t.n(T),S=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",I={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},P=function(t,o){f()(o.el,I[t])};function j(t,o,e){return function(r){r.key===o&&(r.metaKey&&"⌘"===S||r.ctrlKey&&"ctrl"===S)&&(r.preventDefault(),P(t,e))}}function F(t){var o=this,e="function"==typeof t?t():new(O());function r(t,o){return n().translator.trans("flarum-markdown.lib.composer."+t+"_tooltip")+(o?" <"+S+"-"+o+">":"")}var i=function(t){return function(){return P(t,o.attrs.composer.editor)}};return e.add("header",m(w,{title:r("header"),icon:"fas fa-heading",onclick:i("header")}),1e3),e.add("bold",m(w,{title:r("bold","b"),icon:"fas fa-bold",onclick:i("bold")}),900),e.add("italic",m(w,{title:r("italic","i"),icon:"fas fa-italic",onclick:i("italic")}),800),e.add("strikethrough",m(w,{title:r("strikethrough"),icon:"fas fa-strikethrough",onclick:i("strikethrough")}),700),e.add("quote",m(w,{title:r("quote"),icon:"fas fa-quote-left",onclick:i("quote")}),600),e.add("spoiler",m(w,{title:r("spoiler"),icon:"fas fa-exclamation-triangle",onclick:i("spoiler")}),500),e.add("code",m(w,{title:r("code"),icon:"fas fa-code",onclick:i("code")}),400),e.add("link",m(w,{title:r("link"),icon:"fas fa-link",onclick:i("link")}),300),e.add("image",m(w,{title:r("image"),icon:"fas fa-image",onclick:i("image")}),200),e.add("unordered_list",m(w,{title:r("unordered_list"),icon:"fas fa-list-ul",onclick:i("unordered_list")}),100),e.add("ordered_list",m(w,{title:r("ordered_list"),icon:"fas fa-list-ol",onclick:i("ordered_list")}),0),e}r().initializers.add("flarum-markdown",(function(t){(0,a.extend)(d().prototype,"keyHandlers",(function(t){t.add("bold",j("bold","b",this)),t.add("italic",j("italic","i",this))})),l().prototype.markdownToolbarItems?(0,a.override)(l().prototype,"markdownToolbarItems",F):l().prototype.markdownToolbarItems=F,(0,a.extend)(l().prototype,"toolbarItems",(function(t){t.add("markdown",m(b,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},this.markdownToolbarItems().toArray()),100)}))}))})(),module.exports=o})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map
index 838157c..53779dc 100644
--- a/js/dist/forum.js.map
+++ b/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAA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e,WAAc,KACtHL,EAAMQ,IACJ,iBACA,EAAC/D,EAAc,CAACY,MAAO6C,EAAQ,kBAAmB9C,KAAK,iBAAiBD,QAASkD,EAAe,oBAChG,KAEFL,EAAMQ,IAAI,eAAgB,EAAC/D,EAAc,CAACY,MAAO6C,EAAQ,gBAAiB9C,KAAK,iBAAiBD,QAASkD,EAAe,kBAAqB,GAEtIL,CACT,CChFAI,IAAAA,aAAAA,IAAqB,mBDkFd,SAAoBA,IACzBK,EAAAA,EAAAA,QAAOC,IAAAA,UAA6B,eAAe,SAAUV,GAC3DA,EAAMQ,IAAI,OAAQd,EAAa,OAAQ,IAAK5C,OAC5CkD,EAAMQ,IAAI,SAAUd,EAAa,SAAU,IAAK5C,MAClD,IAEI6D,IAAAA,UAAAA,sBACFC,EAAAA,EAAAA,UAASD,IAAAA,UAAsB,uBAAwBb,GAEvDa,IAAAA,UAAAA,qBAA4Cb,GAG9CW,EAAAA,EAAAA,QAAOE,IAAAA,UAAsB,gBAAgB,SAAUX,GACrDA,EAAMQ,IACJ,WACA,EAACrE,EAAe,CAAC0E,IAAK/D,KAAKgE,WAAYC,mBAAoB,SAACC,GAAO,OAAMC,gBAAkBD,CAAO,GAC/FlE,KAAKgD,uBAAuBoB,WAE/B,IAEJ,GACF,G","sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/webpack/runtime/compat get default export","webpack://@flarum/markdown/webpack/runtime/define property getters","webpack://@flarum/markdown/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/markdown/webpack/runtime/make namespace object","webpack://@flarum/markdown/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/markdown/./src/common/index.js","webpack://@flarum/markdown/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/BasicEditorDriver'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/styleSelectedText'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return {vnode.children}
;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport app from 'flarum/common/app';\nimport { extend, override } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n header: { prefix: '### ' },\n bold: { prefix: '**', suffix: '**', trimFirst: true },\n italic: { prefix: '_', suffix: '_', trimFirst: true },\n strikethrough: { prefix: '~~', suffix: '~~', trimFirst: true },\n quote: { prefix: '> ', multiline: true, surroundWithNewlines: true },\n code: { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n link: { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n image: { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n unordered_list: { prefix: '- ', multiline: true, surroundWithNewlines: true },\n ordered_list: { prefix: '1. ', multiline: true, orderedList: true },\n spoiler: { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true },\n};\n\nconst applyStyle = (id, editorDriver) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(editorDriver.el, styles[id]);\n};\n\nfunction makeShortcut(id, key, editorDriver) {\n return function (e) {\n if (e.key === key && ((e.metaKey && modifierKey === '⌘') || (e.ctrlKey && modifierKey === 'ctrl'))) {\n e.preventDefault();\n applyStyle(id, editorDriver);\n }\n };\n}\n\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n\n function tooltip(name, hotkey) {\n return app.translator.trans(`flarum-markdown.lib.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n }\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n\n items.add('header', , 1000);\n items.add('bold', , 900);\n items.add('italic', , 800);\n items.add(\n 'strikethrough',\n ,\n 700\n );\n items.add('quote', , 600);\n items.add('spoiler', , 500);\n items.add('code', , 400);\n items.add('link', , 300);\n items.add('image', , 200);\n items.add(\n 'unordered_list',\n ,\n 100\n );\n items.add('ordered_list', , 0);\n\n return items;\n}\n\nexport function initialize(app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b', this));\n items.add('italic', makeShortcut('italic', 'i', this));\n });\n\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n (shortcutHandler = handler)}>\n {this.markdownToolbarItems().toArray()}\n ,\n 100\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { initialize } from '../common/index';\n\napp.initializers.add('flarum-markdown', initialize);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","this","attrs","hotkey","onkeydown","keydown","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","header","prefix","bold","suffix","trimFirst","italic","strikethrough","quote","multiline","surroundWithNewlines","code","blockPrefix","blockSuffix","link","replaceNext","scanFor","image","unordered_list","ordered_list","orderedList","spoiler","applyStyle","id","editorDriver","styleSelectedText","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","ItemList","tooltip","name","app","makeApplyStyle","composer","editor","add","extend","BasicEditorDriver","TextEditor","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA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,CAAhC,GACxDnE,KAAKiD,uBAAuBoB,WAE/B,IAEH,GACF,G","sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/webpack/runtime/compat get default export","webpack://@flarum/markdown/webpack/runtime/define property getters","webpack://@flarum/markdown/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/markdown/webpack/runtime/make namespace object","webpack://@flarum/markdown/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/markdown/./src/common/index.js","webpack://@flarum/markdown/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/BasicEditorDriver'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/styleSelectedText'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return {vnode.children}
;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport app from 'flarum/common/app';\nimport { extend, override } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n header: { prefix: '### ' },\n bold: { prefix: '**', suffix: '**', trimFirst: true },\n italic: { prefix: '_', suffix: '_', trimFirst: true },\n strikethrough: { prefix: '~~', suffix: '~~', trimFirst: true },\n quote: { prefix: '> ', multiline: true, surroundWithNewlines: true },\n code: { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n link: { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n image: { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n unordered_list: { prefix: '- ', multiline: true, surroundWithNewlines: true },\n ordered_list: { prefix: '1. ', multiline: true, orderedList: true },\n spoiler: { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true },\n};\n\nconst applyStyle = (id, editorDriver) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(editorDriver.el, styles[id]);\n};\n\nfunction makeShortcut(id, key, editorDriver) {\n return function (e) {\n if (e.key === key && ((e.metaKey && modifierKey === '⌘') || (e.ctrlKey && modifierKey === 'ctrl'))) {\n e.preventDefault();\n applyStyle(id, editorDriver);\n }\n };\n}\n\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n\n function tooltip(name, hotkey) {\n return app.translator.trans(`flarum-markdown.lib.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n }\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n\n items.add('header', , 1000);\n items.add('bold', , 900);\n items.add('italic', , 800);\n items.add(\n 'strikethrough',\n ,\n 700\n );\n items.add('quote', , 600);\n items.add('spoiler', , 500);\n items.add('code', , 400);\n items.add('link', , 300);\n items.add('image', , 200);\n items.add(\n 'unordered_list',\n ,\n 100\n );\n items.add('ordered_list', , 0);\n\n return items;\n}\n\nexport function initialize(app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b', this));\n items.add('italic', makeShortcut('italic', 'i', this));\n });\n\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n (shortcutHandler = handler)}>\n {this.markdownToolbarItems().toArray()}\n ,\n 100\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { initialize } from '../common/index';\n\napp.initializers.add('flarum-markdown', initialize);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","this","attrs","hotkey","onkeydown","keydown","bind","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","header","prefix","bold","suffix","trimFirst","italic","strikethrough","quote","multiline","surroundWithNewlines","code","blockPrefix","blockSuffix","link","replaceNext","scanFor","image","unordered_list","ordered_list","orderedList","spoiler","applyStyle","id","editorDriver","styleSelectedText","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","ItemList","tooltip","name","app","makeApplyStyle","composer","editor","add","extend","BasicEditorDriver","TextEditor","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""}
\ No newline at end of file