/*! * tui-editor * @version 1.3.3 * @author NHN Ent. FE Development Lab (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;n1&&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;o1?a-1:0),l=1;l=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\n \n
\n \n
\n \n
',p='
\n
\n \n
\n \n
\n
\n
\n
',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,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var a=function(){function e(e,t){for(var n=0;n0&&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)("
");return e=e.replace(//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/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(e){return e.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;n0&&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\n/g,"
"))}),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'),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=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/gi,"
");for(var t=/(]*)(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(/
/gi,"
");for(var t=/(]*)(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)("
");return t.html(e),t.find("code, pre").each(function(e,t){var n=(0,l.default)(t);n.html(n.html().replace(/<br data-tomark-pass>/,"<br>"))}),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;/`[^`]*
[^`]*`/gi.test(e)||i.test(e)||(e=e.replace(/
/gi,"
\n")),n[t]=e}),n.join("\n")}},{key:"_appendAttributeForBrIfNeed",value:function(e){var t=/
/gi,n=/

/gi,i=/

(.)/gi,o=/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|]*>)/,a=/

/,r=new RegExp(o.source+a.source,"g");e=e.replace(t,"
"),e=e.replace(n,"

");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(/
/gi,"
"),e=e.replace(t,"
"),e=e.replace(i,"

$1"),e=e.replace(r,"$1

")}}],[{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;n0&&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","?","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/g,">").replace(/"/g,""").replace(/'/g,"'")}var r=function(e){e.core.ruler.after("block","tui-code-block",function(e){var t,n,r,l=e.tokens;for(n=0;n3&&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=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,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=S));f++)if(62!==e.src.charCodeAt(T++)||E){if(c)break;for(k=!1,l=0,u=w.length;l=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);in)return!1;if(c=t+1,e.sCount[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;uv)return!1;if(f|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^<("+i.join("|")+")","i"),/^\/?>$/,!0],[new RegExp("^|$))","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;a18;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;n1&&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
",i="",o=0;o",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(/
(<\/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)("
")[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)("

").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?"":"
",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?"":"
";(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)("");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)("");i.html(n.html()),i.insertBefore(t),n.detach()}),t.length){var o=(0,s.default)("");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)("
"),o=void 0;return!n.length&&t.length?(i.append(t[0]),i.append(""),o=i.get(0)):n.length&&!t.length?(i.append(""),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").get(0),e.prepend(i)):n&&(i=(0,s.default)("").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)(""),n=(0,s.default)("");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)(""),n=(0,s.default)("");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)(""),i=(0,s.default)(""),o=void 0,r=void 0;return"TH"===t.children()[0].tagName?(o=e,r=(0,s.default)(""+a(t.find("th").length,"td")+"").get(0)):(o=(0,s.default)(""+a(t.find("td").length,"th")+"").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)("")[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?"":"
";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+"")[0])})}},{key:"_appendRow",value:function(e,t){var n=e.find("tr").last().clone(),i=h?"":"
";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"))}},{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;n0;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&&ts||er?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",v={"&":"&","<":"<",">":">"},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(/((.|\n)*?)<\/pre>/g,function(e,t,n){return"
"+n+"
"})}},{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;n1&&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&&e1&&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)('
');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;n0&&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'+t[o]+"");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;l1&&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;n0,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=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)=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=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.lengthh&&(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\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;n0)a(e,u,c,-1);else if(!i(l)){var d=u.line0){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?!@#$%^&*()_=+\\\/'";: \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?a0;)if(a=n?a+1:a-1,(r=this._getListDepth(a))===t)o.push(a);else if(r0&&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(
|
)<\/\1>/gi,U=/(?:
|
)<\/(.+?)>/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)("
");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(/
( *)
$1B|>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("
")})}},{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+">":"
"}),e=e.replace(U,""),e=e.replace(/]*>/g,""),e=e.replace(/<\/div>/g,"
"),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");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)("
").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)("
").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"),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)("
"),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)("
")[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-1&&i>-1&&(e=e.slice(n+"\x3c!--StartFragment--\x3e".length,i)),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e=""+e+""),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e=""+e+"
"),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(
|
){0,}<\1>/g,":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")})}}]),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.html(e),t.find("p").each(function(e,t){var n=t.innerHTML,i=n.split(/
/gi),o=i.length-1,a=t.nextElementSibling||t.nextSibling,l="";l=i.map(function(e,t){var n="";return t>0&&t"),e&&(n="
"+e+"
"),n}),a&&"P"===a.nodeName&&l.push("

"),(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("
"),(0,r.default)(t).next().is("p")&&(0,r.default)(t).append("

")})}},{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")})}},{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)("

").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;n1)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;n0&&e.setStart(e.startContainer,e.startOffset-1)}},{key:"expandEndOffset",value:function(){var e=this._range;u.default.isTextNode(e.endContainer)&&e.endOffsettext"),this.$el.append(this._$languageLabel),this._$buttonOpenModalEditor=(0,c.default)(''),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'),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','
','
','
','
',"
",'
','
',"
","
"].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\n
\n
\n
\n
\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;nn}).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;o0},_.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);n0};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'+v.default.get("Markdown")+""),this._buttons.$wysiwyg=(0,u.default)('"),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\n \n \n \n
\n \n \n
\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
\n
\n \n \n
\n
\n \n \n
\n \n \n
\n \n \n
\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\n \n \n \n
\n \n \n \n
\n \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\n
\n
\n
\n
\n

\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\n
  • '+p.default.get("Heading")+' 2

  • \n
  • '+p.default.get("Heading")+' 3

  • \n
  • '+p.default.get("Heading")+' 4

  • \n
  • '+p.default.get("Heading")+' 5
  • \n
  • '+p.default.get("Heading")+' 6
  • \n
  • '+p.default.get("Paragraph")+"
  • \n \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'+e+"")}),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\n \n \n \n',L=function(e){function t(e){o(this,t);var n='\n
    \n
    \n \n \n
    \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;n3&&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,ir&&(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;n0&&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').get(0),this._wrapper=(0,l.default)('').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})},_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;a0&&(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="",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",t&&(n+=t[i],i+=1),n+="",e-=1;return n+=""}function a(e,t,n){for(var i="",o=e,a=0;a";for(var r=0;r",n&&(i+=n[o],o+=1),i+="";i+=""}return i+=""}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='',u+=o(t,r),u+=a(t,n-1,r),u+="
    ",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?"":"
    ";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;c0){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;s1){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;n0&&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.length1){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").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("
    "+l+"
    "),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":"選擇語言"})}])});