diff --git a/extensions/markdown/js/dist/forum.js b/extensions/markdown/js/dist/forum.js index 9324e4338..5af0a98c0 100644 --- a/extensions/markdown/js/dist/forum.js +++ b/extensions/markdown/js/dist/forum.js @@ -1,2 +1,2 @@ -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=6)}([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){e.exports=flarum.core.compat["helpers/icon"]},function(e,t,n){e.exports=function(){"use strict";const e=/^[ \t]*(?:(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?|>[ \t]*)*(?::[ \t]*)?/,t=/(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?$/,n=/[-+*\[\]x\d.]/g,i=/[^ \t]/g,r=/(\d+)\.(?=[ \t]+$)/,o=/(?:(?:^[ \t]+)?(?:[-+*]|\d+\.|[>:])(?:[ \t]+\[[ x]])?[ \t]*|^[ \t]+)$/,s=/[*_]/,l=/[-=\s"'`<>\[\](){}+*^$\\.|]$/,a=/^(?:\n|$)/,c=/^(?!$)/gm,u={"`":/^``$/m,"~":/^~~$/m},d={"[":"]","(":")","{":"}","<":">"},f={"]":"[",")":"(","}":"{",">":"<"},h={enter:(n,i,s,l,c)=>{const u=s?null:function(t){const n=t.lastIndexOf("\n")+1,i=t.substring(n),r=e.exec(i);return{line:i,offset:n,prefix:r&&r[0]}}(i);if(u)if(u.line&&u.line.charAt(u.line.length-1)in d){const e=u.prefix?y(u.prefix,!0):"";l="\n"+e+l,c.shiftKey||(i+="\n"+e+n.indent)}else u.prefix?!c.shiftKey&&u.prefix===u.line&&a.test(l)?i=i.substring(0,u.offset)+function(e){return e.replace(o,"")}(u.prefix):!c.shiftKey&&function(e){return t.test(e)}(u.prefix)?i+="\n"+function(e){return e.replace(r,(function(e,t){return parseInt(t)+1+"."}))}(u.prefix):i+="\n"+y(u.prefix,c.shiftKey):i+="\n";else i+="\n";return{v:i+l,s:i.length}},indent:(e,t,n,i)=>{let r=t.length,o=t.lastIndexOf("\n")+1;return o{let r=t.length,o=t.lastIndexOf("\n")+1;return on||r.key in d||i.charAt(0)!==r.key?n||("'"!==r.key||l.test(t))&&!(r.key in f)?!n&&r.key in u&&u[r.key].test(t)?{v:t+r.key+"language\n"+r.key+r.key+r.key+("\n"!==i.charAt(0)?"\n":"")+i,s:t.length+1,e:t.length+9}:r.key===t.slice(-1)&&r.key===i.slice(0,1)?{v:t.slice(0,-1)+n+i.slice(1),s:t.length-1,e:t.length-1+n.length}:{v:t+(f[r.key]||r.key)+n+(d[r.key]||r.key)+i,s:t.length+1,e:t.length+1+n.length}:{v:t+r.key+i,s:t.length+1}:{v:t+(s.test(r.key)?r.key+r.key:"")+i,s:t.length+1}};class p{constructor(e){this.options=e}handleKey(e,t,n,i){const r=this.options.keyMap.find(e=>function(e,t){for(const n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}(i,e.key));if(r&&h[r.action])return h[r.action](this.options,e,t,n,i)}}function y(e,t){return e.replace(t?i:n," ")}const m=/mac|iphone|ipad|ipod/i.test(navigator.platform),v=/firefox/i.test(navigator.userAgent),x=m?"metaKey":"ctrlKey",g={enter:["Enter","Shift+Enter"],indent:["Tab","Cmd+m"],outdent:["Shift+Tab","Cmd+Shift+m"],inline:['"',"'","`","*","_","[","]","(",")","{","}","<",">"]};function k(e={}){const t={},n=[];for(let i in g)if(g.hasOwnProperty(i)){let r=e[i]||g[i];Array.isArray(r)||(r=r.toString().trim().split(/\s*[|,]\s*/g)),n.push.apply(n,r.map(e=>{const n=b(e);return n.key in t||(t[n.key]=0),++t[n.key],{key:n,action:i}}))}return n.forEach(e=>{var n;t[e.key.key]>1&&("ctrlKey"in(n=e.key)||(n.ctrlKey=!1),"altKey"in n||(n.altKey=!1),"shiftKey"in n||(n.shiftKey=!1),"metaKey"in n||(n.metaKey=!1))}),n}function b(e){const t={};return e.trim().split(/\s*\+\s*/g).forEach((function(e){switch(e.toLowerCase()){case"cmd":t[x]=!0;break;case"ctrl":case"alt":case"shift":case"meta":t[e.toLowerCase()+"Key"]=!0;break;default:t.key=e}})),t}function E(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.contentEditable=!0,e.textContent="0",e.addEventListener("focus",()=>setTimeout(()=>e.blur(),0)),e.style.position="fixed",e.style.overflow="hidden",e.style.left="-1000px",e.style.top="50%",e.style.width=e.style.height="1px",e.style.opacity="0",e}function S(e,t=!1){return{s:e.selectionStart,e:e.selectionEnd,x:e.scrollLeft,y:e.scrollTop,v:e.value.replace(/\u00A0/g," "),c:t}}function w(e,t){e.lock=!0;const n=void 0===t.e?t.s:t.e,i=void 0===t.x?e.elem.scrollLeft:t.x,r=void 0===t.y?e.elem.scrollTop:t.y;C(e,{...t,e:n,x:i,y:r,c:!0},!0),e.lock=!1}function O(e,t){if(!e.elem||t.defaultPrevented)return;if(v&&t[x]&&"z"===t.key)return void e.elem.blur();const n=S(e.elem),i=n.v.substring(0,n.s),r=n.v.substring(n.s,n.e),o=n.v.substring(n.e);for(let n=0,s=e.options.extensions.length;ne.cleanup&&e.cleanup(this)),this.ed.elem.removeEventListener("input",this.ed.onInput),this.ed.elem.removeEventListener("keydown",this.ed.onKeyDown)),this.ed.elem=e,e.addEventListener("keydown",this.ed.onKeyDown),e.addEventListener("input",this.ed.onInput),L(this.ed),this.ed.options.extensions.forEach(e=>e.init&&e.init(this))}getValue(){return this.ed.elem.value.replace(/\u00A0/g," ")}setValue(e,t=!1){this.ed.elem.value=e,t||L(this.ed)}pushState(e){w(this.ed,e)}destroy(){return this.ed.options.extensions.forEach(e=>e.cleanup&&e.cleanup(this)),this.ed.elem.removeEventListener("keydown",this.ed.onKeyDown),this.ed.elem.removeEventListener("input",this.ed.onInput),this.ed.helper.removeEventListener("input",this.ed.onUndo),document.body.removeChild(this.ed.helper),this.ed.options.extensions.forEach(e=>e.destroy&&e.destroy()),Object.assign(this.ed,{elem:null,helper:null,options:null,reOutdent:null,onKeyDown:null,onInput:null,onUndo:null,history:null}),Object.assign(this,{ed:null}),null}}return function(e){e.version="v2.0.9"}(P||(P={})),P}()},function(e,t){e.exports=flarum.core.compat["utils/BasicEditorDriver"]},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n(1),o=n.n(r);function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var l=n(2),a=n.n(l),c=navigator.userAgent.match(/Macintosh/)?"Meta":"Control",u=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var n=t.prototype;return n.oncreate=function(t){e.prototype.oncreate.call(this,t),this.attrs.setShortcutHandler(this.shortcut.bind(this))},n.view=function(e){return m("div",{id:"MarkdownToolbar","data-for":this.attrs.for,style:{display:"inline-block"}},e.children)},n.shortcut=function(e){if(e.metaKey&&"Meta"===c||e.ctrlKey&&"Control"===c){var t=this.element.querySelector('[data-hotkey="'+e.key+'"]');t&&(t.click(),e.preventDefault())}},t}(a.a),d=n(3),f=n.n(d);function h(){return(h=Object.assign||function(e){for(var t=1;t1}function v(e,t){return Array(t+1).join(e)}function x(e,t){for(var n=t;e[n]&&null!=e[n-1]&&!e[n-1].match(/\s/);)n--;return n}function g(e,t,n){for(var i=t,r=n?/\n/:/\s/;e[i]&&!e[i].match(r);)i++;return i}function k(e){var t,n,i=e.value.slice(0,e.selectionStart),r=e.value.slice(e.selectionEnd),o=i.match(/\n*$/),s=r.match(/^\n*/),l=o?o[0].length:0,a=s?s[0].length:0;return i.match(/\S/)&&l<2&&(t=v("\n",2-l)),r.match(/\S/)&&a<2&&(n=v("\n",2-a)),null==t&&(t=""),null==n&&(n=""),{newlinesToAppend:t,newlinesToPrepend:n}}var b=function(e,t){var n=t.prefix,i=t.suffix,r=t.blockPrefix,o=t.blockSuffix,s=t.replaceNext,l=t.prefixSpace,a=t.scanFor,c=t.surroundWithNewlines,u=e.selectionStart,d=e.selectionEnd,f=e.value.slice(e.selectionStart,e.selectionEnd),h=y(f)&&r.length>0?r+"\n":n,p=y(f)&&o.length>0?"\n"+o:i;if(l){var m=e.value[e.selectionStart-1];0===e.selectionStart||null==m||m.match(/\s/)||(h=" "+h)}f=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.selectionStart===e.selectionEnd)e.selectionStart=x(e.value,e.selectionStart),e.selectionEnd=g(e.value,e.selectionEnd,i);else{var r=e.selectionStart-t.length,o=e.selectionEnd+n.length,s=e.value.slice(r,e.selectionStart)===t,l=e.value.slice(e.selectionEnd,o)===n;s&&l&&(e.selectionStart=r,e.selectionEnd=o)}return e.value.slice(e.selectionStart,e.selectionEnd)}(e,h,p,t.multiline);var v=e.selectionStart,b=e.selectionEnd,E=s.length>0&&p.indexOf(s)>-1&&f.length>0;if(c){var S=k(e);h=S.newlinesToAppend+n,p+=S.newlinesToPrepend}if(f.startsWith(h)&&f.endsWith(p)){var w=f.slice(h.length,f.length-p.length);if(u===d){var O=u-h.length;O=Math.max(O,v),v=b=O=Math.min(O,v+w.length)}else b=v+w.length;return{text:w,selectionStart:v,selectionEnd:b}}if(E)return a.length>0&&f.match(a)?{text:h+(p=p.replace(s,f)),selectionStart:v=b=v+h.length,selectionEnd:b}:{text:h+f+p,selectionStart:v=v+h.length+f.length+p.indexOf(s),selectionEnd:b=v+s.length};var K=h+f+p;v=u+h.length,b=d+h.length;var j=f.match(/^\s*|\s*$/g);if(t.trimFirst&&j){var L=j[0]||"",C=j[1]||"";K=L+h+f.trim()+p+C,v+=L.length,b-=C.length}return{text:K,selectionStart:v,selectionEnd:b}},E=function(e,t){var n,i=e.value.slice(e.selectionStart,e.selectionEnd);n=t.orderedList?function(e){var t,n,i,r,o=/^\d+\.\s+/,s=e.selectionStart===e.selectionEnd,l=e.value.slice(e.selectionStart,e.selectionEnd),a=l,c=l.split("\n");if(s){var u=e.value.slice(0,e.selectionStart).split(/\n/);i=e.selectionStart-u[u.length-1].length,r=g(e.value,e.selectionStart,!0),a=e.value.slice(i,r)}var d=a.split("\n");if(d.every((function(e){return o.test(e)}))){if(l=(c=d.map((function(e){return e.replace(o,"")}))).join("\n"),s&&i&&r){var f=d[0].length-c[0].length;n=t=e.selectionStart-f,e.selectionStart=i,e.selectionEnd=r}}else{l=(c=function(){var e,t,n,i=[];for(n=e=0,t=c.length;e"),e},t}(a.a),O=n(4),K=n.n(O),j=n(5),L=n.n(j),C=function(){function e(e,t,n){this.oninput=e,this.callInputListeners=t,this.onsubmit=n}return e.prototype.handleKey=function(e,t,n,i){var r=this;setTimeout((function(){if(r.oninput(i.target.value),(i.metaKey||i.ctrlKey)&&"Enter"===i.key)return r.onsubmit();r.callInputListeners(i)}))},e}(),T=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var n=t.prototype;return n.build=function(e,t){this.el.className=t.classNames.join(" "),this.el.disabled=t.disabled,this.el.placeholder=t.placeholder,this.el.value=t.value,this.el.id=t.textareaId,e.append(this.el);var n=function(e){t.inputListeners.forEach((function(e){e()})),e.redraw=!1};this.el.addEventListener("keydown",(function(e){return t.shortcutHandler.apply(t,arguments)})),this.el.addEventListener("input",(function(e){e instanceof CustomEvent&&(t.oninput(e.target.value),n(e))})),this.el.addEventListener("click",n),this.mdarea=new K.a(this.el,{keyMap:{indent:["Ctrl+m"],outdent:["Ctrl+M"],inline:[]},extensions:[new C(t.oninput,n,t.onsubmit)]})},n.destroy=function(){this.mdarea.destroy(),e.prototype.destroy.call(this)},t}(L.a),I=function(){};app.initializers.add("flarum-markdown",(function(e){var t=1;Object(i.extend)(o.a.prototype,"oninit",(function(){this.textareaId="textarea"+t++})),Object(i.override)(o.a.prototype,"buildEditor",(function(e,t){return new T(t,this.buildEditorParams())})),Object(i.extend)(o.a.prototype,"buildEditorParams",(function(e){e.textareaId=this.textareaId,e.shortcutHandler=I})),Object(i.extend)(o.a.prototype,"toolbarItems",(function(t){var n=function(t){return e.translator.trans("flarum-markdown.forum.composer."+t+"_tooltip")};t.add("markdown",m(u,{for:this.textareaId,setShortcutHandler:function(e){return I=e}},m(w,{title:n("header"),icon:"fas fa-heading",style:{prefix:"### "}}),m(w,{title:n("bold"),icon:"fas fa-bold",style:{prefix:"**",suffix:"**",trimFirst:!0},hotkey:"b"}),m(w,{title:n("italic"),icon:"fas fa-italic",style:{prefix:"_",suffix:"_",trimFirst:!0},hotkey:"i"}),m(w,{title:n("quote"),icon:"fas fa-quote-left",style:{prefix:"> ",multiline:!0,surroundWithNewlines:!0}}),m(w,{title:n("code"),icon:"fas fa-code",style:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"}}),m(w,{title:n("link"),icon:"fas fa-link",style:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(w,{title:n("image"),icon:"fas fa-image",style:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(w,{title:n("unordered_list"),icon:"fas fa-list-ul",style:{prefix:"- ",multiline:!0,surroundWithNewlines:!0}}),m(w,{title:n("ordered_list"),icon:"fas fa-list-ol",style:{prefix:"1. ",multiline:!0,orderedList:!0}})),100)}))}))}]); +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=6)}([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){e.exports=flarum.core.compat["helpers/icon"]},function(e,t,n){e.exports=function(){"use strict";const e=/^[ \t]*(?:(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?|>[ \t]*)*(?::[ \t]*)?/,t=/(?:[-+*]|\d+\.)[ \t]+(?:\[[ x]][ \t]+)?$/,n=/[-+*\[\]x\d.]/g,i=/[^ \t]/g,r=/(\d+)\.(?=[ \t]+$)/,o=/(?:(?:^[ \t]+)?(?:[-+*]|\d+\.|[>:])(?:[ \t]+\[[ x]])?[ \t]*|^[ \t]+)$/,s=/[*_]/,l=/[-=\s"'`<>\[\](){}+*^$\\.|]$/,a=/^(?:\n|$)/,c=/^(?!$)/gm,u={"`":/^``$/m,"~":/^~~$/m},d={"[":"]","(":")","{":"}","<":">"},f={"]":"[",")":"(","}":"{",">":"<"},h={enter:(n,i,s,l,c)=>{const u=s?null:function(t){const n=t.lastIndexOf("\n")+1,i=t.substring(n),r=e.exec(i);return{line:i,offset:n,prefix:r&&r[0]}}(i);if(u)if(u.line&&u.line.charAt(u.line.length-1)in d){const e=u.prefix?y(u.prefix,!0):"";l="\n"+e+l,c.shiftKey||(i+="\n"+e+n.indent)}else u.prefix?!c.shiftKey&&u.prefix===u.line&&a.test(l)?i=i.substring(0,u.offset)+function(e){return e.replace(o,"")}(u.prefix):!c.shiftKey&&function(e){return t.test(e)}(u.prefix)?i+="\n"+function(e){return e.replace(r,(function(e,t){return parseInt(t)+1+"."}))}(u.prefix):i+="\n"+y(u.prefix,c.shiftKey):i+="\n";else i+="\n";return{v:i+l,s:i.length}},indent:(e,t,n,i)=>{let r=t.length,o=t.lastIndexOf("\n")+1;return o{let r=t.length,o=t.lastIndexOf("\n")+1;return on||r.key in d||i.charAt(0)!==r.key?n||("'"!==r.key||l.test(t))&&!(r.key in f)?!n&&r.key in u&&u[r.key].test(t)?{v:t+r.key+"language\n"+r.key+r.key+r.key+("\n"!==i.charAt(0)?"\n":"")+i,s:t.length+1,e:t.length+9}:r.key===t.slice(-1)&&r.key===i.slice(0,1)?{v:t.slice(0,-1)+n+i.slice(1),s:t.length-1,e:t.length-1+n.length}:{v:t+(f[r.key]||r.key)+n+(d[r.key]||r.key)+i,s:t.length+1,e:t.length+1+n.length}:{v:t+r.key+i,s:t.length+1}:{v:t+(s.test(r.key)?r.key+r.key:"")+i,s:t.length+1}};class p{constructor(e){this.options=e}handleKey(e,t,n,i){const r=this.options.keyMap.find(e=>function(e,t){for(const n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}(i,e.key));if(r&&h[r.action])return h[r.action](this.options,e,t,n,i)}}function y(e,t){return e.replace(t?i:n," ")}const m=/mac|iphone|ipad|ipod/i.test(navigator.platform),v=/firefox/i.test(navigator.userAgent),x=m?"metaKey":"ctrlKey",g={enter:["Enter","Shift+Enter"],indent:["Tab","Cmd+m"],outdent:["Shift+Tab","Cmd+Shift+m"],inline:['"',"'","`","*","_","[","]","(",")","{","}","<",">"]};function k(e={}){const t={},n=[];for(let i in g)if(g.hasOwnProperty(i)){let r=e[i]||g[i];Array.isArray(r)||(r=r.toString().trim().split(/\s*[|,]\s*/g)),n.push.apply(n,r.map(e=>{const n=b(e);return n.key in t||(t[n.key]=0),++t[n.key],{key:n,action:i}}))}return n.forEach(e=>{var n;t[e.key.key]>1&&("ctrlKey"in(n=e.key)||(n.ctrlKey=!1),"altKey"in n||(n.altKey=!1),"shiftKey"in n||(n.shiftKey=!1),"metaKey"in n||(n.metaKey=!1))}),n}function b(e){const t={};return e.trim().split(/\s*\+\s*/g).forEach((function(e){switch(e.toLowerCase()){case"cmd":t[x]=!0;break;case"ctrl":case"alt":case"shift":case"meta":t[e.toLowerCase()+"Key"]=!0;break;default:t.key=e}})),t}function E(){const e=document.createElement("div");return e.setAttribute("aria-hidden","true"),e.tabIndex=-1,e.contentEditable=!0,e.textContent="0",e.addEventListener("focus",()=>setTimeout(()=>e.blur(),0)),e.style.position="fixed",e.style.overflow="hidden",e.style.left="-1000px",e.style.top="50%",e.style.width=e.style.height="1px",e.style.opacity="0",e}function S(e,t=!1){return{s:e.selectionStart,e:e.selectionEnd,x:e.scrollLeft,y:e.scrollTop,v:e.value.replace(/\u00A0/g," "),c:t}}function w(e,t){e.lock=!0;const n=void 0===t.e?t.s:t.e,i=void 0===t.x?e.elem.scrollLeft:t.x,r=void 0===t.y?e.elem.scrollTop:t.y;C(e,{...t,e:n,x:i,y:r,c:!0},!0),e.lock=!1}function O(e,t){if(!e.elem||t.defaultPrevented)return;if(v&&t[x]&&"z"===t.key)return void e.elem.blur();const n=S(e.elem),i=n.v.substring(0,n.s),r=n.v.substring(n.s,n.e),o=n.v.substring(n.e);for(let n=0,s=e.options.extensions.length;ne.cleanup&&e.cleanup(this)),this.ed.elem.removeEventListener("input",this.ed.onInput),this.ed.elem.removeEventListener("keydown",this.ed.onKeyDown)),this.ed.elem=e,e.addEventListener("keydown",this.ed.onKeyDown),e.addEventListener("input",this.ed.onInput),L(this.ed),this.ed.options.extensions.forEach(e=>e.init&&e.init(this))}getValue(){return this.ed.elem.value.replace(/\u00A0/g," ")}setValue(e,t=!1){this.ed.elem.value=e,t||L(this.ed)}pushState(e){w(this.ed,e)}destroy(){return this.ed.options.extensions.forEach(e=>e.cleanup&&e.cleanup(this)),this.ed.elem.removeEventListener("keydown",this.ed.onKeyDown),this.ed.elem.removeEventListener("input",this.ed.onInput),this.ed.helper.removeEventListener("input",this.ed.onUndo),document.body.removeChild(this.ed.helper),this.ed.options.extensions.forEach(e=>e.destroy&&e.destroy()),Object.assign(this.ed,{elem:null,helper:null,options:null,reOutdent:null,onKeyDown:null,onInput:null,onUndo:null,history:null}),Object.assign(this,{ed:null}),null}}return function(e){e.version="v2.0.9"}(P||(P={})),P}()},function(e,t){e.exports=flarum.core.compat["utils/BasicEditorDriver"]},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n(1),o=n.n(r);function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var l=n(2),a=n.n(l),c=navigator.userAgent.match(/Macintosh/)?"Meta":"Control",u=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var n=t.prototype;return n.oncreate=function(t){e.prototype.oncreate.call(this,t),this.attrs.setShortcutHandler(this.shortcut.bind(this))},n.view=function(e){return m("div",{id:"MarkdownToolbar","data-for":this.attrs.for,style:{display:"inline-block"}},e.children)},n.shortcut=function(e){if(e.metaKey&&"Meta"===c||e.ctrlKey&&"Control"===c){var t=this.element.querySelector('[data-hotkey="'+e.key+'"]');t&&(t.click(),e.preventDefault())}},t}(a.a),d=n(3),f=n.n(d);function h(){return(h=Object.assign||function(e){for(var t=1;t1}function v(e,t){return Array(t+1).join(e)}function x(e,t){for(var n=t;e[n]&&null!=e[n-1]&&!e[n-1].match(/\s/);)n--;return n}function g(e,t,n){for(var i=t,r=n?/\n/:/\s/;e[i]&&!e[i].match(r);)i++;return i}function k(e){var t,n,i=e.value.slice(0,e.selectionStart),r=e.value.slice(e.selectionEnd),o=i.match(/\n*$/),s=r.match(/^\n*/),l=o?o[0].length:0,a=s?s[0].length:0;return i.match(/\S/)&&l<2&&(t=v("\n",2-l)),r.match(/\S/)&&a<2&&(n=v("\n",2-a)),null==t&&(t=""),null==n&&(n=""),{newlinesToAppend:t,newlinesToPrepend:n}}var b=function(e,t){var n=t.prefix,i=t.suffix,r=t.blockPrefix,o=t.blockSuffix,s=t.replaceNext,l=t.prefixSpace,a=t.scanFor,c=t.surroundWithNewlines,u=e.selectionStart,d=e.selectionEnd,f=e.value.slice(e.selectionStart,e.selectionEnd),h=y(f)&&r.length>0?r+"\n":n,p=y(f)&&o.length>0?"\n"+o:i;if(l){var m=e.value[e.selectionStart-1];0===e.selectionStart||null==m||m.match(/\s/)||(h=" "+h)}f=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.selectionStart===e.selectionEnd)e.selectionStart=x(e.value,e.selectionStart),e.selectionEnd=g(e.value,e.selectionEnd,i);else{var r=e.selectionStart-t.length,o=e.selectionEnd+n.length,s=e.value.slice(r,e.selectionStart)===t,l=e.value.slice(e.selectionEnd,o)===n;s&&l&&(e.selectionStart=r,e.selectionEnd=o)}return e.value.slice(e.selectionStart,e.selectionEnd)}(e,h,p,t.multiline);var v=e.selectionStart,b=e.selectionEnd,E=s.length>0&&p.indexOf(s)>-1&&f.length>0;if(c){var S=k(e);h=S.newlinesToAppend+n,p+=S.newlinesToPrepend}if(f.startsWith(h)&&f.endsWith(p)){var w=f.slice(h.length,f.length-p.length);if(u===d){var O=u-h.length;O=Math.max(O,v),v=b=O=Math.min(O,v+w.length)}else b=v+w.length;return{text:w,selectionStart:v,selectionEnd:b}}if(E)return a.length>0&&f.match(a)?{text:h+(p=p.replace(s,f)),selectionStart:v=b=v+h.length,selectionEnd:b}:{text:h+f+p,selectionStart:v=v+h.length+f.length+p.indexOf(s),selectionEnd:b=v+s.length};var K=h+f+p;v=u+h.length,b=d+h.length;var j=f.match(/^\s*|\s*$/g);if(t.trimFirst&&j){var L=j[0]||"",C=j[1]||"";K=L+h+f.trim()+p+C,v+=L.length,b-=C.length}return{text:K,selectionStart:v,selectionEnd:b}},E=function(e,t){var n,i=e.value.slice(e.selectionStart,e.selectionEnd);n=t.orderedList?function(e){var t,n,i,r,o=/^\d+\.\s+/,s=e.selectionStart===e.selectionEnd,l=e.value.slice(e.selectionStart,e.selectionEnd),a=l,c=l.split("\n");if(s){var u=e.value.slice(0,e.selectionStart).split(/\n/);i=e.selectionStart-u[u.length-1].length,r=g(e.value,e.selectionStart,!0),a=e.value.slice(i,r)}var d=a.split("\n");if(d.every((function(e){return o.test(e)}))){if(l=(c=d.map((function(e){return e.replace(o,"")}))).join("\n"),s&&i&&r){var f=d[0].length-c[0].length;n=t=e.selectionStart-f,e.selectionStart=i,e.selectionEnd=r}}else{l=(c=function(){var e,t,n,i=[];for(n=e=0,t=c.length;e"),e},t}(a.a),O=n(4),K=n.n(O),j=n(5),L=n.n(j),C=function(){function e(e,t,n){this.oninput=e,this.callInputListeners=t,this.onsubmit=n}return e.prototype.handleKey=function(e,t,n,i){var r=this;setTimeout((function(){if(r.oninput(i.target.value),(i.metaKey||i.ctrlKey)&&"Enter"===i.key)return r.onsubmit();r.callInputListeners(i)}),25)},e}(),T=function(e){function t(){return e.apply(this,arguments)||this}s(t,e);var n=t.prototype;return n.build=function(e,t){this.el.className=t.classNames.join(" "),this.el.disabled=t.disabled,this.el.placeholder=t.placeholder,this.el.value=t.value,this.el.id=t.textareaId,e.append(this.el);var n=function(e){t.inputListeners.forEach((function(e){e()})),e.redraw=!1};this.el.addEventListener("keydown",(function(e){return t.shortcutHandler.apply(t,arguments)})),this.el.addEventListener("input",(function(e){e instanceof CustomEvent&&(t.oninput(e.target.value),n(e))})),this.el.addEventListener("click",n),this.mdarea=new K.a(this.el,{keyMap:{indent:["Ctrl+m"],outdent:["Ctrl+M"],inline:[]},extensions:[new C(t.oninput,n,t.onsubmit)]})},n.destroy=function(){this.mdarea.destroy(),e.prototype.destroy.call(this)},t}(L.a),I=function(){};app.initializers.add("flarum-markdown",(function(e){var t=1;Object(i.extend)(o.a.prototype,"oninit",(function(){this.textareaId="textarea"+t++})),Object(i.override)(o.a.prototype,"buildEditor",(function(e,t){return new T(t,this.buildEditorParams())})),Object(i.extend)(o.a.prototype,"buildEditorParams",(function(e){e.textareaId=this.textareaId,e.shortcutHandler=I})),Object(i.extend)(o.a.prototype,"toolbarItems",(function(t){var n=function(t){return e.translator.trans("flarum-markdown.forum.composer."+t+"_tooltip")};t.add("markdown",m(u,{for:this.textareaId,setShortcutHandler:function(e){return I=e}},m(w,{title:n("header"),icon:"fas fa-heading",style:{prefix:"### "}}),m(w,{title:n("bold"),icon:"fas fa-bold",style:{prefix:"**",suffix:"**",trimFirst:!0},hotkey:"b"}),m(w,{title:n("italic"),icon:"fas fa-italic",style:{prefix:"_",suffix:"_",trimFirst:!0},hotkey:"i"}),m(w,{title:n("quote"),icon:"fas fa-quote-left",style:{prefix:"> ",multiline:!0,surroundWithNewlines:!0}}),m(w,{title:n("code"),icon:"fas fa-code",style:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"}}),m(w,{title:n("link"),icon:"fas fa-link",style:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(w,{title:n("image"),icon:"fas fa-image",style:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"}}),m(w,{title:n("unordered_list"),icon:"fas fa-list-ul",style:{prefix:"- ",multiline:!0,surroundWithNewlines:!0}}),m(w,{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 8a84863a3..21829339e 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/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/markdown/./node_modules/mdarea/dist/index.min.js","webpack://@flarum/markdown/external \"flarum.core.compat['utils/BasicEditorDriver']\"","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/util/MarkdownAreaEditorDriver.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","e","u","a","h","f","enter","lastIndexOf","substring","exec","line","offset","prefix","charAt","length","shiftKey","indent","test","replace","parseInt","v","outdent","reOutdent","inline","slice","y","this","options","keyMap","find","action","navigator","platform","g","userAgent","x","k","b","Array","isArray","toString","trim","split","push","apply","map","E","forEach","ctrlKey","altKey","metaKey","toLowerCase","K","document","createElement","setAttribute","tabIndex","contentEditable","textContent","addEventListener","setTimeout","blur","style","position","overflow","left","top","width","height","opacity","w","selectionStart","selectionEnd","scrollLeft","scrollTop","L","lock","elem","T","A","defaultPrevented","extensions","handleKey","preventDefault","C","type","execCommand","O","idx","helper","state","history","S","I","$","splice","focus","assign","scrollTo","D","join","RegExp","ed","onKeyDown","onInput","onUndo","body","appendChild","setElement","cleanup","removeEventListener","init","removeChild","destroy","version","_inheritsLoose","subClass","superClass","constructor","__proto__","modifierKey","match","MarkdownToolbar","oncreate","vnode","attrs","setShortcutHandler","shortcut","view","id","data-for","for","display","children","event","button","element","querySelector","click","Component","_extends","target","arguments","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","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","error","createEvent","initEvent","dispatchEvent","setSelectionRange","insertText","MarkdownButton","tooltip","className","title","data-hotkey","hotkey","onclick","onkeydown","keydown","icon","stylesToApply","toolbar","parentElement","field","getElementById","dataset","MarkdownEditorFlarumExtension","oninput","callInputListeners","onsubmit","selection","postfix","evt","MarkdownAreaEditorDriver","build","dom","params","el","classNames","disabled","placeholder","textareaId","append","inputListeners","listener","redraw","shortcutHandler","CustomEvent","mdarea","MarkdownArea","BasicEditorDriver","app","initializers","add","extend","TextEditor","override","_","buildEditorParams","items","translator","trans","handler"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAi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D,CAAgBF,MAAOF,EAAQ,SAAUQ,KAAK,oBAAoBzK,MAAO,CAAElD,OAAQ,KAAM4I,WAAW,EAAMoB,sBAAsB,KAChI,EAAC,EAAD,CAAgBqD,MAAOF,EAAQ,QAASQ,KAAK,cAAczK,MAAO,CAAElD,OAAQ,IAAK0J,OAAQ,IAAKC,YAAa,MAAOC,YAAa,SAC/H,EAAC,EAAD,CAAgByD,MAAOF,EAAQ,QAASQ,KAAK,cAAczK,MAAO,CAAElD,OAAQ,IAAK0J,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC1I,EAAC,EAAD,CAAgBsD,MAAOF,EAAQ,SAAUQ,KAAK,eAAezK,MAAO,CAAElD,OAAQ,KAAM0J,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC7I,EAAC,EAAD,CAAgBsD,MAAOF,EAAQ,kBAAmBQ,KAAK,iBAAiBzK,MAAO,CAAElD,OAAQ,KAAM4I,WAAW,EAAMoB,sBAAsB,KACtI,EAAC,EAAD,CAAgBqD,MAAOF,EAAQ,gBAAiBQ,KAAK,iBAAiBzK,MAAO,CAAElD,OAAQ,MAAO4I,WAAW,EAAMgD,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 = 6);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['helpers/icon'];","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).MarkdownArea=t()}(this,(function(){\"use strict\";const e=/^[ \\t]*(?:(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?|>[ \\t]*)*(?::[ \\t]*)?/,t=/(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?$/,n=/[-+*\\[\\]x\\d.]/g,i=/[^ \\t]/g,s=/(\\d+)\\.(?=[ \\t]+$)/,o=/(?:(?:^[ \\t]+)?(?:[-+*]|\\d+\\.|[>:])(?:[ \\t]+\\[[ x]])?[ \\t]*|^[ \\t]+)$/,r=/[*_]/,l=/[-=\\s\"'`<>\\[\\](){}+*^$\\\\.|]$/,u=/^(?:\\n|$)/,c=/^(?!$)/gm,d={\"`\":/^``$/m,\"~\":/^~~$/m},a={\"[\":\"]\",\"(\":\")\",\"{\":\"}\",\"<\":\">\"},h={\"]\":\"[\",\")\":\"(\",\"}\":\"{\",\">\":\"<\"},f={enter:(n,i,r,l,c)=>{const d=r?null:function(t){const n=t.lastIndexOf(\"\\n\")+1,i=t.substring(n),s=e.exec(i);return{line:i,offset:n,prefix:s&&s[0]}}(i);if(d)if(d.line&&d.line.charAt(d.line.length-1)in a){const e=d.prefix?p(d.prefix,!0):\"\";l=\"\\n\"+e+l,c.shiftKey||(i+=\"\\n\"+e+n.indent)}else d.prefix?!c.shiftKey&&d.prefix===d.line&&u.test(l)?i=i.substring(0,d.offset)+function(e){return e.replace(o,\"\")}(d.prefix):!c.shiftKey&&function(e){return t.test(e)}(d.prefix)?i+=\"\\n\"+function(e){return e.replace(s,(function(e,t){return parseInt(t)+1+\".\"}))}(d.prefix):i+=\"\\n\"+p(d.prefix,c.shiftKey):i+=\"\\n\";else i+=\"\\n\";return{v:i+l,s:i.length}},indent:(e,t,n,i)=>{let s=t.length,o=t.lastIndexOf(\"\\n\")+1;return o{let s=t.length,o=t.lastIndexOf(\"\\n\")+1;return on||s.key in a||i.charAt(0)!==s.key?n||(\"'\"!==s.key||l.test(t))&&!(s.key in h)?!n&&s.key in d&&d[s.key].test(t)?{v:t+s.key+\"language\\n\"+s.key+s.key+s.key+(\"\\n\"!==i.charAt(0)?\"\\n\":\"\")+i,s:t.length+1,e:t.length+9}:s.key===t.slice(-1)&&s.key===i.slice(0,1)?{v:t.slice(0,-1)+n+i.slice(1),s:t.length-1,e:t.length-1+n.length}:{v:t+(h[s.key]||s.key)+n+(a[s.key]||s.key)+i,s:t.length+1,e:t.length+1+n.length}:{v:t+s.key+i,s:t.length+1}:{v:t+(r.test(s.key)?s.key+s.key:\"\")+i,s:t.length+1}};class y{constructor(e){this.options=e}handleKey(e,t,n,i){const s=this.options.keyMap.find((e=>function(e,t){for(const n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}(i,e.key)));if(s&&f[s.action])return f[s.action](this.options,e,t,n,i)}}function p(e,t){return e.replace(t?i:n,\" \")}const m=/mac|iphone|ipad|ipod/i.test(navigator.platform),g=/firefox/i.test(navigator.userAgent),x=m?\"metaKey\":\"ctrlKey\",k={enter:[\"Enter\",\"Shift+Enter\"],indent:[\"Tab\",\"Cmd+m\"],outdent:[\"Shift+Tab\",\"Cmd+Shift+m\"],inline:['\"',\"'\",\"`\",\"*\",\"_\",\"[\",\"]\",\"(\",\")\",\"{\",\"}\",\"<\",\">\"]};function v(e={}){const t=function(e=4){\"number\"!=typeof e&&(e=(e+\"\").length);return new Array(e+1).join(\" \")}(e.indent),n={indent:t,reOutdent:new RegExp(\"^\"+t,\"mg\"),keyMap:b(e.keyMap),extensions:e.extensions||[]};return n.extensions.push(new y(n)),n}function b(e={}){const t={},n=[];for(let i in k)if(k.hasOwnProperty(i)){let s=e[i]||k[i];Array.isArray(s)||(s=s.toString().trim().split(/\\s*[|,]\\s*/g)),n.push.apply(n,s.map((e=>{const n=E(e);return n.key in t||(t[n.key]=0),++t[n.key],{key:n,action:i}})))}return n.forEach((e=>{var n;t[e.key.key]>1&&(\"ctrlKey\"in(n=e.key)||(n.ctrlKey=!1),\"altKey\"in n||(n.altKey=!1),\"shiftKey\"in n||(n.shiftKey=!1),\"metaKey\"in n||(n.metaKey=!1))})),n}function E(e){const t={};return e.trim().split(/\\s*\\+\\s*/g).forEach((function(e){switch(e.toLowerCase()){case\"cmd\":t[x]=!0;break;case\"ctrl\":case\"alt\":case\"shift\":case\"meta\":t[e.toLowerCase()+\"Key\"]=!0;break;default:t.key=e}})),t}function K(){const e=document.createElement(\"div\");return e.setAttribute(\"aria-hidden\",\"true\"),e.tabIndex=-1,e.contentEditable=!0,e.textContent=\"0\",e.addEventListener(\"focus\",(()=>setTimeout((()=>e.blur()),0))),e.style.position=\"fixed\",e.style.overflow=\"hidden\",e.style.left=\"-1000px\",e.style.top=\"50%\",e.style.width=e.style.height=\"1px\",e.style.opacity=\"0\",e}function w(e,t=!1){return{s:e.selectionStart,e:e.selectionEnd,x:e.scrollLeft,y:e.scrollTop,v:e.value.replace(/\\u00A0/g,\" \"),c:t}}function L(e,t){e.lock=!0;const n=void 0===t.e?t.s:t.e,i=void 0===t.x?e.elem.scrollLeft:t.x,s=void 0===t.y?e.elem.scrollTop:t.y;T(e,{...t,e:n,x:i,y:s,c:!0},!0),e.lock=!1}function A(e,t){if(!e.elem||t.defaultPrevented)return;if(g&&t[x]&&\"z\"===t.key)return void e.elem.blur();const n=w(e.elem),i=n.v.substring(0,n.s),s=n.v.substring(n.s,n.e),o=n.v.substring(n.e);for(let n=0,r=e.options.extensions.length;ne.cleanup&&e.cleanup(this))),this.ed.elem.removeEventListener(\"input\",this.ed.onInput),this.ed.elem.removeEventListener(\"keydown\",this.ed.onKeyDown)),this.ed.elem=e,e.addEventListener(\"keydown\",this.ed.onKeyDown),e.addEventListener(\"input\",this.ed.onInput),I(this.ed),this.ed.options.extensions.forEach((e=>e.init&&e.init(this)))}getValue(){return this.ed.elem.value.replace(/\\u00A0/g,\" \")}setValue(e,t=!1){this.ed.elem.value=e,t||I(this.ed)}pushState(e){L(this.ed,e)}destroy(){return this.ed.options.extensions.forEach((e=>e.cleanup&&e.cleanup(this))),this.ed.elem.removeEventListener(\"keydown\",this.ed.onKeyDown),this.ed.elem.removeEventListener(\"input\",this.ed.onInput),this.ed.helper.removeEventListener(\"input\",this.ed.onUndo),document.body.removeChild(this.ed.helper),this.ed.options.extensions.forEach((e=>e.destroy&&e.destroy())),Object.assign(this.ed,{elem:null,helper:null,options:null,reOutdent:null,onKeyDown:null,onInput:null,onUndo:null,history:null}),Object.assign(this,{ed:null}),null}}return function(e){e.version=\"v2.0.9\"}(D||(D={})),D}));\n//# sourceMappingURL=index.min.js.map\n","module.exports = flarum.core.compat['utils/BasicEditorDriver'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Component from 'flarum/Component';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? 'Meta' : 'Control';\n\nexport default class MarkdownToolbar extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.attrs.setShortcutHandler(this.shortcut.bind(this));\n }\n\n view(vnode) {\n return
\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","import MarkdownArea from 'mdarea';\nimport BasicEditorDriver from 'flarum/utils/BasicEditorDriver';\n\nexport class MarkdownEditorFlarumExtension {\n constructor(oninput, callInputListeners, onsubmit) {\n this.oninput = oninput;\n this.callInputListeners = callInputListeners;\n this.onsubmit = onsubmit;\n }\n\n handleKey(\n prefix,\n selection,\n postfix,\n evt\n ) {\n // setTimeout without a time executes after the call stack has cleared,\n // so any DOM changes originating from mdarea (e.g. executing an undo)\n // will be finished by then. At that time, `e.target.value` will represent\n // the updated value of the textarea in response to the keypress.\n setTimeout(() => {\n this.oninput(evt.target.value);\n\n if ((evt.metaKey || evt.ctrlKey) && evt.key === 'Enter') {\n return this.onsubmit();\n }\n\n this.callInputListeners(evt);\n });\n }\n}\n\nexport default class MarkdownAreaEditorDriver extends BasicEditorDriver {\n build(dom, params) {\n this.el.className = params.classNames.join(' ');\n this.el.disabled = params.disabled;\n this.el.placeholder = params.placeholder;\n this.el.value = params.value;\n this.el.id = params.textareaId;\n\n dom.append(this.el);\n\n const callInputListeners = (e) => {\n params.inputListeners.forEach((listener) => {\n listener();\n });\n\n e.redraw = false;\n };\n\n // We can't bind shortcutHandler directly in case `build`\n // runs before MarkdownToolbar's `oninit`.\n this.el.addEventListener('keydown', function (e) {\n return params.shortcutHandler(...arguments);\n });\n\n // Our mdarea extension won't detect programmatic changes via\n // the `app.composer.editor api.\n this.el.addEventListener('input', function (e) {\n if (e instanceof CustomEvent) {\n params.oninput(e.target.value);\n callInputListeners(e);\n }\n });\n\n // This one can't be run through mdarea, but that doesn't matter\n // because mdarea doesn't change value in response to clicks.\n this.el.addEventListener('click', callInputListeners);\n\n this.mdarea = new MarkdownArea(this.el, {\n keyMap: {\n indent: ['Ctrl+m'],\n outdent: ['Ctrl+M'],\n inline: []\n },\n extensions: [\n new MarkdownEditorFlarumExtension(params.oninput, callInputListeners, params.onsubmit)\n ]\n });\n }\n\n destroy() {\n this.mdarea.destroy();\n super.destroy();\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, override } from 'flarum/extend';\nimport TextEditor from 'flarum/components/TextEditor';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport MarkdownAreaEditorDriver from './util/MarkdownAreaEditorDriver';\n\nlet shortcutHandler = () => { };\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 override(TextEditor.prototype, 'buildEditor', function (_, dom) {\n return new MarkdownAreaEditorDriver(dom, this.buildEditorParams());\n });\n\n extend(TextEditor.prototype, 'buildEditorParams', function (params) {\n params.textareaId = this.textareaId;\n params.shortcutHandler = shortcutHandler;\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 shortcutHandler = handler}>\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/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/markdown/./node_modules/mdarea/dist/index.min.js","webpack://@flarum/markdown/external \"flarum.core.compat['utils/BasicEditorDriver']\"","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/util/MarkdownAreaEditorDriver.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","e","u","a","h","f","enter","lastIndexOf","substring","exec","line","offset","prefix","charAt","length","shiftKey","indent","test","replace","parseInt","v","outdent","reOutdent","inline","slice","y","this","options","keyMap","find","action","navigator","platform","g","userAgent","x","k","b","Array","isArray","toString","trim","split","push","apply","map","E","forEach","ctrlKey","altKey","metaKey","toLowerCase","K","document","createElement","setAttribute","tabIndex","contentEditable","textContent","addEventListener","setTimeout","blur","style","position","overflow","left","top","width","height","opacity","w","selectionStart","selectionEnd","scrollLeft","scrollTop","L","lock","elem","T","A","defaultPrevented","extensions","handleKey","preventDefault","C","type","execCommand","O","idx","helper","state","history","S","I","$","splice","focus","assign","scrollTo","D","join","RegExp","ed","onKeyDown","onInput","onUndo","body","appendChild","setElement","cleanup","removeEventListener","init","removeChild","destroy","version","_inheritsLoose","subClass","superClass","constructor","__proto__","modifierKey","match","MarkdownToolbar","oncreate","vnode","attrs","setShortcutHandler","shortcut","view","id","data-for","for","display","children","event","button","element","querySelector","click","Component","_extends","target","arguments","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","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","error","createEvent","initEvent","dispatchEvent","setSelectionRange","insertText","MarkdownButton","tooltip","className","title","data-hotkey","hotkey","onclick","onkeydown","keydown","icon","stylesToApply","toolbar","parentElement","field","getElementById","dataset","MarkdownEditorFlarumExtension","oninput","callInputListeners","onsubmit","selection","postfix","evt","MarkdownAreaEditorDriver","build","dom","params","el","classNames","disabled","placeholder","textareaId","append","inputListeners","listener","redraw","shortcutHandler","CustomEvent","mdarea","MarkdownArea","BasicEditorDriver","app","initializers","add","extend","TextEditor","override","_","buildEditorParams","items","translator","trans","handler"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,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,MAAO,CAAElD,OAAQ,IAAK0J,OAAQ,IAAK4B,WAAW,GAAQiC,OAAO,MAC5H,EAAC,EAAD,CAAgBF,MAAOF,EAAQ,SAAUQ,KAAK,oBAAoBzK,MAAO,CAAElD,OAAQ,KAAM4I,WAAW,EAAMoB,sBAAsB,KAChI,EAAC,EAAD,CAAgBqD,MAAOF,EAAQ,QAASQ,KAAK,cAAczK,MAAO,CAAElD,OAAQ,IAAK0J,OAAQ,IAAKC,YAAa,MAAOC,YAAa,SAC/H,EAAC,EAAD,CAAgByD,MAAOF,EAAQ,QAASQ,KAAK,cAAczK,MAAO,CAAElD,OAAQ,IAAK0J,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC1I,EAAC,EAAD,CAAgBsD,MAAOF,EAAQ,SAAUQ,KAAK,eAAezK,MAAO,CAAElD,OAAQ,KAAM0J,OAAQ,cAAeG,YAAa,WAAYE,QAAS,eAC7I,EAAC,EAAD,CAAgBsD,MAAOF,EAAQ,kBAAmBQ,KAAK,iBAAiBzK,MAAO,CAAElD,OAAQ,KAAM4I,WAAW,EAAMoB,sBAAsB,KACtI,EAAC,EAAD,CAAgBqD,MAAOF,EAAQ,gBAAiBQ,KAAK,iBAAiBzK,MAAO,CAAElD,OAAQ,MAAO4I,WAAW,EAAMgD,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 = 6);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['helpers/icon'];","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).MarkdownArea=t()}(this,(function(){\"use strict\";const e=/^[ \\t]*(?:(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?|>[ \\t]*)*(?::[ \\t]*)?/,t=/(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?$/,n=/[-+*\\[\\]x\\d.]/g,i=/[^ \\t]/g,s=/(\\d+)\\.(?=[ \\t]+$)/,o=/(?:(?:^[ \\t]+)?(?:[-+*]|\\d+\\.|[>:])(?:[ \\t]+\\[[ x]])?[ \\t]*|^[ \\t]+)$/,r=/[*_]/,l=/[-=\\s\"'`<>\\[\\](){}+*^$\\\\.|]$/,u=/^(?:\\n|$)/,c=/^(?!$)/gm,d={\"`\":/^``$/m,\"~\":/^~~$/m},a={\"[\":\"]\",\"(\":\")\",\"{\":\"}\",\"<\":\">\"},h={\"]\":\"[\",\")\":\"(\",\"}\":\"{\",\">\":\"<\"},f={enter:(n,i,r,l,c)=>{const d=r?null:function(t){const n=t.lastIndexOf(\"\\n\")+1,i=t.substring(n),s=e.exec(i);return{line:i,offset:n,prefix:s&&s[0]}}(i);if(d)if(d.line&&d.line.charAt(d.line.length-1)in a){const e=d.prefix?p(d.prefix,!0):\"\";l=\"\\n\"+e+l,c.shiftKey||(i+=\"\\n\"+e+n.indent)}else d.prefix?!c.shiftKey&&d.prefix===d.line&&u.test(l)?i=i.substring(0,d.offset)+function(e){return e.replace(o,\"\")}(d.prefix):!c.shiftKey&&function(e){return t.test(e)}(d.prefix)?i+=\"\\n\"+function(e){return e.replace(s,(function(e,t){return parseInt(t)+1+\".\"}))}(d.prefix):i+=\"\\n\"+p(d.prefix,c.shiftKey):i+=\"\\n\";else i+=\"\\n\";return{v:i+l,s:i.length}},indent:(e,t,n,i)=>{let s=t.length,o=t.lastIndexOf(\"\\n\")+1;return o{let s=t.length,o=t.lastIndexOf(\"\\n\")+1;return on||s.key in a||i.charAt(0)!==s.key?n||(\"'\"!==s.key||l.test(t))&&!(s.key in h)?!n&&s.key in d&&d[s.key].test(t)?{v:t+s.key+\"language\\n\"+s.key+s.key+s.key+(\"\\n\"!==i.charAt(0)?\"\\n\":\"\")+i,s:t.length+1,e:t.length+9}:s.key===t.slice(-1)&&s.key===i.slice(0,1)?{v:t.slice(0,-1)+n+i.slice(1),s:t.length-1,e:t.length-1+n.length}:{v:t+(h[s.key]||s.key)+n+(a[s.key]||s.key)+i,s:t.length+1,e:t.length+1+n.length}:{v:t+s.key+i,s:t.length+1}:{v:t+(r.test(s.key)?s.key+s.key:\"\")+i,s:t.length+1}};class y{constructor(e){this.options=e}handleKey(e,t,n,i){const s=this.options.keyMap.find((e=>function(e,t){for(const n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}(i,e.key)));if(s&&f[s.action])return f[s.action](this.options,e,t,n,i)}}function p(e,t){return e.replace(t?i:n,\" \")}const m=/mac|iphone|ipad|ipod/i.test(navigator.platform),g=/firefox/i.test(navigator.userAgent),x=m?\"metaKey\":\"ctrlKey\",k={enter:[\"Enter\",\"Shift+Enter\"],indent:[\"Tab\",\"Cmd+m\"],outdent:[\"Shift+Tab\",\"Cmd+Shift+m\"],inline:['\"',\"'\",\"`\",\"*\",\"_\",\"[\",\"]\",\"(\",\")\",\"{\",\"}\",\"<\",\">\"]};function v(e={}){const t=function(e=4){\"number\"!=typeof e&&(e=(e+\"\").length);return new Array(e+1).join(\" \")}(e.indent),n={indent:t,reOutdent:new RegExp(\"^\"+t,\"mg\"),keyMap:b(e.keyMap),extensions:e.extensions||[]};return n.extensions.push(new y(n)),n}function b(e={}){const t={},n=[];for(let i in k)if(k.hasOwnProperty(i)){let s=e[i]||k[i];Array.isArray(s)||(s=s.toString().trim().split(/\\s*[|,]\\s*/g)),n.push.apply(n,s.map((e=>{const n=E(e);return n.key in t||(t[n.key]=0),++t[n.key],{key:n,action:i}})))}return n.forEach((e=>{var n;t[e.key.key]>1&&(\"ctrlKey\"in(n=e.key)||(n.ctrlKey=!1),\"altKey\"in n||(n.altKey=!1),\"shiftKey\"in n||(n.shiftKey=!1),\"metaKey\"in n||(n.metaKey=!1))})),n}function E(e){const t={};return e.trim().split(/\\s*\\+\\s*/g).forEach((function(e){switch(e.toLowerCase()){case\"cmd\":t[x]=!0;break;case\"ctrl\":case\"alt\":case\"shift\":case\"meta\":t[e.toLowerCase()+\"Key\"]=!0;break;default:t.key=e}})),t}function K(){const e=document.createElement(\"div\");return e.setAttribute(\"aria-hidden\",\"true\"),e.tabIndex=-1,e.contentEditable=!0,e.textContent=\"0\",e.addEventListener(\"focus\",(()=>setTimeout((()=>e.blur()),0))),e.style.position=\"fixed\",e.style.overflow=\"hidden\",e.style.left=\"-1000px\",e.style.top=\"50%\",e.style.width=e.style.height=\"1px\",e.style.opacity=\"0\",e}function w(e,t=!1){return{s:e.selectionStart,e:e.selectionEnd,x:e.scrollLeft,y:e.scrollTop,v:e.value.replace(/\\u00A0/g,\" \"),c:t}}function L(e,t){e.lock=!0;const n=void 0===t.e?t.s:t.e,i=void 0===t.x?e.elem.scrollLeft:t.x,s=void 0===t.y?e.elem.scrollTop:t.y;T(e,{...t,e:n,x:i,y:s,c:!0},!0),e.lock=!1}function A(e,t){if(!e.elem||t.defaultPrevented)return;if(g&&t[x]&&\"z\"===t.key)return void e.elem.blur();const n=w(e.elem),i=n.v.substring(0,n.s),s=n.v.substring(n.s,n.e),o=n.v.substring(n.e);for(let n=0,r=e.options.extensions.length;ne.cleanup&&e.cleanup(this))),this.ed.elem.removeEventListener(\"input\",this.ed.onInput),this.ed.elem.removeEventListener(\"keydown\",this.ed.onKeyDown)),this.ed.elem=e,e.addEventListener(\"keydown\",this.ed.onKeyDown),e.addEventListener(\"input\",this.ed.onInput),I(this.ed),this.ed.options.extensions.forEach((e=>e.init&&e.init(this)))}getValue(){return this.ed.elem.value.replace(/\\u00A0/g,\" \")}setValue(e,t=!1){this.ed.elem.value=e,t||I(this.ed)}pushState(e){L(this.ed,e)}destroy(){return this.ed.options.extensions.forEach((e=>e.cleanup&&e.cleanup(this))),this.ed.elem.removeEventListener(\"keydown\",this.ed.onKeyDown),this.ed.elem.removeEventListener(\"input\",this.ed.onInput),this.ed.helper.removeEventListener(\"input\",this.ed.onUndo),document.body.removeChild(this.ed.helper),this.ed.options.extensions.forEach((e=>e.destroy&&e.destroy())),Object.assign(this.ed,{elem:null,helper:null,options:null,reOutdent:null,onKeyDown:null,onInput:null,onUndo:null,history:null}),Object.assign(this,{ed:null}),null}}return function(e){e.version=\"v2.0.9\"}(D||(D={})),D}));\n//# sourceMappingURL=index.min.js.map\n","module.exports = flarum.core.compat['utils/BasicEditorDriver'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Component from 'flarum/Component';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? 'Meta' : 'Control';\n\nexport default class MarkdownToolbar extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.attrs.setShortcutHandler(this.shortcut.bind(this));\n }\n\n view(vnode) {\n return
\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","import MarkdownArea from 'mdarea';\nimport BasicEditorDriver from 'flarum/utils/BasicEditorDriver';\n\nexport class MarkdownEditorFlarumExtension {\n constructor(oninput, callInputListeners, onsubmit) {\n this.oninput = oninput;\n this.callInputListeners = callInputListeners;\n this.onsubmit = onsubmit;\n }\n\n handleKey(\n prefix,\n selection,\n postfix,\n evt\n ) {\n // setTimeout executes after the call stack has cleared,\n // so any DOM changes originating from mdarea (e.g. executing an undo)\n // will be finished by then. At that time, `e.target.value` will represent\n // the updated value of the textarea in response to the keypress.\n // Unfortunately, this doesn't work without a value for mobile safari,\n // so we need to set 10 seconds as an arbitrary timeout.\n setTimeout(() => {\n this.oninput(evt.target.value);\n\n if ((evt.metaKey || evt.ctrlKey) && evt.key === 'Enter') {\n return this.onsubmit();\n }\n\n this.callInputListeners(evt);\n }, 25);\n }\n}\n\nexport default class MarkdownAreaEditorDriver extends BasicEditorDriver {\n build(dom, params) {\n this.el.className = params.classNames.join(' ');\n this.el.disabled = params.disabled;\n this.el.placeholder = params.placeholder;\n this.el.value = params.value;\n this.el.id = params.textareaId;\n\n dom.append(this.el);\n\n const callInputListeners = (e) => {\n params.inputListeners.forEach((listener) => {\n listener();\n });\n\n e.redraw = false;\n };\n\n // We can't bind shortcutHandler directly in case `build`\n // runs before MarkdownToolbar's `oninit`.\n this.el.addEventListener('keydown', function (e) {\n return params.shortcutHandler(...arguments);\n });\n\n // Our mdarea extension won't detect programmatic changes via\n // the `app.composer.editor api.\n this.el.addEventListener('input', function (e) {\n if (e instanceof CustomEvent) {\n params.oninput(e.target.value);\n callInputListeners(e);\n }\n });\n\n // This one can't be run through mdarea, but that doesn't matter\n // because mdarea doesn't change value in response to clicks.\n this.el.addEventListener('click', callInputListeners);\n\n this.mdarea = new MarkdownArea(this.el, {\n keyMap: {\n indent: ['Ctrl+m'],\n outdent: ['Ctrl+M'],\n inline: []\n },\n extensions: [\n new MarkdownEditorFlarumExtension(params.oninput, callInputListeners, params.onsubmit)\n ]\n });\n }\n\n destroy() {\n this.mdarea.destroy();\n super.destroy();\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, override } from 'flarum/extend';\nimport TextEditor from 'flarum/components/TextEditor';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport MarkdownAreaEditorDriver from './util/MarkdownAreaEditorDriver';\n\nlet shortcutHandler = () => { };\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 override(TextEditor.prototype, 'buildEditor', function (_, dom) {\n return new MarkdownAreaEditorDriver(dom, this.buildEditorParams());\n });\n\n extend(TextEditor.prototype, 'buildEditorParams', function (params) {\n params.textareaId = this.textareaId;\n params.shortcutHandler = shortcutHandler;\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 shortcutHandler = handler}>\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