travel/admin/node_modules/tui-editor/dist/tui-editor-Editor.min.js

7 lines
322 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* tui-editor
* @version 1.3.3
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("markdown-it"),require("to-mark"),require("highlight.js"),require("squire-rte")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","codemirror","markdown-it","to-mark","highlight.js","squire-rte"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("markdown-it"),require("to-mark"),require("highlight.js"),require("squire-rte")):(e.tui=e.tui||{},e.tui.Editor=t(e.$,e.tui&&e.tui.util,e.CodeMirror,e.markdownit,e.toMark,e.hljs,e.Squire))}("undefined"!=typeof self?self:this,function(e,t,n,i,o,a,r){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},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="dist/",t(t.s=44)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(21),d=i(c),f=n(14),h=f.isMac?1:0,g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this._command=new u.default.Map,this._mdCommand=new u.default.Map,this._wwCommand=new u.default.Map,this._options=l.default.extend({useCommandShortcut:!0},n),this.base=t,this.keyMapCommand={},this._initEvent()}return a(e,[{key:"_addCommandBefore",value:function(e){var t={command:e};return this.base.eventManager.emit("addCommandBefore",t),t.command||e}},{key:"addCommand",value:function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];i.length&&(t=e.command.apply(e,[t].concat(i))),t=this._addCommandBefore(t);var a=t.getName(),r=void 0;return t.isMDType()?r=this._mdCommand:t.isWWType()?r=this._wwCommand:t.isGlobalType()&&(r=this._command),r.set(a,t),t.keyMap&&(this.keyMapCommand[t.keyMap[h]]=a),t}},{key:"_initEvent",value:function(){var e=this;this.base.eventManager.listen("command",function(){e.exec.apply(e,arguments)}),this.base.eventManager.listen("keyMap",function(t){if(e._options.useCommandShortcut){var n=e.keyMapCommand[t.keyMap];n&&(t.data.preventDefault(),e.exec(n))}})}},{key:"exec",value:function(e){var t=void 0,n=void 0,i=this.base;if(t=this._command.get(e),t||(this.base.isMarkdownMode()?(t=this._mdCommand.get(e),i=this.base.mdEditor):(t=this._wwCommand.get(e),i=this.base.wwEditor)),t){for(var o,a=arguments.length,r=Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];r.unshift(i),n=(o=t).exec.apply(o,r)}return n}}]),e}();g.command=function(e,t){var n=d.default.factory(e,t.name,t.keyMap);return u.default.extend(n,t),n},t.default=g},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.I18n=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=void 0,s="en_US",u=function(){function e(){i(this,e),this._code=s,this._langs=new r.default.Map}return o(e,[{key:"setCode",value:function(e){this._code=e}},{key:"setLanguage",value:function(e,t){var n=this;e=[].concat(e),e.forEach(function(e){if(n._langs.has(e)){var i=n._langs.get(e);n._langs.set(e,r.default.extend(i,t))}else n._langs.set(e,t)})}},{key:"get",value:function(e,t){t||(t=this._code);var n=this._langs.get(t);n||(n=this._langs.get(s));var i=n[e];if(!i)throw new Error('There is no text key "'+e+'" in '+t);return i}}],[{key:"getSharedInstance",value:function(){return l||(l=new e),l}}]),e}();t.I18n=u,t.default=new u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(1),l=i(r),s=/\u200B/g,u=function(e){return e&&e.nodeType===Node.TEXT_NODE},c=function(e){return e&&e.nodeType===Node.ELEMENT_NODE},d=function(e){return/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|DETAILS|DIALOG|DD|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[\d]|HEADER|HGROUP|HR|LI|MAIN|NAV|OL|P|PRE|SECTION|UL)$/gi.test(this.getNodeName(e))},f=function(e){return c(e)?e.tagName:"TEXT"},h=function(e){var t=void 0;return c(e)?t=e.textContent.replace(s,"").length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},g=function(e){var t=void 0;return c(e)?t=e.childNodes.length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},v=function(e){var t=e.parentNode.childNodes,n=void 0,i=void 0,o=void 0;for(n=0,i=t.length;n<i;n+=1)if(t[n]===e){o=n;break}return o},p=function(e,t){var n=void 0;return u(e)?n=e:e.childNodes.length&&t>=0&&(n=e.childNodes[t]),n},m=function(e,t,n){for(var i=e+"Sibling",o=void 0,a=void 0;t&&!t[i]&&(o=f(t.parentNode))!==n&&"BODY"!==o;)t=t.parentNode;return t[i]&&(a=t[i]),a},y=function(e,t,n){return t>0?p(e,t-1):m("previous",e,n)},_=function(e,t,n){for(var i=void 0;e.parentNode&&!t(e.parentNode)&&(e=e.parentNode,!n||!n(e.parentNode)););return t(e.parentNode)&&(i=e),i},b=function(e,t){return l.default.isString(t)?_(e,function(e){return t===f(e)}):_(e,function(e){return t===e})},k=function(e,t,n){var i=e+"Sibling",o=void 0;return t=b(t,n),t&&t[i]&&(o=t[i]),o},w=function(e,t){return k("previous",e,t)},C=function(e,t){return k("next",e,t)},E=function(e){return b(e,"BODY")},M=function(e){for(e=e.previousSibling||e.parentNode;!u(e)&&"BODY"!==f(e);)if(e.previousSibling)for(e=e.previousSibling;e.lastChild;)e=e.lastChild;else e=e.parentNode;return"BODY"===f(e)&&(e=null),e},T=function(e,t){for(var n=document.createTreeWalker(e,4,null,!1),i=e===t;!i&&n.nextNode();)i=n.currentNode===t;return i},S=function(e,t,n){var i=[],o="",a=0,r=void 0;if(!t.length)return i;for(var s=t.shift(),u=document.createTreeWalker(e,4,null,!1);u.nextNode();){for(o=u.currentNode.nodeValue||"",n&&(o=n(o)),r=a+o.length;r>=s;){if(i.push({container:u.currentNode,offsetInContainer:s-a,offset:s}),!t.length)return i;s=t.shift()}a=r}do{i.push({container:u.currentNode,offsetInContainer:o.length,offset:s}),s=t.shift()}while(!l.default.isUndefined(s));return i},O=function(e){var t={};t.tagName=e.nodeName,e.id&&(t.id=e.id);var n=e.className.trim();return n&&(t.className=n),t},L=function(e,t){for(var n=[];e&&e!==t;)c(e)&&n.unshift(O(e)),e=e.parentNode;return n},x=function(e,t){var n=!0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t?null:("previous"===t&&(n=!1),n?e.nextElementSibling:e.previousElementSibling)},N=function(e,t,n){var i=!0,o=null,r=void 0,s=void 0,u=void 0,c=void 0,d=void 0,h=void 0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t?null:("previous"===t&&(i=!1),e?(r=(0,a.default)(e),i?(u=r.parent().next(),c=r.parents("thead"),d=c[0]&&c.next(),h=d&&"TBODY"===f(d[0]),s=0):(u=r.parent().prev(),c=r.parents("tbody"),d=c[0]&&c.prev(),h=d&&"THEAD"===f(d[0]),s=e.parentNode.childNodes.length-1),!l.default.isUndefined(n)&&n||(s=v(e)),u[0]?o=u.children("td,th")[s]:c[0]&&h&&(o=d.find("td,th")[s]),o):null)},A=function(e){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(e.nodeName)},B=function(e){return/^(A|ABBR|ACRONYM|B|BDI|BDO|BIG|CITE|CODE|DEL|DFN|EM|I|INS|KBD|MARK|Q|S|SAMP|SMALL|SPAN|STRONG|SUB|SUP|U|VAR)$/gi.test(e.nodeName)},P=function(e,t,n){var i=t;if(i&&e===i.parentNode)for(;i!==n;){var o=i.nextSibling;e.removeChild(i),i=o}},I=function(e,t,n){for(var i=t;i!==e;){var o=i.parentNode,a=i,r=a.nextSibling,l=a.previousSibling;!n&&r?P(o,r,null):n&&l&&P(o,o.childNodes[0],i),i=o}},R=function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t,i=n.firstChild;t=u(i)&&!h(i)?i.nextSibling||i:i}return t};t.default={getNodeName:f,isTextNode:u,isElemNode:c,isBlockNode:d,getTextLength:h,getOffsetLength:g,getPrevOffsetNodeUntil:y,getNodeOffsetOfParent:v,getChildNodeByOffset:p,containsNode:T,getTopPrevNodeUnder:w,getTopNextNodeUnder:C,getParentUntilBy:_,getParentUntil:b,getTopBlockNode:E,getPrevTextNode:M,findOffsetNode:S,getPath:L,getNodeInfo:O,getTableCellByDirection:x,getSiblingRowCellByDirection:N,isMDSupportInlineNode:A,isStyledNode:B,removeChildFromStartToEndNode:P,removeNodesByDirection:I,getLeafNode:R}},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(0),u=i(s),c=n(1),d=i(c),f=n(8),h=i(f),g="tui-popup-",v='<div class="'+g+'header">\n <span class="'+g+'title"></span>\n <div class="'+g+'header-buttons">\n <button type="button" class="'+g+'close-button"></button>\n </div>\n </div>\n <div class="'+g+'body"></div>',p='<div class="'+g+'wrapper">\n <div class="'+g+'header">\n <span class="'+g+'title"></span>\n <div class="'+g+'header-buttons">\n <button type="button" class="'+g+'close-button"></button>\n </div>\n </div>\n <div class="'+g+'body"></div>\n </div>',m=function(e){function t(e){o(this,t),e=d.default.extend({header:!0,$target:(0,u.default)("body"),textContent:""},e);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:e.modal?g+"modal-background":g+"wrapper",rootElement:e.$el}));return n._initInstance(e),n._initDOM(e),n._initDOMEvent(e),n._initEditorEvent(e),n}return r(t,e),l(t,[{key:"_initInstance",value:function(e){this._$target=e.$target,e.$el&&(this.$el=e.$el,this._isExternalHtmlUse=!0),e.content?this.$content=(0,u.default)(e.content):this.$content=e.textContent,this.options=e}},{key:"_initDOM",value:function(){this._initLayout(),this._isExternalHtmlUse||(d.default.isExisty(this.options.title)&&this.setTitle(this.options.title),this.setContent(this.$content));var e=this.options.headerButtons;if(e){this.$el.find("."+g+"close-button").remove();var t=this.$el.find("."+g+"header-buttons");t.empty(),t.append((0,u.default)(e))}this.options.css&&this.$el.css(this.options.css)}},{key:"_initDOMEvent",value:function(){var e=this,t=this.options,n=t.openerCssQuery,i=t.closerCssQuery;n&&(0,u.default)(n).on("click."+this._id,function(){return e.show()}),i&&(0,u.default)(i).on("click."+this._id,function(){return e.hide()}),this.on("click ."+g+"close-button",function(){return e.hide()})}},{key:"_initEditorEvent",value:function(){}},{key:"_initLayout",value:function(){var e=this.options;if(this._isExternalHtmlUse)this.hide(),this._$target.append(this.$el);else{var t=e.modal?p:v;this.$el.html(t),this.$el.addClass(e.className),this.hide(),this._$target.append(this.$el),this.$body=this.$el.find("."+g+"body"),e.header||this.$el.find("."+g+"header").remove()}}},{key:"setContent",value:function(e){this.$body.empty(),this.$body.append(e)}},{key:"setTitle",value:function(e){var t=this.$el.find("."+g+"title");t.empty(),t.append(e)}},{key:"getTitleElement",value:function(){return this.$el.find("."+g+"title").get(0)}},{key:"hide",value:function(){this.$el.css("display","none"),this._isShow=!1,this.trigger("hidden",this)}},{key:"show",value:function(){this.$el.css("display","block"),this._isShow=!0,this.trigger("shown",this)}},{key:"isShow",value:function(){return this._isShow}},{key:"remove",value:function(){var e=this.options,t=e.openerCssQuery,n=e.closerCssQuery;this.trigger("remove",this),this.off(),t&&(0,u.default)(t).off("."+this._id),n&&(0,u.default)(n).off("."+this._id),this.$el.remove(),this.$el=null}},{key:"setFitToWindow",value:function(e){this.$el.toggleClass("fit-window",e)}},{key:"isFitToWindow",value:function(){return this.$el.hasClass("fit-window")}},{key:"toggleFitToWindow",value:function(){var e=!this.isFitToWindow();return this.setFitToWindow(e),e}}]),t}(h.default);t.default=m},function(e,t){e.exports=n},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(31),l=function(e){return e&&e.__esModule?e:{default:e}}(r),s=function(){function e(){i(this,e),this._replacers={}}return a(e,[{key:"setReplacer",value:function(e,t){this._replacers[e]=t}},{key:"getReplacer",value:function(e){return this._replacers[e]}},{key:"createCodeBlockHtml",value:function(e,t){var n=this.getReplacer(e);return n?n(t,e):l.default.getLanguage(e)?l.default.highlight(e,t).value:o(t,!1)}}],[{key:"getHighlightJSLanguages",value:function(){return l.default.listLanguages()}}]),e}();t.CodeBlockManager=s,t.default=new s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return d+=1}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(0),s=i(l),u=n(1),c=i(u),d=-1,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,e),t=c.default.extend({tagName:"div"},t),this.tagName=t.tagName,this.className=t.className,this._id=a(),this._setRootElement(t.rootElement)}return r(e,[{key:"on",value:function(e,t){var n=this;c.default.isObject(e)?c.default.forEach(e,function(e,t){n._addEvent(t,e)}):this._addEvent(e,t)}},{key:"_addEvent",value:function(e,t){var n=this._parseEventType(e),i=n.event,o=n.selector;o?this.$el.on(i,o,t):this.$el.on(i,t)}},{key:"off",value:function(e,t){if(e){var n=this._parseEventType(e),i=n.event,o=n.selector;o?this.$el.off(i,o,t):this.$el.off(i,t)}else this.$el.off()}},{key:"_parseEventType",value:function(e){var t=e.split(" ");return{event:t.shift(),selector:t.join(" ")}}},{key:"_setRootElement",value:function(e){var t=this.tagName,n=this.className;e||(n=n||"uic"+this._id,e=(0,s.default)("<"+t+' class="'+n+'"/>')),this.$el=e}},{key:"trigger",value:function(){var e;(e=this.$el).trigger.apply(e,arguments)}},{key:"_getEventNameWithNamespace",value:function(e){var t=e.split(" ");return t[0]+=".uicEvent"+this._id,t.join(" ")}},{key:"remove",value:function(){this.$el&&this.$el.remove()}},{key:"destroy",value:function(){var e=this;this.remove(),c.default.forEachOwnProperties(this,function(t,n){e[n]=null})}}]),e}();t.default=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=(0,u.default)("<div />");return e=e.replace(/<!--[\s\S]*?-->/g,""),n.append(e),a(n),r(n),l(n,t)}function a(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title").remove()}function r(e){e.find("*").each(function(e,t){var n=t.attributes,i=d.default.toArray(n).filter(function(e){var t=e.name.match(f),n=e.name.match(h);return!t&&!n});d.default.forEachArray(i,function(e){n.getNamedItem(e.name)&&n.removeNamedItem(e.name)})})}function l(e,t){var n=void 0;if(t)n=e[0].innerHTML;else{for(var i=document.createDocumentFragment(),o=d.default.toArray(e[0].childNodes),a=o.length,r=0;r<a;r+=1)i.appendChild(o[r]);n=i}return n}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=i(s),c=n(1),d=i(c),f=new RegExp("^(abbr|align|alt|axis|bgcolor|border|cellpadding|cellspacing|class|clear|color|cols|compact|coords|dir|face|headers|height|hreflang|hspace|ismap|lang|language|nohref|nowrap|rel|rev|rows|rules|scope|scrolling|shape|size|span|start|summary|tabindex|target|title|type|valign|value|vspace|width|checked|mathvariant|encoding|id|name|background|cite|href|longdesc|src|usemap|xlink:href|data-+|checked|style)","g"),h=new RegExp("^(accent-height|accumulate|additive|alphabetic|arabic-form|ascent|baseProfile|bbox|begin|by|calcMode|cap-height|class|color|color-rendering|content|cx|cy|d|dx|dy|descent|display|dur|end|fill|fill-rule|font-family|font-size|font-stretch|font-style|font-variant|font-weight|from|fx|fy|g1|g2|glyph-name|gradientUnits|hanging|height|horiz-adv-x|horiz-origin-x|ideographic|k|keyPoints|keySplines|keyTimes|lang|marker-end|marker-mid|marker-start|markerHeight|markerUnits|markerWidth|mathematical|max|min|offset|opacity|orient|origin|overline-position|overline-thickness|panose-1|path|pathLength|points|preserveAspectRatio|r|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|rotate|rx|ry|slope|stemh|stemv|stop-color|stop-opacity|strikethrough-position|strikethrough-thickness|stroke|stroke-dasharray|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|systemLanguage|target|text-anchor|to|transform|type|u1|u2|underline-position|underline-thickness|unicode|unicode-range|units-per-em|values|version|viewBox|visibility|width|widths|x|x-height|x1|x2|xlink:actuate|xlink:arcrole|xlink:role|xlink:show|xlink:title|xlink:type|xml:base|xml:lang|xml:space|xmlns|xmlns:xlink|y|y1|y2|zoomAndPan)","g");t.default=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),o=new Uint8Array(i),a=0;a<t.length;a+=1)o[a]=t.charCodeAt(a);return new Blob([i],{type:n})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(r),s=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g,u=function(){function e(t){i(this,e),this.eventManager=t,this._initEvent(),this._initDefaultImageImporter()}return a(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("drop",function(t){var n=t.data.dataTransfer&&t.data.dataTransfer.files;e._processBlobItems(n,t.data)}),this.eventManager.listen("willPaste",function(t){var n=t.data.fragment,i=n.querySelectorAll("*");if(1===i.length&&"IMG"===i[0].tagName&&/^data:image/.test(i[0].src)){t.data.preventDefault();var a=o(i[0].src);e._emitAddImageBlobHook(a,"paste")}}),this.eventManager.listen("paste",function(t){e._processClipboard(t.data)}),this.eventManager.listen("pasteBefore",function(t){e._decodeURL(t)})}},{key:"_initDefaultImageImporter",value:function(){this.eventManager.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)})}},{key:"_emitAddImageBlobHook",value:function(e,t){var n=this;this.eventManager.emit("addImageBlobHook",e,function(t,i){n.eventManager.emit("command","AddImage",{imageUrl:t,altText:i||e.name||"image"})},t)}},{key:"_decodeURL",value:function(t){var n=e.decodeURIGraceful,i=e.encodeMarkdownCharacters;if("markdown"===t.source&&t.data.text){var o=t.data.text,a=o[0];1===o.length&&a.match(s)&&(a=n(a),a=i(a),t.data.update(null,null,[a]))}else if("wysiwyg"===t.source){var r=t.$clipboardContainer.get(0),l=r.childNodes[0],u=l.innerText;1===r.childNodes.length&&"A"===l.tagName&&u.match(s)&&(l.innerText=n(u),l.href=i(l.href))}}},{key:"_processClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items,i=t.types;n&&i&&1===i.length&&-1!==l.default.inArray("Files",[].slice.call(i))&&this._processBlobItems(n,e)}},{key:"_processBlobItems",value:function(e,t){var n=this;e&&l.default.forEachArray(e,function(e){if(-1!==e.type.indexOf("image")){t.preventDefault(),t.stopPropagation(),t.codemirrorIgnore=!0;var i=e.name?e:e.getAsFile();return n._emitAddImageBlobHook(i,t.type),!1}return!0})}}],[{key:"decodeURIGraceful",value:function(e){var t=e.split(" "),n=[],i=void 0;return l.default.forEachArray(t,function(e){try{i=decodeURIComponent(e),i=i.replace(/ /g,"%20")}catch(t){i=e}return n.push(i)}),n.join(" ")}},{key:"encodeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/</g,"%3C").replace(/>/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/</g,"\\<").replace(/>/g,"\\>")}}]),e}();t.default=u},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(1),u=i(s),c=n(8),d=i(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:t.name};o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.default.extend({className:t.className},e)));return n._name=e.name,n}return r(t,e),l(t,[{key:"getName",value:function(){return this._name}}]),t}(d.default);Object.defineProperty(f,"name",{enumerable:!0,writable:!0,value:"item"}),Object.defineProperty(f,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-item"}),t.default=f},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},s=n(13),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,n,a,r){i(this,t);var l=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a,r));return l._initEvent(),l}return a(t,e),r(t,[{key:"_initEvent",value:function(){var e=this,t="";this.eventManager.listen("contentChangedFromMarkdown",function(n){t=n.getValue(),e.isVisible()&&e.lazyRunner.run("refresh",t.replace(/<br>\n/g,"<br>"))}),this.eventManager.listen("previewNeedsRefresh",function(n){e.refresh(n||t)}),this.$el.on("scroll",function(t){e.eventManager.emit("scroll",{source:"preview",data:t})})}},{key:"render",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,e),this.eventManager.emit("previewRenderAfter",this)}},{key:"remove",value:function(){this.$el.off("scroll"),this.$el=null}}]),t}(u.default);t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(20),u=i(s),c=function(){function e(t,n,i,a){o(this,e),this.eventManager=n,this.convertor=i,this.$el=t,this.isViewer=!!a,this._initContentSection(),this.lazyRunner=new u.default,this.lazyRunner.registerLazyRunFunction("refresh",this.refresh,800,this)}return a(e,[{key:"_initContentSection",value:function(){this._$previewContent=(0,l.default)('<div class="tui-editor-contents" />'),this.$el.append(this._$previewContent)}},{key:"refresh",value:function(e){this.render(this.convertor.toHTMLWithCodeHightlight(e))}},{key:"getHTML",value:function(){return this._$previewContent.html()}},{key:"setHTML",value:function(e){this._$previewContent.html(e)}},{key:"render",value:function(e){var t=this._$previewContent;e=this.eventManager.emit("previewBeforeHook",e)||e,t.empty(),t.html(e)}},{key:"setHeight",value:function(e){this.$el.get(0).style.height=e+"px"}},{key:"setMinHeight",value:function(e){this.$el.get(0).style.minHeight=e+"px"}},{key:"isVisible",value:function(){return"none"!==this.$el.css("display")}}]),e}();t.default=c},function(e,t,n){"use strict";var i=/Mac/.test(navigator.platform);e.exports={isMac:i}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=["previewBeforeHook","previewRenderAfter","previewNeedsRefresh","addImageBlobHook","setMarkdownAfter","contentChangedFromWysiwyg","changeFromWysiwyg","contentChangedFromMarkdown","changeFromMarkdown","change","changeModeToWysiwyg","changeModeToMarkdown","changeModeBefore","changeMode","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","openPopupAddLink","openPopupAddImage","openPopupAddTable","openPopupTableUtils","openHeadingSelect","openPopupCodeBlockLanguages","openPopupCodeBlockEditor","openDropdownToolbar","closePopupCodeBlockLanguages","closePopupCodeBlockEditor","closeAllPopup","command","addCommandBefore","htmlUpdate","markdownUpdate","renderedHtmlUpdated","removeEditor","convertorAfterMarkdownToHtmlConverted","convertorBeforeHtmlToMarkdownConverted","convertorAfterHtmlToMarkdownConverted","stateChange","wysiwygSetValueAfter","wysiwygSetValueBefore","wysiwygGetValueBefore","wysiwygProcessHTMLText","wysiwygRangeChangeAfter","wysiwygKeyEvent","scroll","click","mousedown","mouseover","mouseout","mouseup","contextmenu","keydown","keyup","keyMap","load","focus","blur","paste","pasteBefore","willPaste","copy","copyBefore","copyAfter","cut","cutAfter","drop","show","hide"],s=function(){function e(){i(this,e),this.events=new r.default.Map,this.TYPE=new r.default.Enum(l)}return o(e,[{key:"listen",value:function(e,t){var n=this._getTypeInfo(e),i=this.events.get(n.type)||[];if(!this._hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),i.push(t),this.events.set(n.type,i)}},{key:"emit",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.shift(),o=this._getTypeInfo(i),a=this.events.get(o.type),l=void 0;return a&&r.default.forEach(a,function(e){var n=e.apply(void 0,t);r.default.isUndefined(n)||(l=l||[],l.push(n))}),l}},{key:"emitReduce",value:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.shift(),o=this.events.get(i);return o&&r.default.forEach(o,function(e){var n=e.apply(void 0,t);r.default.isFalsy(n)||(t[0]=n)}),t[0]}},{key:"_getTypeInfo",value:function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}}},{key:"_hasEventType",value:function(e){return!r.default.isUndefined(this.TYPE[this._getTypeInfo(e).type])}},{key:"addEventType",value:function(e){if(this._hasEventType(e))throw new Error("There is already have event type "+e);this.TYPE.set(e)}},{key:"removeEventHandler",value:function(e,t){var n=this,i=this._getTypeInfo(e),o=i.type,a=i.namespace;o&&t?this._removeEventHandlerWithHandler(o,t):o&&!a?this.events.delete(o):!o&&a?this.events.forEach(function(e,t){n._removeEventHandlerWithTypeInfo(t,a)}):o&&a&&this._removeEventHandlerWithTypeInfo(o,a)}},{key:"_removeEventHandlerWithHandler",value:function(e,t){var n=this.events.get(e)||[],i=n.indexOf(t);i>=0&&n.splice(i,1)}},{key:"_removeEventHandlerWithTypeInfo",value:function(e,t){var n=[],i=this.events.get(e);i&&(i.map(function(e){return e.namespace!==t&&n.push(e),null}),this.events.set(e,n))}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(){i(this,e),this.exts=new r.default.Map}return o(e,[{key:"defineExtension",value:function(e,t){this.exts.set(e,t)}},{key:"applyExtension",value:function(e,t){var n=this;t&&t.forEach(function(t){var i=r.default.isObject(t),o=i?t.name:t;if(n.exts.has(o)){var a=n.exts.get(o);i?a(e,t):a(e)}})}}]),e}();t.default=new l},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(22),d=i(c),f=n(23),h=i(f),g=n(9),v=i(g),p=n(24),m=i(p),y=n(25),_=i(y),b=n(26),k=i(b),w=n(27),C=i(w),E=n(28),M=i(E),T=n(29),S=i(T),O=n(30),L=i(O),x=n(7),N=i(x),A=new d.default({html:!0,breaks:!0,quotes:"“”‘’",langPrefix:"lang-",highlight:function(e,t){return N.default.createCodeBlockHtml(t,e)}}),B=new d.default({html:!0,breaks:!0,quotes:"“”‘’",langPrefix:"lang-"});A.block.ruler.at("code",k.default),A.block.ruler.at("table",M.default,{alt:["paragraph","reference"]}),A.block.ruler.at("blockquote",C.default,{alt:["paragraph","reference","blockquote","list"]}),A.block.ruler.at("html_block",S.default,{alt:["paragraph","reference","blockquote"]}),A.inline.ruler.at("backticks",L.default),A.use(m.default),A.use(_.default),B.block.ruler.at("code",k.default),B.block.ruler.at("table",M.default,{alt:["paragraph","reference"]}),B.block.ruler.at("blockquote",C.default,{alt:["paragraph","reference","blockquote","list"]}),B.block.ruler.at("html_block",S.default,{alt:["paragraph","reference","blockquote"]}),B.inline.ruler.at("backticks",L.default),B.use(m.default),B.use(_.default);var P=function(){function e(t){o(this,e),this.eventManager=t}return a(e,[{key:"_markdownToHtmlWithCodeHighlight",value:function(e){e=e.replace(/<br>/gi,"<br data-tomark-pass>");for(var t=/(<img[^>]*)(onerror\s*=\s*[\"']?[^\"']*[\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");var n=A.render(e);return n=this._removeBrToMarkPassAttributeInCode(n)}},{key:"_markdownToHtml",value:function(e){e=e.replace(/<br>/gi,"<br data-tomark-pass>");for(var t=/(<img[^>]*)(onerror\s*=\s*[\"']?[^\"']*[\"']?)(.*)/i;t.exec(e);)e=e.replace(t,"$1$3");var n=B.render(e);return n=this._removeBrToMarkPassAttributeInCode(n)}},{key:"_removeBrToMarkPassAttributeInCode",value:function(e){var t=(0,l.default)("<div />");return t.html(e),t.find("code, pre").each(function(e,t){var n=(0,l.default)(t);n.html(n.html().replace(/&lt;br data-tomark-pass&gt;/,"&lt;br&gt;"))}),e=t.html()}},{key:"toHTMLWithCodeHightlight",value:function(e){var t=this._markdownToHtmlWithCodeHighlight(e);return t=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t)}},{key:"toHTML",value:function(e){var t=this._markdownToHtml(e);return t=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t)}},{key:"initHtmlSanitizer",value:function(){this.eventManager.listen("convertorAfterMarkdownToHtmlConverted",function(e){return(0,v.default)(e,!0)})}},{key:"toMarkdown",value:function(e,t){var n=[];e=this.eventManager.emitReduce("convertorBeforeHtmlToMarkdownConverted",e);var i=(0,h.default)(this._appendAttributeForBrIfNeed(e),t);return i=this.eventManager.emitReduce("convertorAfterHtmlToMarkdownConverted",i),u.default.forEach(i.split("\n"),function(e,t){var i=/^\|[^|]*\|/gi;/`[^`]*<br>[^`]*`/gi.test(e)||i.test(e)||(e=e.replace(/<br>/gi,"<br>\n")),n[t]=e}),n.join("\n")}},{key:"_appendAttributeForBrIfNeed",value:function(e){var t=/<br>/gi,n=/<br \/><br \/>/gi,i=/<br data-tomark-pass \/><br \/>(.)/gi,o=/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|<img [^>]*>)/,a=/<br data-tomark-pass \/><br data-tomark-pass \/>/,r=new RegExp(o.source+a.source,"g");e=e.replace(t,"<br />"),e=e.replace(n,"<br data-tomark-pass /><br data-tomark-pass />");var s=document.createElement("div"),u=(0,l.default)(s);return u.html(e),u.find("pre br,code br").each(function(e,t){t.hasAttribute("data-tomark-pass")&&t.removeAttribute("data-tomark-pass")}),e=u.html().replace(/<br data-tomark-pass="">/gi,"<br data-tomark-pass />"),e=e.replace(t,"<br />"),e=e.replace(i,"<br data-tomark-pass /><br data-tomark-pass />$1"),e=e.replace(r,"$1<br /><br />")}}],[{key:"getMarkdownitHighlightRenderer",value:function(){return A}},{key:"getMarkdownitRenderer",value:function(){return B}}]),e}();t.default=P},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(11),u=i(s),c=n(34),d=i(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tagName:"button",name:t.name};o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:e.name,tagName:"button",className:e.className+" "+t.className,rootElement:e.$el}));return n._setOptions(e),n._render(),n.on("click",n._onClick.bind(n)),e.tooltip&&(n.on("mouseover",n._onOver.bind(n)),n.on("mouseout",n._onOut.bind(n))),n}return r(t,e),l(t,[{key:"setTooltip",value:function(e){this._tooltip=e}},{key:"_setOptions",value:function(e){this._command=e.command,this._event=e.event,this._text=e.text,this._tooltip=e.tooltip,this._style=e.style,this._state=e.state}},{key:"_render",value:function(){this.$el.text(this._text),this.$el.attr("type","button"),this._style&&this.$el.attr("style",this._style)}},{key:"_onClick",value:function(){this.isEnabled()&&(this._command?this.trigger("command",this._command):this._event&&this.trigger("event",this._event),this.trigger("clicked"))}},{key:"_onOver",value:function(){this.isEnabled()&&d.default.show(this.$el,this._tooltip)}},{key:"_onOut",value:function(){d.default.hide()}},{key:"enable",value:function(){this.$el.attr("disabled",!1)}},{key:"disable",value:function(){this.$el.attr("disabled",!0)}},{key:"isEnabled",value:function(){return!this.$el.attr("disabled")}}]),t}(u.default);Object.defineProperty(f,"name",{enumerable:!0,writable:!0,value:"button"}),Object.defineProperty(f,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-icons"}),t.default=f},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=["","","","CANCEL","","","HELP","","BACK_SPACE","TAB","","","CLEAR","ENTER","ENTER_SPECIAL","","","","","PAUSE","CAPS_LOCK","KANA","EISU","JUNJA","FINAL","HANJA","","ESCAPE","CONVERT","NONCONVERT","ACCEPT","MODECHANGE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","SELECT","PRINT","EXECUTE","PRINTSCREEN","INSERT","DELETE","","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","AT","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","","","CONTEXT_MENU","","SLEEP","NUMPAD0","NUMPAD1","NUMPAD2","NUMPAD3","NUMPAD4","NUMPAD5","NUMPAD6","NUMPAD7","NUMPAD8","NUMPAD9","MULTIPLY","ADD","SEPARATOR","SUBTRACT","DECIMAL","DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","","","","","","","","","NUM_LOCK","SCROLL_LOCK","WIN_OEM_FJ_JISHO","WIN_OEM_FJ_MASSHOU","WIN_OEM_FJ_TOUROKU","WIN_OEM_FJ_LOYA","WIN_OEM_FJ_ROYA","","","","","","","","","","@","!",'"',"#","$","%","&","_","(",")","*","+","|","-","{","}","~","","","","","VOLUME_MUTE","VOLUME_DOWN","VOLUME_UP","","",";","=",",","-",".","/","`","","","","","","","","","","","","","","","","","","","","","","","","","","","[","\\","]","'","","META","ALTGR","","WIN_ICO_HELP","WIN_ICO_00","","WIN_ICO_CLEAR","","","WIN_OEM_RESET","WIN_OEM_JUMP","WIN_OEM_PA1","WIN_OEM_PA2","WIN_OEM_PA3","WIN_OEM_WSCTRL","WIN_OEM_CUSEL","WIN_OEM_ATTN","WIN_OEM_FINISH","WIN_OEM_COPY","WIN_OEM_AUTO","WIN_OEM_ENLW","WIN_OEM_BACKTAB","ATTN","CRSEL","EXSEL","EREOF","PLAY","ZOOM","","PA1","WIN_OEM_CLEAR",""],r=void 0,l=function(){function e(t){i(this,e),this._setSplitter(t)}return o(e,[{key:"_setSplitter",value:function(e){var t=e?e.splitter:"+";this._splitter=t}},{key:"convert",value:function(e){var t=[];e.shiftKey&&t.push("SHIFT"),e.ctrlKey&&t.push("CTRL"),e.metaKey&&t.push("META"),e.altKey&&t.push("ALT");var n=this._getKeyCodeChar(e.keyCode);return n&&t.push(n),t.join(this._splitter)}},{key:"_getKeyCodeChar",value:function(e){return a[e]}}],[{key:"getSharedInstance",value:function(){return r||(r=new e),r}},{key:"keyCode",value:function(e){return a.indexOf(e)}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(){i(this,e),this.globalTOID=null,this.lazyRunFunctions={}}return o(e,[{key:"run",value:function(e,t,n,i){var o=void 0;return r.default.isString(e)?o=this._runRegisteredRun(e,t,n,i):(o=this._runSingleRun(e,t,n,i,this.globalTOID),this.globalTOID=o),o}},{key:"registerLazyRunFunction",value:function(e,t,n,i){i=i||this,this.lazyRunFunctions[e]={fn:t,delay:n,context:i,TOID:null}}},{key:"_runSingleRun",value:function(e,t,n,i,o){return this._clearTOIDIfNeed(o),o=setTimeout(function(){e.call(n,t)},i)}},{key:"_runRegisteredRun",value:function(e,t,n,i){var o=this.lazyRunFunctions[e],a=o.fn,r=o.TOID;return i=i||o.delay,n=n||o.context,r=this._runSingleRun(a,t,n,i,r),o.TOID=r,r}},{key:"_clearTOIDIfNeed",value:function(e){e&&clearTimeout(e)}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(t,n,o){i(this,e),this.name=t,this.type=n,o&&this.setKeyMap(o)}return o(e,[{key:"getName",value:function(){return this.name}},{key:"getType",value:function(){return this.type}},{key:"isMDType",value:function(){return this.type===e.TYPE.MD}},{key:"isWWType",value:function(){return this.type===e.TYPE.WW}},{key:"isGlobalType",value:function(){return this.type===e.TYPE.GB}},{key:"setKeyMap",value:function(e,t){this.keyMap=[e,t]}}]),e}();l.factory=function(e,t){var n=void 0;"markdown"===e?n=l.TYPE.MD:"wysiwyg"===e?n=l.TYPE.WW:"global"===e&&(n=l.TYPE.GB);var i=new l(t.name,n);return r.default.extend(i,t),i},l.TYPE={MD:0,WW:1,GB:2},t.default=l},function(e,t){e.exports=i},function(e,t){e.exports=o},function(e,t,n){"use strict";function i(e){e.content=e.content.slice(4),e.children[0].content=e.children[0].content.slice(4)}function o(e){var t=!1;return 0!==e.content.indexOf("[x]")&&0!==e.content.indexOf("[X]")||(t=!0),t}function a(e,t,n){var i=e.attrIndex(t),o=[t,n];i<0?e.attrPush(o):e.attrs[i]=o}function r(e,t){return"inline"===e[t].type&&"paragraph_open"===e[t-1].type&&"list_item_open"===e[t-2].type&&(0===e[t].content.indexOf("[ ]")||0===e[t].content.indexOf("[x]")||0===e[t].content.indexOf("[X]"))}var l=function(e){e.core.ruler.after("inline","tui-task-list",function(e){var t,n,l=e.tokens;for(n=2;n<l.length;n+=1)r(l,n)&&(t=o(l[n])?"task-list-item checked":"task-list-item",i(l[n]),a(l[n-2],"class",t),a(l[n-2],"data-te-task",""))})};e.exports=l},function(e,t,n){"use strict";function i(e,t,n){var i=e.attrIndex(t),o=[t,n];i<0?e.attrPush(o):e.attrs[i]=o}function o(e){return!0===e.block&&"code"===e.tag&&"fence"===e.type}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var r=function(e){e.core.ruler.after("block","tui-code-block",function(e){var t,n,r,l=e.tokens;for(n=0;n<l.length;n+=1)t=l[n],o(t)&&(r=t.markup.length,r>3&&i(t,"data-backticks",r),t.info&&i(t,"data-language",a(t.info.replace(" ",""),!0)))})};e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n){var i,o,a,r=/ {0,3}(?:-|\*|\d\.) /,l=e.src.split("\n"),s=l[t],u=0;if(s.match(r)||e.sCount[t]-e.blkIndent<4)return!1;for(o=i=t+1;i<n;)if(e.isEmpty(i)){if(++u>=2&&"list"===e.parentType)break;i++}else{if(u=0,!(e.sCount[i]-e.blkIndent>=4))break;i++,o=i}return e.line=o,a=e.push("code_block","code",0),a.content=e.getLines(t,o,4+e.blkIndent,!0),a.map=[t,e.line],!0}},function(e,t,n){"use strict";function i(e){switch(e){case 9:case 32:return!0}return!1}e.exports=function(e,t,n,o){var a,r,l,s,u,c,d,f,h,g,v,p,m,y,_,b,k,w,C,E,M=e.lineMax,T=e.bMarks[t]+e.tShift[t],S=e.eMarks[t],O=/(?:-|\*|\d+\.) {1,4}(?:> {0,3})[^>]*$/,L=e.src.split("\n"),x=L[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(T++))return!1;if(x.match(O))return!1;if(o)return!0;for(s=h=e.sCount[t]+T-(e.bMarks[t]+e.tShift[t]),32===e.src.charCodeAt(T)?(T++,s++,h++,a=!1,b=!0):9===e.src.charCodeAt(T)?(b=!0,(e.bsCount[t]+h)%4==3?(T++,s++,h++,a=!1):a=!0):b=!1,g=[e.bMarks[t]],e.bMarks[t]=T;T<S&&(r=e.src.charCodeAt(T),i(r));)9===r?h+=4-(h+e.bsCount[t]+(a?1:0))%4:h++,T++;for(v=[e.bsCount[t]],e.bsCount[t]=e.sCount[t]+1+(b?1:0),c=T>=S,y=[e.sCount[t]],e.sCount[t]=h-s,_=[e.tShift[t]],e.tShift[t]=T-e.bMarks[t],w=e.md.block.ruler.getRules("blockquote"),m=e.parentType,e.parentType="blockquote",E=!1,f=t+1;f<n&&(e.sCount[f]<e.blkIndent&&(E=!0),T=e.bMarks[f]+e.tShift[f],S=e.eMarks[f],!(T>=S));f++)if(62!==e.src.charCodeAt(T++)||E){if(c)break;for(k=!1,l=0,u=w.length;l<u;l++)if(w[l](e,f,n,!0)){k=!0;break}if(k){e.lineMax=f,0!==e.blkIndent&&(g.push(e.bMarks[f]),v.push(e.bsCount[f]),_.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}g.push(e.bMarks[f]),v.push(e.bsCount[f]),_.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]=-1}else{for(s=h=e.sCount[f]+T-(e.bMarks[f]+e.tShift[f]),32===e.src.charCodeAt(T)?(T++,s++,h++,a=!1,b=!0):9===e.src.charCodeAt(T)?(b=!0,(e.bsCount[f]+h)%4==3?(T++,s++,h++,a=!1):a=!0):b=!1,g.push(e.bMarks[f]),e.bMarks[f]=T;T<S&&(r=e.src.charCodeAt(T),i(r));)9===r?h+=4-(h+e.bsCount[f]+(a?1:0))%4:h++,T++;c=T>=S,v.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(b?1:0),y.push(e.sCount[f]),e.sCount[f]=h-s,_.push(e.tShift[f]),e.tShift[f]=T-e.bMarks[f]}for(p=e.blkIndent,e.blkIndent=0,C=e.push("blockquote_open","blockquote",1),C.markup=">",C.map=d=[t,0],e.md.block.tokenize(e,t,f),C=e.push("blockquote_close","blockquote",-1),C.markup=">",e.lineMax=M,e.parentType=m,d[1]=e.line,l=0;l<_.length;l++)e.bMarks[l+t]=g[l],e.tShift[l+t]=_[l],e.sCount[l+t]=y[l],e.bsCount[l+t]=v[l];return e.blkIndent=p,!0}},function(e,t,n){"use strict";function i(e,t){var n=e.bMarks[t]+e.blkIndent,i=e.eMarks[t];return e.src.substr(n,i-n)}function o(e){var t,n=[],i=0,o=e.length,a=0,r=0,l=!1,s=0;for(t=e.charCodeAt(i);i<o;)96===t&&a%2==0?(l=!l,s=i):124!==t||a%2!=0||l?92===t?a+=1:a=0:(n.push(e.substring(r,i)),r=i+1),i+=1,i===o&&l&&(l=!1,i=s+1),t=e.charCodeAt(i);return n.push(e.substring(r)),n}e.exports=function(e,t,n,a){var r,l,s,u,c,d,f,h,g,v,p,m,y;if(t+2>n)return!1;if(c=t+1,e.sCount[c]<e.blkIndent)return!1;if((s=e.bMarks[c]+e.tShift[c])>=e.eMarks[c])return!1;if(124!==(r=e.src.charCodeAt(s))&&45!==r&&58!==r)return!1;if(l=i(e,t+1),!/^[-:| ]+$/.test(l))return!1;for(d=l.split("|"),g=[],u=0;u<d.length;u+=1){if(!(p=d[u].trim())){if(0===u||u===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(p))return!1;58===p.charCodeAt(p.length-1)?g.push(58===p.charCodeAt(0)?"center":"right"):58===p.charCodeAt(0)?g.push("left"):g.push("")}if(v=g.length,l=i(e,t).trim(),-1===l.indexOf("|"))return!1;if(d=o(l.replace(/^\||\|$/g,"")),(f=d.length)>v)return!1;if(f<v){for(u=0;u<v-f;u+=1)d.push("");f=d.length}if(a)return!0;for(h=e.push("table_open","table",1),h.map=m=[t,0],h=e.push("thead_open","thead",1),h.map=[t,t+1],h=e.push("tr_open","tr",1),h.map=[t,t+1],u=0;u<f;u+=1)h=e.push("th_open","th",1),h.map=[t,t+1],g[u]&&(h.attrs=[["align",g[u]]]),h=e.push("inline","",0),h.content=d[u].trim(),h.map=[t,t+1],h.children=[],h=e.push("th_close","th",-1);for(h=e.push("tr_close","tr",-1),h=e.push("thead_close","thead",-1),h=e.push("tbody_open","tbody",1),h.map=y=[t+2,0],c=t+2;c<n&&!(e.sCount[c]<e.blkIndent)&&(l=i(e,c),-1!==l.indexOf("|"));c+=1){for(d=o(l.replace(/^\||\|\s*$/g,"")),h=e.push("tr_open","tr",1),u=0;u<f;u+=1)h=e.push("td_open","td",1),g[u]&&(h.attrs=[["align",g[u]]]),h=e.push("inline","",0),h.content=d[u]?d[u].trim():"",h.children=[],h=e.push("td_close","td",-1);h=e.push("tr_close","tr",-1)}return h=e.push("tbody_close","tbody",-1),h=e.push("table_close","table",-1),m[1]=y[1]=c,e.line=c,!0}},function(e,t,n){"use strict";var i=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],o=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^<("+i.join("|")+")","i"),/^\/?>$/,!0],[new RegExp("^</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|pre|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?=(\\s|/?>|$))","i"),/^$/,!0],[/^(?:<[A-Za-z][A-Za-z0-9\-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|'[^']*'|"[^"]*"))?)*\s*\/?>|<\/[A-Za-z][A-Za-z0-9\-]*\s*>)\s*$/,/^$/,!1]];e.exports=function(e,t,n,i){var a,r,l,s,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(u))return!1;for(s=e.src.slice(u,c),a=0;a<o.length;a++)if(o[a][0].test(s)){if(5===a)return!1;break}if(a===o.length)return!1;if(i)return o[a][2];if(r=t+1,!o[a][1].test(s))for(;r<n&&!(e.sCount[r]<e.blkIndent);r++)if(u=e.bMarks[r]+e.tShift[r],c=e.eMarks[r],s=e.src.slice(u,c),o[a][1].test(s)){0!==s.length&&r++;break}return e.line=r,l=e.push("html_block","",0),l.map=[t,r],l.content=e.getLines(t,r,e.blkIndent,!0),!0}},function(e,t,n){"use strict";e.exports=function(e,t){var n,i,o,a,r,l,s=e.pos;if(96!==e.src.charCodeAt(s))return!1;for(n=s,s++,i=e.posMax;s<i&&96===e.src.charCodeAt(s);)s++;for(o=e.src.slice(n,s),a=r=s;-1!==(a=e.src.indexOf("`",r));){for(r=a+1;r<i&&96===e.src.charCodeAt(r);)r++;if(r-a===o.length)return t||(l=e.push("code_inline","code",0),l.markup=o,l.content=e.src.slice(s,a).replace(/[ \n]+/g," ").trim(),l.attrSet("data-backticks",l.markup.length)),e.pos=r,!0}return t||(e.pending+=o),e.pos+=o.length,!0}},function(e,t){e.exports=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(12),d=i(c),f=n(15),h=i(f),g=n(2),v=i(g),p=n(16),m=i(p),y=n(17),_=i(y),b=n(4),k=i(b),w=n(7),C=i(w),E=function(){function e(t){var n=this;o(this,e),this.options=l.default.extend({useDefaultHTMLSanitizer:!0,codeBlockLanguages:w.CodeBlockManager.getHighlightJSLanguages(),customConvertor:null},t),this.eventManager=new h.default,this.commandManager=new v.default(this),this.options.customConvertor?this.convertor=new this.options.customConvertor(this.eventManager):this.convertor=new _.default(this.eventManager),this.toMarkOptions=null,this.options.useDefaultHTMLSanitizer&&this.convertor.initHtmlSanitizer(),this.options.hooks&&u.default.forEach(this.options.hooks,function(e,t){n.addHook(t,e)}),this.options.events&&u.default.forEach(this.options.events,function(e,t){n.on(t,e)}),this.preview=new d.default((0,l.default)(this.options.el),this.eventManager,this.convertor,!0),this.preview.$el.on("mousedown",l.default.proxy(this._toggleTask,this)),m.default.applyExtension(this,this.options.exts),this.setValue(this.options.initialValue),this.eventManager.emit("load",this)}return a(e,[{key:"_toggleTask",value:function(e){var t=e.offsetX<18&&e.offsetY>18;e.target.hasAttribute("data-te-task")&&!t&&((0,l.default)(e.target).toggleClass("checked"),this.eventManager.emit("change",{source:"viewer",data:e}))}},{key:"setMarkdown",value:function(e){this.markdownValue=e=e||"",this.preview.refresh(this.markdownValue),this.eventManager.emit("setMarkdownAfter",this.markdownValue)}},{key:"setValue",value:function(e){this.setMarkdown(e)}},{key:"on",value:function(e,t){this.eventManager.listen(e,t)}},{key:"off",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"remove",value:function(){this.eventManager.emit("removeEditor"),this.preview.$el.off("mousedown",l.default.proxy(this._toggleTask,this)),this.preview.remove(),this.options=null,this.eventManager=null,this.commandManager=null,this.convertor=null,this.preview=null}},{key:"addHook",value:function(e,t){this.eventManager.removeEventHandler(e),this.eventManager.listen(e,t)}},{key:"isViewer",value:function(){return!0}},{key:"isMarkdownMode",value:function(){return!1}},{key:"isWysiwygMode",value:function(){return!1}}],[{key:"defineExtension",value:function(e,t){m.default.defineExtension(e,t)}}]),e}();E.isViewer=!0,E.domUtils=k.default,E.codeBlockManager=C.default,E.markdownitHighlight=_.default.getMarkdownitHighlightRenderer(),E.markdownit=_.default.getMarkdownitRenderer(),E.i18n=null,E.Button=null,E.WwCodeBlockManager=null,E.WwTableManager=null,E.WwTableSelectionManager=null,e.exports=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){var n=e.start,i=e.end,o=void 0;if(n.ch>=t){o={from:{line:n.line,ch:n.ch-t},to:{line:i.line,ch:i.ch+t}}}return o},o=t.removeSyntax=function(e,t){var n=t.length;return e.substr(n,e.length-2*n)},a=t.appendSyntax=function(e,t){return""+t+e+t},r=t.expandReplace=function(e,t,n,o,a){var r=i(t,n),l=!1;if(r){var s=r.from,u=r.to,c=e.getRange(s,u);o(c)&&(e.setSelection(s,u),e.replaceSelection(a(c),"around"),l=!0)}return l},l=t.replace=function(e,t,n,i){var o=!1;return n(t)&&(e.replaceSelection(i(t),"around"),o=!0),o};t.changeSyntax=function(e,t,n,i,s){var u=e.getCursor(),c=u.line,d=u.ch,f=e.getSelection(),h=n.length,g=function(e){return i.test(e)};if(!r(e,t,h,g,function(e){return o(e,n)})&&!l(e,f,g,function(e){return o(e,n)})){var v=f.replace(s,"$1");e.replaceSelection(a(v,n),"around")}var p=e.getSelection(),m=d;f||(g(p)?m+=h:m-=h,e.setCursor(c,m))}},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l='<div class="tui-tooltip"><div class="arrow"></div><span class="text"></span></span></div>',s=function(){function e(){i(this,e),this.$el=(0,r.default)(l),this.$el.appendTo("body"),this.hide()}return o(e,[{key:"show",value:function(e,t){this.$el.css({top:e.offset().top+e.height()+13,left:e.offset().left+3}).find(".text").html(t).end().show()}},{key:"hide",value:function(){this.$el.hide()}},{key:"remove",value:function(){this.$el.remove()}}]),e}();t.default=new s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(6),u=i(s);n(47),n(48),n(49),n(50),n(51),n(52),n(53);var c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.editorContainerEl=t,this.cm=null,this._init(n)}return a(e,[{key:"_init",value:function(e){var t=document.createElement("textarea");this.editorContainerEl.appendChild(t),e=l.default.extend(!0,{lineWrapping:!0,theme:"default",extraKeys:{"Shift-Tab":"indentLess","Alt-Up":"replaceLineTextToUpper","Alt-Down":"replaceLineTextToLower"},indentUnit:4,cursorScrollMargin:12,specialCharPlaceholder:function(){return document.createElement("span")}},e),this.cm=u.default.fromTextArea(t,e)}},{key:"getCurrentRange",value:function(){var e=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{from:e,to:t,collapsed:e.line===t.line&&e.ch===t.ch}}},{key:"focus",value:function(){this.cm.focus()}},{key:"blur",value:function(){this.cm.getInputField().blur()}},{key:"remove",value:function(){this.cm.toTextArea()}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.cm.setValue(e),t&&this.moveCursorToEnd(),this.cm.refresh()}},{key:"getValue",value:function(){return this.cm.getValue("\n")}},{key:"getEditor",value:function(){return this.cm}},{key:"reset",value:function(){this.setValue("")}},{key:"getCaretPosition",value:function(){return this.cm.cursorCoords()}},{key:"addWidget",value:function(e,t,n,i){i&&(e.ch+=i),this.cm.addWidget(e.end,t,!0,n)}},{key:"replaceSelection",value:function(e,t){t&&this.cm.setSelection(t.from,t.to),this.cm.replaceSelection(e),this.focus()}},{key:"replaceRelativeOffset",value:function(e,t,n){var i=this.cm.getCursor(),o={from:{line:i.line,ch:i.ch+t},to:{line:i.line,ch:i.ch+t+n}};this.replaceSelection(e,o)}},{key:"setHeight",value:function(e){this.getWrapperElement().style.height=e+"px"}},{key:"setMinHeight",value:function(e){this.getWrapperElement().style.minHeight=e+"px"}},{key:"setPlaceholder",value:function(e){e&&this.cm.setOption("placeholder",e)}},{key:"getWrapperElement",value:function(){return this.cm.getWrapperElement()}},{key:"getCursor",value:function(e){return this.cm.getCursor(e)}},{key:"moveCursorToEnd",value:function(){var e=this.getEditor().getDoc(),t=e.lastLine();e.setCursor(t,e.getLine(t).length)}},{key:"moveCursorToStart",value:function(){var e=this.getEditor().getDoc(),t=e.firstLine();e.setCursor(t,0)}},{key:"scrollTop",value:function(e){return e&&this.cm.scrollTo(0,e),this.cm.getScrollInfo().top}},{key:"getRange",value:function(){var e=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{start:{line:e.line,ch:e.ch},end:{line:t.line,ch:t.ch}}}},{key:"on",value:function(e,t){this.cm.on(e,t)}},{key:"off",value:function(e,t){this.cm.off(e,t)}}]),e}();t.default=c},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t){i(this,e),this._managers={},this._editor=t}return o(e,[{key:"addManager",value:function(e,t){t||(t=e,e=null);var n=new t(this._editor);this._managers[e||n.name]=n}},{key:"getManager",value:function(e){return this._managers[e]}},{key:"removeManager",value:function(e){var t=this.getManager(e);t&&(t.destroy&&t.destroy(),delete this._managers[e])}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n="<"+t+"><br /></"+t+">",i="",o=0;o<e;o+=1)i+=n;return i}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(0),s=i(l),u=n(1),c=i(u),d=n(4),f=i(d),h=c.default.browser.msie&&10===c.default.browser.version,g=c.default.browser.msie&&(10===c.default.browser.version||11===c.default.browser.version),v=c.default.browser.msie?"":"<br>",p=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="table",this._lastCellNode=null,this._init()}return r(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent(),this.tableID=0}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygRangeChangeAfter.table",function(){var t=e.wwe.getEditor().getSelection(),n=e.wwe.isInTable(t);if(e._unwrapBlockInTable(),e._completeTableIfNeed(),!n){e.wwe.componentManager.getManager("tableSelection").removeClassAttrbuteFromAllCellsIfNeed()}e._insertDefaultBlockBetweenTable()}),this.eventManager.listen("wysiwygSetValueAfter.table",function(){e._unwrapBlockInTable(),e._insertDefaultBlockBetweenTable()}),this.eventManager.listen("wysiwygProcessHTMLText.table",function(e){return e.replace(/<br \/>(<\/td>|<\/th>)/g,"$1")}),this.eventManager.listen("cut.table",function(){var t=e.wwe.componentManager.getManager("tableSelection"),n=t.getSelectedCells();n.length&&n.get().forEach(function(e){return(0,s.default)(e).html(v)}),t.removeClassAttrbuteFromAllCellsIfNeed()}),this.eventManager.listen("copyBefore.table",function(t){var n=t.$clipboardContainer;return e.updateTableHtmlOfClipboardIfNeed(n)})}},{key:"updateTableHtmlOfClipboardIfNeed",value:function(e){var t=this,n=this.wwe.componentManager.getManager("tableSelection");if(n.getSelectedCells().length){n.createRangeBySelectedCells();var i=this.wwe.getEditor().getSelection().cloneContents();(0,s.default)(i).children().each(function(e,n){var i=(0,s.default)(n);t.isTableOrSubTableElement(n.nodeName)&&("TABLE"===n.nodeName&&0===i.find("thead").length&&0===i.find("tbody").length?i.remove():n.previousSibling&&"TABLE"===n.previousSibling.nodeName?n.previousSibling.appendChild(n):(t._completeIncompleteTable(n),"TABLE"!==n.nodeName&&"THEAD"!==n.nodeName&&(0,s.default)(n).closest("table").find("thead").remove()))}),e.append(i),e.find(".te-cell-selected").removeClass("te-cell-selected")}}},{key:"pasteTableData",value:function(e){var t=(0,s.default)(e);this._expandTableIfNeed(t),this._pasteDataIntoTable(t)}},{key:"_initKeyHandler",value:function(){var e=this;this.keyEventHandlers={DEFAULT:function(t,n,i){var o=e.wwe.isInTable(n);o&&!e._isSingleModifierKey(i)?(e._recordUndoStateIfNeed(n),e._removeBRIfNeed(n),e._removeContentsAndChangeSelectionIfNeed(n,i,t)):!o&&e._lastCellNode&&e._recordUndoStateAndResetCellNode(n),o&&!e._isModifierKeyPushed(t)&&e.wwe.getEditor().modifyDocument(function(){e.wwe.componentManager.getManager("tableSelection").removeClassAttrbuteFromAllCellsIfNeed()})},ENTER:function(t,n){var i=void 0;return e._isAfterTable(n)?(t.preventDefault(),n.setStart(n.startContainer,n.startOffset-1),e.wwe.breakToNewDefaultBlock(n),i=!1):e._isBeforeTable(n)?(t.preventDefault(),e.wwe.breakToNewDefaultBlock(n,"before"),i=!1):e.wwe.isInTable(n)&&(e._isInStyledText(n)&&e.wwe.defer(function(){e._removeBRinStyleText()}),e._appendBrIfTdOrThNotHaveAsLastChild(n),i=!1),i},BACK_SPACE:function(t,n,i){return e._handleBackspaceAndDeleteKeyEvent(t,n,i)},DELETE:function(t,n,i){return e._handleBackspaceAndDeleteKeyEvent(t,n,i)},TAB:function(){return e._moveCursorTo("next","cell")},"SHIFT+TAB":function(t){return e._moveCursorTo("previous","cell",t)},UP:function(t){return e._moveCursorTo("previous","row",t)},DOWN:function(t){return e._moveCursorTo("next","row",t)}},c.default.forEach(this.keyEventHandlers,function(t,n){return e.wwe.addKeyEventHandler(n,t)})}},{key:"_isInStyledText",value:function(e){var t=e.startContainer,n=void 0;return n=f.default.isTextNode(t)?t.parentNode:t,e.collapsed&&f.default.isStyledNode(n)}},{key:"_removeBRinStyleText",value:function(){var e=this.wwe.getRange(),t=e.startContainer,n=e.startOffset,i=void 0;i="TD"===t.nodeName?f.default.getChildNodeByOffset(t,n-1):f.default.getParentUntil(t,"TD");var o=i.querySelector("br"),a=i,r=a.parentNode,l=a.nodeName;if("CODE"!==l||o.previousSibling)if("CODE"!==l||o.nextSibling){var s=this._splitByBR(i,o);e.setStart(s,0)}else r.insertBefore(o,i.nextSibling),e.setStart(r,f.default.getNodeOffsetOfParent(o)+1);else r.insertBefore(o,i),e.setStart(i,0);e.collapse(!0),this.wwe.getEditor().setSelection(e)}},{key:"_splitByBR",value:function(e,t){var n=e.cloneNode(!0),i=document.createElement("br"),o=e.parentNode;f.default.removeNodesByDirection(e,t,!1),t.parentNode.removeChild(t);var a=n.querySelector("br");f.default.removeNodesByDirection(n,a,!0),a.parentNode.removeChild(a),o.insertBefore(n,e.nextSibling),o.insertBefore(i,n);var r=f.default.getLeafNode(n);return f.default.getTextLength(r)||(r.textContent=""),r}},{key:"_isBeforeTable",value:function(e){return"TABLE"===f.default.getNodeName(f.default.getChildNodeByOffset(e.startContainer,e.startOffset))}},{key:"_isAfterTable",value:function(e){var t=f.default.getPrevOffsetNodeUntil(e.startContainer,e.startOffset);return"TABLE"===f.default.getNodeName(t)&&e.commonAncestorContainer===this.wwe.get$Body()[0]}},{key:"_handleBackspaceAndDeleteKeyEvent",value:function(e,t,n){var i="BACK_SPACE"===n,o=this.wwe.componentManager.getManager("tableSelection"),a=o.getSelectedCells(),r=!0;if(t.collapsed){if(this.wwe.isInTable(t))i?this._tableHandlerOnBackspace(t,e):this._tableHandlerOnDelete(t,e),this._insertBRIfNeed(t),this._removeContentsAndChangeSelectionIfNeed(t,n,e),r=!1;else if(!i&&this._isBeforeTable(t)||i&&this._isAfterTable(t)){e.preventDefault();var l=i?t.startOffset-1:t.startOffset;this._removeTable(t,f.default.getChildNodeByOffset(t.startContainer,l)),r=!1}}else if(this.wwe.isInTable(t)&&a.length>0){var s=this._removeContentsAndChangeSelectionIfNeed(t,n,e);s&&(e.preventDefault(),r=!1)}return r}},{key:"_tableHandlerOnBackspace",value:function(e,t){var n=f.default.getPrevOffsetNodeUntil(e.startContainer,e.startOffset,"TR"),i=f.default.getNodeName(n);n&&"TD"!==i&&"TH"!==i?"BR"===i&&1!==n.parentNode.childNodes.length&&(t.preventDefault(),(0,s.default)(n).remove()):t.preventDefault()}},{key:"isNonTextDeleting",value:function(e){var t=e.startContainer,n=t.nextSibling,i=f.default.getNodeName(n),o=f.default.getNodeName(t),a=o===i&&"TEXT"!==o,r=(!n||"BR"===i&&n.parentNode.lastChild===n)&&f.default.isTextNode(t)&&e.startOffset===t.nodeValue.length,l=!r&&(0,s.default)(t).parents("tr").children().last()[0]===t&&("TD"===o||"TH"===o);return a||r||l}},{key:"_tableHandlerOnDelete",value:function(e,t){this.isNonTextDeleting(e)&&(t.preventDefault(),e.startContainer.normalize())}},{key:"_appendBrIfTdOrThNotHaveAsLastChild",value:function(e){var t=f.default.getNodeName(e.startContainer),n=void 0;if("TD"===t||"TH"===t)n=e.startContainer;else{var i=(0,s.default)(e.startContainer).parentsUntil("tr");n=i[i.length-1]}"BR"===f.default.getNodeName(n.lastChild)||"DIV"===f.default.getNodeName(n.lastChild)||g||(0,s.default)(n).append((0,s.default)("<br />")[0])}},{key:"_unwrapBlockInTable",value:function(){this.wwe.get$Body().find("td div,th div,tr>br,td>br,th>br").each(function(e,t){if("BR"===f.default.getNodeName(t)){var n=f.default.getNodeName(t.parentNode),i=/TD|TH/.test(n),o=0===t.parentNode.textContent.length,a=t.parentNode.lastChild===t;("TR"===n||i&&!o&&a)&&(0,s.default)(t).remove()}else(0,s.default)(t).children().unwrap()})}},{key:"_insertDefaultBlockBetweenTable",value:function(){this.wwe.get$Body().find("table").each(function(e,t){t.nextElementSibling&&"TABLE"===t.nextElementSibling.nodeName&&(0,s.default)("<div><br /></div>").insertAfter(t)})}},{key:"_removeTable",value:function(e,t){"TABLE"===t.tagName&&(this.wwe.getEditor().saveUndoState(e),this.wwe.saveSelection(e),(0,s.default)(t).remove(),this.wwe.restoreSavedSelection())}},{key:"_recordUndoStateIfNeed",value:function(e){var t=f.default.getParentUntil(e.startContainer,"TR");e.collapsed&&t&&this._lastCellNode!==t&&(this.wwe.getEditor().saveUndoState(e),this._lastCellNode=t)}},{key:"_recordUndoStateAndResetCellNode",value:function(e){this.wwe.getEditor().saveUndoState(e),this.resetLastCellNode()}},{key:"_pasteDataIntoTable",value:function(e){var t=this.wwe.getEditor().getSelection(),n=t.startContainer,i=this._getTableDataFromTable(e),o="TD"===n.tagName||"TH"===n.tagName,a=h?"":"<br />",r=void 0,l=void 0,u=void 0,c=void 0;for(o?r=n:(r=f.default.getParentUntilBy(n,function(e){return"TD"===e.tagName||"TH"===e.tagName},function(e){return 0===(0,s.default)(e).closest("table").length}),r=r?r.parentNode:null),r=r||(0,s.default)(n).find("th,td").get(0),l=r;i.length;){for(u=i.shift();l&&u.length;)c=u.shift(),c.length?l.textContent=c:l.innerHTML=a,l=f.default.getTableCellByDirection(l,"next");l=f.default.getSiblingRowCellByDirection(r,"next",!1),r=l}}},{key:"_getTableDataFromTable",value:function(e){var t=(0,s.default)(e),n=[];return t.find("tr").each(function(e,t){var i=[];(0,s.default)(t).children().each(function(e,t){i.push(t.textContent)}),i.length&&n.push(i)}),n}},{key:"_removeTableContents",value:function(e){this.wwe.getEditor().saveUndoState(),e.each(function(e,t){var n=h?"":"<br />";(0,s.default)(t).html(n)})}},{key:"wrapDanglingTableCellsIntoTrIfNeed",value:function(e){var t=e.children("td,th"),n=void 0;if(t.length){var i=(0,s.default)("<tr></tr>");t.each(function(e,t){i.append(t)}),n=i.get(0)}return n}},{key:"wrapTrsIntoTbodyIfNeed",value:function(e){var t=e.children("tr"),n=t.find("th"),i=void 0;if(n.length&&n.each(function(e,t){var n=(0,s.default)(t),i=(0,s.default)("<td></td>");i.html(n.html()),i.insertBefore(t),n.detach()}),t.length){var o=(0,s.default)("<tbody></tbody>");t.each(function(e,t){o.append(t)}),i=o.get(0)}return i}},{key:"wrapTheadAndTbodyIntoTableIfNeed",value:function(e){var t=e.children("thead"),n=e.children("tbody"),i=(0,s.default)("<table></table>"),o=void 0;return!n.length&&t.length?(i.append(t[0]),i.append("<tbody><tr></tr></tbody>"),o=i.get(0)):n.length&&!t.length?(i.append("<thead><tr></tr></thead>"),i.append(n[0]),o=i.get(0)):n.length&&t.length&&(i.append(t[0]),i.append(n[0]),o=i.get(0)),o}},{key:"isTableOrSubTableElement",value:function(e){return"TABLE"===e||"TBODY"===e||"THEAD"===e||"TR"===e||"TD"===e}},{key:"_stuffTableCellsIntoIncompleteRow",value:function(e,t){e.each(function(e,n){for(var i=(0,s.default)(n),o=i.find("th,td"),r=f.default.getNodeName(i.parent()[0]),l="THEAD"===r?"th":"td",u=o.length;u<t;u+=1)i.append((0,s.default)(a(1,l))[0])})}},{key:"prepareToTableCellStuffing",value:function(e){var t=e.eq(0).find("th,td").length,n=!1;return e.each(function(e,i){var o=(0,s.default)(i).find("th,td").length;t!==o&&(n=!0,t<o&&(t=o))}),{maximumCellLength:t,needTableCellStuffingAid:n}}},{key:"_addTbodyOrTheadIfNeed",value:function(e){var t=!e.find("thead").length,n=!e.find("tbody").length,i=void 0;t?(i=(0,s.default)("<thead><tr></tr></thead>").get(0),e.prepend(i)):n&&(i=(0,s.default)("<tbody><tr></tr></tbody>").get(0),e.append(i))}},{key:"tableCellAppendAidForTableElement",value:function(e){var t=(0,s.default)(e);this._addTbodyOrTheadIfNeed(t),this._addTrIntoContainerIfNeed(t);var n=t.find("tr"),i=this.prepareToTableCellStuffing(n),o=i.maximumCellLength;i.needTableCellStuffingAid&&this._stuffTableCellsIntoIncompleteRow(n,o)}},{key:"_generateTheadAndTbodyFromTbody",value:function(e){var t=(0,s.default)("<tr></tr>"),n=(0,s.default)("<thead></thead>");return t.append(a((0,s.default)(e).find("tr").eq(0).find("td").length,"th")),n.append(t),{thead:n[0],tbody:e}}},{key:"_generateTheadAndTbodyFromThead",value:function(e){var t=(0,s.default)("<tr></tr>"),n=(0,s.default)("<tbody></tbody>");return t.append(a((0,s.default)(e).find("th").length,"td")),n.append(t),{thead:e,tbody:n[0]}}},{key:"_generateTheadAndTbodyFromTr",value:function(e){var t=(0,s.default)(e),n=(0,s.default)("<thead></thead>"),i=(0,s.default)("<tbody></tbody>"),o=void 0,r=void 0;return"TH"===t.children()[0].tagName?(o=e,r=(0,s.default)("<tr>"+a(t.find("th").length,"td")+"</tr>").get(0)):(o=(0,s.default)("<tr>"+a(t.find("td").length,"th")+"</tr>").get(0),r=e),n.append(o),i.append(r),{thead:n[0],tbody:i[0]}}},{key:"_completeIncompleteTable",value:function(e){var t=e.tagName,n=void 0,i=void 0;"TABLE"===t?n=e:(n=document.createElement("table"),e.parentNode.insertBefore(n,e.nextSibling),"TBODY"===t?i=this._generateTheadAndTbodyFromTbody(e):"THEAD"===t?i=this._generateTheadAndTbodyFromThead(e):"TR"===t&&(i=this._generateTheadAndTbodyFromTr(e)),n.appendChild(i.thead),n.appendChild(i.tbody)),this._removeEmptyRows(n),this.tableCellAppendAidForTableElement(n)}},{key:"_removeEmptyRows",value:function(e){var t=e.querySelectorAll("tr");c.default.forEachArray(t,function(e){e.cells.length||e.parentNode.removeChild(e)})}},{key:"_completeTableIfNeed",value:function(){var e=this;this.wwe.getEditor().get$Body().children().each(function(t,n){var i=(0,s.default)(n);e.isTableOrSubTableElement(n.nodeName)&&("TABLE"===n.nodeName&&0===i.find("tbody").length?i.remove():e._completeIncompleteTable(n))})}},{key:"resetLastCellNode",value:function(){this._lastCellNode=null}},{key:"setLastCellNode",value:function(e){this._lastCellNode=e}},{key:"_isSingleModifierKey",value:function(e){return"META"===e||"SHIFT"===e||"ALT"===e||"CONTROL"===e}},{key:"_isModifierKeyPushed",value:function(e){return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}},{key:"_addTrIntoContainerIfNeed",value:function(e){e.children().each(function(e,t){0===(0,s.default)(t).find("tr").length&&(0,s.default)(t).append((0,s.default)("<tr></tr>")[0])})}},{key:"_expandTableIfNeed",value:function(e){var t=this.wwe.getEditor().getSelection().cloneRange(),n=(0,s.default)(t.startContainer).parents("table"),i=this._getColumnAndRowDifference(e,t);i.column<0&&this._appendCellForAllRow(n,i.column),i.row<0&&this._appendRow(n,i.row)}},{key:"_getColumnAndRowDifference",value:function(e,t){var n=this._getTableDataFromTable(e),i=n.length,o=n[0].length,a=(0,s.default)(t.startContainer).closest("th,td"),r=a.parent(),l=f.default.getNodeOffsetOfParent(a[0]),u=f.default.getNodeOffsetOfParent(a[0].parentNode),c=r.parents("table"),d=c.find("tr").eq(0).children().length,h=c.find("tr").length;return r.parents("tbody").length&&(u+=1),{row:h-(u+i),column:d-(l+o)}}},{key:"_appendCellForAllRow",value:function(e,t){var n=h?"":"<br />";e.find("tr").each(function(e,i){for(var o=void 0,a=t;a<0;a+=1)o=0===e?"th":"td",(0,s.default)(i).append((0,s.default)("<"+o+">"+n+"</"+o+">")[0])})}},{key:"_appendRow",value:function(e,t){var n=e.find("tr").last().clone(),i=h?"":"<br />";for(n.find("td").html(i);t<0;t+=1)e.find("tbody").append(n.clone()[0])}},{key:"_getSiblingTextNodeByDirection",value:function(e,t){var n=e.previousSibling&&"BR"===e.previousSibling.nodeName&&e.previousSibling.previousSibling&&3===e.previousSibling.previousSibling.nodeType,i=e.nextSibling&&"BR"===e.nextSibling.nodeName&&e.nextSibling.nextSibling&&3===e.nextSibling.nextSibling.nodeType,o=void 0;return t&&i?o=e.nextSibling.nextSibling:!t&&n&&(o=e.previousSibling.previousSibling),o}},{key:"_changeSelectionToTargetCell",value:function(e,t,n,i){var o=t.startContainer,a="next"===n,r="row"===i,l=void 0,u=void 0;if(r){if(f.default.isTextNode(o)&&(l=this._getSiblingTextNodeByDirection(o,a)))return u=l.length<t.startOffset?l.length:t.startOffset,t.setStart(l,u),void t.collapse(!0);l=f.default.getSiblingRowCellByDirection(e,n,!1)}else(l=f.default.getTableCellByDirection(e,n))||(l=f.default.getSiblingRowCellByDirection(e,n,!0));l?(t.setStart(l,0),t.collapse(!0)):(l=(0,s.default)(e).parents("table").get(0),a?t.setStart(l.nextElementSibling,0):l.previousElementSibling&&"TABLE"!==l.previousElementSibling.nodeName?t.setStart(l.previousElementSibling,1):t.setStartBefore(l),t.collapse(!0))}},{key:"_moveCursorTo",value:function(e,t,n){var i=this.wwe.getEditor(),o=i.getSelection().cloneRange(),a=(0,s.default)(o.startContainer).closest("td,th").get(0),r=void 0;return o.collapsed&&this.wwe.isInTable(o)&&a&&("previous"!==e&&"row"!==t||c.default.isUndefined(n)||n.preventDefault(),this._changeSelectionToTargetCell(a,o,e,t),i.setSelection(o),r=!1),r}},{key:"_removeContentsAndChangeSelectionIfNeed",value:function(e,t,n){var i=t.length<=1,o="BACK_SPACE"===t||"DELETE"===t,a=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),r=a.first().get(0),l=!1;return(i||o)&&!this._isModifierKeyPushed(n)&&a.length&&(o&&this._recordUndoStateIfNeed(e),this._removeTableContents(a),this._lastCellNode=r,e.setStart(r,0),e.collapse(!0),this.wwe.getEditor().setSelection(e),l=!0),l}},{key:"getTableIDClassName",value:function(){var e="te-content-table-"+this.tableID;return this.tableID+=1,e}},{key:"_removeBRIfNeed",value:function(e){var t=f.default.isTextNode(e.startContainer),n=t?e.startContainer.parentNode:e.startContainer;/td|th/i.test(f.default.getNodeName(n))&&e.collapsed&&1===n.textContent.length&&(0,s.default)(n).find("br").remove()}},{key:"_insertBRIfNeed",value:function(e){var t=f.default.isTextNode(e.startContainer),n=t?e.startContainer.parentNode:e.startContainer,i=f.default.getNodeName(n),o=(0,s.default)(n);!/td|th/i.test(i)||!e.collapsed||n.textContent.length||o.children().length||g||(n.normalize(),o.append("<br>"))}},{key:"destroy",value:function(){var e=this;this.eventManager.removeEventHandler("wysiwygRangeChangeAfter.table"),this.eventManager.removeEventHandler("wysiwygSetValueAfter.table"),this.eventManager.removeEventHandler("wysiwygProcessHTMLText.table"),this.eventManager.removeEventHandler("cut.table"),this.eventManager.removeEventHandler("copyBefore.table"),c.default.forEach(this.keyEventHandlers,function(t,n){return e.wwe.removeKeyEventHandler(n,t)})}}]),e}();t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(4),d=i(c),f=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="tableSelection",this._init()}return a(e,[{key:"_init",value:function(){this._initEvent(),u.default.browser.firefox&&(document.execCommand("enableObjectResizing",!1,"false"),document.execCommand("enableInlineTableEditing",!1,"false"))}},{key:"_initEvent",value:function(){var e=this,t=void 0,n=void 0,i=void 0;this._tableSelectionTimer=null,this._removeSelectionTimer=null,this._isSelectionStarted=!1;var o=function(o){n=(0,l.default)(o.data.target).closest("[contenteditable=true] td,th").get(0);var a=e.wwe.getEditor().getSelection(),r=(0,l.default)(n).parents("[contenteditable=true] table").get(0),s=t===n,c=e._isTextSelect(a,s)&&!(0,l.default)(t).hasClass("te-cell-selected");e._isSelectionStarted&&r&&!c&&(window.getSelection().removeAllRanges(),u.default.browser.firefox&&!e._removeSelectionTimer&&(e._removeSelectionTimer=setInterval(function(){window.getSelection().removeAllRanges()},10)),e.highlightTableCellsBy(t,n),i=n)},a=function(){e._isSelectionStarted&&(e._isSelectionStarted=!1,e.eventManager.removeEventHandler("mouseover.tableSelection"),e.eventManager.removeEventHandler("mouseup.tableSelection"))},r=function(o){n=(0,l.default)(o.data.target).closest("[contenteditable=true] td,th").get(0);var r=e.wwe.getEditor().getSelection(),s=t===n,c=e._isTextSelect(r,s)&&!(0,l.default)(t).hasClass("te-cell-selected");e._clearTableSelectionTimerIfNeed(),e._isSelectionStarted&&(c?e.removeClassAttrbuteFromAllCellsIfNeed():(e.wwe.componentManager.getManager("table").resetLastCellNode(),n=n||i,r=e.wwe.getEditor().getSelection(),r.setStart(n,0),u.default.browser.msie?r.setEnd(n,1):(r.setEnd(n,0),r.collapse(!1)),e.wwe.getEditor().setSelection(r)),e.onDragEnd&&e.onDragEnd()),a()},s=function(i){t=(0,l.default)(i.data.target).closest("[contenteditable=true] td,th").get(0);var s=(0,l.default)(t).hasClass("te-cell-selected");n=null,!s||s&&2!==i.data.button?(e.removeClassAttrbuteFromAllCellsIfNeed(),e.setTableSelectionTimerIfNeed(t),e.eventManager.listen("mouseover.tableSelection",o),e.eventManager.listen("mouseup.tableSelection",r),e.onDragStart&&t&&e.onDragStart(t)):2===i.data.button&&a()};this.eventManager.listen("mousedown.tableSelection",s),this.eventManager.listen("copyBefore.tableSelection",a),this.eventManager.listen("pasteBefore.tableSelection",a)}},{key:"_isTextSelect",value:function(e,t){return/TD|TH|TEXT/i.test(e.commonAncestorContainer.nodeName)&&t}},{key:"setTableSelectionTimerIfNeed",value:function(e){(0,l.default)(e).parents("[contenteditable=true] table").length&&(this._isSelectionStarted=!0)}},{key:"_clearTableSelectionTimerIfNeed",value:function(){clearTimeout(this._tableSelectionTimer),u.default.browser.firefox&&this._removeSelectionTimer&&(clearTimeout(this._removeSelectionTimer),this._removeSelectionTimer=null)}},{key:"_reArrangeSelectionIfneed",value:function(e,t){var n=(0,l.default)(e).parents("[contenteditable=true] table").length,i=(0,l.default)(t).parents("[contenteditable=true] table").length,o=i&&!n,a=!i&&n;return o?e=(0,l.default)(t).parents("[contenteditable=true] table").find("th").first().get(0):a&&(t=(0,l.default)(e).parents("[contenteditable=true] table").find("td").last().get(0)),{startContainer:e,endContainer:t}}},{key:"_applySelectionDirection",value:function(e,t){var n=d.default.getNodeOffsetOfParent,i=e.startContainer,o=e.endContainer,a=n((0,l.default)(i).closest("[contenteditable=true] tr")[0])-n((0,l.default)(o).closest("[contenteditable=true] tr")[0]),r=n(i)-n(o),s=0===a,u=a<0,c=r>0;return s?c?(t.setStart(o,0),t.setEnd(i,1)):(t.setStart(i,0),t.setEnd(o,1)):u?(t.setStart(i,0),t.setEnd(o,1)):(t.setStart(o,0),t.setEnd(i,1)),t}},{key:"getSelectionRangeFromTable",value:function(e,t){var n=d.default.getNodeOffsetOfParent,i=n(e.parentNode),o=n(t.parentNode),a=n(e),r=n(t),s=d.default.getParentUntil(e,"TABLE"),u=d.default.getParentUntil(t,"TABLE"),c="TBODY"===d.default.getNodeName(s)&&"THEAD"===d.default.getNodeName(u),f=s!==u,h=!!(0,l.default)(e).parents("tbody").length&&!!(0,l.default)(t).parents("tbody").length,g={row:i,cell:a},v={row:o,cell:r},p=void 0,m=void 0;return c?g.row+=1:f?v.row+=1:h&&(g.row+=1,v.row+=1),i>o||i===o&&a>r?(p=v,m=g):(p=g,m=v),{from:p,to:m}}},{key:"highlightTableCellsBy",value:function(e,t){var n=(0,l.default)(e).parents("[contenteditable=true] table").find("tr"),i=this.getSelectionRangeFromTable(e,t),o=i.from.row,a=i.from.cell,r=i.to.row,s=i.to.cell;n.each(function(e,t){(0,l.default)(t).find("td,th").each(function(t,n){var i=(0,l.default)(n),u=e===o,c=e===r;u&&t<a||c&&t>s||e<o||e>r?i.removeClass("te-cell-selected"):i.addClass("te-cell-selected")})})}},{key:"removeClassAttrbuteFromAllCellsIfNeed",value:function(){this.wwe.get$Body().find("td.te-cell-selected,th.te-cell-selected").each(function(e,t){var n=(0,l.default)(t);n.removeClass("te-cell-selected"),n.attr("class").length||n.removeAttr("class")})}},{key:"getSelectedCells",value:function(){return this.wwe.get$Body().find(".te-cell-selected")}},{key:"createRangeBySelectedCells",value:function(){var e=this.wwe.getEditor(),t=e.getSelection().cloneRange(),n=this.getSelectedCells(),i=n.first().get(0),o=n.last().get(0);n.length&&this.wwe.isInTable(t)&&(t.setStart(i,0),t.setEnd(o,o.childNodes.length),e.setSelection(t))}},{key:"styleToSelectedCells",value:function(e,t){this.createRangeBySelectedCells(),e(this.wwe.getEditor(),t)}},{key:"destroy",value:function(){this.eventManager.removeEventHandler("mousedown.tableSelection"),this.eventManager.removeEventHandler("mouseover.tableSelection"),this.eventManager.removeEventHandler("mouseup.tableSelection"),this.eventManager.removeEventHandler("copyBefore.tableSelection"),this.eventManager.removeEventHandler("pasteBefore.tableSelection")}}]),e}();t.default=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return e?e.replace(/[<>&]/g,function(e){return v[e]||e}):""}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(0),s=i(l),u=n(1),c=i(u),d=n(4),f=i(d),h=c.default.browser.msie&&10===c.default.browser.version,g=h?"":"<br>",v={"&":"&amp;","<":"&lt;",">":"&gt;"},p=/\u200B/g,m=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="codeblock",this._init()}return r(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent()}},{key:"_initKeyHandler",value:function(){var e=this;this._keyEventHandlers={BACK_SPACE:this._onBackspaceKeyEventHandler.bind(this),ENTER:function(t,n){!e.wwe.isInTable(n)&&e.wwe.getEditor().hasFormat("CODE")&&e.wwe.defer(function(){var t=e.wwe.getRange(),n=t.startContainer,i=e._getCodeNode(n);i&&!f.default.getTextLength(i)&&i.parentNode.removeChild(i)})}},c.default.forEach(this._keyEventHandlers,function(t,n){return e.wwe.addKeyEventHandler(n,t)})}},{key:"_getCodeNode",value:function(e){var t=void 0;return"CODE"===e.nodeName?t=e:"CODE"===e.parentNode.nodeName&&(t=e.parentNode),t}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter.codeblock",function(){e.modifyCodeBlockForWysiwyg()}),this.eventManager.listen("wysiwygProcessHTMLText.codeblock",function(t){return e._changePreToPreCode(t)})}},{key:"prepareToPasteOnCodeblock",value:function(e){var t=this.wwe.getEditor().getDocument().createDocumentFragment(),n=this.convertNodesToText(e);return n=n.replace(/\n$/,""),t.appendChild(document.createTextNode(n)),t}},{key:"convertNodesToText",value:function(e){for(var t="",n=e.shift();c.default.isTruthy(n);){if(n.childNodes&&f.default.isBlockNode(n))t+=this.convertNodesToText(c.default.toArray(n.childNodes));else if("BR"===n.nodeName)t+="\n";else{var i=n,o=i.textContent;t+=a(o)}n=e.shift()}return t}},{key:"_copyCodeblockTypeFromRangeCodeblock",value:function(e,t){var n=f.default.getParentUntil(t.commonAncestorContainer,this.wwe.get$Body()[0]);if("PRE"===f.default.getNodeName(n)){var i=(0,s.default)(n).prop("attributes");c.default.forEach(i,function(t){(0,s.default)(e).attr(t.name,t.value)})}return e}},{key:"_changePreToPreCode",value:function(e){return e.replace(/<pre( .*?)?>((.|\n)*?)<\/pre>/g,function(e,t,n){return"<pre><code"+(t||"")+">"+n+"</code></pre>"})}},{key:"modifyCodeBlockForWysiwyg",value:function(e){e||(e=this.wwe.get$Body()),(0,s.default)(e).find("pre").each(function(e,t){var n=(0,s.default)(t),i=n.find("code").attr("data-language"),o=n.find("code").attr("data-backticks");n.children().length>1&&n.children().each(function(e,t){"DIV"!==t.nodeName&&"P"!==t.nodeName||(0,s.default)(t).find("br").length||(0,s.default)(t).append("\n")}),n.find("br").replaceWith("\n");var a=n.text().replace(/\s+$/,"");n.empty(),n.html(a||g),i&&(n.attr("data-language",i),n.addClass("lang-"+i)),o&&n.attr("data-backticks",o),n.attr("data-te-codeblock","")})}},{key:"_onBackspaceKeyEventHandler",value:function(e,t){var n=!0,i=this.wwe.getEditor(),o=t.commonAncestorContainer;if(this._isCodeBlockFirstLine(t)&&!this._isFrontCodeblock(t))this._removeCodeblockFirstLine(o),t.collapse(!0),n=!1;else if(t.collapsed&&this._isEmptyLine(o)&&this._isBetweenSameCodeblocks(o)){var a=o.previousSibling,r=o.nextSibling,l=a.textContent.length;i.saveUndoState(t),o.parentNode.removeChild(o),this._mergeCodeblocks(a,r),t.setStart(a.childNodes[0],l),t.collapse(!0),n=!1}return n||(i.setSelection(t),e.preventDefault()),n}},{key:"_isEmptyLine",value:function(e){var t=e.nodeName,n=e.childNodes,i=h?""===e.textContent:1===n.length&&"BR"===n[0].nodeName;return"DIV"===t&&i}},{key:"_isBetweenSameCodeblocks",value:function(e){var t=e.previousSibling,n=e.nextSibling;return"PRE"===f.default.getNodeName(t)&&"PRE"===f.default.getNodeName(n)&&t.getAttribute("data-language")===n.getAttribute("data-language")}},{key:"_mergeCodeblocks",value:function(e,t){var n=t.textContent;e.childNodes[0].textContent+="\n"+n,t.parentNode.removeChild(t)}},{key:"_isCodeBlockFirstLine",value:function(e){return this.isInCodeBlock(e)&&e.collapsed&&0===e.startOffset}},{key:"_isFrontCodeblock",value:function(e){var t=f.default.getParentUntil(e.startContainer,this.wwe.getEditor().getRoot()),n=t.previousSibling;return n&&"PRE"===n.nodeName}},{key:"_removeCodeblockFirstLine",value:function(e){var t=this.wwe.getEditor(),n="PRE"===e.nodeName?e:e.parentNode,i=n.textContent.replace(p,"");t.modifyBlocks(function(){var e=t.getDocument().createDocumentFragment(),o=i.split("\n"),a=document.createElement("div"),r=o.shift();if(a.innerHTML=""+r+g,e.appendChild(a),o.length){var l=n.cloneNode();l.textContent=o.join("\n"),e.appendChild(l)}return e})}},{key:"isInCodeBlock",value:function(e){var t=void 0;return t=e.collapsed?e.startContainer:e.commonAncestorContainer,!!(0,s.default)(t).closest("pre").length}},{key:"destroy",value:function(){var e=this;this.eventManager.removeEventHandler("wysiwygSetValueAfter.codeblock"),this.eventManager.removeEventHandler("wysiwygProcessHTMLText.codeblock"),c.default.forEach(this._keyEventHandlers,function(t,n){return e.wwe.removeKeyEventHandler(n,t)})}}]),e}();t.default=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(8),g=i(h),v=n(18),p=i(v),m=n(11),y=i(m),_=n(41),b=i(_),k=n(42),w=i(k),C=function(e){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];o(this,t);var i=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"tui-editor-defaultUI-toolbar"}));return Object.defineProperty(i,"_items",{enumerable:!0,writable:!0,value:[]}),i._eventManager=e,i.setItems(n),i._initEvent(e),i}return r(t,e),l(t,[{key:"_initEvent",value:function(e){var t=this;e.listen("stateChange",function(e){t._items.forEach(function(t){t._state&&(e[t._state]?t.$el.addClass("active"):t.$el.removeClass("active"))})}),e.listen("changePreviewTabPreview",function(){return t.disableAllButton()}),e.listen("changePreviewTabWrite",function(){return t.enableAllButton()}),e.listen("changeMode",function(){return t.enableAllButton()})}},{key:"disableAllButton",value:function(){this._items.forEach(function(e){e instanceof p.default&&e.disable()})}},{key:"enableAllButton",value:function(){this._items.forEach(function(e){e instanceof p.default&&e.enable()})}},{key:"getItems",value:function(){return this._items.slice(0)}},{key:"getItem",value:function(e){return this._items[e]}},{key:"setItems",value:function(e){this.removeAllItems(),e.forEach(this.addItem.bind(this))}},{key:"addItem",value:function(e){this.insertItem(this._items.length,e)}},{key:"insertItem",value:function(e,t){var n=this;f.default.isString(t)?t=w.default.create(t):f.default.isString(t.type)&&(t=w.default.create(t.type,t.options));var i=this.$el.children();e>=0&&e<i.length?(t.$el.insertBefore(i.eq(e)),this._items.splice(e,0,t)):(t.$el.appendTo(this.$el),this._items.push(t)),t.onCommandHandler=function(e,t){return n._eventManager.emit("command",t)},t.onEventHandler=function(e,t){return n._eventManager.emit(t)},t.on("command",t.onCommandHandler),t.on("event",t.onEventHandler)}},{key:"indexOfItem",value:function(e){var t=void 0;if(e instanceof y.default)t=this._items.indexOf(e);else if(f.default.isString(e)){var n=e;t=this._items.map(function(e){return e.getName()}).indexOf(n)}return t}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=void 0,i=void 0;return n=e instanceof y.default?this.indexOfItem(e):e,n>=0&&(i=this._items.splice(n,1)[0]),i&&(t?i.destroy():(i.off("command",i.onCommandHandler),i.off("event",i.onEventHandler),i.$el.detach())),i}},{key:"removeAllItems",value:function(){for(;this._items&&this._items.length>0;)this.removeItem(0)}},{key:"destroy",value:function(){this.removeAllItems(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"addButton",value:function(e,t){if(f.default.isArray(e))for(var n=e.length-1;n>=0;n-=1)f.default.isNumber(t)?this._addButton(e[n],t):this._addButton(e);else this._addButton(e,t)}},{key:"_addButton",value:function(e,t){var n=this._setButton(e,t).$el;f.default.isNumber(t)?this.$el.find("."+p.default.className).eq(t-1).before(n):this.$el.append(n)}},{key:"addDivider",value:function(){var e=(0,c.default)('<div class="'+b.default.className+'"></div>');return this.$el.append(e),e}},{key:"_setButton",value:function(e,t){var n=this._eventManager;return e instanceof p.default||(e=new p.default(e)),e.on("command",function(e,t){return n.emit("command",t)}),e.on("event",function(e,t){return n.emit(t)}),f.default.isNumber(t)?this._items.splice(t,0,e):this._items.push(e),e}}]),t}(g.default);t.default=C},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),l=function(e){return e&&e.__esModule?e:{default:e}}(r),s=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:t.name,tagName:"div",className:t.className}))}return a(t,e),t}(l.default);Object.defineProperty(s,"name",{enumerable:!0,writable:!0,value:"divider"}),Object.defineProperty(s,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-divider"}),t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(11),l=i(r),s=n(75),u=i(s),c=n(41),d=i(c),f=n(3),h=i(f),g=function(){function e(){o(this,e)}return a(e,null,[{key:"create",value:function(e,t){var n=void 0;switch(e){case"heading":n=new u.default({name:"heading",className:"tui-heading",event:"openHeadingSelect",tooltip:h.default.get("Headings")});break;case"bold":n=new u.default({name:"bold",className:"tui-bold",command:"Bold",tooltip:h.default.get("Bold"),state:"bold"});break;case"italic":n=new u.default({name:"italic",className:"tui-italic",command:"Italic",tooltip:h.default.get("Italic"),state:"italic"});break;case"strike":n=new u.default({name:"strike",className:"tui-strike",command:"Strike",tooltip:h.default.get("Strike"),state:"strike"});break;case"hr":n=new u.default({name:"hr",className:"tui-hrline",command:"HR",tooltip:h.default.get("Line")});break;case"quote":n=new u.default({name:"quote",className:"tui-quote",command:"Blockquote",tooltip:h.default.get("Blockquote"),state:"quote"});break;case"ul":n=new u.default({name:"ul",className:"tui-ul",command:"UL",tooltip:h.default.get("Unordered list")});break;case"ol":n=new u.default({name:"ol",className:"tui-ol",command:"OL",tooltip:h.default.get("Ordered list")});break;case"task":n=new u.default({name:"task",className:"tui-task",command:"Task",tooltip:h.default.get("Task")});break;case"table":n=new u.default({name:"table",className:"tui-table",event:"openPopupAddTable",tooltip:h.default.get("Insert table")});break;case"image":n=new u.default({name:"image",className:"tui-image",event:"openPopupAddImage",tooltip:h.default.get("Insert image"),state:""});break;case"link":n=new u.default({name:"link",className:"tui-link",event:"openPopupAddLink",tooltip:h.default.get("Insert link")});break;case"code":n=new u.default({name:"code",className:"tui-code",command:"Code",tooltip:h.default.get("Code"),state:"code"});break;case"codeblock":n=new u.default({name:"codeblock",className:"tui-codeblock",command:"CodeBlock",tooltip:h.default.get("Insert CodeBlock"),state:"codeBlock"});break;case"indent":n=new u.default({name:"indent",className:"tui-indent",command:"Indent",tooltip:h.default.get("Indent")});break;case"outdent":n=new u.default({name:"outdent",className:"tui-outdent",command:"Outdent",tooltip:h.default.get("Outdent")});break;case"divider":n=new d.default;break;case"button":n=new u.default(t);break;case"item":default:n=new l.default(t)}return n}}]),e}();t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(0),u=i(s),c=n(8),d=i(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"te-tab"}));return n.sections=e.sections,n._$activeButton=null,n._render(e),n._initEvent(e),n}return r(t,e),l(t,[{key:"_initEvent",value:function(e){var t=e.onItemClick;t&&this.on("itemClick",t),this.on("click button",this._onTabButton.bind(this))}},{key:"_render",value:function(e){for(var t=e.items,n=e.initName,i=[],o=0,a=t.length;o<a;o+=1)i.push('<button type="button" data-index="'+o+'">'+t[o]+"</button>");this.$el.html(i.join("")),this.activate(n)}},{key:"activate",value:function(e){var t=this.$el.find('button:contains("'+e+'")');this._activateTabByButton(t)}},{key:"_onTabButton",value:function(e){var t=(0,u.default)(e.target);this._activateTabByButton(t),this.trigger("itemClick",t.text())}},{key:"_activateTabByButton",value:function(e){this._isActivatedButton(e)||this._updateClassByButton(e)}},{key:"_updateClassByButton",value:function(e){if(this._$activeButton){var t=this._$activeButton.attr("data-index");this._$activeButton.removeClass("te-tab-active"),this.sections&&this.sections[t].removeClass("te-tab-active")}e.addClass("te-tab-active"),this._$activeButton=e;var n=e.attr("data-index");this.sections&&this.sections[n].addClass("te-tab-active")}},{key:"_isActivatedButton",value:function(e){return this._$activeButton&&this._$activeButton.text()===e.text()}}]),t}(d.default);t.default=f},function(e,t,n){"use strict";var i=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(45);o.default.fn.tuiEditor=function(){var e=void 0,t=void 0,n=this.get(0);if(n){for(var i=arguments.length,r=Array(i),l=0;l<i;l++)r[l]=arguments[l];if(e=r[0]||{},t=o.default.data(n,"tuiEditor")){if("string"==typeof e){var s;return(s=t)[e].apply(s,r.slice(1))}}else e.el=n,t=a.factory(e),o.default.data(n,"tuiEditor",t)}return this},e.exports=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(18),d=i(c),f=n(46),h=i(f),g=n(12),v=i(g),p=n(56),m=i(p),y=n(70),_=i(y),b=n(15),k=i(b),w=n(2),C=i(w),E=n(16),M=i(E),T=n(10),S=i(T),O=n(39),L=i(O),x=n(17),N=i(x),A=n(32),B=i(A),P=n(3),I=i(P),R=n(71),D=i(R),j=n(4),$=i(j),H=n(37),F=i(H),U=n(38),W=i(U),q=n(7),V=i(q),K=n(89),z=i(K),Y=n(90),G=i(Y),X=n(91),Z=i(X),Q=n(92),J=i(Q),ee=n(93),te=i(ee),ne=n(94),ie=i(ne),oe=n(95),ae=i(oe),re=n(96),le=i(re),se=n(97),ue=i(se),ce=n(98),de=i(ce),fe=n(99),he=i(fe),ge=n(100),ve=i(ge),pe=n(101),me=i(pe),ye=n(102),_e=i(ye),be=n(103),ke=i(be),we=n(104),Ce=i(we),Ee=n(105),Me=i(Ee),Te=n(106),Se=i(Te),Oe=n(107),Le=i(Oe),xe=n(108),Ne=i(xe),Ae=n(109),Be=i(Ae),Pe=n(110),Ie=i(Pe),Re=n(111),De=i(Re),je=n(112),$e=i(je),He=n(113),Fe=i(He),Ue=n(114),We=i(Ue),qe=n(115),Ve=i(qe),Ke=n(116),ze=i(Ke),Ye=n(117),Ge=i(Ye),Xe=n(118),Ze=i(Xe),Qe=n(119),Je=i(Qe),et=n(120),tt=i(et),nt=n(121),it=i(nt),ot=n(122),at=i(ot),rt=n(123),lt=i(rt),st=n(124),ut=i(st),ct=n(125),dt=i(ct),ft=n(126),ht=i(ft),gt=n(127),vt=i(gt),pt=n(128),mt=i(pt);n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136),n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144);var yt=[],_t="UA-129966929-1",bt=function(){function e(t){var n=this;o(this,e),this.initialHtml=t.el.innerHTML,t.el.innerHTML="",this.options=l.default.extend({previewStyle:"tab",initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en_US",useDefaultHTMLSanitizer:!0,useCommandShortcut:!0,codeBlockLanguages:q.CodeBlockManager.getHighlightJSLanguages(),usageStatistics:!0,toolbarItems:["heading","bold","italic","strike","divider","hr","quote","divider","ul","ol","task","indent","outdent","divider","table","image","link","divider","code","codeblock"],hideModeSwitch:!1,customConvertor:null},t),this.eventManager=new k.default,this.importManager=new S.default(this.eventManager),this.commandManager=new C.default(this,{useCommandShortcut:this.options.useCommandShortcut}),this.options.customConvertor?this.convertor=new this.options.customConvertor(this.eventManager):this.convertor=new N.default(this.eventManager),this.options.useDefaultHTMLSanitizer&&this.convertor.initHtmlSanitizer(),this.options.hooks&&u.default.forEach(this.options.hooks,function(e,t){return n.addHook(t,e)}),this.options.events&&u.default.forEach(this.options.events,function(e,t){return n.on(t,e)}),this.layout=new _.default(t,this.eventManager),this.i18n=I.default,this.i18n.setCode(this.options.language),this.setUI(this.options.UI||new D.default(this)),this.mdEditor=h.default.factory(this.layout.getMdEditorContainerEl(),this.eventManager,this.options),this.preview=new v.default(this.layout.getPreviewEl(),this.eventManager,this.convertor),this.wwEditor=m.default.factory(this.layout.getWwEditorContainerEl(),this.eventManager),this.toMarkOptions=null,this.changePreviewStyle(this.options.previewStyle),this.changeMode(this.options.initialEditType,!0),this.minHeight(this.options.minHeight),this.height(this.options.height),this.setValue(this.options.initialValue,!1),this.options.placeholder&&this.setPlaceholder(this.options.placeholder),this.options.initialValue||this.setHtml(this.initialHtml,!1),M.default.applyExtension(this,this.options.exts),this.eventManager.emit("load",this),yt.push(this),this._addDefaultCommands(),this.options.usageStatistics&&u.default.sendHostname("editor",_t)}return a(e,[{key:"changePreviewStyle",value:function(e){this.layout.changePreviewStyle(e),this.mdPreviewStyle=e,this.eventManager.emit("changePreviewStyle",e),this.eventManager.emit("previewNeedsRefresh")}},{key:"exec",value:function(){var e;(e=this.commandManager).exec.apply(e,arguments)}},{key:"_addDefaultCommands",value:function(){this.addCommand(z.default),this.addCommand(G.default),this.addCommand(J.default),this.addCommand(te.default),this.addCommand(ie.default),this.addCommand(ae.default),this.addCommand(le.default),this.addCommand(ue.default),this.addCommand(de.default),this.addCommand(he.default),this.addCommand(ve.default),this.addCommand(me.default),this.addCommand(_e.default),this.addCommand(ke.default),this.addCommand(Ce.default),this.addCommand(Me.default),this.addCommand(Z.default),this.addCommand(Se.default),this.addCommand(Le.default),this.addCommand(Be.default),this.addCommand(Ve.default),this.addCommand(ze.default),this.addCommand(Ie.default),this.addCommand(De.default),this.addCommand($e.default),this.addCommand(Fe.default),this.addCommand(We.default),this.addCommand(ut.default),this.addCommand(dt.default),this.addCommand(ht.default),this.addCommand(Ge.default),this.addCommand(Ze.default),this.addCommand(Je.default),this.addCommand(tt.default),this.addCommand(it.default),this.addCommand(at.default),this.addCommand(lt.default),this.addCommand(vt.default),this.addCommand(mt.default),this.addCommand(Ne.default)}},{key:"addCommand",value:function(e,t){t?this.commandManager.addCommand(C.default.command(e,t)):this.commandManager.addCommand(e)}},{key:"afterAddedCommand",value:function(){this.eventManager.emit("afterAddedCommand",this)}},{key:"on",value:function(e,t){this.eventManager.listen(e,t)}},{key:"off",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"addHook",value:function(e,t){this.eventManager.removeEventHandler(e),this.eventManager.listen(e,t)}},{key:"removeHook",value:function(e){this.eventManager.removeEventHandler(e)}},{key:"getCodeMirror",value:function(){return this.mdEditor.getEditor()}},{key:"getSquire",value:function(){return this.wwEditor.getEditor()}},{key:"focus",value:function(){this.getCurrentModeEditor().focus()}},{key:"blur",value:function(){this.getCurrentModeEditor().blur()}},{key:"moveCursorToEnd",value:function(){this.getCurrentModeEditor().moveCursorToEnd()}},{key:"moveCursorToStart",value:function(){this.getCurrentModeEditor().moveCursorToStart()}},{key:"setMarkdown",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e=e||"",this.isMarkdownMode()?this.mdEditor.setValue(e,t):this.wwEditor.setValue(this.convertor.toHTML(e),t),this.eventManager.emit("setMarkdownAfter",e)}},{key:"setHtml",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e=e||"",this.wwEditor.setValue(e,t),this.isMarkdownMode()){var n=this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions);this.mdEditor.setValue(n,t),this.eventManager.emit("setMarkdownAfter",n)}}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setMarkdown(e,t)}},{key:"getMarkdown",value:function(){return this.isMarkdownMode()?this.mdEditor.getValue():this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)}},{key:"getHtml",value:function(){return this.isWysiwygMode()&&this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)),this.convertor.toHTML(this.mdEditor.getValue())}},{key:"getValue",value:function(){return this.getMarkdown()}},{key:"insertText",value:function(e){this.isMarkdownMode()?this.mdEditor.replaceSelection(e):this.wwEditor.insertText(e)}},{key:"addWidget",value:function(e,t,n,i){this.getCurrentModeEditor().addWidget(e,t,n,i)}},{key:"height",value:function(e){return u.default.isExisty(e)&&("auto"===e?((0,l.default)(this.options.el).addClass("auto-height"),this.minHeight(this.minHeight())):((0,l.default)(this.options.el).removeClass("auto-height"),this.minHeight(e)),u.default.isNumber(e)&&(e+="px"),this.options.el.style.height=e,this._height=e),this._height}},{key:"minHeight",value:function(e){if(u.default.isExisty(e)){var t=this._ui.getEditorHeight(),n=this._ui.getEditorSectionHeight(),i=t-n;this._minHeight=e,e=parseInt(e,10),e=Math.max(e-i,0),this.wwEditor.setMinHeight(e),this.mdEditor.setMinHeight(e),this.preview.setMinHeight(e)}return this._minHeight}},{key:"getCurrentModeEditor",value:function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor}},{key:"isMarkdownMode",value:function(){return"markdown"===this.currentMode}},{key:"isWysiwygMode",value:function(){return"wysiwyg"===this.currentMode}},{key:"isViewer",value:function(){return!1}},{key:"getCurrentPreviewStyle",value:function(){return this.mdPreviewStyle}},{key:"changeMode",value:function(e,t){this.currentMode!==e&&(this.eventManager.emit("changeModeBefore",this.currentMode),this.currentMode=e,this.isWysiwygMode()?(this.layout.switchToWYSIWYG(),this.wwEditor.setValue(this.convertor.toHTML(this.mdEditor.getValue()),!t),this.eventManager.emit("changeModeToWysiwyg")):(this.layout.switchToMarkdown(),this.mdEditor.resetState(),this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions),!t),this.getCodeMirror().refresh(),this.eventManager.emit("changeModeToMarkdown")),this.eventManager.emit("changeMode",e),t||this.focus())}},{key:"remove",value:function(){var e=this,t=yt.length-1;for(this.wwEditor.remove(),this.mdEditor.remove(),this.layout.remove(),this.preview.remove(),this.getUI()&&this.getUI().remove(),this.eventManager.emit("removeEditor"),this.eventManager.events.forEach(function(t,n){e.off(n)}),this.eventManager=null;t>=0;t-=1)yt[t]===this&&yt.splice(t,1)}},{key:"hide",value:function(){this.eventManager.emit("hide",this)}},{key:"show",value:function(){this.eventManager.emit("show",this),this.getCodeMirror().refresh()}},{key:"scrollTop",value:function(e){return this.getCurrentModeEditor().scrollTop(e)}},{key:"setUI",value:function(e){this._ui=e}},{key:"getUI",value:function(){return this._ui}},{key:"reset",value:function(){this.wwEditor.reset(),this.mdEditor.reset()}},{key:"getRange",value:function(){return this.getCurrentModeEditor().getRange()}},{key:"getTextObject",value:function(e){return this.getCurrentModeEditor().getTextObject(e)}},{key:"getSelectedText",value:function(){var e=this.getRange();return this.getTextObject(e).getTextContent()||""}},{key:"setPlaceholder",value:function(e){this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)}}],[{key:"getInstances",value:function(){return yt}},{key:"defineExtension",value:function(e,t){M.default.defineExtension(e,t)}},{key:"factory",value:function(t){return t.viewer?new B.default(t):new e(t)}}]),e}();bt.isViewer=!1,bt.i18n=I.default,bt.domUtils=$.default,bt.codeBlockManager=V.default,bt.Button=d.default,bt.WwCodeBlockManager=L.default,bt.WwTableManager=F.default,bt.WwTableSelectionManager=W.default,bt.CommandManager=C.default,bt.markdownitHighlight=N.default.getMarkdownitHighlightRenderer(),bt.markdownit=N.default.getMarkdownitRenderer(),e.exports=bt},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(1),c=i(u),d=n(35),f=i(d),h=n(19),g=i(h),v=n(54),p=i(v),m=n(36),y=i(m),_=n(55),b=i(_),k=g.default.getSharedInstance(),w=function(e){function t(e,n,i){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.get(0),{mode:"gfm",dragDrop:!0,allowDropFileTypes:["image"],extraKeys:{Enter:"newlineAndIndentContinueMarkdownList",Tab:"indentOrderedList","Shift-Tab":"indentLessOrderedList"},viewportMargin:i&&"auto"===i.height?1/0:10}));return r.eventManager=n,r.componentManager=new y.default(r),r.componentManager.addManager(p.default),r._latestState=null,r._initEvent(),r}return r(t,e),l(t,[{key:"_initEvent",value:function(){var e=this;this.cm.getWrapperElement().addEventListener("click",function(){e.eventManager.emit("click",{source:"markdown"})}),this.cm.on("beforeChange",function(t,n){"paste"===n.origin&&e.eventManager.emit("pasteBefore",{source:"markdown",data:n})}),this.cm.on("change",function(t,n){e._emitMarkdownEditorContentChangedEvent(),e._emitMarkdownEditorChangeEvent(n)}),this.cm.on("focus",function(){e.eventManager.emit("focus",{source:"markdown"})}),this.cm.on("blur",function(){e.eventManager.emit("blur",{source:"markdown"})}),this.cm.on("scroll",function(t,n){e.eventManager.emit("scroll",{source:"markdown",data:n})}),this.cm.on("keydown",function(t,n){e.eventManager.emit("keydown",{source:"markdown",data:n}),e.eventManager.emit("keyMap",{source:"markdown",keyMap:k.convert(n),data:n})}),this.cm.on("keyup",function(t,n){e.eventManager.emit("keyup",{source:"markdown",data:n})}),this.cm.on("copy",function(t,n){e.eventManager.emit("copy",{source:"markdown",data:n})}),this.cm.on("cut",function(t,n){e.eventManager.emit("cut",{source:"markdown",data:n})}),this.cm.on("paste",function(t,n){e.eventManager.emit("paste",{source:"markdown",data:n})}),this.cm.on("drop",function(t,n){n.preventDefault(),e.eventManager.emit("drop",{source:"markdown",data:n})}),this.cm.on("cursorActivity",function(){var t=e.cm.getTokenAt(e.cm.getCursor()),n=t.state.base,i={bold:!!n.strong,italic:!!n.em,strike:!!n.strikethrough,code:n.code>0,codeBlock:-1===n.code,quote:!!n.quote,list:!!n.list,task:!!n.taskList,source:"markdown"};e._latestState&&!e._isStateChanged(e._latestState,i)||(e.eventManager.emit("stateChange",i),e._latestState=i)})}},{key:"setValue",value:function(e,n){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e,n),this._emitMarkdownEditorContentChangedEvent()}},{key:"getTextObject",value:function(e){return new b.default(this,e)}},{key:"_emitMarkdownEditorContentChangedEvent",value:function(){this.eventManager.emit("contentChangedFromMarkdown",this)}},{key:"_emitMarkdownEditorChangeEvent",value:function(e){if("setValue"!==e.origin){var t={source:"markdown"};this.eventManager.emit("changeFromMarkdown",t),this.eventManager.emit("change",t)}}},{key:"_isStateChanged",value:function(e,t){var n=!1;return c.default.forEach(t,function(t,i){return!(n=e[i]!==t)}),n}},{key:"resetState",value:function(){this._latestState=null}}],[{key:"factory",value:function(e,n,i){return new t(e,n,i)}}]),t}(f.default);t.default=w},function(e,t,n){"use strict";function i(e,t,n,o){var a=void 0,r=void 0,s=void 0,u=void 0,c=n,d=o.getLine(e);do{var f=l.exec(d);if(a=f[1],r=f[4],s=f[5],(u=a.length)===t)o.replaceRange(""+a+c+r+s,{line:e,ch:0},{line:e,ch:d.length}),c+=1,e+=1;else{if(!(u>t))return e;e=i(e,u,1,o)}d=o.getLine(e)}while(l.test(d));return e}function o(e,t){for(var n=e,i=t.getLine(e);l.test(i);)n-=1,i=t.getLine(n);return e===n?n=-1:n+=1,n}var a=n(6),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/;r.default.commands.indentLessOrderedList=function(e){return e.getOption("disableInput")?r.default.Pass:(e.execCommand("indentLess"),e.execCommand("fixOrderedListNumber"),null)},r.default.commands.fixOrderedListNumber=function(e){if(e.getOption("disableInput"))return r.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n+=1){var a=t[n].head,s=o(a.line,e);if(s>=0){var u=e.getLine(s),c=l.exec(u),d=c[1],f=c[3];i(s,d.length,parseInt(f,10),e)}}return null}},function(e,t,n){"use strict";var i=n(6),o=function(e){return e&&e.__esModule?e:{default:e}}(i);o.default.overlayMode=function(e,t,n){return{startState:function(){return{base:o.default.startState(e),overlay:o.default.startState(t),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:o.default.copyState(e,n.base),overlay:o.default.copyState(t,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(i,o){return(i!=o.streamSeen||Math.min(o.basePos,o.overlayPos)<i.start)&&(o.streamSeen=i,o.basePos=o.overlayPos=i.start),i.start==o.basePos&&(o.baseCur=e.token(i,o.base),o.basePos=i.pos),i.start==o.overlayPos&&(i.pos=i.start,o.overlayCur=t.token(i,o.overlay),o.overlayPos=i.pos),i.pos=Math.min(o.basePos,o.overlayPos),null==o.overlayCur?o.baseCur:null!=o.baseCur&&o.overlay.combineTokens||n&&null==o.overlay.combineTokens?o.baseCur+" "+o.overlayCur:o.overlayCur},indent:e.indent&&function(t,n){return e.indent(t.base,n)},electricChars:e.electricChars,innerMode:function(t){return{state:t.base,mode:e}},blankLine:function(n){e.blankLine&&e.blankLine(n.base),t.blankLine&&t.blankLine(n.overlay)}}}},function(e,t,n){"use strict";var i=n(6),o=function(e){return e&&e.__esModule?e:{default:e}}(i);o.default.defineMode("markdown",function(e,t){function n(t){if(o.default.findModeByName){var n=o.default.findModeByName(t);n&&(t=n.mime||n.mimes[0])}var i=o.default.getMode(e,t);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function a(e,t,n){return t.f=t.block=n,n(e,t)}function r(e){return!e||!/\S/.test(e.string)}function l(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==u){var t=k;if(!t){var n=o.default.innerMode(b,e.htmlState);t="xml"==n.mode.name&&null===n.state.tagStart&&!n.state.context&&n.state.tokenize.isInText}t&&(e.f=h,e.block=s,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function s(e,a){var l=e.column()===a.indentation,s=r(a.prevLine.stream),u=a.indentedCode,f=a.prevLine.hr,h=!1!==a.list,g=(a.listStack[a.listStack.length-1]||0)+3;a.indentedCode=!1;var v=a.indentation;if(null===a.indentationDiff&&(a.indentationDiff=a.indentation,h)){for(a.em=!1,a.strong=!1,a.code=!1,a.strikethrough=!1,a.list=null;v<a.listStack[a.listStack.length-1];)a.listStack.pop(),a.listStack.length?a.indentation=a.listStack[a.listStack.length-1]:a.list=!1;!1!==a.list&&(a.indentationDiff=v-a.listStack[a.listStack.length-1])}var p=!(s||f||a.prevLine.header||h&&u||a.prevLine.fencedCodeEnd),y=(!1===a.list||f||s)&&a.indentation<=g&&e.match(E),_=null;if(a.indentationDiff>=4&&(u||a.prevLine.fencedCodeEnd||a.prevLine.header||s))return e.skipToEnd(),a.indentedCode=!0,w.code;if(e.eatSpace())return null;if(l&&a.indentation<=g&&(_=e.match(S))&&_[1].length<=6)return a.quote=0,a.header=_[1].length,a.thisLine.header=!0,t.highlightFormatting&&(a.formatting="header"),a.f=a.inline,d(a);if(a.indentation<=g&&e.eat(">"))return a.quote=l?1:a.quote+1,t.highlightFormatting&&(a.formatting="quote"),e.eatSpace(),d(a);if(!y&&!a.setext&&l&&a.indentation<=g&&(_=e.match(M))){var b=_[1]?"ol":"ul";return a.indentation=v+e.current().length,a.list=!0,a.quote=0,a.listStack.push(a.indentation),t.taskLists&&e.match(T,!1)&&(a.taskList=!0),a.f=a.inline,t.highlightFormatting&&(a.formatting=["list","list-"+b]),d(a)}return l&&a.indentation<=g&&(_=e.match(x,!0))?(a.quote=0,a.fencedEndRE=new RegExp(_[1]+"+ *$"),a.localMode=t.fencedCodeBlockHighlighting&&n(_[2]),a.localMode&&(a.localState=o.default.startState(a.localMode)),a.f=a.block=c,t.highlightFormatting&&(a.formatting="code-block"),a.code=-1,d(a)):a.setext||!(p&&h||a.quote||!1!==a.list||a.code||y||N.test(e.string))&&(_=e.lookAhead(1))&&(_=_.match(O))?(a.setext?(a.header=a.setext,a.setext=0,e.skipToEnd(),t.highlightFormatting&&(a.formatting="header")):(a.header="="==_[0].charAt(0)?1:2,a.setext=a.header),a.thisLine.header=!0,a.f=a.inline,d(a)):y?(e.skipToEnd(),a.hr=!0,a.thisLine.hr=!0,w.hr):"["===e.peek()?i(e,a,m):i(e,a,a.inline)}function u(e,t){var n=b.token(e,t.htmlState);if(!k){var i=o.default.innerMode(b,t.htmlState);("xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=h,t.block=s,t.htmlState=null)}return n}function c(e,n){var i=n.listStack[n.listStack.length-1]||0,o=n.indentation<i,r=i+3;if(n.fencedEndRE&&n.indentation<=r&&(o||e.match(n.fencedEndRE))){t.highlightFormatting&&(n.formatting="code-block");var l;return o||(l=d(n)),n.localMode=n.localState=null,n.block=s,n.f=h,n.fencedEndRE=null,n.code=0,n.thisLine.fencedCodeEnd=!0,o?a(e,n,n.block):l}return n.localMode?n.localMode.token(e,n.localState):(e.skipToEnd(),w.code)}function d(e){var n=[];if(e.formatting){n.push(w.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)n.push(w.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&n.push(w.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(w.formatting+"-"+e.formatting[i]+"-"+e.quote):n.push("error"))}if(e.taskOpen)return n.push("meta"),n.length?n.join(" "):null;if(e.taskClosed)return n.push("property"),n.length?n.join(" "):null;if(e.linkHref?n.push(w.linkHref,"url"):(e.strong&&n.push(w.strong),e.em&&n.push(w.em),e.strikethrough&&n.push(w.strikethrough),e.emoji&&n.push(w.emoji),e.linkText&&n.push(w.linkText),e.code&&n.push(w.code),e.image&&n.push(w.image),e.imageAltText&&n.push(w.imageAltText,"link"),e.imageMarker&&n.push(w.imageMarker)),e.header&&n.push(w.header,w.header+"-"+e.header),e.quote&&(n.push(w.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?n.push(w.quote+"-"+e.quote):n.push(w.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var o=(e.listStack.length-1)%3;o?1===o?n.push(w.list2):n.push(w.list3):n.push(w.list1)}return e.trailingSpaceNewLine?n.push("trailing-space-new-line"):e.trailingSpace&&n.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),n.length?n.join(" "):null}function f(e,t){if(e.match(L,!0))return d(t)}function h(e,n){var i=n.text(e,n);if(void 0!==i)return i;if(n.list)return n.list=null,d(n);if(n.taskList){return" "===e.match(T,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,t.highlightFormatting&&(n.formatting="task"),n.taskList=!1,d(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(n.formatting="header"),d(n);var r=e.next();if(n.linkTitle){n.linkTitle=!1;var l=r;"("===r&&(l=")"),l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var s="^\\s*(?:[^"+l+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(s),!0))return w.linkHref}if("`"===r){var c=n.formatting;t.highlightFormatting&&(n.formatting="code"),e.eatWhile("`");var f=e.current().length;if(0!=n.code||n.quote&&1!=f){if(f==n.code){var p=d(n);return n.code=0,p}return n.formatting=c,d(n)}return n.code=f,d(n)}if(n.code)return d(n);if("\\"===r&&(e.next(),t.highlightFormatting)){var m=d(n),y=w.formatting+"-escape";return m?m+" "+y:y}if("!"===r&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,t.highlightFormatting&&(n.formatting="image"),d(n);if("["===r&&n.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,t.highlightFormatting&&(n.formatting="image"),d(n);if("]"===r&&n.imageAltText){t.highlightFormatting&&(n.formatting="image");var m=d(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=v,m}if("["===r&&!n.image)return n.linkText&&e.match(/^.*?\]/)?d(n):(n.linkText=!0,t.highlightFormatting&&(n.formatting="link"),d(n));if("]"===r&&n.linkText){t.highlightFormatting&&(n.formatting="link");var m=d(n);return n.linkText=!1,n.inline=n.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?v:h,m}if("<"===r&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=g,t.highlightFormatting&&(n.formatting="link");var m=d(n);return m?m+=" ":m="",m+w.linkInline}if("<"===r&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=g,t.highlightFormatting&&(n.formatting="link");var m=d(n);return m?m+=" ":m="",m+w.linkEmail}if(t.xml&&"<"===r&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=e.string.indexOf(">",e.pos);if(-1!=_){/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(e.string.substring(e.start,_))&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=o.default.startState(b),a(e,n,u)}if(t.xml&&"<"===r&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===r||"_"===r){for(var k=1,C=1==e.pos?" ":e.string.charAt(e.pos-2);k<3&&e.eat(r);)k++;var E=e.peek()||" ",M=!/\s/.test(E)&&(!A.test(E)||/\s/.test(C)||A.test(C)),S=!/\s/.test(C)&&(!A.test(C)||/\s/.test(E)||A.test(E)),O=null,L=null;if(k%2&&(n.em||!M||"*"!==r&&S&&!A.test(C)?n.em!=r||!S||"*"!==r&&M&&!A.test(E)||(O=!1):O=!0),k>1&&(n.strong||!M||"*"!==r&&S&&!A.test(C)?n.strong!=r||!S||"*"!==r&&M&&!A.test(E)||(L=!1):L=!0),null!=L||null!=O){t.highlightFormatting&&(n.formatting=null==O?"strong":null==L?"em":"strong em"),!0===O&&(n.em=r),!0===L&&(n.strong=r);var p=d(n);return!1===O&&(n.em=!1),!1===L&&(n.strong=!1),p}}else if(" "===r&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return d(n);e.backUp(1)}if(t.strikethrough)if("~"===r&&e.eatWhile(r)){if(n.strikethrough){t.highlightFormatting&&(n.formatting="strikethrough");var p=d(n);return n.strikethrough=!1,p}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,t.highlightFormatting&&(n.formatting="strikethrough"),d(n)}else if(" "===r&&e.match(/^~~/,!0)){if(" "===e.peek())return d(n);e.backUp(2)}if(t.emoji&&":"===r&&e.match(/^[a-z_\d+-]+:/)){n.emoji=!0,t.highlightFormatting&&(n.formatting="emoji");var x=d(n);return n.emoji=!1,x}return" "===r&&(e.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),d(n)}function g(e,n){if(">"===e.next()){n.f=n.inline=h,t.highlightFormatting&&(n.formatting="link");var i=d(n);return i?i+=" ":i="",i+w.linkInline}return e.match(/^[^>]+/,!0),w.linkInline}function v(e,n){if(e.eatSpace())return null;var i=e.next();return"("===i||"["===i?(n.f=n.inline=p("("===i?")":"]"),t.highlightFormatting&&(n.formatting="link-string"),n.linkHref=!0,d(n)):"error"}function p(e){return function(n,i){if(n.next()===e){i.f=i.inline=h,t.highlightFormatting&&(i.formatting="link-string");var o=d(i);return i.linkHref=!1,o}return n.match(B[e]),i.linkHref=!0,d(i)}}function m(e,n){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(n.f=y,e.next(),t.highlightFormatting&&(n.formatting="link"),n.linkText=!0,d(n)):i(e,n,h)}function y(e,n){if(e.match(/^\]:/,!0)){n.f=n.inline=_,t.highlightFormatting&&(n.formatting="link");var i=d(n);return n.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),w.linkText}function _(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,w.linkHref+" url")}var b=o.default.getMode(e,"text/html"),k="null"==b.name;void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var w={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var C in w)w.hasOwnProperty(C)&&t.tokenTypeOverrides[C]&&(w[C]=t.tokenTypeOverrides[C]);var E=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,T=/^\[(x| )\](?=\s)/i,S=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ *(?:\={1,}|-{1,})\s*$/,L=/^[^#!\[\]*_\\<>` "'(~:]+/,x=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,N=/^\s*\[[^\]]+?\]:.*$/,A=/[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~]/,B={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},P={startState:function(){return{f:s,prevLine:{stream:null},thisLine:{stream:null},block:s,htmlState:null,indentation:0,inline:h,text:f,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&o.default.copyState(b,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?o.default.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return l(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=u)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==u?{state:e.htmlState,mode:b}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},indent:function(e,t,n){return e.block==u&&b.indent?b.indent(e.htmlState,t,n):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,n):o.default.Pass},blankLine:l,getType:d,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P},"xml"),o.default.defineMIME("text/markdown","markdown"),o.default.defineMIME("text/x-markdown","markdown")},function(e,t,n){"use strict";var i=n(6),o=function(e){return e&&e.__esModule?e:{default:e}}(i);o.default.defineMode("gfm",function(e,t){function n(e){return e.code=!1,null}var i=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```+/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");var o=1+e.pos-n;return t.code?o===i&&(t.code=!1):(i=o,t.code=!0),null}return t.code?(e.next(),null):e.eatSpace()?(t.ateSpace=!0,null):(e.next(),null)},blankLine:n},r={taskLists:!0,strikethrough:!0,emoji:!0};for(var l in t)r[l]=t[l];return r.name="markdown",o.default.overlayMode(o.default.getMode(e,r),a)},"markdown"),o.default.defineMIME("text/x-gfm","gfm")},function(e,t,n){"use strict";function i(e,t){var n=t.line,i=0,o=0,a=r.exec(e.getLine(n)),l=a[1];do{i+=1;var s=n+i,u=e.getLine(s),c=r.exec(u);if(c){var d=c[1],f=parseInt(a[3],10)+i-o,h=parseInt(c[3],10),g=h;if(l!==d||isNaN(h)){if(l.length>d.length)return;if(l.length<d.length&&1===i)return;o+=1}else f===h&&(g=h+1),f>h&&(g=f+1),e.replaceRange(u.replace(r,d+g+c[4]+c[5]),{line:s,ch:0},{line:s,ch:u.length})}}while(c)}var o=n(6),a=function(e){return e&&e.__esModule?e:{default:e}}(o),r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,l=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,s=/[*+-]\s/;a.default.commands.indentOrderedList=function(e){if(e.getOption("disableInput"))return a.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var i=t[n].head,o=e.getLine(i.line),l=o.substr(0,i.ch);r.test(l)||e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertSoftTab")}e.execCommand("fixOrderedListNumber")},a.default.commands.newlineAndIndentContinueMarkdownList=function(e){if(e.getOption("disableInput"))return a.default.Pass;for(var t=e.listSelections(),n=[],o=0;o<t.length;o++){var u=t[o].head,c=e.getStateAfter(u.line),d=!1!==c.list,f=0!==c.quote,h=e.getLine(u.line),g=r.exec(h),v=/^\s*$/.test(h.slice(0,u.ch));if(!t[o].empty()||!d&&!f||!g||v)return void e.execCommand("newlineAndIndent");if(l.test(h))/>\s*$/.test(h)||e.replaceRange("",{line:u.line,ch:0},{line:u.line,ch:u.ch+1}),n[o]="\n";else{var p=g[1],m=g[5],y=!(s.test(g[2])||g[2].indexOf(">")>=0),_=y?parseInt(g[3],10)+1+g[4]:g[2].replace("x"," ");n[o]="\n"+p+_+m,y&&i(e,u)}}e.replaceSelections(n)}},function(e,t,n){"use strict";function i(e){return o(e)&&e.anchor.ch===e.head.ch}function o(e){return e.anchor.line===e.head.line}function a(e,t,n,o){var a=e.getLine(n.line),r=e.getLine(n.line+o),l={anchor:t,head:n};e.replaceRange(r,{line:n.line,ch:0},{line:n.line,ch:a.length},"+input"),e.replaceRange(a,{line:n.line+o,ch:0},{line:n.line+o,ch:r.length},"+input"),i(l)?e.setCursor({line:n.line+o,ch:n.ch}):e.setSelection({line:t.line+o,ch:t.ch},{line:n.line+o,ch:n.ch})}function r(e,t,n,i){var o=e.getRange({line:t.line,ch:0},{line:n.line,ch:e.getLine(n.line).length}),a=i>0?n:t,r=e.getLine(a.line+i),l=void 0;l=i>0?t:n,e.replaceRange(r,{line:l.line,ch:0},{line:l.line,ch:e.getLine(l.line).length},"+input"),e.replaceRange(o,{line:t.line+i,ch:0},{line:n.line+i,ch:e.getLine(n.line+i).length},"+input"),e.setSelection({line:t.line+i,ch:t.ch},{line:n.line+i,ch:n.ch})}var l=n(6),s=function(e){return e&&e.__esModule?e:{default:e}}(l);s.default.commands.replaceLineTextToUpper=function(e){if(e.getOption("disableInput"))return s.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var l=t[n],u=l.anchor,c=l.head;if(o(l)&&c.line>0)a(e,u,c,-1);else if(!i(l)){var d=u.line<c.line?u.line:c.line;if(d>0){var f=u.line===d?u:c,h=u.line===d?c:u;r(e,f,h,-1)}}}},s.default.commands.replaceLineTextToLower=function(e){if(e.getOption("disableInput"))return s.default.Pass;for(var t=e.listSelections(),n=0;n<t.length;n++){var l=t[n],u=l.anchor,c=l.head,d=c.line===e.lastLine();if(o(l)&&!d)a(e,u,c,1);else if(!i(l)){var f=u.line<c.line?u.line:c.line,h=u.line===f?u:c,g=u.line===f?c:u;g.line<e.lastLine()&&r(e,h,g,1)}}}},function(e,t,n){"use strict";function i(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function o(e){i(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.className="CodeMirror-placeholder";var n=e.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),t.appendChild(n),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function a(e){l(e)&&o(e)}function r(e){var t=e.getWrapperElement(),n=l(e);t.className=t.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?o(e):i(e)}function l(e){return 1===e.lineCount()&&""===e.getLine(0)}var s=n(6),u=function(e){return e&&e.__esModule?e:{default:e}}(s);u.default.defineOption("placeholder","",function(e,t,n){var o=n&&n!=u.default.Init;if(t&&!o)e.on("blur",a),e.on("change",r),e.on("swapDoc",r),r(e);else if(!t&&o){e.off("blur",a),e.off("change",r),e.off("swapDoc",r),i(e);var l=e.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}t&&!e.hasFocus()&&a(e)})},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=/^[ \t]*([-*]|[\d]+\.)( \[[ xX]])? /,r=/^[ \t]*([*-] |[\d]+\. )(\[[ xX]] )/,l=/^[ \t]*[-*] .*/,s=/^[ \t]*[\d]+\. \[[ xX]] .*/,u=/([*-] |[\d]+\. )/,c=/([-*] |[\d]+\. )(\[[ xX]] )/,d=/([-*]|[\d]+\.)( \[[ xX]])? /,f=/([-*])( \[[ xX]]) /,h=/([\d])+\.( \[[ xX]])? /,g=/^\|([-\s\w\d\t<>?!@#$%^&*()_=+\\\/'";: \r[\]]*\|+)+/i,v=/^#+\s/,p=/^ {0,3}(```|\||>)/,m=function(){function e(t){i(this,e),this.cm=t.getEditor(),this.doc=this.cm.getDoc(),this.name="list"}return o(e,[{key:"_createSortedLineRange",value:function(e){var t=e.from.line>e.to.line;return{start:{line:t?e.to.line:e.from.line,ch:0}.line,end:{line:t?e.from.line:e.to.line,ch:0}.line}}},{key:"_calculateOrdinalNumber",value:function(e){for(var t=1,n=e-1;n>=0;n-=1){var i=this._getListDepth(n);if(1===i&&h.exec(this.doc.getLine(n))){t=parseInt(RegExp.$1,10)+1;break}if(0===i)break}return t}},{key:"_isListLine",value:function(e){return!!a.exec(this.doc.getLine(e))}},{key:"_isCanBeList",value:function(e){var t=this.doc.getLine(e);return!p.test(t)&&!g.test(t)&&!v.test(t)}},{key:"_getChangeFn",value:function(e){var t=this,n=void 0;switch(e){case"ol":case"ul":n=function(n){return t._changeToList(n,e)};break;case"task":n=function(e){return t._changeToTask(e)}}return n}},{key:"changeSyntax",value:function(e,t){for(var n=[],i=this._createSortedLineRange(e),o=i.start,a=i.end,r=this._getChangeFn(t),l=o;l<=a&&this._isCanBeList(l);l+=1)this._isListLine(l)||n.push(l),r(l);this._insertBlankLineForNewList(n),this.cm.focus()}},{key:"_replaceLineText",value:function(e,t){this.doc.replaceRange(e,{line:t,ch:0})}},{key:"_changeToList",value:function(e,t){var n=this;this._isListLine(e)?this._changeSameDepthList(e,"ol"===t?function(e,t){n._replaceListTypeToOL(e,t)}:function(e){n._replaceListTypeToUL(e)}):this._replaceLineText("ol"===t?this._calculateOrdinalNumber(e)+". ":"* ",e)}},{key:"_changeToTask",value:function(e){r.exec(this.doc.getLine(e))?this._replaceLineTextByRegexp(e,c,"$1"):this._isListLine(e)?this._replaceLineTextByRegexp(e,u,"$1[ ] "):this._replaceLineText("* [ ] ",e)}},{key:"_getListDepth",value:function(e){return this.doc.getLine(e)?this.doc.cm.getStateAfter(e).base.listStack.length:0}},{key:"_findSameDepthList",value:function(e,t,n){for(var i=this.doc.lineCount(),o=[],a=e,r=void 0;n?a<i-1:a>0;)if(a=n?a+1:a-1,(r=this._getListDepth(a))===t)o.push(a);else if(r<t)break;return o}},{key:"_changeSameDepthList",value:function(e,t){var n=this._getListDepth(e),i=this._findSameDepthList(e,n,!1).reverse(),o=this._findSameDepthList(e,n,!0);i.concat([e]).concat(o).forEach(function(e,n){t(e,n+1)})}},{key:"_replaceLineTextByRegexp",value:function(e,t,n){var i=this.doc.getLine(e),o={line:e,ch:0},a={line:e,ch:i.length};i=i.replace(t,n),this.doc.replaceRange(i,o,a)}},{key:"_replaceListTypeToUL",value:function(e){var t=this.doc.getLine(e);f.exec(t)?this._replaceLineTextByRegexp(e,f,"$1 "):h.exec(t)&&this._replaceLineTextByRegexp(e,h,"* ")}},{key:"_replaceListTypeToOL",value:function(e,t){var n=this.doc.getLine(e);l.exec(n)||s.exec(n)?this._replaceLineTextByRegexp(e,d,t+". "):h.exec(n)&&parseInt(RegExp.$1,10)!==t&&this._replaceLineTextByRegexp(e,h,t+". ")}},{key:"_insertBlankLineForNewList",value:function(e){var t=e.length;if(t){var n=e[0],i=e[t-1];this._isNotBlankNotListLine(i+1)&&this.doc.replaceRange("\n",{line:i,ch:this.doc.getLine(i).length}),n>0&&this._isNotBlankNotListLine(n-1)&&this.doc.replaceRange("\n",{line:n,ch:0})}}},{key:"_isNotBlankNotListLine",value:function(e){return!!this.doc.getLine(e)&&!this._isListLine(e)}}]),e}();t.default=m},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function(){function e(t,n){i(this,e),this._mde=t,this.setRange(n||t.getRange())}return o(e,[{key:"_setStart",value:function(e){this._start=e}},{key:"_setEnd",value:function(e){this._end=e}},{key:"setRange",value:function(e){this._setStart(e.start),this._setEnd(e.end)}},{key:"setEndBeforeRange",value:function(e){this._setEnd(e.start)}},{key:"expandStartOffset",value:function(){var e=this._start;0!==e.ch&&(e.ch-=1)}},{key:"expandEndOffset",value:function(){var e=this._end;e.ch<this._mde.getEditor().getDoc().getLine(e.line).length&&(e.ch+=1)}},{key:"getTextContent",value:function(){return this._mde.getEditor().getRange(this._start,this._end)}},{key:"replaceContent",value:function(e){this._mde.getEditor().replaceRange(e,this._start,this._end,"+input")}},{key:"deleteContent",value:function(){this._mde.getEditor().replaceRange("",this._start,this._end,"+delete")}},{key:"peekStartBeforeOffset",value:function(e){var t={line:this._start.line,ch:Math.max(this._start.ch-e,0)};return this._mde.getEditor().getRange(t,this._start)}}]),e}();t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(4),d=i(c),f=n(57),h=i(f),g=n(60),v=i(g),p=n(61),m=i(p),y=n(37),_=i(y),b=n(38),k=i(b),w=n(62),C=i(w),E=n(63),M=i(E),T=n(64),S=i(T),O=n(39),L=i(O),x=n(65),N=i(x),A=n(19),B=i(A),P=n(67),I=i(P),R=n(36),D=i(R),j=n(68),$=i(j),H=B.default.getSharedInstance(),F=/<([a-z]+|h\d)>(<br>|<br \/>)<\/\1>/gi,U=/(?:<br>|<br \/>)<\/(.+?)>/gi,W=/\b(H[\d]|LI|P|BLOCKQUOTE|TD|PRE)\b/,q=/^(TABLE|H[1-6])$/,V="undefined"!=typeof MutationObserver,K=function(){function e(t,n){var i=this;o(this,e),this.componentManager=new D.default(this),this.eventManager=n,this.$editorContainerEl=t,this._height=0,this._silentChange=!1,this._keyEventHandlers={},this._managers={},this._initEvent(),this._initDefaultKeyEventHandler(),this.debouncedPostProcessForChange=u.default.debounce(function(){return i.postProcessForChange()},0)}return a(e,[{key:"init",value:function(){var e=(0,l.default)("<div />");this.$editorContainerEl.append(e),this.editor=new N.default(e[0],{blockTag:"DIV",leafNodeNames:{HR:!1}}),this.editor.blockCommandShortcuts(),this._clipboardManager=new h.default(this),this._initSquireEvent(),this._clipboardManager.init(),this.get$Body().addClass("tui-editor-contents"),this.$editorContainerEl.css("position","relative"),this._togglePlaceholder(),this.codeBlockGadget=new $.default({eventManager:this.eventManager,container:this.$editorContainerEl,wysiwygEditor:this})}},{key:"_preprocessForInlineElement",value:function(e){return e.replace(/<br>( *)<img/g,"<br><br>$1<img")}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._preprocessForInlineElement(t)}),this.eventManager.listen("wysiwygKeyEvent",function(t){return e._runKeyEventHandlers(t.data,t.keyMap)}),this.eventManager.listen("wysiwygRangeChangeAfter",function(){return e.scrollIntoCursor()}),this.eventManager.listen("contentChangedFromWysiwyg",function(){e._togglePlaceholder()})}},{key:"addKeyEventHandler",value:function(e,t){var n=this;t||(t=e,e="DEFAULT"),u.default.isArray(e)||(e=[e]),e.forEach(function(e){n._keyEventHandlers[e]||(n._keyEventHandlers[e]=[]),n._keyEventHandlers[e].push(t)})}},{key:"removeKeyEventHandler",value:function(e,t){t||(t=e,e="DEFAULT");var n=this._keyEventHandlers[e];n&&(this._keyEventHandlers[e]=n.filter(function(e){return e!==t}))}},{key:"_runKeyEventHandlers",value:function(e,t){var n=this.getRange(),i=void 0,o=void 0;i=this._keyEventHandlers.DEFAULT,i&&u.default.forEachArray(i,function(i){return o=i(e,n,t)}),(i=this._keyEventHandlers[t])&&!1!==o&&u.default.forEachArray(i,function(i){return i(e,n,t)})}},{key:"_initSquireEvent",value:function(){var e=this,t=this.getEditor(),n=!1;t.addEventListener("copy",function(t){e.eventManager.emit("copy",{source:"wysiwyg",data:t}),u.default.debounce(function(){e.isEditorValid()&&e.eventManager.emit("copyAfter",{source:"wysiwyg",data:t})})()}),t.addEventListener(u.default.browser.msie?"beforecut":"cut",function(t){e.eventManager.emit("cut",{source:"wysiwyg",data:t}),u.default.debounce(function(){e.isEditorValid()&&e.eventManager.emit("cutAfter",{source:"wysiwyg",data:t})})()}),t.addEventListener(u.default.browser.msie?"beforepaste":"paste",function(t){e.eventManager.emit("paste",{source:"wysiwyg",data:t})}),t.addEventListener("dragover",function(e){return e.preventDefault(),!1}),t.addEventListener("drop",function(t){return t.preventDefault(),e.eventManager.emit("drop",{source:"wysiwyg",data:t}),!1}),t.addEventListener("input",u.default.debounce(function(){if(e.isEditorValid()){if(e._silentChange)e._silentChange=!1;else{var t={source:"wysiwyg"};e.eventManager.emit("changeFromWysiwyg",t),e.eventManager.emit("change",t),e.eventManager.emit("contentChangedFromWysiwyg",e)}e.getEditor().preserveLastLine()}},0)),t.addEventListener("keydown",function(t){e.getEditor().getSelection().collapsed||(n=!0),e.eventManager.emit("keydown",{source:"wysiwyg",data:t}),e._onKeyDown(t)}),u.default.browser.firefox&&(t.addEventListener("keypress",function(t){var i=t.keyCode;if(13===i||9===i){e.getEditor().getSelection().collapsed||(n=!0),e.eventManager.emit("keydown",{source:"wysiwyg",data:t}),e._onKeyDown(t)}}),t.addEventListener("keyup",function(){var t=e.getRange();if(d.default.isTextNode(t.commonAncestorContainer)&&d.default.isTextNode(t.commonAncestorContainer.previousSibling)){var n=t.commonAncestorContainer.previousSibling.length,i=t.commonAncestorContainer;t.commonAncestorContainer.previousSibling.appendData(t.commonAncestorContainer.data),t.setStart(t.commonAncestorContainer.previousSibling,n+t.startOffset),t.collapse(!0),i.parentNode.removeChild(i),e.setRange(t),t.detach()}})),t.addEventListener("keyup",function(t){n&&(e.debouncedPostProcessForChange(),n=!1),e.eventManager.emit("keyup",{source:"wysiwyg",data:t})}),this.$editorContainerEl.on("scroll",function(t){e.eventManager.emit("scroll",{source:"wysiwyg",data:t})}),t.addEventListener("click",function(t){e.eventManager.emit("click",{source:"wysiwyg",data:t})}),t.addEventListener("mousedown",function(t){e.eventManager.emit("mousedown",{source:"wysiwyg",data:t})}),t.addEventListener("mouseover",function(t){e.eventManager.emit("mouseover",{source:"wysiwyg",data:t})}),t.addEventListener("mouseout",function(t){e.eventManager.emit("mouseout",{source:"wysiwyg",data:t})}),t.addEventListener("mouseup",function(t){e.eventManager.emit("mouseup",{source:"wysiwyg",data:t})}),t.addEventListener("contextmenu",function(t){e.eventManager.emit("contextmenu",{source:"wysiwyg",data:t})}),t.addEventListener("focus",function(){e.eventManager.emit("focus",{source:"wysiwyg"})}),t.addEventListener("blur",function(){e.fixIMERange(),e.eventManager.emit("blur",{source:"wysiwyg"})}),t.addEventListener("pathChange",function(t){var n={bold:/(>B|>STRONG|^B$|^STRONG$)/.test(t.path),italic:/(>I|>EM|^I$|^EM$)/.test(t.path),strike:/(^S>|>S$|>S>|^S$)/.test(t.path),code:/CODE/.test(t.path),codeBlock:/PRE/.test(t.path),quote:/BLOCKQUOTE/.test(t.path),list:/LI(?!.task-list-item)/.test(e._getLastLiString(t.path)),task:/LI.task-list-item/.test(e._getLastLiString(t.path)),source:"wysiwyg"};e.eventManager.emit("stateChange",n)}),t.addEventListener("willPaste",function(t){t.fragment&&e.eventManager.emit("willPaste",{source:"wysiwyg",data:t})})}},{key:"_togglePlaceholder",value:function(){var e=this.getEditor();e.modifyDocument(function(){var t=e.getRoot();t.textContent||t.childNodes.length>1?t.classList.remove("tui-editor-contents-placeholder"):t.classList.add("tui-editor-contents-placeholder")})}},{key:"_getLastLiString",value:function(e){var t=/LI[^UO]*$/.exec(e);return t?t[0]:""}},{key:"_onKeyDown",value:function(e){var t=H.convert(e);e.keyCode&&(this.eventManager.emit("keyMap",{source:"wysiwyg",keyMap:t,data:e}),e.defaultPrevented||this.eventManager.emit("wysiwygKeyEvent",{keyMap:t,data:e}))}},{key:"_initDefaultKeyEventHandler",value:function(){var e=this;this.addKeyEventHandler("ENTER",function(t,n){e._isInOrphanText(n)&&e.defer(function(){e._wrapDefaultBlockToOrphanTexts(),e.breakToNewDefaultBlock(n,"before")}),e.defer(function(){return e.scrollIntoCursor()})}),this.addKeyEventHandler("TAB",function(t){var n=e.getEditor(),i=n.getSelection(),o=i.collapsed&&e._isCursorNotInRestrictedAreaOfTabAction(n),a=!i.collapsed&&d.default.isTextNode(i.commonAncestorContainer);return t.preventDefault(),!o&&!a||(n.insertPlainText("    "),!1)}),this.addKeyEventHandler("BACK_SPACE",function(t,n,i){return e._handleRemoveKeyEvent(t,n,i)}),this.addKeyEventHandler("DELETE",function(t,n,i){return e._handleRemoveKeyEvent(t,n,i)})}},{key:"_handleRemoveKeyEvent",value:function(e,t,n){var i=this.getEditor();if(this._isStartHeadingOrTableAndContainsThem(t)){var o="BACK_SPACE"===n?"backspace":"delete";return i.removeAllFormatting(),i._keyHandlers[o](i,e,i.getSelection()),i.removeLastUndoStack(),!1}return!0}},{key:"_isStartHeadingOrTableAndContainsThem",value:function(e){var t=e.startContainer,n=e.startOffset,i=e.commonAncestorContainer,o=e.collapsed,a=this.getEditor().getRoot();if(!o&&i===a){if(t===a)return q.test(d.default.getChildNodeByOffset(t,n).nodeName);if(0===n)return q.test(d.default.getParentUntil(t,a).nodeName)}return!1}},{key:"_wrapDefaultBlockToOrphanTexts",value:function(){this.get$Body().contents().filter(this.findTextNodeFilter).each(function(e,t){t.nextSibling&&"BR"===t.nextSibling.tagName&&(0,l.default)(t.nextSibling).remove(),(0,l.default)(t).wrap("<div />")})}},{key:"_isInOrphanText",value:function(e){return e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer.parentNode===this.get$Body()[0]}},{key:"_wrapDefaultBlockTo",value:function(e){this.saveSelection(e),this._joinSplitedTextNodes(),this.restoreSavedSelection(),e=this.getRange();var t=e.startContainer,n=e.startOffset,i=this.getEditor().createDefaultBlock([e.startContainer]),o=d.default.getChildNodeByOffset(e.startContainer,e.startOffset);o?e.setStartBefore(o):e.selectNodeContents(e.startContainer),e.collapse(!0),e.insertNode(i),e.setStart(t,n),e.collapse(!0),this.setRange(e)}},{key:"findTextNodeFilter",value:function(){return this.nodeType===Node.TEXT_NODE}},{key:"_joinSplitedTextNodes",value:function(){var e=void 0,t=void 0,n=[];this.get$Body().contents().filter(this.findTextNodeFilter).each(function(i,o){e===o.previousSibling?(t.nodeValue+=o.nodeValue,n.push(o)):t=o,e=o}),(0,l.default)(n).remove()}},{key:"saveSelection",value:function(e){e||(e=this.getRange()),this.getEditor()._saveRangeToBookmark(e)}},{key:"setSelectionByContainerAndOffset",value:function(e,t,n,i){var o=this.getEditor(),a=o.getSelection();return a.setStart(e,t),a.setEnd(n,i),o.setSelection(a),a}},{key:"restoreSavedSelection",value:function(){this.setRange(this.getEditor()._getRangeAndRemoveBookmark())}},{key:"reset",value:function(){this.setValue("")}},{key:"changeBlockFormatTo",value:function(e){this.getEditor().changeBlockFormatTo(e),this.eventManager.emit("wysiwygRangeChangeAfter",this)}},{key:"makeEmptyBlockCurrentSelection",value:function(){var e=this;this.getEditor().modifyBlocks(function(t){return t.textContent||(t=e.getEditor().createDefaultBlock()),t})}},{key:"focus",value:function(){var e=this.scrollTop();this.editor.focus(),e!==this.scrollTop()&&this.scrollTop(e)}},{key:"blur",value:function(){this.editor.blur()}},{key:"remove",value:function(){this.$editorContainerEl.off("scroll"),this.getEditor().destroy(),this.editor=null,this.$body=null,this.eventManager=null}},{key:"setHeight",value:function(e){this._height=e,this.$editorContainerEl.css("overflow","auto"),this.$editorContainerEl.css("height","100%"),this.$editorContainerEl.parent().height(e);var t=parseInt(this.$editorContainerEl.css("padding-top"),10)-parseInt(this.$editorContainerEl.css("padding-bottom"),10),n=parseInt(this.get$Body().css("margin-top"),10)-parseInt(this.get$Body().css("margin-bottom"),10);this.get$Body().css("min-height",e-n-t+"px")}},{key:"setMinHeight",value:function(e){this.get$Body().get(0).style.minHeight=e+"px"}},{key:"setPlaceholder",value:function(e){e&&this.getEditor().getRoot().setAttribute("data-placeholder",e)}},{key:"setValue",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e=this.eventManager.emitReduce("wysiwygSetValueBefore",e),this.editor.setHTML(e),this.eventManager.emit("wysiwygSetValueAfter",this),this.eventManager.emit("contentChangedFromWysiwyg",this),t&&this.moveCursorToEnd(),this.getEditor().preserveLastLine(),this.getEditor().removeLastUndoStack(),this.getEditor().saveUndoState()}},{key:"insertText",value:function(e){this.editor.insertPlainText(e)}},{key:"getValue",value:function(){this._prepareGetHTML();var e=this.editor.getHTML();return e=e.replace(F,function(e,t){return"li"===t?e:"td"===t||"th"===t?"<"+t+"></"+t+">":"<br />"}),e=e.replace(U,"</$1>"),e=e.replace(/<div[^>]*>/g,""),e=e.replace(/<\/div>/g,"<br />"),e=this.eventManager.emitReduce("wysiwygProcessHTMLText",e)}},{key:"_prepareGetHTML",value:function(){var e=this;this.getEditor().modifyDocument(function(){e._joinSplitedTextNodes(),e.eventManager.emit("wysiwygGetValueBefore",e)})}},{key:"postProcessForChange",value:function(){var e=this;this.isEditorValid()&&this.getEditor().modifyDocument(function(){e.eventManager.emit("wysiwygRangeChangeAfter",e)})}},{key:"readySilentChange",value:function(){V&&!this.getEditor().isIgnoreChange()&&(this._silentChange=!0)}},{key:"getEditor",value:function(){return this.editor}},{key:"replaceSelection",value:function(e,t){this.getEditor().replaceSelection(e,t)}},{key:"replaceRelativeOffset",value:function(e,t,n){this.getEditor().replaceRelativeOffset(e,t,n)}},{key:"addWidget",value:function(e,t,n,i){var o=this.getEditor().getSelectionPosition(e,n,i),a=this.$editorContainerEl.offset();this.$editorContainerEl.append(t),(0,l.default)(t).css({position:"absolute",top:o.top-a.top+this.scrollTop(),left:o.left-a.left})}},{key:"get$Body",value:function(){return this.getEditor().get$Body()}},{key:"hasFormatWithRx",value:function(e){return this.getEditor().getPath().match(e)}},{key:"breakToNewDefaultBlock",value:function(e,t){var n=this.editor.createDefaultBlock(),i=d.default.getChildNodeByOffset(e.startContainer,e.startOffset)||d.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),o=d.default.getParentUntil(i,this.get$Body()[0]);"before"===t?(0,l.default)(o).before(n):(0,l.default)(o).after(n),e.setStart(n,0),e.collapse(!0),this.setRange(e)}},{key:"replaceContentText",value:function(e,t,n){var i=(0,l.default)(e).html();(0,l.default)(e).html(i.replace(t,n))}},{key:"unwrapBlockTag",value:function(e){e||(e=function(e){return W.test(e)}),this.getEditor().changeBlockFormat(e),this.eventManager.emit("wysiwygRangeChangeAfter",this)}},{key:"scrollIntoCursor",value:function(){var e=this.scrollTop(),t=this.getEditor().getCursorPosition(),n=t.top,i=t.height,o=this.$editorContainerEl.get(0).getBoundingClientRect(),a=o.top,r=o.height,l=n-a,s=n+i-(a+r);l<0?this.scrollTop(e+l):s>0&&this.scrollTop(Math.ceil(e+s))}},{key:"moveCursorToEnd",value:function(){this.getEditor().moveCursorToEnd(),this.scrollIntoCursor(),this._correctRangeAfterMoveCursor("end")}},{key:"moveCursorToStart",value:function(){this.getEditor().moveCursorToStart(),this.scrollTop(0)}},{key:"scrollTop",value:function(e){return u.default.isUndefined(e)?this.$editorContainerEl.scrollTop():this.$editorContainerEl.scrollTop(e)}},{key:"_correctRangeAfterMoveCursor",value:function(e){var t=this.getRange(),n=this.get$Body().get(0);if("start"===e)for(;n.firstChild;)n=n.firstChild;else for(;n.lastChild;)n=n.lastChild;"BR"===n.tagName?t.setStartBefore(n):t.setStartAfter(n),t.collapse(!0),this.setRange(t)}},{key:"getRange",value:function(){return this.getEditor().getSelection().cloneRange()}},{key:"getIMERange",value:function(){var e=void 0,t=getSelection();return t&&t.rangeCount&&(e=t.getRangeAt(0).cloneRange()),e}},{key:"fixIMERange",value:function(){var e=this.getIMERange();e&&(0,l.default)(e.commonAncestorContainer).closest(this.$editorContainerEl).length&&this.setRange(e)}},{key:"setRange",value:function(e){this.getEditor().setSelection(e)}},{key:"isInTable",value:function(e){var t=e.collapsed?e.startContainer:e.commonAncestorContainer;return!!(0,l.default)(t).closest("[contenteditable=true] table").length}},{key:"getTextObject",value:function(e){return new I.default(this,e)}},{key:"defer",value:function(e,t){var n=this,i=t||0;setTimeout(function(){n.isEditorValid()&&e(n)},i)}},{key:"isEditorValid",value:function(){return this.getEditor()&&l.default.contains(this.$editorContainerEl[0].ownerDocument,this.$editorContainerEl[0])}},{key:"_isCursorNotInRestrictedAreaOfTabAction",value:function(e){return!e.hasFormat("li")&&!e.hasFormat("blockquote")&&!e.hasFormat("table")}}],[{key:"factory",value:function(t,n,i){var o=new e(t,n,i);return o.init(),o.componentManager.addManager(v.default),o.componentManager.addManager(m.default),o.componentManager.addManager(k.default),o.componentManager.addManager(_.default),o.componentManager.addManager(C.default),o.componentManager.addManager(M.default),o.componentManager.addManager(S.default),o.componentManager.addManager(L.default),o}}]),e}();t.default=K},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(4),d=i(c),f=n(58),h=i(f),g=n(59),v=i(g),p=function(){function e(t){o(this,e),this.wwe=t,this._pch=new h.default(this.wwe),this._tablePasteHelper=new v.default(this.wwe),this._selectedSellCount=0,this._$clipboardArea=null}return a(e,[{key:"init",value:function(){var e=this;this.wwe.eventManager.listen("willPaste",function(t){return e._onWillPaste(t.data)}),this.wwe.eventManager.listen("copy",this._onCopyCut.bind(this)),this.wwe.eventManager.listen("copyAfter",this._onCopyAfter.bind(this)),this.wwe.eventManager.listen("cut",this._onCopyCut.bind(this)),this.wwe.eventManager.listen("cutAfter",this._onCutAfter.bind(this)),this.wwe.eventManager.listen("paste",this._onPasteIntoTable.bind(this))}},{key:"_onCopyCut",value:function(e){var t=this.wwe.componentManager.getManager("tableSelection");if(t.getSelectedCells().length){if(!t.mergedTableSelectionManager)return t.createRangeBySelectedCells(),void t.removeClassAttrbuteFromAllCellsIfNeed();var n=this.wwe.getEditor(),i=e.data,o=n.getSelection().cloneRange(),a=(0,l.default)("<div />");this._extendRange(o),a.append(o.cloneContents()),this._updateCopyDataForListTypeIfNeed(o,a),this.wwe.eventManager.emit("copyBefore",{source:"wysiwyg",$clipboardContainer:a}),this._setClipboardData(i,a.html(),a.text())}}},{key:"_clearClipboardArea",value:function(){this._$clipboardArea&&(this._$clipboardArea.remove(),this._$clipboardArea=null)}},{key:"_onCopyAfter",value:function(){this.wwe.getEditor().get$Body().focus(),this._clearClipboardArea()}},{key:"_onCutAfter",value:function(){this.wwe.getEditor().getSelection().deleteContents(),this.wwe.getEditor().focus(),this._clearClipboardArea()}},{key:"_onPasteIntoTable",value:function(e){var t=e.data,n=this.wwe.getEditor().getSelection();this.wwe.isInTable(n)&&this._isSingleCellSelected(n)&&this._tablePasteHelper.pasteClipboard(t)}},{key:"_isSingleCellSelected",value:function(e){var t=e.startContainer,n=e.endContainer;return this._getCell(t)===this._getCell(n)}},{key:"_getCell",value:function(e){return"TD"===e.nodeName?e:d.default.getParentUntil(e,"TR")}},{key:"_onWillPaste",value:function(e){var t=this,n=(0,l.default)("<div>").append(e.fragment.cloneNode(!0));this._preparePaste(n),this._setTableBookmark(n),e.fragment=document.createDocumentFragment(),n.contents().each(function(t,n){e.fragment.appendChild(n)}),this._pasteToEmptyCodeBlock(e);var i=function e(){t.wwe.getEditor().removeEventListener("input",e),t.wwe.eventManager.emit("wysiwygRangeChangeAfter",t),t._focusTableBookmark()};this.wwe.getEditor().addEventListener("input",i)}},{key:"_pasteToEmptyCodeBlock",value:function(e){var t=this,n=this.wwe.getEditor(),i=n.getSelection().cloneRange(),o=i.startContainer,a=this.wwe.componentManager.getManager("codeblock"),r=!1;if(a.isInCodeBlock(i)&&i.collapse&&"PRE"===o.nodeName&&!o.textContent){var l=o.firstChild;o.insertBefore(e.fragment,l),e.defaultPrevented=!0,r=!0}var s=function e(){t.wwe.getEditor().removeEventListener("input",e),r&&(i.setStart(o,1),n.setSelection(i))};this.wwe.getEditor().addEventListener("input",s)}},{key:"_setClipboardData",value:function(e,t,n){u.default.browser.msie?(e.squirePrevented=!0,this._$clipboardArea=this._createClipboardArea(),this._$clipboardArea.html(t),this._$clipboardArea.focus(),window.getSelection().selectAllChildren(this._$clipboardArea[0])):(e.preventDefault(),e.stopPropagation(),e.clipboardData.setData("text/html",t),e.clipboardData.setData("text/plain",n))}},{key:"_createClipboardArea",value:function(){return(0,l.default)("<DIV>").attr({contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"}).appendTo(document.body)}},{key:"_updateCopyDataForListTypeIfNeed",value:function(e,t){var n=e.commonAncestorContainer.nodeName;if("UL"===n||"OL"===n){var i=(0,l.default)("<"+n+" />");i.append(t.html()),t.html(""),t.append(i)}}},{key:"_removeEmptyFontElement",value:function(e){e.children("font").each(function(e,t){var n=(0,l.default)(t);n.text().trim()||n.remove()})}},{key:"_preparePaste",value:function(e){this._removeEmptyFontElement(e),this._pch.preparePaste(e),this.wwe.eventManager.emit("pasteBefore",{source:"wysiwyg",$clipboardContainer:e})}},{key:"_setTableBookmark",value:function(e){var t=(0,l.default)(e[0].childNodes).last();t[0]&&"TABLE"===t[0].nodeName&&t.addClass("tui-paste-table-bookmark")}},{key:"_focusTableBookmark",value:function(){var e=this.wwe.getEditor(),t=e.getSelection().cloneRange(),n=e.get$Body().find(".tui-paste-table-bookmark"),i=e.get$Body().find(".tui-paste-table-cell-bookmark");n.length&&(n.removeClass("tui-paste-table-bookmark"),t.setEndAfter(n[0]),t.collapse(!1),e.setSelection(t)),i.length&&(i.removeClass("tui-paste-table-cell-bookmark"),t.selectNodeContents(i[0]),t.collapse(!1),e.setSelection(t))}},{key:"_extendRange",value:function(e){(!d.default.isTextNode(e.commonAncestorContainer)||0===e.startOffset&&e.commonAncestorContainer.textContent.length===e.endOffset||"TD"===e.commonAncestorContainer.nodeName)&&(0===e.startOffset&&(e=this._extendStartRange(e)),e.endOffset===d.default.getOffsetLength(e.endContainer)&&(e=this._extendEndRange(e)),this._isWholeCommonAncestorContainerSelected(e)&&e.selectNode(e.commonAncestorContainer),this.wwe.getEditor().setSelection(e))}},{key:"_extendStartRange",value:function(e){for(var t=e.startContainer;t.parentNode!==e.commonAncestorContainer&&t.parentNode!==this.wwe.get$Body()[0]&&!t.previousSibling;)t=t.parentNode;return e.setStart(t.parentNode,d.default.getNodeOffsetOfParent(t)),e}},{key:"_extendEndRange",value:function(e){for(var t=e.endContainer,n=t.nextSibling;t.parentNode!==e.commonAncestorContainer&&t.parentNode!==this.wwe.get$Body()[0]&&(!n||"BR"===d.default.getNodeName(n)&&t.parentNode.lastChild===n);)t=t.parentNode,n=t.nextSibling;return e.setEnd(t.parentNode,d.default.getNodeOffsetOfParent(t)+1),e}},{key:"_isWholeCommonAncestorContainerSelected",value:function(e){return e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE&&e.commonAncestorContainer!==this.wwe.get$Body()[0]&&0===e.startOffset&&e.endOffset===e.commonAncestorContainer.childNodes.length&&e.commonAncestorContainer===e.startContainer&&e.commonAncestorContainer===e.endContainer}}]),e}();t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c=n(4),d=i(c),f=n(9),h=i(f),g=function(){function e(t){o(this,e),this.wwe=t}return a(e,[{key:"preparePaste",value:function(e){var t=this.wwe.getEditor().getSelection().cloneRange(),n=this.wwe.componentManager.getManager("codeblock"),i=!1,o=(0,l.default)("<div />"),a=void 0,r=void 0,s=void 0;this._pasteFirstAid(e);for(var c=u.default.toArray(e[0].childNodes);c.length;)r=c[0],a=d.default.getNodeName(r),s="LI"===a||"UL"===a||"OL"===a,n.isInCodeBlock(t)?o.append(n.prepareToPasteOnCodeblock(c)):s?(o.append(this._prepareToPasteList(c,t,i)),i=!0):o.append(c.shift());e.html(o.html())}},{key:"_wrapOrphanNodeWithDiv",value:function(e){var t=(0,l.default)("<div />"),n=u.default.toArray(e[0].childNodes),i=void 0;return u.default.forEachArray(n,function(e){var n=3===e.nodeType,o=/^(SPAN|A|CODE|EM|I|STRONG|B|S|U|ABBR|ACRONYM|CITE|DFN|KBD|SAMP|VAR|BDO|Q|SUB|SUP)$/gi.test(e.tagName);n||o?(i||(i=document.createElement("div"),t.append(i)),i.appendChild(e)):(i&&"BR"!==i.lastChild.tagName&&i.appendChild((0,l.default)("<br/>")[0]),i=null,t.append(e))}),t.html()}},{key:"_pasteFirstAid",value:function(e){var t=this,n="div, section, article, aside, nav, menus, p";e.html((0,h.default)(e.html(),!0)),e.find("*").each(function(e,n){t._removeStyles(n)}),this._unwrapIfNonBlockElementHasBr(e),this._unwrapNestedBlocks(e,n),this._removeUnnecessaryBlocks(e,n),e.html(this._wrapOrphanNodeWithDiv(e)),this._preElementAid(e),this._tableElementAid(e),e.children("br").remove()}},{key:"_preElementAid",value:function(e){this.wwe.componentManager.getManager("codeblock").modifyCodeBlockForWysiwyg(e)}},{key:"_unwrapIfNonBlockElementHasBr",value:function(e){e.find("span, a, b, em, i, s").each(function(e,t){var n=(0,l.default)(t).children("br");n.length&&"LI"!==t.nodeName&&"UL"!==t.nodeName&&n.eq(0).unwrap()})}},{key:"_unwrapNestedBlocks",value:function(e,t){e.find(":not(:has(*))").not("b,s,i,em,code,span").each(function(n,i){for(var o="BR"===i.nodeName?(0,l.default)(i.parentNode):(0,l.default)(i);o.parents(t).length;){var a=o.parent(t);a.length&&a[0]!==e[0]?o.unwrap():o=o.parent()}})}},{key:"_removeUnnecessaryBlocks",value:function(e,t){e.find(t).each(function(e,n){var i=(0,l.default)(n),o=n.tagName,a="DIV"===o,r=0!==i.parent("li").length,s=0!==i.parent("blockquote").length,u=i.children(t).length;a&&(r||s||!u)||i.replaceWith(i.html())})}},{key:"_removeStyles",value:function(e){var t=(0,l.default)(e),n=void 0;"SPAN"!==d.default.getNodeName(t[0])?t.removeAttr("style"):(t.attr("style")&&(n=t.css("color")),t.removeAttr("style"),n?t.css("color",n):t.contents().unwrap())}},{key:"_prepareToPasteList",value:function(e,t,n){var i=d.default.getNodeName(e[0]),o=e.shift(),a=this.wwe.getEditor().getDocument().createDocumentFragment();if("LI"!==i&&e.length&&"LI"===e[0].tagName&&(i="LI",o=this._makeNodeAndAppend({tagName:i},o)),"OL"===i||"UL"===i)!n&&this.wwe.getEditor().hasFormat("LI")?(0,l.default)(a).append(this._wrapCurrentFormat(o)):(0,l.default)(a).append(o);else if("LI"===i){var r=this.wwe.getEditor().getDocument().createDocumentFragment();for(r.appendChild(o);e.length&&"LI"===e[0].tagName;)r.appendChild(e.shift());!n&&this.wwe.getEditor().hasFormat("LI")?(0,l.default)(a).append(this._wrapCurrentFormat(r)):!t||"UL"!==t.commonAncestorName&&"OL"!==t.commonAncestorName?(0,l.default)(a).append(this._makeNodeAndAppend({tagName:"UL"},r)):(0,l.default)(a).append(this._makeNodeAndAppend({tagName:t.commonAncestorName},r))}return a}},{key:"_unwrapFragmentFirstChildForPasteAsInline",value:function(e){return(0,l.default)(e).find("br").remove(),e.childNodes}},{key:"_wrapCurrentFormat",value:function(e){var t=this,n=void 0;return this._eachCurrentPath(function(i){"DIV"!==i.tagName&&(n=d.default.isElemNode(e)?e.tagName:e.firstChild.tagName,i.tagName!==n&&(e=t._makeNodeAndAppend(i,e)))}),e}},{key:"_eachCurrentPath",value:function(e){for(var t=d.default.getPath(this.wwe.getEditor().getSelection().startContainer,this.wwe.get$Body()[0]),n=t.length-1;n>-1;n-=1)e(t[n])}},{key:"_makeNodeAndAppend",value:function(e,t){var n=(0,l.default)("<"+e.tagName+"/>");return n.append(t),e.id&&n.attr("id",e.id),e.className&&n.addClass(e.className),n[0]}},{key:"_tableElementAid",value:function(e){this._removeColgroup(e),this._completeTableIfNeed(e),this._updateTableIDClassName(e)}},{key:"_removeColgroup",value:function(e){e.find("colgroup").remove()}},{key:"_completeTableIfNeed",value:function(e){var t=this.wwe.componentManager.getManager("table"),n=t.wrapDanglingTableCellsIntoTrIfNeed(e);n&&e.append(n);var i=t.wrapTrsIntoTbodyIfNeed(e);i&&e.append(i);var o=t.wrapTheadAndTbodyIntoTableIfNeed(e);o&&e.append(o)}},{key:"_updateTableIDClassName",value:function(e){var t=this.wwe.componentManager.getManager("table");e.find("table").each(function(e,t){(0,l.default)(t).removeClass(function(e,t){return t.replace(/.*\s*(te-content-table-\d+)\s*.*/,"$1")})}),e.find("table").each(function(e,n){(0,l.default)(n).addClass(t.getTableIDClassName())})}}]),e}();t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(1),l=i(r),s=n(4),u=i(s),c=n(9),d=i(c),f=function(){function e(t){o(this,e),this.wwe=t}return a(e,[{key:"pasteClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items;n?(this._pasteClipboardItem(n),e.preventDefault()):(this._pasteClipboardUsingPasteArea(),e.squirePrevented=!0)}},{key:"_pasteClipboardUsingPasteArea",value:function(){var e=this,t=this.wwe.getEditor(),n=t.getSelection(),i=n.startContainer,o=n.startOffset,a=n.endContainer,r=n.endOffset,l=document.createElement("div"),s=document,u=s.body;l.setAttribute("contenteditable",!0),l.setAttribute("style","position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"),u.appendChild(l),n.selectNodeContents(l),t.setSelection(n),setTimeout(function(){var s=u.removeChild(l);n.setStart(i,o),n.setEnd(a,r),t.focus(),t.setSelection(n),e._pasteClipboardHtml(s.innerHTML)})}},{key:"_pasteClipboardItem",value:function(e){var t=this,n=null,i=null;l.default.forEachArray(e,function(e){"text/html"===e.type?i=e:"text/plain"===e.type&&(n=e)}),i?i.getAsString(function(e){t._pasteClipboardHtml(e)}):n&&n.getAsString(function(e){t._pasteClipboardContainer(document.createTextNode(e))})}},{key:"_pasteClipboardHtml",value:function(e){var t=document.createDocumentFragment(),n=e.indexOf("\x3c!--StartFragment--\x3e"),i=e.lastIndexOf("\x3c!--EndFragment--\x3e");n>-1&&i>-1&&(e=e.slice(n+"\x3c!--StartFragment--\x3e".length,i)),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e="<TR>"+e+"</TR>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e="<TABLE>"+e+"</TABLE>"),t.appendChild((0,d.default)(e)),this._pasteClipboardContainer(t)}},{key:"_pasteClipboardContainer",value:function(e){var t=this.wwe.getEditor(),n=e.childNodes;if(1===n.length&&"TABLE"===n[0].nodeName)this.wwe.componentManager.getManager("table").pasteTableData(e);else{var i=t.getSelection().cloneRange(),o=this._preparePasteDocumentFragment(e);t.saveUndoState(i),i.collapsed||this._deleteContentsRange(i),u.default.isTextNode(i.startContainer)?this._pasteIntoTextNode(i,o):this._pasteIntoElements(i,o),t.setSelection(i)}}},{key:"_preparePasteDocumentFragment",value:function(e){var t=e.childNodes,n=document.createDocumentFragment();return t.length?n.appendChild(this._unwrapBlock(e)):this._isPossibleInsertToTable(e)&&n.appendChild(e),n}},{key:"_unwrapBlock",value:function(e){for(var t=document.createDocumentFragment(),n=l.default.toArray(e.childNodes);n.length;){var i=n.shift();if(this._isPossibleInsertToTable(i))t.appendChild(i);else{t.appendChild(this._unwrapBlock(i));var o=t.lastChild;n.length&&o&&"BR"!==o.nodeName&&t.appendChild(document.createElement("br"))}}return t}},{key:"_isPossibleInsertToTable",value:function(e){return!("CODE"===e.nodeName&&e.childNodes.length>1)&&(u.default.isMDSupportInlineNode(e)||u.default.isTextNode(e))}},{key:"_pasteIntoElements",value:function(e,t){var n=e.startContainer,i=e.startOffset,o=u.default.getChildNodeByOffset(n,i);if(o)n.insertBefore(t,o),e.setStart(o,0);else if("TD"===n.nodeName)n.appendChild(t),e.setStart(n,n.childNodes.length);else{var a=n.parentNode,r=n.nextSibling;a.insertBefore(t,r),r?e.setStart(r,0):e.setStartAfter(a.lastChild)}e.collapse(!0)}},{key:"_pasteIntoTextNode",value:function(e,t){var n=e.startContainer,i=e.startOffset,o=n.parentNode,a=n.textContent,r=a.slice(0,i),s=a.slice(i,a.length),c=t.childNodes,d=c[0],f=1===c.length&&u.default.isTextNode(d);if(r)if(s)if(f){var h=d.textContent;n.textContent=""+r+h+s,e.setStart(n,r.length+h.length)}else{var g=document.createDocumentFragment();g.appendChild(document.createTextNode(r)),g.appendChild(t),g.appendChild(document.createTextNode(s)),o.replaceChild(g,n);var v=l.default.toArray(o.childNodes),p=0;v.forEach(function(e,t){e.textContent===s&&(p=t)}),e.setStart(o.childNodes[p],0)}else{var m=n.nextSibling;o.insertBefore(t,m),e.setStartAfter(m)}else o.insertBefore(t,n),e.setStart(n,0);e.collapse(!0)}},{key:"_deleteContentsRange",value:function(e){var t=e.startContainer,n=e.startOffset,i=e.endContainer,o=e.endOffset;t===i?(this._deleteContentsByOffset(t,n,o),e.setStart(t,n),e.collapse(!0)):this._deleteNotCollapsedRangeContents(e)}},{key:"_deleteNotCollapsedRangeContents",value:function(e){var t=e.startContainer,n=e.startOffset,i=e.endContainer,o=e.endOffset,a=e.commonAncestorContainer,r=this._getBlock(t,a,n),l=this._getBlock(i,a,o-1);if(r===l)this._removeInSameBlock(r,t,i,n,o),l=i!==l?null:l;else{var s=r.nextSibling;"TD"===t.nodeName?s=this._removeOneLine(r):(this._deleteContentsByOffset(t,n,u.default.getOffsetLength(t)),u.default.removeNodesByDirection(r,t,!1)),"TD"===i.nodeName?l=this._removeOneLine(l):(this._deleteContentsByOffset(i,0,o),u.default.removeNodesByDirection(l,i,!0)),u.default.removeChildFromStartToEndNode(a,s,l)}l?e.setStart(l,0):e.setStartAfter(r),e.collapse(!0)}},{key:"_removeInSameBlock",value:function(e,t,n,i,o){var a=t===e?i:0,r=n===e?o:u.default.getOffsetLength(e);this._deleteContentsByOffset(e,a,r)}},{key:"_removeOneLine",value:function(e){var t=e.nextSibling,n=e.parentNode,i=t;return n.removeChild(e),t&&"BR"===t.nodeName&&(i=t.nextSibling,n.removeChild(t)),i}},{key:"_getBlock",value:function(e,t,n){return u.default.getParentUntil(e,t)||u.default.getChildNodeByOffset(e,n)}},{key:"_deleteContentsByOffset",value:function(e,t,n){if(u.default.isTextNode(e)){var i=e.textContent,o=i.slice(0,t),a=i.slice(n,i.length);e.textContent=""+o+a}else{var r=u.default.getChildNodeByOffset(e,t),l=u.default.getChildNodeByOffset(e,n);r&&u.default.removeChildFromStartToEndNode(e,r,l||null)}}}]),e}();t.default=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(4),u=i(s),c=/<li/i,d=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="list",this._init()}return a(e,[{key:"_init",value:function(){this._initEvent(),this._initKeyHandler()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._convertToArbitraryNestingList(t)}),this.eventManager.listen("wysiwygRangeChangeAfter",function(){e._findAndRemoveEmptyList(),e._removeBranchListAll()}),this.eventManager.listen("wysiwygSetValueAfter",function(){e._removeBranchListAll()}),this.eventManager.listen("wysiwygProcessHTMLText",function(t){return t=e._insertBlankToBetweenSameList(t),t=e._convertFromArbitraryNestingList(t)}),this.eventManager.listen("convertorAfterHtmlToMarkdownConverted",function(e){return e.replace(/:BLANK_LINE:\n/g,"")})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler(["TAB","CTRL+]","META+]"],function(t){var n=void 0;return e.wwe.getEditor().hasFormat("LI")&&(t.preventDefault(),e.eventManager.emit("command","Indent"),n=!1),n}),this.wwe.addKeyEventHandler(["SHIFT+TAB","CTRL+[","META+["],function(t,n){var i=void 0;if(e.wwe.getEditor().hasFormat("LI")){t.preventDefault();var o=(0,l.default)(n.startContainer).closest("li").children("OL,UL");e.eventManager.emit("command","Outdent"),o.length&&!o.prev().length&&e._removeBranchList(o),i=!1}return i}),this.wwe.addKeyEventHandler("ENTER",function(t,n){n.collapsed&&e.wwe.getEditor().hasFormat("LI")&&e.wwe.defer(function(){var t=e.wwe.getRange(),n=(0,l.default)(t.startContainer).parents("li").eq(0);e._removeBranchListAll(n)})}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){n.collapsed&&e.wwe.getEditor().hasFormat("LI")&&e.wwe.defer(function(){e._removeBranchListAll()})})}},{key:"_findAndRemoveEmptyList",value:function(){this.wwe.get$Body().find("OL,UL").each(function(e,t){c.test(t.innerHTML)||(0,l.default)(t).remove()})}},{key:"_removeBranchListAll",value:function(e){var t=this;e=e?(0,l.default)(e):this.wwe.get$Body(),e.find("li ul, li ol").each(function(e,n){n&&!n.previousSibling&&t._removeBranchList(n)})}},{key:"_removeBranchList",value:function(e){for(var t=(0,l.default)(e),n=t;!n[0].previousSibling&&n[0].parentElement.tagName.match(/UL|OL|LI/g);)n=n.parent();var i=n.children("li").eq(0);n.prepend(t.children().unwrap()),i.remove()}},{key:"_insertBlankToBetweenSameList",value:function(e){return e.replace(/<\/(ul|ol)>(<br \/>|<br>){0,}<\1>/g,"</$1>:BLANK_LINE:<$1>")}},{key:"_convertToArbitraryNestingList",value:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.querySelector("li > ul, li > ol");null!==n;){var i=n.parentNode;i.parentNode.insertBefore(n,i.nextElementSibling),n=t.querySelector("li > ul, li > ol")}return t.innerHTML}},{key:"_convertFromArbitraryNestingList",value:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.querySelector("ol > ol, ol > ul, ul > ol, ul > ul");null!==n;){for(var i=n.previousElementSibling;i&&"LI"!==i.tagName;)i=i.previousElementSibling;i?i.appendChild(n):this._unwrap(n),n=t.querySelector("ol > ol, ol > ul, ul > ol, ul > ul")}return t.innerHTML}},{key:"_unwrap",value:function(e){for(var t=document.createDocumentFragment();e.firstChild;)t.appendChild(e.firstChild);e.parentNode.replaceChild(t,e)}},{key:"getLinesOfSelection",value:function(e,t){var n=[],i=!1,o=!0,a=void 0;u.default.isTextNode(e)&&(e=(0,l.default)(e).parents("DIV,LI").first().get(0)),u.default.isTextNode(t)&&(t=(0,l.default)(t).parents("DIV,LI").first().get(0));for(var r=e;o&&(0,l.default)(r).is("DIV,LI");r=a)n.push(r),r===t?i=!0:a=this._getNextLine(r,t),o=a&&!i;return n}},{key:"_getNextLine",value:function(e,t){var n=e.nextElementSibling;return n?(0,l.default)(n).is("OL,UL")&&(n=n.querySelector("li")):n=e.parentNode.nextElementSibling,(0,l.default)(n).is("DIV,LI")||n===t?n:this._getNextLine(n)}},{key:"mergeList",value:function(e){var t=e.parentNode,n=t.previousElementSibling,i=t.nextElementSibling;t.firstElementChild===e&&n&&(0,l.default)(n).is("OL,UL")&&(this._mergeList(t,n),t=n),t.lastElementChild===e&&i&&(0,l.default)(i).is("OL,UL")&&this._mergeList(i,t)}},{key:"_mergeList",value:function(e,t){var n=e.firstElementChild;if(t&&(0,l.default)(t).is("OL,UL")){for(;n;){var i=n.nextElementSibling;t.appendChild(n),n=i}e.parentNode.removeChild(e)}}}]),e}();t.default=d},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="task",this._init()}return o(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent(),this.wwe.getEditor().addEventListener("mousedown",function(e){var t=e.offsetX<18&&e.offsetY<18;e.target.hasAttribute("data-te-task")&&t&&(0,r.default)(e.target).toggleClass("checked")})}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._removeTaskListClass()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler("ENTER",function(t,n){e.isInTaskList(n)&&e.wwe.defer(function(){var t=e.wwe.getRange();(0,r.default)(t.startContainer).closest("li").removeClass("checked")})})}},{key:"isInTaskList",value:function(e){var t=void 0;return e||(e=this.wwe.getEditor().getSelection().cloneRange()),t=e.startContainer.nodeType===Node.ELEMENT_NODE&&"LI"===e.startContainer.tagName?e.startContainer:(0,r.default)(e.startContainer).parents("li").get(0),(0,r.default)(t).hasClass("task-list-item")}},{key:"unformatTask",value:function(e){var t=(0,r.default)(e).closest("li");t.removeClass("task-list-item"),t.removeClass("checked"),t.removeAttr("data-te-task"),t.attr("class")||t.removeAttr("class")}},{key:"formatTask",value:function(e){var t=(0,r.default)(e),n=t.closest("li");n.addClass("task-list-item"),n.attr("data-te-task","")}},{key:"_formatTaskIfNeed",value:function(){var e=this.wwe.getEditor().getSelection().cloneRange();this.isInTaskList(e)&&this.formatTask(e.startContainer)}},{key:"_removeTaskListClass",value:function(){this.wwe.get$Body().find(".task-list").each(function(e,t){(0,r.default)(t).removeClass("task-list")})}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(){return this.nodeType===Node.TEXT_NODE}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(0),s=i(l),u=n(4),c=i(u),d=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="hr",this._init()}return r(e,[{key:"_init",value:function(){this._initKeyHandler(),this._initEvent()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._unwrapDivOnHr()}),this.eventManager.listen("wysiwygGetValueBefore",function(){e._wrapDefaultBlockToOrphanTexts()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler(function(t,n){return e._onTypedInHr(n)}),this.wwe.addKeyEventHandler("ENTER",function(t,n){return!n.collapsed||e._removeHrOnEnter(n,t)}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){return!n.collapsed||e._removeHrOnBackspace(n,t)})}},{key:"_isInHr",value:function(e){return"HR"===c.default.getNodeName(e.startContainer.childNodes[e.startOffset])}},{key:"_isNearHr",value:function(e){var t=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1);return"HR"===c.default.getNodeName(t)}},{key:"_onTypedInHr",value:function(e){var t=this;(this._isInHr(e)||this._isNearHr(e))&&this.wwe.defer(function(e){e.saveSelection(),t._wrapDefaultBlockToOrphanTexts(),e.restoreSavedSelection()})}},{key:"_removeHrOnEnter",value:function(e,t){var n=void 0,i=void 0;return this._isInHr(e)?n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset):this._isNearHr(e)&&(n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),i="before"),this._changeHrToNewDefaultBlock(n,e,t,i)}},{key:"_removeHrOnBackspace",value:function(e,t){var n=void 0,i=void 0;return this._isInHr(e)?n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset):0===e.startOffset?(n=c.default.getTopPrevNodeUnder(e.startContainer,this.wwe.get$Body()[0]),i="none"):this._isNearHr(e)&&(n=c.default.getChildNodeByOffset(e.startContainer,e.startOffset-1),i="before"),this._changeHrToNewDefaultBlock(n,e,t,i)}},{key:"_changeHrToNewDefaultBlock",value:function(e,t,n,i){return!e||"HR"!==c.default.getNodeName(e)||(n.preventDefault(),"none"!==i&&this.wwe.breakToNewDefaultBlock(t,i),(0,s.default)(e).remove(),!1)}},{key:"_unwrapDivOnHr",value:function(){var e=this.wwe.get$Body().get(0);this.wwe.get$Body().find("hr").each(function(t,n){var i=(0,s.default)(n).parent("div");i[0]!==e&&(i.find("br").remove(),(0,s.default)(n).unwrap())})}},{key:"_wrapDefaultBlockToOrphanTexts",value:function(){this.wwe.get$Body().contents().filter(a).each(function(e,t){(0,s.default)(t).wrap("<div />")})}}]),e}();t.default=d},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(t){i(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="p",this._initEvent()}return o(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return e._splitPtagContentLines(t)}),this.eventManager.listen("wysiwygSetValueAfter",function(){e._ensurePtagContentWrappedWithDiv(),e._unwrapPtags()})}},{key:"_splitPtagContentLines",value:function(e){if(e){var t=(0,r.default)("<div />");t.html(e),t.find("p").each(function(e,t){var n=t.innerHTML,i=n.split(/<br>/gi),o=i.length-1,a=t.nextElementSibling||t.nextSibling,l="";l=i.map(function(e,t){var n="";return t>0&&t<o&&(e=e||"<br>"),e&&(n="<div>"+e+"</div>"),n}),a&&"P"===a.nodeName&&l.push("<div><br></div>"),(0,r.default)(t).replaceWith((0,r.default)(l.join("")))}),e=t.html()}return e}},{key:"_ensurePtagContentWrappedWithDiv",value:function(){this.wwe.get$Body().find("p").each(function(e,t){(0,r.default)(t).find("div").length<=0&&(0,r.default)(t).wrapInner("<div />"),(0,r.default)(t).next().is("p")&&(0,r.default)(t).append("<div><br></div>")})}},{key:"_unwrapPtags",value:function(){this.wwe.get$Body().find("div").each(function(e,t){(0,r.default)(t).parent().is("p")&&(0,r.default)(t).unwrap()})}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(4),u=i(s),c=/h[\d]/i,d=function(){function e(t){o(this,e),this.wwe=t,this.eventManager=t.eventManager,this.name="heading",this._init()}return a(e,[{key:"_init",value:function(){this._initEvent(),this._initKeyHandler()}},{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("wysiwygSetValueAfter",function(){e._wrapDefaultBlockToHeadingInner()})}},{key:"_initKeyHandler",value:function(){var e=this;this.wwe.addKeyEventHandler("ENTER",function(t,n){return!e.wwe.hasFormatWithRx(c)||(e._onEnter(t,n),!1)}),this.wwe.addKeyEventHandler("BACK_SPACE",function(t,n){return!e.wwe.hasFormatWithRx(c)||(e._removePrevTopNodeIfNeed(t,n),!1)})}},{key:"_wrapDefaultBlockToHeadingInner",value:function(){this.wwe.get$Body().find("h1, h2, h3, h4, h5, h6").each(function(e,t){(0,l.default)(t).children("div, p").length<=0&&(0,l.default)(t).wrapInner("<div />")})}},{key:"_unwrapHeading",value:function(){this.wwe.unwrapBlockTag(function(e){return c.test(e)})}},{key:"_onEnter",value:function(e,t){var n=this;t.startOffset>0?this.wwe.defer(function(e){n._unwrapHeading(),e.getEditor().removeLastUndoStack()}):(e.preventDefault(),this._insertEmptyBlockToPrevious(t))}},{key:"_insertEmptyBlockToPrevious",value:function(e){this.wwe.getEditor().saveUndoState(e),(0,l.default)("<div><br></div>").insertBefore(u.default.getParentUntil(e.startContainer,this.wwe.get$Body()[0]))}},{key:"_removePrevTopNodeIfNeed",value:function(e,t){var n=!1;if(t.collapsed&&0===t.startOffset){var i=t.startContainer,o=u.default.getTopPrevNodeUnder(i,this.wwe.get$Body()[0]),a=o&&0===o.textContent.length,r=this.wwe.getEditor();0===i.textContent.length?n=this._removeHedingAndChangeSelection(e,t,o):a&&(e.preventDefault(),r.saveUndoState(t),(0,l.default)(o).remove(),n=!0)}return n}},{key:"_removeHedingAndChangeSelection",value:function(e,t,n){var i=t.startContainer,o=this.wwe.getEditor(),a=this.wwe.get$Body(),r=c.test(u.default.getNodeName(i)),s=r?i:(0,l.default)(i).parents("h1,h2,h3,h4,h5,h6")[0],d=n,f=1;return e.defaultPrevented||(e.preventDefault(),o.saveUndoState(t)),(0,l.default)(s).remove(),n||(d=a.children("div").first().get(0),f=0),t.setStart(d,f),t.collapse(!0),o.setSelection(t),!0}}]),e}();t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(0),u=i(s),c=n(1),d=i(c),f=n(66),h=i(f),g=n(4),v=i(g),p=n(14),m=/\b(H[\d]|LI|P|BLOCKQUOTE|TD)\b/,y=/Trident\/[456]\./.test(navigator.userAgent),_=function(e){function t(){var e;o(this,t);for(var n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];var l=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i)));return l._decorateHandlerToCancelable("copy"),l._decorateHandlerToCancelable(y?"beforecut":"cut"),l._decorateHandlerToCancelable(y?"beforepaste":"paste"),l.get$Body=function(){return l.$body=l.$body||(0,u.default)(l.getRoot()),l.$body},l}return r(t,e),l(t,[{key:"_decorateHandlerToCancelable",value:function(e){var t=this._events[e];if(t.length>1)throw new Error("too many"+e+"handlers in squire");var n=t[0].bind(this);t[0]=function(e){e.defaultPrevented||e.squirePrevented||n(e)}}},{key:"changeBlockFormat",value:function(e,t){var n=this;this.modifyBlocks(function(i){var o=void 0,a=void 0,r=void 0,l=void 0,s=void 0,u=void 0,c=void 0;if(i.childNodes.length?o=i.childNodes.item(0):(o=n.createDefaultBlock(),i.appendChild(o)),e){for(;o.firstChild;)o=o.firstChild;for(c=function(e){l.appendChild(e)};o!==i;){if(s=o.tagName,d.default.isFunction(e)?e(s):s===e){l=o.childNodes.item(0),(!v.default.isElemNode(l)||o.childNodes.length>1)&&(l=n.createDefaultBlock(),d.default.forEachArray(d.default.toArray(o.childNodes),c),(u=l.lastChild)&&"BR"===v.default.getNodeName(u)&&l.removeChild(u)),r=t?n.createElement(t,[l]):l,a=n.getDocument().createDocumentFragment(),a.appendChild(r),i=a;break}o=o.parentNode}}return a&&e||!t||"DIV"!==v.default.getNodeName(i.childNodes[0])||(i=n.createElement(t,[i.childNodes[0]])),i})}},{key:"changeBlockFormatTo",value:function(e){this.changeBlockFormat(function(e){return m.test(e)},e)}},{key:"getCaretPosition",value:function(){return this.getCursorPosition()}},{key:"replaceSelection",value:function(e,t){t&&this.setSelection(t),this._ignoreChange=!0,this.insertHTML(e)}},{key:"replaceRelativeOffset",value:function(e,t,n){var i=this.getSelection().cloneRange();this._replaceRelativeOffsetOfSelection(e,t,n,i)}},{key:"_replaceRelativeOffsetOfSelection",value:function(e,t,n,i){var o=void 0,a=void 0,r=void 0,l=i.endContainer,s=i.endOffset;"TEXT"!==v.default.getNodeName(l)&&(l=this._getClosestTextNode(l,s))&&(s=v.default.isTextNode(l)?l.nodeValue.length:l.textContent.length),l?(o=this.getSelectionInfoByOffset(l,s+t),i.setStart(o.element,o.offset),r=s+(t+n),a=this.getSelectionInfoByOffset(l,r),i.setEnd(a.element,a.offset),this.replaceSelection(e,i)):this.replaceSelection(e)}},{key:"_getClosestTextNode",value:function(e,t){var n=v.default.getChildNodeByOffset(e,t-1);return"TEXT"!==v.default.getNodeName(n)&&(n=n.previousSibling),n}},{key:"getSelectionInfoByOffset",value:function(e,t){var n=void 0,i=void 0,o=void 0,a=void 0,r=t>=0?"next":"previous",l=Math.abs(t),s=n;for(n="next"===r?e:e.previousSibling,o=l,a=0;n&&(i=v.default.isTextNode(n)?n.nodeValue.length:n.textContent.length,a+=i,!(l<=a));)o-=i,v.default.getTextLength(n)>0&&(s=n),n=n[r+"Sibling"];return n||(n=s,o=v.default.getTextLength(n)),"previous"===r&&(o=v.default.getTextLength(n)-o),{element:n,offset:o}}},{key:"getSelectionPosition",value:function(e,t,n){var i=this.createElement("INPUT"),o=e.cloneRange(),a=this.getSelectionInfoByOffset(e.endContainer,e.endOffset+(n||0));o.setStart(o.startContainer,o.startOffset),o.setEnd(a.element,a.offset),this._ignoreChange=!0,this.insertElement(i,o);var r=(0,u.default)(i).offset();return"over"!==t&&(r.top+=(0,u.default)(i).outerHeight()),i.parentNode.removeChild(i),e.setStart(e.endContainer,e.endOffset),e.collapse(!0),this.setSelection(e),r}},{key:"removeLastUndoStack",value:function(){this._undoStack.length&&(this._undoStackLength-=1,this._undoIndex-=1,this._undoStack.pop(),this._isInUndoState=!1)}},{key:"replaceParent",value:function(e,t,n){var i=(0,u.default)(e).closest(t);i.length&&(i.wrapInner("<"+n+"/>"),i.children().unwrap())}},{key:"preserveLastLine",value:function(){var e=this.get$Body().children().last();"DIV"!==v.default.getNodeName(e[0])&&(this._ignoreChange=!0,(0,u.default)(this.createDefaultBlock()).insertAfter(e))}},{key:"scrollTop",value:function(e){return d.default.isUndefined(e)?this.get$Body().scrollTop():this.get$Body().scrollTop(e)}},{key:"isIgnoreChange",value:function(){return this._ignoreChange}},{key:"focus",value:function(){h.default.prototype.focus.call(this)}},{key:"blockCommandShortcuts",value:function(){var e=this,t=p.isMac?"meta":"ctrl";["b","i","u","shift-7","shift-5","shift-6","shift-8","shift-9","[","]","d"].forEach(function(n){e.setKeyHandler(t+"-"+n,function(e,t){t.preventDefault()})})}}]),t}(h.default);t.default=_},function(e,t){e.exports=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(1),l=i(r),s=n(4),u=i(s),c=l.default.browser.msie&&11===l.default.browser.version,d=-1!==navigator.appVersion.indexOf("Win")&&l.default.browser.chrome,f=c||d,h=function(){function e(t,n){o(this,e),this._wwe=t,f&&(this.isComposition=!1,this._initCompositionEvent()),this.setRange(n||this._wwe.getRange())}return a(e,[{key:"_initCompositionEvent",value:function(){var e=this;this._wwe.getEditor().addEventListener("compositionstart",function(){e.isComposition=!0}),this._wwe.getEditor().addEventListener("compositionend",function(){e.isComposition=!1})}},{key:"setRange",value:function(e){this._range&&this._range.detach(),this._range=e}},{key:"expandStartOffset",value:function(){var e=this._range;u.default.isTextNode(e.startContainer)&&e.startOffset>0&&e.setStart(e.startContainer,e.startOffset-1)}},{key:"expandEndOffset",value:function(){var e=this._range;u.default.isTextNode(e.endContainer)&&e.endOffset<e.endContainer.nodeValue.length&&e.setEnd(e.endContainer,e.endOffset+1)}},{key:"setEndBeforeRange",value:function(e){var t=e.startOffset;this.isComposition&&(t+=1),this._range.setEnd(e.startContainer,t)}},{key:"getTextContent",value:function(){return this._range.cloneContents().textContent}},{key:"replaceContent",value:function(e){this._wwe.getEditor().setSelection(this._range),this._wwe.getEditor().insertHTML(e),this._range=this._wwe.getRange()}},{key:"deleteContent",value:function(){this._wwe.getEditor().setSelection(this._range),this._wwe.getEditor().insertHTML(""),this._range=this._wwe.getRange()}},{key:"peekStartBeforeOffset",value:function(e){var t=this._range.cloneRange();return t.setStart(t.startContainer,Math.max(t.startOffset-e,0)),t.setEnd(this._range.startContainer,this._range.startOffset),t.cloneContents().textContent}}]),e}();t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(69),f=i(d),h=function(e){function t(e){var n=e.eventManager,i=e.container,r=e.wysiwygEditor;o(this,t);var l=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{eventManager:n,container:i,attachedSelector:"pre"}));return l._wysiwygEditor=r,l._popupCodeBlockLanguages=null,l._initDOM(),l._initDOMEvent(),l}return r(t,e),l(t,[{key:"_initDOM",value:function(){var e=this;this.$el.addClass("code-block-header"),this._$languageLabel=(0,c.default)("<span>text</span>"),this.$el.append(this._$languageLabel),this._$buttonOpenModalEditor=(0,c.default)('<button type="button">Editor</button>'),this.$el.append(this._$buttonOpenModalEditor),this._eventManager.emit("removeEditor",function(){e._$buttonOpenModalEditor.off("click"),e._$buttonOpenModalEditor=null})}},{key:"_initDOMEvent",value:function(){var e=this;this._$buttonOpenModalEditor.on("click",function(){return e._openPopupCodeBlockEditor()})}},{key:"_openPopupCodeBlockEditor",value:function(){this._eventManager.emit("openPopupCodeBlockEditor",this.getAttachedElement())}},{key:"_updateLanguage",value:function(){var e=this.getAttachedElement(),t=e?e.getAttribute("data-language"):null;this._$languageLabel.text(t||"text")}},{key:"syncLayout",value:function(){var e=(0,c.default)(this.getAttachedElement()),t=e.offset();t.left=t.left+(e.outerWidth()-250),this.$el.offset(t),this.$el.height(30),this.$el.width(250)}},{key:"onShow",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onShow",this).call(this),this._onAttachedElementChange=function(){return e._updateLanguage()},(0,c.default)(this.getAttachedElement()).on("language-changed",this._onAttachedElementChange),this._updateLanguage()}},{key:"onHide",value:function(){(0,c.default)(this.getAttachedElement()).off("language-changed",this._onAttachedElementChange),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onHide",this).call(this)}}]),t}(f.default);t.default=h},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=function(){function e(t){var n=t.eventManager,o=t.container,a=t.attachedSelector;i(this,e),this._eventManager=n,this._attachedSelector="[contenteditable=true] "+a,this._$container=(0,r.default)(o),this._$attachedElement=null,this.active=!1,this._createElement(),this._initEvent()}return o(e,[{key:"_createElement",value:function(){this.$el=(0,r.default)('<div class="te-ww-block-overlay">'),this.$el.css({position:"absolute",display:"none","z-index":1}),this._$container.append(this.$el)}},{key:"_initEvent",value:function(){var e=this;this._eventManager.listen("change",this._onChange.bind(this)),this._eventManager.listen("mouseover",this._onMouseOver.bind(this)),this._eventManager.listen("focus",function(){e.setVisibility(!1)}),this._eventManager.listen("mousedown",function(){e.setVisibility(!1)})}},{key:"_onChange",value:function(){this._$attachedElement&&r.default.contains(document,this._$attachedElement[0])?this.syncLayout():this.setVisibility(!1)}},{key:"_onMouseOver",value:function(e){var t=e.data,n=(0,r.default)(t.target),i=n.closest(this._attachedSelector);i.length?(this._$attachedElement=i,this.setVisibility(!0)):n.closest(this.$el).length?this.setVisibility(!0):this.active||this.setVisibility(!1)}},{key:"syncLayout",value:function(){this.$el.offset(this._$attachedElement.offset()),this.$el.width(this._$attachedElement.outerWidth()),this.$el.height(this._$attachedElement.outerHeight())}},{key:"getAttachedElement",value:function(){return this._$attachedElement?this._$attachedElement.get(0):null}},{key:"getVisibility",value:function(){return"block"===this.$el.css("display")}},{key:"setVisibility",value:function(e){e&&this._$attachedElement?this.getVisibility()||(this.$el.css("display","block"),this.syncLayout(),this.onShow()):e||this.getVisibility()&&(this.$el.css("display","none"),this.onHide())}},{key:"onShow",value:function(){}},{key:"onHide",value:function(){this.active=!1,this._$attachedElement=null}}]),e}();t.default=l},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=['<div class="tui-editor">','<div class="te-md-container">','<div class="te-editor" />','<div class="te-md-splitter" />','<div class="te-preview" />',"</div>",'<div class="te-ww-container">','<div class="te-editor" />',"</div>","</div>"].join(""),s=function(){function e(t,n){i(this,e),this.$el=(0,r.default)(t.el),this.height=t.height,this.type=t.initialEditType,this.eventManager=n,this.init(),this._initEvent()}return o(e,[{key:"init",value:function(){this._renderLayout(),this._initMarkdownAndPreviewSection(),this._initWysiwygSection()}},{key:"_initEvent",value:function(){this.eventManager.listen("hide",this.hide.bind(this)),this.eventManager.listen("show",this.show.bind(this))}},{key:"_renderLayout",value:function(){this.$el.css("box-sizing","border-box"),this.$containerEl=(0,r.default)(l).appendTo(this.$el)}},{key:"switchToWYSIWYG",value:function(){this.$containerEl.removeClass("te-md-mode"),this.$containerEl.addClass("te-ww-mode")}},{key:"switchToMarkdown",value:function(){this.$containerEl.removeClass("te-ww-mode"),this.$containerEl.addClass("te-md-mode")}},{key:"_initMarkdownAndPreviewSection",value:function(){this.$mdEditorContainerEl=this.$containerEl.find(".te-md-container .te-editor"),this.$previewEl=this.$containerEl.find(".te-md-container .te-preview")}},{key:"_initWysiwygSection",value:function(){this.$wwEditorContainerEl=this.$containerEl.find(".te-ww-container .te-editor")}},{key:"_verticalSplitStyle",value:function(){this.$containerEl.find(".te-md-container").removeClass("te-preview-style-tab"),this.$containerEl.find(".te-md-container").addClass("te-preview-style-vertical")}},{key:"_tabStyle",value:function(){this.$containerEl.find(".te-md-container").removeClass("te-preview-style-vertical"),this.$containerEl.find(".te-md-container").addClass("te-preview-style-tab")}},{key:"changePreviewStyle",value:function(e){"tab"===e?this._tabStyle():"vertical"===e&&this._verticalSplitStyle()}},{key:"hide",value:function(){this.$el.find(".tui-editor").addClass("te-hide")}},{key:"show",value:function(){this.$el.find(".tui-editor").removeClass("te-hide")}},{key:"remove",value:function(){this.$el.find(".tui-editor").remove()}},{key:"getEditorEl",value:function(){return this.$containerEl}},{key:"getPreviewEl",value:function(){return this.$previewEl}},{key:"getMdEditorContainerEl",value:function(){return this.$mdEditorContainerEl}},{key:"getWwEditorContainerEl",value:function(){return this.$wwEditorContainerEl}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(72),u=i(s),c=n(43),d=i(c),f=n(5),h=i(f),g=n(77),v=i(g),p=n(78),m=i(p),y=n(79),_=i(y),b=n(80),k=i(b),w=n(81),C=i(w),E=n(82),M=i(E),T=n(83),S=i(T),O=n(84),L=i(O),x=n(3),N=i(x),A=n(34),B=i(A),P=function(){function e(t){o(this,e),Object.defineProperty(this,"name",{enumerable:!0,writable:!0,value:"default"}),Object.defineProperty(this,"_popups",{enumerable:!0,writable:!0,value:[]}),this._editor=t,this._initialEditType=t.options.initialEditType,this._init(t.options),this._initEvent()}return a(e,[{key:"_init",value:function(e){var t=e.el,n=e.toolbarItems,i=e.hideModeSwitch;this.$el=(0,l.default)('\n <div class="tui-editor-defaultUI">\n <div class="te-toolbar-section"><div class="te-markdown-tab-section"></div></div>\n <div class="te-editor-section"></div>\n <div class="te-mode-switch-section"></div>\n </div>\n').appendTo(t),this._container=t,this._editorSection=this.$el.find(".te-editor-section").get(0),this._editorSection.appendChild(this._editor.layout.getEditorEl().get(0)),this._initToolbar(this._editor.eventManager,n),this._initModeSwitch(i),this._initPopupAddLink(),this._initPopupAddImage(),this._initPopupAddTable(),this._initPopupAddHeading(),this._initPopupTableUtils(),this._initPopupCodeBlockLanguages(),this._initPopupCodeBlockEditor(),this._initMarkdownTab()}},{key:"_initEvent",value:function(){this._editor.eventManager.listen("hide",this.hide.bind(this)),this._editor.eventManager.listen("show",this.show.bind(this)),this._editor.eventManager.listen("changeMode",this._markdownTabControl.bind(this)),this._editor.eventManager.listen("changePreviewStyle",this._markdownTabControl.bind(this))}},{key:"_initToolbar",value:function(e,t){var n=new u.default(e,t);this._toolbar=n,this.$el.find(".te-toolbar-section").append(n.$el)}},{key:"_initModeSwitch",value:function(e){var t=this,n=this.$el.find(".te-mode-switch-section"),i="markdown"===this._initialEditType?v.default.TYPE.MARKDOWN:v.default.TYPE.WYSIWYG,o=new v.default(n,i);this._modeSwitch=o,e&&o.hide(),o.on("modeSwitched",function(e,n){return t._editor.changeMode(n)})}},{key:"_initMarkdownTab",value:function(){var e=this._editor;this._markdownTab=new d.default({initName:N.default.get("Write"),items:[N.default.get("Write"),N.default.get("Preview")],sections:[e.layout.getMdEditorContainerEl(),e.layout.getPreviewEl()]}),this._$markdownTabSection=this.$el.find(".te-markdown-tab-section"),this._$markdownTabSection.append(this._markdownTab.$el),this._markdownTab.on("itemClick",function(t,n){n===N.default.get("Preview")?(e.eventManager.emit("previewNeedsRefresh"),e.eventManager.emit("changePreviewTabPreview"),e.eventManager.emit("closeAllPopup")):(e.getCodeMirror().focus(),e.eventManager.emit("changePreviewTabWrite"))})}},{key:"_markdownTabControl",value:function(){this._editor.isMarkdownMode()&&"tab"===this._editor.getCurrentPreviewStyle()?(this._$markdownTabSection.show(),this._markdownTab.activate(N.default.get("Write"))):this._$markdownTabSection.hide()}},{key:"_initPopupAddLink",value:function(){this._popups.push(new m.default({$target:this.$el,editor:this._editor}))}},{key:"_initPopupAddImage",value:function(){this._popups.push(new _.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupAddTable",value:function(){this._popups.push(new C.default({$target:this._toolbar.$el,eventManager:this._editor.eventManager,$button:this.$el.find("button.tui-table"),css:{position:"absolute"}}))}},{key:"_initPopupAddHeading",value:function(){this._popups.push(new M.default({$target:this._toolbar.$el,eventManager:this._editor.eventManager,$button:this.$el.find("button.tui-heading"),css:{position:"absolute"}}))}},{key:"_initPopupTableUtils",value:function(){var e=this;this._editor.eventManager.listen("contextmenu",function(t){(0,l.default)(t.data.target).parents("[contenteditable=true] table").length>0&&(t.data.preventDefault(),e._editor.eventManager.emit("openPopupTableUtils",t.data))}),this._popups.push(new k.default({$target:this.$el,eventManager:this._editor.eventManager}))}},{key:"_initPopupCodeBlockLanguages",value:function(){var e=this._editor;this._popups.push(new S.default({$target:this.$el,eventManager:e.eventManager,languages:e.options.codeBlockLanguages}))}},{key:"_initPopupCodeBlockEditor",value:function(){this._popups.push(new L.default({$target:this.$el,eventManager:this._editor.eventManager,convertor:this._editor.convertor}))}},{key:"getToolbar",value:function(){return this._toolbar}},{key:"setToolbar",value:function(e){this._toolbar.destroy(),this._toolbar=e}},{key:"getModeSwitch",value:function(){return this._modeSwitch}},{key:"getEditorSectionHeight",value:function(){var e=this._editorSection.getBoundingClientRect();return e.bottom-e.top}},{key:"getEditorHeight",value:function(){var e=this._container.getBoundingClientRect();return e.bottom-e.top}},{key:"getPopupTableUtils",value:function(){var e=void 0;return this._popups.forEach(function(t){t instanceof k.default&&(e=t)}),e}},{key:"hide",value:function(){this.$el.addClass("te-hide")}},{key:"show",value:function(){this.$el.removeClass("te-hide")}},{key:"remove",value:function(){this.$el.remove(),this._markdownTab.remove(),this._modeSwitch.remove(),this._toolbar.destroy(),this._popups.forEach(function(e){return e.remove()}),this._popups=[],B.default.hide()}},{key:"createPopup",value:function(e){return new h.default(e)}}]),e}();t.default=P},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(73),c=i(u),d=n(3),f=i(d),h=n(40),g=i(h),v=n(76),p=i(v),m=n(42),y=i(m),_=function(e){function t(e,n){o(this,t);var i=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return i._init(e),i._bindWidthChangedEvent(),i}return r(t,e),l(t,[{key:"insertItem",value:function(e,n){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,e,n),this._arrangeMoreButton()}},{key:"_init",value:function(e){var t=y.default.create("button",{name:"more",className:"tui-more",tooltip:f.default.get("More"),event:p.default.OPEN_EVENT});this._moreButton=t,this._popupDropdownToolbar=new p.default({eventManager:e,$target:this.$el,$button:t.$el}),this.addItem(t)}},{key:"_bindWidthChangedEvent",value:function(){var e=this;this._observer=new c.default(function(){e._popupDropdownToolbar.hide(),e._balanceButtons()}),this._observer.observe(this.$el.get(0))}},{key:"_balanceButtons",value:function(){var e=this;this._popupDropdownToolbar.getItems().forEach(function(n){e._popupDropdownToolbar.removeItem(n,!1);var i=e.getItems().length;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",e).call(e,i,n)}),this.removeItem(this._moreButton,!1),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,0,this._moreButton);var n=this.$el.height();this.getItems().filter(function(e){return e.$el.position().top>n}).forEach(function(t){e.removeItem(t,!1),e._popupDropdownToolbar.addItem(t)}),this._arrangeMoreButton()}},{key:"_arrangeMoreButton",value:function(){if(this._popupDropdownToolbar){this.removeItem(this._moreButton,!1);var e=this._popupDropdownToolbar.getItems().length>0,n=this.getItems().length;e&&s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertItem",this).call(this,n,this._moreButton)}}},{key:"destroy",value:function(){this._observer&&(this._observer.disconnect(),this._observer=null)}}]),t}(g.default);t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function n(e){return parseFloat(e)||0}function i(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];return t.reduce(function(t,i){return t+n(e["border-"+i+"-width"])},0)}function o(e){for(var t=["top","right","bottom","left"],i={},o=0,a=t;o<a.length;o+=1){var r=a[o],l=e["padding-"+r];i[r]=n(l)}return i}function a(e){var t=e.getBBox();return c(0,0,t.width,t.height)}function r(e){var t=e.clientWidth,a=e.clientHeight;if(!t&&!a)return w;var r=k(e).getComputedStyle(e),s=o(r),u=s.left+s.right,d=s.top+s.bottom,f=n(r.width),h=n(r.height);if("border-box"===r.boxSizing&&(Math.round(f+u)!==t&&(f-=i(r,"left","right")+u),Math.round(h+d)!==a&&(h-=i(r,"top","bottom")+d)),!l(e)){var g=Math.round(f+u)-t,v=Math.round(h+d)-a;1!==Math.abs(g)&&(f-=g),1!==Math.abs(v)&&(h-=v)}return c(s.left,s.top,f,h)}function l(e){return e===k(e).document.documentElement}function s(e){return f?C(e)?a(e):r(e):w}function u(e){var t=e.x,n=e.y,i=e.width,o=e.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,r=Object.create(a.prototype);return b(r,{x:t,y:n,width:i,height:o,top:n,right:t+i,bottom:o+n,left:t}),r}function c(e,t,n,i){return{x:e,y:t,width:n,height:i}}var d=function(){function e(e,t){var n=-1;return e.some(function(e,i){return e[0]===t&&(n=i,!0)}),n}return"undefined"!=typeof Map?Map:function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=null);for(var i=0,o=n.__entries__;i<o.length;i+=1){var a=o[i];e.call(t,a[1],a[0])}},Object.defineProperties(t.prototype,n),t}()}(),f="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,h=function(){return void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")()}(),g=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame.bind(h):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),v=2,p=function(e,t){function n(){a&&(a=!1,e()),r&&o()}function i(){g(n)}function o(){var e=Date.now();if(a){if(e-l<v)return;r=!0}else a=!0,r=!1,setTimeout(i,t);l=e}var a=!1,r=!1,l=0;return o},m=["top","right","bottom","left","width","height","size","weight"],y="undefined"!=typeof MutationObserver,_=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=p(this.refresh.bind(this),20)};_.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},_.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},_.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},_.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},_.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),y?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},_.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},_.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),m.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},_.getInstance=function(){return this.instance_||(this.instance_=new _),this.instance_},_.instance_=null;var b=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n+=1){var o=i[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},k=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||h},w=c(0,0,0,0),C=function(){return"undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof k(e).SVGGraphicsElement}:function(e){return e instanceof k(e).SVGElement&&"function"==typeof e.getBBox}}(),E=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=c(0,0,0,0),this.target=e};E.prototype.isActive=function(){var e=s(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},E.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var M=function(e,t){var n=u(t);b(this,{target:e,contentRect:n})},T=function(e,t,n){if(this.activeObservations_=[],this.observations_=new d,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n};T.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof k(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new E(e)),this.controller_.addObserver(this),this.controller_.refresh())}},T.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof k(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},T.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},T.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},T.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new M(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},T.prototype.clearActive=function(){this.activeObservations_.splice(0)},T.prototype.hasActive=function(){return this.activeObservations_.length>0};var S="undefined"!=typeof WeakMap?new WeakMap:new d,O=function(e){if(!(this instanceof O))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=_.getInstance(),n=new T(e,t,this);S.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){O.prototype[e]=function(){return(t=S.get(this))[e].apply(t,arguments);var t}});var L=function(){return void 0!==h.ResizeObserver?h.ResizeObserver:O}();t.default=L}.call(t,n(74))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),l=function(e){return e&&e.__esModule?e:{default:e}}(r),s=function(e){function t(){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return a(t,e),t}(l.default);t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(1),c=i(u),d=n(5),f=i(d),h=n(40),g=i(h),v=function(e){function t(e){return o(this,t),e=c.default.extend({header:!1,className:"te-dropdown-toolbar"},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"getToolbar",value:function(){return this._toolbar}},{key:"getItems",value:function(){return this.getToolbar().getItems()}},{key:"getItem",value:function(e){return this.getToolbar().getItem(e)}},{key:"setItems",value:function(e){this.getToolbar().setItems(e)}},{key:"addItem",value:function(e){this.getToolbar().addItem(e)}},{key:"insertItem",value:function(e,t){this.getToolbar().insertItem(e,t)}},{key:"indexOfItem",value:function(e){return this.getToolbar().indexOfItem(e)}},{key:"removeItem",value:function(e,t){return this.getToolbar().removeItem(e,t)}},{key:"removeAllItems",value:function(){this.getToolbar().removeAllItems()}},{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e);var n=e.$button,i=e.eventManager;this._$button=n,this._eventManager=i,this._toolbar=new g.default(i)}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this),this.setContent(this._toolbar.$el)}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",function(){return e.hide()}),this._eventManager.listen("closeAllPopup",function(){return e.hide()}),this._eventManager.listen(t.OPEN_EVENT,function(){var t=e.isShow();e._eventManager.emit("closeAllPopup"),t||e.show(),e.$el.css({left:"-1000px"});var n=e._$button,i=n.position(),o=n.outerHeight(!0),a=(o-n.outerHeight())/2,r=i.top+o-a,l=i.left+n.outerWidth(!0)-e.$el.outerWidth(!0);e.$el.css({top:r,left:l})})}}]),t}(f.default);Object.defineProperty(v,"OPEN_EVENT",{enumerable:!0,writable:!0,value:"openDropdownToolbar"}),t.default=v},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(0),u=i(s),c=n(1),d=i(c),f=n(8),h=i(f),g=n(3),v=i(g),p="markdown",m=function(e){function t(e,n){o(this,t);var i=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:"te-mode-switch"}));return Object.defineProperty(i,"_buttons",{enumerable:!0,writable:!0,value:{}}),i._render(e),i._switchType(d.default.isExisty(n)?n:p),i}return r(t,e),l(t,[{key:"isShown",value:function(){return"block"===this._$rootElement.css("display")}},{key:"show",value:function(){this._$rootElement.css("display","block")}},{key:"hide",value:function(){this._$rootElement.css("display","none")}},{key:"_render",value:function(e){this._buttons.$markdown=(0,u.default)('<button class="te-switch-button markdown" type="button">'+v.default.get("Markdown")+"</button>"),this._buttons.$wysiwyg=(0,u.default)('<button class="te-switch-button wysiwyg" type="button">'+v.default.get("WYSIWYG")+"</button>"),this.$el.append(this._buttons.$markdown),this.$el.append(this._buttons.$wysiwyg),e&&(e.append(this.$el),this._$rootElement=e),this.on("click .markdown",this._changeMarkdown.bind(this)),this.on("click .wysiwyg",this._changeWysiwyg.bind(this)),this.show()}},{key:"_changeMarkdown",value:function(){this._switchType(p)}},{key:"_changeWysiwyg",value:function(){this._switchType("wysiwyg")}},{key:"_setActiveButton",value:function(e){this._buttons.$markdown.removeClass("active"),this._buttons.$wysiwyg.removeClass("active"),this._buttons["$"+e].addClass("active")}},{key:"_switchType",value:function(e){this._type!==e&&(this._type=e,this._setActiveButton(e),this.trigger("modeSwitched",this._type))}}]),t}(h.default);Object.defineProperty(m,"TYPE",{enumerable:!0,writable:!0,value:{MARKDOWN:p,WYSIWYG:"wysiwyg"}}),t.default=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(5),g=i(h),v=n(3),p=i(v),m=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/,y=function(e){function t(e){o(this,t);var n='\n <label for="linkText">'+p.default.get("Link text")+'</label>\n <input type="text" class="te-link-text-input" />\n <label for="url">'+p.default.get("URL")+'</label>\n <input type="text" class="te-url-input" />\n <div class="te-button-section">\n <button type="button" class="te-ok-button">'+p.default.get("OK")+'</button>\n <button type="button" class="te-close-button">'+p.default.get("Cancel")+"</button>\n </div>\n ";return e=f.default.extend({header:!0,title:p.default.get("Insert link"),className:"te-popup-add-link tui-editor-popup",content:n},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._editor=e.editor,this._eventManager=e.editor.eventManager}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this);var e=this.$el.get(0);this._inputText=e.querySelector(".te-link-text-input"),this._inputURL=e.querySelector(".te-url-input")}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click .te-close-button",function(){return e.hide()}),this.on("click .te-ok-button",function(){return e._addLink()}),this.on("shown",function(){var t=e._inputText,n=e._inputURL,i=e._editor.getSelectedText().trim();t.value=i,m.exec(i)&&(n.value=i),i.length>0&&n.value.length<1?n.focus():(t.focus(),t.setSelectionRange(0,i.length))}),this.on("hidden",function(){e._resetInputs()})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this);var n=this._eventManager;n.listen("focus",function(){return e.hide()}),n.listen("closeAllPopup",function(){return e.hide()}),n.listen("openPopupAddLink",function(){n.emit("closeAllPopup"),e.show()})}},{key:"_addLink",value:function(){var e=this._getValue(),t=e.url,n=e.linkText;return this._clearValidationStyle(),n.length<1?void(0,c.default)(this._inputText).addClass("wrong"):t.length<1?void(0,c.default)(this._inputURL).addClass("wrong"):(this._eventManager.emit("command","AddLink",{linkText:n,url:t}),void this.hide())}},{key:"_getValue",value:function(){return{url:this._inputURL.value,linkText:this._inputText.value}}},{key:"_clearValidationStyle",value:function(){(0,c.default)(this._inputURL).removeClass("wrong"),(0,c.default)(this._inputText).removeClass("wrong")}},{key:"_resetInputs",value:function(){this._inputText.value="",this._inputURL.value="",this._clearValidationStyle()}}]),t}(g.default);t.default=y},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(1),c=i(u),d=n(5),f=i(d),h=n(43),g=i(h),v=n(3),p=i(v),m="te-image-url-input",y="te-image-file-input",_="te-alt-text-input",b="te-ok-button",k="te-close-button",w="te-file-type",C="te-url-type",E="te-tab-section",M=function(e){function t(e){o(this,t);var n='\n <div class="'+E+'"></div>\n <div class="'+C+'">\n <label for="">'+p.default.get("Image URL")+'</label>\n <input type="text" class="'+m+'" />\n </div>\n <form enctype="multipart/form-data" class="'+w+'">\n <label for="">'+p.default.get("Select image file")+'</label>\n <input type="file" class="'+y+'" accept="image/*" />\n </form>\n <label for="url">'+p.default.get("Description")+'</label>\n <input type="text" class="'+_+'" />\n <div class="te-button-section">\n <button type="button" class="'+b+'">'+p.default.get("OK")+'</button>\n <button type="button" class="'+k+'">'+p.default.get("Cancel")+"</button>\n </div>\n ";return e=c.default.extend({header:!0,title:p.default.get("Insert image"),className:"te-popup-add-image tui-editor-popup",content:n},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this);var e=this.$el;this._$imageUrlInput=e.find("."+m),this._$imageFileInput=e.find("."+y),this._$altTextInput=e.find("."+_);var n=e.find("."+w),i=e.find("."+C),o=this.$body.find("."+E);this.tab=new g.default({initName:p.default.get("File"),items:[p.default.get("File"),p.default.get("URL")],sections:[n,i]}),o.append(this.tab.$el)}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("shown",function(){return e._$imageUrlInput.focus()}),this.on("hidden",function(){return e._resetInputs()}),this.on("change ."+y,function(){var t=e._$imageFileInput.val().split("\\").pop();e._$altTextInput.val(t)}),this.on("click ."+k,function(){return e.hide()}),this.on("click ."+b,function(){var t=e._$imageUrlInput.val(),n=e._$altTextInput.val();if(t)e._applyImage(t,n);else{var i=e._$imageFileInput.get(0),o=i.files;if(o.length){var a=o.item(0),r=function(t,i){return e._applyImage(t,n||i)};e.eventManager.emit("addImageBlobHook",a,r,"ui")}}e.hide()}),this.tab.on("itemClick",function(){return e._resetInputs()})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("openPopupAddImage",function(){e.eventManager.emit("closeAllPopup"),e.show()})}},{key:"_applyImage",value:function(e,t){this.eventManager.emit("command","AddImage",{imageUrl:e,altText:t||"image"}),this.hide()}},{key:"_resetInputs",value:function(){this.$el.find("input").val("")}},{key:"remove",value:function(){this.tab.remove(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this)}}]),t}(f.default);t.default=M},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(5),g=i(h),v=n(3),p=i(v),m=function(e){function t(e){o(this,t);var n='\n <button type="button" class="te-table-add-row">'+p.default.get("Add row")+'</button>\n <button type="button" class="te-table-add-col">'+p.default.get("Add col")+'</button>\n <button type="button" class="te-table-remove-row">'+p.default.get("Remove row")+'</button>\n <button type="button" class="te-table-remove-col">'+p.default.get("Remove col")+'</button>\n <hr/>\n <button type="button" class="te-table-col-align-left">'+p.default.get("Align left")+'</button>\n <button type="button" class="te-table-col-align-center">'+p.default.get("Align center")+'</button>\n <button type="button" class="te-table-col-align-right">'+p.default.get("Align right")+'</button>\n <hr/>\n <button type="button" class="te-table-remove">'+p.default.get("Remove table")+"</button>\n ";return e=f.default.extend({header:!1,className:"te-popup-table-utils",content:n},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click .te-table-add-row",function(){return e.eventManager.emit("command","AddRow")}),this.on("click .te-table-add-col",function(){return e.eventManager.emit("command","AddCol")}),this.on("click .te-table-remove-row",function(){return e.eventManager.emit("command","RemoveRow")}),this.on("click .te-table-col-align-left",function(){return e.eventManager.emit("command","AlignCol","left")}),this.on("click .te-table-col-align-center",function(){return e.eventManager.emit("command","AlignCol","center")}),this.on("click .te-table-col-align-right",function(){return e.eventManager.emit("command","AlignCol","right")}),this.on("click .te-table-remove-col",function(){return e.eventManager.emit("command","RemoveCol")}),this.on("click .te-table-remove",function(){return e.eventManager.emit("command","RemoveTable")})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("mousedown",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("openPopupTableUtils",function(t){var n=e.$el.parent().offset(),i=t.clientX-n.left,o=t.clientY-n.top+(0,c.default)(window).scrollTop();e.$el.css({position:"absolute",top:o+5,left:i+10}),e.eventManager.emit("closeAllPopup"),e.show()})}}]),t}(g.default);t.default=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(1),c=i(u),d=n(5),f=i(d),h='\n <div class="te-table-selection">\n <div class="te-table-header"></div>\n <div class="te-table-body"></div>\n <div class="te-selection-area"></div>\n </div>\n <p class="te-description"></p>\n',g=function(e){function t(e){return o(this,t),e=c.default.extend({header:!1,className:"te-popup-add-table",content:h},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._selectedBound={},this._tableBound={},this._eventManager=e.eventManager,this._$button=e.$button}},{key:"_initDOM",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this),this._cacheElements(),this._setTableSizeByBound(5,7)}},{key:"_initDOMEvent",value:function(e){var n=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this,e),this.on("mousemove .te-table-selection",function(e){var t=e.pageX-n._selectionOffset.left,i=e.pageY-n._selectionOffset.top,o=n._getSelectionBoundByOffset(t,i);n._resizeTableBySelectionIfNeed(o.col,o.row),n._setSelectionAreaByBound(o.col,o.row),n._setDisplayText(o.col,o.row),n._setSelectedBound(o.col,o.row)}),this.on("click .te-table-selection",function(){var e=n._getSelectedTableSize();n._eventManager.emit("command","Table",e.col,e.row)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",function(){return e.hide()}),this._eventManager.listen("closeAllPopup",function(){return e.hide()}),this._eventManager.listen("openPopupAddTable",function(){var t=e._$button,n=t.get(0),i=n.offsetTop,o=n.offsetLeft;e.$el.css({top:i+t.outerHeight(),left:o}),e._eventManager.emit("closeAllPopup"),e.show(),e._selectionOffset=e.$el.find(".te-table-selection").offset()})}},{key:"_cacheElements",value:function(){this.$header=this.$el.find(".te-table-header"),this.$body=this.$el.find(".te-table-body"),this.$selection=this.$el.find(".te-selection-area"),this.$desc=this.$el.find(".te-description")}},{key:"_resizeTableBySelectionIfNeed",value:function(e,t){var n=this._getResizedTableBound(e,t);n&&this._setTableSizeByBound(n.col,n.row)}},{key:"_getResizedTableBound",value:function(e,t){var n=void 0,i=void 0,o=void 0;return e>=5&&e<9?n=e+1:e<5&&(n=5),t>=7&&t<14?i=t+1:t<7&&(i=7),this._isNeedResizeTable(n,i)&&(o={row:i||this._tableBound.row,col:n||this._tableBound.col}),o}},{key:"_isNeedResizeTable",value:function(e,t){return e&&e!==this._tableBound.col||t&&t!==this._tableBound.row}},{key:"_getBoundByOffset",value:function(e,t){return{row:parseInt(t/17,10),col:parseInt(e/25,10)}}},{key:"_getOffsetByBound",value:function(e,t){return{x:25*e+25,y:17*t+17}}},{key:"_setTableSizeByBound",value:function(e,t){var n=this._getOffsetByBound(e,t-1);this._setTableSize(n.x,n.y),this._tableBound.row=t,this._tableBound.col=e}},{key:"_getSelectionBoundByOffset",value:function(e,t){var n=this._getBoundByOffset(e,t);return n.row<1?n.row=1:n.row>this._tableBound.row&&(n.row=this._tableBound.row),n.col<1?n.col=1:n.col>this._tableBound.col&&(n.col=this._tableBound.col),n}},{key:"_setSelectionAreaByBound",value:function(e,t){var n=this._getOffsetByBound(e,t);this._setSelectionArea(n.x,n.y)}},{key:"_setSelectedBound",value:function(e,t){this._selectedBound.col=e,this._selectedBound.row=t}},{key:"_getSelectedTableSize",value:function(){return{row:this._selectedBound.row+1,col:this._selectedBound.col+1}}},{key:"_setDisplayText",value:function(e,t){this.$desc.html(e+1+" x "+(t+1))}},{key:"_setTableSize",value:function(e,t){e+=1,t+=1,this.$header.css({height:17,width:e}),this.$body.css({height:t,width:e}),this.$el.css({width:e+30})}},{key:"_setSelectionArea",value:function(e,t){e+=1,t+=1,this.$selection.css({height:t,width:e})}}]),t}(f.default);g.CELL_WIDTH=25,g.CELL_HEIGHT=17,g.MIN_ROW_SELECTION_INDEX=1,g.MIN_COL_SELECTION_INDEX=1,t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(5),g=i(h),v=n(3),p=i(v),m=function(e){function t(e){o(this,t);var n='\n <ul>\n <li data-value="1" data-type="Heading"><h1>'+p.default.get("Heading")+' 1</h1></li>\n <li data-value="2" data-type="Heading"><h2>'+p.default.get("Heading")+' 2</h2></li>\n <li data-value="3" data-type="Heading"><h3>'+p.default.get("Heading")+' 3</h3></li>\n <li data-value="4" data-type="Heading"><h4>'+p.default.get("Heading")+' 4</h4></li>\n <li data-value="5" data-type="Heading"><h5>'+p.default.get("Heading")+' 5</h5></li>\n <li data-value="6" data-type="Heading"><h6>'+p.default.get("Heading")+' 6</h6></li>\n <li data-type="Paragraph"><div>'+p.default.get("Paragraph")+"</div></li>\n </ul>\n ";return e=f.default.extend({header:!1,className:"te-heading-add",content:n},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._eventManager=e.eventManager,this._$button=e.$button}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("click li",function(t){var n=(0,c.default)(t.target).closest("li");e._eventManager.emit("command",n.data("type"),n.data("value"))})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this._eventManager.listen("focus",this.hide.bind(this)),this._eventManager.listen("closeAllPopup",this.hide.bind(this)),this._eventManager.listen("openHeadingSelect",function(){var t=e._$button,n=t.get(0),i=n.offsetTop,o=n.offsetLeft;e.$el.css({top:i+t.outerHeight(),left:o}),e._eventManager.emit("closeAllPopup"),e.show()})}}]),t}(g.default);t.default=m},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(5),g=i(h),v="te-popup-code-block-lang-",p=function(e){function t(e){o(this,t);var n=[];return e.languages.forEach(function(e){return n.push('<button type="button" class="'+v+e+'" data-lang="'+e+'">'+e+"</button>")}),e=f.default.extend({header:!1,className:"te-popup-code-block-languages",content:n.join("")},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this._onSelectedLanguage=null,this._onDismissed=null,this._currentButton=null,this._$buttons=null,this._languages=e.languages,this.eventManager=e.eventManager}},{key:"_initDOM",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this,e),this.$el.css("z-index",1e4),this._$buttons=this.$el.find("button"),this._activateButtonByIndex(0)}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this);var n=function(t){var n=(0,c.default)(t.target).data("lang");e._onSelectedLanguage&&e._onSelectedLanguage(n),e.hide()};this._languages.forEach(function(t){return e.on("mousedown ."+v+t,n)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("openPopupCodeBlockLanguages",function(t){e.show(t.callback);var n=e.$el.get(0).style;return n.top=t.offset.top+"px",n.left=t.offset.left+"px",e.setCurrentLanguage(t.language),e}),this.eventManager.listen("focus",function(){return e.hide()}),this.eventManager.listen("mousedown",function(){return e.hide()}),this.eventManager.listen("closeAllPopup",function(){return e.hide()}),this.eventManager.listen("closePopupCodeBlockLanguages",function(){return e.hide()}),this.eventManager.listen("scroll",function(){return e.hide()})}},{key:"_activateButtonByIndex",value:function(e){this._currentButton&&(0,c.default)(this._currentButton).removeClass("active"),this._currentButton=this._$buttons.get(e),(0,c.default)(this._currentButton).addClass("active"),this._currentButton.scrollIntoView()}},{key:"prev",value:function(){var e=this._$buttons.index(this._currentButton)-1;e<0&&(e=this._$buttons.length-1),this._activateButtonByIndex(e)}},{key:"next",value:function(){var e=this._$buttons.index(this._currentButton)+1;e>=this._$buttons.length&&(e=0),this._activateButtonByIndex(e)}},{key:"getCurrentLanguage",value:function(){return(0,c.default)(this._currentButton).data("lang")}},{key:"setCurrentLanguage",value:function(e){var t=this._$buttons.filter("."+v+e);if(t.length>0){var n=this._$buttons.index(t);this._activateButtonByIndex(n)}}},{key:"show",value:function(e){this._onSelectedLanguage=e.selected,this._onDismissed=e.dismissed,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._onDismissed&&this._onDismissed(),this._onSelectedLanguage=null,this._onDismissed=null,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(g.default);t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},u=n(0),c=i(u),d=n(1),f=i(d),h=n(5),g=i(h),v=n(85),p=i(v),m=n(86),y=i(m),_=n(87),b=i(_),k=n(88),w=i(k),C=n(3),E=i(C),M="popup-editor-",T="te-ok-button",S="te-close-button",O='\n <button type="button" class="'+M+'toggle-scroll"></button>\n <button type="button" class="'+M+'toggle-preview"></button>\n <button type="button" class="'+M+'toggle-fit"></button>\n <button type="button" class="tui-popup-close-button"></button>\n',L=function(e){function t(e){o(this,t);var n='\n <div class="'+M+'body"></div>\n <div class="te-button-section">\n <button type="button" class="'+T+'">'+E.default.get("OK")+'</button>\n <button type="button" class="'+S+'">'+E.default.get("Cancel")+"</button>\n </div>\n ";return e=f.default.extend({header:!0,title:"CodeBlock Editor",content:n,className:"tui-popup-code-block-editor",headerButtons:O,modal:!0},e),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),l(t,[{key:"_initInstance",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initInstance",this).call(this,e),this.eventManager=e.eventManager,this.convertor=e.convertor}},{key:"_initDOM",value:function(e){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOM",this).call(this,e);var n=this.$el.get(0);this._body=n.querySelector("."+M+"body"),this._toggleFitButton=n.querySelector("."+M+"toggle-fit"),this._togglePreviewButton=n.querySelector("."+M+"toggle-preview"),this._toggleScrollButton=n.querySelector("."+M+"toggle-scroll"),this._okButton=n.querySelector("."+T),this._closeButton=n.querySelector("."+S),this._codeMirrorWrapper=this._createCodeBlockEditor(),this._previewWrapper=this._createPreview(),this._scrollSyncSplit=new p.default(this._body,this._codeMirrorWrapper,this._previewWrapper),this._updateFitWindowButton(),this._updatePreviewButton(),this._updateScrollButton(),this._codeBlockLanguagesCombo=this._createCodeBlockLanguagesCombo()}},{key:"_initDOMEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initDOMEvent",this).call(this),this.on("scroll",function(e){return e.preventDefault()}),this.on("click ."+M+"toggle-fit",function(){return e._toggleFitToWindow()}),this.on("click ."+M+"toggle-preview",function(){return e._togglePreview()}),this.on("click ."+M+"toggle-scroll",function(){return e._toggleScroll()}),this.on("click ."+T,function(){return e._save()}),this.on("click ."+S,function(){return e.hide()}),this.on("click ."+M+"close",function(){return e.hide()}),this.on("click ."+M+"editor-wrapper",function(t){t.target===e._codeMirrorWrapper&&e._focusEditor(!0)})}},{key:"_initEditorEvent",value:function(){var e=this;s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_initEditorEvent",this).call(this),this.eventManager.listen("openPopupCodeBlockEditor",function(t){return e.eventManager.emit("closeAllPopup"),e.show(t),e}),this.eventManager.listen("closeAllPopup",this.hide.bind(this)),this.eventManager.listen("closePopupCodeBlockEditor",this.hide.bind(this))}},{key:"_createCodeBlockEditor",value:function(){var e=document.createElement("div");return e.className=M+"editor-wrapper",this._codeBlockEditor=new y.default(e,this.eventManager),e}},{key:"_createPreview",value:function(){var e=document.createElement("div");return this._codeBlockPreview=new b.default((0,c.default)(e),this.eventManager,this.convertor,this._codeBlockEditor),e}},{key:"_createCodeBlockLanguagesCombo",value:function(){var e=this,t=this.getTitleElement(),n=new w.default(this.eventManager);return n.setOnLanguageSelected(function(t){e._codeBlockEditor.setLanguage(t),e._codeBlockEditor.refresh(),e._focusEditor()}),t.innerHTML="CodeBlock Editor",t.appendChild(n.getElement()),n}},{key:"_updateFitWindowButton",value:function(){(0,c.default)(this._toggleFitButton).toggleClass("active",this.isFitToWindow())}},{key:"_updatePreviewButton",value:function(){(0,c.default)(this._togglePreviewButton).toggleClass("active",this._scrollSyncSplit.isSplitView())}},{key:"_updateScrollButton",value:function(){this._scrollSyncSplit.isSplitView()?this._toggleScrollButton.style.display="inline-block":this._toggleScrollButton.style.display="none",(0,c.default)(this._toggleScrollButton).toggleClass("active",this._scrollSyncSplit.isScrollSynced())}},{key:"_focusEditor",value:function(e){this._codeBlockEditor.focus(),e?this._codeBlockEditor.moveCursorToEnd():this._codeBlockEditor.moveCursorToStart()}},{key:"_togglePreview",value:function(){this._scrollSyncSplit.toggleSplitView(),this._updatePreviewButton(),this._updateScrollButton(),this._codeBlockEditor.refresh()}},{key:"_toggleFitToWindow",value:function(){this.toggleFitToWindow(),this._updateFitWindowButton(),this._codeBlockEditor.refresh()}},{key:"_toggleScroll",value:function(){this._scrollSyncSplit.toggleScrollSync(),this._updateScrollButton()}},{key:"_save",value:function(){this._codeBlockEditor.save(this._codeBlockElement),this.hide()}},{key:"_load",value:function(e){this._codeBlockElement=e,this._codeBlockEditor.load(e),this._codeBlockLanguagesCombo.setLanguage(this._codeBlockEditor.getLanguage()),this._focusEditor(),this._codeBlockPreview.refresh()}},{key:"show",value:function(e){if(s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"show",this).call(this),!e)throw new Error("should be called with codeBlockElement");this._load(e)}},{key:"hide",value:function(){this.setFitToWindow(!1),this._codeBlockEditor&&this._codeBlockEditor.clear(),this._codeBlockPreview&&this._codeBlockPreview.clear(),this._codeBlockElement=null,s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"hide",this).call(this)}}]),t}(g.default);t.default=L},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(1),u=i(s),c={left:"tui-split-content-left",right:"tui-split-content-right"},d=function(){function e(t,n,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};o(this,e),a=u.default.extend({showScrollSyncButton:!1,scrollSync:!0,splitView:!0},a),this._baseElement=t,this._contentElements=[],this._initDom(n,i,a),this._initDomEvent()}return a(e,[{key:"_initDom",value:function(e,t,n){var i=document.createElement("div");i.className="tui-split-scroll",this._el=i;var o=document.createElement("div");o.className="tui-split-scroll-wrapper",this._scrollWrapper=o,this._setScrollSync(n.scrollSync),this.setSplitView(n.splitView);var a=document.createElement("div");a.className="tui-split-scroll-content",this._contentWrapper=a;var r=document.createElement("div");r.className="tui-splitter",this._baseElement.appendChild(i),i.appendChild(o),o.appendChild(a),o.appendChild(r),this._setLeft(e),this._setRight(t)}},{key:"_initDomEvent",value:function(){this._contentWrapper.addEventListener("scroll",this.sync.bind(this))}},{key:"_requireScrollIntoView",value:function(e){var t=e.target,n=t.getBoundingClientRect(),i=n.top,o=n.bottom,a=void 0,r=void 0,s=void 0;if(this.isScrollSynced())s=this._contentWrapper;else if((0,l.default)(t).parents(this._contentElements.left).length)s=this._contentElements.left;else{if(!(0,l.default)(t).parents(this._contentElements.right).length)return;s=this._contentElements.right}var u=s.getBoundingClientRect();a=u.top,r=u.bottom,i<a?s.scrollTop=s.scrollTop+i-a:o>r&&(s.scrollTop=s.scrollTop+o-r),this.sync()}},{key:"_setContentElement",value:function(e,t){var n=this,i=this._contentElements[t];i&&((0,l.default)(i).off("requireScrollIntoView"),this._contentWrapper.removeChild(i)),(0,l.default)(e).addClass(c[t]),this._contentWrapper.appendChild(e),(0,l.default)(e).on("requireScrollIntoView",function(e){return n._requireScrollIntoView(e)}),(0,l.default)(e).on("requireScrollSync",function(){return n.sync()}),this._contentElements[t]=e,this.sync()}},{key:"_setLeft",value:function(e){this._setContentElement(e,"left")}},{key:"_setRight",value:function(e){this._setContentElement(e,"right")}},{key:"_setScrollSync",value:function(e){(0,l.default)(this._el).toggleClass("scroll-sync",e)}},{key:"toggleScrollSync",value:function(){(0,l.default)(this._el).toggleClass("scroll-sync")}},{key:"setSplitView",value:function(e){(0,l.default)(this._el).toggleClass("single-content",!e)}},{key:"toggleSplitView",value:function(){(0,l.default)(this._el).toggleClass("single-content")}},{key:"isScrollSynced",value:function(){return(0,l.default)(this._el).hasClass("scroll-sync")}},{key:"isSplitView",value:function(){return!(0,l.default)(this._el).hasClass("single-content")}},{key:"sync",value:function(){if(this._contentElements.left&&this._contentElements.right){var e=this._contentWrapper.clientHeight,t=this._contentWrapper.scrollTop,n=this._contentElements.left,i=this._contentElements.right,o=n.offsetHeight-e>0?n:i,a=o===n?i:n,r=o.offsetHeight,l=Math.max(r-e,0),s=Math.max(a.offsetHeight,e),u=r-s;o.style.top="0px",a.style.top=t/l*u+"px"}}},{key:"scrollTop",value:function(e){this._contentWrapper.scrollTop=e}}]),e}();t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(0),u=i(s),c=n(35),d=i(c),f=function(e){function t(e,n){o(this,t);var i=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,{singleCursorHeightPerLine:!1,theme:"none"}));return i._language="",i._eventManager=n,i._initEvent(),i}return r(t,e),l(t,[{key:"_initEvent",value:function(){var e=this;this.on("cursorActivity",this._onRequireScrollIntoView.bind(this)),this.on("beforeChange",function(t,n){"paste"===n.origin&&e._eventManager.emit("pasteBefore",{source:"codeblock",data:n})})}},{key:"_onRequireScrollIntoView",value:function(){var e=this.getCursor(),t=this.getWrapperElement();setTimeout(function(){var n=t.querySelector("pre:nth-child("+(e.line+1)+")");(0,u.default)(n).trigger("requireScrollIntoView")},0)}},{key:"load",value:function(e){var t=e.cloneNode(!0);this.setLanguage(t.getAttribute("data-language")||""),this.setEditorCodeText(t.textContent)}},{key:"save",value:function(e){e.innerHTML="",e.textContent=this.getEditorCodeText(),e.setAttribute("data-language",this._language),(0,u.default)(e).trigger("language-changed")}},{key:"clear",value:function(){this.setLanguage(""),this.setEditorCodeText("")}},{key:"getLanguage",value:function(){return this._language}},{key:"setLanguage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this._language=e}},{key:"getEditorCodeText",value:function(){return this.getValue()}},{key:"setEditorCodeText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setValue(e)}},{key:"refresh",value:function(){this.cm.refresh()}}]),t}(d.default);t.default=f},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=function e(t,n,i){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in o)return o.value;var r=o.get;if(void 0!==r)return r.call(i)},s=n(13),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,n,a,r){i(this,t);var l=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,a,!0));return l._codeBlockEditor=r,l._initEvent(),l}return a(t,e),r(t,[{key:"_initEvent",value:function(){var e=this;this._codeBlockEditor.on("update",function(){return e.lazyRunner.run("refresh")})}},{key:"refresh",value:function(){var e=this._codeBlockEditor.getLanguage(),n=this._codeBlockEditor.getEditorCodeText();l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"refresh",this).call(this,"```"+e+"\n"+n+"\n```"),this.$el.trigger("requireScrollSync")}},{key:"clear",value:function(){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"render",this).call(this,"")}}]),t}(u.default);t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0),l=i(r),s=n(3),u=i(s),c=n(19),d=i(c),f=function(){function e(t){o(this,e),this._eventManager=t,this._initDOM(),this._initDOMEvent()}return a(e,[{key:"_initDOM",value:function(){this._inputLanguage=(0,l.default)('<input type="text" maxlength="20" placeholder="'+u.default.get("Choose language")+'">').get(0),this._wrapper=(0,l.default)('<span class="te-input-language">').get(0),this._wrapper.appendChild(this._inputLanguage)}},{key:"_initDOMEvent",value:function(){var e=this;this._inputLanguage.addEventListener("keydown",function(t){return e._onKeyEvent(t)}),this._inputLanguage.addEventListener("focus",function(){return e._showPopupCodeBlockLanguages()}),this._inputLanguage.addEventListener("focusout",function(){return e._onFocusOut()}),this._wrapper.addEventListener("mousedown",function(t){t.target===e._wrapper&&(t.preventDefault(),e._toggleFocus())})}},{key:"_showPopupCodeBlockLanguages",value:function(){var e=this,t=this._inputLanguage.getBoundingClientRect();(0,l.default)(this._wrapper).toggleClass("active",!0),this.active=!0,this._popupCodeBlockLanguages=this._eventManager.emitReduce("openPopupCodeBlockLanguages",{language:this._prevStoredLanguage,offset:{left:t.left,top:t.bottom},callback:{selected:function(t){return e._onLanguageSelectedFromList(t)},dismissed:function(){e._popupCodeBlockLanguages=null}}})}},{key:"_toggleFocus",value:function(){var e=this._inputLanguage;(0,l.default)(this._wrapper).hasClass("active")?e.blur():e.focus()}},{key:"_onFocusOut",value:function(){(0,l.default)(this._wrapper).toggleClass("active",!1),this._inputLanguage.value=this._prevStoredLanguage,this._hidePopupCodeBlockLanguages()}},{key:"_onKeyEvent",value:function(e){if(this._popupCodeBlockLanguages)switch(e.which){case d.default.keyCode("UP"):this._popupCodeBlockLanguages.prev(),e.preventDefault();break;case d.default.keyCode("DOWN"):this._popupCodeBlockLanguages.next(),e.preventDefault();break;case d.default.keyCode("ENTER"):case d.default.keyCode("TAB"):var t=this._popupCodeBlockLanguages.getCurrentLanguage();this._inputLanguage.value=t,this._storeInputLanguage(),e.preventDefault();break;default:this._popupCodeBlockLanguages.hide()}else e.which!==d.default.keyCode("ENTER")&&e.which!==d.default.keyCode("TAB")||(this._storeInputLanguage(),e.preventDefault())}},{key:"_onLanguageSelectedFromList",value:function(e){this._inputLanguage.value=e,this._storeInputLanguage()}},{key:"setOnLanguageSelected",value:function(e){this._onLanguageSelected=e}},{key:"_hidePopupCodeBlockLanguages",value:function(){this._eventManager.emit("closePopupCodeBlockLanguages")}},{key:"setLanguage",value:function(e){this._prevStoredLanguage=e,this._inputLanguage.value=e}},{key:"_storeInputLanguage",value:function(){var e=this._inputLanguage.value;this.setLanguage(e),this._onLanguageSelected&&this._onLanguageSelected(e),this._hidePopupCodeBlockLanguages()}},{key:"getElement",value:function(){return this._wrapper}}]),e}();t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(33),r=/^(\*{2}|_{2}).*\1$/,l=/[*_]{2,}([^*_]*)[*_]{2,}/g,s=o.default.command("markdown",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=e.getRange();(0,a.changeSyntax)(n,i,"**",r,l),t.focus()}});t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(33),r=/^(\*{3}|_{3}).*\1$/,l=/^(\*{2}|_{2}).*\1$/,s=/^(\*|_).*\1$/,u=/([^*_])[*_]([^*_]+)[*_]([^*_])/g,c=function(e){return r.test(e)},d=function(e){return l.test(e)},f=function(e){return s.test(e)},h="*".length,g="**".length,v="***".length,p=function(e){return e?e.replace(u,"$1$2$3"):""},m=function(e,t,n){var i=a.expandReplace.bind(this,e,n);return i(v,c,function(e){return(0,a.removeSyntax)(e,"*")})||i(g,d,function(e){return(0,a.appendSyntax)(p(e),"*")})||i(h,f,function(e){return(0,a.removeSyntax)(e,"*")})||(0,a.replace)(e,t,c,function(e){return(0,a.removeSyntax)(e,"*")})||(0,a.replace)(e,t,d,function(e){return(0,a.appendSyntax)(p(e),"*")})||(0,a.replace)(e,t,f,function(e){return(0,a.removeSyntax)(e,"*")})},y=function(e,t){return(0,a.expandReplace)(e,t,v,c,function(e){return(0,a.removeSyntax)(e,"*")})||(0,a.expandReplace)(e,t,g,d,function(e){return(0,a.appendSyntax)(e,"*")})||(0,a.expandReplace)(e,t,h,f,function(){return""})||e.replaceSelection("**","around")},_=o.default.command("markdown",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=n.getCursor(),o=i.line,r=i.ch,l=e.getRange(),s=n.getSelection();if(s)m(n,s,l)||n.replaceSelection((0,a.appendSyntax)(p(s),"*"),"around");else{y(n,l);var u=n.getSelection(),g=r;c(u)||f(u)&&!d(u)?g+=h:g-=h,n.setCursor(o,g)}t.focus()}});t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=n(33),r=/^~~.*~~$/,l=/~~([^~]*)~~/g,s=o.default.command("markdown",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=e.getRange();(0,a.changeSyntax)(n,i,"~~",r,l),t.focus()}});t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=/^> ?/,r=o.default.command("markdown",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=e.getCurrentRange(),o={line:i.from.line,ch:0},a={line:i.to.line,ch:n.getLineHandle(i.to.line).text.length},r=n.getRange(o,a),l=r.split("\n"),s=this._haveBlockquote(l),u=void 0;if(u=s?this._removeBlockquote(l):this._addBlockquote(l),n.replaceRange(u.join("\n"),o,a),s){var c=l.length;this._isBlockquoteWithSpace(l[c-1])?i.to.ch-=2:i.to.ch-=1}else i.to.ch+=2;n.setCursor(i.to),t.focus()},_haveBlockquote:function(e){for(var t=0;t<e.length;t+=1)if(!a.test(e[t]))return!1;return!0},_addBlockquote:function(e){return e.map(function(e){return"> "+e})},_removeBlockquote:function(e){return e.map(function(e){return e.replace(a,"")})},_isBlockquoteWithSpace:function(e){return/^> /.test(e)}});t.default=r},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.match(u),i="";do{i+="#",t-=1}while(t>0);if(n){e=e.split(n[0])[1]}return i+" "+e}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),r=i(a),l=n(2),s=i(l),u=/^#+\s/g,c=s.default.command("markdown",{name:"Heading",exec:function(e,t){var n=e.getEditor(),i=n.getDoc(),a=e.getCurrentRange(),l={line:a.from.line,ch:0},s={line:a.to.line,ch:i.getLineHandle(a.to.line).text.length},u=i.getLine(s.line).length,c=i.getRange(l,s),d=c.split("\n");r.default.forEachArray(d,function(e,n){d[n]=o(e,t)}),i.replaceRange(d.join("\n"),l,s),a.to.ch+=i.getLine(s.line).length-u,i.setSelection(l,a.to),n.focus()}});t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=/^(#{1,6}| *((?:\*|-|\d\.)(?: \[[ xX]])?)) /;return e.replace(t,"")}Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),r=i(a),l=n(2),s=i(l),u=s.default.command("markdown",{name:"Paragraph",exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=e.getCurrentRange(),a={line:i.from.line,ch:0},l={line:i.to.line,ch:n.getLineHandle(i.to.line).text.length},s=n.getLine(l.line).length,u=n.getRange(a,l),c=u.split("\n");r.default.forEachArray(c,function(e,t){c[t]=o(e)}),n.replaceRange(c.join("\n"),a,l),i.to.ch+=n.getLine(l.line).length-s,n.setSelection(a,l),t.focus()}});t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i="",o=e.getCurrentRange(),a={line:o.from.line,ch:o.from.ch},r={line:o.to.line,ch:o.to.ch};o.collapsed&&(i=n.getLine(a.line),a.ch=0,r.ch=n.getLineHandle(o.to.line).text.length),n.getLine(a.line).length?i+="\n\n* * *\n\n":i+="\n* * *\n",n.replaceRange(i,a,r),t.focus()}});t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(10),l=i(r),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=l.default.escapeMarkdownCharacters,d=a.default.command("markdown",{name:"AddLink",exec:function(e,t){var n=e.getEditor(),i=n.getDoc(),o=e.getCurrentRange(),a={line:o.from.line,ch:o.from.ch},r={line:o.to.line,ch:o.to.ch},l=t.linkText,d=t.url;l=s(l),l=c(l),d=u(d);var f="["+l+"]("+d+")";i.replaceRange(f,a,r),n.focus()}});t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(10),l=i(r),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=l.default.escapeMarkdownCharacters,d=a.default.command("markdown",{name:"AddImage",exec:function(e,t){var n=e.getEditor(),i=n.getDoc(),o=e.getCurrentRange(),a={line:o.from.line,ch:o.from.ch},r={line:o.to.line,ch:o.to.ch},l=t.altText,d=t.imageUrl;l=s(l),l=c(l),d=u(d);var f="!["+l+"]("+d+")";i.replaceRange(f,a,r,"+addImage"),n.focus()}});t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"ul")}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"ol")}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"Indent",exec:function(e){e.getEditor().execCommand("indentOrderedList")}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"Outdent",exec:function(e){e.getEditor().execCommand("indentLessOrderedList")}});t.default=a},function(e,t,n){"use strict";function i(e,t){for(var n="|",i="|",o=0;e;)t?(n+=" "+t[o]+" |",o+=1):n+=" |",i+=" --- |",e-=1;return n+"\n"+i+"\n"}function o(e,t,n){for(var i="",o=e,a=0;a<t;a+=1){i+="|";for(var r=0;r<e;r+=1)n?(i+=" "+n[o]+" |",o+=1):i+=" |";i+="\n"}return i=i.replace(/\n$/g,"")}Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=r.default.command("markdown",{name:"Table",exec:function(e,t,n,a){var r=e.getEditor(),l=r.getDoc(),s="\n";r.getCursor().ch>0&&(s+="\n"),s+=i(t,a),s+=o(t,n-1,a),l.replaceSelection(s),a||r.setCursor(r.getCursor().line-n,2),e.focus()}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(e){var t=e.getCurrentRange();e.componentManager.getManager("list").changeSyntax(t,"task")}});t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=/^`([^`]+)`$/,r=/`([^`]+)`/g,l=o.default.command("markdown",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=n.getSelection(),o=t.getCursor(),a=this.hasStrikeSyntax(i),r=void 0;a?(r=this.remove(i),r=this._removeCodeSyntax(r)):(r=this._removeCodeSyntax(i),r=this.append(r)),n.replaceSelection(r,"around"),i||a||this.setCursorToCenter(n,o,a),t.focus()},setCursorToCenter:function(e,t,n){var i=n?-1:1;e.setCursor(t.line,t.ch+i)},hasStrikeSyntax:function(e){return a.test(e)},append:function(e){return"`"+e+"`"},remove:function(e){return e.substr(1,e.length-2)},_removeCodeSyntax:function(e){return e?e.replace(r,"$1"):""}});t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("markdown",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(e){var t=e.getEditor(),n=t.getDoc(),i=e.getCurrentRange(),o=["```",n.getSelection(),"```"],a=1;0!==i.from.ch&&(o.unshift(""),a+=1),i.to.ch!==n.getLine(i.to.line).length&&o.push(""),n.replaceSelection(o.join("\n")),t.setCursor(i.from.line+a,0),t.focus()}});t.default=a},function(e,t,n){"use strict";function i(e){e.hasFormat("b")||e.hasFormat("strong")?e.changeFormat(null,{tag:"b"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.bold())}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=function(e){return e&&e.__esModule?e:{default:e}}(o),r=a.default.command("wysiwyg",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(i);var o=t.getSelection();o.collapse(!0),t.setSelection(o)}else i(t)}});t.default=r},function(e,t,n){"use strict";function i(e){e.hasFormat("i")||e.hasFormat("em")?e.changeFormat(null,{tag:"i"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.italic())}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=function(e){return e&&e.__esModule?e:{default:e}}(o),r=a.default.command("wysiwyg",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(i);var o=t.getSelection();o.collapse(!0),t.setSelection(o)}else i(t)}});t.default=r},function(e,t,n){"use strict";function i(e){e.hasFormat("S")?e.changeFormat(null,{tag:"S"}):e.hasFormat("a")||e.hasFormat("PRE")||(e.hasFormat("code")&&e.changeFormat(null,{tag:"code"}),e.strikethrough())}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=function(e){return e&&e.__esModule?e:{default:e}}(o),r=a.default.command("wysiwyg",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection");if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(i);var o=t.getSelection();o.collapse(!0),t.setSelection(o)}else i(t)}});t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(i),a=o.default.command("wysiwyg",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(e){var t=e.getEditor();e.focus(),t.hasFormat("TABLE")||t.hasFormat("PRE")||(t.hasFormat("BLOCKQUOTE")?t.decreaseQuoteLevel():t.increaseQuoteLevel())}});t.default=a},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(10),l=i(r),s=l.default.decodeURIGraceful,u=l.default.encodeMarkdownCharacters,c=a.default.command("wysiwyg",{name:"AddImage",exec:function(e,t){var n=e.getEditor(),i=t.altText,o=t.imageUrl;i=s(i),o=u(o),e.focus(),n.hasFormat("PRE")||n.insertImage(o,{alt:i})}});t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=n(10),u=i(s),c=u.default.decodeURIGraceful,d=u.default.encodeMarkdownCharacters,f=l.default.command("wysiwyg",{name:"AddLink",exec:function(e,t){var n=e.getEditor(),i=t.url,o=t.linkText;if(o=c(o),i=d(i),e.focus(),!n.hasFormat("PRE"))if(n.removeAllFormatting(),n.getSelectedText())n.makeLink(i);else{var r=n.createElement("A",{href:i});(0,a.default)(r).text(o),n.insertElement(r)}}});t.default=f},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(4),l=i(r),s=a.default.command("wysiwyg",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),i=void 0,o=void 0,a=void 0;if(n.collapsed&&!t.hasFormat("TABLE")&&!t.hasFormat("PRE")){i=l.default.getChildNodeByOffset(n.startContainer,n.startOffset),o=l.default.getTopNextNodeUnder(i,e.get$Body()[0]),o||(o=t.createDefaultBlock(),e.get$Body().append(o));var r=t.createElement("HR");t.modifyBlocks(function(e){return e.appendChild(r),e}),a=r.previousSibling,a&&l.default.isTextNode(a)&&0===l.default.getTextLength(a)&&r.parentNode.removeChild(a),n.selectNodeContents(o),n.collapse(!0),t.setSelection(n)}e.focus()}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=l.default.command("wysiwyg",{name:"Heading",exec:function(e,t){var n=e.getEditor();e.focus(),n.hasFormat("TABLE")||n.hasFormat("PRE")||n.modifyBlocks(function(e){return(0,a.default)(e).children("h1, h2, h3, h4, h5, h6, div").each(function(e,n){var i="<H"+t+" />",o=(0,a.default)(n);if(o.is("DIV"))o.wrap(i);else{var r=(0,a.default)(i);r.insertBefore(n),r.html(o.html()),o.remove()}}),e})}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=l.default.command("wysiwyg",{name:"Paragraph",exec:function(e){var t=e.getEditor();e.focus(),t.hasFormat("TABLE")||t.hasFormat("PRE")||t.modifyBlocks(function(e){var t=(0,a.default)(document.createDocumentFragment());return(0,a.default)(e).children().each(function(e,n){n.nodeName.match(/h\d/i)?t.append((0,a.default)(n).children()):n.nodeName.match(/ul|ol/i)?(0,a.default)(n).find("li").each(function(e,n){t.append((0,a.default)(n).children())}):t.append(n)}),t[0]})}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(4),l=i(r),s=a.default.command("wysiwyg",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),i=e.componentManager.getManager("list"),o=n.startContainer,a=n.endContainer,r=n.startOffset,s=n.endOffset;e.focus(),t.saveUndoState(n);for(var u=i.getLinesOfSelection(o,a),c=[],d=0;d<u.length;d+=1){var f=this._changeFormatToUnorderedListIfNeed(e,u[d]);f&&c.push(f)}if(c.length){var h=l.default.containsNode(c[0],o)?o:c[0],g=l.default.containsNode(c[c.length-1],a)?a:c[c.length-1];e.setSelectionByContainerAndOffset(h,r,g,s)}},_changeFormatToUnorderedListIfNeed:function(e,t){var n=e.getEditor(),i=n.getSelection(),o=e.componentManager.getManager("task"),a=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(i.setStart(t,0),i.collapse(!0),n.setSelection(i),n.hasFormat("LI")?(e.saveSelection(i),o.unformatTask(i.startContainer),n.replaceParent(i.startContainer,"ol","ul"),e.restoreSavedSelection()):(e.unwrapBlockTag(),n.makeUnorderedList()),a=n.getSelection().startContainer),a}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=i(o),r=n(4),l=i(r),s=a.default.command("wysiwyg",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),i=e.componentManager.getManager("list"),o=n.startContainer,a=n.startOffset,r=n.endContainer,s=n.endOffset;e.focus(),t.saveUndoState(n);for(var u=i.getLinesOfSelection(o,r),c=[],d=0;d<u.length;d+=1){var f=this._changeFormatToOrderedListIfNeed(e,u[d]);f&&c.push(f)}if(c.length){var h=l.default.containsNode(c[0],o)?o:c[0],g=l.default.containsNode(c[c.length-1],r)?r:c[c.length-1];e.setSelectionByContainerAndOffset(h,a,g,s)}},_changeFormatToOrderedListIfNeed:function(e,t){var n=e.getEditor(),i=n.getSelection(),o=e.componentManager.getManager("task"),a=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(i.setStart(t,0),i.collapse(!0),n.setSelection(i),n.hasFormat("LI")?(e.saveSelection(i),o.unformatTask(i.startContainer),n.replaceParent(i.startContainer,"ul","ol"),e.restoreSavedSelection()):(e.unwrapBlockTag(),n.makeOrderedList()),a=n.getSelection().startContainer),a}});t.default=s},function(e,t,n){"use strict";function i(e,t){var n=e.getSelection();n.selectNodeContents(t.find("th")[0]),n.collapse(!0),e.setSelection(n)}function o(e,t){for(var n="<thead><tr>",i=0;e;)n+="<th>",t&&(n+=t[i],i+=1),n+="</th>",e-=1;return n+="</tr></thead>"}function a(e,t,n){for(var i="<tbody>",o=e,a=0;a<t;a+=1){i+="<tr>";for(var r=0;r<e;r+=1)i+="<td>",n&&(i+=n[o],o+=1),i+="</td>";i+="</tr>"}return i+="</tbody>"}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),l=function(e){return e&&e.__esModule?e:{default:e}}(r),s=l.default.command("wysiwyg",{name:"Table",exec:function(e,t,n,r){var l=e.getEditor(),s=e.componentManager.getManager("table").getTableIDClassName(),u=void 0;if(!l.getSelection().collapsed||l.hasFormat("TABLE")||l.hasFormat("PRE"))return void e.focus();u='<table class="'+s+'">',u+=o(t,r),u+=a(t,n-1,r),u+="</table>",l.insertHTML(u),e.focus(),r||i(l,e.get$Body().find("."+s))}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),i=1;if(n.length>1){var o=n.first().get(0),a=n.last().get(0),r=t.getSelectionRangeFromTable(o,a);i=r.to.row-r.from.row+1}return i}function a(e){var t=e.clone(),n=c.default.browser.msie?"":"<br />";return t.find("td").html(n),t}function r(e,t){var n=e.getSelection();n.selectNodeContents(t.find("td")[0]),n.collapse(!0),e.setSelection(n)}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=i(l),u=n(1),c=i(u),d=n(2),f=i(d),h=f.default.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),i=o(e),l=void 0,u=void 0;if(e.focus(),t.hasFormat("TD")){t.saveUndoState(n),l=(0,s.default)(n.startContainer).closest("tr");for(var c=0;c<i;c+=1)u=a(l),u.insertAfter(l);r(t,u)}else if(t.hasFormat("TH")){t.saveUndoState(n),l=(0,s.default)(n.startContainer).parents("thead").next("tbody").children("tr").eq(0);for(var d=0;d<i;d+=1)u=a(l),u.insertBefore(l);r(t,u)}}});t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.componentManager.getManager("tableSelection"),n=t.getSelectedCells(),i=1;if(n.length>0){var o=n.get(0).parentNode.querySelectorAll("td, th").length;i=Math.min(o,n.length)}return i}function a(e){var t=e.startContainer;return t="TD"===v.default.getNodeName(t)||"TH"===v.default.getNodeName(t)?(0,u.default)(t):(0,u.default)(t).parentsUntil("tr")}function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=e.index(),i=void 0;e.parents("table").find("tr").each(function(e,o){for(var a="TBODY"===v.default.getNodeName(o.parentNode),r=d.default.browser.msie,l=o.children[n],s=0;s<t;s+=1)i=a?document.createElement("td"):document.createElement("th"),r||i.appendChild(document.createElement("br")),(0,u.default)(i).insertAfter(l)})}function l(e,t){var n=e.getSelection();n.selectNodeContents(t.next()[0]),n.collapse(!0),e.setSelection(n)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=i(s),c=n(1),d=i(c),f=n(2),h=i(f),g=n(4),v=i(g),p=h.default.command("wysiwyg",{name:"AddCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),i=o(e),s=void 0;e.focus(),t.hasFormat("TR")&&(t.saveUndoState(n),s=a(n),r(s,i),l(t,s))}});t.default=p},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,i){var o=n.find("td").get(0);t.setStart(o,0),t.collapse(!0),i.setLastCellNode(o),e.setSelection(t)}function a(e,t,n){var i=n.find("tbody tr").length,o=(0,s.default)(e).parents("thead").length,a=t.from.row,r=t.to.row;return o&&(a+=1),(1===a||o)&&r===i&&(r-=1),n.find("tr").slice(a,r+1)}function r(e,t,n){var i=t.getSelectedCells(),o=void 0,r=void 0;if(i.length)o=t.getSelectionRangeFromTable(i.first().get(0),i.last().get(0)),r=a(i.first()[0],o,n);else{var l=(0,s.default)(e.startContainer).closest("td,th").get(0);o=t.getSelectionRangeFromTable(l,l),r=a(l,o,n)}return r}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=i(l),u=n(2),c=i(u),d=c.default.command("wysiwyg",{name:"RemoveRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),i=(0,s.default)(n.startContainer).parents("table"),a=e.componentManager.getManager("tableSelection"),l=e.componentManager.getManager("table"),u=r(n,a,i),c=i.find("tbody tr").length;if(e.focus(),(t.hasFormat("TD")||t.hasFormat("TABLE"))&&c>1){t.saveUndoState(n);var d=u.last().next()[0]?u.last().next():u.first().prev();d.length&&o(t,n,d,l),u.remove()}a.removeClassAttrbuteFromAllCellsIfNeed()}});t.default=d},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.startContainer;return t="TD"===h.default.getNodeName(t)||"TH"===h.default.getNodeName(t)?(0,u.default)(t):(0,u.default)(t).parentsUntil("tr")}function a(e){for(var t=e.length,n=0;n<t;n+=1){e.eq(n).length>0&&r(e.eq(n))}}function r(e){var t=e.index();e.parents("table").find("tr").each(function(e,n){(0,u.default)(n).children().eq(t).remove()})}function l(e,t,n){var i=t.get(0);if(t.length&&u.default.contains(document,t)){var o=e.getSelection();o.selectNodeContents(t[0]),o.collapse(!0),e.setSelection(o),n.setLastCellNode(i)}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=i(s),c=n(2),d=i(c),f=n(4),h=i(f),g=d.default.command("wysiwyg",{name:"RemoveCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange(),i=(0,u.default)(n.startContainer).parents("table"),s=e.componentManager.getManager("table"),c=e.componentManager.getManager("tableSelection"),d=(0,u.default)(n.startContainer).closest("table").find("thead tr th").length>1;if(e.focus(),n.collapse(!0),t.setSelection(n),t.hasFormat("TR",null,n)&&d){var f=i.find("tbody tr:first td").length,h=c.getSelectedCells();if(h.length<f){t.saveUndoState(n);var g=void 0;if(h.length>1){var v=h.last(),p=h.first();g=v.next().length?v.next():p.prev(),a(h)}else{var m=o(n);g=m.next().length?m.next():m.prev(),r(m)}l(t,g,s)}}}});t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var i=n.isDivided||!1,o=n.startColumnIndex,a=n.endColumnIndex,r=e.find("tr").eq(0).find("td,th").length;e.find("tr").each(function(e,n){(0,s.default)(n).children("td,th").each(function(e,n){i&&(o<=e&&e<=r||e<=a)?(0,s.default)(n).attr("align",t):o<=e&&e<=a&&(0,s.default)(n).attr("align",t)})})}function a(e,t){var n=e.find("tr").eq(0).find("td,th").length,i=t.from,o=t.to,a=void 0,r=void 0,l=void 0;return i.row===o.row?(a=i.cell,r=o.cell):i.row<o.row&&(i.cell<=o.cell?(a=0,r=n-1):(a=i.cell,r=o.cell,l=!0)),{startColumnIndex:a,endColumnIndex:r,isDivided:l}}function r(e,t){var n=t.getSelectedCells(),i=void 0,o=void 0;if(n.length)i=t.getSelectionRangeFromTable(n.first().get(0),n.last().get(0));else{var a=e.startContainer;o=f.default.isTextNode(a)?(0,s.default)(a).parent("td,th")[0]:a,i=t.getSelectionRangeFromTable(o,o)}return i}Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),s=i(l),u=n(2),c=i(u),d=n(4),f=i(d),h=c.default.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),i=n.getSelection().cloneRange(),l=e.componentManager.getManager("tableSelection"),u=r(i,l);if(e.focus(),n.hasFormat("TR")){n.saveUndoState(i);var c=(0,s.default)(i.startContainer).parents("table");o(c,t,a(c,u))}l.removeClassAttrbuteFromAllCellsIfNeed()}});t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=l.default.command("wysiwyg",{name:"RemoveTable",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(t.hasFormat("TABLE")){t.saveUndoState(n);(0,a.default)(n.startContainer).closest("table").remove()}e.focus()}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=l.default.command("wysiwyg",{name:"Indent",exec:function(e){var t=e.componentManager.getManager("list"),n=e.getEditor().getSelection(),i=(0,a.default)(n.startContainer).closest("li"),o=void 0,r=void 0,l=void 0,s=i.prev();if(s.length&&i.length){var u=i.find("li").eq(0);e.getEditor().saveUndoState(),r=i.attr("class"),o=s.attr("class"),l=u.attr("class"),i.removeAttr("class"),s.removeAttr("class"),u.length&&!u.children("div").length&&u.removeAttr("class"),e.getEditor().increaseListLevel(),t.mergeList(i.get(0)),i.attr("class",r),s.attr("class",o),u.attr("class",l)}}});t.default=s},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){return!e.next().is("OL,UL")}function a(e){var t=e.getEditor().getSelection();return(0,l.default)(t.startContainer).closest("li")}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),l=i(r),s=n(2),u=i(s),c=u.default.command("wysiwyg",{name:"Outdent",exec:function(e){var t=a(e);if(t.length&&o(t)){e.getEditor().saveUndoState();var n=t.attr("class");e.getEditor().decreaseListLevel(),t=a(e),t.attr("class",n)}}});t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),a=i(o),r=n(2),l=i(r),s=n(4),u=i(s),c=l.default.command("wysiwyg",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(e){var t=e.getEditor(),n=t.getSelection(),i=e.componentManager.getManager("list"),o=n.startContainer,a=n.endContainer,r=n.startOffset,l=n.endOffset;e.focus(),t.saveUndoState(n);for(var s=i.getLinesOfSelection(o,a),c=[],d=0;d<s.length;d+=1){var f=this._changeFormatToTaskIfNeed(e,s[d]);f&&c.push(f)}if(c.length){var h=u.default.containsNode(c[0],o)?o:c[0],g=u.default.containsNode(c[c.length-1],a)?a:c[c.length-1];e.setSelectionByContainerAndOffset(h,r,g,l)}},_changeFormatToTaskIfNeed:function(e,t){var n=e.getEditor(),i=n.getSelection(),o=e.componentManager.getManager("task"),r=void 0;return n.hasFormat("TABLE")||n.hasFormat("PRE")||(i.setStart(t,0),i.collapse(!0),n.setSelection(i),n.hasFormat("li")||(n.makeUnorderedList(),t=n.getSelection().startContainer),(0,a.default)(t).hasClass("task-list-item")?o.unformatTask(t):o.formatTask(t),r=n.getSelection().startContainer),r}});t.default=c},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e){"CODE"===h.default.getNodeName(e.startContainer.nextSibling)&&0===h.default.getTextLength(e.startContainer.nextSibling)&&(0,l.default)(e.startContainer.nextSibling).remove()}function a(e,t){if(!t.hasFormat("PRE")&&t.hasFormat("code"))t.changeFormat(null,{tag:"code"}),o(e.getSelection().cloneRange());else if(!t.hasFormat("a")&&!t.hasFormat("PRE")){t.hasFormat("b")?t.removeBold():t.hasFormat("i")&&t.removeItalic(),t.changeFormat({tag:"code"});var n=t.getSelection().cloneRange();n.setStart(n.endContainer,n.endOffset),n.collapse(!0),t.setSelection(n)}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),l=i(r),s=n(1),u=i(s),c=n(2),d=i(c),f=n(4),h=i(f),g=d.default.command("wysiwyg",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(e){var t=e.getEditor(),n=e.componentManager.getManager("tableSelection"),i=u.default.bind(a,null,e.getEditor());if(e.focus(),t.hasFormat("table")&&n.getSelectedCells().length){n.styleToSelectedCells(i);var o=t.getSelection();o.collapse(!0),t.setSelection(o)}else i(t)}});t.default=g},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t.getEditor().getSelection().cloneRange();e.removeClass(f),n.setStartBefore(e.get(0).firstChild),n.collapse(!0),t.getEditor().setSelection(n)}function a(e,t){var n=t.componentManager.getManager("codeblock"),i=void 0;if(e.collapsed)i="<br>";else{var o=e.extractContents(),a=u.default.toArray(o.childNodes);i=(0,l.default)("<div>").append(n.prepareToPasteOnCodeblock(a)).html()}return i}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),l=i(r),s=n(1),u=i(s),c=n(2),d=i(c),f="te-content-codeblock-temp",h=d.default.command("wysiwyg",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(e,t){var n=e.getEditor(),i=n.getSelection().cloneRange();if(!n.hasFormat("PRE")&&!n.hasFormat("TABLE")){var r='data-te-codeblock class = "'+f+'"';t&&(r+=' data-language="'+t+'"');var l=a(i,e);n.insertHTML("<pre "+r+">"+l+"</pre>"),o(e.get$Body().find("."+f),e)}e.focus()}});t.default=h},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["en","en_US"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Write",Preview:"Preview",Headings:"Headings",Paragraph:"Paragraph",Bold:"Bold",Italic:"Italic",Strike:"Strike",Code:"Inline code",Line:"Line",Blockquote:"Blockquote","Unordered list":"Unordered list","Ordered list":"Ordered list",Task:"Task",Indent:"Indent",Outdent:"Outdent","Insert link":"Insert link","Insert CodeBlock":"Insert codeBlock","Insert table":"Insert table","Insert image":"Insert image",Heading:"Heading","Image URL":"Image URL","Select image file":"Select image file",Description:"Description",OK:"OK",More:"More",Cancel:"Cancel",File:"File",URL:"URL","Link text":"Link text","Add row":"Add row","Add col":"Add col","Remove row":"Remove row","Remove col":"Remove col","Align left":"Align left","Align center":"Align center","Align right":"Align right","Remove table":"Remove table","Would you like to paste as table?":"Would you like to paste as table?","Text color":"Text color","Auto scroll enabled":"Auto scroll enabled","Auto scroll disabled":"Auto scroll disabled","Choose language":"Choose language"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["ko","ko_KR"],{Markdown:"마크다운",WYSIWYG:"위지윅",Write:"편집하기",Preview:"미리보기",Headings:"제목크기",Paragraph:"본문",Bold:"굵게",Italic:"기울임꼴",Strike:"취소선",Code:"인라인 코드",Line:"문단나눔",Blockquote:"인용구","Unordered list":"글머리 기호","Ordered list":"번호 매기기",Task:"체크박스",Indent:"들여쓰기",Outdent:"내어쓰기","Insert link":"링크 삽입","Insert CodeBlock":"코드블럭 삽입","Insert table":"표 삽입","Insert image":"이미지 삽입",Heading:"제목","Image URL":"이미지 주소","Select image file":"이미지 파일을 선택하세요.",Description:"설명",OK:"확인",More:"더 보기",Cancel:"취소",File:"파일",URL:"주소","Link text":"링크 텍스트","Add row":"행 추가","Add col":"열 추가","Remove row":"행 삭제","Remove col":"열 삭제","Align left":"왼쪽 정렬","Align center":"가운데 정렬","Align right":"오른쪽 정렬","Remove table":"표 삭제","Would you like to paste as table?":"표형태로 붙여 넣겠습니까?","Text color":"글자 색상","Auto scroll enabled":"자동 스크롤 켜짐","Auto scroll disabled":"자동 스크롤 꺼짐","Choose language":"언어 선택"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["zh","zh_CN"],{Markdown:"Markdown",WYSIWYG:"所见即所得",Write:"编辑",Preview:"预览",Headings:"标题",Paragraph:"文本",Bold:"加粗",Italic:"斜体字",Strike:"删除线",Code:"内嵌代码",Line:"水平线",Blockquote:"引用块","Unordered list":"无序列表","Ordered list":"有序列表",Task:"任务",Indent:"缩进",Outdent:"减少缩进","Insert link":"插入链接","Insert CodeBlock":"插入代码块","Insert table":"插入表格","Insert image":"插入图片",Heading:"标题","Image URL":"图片网址","Select image file":"选择图片文件",Description:"说明",OK:"确认",More:"更多",Cancel:"取消",File:"文件",URL:"URL","Link text":"链接文本","Add row":"添加行","Add col":"添加列","Remove row":"删除行","Remove col":"删除列","Align left":"左对齐","Align center":"居中对齐","Align right":"右对齐","Remove table":"删除表格","Would you like to paste as table?":"需要粘贴为表格吗?","Text color":"文字颜色","Auto scroll enabled":"自动滚动已启用","Auto scroll disabled":"自动滚动已禁用","Choose language":"选择语言"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["ja","ja_JP"],{Markdown:"マークダウン",WYSIWYG:"WYSIWYG",Write:"編集する",Preview:"プレビュー",Headings:"見出し",Paragraph:"本文",Bold:"太字",Italic:"イタリック",Strike:"ストライク",Code:"インラインコード",Line:"ライン",Blockquote:"引用","Unordered list":"番号なしリスト","Ordered list":"順序付きリスト",Task:"タスク",Indent:"インデント",Outdent:"アウトデント","Insert link":"リンク挿入","Insert CodeBlock":"コードブロック挿入","Insert table":"テーブル挿入","Insert image":"画像挿入",Heading:"見出し","Image URL":"イメージURL","Select image file":"画像ファイル選択",Description:"ディスクリプション ",OK:"はい",More:"もっと",Cancel:"キャンセル",File:"ファイル",URL:"URL","Link text":"リンクテキスト","Add row":"行追加","Add col":"列追加","Remove row":"行削除","Remove col":"列削除","Align left":"左揃え","Align center":"中央揃え","Align right":"右揃え","Remove table":"テーブル削除","Would you like to paste as table?":"テーブルを貼り付けますか?","Text color":"文字色相","Auto scroll enabled":"自動スクロールが有効","Auto scroll disabled":"自動スクロールを無効に","Choose language":"言語選択"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["nl","nl_NL"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Opslaan",Preview:"Voorbeeld",Headings:"Koppen",Paragraph:"Alinea",Bold:"Vet",Italic:"Cursief",Strike:"Doorhalen",Code:"Inline code",Line:"Regel",Blockquote:"Citaatblok","Unordered list":"Opsomming","Ordered list":"Genummerde opsomming",Task:"Taak",Indent:"Niveau verhogen",Outdent:"Niveau verlagen","Insert link":"Link invoegen","Insert CodeBlock":"Codeblok toevoegen","Insert table":"Tabel invoegen","Insert image":"Afbeelding invoegen",Heading:"Kop","Image URL":"Afbeelding URL","Select image file":"Selecteer een afbeelding",Description:"Omschrijving",OK:"OK",More:"Meer",Cancel:"Annuleren",File:"Bestand",URL:"URL","Link text":"Link tekst","Add row":"Rij toevoegen","Add col":"Kolom toevoegen","Remove row":"Rij verwijderen","Remove col":"Kolom verwijderen","Align left":"Links uitlijnen","Align center":"Centreren","Align right":"Rechts uitlijnen","Remove table":"Verwijder tabel","Would you like to paste as table?":"Wil je dit als tabel plakken?","Text color":"Tekstkleur","Auto scroll enabled":"Autoscroll ingeschakeld","Auto scroll disabled":"Autoscroll uitgeschakeld","Choose language":"Kies een taal"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["es","es_ES"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Escribir",Preview:"Vista previa",Headings:"Encabezados",Paragraph:"Párrafo",Bold:"Negrita",Italic:"Itálica",Strike:"Tachado",Code:"Código",Line:"Línea",Blockquote:"Cita","Unordered list":"Lista desordenada","Ordered list":"Lista ordenada",Task:"Tarea",Indent:"Sangría",Outdent:"Saliendo","Insert link":"Insertar enlace","Insert CodeBlock":"Insertar bloque de código","Insert table":"Insertar tabla","Insert image":"Insertar imagen",Heading:"Encabezado","Image URL":"URL de la imagen","Select image file":"Seleccionar archivo de imagen",Description:"Descripción",OK:"Aceptar",More:"Más",Cancel:"Cancelar",File:"Archivo",URL:"URL","Link text":"Texto del enlace","Add row":"Agregar fila","Add col":"Agregar columna","Remove row":"Eliminar fila","Remove col":"Eliminar columna","Align left":"Alinear a la izquierda","Align center":"Centrar","Align right":"Alinear a la derecha","Remove table":"Eliminar tabla","Would you like to paste as table?":"¿Desea pegar como tabla?","Text color":"Color del texto","Auto scroll enabled":"Desplazamiento automático habilitado","Auto scroll disabled":"Desplazamiento automático deshabilitado","Choose language":"Elegir idioma"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["de","de_DE"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Verfassen",Preview:"Vorschau",Headings:"Überschriften",Paragraph:"Text",Bold:"Fett",Italic:"Kursiv",Strike:"Durchgestrichen",Code:"Code",Line:"Trennlinie",Blockquote:"Blocktext","Unordered list":"Aufzählung","Ordered list":"Nummerierte Aufzählung",Task:"Aufgabe",Indent:"Einrücken",Outdent:"Ausrücken","Insert link":"Link einfügen","Insert CodeBlock":"Codeblock einfügen","Insert table":"Tabelle einfügen","Insert image":"Grafik einfügen",Heading:"Titel","Image URL":"Bild URL","Select image file":"Grafik auswählen",Description:"Beschreibung",OK:"OK",More:"Mehr",Cancel:"Abbrechen",File:"Datei",URL:"URL","Link text":"Anzuzeigender Text","Add row":"Zeile hinzufügen","Add col":"Spalte hinzufügen","Remove row":"Zeile entfernen","Remove col":"Spalte entfernen","Align left":"Links ausrichten","Align center":"Zentrieren","Align right":"Rechts ausrichten","Remove table":"Tabelle entfernen","Would you like to paste as table?":"Möchten Sie eine Tabelle einfügen?","Text color":"Textfarbe","Auto scroll enabled":"Autoscrollen aktiviert","Auto scroll disabled":"Autoscrollen deaktiviert","Choose language":"Sprache auswählen"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["ru","ru_RU"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написать",Preview:"Предварительный просмотр",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирный",Italic:"Курсив",Strike:"Зачеркнутый",Code:"Встроенный код",Line:"Строка",Blockquote:"Блок цитирования","Unordered list":"Неупорядоченный список","Ordered list":"Упорядоченный список",Task:"Задача",Indent:"отступ",Outdent:"Выступ","Insert link":"Вставить ссылку","Insert CodeBlock":"Вставить код","Insert table":"Вставить таблицу","Insert image":"Вставить изображение",Heading:"Заголовок","Image URL":"URL изображения","Select image file":"Выбрать файл изображения",Description:"Описание",OK:"Хорошо",More:"еще",Cancel:"Отмена",File:"Файл",URL:"URL","Link text":"Текст ссылки","Add row":"Добавить ряд","Add col":"Добавить столбец","Remove row":"Удалить ряд","Remove col":"Удалить столбец","Align left":"Выровнять по левому краю","Align center":"Выровнять по центру","Align right":"Выровнять по правому краю","Remove table":"Удалить таблицу","Would you like to paste as table?":"Вы хотите вставить в виде таблицы?","Text color":"Цвет текста","Auto scroll enabled":"Автоматическая прокрутка включена","Auto scroll disabled":"Автоматическая прокрутка отключена","Choose language":"Выбрать язык"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["fr","fr_FR"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Écrire",Preview:"Aperçu",Headings:"En-têtes",Paragraph:"Paragraphe",Bold:"Gras",Italic:"Italique",Strike:"Barré",Code:"Code en ligne",Line:"Ligne",Blockquote:"Citation","Unordered list":"Liste non-ordonnée","Ordered list":"Liste ordonnée",Task:"Tâche",Indent:"Retrait",Outdent:"Sortir","Insert link":"Insérer un lien","Insert CodeBlock":"Insérer un bloc de code","Insert table":"Insérer un tableau","Insert image":"Insérer une image",Heading:"En-tête","Image URL":"URL de l'image","Select image file":"Sélectionnez un fichier image",Description:"Description",OK:"OK",More:"de plus",Cancel:"Annuler",File:"Fichier",URL:"URL","Link text":"Texte du lien","Add row":"Ajouter une ligne","Add col":"Ajouter une colonne","Remove row":"Supprimer une ligne","Remove col":"Supprimer une colonne","Align left":"Aligner à gauche","Align center":"Aligner au centre","Align right":"Aligner à droite","Remove table":"Supprimer le tableau","Would you like to paste as table?":"Voulez-vous coller ce contenu en tant que tableau ?","Text color":"Couleur du texte","Auto scroll enabled":"Défilement automatique activé","Auto scroll disabled":"Défilement automatique désactivé","Choose language":"Choix de la langue"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["uk","uk_UA"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написати",Preview:"Попередній перегляд",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирний",Italic:"Курсив",Strike:"Закреслений",Code:"Вбудований код",Line:"Лінія",Blockquote:"Блок цитування","Unordered list":"Невпорядкований список","Ordered list":"Упорядкований список",Task:"Завдання",Indent:"відступ",Outdent:"застарілий","Insert link":"Вставити посилання","Insert CodeBlock":"Вставити код","Insert table":"Вставити таблицю","Insert image":"Вставити зображення",Heading:"Заголовок","Image URL":"URL зображення","Select image file":"Вибрати файл зображення",Description:"Опис",OK:"OK",More:"ще",Cancel:"Скасувати",File:"Файл",URL:"URL","Link text":"Текст посилання","Add row":"Додати ряд","Add col":"Додати стовпчик","Remove row":"Видалити ряд","Remove col":"Видалити стовпчик","Align left":"Вирівняти по лівому краю","Align center":"Вирівняти по центру","Align right":"Вирівняти по правому краю","Remove table":"Видалити таблицю","Would you like to paste as table?":"Ви хочете вставити у вигляді таблиці?","Text color":"Колір тексту","Auto scroll enabled":"Автоматична прокрутка включена","Auto scroll disabled":"Автоматична прокрутка відключена","Choose language":"Вибрати мову"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["tr","tr_TR"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Düzenle",Preview:"Ön izleme",Headings:"Başlıklar",Paragraph:"Paragraf",Bold:"Kalın",Italic:"İtalik",Strike:"Altı çizgili",Code:"Satır içi kod",Line:"Çizgi",Blockquote:"Alıntı","Unordered list":"Sıralanmamış liste","Ordered list":"Sıralı liste",Task:"Görev kutusu",Indent:"Girintiyi arttır",Outdent:"Girintiyi azalt","Insert link":"Bağlantı ekle","Insert CodeBlock":"Kod bloku ekle","Insert table":"Tablo ekle","Insert image":"İmaj ekle",Heading:"Başlık","Image URL":"İmaj URL","Select image file":"İmaj dosyası seç",Description:"Açıklama",OK:"Onay",More:"Daha Fazla",Cancel:"İptal",File:"Dosya",URL:"URL","Link text":"Bağlantı yazısı","Add row":"Satır ekle","Add col":"Sütun ekle","Remove row":"Satır sil","Remove col":"Sütun sil","Align left":"Sola hizala","Align center":"Merkeze hizala","Align right":"Sağa hizala","Remove table":"Tabloyu kaldır","Would you like to paste as table?":"Tablo olarak yapıştırmak ister misiniz?","Text color":"Metin rengi","Auto scroll enabled":"Otomatik kaydırma açık","Auto scroll disabled":"Otomatik kaydırma kapalı","Choose language":"Dil seçiniz"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["fi","fi_FI"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Kirjoita",Preview:"Esikatselu",Headings:"Otsikot",Paragraph:"Kappale",Bold:"Lihavointi",Italic:"Kursivointi",Strike:"Yliviivaus",Code:"Koodi",Line:"Vaakaviiva",Blockquote:"Lainaus","Unordered list":"Luettelo","Ordered list":"Numeroitu luettelo",Task:"Tehtävä",Indent:"Suurenna sisennystä",Outdent:"Pienennä sisennystä","Insert link":"Lisää linkki","Insert CodeBlock":"Lisää koodia","Insert table":"Lisää taulukko","Insert image":"Lisää kuva",Heading:"Otsikko","Image URL":"Kuvan URL","Select image file":"Valitse kuvatiedosto",Description:"Kuvaus",OK:"OK",More:"Lisää",Cancel:"Peruuta",File:"Tiedosto",URL:"URL","Link text":"Linkkiteksti","Add row":"Lisää rivi","Add col":"Lisää sarake","Remove row":"Poista rivi","Remove col":"Poista sarake","Align left":"Tasaus vasemmalle","Align center":"Keskitä","Align right":"Tasaus oikealle","Remove table":"Poista taulukko","Would you like to paste as table?":"Haluatko liittää taulukkomuodossa?","Text color":"Tekstin väri","Auto scroll enabled":"Automaattinen skrollaus käytössä","Auto scroll disabled":"Automaattinen skrollaus pois käytöstä","Choose language":"Valitse kieli"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["cs","cs_CZ"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Napsat",Preview:"Náhled",Headings:"Nadpisy",Paragraph:"Odstavec",Bold:"Tučné",Italic:"Kurzíva",Strike:"Přeškrtnuté",Code:"Kód",Line:"Vodorovná čára",Blockquote:"Citace","Unordered list":"Seznam s odrážkami","Ordered list":"Číslovaný seznam",Task:"Úkol",Indent:"Zvětšit odsazení",Outdent:"Zmenšit odsazení","Insert link":"Vložit odkaz","Insert CodeBlock":"Vložit blok kódu","Insert table":"Vložit tabulku","Insert image":"Vložit obrázek",Heading:"Nadpis","Image URL":"URL obrázku","Select image file":"Vybrat obrázek",Description:"Popis",OK:"OK",More:"Více",Cancel:"Zrušit",File:"Soubor",URL:"URL","Link text":"Text odkazu","Add row":"Přidat řádek","Add col":"Přidat sloupec","Remove row":"Odebrat řádek","Remove col":"Odebrat sloupec","Align left":"Zarovnat vlevo","Align center":"Zarovnat na střed","Align right":"Zarovnat vpravo","Remove table":"Odstranit tabulku","Would you like to paste as table?":"Chcete vložit jako tabulku?","Text color":"Barva textu","Auto scroll enabled":"Automatické rolování zapnuto","Auto scroll disabled":"Automatické rolování vypnuto","Choose language":"Vybrat jazyk"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["ar","ar_AR"],{Markdown:"لغة ترميز",WYSIWYG:"ما تراه هو ما تحصل عليه",Write:"يكتب",Preview:"عرض مسبق",Headings:"العناوين",Paragraph:"فقرة",Bold:"خط عريض",Italic:"خط مائل",Strike:"إضراب",Code:"رمز",Line:"خط",Blockquote:"فقرة مقتبسة","Unordered list":"قائمة غير مرتبة","Ordered list":"قائمة مرتبة",Task:"مهمة",Indent:"المسافة البادئة",Outdent:"المسافة الخارجة","Insert link":"أدخل الرابط","Insert CodeBlock":"أدخل الكود","Insert table":"أدخل جدول","Insert image":"أدخل صورة",Heading:"عنوان","Image URL":"رابط الصورة","Select image file":"حدد ملف الصورة",Description:"وصف",OK:"موافقة",More:"أكثر",Cancel:"إلغاء",File:"ملف",URL:"رابط","Link text":"نص الرابط","Add row":"ضف سطر","Add col":"ضف عمود","Remove row":"حذف سطر","Remove col":"حذف عمود","Align left":"محاذاة اليسار","Align center":"محاذاة الوسط","Align right":"محاذاة اليمين","Remove table":"حذف الجدول","Would you like to paste as table?":"هل تريد اللصق كجدول","Text color":"لون النص","Auto scroll enabled":"التحريك التلقائي ممكّن","Auto scroll disabled":"التحريك التلقائي معطّل","Choose language":"اختر اللغة"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["pl","pl_PL"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Napisz",Preview:"Podgląd",Headings:"Nagłówki",Paragraph:"Akapit",Bold:"Pogrubienie",Italic:"Kursywa",Strike:"Przekreślenie",Code:"Fragment kodu",Line:"Linia",Blockquote:"Cytat","Unordered list":"Lista nieuporządkowana","Ordered list":"Lista uporządkowana",Task:"Zadanie",Indent:"Utwórz wcięcie",Outdent:"Usuń wcięcie","Insert link":"Umieść odnośnik","Insert CodeBlock":"Umieść blok kodu","Insert table":"Umieść tabelę","Insert image":"Umieść obraz",Heading:"Nagłówek","Image URL":"Adres URL obrazu","Select image file":"Wybierz plik obrazu",Description:"Opis",OK:"OK",More:"Więcej",Cancel:"Anuluj",File:"Plik",URL:"URL","Link text":"Tekst odnośnika","Add row":"Dodaj rząd","Add col":"Dodaj kolumnę","Remove row":"Usuń rząd","Remove col":"Usuń kolumnę","Align left":"Wyrównaj do lewej","Align center":"Wyśrodkuj","Align right":"Wyrównaj do prawej","Remove table":"Usuń tabelę","Would you like to paste as table?":"Czy chcesz wkleić tekst jako tabelę?","Text color":"Kolor tekstu","Auto scroll enabled":"Włączono automatyczne przewijanie","Auto scroll disabled":"Wyłączono automatyczne przewijanie","Choose language":"Wybierz język"})},function(e,t,n){"use strict";var i=n(3);(function(e){return e&&e.__esModule?e:{default:e}})(i).default.setLanguage(["zhtw","zh_TW"],{Markdown:"Markdown",WYSIWYG:"所見即所得",Write:"編輯",Preview:"預覽",Headings:"標題",Paragraph:"內文",Bold:"粗體",Italic:"斜體",Strike:"刪除線",Code:"內嵌程式碼",Line:"分隔線",Blockquote:"引言","Unordered list":"項目符號清單","Ordered list":"編號清單",Task:"核取方塊清單",Indent:"增加縮排",Outdent:"減少縮排","Insert link":"插入超連結","Insert CodeBlock":"插入程式碼區塊","Insert table":"插入表格","Insert image":"插入圖片",Heading:"標題","Image URL":"圖片網址","Select image file":"選擇圖片檔案",Description:"描述",OK:"確認",More:"更多",Cancel:"取消",File:"檔案",URL:"URL","Link text":"超連結文字","Add row":"增加行","Add col":"增加列","Remove row":"刪除行","Remove col":"刪除列","Align left":"靠左對齊","Align center":"置中","Align right":"靠右對齊","Remove table":"刪除表格","Would you like to paste as table?":"您要以表格貼上嗎?","Text color":"文字顏色","Auto scroll enabled":"已啟用自動滾動","Auto scroll disabled":"已停用自動滾動","Choose language":"選擇語言"})}])});