!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MavonEditor",[],t):"object"==typeof exports?exports.MavonEditor=t():e.MavonEditor=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=68)}([function(e,t,n){"use strict";function r(e){return Object.prototype.toString.call(e)}function o(e){return"[object String]"===r(e)}function i(e,t){return w.call(e,t)}function a(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function s(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function c(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function u(e,t){var n=0;return i(A,t)?A[t]:35===t.charCodeAt(0)&&T.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),l(n))?c(n):e}function p(e){return e.indexOf("\\")<0?e:e.replace(x,"$1")}function d(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(C,function(e,t,n){return t||u(e,n)})}function h(e){return E[e]}function f(e){return S.test(e)?e.replace(D,h):e}function _(e){return e.replace(L,"\\$&")}function g(e){switch(e){case 9:case 32:return!0}return!1}function m(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function b(e){return j.test(e)}function v(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function k(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}var w=Object.prototype.hasOwnProperty,x=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,y=/&([a-z#][a-z0-9]{1,31});/gi,C=new RegExp(x.source+"|"+y.source,"gi"),T=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,A=n(52),S=/[&<>"]/,D=/[&<>"]/g,E={"&":"&","<":"<",">":">",'"':"""},L=/[.?*+^$[\]\\(){}|-]/g,j=n(34);t.lib={},t.lib.mdurl=n(56),t.lib.ucmicro=n(196),t.assign=a,t.isString=o,t.has=i,t.unescapeMd=p,t.unescapeAll=d,t.isValidEntityCode=l,t.fromCodePoint=c,t.escapeHtml=f,t.arrayReplaceAt=s,t.isSpace=g,t.isWhiteSpace=m,t.isMdAsciiPunct=v,t.isPunctChar=b,t.escapeRE=_,t.normalizeReference=k},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){e.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(5),o=n(13);e.exports=n(3)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(9),o=n(42),i=n(28),a=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(88),o=n(19);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(26)("wks"),o=n(14),i=n(1).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(8);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){function n(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var i=r(o);return[n].concat(o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"})).concat([i]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;on.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],o=0;o0?r:n)(e)}},function(e,t,n){var r=n(8);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(1),o=n(10),i=n(12),a=n(30),s=n(5).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){t.f=n(7)},function(e,t,n){function r(e,t){return new i(t).process(e)}var o=n(50),i=n(111);t=e.exports=r,t.FilterCSS=i;for(var a in o)t[a]=o[a];"undefined"!=typeof window&&(window.filterCSS=e.exports)},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=0;t=0&&(n=this.attrs[t][1]),n},r.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=r},function(e,t){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(e,t){e.exports={indexOf:function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n0)return n[0].addEventListener("load",function(){t()}),void t();var r=document.createElement("script"),o=document.getElementsByTagName("head")[0];r.type="text/javascript",r.charset="UTF-8",r.src=e,r.addEventListener?r.addEventListener("load",function(){t()},!1):r.attachEvent&&r.attachEvent("onreadystatechange",function(){"loaded"===window.event.srcElement.readyState&&t()}),o.appendChild(r)}function c(e,t,n){if("function"!=typeof t&&(t=function(){}),document.querySelectorAll("link[href='"+e+"']").length>0)return void t();if(n){var r=document.querySelectorAll("link#"+n);if(r.length)return void(r[0].href=e)}var o=document.createElement("link"),i=document.getElementsByTagName("head")[0];o.rel="stylesheet",o.href=e,n&&(o.id=n),o.addEventListener?o.addEventListener("load",function(){t()},!1):o.attachEvent&&o.attachEvent("onreadystatechange",function(){"loaded"===window.event.srcElement.readyState&&t()}),i.appendChild(o)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=l,t.loadLink=c;var u=(t.insertTextAtCaret=function(e,t,n){var r=t.prefix,o=t.subfix,a=t.str;t.type;if(e.focus(),i(e)){var l=e.selectionStart,c=e.selectionEnd,u=e.value;l===c?(e.value=u.substring(0,l)+r+a+o+u.substring(c,u.length),e.selectionStart=l+r.length,e.selectionEnd=l+(a.length+r.length)):u.substring(l-r.length,l)===r&&u.substring(c,c+o.length)===o&&s(r,o,u,l,c)?(e.value=u.substring(0,l-r.length)+u.substring(l,c)+u.substring(c+o.length,u.length),e.selectionStart=l-r.length,e.selectionEnd=c-r.length):(e.value=u.substring(0,l)+r+u.substring(l,c)+o+u.substring(c,u.length),e.selectionStart=l+r.length,e.selectionEnd=l+(c-l+r.length))}else alert("Error: Browser version is too low");n.d_value=e.value,e.focus()},{prefix:"```",subfix:"\n```\n",defaultLanguageText:"language"});t.insertCodeBlock=function(e){var t=e.getTextareaDom();if(!i(t))return void alert("Error: Browser version is too low");var n=u.defaultLanguageText,s=t.selectionStart,l=t.selectionEnd,c=t.value;if(s===l)r(n,"",t);else if(a(t))o(t);else{var p=c.substring(s,l);r("",p,t)}e.d_value=t.value,t.focus()},t.insertOl=function(e){var t=e.getTextareaDom();if(i(t)){var n=t.selectionStart,r=t.selectionEnd,o=t.value;if(n===r)t.value=o.substring(0,n)+"1. "+o.substring(r,o.length),t.selectionEnd=t.selectionStart=n+3;else{for(var a=n;a>0&&"\n"!==o.substring(a-1,a);)a--;for(var s=o.substring(a,r),l=s.split("\n"),c=0;c0&&"\n"!==o.substring(a-1,a);)a--;for(var s=r;s0&&"\n"!==o.substring(a-1,a);)a--;var s=o.substring(a,r),l=s.replace(/\n/g,"\n- ");l="- "+l,t.value=o.substring(0,a)+l+o.substring(r,o.length),t.selectionStart=a,t.selectionEnd=r+l.length-s.length}}else alert("Error: Browser version is too low");e.d_value=t.value,t.focus()},t.insertTab=function(e,t){t=t?new Array(t).fill(" ").join(""):"\t";var n=e.getTextareaDom();if(i(n)){var r=n.selectionStart,o=n.selectionEnd,a=n.value,s=a.substring(0,r).split("\n").pop();if(s.match(/^\s*[0-9]+\.\s+\S*/)){var l=s.replace(/(\d+)/,1);n.value=a.substring(0,r-l.length)+t+l+a.substring(o,a.length)}else s.match(/^\s*-\s+\S*/)?n.value=a.substring(0,r-s.length)+t+s+a.substring(o,a.length):n.value=a.substring(0,r)+t+a.substring(o,a.length);n.selectionStart=n.selectionEnd=r+t.length}else alert("Error: Browser version is too low");e.d_value=n.value,n.focus()},t.unInsertTab=function(e,t){var n=new RegExp(t?"\\s{"+t+"}":"\t");console.log("regTab:",n);var r=e.getTextareaDom();if(i(r)){var o=r.selectionStart,a=r.selectionEnd,s=r.value,l=s.substring(0,o).split("\n").pop();l.search(n)>=0&&(r.value=s.substring(0,o-l.length)+l.replace(n,"")+s.substring(a,s.length),r.selectionStart=r.selectionEnd=o-(t||1))}else alert("Error: Browser version is too low");e.d_value=r.value,r.focus()},t.insertEnter=function(e,t){var n=e.getTextareaDom();if(i(n)){var r=n.selectionStart,o=n.selectionEnd,a=n.value,s=a.substring(0,r).split("\n").pop(),l=s.match(/^\s*(?:[0-9]+\.|-)\s+\S+/);if(l){t.preventDefault();var c=l.shift().match(/^\s*(?:[0-9]+\.|-)\s/).shift();if(c.search(/-/)>=0)n.value=a.substring(0,r)+"\n"+c+a.substring(o,a.length),n.selectionStart=n.selectionEnd=r+c.length+1;else{var u=c.replace(/(\d+)/,parseInt(c)+1);n.value=a.substring(0,r)+"\n"+u+a.substring(o,a.length),n.selectionStart=n.selectionEnd=r+u.length+1}}else{var p=s.match(/^\s*(?:[0-9]+\.|-)\s+$/);if(p){t.preventDefault();var d=p.shift().length;n.value=a.substring(0,r-d)+"\n"+a.substring(o,a.length),n.selectionStart=n.selectionEnd=r-d}}}else alert("Error: Browser version is too low");e.d_value=n.value,n.focus()},t.getNavigation=function(e,t){var n=void 0;n=e.$refs.navigationContent,n.innerHTML=e.d_render;var r=n.children;if(r.length)for(var o=0;o=0&&n.scrollHeight!==t.edit_scroll_height&&n.scrollHeight-n.offsetHeight-n.scrollTop<=30&&(t.$refs.vNoteEdit.scrollTop=n.scrollHeight-n.offsetHeight,r=1),t.edit_scroll_height=n.scrollHeight,t.$refs.vShowContent.scrollHeight>t.$refs.vShowContent.offsetHeight&&(t.$refs.vShowContent.scrollTop=(t.$refs.vShowContent.scrollHeight-t.$refs.vShowContent.offsetHeight)*r)},t.fullscreenchange=function(e){e.$el.addEventListener("fullscreenchange",function(t){e.$toolbar_right_read_change_status()},!1),e.$el.addEventListener("mozfullscreenchange",function(t){e.$toolbar_right_read_change_status()},!1),e.$el.addEventListener("webkitfullscreenchange",function(t){e.$toolbar_right_read_change_status()},!1),e.$el.addEventListener("msfullscreenchange",function(t){e.$toolbar_right_read_change_status()},!1)},t.windowResize=function(e){function t(){e.$el.clientWidth>768?e.s_subfield=e.subfield:e.s_subfield=!1}t(),window.addEventListener("resize",t)},t.ImagePreviewListener=function(e){e.$refs.vShowContent.addEventListener("click",function(t){t=t||window.event;var n=t.srcElement?t.srcElement:t.target;"IMG"===n.tagName&&(null!=e.imageClick?e.imageClick(n):e.d_preview_imgsrc=n.src)})}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(8),o=n(1).document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,n){var r=n(1),o=n(10),i=n(85),a=n(4),s=n(2),l=function(e,t,n){var c,u,p,d=e&l.F,h=e&l.G,f=e&l.S,_=e&l.P,g=e&l.B,m=e&l.W,b=h?o:o[t]||(o[t]={}),v=b.prototype,k=h?r:f?r[t]:(r[t]||{}).prototype;h&&(n=t);for(c in n)(u=!d&&k&&void 0!==k[c])&&s(b,c)||(p=u?k[c]:n[c],b[c]=h&&"function"!=typeof k[c]?n[c]:g&&u?i(p,r):m&&k[c]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(p):_&&"function"==typeof p?i(Function.call,p):p,_&&((b.virtual||(b.virtual={}))[c]=p,e&l.R&&v&&!v[c]&&a(v,c,p)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){e.exports=!n(3)&&!n(11)(function(){return 7!=Object.defineProperty(n(40)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var r=n(12),o=n(41),i=n(48),a=n(4),s=n(21),l=n(90),c=n(24),u=n(96),p=n(7)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,f,_,g,m){l(n,t,f);var b,v,k,w=function(e){if(!d&&e in T)return T[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},x=t+" Iterator",y="values"==_,C=!1,T=e.prototype,A=T[p]||T["@@iterator"]||_&&T[_],S=A||w(_),D=_?y?w("entries"):S:void 0,E="Array"==t?T.entries||A:A;if(E&&(k=u(E.call(new e)))!==Object.prototype&&k.next&&(c(k,x,!0),r||"function"==typeof k[p]||a(k,p,h)),y&&A&&"values"!==A.name&&(C=!0,S=function(){return A.call(this)}),r&&!m||!d&&!C&&T[p]||a(T,p,S),s[t]=S,s[x]=h,_)if(b={values:y?S:w("values"),keys:g?S:w("keys"),entries:D},m)for(v in b)v in T||i(T,v,b[v]);else o(o.P+o.F*(d||C),t,b);return b}},function(e,t,n){var r=n(9),o=n(93),i=n(20),a=n(25)("IE_PROTO"),s=function(){},l=function(){var e,t=n(40)("iframe"),r=i.length;for(t.style.display="none",n(87).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("