From 6ff20798c329cf1267e2138ea3bf2a2b875d5976 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Thu, 24 Sep 2020 02:52:46 +0000 Subject: [PATCH] Bundled output for commit ab63a55d6064f5b9ca8f51f9301c1f6fa06f00d9 [skip ci] --- extensions/markdown/js/dist/forum.js | 4 ++-- extensions/markdown/js/dist/forum.js.map | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/markdown/js/dist/forum.js b/extensions/markdown/js/dist/forum.js index a2e8c0c76..aa1c0815c 100644 --- a/extensions/markdown/js/dist/forum.js +++ b/extensions/markdown/js/dist/forum.js @@ -1,4 +1,4 @@ -module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=flarum.core.compat.extend},function(e,t){e.exports=flarum.core.compat["components/TextEditor"]},function(e,t){e.exports=flarum.core.compat.Component},function(e,t,n){var i,r,l;"undefined"!=typeof self&&self,r=[],void 0===(l="function"==typeof(i=function(){var e=/mac|iphone|ipad|ipod/i.test(navigator.platform)?"metaKey":"ctrlKey",t=/[*_]/,n=/^[ \t]*(?:(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?|>[ \t]*)*(?::[ \t]*)?/,i=/[-=\s"'`<>\[\](){}+*^$\\.|]$/,r=/(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?$/,l=/^(?:\n|$)/,o=/[-+*\[\]x\d.]/g,s=/[^ \t]/g,a=/(\d+)\.(?=[ \t]+$)/,c=/(?:(?:^[ \t]+)?(?:[-+*]|\d+\.|[>:])(?:[ \t]+\[[ x]])?[ \t]*|^[ \t]+)$/,u=/^(?!$)/gm,f={"`":/^``$/m,"~":/^~~$/m},h={"[":"]","(":")","{":"}","<":">"},d={"]":"[",")":"(","}":"{",">":"<"},p={enter:["Enter","Shift+Enter"],indent:["Tab","Cmd+m"],outdent:["Shift+Tab","Cmd+Shift+m"],inline:['"',"'","`","*","_","[","]","(",")","{","}","<",">"]};function m(e,t){var n,i;this._options=((n=t)||(n={}),n.keyMap=function(e){e||(e={});var t={},n=[];for(var i in p)if(p.hasOwnProperty(i)){var r=e[i]||p[i];Array.isArray(r)||(r=r.toString().trim().split(/\s*[|,]\s*/g)),n.push.apply(n,r.map((function(e){return(e=v(e)).key in t||(t[e.key]=0),++t[e.key],{key:e,action:i}})))}return n.forEach((function(e){var n;11}function x(e,t){return Array(t+1).join(e)}function b(e,t){for(var n=t;e[n]&&null!=e[n-1]&&!e[n-1].match(/\s/);)n--;return n}function k(e,t,n){for(var i=t,r=n?/\n/:/\s/;e[i]&&!e[i].match(r);)i++;return i}function E(e){var t,n,i=e.value.slice(0,e.selectionStart),r=e.value.slice(e.selectionEnd),l=i.match(/\n*$/),o=r.match(/^\n*/),s=l?l[0].length:0,a=o?o[0].length:0;return i.match(/\S/)&&s<2&&(t=x("\n",2-s)),r.match(/\S/)&&a<2&&(n=x("\n",2-a)),null==t&&(t=""),null==n&&(n=""),{newlinesToAppend:t,newlinesToPrepend:n}}var S=function(e,t){var n=t.prefix,i=t.suffix,r=t.blockPrefix,l=t.blockSuffix,o=t.replaceNext,s=t.prefixSpace,a=t.scanFor,c=t.surroundWithNewlines,u=e.selectionStart,f=e.selectionEnd,h=e.value.slice(e.selectionStart,e.selectionEnd),d=g(h)&&r.length>0?r+"\n":n,p=g(h)&&l.length>0?"\n"+l:i;if(s){var m=e.value[e.selectionStart-1];0===e.selectionStart||null==m||m.match(/\s/)||(d=" "+d)}h=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.selectionStart===e.selectionEnd)e.selectionStart=b(e.value,e.selectionStart),e.selectionEnd=k(e.value,e.selectionEnd,i);else{var r=e.selectionStart-t.length,l=e.selectionEnd+n.length,o=e.value.slice(r,e.selectionStart)===t,s=e.value.slice(e.selectionEnd,l)===n;o&&s&&(e.selectionStart=r,e.selectionEnd=l)}return e.value.slice(e.selectionStart,e.selectionEnd)}(e,d,p,t.multiline);var v=e.selectionStart,y=e.selectionEnd,x=o.length>0&&p.indexOf(o)>-1&&h.length>0;if(c){var S=E(e);d=S.newlinesToAppend+n,p+=S.newlinesToPrepend}if(h.startsWith(d)&&h.endsWith(p)){var _=h.slice(d.length,h.length-p.length);if(u===f){var w=u-d.length;w=Math.max(w,v),v=y=w=Math.min(w,v+_.length)}else y=v+_.length;return{text:_,selectionStart:v,selectionEnd:y}}if(x)return a.length>0&&h.match(a)?{text:d+(p=p.replace(o,h)),selectionStart:v=y=v+d.length,selectionEnd:y}:{text:d+h+p,selectionStart:v=v+d.length+h.length+p.indexOf(o),selectionEnd:y=v+o.length};var O=d+h+p;v=u+d.length,y=f+d.length;var K=h.match(/^\s*|\s*$/g);if(t.trimFirst&&K){var j=K[0]||"",M=K[1]||"";O=j+d+h.trim()+p+M,v+=j.length,y-=M.length}return{text:O,selectionStart:v,selectionEnd:y}},_=function(e,t){var n,i=e.value.slice(e.selectionStart,e.selectionEnd);n=t.orderedList?function(e){var t,n,i,r,l=/^\d+\.\s+/,o=e.selectionStart===e.selectionEnd,s=e.value.slice(e.selectionStart,e.selectionEnd),a=s,c=s.split("\n");if(o){var u=e.value.slice(0,e.selectionStart).split(/\n/);i=e.selectionStart-u[u.length-1].length,r=k(e.value,e.selectionStart,!0),a=e.value.slice(i,r)}var f=a.split("\n");if(f.every((function(e){return l.test(e)}))){if(s=(c=f.map((function(e){return e.replace(l,"")}))).join("\n"),o&&i&&r){var h=f[0].length-c[0].length;n=t=e.selectionStart-h,e.selectionStart=i,e.selectionEnd=r}}else{s=(c=function(){var e,t,n,i=[];for(n=e=0,t=c.length;e"),e},t}(u.a); +module.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["components/TextEditor"]},function(t,e){t.exports=flarum.core.compat.Component},function(t,e,n){var i,r,l;"undefined"!=typeof self&&self,r=[],void 0===(l="function"==typeof(i=function(){var t=/mac|iphone|ipad|ipod/i.test(navigator.platform)?"metaKey":"ctrlKey",e=/[*_]/,n=/^[ \t]*(?:(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?|>[ \t]*)*(?::[ \t]*)?/,i=/[-=\s"'`<>\[\](){}+*^$\\.|]$/,r=/(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?$/,l=/^(?:\n|$)/,o=/[-+*\[\]x\d.]/g,s=/[^ \t]/g,a=/(\d+)\.(?=[ \t]+$)/,c=/(?:(?:^[ \t]+)?(?:[-+*]|\d+\.|[>:])(?:[ \t]+\[[ x]])?[ \t]*|^[ \t]+)$/,u=/^(?!$)/gm,f={"`":/^``$/m,"~":/^~~$/m},h={"[":"]","(":")","{":"}","<":">"},d={"]":"[",")":"(","}":"{",">":"<"},p={enter:["Enter","Shift+Enter"],indent:["Tab","Cmd+m"],outdent:["Shift+Tab","Cmd+Shift+m"],inline:['"',"'","`","*","_","[","]","(",")","{","}","<",">"]};function m(t,e){var n,i;this._options=((n=e)||(n={}),n.keyMap=function(t){t||(t={});var e={},n=[];for(var i in p)if(p.hasOwnProperty(i)){var r=t[i]||p[i];Array.isArray(r)||(r=r.toString().trim().split(/\s*[|,]\s*/g)),n.push.apply(n,r.map((function(t){return(t=v(t)).key in e||(e[t.key]=0),++e[t.key],{key:t,action:i}})))}return n.forEach((function(t){var n;11}function x(t,e){return Array(e+1).join(t)}function b(t,e){for(var n=e;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}function k(t,e,n){for(var i=e,r=n?/\n/:/\s/;t[i]&&!t[i].match(r);)i++;return i}function E(t){var e,n,i=t.value.slice(0,t.selectionStart),r=t.value.slice(t.selectionEnd),l=i.match(/\n*$/),o=r.match(/^\n*/),s=l?l[0].length:0,a=o?o[0].length:0;return i.match(/\S/)&&s<2&&(e=x("\n",2-s)),r.match(/\S/)&&a<2&&(n=x("\n",2-a)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}var S=function(t,e){var n=e.prefix,i=e.suffix,r=e.blockPrefix,l=e.blockSuffix,o=e.replaceNext,s=e.prefixSpace,a=e.scanFor,c=e.surroundWithNewlines,u=t.selectionStart,f=t.selectionEnd,h=t.value.slice(t.selectionStart,t.selectionEnd),d=g(h)&&r.length>0?r+"\n":n,p=g(h)&&l.length>0?"\n"+l:i;if(s){var m=t.value[t.selectionStart-1];0===t.selectionStart||null==m||m.match(/\s/)||(d=" "+d)}h=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.selectionStart===t.selectionEnd)t.selectionStart=b(t.value,t.selectionStart),t.selectionEnd=k(t.value,t.selectionEnd,i);else{var r=t.selectionStart-e.length,l=t.selectionEnd+n.length,o=t.value.slice(r,t.selectionStart)===e,s=t.value.slice(t.selectionEnd,l)===n;o&&s&&(t.selectionStart=r,t.selectionEnd=l)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,d,p,e.multiline);var v=t.selectionStart,y=t.selectionEnd,x=o.length>0&&p.indexOf(o)>-1&&h.length>0;if(c){var S=E(t);d=S.newlinesToAppend+n,p+=S.newlinesToPrepend}if(h.startsWith(d)&&h.endsWith(p)){var _=h.slice(d.length,h.length-p.length);if(u===f){var w=u-d.length;w=Math.max(w,v),v=y=w=Math.min(w,v+_.length)}else y=v+_.length;return{text:_,selectionStart:v,selectionEnd:y}}if(x)return a.length>0&&h.match(a)?{text:d+(p=p.replace(o,h)),selectionStart:v=y=v+d.length,selectionEnd:y}:{text:d+h+p,selectionStart:v=v+d.length+h.length+p.indexOf(o),selectionEnd:y=v+o.length};var O=d+h+p;v=u+d.length,y=f+d.length;var j=h.match(/^\s*|\s*$/g);if(e.trimFirst&&j){var K=j[0]||"",M=j[1]||"";O=K+d+h.trim()+p+M,v+=K.length,y-=M.length}return{text:O,selectionStart:v,selectionEnd:y}},_=function(t,e){var n,i=t.value.slice(t.selectionStart,t.selectionEnd);n=e.orderedList?function(t){var e,n,i,r,l=/^\d+\.\s+/,o=t.selectionStart===t.selectionEnd,s=t.value.slice(t.selectionStart,t.selectionEnd),a=s,c=s.split("\n");if(o){var u=t.value.slice(0,t.selectionStart).split(/\n/);i=t.selectionStart-u[u.length-1].length,r=k(t.value,t.selectionStart,!0),a=t.value.slice(i,r)}var f=a.split("\n");if(f.every((function(t){return l.test(t)}))){if(s=(c=f.map((function(t){return t.replace(l,"")}))).join("\n"),o&&i&&r){var h=f[0].length-c[0].length;n=e=t.selectionStart-h,t.selectionStart=i,t.selectionEnd=r}}else{s=(c=function(){var t,e,n,i=[];for(n=t=0,e=c.length;t"),t},e}(u.a); /*! * Includes modified code from GitHub Markdown Toolbar Element * https://github.com/github/markdown-toolbar-element/ @@ -7,5 +7,5 @@ module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;va * Released under the MIT license * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE */ -app.initializers.add("flarum-markdown",(function(e){var t=1;Object(i.extend)(l.a.prototype,"init",(function(){this.textareaId="textarea"+t++})),Object(i.extend)(l.a.prototype,"view",(function(e){e.children[0].attrs.id=this.textareaId})),Object(i.extend)(l.a.prototype,"configTextarea",(function(e,t,n,i){if(!n){var r=new s.a(t,{keyMap:{indent:["Ctrl+m"],outdent:["Ctrl+M"]}});i.onunload=function(){r.destroy()}}})),Object(i.extend)(l.a.prototype,"toolbarItems",(function(t){var n=function(t){return e.translator.trans("flarum-markdown.forum.composer."+t+"_tooltip")};t.add("markdown",m(h,{for:this.textareaId},m(O,{title:n("header"),icon:"fas fa-heading",style:{prefix:"### "}}),m(O,{title:n("bold"),icon:"fas fa-bold",style:{prefix:"**",suffix:"**",trimFirst:!0},hotkey:"b"}),m(O,{title:n("italic"),icon:"fas fa-italic",style:{prefix:"_",suffix:"_",trimFirst:!0},hotkey:"i"}),m(O,{title:n("quote"),icon:"fas fa-quote-left",style:{prefix:"> ",multiline:!0,surroundWithNewlines:!0}}),m(O,{title:n("code"),icon:"fas fa-code",style:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"}}),m(O,{title:n("link"),icon:"fas fa-link",style:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(O,{title:n("image"),icon:"fas fa-image",style:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(O,{title:n("unordered_list"),icon:"fas fa-list-ul",style:{prefix:"- ",multiline:!0,surroundWithNewlines:!0}}),m(O,{title:n("ordered_list"),icon:"fas fa-list-ol",style:{prefix:"1. ",multiline:!0,orderedList:!0}})),100)}))}))}]); +app.initializers.add("flarum-markdown",(function(t){var e=1;Object(i.extend)(l.a.prototype,"oninit",(function(){this.textareaId="textarea"+e++})),Object(i.extend)(l.a.prototype,"view",(function(t){t.children[0].attrs.id=this.textareaId})),Object(i.extend)(l.a.prototype,"oncreate",(function(){this.editor=new s.a(this.$("textarea")[0],{keyMap:{indent:["Ctrl+m"],outdent:["Ctrl+M"]}})})),Object(i.extend)(l.a.prototype,"onremove",(function(){this.editor.destroy()})),Object(i.extend)(l.a.prototype,"toolbarItems",(function(e){var n=function(e){return t.translator.trans("flarum-markdown.forum.composer."+e+"_tooltip")};e.add("markdown",m(h,{for:this.textareaId},m(O,{title:n("header"),icon:"fas fa-heading",style:{prefix:"### "}}),m(O,{title:n("bold"),icon:"fas fa-bold",style:{prefix:"**",suffix:"**",trimFirst:!0},hotkey:"b"}),m(O,{title:n("italic"),icon:"fas fa-italic",style:{prefix:"_",suffix:"_",trimFirst:!0},hotkey:"i"}),m(O,{title:n("quote"),icon:"fas fa-quote-left",style:{prefix:"> ",multiline:!0,surroundWithNewlines:!0}}),m(O,{title:n("code"),icon:"fas fa-code",style:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"}}),m(O,{title:n("link"),icon:"fas fa-link",style:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(O,{title:n("image"),icon:"fas fa-image",style:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(O,{title:n("unordered_list"),icon:"fas fa-list-ul",style:{prefix:"- ",multiline:!0,surroundWithNewlines:!0}}),m(O,{title:n("ordered_list"),icon:"fas fa-list-ol",style:{prefix:"1. ",multiline:!0,orderedList:!0}})),100)}))}))}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/markdown/js/dist/forum.js.map b/extensions/markdown/js/dist/forum.js.map index d86e2e616..0fac044ee 100644 --- a/extensions/markdown/js/dist/forum.js.map +++ b/extensions/markdown/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/external \"flarum.core.compat['extend']\"","webpack://@flarum/markdown/external \"flarum.core.compat['components/TextEditor']\"","webpack://@flarum/markdown/external \"flarum.core.compat['Component']\"","webpack://@flarum/markdown/./node_modules/mdarea/mdarea.min.js","webpack://@flarum/markdown/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/./src/forum/components/MarkdownToolbar.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/markdown/./src/forum/util/insertText.js","webpack://@flarum/markdown/./src/forum/util/styles.js","webpack://@flarum/markdown/./src/forum/util/apply.js","webpack://@flarum/markdown/./src/forum/components/MarkdownButton.js","webpack://@flarum/markdown/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","self","test","navigator","platform","u","f","y","g","_","v","k","enter","indent","outdent","inline","e","this","_options","keyMap","Array","isArray","toString","trim","split","push","apply","map","action","forEach","ctrlKey","altKey","shiftKey","metaKey","length","join","_reOutdent","RegExp","_handleKey","setElement","toLowerCase","b","selectionStart","selectionEnd","arguments","window","InputEvent","dispatchEvent","x","replace","constructor","getElement","_elem","removeEventListener","addEventListener","getValue","setValue","destroy","defaultPrevented","find","substring","a","h","lastIndexOf","line","offset","prefix","exec","charAt","parseInt","slice","preventDefault","_inheritsLoose","subClass","superClass","__proto__","modifierKey","userAgent","match","MarkdownToolbar","config","isInitialized","document","getElementById","props","for","shortcut","view","id","data-for","style","display","children","event","button","element","querySelector","click","Component","_extends","assign","target","source","canInsertText","isMultipleLines","string","repeat","wordSelectionStart","text","index","wordSelectionEnd","multiline","breakpoint","newlinesToSurroundSelectedText","textarea","newlinesToAppend","newlinesToPrepend","beforeSelection","afterSelection","breaksBefore","breaksAfter","newlinesBeforeSelection","newlinesAfterSelection","blockStyle","arg","suffix","blockPrefix","blockSuffix","replaceNext","prefixSpace","scanFor","surroundWithNewlines","originalSelectionStart","originalSelectionEnd","selectedText","prefixToUse","suffixToUse","undefined","expandedSelectionStart","expandedSelectionEnd","beginsWithPrefix","endsWithSuffix","expandSelectedText","hasReplaceNext","indexOf","ref","startsWith","endsWith","replacementText","position","Math","max","min","whitespaceEdges","trimFirst","leadingWhitespace","trailingWhitespace","styleSelectedText","styleArgs","result","orderedList","startOfLine","endOfLine","orderedListRegex","noInitialSelection","textToUnstyle","lines","linesBefore","linesToUnstyle","every","lengthDiff","len","results","multilineStyle","before","after","contentEditable","execCommand","error","createEvent","initEvent","setSelectionRange","insertText","MarkdownButton","$","tooltip","className","title","data-hotkey","hotkey","onclick","onkeydown","keydown","icon","stylesToApply","toolbar","parentElement","field","dataset","focus","app","initializers","add","extend","TextEditor","textareaId","vdom","attrs","context","editor","MarkdownArea","onunload","items","translator","trans"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU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,EAAC,EAAD,CAAgBwD,MAAOF,EAAQ,gBAAiBQ,KAAK,iBAAiBvG,MAAO,CAAExB,OAAQ,MAAO6C,WAAW,EAAMiD,aAAa,MAE7H","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['Component'];","!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&module.exports?module.exports=t():e.MarkdownArea=t()}(\"undefined\"!=typeof self?self:this,function(){var n=/mac|iphone|ipad|ipod/i.test(navigator.platform)?\"metaKey\":\"ctrlKey\",u=/[*_]/,d=/^[ \\t]*(?:(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?|>[ \\t]*)*(?::[ \\t]*)?/,f=/[-=\\s\"'`<>\\[\\](){}+*^$\\\\.|]$/,p=/(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?$/,y=/^(?:\\n|$)/,i=/[-+*\\[\\]x\\d.]/g,s=/[^ \\t]/g,m=/(\\d+)\\.(?=[ \\t]+$)/,g=/(?:(?:^[ \\t]+)?(?:[-+*]|\\d+\\.|[>:])(?:[ \\t]+\\[[ x]])?[ \\t]*|^[ \\t]+)$/,c=/^(?!$)/gm,_={\"`\":/^``$/m,\"~\":/^~~$/m},v={\"[\":\"]\",\"(\":\")\",\"{\":\"}\",\"<\":\">\"},k={\"]\":\"[\",\")\":\"(\",\"}\":\"{\",\">\":\"<\"},r={enter:[\"Enter\",\"Shift+Enter\"],indent:[\"Tab\",\"Cmd+m\"],outdent:[\"Shift+Tab\",\"Cmd+Shift+m\"],inline:['\"',\"'\",\"`\",\"*\",\"_\",\"[\",\"]\",\"(\",\")\",\"{\",\"}\",\"<\",\">\"]};function e(e,t){var n,i;this._options=((n=t)||(n={}),n.keyMap=function(e){e||(e={});var n={},t=[];for(var i in r)if(r.hasOwnProperty(i)){var s=e[i]||r[i];Array.isArray(s)||(s=s.toString().trim().split(/\\s*[|,]\\s*/g)),t.push.apply(t,s.map(function(e){return(e=l(e)).key in n||(n[e.key]=0),++n[e.key],{key:e,action:i}}))}return t.forEach(function(e){var t;1\n {this.props.children}\n ;\n }\n\n shortcut(event) {\n if ((event.metaKey && modifierKey === 'Meta') || (event.ctrlKey && modifierKey === 'Control')) {\n const button = this.element.querySelector(`[data-hotkey=\"${event.key}\"]`);\n\n if (button) {\n button.click();\n event.preventDefault()\n }\n }\n }\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport let canInsertText = null;\n\nexport default (textarea, { text, selectionStart, selectionEnd }) => {\n const originalSelectionStart = textarea.selectionStart;\n const before = textarea.value.slice(0, originalSelectionStart);\n const after = textarea.value.slice(textarea.selectionEnd);\n\n if (canInsertText === null || canInsertText === true) {\n textarea.contentEditable = 'true';\n try {\n canInsertText = document.execCommand('insertText', false, text);\n }\n catch (error) {\n canInsertText = false;\n }\n textarea.contentEditable = 'false';\n }\n if (canInsertText && !textarea.value.slice(0, textarea.selectionStart).endsWith(text)) {\n canInsertText = false;\n }\n if (!canInsertText) {\n try {\n document.execCommand('ms-beginUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n textarea.value = before + text + after;\n try {\n document.execCommand('ms-endUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n\n // fire custom event, works on IE\n const event = document.createEvent('Event');\n\n event.initEvent('input', true, true);\n\n textarea.dispatchEvent(event);\n }\n if (selectionStart != null && selectionEnd != null) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n else {\n textarea.setSelectionRange(originalSelectionStart, textarea.selectionEnd);\n }\n};\n","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport function isMultipleLines(string) {\n return string.trim().split('\\n').length > 1;\n}\n\nexport function repeat(string, n) {\n return Array(n + 1).join(string);\n}\n\nexport function wordSelectionStart(text, i) {\n let index = i;\n\n while (text[index] && text[index - 1] != null && !text[index - 1].match(/\\s/)) {\n index--;\n }\n\n return index;\n}\n\nexport function wordSelectionEnd(text, i, multiline) {\n let index = i;\n const breakpoint = multiline ? /\\n/ : /\\s/;\n\n while (text[index] && !text[index].match(breakpoint)) {\n index++;\n }\n\n return index;\n}\n\nexport function expandSelectedText(textarea, prefixToUse, suffixToUse) {\n let multiline = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (textarea.selectionStart === textarea.selectionEnd) {\n textarea.selectionStart = wordSelectionStart(textarea.value, textarea.selectionStart);\n textarea.selectionEnd = wordSelectionEnd(textarea.value, textarea.selectionEnd, multiline);\n } else {\n const expandedSelectionStart = textarea.selectionStart - prefixToUse.length;\n const expandedSelectionEnd = textarea.selectionEnd + suffixToUse.length;\n const beginsWithPrefix = textarea.value.slice(expandedSelectionStart, textarea.selectionStart) === prefixToUse;\n const endsWithSuffix = textarea.value.slice(textarea.selectionEnd, expandedSelectionEnd) === suffixToUse;\n\n if (beginsWithPrefix && endsWithSuffix) {\n textarea.selectionStart = expandedSelectionStart;\n textarea.selectionEnd = expandedSelectionEnd;\n }\n }\n\n return textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n}\n\nexport function newlinesToSurroundSelectedText(textarea) {\n const beforeSelection = textarea.value.slice(0, textarea.selectionStart);\n const afterSelection = textarea.value.slice(textarea.selectionEnd);\n const breaksBefore = beforeSelection.match(/\\n*$/);\n const breaksAfter = afterSelection.match(/^\\n*/);\n const newlinesBeforeSelection = breaksBefore ? breaksBefore[0].length : 0;\n const newlinesAfterSelection = breaksAfter ? breaksAfter[0].length : 0;\n let newlinesToAppend;\n let newlinesToPrepend;\n\n if (beforeSelection.match(/\\S/) && newlinesBeforeSelection < 2) {\n newlinesToAppend = repeat('\\n', 2 - newlinesBeforeSelection);\n }\n\n if (afterSelection.match(/\\S/) && newlinesAfterSelection < 2) {\n newlinesToPrepend = repeat('\\n', 2 - newlinesAfterSelection);\n }\n\n if (newlinesToAppend == null) {\n newlinesToAppend = '';\n }\n\n if (newlinesToPrepend == null) {\n newlinesToPrepend = '';\n }\n\n return {\n newlinesToAppend,\n newlinesToPrepend\n };\n}\n\nexport const blockStyle = (textarea, arg) => {\n let newlinesToAppend;\n let newlinesToPrepend;\n const { prefix, suffix, blockPrefix, blockSuffix, replaceNext, prefixSpace, scanFor, surroundWithNewlines } = arg;\n const originalSelectionStart = textarea.selectionStart;\n const originalSelectionEnd = textarea.selectionEnd;\n let selectedText = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let prefixToUse = isMultipleLines(selectedText) && blockPrefix.length > 0 ? `${blockPrefix}\\n` : prefix;\n let suffixToUse = isMultipleLines(selectedText) && blockSuffix.length > 0 ? `\\n${blockSuffix}` : suffix;\n\n if (prefixSpace) {\n const beforeSelection = textarea.value[textarea.selectionStart - 1];\n if (textarea.selectionStart !== 0 && beforeSelection != null && !beforeSelection.match(/\\s/)) {\n prefixToUse = ` ${prefixToUse}`;\n }\n }\n\n selectedText = expandSelectedText(textarea, prefixToUse, suffixToUse, arg.multiline);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const hasReplaceNext = replaceNext.length > 0 && suffixToUse.indexOf(replaceNext) > -1 && selectedText.length > 0;\n\n if (surroundWithNewlines) {\n const ref = newlinesToSurroundSelectedText(textarea);\n newlinesToAppend = ref.newlinesToAppend;\n newlinesToPrepend = ref.newlinesToPrepend;\n prefixToUse = newlinesToAppend + prefix;\n suffixToUse += newlinesToPrepend;\n }\n\n if (selectedText.startsWith(prefixToUse) && selectedText.endsWith(suffixToUse)) {\n const replacementText = selectedText.slice(prefixToUse.length, selectedText.length - suffixToUse.length);\n if (originalSelectionStart === originalSelectionEnd) {\n let position = originalSelectionStart - prefixToUse.length;\n position = Math.max(position, selectionStart);\n position = Math.min(position, selectionStart + replacementText.length);\n selectionStart = selectionEnd = position;\n }\n else {\n selectionEnd = selectionStart + replacementText.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (!hasReplaceNext) {\n let replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = originalSelectionStart + prefixToUse.length;\n selectionEnd = originalSelectionEnd + prefixToUse.length;\n const whitespaceEdges = selectedText.match(/^\\s*|\\s*$/g);\n if (arg.trimFirst && whitespaceEdges) {\n const leadingWhitespace = whitespaceEdges[0] || '';\n const trailingWhitespace = whitespaceEdges[1] || '';\n replacementText = leadingWhitespace + prefixToUse + selectedText.trim() + suffixToUse + trailingWhitespace;\n selectionStart += leadingWhitespace.length;\n selectionEnd -= trailingWhitespace.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (scanFor.length > 0 && selectedText.match(scanFor)) {\n suffixToUse = suffixToUse.replace(replaceNext, selectedText);\n const replacementText = prefixToUse + suffixToUse;\n selectionStart = selectionEnd = selectionStart + prefixToUse.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else {\n const replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = selectionStart + prefixToUse.length + selectedText.length + suffixToUse.indexOf(replaceNext);\n selectionEnd = selectionStart + replaceNext.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n}\n\nexport const multilineStyle = (textarea, arg) => {\n const { prefix, suffix, surroundWithNewlines } = arg;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const lines = text.split('\\n');\n const undoStyle = lines.every(line => line.startsWith(prefix) && line.endsWith(suffix));\n if (undoStyle) {\n text = lines.map(line => line.slice(prefix.length, line.length - suffix.length)).join('\\n');\n selectionEnd = selectionStart + text.length;\n }\n else {\n text = lines.map(line => prefix + line + suffix).join('\\n');\n if (surroundWithNewlines) {\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart += newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n }\n return { text, selectionStart, selectionEnd };\n}\n\nexport const orderedList = (textarea) => {\n const orderedListRegex = /^\\d+\\.\\s+/;\n const noInitialSelection = textarea.selectionStart === textarea.selectionEnd;\n let selectionEnd;\n let selectionStart;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let textToUnstyle = text;\n let lines = text.split('\\n');\n let startOfLine, endOfLine;\n if (noInitialSelection) {\n const linesBefore = textarea.value.slice(0, textarea.selectionStart).split(/\\n/);\n startOfLine = textarea.selectionStart - linesBefore[linesBefore.length - 1].length;\n endOfLine = wordSelectionEnd(textarea.value, textarea.selectionStart, true);\n textToUnstyle = textarea.value.slice(startOfLine, endOfLine);\n }\n const linesToUnstyle = textToUnstyle.split('\\n');\n const undoStyling = linesToUnstyle.every(line => orderedListRegex.test(line));\n if (undoStyling) {\n lines = linesToUnstyle.map(line => line.replace(orderedListRegex, ''));\n text = lines.join('\\n');\n if (noInitialSelection && startOfLine && endOfLine) {\n const lengthDiff = linesToUnstyle[0].length - lines[0].length;\n selectionStart = selectionEnd = textarea.selectionStart - lengthDiff;\n textarea.selectionStart = startOfLine;\n textarea.selectionEnd = endOfLine;\n }\n }\n else {\n lines = (function () {\n let i;\n let len;\n let index;\n const results = [];\n for (index = i = 0, len = lines.length; i < len; index = ++i) {\n const line = lines[index];\n results.push(`${index + 1}. ${line}`);\n }\n return results;\n })();\n text = lines.join('\\n');\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart = textarea.selectionStart + newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n if (noInitialSelection)\n selectionStart = selectionEnd;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n return { text, selectionStart, selectionEnd };\n}\n","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nimport insertText from './insertText';\nimport { blockStyle, isMultipleLines, multilineStyle, orderedList } from './styles';\n\nexport const styleSelectedText = (textarea, styleArgs) => {\n const text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let result;\n if (styleArgs.orderedList) {\n result = orderedList(textarea);\n }\n else if (styleArgs.multiline && isMultipleLines(text)) {\n result = multilineStyle(textarea, styleArgs);\n }\n else {\n result = blockStyle(textarea, styleArgs);\n }\n\n insertText(textarea, result);\n};\n\nexport default (button, stylesToApply) => {\n const toolbar = button.parentElement;\n\n const defaults = {\n prefix: '',\n suffix: '',\n blockPrefix: '',\n blockSuffix: '',\n multiline: false,\n replaceNext: '',\n prefixSpace: false,\n scanFor: '',\n surroundWithNewlines: false,\n orderedList: false,\n trimFirst: false\n };\n\n const style = Object.assign({}, defaults, stylesToApply);\n\n const field = document.getElementById(toolbar.dataset.for);\n\n if (field) {\n field.focus();\n styleSelectedText(field, style);\n }\n}\n","import Component from 'flarum/Component';\nimport icon from 'flarum/helpers/icon';\nimport apply from '../util/apply';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nexport default class MarkdownButton extends Component {\n config(isInitialized) {\n if (isInitialized) return;\n\n this.$().tooltip();\n }\n\n view() {\n return ;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.click();\n }\n }\n\n click() {\n return apply(this.element, this.props.style);\n }\n\n title() {\n let tooltip = this.props.title;\n\n if (this.props.hotkey) tooltip += ` <${modifierKey}-${this.props.hotkey}>`;\n\n return tooltip;\n }\n}\n","/*!\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 { extend } from 'flarum/extend';\nimport TextEditor from 'flarum/components/TextEditor';\nimport MarkdownArea from 'mdarea';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\n\napp.initializers.add('flarum-markdown', function(app) {\n let index = 1;\n\n extend(TextEditor.prototype, 'init', function() {\n this.textareaId = 'textarea'+(index++);\n });\n\n extend(TextEditor.prototype, 'view', function(vdom) {\n vdom.children[0].attrs.id = this.textareaId;\n });\n\n extend(TextEditor.prototype, 'configTextarea', function(value, element, isInitialized, context) {\n if (isInitialized) return;\n\n const editor = new MarkdownArea(element, {\n keyMap: {\n indent: ['Ctrl+m'],\n outdent: ['Ctrl+M']\n }\n });\n\n context.onunload = function() {\n editor.destroy();\n };\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function(items) {\n const tooltip = name => app.translator.trans(`flarum-markdown.forum.composer.${name}_tooltip`);\n\n items.add('markdown', (\n \n \n \n \n ', multiline: true, surroundWithNewlines: true }} />\n \n \n \n \n \n \n ), 100);\n });\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/external \"flarum.core.compat['extend']\"","webpack://@flarum/markdown/external \"flarum.core.compat['components/TextEditor']\"","webpack://@flarum/markdown/external \"flarum.core.compat['Component']\"","webpack://@flarum/markdown/./node_modules/mdarea/mdarea.min.js","webpack://@flarum/markdown/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/./src/forum/components/MarkdownToolbar.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/markdown/./src/forum/util/insertText.js","webpack://@flarum/markdown/./src/forum/util/styles.js","webpack://@flarum/markdown/./src/forum/util/apply.js","webpack://@flarum/markdown/./src/forum/components/MarkdownButton.js","webpack://@flarum/markdown/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","self","test","navigator","platform","u","f","y","g","_","v","k","enter","indent","outdent","inline","e","this","_options","keyMap","Array","isArray","toString","trim","split","push","apply","map","action","forEach","ctrlKey","altKey","shiftKey","metaKey","length","join","_reOutdent","RegExp","_handleKey","setElement","toLowerCase","b","selectionStart","selectionEnd","arguments","window","InputEvent","dispatchEvent","x","replace","constructor","getElement","_elem","removeEventListener","addEventListener","getValue","setValue","destroy","defaultPrevented","find","substring","a","h","lastIndexOf","line","offset","prefix","exec","charAt","parseInt","slice","preventDefault","_inheritsLoose","subClass","superClass","__proto__","modifierKey","userAgent","match","MarkdownToolbar","oncreate","vnode","document","getElementById","attrs","for","shortcut","view","id","data-for","style","display","children","event","button","element","querySelector","click","Component","_extends","assign","target","source","canInsertText","isMultipleLines","string","repeat","wordSelectionStart","text","index","wordSelectionEnd","multiline","breakpoint","newlinesToSurroundSelectedText","textarea","newlinesToAppend","newlinesToPrepend","beforeSelection","afterSelection","breaksBefore","breaksAfter","newlinesBeforeSelection","newlinesAfterSelection","blockStyle","arg","suffix","blockPrefix","blockSuffix","replaceNext","prefixSpace","scanFor","surroundWithNewlines","originalSelectionStart","originalSelectionEnd","selectedText","prefixToUse","suffixToUse","undefined","expandedSelectionStart","expandedSelectionEnd","beginsWithPrefix","endsWithSuffix","expandSelectedText","hasReplaceNext","indexOf","ref","startsWith","endsWith","replacementText","position","Math","max","min","whitespaceEdges","trimFirst","leadingWhitespace","trailingWhitespace","styleSelectedText","styleArgs","result","orderedList","startOfLine","endOfLine","orderedListRegex","noInitialSelection","textToUnstyle","lines","linesBefore","linesToUnstyle","every","lengthDiff","len","results","multilineStyle","before","after","contentEditable","execCommand","error","createEvent","initEvent","setSelectionRange","insertText","MarkdownButton","$","tooltip","className","title","data-hotkey","hotkey","onclick","onkeydown","keydown","icon","stylesToApply","toolbar","parentElement","field","dataset","focus","app","initializers","add","extend","TextEditor","textareaId","vdom","editor","MarkdownArea","items","translator","trans"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/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,EAAC,EAAD,CAAgByH,MAAOF,EAAQ,QAASQ,KAAK,cAAcvG,MAAO,CAAExB,OAAQ,KAAM2D,OAAQ,KAAM6B,WAAW,GAAQmC,OAAO,MAC1H,EAAC,EAAD,CAAgBF,MAAOF,EAAQ,UAAWQ,KAAK,gBAAgBvG,MAAO,CAAExB,OAAQ,IAAK2D,OAAQ,IAAK6B,WAAW,GAAQmC,OAAO,MAC5H,EAAC,EAAD,CAAgBF,MAAOF,EAAQ,SAAUQ,KAAK,oBAAoBvG,MAAO,CAAExB,OAAQ,KAAM6C,WAAW,EAAMoB,sBAAsB,KAChI,EAAC,EAAD,CAAgBwD,MAAOF,EAAQ,QAASQ,KAAK,cAAcvG,MAAO,CAAExB,OAAQ,IAAK2D,OAAQ,IAAKC,YAAa,MAAOC,YAAa,SAC/H,EAAC,EAAD,CAAgB4D,MAAOF,EAAQ,QAASQ,KAAK,cAAcvG,MAAO,CAAExB,OAAQ,IAAK2D,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC1I,EAAC,EAAD,CAAgByD,MAAOF,EAAQ,SAAUQ,KAAK,eAAevG,MAAO,CAAExB,OAAQ,KAAM2D,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC7I,EAAC,EAAD,CAAgByD,MAAOF,EAAQ,kBAAmBQ,KAAK,iBAAiBvG,MAAO,CAAExB,OAAQ,KAAM6C,WAAW,EAAMoB,sBAAsB,KACtI,EAAC,EAAD,CAAgBwD,MAAOF,EAAQ,gBAAiBQ,KAAK,iBAAiBvG,MAAO,CAAExB,OAAQ,MAAO6C,WAAW,EAAMiD,aAAa,MAE7H","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['Component'];","!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&module.exports?module.exports=t():e.MarkdownArea=t()}(\"undefined\"!=typeof self?self:this,function(){var n=/mac|iphone|ipad|ipod/i.test(navigator.platform)?\"metaKey\":\"ctrlKey\",u=/[*_]/,d=/^[ \\t]*(?:(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?|>[ \\t]*)*(?::[ \\t]*)?/,f=/[-=\\s\"'`<>\\[\\](){}+*^$\\\\.|]$/,p=/(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?$/,y=/^(?:\\n|$)/,i=/[-+*\\[\\]x\\d.]/g,s=/[^ \\t]/g,m=/(\\d+)\\.(?=[ \\t]+$)/,g=/(?:(?:^[ \\t]+)?(?:[-+*]|\\d+\\.|[>:])(?:[ \\t]+\\[[ x]])?[ \\t]*|^[ \\t]+)$/,c=/^(?!$)/gm,_={\"`\":/^``$/m,\"~\":/^~~$/m},v={\"[\":\"]\",\"(\":\")\",\"{\":\"}\",\"<\":\">\"},k={\"]\":\"[\",\")\":\"(\",\"}\":\"{\",\">\":\"<\"},r={enter:[\"Enter\",\"Shift+Enter\"],indent:[\"Tab\",\"Cmd+m\"],outdent:[\"Shift+Tab\",\"Cmd+Shift+m\"],inline:['\"',\"'\",\"`\",\"*\",\"_\",\"[\",\"]\",\"(\",\")\",\"{\",\"}\",\"<\",\">\"]};function e(e,t){var n,i;this._options=((n=t)||(n={}),n.keyMap=function(e){e||(e={});var n={},t=[];for(var i in r)if(r.hasOwnProperty(i)){var s=e[i]||r[i];Array.isArray(s)||(s=s.toString().trim().split(/\\s*[|,]\\s*/g)),t.push.apply(t,s.map(function(e){return(e=l(e)).key in n||(n[e.key]=0),++n[e.key],{key:e,action:i}}))}return t.forEach(function(e){var t;1\n {vnode.children}\n ;\n }\n\n shortcut(event) {\n if ((event.metaKey && modifierKey === 'Meta') || (event.ctrlKey && modifierKey === 'Control')) {\n const button = this.element.querySelector(`[data-hotkey=\"${event.key}\"]`);\n\n if (button) {\n button.click();\n event.preventDefault()\n }\n }\n }\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport let canInsertText = null;\n\nexport default (textarea, { text, selectionStart, selectionEnd }) => {\n const originalSelectionStart = textarea.selectionStart;\n const before = textarea.value.slice(0, originalSelectionStart);\n const after = textarea.value.slice(textarea.selectionEnd);\n\n if (canInsertText === null || canInsertText === true) {\n textarea.contentEditable = 'true';\n try {\n canInsertText = document.execCommand('insertText', false, text);\n }\n catch (error) {\n canInsertText = false;\n }\n textarea.contentEditable = 'false';\n }\n if (canInsertText && !textarea.value.slice(0, textarea.selectionStart).endsWith(text)) {\n canInsertText = false;\n }\n if (!canInsertText) {\n try {\n document.execCommand('ms-beginUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n textarea.value = before + text + after;\n try {\n document.execCommand('ms-endUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n\n // fire custom event, works on IE\n const event = document.createEvent('Event');\n\n event.initEvent('input', true, true);\n\n textarea.dispatchEvent(event);\n }\n if (selectionStart != null && selectionEnd != null) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n else {\n textarea.setSelectionRange(originalSelectionStart, textarea.selectionEnd);\n }\n};\n","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport function isMultipleLines(string) {\n return string.trim().split('\\n').length > 1;\n}\n\nexport function repeat(string, n) {\n return Array(n + 1).join(string);\n}\n\nexport function wordSelectionStart(text, i) {\n let index = i;\n\n while (text[index] && text[index - 1] != null && !text[index - 1].match(/\\s/)) {\n index--;\n }\n\n return index;\n}\n\nexport function wordSelectionEnd(text, i, multiline) {\n let index = i;\n const breakpoint = multiline ? /\\n/ : /\\s/;\n\n while (text[index] && !text[index].match(breakpoint)) {\n index++;\n }\n\n return index;\n}\n\nexport function expandSelectedText(textarea, prefixToUse, suffixToUse) {\n let multiline = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (textarea.selectionStart === textarea.selectionEnd) {\n textarea.selectionStart = wordSelectionStart(textarea.value, textarea.selectionStart);\n textarea.selectionEnd = wordSelectionEnd(textarea.value, textarea.selectionEnd, multiline);\n } else {\n const expandedSelectionStart = textarea.selectionStart - prefixToUse.length;\n const expandedSelectionEnd = textarea.selectionEnd + suffixToUse.length;\n const beginsWithPrefix = textarea.value.slice(expandedSelectionStart, textarea.selectionStart) === prefixToUse;\n const endsWithSuffix = textarea.value.slice(textarea.selectionEnd, expandedSelectionEnd) === suffixToUse;\n\n if (beginsWithPrefix && endsWithSuffix) {\n textarea.selectionStart = expandedSelectionStart;\n textarea.selectionEnd = expandedSelectionEnd;\n }\n }\n\n return textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n}\n\nexport function newlinesToSurroundSelectedText(textarea) {\n const beforeSelection = textarea.value.slice(0, textarea.selectionStart);\n const afterSelection = textarea.value.slice(textarea.selectionEnd);\n const breaksBefore = beforeSelection.match(/\\n*$/);\n const breaksAfter = afterSelection.match(/^\\n*/);\n const newlinesBeforeSelection = breaksBefore ? breaksBefore[0].length : 0;\n const newlinesAfterSelection = breaksAfter ? breaksAfter[0].length : 0;\n let newlinesToAppend;\n let newlinesToPrepend;\n\n if (beforeSelection.match(/\\S/) && newlinesBeforeSelection < 2) {\n newlinesToAppend = repeat('\\n', 2 - newlinesBeforeSelection);\n }\n\n if (afterSelection.match(/\\S/) && newlinesAfterSelection < 2) {\n newlinesToPrepend = repeat('\\n', 2 - newlinesAfterSelection);\n }\n\n if (newlinesToAppend == null) {\n newlinesToAppend = '';\n }\n\n if (newlinesToPrepend == null) {\n newlinesToPrepend = '';\n }\n\n return {\n newlinesToAppend,\n newlinesToPrepend\n };\n}\n\nexport const blockStyle = (textarea, arg) => {\n let newlinesToAppend;\n let newlinesToPrepend;\n const { prefix, suffix, blockPrefix, blockSuffix, replaceNext, prefixSpace, scanFor, surroundWithNewlines } = arg;\n const originalSelectionStart = textarea.selectionStart;\n const originalSelectionEnd = textarea.selectionEnd;\n let selectedText = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let prefixToUse = isMultipleLines(selectedText) && blockPrefix.length > 0 ? `${blockPrefix}\\n` : prefix;\n let suffixToUse = isMultipleLines(selectedText) && blockSuffix.length > 0 ? `\\n${blockSuffix}` : suffix;\n\n if (prefixSpace) {\n const beforeSelection = textarea.value[textarea.selectionStart - 1];\n if (textarea.selectionStart !== 0 && beforeSelection != null && !beforeSelection.match(/\\s/)) {\n prefixToUse = ` ${prefixToUse}`;\n }\n }\n\n selectedText = expandSelectedText(textarea, prefixToUse, suffixToUse, arg.multiline);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const hasReplaceNext = replaceNext.length > 0 && suffixToUse.indexOf(replaceNext) > -1 && selectedText.length > 0;\n\n if (surroundWithNewlines) {\n const ref = newlinesToSurroundSelectedText(textarea);\n newlinesToAppend = ref.newlinesToAppend;\n newlinesToPrepend = ref.newlinesToPrepend;\n prefixToUse = newlinesToAppend + prefix;\n suffixToUse += newlinesToPrepend;\n }\n\n if (selectedText.startsWith(prefixToUse) && selectedText.endsWith(suffixToUse)) {\n const replacementText = selectedText.slice(prefixToUse.length, selectedText.length - suffixToUse.length);\n if (originalSelectionStart === originalSelectionEnd) {\n let position = originalSelectionStart - prefixToUse.length;\n position = Math.max(position, selectionStart);\n position = Math.min(position, selectionStart + replacementText.length);\n selectionStart = selectionEnd = position;\n }\n else {\n selectionEnd = selectionStart + replacementText.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (!hasReplaceNext) {\n let replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = originalSelectionStart + prefixToUse.length;\n selectionEnd = originalSelectionEnd + prefixToUse.length;\n const whitespaceEdges = selectedText.match(/^\\s*|\\s*$/g);\n if (arg.trimFirst && whitespaceEdges) {\n const leadingWhitespace = whitespaceEdges[0] || '';\n const trailingWhitespace = whitespaceEdges[1] || '';\n replacementText = leadingWhitespace + prefixToUse + selectedText.trim() + suffixToUse + trailingWhitespace;\n selectionStart += leadingWhitespace.length;\n selectionEnd -= trailingWhitespace.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (scanFor.length > 0 && selectedText.match(scanFor)) {\n suffixToUse = suffixToUse.replace(replaceNext, selectedText);\n const replacementText = prefixToUse + suffixToUse;\n selectionStart = selectionEnd = selectionStart + prefixToUse.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else {\n const replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = selectionStart + prefixToUse.length + selectedText.length + suffixToUse.indexOf(replaceNext);\n selectionEnd = selectionStart + replaceNext.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n}\n\nexport const multilineStyle = (textarea, arg) => {\n const { prefix, suffix, surroundWithNewlines } = arg;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const lines = text.split('\\n');\n const undoStyle = lines.every(line => line.startsWith(prefix) && line.endsWith(suffix));\n if (undoStyle) {\n text = lines.map(line => line.slice(prefix.length, line.length - suffix.length)).join('\\n');\n selectionEnd = selectionStart + text.length;\n }\n else {\n text = lines.map(line => prefix + line + suffix).join('\\n');\n if (surroundWithNewlines) {\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart += newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n }\n return { text, selectionStart, selectionEnd };\n}\n\nexport const orderedList = (textarea) => {\n const orderedListRegex = /^\\d+\\.\\s+/;\n const noInitialSelection = textarea.selectionStart === textarea.selectionEnd;\n let selectionEnd;\n let selectionStart;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let textToUnstyle = text;\n let lines = text.split('\\n');\n let startOfLine, endOfLine;\n if (noInitialSelection) {\n const linesBefore = textarea.value.slice(0, textarea.selectionStart).split(/\\n/);\n startOfLine = textarea.selectionStart - linesBefore[linesBefore.length - 1].length;\n endOfLine = wordSelectionEnd(textarea.value, textarea.selectionStart, true);\n textToUnstyle = textarea.value.slice(startOfLine, endOfLine);\n }\n const linesToUnstyle = textToUnstyle.split('\\n');\n const undoStyling = linesToUnstyle.every(line => orderedListRegex.test(line));\n if (undoStyling) {\n lines = linesToUnstyle.map(line => line.replace(orderedListRegex, ''));\n text = lines.join('\\n');\n if (noInitialSelection && startOfLine && endOfLine) {\n const lengthDiff = linesToUnstyle[0].length - lines[0].length;\n selectionStart = selectionEnd = textarea.selectionStart - lengthDiff;\n textarea.selectionStart = startOfLine;\n textarea.selectionEnd = endOfLine;\n }\n }\n else {\n lines = (function () {\n let i;\n let len;\n let index;\n const results = [];\n for (index = i = 0, len = lines.length; i < len; index = ++i) {\n const line = lines[index];\n results.push(`${index + 1}. ${line}`);\n }\n return results;\n })();\n text = lines.join('\\n');\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart = textarea.selectionStart + newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n if (noInitialSelection)\n selectionStart = selectionEnd;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n return { text, selectionStart, selectionEnd };\n}\n","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nimport insertText from './insertText';\nimport { blockStyle, isMultipleLines, multilineStyle, orderedList } from './styles';\n\nexport const styleSelectedText = (textarea, styleArgs) => {\n const text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let result;\n if (styleArgs.orderedList) {\n result = orderedList(textarea);\n }\n else if (styleArgs.multiline && isMultipleLines(text)) {\n result = multilineStyle(textarea, styleArgs);\n }\n else {\n result = blockStyle(textarea, styleArgs);\n }\n\n insertText(textarea, result);\n};\n\nexport default (button, stylesToApply) => {\n const toolbar = button.parentElement;\n\n const defaults = {\n prefix: '',\n suffix: '',\n blockPrefix: '',\n blockSuffix: '',\n multiline: false,\n replaceNext: '',\n prefixSpace: false,\n scanFor: '',\n surroundWithNewlines: false,\n orderedList: false,\n trimFirst: false\n };\n\n const style = Object.assign({}, defaults, stylesToApply);\n\n const field = document.getElementById(toolbar.dataset.for);\n\n if (field) {\n field.focus();\n styleSelectedText(field, style);\n }\n}\n","import Component from 'flarum/Component';\nimport icon from 'flarum/helpers/icon';\nimport apply from '../util/apply';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.$().tooltip();\n }\n\n view() {\n return (\n \n );\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.click();\n }\n }\n\n click() {\n return apply(this.element, this.attrs.style);\n }\n\n title() {\n let tooltip = this.attrs.title;\n\n if (this.attrs.hotkey) tooltip += ` <${modifierKey}-${this.attrs.hotkey}>`;\n\n return tooltip;\n }\n}\n","/*!\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 { extend } from 'flarum/extend';\nimport TextEditor from 'flarum/components/TextEditor';\nimport MarkdownArea from 'mdarea';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\n\napp.initializers.add('flarum-markdown', function(app) {\n let index = 1;\n\n extend(TextEditor.prototype, 'oninit', function() {\n this.textareaId = 'textarea'+(index++);\n });\n\n extend(TextEditor.prototype, 'view', function(vdom) {\n vdom.children[0].attrs.id = this.textareaId;\n });\n\n extend(TextEditor.prototype, 'oncreate', function() {\n this.editor = new MarkdownArea(this.$('textarea')[0], {\n keyMap: {\n indent: ['Ctrl+m'],\n outdent: ['Ctrl+M']\n }\n });\n });\n\n extend(TextEditor.prototype, 'onremove', function () {\n this.editor.destroy();\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function(items) {\n const tooltip = name => app.translator.trans(`flarum-markdown.forum.composer.${name}_tooltip`);\n\n items.add('markdown', (\n \n \n \n \n ', multiline: true, surroundWithNewlines: true }} />\n \n \n \n \n \n \n ), 100);\n });\n});\n"],"sourceRoot":""} \ No newline at end of file