UNPKG

tui-editor

Version:

GFM Markdown Wysiwyg Editor - Productive and Extensible

7 lines 469 kB
/*! * tui-editor * @version 1.4.6 * @author NHN FE Development Lab <dl_javascript@nhn.com> (https://nhn.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("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","codemirror","to-mark","tui-chart","squire-rte","markdown-it","highlight.js","tui-color-picker","plantuml-encoder"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):(e.tui=e.tui||{},e.tui.Editor=t(e.$,e.tui&&e.tui.util,e.CodeMirror,e.toMark,e.tui&&e.tui.chart,e.Squire,e.markdownit,e.hljs,e.tui&&e.tui.colorPicker,e.plantumlEncoder))}("undefined"!=typeof self?self:this,function(e,t,n,r,i,o,a,l,s,u){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=55)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),s=n(1),u=r(s),c=n(84),d=r(c),f=n(38),h=f.isMac?1:0,g=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(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 o(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,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];r.length&&(t=e.command.apply(e,[t].concat(r))),t=this._addCommandBefore(t);var o=t.getName(),a=void 0;return t.isMDType()?a=this._mdCommand:t.isWWType()?a=this._wwCommand:t.isGlobalType()&&(a=this._command),a.set(o,t),t.keyMap&&(this.keyMapCommand[t.keyMap[h]]=o),t}},{key:"_initEvent",value:function(){var e=this;this.base.eventManager.listen("command",function(){e.exec.apply(e,arguments)}),this.base.eventManager.listen("keyMap",function(t){if(e._options.useCommandShortcut){var n=e.keyMapCommand[t.keyMap];n&&(t.data.preventDefault(),e.exec(n))}})}},{key:"exec",value:function(e){var t=void 0,n=void 0,r=this.base;if(t=this._command.get(e),t||(this.base.isMarkdownMode()?(t=this._mdCommand.get(e),r=this.base.mdEditor):(t=this._wwCommand.get(e),r=this.base.wwEditor)),t){for(var i,o=arguments.length,a=Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];a.unshift(r),n=(i=t).exec.apply(i,a)}return n}}]),e}();g.command=function(e,t){var n=d.default.factory(e,t.name,t.keyMap);return u.default.extend(n,t),n},t.default=g},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.I18n=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=function(e){return e&&e.__esModule?e:{default:e}}(o),l=void 0,s="en_US",u=function(){function e(){r(this,e),this._code=s,this._langs=new a.default.Map}return i(e,[{key:"setCode",value:function(e){this._code=e}},{key:"setLanguage",value:function(e,t){var n=this;e=[].concat(e),e.forEach(function(e){if(n._langs.has(e)){var r=n._langs.get(e);n._langs.set(e,a.default.extend(r,t))}else n._langs.set(e,t)})}},{key:"get",value:function(e,t){t||(t=this._code);var n=this._langs.get(t);n||(n=this._langs.get(s));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r}}],[{key:"getSharedInstance",value:function(){return l||(l=new e),l}}]),e}();t.I18n=u,t.default=new u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=r(i),a=n(1),l=r(a),s=/\u200B/g,u=function(e){return e&&e.nodeType===Node.TEXT_NODE},c=function(e){return e&&e.nodeType===Node.ELEMENT_NODE},d=function(e){return/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|DETAILS|DIALOG|DD|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[\d]|HEADER|HGROUP|HR|LI|MAIN|NAV|OL|P|PRE|SECTION|UL)$/gi.test(this.getNodeName(e))},f=function(e){return c(e)?e.tagName:"TEXT"},h=function(e){var t=void 0;return c(e)?t=e.textContent.replace(s,"").length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},g=function(e){var t=void 0;return c(e)?t=e.childNodes.length:u(e)&&(t=e.nodeValue.replace(s,"").length),t},p=function(e){var t=e.parentNode.childNodes,n=void 0,r=void 0,i=void 0;for(n=0,r=t.length;n<r;n+=1)if(t[n]===e){i=n;break}return i},v=function(e,t){var n=void 0;return u(e)?n=e:e.childNodes.length&&t>=0&&(n=e.childNodes[t]),n},m=function(e,t,n){for(var r=e+"Sibling",i=void 0,o=void 0;t&&!t[r]&&(i=f(t.parentNode))!==n&&"BODY"!==i;)t=t.parentNode;return t[r]&&(o=t[r]),o},y=function(e,t,n){return t>0?v(e,t-1):m("previous",e,n)},b=function(e,t,n){for(var r=void 0;e.parentNode&&!t(e.parentNode)&&(e=e.parentNode,!n||!n(e.parentNode)););return t(e.parentNode)&&(r=e),r},_=function(e,t){return l.default.isString(t)?b(e,function(e){return t===f(e)}):b(e,function(e){return t===e})},w=function(e,t,n){var r=e+"Sibling",i=void 0;return t=_(t,n),t&&t[r]&&(i=t[r]),i},k=function(e,t){return w("previous",e,t)},E=function(e,t){return w("next",e,t)},C=function(e){return _(e,"BODY")},T=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},S=function(e,t){for(var n=document.createTreeWalker(e,4,null,!1),r=e===t;!r&&n.nextNode();)r=n.currentNode===t;return r},M=function(e,t,n){var r=[],i="",o=0,a=void 0;if(!t.length)return r;for(var s=t.shift(),u=document.createTreeWalker(e,4,null,!1);u.nextNode();){for(i=u.currentNode.nodeValue||"",n&&(i=n(i)),a=o+i.length;a>=s;){if(r.push({container:u.currentNode,offsetInContainer:s-o,offset:s}),!t.length)return r;s=t.shift()}o=a}do{r.push({container:u.currentNode,offsetInContainer:i.length,offset:s}),s=t.shift()}while(!l.default.isUndefined(s));return r},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},x=function(e,t){for(var n=[];e&&e!==t;)c(e)&&n.unshift(O(e)),e=e.parentNode;return n},L=function(e,t){var n=null;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t||(n="next"===t?e.nextElementSibling:e.previousElementSibling),n},I=function(e,t,n){var r=null,i=void 0,a=void 0,s=void 0,u=void 0,c=void 0,d=void 0;return l.default.isUndefined(t)||"next"!==t&&"previous"!==t||e&&(i=(0,o.default)(e),"next"===t?(s=i.parent().next(),u=i.parents("thead"),c=u[0]&&u.next(),d=c&&"TBODY"===f(c[0]),a=0):(s=i.parent().prev(),u=i.parents("tbody"),c=u[0]&&u.prev(),d=c&&"THEAD"===f(c[0]),a=e.parentNode.childNodes.length-1),!l.default.isUndefined(n)&&n||(a=p(e)),s[0]?r=s.children("td,th")[a]:u[0]&&d&&(r=c.find("td,th")[a])),r},A=function(e){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(e.nodeName)},N=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 r=t;if(r&&e===r.parentNode)for(;r!==n;){var i=r.nextSibling;e.removeChild(r),r=i}},R=function(e,t,n){for(var r=t;r!==e;){var i=r.parentNode,o=r,a=o.nextSibling,l=o.previousSibling;!n&&a?P(i,a,null):n&&l&&P(i,i.childNodes[0],r),r=i}},B=function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t,r=n.firstChild;t=u(r)&&!h(r)?r.nextSibling||r:r}return t},D=function(e,t,n){var r={left:parseInt(e.left,10),top:parseInt(e.top,10),width:parseInt(e.width,10),height:parseInt(e.height,10)};return t>=r.left&&t<=r.left+r.width&&n>=r.top&&n<=r.top+r.height},j=function(e){return!!e&&("UL"===e.nodeName||"OL"===e.nodeName)},U=function(e){var t=e.nodeName,n=e.parentNode;return"LI"===t&&e===n.firstChild},H=function(e){var t=e.nodeName,n=e.parentNode,r=n.parentNode;return"LI"===t&&!j(r)},$=function(e,t){e.hasChildNodes()&&(l.default.forEachArray(e.childNodes,function(){t.appendChild(e.firstChild)}),t.normalize()),e.parentNode&&e.parentNode.removeChild(e)},F=function(){var e=document.createElement("div"),t=document.createElement("hr");return e.setAttribute("contenteditable",!1),t.setAttribute("contenteditable",!1),e.appendChild(t),e},W=function(){var e=document.createElement("div");return e.appendChild(document.createElement("br")),e},q=function(e,t){if("SPAN"!==e.nodeName)for(var n=e.parentNode,r=e;r.childNodes&&1===r.childNodes.length&&!u(r.firstChild)&&(r=r.firstChild,"SPAN"!==r.nodeName);)if(r.nodeName===t){var i=document.createElement(t);return $(r,r.parentNode),n.replaceChild(i,e),i.appendChild(e),i}return e},z=function(e,t,n){var r=q(e,n);if(r.nodeName===n)for(var i=q(t,n),o=r,a=r.nextSibling;a;){var l=a.nextSibling;if(a=q(a,n),a.nodeName===n?o?$(a,o):o=a:o=null,a===i)break;a=l}},V=function(e,t){var n=e.collapsed,r=e.commonAncestorContainer,i=e.startContainer,o=e.endContainer;if(!n){var a=null;if(i!==o?(z(_(i,r),_(o,r),t),a=r):u(i)&&(a=i.parentNode),a&&a.nodeName===t){var l=a,s=l.previousSibling,c=void 0;s&&(c=q(s),c.nodeName===t&&$(a,c));var d=a,f=d.nextSibling;f&&(c=q(f),c.nodeName===t&&$(c,a))}}},Y=function(e){for(var t=document.createTreeWalker(e,4,null,!1),n=[];t.nextNode();){var r=t.currentNode;u(r)&&n.push(r)}return n};t.default={getNodeName:f,isTextNode:u,isElemNode:c,isBlockNode:d,getTextLength:h,getOffsetLength:g,getPrevOffsetNodeUntil:y,getNodeOffsetOfParent:p,getChildNodeByOffset:v,getNodeWithDirectionUntil:m,containsNode:S,getTopPrevNodeUnder:k,getTopNextNodeUnder:E,getParentUntilBy:b,getParentUntil:_,getTopBlockNode:C,getPrevTextNode:T,findOffsetNode:M,getPath:x,getNodeInfo:O,getTableCellByDirection:L,getSiblingRowCellByDirection:I,isMDSupportInlineNode:A,isStyledNode:N,removeChildFromStartToEndNode:P,removeNodesByDirection:R,getLeafNode:B,isInsideTaskBox:D,isListNode:j,isFirstListItem:U,isFirstLevelListItem:H,mergeNode:$,createHorizontalRule:F,createEmptyLine:W,changeTagOrder:q,mergeSameNodes:z,optimizeRange:V,getAllTextNode:Y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0;try{r=n(29)}catch(e){}if(!r)try{r=n(!function(){var e=new Error('Cannot find module "../viewer"');throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}t.default=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=(0,_.default)(e),i=r.attr("colspan"),o=r.attr("rowspan"),a=e.nodeName;if("TH"!==a&&"TD"!==a)return null;var l={nodeName:e.nodeName,colspan:i?parseInt(i,10):1,rowspan:o?parseInt(o,10):1,content:r.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(l.align=e.align),l}function o(e,t,n,r){var i=t.colspan,o=t.rowspan,a=t.nodeName,l=i>1,s=o>1;if(l||s){var u=n+o,c=r+i;k.default.range(n,u).forEach(function(t){e[t]=e[t]||[],k.default.range(r,c).forEach(function(i){var o={nodeName:a};t===n&&i===r||(l&&(o.colMergeWith=r),s&&(o.rowMergeWith=n),e[t][i]=o)})})}}function a(e){var t=[];return e.find("tr").each(function(e,n){var r=0;t[e]=t[e]||[],(0,_.default)(n).children().each(function(n,a){var l=i(a,e,n);if(l){for(var s=n+r;t[e][s];)s+=1,r+=1;t[e][s]=l,o(t,l,e,s)}})}),e[0].className&&(t.className=e[0].className),t}function l(e){var t=[];return e.forEach(function(e,n){var r=[];e.forEach(function(e,t){k.default.isUndefined(e.colMergeWith)&&k.default.isUndefined(e.rowMergeWith)&&r.push({rowIndex:n,colIndex:t})}),t.push(r)}),t}function s(e){var t=e[0];return t.map(function(e){return k.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align})}function u(e,t){var n=s(e),r=t.map(function(t){return t.map(function(t){var r=t.rowIndex,i=t.colIndex;return k.default.extend({align:n[i]},e[r][i])})});return e.className&&(r.className=e.className),r}function c(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:E,elementIndex:{rowIndex:e,colIndex:t}}}function d(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function f(e){return e.closest("td, th").prevAll().length}function h(e,t){var n=d(t),r=f(t);return e[n][r]}function g(e,t,n){var r=e[t][n],i=t;return r.rowspan>1&&(i+=r.rowspan-1),i}function p(e,t,n){var r=e[t][n],i=n;return r.colspan>1&&(i+=r.colspan-1),i}function v(e,t,n){var r=e[t][n];return t=k.default.isExisty(r.rowMergeWith)?r.rowMergeWith:t,n=k.default.isExisty(r.colMergeWith)?r.colMergeWith:n,e[t][n].elementIndex}function m(e,t){e.forEach(function(e,n){var r=e.length;if(r){var i=e[0].nodeName;k.default.range(r,t).forEach(function(t){e.push(c(n,t,i))})}})}function y(e){var t=e[0],n=t.length,r=!0;if(!n&&e[1])k.default.range(0,e[1].length).forEach(function(e){t.push(c(0,e,"TH"))});else if("TH"!==e[0][0].nodeName){var i,o=k.default.range(0,n).map(function(e){return c(0,e,"TH")});(i=[]).concat.apply(i,e).forEach(function(e){e.elementIndex&&(e.elementIndex.rowIndex+=1)}),e.unshift(o)}else if(1===e.length){var a=k.default.range(0,n).map(function(e){return c(1,e,"TD")});e.push(a)}else r=!1;return r}Object.defineProperty(t,"__esModule",{value:!0}),t.createTableData=a,t.createCellIndexData=l;var b=n(0),_=r(b),w=n(1),k=r(w),E=k.default.browser.msie?"":"<br>";t.default={createTableData:a,createCellIndexData:l,createRenderData:u,findElementRowIndex:d,findElementColIndex:f,findCellIndex:h,createBasicCell:c,findRowMergedLastIndex:g,findColMergedLastIndex:p,findElementIndex:v,stuffCellsIntoIncompleteRow:m,addTbodyOrTheadIfNeed:y}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}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 l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(0),u=r(s),c=n(1),d=r(c),f=n(14),h=r(f),g="tui-popup-",p='<div class="'+g+'header">\n <span class="'+g+'title"></span>\n <div class="'+g+'header-buttons">\n <button type="button" class="'+g+'close-button"></button>\n </div>\n </div>\n <div class="'+g+'body"></div>',v='<div class="'+g+'wrapper">\n <div class="'+g+'header">\n <span class="'+g+'title"></span>\n <div class="'+g+'header-buttons">\n <button type="button" class="'+g+'close-button"></button>\n </div>\n </div>\n <div class="'+g+'body"></div>\n </div>',m=function(e){function t(e){i(this,t),e=d.default.extend({header:!0,$target:(0,u.default)("body"),textContent:""},e);var n=o(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 a(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,r=t.closerCssQuery;n&&(0,u.default)(n).on("click."+this._id,function(){return e.show()}),r&&(0,u.default)(r).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?v:p;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,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.colspan>1?' colspan="'+e.colspan+'"':"";return t+=e.rowspan>1?' rowspan="'+e.rowspan+'"':"",t+=e.align?' align="'+e.align+'"':"","<"+e.nodeName+t+">"+e.content+"</"+e.nodeName+">"}function o(e,t){var n="";return e.length&&(n=e.map(function(e){return"<tr>"+e.map(i).join("")+"</tr>"}).join(""),n="<"+t+">"+n+"</"+t+">"),n}function a(e){var t=[e[0]],n=e.slice(1),r=o(t,"THEAD"),i=o(n,"TBODY");return"<table"+(e.className?' class="'+e.className+'"':"")+">"+(r+i)+"</renderData>"}function l(e,t){var n=f.default.createCellIndexData(t),r=f.default.createRenderData(t,n),i=(0,c.default)(a(r));return e.replaceWith(i),i}function s(e,t,n){t.selectNodeContents(n),t.collapse(!0),e.setSelection(t)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),c=r(u),d=n(6),f=r(d);t.default={createTableHtml:a,replaceTable:l,focusToCell:s}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var r=p.default.createCellIndexData(e),i=p.default.findCellIndex(r,t),o=p.default.findCellIndex(r,n),a=void 0,l=void 0,s=void 0,u=void 0;return i.rowIndex>o.rowIndex?(a=o.rowIndex,l=i.rowIndex):(a=i.rowIndex,l=o.rowIndex),i.colIndex>o.colIndex?(s=o.colIndex,u=i.colIndex):(s=i.colIndex,u=o.colIndex),{start:{rowIndex:a,colIndex:s},end:{rowIndex:l,colIndex:u}}}function o(e,t,n){var r=t[n].rowIndex,i=e[r];h.default.range(t.start.colIndex,t.end.colIndex+1).forEach(function(n){var o=i[n],a=o.rowMergeWith,l=-1;h.default.isExisty(a)?(a<t.start.rowIndex&&(t.start.rowIndex=a),l=a+e[a][n].rowspan-1):o.rowspan>1&&(l=r+o.rowspan-1),l>t.end.rowIndex&&(t.end.rowIndex=l)})}function a(e,t,n,r){var i=e[n],o=i[r],a=o.colMergeWith,l=-1;h.default.isExisty(a)?(a<t.start.colIndex&&(t.start.colIndex=a),l=a+i[a].colspan-1):o.colspan>1&&(l=r+o.colspan-1),l>t.end.colIndex&&(t.end.colIndex=l)}function l(e,t){for(var n="";n!==JSON.stringify(t);)n=JSON.stringify(t),o(e,t,"start"),o(e,t,"end"),h.default.range(t.start.rowIndex,t.end.rowIndex+1).forEach(function(n){a(e,t,n,t.start.colIndex),a(e,t,n,t.end.colIndex)});return t}function s(e,t,n){return l(e,i(e,t,n))}function u(e,t,n){var r=p.default.createCellIndexData(e),i={};if(t.length){var o=p.default.findCellIndex(r,t.first()),a=h.default.extend({},o);t.each(function(t,n){var i=p.default.findCellIndex(r,(0,d.default)(n)),o=e[i.rowIndex][i.colIndex],l=i.rowIndex+o.rowspan-1,s=i.colIndex+o.colspan-1;a.rowIndex=Math.max(a.rowIndex,l),a.colIndex=Math.max(a.colIndex,s)}),i.start=o,i.end=a}else{var l=p.default.findCellIndex(r,n);i.start=l,i.end=h.default.extend({},l)}return i}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),d=r(c),f=n(1),h=r(f),g=n(6),p=r(g);t.default={findSelectionRange:s,getTableSelectionRange:u}},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);u.call(this,e),c.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var a=n(19),l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=r;var s=n(16);s.inherits=n(13);var u=n(48),c=n(28);s.inherits(r,u);for(var d=l(c.prototype),f=0;f<d.length;f++){var h=d[f];r.prototype[h]||(r.prototype[h]=c.prototype[h])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),r.prototype._destroy=function(e,t){this.push(null),this.end(),a(t,e)}},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){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return d+=1}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),s=r(l),u=n(1),c=r(u),d=-1,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,e),t=c.default.extend({tagName:"div"},t),this.tagName=t.tagName,this.className=t.className,this._id=o(),this._setRootElement(t.rootElement)}return a(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),r=n.event,i=n.selector;i?this.$el.on(r,i,t):this.$el.on(r,t)}},{key:"off",value:function(e,t){if(e){var n=this._parseEventType(e),r=n.event,i=n.selector;i?this.$el.off(r,i,t):this.$el.off(r,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 r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r),o=0;o<t.length;o+=1)i[o]=t.charCodeAt(o);return new Blob([r],{type:n})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g,u=function(){function e(t){r(this,e),this.eventManager=t,this._initEvent(),this._initDefaultImageImporter()}return o(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("drop",function(t){var n=t.data.dataTransfer&&t.data.dataTransfer.files;e._processBlobItems(n,t.data)}),this.eventManager.listen("willPaste",function(t){var n=t.data.fragment,r=n.querySelectorAll("*");if(1===r.length&&"IMG"===r[0].tagName&&/^data:image/.test(r[0].src)){t.data.preventDefault();var o=i(r[0].src);e._emitAddImageBlobHook(o,"paste")}}),this.eventManager.listen("paste",function(t){e._processClipboard(t.data)}),this.eventManager.listen("pasteBefore",function(t){e._decodeURL(t)})}},{key:"_initDefaultImageImporter",value:function(){this.eventManager.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)})}},{key:"_emitAddImageBlobHook",value:function(e,t){var n=this;this.eventManager.emit("addImageBlobHook",e,function(t,r){n.eventManager.emit("command","AddImage",{imageUrl:t,altText:r||e.name||"image"})},t)}},{key:"_decodeURL",value:function(t){var n=e.decodeURIGraceful,r=e.encodeMarkdownCharacters;if("markdown"===t.source&&t.data.text){var i=t.data.text,o=i[0];1===i.length&&o.match(s)&&(o=n(o),o=r(o),t.data.update(null,null,[o]))}else if("wysiwyg"===t.source){var a=t.$clipboardContainer.get(0),l=a.childNodes[0],u=l.innerText;1===a.childNodes.length&&"A"===l.tagName&&u.match(s)&&(l.innerText=n(u),l.href=r(l.href))}}},{key:"_processClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items,r=t.types;n&&r&&1===r.length&&-1!==l.default.inArray("Files",[].slice.call(r))&&this._processBlobItems(n,e)}},{key:"_processBlobItems",value:function(e,t){var n=this;e&&l.default.forEachArray(e,function(e){if(-1!==e.type.indexOf("image")){t.preventDefault(),t.stopPropagation(),t.codemirrorIgnore=!0;var r=e.name?e:e.getAsFile();return n._emitAddImageBlobHook(r,t.type),!1}return!0})}}],[{key:"decodeURIGraceful",value:function(e){var t=e.split(" "),n=[],r=void 0;return l.default.forEachArray(t,function(e){try{r=decodeURIComponent(e),r=r.replace(/ /g,"%20")}catch(t){r=e}return n.push(r)}),n.join(" ")}},{key:"encodeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/</g,"%3C").replace(/>/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/</g,"\\<").replace(/>/g,"\\>")}}]),e}();t.default=u},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function l(e){return"string"==typeof e}function s(e){return"symbol"==typeof e}function u(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function d(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function g(e){return"function"==typeof e}function p(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=l,t.isSymbol=s,t.isUndefined=u,t.isRegExp=c,t.isObject=d,t.isDate=f,t.isError=h,t.isFunction=g,t.isPrimitive=p,t.isBuffer=e.isBuffer}).call(t,n(51).Buffer)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}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 l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(1),u=r(s),c=n(14),d=r(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:t.name};i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,u.default.extend({className:t.className},e)));return n._name=e.name,n}return a(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){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(d===clearTimeout)return clearTimeout(e);if((d===r||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){p&&h&&(p=!1,h.length?g=h.concat(g):v=-1,g.length&&l())}function l(){if(!p){var e=i(a);p=!0;for(var t=g.length;t;){for(h=g,g=[];++v<t;)h&&h[v].run();v=-1,t=g.length}h=null,p=!1,o(e)}}function s(e,t){this.fun=e,this.array=t}function u(){}var c,d,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{d="function"==typeof clearTimeout?clearTimeout:r}catch(e){d=r}}();var h,g=[],p=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];g.push(new s(e,t)),1!==g.length||p||i(l)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t,n){"use strict";(function(t){function n(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,l=arguments.length;switch(l){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,i)});default:for(o=new Array(l-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports=n:e.exports=t.nextTick}).call(t,n(18))},function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function i(e,t,n){return a(e,t,n)}var o=n(51),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=o:(r(o,t),t.Buffer=i),r(a,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return a(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=a(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o.SlowBuffer(e)}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}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 l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(17),u=r(s),c=n(30),d=r(c),f=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tagName:"button",name:t.name};i(this,t);var n=o(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 a(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 r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=["","","","CANCEL","","","HELP","","BACK_SPACE","TAB","","","CLEAR","ENTER","ENTER_SPECIAL","","","","","PAUSE","CAPS_LOCK","KANA","EISU","JUNJA","FINAL","HANJA","","ESCAPE","CONVERT","NONCONVERT","ACCEPT","MODECHANGE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","SELECT","PRINT","EXECUTE","PRINTSCREEN","INSERT","DELETE","","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","AT","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","","","CONTEXT_MENU","","SLEEP","NUMPAD0","NUMPAD1","NUMPAD2","NUMPAD3","NUMPAD4","NUMPAD5","NUMPAD6","NUMPAD7","NUMPAD8","NUMPAD9","MULTIPLY","ADD","SEPARATOR","SUBTRACT","DECIMAL","DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","","","","","","","","","NUM_LOCK","SCROLL_LOCK","WIN_OEM_FJ_JISHO","WIN_OEM_FJ_MASSHOU","WIN_OEM_FJ_TOUROKU","WIN_OEM_FJ_LOYA","WIN_OEM_FJ_ROYA","","","","","","","","","","@","!",'"',"#","$","%","&","_","(",")","*","+","|","-","{","}","~","","","","","VOLUME_MUTE","VOLUME_DOWN","VOLUME_UP","","",";","=",",","-",".","/","`","","","","","","","","","","","","","","","","","","","","","","","","","","","[","\\","]","'","","META","ALTGR","","WIN_ICO_HELP","WIN_ICO_00","","WIN_ICO_CLEAR","","","WIN_OEM_RESET","WIN_OEM_JUMP","WIN_OEM_PA1","WIN_OEM_PA2","WIN_OEM_PA3","WIN_OEM_WSCTRL","WIN_OEM_CUSEL","WIN_OEM_ATTN","WIN_OEM_FINISH","WIN_OEM_COPY","WIN_OEM_AUTO","WIN_OEM_ENLW","WIN_OEM_BACKTAB","ATTN","CRSEL","EXSEL","EREOF","PLAY","ZOOM","","PA1","WIN_OEM_CLEAR",""],a=void 0,l=function(){function e(t){r(this,e),this._setSplitter(t)}return i(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 o[e]}}],[{key:"getSharedInstance",value:function(){return a||(a=new e),a}},{key:"keyCode",value:function(e){return o.indexOf(e)}}]),e}();t.default=l},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=(0,u.default)("<div />");return e=e.replace(/<!--[\s\S]*?-->/g,""),n.append(e),o(n),a(n),l(n,t)}function o(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title").remove()}function a(e){e.find("*").each(function(e,t){var n=t.attributes,r=d.default.toArray(n).filter(function(e){var t=e.name.match(f),n=e.name.match(h);return!t&&!n});d.default.forEachArray(r,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 r=document.createDocumentFragment(),i=d.default.toArray(e[0].childNodes),o=i.length,a=0;a<o;a+=1)r.appendChild(i[a]);n=r}return n}Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=r(s),c=n(1),d=r(c),f=new RegExp("^(abbr|align|alt|axis|bgcolor|border|cellpadding|cellspacing|class|clear|color|cols|compact|coords|dir|face|headers|height|hreflang|hspace|ismap|lang|language|nohref|nowrap|rel|rev|rows|rules|scope|scrolling|shape|size|span|start|summary|tabindex|target|title|type|valign|value|vspace|width|checked|mathvariant|encoding|id|name|background|cite|href|longdesc|src|usemap|xlink:href|data-+|checked|style)","g"),h=new RegExp("^(accent-height|accumulate|additive|alphabetic|arabic-form|ascent|baseProfile|bbox|begin|by|calcMode|cap-height|class|color|color-rendering|content|cx|cy|d|dx|dy|descent|display|dur|end|fill|fill-rule|font-family|font-size|font-stretch|font-style|font-variant|font-weight|from|fx|fy|g1|g2|glyph-name|gradientUnits|hanging|height|horiz-adv-x|horiz-origin-x|ideographic|k|keyPoints|keySplines|keyTimes|lang|marker-end|marker-mid|marker-start|markerHeight|markerUnits|markerWidth|mathematical|max|min|offset|opacity|orient|origin|overline-position|overline-thickness|panose-1|path|pathLength|points|preserveAspectRatio|r|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|rotate|rx|ry|slope|stemh|stemv|stop-color|stop-opacity|strikethrough-position|strikethrough-thickness|stroke|stroke-dasharray|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|systemLanguage|target|text-anchor|to|transform|type|u1|u2|underline-position|underline-thickness|unicode|unicode-range|units-per-em|values|version|viewBox|visibility|width|widths|x|x-height|x1|x2|xlink:actuate|xlink:arcrole|xlink:role|xlink:show|xlink:title|xlink:type|xml:base|xml:lang|xml:space|xmlns|xmlns:xlink|y|y1|y2|zoomAndPan)","g");t.default=i},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(94),l=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(){r(this,e),this._replacers={}}return o(e,[{key:"setReplacer",value:function(e,t){this._replacers[e]=t}},{key:"getReplacer",value:function(e){return this._replacers[e]}},{key:"createCodeBlockHtml",value:function(e,t){var n=this.getReplacer(e);return n?n(t,e):l.default.getLanguage(e)?l.default.highlight(e,t).value:i(t,!1)}}],[{key:"getHighlightJSLanguages",value:function(){return l.default.listLanguages()}}]),e}();t.CodeBlockManager=s,t.default=new s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){var n=e.start,r=e.end,i=void 0;if(n.ch>=t){i={from:{line:n.line,ch:n.ch-t},to:{line:r.line,ch:r.ch+t}}}return i},i=t.removeSyntax=function(e,t){var n=t.length;return e.substr(n,e.length-2*n)},o=t.appendSyntax=function(e,t){return""+t+e+t},a=t.expandReplace=function(e,t,n,i,o){var a=r(t,n),l=!1;if(a){var s=a.from,u=a.to,c=e.getRange(s,u);i(c)&&(e.setSelection(s,u),e.replaceSelection(o(c),"around"),l=!0)}return l},l=t.replace=function(e,t,n,r){var i=!1;return n(t)&&(e.replaceSelection(r(t),"around"),i=!0),i};t.changeSyntax=function(e,t,n,r,s){var u=e.getCursor(),c=u.line,d=u.ch,f=e.getSelection(),h=n.length,g=function(e){return r.test(e)};if(!a(e,t,h,g,function(e){return i(e,n)})&&!l(e,f,g,function(e){return i(e,n)})){var p=f.replace(s,"$1");e.replaceSelection(o(p,n),"around")}var v=e.getSelection(),m=d;f||(g(v)?m+=h:m-=h,e.setCursor(c,m))}},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,l,s,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),n.apply(this,l)}else if(o(n))for(l=Array.prototype.slice.call(arguments,1),u=n.slice(),i=u.length,s=0;s<i;s++)u[s].apply(this,l);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(l=a;l-- >0;)if(n[l]===t||n[l].listener&&n[l].listener===t){i=l;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){t=e.exports=n(48),t.Stream=t,t.Readable=t,t.Writable=n(28),t.Duplex=n(11),t.Transform=n(54),t.PassThrough=n(180)},function(e,t,n){"use strict";(function(t,r,i){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){M(t,e)}}function a(e){return P.from(e)}function l(e){return P.isBuffer(e)||e instanceof R}function s(){}function u(e,t){x=x||n(11),e=e||{},this.objectMode=!!e.objectMode,t instanceof x&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){y(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function c(e){if(x=x||n(11),!(D.call(c,this)||this instanceof x))return new c(e);this._writableState=new u(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),N.call(this)}function d(e,t){var n=new Error("write after end");e.emit("error",n),O(t,n)}function f(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),O(r,o),i=!1),i}function h(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=P.from(t,n)),t}function g(e,t,n,r,i,o){if(!n){var a=h(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var l=t.objectMode?1:r.length;t.length+=l;var s=t.length<t.highWaterMark;if(s||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else p(e,t,!1,l,r,i,o);return s}function p(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,n,r,i){--t.pending