text: /*!
   * TOAST UI Editor : jQuery Wrapper
   * @version 2.5.1 | Tue Nov 24 2020
   * @author NHN FE Development Lab <dl_javascript@nhn.com>
   * @license MIT
   */
  (function(n,t){typeof exports=="object"&&typeof module=="object"?module.exports=t(require("jquery")):typeof define=="function"&&define.amd?define(["jquery"],t):typeof exports=="object"?exports.Editor=t(require("jquery")):(n.toastui=n.toastui||{},n.toastui.Editor=t(n.$))})(window,function(n){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=3)}([function(t){t.exports=n},function(n,t,i){
  /*!
   * @toast-ui/editor
   * @version 2.5.1 | Tue Nov 24 2020
   * @author NHN FE Development Lab <dl_javascript@nhn.com>
   * @license MIT
   */
  (function(t,r){!0&&(n.exports=r(i(4)))})(window,function(n){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=65)}([function(n,t,i){"use strict";function or(n,t){var i=document.createElement("div"),r;return h()(n)?i.innerHTML=n:i.appendChild(n),r=i.firstChild,t&&t.appendChild(r),r}function et(n,t){var i=r()(n.querySelectorAll(t));return i.length?i:[]}function sr(n,t){return n!==t&&n.contains(t)}function ot(n,t,i){var r;for(i=i||document,r=h()(t)?function(n){return c()(n,t)}:function(n){return n===t};n&&n!==i;){if(e(n)&&r(n))return n;n=n.parentNode}return null}function hr(n,t){var i=n.parentNode;return t?i&&c()(i,t)?i:null:i}function w(n,t){for(var i=[];n&&n!==document;)n=ot(n.parentNode,t),n&&i.push(n);return i}function cr(n,t){for(var i=[];n.parentNode&&!c()(n.parentNode,t);)n=n.parentNode,n&&i.push(n);return i}function st(n,t){var i;return i=n.nodeType===Node.DOCUMENT_FRAGMENT_NODE?n.childNodes:n.children,r()(i).filter(function(n){return c()(n,t)})}function lr(n,t){if(h()(t))n.insertAdjacentHTML("beforeEnd",t);else{t=t.length?r()(t):[t];for(var i=0,u=t.length;i<u;i+=1)n.appendChild(t[i])}}function ar(n,t){if(h()(t))n.insertAdjacentHTML("afterBegin",t);else{t=t.length?r()(t):[t];for(var i=t.length-1;i>=0;i-=1)n.insertBefore(t[i],n.firstChild)}}function vr(n,t){var i=t.parentNode;i&&i.insertBefore(n,t)}function yr(n,t){var i=t.parentNode;i&&i.insertBefore(n,t.nextSibling)}function pr(n,t){n=n.length?r()(n):[n];n.forEach(function(n){n.insertAdjacentHTML("afterEnd",t);n.parentNode.removeChild(n)})}function wr(n,t){n=n.length?r()(n):[n];n.forEach(function(n){var i=document.createElement(t);n.parentNode.insertBefore(i,n);i.appendChild(n)})}function br(n,t){n=n.length?r()(n):[n];n.forEach(function(n){var i=document.createElement(t);for(n.appendChild(i);n.firstChild!==i;)i.appendChild(n.firstChild)})}function kr(n){for(var t=[];n.firstChild;)t.push(n.firstChild),n.parentNode.insertBefore(n.firstChild,n);return ht(n),t}function ht(n){n.parentNode&&n.parentNode.removeChild(n)}function dr(n){while(n.firstChild)n.removeChild(n.firstChild)}function gr(n,t){var i=n.parentNode.getBoundingClientRect(),r=i.top,u=i.left;b()(n,{top:t.top-r-document.body.scrollTop+"px"});b()(n,{left:t.left-u-document.body.scrollLeft+"px"})}function nu(n,t){t===void 0&&(t="document");var i=0,r=0;do i+=n.offsetTop||0,r+=n.offsetLeft||0,n=n.offsetParent;while(n&&!c()(n,t));return{top:i,left:r}}function tu(n,t){var i=n.offsetWidth;if(t){var r=k(n),u=r.marginLeft,f=r.marginRight;i+=parseInt(u,10)+parseInt(f,10)}return i}function iu(n,t){var i=n.offsetHeight;if(t){var r=k(n),u=r.marginTop,f=r.marginBottom;i+=parseInt(u,10)+parseInt(f,10)}return i}function uu(n,t){var u,i;if(t)u=n.innerHTML;else{var f=document.createDocumentFragment(),e=r()(n.childNodes),o=e.length;for(i=0;i<o;i+=1)f.appendChild(e[i]);u=f}return u}function fu(n){var t=document.createDocumentFragment(),i=n.split("\n");return i.forEach(function(n,r){var u=document.createTextNode(n);t.appendChild(u);r<i.length-1&&t.appendChild(document.createElement("br"))}),t}var ct=i(3),r=i.n(ct),lt=i(8),s=i.n(lt),at=i(9),h=i.n(at),vt=i(4),b=i.n(vt),yt=i(5),pt=i.n(yt),wt=i(6),bt=i.n(wt),kt=i(16),dt=i.n(kt),gt=i(13),c=i.n(gt),v=/\u200B/g,ni=window,k=ni.getComputedStyle,u=function(n){return n&&n.nodeType===Node.TEXT_NODE},e=function(n){return n&&n.nodeType===Node.ELEMENT_NODE},ti=function(n){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(n))},f=function(n){return e(n)?n.tagName:"TEXT"},d=function(n){var t;return e(n)?t=n.textContent.replace(v,"").length:u(n)&&(t=n.nodeValue.replace(v,"").length),t},ii=function(n){var t;return e(n)?t=n.childNodes.length:u(n)&&(t=n.nodeValue.replace(v,"").length),t},g=function(n){for(var i=n.parentNode.childNodes,u,t=0,r=i.length;t<r;t+=1)if(i[t]===n){u=t;break}return u},nt=function(n,t){var i;return u(n)?i=n:n.childNodes.length&&t>=0&&(i=n.childNodes[t]),i},tt=function(n,t,i){for(var r=n+"Sibling",u,e;t&&!t[r];){if(u=f(t.parentNode),u===i||u==="BODY")break;t=t.parentNode}return t[r]&&(e=t[r]),e},ri=function(n,t,i){return t>0?nt(n,t-1):tt("previous",n,i)},y=function(n,t,i){while(n.parentNode&&!t(n.parentNode))if(n=n.parentNode,i&&i(n))break;return t(n.parentNode)?n:null},l=function(n,t){return h()(t)?y(n,function(n){return t===f(n)}):y(n,function(n){return t===n})},it=function(n,t,i){var r=n+"Sibling",u;return t=l(t,i),t&&t[r]&&(u=t[r]),u},ui=function(n,t){return it("previous",n,t)},fi=function(n,t){return it("next",n,t)},ei=function(n){return l(n,"BODY")},oi=function(n){for(n=n.previousSibling||n.parentNode;!u(n)&&f(n)!=="BODY";)if(n.previousSibling)for(n=n.previousSibling;n.lastChild;)n=n.lastChild;else n=n.parentNode;return f(n)==="BODY"&&(n=null),n},si=function(n,t){for(var r=document.createTreeWalker(n,4,null,!1),i=n===t;!i&&r.nextNode();)i=r.currentNode===t;return i},hi=function(n,t,i){var u=[],f="",o=0,h,r,e;if(!t.length)return u;for(r=t.shift(),e=document.createTreeWalker(n,4,null,!1);e.nextNode();){for(f=e.currentNode.nodeValue||"",i&&(f=i(f)),h=o+f.length;h>=r;){if(u.push({container:e.currentNode,offsetInContainer:r-o,offset:r}),!t.length)return u;r=t.shift()}o=h}do u.push({container:e.currentNode,offsetInContainer:f.length,offset:r}),r=t.shift();while(!s()(r));return u},rt=function(n){var t={},i;return t.tagName=n.nodeName,n.id&&(t.id=n.id),i=n.className.trim(),i&&(t.className=i),t},ci=function(n,t){for(var i=[];n&&n!==t;)e(n)&&i.unshift(rt(n)),n=n.parentNode;return i},li=function(n,t){var i=null;return s()(t)||t!=="next"&&t!=="previous"||(i=t==="next"?n.nextElementSibling:n.previousElementSibling),i},ai=function(n,t,i){var h=null,e,o,r,u,c;return s()(t)||t!=="next"&&t!=="previous"||n&&(t==="next"?(o=n.parentNode&&n.parentNode.nextSibling,r=w(n,"thead"),u=r[0]&&r[0].nextSibling,c=u&&f(u)==="TBODY",e=0):(o=n.parentNode&&n.parentNode.previousSibling,r=w(n,"tbody"),u=r[0]&&r[0].previousSibling,c=u&&f(u)==="THEAD",e=n.parentNode.childNodes.length-1),(s()(i)||!i)&&(e=g(n)),o?h=st(o,"td,th")[e]:r[0]&&c&&(h=et(u,"td,th")[e])),h},vi=function(n){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(n.nodeName)},yi=function(n){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(n.nodeName)},p=function(n,t,i){var r=t,u;if(r&&n===r.parentNode)while(r!==i)u=r.nextSibling,n.removeChild(r),r=u},pi=function(n,t,i){for(var r=t;r!==n;){var u=r.parentNode,f=r,e=f.nextSibling,o=f.previousSibling;!i&&e?p(u,e,null):i&&o&&p(u,u.childNodes[0],r);r=u}},wi=function(n){for(var i=n,r,t;i.childNodes&&i.childNodes.length;)r=i,t=r.firstChild,i=u(t)&&!d(t)?t.nextSibling||t:t;return i},bi=function(n,t,i){var r={left:parseInt(n.left,10),top:parseInt(n.top,10),width:parseInt(n.width,10),height:parseInt(n.height,10)};return t>=r.left&&t<=r.left+r.width&&i>=r.top&&i<=r.top+r.height},ut=function(n){return n?n.nodeName==="UL"||n.nodeName==="OL":!1},ki=function(n){var t=n.nodeName,i=n.parentNode;return t==="LI"&&n===i.firstChild},di=function(n){var t=n.nodeName,i=n.parentNode,r=i.parentNode;return t==="LI"&&!ut(r)},a=function(n,t){n.hasChildNodes()&&(r()(n.childNodes).forEach(function(){t.appendChild(n.firstChild)}),t.normalize());n.parentNode&&n.parentNode.removeChild(n)},gi=function(){var n=document.createElement("div"),t=document.createElement("hr");return n.setAttribute("contenteditable",!1),t.setAttribute("contenteditable",!1),n.appendChild(t),n},nr=function(){var n=document.createElement("div");return n.appendChild(document.createElement("br")),n},o=function(n,t){var f,i,r;if(n.nodeName!=="SPAN")for(f=n.parentNode,i=n;i.childNodes&&i.childNodes.length===1&&!u(i.firstChild);){if(i=i.firstChild,i.nodeName==="SPAN")break;if(i.nodeName===t)return r=document.createElement(t),a(i,i.parentNode),f.replaceChild(r,n),r.appendChild(n),r}return n},ft=function(n,t,i){var f=o(n,i),e;if(f.nodeName===i)for(var s=o(t,i),u=f,r=f.nextSibling;r;){if(e=r.nextSibling,r=o(r,i),r.nodeName===i?u?a(r,u):u=r:u=null,r===s)break;r=e}},tr=function(n,t){var b=n.collapsed,e=n.commonAncestorContainer,f=n.startContainer,y=n.endContainer,i,s,h,p,c,r,w,v;b||(i=null,f!==y?(s=l(f,e),h=l(y,e),s&&h&&ft(s,h,t),i=e):u(f)&&(i=f.parentNode),i&&i.nodeName===t&&(p=i,c=p.previousSibling,c&&(r=o(c),r.nodeName===t&&a(i,r)),w=i,v=w.nextSibling,v&&(r=o(v),r.nodeName===t&&a(r,i))))},ir=function(n){for(var i=document.createTreeWalker(n,4,null,!1),r=[],t;i.nextNode();)t=i.currentNode,u(t)&&r.push(t);return r},rr=function(n){return n?n.nodeName==="TD"||n.nodeName==="TH":!1},ur=function(n,t){for(var i=n&&n.lastChild;i&&t(i);)i=i.lastChild;return i},fr=function(n,t){while(n&&t(n.parentNode,n))n=n.parentNode;return n},er=function(n,t,i){for(var r=t+"Sibling";n&&i(n[r],n);)n=n[r];return n},ru=function(n,t,i){s()(i)&&(i=!dt()(n,t));var r=i?pt.a:bt.a;r(n,t)};t.a={getNodeName:f,isTextNode:u,isElemNode:e,isBlockNode:ti,getTextLength:d,getOffsetLength:ii,getPrevOffsetNodeUntil:ri,getNodeOffsetOfParent:g,getChildNodeByOffset:nt,getNodeWithDirectionUntil:tt,containsNode:si,getTopPrevNodeUnder:ui,getTopNextNodeUnder:fi,getParentUntilBy:y,getParentUntil:l,getTopBlockNode:ei,getPrevTextNode:oi,findOffsetNode:hi,getPath:ci,getNodeInfo:rt,getTableCellByDirection:li,getSiblingRowCellByDirection:ai,isMDSupportInlineNode:vi,isStyledNode:yi,removeChildFromStartToEndNode:p,removeNodesByDirection:pi,getLeafNode:wi,isInsideButtonBox:bi,isListNode:ut,isFirstListItem:ki,isFirstLevelListItem:di,mergeNode:a,createHorizontalRule:gi,createEmptyLine:nr,changeTagOrder:o,mergeSameNodes:ft,optimizeRange:tr,getAllTextNode:ir,isCellNode:rr,getLastNodeBy:ur,getParentNodeBy:fr,getSiblingNodeBy:er,createElementWith:or,findAll:et,isContain:sr,closest:ot,parent:hr,parents:w,parentsUntil:cr,children:st,append:lr,prepend:ar,insertBefore:vr,insertAfter:yr,replaceWith:pr,wrap:wr,wrapInner:br,unwrap:kr,remove:ht,empty:dr,setOffset:gr,getOffset:nu,getOuterWidth:tu,getOuterHeight:iu,toggleClass:ru,finalizeHtml:uu,getFragmentReplacedByNewlineToBr:fu}},function(n,t,i){"use strict";var o=i(7),u=i.n(o),r=function(){function t(n,t,i){this.name=n;this.type=t;i&&this.setKeyMap(i)}var n=t.prototype;return n.getName=function(){return this.name},n.getType=function(){return this.type},n.isMDType=function(){return this.type===t.TYPE.MD},n.isWWType=function(){return this.type===t.TYPE.WW},n.isGlobalType=function(){return this.type===t.TYPE.GB},n.setKeyMap=function(n,t){this.keyMap=[n,t]},t}(),l;r.factory=function(n,t){var i,f;return n==="markdown"?i=r.TYPE.MD:n==="wysiwyg"?i=r.TYPE.WW:n==="global"&&(i=r.TYPE.GB),f=new r(t.name,i),u()(f,t),f};r.TYPE={MD:0,WW:1,GB:2};var s=r,h=i(12),f=i(23),c=h.b?1:0,e=function(){function n(n,t){t===void 0&&(t={});this._command=new f.a;this._mdCommand=new f.a;this._wwCommand=new f.a;this._options=u()({useCommandShortcut:!0},t);this.base=n;this.keyMapCommand={};this._initEvent()}var t=n.prototype;return t._addCommandBefore=function(n){var t={command:n};return this.base.eventManager.emit("addCommandBefore",t),t.command||n},t.addCommand=function(t){for(var e,r,u=arguments.length,f=new Array(u>1?u-1:0),i=1;i<u;i++)f[i-1]=arguments[i];return f.length&&(t=n.command.apply(n,[t].concat(f))),t=this._addCommandBefore(t),e=t.getName(),t.isMDType()?r=this._mdCommand:t.isWWType()?r=this._wwCommand:t.isGlobalType()&&(r=this._command),r.set(e,t),t.keyMap&&(this.keyMapCommand[t.keyMap[c]]=e),t},t._initEvent=function(){var n=this;this.base.eventManager.listen("command",function(){n.exec.apply(n,arguments)});this.base.eventManager.listen("keyMap",function(t){if(n._options.useCommandShortcut){var i=n.keyMapCommand[t.keyMap];i&&(t.data.preventDefault(),n.exec(i))}})},t.exec=function(n){var t,e,r=this.base,o;if(t=this._command.get(n),t||(this.base.isMarkdownMode()?(t=this._mdCommand.get(n),r=this.base.mdEditor):(t=this._wwCommand.get(n),r=this.base.wwEditor)),t){for(var u=arguments.length,f=new Array(u>1?u-1:0),i=1;i<u;i++)f[i-1]=arguments[i];f.unshift(r);e=(o=t).exec.apply(o,f)}return e},n}();e.command=function(n,t){var i=s.factory(n,t.name,t.keyMap);return u()(i,t),i};l=t.a=e},function(n,t,i){"use strict";function f(n){return n.sourcepos[0][0]}function e(n){return n.sourcepos[1][0]}function o(n){return n.sourcepos[0][1]}function s(n){return n.sourcepos[1][1]}function h(n){var t=n.type;return t==="codeBlock"||t==="paragraph"}function c(n){var t=n.type;return t==="htmlBlock"||t==="htmlInline"}function l(n){var t=n.type;return t==="strike"||t==="strong"||t==="emph"}function a(n){return n.type==="item"}function v(n){var t=n.type;return t==="tableCell"||t==="tableDelimCell"}function y(n){switch(n.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":return!0;default:return!1}}function p(n,t,i){for(i===void 0&&(i=!0),n=i?n:n.parent;n&&n.type!=="document";){if(t(n))return n;n=n.parent}return null}function w(n,t,i){for(i===void 0&&(i=!0),n=i?n:n.parent;n&&n.type!=="document";)t(n),n=n.parent}function b(n,t){return{line:n.line,ch:n.ch+t}}function k(n,t){return{line:n.line,ch:t}}i.d(t,"f",function(){return f});i.d(t,"d",function(){return e});i.d(t,"e",function(){return o});i.d(t,"c",function(){return s});i.d(t,"j",function(){return h});i.d(t,"g",function(){return c});i.d(t,"k",function(){return l});i.d(t,"i",function(){return a});i.d(t,"l",function(){return v});i.d(t,"h",function(){return y});i.d(t,"b",function(){return p});i.d(t,"n",function(){return w});i.d(t,"a",function(){return b});i.d(t,"m",function(){return k});var r=i(12)},function(n,t,i){"use strict";function u(n){var t;try{t=Array.prototype.slice.call(n)}catch(i){t=[];r(n,function(n){t.push(n)})}return t}var r=i(21);n.exports=u},function(n,t,i){"use strict";function f(n,t,i){var f=n.style;if(r(t)){f[t]=i;return}u(t,function(n,t){f[t]=n})}var r=i(9),u=i(26);n.exports=f},function(n,t,i){"use strict";function o(n){var t=Array.prototype.slice.call(arguments,1),s=n.classList,i=[],o;if(s){r(t,function(t){n.classList.add(t)});return}o=f(n);o&&(t=[].concat(o.split(/\s+/),t));r(t,function(n){u(n,i)<0&&i.push(n)});e(n,i)}var r=i(26),u=i(14),f=i(33),e=i(39);n.exports=o},function(n,t,i){"use strict";function o(n){var i=Array.prototype.slice.call(arguments,1),o=n.classList,s,t;if(o){r(i,function(n){o.remove(n)});return}s=f(n).split(/\s+/);t=[];r(s,function(n){u(n,i)<0&&t.push(n)});e(n,t)}var r=i(21),u=i(14),f=i(33),e=i(39);n.exports=o},function(n){"use strict";function t(n){for(var f=Object.prototype.hasOwnProperty,t,i,r=1,u=arguments.length;r<u;r+=1){t=arguments[r];for(i in t)f.call(t,i)&&(n[i]=t[i])}return n}n.exports=t},function(n){"use strict";function t(n){return n===undefined}n.exports=t},function(n){"use strict";function t(n){return typeof n=="string"||n instanceof String}n.exports=t},function(n){"use strict";function t(n,t,i){var r;i=i||null;for(r in n)if(n.hasOwnProperty(r)&&t.call(i,n[r],r,n)===!1)break}n.exports=t},function(n){"use strict";function i(){var f=window.navigator,e=f.appName.replace(/\s/g,"_"),n=f.userAgent,h=/MSIE\s([0-9]+[.0-9]*)/,c=/Trident.*rv:11\./,o=/Edge\/(\d+)\./,u={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},i,r,s={Microsoft_Internet_Explorer:function(){var i=n.match(h);i?(t.msie=!0,t.version=parseFloat(i[1])):t.others=!0},Netscape:function(){var f=!1;if(c.exec(n))t.msie=!0,t.version=11,f=!0;else if(o.exec(n))t.edge=!0,t.version=n.match(o)[1],f=!0;else for(i in u)if(u.hasOwnProperty(i)&&(r=n.match(u[i]),r&&r.length>1)){t[i]=f=!0;t.version=parseFloat(r[1]||0);break}f||(t.others=!0)}},l=s[e];l&&s[e]()}var t={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};typeof window!="undefined"&&window.navigator&&i();n.exports=t},function(n,t,i){"use strict";function h(){o()("editor","UA-129966929-1")}function c(n,t){return n.indexOf(t)!==-1}function l(n){if(!n)return null;var t={};return r.forEach(function(i){f()(n[i])||(t[i]=n[i])}),t}var r;i.d(t,"b",function(){return s});i.d(t,"d",function(){return h});i.d(t,"a",function(){return c});i.d(t,"c",function(){return l});var u=i(8),f=i.n(u),e=i(43),o=i.n(e),s=/Mac/.test(navigator.platform);r=["rel","target","contenteditable","hreflang","type"]},function(n,t,i){"use strict";function o(n,t){return e.call(n,t)}var u=i(14),f=i(3),r=Element.prototype,e=r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(n){var t=this.document||this.ownerDocument;return u(this,f(t.querySelectorAll(n)))>-1};n.exports=o},function(n,t,i){"use strict";function u(n,t,i){var u,f;if(i=i||0,!r(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,n,i);for(f=t.length,u=i;i>=0&&u<f;u+=1)if(t[u]===n)return u;return-1}var r=i(17);n.exports=u},function(t){t.exports=n},function(n,t,i){"use strict";function f(n,t){var i;return n.classList?n.classList.contains(t):(i=u(n).split(/\s+/),r(t,i)>-1)}var r=i(14),u=i(33);n.exports=f},function(n){"use strict";function t(n){return n instanceof Array}n.exports=t},function(n,t,i){"use strict";function l(n){return!Object(r.a)(f,n.type)}function a(n,t,i,r){var u=(n-t)/i;return u<1?u*r:r}function v(n){for(var t=document.querySelector('[data-nodeid="'+n.id+'"]');!t||Object(r.a)(c,n.type)||Object(u.k)(n);)n=n.parent,t=document.querySelector('[data-nodeid="'+n.id+'"]');return p(y(n))}function y(n){for(var t=n;n&&n!=="document";){if(n.type==="item"){t=n;break}n=n.parent}return{mdNode:t,node:document.querySelector('[data-nodeid="'+t.id+'"]')}}function p(n){for(var t=n.mdNode,i=n.node;Object(r.a)(f,t.type)&&t.firstChild;)t=t.firstChild,i=i.firstElementChild;return{mdNode:t,node:i}}function w(n,t){var i=Object(u.f)(n),f=Object(u.d)(n),o=t.lineInfo(i-1).handle.height,r=t.heightAtLine(f,"local")-t.heightAtLine(i-1,"local");return r<=0?o:r+e(t,Object(u.d)(n))}function e(n,t,i){var u,r,f;if(i===void 0&&(i=Number.MAX_VALUE),u=n.lineInfo(t),!u)return 0;for(r=u.handle,f=0;t<=i&&!r.text.trim();)f+=r.height,t+=1,r=n.lineInfo(t).handle;return f}function o(n,t){for(var i=0;n&&n!==t;){if(Object(r.a)(h,n.tagName)||(i+=n.offsetTop),n.offsetParent===t.offsetParent)break;n=n.parentElement}return i}function b(n,t){for(var i=t,f=null,e,r,h,u;i;){if(e=i,r=e.firstElementChild,!r)break;h=s(r,n,o(i,t));f=i;i=h}return u=i||f,u===t?null:u}function s(n,t,i){return n&&t>i+n.offsetTop?s(n.nextElementSibling,t,i)||n:null}function k(n){var i=n.latestScrollTop,u=n.scrollTop,t=n.targetScrollTop,r=n.sourceScrollTop;return i===null?t:i<u?Math.max(t,r):Math.min(t,r)}i.d(t,"h",function(){return l});i.d(t,"b",function(){return a});i.d(t,"f",function(){return v});i.d(t,"c",function(){return w});i.d(t,"e",function(){return e});i.d(t,"g",function(){return o});i.d(t,"a",function(){return b});i.d(t,"d",function(){return k});var r=i(12),u=i(2),f=["list","blockQuote"],h=["UL","OL","BLOCKQUOTE"],c=["TR","TH","TBODY","TD"]},function(n,t,i){"use strict";function o(n,t,i,e){if(f(t)){r(t.split(/\s+/g),function(t){u(n,t,i,e)});return}r(t,function(t,r){u(n,r,t,i)})}function u(n,t,i,r){function u(t){i.call(r||n,t||window.event)}"addEventListener"in n?n.addEventListener(t,u):"attachEvent"in n&&n.attachEvent("on"+t,u);s(n,t,i,u)}function s(n,t,i,u){var f=e(n,t),o=!1;r(f,function(n){return n.handler===i?(o=!0,!1):!0});o||f.push({handler:i,wrappedHandler:u})}var f=i(9),r=i(26),e=i(40);n.exports=o},function(n,t,i){"use strict";function s(n,t,i){if(e(t)){r(t.split(/\s+/g),function(t){u(n,t,i)});return}r(t,function(t,i){u(n,i,t)})}function u(n,t,i){var u=o(n,t),e;i?(r(u,function(r,u){return i===r.handler?(f(n,t,r.wrappedHandler),e=u,!1):!0}),u.splice(e,1)):(r(u,function(i){f(n,t,i.wrappedHandler)}),u.splice(0,u.length))}function f(n,t,i){"removeEventListener"in n?n.removeEventListener(t,i):"detachEvent"in n&&n.detachEvent("on"+t,i)}var e=i(9),r=i(26),o=i(40);n.exports=s},function(n){"use strict";function t(n,t,i){var r=0,u=n.length;for(i=i||null;r<u;r+=1)if(t.call(i,n[r],r,n)===!1)break}n.exports=t},function(n,t){!function(n,t){for(var i in t)n[i]=t[i]}(t,function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="/dist",t(t.s=11)}([function(n,t,i){"use strict";function s(n,t){function i(){this.constructor=n}u(n,t);n.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function h(n,t){var u={},i,r;for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(u[i[r]]=n[i[r]]);return u}function c(n,t,i,r){var f,e=arguments.length,u=e<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r,o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(f=n[o])&&(u=(e<3?f(u):e>3?f(t,i,u):f(t,i))||u);return e>3&&u&&Object.defineProperty(t,i,u),u}function l(n,t){return function(i,r){t(i,r,n)}}function a(n,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,t)}function v(n,t,i,r){return new(i||(i=Promise))(function(u,f){function o(n){try{e(r.next(n))}catch(n){f(n)}}function s(n){try{e(r.throw(n))}catch(n){f(n)}}function e(n){var t;n.done?u(n.value):(t=n.value,t instanceof i?t:new i(function(n){n(t)})).then(o,s)}e((r=r.apply(n,t||[])).next())})}function y(n,t){function o(e){return function(o){return function(e){if(f)throw new TypeError("Generator is already executing.");for(;r;)try{if(f=1,u&&(i=2&e[0]?u.return:e[0]?u.throw||((i=u.return)&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;switch(u=0,i&&(e=[2&e[0],i.value]),e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==e[0]&&2!==e[0])){r=0;continue}if(3===e[0]&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(6===e[0]&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(n){e=[6,n];u=0}finally{f=i=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,o])}}var f,u,i,e,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return e={next:o(0),"throw":o(1),"return":o(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e}function p(n,t,i,r){void 0===r&&(r=i);n[r]=t[i]}function w(n,t){for(var i in n)"default"===i||t.hasOwnProperty(i)||(t[i]=n[i])}function e(n){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&n[t],r=0;if(i)return i.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.");}function o(n,t){var i="function"==typeof Symbol&&n[Symbol.iterator],r,f,u,e;if(!i)return n;u=i.call(n);e=[];try{for(;(void 0===t||t-->0)&&!(r=u.next()).done;)e.push(r.value)}catch(n){f={error:n}}finally{try{r&&!r.done&&(i=u.return)&&i.call(u)}finally{if(f)throw f.error;}}return e}function b(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(o(arguments[t]));return n}function k(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function r(n){return this instanceof r?(this.v=n,this):new r(n)}function d(n,t,i){function o(n){s[n]&&(f[n]=function(t){return new Promise(function(i,r){u.push([n,t,i,r])>1||e(n,t)})})}function e(n,t){try{(i=s[n](t)).value instanceof r?Promise.resolve(i.value.v).then(c,l):h(u[0][2],i)}catch(n){h(u[0][3],n)}var i}function c(n){e("next",n)}function l(n){e("throw",n)}function h(n,t){n(t);u.shift();u.length&&e(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var f,s=i.apply(n,t||[]),u=[];return f={},o("next"),o("throw"),o("return"),f[Symbol.asyncIterator]=function(){return this},f}function g(n){function i(i,f){t[i]=n[i]?function(t){return(u=!u)?{value:r(n[i](t)),done:"return"===i}:f?f(t):t}:f}var t,u;return t={},i("next"),i("throw",function(n){throw n;}),i("return"),t[Symbol.iterator]=function(){return this},t}function nt(n){function i(i){t[i]=n[i]&&function(t){return new Promise(function(r,u){(function(n,t,i,r){Promise.resolve(r).then(function(t){n({value:t,done:i})},t)})(r,u,(t=n[i](t)).done,t.value)})}}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=n[Symbol.asyncIterator];return r?r.call(n):(n=e(n),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t)}function tt(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n}function it(n){var t,i;if(n&&n.__esModule)return n;if(t={},null!=n)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t.default=n,t}function rt(n){return n&&n.__esModule?n:{"default":n}}function ut(n,t){if(!t.has(n))throw new TypeError("attempted to get private field on non-instance");return t.get(n)}function ft(n,t,i){if(!t.has(n))throw new TypeError("attempted to set private field on non-instance");return t.set(n,i),i}var u,f;i.r(t);i.d(t,"__extends",function(){return s});i.d(t,"__assign",function(){return f});i.d(t,"__rest",function(){return h});i.d(t,"__decorate",function(){return c});i.d(t,"__param",function(){return l});i.d(t,"__metadata",function(){return a});i.d(t,"__awaiter",function(){return v});i.d(t,"__generator",function(){return y});i.d(t,"__createBinding",function(){return p});i.d(t,"__exportStar",function(){return w});i.d(t,"__values",function(){return e});i.d(t,"__read",function(){return o});i.d(t,"__spread",function(){return b});i.d(t,"__spreadArrays",function(){return k});i.d(t,"__await",function(){return r});i.d(t,"__asyncGenerator",function(){return d});i.d(t,"__asyncDelegator",function(){return g});i.d(t,"__asyncValues",function(){return nt});i.d(t,"__makeTemplateObject",function(){return tt});i.d(t,"__importStar",function(){return it});i.d(t,"__importDefault",function(){return rt});i.d(t,"__classPrivateFieldGet",function(){return ut});i.d(t,"__classPrivateFieldSet",function(){return ft});
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */
  u=function(n,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])})(n,t)};f=function(){return(f=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)}},function(n,t,i){"use strict";function b(n){switch(n.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":return!0;default:return!1}}function d(n,t){switch(n){case"heading":return new s(n,t);case"list":case"item":return new o(n,t);case"link":case"image":return new h(n,t);case"codeBlock":return new c(n,t);case"htmlBlock":return new l(n,t);case"table":return new v(n,t);case"tableCell":return new y(n,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":return new u(n,t);case"code":return new a(n,t);case"refDef":return new p(n,t);default:return new f(n,t)}}var r,w,k,e,f,u,o,s,h,c,l,a,v,y,p;Object.defineProperty(t,"__esModule",{value:!0});t.text=t.isRefDef=t.isTable=t.isList=t.isHeading=t.isHtmlBlock=t.isCodeBlock=t.createNode=t.RefDefNode=t.TableCellNode=t.TableNode=t.CodeNode=t.HtmlBlockNode=t.CodeBlockNode=t.LinkNode=t.HeadingNode=t.ListNode=t.BlockNode=t.Node=t.removeAllNode=t.removeNodeById=t.getNodeById=t.isContainer=void 0;r=i(0);w=r.__importDefault(i(18));t.isContainer=b;k=1;e={};t.getNodeById=function(n){return e[n]};t.removeNodeById=function(n){delete e[n]};t.removeAllNode=function(){e={}};f=function(){function n(n,t){this.parent=null;this.prev=null;this.next=null;this.firstChild=null;this.lastChild=null;this.literal=null;this.id="document"===n?-1:k++;this.type=n;this.sourcepos=t;e[this.id]=this}return n.prototype.isContainer=function(){return b(this)},n.prototype.unlink=function(){this.prev?this.prev.next=this.next:this.parent&&(this.parent.firstChild=this.next);this.next?this.next.prev=this.prev:this.parent&&(this.parent.lastChild=this.prev);this.parent=null;this.next=null;this.prev=null},n.prototype.replaceWith=function(n){this.insertBefore(n);this.unlink()},n.prototype.insertAfter=function(n){n.unlink();n.next=this.next;n.next&&(n.next.prev=n);n.prev=this;this.next=n;this.parent&&(n.parent=this.parent,n.next||(n.parent.lastChild=n))},n.prototype.insertBefore=function(n){n.unlink();n.prev=this.prev;n.prev&&(n.prev.next=n);n.next=this;this.prev=n;n.parent=this.parent;n.prev||(n.parent.firstChild=n)},n.prototype.appendChild=function(n){n.unlink();n.parent=this;this.lastChild?(this.lastChild.next=n,n.prev=this.lastChild,this.lastChild=n):(this.firstChild=n,this.lastChild=n)},n.prototype.prependChild=function(n){n.unlink();n.parent=this;this.firstChild?(this.firstChild.prev=n,n.next=this.firstChild,this.firstChild=n):(this.firstChild=n,this.lastChild=n)},n.prototype.walker=function(){return new w.default(this)},n}();t.Node=f;u=function(n){function t(t,i){var r=n.call(this,t,i)||this;return r.open=!0,r.lineOffsets=null,r.stringContent=null,r.lastLineBlank=!1,r.lastLineChecked=!1,r.customType=null,r.type=t,r}return r.__extends(t,n),t}(f);t.BlockNode=u;o=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.listData=null,t}return r.__extends(t,n),t}(u);t.ListNode=o;s=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return r.__extends(t,n),t}(u);t.HeadingNode=s;h=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.destination=null,t.title=null,t.extendedAutolink=!1,t}return r.__extends(t,n),t}(f);t.LinkNode=h;c=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.isFenced=!1,t.fenceChar=null,t.fenceLength=0,t.fenceOffset=-1,t.info=null,t.infoPadding=0,t}return r.__extends(t,n),t}(u);t.CodeBlockNode=c;l=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return r.__extends(t,n),t}(u);t.HtmlBlockNode=l;a=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.tickCount=0,t}return r.__extends(t,n),t}(f);t.CodeNode=a;v=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.columns=[],t}return r.__extends(t,n),t}(u);t.TableNode=v;y=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.startIdx=0,t.endIdx=0,t.paddingLeft=0,t.paddingRight=0,t.ignored=!1,t}return r.__extends(t,n),t}(u);t.TableCellNode=y;p=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return r.__extends(t,n),t}(u);t.RefDefNode=p;t.createNode=d;t.isCodeBlock=function(n){return"codeBlock"===n.type};t.isHtmlBlock=function(n){return"htmlBlock"===n.type};t.isHeading=function(n){return"heading"===n.type};t.isList=function(n){return"list"===n.type};t.isTable=function(n){return"table"===n.type};t.isRefDef=function(n){return"refDef"===n.type};t.text=function(n,t){var i=d("text",t);return i.literal=n,i}},function(n,t,i){"use strict";function h(n){switch(n){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return n}}var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});t.isEmpty=t.last=t.repeat=t.escapeXml=t.normalizeURI=t.unescapeString=t.ESCAPABLE=t.ENTITY=void 0;r=i(0).__importDefault(i(12));u=i(8);t.ENTITY="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});";f=/[\\&]/;t.ESCAPABLE="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]";var o=new RegExp("\\\\"+t.ESCAPABLE+"|"+t.ENTITY,"gi"),e=new RegExp('[&<>"]',"g"),s=function(n){return 92===n.charCodeAt(0)?n.charAt(1):u.decodeHTML(n)};t.unescapeString=function(n){return f.test(n)?n.replace(o,s):n};t.normalizeURI=function(n){try{return r.default(n)}catch(t){return n}};t.escapeXml=function(n){return e.test(n)?n.replace(e,h):n};t.repeat=function(n,t){for(var i=[],r=0;r<t;r++)i.push(n);return i.join("")};t.last=function(n){return n.length?n[n.length-1]:null};t.isEmpty=function(n){return!n||!/[^ \t]+/.test(n)}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.clearObj=t.isEmptyObj=t.omit=t.iterateObject=t.normalizeReference=t.last=void 0;var r=i(0);t.last=function(n){return n[n.length-1]};t.normalizeReference=function(n){return n.slice(1,n.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()};t.iterateObject=function(n,t){Object.keys(n).forEach(function(i){t(i,n[i])})};t.omit=function(n){for(var u,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return u=r.__assign({},n),i.forEach(function(n){delete u[n]}),u};t.isEmptyObj=function(n){return!Object.keys(n).length};t.clearObj=function(n){Object.keys(n).forEach(function(t){delete n[t]})}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isSpaceOrTab=t.isBlank=t.peek=t.endsWithBlankLine=t.reClosingCodeFence=t.reNonSpace=t.C_OPEN_BRACKET=t.C_SPACE=t.C_LESSTHAN=t.C_GREATERTHAN=t.C_NEWLINE=t.C_TAB=t.CODE_INDENT=void 0;t.CODE_INDENT=4;t.C_TAB=9;t.C_NEWLINE=10;t.C_GREATERTHAN=62;t.C_LESSTHAN=60;t.C_SPACE=32;t.C_OPEN_BRACKET=91;t.reNonSpace=/[^ \t\f\v\r\n]/;t.reClosingCodeFence=/^(?:`{3,}|~{3,})(?= *$)/;t.endsWithBlankLine=function(n){for(var i,t=n;t;){if(t.lastLineBlank)return!0;if(i=t.type,t.lastLineChecked||"list"!==i&&"item"!==i){t.lastLineChecked=!0;break}t.lastLineChecked=!0;t=t.lastChild}return!1};t.peek=function(n,t){return t<n.length?n.charCodeAt(t):-1};t.isBlank=function(n){return!t.reNonSpace.test(n)};t.isSpaceOrTab=function(n){return n===t.C_SPACE||n===t.C_TAB}},function(n,t,i){"use strict";function o(n){return{id:n.id,title:n.title,sourcepos:n.sourcepos,unlinked:!1,destination:n.dest}}var c;Object.defineProperty(t,"__esModule",{value:!0});t.ToastMark=t.createRefDefState=t.reLineEnding=void 0;var s=i(0),l=i(7),u=i(1),r=i(27),h=i(10),f=i(3),a=i(4),e=i(6);t.reLineEnding=/\r\n|\n|\r/;t.createRefDefState=o;c=function(){function n(n,i){this.refMap={};this.refLinkCandidateMap={};this.refDefCandidateMap={};this.referenceDefinition=!!(null==i?void 0:i.referenceDefinition);this.frontMatter=!!(null==i?void 0:i.frontMatter);this.parser=new l.Parser(i);this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap);this.eventHandlerMap={change:[]};n=n||"";this.lineTexts=n.split(t.reLineEnding);this.root=this.parser.parse(n)}return n.prototype.updateLineTexts=function(n,i,r){var h,f=n[0],l=n[1],c=i[0],a=i[1],u=r.split(t.reLineEnding),e=u.length,v=this.lineTexts[f-1],y=this.lineTexts[c-1],o;return u[0]=v.slice(0,l-1)+u[0],u[e-1]=u[e-1]+y.slice(a-1),o=c-f+1,(h=this.lineTexts).splice.apply(h,s.__spreadArrays([f-1,o],u)),e-o},n.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0])return this.root.lastLineBlank=!0,void(this.root.sourcepos=[[1,1],[1,0]]);this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var t=this.lineTexts,n=t.length-1;""===t[n];)n-=1;t.length-2>n&&(n+=1);this.root.sourcepos[1]=[n+1,t[n].length]},n.prototype.replaceRangeNodes=function(n,t,i){n?(r.insertNodesBefore(n,i),r.removeNextUntil(n,t),[n.id,t.id].forEach(function(n){return u.removeNodeById(n)}),n.unlink()):t?(r.insertNodesBefore(t,i),u.removeNodeById(t.id),t.unlink()):r.prependChildNodes(this.root,i)},n.prototype.getNodeRange=function(n,t){var u=r.findChildNodeAtLine(this.root,n[0]),i=r.findChildNodeAtLine(this.root,t[0]);return i&&i.next&&t[0]+1===i.next.sourcepos[0][0]&&(i=i.next),r.getRangeForCustomType(u,i)},n.prototype.trigger=function(n,t){this.eventHandlerMap[n].forEach(function(n){n(t)})},n.prototype.extendEndLine=function(n){for(;""===this.lineTexts[n];)n+=1;return n},n.prototype.parseRange=function(n,t,i,f){var s,c;n&&n.prev&&(u.isList(n.prev)&&function(n){var t=n.match(/^[ \t]+/),i;return t&&(t[0].length>=2||/\t/.test(t[0]))?!0:(i=t?n.slice(t.length):n,h.reBulletListMarker.test(i)||h.reOrderedListMarker.test(i))}(this.lineTexts[i-1])||u.isTable(n.prev)&&(s=this.lineTexts[i-1],!a.isBlank(s)&&-1!==s.indexOf("|")))&&(i=(n=n.prev).sourcepos[0][0]);for(var v=this.lineTexts.slice(i-1,f),l=this.parser.partialParseStart(i,v),e=t?t.next:this.root.firstChild,o=l.lastChild,y=o&&u.isCodeBlock(o),p=o&&u.isList(o);y&&e||p&&e&&("list"===e.type||e.sourcepos[0][1]>=2);)c=this.extendEndLine(e.sourcepos[1][0]),this.parser.partialParseExtends(this.lineTexts.slice(f,c)),n||(n=t),t=e,f=c,e=e.next;return this.parser.partialParseFinish(),{newNodes:r.getChildNodes(l),extStartNode:n,extEndNode:t}},n.prototype.getRemovedNodeRange=function(n,t){return!n||n&&u.isRefDef(n)||t&&u.isRefDef(t)?null:{id:[n.id,t.id],line:[n.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},n.prototype.markDeletedRefMap=function(n,t){var e=this,i;f.isEmptyObj(this.refMap)||(i=function(n){if(u.isRefDef(n)){var t=e.refMap[n.label];t&&n.id===t.id&&(t.unlinked=!0)}},n&&r.invokeNextUntil(i,n.parent,t),t&&r.invokeNextUntil(i,t))},n.prototype.replaceWithNewRefDefState=function(n){var t=this,i;f.isEmptyObj(this.refMap)||(i=function(n){if(u.isRefDef(n)){var i=n.label,r=t.refMap[i];r&&!r.unlinked||(t.refMap[i]=o(n))}},n.forEach(function(n){r.invokeNextUntil(i,n)}))},n.prototype.replaceWithRefDefCandidate=function(){var n=this;f.isEmptyObj(this.refDefCandidateMap)||f.iterateObject(this.refDefCandidateMap,function(t,i){var u=i.label,f=i.sourcepos,r=n.refMap[u];(!r||r.unlinked||r.sourcepos[0][0]>f[0][0])&&(n.refMap[u]=o(i))})},n.prototype.getRangeWithRefDef=function(n,t,i,e,o){if(this.referenceDefinition&&!f.isEmptyObj(this.refMap)){var s=r.findChildNodeAtLine(this.root,n-1),h=r.findChildNodeAtLine(this.root,t+1);s&&u.isRefDef(s)&&s!==i&&s!==e&&(n=(i=s).sourcepos[0][0]);h&&u.isRefDef(h)&&h!==i&&h!==e&&(e=h,t=this.extendEndLine(e.sourcepos[1][0]+o))}return[i,e,n,t]},n.prototype.parseWithFrontMatter=function(n,t,i){var o;void 0===i&&(i=0);var h=s.__spreadArrays(this.lineTexts),f=e.getFrontMatterPos(this.lineTexts),r=f[0],u=f[1];return r>-1&&u>-1&&(this.lineTexts[r]=e.frontMatterOpen,this.lineTexts[u]=e.frontMatterClose,r>=t[0]-1&&(t[0]=u+1),r<=n[0]-1&&u>=t[0]-1&&(n[0]=r+1,t[0]=u+1)),o=this.parse(n,t,i),this.lineTexts=h,o},n.prototype.parse=function(n,t,i){void 0===i&&(i=0);var h=this.getNodeRange(n,t),e=h[0],o=h[1],c=e?Math.min(e.sourcepos[0][0],n[0]):n[0],l=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+i),s=this.parseRange.apply(this,this.getRangeWithRefDef(c,l,e,o,i)),u=s.newNodes,f=s.extStartNode,r=s.extEndNode,a=this.getRemovedNodeRange(f,r),v=r?r.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(f,r),this.replaceRangeNodes(f,r,u),this.replaceWithNewRefDefState(u)):this.replaceRangeNodes(f,r,u),{nodes:u,removedNodeRange:a,nextNode:v}},n.prototype.parseRefLink=function(){var n=this,t=[];return f.isEmptyObj(this.refMap)||f.iterateObject(this.refMap,function(i,r){r.unlinked&&delete n.refMap[i];f.iterateObject(n.refLinkCandidateMap,function(r,u){var f=u.node;u.refLabel===i&&t.push(n.parse(f.sourcepos[0],f.sourcepos[1]))})}),t},n.prototype.removeUnlinkedCandidate=function(){f.isEmptyObj(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(n){f.iterateObject(n,function(t){r.isUnlinked(t)&&delete n[t]})})},n.prototype.editMarkdown=function(n,t,i){var e=this.updateLineTexts(n,t,i),o=this.frontMatter?this.parseWithFrontMatter(n,t,e):this.parse(n,t,e),s=f.omit(o,"nextNode"),u;return r.updateNextLineNumbers(o.nextNode,e),this.updateRootNodeState(),u=[s],this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),u=u.concat(this.parseRefLink())),this.trigger("change",u),u},n.prototype.getLineTexts=function(){return this.lineTexts},n.prototype.getRootNode=function(){return this.root},n.prototype.findNodeAtPosition=function(n){var t=r.findNodeAtPosition(this.root,n);return t&&t!==this.root?t:null},n.prototype.findFirstNodeAtLine=function(n){return r.findFirstNodeAtLine(this.root,n)},n.prototype.on=function(n,t){this.eventHandlerMap[n].push(t)},n.prototype.off=function(n,t){var i=this.eventHandlerMap[n],r=i.indexOf(t);i.splice(r,1)},n.prototype.findNodeById=function(n){return r.findNodeById(n)},n.prototype.removeAllNode=function(){u.removeAllNode()},n}();t.ToastMark=c},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getFrontMatterPos=t.replaceFrontMatter=t.frontMatterClose=t.frontMatterOpen=void 0;t.frontMatterOpen="{:f";t.frontMatterClose="f:}";var i=/^---$/,r=/^---$([\s\S]*)^---$/m;t.replaceFrontMatter=function(n){var i=n.trim();return/^---/.test(i)&&function(n){return r.test(n)}(i)?n.replace(r,t.frontMatterOpen+"$1"+t.frontMatterClose):n};t.getFrontMatterPos=function(n){for(var u,r=-1,f=-1,t=0;t<n.length;t+=1){if(u=n[t].trim(),r<0&&u&&!i.test(u)||f>0)break;i.test(u)&&(r<0?r=t:f=t)}return[r,f]}},function(n,t,i){"use strict";function e(){return f.createNode("document",[[1,1],[0,0]])}var h,c;Object.defineProperty(t,"__esModule",{value:!0});t.Parser=void 0;var u=i(0),l=i(2),f=i(1),o=i(19),r=i(22),a=i(4),s=i(10),v=i(3),y=i(6),p=i(26),w=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],b=/^[#`~*+_=<>0-9-]/,k=/\r\n|\n|\r/;h={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1};c=function(){function n(n){this.options=u.__assign(u.__assign({},h),n);this.doc=e();this.tip=this.doc;this.oldtip=this.doc;this.lineNumber=0;this.offset=0;this.column=0;this.nextNonspace=0;this.nextNonspaceColumn=0;this.indent=0;this.currentLine="";this.indented=!1;this.blank=!1;this.partiallyConsumedTab=!1;this.allClosed=!0;this.lastMatchedContainer=this.doc;this.refMap={};this.refLinkCandidateMap={};this.refDefCandidateMap={};this.lastLineLength=0;this.options.frontMatter&&(this.options.customParser=u.__assign(u.__assign({},p.frontMatterParser),this.options.customParser));this.inlineParser=new o.InlineParser(this.options)}return n.prototype.advanceOffset=function(n,t){void 0===t&&(t=!1);for(var i,r,u,f=this.currentLine;n>0&&(u=f[this.offset]);)"\t"===u?(i=4-this.column%4,t?(this.partiallyConsumedTab=i>n,r=i>n?n:i,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,n-=r):(this.partiallyConsumedTab=!1,this.column+=i,this.offset+=1,n-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,n-=1)},n.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace;this.column=this.nextNonspaceColumn;this.partiallyConsumedTab=!1},n.prototype.findNextNonspace=function(){for(var n,r=this.currentLine,t=this.offset,i=this.column;""!==(n=r.charAt(t));)if(" "===n)t++,i++;else{if("\t"!==n)break;t++;i+=4-i%4}this.blank="\n"===n||"\r"===n||""===n;this.nextNonspace=t;this.nextNonspaceColumn=i;this.indent=this.nextNonspaceColumn-this.column;this.indented=this.indent>=a.CODE_INDENT},n.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var n=4-this.column%4;this.tip.stringContent+=l.repeat(" ",n)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset];this.tip.stringContent+=this.currentLine.slice(this.offset)+"\n"},n.prototype.addChild=function(n,t){for(;!r.blockHandlers[this.tip.type].canContain(n);)this.finalize(this.tip,this.lineNumber-1);var u=t+1,i=f.createNode(n,[[this.lineNumber,u],[0,0]]);return i.stringContent="",this.tip.appendChild(i),this.tip=i,i},n.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var n=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1);this.oldtip=n}this.allClosed=!0}},n.prototype.finalize=function(n,t){var i=n.parent;n.open=!1;n.sourcepos[1]=[t,this.lastLineLength];r.blockHandlers[n.type].finalize(this,n);this.tip=i},n.prototype.processInlines=function(n){var r,u=this.options.customParser,e=n.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;r=e.next();){var i=r.node,f=r.entering,t=i.type;u&&u[t]&&u[t](i,{entering:f,options:this.options});f||"paragraph"!==t&&"heading"!==t&&("tableCell"!==t||i.ignored)||this.inlineParser.parse(i)}},n.prototype.incorporateLine=function(n){var t=this.doc,e,o,h,c,i,l;for(this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==n.indexOf("\0")&&(n=n.replace(/\0/g,"�")),this.currentLine=n,o=!0;(e=t.lastChild)&&e.open;){switch(t=e,this.findNextNonspace(),r.blockHandlers[t.type].continue(this,t)){case 0:break;case 1:o=!1;break;case 2:return void(this.lastLineLength=n.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2");}if(!o){t=t.parent;break}}for(this.allClosed=t===this.oldtip,this.lastMatchedContainer=t,h="paragraph"!==t.type&&r.blockHandlers[t.type].acceptsLines,c=s.blockStarts.length;!h;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!b.test(n.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(i=0;i<c;){if(l=s.blockStarts[i](this,t),1===l){t=this.tip;break}if(2===l){t=this.tip;h=!0;break}i++}if(i===c){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks();this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var a=t.type,v=this.blank&&!("blockQuote"===a||f.isCodeBlock(t)&&t.isFenced||"item"===a&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),u=t;u;)u.lastLineBlank=v,u=u.parent;r.blockHandlers[a].acceptsLines?(this.addLine(),f.isHtmlBlock(t)&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&w[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=n.length,this.finalize(t,this.lineNumber))):this.offset<n.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=n.length},n.prototype.parse=function(n){var r,t,i;for(this.options.frontMatter&&(n=y.replaceFrontMatter(n)),this.doc=e(),this.tip=this.doc,this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="",r=n.split(k),t=r.length,this.options.referenceDefinition&&this.clearRefMaps(),n.charCodeAt(n.length-1)===o.C_NEWLINE&&(t-=1),i=0;i<t;i++)this.incorporateLine(r[i]);for(;this.tip;)this.finalize(this.tip,t);return this.processInlines(this.doc),this.doc},n.prototype.partialParseStart=function(n,t){this.doc=e();this.tip=this.doc;this.lineNumber=n-1;this.lastLineLength=0;this.offset=0;this.column=0;this.lastMatchedContainer=this.doc;this.currentLine="";for(var r=t.length,i=0;i<r;i++)this.incorporateLine(t[i]);return this.doc},n.prototype.partialParseExtends=function(n){for(var t=0;t<n.length;t++)this.incorporateLine(n[t])},n.prototype.partialParseFinish=function(){for(;this.tip;)this.finalize(this.tip,this.lineNumber);this.processInlines(this.doc)},n.prototype.setRefMaps=function(n,t,i){this.refMap=n;this.refLinkCandidateMap=t;this.refDefCandidateMap=i},n.prototype.clearRefMaps=function(){[this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(n){v.clearObj(n)})},n}();t.Parser=c},function(n,t,i){"use strict";function o(n){var t=Object.keys(n).join("|"),i=s(n),r=new RegExp("&(?:"+(t+="|#[xX][\\da-fA-F]+|#\\d+")+");","g");return function(n){return String(n).replace(r,i)}}function s(n){return function(t){if("#"===t.charAt(1)){var i=t.charAt(2);return"X"===i||"x"===i?e.default(parseInt(t.substr(3),16)):e.default(parseInt(t.substr(2),10))}return n[t.slice(1,-1)]}}var r=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},f;Object.defineProperty(t,"__esModule",{value:!0});t.decodeHTML=t.decodeHTMLStrict=t.decodeXML=void 0;var u=r(i(13)),h=r(i(14)),c=r(i(15)),e=r(i(16));t.decodeXML=o(c.default);t.decodeHTMLStrict=o(u.default);f=function(n,t){return n<t?1:-1};t.decodeHTML=function(){function c(n){return";"!==n.substr(-1)&&(n+=";"),e(n)}for(var r,e,o=Object.keys(h.default).sort(f),n=Object.keys(u.default).sort(f),t=0,i=0;t<n.length;t++)o[i]===n[t]?(n[t]+=";?",i++):n[t]+=";";return r=new RegExp("&(?:"+n.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),e=s(u.default),function(n){return String(n).replace(r,c)}}()},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.reHtmlTag=t.CLOSETAG=t.OPENTAG=void 0;t.OPENTAG="<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>";t.CLOSETAG="<\/[A-Za-z][A-Za-z0-9-]*\\s*[>]";var i="(?:"+t.OPENTAG+"|"+t.CLOSETAG+"|<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)";t.reHtmlTag=new RegExp("^"+i,"i")},function(n,t,i){"use strict";function e(n,t){return n.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}Object.defineProperty(t,"__esModule",{value:!0});t.blockStarts=t.reOrderedListMarker=t.reBulletListMarker=void 0;var o=i(1),u=i(9),r=i(4),f=i(25),s=/^`{3,}(?!.*`)|^~{3,}/,h=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,new RegExp("^(?:"+u.OPENTAG+"|"+u.CLOSETAG+")\\s*$","i")],c=/^(?:=+|-+)[ \t]*$/,l=/^#{1,6}(?:[ \t]+|$)/,a=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/;t.reBulletListMarker=/^[*+-]/;t.reOrderedListMarker=/^(\d{1,9})([.)])/;t.blockStarts=[function(n){return n.indented||r.peek(n.currentLine,n.nextNonspace)!==r.C_GREATERTHAN?0:(n.advanceNextNonspace(),n.advanceOffset(1,!1),r.isSpaceOrTab(r.peek(n.currentLine,n.offset))&&n.advanceOffset(1,!0),n.closeUnmatchedBlocks(),n.addChild("blockQuote",n.nextNonspace),1)},function(n,t){var r,i;return!n.indented&&!e(n,t)&&(r=n.currentLine.slice(n.nextNonspace).match(l))?(n.advanceNextNonspace(),n.advanceOffset(r[0].length,!1),n.closeUnmatchedBlocks(),i=n.addChild("heading",n.nextNonspace),i.level=r[0].trim().length,i.headingType="atx",i.stringContent=n.currentLine.slice(n.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),n.advanceOffset(n.currentLine.length-n.offset),2):0},function(n){var i,r,t;return!n.indented&&(i=n.currentLine.slice(n.nextNonspace).match(s))?(r=i[0].length,n.closeUnmatchedBlocks(),t=n.addChild("codeBlock",n.nextNonspace),t.isFenced=!0,t.fenceLength=r,t.fenceChar=i[0][0],t.fenceOffset=n.indent,n.advanceNextNonspace(),n.advanceOffset(r,!1),2):0},function(n,t){var u;if(!n.indented&&r.peek(n.currentLine,n.nextNonspace)===r.C_LESSTHAN)for(var e=n.currentLine.slice(n.nextNonspace),f=n.options.disallowedHtmlBlockTags,i=void 0,i=1;i<=7;i++)if(u=e.match(h[i]),u)return 7===i&&("paragraph"===t.type||f.length>0&&new RegExp("<\/?(?:"+f.join("|")+")","i").test(u[0]))?0:(n.closeUnmatchedBlocks(),n.addChild("htmlBlock",n.offset).htmlBlockType=i,2);return 0},function(n,t){var f,u,i;if(null!==t.stringContent&&!n.indented&&"paragraph"===t.type&&!e(n,t.parent)&&(f=n.currentLine.slice(n.nextNonspace).match(c))){for(n.closeUnmatchedBlocks(),u=void 0;r.peek(t.stringContent,0)===r.C_OPEN_BRACKET&&(u=n.inlineParser.parseReference(t,n.refMap));)t.stringContent=t.stringContent.slice(u);return t.stringContent.length>0?(i=o.createNode("heading",t.sourcepos),i.level="="===f[0][0]?1:2,i.headingType="setext",i.stringContent=t.stringContent,t.insertAfter(i),t.unlink(),n.tip=i,n.advanceOffset(n.currentLine.length-n.offset,!1),2):0}return 0},function(n){return!n.indented&&a.test(n.currentLine.slice(n.nextNonspace))?(n.closeUnmatchedBlocks(),n.addChild("thematicBreak",n.nextNonspace),n.advanceOffset(n.currentLine.length-n.offset,!1),2):0},function(n,i){var u,f,e,o=i;return n.indented&&"list"!==i.type||!(u=function(n,i){var u,e,h=n.currentLine.slice(n.nextNonspace),f={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:n.indent,task:!1,checked:!1},o,c,l,s;if(n.indent>=4)return null;if(u=h.match(t.reBulletListMarker))f.type="bullet",f.bulletChar=u[0][0];else{if(!(u=h.match(t.reOrderedListMarker))||"paragraph"===i.type&&"1"!==u[1])return null;f.type="ordered";f.start=parseInt(u[1],10);f.delimiter=u[2]}if(-1!==(e=r.peek(n.currentLine,n.nextNonspace+u[0].length))&&e!==r.C_TAB&&e!==r.C_SPACE||"paragraph"===i.type&&!n.currentLine.slice(n.nextNonspace+u[0].length).match(r.reNonSpace))return null;n.advanceNextNonspace();n.advanceOffset(u[0].length,!0);o=n.column;c=n.offset;do n.advanceOffset(1,!0),e=r.peek(n.currentLine,n.offset);while(n.column-o<5&&r.isSpaceOrTab(e));return l=-1===r.peek(n.currentLine,n.offset),s=n.column-o,s>=5||s<1||l?(f.padding=u[0].length+1,n.column=o,n.offset=c,r.isSpaceOrTab(r.peek(n.currentLine,n.offset))&&n.advanceOffset(1,!0)):f.padding=u[0].length+s,f}(n,o))?0:(n.closeUnmatchedBlocks(),"list"===n.tip.type&&(f=o.listData,e=u,f.type===e.type&&f.delimiter===e.delimiter&&f.bulletChar===e.bulletChar)||((o=n.addChild("list",n.nextNonspace)).listData=u),(o=n.addChild("item",n.nextNonspace)).listData=u,1)},function(n){return n.indented&&"paragraph"!==n.tip.type&&!n.blank?(n.advanceOffset(r.CODE_INDENT,!0),n.closeUnmatchedBlocks(),n.addChild("codeBlock",n.offset),2):0},f.tableHead,f.tableBody]},function(n,t,i){"use strict";var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});r=i(5);Object.defineProperty(t,"ToastMark",{enumerable:!0,get:function(){return r.ToastMark}});u=i(28);Object.defineProperty(t,"createRenderHTML",{enumerable:!0,get:function(){return u.createRenderHTML}});f=i(7);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return f.Parser}})},function(n){"use strict";function t(n,r,u){var f,s,e,h,c,o="";for("string"!=typeof r&&(u=r,r=t.defaultChars),void 0===u&&(u=!0),c=function(n){var t,u,r=i[n];if(r)return r;for(r=i[n]=[],t=0;t<128;t++)u=String.fromCharCode(t),/^[0-9a-z]$/i.test(u)?r.push(u):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<n.length;t++)r[n.charCodeAt(t)]=n[t];return r}(r),f=0,s=n.length;f<s;f++)if(e=n.charCodeAt(f),u&&37===e&&f+2<s&&/^[0-9a-f]{2}$/i.test(n.slice(f+1,f+3)))o+=n.slice(f,f+3),f+=2;else if(e<128)o+=c[e];else if(e>=55296&&e<=57343){if(e>=55296&&e<=56319&&f+1<s&&(h=n.charCodeAt(f+1))>=56320&&h<=57343){o+=encodeURIComponent(n[f]+n[f+1]);f++;continue}o+="%EF%BF%BD"}else o+=encodeURIComponent(n[f]);return o}var i={};t.defaultChars=";/?:@&=+$,-_.!~*'()#";t.componentChars="-_.!~*'()";n.exports=t},function(n){n.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ﬃ","fflig":"ﬀ","ffllig":"ﬄ","Ffr":"𝔉","ffr":"𝔣","filig":"ﬁ","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"ﬂ","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"Ĳ","ijlig":"ĳ","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ŉ","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},function(n){n.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(n){n.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')},function(n,t,i){"use strict";var u=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},r;Object.defineProperty(t,"__esModule",{value:!0});r=u(i(17));t.default=function(n){if(n>=55296&&n<=57343||n>1114111)return"�";n in r.default&&(n=r.default[n]);var t="";return n>65535&&(n-=65536,t+=String.fromCharCode(n>>>10&1023|55296),n=56320|1023&n),t+String.fromCharCode(n)}},function(n){n.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1),u=function(){function n(n){this.current=n;this.root=n;this.entering=!0}return n.prototype.next=function(){var n=this.current,t=this.entering,i;return null===n?null:(i=r.isContainer(n),t&&i?n.firstChild?(this.current=n.firstChild,this.entering=!0):this.entering=!1:n===this.root?this.current=null:null===n.next?(this.current=n.parent,this.entering=!1):(this.current=n.next,this.entering=!0),{entering:t,node:n})},n.prototype.resumeAt=function(n,t){this.current=n;this.entering=!0===t},n}();t.default=u},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.InlineParser=t.C_NEWLINE=void 0;var v=i(0),r=i(1),u=i(2),y=i(9),f=v.__importDefault(i(20)),p=i(8),w=i(21),e=i(3),b=i(5);t.C_NEWLINE=10;var o="\\\\"+u.ESCAPABLE,h=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),k=new RegExp('^(?:"('+o+'|[^"\\x00])*"|\'('+o+"|[^'\\x00])*'|\\(("+o+"|[^()\\x00])*\\))"),d=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,c=new RegExp("^"+u.ESCAPABLE),g=new RegExp("^"+u.ENTITY,"i"),nt=/`+/,tt=/^`+/,it=/\.\.\./g,rt=/--+/g,ut=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,ft=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,et=/^ *(?:\n *)?/,s=/^[ \t\n\x0b\x0c\x0d]/,l=/^\s/,ot=/ *$/,st=/^ */,a=/^ *(?:\n|$)/,ht=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,ct=/^[^\n`\[\]\\!<&*_'"~]+/m,lt=function(){function n(n){this.subject="";this.delimiters=null;this.brackets=null;this.pos=0;this.lineStartNum=0;this.lineIdx=0;this.lineOffsets=[0];this.linePosOffset=0;this.refMap={};this.refLinkCandidateMap={};this.refDefCandidateMap={};this.options=n}return n.prototype.sourcepos=function(n,t){var i=this.linePosOffset+this.lineOffsets[this.lineIdx],r=this.lineStartNum+this.lineIdx,u=[r,n+i];return"number"==typeof t?[u,[r,t+i]]:u},n.prototype.nextLine=function(){this.lineIdx+=1;this.linePosOffset=-this.pos},n.prototype.match=function(n){var t=n.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},n.prototype.peek=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},n.prototype.spnl=function(){return this.match(et),!0},n.prototype.parseBackticks=function(n){var s=this.pos+1,i=this.match(tt),h,o,l,f;if(null===i)return!1;for(o=this.pos;null!==(h=this.match(nt));)if(h===i){var t=this.subject.slice(o,this.pos-i.length),c=this.sourcepos(s,this.pos),u=t.split("\n");return u.length>1&&(l=e.last(u),this.lineIdx+=u.length-1,this.linePosOffset=-(this.pos-l.length-i.length),c[1]=this.sourcepos(this.pos),t=u.join(" ")),f=r.createNode("code",c),f.literal=t.length>0&&null!==t.match(/[^ ]/)&&" "==t[0]&&" "==t[t.length-1]?t.slice(1,t.length-1):t,f.tickCount=i.length,n.appendChild(f),!0}return this.pos=o,n.appendChild(r.text(i,this.sourcepos(s,this.pos-1))),!0},n.prototype.parseBackslash=function(n){var u,f=this.subject,i;return this.pos+=1,i=this.pos,this.peek()===t.C_NEWLINE?(this.pos+=1,u=r.createNode("linebreak",this.sourcepos(this.pos-1,this.pos)),n.appendChild(u),this.nextLine()):c.test(f.charAt(this.pos))?(n.appendChild(r.text(f.charAt(this.pos),this.sourcepos(i,this.pos))),this.pos+=1):n.appendChild(r.text("\\",this.sourcepos(i,i))),!0},n.prototype.parseAutolink=function(n){var i,f,t,e=this.pos+1;return(i=this.match(ut))?(f=i.slice(1,i.length-1),(t=r.createNode("link",this.sourcepos(e,this.pos))).destination=u.normalizeURI("mailto:"+f),t.title="",t.appendChild(r.text(f,this.sourcepos(e+1,this.pos-1))),n.appendChild(t),!0):!!(i=this.match(ft))&&(f=i.slice(1,i.length-1),(t=r.createNode("link",this.sourcepos(e,this.pos))).destination=u.normalizeURI(f),t.title="",t.appendChild(r.text(f,this.sourcepos(e+1,this.pos-1))),n.appendChild(t),!0)},n.prototype.parseHtmlTag=function(n){var u=this.pos+1,i=this.match(y.reHtmlTag),t;return null===i?!1:(t=r.createNode("htmlInline",this.sourcepos(u,this.pos)),t.literal=i,n.appendChild(t),!0)},n.prototype.scanDelims=function(n){var t=0,r=this.pos,s,c,a;if(39===n||34===n)t++,this.pos++;else for(;this.peek()===n;)t++,this.pos++;if(0===t||t<2&&126===n)return this.pos=r,null;c=0===r?"\n":this.subject.charAt(r-1);a=this.peek();s=-1===a?"\n":f.default(a);var u,e,p=l.test(s),v=h.test(s),w=l.test(c),y=h.test(c),o=!p&&(!v||w||y),i=!w&&(!y||p||v);return 95===n?(u=o&&(!i||y),e=i&&(!o||v)):39===n||34===n?(u=o&&!i,e=i):(u=o,e=i),this.pos=r,{numdelims:t,canOpen:u,canClose:e}},n.prototype.handleDelim=function(n,t){var i=this.scanDelims(n),o,u,f,e;return i?(u=i.numdelims,f=this.pos+1,this.pos+=u,o=39===n?"’":34===n?"“":this.subject.slice(f-1,this.pos),e=r.text(o,this.sourcepos(f,this.pos)),t.appendChild(e),(i.canOpen||i.canClose)&&(this.options.smart||39!==n&&34!==n)&&(this.delimiters={cc:n,numdelims:u,origdelims:u,node:e,previous:this.delimiters,next:null,canOpen:i.canOpen,canClose:i.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0):!1},n.prototype.removeDelimiter=function(n){null!==n.previous&&(n.previous.next=n.next);null===n.next?this.delimiters=n.previous:n.next.previous=n.previous},n.prototype.removeDelimitersBetween=function(n,t){n.next!==t&&(n.next=t,t.previous=n)},n.prototype.processEmphasis=function(n){for(var c,i,a,f,o,l,w=!1,b=((c={})[95]=[n,n,n],c[42]=[n,n,n],c[39]=[n],c[34]=[n],c[126]=[n],c),e,s,u,v,h,p,g,t=this.delimiters;null!==t&&t.previous!==n;)t=t.previous;for(;null!==t;)if(e=t.cc,s=95===e||42===e,t.canClose){for(i=t.previous,l=!1;null!==i&&i!==n&&i!==b[e][s?t.origdelims%3:0];){if(w=s&&(t.canOpen||i.canClose)&&t.origdelims%3!=0&&(i.origdelims+t.origdelims)%3==0,i.cc===t.cc&&i.canOpen&&!w){l=!0;break}i=i.previous}if(a=t,s||126===e)if(l){if(i){u=t.numdelims>=2&&i.numdelims>=2?2:1;v=s?0:1;f=i.node;o=t.node;var y=r.createNode(s?1===u?"emph":"strong":"strike"),k=f.sourcepos[1],d=o.sourcepos[0];for(y.sourcepos=[[k[0],k[1]-u+1],[d[0],d[1]+u-1]],f.sourcepos[1][1]-=u,o.sourcepos[0][1]+=u,f.literal=f.literal.slice(u),o.literal=o.literal.slice(u),i.numdelims-=u,t.numdelims-=u,h=f.next,p=void 0;h&&h!==o;)p=h.next,h.unlink(),y.appendChild(h),h=p;(f.insertAfter(y),this.removeDelimitersBetween(i,t),i.numdelims<=v&&(0===i.numdelims&&f.unlink(),this.removeDelimiter(i)),t.numdelims<=v)&&(0===t.numdelims&&o.unlink(),g=t.next,this.removeDelimiter(t),t=g)}}else t=t.next;else 39===e?(t.node.literal="’",l&&(i.node.literal="‘"),t=t.next):34===e&&(t.node.literal="”",l&&(i.node.literal="“"),t=t.next);l||(b[e][s?a.origdelims%3:0]=a.previous,a.canOpen||this.removeDelimiter(a))}else t=t.next;for(;null!==this.delimiters&&this.delimiters!==n;)this.removeDelimiter(this.delimiters)},n.prototype.parseLinkTitle=function(){var n=this.match(k);return null===n?null:u.unescapeString(n.substr(1,n.length-2))},n.prototype.parseLinkDestination=function(){var t=this.match(d);if(null===t){if(60===this.peek())return null;for(var r=this.pos,i=0,n=void 0;-1!==(n=this.peek());)if(92===n&&c.test(this.subject.charAt(this.pos+1)))this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===n)this.pos+=1,i+=1;else if(41===n){if(i<1)break;this.pos+=1;i-=1}else{if(null!==s.exec(f.default(n)))break;this.pos+=1}return this.pos===r&&41!==n||0!==i?null:(t=this.subject.substr(r,this.pos-r),u.normalizeURI(u.unescapeString(t)))}return u.normalizeURI(u.unescapeString(t.substr(1,t.length-2)))},n.prototype.parseLinkLabel=function(){var n=this.match(ht);return null===n||n.length>1001?0:n.length},n.prototype.parseOpenBracket=function(n){var i=this.pos,t;return this.pos+=1,t=r.text("[",this.sourcepos(this.pos,this.pos)),n.appendChild(t),this.addBracket(t,i,!1),!0},n.prototype.parseBang=function(n){var i=this.pos,t;return(this.pos+=1,91===this.peek())?(this.pos+=1,t=r.text("![",this.sourcepos(this.pos-1,this.pos)),n.appendChild(t),this.addBracket(t,i+1,!0)):(t=r.text("!",this.sourcepos(this.pos,this.pos)),n.appendChild(t)),!0},n.prototype.parseCloseBracket=function(n){var a=null,v=null,h=!1,i,t,y,p,u,w,c,l,f,o,b;if(this.pos+=1,i=this.pos,t=this.brackets,null===t)return n.appendChild(r.text("]",this.sourcepos(i,i))),!0;if(!t.active)return n.appendChild(r.text("]",this.sourcepos(i,i))),this.removeBracket(),!0;if(y=t.image,p=this.pos,40===this.peek()&&(this.pos++,this.spnl()&&null!==(a=this.parseLinkDestination())&&this.spnl()&&(s.test(this.subject.charAt(this.pos-1))&&(v=this.parseLinkTitle()),1)&&this.spnl()&&41===this.peek()?(this.pos+=1,h=!0):this.pos=p),u="",h||(w=this.pos,c=this.parseLinkLabel(),(c>2?u=this.subject.slice(w,w+c):t.bracketAfter||(u=this.subject.slice(t.index,i)),0===c&&(this.pos=p),u)&&(u=e.normalizeReference(u),l=this.refMap[u],l&&(a=l.destination,v=l.title,h=!0))),h){for(f=r.createNode(y?"image":"link"),f.destination=a,f.title=v||"",f.sourcepos=[t.startpos,this.sourcepos(this.pos)],o=t.node.next,b=void 0;o;)b=o.next,o.unlink(),f.appendChild(o),o=b;if(n.appendChild(f),this.processEmphasis(t.previousDelimiter),this.removeBracket(),t.node.unlink(),!y)for(t=this.brackets;null!==t;)t.image||(t.active=!1),t=t.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[n.id]={node:n,refLabel:u}),!0}return this.removeBracket(),this.pos=i,n.appendChild(r.text("]",this.sourcepos(i,i))),this.options.referenceDefinition&&(this.refLinkCandidateMap[n.id]={node:n,refLabel:u}),!0},n.prototype.addBracket=function(n,t,i){null!==this.brackets&&(this.brackets.bracketAfter=!0);this.brackets={node:n,startpos:this.sourcepos(t+(i?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:i,active:!0}},n.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},n.prototype.parseEntity=function(n){var t,i=this.pos+1;return!!(t=this.match(g))&&(n.appendChild(r.text(p.decodeHTML(t),this.sourcepos(i,this.pos))),!0)},n.prototype.parseString=function(n){var t,i=this.pos+1,f,e;return(t=this.match(ct))?(this.options.smart?(f=t.replace(it,"…").replace(rt,function(n){var t=0,i=0;return n.length%3==0?i=n.length/3:n.length%2==0?t=n.length/2:n.length%3==2?(t=1,i=(n.length-2)/3):(t=2,i=(n.length-4)/3),u.repeat("—",i)+u.repeat("–",t)}),n.appendChild(r.text(f,this.sourcepos(i,this.pos)))):(e=r.text(t,this.sourcepos(i,this.pos)),n.appendChild(e)),!0):!1},n.prototype.parseNewline=function(n){var t,u,f,i;return this.pos+=1,t=n.lastChild,t&&"text"===t.type&&" "===t.literal[t.literal.length-1]?(u=" "===t.literal[t.literal.length-2],f=t.literal.length,t.literal=t.literal.replace(ot,""),i=f-t.literal.length,t.sourcepos[1][1]-=i,n.appendChild(r.createNode(u?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))):n.appendChild(r.createNode("softbreak",this.sourcepos(this.pos,this.pos))),this.nextLine(),this.match(st),!0},n.prototype.parseReference=function(n,t){var y,c,s,h,o,l,i;if(!this.options.referenceDefinition)return 0;this.subject=n.stringContent;this.pos=0;var u=null,f=this.pos,v=this.parseLinkLabel();return 0===v?0:(y=this.subject.substr(0,v),58!==this.peek())?(this.pos=f,0):(this.pos++,this.spnl(),c=this.parseLinkDestination(),null===c)?(this.pos=f,0):(s=this.pos,this.spnl(),this.pos!==s&&(u=this.parseLinkTitle()),null===u&&(u="",this.pos=s),h=!0,null===this.match(a)&&(""===u?h=!1:(u="",this.pos=s,h=null!==this.match(a))),!h)?(this.pos=f,0):(o=e.normalizeReference(y),""===o)?(this.pos=f,0):(l=this.getReferenceDefSourcepos(n),n.sourcepos[0][0]=l[1][0]+1,i=r.createNode("refDef",l),i.title=u,i.dest=c,i.label=o,n.insertBefore(i),t[o]?this.refDefCandidateMap[i.id]=i:t[o]=b.createRefDefState(i),this.pos-f)},n.prototype.mergeTextNodes=function(n){for(var f,o,e,i,u,r,t=[];f=n.next();)if(o=f.entering,e=f.node,o&&"text"===e.type)t.push(e);else if(1===t.length)t=[];else if(t.length>1){for(i=t[0],u=t[t.length-1],i.sourcepos&&u.sourcepos&&(i.sourcepos[1]=u.sourcepos[1]),i.next=u.next,i.next&&(i.next.prev=i),r=1;r<t.length;r+=1)i.literal+=t[r].literal,t[r].unlink();t=[]}},n.prototype.getReferenceDefSourcepos=function(n){for(var t,e,o,u=n.stringContent.split(/\n|\r\n/),h=!1,f=0,r={line:0,ch:0},i=0;i<u.length;i+=1){if(t=u[i],s.test(t))break;if(/\:/.test(t)&&0===f){if(h)break;e=t.indexOf(":")===t.length-1?i+1:i;r={line:e,ch:u[e].length};h=!0}if(o=t.match(/'|"/g),o&&(f+=o.length),2===f){r={line:i,ch:t.length};break}}return[[n.sourcepos[0][0],n.sourcepos[0][1]],[n.sourcepos[0][0]+r.line,r.ch]]},n.prototype.parseInline=function(n){var e,i=!1,u=this.peek();if(-1===u)return!1;switch(u){case t.C_NEWLINE:i=this.parseNewline(n);break;case 92:i=this.parseBackslash(n);break;case 96:i=this.parseBackticks(n);break;case 42:case 95:case 126:i=this.handleDelim(u,n);break;case 39:case 34:i=!!(null===(e=this.options)||void 0===e?void 0:e.smart)&&this.handleDelim(u,n);break;case 91:i=this.parseOpenBracket(n);break;case 33:i=this.parseBang(n);break;case 93:i=this.parseCloseBracket(n);break;case 60:i=this.parseAutolink(n)||this.parseHtmlTag(n);break;case 38:i=this.parseEntity(n);break;default:i=this.parseString(n)}return i||(this.pos+=1,n.appendChild(r.text(f.default(u),this.sourcepos(this.pos,this.pos+1)))),!0},n.prototype.parse=function(n){var u,o,t,s;for(this.subject=n.stringContent.trim(),this.pos=0,this.delimiters=null,this.brackets=null,this.lineOffsets=n.lineOffsets||[0],this.lineIdx=0,this.linePosOffset=0,this.lineStartNum=n.sourcepos[0][0],r.isHeading(n)&&(this.lineOffsets[0]+=n.level+1);this.parseInline(n););n.stringContent=null;this.processEmphasis(null);this.mergeTextNodes(n.walker());var f=this.options,e=f.extendedAutolinks,i=f.customParser;if(e&&w.convertExtAutoLinks(n.walker(),e),i&&n.firstChild)for(o=n.firstChild.walker();u=o.next();)t=u.node,s=u.entering,i[t.type]&&i[t.type](t,{entering:s,options:this.options})},n}();t.InlineParser=lt},function(n,t){"use strict";
  /*! http://mths.be/fromcodepoint v0.2.1 by @mathias */
  var i,r,u;(Object.defineProperty(t,"__esModule",{value:!0}),String.fromCodePoint)?i=function(n){try{return String.fromCodePoint(n)}catch(n){if(n instanceof RangeError)return String.fromCharCode(65533);throw n;}}:(r=String.fromCharCode,u=Math.floor,i=function(){for(var s,n,f=[],t=0;t<arguments.length;t++)f[t]=arguments[t];var h,c,i=[],e=-1,o=f.length;if(!o)return"";for(s="";++e<o;){if(n=Number(f[e]),!isFinite(n)||n<0||n>1114111||u(n)!==n)return String.fromCharCode(65533);n<=65535?i.push(n):(h=55296+((n-=65536)>>10),c=n%1024+56320,i.push(h,c));(e+1===o||i.length>16384)&&(s+=r.apply(void 0,i),i.length=0)}return s});t.default=i},function(n,t,i){"use strict";function o(n){var u=/\)+$/.exec(n),r,e;if(u){for(var t=0,i=0,f=n;i<f.length;i++)r=f[i],"("===r?t<0?t=1:t+=1:")"===r&&(t-=1);if(t<0)return e=Math.min(-t,u[0].length),n.substring(0,n.length-e)}return n}function s(n){return n.replace(/&[A-Za-z0-9]+;$/,"")}function u(n){for(var i,t,u=new RegExp("[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+","g"),r=[];i=u.exec(n);)t=i[0],/[_-]+$/.test(t)||r.push({text:t,range:[i.index,i.index+t.length-1],url:"mailto:"+t});return r}function f(n){for(var t,i,f,u=new RegExp("(www|https?://).(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+[^<\\s]*[^<?!.,:*_?~\\s]","g"),r=[];t=u.exec(n);)i=s(o(t[0])),f="www"===t[1]?"http://":"",r.push({text:i,range:[t.index,t.index+i.length-1],url:""+f+i});return r}function h(n){return e.__spreadArrays(f(n),u(n)).sort(function(n,t){return n.range[0]-t.range[0]})}Object.defineProperty(t,"__esModule",{value:!0});t.convertExtAutoLinks=t.parseUrlLink=t.parseEmailLink=void 0;var e=i(0),r=i(1);t.parseEmailLink=u;t.parseUrlLink=f;t.convertExtAutoLinks=function(n,t){var i,u;for("boolean"==typeof t&&(t=h),u=function(){var g=i.entering,u=i.node,f,s,o,l,y,d;if(g&&"text"===u.type&&"link"!==u.parent.type){if(f=u.literal,s=t(f),!s||!s.length)return"continue";for(var n=0,p=u.sourcepos[0],w=p[0],b=p[1],h=function(n,t){return[[w,b+n],[w,b+t]]},c=[],a=0,k=s;a<k.length;a++){var v=k[a],e=v.range,nt=v.url,tt=v.text;e[0]>n&&c.push(r.text(f.substring(n,e[0]),h(n,e[0]-1)));o=r.createNode("link",h.apply(void 0,e));o.appendChild(r.text(tt,h.apply(void 0,e)));o.destination=nt;o.extendedAutolink=!0;c.push(o);n=e[1]+1}for(n<f.length&&c.push(r.text(f.substring(n),h(n,f.length-1))),l=0,y=c;l<y.length;l++)d=y[l],u.insertBefore(d);u.unlink()}};i=n.next();)u()}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.blockHandlers=void 0;var f=i(23),u=i(24),r=i(4),e=i(2),o={"continue":function(){return 0},finalize:function(n,t){for(var u,i=t.firstChild;i;){if(r.endsWithBlankLine(i)&&i.next){t.listData.tight=!1;break}for(u=i.firstChild;u;){if(r.endsWithBlankLine(u)&&(i.next||u.next)){t.listData.tight=!1;break}u=u.next}i=i.next}},canContain:function(n){return"item"===n},acceptsLines:!1},s={"continue":function(n){var t=n.currentLine;return n.indented||r.peek(t,n.nextNonspace)!==r.C_GREATERTHAN?1:(n.advanceNextNonspace(),n.advanceOffset(1,!1),r.isSpaceOrTab(r.peek(t,n.offset))&&n.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(n){return"item"!==n},acceptsLines:!1},h={"continue":function(n,t){if(n.blank){if(null===t.firstChild)return 1;n.advanceNextNonspace()}else{if(!(n.indent>=t.listData.markerOffset+t.listData.padding))return 1;n.advanceOffset(t.listData.markerOffset+t.listData.padding,!0)}return 0},finalize:f.taskListItemFinalize,canContain:function(n){return"item"!==n},acceptsLines:!1},c={"continue":function(n,t){var u=n.currentLine,f=n.indent,i,e;if(t.isFenced){if(i=f<=3&&u.charAt(n.nextNonspace)===t.fenceChar&&u.slice(n.nextNonspace).match(r.reClosingCodeFence),i&&i[0].length>=t.fenceLength)return n.lastLineLength=n.offset+f+i[0].length,n.finalize(t,n.lineNumber),2;for(e=t.fenceOffset;e>0&&r.isSpaceOrTab(r.peek(u,n.offset));)n.advanceOffset(1,!0),e--}else if(f>=r.CODE_INDENT)n.advanceOffset(r.CODE_INDENT,!0);else{if(!n.blank)return 1;n.advanceNextNonspace()}return 0},finalize:function(n,t){var i;if(null!==t.stringContent){if(t.isFenced){var r=t.stringContent,u=r.indexOf("\n"),o=r.slice(0,u),s=r.slice(u+1),f=o.match(/^(\s*)(.*)/);t.infoPadding=f[1].length;t.info=e.unescapeString(f[2].trim());t.literal=s}else t.literal=null===(i=t.stringContent)||void 0===i?void 0:i.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},l={"continue":function(n){return n.blank?1:0},finalize:function(n,t){if(null!==t.stringContent){for(var i,u=!1;r.peek(t.stringContent,0)===r.C_OPEN_BRACKET&&(i=n.inlineParser.parseReference(t,n.refMap));)t.stringContent=t.stringContent.slice(i),u=!0;u&&r.isBlank(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0};t.blockHandlers={document:{"continue":function(){return 0},finalize:function(){},canContain:function(n){return"item"!==n},acceptsLines:!1},list:o,blockQuote:s,item:h,heading:{"continue":function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematicBreak:{"continue":function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},codeBlock:c,htmlBlock:{"continue":function(n,t){return!n.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(n,t){var i;t.literal=(null===(i=t.stringContent)||void 0===i?void 0:i.replace(/(\n *)+$/,""))||null;t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:l,table:u.table,tableBody:u.tableBody,tableHead:u.tableHead,tableRow:u.tableRow,tableCell:u.tableCell,tableDelimRow:u.tableDelimRow,tableDelimCell:u.tableDelimCell,refDef:{"continue":function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0}}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.taskListItemFinalize=void 0;var i=/^\[([ \txX])\][ \t]+/;t.taskListItemFinalize=function(n,t){var r,u,f;t.firstChild&&"paragraph"===t.firstChild.type&&(r=t.firstChild,u=r.stringContent.match(i),u&&(f=u[0].length,r.stringContent=r.stringContent.substring(f-1),r.sourcepos[0][1]+=f,r.lineOffsets[0]+=f,t.listData.task=!0,t.listData.checked=/[xX]/.test(u[1])))}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.tableCell=t.tableRow=t.tableDelimCell=t.tableDelimRow=t.tableHead=t.tableBody=t.table=void 0;t.table={"continue":function(){return 0},finalize:function(){},canContain:function(n){return"tableHead"===n||"tableBody"===n},acceptsLines:!1};t.tableBody={"continue":function(){return 0},finalize:function(){},canContain:function(n){return"tableRow"===n},acceptsLines:!1};t.tableHead={"continue":function(){return 1},finalize:function(){},canContain:function(n){return"tableRow"===n||"tableDelimRow"===n},acceptsLines:!1};t.tableDelimRow={"continue":function(){return 1},finalize:function(){},canContain:function(n){return"tableDelimCell"===n},acceptsLines:!1};t.tableDelimCell={"continue":function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1};t.tableRow={"continue":function(){return 1},finalize:function(){},canContain:function(n){return"tableCell"===n},acceptsLines:!1};t.tableCell={"continue":function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1}},function(n,t,i){"use strict";function u(n){for(var i,r=0,f=0,u=[],t=0;t<n.length;t+=1)"|"===n[t]&&"\\"!==n[t-1]&&(i=n.substring(r,t),0===r&&e.isEmpty(i)?f=t+1:u.push(i),r=t+1);return r<n.length&&(i=n.substring(r,n.length),e.isEmpty(i)||u.push(i)),[f,u]}function f(n,t,i,u){for(var a,p,f,s=[],c=0,v=t;c<v.length;c++){var e=v[c],y=e.match(/^[ \t]+/),o=y?y[0].length:0,h=void 0,l=void 0;o===e.length?(o=0,h=0,l=""):(a=e.match(/[ \t]+$/),h=a?a[0].length:0,l=e.slice(o,e.length-h));p=u+o;f=r.createNode(n,[[i,u],[i,u+e.length-1]]);f.stringContent=l.replace(/\\\|/g,"|");f.startIdx=s.length;f.endIdx=s.length;f.lineOffsets=[p-1];f.paddingLeft=o;f.paddingRight=h;s.push(f);u+=e.length+1}return s}function s(n){var i="left",t=n.stringContent,r=t[0];return":"===t[t.length-1]&&(i=":"===r?"center":"right"),{align:i}}Object.defineProperty(t,"__esModule",{value:!0});t.tableBody=t.tableHead=void 0;var e=i(2),r=i(1),o=i(3);t.tableHead=function(n,t){var e=t.stringContent,rt,y,p,w,b;if("paragraph"===t.type&&!n.indented&&!n.blank){var k=e.length-1,a=e.lastIndexOf("\n",k-1)+1,d=e.slice(a,k),g=n.currentLine.slice(n.nextNonspace),nt=u(d),ut=nt[0],tt=nt[1],it=u(g),ft=it[0],h=it[1],et=/^[ \t]*:?-+:?[ \t]*$/;if(!tt.length||!h.length||h.some(function(n){return!et.test(n)})||1===h.length&&0!==g.indexOf("|"))return 0;var v=t.lineOffsets,i=n.lineNumber-1,c=o.last(v)+1,l=r.createNode("table",[[i,c],[n.lineNumber,n.offset]]);return(l.columns=h.map(function(){return{align:"left"}}),t.insertAfter(l),1===v.length)?t.unlink():(t.stringContent=e.slice(0,a),rt=a-(e.lastIndexOf("\n",a-2)+1)-1,n.lastLineLength=v[v.length-2]+rt,n.finalize(t,i-1)),n.advanceOffset(n.currentLine.length-n.offset,!1),y=r.createNode("tableHead",[[i,c],[n.lineNumber,n.offset]]),l.appendChild(y),p=r.createNode("tableRow",[[i,c],[i,c+d.length-1]]),w=r.createNode("tableDelimRow",[[n.lineNumber,n.nextNonspace+1],[n.lineNumber,n.offset]]),y.appendChild(p),y.appendChild(w),f("tableCell",tt,i,c+ut).forEach(function(n){p.appendChild(n)}),b=f("tableDelimCell",h,n.lineNumber,n.nextNonspace+1+ft),b.forEach(function(n){w.appendChild(n)}),l.columns=b.map(s),n.tip=l,2}return 0};t.tableBody=function(n,t){var e,i,o;if("table"!==t.type&&"tableBody"!==t.type||!n.blank&&-1===n.currentLine.indexOf("|"))return 0;if(n.advanceOffset(n.currentLine.length-n.offset,!1),n.blank)return e=t,"tableBody"===t.type&&(e=t.parent,n.finalize(t,n.lineNumber)),n.finalize(e,n.lineNumber),0;i=t;"table"===t.type&&((i=n.addChild("tableBody",n.nextNonspace)).stringContent=null);o=r.createNode("tableRow",[[n.lineNumber,n.nextNonspace+1],[n.lineNumber,n.currentLine.length]]);i.appendChild(o);var h=i.parent,s=u(n.currentLine.slice(n.nextNonspace)),c=s[0];return f("tableCell",s[1],n.lineNumber,n.nextNonspace+1+c).forEach(function(n,t){t>=h.columns.length&&(n.ignored=!0);o.appendChild(n)}),2}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.frontMatterParser=void 0;var e=i(1),f=i(5),r=i(6),o=new RegExp(r.frontMatterOpen),s=new RegExp(r.frontMatterClose),h=new RegExp(r.frontMatterClose+"$"),u=!1;t.frontMatterParser={paragraph:function(n,t){var l,it=t.entering,rt=t.options,ut=n.type,ft=n.stringContent;if(rt.frontMatter&&it&&"paragraph"===ut){var i=(ft||"").trim(),v=[o.test(i),s.test(i)],y=v[0],a=v[1];if((y||a)&&(u=!0),u&&(n.customType="frontMatter"),a&&(u=!1,!h.test(i))){var p=r.frontMatterClose.length,w=i.indexOf(r.frontMatterClose),b=i.substring(0,w+p),k=b.split(f.reLineEnding).length;n.sourcepos[1][0]=n.sourcepos[0][0]+k-1;n.sourcepos[1][1]=3;n.stringContent=b;var et=null===(l=n.lineOffsets)||void 0===l?void 0:l.splice(k),d=n.sourcepos[1][0],g=i.substring(w+p+1),nt=g.split(f.reLineEnding),tt=nt.length,c=e.createNode("paragraph",[[d+1,1],[d+tt,nt[tt-1].length]]);c.stringContent=g;c.open=!1;c.lineOffsets=et;n.insertAfter(c)}(y||a)&&(n.stringContent=n.stringContent.replace(new RegExp(r.frontMatterOpen+"|"+r.frontMatterClose,"g"),"---"))}}}},function(n,t,i){"use strict";function f(n,t){return n[0]<t[0]?1:n[0]>t[0]?-1:n[1]<t[1]?1:n[1]>t[1]?-1:0}function o(n,t){var i=n[0];return 1===f(n[1],t)?1:-1===f(i,t)?-1:0}function r(n,t){var i=n[0];return n[1][0]<t?1:i[0]>t?-1:0}function e(n){return u.getNodeById(n)||null}Object.defineProperty(t,"__esModule",{value:!0});t.getRangeForCustomType=t.isUnlinked=t.invokeNextUntil=t.findNodeById=t.toString=t.findNodeAtPosition=t.findFirstNodeAtLine=t.findChildNodeAtLine=t.updateNextLineNumbers=t.prependChildNodes=t.insertNodesBefore=t.getChildNodes=t.removeNextUntil=t.getAllParents=void 0;var u=i(1);t.getAllParents=function(n){for(var t=[];n.parent;)t.push(n.parent),n=n.parent;return t.reverse()};t.removeNextUntil=function(n,t){var i,r;if(n.parent===t.parent&&n!==t){for(i=n.next;i&&i!==t;){for(var o=i.next,f=0,e=["parent","prev","next"];f<e.length;f++)r=e[f],i[r]&&(u.removeNodeById(i[r].id),i[r]=null);i=o}n.next=t.next;t.next?t.next.prev=n:n.parent.lastChild=n}};t.getChildNodes=function(n){for(var i=[],t=n.firstChild;t;)i.push(t),t=t.next;return i};t.insertNodesBefore=function(n,t){for(var u,i=0,r=t;i<r.length;i++)u=r[i],n.insertBefore(u)};t.prependChildNodes=function(n,t){for(var i=t.length-1;i>=0;i-=1)n.prependChild(t[i])};t.updateNextLineNumbers=function(n,t){var i,r,u;if(n&&n.parent&&0!==t)for(r=n.parent.walker(),r.resumeAt(n,!0);i=r.next();)u=i.node,i.entering&&(u.sourcepos[0][0]+=t,u.sourcepos[1][0]+=t)};t.findChildNodeAtLine=function(n,t){for(var u,i=n.firstChild;i;){if(u=r(i.sourcepos,t),0===u)return i;if(-1===u)return i.prev||i;i=i.next}return n.lastChild};t.findFirstNodeAtLine=function(n,t){for(var f,i=n.firstChild,u=null;i;)if(f=r(i.sourcepos,t),0===f){if(i.sourcepos[0][0]===t||!i.firstChild)return i;u=i;i=i.firstChild}else{if(-1===f)break;u=i;i=i.next}return u?function(n){for(;n.parent&&"document"!==n.parent.type&&n.parent.sourcepos[0][0]===n.sourcepos[0][0];)n=n.parent;return n}(function(n){for(;n.lastChild;)n=n.lastChild;return n}(u)):null};t.findNodeAtPosition=function(n,t){for(var u,i=n,r=null;i;)if(u=o(i.sourcepos,t),0===u){if(!i.firstChild)return i;r=i;i=i.firstChild}else{if(-1===u||!i.next)return r;i=i.next}return i};t.toString=function(n){return n?"type: "+n.type+", sourcepos: "+n.sourcepos+", firstChild: "+(n.firstChild&&n.firstChild.type)+", lastChild: "+(n.lastChild&&n.lastChild.type)+", prev: "+(n.prev&&n.prev.type)+", next: "+(n.next&&n.next.type):"null"};t.findNodeById=e;t.invokeNextUntil=function(n,t,i){var u,r;if(void 0===i&&(i=null),t)for(u=t.walker();t&&t!==i;){if(n(t),r=u.next(),!r)break;t=r.node}};t.isUnlinked=function(n){var t=e(n);if(!t)return!0;for(;t&&"document"!==t.type;){if(!t.parent&&!t.prev&&!t.next)return!0;t=t.parent}return!1};t.getRangeForCustomType=function(n,t){var i=[n,t];return[{node:n,type:"prev"},{node:t,type:"next"}].forEach(function(n,t){for(var u=n.node,f=n.type;u&&u.customType&&u[f];){var e=u[f],o=e.sourcepos,s=e.customType,h="prev"===f?1===r(o,u.sourcepos[0][0]):-1===r(o,u.sourcepos[1][0]);if(!s||!h)break;u=e;i[t]=u}}),i}},function(n,t,i){"use strict";function f(n){n.length&&"\n"!==e.last(e.last(n))&&n.push("\n")}function u(n,t){n.outerNewLine&&f(t)}function o(n,t){n.innerNewLine&&f(t)}function v(n){for(var t,i=[],u=n.walker(),r=null;r=u.next();)t=r.node,"text"===t.type&&i.push(t.literal);return i.join("")}Object.defineProperty(t,"__esModule",{value:!0});t.createRenderHTML=void 0;var r=i(0),s=i(1),h=i(2),e=i(3),c=i(29),l=i(31),a={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1,customProp:{}};t.createRenderHTML=function(n){var t=r.__assign(r.__assign({},a),n),i=r.__assign({},c.baseConvertors),e;return(t.gfm&&(i=r.__assign(r.__assign({},i),l.gfmConvertors)),t.convertors)&&(e=t.convertors,Object.keys(e).forEach(function(n){var t=i[n],r=e[n];i[n]=t?function(n,i){return i.origin=function(){return t(n,i)},r(n,i)}:r}),delete t.convertors),function(n){return function(n,t,i){for(var r=[],e=n.walker(),c=null,l=function(){var n=c.node,y=c.entering,l=t[n.type];if(!l)return"continue";var a=!1,p={entering:y,leaf:!s.isContainer(n),options:i,getChildrenText:v,skipChildren:function(){a=!0}},f=l(n,p);f&&((Array.isArray(f)?f:[f]).forEach(function(t,f){"openTag"===t.type&&i.nodeId&&0===f&&(t.attributes||(t.attributes={}),t.attributes["data-nodeid"]=String(n.id)),function(n,t){switch(n.type){case"openTag":case"closeTag":!function(n,t){"openTag"===n.type?(u(n,t),t.push(function(n){var t=[],u=n.tagName,i=n.classNames,r=n.attributes;return t.push("<"+u),i&&i.length>0&&t.push(' class="'+i.join(" ")+'"'),r&&Object.keys(r).forEach(function(n){var i=r[n];t.push(" "+n+'="'+i+'"')}),n.selfClose&&t.push(" /"),t.push(">"),n.finalize&&t.push("<\/"+u+">"),t.join("")}(n)),n.selfClose?u(n,t):o(n,t)):(o(n,t),t.push("<\/"+n.tagName+">"),u(n,t))}(n,t);break;case"text":!function(n,t){t.push(h.escapeXml(n.content))}(n,t);break;case"html":!function(n,t){u(n,t);t.push(n.content);u(n,t)}(n,t)}}(t,r)}),a&&(e.resumeAt(n,!1),e.next()))};c=e.next();)l();return f(r),r.join("")}(n,i,t)}}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.baseConvertors=void 0;var u=i(0),r=i(2),f=i(30);t.baseConvertors={heading:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"h"+n.level,outerNewLine:!0}},text:function(n){return{type:"text",content:n.literal}},softbreak:function(n,t){return{type:"html",content:t.options.softbreak}},linebreak:function(){return{type:"html",content:"<br />\n"}},emph:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"em"}},strong:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"strong"}},paragraph:function(n,t){var i,f=t.entering,e=t.skipChildren,r=null===(i=n.parent)||void 0===i?void 0:i.parent,u=!1;return r&&"list"===r.type&&r.listData.tight?null:(n.customType&&(u=!0,e()),{type:f?"openTag":"closeTag",tagName:"p",outerNewLine:!0,finalize:u})},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(n,t){var e=t.entering,r=n.listData,o=r.type,i=r.start,u="bullet"===o?"ul":"ol",f={};return"ol"===u&&null!==i&&1!==i&&(f.start=i.toString()),{type:e?"openTag":"closeTag",tagName:u,attributes:f,outerNewLine:!0}},item:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(n,t){return{type:"html",content:t.options.tagFilter?f.filterDisallowedTags(n.literal):n.literal}},htmlBlock:function(n,t){var i=t.options,r=i.tagFilter?f.filterDisallowedTags(n.literal):n.literal;return i.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:r},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:r,outerNewLine:!0}},code:function(n){return[{type:"openTag",tagName:"code"},{type:"text",content:n.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(n){var i=n.info,t=i?i.split(/\s+/):[],u=[];return t.length>0&&t[0].length>0&&u.push("language-"+r.escapeXml(t[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:u},{type:"text",content:n.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(n,t){if(t.entering){var i=n,f=i.title,e=i.destination;return{type:"openTag",tagName:"a",attributes:u.__assign({href:r.escapeXml(e)},f&&{title:r.escapeXml(f)})}}return{type:"closeTag",tagName:"a"}},image:function(n,t){var e=t.getChildrenText,o=t.skipChildren,i=n,f=i.title,s=i.destination;return o(),{type:"openTag",tagName:"img",selfClose:!0,attributes:u.__assign({src:r.escapeXml(s),alt:e(n)},f&&{title:r.escapeXml(f)})}}}},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.filterDisallowedTags=void 0;var i=new RegExp("<(/?(?:title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)[^>]*>)","ig");t.filterDisallowedTags=function(n){return i.test(n)?n.replace(i,function(n,t){return"&lt;"+t}):n}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.gfmConvertors=void 0;var r=i(0);t.gfmConvertors={strike:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(n,t){var f=t.entering,u=n.listData,e=u.checked,o=u.task,i;return f?(i={type:"openTag",tagName:"li",outerNewLine:!0},o?[i,{type:"openTag",tagName:"input",selfClose:!0,attributes:r.__assign(r.__assign({},e&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:i):{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(n,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(n,t){var i,u,r;if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};if(i=[],n.lastChild)for(u=n.parent.parent.columns.length,r=n.lastChild.endIdx+1;r<u;r+=1)i.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return i.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),i},tableCell:function(n,t){var s=t.entering;if(n.ignored)return{type:"text",content:""};var u=n.parent.parent,f="tableHead"===u.type?"th":"td",i=u.parent.columns[n.startIdx],e=i&&"left"!==i.align?i.align:null,o=e?{align:e}:null;return s?r.__assign({type:"openTag",tagName:f,outerNewLine:!0},o&&{attributes:o}):{type:"closeTag",tagName:f,outerNewLine:!0}}}}]))},function(n,t,i){"use strict";var r=i(14),u=i.n(r),f=i(21),e=i.n(f),o=function(){function t(){this._keys=[];this._values=[]}var n=t.prototype;return n._getKeyIndex=function(n){return u()(n,this._keys)},n.get=function(n){return this._values[this._getKeyIndex(n)]},n.set=function(n,t){var i=this._getKeyIndex(n);i>-1?this._values[i]=t:(this._keys.push(n),this._values.push(t))},n.has=function(n){return this._getKeyIndex(n)>-1},n.delete=function(n){var t=this._getKeyIndex(n);t>-1&&(this._keys.splice(t,1),this._values.splice(t,1))},n.forEach=function(n,t){var i=this;t===void 0&&(t=this);e()(this._values,function(r,u){r&&i._keys[u]&&n.call(t,r,i._keys[u],i)})},t}();t.a=o},function(n,t,i){"use strict";function o(n,t){r[n]=r[n]||{};r[n].height=t}function s(n,t){r[n]=r[n]||{};r[n].offsetTop=t}function h(n){return r[n]&&r[n].height}function c(n){return r[n]&&r[n].offsetTop}function u(n){n&&(delete r[n.getAttribute("data-nodeid")],e()(n.children).forEach(function(n){u(n)}))}i.d(t,"d",function(){return o});i.d(t,"e",function(){return s});i.d(t,"a",function(){return h});i.d(t,"b",function(){return c});i.d(t,"c",function(){return u});var f=i(3),e=i.n(f),r={}},function(n,t,i){"use strict";function v(n,t){var i=document.createElement("div");return o()(n)?(n=n.replace(/<!--[\s\S]*?-->/g,""),i.innerHTML=n):i.appendChild(n),y(i),b(i),r.a.finalizeHtml(i,t)}function y(n){var t=r.a.findAll(n,"script, iframe, textarea, form, button, select, input, meta, style, link, title, embed, object, details, summary");t.forEach(function(n){r.a.remove(n)})}function p(n,t){return n.match(c)&&t.match(l)}function w(n,t){u()(t).forEach(function(t){var i=t.name;a.test(i)&&(n[i]=null);n.getAttribute(i)&&n.removeAttribute(i)})}function b(n){r.a.findAll(n,"*").forEach(function(n){var t=n.attributes,i=u()(t).filter(function(n){var t=n.name,r=n.value,i=t.match(s),u=t.match(h),f=i&&p(t,r);return!i&&!u||f});w(n,i)})}var f=i(3),u=i.n(f),e=i(9),o=i.n(e),r=i(0),s=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"),c=/href|src|background/gi,l=/((java|vb|live)script|x):/gi,a=/^on\S+/;t.a=v},function(n,t,i){"use strict";function e(n,t,i){r(n)?u(n,t,i):f(n,t,i)}var r=i(17),u=i(21),f=i(10);n.exports=e},function(n){"use strict";function t(n){return n instanceof Function}n.exports=t},function(n,t,i){"use strict";function f(n){return!r(n)&&!u(n)}var r=i(8),u=i(48);n.exports=f},function(n,t,i){"use strict";function r(){return r=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},r.apply(this,arguments)}function f(n,t){var i=r({},u);return n&&(i.link=function(t,i){var f=i.entering,e=i.origin,u=e();return f&&(u.attributes=r({},u.attributes,n)),u}),t&&Object.keys(t).forEach(function(n){var u=i[n],f=t[n];i[n]=u?function(n,t){var i=r({},t);return i.origin=function(){return u(n,t)},f(n,i)}:f}),i}i.d(t,"a",function(){return f});var u={paragraph:function(n,t){var u=t.entering,f=t.origin,i=t.options,e=i.nodeId,r=i.customProp,o=r===void 0?{}:r,s=o.showFrontMatter&&n.customType;return e&&!n.customType||s?{type:u?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:f()},softbreak:function(n){var t=n.prev&&n.prev.type==="htmlInline",i=t&&/<br ?\/?>/.test(n.prev.literal),r=i?"\n":"<br>\n";return{type:"html",content:r}},item:function(n,t){var u=t.entering,r,i;return u?(r={},i=[],n.listData.task&&(r["data-te-task"]="",i.push("task-list-item"),n.listData.checked&&i.push("checked")),{type:"openTag",tagName:"li",classNames:i,attributes:r,outerNewLine:!0}):{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(n){var t={"data-backticks":n.tickCount};return[{type:"openTag",tagName:"code",attributes:t},{type:"text",content:n.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(n){var t=n.info?n.info.split(/\s+/):[],u=[],i={},r;return n.fenceLength>3&&(i["data-backticks"]=n.fenceLength),t.length>0&&t[0].length>0&&(r=t[0],u.push("lang-"+r),i["data-language"]=r),[{type:"openTag",tagName:"pre",classNames:u},{type:"openTag",tagName:"code",attributes:i},{type:"text",content:n.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]}}},function(n,t){"use strict";function r(n,t){return n.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var i=function(){function t(){this._replacers={}}var n=t.prototype;return n.setReplacer=function(n,t){n=n.toLowerCase();this._replacers[n]=t},n.getReplacer=function(n){return this._replacers[n]},n.createCodeBlockHtml=function(n,t){n=n.toLowerCase();var i=this.getReplacer(n);return i?i(t,n):r(t,!1)},t}();t.a=new i},function(n,t,i){"use strict";function r(){return r=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},r.apply(this,arguments)}function s(n,t){n.forEach(function(n){if(f()(n))n(t);else if(u()(n)){var r=n[0],i=n[1],e=i===void 0?{}:i;r(t,e)}})}function h(n){return n?n.reduce(function(n,t){var i=u()(t)?t[0]:t;if(!f()(i)){var e=i.renderer,o=i.parser,s=i.pluginFn;t=u()(t)?[s,t[1]]:s;e&&(n.renderer=r({},n.renderer,e));o&&(n.parser=r({},n.parser,o))}return n.plugins.push(t),n},{plugins:[],renderer:{},parser:{}}):{}}i.d(t,"b",function(){return s});i.d(t,"a",function(){return h});var e=i(17),u=i.n(e),o=i(27),f=i.n(o)},function(n){
  /*!
   * to-mark
   * @version 1.0.1 | Tue Nov 24 2020
   */
  (function(t,i){!0&&(n.exports=i())})(window,function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=0)}([function(n,t,i){"use strict";function ut(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function l(n){var t;return Object.prototype.toString.call(n)==="[object String]"?(t=document.createElement("div"),t.innerHTML=a(n)):t=n,t.__htmlRootByToMark=!0,t}function a(n){return n=n.replace(ft,""),n=n.replace(et,"><"),n.replace(ot,"> <")}function e(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function b(n,t,i){var r;i=i||null;for(r in n)if(n.hasOwnProperty(r)&&t.call(i,n[r],r,n)===!1)break}function k(n){var t=n.tagName;return t==="S"||t==="B"||t==="I"||t==="EM"||t==="STRONG"||t==="A"||t==="IMG"||t==="CODE"}function vt(n,t){var i=n.cloneNode(!1);return i.innerHTML=t,i.outerHTML}function d(n,t){b(t,function(t,i){i!=="converter"?(n[i]||(n[i]={}),d(n[i],t)):n[i]=t})}function tt(n,t){var i;return n.className.indexOf("task-list-item")!==-1&&(i=n.className.indexOf("checked")!==-1?"x":" ",t="["+i+"] "+t),t}function wt(n){var i,r,t,u=n.align;return t=n.textContent?n.textContent.length:n.innerText.length,i="",r="",u&&(u==="left"?(i=":",t-=1):u==="right"?(r=":",t-=1):u==="center"&&(r=":",i=":",t-=2)),i+bt("-",t)+r}function it(n,t){for(var r=n.childNodes,u=[],i=0,f=r.length;i<f;i+=1)r[i].tagName&&r[i].tagName===t&&u.push(r[i]);return u}function bt(n,t){var i=n;for(t=Math.max(t,3);t>1;)i+=n,t-=1;return i}function s(n,t){var r=!0,i,u;return n?(i=nt,t&&(r=t.gfm,r===!1&&(i=f),i=t.renderer||i),u=new h(l(n)),ri(ii(u,i),r,i.lineFeedReplacement)):""}function ii(n,t){for(var i="";n.next();)i+=rt(n,t);return i}function ri(n,t,i){return n=n.replace(kt,"\n"),n=n.replace(gt,"\n\n"),n=n.replace(ti,function(n){var t=(n.match(/\n/g)||[]).length;return t>=3?"\n\n":n>=1?"\n":n}),n=n.replace(dt,""),n=n.replace(new RegExp(i,"g"),"\n"),t&&(n=n.replace(ni,"\n")),n}function rt(n,t){for(var i="",r=n.getNode(),u=0,f=r.childNodes.length;u<f;u+=1)n.next(),i+=rt(n,t);return t.convert(r,i)}var u,h,r,ui;i.r(t);u={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3};h=function(){function t(n){this._normalizeTextChildren(n);this._root=n;this._current=n}var n=t.prototype;return n.next=function(){var n=this._current,t;if(this._current){for(t=this._getNextNode(n);this._isNeedNextSearch(t,n);)n=n.parentNode,t=n.nextSibling;this._current=t}return this._current},n.getNode=function(){return this._normalizeTextChildren(this._current),this._current},n._normalizeTextChildren=function(n){if(n&&!(n.childNodes.length<2))for(var t=n.firstChild,i;t.nextSibling;)i=t.nextSibling,t.nodeType===u.TEXT_NODE&&i.nodeType===u.TEXT_NODE?(t.nodeValue+=i.nodeValue,n.removeChild(i)):t=i},n.getNodeText=function(){var n=this.getNode();return n.nodeType===u.TEXT_NODE?n.nodeValue:n.textContent||n.innerText},n._isNeedNextSearch=function(n,t){return!n&&t!==this._root&&t.parentNode!==this._root},n._getNextNode=function(n){return n.firstChild||n.nextSibling},t}();ut(h,"NODE_TYPE",u);var ft=/^[\s\r\n\t]+|[\s\r\n\t]+$/g,et=/>[\r\n\t]+</g,ot=/>[ ]+</g;l.preProcess=a;var v=/^\u0020/,y=/.+\u0020$/,st=/[\n\s\t]+/g,ht=/^[\u0020\r\n\t]+|[\u0020\r\n\t]+$/g,ct=/[\u0020]+/g,lt=/[>(){}[\]+-.!#|]/g,at=/[[\]]/g,p=/!\[.*\]\(.*\)/g,w=3;r=function(){function t(n){this.rules={};this.lineFeedReplacement="​​";n&&this.addRules(n)}var n=t.prototype;return n.addRule=function(n,t){var r=n.split(", "),i=r.pop();for(t.fname=n;i;)this._setConverterWithSelector(i,t),i=r.pop()},n.addRules=function(n){b(n,function(n,t){this.addRule(t,n)},this)},n.getSpaceControlled=function(n,t){var r="",u="",i;return t.previousSibling&&(t.previousSibling.nodeType===w||k(t.previousSibling))&&(i=t.previousSibling.innerHTML||t.previousSibling.nodeValue,(y.test(i)||v.test(t.innerHTML||t.nodeValue))&&(r=" ")),t.nextSibling&&(t.nextSibling.nodeType===w||k(t.nextSibling))&&(i=t.nextSibling.innerHTML||t.nextSibling.nodeValue,(v.test(i)||y.test(t.innerHTML||t.nodeValue))&&(u=" ")),r+n+u},n.convert=function(n,t){var i,r=this._getConverter(n);return n&&n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute("data-tomark-pass")?(n.removeAttribute("data-tomark-pass"),i=vt(n,t)):r?i=r.call(this,n,t):n&&(i=this.getSpaceControlled(this._getInlineHtml(n,t),n)),i||""},n._getInlineHtml=function(n,t){var r=n.outerHTML,i=n.tagName,u=t.replace(/\$/g,"$$$$");return r.replace(new RegExp("(<"+i+" ?.*?>).*(<\/"+i+">)","i"),"$1"+u+"$2")},n._getConverter=function(n){for(var t=this.rules,i;n&&t;)t=this._getNextRule(t,this._getRuleNameFromNode(n)),n=this._getPrevNode(n),t&&t.converter&&(i=t.converter);return i},n._getNextRule=function(n,t){return n[t]},n._getRuleNameFromNode=function(n){return n.tagName||"TEXT_NODE"},n._getPrevNode=function(n){var t=n.parentNode,i;return t&&!t.__htmlRootByToMark&&(i=t),i},n._setConverterWithSelector=function(n,t){var i=this.rules;this._eachSelector(n,function(n){i[n]||(i[n]={});i=i[n]});i.converter=t},n._eachSelector=function(n,t){for(var r=n.split(" "),i=r.length-1;i>=0;)t(r[i]),i-=1},n.trim=function(n){return n.replace(ht,"")},n.isEmptyText=function(n){return n.replace(st,"")===""},n.getSpaceCollapsedText=function(n){return n.replace(ct," ")},n.escapeText=function(n){return n.replace(lt,function(n){return"\\"+n})},n.escapeTextForLink=function(n){for(var i=[],t=p.exec(n);t;)i.push([t.index,t.index+t[0].length]),t=p.exec(n);return n.replace(at,function(n,t){var r=i.some(function(n){return t>n[0]&&t<n[1]});return r?n:"\\"+n})},n.escapeTextHtml=function(n){return n.replace(new RegExp(t.markdownTextToEscapeHtmlRx.source,"g"),function(n){return"\\"+n})},n.escapeTextBackSlash=function(n){return n.replace(new RegExp(t.markdownTextToEscapeBackSlashRx.source,"g"),function(n){return"\\"+n})},n.escapePairedCharacters=function(n){return n.replace(new RegExp(t.markdownTextToEscapePairedCharsRx.source,"g"),function(n){return"\\"+n})},n._isNeedEscape=function(n){var r=!1,i=t.markdownTextToEscapeRx;for(var u in i)if(i.hasOwnProperty(u)&&i[u].test(n)){r=!0;break}return r},n._isNeedEscapeHtml=function(n){return t.markdownTextToEscapeHtmlRx.test(n)},n._isNeedEscapeBackSlash=function(n){return t.markdownTextToEscapeBackSlashRx.test(n)},n.mix=function(n){d(this.rules,n.rules)},t.factory=function(n,i){var r=new t;return i?r.mix(n):i=n,r.addRules(i),r},t}();e(r,"markdownTextToEscapeRx",{codeblock:/(^ {4}[^\n]+\n*)+/,hr:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,heading:/^(#{1,6}) +[\s\S]+/,lheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,codeblockGfm:/^(`{3,})/,codeblockTildes:/^(~{3,})/});e(r,"markdownTextToEscapeHtmlRx",/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\/>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/);e(r,"markdownTextToEscapeBackSlashRx",/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/);e(r,"markdownTextToEscapePairedCharsRx",/[*_~`]/);var g=/\n$/g,yt=/[ \xA0]+\n\n/g,o=/([ \xA0]+\n){2,}/g,pt=/href="(.*?)"/,c=/^/gm,f=r.factory({TEXT_NODE:function(n){var t=this.trim(this.getSpaceCollapsedText(n.nodeValue));return this._isNeedEscapeBackSlash(t)&&(t=this.escapeTextBackSlash(t)),t=this.escapePairedCharacters(t),this._isNeedEscapeHtml(t)&&(t=this.escapeTextHtml(t)),this._isNeedEscape(t)&&(t=this.escapeText(t)),this.getSpaceControlled(t,n)},"CODE TEXT_NODE":function(n){return n.nodeValue},"EM, I":function(n,t){var i="";return this.isEmptyText(t)||(i="*"+t+"*"),i},"STRONG, B":function(n,t){var i="";return this.isEmptyText(t)||(i="**"+t+"**"),i},A:function(n,t){var r=t,u="",i,f=pt.exec(n.outerHTML);return f&&(i=f[1].replace(/&amp;/g,"&")),n.title&&(u=' "'+n.title+'"'),!this.isEmptyText(t)&&i&&(r="["+this.escapeTextForLink(t)+"]("+i+u+")"),r},IMG:function(n){var t=n.getAttribute("src"),i=n.alt;return t?"!["+this.escapeTextForLink(i)+"]("+t+")":""},BR:function(){return"  \n"},CODE:function(n,t){var i,r,u="";return this.isEmptyText(t)||(r=parseInt(n.getAttribute("data-backticks"),10),i=isNaN(r)?"`":Array(r+1).join("`"),u=i+t+i),u},P:function(n,t){var i="";return t=t.replace(o,"  \n"),this.isEmptyText(t)||(i="\n\n"+t+"\n\n"),i},"BLOCKQUOTE P":function(n,t){return t},"LI P":function(n,t){var i="";return this.isEmptyText(t)||(i=t),i},"H1, H2, H3, H4, H5, H6":function(n,t){for(var i="",r=parseInt(n.tagName.charAt(1),10);r;)i+="#",r-=1;return i+=" ",i+=t,"\n\n"+i+"\n\n"},"LI H1, LI H2, LI H3, LI H4, LI H5, LI H6":function(n,t){var i=parseInt(n.tagName.charAt(1),10);return Array(i+1).join("#")+" "+t},"UL, OL":function(n,t){return"\n\n"+t+"\n\n"},"LI OL, LI UL":function(n,t){var i,r;return i=t.replace(yt,"\n"),i=i.replace(g,""),r=i.replace(c,"    "),"\n"+r},"UL LI":function(n,t){var i="";return t=t.replace(o,"  \n"),n.firstChild&&n.firstChild.tagName==="P"&&(i+="\n"),i+("* "+t+"\n")},"OL LI":function(n,t){for(var i="",r=parseInt(n.parentNode.getAttribute("start")||1,10);n.previousSibling;)n=n.previousSibling,n.nodeType===1&&n.tagName==="LI"&&(r+=1);return t=t.replace(o,"  \n"),n.firstChild&&n.firstChild.tagName==="P"&&(i+="\n"),i+(r+". "+t+"\n")},HR:function(){return"\n\n- - -\n\n"},BLOCKQUOTE:function(n,t){t=t.replace(o,"\n\n");var i=this.trim(t),r=i.replace(c,"> ");return"\n\n"+r+"\n\n"},"PRE CODE":function(n,t){var i=t.replace(g,""),r=i.replace(c,"    ");return"\n\n"+r+"\n\n"}}),nt=r.factory(f,{"DEL, S":function(n,t){return"~~"+t+"~~"},"PRE CODE":function(n,t){var u="",i=n.getAttribute("data-backticks"),r;return n.getAttribute("data-language")&&(u=" "+n.getAttribute("data-language")),i=parseInt(i,10),r=isNaN(i)?"```":Array(i+1).join("`"),t=t.replace(/(\r\n)|(\r)|(\n)/g,this.lineFeedReplacement),"\n\n"+r+u+"\n"+t+"\n"+r+"\n\n"},PRE:function(n,t){return t},"UL LI":function(n,t){return f.convert(n,tt(n,t))},"OL LI":function(n,t){return f.convert(n,tt(n,t))},TABLE:function(n,t){return"\n\n"+t+"\n\n"},"TBODY, TFOOT":function(n,t){return t},"TR TD, TR TH":function(n,t){return t=t.replace(/(\r\n)|(\r)|(\n)/g,"")," "+t+" |"},"TD BR, TH BR":function(){return"<br>"},TR:function(n,t){return"|"+t+"\n"},THEAD:function(n,t){for(var r="",u=it(it(n,"TR")[0],"TH"),i=0,f=u.length;i<f;i+=1)r+=" "+wt(u[i])+" |";return t?t+"|"+r+"\n":""}});var kt=/[ \xA0]+(\n\n)/g,dt=/^[\n]+|[\s\n]+$/g,gt=/([ \xA0]+\n){2,}/g,ni=/([ \xA0]){2,}\n/g,ti=/[ \xA0\n]+/g;s.Renderer=r;s.basicRenderer=f;s.gfmRenderer=nt;ui=t["default"]=s}])["default"]})},function(n,t,i){"use strict";function u(n){return!n||!n.className?"":r(n.className.baseVal)?n.className:n.className.baseVal}var r=i(8);n.exports=u},function(n){"use strict";function t(n){return typeof n=="number"||n instanceof Number}n.exports=t},function(n,t,i){"use strict";function d(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function g(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function nt(n,t){for(var u=t.ch,i=n.firstChild;i&&i.next;){if(Object(r.e)(i.next)>u+1)break;i=i.next}return i}var s=i(19),h=i.n(s),c=i(20),l=i.n(c),a=i(5),v=i.n(a),y=i(6),f=i.n(y),e=i(22),it=i.n(e),p=i(38),w=i(0),b=i(29),k=i(18),o=i(24),r=i(2),u="te-preview-highlight",tt=function(n){function i(t,i,r,u){var f;f=n.call(this,t,i,r,u.isViewer)||this;f.lazyRunner.registerLazyRunFunction("invokeCodeBlock",f.invokeCodeBlockPlugins,f.delayCodeBlockTime,d(f));var s=u.linkAttribute,h=u.customHTMLRenderer,o=u.highlight,c=o===void 0?!1:o;return f.renderHTML=Object(e.createRenderHTML)({gfm:!0,nodeId:!0,convertors:Object(b.a)(s,h)}),f.cursorNodeId=null,f._initEvent(c),f}g(i,n);var t=i.prototype;return t._initEvent=function(n){var t=this;this.eventManager.listen("contentChangedFromMarkdown",this.update.bind(this));n&&(this.eventManager.listen("cursorActivity",function(n){var i=n.markdownNode,r=n.cursor;t._updateCursorNode(i,r)}),this.eventManager.listen("blur",function(){t._removeHighlight()}));h()(this.el,"scroll",function(n){t.eventManager.emit("scroll",{source:"preview",data:Object(k.a)(n.target.scrollTop,t._previewContent)})})},t._removeHighlight=function(){if(this.cursorNodeId){var n=this._getElementByNodeId(this.cursorNodeId);n&&f()(n,u)}},t._updateCursorNode=function(n,t){var i;if(n&&(n=Object(r.b)(n,function(n){return!Object(r.h)(n)}),n.type==="tableRow"?n=nt(n,t):n.type==="tableBody"&&(n=null)),i=n?n.id:null,this.cursorNodeId!==i){var s=n&&n.customType==="frontMatter",e=this._getElementByNodeId(this.cursorNodeId),o=this._getElementByNodeId(i);e&&f()(e,u);o&&!s&&v()(o,u);this.cursorNodeId=i}},t._getElementByNodeId=function(n){return n?this._previewContent.querySelector('[data-nodeid="'+n+'"]'):null},t.update=function(n){var t=this;n.forEach(function(n){return t.replaceRangeNodes(n)});this.eventManager.emit("previewRenderAfter",this)},t.replaceRangeNodes=function(n){var c=this,u=n.nodes,f=n.removedNodeRange,l=this._previewContent,e=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",u.map(function(n){return c.renderHTML(n)}).join("")),t,h,r;if(f){var s=f.id,a=s[0],v=s[1],i=this._getElementByNodeId(a),y=this._getElementByNodeId(v);if(i){for(i.insertAdjacentHTML("beforebegin",e),t=i;t!==y;)h=t.nextElementSibling,t.parentNode.removeChild(t),Object(o.c)(t),t=h;t.parentNode&&(w.a.remove(t),Object(o.c)(t))}}else l.insertAdjacentHTML("afterbegin",e);r=this.getCodeBlockElements(u.map(function(n){return n.id}));r.length&&this.lazyRunner.run("invokeCodeBlock",r)},t.render=function(t){n.prototype.render.call(this,t);this.eventManager.emit("previewRenderAfter",this)},t.remove=function(){l()(this.el,"scroll");this.el=null},i}(p.a);t.a=tt},function(n,t,i){"use strict";var f=i(10),r=i.n(f),e=i(8),u=i.n(e),o=i(44),s=i.n(o),h=i(45),c=i.n(h),l=i(23),a=["previewBeforeHook","previewRenderAfter","previewNeedsRefresh","addImageBlobHook","setMarkdownAfter","contentChangedFromWysiwyg","changeFromWysiwyg","contentChangedFromMarkdown","changeFromMarkdown","change","changeModeToWysiwyg","changeModeToMarkdown","changeModeBefore","changeMode","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","openPopupAddLink","openPopupAddImage","openPopupAddTable","openPopupTableUtils","openHeadingSelect","openPopupCodeBlockLanguages","openPopupCodeBlockEditor","openDropdownToolbar","closePopupCodeBlockLanguages","closePopupCodeBlockEditor","closeAllPopup","command","addCommandBefore","htmlUpdate","markdownUpdate","renderedHtmlUpdated","removeEditor","convertorAfterMarkdownToHtmlConverted","convertorBeforeHtmlToMarkdownConverted","convertorAfterHtmlToMarkdownConverted","stateChange","wysiwygSetValueAfter","wysiwygSetValueBefore","wysiwygGetValueBefore","wysiwygProcessHTMLText","wysiwygRangeChangeAfter","wysiwygKeyEvent","scroll","click","mousedown","mouseover","mouseout","mouseup","contextmenu","keydown","keyup","keyMap","load","focus","blur","paste","pasteBefore","willPaste","copy","copyBefore","copyAfter","cut","cutAfter","drop","show","hide","changeLanguage","cursorActivity","requireScrollSync","requireScrollIntoView","setCodeBlockLanguages"],v=function(){function t(){this.events=new l.a;this.TYPE=new c.a(a)}var n=t.prototype;return n.listen=function(n,t){var i=this._getTypeInfo(n),r=this.events.get(i.type)||[];if(!this._hasEventType(i.type))throw new Error("There is no event type "+i.type);i.namespace&&(t.namespace=i.namespace);r.push(t);this.events.set(i.type,r)},n.emit=function(){for(var f=arguments.length,i=new Array(f),n=0;n<f;n++)i[n]=arguments[n];var o=i.shift(),s=this._getTypeInfo(o),e=this.events.get(s.type),t;return e&&r()(e,function(n){var r=n.apply(void 0,i);u()(r)||(t=t||[],t.push(r))}),t},n.emitReduce=function(){for(var f,i,u=arguments.length,n=new Array(u),t=0;t<u;t++)n[t]=arguments[t];return f=n.shift(),i=this.events.get(f),i&&r()(i,function(t){var i=t.apply(void 0,n);s()(i)||(n[0]=i)}),n[0]},n._getTypeInfo=function(n){var t=n.split(".");return{type:t[0],namespace:t[1]}},n._hasEventType=function(n){return!u()(this.TYPE[this._getTypeInfo(n).type])},n.addEventType=function(n){if(this._hasEventType(n))throw new Error("There is already have event type "+n);this.TYPE.set(n)},n.removeEventHandler=function(n,t){var f=this,u=this._getTypeInfo(n),i=u.type,r=u.namespace;i&&t?this._removeEventHandlerWithHandler(i,t):i&&!r?this.events.delete(i):!i&&r?this.events.forEach(function(n,t){f._removeEventHandlerWithTypeInfo(t,r)}):i&&r&&this._removeEventHandlerWithTypeInfo(i,r)},n._removeEventHandlerWithHandler=function(n,t){var i=this.events.get(n)||[],r=i.indexOf(t);r>=0&&i.splice(r,1)},n._removeEventHandlerWithTypeInfo=function(n,t){var i=[],r=this.events.get(n);r&&(r.map(function(n){return n.namespace!==t&&i.push(n),null}),this.events.set(n,i))},t}();t.a=v},function(n,t,i){"use strict";var f=i(32),e=i.n(f),r=i(22),l=i.n(r),o=i(29),u=i(0),s=new RegExp("(\\\\<|<)([A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*)(\\/?>)","g"),h=/^\s?\\-\\-\\-([\s\S]+?)\\-\\-\\-/,c=function(){function t(n,t){t===void 0&&(t={});var i=t,u=i.linkAttribute,f=i.customHTMLRenderer,e=i.extendedAutolinks,s=i.referenceDefinition,h=i.customParser,c=i.frontMatter,l=i.customProp;this.options=t;this.mdReader=new r.Parser({extendedAutolinks:e,disallowedHtmlBlockTags:["br"],referenceDefinition:s,disallowDeepHeading:!0,customParser:h,frontMatter:c});this.renderHTML=Object(r.createRenderHTML)({gfm:!0,convertors:Object(o.a)(u,f),customProp:l});this.eventManager=n}var n=t.prototype;return n._markdownToHtmlWithCodeHighlight=function(n){return this.renderHTML(this.mdReader.parse(n))},n._markdownToHtml=function(n){return n=n.replace(s,function(n,t,i,r){return n[0]!=="\\"?""+t+i+" data-tomark-pass "+r:n}),this.renderHTML(this.mdReader.parse(n))},n._removeBrToMarkPassAttributeInCode=function(n){var t=u.a.createElementWith("<div>"+n+"<\/div>");return u.a.findAll(t,"code, pre").forEach(function(n){var t=n;t.innerHTML=t.innerHTML.replace(/\sdata-tomark-pass\s(\/?)&gt;/g,"$1&gt;")}),t.innerHTML},n.toHTMLWithCodeHighlight=function(n){var t=this._markdownToHtmlWithCodeHighlight(n);return this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t)},n.toHTML=function(n){var t=this._markdownToHtml(n);return t=this.eventManager.emitReduce("convertorAfterMarkdownToHtmlConverted",t),this._removeBrToMarkPassAttributeInCode(t)},n.initHtmlSanitizer=function(n){this.eventManager.listen("convertorAfterMarkdownToHtmlConverted",function(t){return n(t,!0)})},n.toMarkdown=function(n,t){var r=[],i;return n=this.eventManager.emitReduce("convertorBeforeHtmlToMarkdownConverted",n),n=this._appendAttributeForLinkIfNeed(n),n=this._appendAttributeForBrIfNeed(n),i=e()(n,t),this.options.frontMatter&&(i=i.replace(h,"---$1---")),i=this.eventManager.emitReduce("convertorAfterHtmlToMarkdownConverted",i),i=this._removeNewlinesBeforeAfterAndBlockElement(i),i.split("\n").forEach(function(n,t){/^(<br>)+\||\|[^|]*\|/gi.test(n)?n=n.replace(/^(<br>)+\|/gi,function(n){return n.replace(/<br>/gi,"<br>\n")}):/`[^`]*<br>[^`]*`/gi.test(n)||(n=n.replace(/<br>/gi,"<br>\n"));r[t]=n}),r.join("\n")},n._removeNewlinesBeforeAfterAndBlockElement=function(n){return n=n.replace(/<br>\n\n(#{1,6} .*|```|\||(\*+|-+|\d+\.) .*| *>[^\n]+.*)/g,"<br>$1"),n.replace(/(#{1,6} .*|```|\|)\n\n<br>/g,"$1\n<br>")},n._appendAttributeForLinkIfNeed=function(n){return n.replace(/!?\[.*\]\(<\s*a[^>]*>(.*?)<\s*\/\s*a>\)/gi,function(n){return n.replace(/<a /gi,'<a data-tomark-pass="" ')})},n._appendAttributeForBrIfNeed=function(n){var t=new RegExp(/([^>]|<\/a>|<\/code>|<\/span>|<\/b>|<\/i>|<\/s>|<img [^>]*>)/.source+/<br data-tomark-pass \/><br data-tomark-pass \/>/.source,"g");return n=n.replace(/<br>/gi,"<br />"),n=n.replace(/<br \/><br \/>/gi,"<br data-tomark-pass /><br data-tomark-pass />"),n=n.replace(/<br data-tomark-pass="">/gi,"<br data-tomark-pass />"),n=n.replace(/<br data-tomark-pass \/><br \/>(.)/gi,"<br data-tomark-pass /><br data-tomark-pass />$1"),n=n.replace(t,"$1<br /><br />"),n=n.replace(/(.)<br \/><br \/>(<h[1-6]>|<pre>|<table>|<ul>|<ol>|<blockquote>)/g,"$1<br /><br data-tomark-pass />$2"),n.replace(/(<\/h[1-6]>|<\/pre>|<\/table>|<\/ul>|<\/ol>|<\/blockquote>)<br \/>(.)/g,"$1<br data-tomark-pass />$2")},t}();t.a=c},function(n,t,i){"use strict";var f=i(4),u=i.n(f),e=i(9),o=i.n(e),s=function(){function t(){this.globalTOID=null;this.lazyRunFunctions={}}var n=t.prototype;return n.run=function(n,t,i,r){var u;return o()(n)?u=this._runRegisteredRun(n,t,i,r):(u=this._runSingleRun(n,t,i,r,this.globalTOID),this.globalTOID=u),u},n.registerLazyRunFunction=function(n,t,i,r){r=r||this;this.lazyRunFunctions[n]={fn:t,delay:i,context:r,TOID:null}},n._runSingleRun=function(n,t,i,r,u){return this._clearTOIDIfNeed(u),setTimeout(function(){n.call(i,t)},r)},n._runRegisteredRun=function(n,t,i,r){var u=this.lazyRunFunctions[n],e=u.fn,f=u.TOID;return r=r||u.delay,i=i||u.context,f=this._runSingleRun(e,t,i,r,f),u.TOID=f,f},n._clearTOIDIfNeed=function(n){n&&clearTimeout(n)},t}(),h=s,r=i(0),c=i(30),l=function(){function t(n,t,i,r){this.eventManager=t;this.convertor=i;this.el=n;this.isViewer=!!r;this.delayCodeBlockTime=500;this._initContentSection();this.lazyRunner=new h}var n=t.prototype;return n._initContentSection=function(){this._previewContent=r.a.createElementWith('<div class="tui-editor-contents"><\/div>');this.el.appendChild(this._previewContent)},n.getCodeBlockElements=function(n){var i=this._previewContent,t=[],u;return u=n?n.map(function(n){return i.querySelector('[data-nodeid="'+n+'"]')}).filter(Boolean):[i],u.forEach(function(n){t.push.apply(t,r.a.findAll(n,"code[data-language]"))}),t},n.invokeCodeBlockPlugins=function(n){n.forEach(function(n){var t=n.getAttribute("data-language"),i=c.a.createCodeBlockHtml(t,n.textContent);n.innerHTML=i})},n.refresh=function(n){n===void 0&&(n="");this.render(this.convertor.toHTMLWithCodeHighlight(n));this.invokeCodeBlockPlugins(this.getCodeBlockElements())},n.getHTML=function(){return this._previewContent.innerHTML},n.setHTML=function(n){this._previewContent.innerHTML=n},n.render=function(n){var t=this._previewContent;n=this.eventManager.emit("previewBeforeHook",n)||n;r.a.empty(t);t.innerHTML=n},n.setHeight=function(n){u()(this.el,{height:n+"px"})},n.setMinHeight=function(n){u()(this.el,{minHeight:n+"px"})},n.isVisible=function(){return this.el.style.display!=="none"},t}(),a=t.a=l},function(n,t,i){"use strict";function f(n,t){if(t=r(t)?t.join(" "):t,t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),u(n.className.baseVal)){n.className=t;return}n.className.baseVal=t}var r=i(17),u=i(8);n.exports=f},function(n){"use strict";function i(n,i){var r=n[t],u;return r||(r=n[t]={}),u=r[i],u||(u=r[i]=[]),u}var t="_feEventKey";n.exports=i},function(){},function(n,t,i){"use strict";function u(n){return r(n)&&n!==!1}var r=i(28);n.exports=u},function(n,t,i){"use strict";function e(n){var t=(new Date).getTime();return t-n>f}function o(n,t){var s="https://www.google-analytics.com/collect",i=location.hostname,h="event",c="use",f="TOAST UI "+n+" for "+i+": Statistics",o=window.localStorage.getItem(f);(r(window.tui)||window.tui.usageStatistics!==!1)&&(!o||e(o))&&(window.localStorage.setItem(f,(new Date).getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&u(s,{v:1,t:h,tid:t,cid:i,dp:i,dh:n,el:n,ec:c})},1e3))}var r=i(8),u=i(49),f=6048e5;n.exports=o},function(n,t,i){"use strict";function u(n){return!r(n)}var r=i(42);n.exports=u},function(n,t,i){"use strict";function r(n){n&&this.set.apply(this,arguments)}var e=i(34),o=i(17),s=i(3),u=i(26),h=function(){try{return Object.defineProperty({},"x",{}),!0}catch(n){return!1}}(),f=0;r.prototype.set=function(n){var t=this;o(n)||(n=s(arguments));u(n,function(n){t._addItem(n)})};r.prototype.getName=function(n){var i=this,t;return u(this,function(r,u){if(i._isEnumItem(u)&&n===r)return t=u,!1}),t};r.prototype._addItem=function(n){var t;this.hasOwnProperty(n)||(t=this._makeEnumValue(),h?Object.defineProperty(this,n,{enumerable:!0,configurable:!1,writable:!1,value:t}):this[n]=t)};r.prototype._makeEnumValue=function(){var n;return n=f,f+=1,n};r.prototype._isEnumItem=function(n){return e(this[n])};n.exports=r},function(n,t,i){"use strict";function u(){return u=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},u.apply(this,arguments)}var s=i(10),e=i.n(s),h=i(7),c=i.n(h),l=i(19),a=i.n(l),v=i(20),y=i.n(v),p=i(35),w=i(36),b=i(1),k=i(37),f=i(0),d=i(30),o=i(31),g=i(12),nt=i(25),tt="data-te-task",it="data-te-task-disabled",rt="checked",r=function(){function t(n){var h=this,f;this.options=c()({useDefaultHTMLSanitizer:!0,linkAttribute:null,extendedAutolinks:!1,customConvertor:null,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1},n);this.codeBlockLanguages=[];this.eventManager=new w.a;this.commandManager=new b.a(this);var tt=Object(g.c)(this.options.linkAttribute),i=Object(o.a)(this.options.plugins),it=i.renderer,rt=i.parser,l=i.plugins,t=this.options,ut=t.customHTMLRenderer,ft=t.customHTMLSanitizer,et=t.extendedAutolinks,ot=t.referenceDefinition,st=t.frontMatter,r={linkAttribute:tt,customHTMLRenderer:u({},it,ut),extendedAutolinks:et,referenceDefinition:ot,customParser:rt,frontMatter:st};this.convertor=this.options.customConvertor?new this.options.customConvertor(this.eventManager,r):new k.a(this.eventManager,r);f=ft||(this.options.useDefaultHTMLSanitizer?nt.a:null);f&&this.convertor.initHtmlSanitizer(f);this.options.hooks&&e()(this.options.hooks,function(n,t){h.addHook(t,n)});this.options.events&&e()(this.options.events,function(n,t){h.on(t,n)});var v=this.options,s=v.el,y=v.initialValue,d=s.innerHTML;s.innerHTML="";this.preview=new p.a(s,this.eventManager,this.convertor,u({},r,{isViewer:!0}));a()(this.preview.el,"mousedown",this._toggleTask.bind(this));l&&Object(o.b)(l,this);y?this.setMarkdown(y):d&&this.preview.setHTML(d);this.eventManager.emit("load",this)}var n=t.prototype;return n._toggleTask=function(n){var t=getComputedStyle(n.target,":before");!n.target.hasAttribute(it)&&n.target.hasAttribute(tt)&&f.a.isInsideButtonBox(t,n.offsetX,n.offsetY)&&(f.a.toggleClass(n.target,rt),this.eventManager.emit("change",{source:"viewer",data:n}))},n.setMarkdown=function(n){this.markdownValue=n=n||"";this.preview.refresh(this.markdownValue);this.eventManager.emit("setMarkdownAfter",this.markdownValue)},n.on=function(n,t){this.eventManager.listen(n,t)},n.off=function(n){this.eventManager.removeEventHandler(n)},n.remove=function(){this.eventManager.emit("removeEditor");y()(this.preview.el,"mousedown",this._toggleTask.bind(this));this.preview.remove();this.options=null;this.eventManager=null;this.commandManager=null;this.convertor=null;this.preview=null},n.addHook=function(n,t){this.eventManager.removeEventHandler(n);this.eventManager.listen(n,t)},n.isViewer=function(){return!0},n.isMarkdownMode=function(){return!1},n.isWysiwygMode=function(){return!1},n.setCodeBlockLanguages=function(n){var t=this;n===void 0&&(n=[]);n.forEach(function(n){t.codeBlockLanguages.indexOf(n)<0&&t.codeBlockLanguages.push(n)})},t}();r.isViewer=!0;r.domUtils=f.a;r.codeBlockManager=d.a;r.WwCodeBlockManager=null;r.WwTableManager=null;r.WwTableSelectionManager=null;t.a=r},function(n){"use strict";function t(n,t){function u(){r=Array.prototype.slice.call(arguments);window.clearTimeout(i);i=window.setTimeout(function(){n.apply(null,r)},t)}var i,r;return t=t||0,u}n.exports=t},function(n){"use strict";function t(n){return n===null}n.exports=t},function(n,t,i){"use strict";function u(n,t){var i=document.createElement("img"),u="";return r(t,function(n,t){u+="&"+t+"="+n}),u=u.substring(1),i.src=n+"?"+u,i.style.display="none",document.body.appendChild(i),document.body.removeChild(i),i}var r=i(10);n.exports=u},function(){},function(){},function(){},,function(n){"use strict";function t(n){return n===Object(n)}n.exports=t},function(n){!function(t,i){"use strict";function w(n,t,i){this.root=this.currentNode=n;this.nodeType=t;this.filter=i||eu}function rf(n,t){for(var i=n.length;i--;)if(!t(n[i]))return!1;return!0}function ot(n){return n.nodeType===p&&!!ar[n.nodeName]}function rr(n){switch(n.nodeType){case u:return vr;case p:case uu:if(bi&&di.has(n))return di.get(n);break;default:return yf}var t;return t=rf(n.childNodes,e)?vf.test(n.nodeName)?vr:ou:su,bi&&di.set(n,t),t}function e(n){return rr(n)===vr}function st(n){return rr(n)===ou}function bt(n){return rr(n)===su}function fi(n,t){var i=new w(t,ni,st);return i.currentNode=n,i}function kt(n,t){return n=fi(n,t).previousNode(),n!==t?n:null}function it(n,t){return n=fi(n,t).nextNode(),n!==t?n:null}function uf(n){return!n.textContent&&!n.querySelector("IMG")}function ur(n,t){return!ot(n)&&n.nodeType===t.nodeType&&n.nodeName===t.nodeName&&"A"!==n.nodeName&&n.className===t.className&&(!n.style&&!t.style||n.style.cssText===t.style.cssText)}function yi(n,t,i){if(n.nodeName!==t)return!1;for(var r in i)if(n.getAttribute(r)!==i[r])return!1;return!0}function s(n,t,i,r){for(;n&&n!==t;){if(yi(n,i,r))return n;n=n.parentNode}return null}function ff(n,t,i){for(;n&&n!==t;){if(i.test(n.nodeName))return n;n=n.parentNode}return null}function ei(n,t){for(;t;){if(t===n)return!0;t=t.parentNode}return!1}function nu(n,t,i){var e,o,u,s,f,r="";return n&&n!==t&&(r=nu(n.parentNode,t,i),n.nodeType===p&&(r+=(r?">":"")+n.nodeName,(e=n.id)&&(r+="#"+e),(o=n.className.trim())&&(u=o.split(/\s\s*/),u.sort(),r+=".",r+=u.join(".")),(s=n.dir)&&(r+="[dir="+s+"]"),u&&(f=i.classNames,h.call(u,f.highlight)>-1&&(r+="[backgroundColor="+n.style.backgroundColor.replace(/ /g,"")+"]"),h.call(u,f.colour)>-1&&(r+="[color="+n.style.color.replace(/ /g,"")+"]"),h.call(u,f.fontFamily)>-1&&(r+="[fontFamily="+n.style.fontFamily.replace(/ /g,"")+"]"),h.call(u,f.fontSize)>-1&&(r+="[fontSize="+n.style.fontSize+"]")))),r}function tt(n){var t=n.nodeType;return t===p||t===uu?n.childNodes.length:n.length||0}function c(n){var t=n.parentNode;return t&&t.removeChild(n),n}function b(n,t){var i=n.parentNode;i&&i.replaceChild(t,n)}function o(n){for(var t=n.ownerDocument.createDocumentFragment(),i=n.childNodes,r=i?i.length:0;r--;)t.appendChild(n.firstChild);return t}function l(n,t,r,u){var f,e,s,o=n.createElement(t);if(r instanceof Array&&(u=r,r=null),r)for(f in r)r[f]!==i&&o.setAttribute(f,r[f]);if(u)for(e=0,s=u.length;e<s;e+=1)o.appendChild(u[e]);return o}function a(n,t){var r,i,o=t.__squire__,f=n.ownerDocument,s=n;if(n===t&&((i=n.firstChild)&&"BR"!==i.nodeName||(r=o.createDefaultBlock(),i?n.replaceChild(r,i):n.appendChild(r),n=r,r=null)),n.nodeType===u)return s;if(e(n)){for(i=n.firstChild;lr&&i&&i.nodeType===u&&!i.data;)n.removeChild(i),i=n.firstChild;i||(lr?(r=f.createTextNode(ti),o._didAddZWS()):r=f.createTextNode(""))}else if(cr){for(;n.nodeType!==u&&!ot(n);){if(!(i=n.firstChild)){r=f.createTextNode("");break}n=i}n.nodeType===u?/^ +$/.test(n.data)&&(n.data=""):ot(n)&&n.parentNode.insertBefore(f.createTextNode(""),n)}else if("HR"!==n.nodeName&&!n.querySelector("BR"))for(r=l(f,"BR");(i=n.lastElementChild)&&!e(i);)n=i;if(r)try{n.appendChild(r)}catch(t){o.didError({name:"Squire: fixCursor – "+t,message:"Parent: "+n.nodeName+"/"+n.innerHTML+" appendChild: "+r.nodeName})}return s}function rt(n,t){for(var r,o,h=n.childNodes,c=n.ownerDocument,i=null,s=t.__squire__._config,u=0,f=h.length;u<f;u+=1)r=h[u],o="BR"===r.nodeName,!o&&e(r)?(i||(i=l(c,s.blockTag,s.blockAttributes)),i.appendChild(r),u-=1,f-=1):(o||i)&&(i||(i=l(c,s.blockTag,s.blockAttributes)),a(i,t),o?n.replaceChild(i,r):(n.insertBefore(i,r),u+=1,f+=1),i=null),bt(r)&&rt(r,t);return i&&n.appendChild(a(i,t)),n}function nt(n,t,i,r){var e,f,o,h=n.nodeType;if(h===u&&n!==i)return nt(n.parentNode,n.splitText(t),i,r);if(h===p){if("number"==typeof t&&(t=t<n.childNodes.length?n.childNodes[t]:null),n===i)return t;for(e=n.parentNode,f=n.cloneNode(!1);t;)o=t.nextSibling,f.appendChild(t),t=o;return"OL"===n.nodeName&&s(n,r,"BLOCKQUOTE")&&(f.start=(+n.start||1)+n.childNodes.length-1),a(n,r),a(f,r),(o=n.nextSibling)?e.insertBefore(f,o):e.appendChild(f),nt(e,f,i,r)}return t}function tu(n,t){for(var i,r,l,s=n.childNodes,f=s.length,h=[];f--;)if(i=s[f],r=f&&s[f-1],f&&e(i)&&ur(i,r)&&!ar[i.nodeName])t.startContainer===i&&(t.startContainer=r,t.startOffset+=tt(r)),t.endContainer===i&&(t.endContainer=r,t.endOffset+=tt(r)),t.startContainer===n&&(t.startOffset>f?t.startOffset-=1:t.startOffset===f&&(t.startContainer=r,t.startOffset=tt(r))),t.endContainer===n&&(t.endOffset>f?t.endOffset-=1:t.endOffset===f&&(t.endContainer=r,t.endOffset=tt(r))),c(i),i.nodeType===u?r.appendData(i.data):h.push(o(i));else if(i.nodeType===p){for(l=h.length;l--;)i.appendChild(h.pop());tu(i,t)}}function dt(n,t){if(n.nodeType===u&&(n=n.parentNode),n.nodeType===p){var i={startContainer:t.startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset};tu(n,i);t.setStart(i.startContainer,i.startOffset);t.setEnd(i.endContainer,i.endOffset)}}function fr(n){var t=n.nodeName;return"TD"===t||"TH"===t||"TR"===t||"TBODY"===t||"THEAD"===t}function oi(n,t,i,r){var f,u,e,s=t;if(!fr(n)||!fr(t)){for(;(f=s.parentNode)&&f!==r&&f.nodeType===p&&1===f.childNodes.length;)s=f;c(s);e=n.childNodes.length;u=n.lastChild;u&&"BR"===u.nodeName&&(n.removeChild(u),e-=1);n.appendChild(o(t));i.setStart(n,e);i.collapse(!0);dt(n,i);si&&(u=n.lastChild)&&"BR"===u.nodeName&&n.removeChild(u)}}function ht(n,t){var e,u,i=n.previousSibling,r=n.firstChild,s=n.ownerDocument,f="LI"===n.nodeName;if((!f||r&&/^[OU]L$/.test(r.nodeName))&&!fr(n))if(i&&ur(i,n)&&i.isContentEditable&&n.isContentEditable){if(!bt(i)){if(!f)return;u=l(s,"DIV");u.appendChild(o(i));i.appendChild(u)}c(n);e=!bt(n);i.appendChild(o(n));e&&rt(i,t);r&&ht(r,t)}else f&&(i=l(s,"DIV"),n.insertBefore(i,r),a(i,t))}function iu(n){this.isShiftDown=n.shiftKey}function gt(n,t,i){var r,u;if(n||(n={}),t)for(r in t)!i&&r in n||(u=t[r],n[r]=u&&u.constructor===Object?gt(n[r],u,i):u);return n}function f(n,t){n.nodeType===of&&(n=n.body);var r,i=n.ownerDocument,u=i.defaultView;this._win=u;this._doc=i;this._root=n;this._events={};this._isFocused=!1;this._lastSelection=null;af&&this.addEventListener("beforedeactivate",this.getSelection);this._hasZWS=!1;this._lastAnchorNode=null;this._lastFocusNode=null;this._path="";this._willUpdatePath=!1;"onselectionchange"in i?this.addEventListener("selectionchange",this._updatePathOnEvent):(this.addEventListener("keyup",this._updatePathOnEvent),this.addEventListener("mouseup",this._updatePathOnEvent));this._undoIndex=-1;this._undoStack=[];this._undoStackLength=0;this._isInUndoState=!1;this._ignoreChange=!1;this._ignoreAllChanges=!1;lt?(r=new MutationObserver(this._docWasChanged.bind(this)),r.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._mutation=r):this.addEventListener("keyup",this._keyUpDetectChange);this._restoreSelection=!1;this.addEventListener("blur",pi);this.addEventListener("mousedown",ru);this.addEventListener("touchstart",ru);this.addEventListener("focus",ef);this._awaitingPaste=!1;this.addEventListener(ii?"beforecut":"cut",ie);this.addEventListener("copy",re);this.addEventListener("keydown",iu);this.addEventListener("keyup",iu);this.addEventListener(ii?"beforepaste":"paste",wu);this.addEventListener("drop",ue);this.addEventListener(si?"keypress":"keydown",wf);this._keyHandlers=Object.create(v);this.setConfig(t);ii&&(u.Text.prototype.splitText=function(n){var t=this.ownerDocument.createTextNode(this.data.slice(n)),i=this.nextSibling,r=this.parentNode,u=this.length-n;return i?r.insertBefore(t,i):r.appendChild(t),u&&this.deleteData(n,u),t});n.setAttribute("contenteditable","true");try{i.execCommand("enableObjectResizing",!1,"false");i.execCommand("enableInlineTableEditing",!1,"false")}catch(n){}n.__squire__=this;this.setHTML("")}function pi(){this._restoreSelection=!0}function ru(){this._restoreSelection=!1}function ef(){this._restoreSelection&&this.setSelection(this._lastSelection)}function er(n,t,i){for(var f,r=t.firstChild;r;r=f){if(f=r.nextSibling,e(r)){if(r.nodeType===u||"BR"===r.nodeName||"IMG"===r.nodeName){i.appendChild(r);continue}}else if(st(r)){i.appendChild(n.createDefaultBlock([er(n,r,n._doc.createDocumentFragment())]));continue}er(n,r,i)}return i}var p=1,u=3,of=9,uu=11,ni=1,ti="​",sf=t.defaultView,ct=navigator.userAgent,hf=/Android/.test(ct),or=/iP(?:ad|hone|od)/.test(ct),sr=/Mac OS X/.test(ct),cf=/Windows NT/.test(ct),fu=/Gecko\//.test(ct),ii=/Trident\/[456]\./.test(ct),si=!!sf.opera,wi=/Edge\//.test(ct),lf=!wi&&/WebKit\//.test(ct),hr=/Trident\/[4567]\./.test(ct),k=sr?"meta-":"ctrl-",cr=ii||si,lr=ii||lf,af=ii,lt="undefined"!=typeof MutationObserver,bi="undefined"!=typeof WeakMap,ut=/[^ \t\r\n]/,h=Array.prototype.indexOf,ki,eu,kr,ai,ir,ui,bu,dr,vi,gr,y,nf,tf;Object.create||(Object.create=function(n){var t=function(){};return t.prototype=n,new t});ki={1:1,2:2,3:4,8:128,9:256,11:1024};eu=function(){return!0};w.prototype.nextNode=function(){for(var n,t=this.currentNode,i=this.root,r=this.nodeType,u=this.filter;;){for(n=t.firstChild;!n&&t&&t!==i;)(n=t.nextSibling)||(t=t.parentNode);if(!n)return null;if(ki[n.nodeType]&r&&u(n))return this.currentNode=n,n;t=n}};w.prototype.previousNode=function(){for(var n,t=this.currentNode,i=this.root,r=this.nodeType,u=this.filter;;){if(t===i)return null;if(n=t.previousSibling)for(;t=n.lastChild;)n=t;else n=t.parentNode;if(!n)return null;if(ki[n.nodeType]&r&&u(n))return this.currentNode=n,n;t=n}};w.prototype.previousPONode=function(){for(var n,t=this.currentNode,i=this.root,r=this.nodeType,u=this.filter;;){for(n=t.lastChild;!n&&t&&t!==i;)(n=t.previousSibling)||(t=t.parentNode);if(!n)return null;if(ki[n.nodeType]&r&&u(n))return this.currentNode=n,n;t=n}};var vf=/^(?:#text|A(?:BBR|CRONYM)?|B(?:R|D[IO])?|C(?:ITE|ODE)|D(?:ATA|EL|FN)|EM|FONT|I(?:FRAME|MG|NPUT|NS)?|KBD|Q|R(?:P|T|UBY)|S(?:AMP|MALL|PAN|TR(?:IKE|ONG)|U[BP])?|TIME|U|VAR|WBR)$/,ar={BR:1,HR:1,IFRAME:1,IMG:1,INPUT:1},yf=0,vr=1,ou=2,su=3,di=bi?new WeakMap:null,gi=function(n,t){for(var i=n.childNodes;t&&n.nodeType===p;)n=i[t-1],i=n.childNodes,t=i.length;return n},yr=function(n,t){if(n.nodeType===p){var i=n.childNodes;if(t<i.length)n=i[t];else{for(;n&&!n.nextSibling;)n=n.parentNode;n&&(n=n.nextSibling)}}return n},ft=function(n,t){var o,f,c,l,i=n.startContainer,r=n.startOffset,e=n.endContainer,s=n.endOffset;i.nodeType===u?(o=i.parentNode,f=o.childNodes,r===i.length?(r=h.call(f,i)+1,n.collapsed&&(e=o,s=r)):(r&&(l=i.splitText(r),e===i?(s-=r,e=l):e===o&&(s+=1),i=l),r=h.call(f,i)),i=o):f=i.childNodes;c=f.length;r===c?i.appendChild(t):i.insertBefore(t,f[r]);i===e&&(s+=f.length-c);n.setStart(i,r);n.setEnd(e,s)},pr=function(n,t,i){var s=n.startContainer,e=n.startOffset,b=n.endContainer,k=n.endOffset;t||(t=n.commonAncestorContainer);t.nodeType===u&&(t=t.parentNode);for(var p,r,f,v,o,y=nt(b,k,t,i),l=nt(s,e,t,i),w=t.ownerDocument.createDocumentFragment();l!==y;)p=l.nextSibling,w.appendChild(l),l=p;return s=t,e=y?h.call(t.childNodes,y):t.childNodes.length,f=t.childNodes[e],r=f&&f.previousSibling,r&&r.nodeType===u&&f.nodeType===u&&(s=r,e=r.length,v=r.data,o=f.data," "===v.charAt(v.length-1)&&" "===o.charAt(0)&&(o=" "+o.slice(1)),r.appendData(o),c(f)),n.setStart(s,e),n.collapse(!0),a(t,i),w},pt=function(n,t){var f,u,i=g(n,t),r=yt(n,t),e=i!==r;return d(n),vt(n,i,r,t),f=pr(n,null,t),d(n),e&&(r=yt(n,t),i&&r&&i!==r&&oi(i,r,n,t)),i&&a(i,t),u=t.firstChild,u&&"BR"!==u.nodeName?n.collapse(!0):(a(t,t),n.selectNodeContents(t.firstChild)),f},hu=function(n,t,i){var l,c,v,o,r,f,y,u,w,p;for(rt(t,i),l=t;l=it(l,i);)a(l,i);if(n.collapsed||pt(n,i),d(n),n.collapse(!1),o=s(n.endContainer,i,"BLOCKQUOTE")||i,c=g(n,i),y=it(t,t),c&&y&&!ff(y,t,/PRE|TABLE|H[1-6]|OL|UL|BLOCKQUOTE/)){if(vt(n,c,c,i),n.collapse(!0),r=n.endContainer,f=n.endOffset,tr(c,i,!1),e(r)&&(u=nt(r,f,kt(r,i),i),r=u.parentNode,f=h.call(r.childNodes,u)),f!==tt(r))for(v=i.ownerDocument.createDocumentFragment();l=r.childNodes[f];)v.appendChild(l);oi(r,y,n,i);f=h.call(r.parentNode.childNodes,r)+1;r=r.parentNode;n.setEnd(r,f)}tt(t)&&(vt(n,o,o,i),u=nt(n.endContainer,n.endOffset,o,i),w=u?u.previousSibling:o.lastChild,o.insertBefore(t,u),u?n.setEndBefore(u):n.setEnd(o,tt(o)),c=yt(n,i),d(n),r=n.endContainer,f=n.endOffset,u&&bt(u)&&ht(u,i),u=w&&w.nextSibling,u&&bt(u)&&ht(u,i),n.setEnd(r,f));v&&(p=n.cloneRange(),oi(c,v,p,i),n.setEnd(p.endContainer,p.endOffset));d(n)},at=function(n,t,i){var r=t.ownerDocument.createRange(),u,f,e,o;return(r.selectNode(t),i)?(u=n.compareBoundaryPoints(3,r)>-1,f=n.compareBoundaryPoints(1,r)<1,!u&&!f):(e=n.compareBoundaryPoints(0,r)<1,o=n.compareBoundaryPoints(2,r)>-1,e&&o)},d=function(n){for(var t,f=n.startContainer,e=n.startOffset,i=n.endContainer,r=n.endOffset,o=!0;f.nodeType!==u&&(t=f.childNodes[e])&&!ot(t);)f=t,e=0;if(r)for(;i.nodeType!==u;){if(!(t=i.childNodes[r-1])||ot(t)){if(o&&t&&"BR"===t.nodeName){r-=1;o=!1;continue}break}i=t;r=tt(i)}else for(;i.nodeType!==u&&(t=i.firstChild)&&!ot(t);)i=t;n.collapsed?(n.setStart(i,r),n.setEnd(f,e)):(n.setStart(f,e),n.setEnd(i,r))},vt=function(n,t,i,r){var e,o=n.startContainer,c=n.startOffset,f=n.endContainer,s=n.endOffset,l=!0;for(t||(t=n.commonAncestorContainer),i||(i=t);!c&&o!==t&&o!==r;)e=o.parentNode,c=h.call(e.childNodes,o),o=e;for(;;){if(l&&f.nodeType!==u&&f.childNodes[s]&&"BR"===f.childNodes[s].nodeName&&(s+=1,l=!1),f===i||f===r||s!==tt(f))break;e=f.parentNode;s=h.call(e.childNodes,f)+1;f=e}n.setStart(o,c);n.setEnd(f,s)},g=function(n,t){var i,r=n.startContainer;return e(r)?i=kt(r,t):r!==t&&st(r)?i=r:(i=gi(r,n.startOffset),i=it(i,t)),i&&at(n,i,!0)?i:null},yt=function(n,t){var i,u,r=n.endContainer;if(e(r))i=kt(r,t);else if(r!==t&&st(r))i=r;else{if(!(i=yr(r,n.endOffset))||!ei(t,i))for(i=t;u=i.lastChild;)i=u;i=kt(i,t)}return i&&at(n,i,!0)?i:null},et=new w(null,4|ni,function(n){return n.nodeType===u?ut.test(n.data):"IMG"===n.nodeName}),hi=function(n,t){var i,r=n.startContainer,f=n.startOffset;if(et.root=null,r.nodeType===u){if(f)return!1;i=r}else if(i=yr(r,f),i&&!ei(t,i)&&(i=null),!i&&(i=gi(r,f),i.nodeType===u&&i.length))return!1;return et.currentNode=i,et.root=g(n,t),!et.previousNode()},wr=function(n,t){var r,i=n.endContainer,f=n.endOffset;if(et.root=null,i.nodeType===u){if((r=i.data.length)&&f<r)return!1;et.currentNode=i}else et.currentNode=gi(i,f);return et.root=yt(n,t),!et.nextNode()},br=function(n,t){var i,r=g(n,t),u=yt(n,t);r&&u&&(i=r.parentNode,n.setStart(i,h.call(i.childNodes,r)),i=u.parentNode,n.setEnd(i,h.call(i.childNodes,u)+1))},pf={8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",37:"left",39:"right",46:"delete",219:"[",221:"]"},wf=function(n){var r=n.keyCode,t=pf[r],u="",i=this.getSelection();n.defaultPrevented||(t||(t=String.fromCharCode(r).toLowerCase(),/^[A-Za-z0-9]$/.test(t)||(t="")),si&&46===n.which&&(t="."),111<r&&r<124&&(t="f"+(r-111)),"backspace"!==t&&"delete"!==t&&(n.altKey&&(u+="alt-"),n.ctrlKey&&(u+="ctrl-"),n.metaKey&&(u+="meta-")),n.shiftKey&&(u+="shift-"),t=u+t,this._keyHandlers[t]?this._keyHandlers[t](this,n,i):i.collapsed||n.isComposing||n.ctrlKey||n.metaKey||1!==(hr?t:n.key||t).length||(this.saveUndoState(i),pt(i,this._root),this._ensureBottomLine(),this.setSelection(i),this._updatePath(i,!0)))},wt=function(n){return function(t,i){i.preventDefault();t[n]()}},ri=function(n,t){return t=t||null,function(i,r){r.preventDefault();var u=i.getSelection();i.hasFormat(n,null,u)?i.changeFormat(null,{tag:n},u):i.changeFormat({tag:n},t,u)}},ci=function(n,t){try{t||(t=n.getSelection());var i,r=t.startContainer;for(r.nodeType===u&&(r=r.parentNode),i=r;e(i)&&(!i.textContent||i.textContent===ti);)r=i,i=r.parentNode;r!==i&&(t.setStart(i,h.call(i.childNodes,r)),t.collapse(!0),i.removeChild(r),st(i)||(i=kt(i,n._root)),a(i,n._root),d(t));r===n._root&&(r=r.firstChild)&&"BR"===r.nodeName&&c(r);n._ensureBottomLine();n.setSelection(t);n._updatePath(t,!0)}catch(t){n.didError(t)}},v={enter:function(n,t,i){var o,l,r,v,e,f=n._root,y,h;if(t.preventDefault(),n._recordUndoState(i),s(i.startContainer,f,"PRE",{"data-te-codeblock":""})||vi(i.startContainer,f,n),n._removeZWS(),n._getRangeAndRemoveBookmark(i),i.collapsed||pt(i,f),(o=g(i,f))&&(l=s(o,f,"PRE")))return d(i),r=i.startContainer,v=i.startOffset,r.nodeType!==u&&(r=n._doc.createTextNode(""),l.insertBefore(r,l.firstChild)),t.shiftKey||"\n"!==r.data.charAt(v-1)&&!hi(i,f)||"\n"!==r.data.charAt(v)&&!wr(i,f)?(r.insertData(v,"\n"),a(l,f),r.length===v+1?i.setStartAfter(r):i.setStart(r,v+1)):(r.deleteData(v&&v-1,v?2:1),e=nt(r,v&&v-1,f,f),r=e.previousSibling,r.textContent||c(r),r=n.createDefaultBlock(),e.parentNode.insertBefore(r,e),e.textContent||c(e),i.setStart(r,0)),i.collapse(!0),n.setSelection(i),n._updatePath(i,!0),void n._docWasChanged();if(!o||t.shiftKey||/^T[HD]$/.test(o.nodeName))return l=s(i.endContainer,f,"A"),l&&(l=l.parentNode,vt(i,l,l,f),i.collapse(!1)),ft(i,n.createElement("BR")),i.collapse(!1),n.setSelection(i),void n._updatePath(i,!0);if((l=s(o,f,"LI"))&&(o=l),uf(o)){if(s(o,f,"UL")||s(o,f,"OL"))return n.decreaseListLevel(i);if(s(o,f,"BLOCKQUOTE"))return n.modifyBlocks(oe,i)}for(e=dr(n,o,i.startContainer,i.startOffset),ir(o),vu(o),a(o,f);e.nodeType===p;){if(h=e.firstChild,"A"===e.nodeName&&(!e.textContent||e.textContent===ti)){h=n._doc.createTextNode("");b(e,h);e=h;break}for(;h&&h.nodeType===u&&!h.data&&(y=h.nextSibling)&&"BR"!==y.nodeName;)c(h),h=y;if(!h||"BR"===h.nodeName||h.nodeType===u&&!si)break;e=h}i=n.createRange(e,0);n.setSelection(i);n._updatePath(i,!0)},"shift-enter":function(n,t,i){return n._keyHandlers.enter(n,t,i)},backspace:function(n,t,i){var u=n._root,f,r;if(n._removeZWS(),n.saveUndoState(i),i.collapsed)if(hi(i,u)){if(t.preventDefault(),r=g(i,u),!r)return;if(rt(r.parentNode,u),f=kt(r,u)){if(!f.isContentEditable){for(;!f.parentNode.isContentEditable;)f=f.parentNode;return void c(f)}for(oi(f,r,i,u),r=f.parentNode;r!==u&&!r.nextSibling;)r=r.parentNode;r!==u&&(r=r.nextSibling)&&ht(r,u);n.setSelection(i)}else if(r){if(s(r,u,"UL")||s(r,u,"OL"))return n.decreaseListLevel(i);if(s(r,u,"BLOCKQUOTE"))return n.modifyBlocks(ku,i);n.setSelection(i);n._updatePath(i,!0)}}else n.setSelection(i),setTimeout(function(){ci(n)},0);else t.preventDefault(),pt(i,u),ci(n,i)},"delete":function(n,t,i){var f,r,s,e,h,o,u=n._root;if(n._removeZWS(),n.saveUndoState(i),i.collapsed)if(wr(i,u)){if(t.preventDefault(),!(f=g(i,u)))return;if(rt(f.parentNode,u),r=it(f,u)){if(!r.isContentEditable){for(;!r.parentNode.isContentEditable;)r=r.parentNode;return void c(r)}for(oi(f,r,i,u),r=f.parentNode;r!==u&&!r.nextSibling;)r=r.parentNode;r!==u&&(r=r.nextSibling)&&ht(r,u);n.setSelection(i);n._updatePath(i,!0)}}else{if(s=i.cloneRange(),vt(i,u,u,u),e=i.endContainer,h=i.endOffset,e.nodeType===p&&(o=e.childNodes[h])&&"IMG"===o.nodeName)return t.preventDefault(),c(o),d(i),void ci(n,i);n.setSelection(s);setTimeout(function(){ci(n)},0)}else t.preventDefault(),pt(i,u),ci(n,i)},tab:function(n,t,i){var u,r,f=n._root;if(n._removeZWS(),i.collapsed&&hi(i,f))for(u=g(i,f);r=u.parentNode;){if("UL"===r.nodeName||"OL"===r.nodeName){t.preventDefault();n.increaseListLevel(i);break}u=r}},"shift-tab":function(n,t,i){var r,u=n._root;n._removeZWS();i.collapsed&&hi(i,u)&&(r=i.startContainer,(s(r,u,"UL")||s(r,u,"OL"))&&(t.preventDefault(),n.decreaseListLevel(i)))},space:function(n,t,i){var r,u=n._root;if(n._recordUndoState(i),vi(i.startContainer,u,n),n._getRangeAndRemoveBookmark(i),r=i.endContainer,i.collapsed&&i.endOffset===tt(r))do if("A"===r.nodeName){i.setStartAfter(r);break}while(!r.nextSibling&&(r=r.parentNode)&&r!==u);i.collapsed||(pt(i,u),n._ensureBottomLine(),n.setSelection(i),n._updatePath(i,!0));n.setSelection(i)},left:function(n){n._removeZWS()},right:function(n){n._removeZWS()}};sr&&fu&&(v["meta-left"]=function(n,t){t.preventDefault();var i=ai(n);i&&i.modify&&i.modify("move","backward","lineboundary")},v["meta-right"]=function(n,t){t.preventDefault();var i=ai(n);i&&i.modify&&i.modify("move","forward","lineboundary")});sr||(v.pageup=function(n){n.moveCursorToStart()},v.pagedown=function(n){n.moveCursorToEnd()});v[k+"b"]=ri("B");v[k+"i"]=ri("I");v[k+"u"]=ri("U");v[k+"shift-7"]=ri("S");v[k+"shift-5"]=ri("SUB",{tag:"SUP"});v[k+"shift-6"]=ri("SUP",{tag:"SUB"});v[k+"shift-8"]=wt("makeUnorderedList");v[k+"shift-9"]=wt("makeOrderedList");v[k+"["]=wt("decreaseQuoteLevel");v[k+"]"]=wt("increaseQuoteLevel");v[k+"d"]=wt("toggleCode");v[k+"y"]=wt("redo");v[k+"z"]=wt("undo");v[k+"shift-z"]=wt("redo");var bf={1:10,2:13,3:16,4:18,5:24,6:32,7:48},cu={backgroundColor:{regexp:ut,replace:function(n,t,i){return l(n,"SPAN",{"class":t.highlight,style:"background-color:"+i})}},color:{regexp:ut,replace:function(n,t,i){return l(n,"SPAN",{"class":t.colour,style:"color:"+i})}},fontWeight:{regexp:/^bold|^700/i,replace:function(n){return l(n,"B")}},fontStyle:{regexp:/^italic/i,replace:function(n){return l(n,"I")}},fontFamily:{regexp:ut,replace:function(n,t,i){return l(n,"SPAN",{"class":t.fontFamily,style:"font-family:"+i})}},fontSize:{regexp:ut,replace:function(n,t,i){return l(n,"SPAN",{"class":t.fontSize,style:"font-size:"+i})}},textDecoration:{regexp:/^underline/i,replace:function(n){return l(n,"U")}}},nr=function(n){return function(t,i){var r=l(t.ownerDocument,n);return i.replaceChild(r,t),r.appendChild(o(t)),r}},lu=function(n,t,i){var f,s,h,r,u,e,c=n.style,l=n.ownerDocument;for(f in cu)s=cu[f],(h=c[f])&&s.regexp.test(h)&&(e=s.replace(l,i.classNames,h),u||(u=e),r&&r.appendChild(e),r=e,n.style[f]="");return u&&(r.appendChild(o(n)),"SPAN"===n.nodeName?t.replaceChild(u,n):n.appendChild(u)),r||n},kf={P:lu,SPAN:lu,STRONG:nr("B"),EM:nr("I"),INS:nr("U"),STRIKE:nr("S"),FONT:function(n,t,i){var c,e,s,r,u,v=n.face,y=n.size,f=n.color,h=n.ownerDocument,a=i.classNames;return v&&(c=l(h,"SPAN",{"class":a.fontFamily,style:"font-family:"+v}),u=c,r=c),y&&(e=l(h,"SPAN",{"class":a.fontSize,style:"font-size:"+bf[y]+"px"}),u||(u=e),r&&r.appendChild(e),r=e),f&&/^#?([\dA-F]{3}){1,2}$/i.test(f)&&("#"!==f.charAt(0)&&(f="#"+f),s=l(h,"SPAN",{"class":a.colour,style:"color:"+f}),u||(u=s),r&&r.appendChild(s),r=s),u||(u=r=l(h,"SPAN")),t.replaceChild(u,n),r.appendChild(o(n)),r},TT:function(n,t,i){var r=l(n.ownerDocument,"SPAN",{"class":i.classNames.fontFamily,style:'font-family:menlo,consolas,"courier new",monospace'});return t.replaceChild(r,n),r.appendChild(o(n)),r}},df=/^(?:A(?:DDRESS|RTICLE|SIDE|UDIO)|BLOCKQUOTE|CAPTION|D(?:[DLT]|IV)|F(?:IGURE|IGCAPTION|OOTER)|H[1-6]|HEADER|HR|L(?:ABEL|EGEND|I)|O(?:L|UTPUT)|P(?:RE)?|SECTION|T(?:ABLE|BODY|D|FOOT|H|HEAD|R)|COL(?:GROUP)?|UL)$/,gf=/^(?:HEAD|META|STYLE)/,li=new w(null,4|ni),ne=function(n,t){var i,r=t.allowedBlocks,u=!1,f=r.length;if(f){for(i=0;i<f;i+=1)r[i]=r[i].toUpperCase();u=new RegExp(r.join("|")).test(n)}return df.test(n)||u},au=function t(n,i,r){for(var l,v,f,c,y,w,b,k,d,h,s,g=n.childNodes,a=n;e(a);)a=a.parentNode;for(li.root=a,l=0,v=g.length;l<v;l+=1)if(f=g[l],c=f.nodeName,y=f.nodeType,w=kf[c],y===p){if(b=f.childNodes.length,w)f=w(f,n,i);else{if(gf.test(c)){n.removeChild(f);l-=1;v-=1;continue}if(!ne(c,i)&&!e(f)){l-=1;v+=b-1;n.replaceChild(o(f),f);continue}}b&&t(f,i,r||"PRE"===c)}else{if(y===u){if(h=f.data,k=!ut.test(h.charAt(0)),d=!ut.test(h.charAt(h.length-1)),r||!k&&!d)continue;if(k){for(li.currentNode=f;(s=li.previousPONode())&&!("IMG"===(c=s.nodeName)||"#text"===c&&ut.test(s.data));)if(!e(s)){s=null;break}h=h.replace(/^[ \t\r\n]+/g,s?" ":"")}if(d){for(li.currentNode=f;(s=li.nextNode())&&!("IMG"===c||"#text"===c&&ut.test(s.data));)if(!e(s)){s=null;break}h=h.replace(/[ \t\r\n]+$/g,s?" ":"")}if(h){f.data=h;continue}}n.removeChild(f);l-=1;v-=1}return n},vu=function t(n){for(var i,o,r=n.childNodes,f=r.length;f--;)(i=r[f],i.nodeType!==p||ot(i))?i.nodeType!==u||i.data||n.removeChild(i):(t(i),o="FIGURE"===i.tagName,(e(i)||o)&&!i.firstChild&&n.removeChild(i))},te=function(n){return n.nodeType===p?"BR"===n.nodeName||"IMG"===n.nodeName:ut.test(n.data)},yu=function(n,t){for(var i,r=n.parentNode;e(r);)r=r.parentNode;return i=new w(r,4|ni,te),i.currentNode=n,!!i.nextNode()||t&&!i.previousNode()},tr=function(n,t,i){for(var f,o,s=n.querySelectorAll("BR"),h=[],u=s.length,r=0;r<u;r+=1)h[r]=yu(s[r],i);for(;u--;)f=s[u],(o=f.parentNode)&&(h[u]?e(o)||rt(o,t):c(f))},pu=function(n,t,i,r){var u,f,e=t.ownerDocument.body,o=r.willCutCopy;tr(t,i,!0);t.setAttribute("style","position:fixed;overflow:hidden;bottom:100%;right:100%;");e.appendChild(t);u=t.innerHTML;f=t.innerText||t.textContent;o&&(u=o(u));cf&&(f=f.replace(/\r?\n/g,"\r\n"));n.setData("text/html",u);n.setData("text/plain",f);e.removeChild(t)},ie=function(n){var e,h,c,f,t,o,s,l=n.clipboardData,i=this.getSelection(),r=this._root,a=this;if(i.collapsed)return void n.preventDefault();if(this.saveUndoState(i),wi||or||!l)setTimeout(function(){try{a._ensureBottomLine()}catch(n){a.didError(n)}},0);else{for(e=g(i,r),h=yt(i,r),c=e===h&&e||r,f=pt(i,r),t=i.commonAncestorContainer,t.nodeType===u&&(t=t.parentNode);t&&t!==c;)o=t.cloneNode(!1),o.appendChild(f),f=o,t=t.parentNode;s=this.createElement("div");s.appendChild(f);pu(l,s,r,this._config);n.preventDefault()}this.setSelection(i)},re=function(n){var o,c,f,e,t,s,h,l=n.clipboardData,i=this.getSelection(),r=this._root;if(!wi&&!or&&l){for(o=g(i,r),c=yt(i,r),f=o===c&&o||r,i=i.cloneRange(),d(i),vt(i,f,f,r),e=i.cloneContents(),t=i.commonAncestorContainer,t.nodeType===u&&(t=t.parentNode);t&&t!==f;)s=t.cloneNode(!1),s.appendChild(e),e=s,t=t.parentNode;h=this.createElement("div");h.appendChild(e);pu(l,h,r,this._config);n.preventDefault()}},wu=function(n){var l,o,s,f,e,i=n.clipboardData,a=i&&i.items,v=this.isShiftDown,p=!1,w=!1,y=null,r=this;if(a){for(n.preventDefault(),l=a.length;l--;){if(o=a[l],s=o.type,!v&&"text/html"===s)return void o.getAsString(function(n){r.insertHTML(n,!0)});"text/plain"===s&&(y=o);!v&&/^image\/.*/.test(s)&&(w=!0)}return void(w?(this.fireEvent("dragover",{dataTransfer:i,preventDefault:function(){p=!0}}),p&&this.fireEvent("drop",{dataTransfer:i})):y&&y.getAsString(function(n){r.insertPlainText(n,!0)}))}if(f=i&&i.types,!wi&&f&&(h.call(f,"text/html")>-1||!fu&&h.call(f,"text/plain")>-1&&h.call(f,"text/rtf")<0))return n.preventDefault(),void(!v&&(e=i.getData("text/html"))?this.insertHTML(e,!0):((e=i.getData("text/plain"))||(e=i.getData("text/uri-list")))&&this.insertPlainText(e,!0));this._awaitingPaste=!0;var b=this._doc.body,u=this.getSelection(),k=u.startContainer,d=u.startOffset,g=u.endContainer,nt=u.endOffset,t=this.createElement("DIV",{contenteditable:"true",style:"position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;"});b.appendChild(t);u.selectNodeContents(t);this.setSelection(u);setTimeout(function(){try{r._awaitingPaste=!1;for(var n,u,i="",f=t;t=f;)f=t.nextSibling,c(t),n=t.firstChild,n&&n===t.lastChild&&"DIV"===n.nodeName&&(t=n),i+=t.innerHTML;u=r.createRange(k,d,g,nt);r.setSelection(u);i&&r.insertHTML(i,!0)}catch(n){r.didError(n)}},0)},ue=function(n){for(var t=n.dataTransfer.types,i=t.length,r=!1,u=!1;i--;)switch(t[i]){case"text/plain":r=!0;break;case"text/html":u=!0;break;default:return}(u||r)&&this.saveUndoState()},r=f.prototype,fe=function(n,t,i){var r=i._doc,u=n?DOMPurify.sanitize(n,{ALLOW_UNKNOWN_PROTOCOLS:!0,WHOLE_DOCUMENT:!1,RETURN_DOM:!0,RETURN_DOM_FRAGMENT:!0}):null;return u?r.importNode(u,!0):r.createDocumentFragment()};r.setConfig=function(n){return n=gt({blockTag:"DIV",blockAttributes:null,tagAttributes:{blockquote:null,ul:null,ol:null,li:null,a:null},classNames:{colour:"colour",fontFamily:"font",fontSize:"size",highlight:"highlight"},leafNodeNames:ar,undo:{documentSizeThreshold:-1,undoLimit:-1},isInsertedHTMLSanitized:!0,isSetHTMLSanitized:!0,sanitizeToDOMFragment:"undefined"!=typeof DOMPurify&&DOMPurify.isSupported?fe:null,willCutCopy:null,allowedBlocks:[]},n,!0),n.blockTag=n.blockTag.toUpperCase(),this._config=n,this};r.createElement=function(n,t,i){return l(this._doc,n,t,i)};r.createDefaultBlock=function(n){var t=this._config;return a(this.createElement(t.blockTag,t.blockAttributes,n),this._root)};r.didError=function(n){console.log(n)};r.getDocument=function(){return this._doc};r.getRoot=function(){return this._root};r.modifyDocument=function(n){var t=this._mutation;t&&(t.takeRecords().length&&this._docWasChanged(),t.disconnect());this._ignoreAllChanges=!0;n();this._ignoreAllChanges=!1;t&&(t.observe(this._root,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),this._ignoreChange=!1)};kr={pathChange:1,select:1,input:1,undoStateChange:1};r.fireEvent=function(n,t){var u,f,r,i=this._events[n];if(/^(?:focus|blur)/.test(n))if(u=this._root===this._doc.activeElement,"focus"===n){if(!u||this._isFocused)return this;this._isFocused=!0}else{if(u||!this._isFocused)return this;this._isFocused=!1}if(i)for(t||(t={}),t.type!==n&&(t.type=n),i=i.slice(),f=i.length;f--;){r=i[f];try{r.handleEvent?r.handleEvent(t):r.call(this,t)}catch(t){t.details="Squire: fireEvent error. Event type: "+n;this.didError(t)}}return this};r.destroy=function(){var n,t=this._events;for(n in t)this.removeEventListener(n);this._mutation&&this._mutation.disconnect();delete this._root.__squire__;this._undoIndex=-1;this._undoStack=[];this._undoStackLength=0};r.handleEvent=function(n){this.fireEvent(n.type,n)};r.addEventListener=function(n,t){var i=this._events[n],r=this._root;return t?(i||(i=this._events[n]=[],kr[n]||("selectionchange"===n&&(r=this._doc),r.addEventListener(n,this,!0))),i.push(t),this):(this.didError({name:"Squire: addEventListener with null or undefined fn",message:"Event type: "+n}),this)};r.removeEventListener=function(n,t){var r,i=this._events[n],u=this._root;if(i){if(t)for(r=i.length;r--;)i[r]===t&&i.splice(r,1);else i.length=0;i.length||(delete this._events[n],kr[n]||("selectionchange"===n&&(u=this._doc),u.removeEventListener(n,this,!0)))}return this};r.createRange=function(n,t,i,r){if(n instanceof this._win.Range)return n.cloneRange();var u=this._doc.createRange();return u.setStart(n,t),i?u.setEnd(i,r):u.setEnd(n,t),u};r.getCursorPosition=function(n){if(!n&&!(n=this.getSelection())||!n.getBoundingClientRect)return null;var t,r,i=n.getBoundingClientRect();return i&&!i.top&&(this._ignoreChange=!0,t=this._doc.createElement("SPAN"),t.textContent=ti,ft(n,t),i=t.getBoundingClientRect(),r=t.parentNode,r.removeChild(t),dt(r,n),this._ignoreChange=!1),i};r._moveCursorTo=function(n){var t=this._root,i=this.createRange(t,n?0:t.childNodes.length);return d(i),this.setSelection(i),this};r.moveCursorToStart=function(){return this._moveCursorTo(!0)};r.moveCursorToEnd=function(){return this._moveCursorTo(!1)};ai=function(n){return n._win.getSelection()||null};r.setSelection=function(n){if(n)if(this._lastSelection=n,this._isFocused)if(hf&&!this._restoreSelection)pi.call(this),this.blur(),this.focus();else{or&&this._win.focus();var t=ai(this);t&&(t.removeAllRanges(),t.addRange(n))}else pi.call(this);return this};r.getSelection=function(){var n,t,i,r,u=ai(this),f=this._root;return this._isFocused&&u&&u.rangeCount&&(n=u.getRangeAt(0).cloneRange(),t=n.startContainer,i=n.endContainer,t&&ot(t)&&n.setStartBefore(t),i&&ot(i)&&n.setEndBefore(i)),n&&ei(f,n.commonAncestorContainer)?this._lastSelection=n:(n=this._lastSelection,r=n.commonAncestorContainer,ei(r.ownerDocument,r)||(n=null)),n||(n=this.createRange(f.firstChild,0)),n};r.getSelectedText=function(){var t=this.getSelection();if(!t||t.collapsed)return"";var i,r=new w(t.commonAncestorContainer,4|ni,function(n){return at(t,n,!0)}),s=t.startContainer,h=t.endContainer,n=r.currentNode=s,f="",o=!1;for(r.filter(n)||(n=r.nextNode());n;)n.nodeType===u?(i=n.data)&&/\S/.test(i)&&(n===h&&(i=i.slice(0,t.endOffset)),n===s&&(i=i.slice(t.startOffset)),f+=i,o=!0):("BR"===n.nodeName||o&&!e(n))&&(f+="\n",o=!1),n=r.nextNode();return f};r.getPath=function(){return this._path};ir=function(n,t){for(var r,i,u,f=new w(n,4);i=f.nextNode();)for(;(u=i.data.indexOf(ti))>-1&&(!t||i.parentNode!==t);){if(1===i.length){do r=i.parentNode,r.removeChild(i),i=r,f.currentNode=r;while(e(i)&&!tt(i));break}i.deleteData(u,1)}};r._didAddZWS=function(){this._hasZWS=!0};r._removeZWS=function(){this._hasZWS&&(ir(this._root),this._hasZWS=!1)};r._updatePath=function(n,t){if(n){var r,u=n.startContainer,i=n.endContainer;(t||u!==this._lastAnchorNode||i!==this._lastFocusNode)&&(this._lastAnchorNode=u,this._lastFocusNode=i,r=u&&i?u===i?nu(i,this._root,this._config):"(selection)":"",this._path!==r&&(this._path=r,this.fireEvent("pathChange",{path:r})));this.fireEvent(n.collapsed?"cursor":"select",{range:n})}};r._updatePathOnEvent=function(){var n=this;n._isFocused&&!n._willUpdatePath&&(n._willUpdatePath=!0,setTimeout(function(){n._willUpdatePath=!1;n._updatePath(n.getSelection())},0))};r.focus=function(){if(hr){try{this._root.setActive()}catch(n){}this.fireEvent("focus")}else this._root.focus();return this};r.blur=function(){return this._root.blur(),hr&&this.fireEvent("blur"),this};ui="squire-selection-end";r._saveRangeToBookmark=function(n){var r,t=this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),i=this.createElement("INPUT",{id:ui,type:"hidden"});ft(n,t);n.collapse(!1);ft(n,i);2&t.compareDocumentPosition(i)&&(t.id=ui,i.id="squire-selection-start",r=t,t=i,i=r);n.setStartAfter(t);n.setEndBefore(i)};r._getRangeAndRemoveBookmark=function(n){var e=this._root,r=e.querySelector("#squire-selection-start"),f=e.querySelector("#"+ui);if(r&&f){var i=r.parentNode,t=f.parentNode,s=h.call(i.childNodes,r),o=h.call(t.childNodes,f);i===t&&(o-=1);c(r);c(f);n||(n=this._doc.createRange());n.setStart(i,s);n.setEnd(t,o);dt(i,n);i!==t&&dt(t,n);n.collapsed&&(i=n.startContainer,i.nodeType===u&&(t=i.childNodes[n.startOffset],t&&t.nodeType===u||(t=i.childNodes[n.startOffset-1]),t&&t.nodeType===u&&(n.setStart(t,0),n.collapse(!0))))}return n||null};r._keyUpDetectChange=function(n){var t=n.keyCode;!n.ctrlKey&&!n.metaKey&&!n.altKey&&(t<16||t>20)&&(t<33||t>45)&&this._docWasChanged()};r._docWasChanged=function(){if(bi&&(di=new WeakMap),!this._ignoreAllChanges){if(lt&&this._ignoreChange)return void(this._ignoreChange=!1);this._isInUndoState&&(this._isInUndoState=!1,this.fireEvent("undoStateChange",{canUndo:!0,canRedo:!1}));this.fireEvent("input")}};r._recordUndoState=function(n,t){if(!this._isInUndoState||t){var u,i=this._undoIndex,f=this._undoStack,e=this._config.undo,o=e.documentSizeThreshold,r=e.undoLimit;t||(i+=1);i<this._undoStackLength&&(f.length=this._undoStackLength=i);n&&this._saveRangeToBookmark(n);u=this._getHTML();o>-1&&2*u.length>o&&r>-1&&i>r&&(f.splice(0,i-r),i=r,this._undoStackLength=r);f[i]=u;this._undoIndex=i;this._undoStackLength+=1;this._isInUndoState=!0}};r.saveUndoState=function(n){return n===i&&(n=this.getSelection()),this._recordUndoState(n,this._isInUndoState),this._getRangeAndRemoveBookmark(n),this};r.undo=function(){if(0!==this._undoIndex||!this._isInUndoState){this._recordUndoState(this.getSelection(),!1);this._undoIndex-=1;this._setHTML(this._undoStack[this._undoIndex]);var n=this._getRangeAndRemoveBookmark();n&&this.setSelection(n);this._isInUndoState=!0;this.fireEvent("undoStateChange",{canUndo:0!==this._undoIndex,canRedo:!0});this.fireEvent("input")}return this};r.redo=function(){var t=this._undoIndex,i=this._undoStackLength,n;return t+1<i&&this._isInUndoState&&(this._undoIndex+=1,this._setHTML(this._undoStack[this._undoIndex]),n=this._getRangeAndRemoveBookmark(),n&&this.setSelection(n),this.fireEvent("undoStateChange",{canUndo:!0,canRedo:t+2<i}),this.fireEvent("input")),this};r.hasFormat=function(n,t,i){var o,h,f,r,e;if(n=n.toUpperCase(),t||(t={}),!i&&!(i=this.getSelection()))return!1;if(!i.collapsed&&i.startContainer.nodeType===u&&i.startOffset===i.startContainer.length&&i.startContainer.nextSibling&&i.setStartBefore(i.startContainer.nextSibling),!i.collapsed&&i.endContainer.nodeType===u&&0===i.endOffset&&i.endContainer.previousSibling&&i.setEndAfter(i.endContainer.previousSibling),f=this._root,r=i.commonAncestorContainer,s(r,f,n,t))return!0;if(r.nodeType===u)return!1;for(o=new w(r,4,function(n){return at(i,n,!0)}),e=!1;h=o.nextNode();){if(!s(h,f,n,t))return!1;e=!0}return e};r.getFontInfo=function(n){var r,e,f,t={color:i,backgroundColor:i,family:i,size:i},o=0;if(!n&&!(n=this.getSelection()))return t;if(r=n.commonAncestorContainer,n.collapsed||r.nodeType===u)for(r.nodeType===u&&(r=r.parentNode);o<4&&r;)(e=r.style)&&(!t.color&&(f=e.color)&&(t.color=f,o+=1),!t.backgroundColor&&(f=e.backgroundColor)&&(t.backgroundColor=f,o+=1),!t.family&&(f=e.fontFamily)&&(t.family=f,o+=1),!t.size&&(f=e.fontSize)&&(t.size=f,o+=1)),r=r.parentNode;return t};r._addFormat=function(n,t,i){var f,v,o,h,c,l,r,y,p=this._root;if(i.collapsed){for(f=a(this.createElement(n,t),p),ft(i,f),i.setStart(f.firstChild,f.firstChild.length),i.collapse(!0),y=f;e(y);)y=y.parentNode;ir(y,f)}else{if(v=new w(i.commonAncestorContainer,4|ni,function(n){return(n.nodeType===u||"BR"===n.nodeName||"IMG"===n.nodeName)&&at(i,n,!0)}),o=i.startContainer,c=i.startOffset,h=i.endContainer,l=i.endOffset,v.currentNode=o,v.filter(o)||(o=v.nextNode(),c=0),!o)return i;do r=v.currentNode,s(r,p,n,t)||(r===h&&r.length>l&&r.splitText(l),r===o&&c&&(r=r.splitText(c),h===o&&(h=r,l-=c),o=r,c=0),f=this.createElement(n,t),b(r,f),f.appendChild(r));while(v.nextNode());h.nodeType!==u&&(r.nodeType===u?(h=r,l=r.length):(h=r.parentNode,l=1));i=this.createRange(o,c,h,l)}return i};r._removeFormat=function(n,t,i,r){var s,c,f;for(this._saveRangeToBookmark(i),c=this._doc,i.collapsed&&(lr?(s=c.createTextNode(ti),this._didAddZWS()):s=c.createTextNode(""),ft(i,s)),f=i.commonAncestorContainer;e(f);)f=f.parentNode;var p=i.startContainer,l=i.startOffset,w=i.endContainer,a=i.endOffset,h=[],v=function(n,t){if(!at(i,n,!1)){var r,f,e=n.nodeType===u;if(!at(i,n,!0))return void("INPUT"===n.nodeName||e&&!n.data||h.push([t,n]));if(e)n===w&&a!==n.length&&h.push([t,n.splitText(a)]),n===p&&l&&(n.splitText(l),h.push([t,n]));else for(r=n.firstChild;r;r=f)f=r.nextSibling,v(r,t)}},y=Array.prototype.filter.call(f.getElementsByTagName(n),function(r){return at(i,r,!0)&&yi(r,n,t)});return r||y.forEach(function(n){v(n,n)}),h.forEach(function(n){var t=n[0].cloneNode(!1),i=n[1];b(i,t);t.appendChild(i)}),y.forEach(function(n){b(n,o(n))}),this._getRangeAndRemoveBookmark(i),s&&i.collapse(!1),dt(f,i),i};r.changeFormat=function(n,t,i,r){return i||(i=this.getSelection())?(this.saveUndoState(i),t&&(i=this._removeFormat(t.tag.toUpperCase(),t.attributes||{},i,r)),n&&(i=this._addFormat(n.tag.toUpperCase(),n.attributes||{},i)),this.setSelection(i),this._updatePath(i,!0),lt||this._docWasChanged(),this):this};bu={DT:"DD",DD:"DT",LI:"LI",PRE:"PRE"};dr=function(n,t,i,r){var f=bu[t.nodeName],e=null,u=nt(i,r,t.parentNode,n._root),s=n._config;return f||(f=s.blockTag,e=s.blockAttributes),yi(u,f,e)||(t=l(u.ownerDocument,f,e),u.dir&&(t.dir=u.dir),b(u,t),t.appendChild(o(u)),u=t),u};r.forEachBlock=function(n,t,i){if(!i&&!(i=this.getSelection()))return this;t&&this.saveUndoState(i);var u=this._root,r=g(i,u),f=yt(i,u);if(r&&f)do if(n(r)||r===f)break;while(r=it(r,u));return t&&(this.setSelection(i),this._updatePath(i,!0),lt||this._docWasChanged()),this};r.modifyBlocks=function(n,t){if(!t&&!(t=this.getSelection()))return this;this._recordUndoState(t,this._isInUndoState);var r,i=this._root;return br(t,i),vt(t,i,i,i),r=pr(t,i,i),ft(t,n.call(this,r)),t.endOffset<t.endContainer.childNodes.length&&ht(t.endContainer.childNodes[t.endOffset],i),ht(t.startContainer.childNodes[t.startOffset],i),this._getRangeAndRemoveBookmark(t),this.setSelection(t),this._updatePath(t,!0),lt||this._docWasChanged(),this};var ee=function(n){return this.createElement("BLOCKQUOTE",this._config.tagAttributes.blockquote,[n])},ku=function(n){var t=this._root,i=n.querySelectorAll("blockquote");return Array.prototype.filter.call(i,function(n){return!s(n.parentNode,t,"BLOCKQUOTE")}).forEach(function(n){b(n,o(n))}),n},oe=function(){return this.createDefaultBlock([this.createElement("INPUT",{id:"squire-selection-start",type:"hidden"}),this.createElement("INPUT",{id:ui,type:"hidden"})])},du=function(n,t,i){for(var r,s,f,u,e=fi(t,n._root),h=n._config.tagAttributes,l=h[i.toLowerCase()],a=h.li;r=e.nextNode();)"LI"===r.parentNode.nodeName&&(r=r.parentNode,e.currentNode=r.lastChild),"LI"!==r.nodeName?(u=n.createElement("LI",a),r.dir&&(u.dir=r.dir),(f=r.previousSibling)&&f.nodeName===i?(f.appendChild(u),c(r)):b(r,n.createElement(i,l,[u])),u.appendChild(o(r)),e.currentNode=u):(r=r.parentNode,(s=r.nodeName)!==i&&/^[OU]L$/.test(s)&&b(r,n.createElement(i,l,[o(r)])))},se=function(n){return du(this,n,"UL"),n},he=function(n){return du(this,n,"OL"),n},ce=function(n){for(var u,f,i,e=n.querySelectorAll("UL, OL"),s=n.querySelectorAll("LI"),h=this._root,t=0,r=e.length;t<r;t+=1)u=e[t],f=o(u),rt(f,h),b(u,f);for(t=0,r=s.length;t<r;t+=1)i=s[t],st(i)?b(i,this.createDefaultBlock([o(i)])):(rt(i,h),b(i,o(i)));return n},gu=function(n,t){for(var i=n.commonAncestorContainer,r=n.startContainer,u=n.endContainer;i&&i!==t&&!/^[OU]L$/.test(i.nodeName);)i=i.parentNode;if(!i||i===t)return null;for(r===i&&(r=r.childNodes[n.startOffset]),u===i&&(u=u.childNodes[n.endOffset]);r&&r.parentNode!==i;)r=r.parentNode;for(;u&&u.parentNode!==i;)u=u.parentNode;return[i,r,u]};r.increaseListLevel=function(n){var e,r,s,u,f,i;if(!n&&!(n=this.getSelection())||(e=this._root,r=gu(n,e),!r))return this.focus();var o=r[0],t=r[1],h=r[2];if(!t||t===o.firstChild)return this.focus();this._recordUndoState(n,this._isInUndoState);f=o.nodeName;i=t.previousSibling;i.nodeName!==f&&(s=this._config.tagAttributes[f.toLowerCase()],i=this.createElement(f,s),o.insertBefore(i,t));do u=t===h?null:t.nextSibling,i.appendChild(t);while(t=u);return u=i.nextSibling,u&&ht(u,e),this._getRangeAndRemoveBookmark(n),this.setSelection(n),this._updatePath(n,!0),lt||this._docWasChanged(),this.focus()};r.decreaseListLevel=function(n){var e,s,h,u,r,l;if(!n&&!(n=this.getSelection())||(e=this._root,s=gu(n,e),!s))return this.focus();var i=s[0],t=s[1],f=s[2];if(t||(t=i.firstChild),f||(f=i.lastChild),this._recordUndoState(n,this._isInUndoState),u=i.parentNode,r=f.nextSibling?nt(i,f.nextSibling,u,e):i.nextSibling,u!==e&&"LI"===u.nodeName){for(u=u.parentNode;r;)h=r.nextSibling,f.appendChild(r),r=h;r=i.parentNode.nextSibling}l=!/^[OU]L$/.test(u.nodeName);do h=t===f?null:t.nextSibling,i.removeChild(t),l&&"LI"===t.nodeName&&(t=this.createDefaultBlock([o(t)])),u.insertBefore(t,r);while(t=h);return i.firstChild||c(i),r&&ht(r,e),this._getRangeAndRemoveBookmark(n),this.setSelection(n),this._updatePath(n,!0),lt||this._docWasChanged(),this.focus()};r._ensureBottomLine=function(){var t=this._root,n=t.lastElementChild;n&&n.nodeName===this._config.blockTag&&st(n)||t.appendChild(this.createDefaultBlock())};r.setKeyHandler=function(n,t){return this._keyHandlers[n]=t,this};r._getHTML=function(){return this._root.innerHTML};r._setHTML=function(n){var i=this._root,t=i;t.innerHTML=n;do a(t,i);while(t=it(t,i));this._ignoreChange=!0};r.getHTML=function(n){var r,t,u,o,f,i,e=[];if(n&&(i=this.getSelection())&&this._saveRangeToBookmark(i),cr)for(r=this._root,t=r;t=it(t,r);)t.textContent||t.querySelector("BR")||(u=this.createElement("BR"),t.appendChild(u),e.push(u));if(o=this._getHTML().replace(/\u200B/g,""),cr)for(f=e.length;f--;)c(e[f]);return i&&this._getRangeAndRemoveBookmark(i),o};r.setHTML=function(n){var f,i,s,e=this._config,h=e.isSetHTMLSanitized?e.sanitizeToDOMFragment:null,t=this._root,r,u;for("function"==typeof h?i=h(n,!1,this):(f=this.createElement("DIV"),f.innerHTML=n,i=this._doc.createDocumentFragment(),i.appendChild(o(f))),au(i,e),tr(i,t,!1),rt(i,t),r=i;r=it(r,t);)a(r,t);for(this._ignoreChange=!0;s=t.lastChild;)t.removeChild(s);return t.appendChild(i),a(t,t),this._undoIndex=-1,this._undoStack.length=0,this._undoStackLength=0,this._isInUndoState=!1,u=this._getRangeAndRemoveBookmark()||this.createRange(t.firstChild,0),this.saveUndoState(u),this._lastSelection=u,pi.call(this),this._updatePath(u,!0),this};r.insertElement=function(n,t){if(t||(t=this.getSelection()),t.collapse(!0),e(n))ft(t,n),t.setStartAfter(n);else{for(var f,r,i=this._root,u=g(t,i)||i;u!==i&&!u.nextSibling;)u=u.parentNode;u!==i&&(f=u.parentNode,r=nt(f,u.nextSibling,i,i));r?i.insertBefore(n,r):(i.appendChild(n),r=this.createDefaultBlock(),i.appendChild(r));t.setStart(r,0);t.setEnd(r,0);d(t)}return this.focus(),this.setSelection(t),this._updatePath(t),lt||this._docWasChanged(),this};r.insertImage=function(n,t){var i=this.createElement("IMG",gt({src:n},t,!0));return this.insertElement(i),i};r.linkRegExp=/\b((?:(?:ht|f)tps?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,}\/)(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))|([\w\-.%+]+@(?:[\w\-]+\.)+[A-Z]{2,}\b)(?:\?[^&?\s]+=[^&?\s]+(?:&[^&?\s]+=[^&?\s]+)*)?/i;vi=function(n,t,i){var u,f,h,r,e,c,o,a=n.ownerDocument,v=new w(n,4,function(n){return!s(n,t,"A")}),l=i.linkRegExp,y=i._config.tagAttributes.a;if(l)for(;u=v.nextNode();)for(f=u.data,h=u.parentNode;r=l.exec(f);)e=r.index,c=e+r[0].length,e&&(o=a.createTextNode(f.slice(0,e)),h.insertBefore(o,u)),o=i.createElement("A",gt({href:r[1]?/^(?:ht|f)tps?:/i.test(r[1])?r[1]:"http://"+r[1]:"mailto:"+r[0]},y,!1)),o.textContent=f.slice(e,c),h.insertBefore(o,u),u.data=f=f.slice(c)};r.insertHTML=function(n,t){var s,h,c,i,u,f,e,l=this._config,v=l.isInsertedHTMLSanitized?l.sanitizeToDOMFragment:null,r=this.getSelection(),y=this._doc;"function"==typeof v?i=v(n,t,this):(t&&(s=n.indexOf("<!--StartFragment-->"),h=n.lastIndexOf("<!--EndFragment-->"),s>-1&&h>-1&&(n=n.slice(s+20,h))),/<\/td>((?!<\/tr>)[\s\S])*$/i.test(n)&&(n="<TR>"+n+"<\/TR>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(n)&&(n="<TABLE>"+n+"<\/TABLE>"),c=this.createElement("DIV"),c.innerHTML=n,i=y.createDocumentFragment(),i.appendChild(o(c)));this.saveUndoState(r);try{for(u=this._root,f=i,e={fragment:i,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},vi(i,i,this),au(i,l),tr(i,u,!1),vu(i),i.normalize();f=it(f,i);)a(f,u);t&&this.fireEvent("willPaste",e);e.defaultPrevented||(hu(r,e.fragment,u),lt||this._docWasChanged(),r.collapse(!1),this._ensureBottomLine());this.setSelection(r);this._updatePath(r,!0);t&&this.focus()}catch(n){this.didError(n)}return this};gr=function(n){return n.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")};r.insertPlainText=function(n,t){var r=this.getSelection(),l,o,i,f;if(r.collapsed&&s(r.startContainer,this._root,"PRE"))return i=r.startContainer,f=r.startOffset,i&&i.nodeType===u||(l=this._doc.createTextNode(""),i.insertBefore(l,i.childNodes[f]),i=l,f=0),o={text:n,preventDefault:function(){this.defaultPrevented=!0},defaultPrevented:!1},t&&this.fireEvent("willPaste",o),o.defaultPrevented||(n=o.text,i.insertData(f,n),r.setStart(i,f+n.length),r.collapse(!0)),this.setSelection(r),this;var a,e,y,h,c=n.split("\n"),p=this._config,w=p.blockTag,b=p.blockAttributes,k="<\/"+w+">",v="<"+w;for(a in b)v+=" "+a+'="'+gr(b[a])+'"';for(v+=">",e=0,y=c.length;e<y;e+=1)h=c[e],h=gr(h).replace(/ (?= )/g,"&nbsp;"),c[e]=v+(h||"<BR>")+k;return this.insertHTML(c.join(""),t)};y=function(n,t,i){return function(){return this[n](t,i),this.focus()}};r.addStyles=function(n){if(n){var i=this._doc.documentElement.firstChild,t=this.createElement("STYLE",{type:"text/css"});t.appendChild(this._doc.createTextNode(n));i.appendChild(t)}return this};r.bold=y("changeFormat",{tag:"B"});r.italic=y("changeFormat",{tag:"I"});r.underline=y("changeFormat",{tag:"U"});r.strikethrough=y("changeFormat",{tag:"S"});r.subscript=y("changeFormat",{tag:"SUB"},{tag:"SUP"});r.superscript=y("changeFormat",{tag:"SUP"},{tag:"SUB"});r.removeBold=y("changeFormat",null,{tag:"B"});r.removeItalic=y("changeFormat",null,{tag:"I"});r.removeUnderline=y("changeFormat",null,{tag:"U"});r.removeStrikethrough=y("changeFormat",null,{tag:"S"});r.removeSubscript=y("changeFormat",null,{tag:"SUB"});r.removeSuperscript=y("changeFormat",null,{tag:"SUP"});r.makeLink=function(n,t){var r=this.getSelection(),i;if(r.collapsed){if(i=n.indexOf(":")+1,i)for(;"/"===n[i];)i+=1;ft(r,this._doc.createTextNode(n.slice(i)))}return t=gt(gt({href:n},t,!0),this._config.tagAttributes.a,!1),this.changeFormat({tag:"A",attributes:t},{tag:"A"},r),this.focus()};r.removeLink=function(){return this.changeFormat(null,{tag:"A"},this.getSelection(),!0),this.focus()};r.setFontFace=function(n){var t=this._config.classNames.fontFamily;return this.changeFormat(n?{tag:"SPAN",attributes:{"class":t,style:"font-family: "+n+", sans-serif;"}}:null,{tag:"SPAN",attributes:{"class":t}}),this.focus()};r.setFontSize=function(n){var t=this._config.classNames.fontSize;return this.changeFormat(n?{tag:"SPAN",attributes:{"class":t,style:"font-size: "+("number"==typeof n?n+"px":n)}}:null,{tag:"SPAN",attributes:{"class":t}}),this.focus()};r.setTextColour=function(n){var t=this._config.classNames.colour;return this.changeFormat(n?{tag:"SPAN",attributes:{"class":t,style:"color:"+n}}:null,{tag:"SPAN",attributes:{"class":t}}),this.focus()};r.setHighlightColour=function(n){var t=this._config.classNames.highlight;return this.changeFormat(n?{tag:"SPAN",attributes:{"class":t,style:"background-color:"+n}}:n,{tag:"SPAN",attributes:{"class":t}}),this.focus()};r.setTextAlignment=function(n){return this.forEachBlock(function(t){var i=t.className.split(/\s+/).filter(function(n){return!!n&&!/^align/.test(n)}).join(" ");n?(t.className=i+" align-"+n,t.style.textAlign=n):(t.className=i,t.style.textAlign="")},!0),this.focus()};r.setTextDirection=function(n){return this.forEachBlock(function(t){n?t.dir=n:t.removeAttribute("dir")},!0),this.focus()};nf=function(n){for(var t,l=this._root,e=this._doc,r=e.createDocumentFragment(),s=fi(n,l);t=s.nextNode();){for(var h,u=t.querySelectorAll("BR"),v=[],i=u.length,f=0;f<i;f+=1)v[f]=yu(u[f],!1);for(;i--;)h=u[i],v[i]?b(h,e.createTextNode("\n")):c(h);for(u=t.querySelectorAll("CODE"),i=u.length;i--;)c(u[i]);r.childNodes.length&&r.appendChild(e.createTextNode("\n"));r.appendChild(o(t))}for(s=new w(r,4);t=s.nextNode();)t.data=t.data.replace(/ /g," ");return r.normalize(),a(this.createElement("PRE",this._config.tagAttributes.pre,[r]),l)};tf=function(n){for(var i,s,r,t,u,f,e=this._doc,l=this._root,h=n.querySelectorAll("PRE"),c=h.length;c--;){for(i=h[c],s=new w(i,4);r=s.nextNode();){for(t=r.data,t=t.replace(/ (?= )/g," "),u=e.createDocumentFragment();(f=t.indexOf("\n"))>-1;)u.appendChild(e.createTextNode(t.slice(0,f))),u.appendChild(e.createElement("BR")),t=t.slice(f+1);r.parentNode.insertBefore(u,r);r.data=t}rt(i,l);b(i,o(i))}return n};r.code=function(){var n=this.getSelection();return n.collapsed||bt(n.commonAncestorContainer)?this.modifyBlocks(nf,n):this.changeFormat({tag:"CODE",attributes:this._config.tagAttributes.code},null,n),this.focus()};r.removeCode=function(){var n=this.getSelection();return s(n.commonAncestorContainer,this._root,"PRE")?this.modifyBlocks(tf,n):this.changeFormat(null,{tag:"CODE"},n),this.focus()};r.toggleCode=function(){return this.hasFormat("PRE")||this.hasFormat("CODE")?this.removeCode():this.code(),this};r.removeAllFormatting=function(n){var r,t;if(!n&&!(n=this.getSelection())||n.collapsed)return this;for(r=this._root,t=n.commonAncestorContainer;t&&!st(t);)t=t.parentNode;if(t||(br(n,r),t=r),t.nodeType===u)return this;this.saveUndoState(n);vt(n,t,t,r);for(var o,s,a=t.ownerDocument,y=n.startContainer,f=n.startOffset,p=n.endContainer,c=n.endOffset,v=a.createDocumentFragment(),e=a.createDocumentFragment(),l=nt(p,c,t,r),i=nt(y,f,t,r);i!==l;)o=i.nextSibling,v.appendChild(i),i=o;return er(this,v,e),e.normalize(),i=e.firstChild,o=e.lastChild,s=t.childNodes,i?(t.insertBefore(e,l),f=h.call(s,i),c=h.call(s,o)+1):(f=h.call(s,l),c=f),n.setStart(t,f),n.setEnd(t,c),dt(t,n),d(n),this.setSelection(n),this._updatePath(n,!0),this.focus()};r.increaseQuoteLevel=y("modifyBlocks",ee);r.decreaseQuoteLevel=y("modifyBlocks",ku);r.makeUnorderedList=y("modifyBlocks",se);r.makeOrderedList=y("modifyBlocks",he);r.removeList=y("modifyBlocks",ce);f.isInline=e;f.isBlock=st;f.isContainer=bt;f.getBlockWalker=fi;f.getPreviousBlock=kt;f.getNextBlock=it;f.areAlike=ur;f.hasTagAttributes=yi;f.getNearest=s;f.isOrContains=ei;f.detach=c;f.replaceWith=b;f.empty=o;f.getNodeBefore=gi;f.getNodeAfter=yr;f.insertNodeInRange=ft;f.extractContentsOfRange=pr;f.deleteContentsOfRange=pt;f.insertTreeFragmentIntoRange=hu;f.isNodeContainedInRange=at;f.moveRangeBoundariesDownTree=d;f.moveRangeBoundariesUpTree=vt;f.getStartBlockOfRange=g;f.getEndBlockOfRange=yt;f.contentWalker=et;f.rangeDoesStartAtBlockBoundary=hi;f.rangeDoesEndAtBlockBoundary=wr;f.expandRangeToBlockBoundaries=br;f.onPaste=wu;f.addLinks=vi;f.splitBlock=dr;f.startSelectionId="squire-selection-start";f.endSelectionId=ui;n.exports=f}(document)},function(n){"use strict";function t(n){return typeof n=="boolean"||n instanceof Boolean}n.exports=t},function(n,t,i){"use strict";(function(n){function w(n,t){function e(){i&&(i=!1,n());r&&f()}function o(){y(e)}function f(){var n=Date.now();if(i){if(n-u<p)return;r=!0}else i=!0,r=!1,setTimeout(o,t);u=n}var i=!1,r=!1,u=0;return f}function u(n){return parseFloat(n)||0}function c(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(t,i){var r=n["border-"+i+"-width"];return t+u(r)},0)}function nt(n){for(var i,e,r={},t=0,f=["top","right","bottom","left"];t<f.length;t++)i=f[t],e=n["padding-"+i],r[i]=u(e);return r}function tt(n){var t=n.getBBox();return f(0,0,t.width,t.height)}function it(n){var s=n.clientWidth,l=n.clientHeight,y,p;if(!s&&!l)return h;var t=i(n).getComputedStyle(n),r=nt(t),a=r.left+r.right,v=r.top+r.bottom,e=u(t.width),o=u(t.height);return t.boxSizing==="border-box"&&(Math.round(e+a)!==s&&(e-=c(t,"left","right")+a),Math.round(o+v)!==l&&(o-=c(t,"top","bottom")+v)),ut(n)||(y=Math.round(e+a)-s,p=Math.round(o+v)-l,Math.abs(y)!==1&&(e-=y),Math.abs(p)!==1&&(o-=p)),f(r.left,r.top,e,o)}function ut(n){return n===i(n).document.documentElement}function ft(n){return e?rt(n)?tt(n):it(n):h}function et(n){var t=n.x,i=n.y,r=n.width,u=n.height,e=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,f=Object.create(e.prototype);return s(f,{x:t,y:i,width:r,height:u,top:i,right:t+r,bottom:u+i,left:t}),f}function f(n,t,i,r){return{x:n,y:t,width:i,height:r}}var o=function(){function n(n,t){var i=-1;return n.some(function(n,r){return n[0]===t?(i=r,!0):!1}),i}return typeof Map!="undefined"?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},t.prototype.has=function(t){return!!~n(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,t){var i,r,u;for(t===void 0&&(t=null),i=0,r=this.__entries__;i<r.length;i++)u=r[i],n.call(t,u[1],u[0])},t}()}(),e=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,r=function(){return typeof n!="undefined"&&n.Math===Math?n:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),y=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(r):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),p=2,b=20,k=["top","right","bottom","left","width","height","size","weight"],d=typeof MutationObserver!="undefined",g=function(){function n(){this.connected_=!1;this.mutationEventsAdded_=!1;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=w(this.refresh.bind(this),b)}return n.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n);this.connected_||this.connect_()},n.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1);!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},n.prototype.updateObservers_=function(){var n=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return n.forEach(function(n){return n.broadcastActive()}),n.length>0},n.prototype.connect_=function(){e&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),d?(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)},n.prototype.disconnect_=function(){e&&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)},n.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=k.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),s=function(n,t){for(var u,i=0,r=Object.keys(t);i<r.length;i++)u=r[i],Object.defineProperty(n,u,{value:t[u],enumerable:!1,writable:!1,configurable:!0});return n},i=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||r},h=f(0,0,0,0),rt=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof i(n).SVGGraphicsElement}:function(n){return n instanceof i(n).SVGElement&&typeof n.getBBox=="function"}}(),ot=function(){function n(n){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=f(0,0,0,0);this.target=n}return n.prototype.isActive=function(){var n=ft(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},n}(),st=function(){function n(n,t){var i=et(t);s(this,{target:n,contentRect:i})}return n}(),ht=function(){function n(n,t,i){if(this.activeObservations_=[],this.observations_=new o,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n;this.controller_=t;this.callbackCtx_=i}return n.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof i(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new ot(n)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof i(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var n=this;this.clearActive();this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new st(n.target,n.broadcastRect())});this.callback_.call(n,t,n);this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),l=typeof WeakMap!="undefined"?new WeakMap:new o,a=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=g.getInstance(),r=new ht(t,i,this);l.set(this,r)}return n}(),v;["observe","unobserve","disconnect"].forEach(function(n){a.prototype[n]=function(){var t;return(t=l.get(this))[n].apply(t,arguments)}});v=function(){return typeof r.ResizeObserver!="undefined"?r.ResizeObserver:a}();t.a=v}).call(this,i(59))},function(n,t,i){"use strict";function r(){this.events=null;this.contexts=null}var c=i(7),s=i(28),f=i(9),e=i(54),l=i(17),o=i(27),u=i(26),h=/\s+/g;r.mixin=function(n){c(n.prototype,r.prototype)};r.prototype._getHandlerItem=function(n,t){var i={handler:n};return t&&(i.context=t),i};r.prototype._safeEvent=function(n){var t=this.events,i;return t||(t=this.events={}),n&&(i=t[n],i||(i=[],t[n]=i),t=i),t};r.prototype._safeContext=function(){var n=this.contexts;return n||(n=this.contexts=[]),n};r.prototype._indexOfContext=function(n){for(var i=this._safeContext(),t=0;i[t];){if(n===i[t][0])return t;t+=1}return-1};r.prototype._memorizeContext=function(n){var t,i;s(n)&&(t=this._safeContext(),i=this._indexOfContext(n),i>-1?t[i][1]+=1:t.push([n,1]))};r.prototype._forgetContext=function(n){var i,t;s(n)&&(i=this._safeContext(),t=this._indexOfContext(n),t>-1&&(i[t][1]-=1,i[t][1]<=0&&i.splice(t,1)))};r.prototype._bindEvent=function(n,t,i){var r=this._safeEvent(n);this._memorizeContext(i);r.push(this._getHandlerItem(t,i))};r.prototype.on=function(n,t,i){var r=this;f(n)?(n=n.split(h),u(n,function(n){r._bindEvent(n,t,i)})):e(n)&&(i=t,u(n,function(n,t){r.on(t,n,i)}))};r.prototype.once=function(n,t,i){function f(){t.apply(i,arguments);r.off(n,f,i)}var r=this;if(e(n)){i=t;u(n,function(n,t){r.once(t,n,i)});return}this.on(n,f,i)};r.prototype._spliceMatches=function(n,t){var i=0,r;if(l(n))for(r=n.length;i<r;i+=1)t(n[i])===!0&&(n.splice(i,1),r-=1,i-=1)};r.prototype._matchHandler=function(n){var t=this;return function(i){var r=n===i.handler;return r&&t._forgetContext(i.context),r}};r.prototype._matchContext=function(n){var t=this;return function(i){var r=n===i.context;return r&&t._forgetContext(i.context),r}};r.prototype._matchHandlerAndContext=function(n,t){var i=this;return function(r){var f=n===r.handler,e=t===r.context,u=f&&e;return u&&i._forgetContext(r.context),u}};r.prototype._offByEventName=function(n,t){var i=this,r=o(t),f=i._matchHandler(t);n=n.split(h);u(n,function(n){var t=i._safeEvent(n);r?i._spliceMatches(t,f):(u(t,function(n){i._forgetContext(n.context)}),i.events[n]=[])})};r.prototype._offByHandler=function(n){var t=this,i=this._matchHandler(n);u(this._safeEvent(),function(n){t._spliceMatches(n,i)})};r.prototype._offByObject=function(n,t){var r=this,i;this._indexOfContext(n)<0?u(n,function(n,t){r.off(t,n)}):f(t)?(i=this._matchContext(n),r._spliceMatches(this._safeEvent(t),i)):o(t)?(i=this._matchHandlerAndContext(t,n),u(this._safeEvent(),function(n){r._spliceMatches(n,i)})):(i=this._matchContext(n),u(this._safeEvent(),function(n){r._spliceMatches(n,i)}))};r.prototype.off=function(n,t){f(n)?this._offByEventName(n,t):arguments.length?o(n)?this._offByHandler(n):e(n)&&this._offByObject(n,t):(this.events={},this.contexts=[])};r.prototype.fire=function(){this.invoke.apply(this,arguments)};r.prototype.invoke=function(n){var i,u,t,r;if(!this.hasListener(n))return!0;for(i=this._safeEvent(n),u=Array.prototype.slice.call(arguments,1),t=0;i[t];){if(r=i[t],r.handler.apply(r.context,u)===!1)return!1;t+=1}return!0};r.prototype.hasListener=function(n){return this.getListenerLength(n)>0};r.prototype.getListenerLength=function(n){var t=this._safeEvent(n);return t.length};n.exports=r},function(n){var t=function(){return this}();try{t=t||new Function("return this")()}catch(i){typeof window=="object"&&(t=window)}n.exports=t},,,,,,function(n,t,i){"use strict";function wl(n){var t=n.extendedAutolinks,i=n.customHTMLRenderer,r=n.referenceDefinition,u=n.customParser,f=n.frontMatter,e=new gr.Parser({disallowedHtmlBlockTags:["br"],extendedAutolinks:t,referenceDefinition:r,disallowDeepHeading:!0,customParser:u,frontMatter:f}),o=Object(gr.createRenderHTML)({gfm:!0,convertors:Object(pl.a)(null,i)});return function(n){return o(e.parse(n))}}function ie(n,t,i,r){var o,s,h,u,c=i,f=r.getLine(n),e;do{if(e=ci.exec(f),o=e[1],s=e[4],h=e[5],u=o.length,u===t)r.replaceRange(""+o+c+s+h,{line:n,ch:0},{line:n,ch:f.length}),c+=1,n+=1;else if(u>t)n=ie(n,u,1,r);else return n;f=r.getLine(n)}while(ci.test(f));return n}function gl(n,t){for(var i=n,r=t.getLine(n);ci.test(r);)i-=1,r=t.getLine(i);return n===i?i=-1:i+=1,i}function ia(n,t){var l=t.line,u=0,a=0,v=dt.exec(n.getLine(l)),e=v[1];do{u+=1;var o=l+u,s=n.getLine(o),i=dt.exec(s);if(i){var f=i[1],h=parseInt(v[3],10)+u-a,r=parseInt(i[3],10),c=r;if(e!==f||isNaN(r)){if(e.length>f.length)return;if(e.length<f.length&&u===1)return;a+=1}else h===r&&(c=r+1),h>r&&(c=h+1),n.replaceRange(s.replace(dt,f+c+i[4]+i[5]),{line:o,ch:0},{line:o,ch:s.length})}}while(i)}function tu(n){return iu(n)&&n.anchor.ch===n.head.ch}function iu(n){return n.anchor.line===n.head.line}function re(n,t,i,r){var u=n.getLine(i.line),f=n.getLine(i.line+r),e={anchor:t,head:i};n.replaceRange(f,{line:i.line,ch:0},{line:i.line,ch:u.length},"+input");n.replaceRange(u,{line:i.line+r,ch:0},{line:i.line+r,ch:f.length},"+input");tu(e)?n.setCursor({line:i.line+r,ch:i.ch}):n.setSelection({line:t.line+r,ch:t.ch},{line:i.line+r,ch:i.ch})}function ue(n,t,i,r){var f=n.getRange({line:t.line,ch:0},{line:i.line,ch:n.getLine(i.line).length}),e=r>0?i:t,o=n.getLine(e.line+r),u;u=r>0?t:i;n.replaceRange(o,{line:u.line,ch:0},{line:u.line,ch:n.getLine(u.line).length},"+input");n.replaceRange(f,{line:t.line+r,ch:0},{line:i.line+r,ch:n.getLine(i.line+r).length},"+input");n.setSelection({line:t.line+r,ch:t.ch},{line:i.line+r,ch:i.ch})}function ru(n){n.state.placeholder&&(n.state.placeholder.parentNode.removeChild(n.state.placeholder),n.state.placeholder=null)}function fe(n){var t,i;ru(n);t=n.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible";t.className="CodeMirror-placeholder";i=n.getOption("placeholder");typeof i=="string"&&(i=document.createTextNode(i));t.appendChild(i);n.display.lineSpace.insertBefore(t,n.display.lineSpace.firstChild)}function uu(n){ee(n)&&fe(n)}function gt(n){var t=n.getWrapperElement(),i=ee(n);t.className=t.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":"");i?fe(n):ru(n)}function ee(n){return n.lineCount()===1&&n.getLine(0)===""}function li(){return li=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},li.apply(this,arguments)}function eu(){return eu=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},eu.apply(this,arguments)}function nt(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return i.map(function(n){return""+nv+n}).join(" ")}function tv(n){return ut()(n,function(t,i){n[i]=nt(t)}),n}function c(n,t,i){return{start:n,end:t,className:i}}function iv(n,t,i){var f=n.level,e=n.headingType,r=[c(t,i,nt("heading","heading"+f))];return e==="atx"?r.push(c(t,Object(u.a)(t,f),a.DELIM)):r.push(c(Object(u.m)(i,0),i,a.DELIM+" setext")),{marks:r}}function ou(n,t,i){var r=n.type;return{marks:[c(t,i,nt(""+r)),c(t,Object(u.a)(t,ae[r]),a.DELIM),c(Object(u.a)(i,-ae[r]),i,a.DELIM)]}}function ve(n,t,i,r){return[c(n,t,nt("link")),c(i,Object(u.m)(t,r),nt("link-desc")),c(Object(u.m)(n,i.ch+1),Object(u.m)(t,r-1),a.TEXT),c(Object(u.m)(t,r),t,nt("link-url")),c(Object(u.m)(t,r+1),Object(u.a)(t,-1),a.TEXT)]}function rv(n,t,i){var r=n.lastChild,e=r?Object(u.c)(r)+1:3,f=Object(u.a)(t,1);return{marks:[c(t,f,a.META)].concat(ve(t,i,f,e))}}function uv(n,t,i){var r=n.lastChild,f=n.extendedAutolink,e=r?Object(u.c)(r)+1:2,o=f?[c(t,i,nt("link","link-desc")+" "+a.TEXT)]:ve(t,i,t,e);return{marks:o}}function fv(n,t,i){var r=n.tickCount,f=Object(u.a)(t,r),e=Object(u.a)(i,-r);return{marks:[c(t,i,nt("code")),c(t,f,a.DELIM+" start"),c(f,e,a.TEXT),c(e,i,a.DELIM+" end")]}}function ev(n,t,i,r){var w=n.fenceOffset,o=n.fenceLength,s=n.fenceChar,h=n.info,b=n.infoPadding,l=n.parent,e=w+o,f=[c(Object(u.m)(t,0),i,a.CODE_BLOCK)],v,y,p;return s&&f.push(c(t,Object(u.a)(t,e),a.DELIM)),h&&f.push(c(Object(u.m)(t,e),Object(u.m)(t,e+b+h.length),a.META)),v="^(\\s{0,3})("+s+"{"+o+",})",y=new RegExp(v),y.test(r)&&f.push(c(Object(u.m)(i,0),i,a.DELIM)),p=l.type!=="item"&&l.type!=="blockQuote"?{start:t.line,end:i.line,className:a.CODE_BLOCK}:null,{marks:f,lineBackground:eu({},p)}}function ye(n,t){for(var r=[],f,i;n;)f=n,i=f.type,(i==="paragraph"||i==="codeBlock")&&r.push(c({line:Object(u.f)(n)-1,ch:Object(u.e)(n)-1},{line:Object(u.d)(n)-1,ch:Object(u.c)(n)},t)),n=n.next;return r}function ov(n){for(var t=[];n;)t.push(c({line:Object(u.f)(n)-1,ch:Object(u.e)(n)-1},{line:Object(u.d)(n)-1,ch:Object(u.c)(n)},a.TEXT)),n=n.next;return t}function sv(n,t,i){var u=n.parent&&n.parent.type!=="blockQuote"?[c(t,i,nt("block-quote"))]:[],r;return n.firstChild&&(r=[],n.firstChild.type==="paragraph"?r=ov(n.firstChild.firstChild,a.TEXT):n.firstChild.type==="list"&&(r=ye(n.firstChild,a.TEXT)),u=[].concat(u,r)),{marks:u}}function hv(n){for(var t=0,i,r;n.parent.parent&&n.parent.parent.type==="item";)n=n.parent.parent,t+=1;return i=["list-item-odd","list-item-even"][t%2],r=["fisrt","second","third"][t%3],nt("list-item",""+i)+" "+r}function cv(n,t){var r=hv(n),f=n.listData,i=f.padding,e=f.task;return{marks:[c(t,Object(u.a)(t,i),r+" "+nt("list-item-bullet"))].concat(e?[c(Object(u.a)(t,i),Object(u.a)(t,i+3),r+" "+a.DELIM),c(Object(u.a)(t,i+1),Object(u.a)(t,i+2),a.META)]:[],ye(n.firstChild,r+" "+a.TEXT))}}function lv(n,t,i,r){var u=n.type;return le()(su[u])?su[u](n,t,i,r):hu[u]?{marks:[c(t,i,hu[u])]}:null}function pe(n,t){var i,r;if(typeof Symbol=="undefined"||n[Symbol.iterator]==null){if(Array.isArray(n)||(i=av(n))||t&&n&&typeof n.length=="number")return i&&(n=i),r=0,function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}return i=n[Symbol.iterator](),i.next.bind(i)}function av(n,t){if(n){if(typeof n=="string")return we(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);return(i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set")?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?we(n,t):void 0}}function we(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}function vv(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function yv(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ai(){return ai=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},ai.apply(this,arguments)}function pv(n){var t=n.type,i=n.listData;return t==="list"||t==="item"?i.task?"taskList":i.type==="ordered"?"orderedList":"list":t.indexOf("table")!==-1?"table":t}function wv(n,t,i,r){var f=ai({},cu),e=!1;return Object(u.n)(n,function(n){var t=pv(n);kl()(f[t])&&(t==="list"||t==="orderedList"?e||(f[t]=!0,e=!0):f[t]=!0)}),Object(u.k)(n)&&(r===t&&Object(u.d)(n)===i||r===Object(u.c)(n)+1&&i===Object(u.d)(n)||r===Object(u.e)(n)&&i===Object(u.f)(n))&&(f[n.type]=!1),f}function bv(n,t){return!n&&!t?!1:!n&&t||n&&!t?!0:Object.keys(t).some(function(i){return n[i]!==t[i]})}function no(n){return de.test(n)}function yy(n){for(var i=[],u=document.createTreeWalker(n,1,null,!1),t;u.nextNode();)if(t=u.currentNode,r.a.isElemNode(t)){var f=t.outerHTML,e=t.textContent,o=de.test(f),s=ge.test(f);o&&!s&&e?i.push([t,!0]):(ay.test(t.nodeName)||o&&!e||s)&&i.push([t,!1])}return i.forEach(function(n){var t=n[0],i=n[1];i?r.a.unwrap(t):r.a.remove(t)}),n.innerHTML.trim()}function py(n,t){var i=n.getAttribute("style"),r=i.match(ge),u=r[1],f=u.trim().split(" "),e=f[1],o=parseInt(e.replace("level",""),10),s=vy.test(n.textContent);return{id:t,level:o,prev:null,parent:null,children:[],unorderedListItem:s,contents:yy(n)}}function wy(n,t){if(t.level<n.level)t.children.push(n),n.parent=t;else{while(t){if(t.level===n.level)break;t=t.parent}t&&(n.prev=t,n.parent=t.parent,n.parent&&n.parent.children.push(n))}}function by(n){var t=[];return n.forEach(function(n,i){var r=t[i-1],u=py(n,i);r&&wy(u,r);t.push(u)}),t}function to(n){var i=n[0].unorderedListItem?"ul":"ol",t=document.createElement(i);return n.forEach(function(n){var i=n.children,u=n.contents,r=document.createElement("li");r.innerHTML=u;t.appendChild(r);i.length&&t.appendChild(to(i))}),t}function ky(n){var t=by(n),i=t.filter(function(n){var t=n.parent;return!t});return to(i)}function dy(n){while(n){if(r.a.isElemNode(n))break;n=n.nextSibling}return n?!ly.test(n.className):!0}function io(n){var t=[];return r.a.findAll(n,cy).forEach(function(i){var e=dy(i.nextSibling),u,f;t.push(i);e&&(u=ky(t),f=i.nextSibling,f?r.a.insertBefore(u,f):r.a.append(n,u),t=[]);r.a.remove(i)}),n}function ii(n,t){for(var u="<"+t+"><br /><\/"+t+">",i="",r=0;r<n;r+=1)i=i+u;return i}function co(n){return n?n.replace(/[<>&]/g,function(n){return hw[n]||n}):""}function yw(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function fb(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ek(n){for(var i=atob(n.split(",")[1]),r=new ArrayBuffer(i.length),u=new Uint8Array(r),t=0;t<i.length;t+=1)u[t]=i.charCodeAt(t);var f=n.split(","),e=f[0];return new Blob([r],{type:e.split(":")[1].split(";")[0]})}function di(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function bk(){return bu+=1}function kk(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function go(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function du(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function td(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ns(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function id(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ts(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function is(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function fd(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function rs(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function ed(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function od(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ld(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ad(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function uf(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function vd(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ff(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function bd(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function ef(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dd(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function rr(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function gd(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function rg(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function og(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function hg(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function yg(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function pg(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function fh(n){return n.map(function(n){return'<button type="button" class="'+ei+n+'" data-lang="'+n+'">'+n+"<\/button>"}).join("")}function fn(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function hn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function cn(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function pn(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n;n.__proto__=t}function rt(n,t,i){return t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function rtt(n){var t=r.a.isElemNode,i=r.a.isTextNode,u=i(n.previousSibling)&&t(n.firstChild),f=i(n.nextSibling)&&t(n.lastChild);return!u&&!f}function yf(n,t,i){var r=t.match(/^(\s*)((?:.|\n)*\S)(\s*)$/m),o=r[1],e=r[2],s=r[3],u,f;return rtt(n)?u=""+i+e+i:(f=n.nodeName.toLowerCase(),u="<"+f+">"+e+"<\/"+f+">"),""+o+u+s}function oit(n,t){var i=n.match(fit),r="",u;do r+="#",t-=1;while(t>0);return i&&(u=n.split(i[0]),n=u[1]),r+" "+n}function sit(n){return n.replace(/^(#{1,6}| *((?:\*|-|\d\.)(?: \[[ xX]])?)) /,"")}function pit(n){for(var r=[],t=dh.exec(n),u,i;t;)u=t,i=u.index,r.push([i,i+t[0].length]),t=dh.exec(n);return n.replace(yit,function(n,t){var i=r.some(function(n){return t>n[0]&&t<n[1]});return i?n:"\\"+n})}function lrt(n,t){for(var i="|",r="|",u=0;n;)t?(i+=" "+t[u]+" |",u+=1):i+="  |",r+=" --- |",n-=1;return i+"\n"+r+"\n"}function art(n,t,i){for(var u,r="",f=n,e=0;e<t;e+=1){for(r+="|",u=0;u<n;u+=1)i?(r+=" "+i[f]+" |",f+=1):r+="  |";r+="\n"}return r.replace(/\n$/g,"")}function cut(n){for(var r=n.parent.parent.columns.length,t="|",i=0;i<r;i+=1)t+="  |";return t}function gh(n){n.hasFormat("b")||n.hasFormat("strong")?n.changeFormat(null,{tag:"b"}):n.hasFormat("PRE")||(n.hasFormat("code")&&n.changeFormat(null,{tag:"code"}),n.bold())}function ic(n){n.hasFormat("i")||n.hasFormat("em")?n.changeFormat(null,{tag:"i"}):n.hasFormat("PRE")||(n.hasFormat("code")&&n.changeFormat(null,{tag:"code"}),n.italic())}function fc(n){n.hasFormat("S")?n.changeFormat(null,{tag:"S"}):n.hasFormat("PRE")||(n.hasFormat("code")&&n.changeFormat(null,{tag:"code"}),n.strikethrough())}function ec(n,t){s()(t).forEach(function(t){n.appendChild(t.cloneNode(!0))})}function pft(n,t){var i=n.getSelection();i.selectNodeContents(t.querySelector("th"));i.collapse(!0);n.setSelection(i)}function wft(n,t){for(var i="<thead><tr>",r=0;n;)i+="<th>",t&&(i+=t[r],r+=1),i+="<\/th>",n-=1;return i+"<\/tr><\/thead>"}function bft(n,t,i){for(var u,r="<tbody>",f=n,e=0;e<t;e+=1){for(r+="<tr>",u=0;u<n;u+=1)r+="<td>",i&&(r+=i[f],f+=1),r+="<\/td>";r+="<\/tr>"}return r+"<\/tbody>"}function kft(n){var i=n.componentManager.getManager("tableSelection"),t=i.getSelectedCells(),r=1;if(t.length>1){var f=t[0],e=t[t.length-1],u=i.getSelectionRangeFromTable(f,e);r=u.to.row-u.from.row+1}return r}function hc(n){var t=n.cloneNode(!0),i=v.a.msie?"":"<br />";return r.a.findAll(t,"td").forEach(function(n){n.innerHTML=i}),t}function cc(n,t){var i=n.getSelection();i.selectNodeContents(t.querySelector("td"));i.collapse(!0);n.setSelection(i)}function dft(n){var u=n.componentManager.getManager("tableSelection"),t=u.getSelectedCells(),i=1,r;return t.length>0&&(r=t[0].parentNode.querySelectorAll("td, th").length,i=Math.min(r,t.length)),i}function gft(n){var t=n.startContainer;return r.a.getNodeName(t)!=="TD"&&r.a.getNodeName(t)!=="TH"&&(t=r.a.closest(t,"td, th")),t}function net(n,t){var f,u,e,i;t===void 0&&(t=1);f=r.a.parents(n,"table");u=f[0];u&&(e=ct()(n,s()(n.parentNode.childNodes)),r.a.findAll(u,"tr").forEach(function(n){for(var f=r.a.getNodeName(n.parentNode)==="TBODY",o=v.a.msie,s=n.children[e],u=0;u<t;u+=1)i=f?document.createElement("td"):document.createElement("th"),o||i.appendChild(document.createElement("br")),r.a.insertAfter(i,s)}))}function tet(n,t){var i=n.getSelection();i.selectNodeContents(t.nextSibling);i.collapse(!0);n.setSelection(i)}function iet(n,t,i,r){var u=i.querySelector("td");t.setStart(u,0);t.collapse(!0);r.setLastCellNode(u);n.setSelection(t)}function pc(n,t,i){var s=i.querySelectorAll("tbody tr").length,e=r.a.parents(n,"thead").length,u=t.from.row,f=t.to.row,o;return e&&(u+=1),o=(u===1||e)&&f===s,o&&(f-=1),r.a.findAll(i,"tr").slice(u,f+1)}function ret(n,t,i){var u=t.getSelectedCells(),f,o,e;return u.length?(f=t.getSelectionRangeFromTable(u[0],u[u.length-1]),o=pc(u[0],f,i)):(e=r.a.closest(n.startContainer,"td,th"),f=t.getSelectionRangeFromTable(e,e),o=pc(e,f,i)),o}function uet(n){var t=n.startContainer;return r.a.getNodeName(t)!=="TD"&&!1&&(t=r.a.parentsUntil(t,"tr")),t}function fet(n){for(var i,r=n.length,t=0;t<r;t+=1)i=n[t],i&&kc(n[t])}function kc(n){var u=r.a.parents(n,"table"),t=u[0],i;t&&(i=ct()(n,s()(n.parentNode.childNodes)),r.a.findAll(t,"tr").forEach(function(n){var t=n.children[i];r.a.remove(t)}))}function eet(n,t,i){var f=t,u;t&&r.a.isContain(document.body,t)&&(u=n.getSelection(),u.selectNodeContents(t),u.collapse(!0),n.setSelection(u),i.setLastCellNode(f))}function oet(n,t,i){var o=i.isDivided||!1,f=i.startColumnIndex,e=i.endColumnIndex,u=r.a.findAll(n,"tr"),h=u.length?u[0].querySelectorAll("td,th").length:0;u.forEach(function(n){var i=s()(r.a.children(n,"td,th"));i.forEach(function(n,i){o&&(f<=i&&i<=h||i<=e)?n.setAttribute("align",t):f<=i&&i<=e&&n.setAttribute("align",t)})})}function set(n,t){var e=n.querySelectorAll("tr"),s=e.length?e[0].querySelectorAll("td,th").length:0,i=t.from,r=t.to,u,f,o;return i.row===r.row?(u=i.cell,f=r.cell):i.row<r.row&&(i.cell<=r.cell?(u=0,f=s-1):(u=i.cell,f=r.cell,o=!0)),{startColumnIndex:u,endColumnIndex:f,isDivided:o}}function het(n,t){var i=t.getSelectedCells(),f,e,u;return i.length?f=t.getSelectionRangeFromTable(i[0],i[i.length-1]):(u=n.startContainer,e=r.a.isTextNode(u)?r.a.parent(u,"td,th"):u,f=t.getSelectionRangeFromTable(e,e)),f}function bet(n){var t=r.a.getNodeName(n.nextSibling);return t!=="OL"&&t!=="UL"}function nl(n){var t=n.getEditor().getSelection();return r.a.closest(t.startContainer,"li")}function tot(n){r.a.getNodeName(n.startContainer.nextSibling)==="CODE"&&r.a.getTextLength(n.startContainer.nextSibling)===0&&r.a.remove(n.startContainer.nextSibling)}function iot(n,t){if(!t.hasFormat("PRE")&&t.hasFormat("code"))t.changeFormat(null,{tag:"code"}),tot(n.getSelection().cloneRange());else if(!t.hasFormat("a")&&!t.hasFormat("PRE")){t.hasFormat("b")?t.removeBold():t.hasFormat("i")&&t.removeItalic();t.changeFormat({tag:"code"});var i=t.getSelection().cloneRange();i.setStart(i.endContainer,i.endOffset);i.collapse(!0);t.setSelection(i)}}function eot(n,t){var i=t.getEditor().getSelection().cloneRange();h()(n,wf);i.setStartBefore(n.firstChild);i.collapse(!0);t.getEditor().setSelection(i)}function oot(n,t){var u=t.componentManager.getManager("codeblock"),i;if(n.collapsed)i="<br>";else{var f=n.extractContents(),e=s()(f.childNodes),r=document.createElement("div");r.appendChild(u.prepareToPasteOnCodeblock(e));i=r.innerHTML}return i}function il(n,t){var i=t.syncScrollTop,r=t.releaseEventBlock;clearTimeout(tl);i(n);tl=setTimeout(function(){r()},cot)}function rl(n,t,i){var u=t-n,f=Date.now(),r=function r(){var s=Date.now(),e=(s-f)/hot,o;pr&&clearTimeout(pr);e<1?(o=n+u*Math.cos((1-e)*Math.PI/2),il(Math.ceil(o),i),pr=setTimeout(r,1)):(il(t,i),pr=null)};r()}function df(n,t){var i=Object(bt.a)(t),r=i||n.offsetHeight;return i||Object(bt.d)(t,r),r}function aot(n,t,i,r,f){var h=Object(u.f)(i),c=n.lineInfo(t).handle.height,l=df(f,0),o=r.getBoundingClientRect().top-f.getBoundingClientRect().top,s=-l*lot,e;return Object(u.j)(i)&&(e=(t-h+1)*c,s=e,o+=e),{top:o,additionalScrollTop:s}}function ul(n,t,i){var nt=t._previewContent,o=t.el,f=n.cm,tt=n.toastMark,h=f.getScrollInfo(),it=h.left,e=h.top,rt=h.height,ut=h.clientHeight,v=rt-e<=ut,l=o.scrollTop,r=v?o.scrollHeight:0,k,g;if(e&&!v){var ft=i?f.coordsChar({left:it,top:e},"local"):f.getCursor("from"),y=ft.line,a=tt.findFirstNodeAtLine(y+1);if(!a||Object(u.g)(a))return;var p=Object(d.f)(a),c=p.node,s=p.mdNode,et=Object(u.f)(s),ot=df(o,0);if(r=Object(d.g)(c,nt)||c.offsetTop,i){if(Object(d.h)(s)){var ht=df(c,s.id),ct=f.heightAtLine(et-1,"local"),lt=Object(d.c)(s,f);if(r+=Object(d.b)(e,ct,lt,ht),k={latestScrollTop:kf,scrollTop:e,targetScrollTop:r,sourceScrollTop:l},r=Object(d.d)(k),kf=e,r===l)return}}else{var w=aot(f,y,s,c,o),b=w.top,st=w.additionalScrollTop;if(b>0&&b<ot)return;r+=st;kf=null}}bf=!0;g={syncScrollTop:function(n){return o.scrollTop=n},releaseEventBlock:function(){return bf=!1}};rl(l,r,g)}function vot(){return bf}function yot(n,t,i){var r=Object(bt.a)(t),u=Object(bt.b)(t),f=r||n.offsetHeight,e=u||Object(d.g)(n,i)||n.offsetTop;return r||Object(bt.d)(t,f),u||Object(bt.e)(t,e),{offsetHeight:f,offsetTop:e}}function pot(n,t){while(!n.getAttribute("data-nodeid")&&n.parentElement!==t)n=n.parentElement;return n}function wot(n,t,i){var g=n.toastMark,f=n.cm,h=t.el,e=h.scrollTop,nt=h.clientHeight,tt=h.scrollHeight,l=t._previewContent,a=tt-e<=nt,c=f.getScrollInfo(),it=c.left,o=c.top,rt=c.height,r=a?rt:0,b,k;if(e&&i&&!a){if(i=pot(i,l),!i.getAttribute("data-nodeid"))return;var ut=f.coordsChar({left:it,top:o},"local"),ft=ut.line,v=Number(i.getAttribute("data-nodeid")),y=Object(d.f)(g.findNodeById(v)),s=y.mdNode,et=y.node,p=Object(u.f)(s);if(r=f.heightAtLine(p-1,"local"),Object(u.i)(s)&&(r+=Object(d.e)(f,p,ft)),Object(d.h)(s)){var ot=Object(d.c)(s,f),w=yot(et,v,l),st=w.offsetHeight,ht=w.offsetTop;if(r+=Object(d.b)(e,ht,st,ot),b={latestScrollTop:gf,scrollTop:e,targetScrollTop:r,sourceScrollTop:o},r=Object(d.d)(b),gf=e,r===o)return}}wr=!0;k={syncScrollTop:function(n){return f.scrollTo(0,n)},releaseEventBlock:function(){return wr=!1}};rl(o,r,k)}function bot(){return wr}function el(){return br}function dot(n){if(!n.isViewer()&&n.getUI().name==="default"){var u=n.i18n,f={ACTIVE:u.get("Auto scroll enabled"),INACTIVE:u.get("Auto scroll disabled")},i=n.getUI().getToolbar(),e=document.createElement("button");e.className=fl;i.addItem("divider");i.addItem({type:"button",options:{command:"scrollSyncToggle",tooltip:f.ACTIVE,el:e}});var t=i.getItems(),o=t[t.length-2].el,r=t[t.length-1];ne(n,r,o);got(n,r,o);nst(n,r,f)}}function got(n,t,i){n.on("changeMode",function(){return ne(n,t,i)});n.on("changePreviewStyle",function(){return ne(n,t,i)})}function nst(n,t,i){n.addCommand("markdown",{name:"scrollSyncToggle",exec:function(){br=!br;t._onOut();br?(t.el.className=fl,t.setTooltip(i.ACTIVE)):(t.el.className=kot,t.setTooltip(i.INACTIVE));t._onOver()}})}function ne(n,t,i){n.mdPreviewStyle==="vertical"&&n.currentMode==="markdown"?(e()(t.el,{display:"inline-block"}),e()(i,{display:"inline-block"})):(e()(t.el,{display:"none"}),e()(i,{display:"none"}))}function tst(n){var t=n.mdEditor,i=n.preview;dot(n);rst(t,i);ist(t,i);t.cm.on("change",function(){return kr=!1})}function ist(n,t){n.eventManager.listen("previewRenderAfter",function(){setTimeout(function(){el()&&ul(n,t);kr=!0},200)})}function rst(n,t){var i=n.eventManager;i.listen("scroll",function(i){var r=i.source,u=i.data;el()&&kr&&t.isVisible()&&(r!=="markdown"||bot()?r!=="preview"||vot()||wot(n,t,u):ul(n,t,!0))})}function dr(){return dr=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},dr.apply(this,arguments)}var su,hu,be,cu,wu,bu,ko,pt,gi,nr,p,tr,us,nf,tf,rf,ur,ih,rh,uh,ei,bh,kh,nc,tc,rc,uc,oc,sc,lc,ac,vc,yc,wc,bc,dc,gc,wr,gf,kr,kt,st,ust;i.r(t);var sl=i(10),ut=i.n(sl),hl=i(28),hi=i.n(hl),cl=i(34),te=i.n(cl),ll=i(7),b=i.n(ll),al=i(4),e=i.n(al),vl=i(5),l=i.n(vl),yl=i(6),h=i.n(yl),gr=i(22),pl=i(29);var nu=i(12),bl=i(56),kl=i.n(bl),dl=i(15),w=i.n(dl),ci=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/;w.a.commands.indentLessOrderedList=function(n){return n.getOption("disableInput")?w.a.Pass:(n.execCommand("indentLess"),n.execCommand("fixOrderedListNumber"),null)};w.a.commands.fixOrderedListNumber=function(n){var r,t,u,i;if(n.getOption("disableInput")||!!n.state.isCursorInCodeBlock)return w.a.Pass;for(r=n.listSelections(),t=0;t<r.length;t+=1)if(u=r[t].head,i=gl(u.line,n),i>=0){var e=n.getLine(i),f=ci.exec(e),o=f[1],s=f[3];ie(i,o.length,parseInt(s,10),n)}return null};w.a.overlayMode=function(n,t,i){return{startState:function(){return{base:w.a.startState(n),overlay:w.a.startState(t),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:w.a.copyState(n,i.base),overlay:w.a.copyState(t,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(r,u){return(r!=u.streamSeen||Math.min(u.basePos,u.overlayPos)<r.start)&&(u.streamSeen=r,u.basePos=u.overlayPos=r.start),r.start==u.basePos&&(u.baseCur=n.token(r,u.base),u.basePos=r.pos),r.start==u.overlayPos&&(r.pos=r.start,u.overlayCur=t.token(r,u.overlay),u.overlayPos=r.pos),r.pos=Math.min(u.basePos,u.overlayPos),u.overlayCur==null?u.baseCur:u.baseCur!=null&&u.overlay.combineTokens||i&&u.overlay.combineTokens==null?u.baseCur+" "+u.overlayCur:u.overlayCur},indent:n.indent&&function(t,i){return n.indent(t.base,i)},electricChars:n.electricChars,innerMode:function(t){return{state:t.base,mode:n}},blankLine:function(i){n.blankLine&&n.blankLine(i.base);t.blankLine&&t.blankLine(i.overlay)}}};var dt=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]\s))(\s*)/,na=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,ta=/[*+-]\s/;w.a.commands.indentOrderedList=function(n){var i,t;if(n.getOption("disableInput"))return w.a.Pass;for(i=n.listSelections(),t=0;t<i.length;t++){var r=i[t].head,u=n.getLine(r.line),f=u.substr(0,r.ch);dt.test(f)||n.somethingSelected()?n.indentSelection("add"):n.execCommand("insertSoftTab")}n.execCommand("fixOrderedListNumber")};w.a.commands.newlineAndIndentContinueMarkdownList=function(n){var u,f,i;if(n.getOption("disableInput")||!!n.state.isCursorInCodeBlock){n.execCommand("newlineAndIndent");return}for(u=n.listSelections(),f=[],i=0;i<u.length;i++){var r=u[i].head,e=n.getLine(r.line),t=dt.exec(e),s=/^\s*$/.test(e.slice(0,r.ch));if(!u[i].empty()||!t||s){n.execCommand("newlineAndIndent");return}if(na.test(e))/>\s*$/.test(e)||n.replaceRange("",{line:r.line,ch:0},{line:r.line,ch:r.ch+1}),f[i]="\n";else{var h=t[1],c=t[5],o=!(ta.test(t[2])||t[2].indexOf(">")>=0),l=o?parseInt(t[3],10)+1+t[4]:t[2].replace("x"," ");f[i]="\n"+h+l+c;o&&ia(n,r)}}n.replaceSelections(f)};w.a.commands.replaceLineTextToUpper=function(n){var e,o,r,f,s,h;if(n.getOption("disableInput"))return w.a.Pass;for(e=n.listSelections(),o=-1,r=0;r<e.length;r++){var u=e[r],t=u.anchor,i=u.head;iu(u)&&i.line>0?re(n,t,i,o):tu(u)||(f=t.line<i.line?t.line:i.line,f>0&&(s=t.line===f?t:i,h=t.line===f?i:t,ue(n,s,h,o)))}};w.a.commands.replaceLineTextToLower=function(n){var f,e,r;if(n.getOption("disableInput"))return w.a.Pass;for(f=n.listSelections(),e=1,r=0;r<f.length;r++){var u=f[r],t=u.anchor,i=u.head,h=i.line===n.lastLine();if(iu(u)&&!h)re(n,t,i,e);else if(!tu(u)){var o=t.line<i.line?t.line:i.line,c=t.line===o?t:i,s=t.line===o?i:t;s.line<n.lastLine()&&ue(n,c,s,e)}}};w.a.defineOption("placeholder","",function(n,t,i){var u=i&&i!=w.a.Init,r;if(t&&!u){n.on("blur",uu);n.on("change",gt);n.on("swapDoc",gt);gt(n)}else!t&&u&&(n.off("blur",uu),n.off("change",gt),n.off("swapDoc",gt),ru(n),r=n.getWrapperElement(),r.className=r.className.replace(" CodeMirror-empty",""));t&&!n.hasFocus()&&uu(n)});var ra=function(){function t(n,t){t===void 0&&(t={});this.editorContainerEl=n;this.cm=null;this._init(t)}var n=t.prototype;return n._init=function(n){var t=document.createElement("textarea");this.editorContainerEl.appendChild(t);n=li({},n,{lineWrapping:!0,theme:"default",extraKeys:li({"Shift-Tab":"indentLess","Alt-Up":"replaceLineTextToUpper","Alt-Down":"replaceLineTextToLower"},n.extraKeys),indentUnit:4,cursorScrollMargin:12,specialCharPlaceholder:function(){return document.createElement("span")}});this.cm=w.a.fromTextArea(t,n)},n.getCurrentRange=function(){var n=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{from:n,to:t,collapsed:n.line===t.line&&n.ch===t.ch}},n.focus=function(){this.cm.focus()},n.blur=function(){this.cm.getInputField().blur()},n.remove=function(){this.cm.toTextArea()},n.setValue=function(n,t){t===void 0&&(t=!0);this.cm.setValue(n);t&&this.moveCursorToEnd();this.cm.doc.clearHistory();this.cm.refresh()},n.getValue=function(){return this.cm.getValue("\n")},n.getEditor=function(){return this.cm},n.reset=function(){this.setValue("")},n.getCaretPosition=function(){return this.cm.cursorCoords()},n.addWidget=function(n,t,i,r){r&&(n.ch+=r);this.cm.addWidget(n.end,t,!0,i)},n.replaceSelection=function(n,t){t&&this.cm.setSelection(t.from,t.to);this.cm.replaceSelection(n);this.focus()},n.replaceRelativeOffset=function(n,t,i){var r=this.cm.getCursor(),u={from:{line:r.line,ch:r.ch+t},to:{line:r.line,ch:r.ch+t+i}};this.replaceSelection(n,u)},n.setHeight=function(n){var t=this.getWrapperElement();e()(t,{height:n+"px"})},n.setMinHeight=function(n){var t=this.getWrapperElement();e()(t,{minHeight:n+"px"})},n.setPlaceholder=function(n){n&&this.cm.setOption("placeholder",n)},n.getWrapperElement=function(){return this.cm.getWrapperElement()},n.getCursor=function(n){return this.cm.getCursor(n)},n.moveCursorToEnd=function(){var n=this.getEditor().getDoc(),t=n.lastLine();n.setCursor(t,n.getLine(t).length)},n.moveCursorToStart=function(){var n=this.getEditor().getDoc(),t=n.firstLine();n.setCursor(t,0)},n.scrollTop=function(n){return n&&this.cm.scrollTo(0,n),this.cm.getScrollInfo().top},n.getRange=function(){var n=this.cm.getCursor("from"),t=this.cm.getCursor("to");return{start:{line:n.line,ch:n.ch},end:{line:t.line,ch:t.ch}}},n.on=function(n,t){this.cm.on(n,t)},n.off=function(n,t){this.cm.off(n,t)},t}(),oe=ra,se=["","","","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",""],fu,ua=function(){function n(n){this._setSplitter(n)}var t=n.prototype;return t._setSplitter=function(n){var t=n?n.splitter:"+";this._splitter=t},t.convert=function(n){var t=[],i;return n.shiftKey&&t.push("SHIFT"),n.ctrlKey&&t.push("CTRL"),n.metaKey&&t.push("META"),n.altKey&&t.push("ALT"),i=this._getKeyCodeChar(n.keyCode),i&&t.push(i),t.join(this._splitter)},t._getKeyCodeChar=function(n){return se[n]},n.getSharedInstance=function(){return fu||(fu=new n),fu},n.keyCode=function(n){return se.indexOf(n)},n}(),ht=ua,fa=/^[ \t]*([-*]|[\d]+\.)( \[[ xX]])? /,ea=/^[ \t]*([*-] |[\d]+\. )(\[[ xX]] )/,oa=/^[ \t]*[-*] .*/,sa=/^[ \t]*[\d]+\. \[[ xX]] .*/,ha=/([*-] |[\d]+\. )/,ca=/([-*] |[\d]+\. )(\[[ xX]] )/,la=/([-*]|[\d]+\.)( \[[ xX]])? /,he=/([-*])( \[[ xX]]) /,ni=/([\d])+\.( \[[ xX]])? /,aa=/^\|([-\s\w\d\t<>?!@#$%^&*()_=+\\/'";: \r[\]]*\|+)+/i,va=/^#+\s/,ya=/^ {0,3}(```|\||>)/,pa=function(){function t(n){this.cm=n.getEditor();this.doc=this.cm.getDoc();this.toastMark=n.getToastMark();this.name="list"}var n=t.prototype;return n._createSortedLineRange=function(n){var t=n.from.line>n.to.line,i={line:t?n.to.line:n.from.line,ch:0},r={line:t?n.from.line:n.to.line,ch:0};return{start:i.line,end:r.line}},n._calculateOrdinalNumber=function(n){for(var i,r=1,t=n-1;t>=0;t-=1)if(i=this._getListDepth(t),i===1&&ni.exec(this.doc.getLine(t))){r=parseInt(RegExp.$1,10)+1;break}else if(i===0)break;return r},n._isListLine=function(n){return!!fa.exec(this.doc.getLine(n))},n._isCanBeList=function(n){var t=this.doc.getLine(n);return!ya.test(t)&&!aa.test(t)&&!va.test(t)},n._getChangeFn=function(n){var i=this,t;switch(n){case"ol":case"ul":t=function(t){return i._changeToList(t,n)};break;case"task":t=function(n){return i._changeToTask(n)}}return t},n.changeSyntax=function(n,t){for(var r=[],u=this._createSortedLineRange(n),f=u.start,e=u.end,o=this._getChangeFn(t),i=f;i<=e;i+=1){if(!this._isCanBeList(i))break;this._isListLine(i)||r.push(i);o(i)}this._insertBlankLineForNewList(r);this.cm.focus()},n._replaceLineText=function(n,t){this.doc.replaceRange(n,{line:t,ch:0})},n._changeToList=function(n,t){var i=this;this._isListLine(n)?this._changeSameDepthList(n,t==="ol"?function(n,t){i._replaceListTypeToOL(n,t)}:function(n){i._replaceListTypeToUL(n)}):this._replaceLineText(t==="ol"?this._calculateOrdinalNumber(n)+". ":"* ",n)},n._changeToTask=function(n){ea.exec(this.doc.getLine(n))?this._replaceLineTextByRegexp(n,ca,"$1"):this._isListLine(n)?this._replaceLineTextByRegexp(n,ha,"$1[ ] "):this._replaceLineText("* [ ] ",n)},n._getListDepth=function(n){var i=0,r=this.doc.getLine(n),t;if(r)for(t=this.toastMark.findFirstNodeAtLine(n+1);t&&t.type!=="document";)t.type==="list"&&(i+=1),t=t.parent;return i},n._findSameDepthList=function(n,t,i){for(var e=this.doc.lineCount(),f=[],r=n,u;i?r<e-1:r>0;)if(r=i?r+1:r-1,u=this._getListDepth(r),u===t)f.push(r);else if(u<t)break;return f},n._changeSameDepthList=function(n,t){var i=this._getListDepth(n),r=this._findSameDepthList(n,i,!1).reverse(),u=this._findSameDepthList(n,i,!0),f=r.concat([n]).concat(u);f.forEach(function(n,i){t(n,i+1)})},n._replaceLineTextByRegexp=function(n,t,i){var r=this.doc.getLine(n),u={line:n,ch:0},f={line:n,ch:r.length};r=r.replace(t,i);this.doc.replaceRange(r,u,f)},n._replaceListTypeToUL=function(n){var t=this.doc.getLine(n);he.exec(t)?this._replaceLineTextByRegexp(n,he,"$1 "):ni.exec(t)&&this._replaceLineTextByRegexp(n,ni,"* ")},n._replaceListTypeToOL=function(n,t){var i=this.doc.getLine(n);oa.exec(i)||sa.exec(i)?this._replaceLineTextByRegexp(n,la,t+". "):ni.exec(i)&&parseInt(RegExp.$1,10)!==t&&this._replaceLineTextByRegexp(n,ni,t+". ")},n._insertBlankLineForNewList=function(n){var r=n.length,t,i;r&&(t=n[0],i=n[r-1],this._isNotBlankNotListLine(i+1)&&this.doc.replaceRange("\n",{line:i,ch:this.doc.getLine(i).length}),t>0&&this._isNotBlankNotListLine(t-1)&&this.doc.replaceRange("\n",{line:t,ch:0}))},n._isNotBlankNotListLine=function(n){return!!this.doc.getLine(n)&&!this._isListLine(n)},t}(),wa=pa,ba=function(){function t(n){this._managers={};this._editor=n}var n=t.prototype;return n.addManager=function(n,t){t||(t=n,n=null);var i=new t(this._editor);this._managers[n||i.name]=i},n.getManager=function(n){return this._managers[n]},n.removeManager=function(n){var t=this.getManager(n);t&&(t.destroy&&t.destroy(),delete this._managers[n])},t}(),ce=ba,ka=function(){function t(n,t){this._mde=n;this.setRange(t||n.getRange())}var n=t.prototype;return n._setStart=function(n){this._start=n},n._setEnd=function(n){this._end=n},n.setRange=function(n){this._setStart(n.start);this._setEnd(n.end)},n.setEndBeforeRange=function(n){this._setEnd(n.start)},n.expandStartOffset=function(){var n=this._start;n.ch!==0&&(n.ch-=1)},n.expandEndOffset=function(){var n=this._end;n.ch<this._mde.getEditor().getDoc().getLine(n.line).length&&(n.ch+=1)},n.getTextContent=function(){return this._mde.getEditor().getRange(this._start,this._end)},n.replaceContent=function(n){this._mde.getEditor().replaceRange(n,this._start,this._end,"+input")},n.deleteContent=function(){this._mde.getEditor().replaceRange("",this._start,this._end,"+delete")},n.peekStartBeforeOffset=function(n){var t={line:this._start.line,ch:Math.max(this._start.ch-n,0)};return this._mde.getEditor().getRange(t,this._start)},t}(),da=ka,u=i(2),ga=i(27),le=i.n(ga);var nv="tui-md-",a=tv({DELIM:"delimiter",META:"meta",TEXT:"marked-text",THEMATIC_BREAK:"thematic-break",CODE_BLOCK:"code-block",TABLE:"table",HTML:"html"}),ae={strong:2,emph:1,strike:2};su={heading:iv,strong:ou,emph:ou,strike:ou,link:uv,image:rv,code:fv,codeBlock:ev,blockQuote:sv,item:cv};hu={thematicBreak:a.THEMATIC_BREAK,table:a.TABLE,tableCell:a.TEXT,htmlInline:a.HTML};be=ht.getSharedInstance();cu={strong:!1,emph:!1,strike:!1,thematicBreak:!1,blockQuote:!1,code:!1,codeBlock:!1,list:!1,taskList:!1,orderedList:!1,heading:!1,table:!1};var ke="data-tui-mark",kv=/x|backspace/i,dv=function(n){function i(t,i,r,u){var f;return f=n.call(this,t,{dragDrop:!0,allowDropFileTypes:["image"],extraKeys:{Enter:function(){return f.eventManager.emit("command","AddLine")},Tab:function(){return f.eventManager.emit("command","MoveNextCursorOrIndent")},"Shift-Tab":function(){return f.eventManager.emit("command","MovePrevCursorOrOutdent")},"Shift-Ctrl-X":function(){return f.eventManager.emit("command","ToggleTaskMarker")}},viewportMargin:u&&u.height==="auto"?Infinity:10})||this,f.eventManager=i,f.componentManager=new ce(vv(f)),f.toastMark=r,f.componentManager.addManager(wa),f._latestState=null,f._markedLines={},f._initEvent(),f}yv(i,n);var t=i.prototype;return t._initEvent=function(){var n=this;this.cm.getWrapperElement().addEventListener("click",function(){n.eventManager.emit("click",{source:"markdown"})});this.cm.on("beforeChange",function(t,i){i.origin==="paste"&&n.eventManager.emit("pasteBefore",{source:"markdown",data:i})});this.cm.on("change",function(t,i){n._refreshCodeMirrorMarks(i);n._emitMarkdownEditorChangeEvent(i)});this.cm.on("focus",function(){n.eventManager.emit("focus",{source:"markdown"})});this.cm.on("blur",function(){n.eventManager.emit("blur",{source:"markdown"})});this.cm.on("scroll",function(t,i){n.eventManager.emit("scroll",{source:"markdown",data:i})});this.cm.on("keydown",function(t,i){n.eventManager.emit("keydown",{source:"markdown",data:i});n.eventManager.emit("keyMap",{source:"markdown",keyMap:be.convert(i),data:i})});this.cm.on("keyup",function(t,i){n.eventManager.emit("keyup",{source:"markdown",data:i});var r=i.key;kv.test(r)&&n.eventManager.emit("command","ChangeTaskMarker")});this.cm.on("copy",function(t,i){n.eventManager.emit("copy",{source:"markdown",data:i})});this.cm.on("cut",function(t,i){n.eventManager.emit("cut",{source:"markdown",data:i})});this.cm.on("paste",function(t,i){n.eventManager.emit("paste",{source:"markdown",data:i})});this.cm.on("drop",function(t,i){i.preventDefault();n.eventManager.emit("drop",{source:"markdown",data:i})});this.cm.on("cursorActivity",function(){return n._onChangeCursorActivity()})},t.setValue=function(t,i){n.prototype.setValue.call(this,t,i)},t.getTextObject=function(n){return new da(this,n)},t._emitMarkdownEditorContentChangedEvent=function(n){this.eventManager.emit("contentChangedFromMarkdown",n)},t._emitMarkdownEditorChangeEvent=function(n){if(n.origin!=="setValue"){var t={source:"markdown"};this.eventManager.emit("changeFromMarkdown",t);this.eventManager.emit("change",t)}},t._refreshCodeMirrorMarks=function(n){var u=this,i=n.from,r=n.to,f=n.text,t=this.toastMark.editMarkdown([i.line+1,i.ch+1],[r.line+1,r.ch+1],f.join("\n"));(this._emitMarkdownEditorContentChangedEvent(t),t.length)&&t.forEach(function(n){return u._markNodes(n)})},t._markNodes=function(n){var t=n.nodes,u=n.removedNodeRange,o,s,i,h,c;if(u&&this._removeBackgroundOfLines(u),t.length){var v=t[0].sourcepos,f=v[0],y=t[t.length-1].sourcepos,e=y[1],p={line:f[0]-1,ch:f[1]-1},w={line:e[0]-1,ch:e[1]},b=this.cm.findMarks(p,w);for(o=pe(b);!(s=o()).done;)i=s.value,i.attributes&&ke in i.attributes&&i.clear();for(h=pe(t);!(c=h()).done;)for(var k=c.value,l=k.walker(),r=l.next();r;){var a=r,d=a.node,g=a.entering;g&&this._markNode(d);r=l.next()}}},t._removeBackgroundOfLines=function(n){for(var i=n.line,r=i[0],u=i[1],t=r;t<=u;t+=1)this._markedLines[t]&&(this.cm.removeLineClass(t,"background"),this._markedLines[t]=!1)},t._markCodeBlockBackground=function(n){for(var i,r=n.start,u=n.end,f=n.className,t=r;t<=u;t+=1)i=f,t===r?i+=" start":t===u&&(i+=" end"),this.cm.addLineClass(t,"background",i),this._markedLines[t]=!0},t._markNode=function(n){var e=this,o={line:Object(u.f)(n)-1,ch:Object(u.e)(n)-1},i={line:Object(u.d)(n)-1,ch:Object(u.c)(n)},t=lv(n,o,i,this.cm.getLine(i.line));if(t){var r=t.marks,s=r===void 0?[]:r,f=t.lineBackground,h=f===void 0?{}:f;s.forEach(function(n){var t,i=n.start,r=n.end,u=n.className,f=(t={},t[ke]="",t);e.cm.markText(i,r,{className:u,attributes:f})});this._markCodeBlockBackground(h)}},t._setToolbarState=function(n){if(bv(this._latestState,n)){var t=ai({source:"markdown"},n?n:cu);this.eventManager.emit("stateChange",t)}this._latestState=n},t._onChangeCursorActivity=function(){var r=this.cm.getCursor(),i=r.line,t=r.ch,u=i+1,f=this.cm.getLine(i).length===t?t:t+1,n=this.toastMark.findNodeAtPosition([u,f]),e=null;this.cm.state.isCursorInCodeBlock=n&&n.type==="codeBlock";this.eventManager.emit("cursorActivity",{source:"markdown",cursor:{line:i,ch:t},markdownNode:n});n&&(n=n.type==="text"?n.parent:n,e=wv(n,t,u,f));this._setToolbarState(e)},t.resetState=function(){this._latestState=null},t.getToastMark=function(){return this.toastMark},i.factory=function(n,t,r,u){return new i(n,t,r,u)},i}(oe),gv=dv,ny=i(35),ty=i(3),s=i.n(ty),iy=i(21),vi=i.n(iy),ry=i(8),lu=i.n(ry),uy=i(17),fy=i.n(uy),ey=i(11),v=i.n(ey),oy=i(47),yi=i.n(oy),sy=i(19),at=i.n(sy),hy=i(20),vt=i.n(hy),r=i(0),cy="p.MsoListParagraph",ly=/MsoListParagraph/,de=/style=(.|\n)*mso-/,ge=/mso-list:(.*)/,ay=/O:P/,vy=/^(n|u|l)/;var gy=i(13),tt=i.n(gy),ti=i(25),np="rgb(34, 34, 34)",tp=function(){function t(n){this.wwe=n}var n=t.prototype;return n.preparePaste=function(n){var f=this.wwe.getEditor().getSelection().cloneRange(),e=this.wwe.componentManager.getManager("codeblock"),o=!1,i=document.createElement("div"),u,h,c,t;for(this._pasteFirstAid(n),t=s()(n.childNodes);t.length;)h=t[0],u=r.a.getNodeName(h),c=u==="LI"||u==="UL"||u==="OL",e.isInCodeBlock(f)?r.a.append(i,e.prepareToPasteOnCodeblock(t)):c?(r.a.append(i,this._prepareToPasteList(t,f,o)),o=!0):r.a.append(i,t.shift());n.innerHTML=i.innerHTML},n._wrapOrphanNodeWithDiv=function(n){var i=document.createElement("div"),t;return s()(n.childNodes).forEach(function(n){var u=n.nodeType===3,f=/^(SPAN|A|CODE|EM|I|STRONG|B|S|U|ABBR|ACRONYM|CITE|DFN|KBD|SAMP|VAR|BDO|Q|SUB|SUP)$/gi.test(n.tagName),r=n.nodeName==="BR";u||f||r?(t||(t=document.createElement("div"),i.appendChild(t)),t.appendChild(n),r&&(t=null)):(t&&t.lastChild.tagName!=="BR"&&t.appendChild(document.createElement("br")),t=null,i.appendChild(n))}),i.innerHTML},n._sanitizeHtml=function(n){var t=this.wwe.getSanitizer(),i=Object(ti.a)(n.innerHTML,!0);t&&t!==ti.a&&(i=t(i));n.innerHTML=i},n._pasteFirstAid=function(n){var i=this,t;this._sanitizeHtml(n);r.a.findAll(n,"*").forEach(function(n){i._removeStyles(n)});t="div, section, article, aside, nav, menus, p";this._unwrapIfNonBlockElementHasBr(n);this._unwrapNestedBlocks(n,t);this._removeUnnecessaryBlocks(n,t);n.innerHTML=this._wrapOrphanNodeWithDiv(n);this._preprocessPreElement(n);this._preprocessListElement(n);this._preprocessTableElement(n);s()(n.children).forEach(function(n){r.a.getNodeName(n)==="BR"&&r.a.remove(n)})},n._preprocessListElement=function(n){var t=this.wwe.componentManager.getManager("list");n.innerHTML=t.convertToArbitraryNestingList(n.innerHTML)},n._preprocessPreElement=function(n){var t=this.wwe.componentManager.getManager("codeblock");t.modifyCodeBlockForWysiwyg(n)},n._unwrapIfNonBlockElementHasBr=function(n){var t=r.a.findAll(n,"span, a, b, em, i, s");t.forEach(function(n){var t=r.a.children(n,"br");t.length&&n.nodeName!=="LI"&&n.nodeName!=="UL"&&r.a.unwrap(n)})},n._unwrapNestedBlocks=function(n,t){var i=r.a.findAll(n,"*").filter(function(n){return!tt()(n,"b,s,i,em,code,span,hr")&&!n.firstChild});i.forEach(function(i){for(var u=i.nodeName==="BR"?i.parentNode:i,f;r.a.parents(u,t).length;)f=r.a.parent(u,t),f&&f!==n?r.a.unwrap(f):u=u.parentElement})},n._removeUnnecessaryBlocks=function(n,t){r.a.findAll(n,t).forEach(function(n){var i=n.tagName,u=i==="DIV",f=!!r.a.parent(n,"li"),e=!!r.a.parent(n,"blockquote"),o=!!r.a.children(n,t).length;u&&(f||e||!o)||(n.lastChild&&n.lastChild.nodeName!=="BR"&&n.appendChild(document.createElement("br")),r.a.replaceWith(n,n.innerHTML))})},n._removeStyles=function(n){var t;r.a.getNodeName(n)!=="SPAN"?n.removeAttribute("style"):(n.getAttribute("style")&&(t=n.style.color),n.removeAttribute("style"),t&&t!==np?e()(n,{color:t}):r.a.unwrap(n))},n._prepareToPasteList=function(n,t,i){var u=r.a.getNodeName(n[0]),f=n.shift(),e=this.wwe.getEditor().getDocument().createDocumentFragment(),o;if(u!=="LI"&&n.length&&n[0].tagName==="LI"&&(u="LI",f=this._makeNodeAndAppend({tagName:u},f)),u==="OL"||u==="UL")!i&&this.wwe.getEditor().hasFormat("LI")?r.a.append(e,this._wrapCurrentFormat(f)):e.appendChild(f);else if(u==="LI"){for(o=this.wwe.getEditor().getDocument().createDocumentFragment(),o.appendChild(f);n.length&&n[0].tagName==="LI";)o.appendChild(n.shift());!i&&this.wwe.getEditor().hasFormat("LI")?r.a.append(e,this._wrapCurrentFormat(o)):t&&(t.commonAncestorName==="UL"||t.commonAncestorName==="OL")?r.a.append(e,this._makeNodeAndAppend({tagName:t.commonAncestorName},o)):r.a.append(e,this._makeNodeAndAppend({tagName:"UL"},o))}return this._getResolvePastedListDepthToCurrentDepth(t.startContainer,f,e)},n._unwrapFragmentFirstChildForPasteAsInline=function(n){return r.a.findAll(n,"br").forEach(function(n){return r.a.remove(n)}),n.childNodes},n._wrapCurrentFormat=function(n){var i=this,t;return this._eachCurrentPath(function(u){u.tagName!=="DIV"&&(t=r.a.isElemNode(n)?n.tagName:n.firstChild.tagName,u.tagName!==t&&(n=i._makeNodeAndAppend(u,n)))}),n},n._eachCurrentPath=function(n){for(var i=r.a.getPath(this.wwe.getEditor().getSelection().startContainer,this.wwe.getBody()),t=i.length-1;t>-1;t-=1)n(i[t])},n._makeNodeAndAppend=function(n,t){var i=document.createElement(""+n.tagName);return i.appendChild(t),n.id&&i.setAttribute("id",n.id),n.className&&l()(i,n.className),i},n._preprocessTableElement=function(n){this._removeColgroup(n);this._completeTableIfNeed(n);this._updateTableIDClassName(n)},n._removeColgroup=function(n){var t=n.querySelector("colgroup");t&&r.a.remove(t)},n._completeTableIfNeed=function(n){var t=this.wwe.componentManager.getManager("table"),f=t.wrapDanglingTableCellsIntoTrIfNeed(n),i,u;f&&r.a.append(n,f);i=t.wrapTrsIntoTbodyIfNeed(n);i&&r.a.append(n,i);u=t.wrapTheadAndTbodyIntoTableIfNeed(n);u&&r.a.append(n,u)},n._updateTableIDClassName=function(n){var i=this.wwe.componentManager.getManager("table"),t=r.a.findAll(n,"table");t.forEach(function(n){var t=n.className.match(/.*\s*(te-content-table-\d+)\s*.*/);t&&h()(n,t[0])});t.forEach(function(n){l()(n,i.getTableIDClassName())})},n._getResolvePastedListDepthToCurrentDepth=function(n,t,i){var u=this._getListDepth(n),f=this._getContinuousDepth(t),h,e,o;for(i=this._getRemovedUnnecessaryListWrapper(i,t);u<f;){if(i.firstChild.tagName!=="UL"&&i.firstChild.tagName!=="OL")break;h=s()(i.childNodes);i=i.firstChild;h.filter(function(n){return n!==i}).forEach(function(n){i.insertAdjacentElement("beforeend",n)});f-=1}while(u&&u>f)e=i.firstChild.parentElement,o=document.createElement(e.tagName),o.appendChild(e),i=o,f+=1;return u&&!n.textContent&&r.a.remove(n),i},n._getListDepth=function(n){for(var t=0,i=this.wwe.getBody();n&&n!==i;)(n.tagName==="UL"||n.tagName==="OL")&&(t+=1),n=n.parentNode;return t},n._getContinuousDepth=function(n){for(var t=0;n&&(n.tagName==="UL"||n.tagName==="OL");){if(t+=1,n.childNodes.length>1)break;n=n.firstChild}return t},n._getRemovedUnnecessaryListWrapper=function(n,t){while(n.querySelectorAll("ul,ol").length>t.querySelectorAll("ul,ol").length)n=n.firstChild;return n},t}(),ip=tp,rp=function(){function t(n){this.wwe=n}var n=t.prototype;return n.pasteClipboard=function(n){var t=n.clipboardData||window.clipboardData,i=t&&t.items;i?(this._pasteClipboardItem(i),n.preventDefault()):(this._pasteClipboardUsingPasteArea(),n.squirePrevented=!0)},n._pasteClipboardUsingPasteArea=function(){var u=this,i=this.wwe.getEditor(),n=i.getSelection(),f=n.startContainer,e=n.startOffset,o=n.endContainer,s=n.endOffset,t=document.createElement("div"),h=document,r=h.body;t.setAttribute("contenteditable",!0);t.setAttribute("style","position:fixed; overflow:hidden; top:0; right:100%; width:1px; height:1px;");r.appendChild(t);n.selectNodeContents(t);i.setSelection(n);setTimeout(function(){var h=r.removeChild(t);n.setStart(f,e);n.setEnd(o,s);i.focus();i.setSelection(n);u._pasteClipboardHtml(h.innerHTML)})},n._pasteClipboardItem=function(n){var u=this,t=null,i=null;s()(n).forEach(function(n){n.type==="text/html"?i=n:n.type==="text/plain"&&(t=n)});i?i.getAsString(function(n){u._pasteClipboardHtml(n)}):t&&t.getAsString(function(n){var t=r.a.getFragmentReplacedByNewlineToBr(n);u._pasteClipboardContainer(t)})},n._getSanitizedHtml=function(n){var t=this.wwe.getSanitizer(),i;return n=Object(ti.a)(n,!0),t&&t!==ti.a&&(n=t(n)),i=document.createElement("div"),i.innerHTML=n,r.a.finalizeHtml(i)},n._convertToMsoList=function(n){var t=document.createElement("div");return t.innerHTML=n,io(t),t.innerHTML},n._pasteClipboardHtml=function(n){var t=document.createDocumentFragment(),i="<!--StartFragment-->",r=n.indexOf(i),u=n.lastIndexOf("<!--EndFragment-->");r>-1&&u>-1&&(n=n.slice(r+i.length,u));/<\/td>((?!<\/tr>)[\s\S])*$/i.test(n)&&(n="<TR>"+n+"<\/TR>");/<\/tr>((?!<\/table>)[\s\S])*$/i.test(n)&&(n="<TABLE>"+n+"<\/TABLE>");no(n)&&(n=this._convertToMsoList(n));t.appendChild(this._getSanitizedHtml(n));this._pasteClipboardContainer(t)},n._pasteClipboardContainer=function(n){var i=this.wwe.getEditor(),f=n.childNodes,o=f.length===1&&f[0].nodeName==="TABLE",e,t,u;o?(e=this.wwe.componentManager.getManager("table"),e.pasteTableData(n)):(t=i.getSelection().cloneRange(),u=this._preparePasteDocumentFragment(n),i.saveUndoState(t),t.collapsed||this._deleteContentsRange(t),r.a.isTextNode(t.startContainer)?this._pasteIntoTextNode(t,u):this._pasteIntoElements(t,u),i.setSelection(t))},n._preparePasteDocumentFragment=function(n){var i=n.childNodes,t=document.createDocumentFragment();return i.length?t.appendChild(this._unwrapBlock(n)):this._isPossibleInsertToTable(n)&&t.appendChild(n),t},n._unwrapBlock=function(n){for(var t=document.createDocumentFragment(),r=s()(n.childNodes),i,u;r.length;)i=r.shift(),this._isPossibleInsertToTable(i)?t.appendChild(i):(t.appendChild(this._unwrapBlock(i)),u=t.lastChild,r.length&&u&&u.nodeName!=="BR"&&t.appendChild(document.createElement("br")));return t},n._isPossibleInsertToTable=function(n){var t=n.nodeName,i=t==="CODE"&&n.childNodes.length>1,u=t==="UL"||t==="OL";return!i&&(u||r.a.isMDSupportInlineNode(n)||r.a.isTextNode(n))},n._pasteIntoElements=function(n,t){var i=n.startContainer,o=n.startOffset,f=r.a.getChildNodeByOffset(i,o),e,u;f?(i.insertBefore(t,f),n.setStart(f,0)):i.nodeName==="TD"?(i.appendChild(t),n.setStart(i,i.childNodes.length)):(e=i.parentNode,u=i.nextSibling,e.insertBefore(t,u),u?n.setStart(u,0):n.setStartAfter(e.lastChild));n.collapse(!0)},n._pasteIntoTextNode=function(n,t){var i=n.startContainer,v=n.startOffset,u=i.parentNode,h=i.textContent,e=h.slice(0,v),o=h.slice(v,h.length),y=t.childNodes,p=y[0],b=y.length===1&&r.a.isTextNode(p),c,l,f,w,a;e?o?b?(l=p.textContent,i.textContent=""+e+l+o,n.setStart(i,e.length+l.length)):(f=document.createDocumentFragment(),f.appendChild(document.createTextNode(e)),f.appendChild(t),f.appendChild(document.createTextNode(o)),u.replaceChild(f,i),w=s()(u.childNodes),a=0,w.forEach(function(n,t){n.textContent===o&&(a=t)}),n.setStart(u.childNodes[a],0)):(c=i.nextSibling,u.insertBefore(t,c),n.setStartAfter(c)):(u.insertBefore(t,i),n.setStart(i,0));n.collapse(!0)},n._deleteContentsRange=function(n){var t=n.startContainer,i=n.startOffset,r=n.endContainer,u=n.endOffset;t===r?(this._deleteContentsByOffset(t,i,u),n.setStart(t,i),n.collapse(!0)):this._deleteNotCollapsedRangeContents(n)},n._deleteNotCollapsedRangeContents=function(n){var i=n.startContainer,e=n.startOffset,u=n.endContainer,o=n.endOffset,s=n.commonAncestorContainer,f=this._getBlock(i,s,e),t=this._getBlock(u,s,o-1),h;f===t?(this._removeInSameBlock(f,i,u,e,o),t=u!==t?null:t):(h=f.nextSibling,i.nodeName==="TD"?h=this._removeOneLine(f):(this._deleteContentsByOffset(i,e,r.a.getOffsetLength(i)),r.a.removeNodesByDirection(f,i,!1)),u.nodeName==="TD"?t=this._removeOneLine(t):(this._deleteContentsByOffset(u,0,o),r.a.removeNodesByDirection(t,u,!0)),r.a.removeChildFromStartToEndNode(s,h,t));t?n.setStart(t,0):n.setStartAfter(f);n.collapse(!0)},n._removeInSameBlock=function(n,t,i,u,f){var e=t===n?u:0,o=i===n?f:r.a.getOffsetLength(n);this._deleteContentsByOffset(n,e,o)},n._removeOneLine=function(n){var t=n.nextSibling,i=n.parentNode,r=t;return i.removeChild(n),t&&t.nodeName==="BR"&&(r=t.nextSibling,i.removeChild(t)),r},n._getBlock=function(n,t,i){return r.a.getParentUntil(n,t)||r.a.getChildNodeByOffset(n,i)},n._deleteContentsByOffset=function(n,t,i){var f,e;if(r.a.isTextNode(n)){var u=n.textContent,o=u.slice(0,t),s=u.slice(i,u.length);n.textContent=""+o+s}else f=r.a.getChildNodeByOffset(n,t),e=r.a.getChildNodeByOffset(n,i),f&&r.a.removeChildFromStartToEndNode(n,f,e||null)},t}(),up=rp,au="tui-paste-table-bookmark",ro="tui-paste-table-cell-bookmark",fp=function(){function t(n){this.wwe=n;this._pch=new ip(this.wwe);this._tablePasteHelper=new up(this.wwe);this._selectedSellCount=0;this._clipboardArea=null}var n=t.prototype;return n.init=function(){var n=this;this.wwe.eventManager.listen("willPaste",function(t){return n._executeHandler(n._onWillPaste.bind(n),t)});this.wwe.eventManager.listen("copy",function(t){return n._executeHandler(n._onCopyCut.bind(n),t)});this.wwe.eventManager.listen("copyAfter",function(t){return n._executeHandler(n._onCopyAfter.bind(n),t)});this.wwe.eventManager.listen("cut",function(t){return n._executeHandler(n._onCopyCut.bind(n),t)});this.wwe.eventManager.listen("cutAfter",function(t){return n._executeHandler(n._onCutAfter.bind(n),t)});this.wwe.eventManager.listen("paste",function(t){return n._executeHandler(n._onPasteIntoTable.bind(n),t)})},n._executeHandler=function(n,t){t.source==="wysiwyg"&&n(t)},n._onCopyCut=function(n){var i=this.wwe.componentManager.getManager("tableSelection"),u=i.getSelectedCells().length;if(u){if(!i.mergedTableSelectionManager){i.createRangeBySelectedCells();return}var f=this.wwe.getEditor(),e=n.data,r=f.getSelection().cloneRange(),t=document.createElement("div");this._extendRange(r);t.innerHTML=r.cloneContents();this._updateCopyDataForListTypeIfNeed(r,t);this.wwe.eventManager.emit("copyBefore",{source:"wysiwyg",clipboardContainer:t});this._setClipboardData(e,t.innerHTML,t.textContent)}},n._clearClipboardArea=function(){this._clipboardArea&&(r.a.remove(this._clipboardArea),this._clipboardArea=null)},n._onCopyAfter=function(){this.wwe.getEditor().getBody().focus();this._clearClipboardArea()},n._onCutAfter=function(){var n=this.wwe.getEditor().getSelection();n.deleteContents();this.wwe.getEditor().focus();this._clearClipboardArea()},n._onPasteIntoTable=function(n){var i=n.data,t=this.wwe.getEditor().getSelection();this.wwe.isInTable(t)&&this._isSingleCellSelected(t)&&this._tablePasteHelper.pasteClipboard(i)},n._isSingleCellSelected=function(n){var t=n.startContainer,i=n.endContainer;return this._getCell(t)===this._getCell(i)},n._getCell=function(n){return n.nodeName==="TD"?n:r.a.getParentUntil(n,"TR")},n._replaceNewLineToBr=function(n){var t=r.a.getAllTextNode(n);t.forEach(function(n){/\n/.test(n.nodeValue)&&(n.parentNode.innerHTML=n.nodeValue.replace(/\n/g,"<br>"))})},n._onWillPaste=function(n){var t=this,u=n.data,i=document.createElement("div"),f;i.appendChild(u.fragment.cloneNode(!0));this._preparePaste(i);this._setTableBookmark(i);u.fragment=document.createDocumentFragment();s()(i.childNodes).forEach(function(n){r.a.getNodeName(n)==="DIV"&&t._replaceNewLineToBr(n);u.fragment.appendChild(n)});f=function f(){t.wwe.getEditor().removeEventListener("input",f);t.wwe.eventManager.emit("wysiwygRangeChangeAfter",t);t._focusTableBookmark()};this.wwe.getEditor().addEventListener("input",f)},n._setClipboardData=function(n,t,i){v.a.msie?(n.squirePrevented=!0,this._clipboardArea=this._createClipboardArea(),this._clipboardArea.innerHTML=t,this._clipboardArea.focus(),window.getSelection().selectAllChildren(this._clipboardArea)):(n.preventDefault(),n.stopPropagation(),n.clipboardData.setData("text/html",t),n.clipboardData.setData("text/plain",i))},n._createClipboardArea=function(){var n=document.createElement("div");return n.setAttribute("contenteditable",!0),e()(n,{position:"fixed",overflow:"hidden",top:0,right:"100%",width:"1px",height:"1px"}),document.body.appendChild(n),n},n._updateCopyDataForListTypeIfNeed=function(n,t){var i=n.commonAncestorContainer.nodeName,r;(i==="UL"||i==="OL")&&(r=document.createElement(i),r.appendChild(t),t.innerHTML="",t.appendChild(r))},n._removeEmptyFontElement=function(n){var t=r.a.children(n,"font");t.forEach(function(n){n.textContent.trim()||r.a.remove(n)})},n._preProcessPtag=function(n){r.a.findAll(n,"p").forEach(function(n){n.lastChild&&n.lastChild.nodeName!=="BR"&&n.appendChild(document.createElement("br"));n.appendChild(document.createElement("br"))})},n._preparePaste=function(n){no(n.innerHTML)?io(n):this._preProcessPtag(n);this._removeEmptyFontElement(n);this._pch.preparePaste(n);this.wwe.eventManager.emit("pasteBefore",{source:"wysiwyg",clipboardContainer:n})},n._setTableBookmark=function(n){var t=n.lastChild,i=t&&t.nodeName==="TABLE";i&&l()(t,au)},n._focusTableBookmark=function(){var t=this.wwe.getEditor(),n=t.getSelection().cloneRange(),i=t.getBody().querySelector("."+au),r=t.getBody().querySelector("."+ro);i&&(h()(i,au),n.setEndAfter(i),n.collapse(!1),t.setSelection(n));r&&(h()(r,ro),n.selectNodeContents(r),n.collapse(!1),t.setSelection(n))},n._extendRange=function(n){r.a.isTextNode(n.commonAncestorContainer)&&(n.startOffset!==0||n.commonAncestorContainer.textContent.length!==n.endOffset)&&n.commonAncestorContainer.nodeName!=="TD"||(n.startOffset===0&&(n=this._extendStartRange(n)),n.endOffset===r.a.getOffsetLength(n.endContainer)&&(n=this._extendEndRange(n)),this._isWholeCommonAncestorContainerSelected(n)&&n.selectNode(n.commonAncestorContainer),this.wwe.getEditor().setSelection(n))},n._extendStartRange=function(n){for(var t=n.startContainer;t.parentNode!==n.commonAncestorContainer&&t.parentNode!==this.wwe.getBody()&&!t.previousSibling;)t=t.parentNode;return n.setStart(t.parentNode,r.a.getNodeOffsetOfParent(t)),n},n._extendEndRange=function(n){for(var t=n.endContainer,i=t.nextSibling;t.parentNode!==n.commonAncestorContainer&&t.parentNode!==this.wwe.getBody()&&(!i||r.a.getNodeName(i)==="BR"&&t.parentNode.lastChild===i);)t=t.parentNode,i=t.nextSibling;return n.setEnd(t.parentNode,r.a.getNodeOffsetOfParent(t)+1),n},n._isWholeCommonAncestorContainerSelected=function(n){return n.commonAncestorContainer.nodeType===Node.ELEMENT_NODE&&n.commonAncestorContainer!==this.wwe.getBody()&&n.startOffset===0&&n.endOffset===n.commonAncestorContainer.childNodes.length&&n.commonAncestorContainer===n.startContainer&&n.commonAncestorContainer===n.endContainer},t}(),ep=fp,op=i(16),it=i.n(op),uo="image-link",sp=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="link";this._init()}var n=t.prototype;return n._init=function(){var n=this;this.eventManager.listen("wysiwygSetValueAfter",function(){n._addClassNameToAllImageLinks()});this.wwe.getEditor().addEventListener("click",function(t){var i=t.target,u=t.offsetX,f=t.offsetY,e=getComputedStyle(i,":before");it()(i,uo)&&r.a.isInsideButtonBox(e,u,f)&&(n._selectImageLink(i.parentNode),n.eventManager.emit("openPopupAddLink",{url:i.getAttribute("href")}))})},n._selectImageLink=function(n){var t=this.wwe.getEditor().getSelection().cloneRange();t.selectNode(n);this.wwe.getEditor().setSelection(t)},n._addClassNameToImageLinks=function(n){n.forEach(function(n){n.firstChild&&n.firstChild.nodeName==="IMG"&&l()(n,uo)})},n._addClassNameToAllImageLinks=function(){var n=r.a.findAll(this.wwe.getBody(),"a");this._addClassNameToImageLinks(n)},n.addClassNameToImageLinksInSelection=function(){var i=this.wwe.getEditor(),u=i.getSelection(),n=u.commonAncestorContainer,t;r.a.isElemNode(n)&&(t=n.nodeName==="A"?[n]:r.a.findAll(n,"a"),this._addClassNameToImageLinks(t))},t}(),hp=/<li/i,pi="DIV,LI",yt="OL,UL",cp=/(<(?:th|td)[^>]*>)(.*?)(<\/(?:th|td)>)/g,lp=/<(ul|ol|li)([^>]*)>/g,ap=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="list";this._init()}var n=t.prototype;return n._init=function(){this._initEvent();this._initKeyHandler()},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return n.convertToArbitraryNestingList(t)});this.eventManager.listen("wysiwygRangeChangeAfter",function(){n._findAndRemoveEmptyList();n._removeBranchListAll()});this.eventManager.listen("wysiwygSetValueAfter",function(){n._removeBranchListAll()});this.eventManager.listen("wysiwygProcessHTMLText",function(t){return n._convertFromArbitraryNestingList(t)});this.eventManager.listen("convertorBeforeHtmlToMarkdownConverted",function(t){return n._insertDataToMarkPassForListInTable(t)})},n._initKeyHandler=function(){var n=this;this.wwe.addKeyEventHandler(["TAB","CTRL+]","META+]"],function(t){var i;return n.wwe.getEditor().hasFormat("LI")&&(t.preventDefault(),n.eventManager.emit("command","Indent"),i=!1),i});this.wwe.addKeyEventHandler(["SHIFT+TAB","CTRL+[","META+["],function(t,i){var f,u;return n.wwe.getEditor().hasFormat("LI")&&(t.preventDefault(),u=r.a.children(r.a.closest(i.startContainer,"li"),yt),n.eventManager.emit("command","Outdent"),u.length&&!u.previousSibling&&n._removeBranchList(u),f=!1),f});this.wwe.addKeyEventHandler("ENTER",function(t,i){i.collapsed&&n.wwe.getEditor().hasFormat("LI")&&n.wwe.defer(function(){var t=n.wwe.getRange(),i=r.a.parents(t.startContainer,"li"),u=i[0];n._removeBranchListAll(u)})});this.wwe.addKeyEventHandler("BACK_SPACE",function(t,i){i.collapsed&&n.wwe.getEditor().hasFormat("LI")&&n.wwe.defer(function(){n._removeBranchListAll()})})},n._findAndRemoveEmptyList=function(){r.a.findAll(this.wwe.getBody(),yt).forEach(function(n){hp.test(n.innerHTML)||r.a.remove(n)})},n._removeBranchListAll=function(n){var t=this;n=n?n:this.wwe.getBody();r.a.findAll(n,"li > ul, li > ol").forEach(function(n){n&&!n.previousSibling&&t._removeBranchList(n)})},n._removeBranchList=function(n){for(var t=n;!t.previousSibling&&t.parentElement.tagName.match(/UL|OL|LI/g);)t=t.parentElement;var i=r.a.children(t,"li"),u=i[0],f=r.a.unwrap(n);r.a.prepend(t,f);r.a.remove(u)},n.convertToArbitraryNestingList=function(n){for(var f="li > ul, li > ol",i=r.a.createElementWith("<div>"+n+"<\/div>"),t=i.querySelector(f),u,e;t!==null;)u=t.parentNode,e=u.parentNode,e.insertBefore(t,u.nextElementSibling),t=i.querySelector(f);return i.innerHTML},n._convertFromArbitraryNestingList=function(n){for(var f="ol > ol, ol > ul, ul > ol, ul > ul",u=r.a.createElementWith("<div>"+n+"<\/div>"),i=u.querySelector(f),t;i!==null;){for(t=i.previousElementSibling;t&&t.tagName!=="LI";)t=t.previousElementSibling;t?t.appendChild(i):this._unwrap(i);i=u.querySelector(f)}return u.innerHTML},n._unwrap=function(n){for(var t=document.createDocumentFragment();n.firstChild;)t.appendChild(n.firstChild);n.parentNode.replaceChild(t,n)},n._insertDataToMarkPassForListInTable=function(n){return n.replace(cp,function(n,t,i,r){var u=i.replace(lp,"<$1 data-tomark-pass $2>");return""+t+u+r})},n.getLinesOfSelection=function(n,t){var f=[],e=!1,o=!0,u,s,h,i;for(r.a.isTextNode(n)&&(s=r.a.parents(n,pi),n=s[0]),r.a.isTextNode(t)&&(h=r.a.parents(t,pi),t=h[0]),i=n;o;i=u){if(tt()(i,pi))f.push(i),i===t?e=!0:u=this._getNextLine(i,t);else break;o=u&&!e}return f},n._getNextLine=function(n,t){var i=n.nextElementSibling;return(i?tt()(i,yt)&&(i=i.querySelector("li")):i=n.parentNode.nextElementSibling,tt()(i,pi)||i===t)?i:this._getNextLine(i)},n.mergeList=function(n){var t=n.parentNode,i=t.previousElementSibling,r=t.nextElementSibling;t.firstElementChild===n&&i&&tt()(i,yt)&&(this._mergeList(t,i),t=i);t.lastElementChild===n&&r&&tt()(r,yt)&&this._mergeList(r,t)},n._mergeList=function(n,t){var i=n.firstElementChild,r;if(t&&tt()(t,yt)){while(i)r=i.nextElementSibling,t.appendChild(i),i=r;n.parentNode.removeChild(n)}},n.isAvailableMakeListInTable=function(){var t=this.wwe.componentManager.getManager("tableSelection"),i=t.getSelectedCells(),n=this.wwe.getEditor();return i&&n.hasFormat("table")&&!n.hasFormat("OL")&&!n.hasFormat("UL")},n._getParentNodeBeforeTD=function(n,t){var i=r.a.getParentUntil(n,"TD");if(!i){var u=n.childNodes,f=u?u.length:0,e=t>0&&t===f?t-1:t;i=r.a.getChildNodeByOffset(n,e)}return i},n._findLINodeInsideCell=function(n,t){var i=null,u,f;return n&&r.a.isCellNode(n)&&(n=n.firstChild),u=r.a.getParentUntilBy(n,function(n){return n&&r.a.isListNode(n)},function(n){return n&&r.a.isCellNode(n)}),u?i=u:n.nodeName==="LI"?i=n:r.a.isListNode(n)&&(f=n.childNodes.length,i=n.childNodes[t>=f?f-1:t]),i},n._getFirstNodeInLineOfTable=function(n,t){var i=this._findLINodeInsideCell(n,t),f,u;if(!i)for(i=this._getParentNodeBeforeTD(n,t),f=i,u=f.previousSibling;u&&u.nodeName!=="BR"&&!r.a.isListNode(u);)i=u,u=i.previousSibling;return i},n._getLastNodeInLineOfTable=function(n,t){var i=this._findLINodeInsideCell(n,t);if(!i)for(i=this._getParentNodeBeforeTD(n,t);i.nextSibling;){if(i.nodeName==="BR"||r.a.isListNode(i))break;i=i.nextSibling}return i},n._isLastNodeInLineOfTable=function(n){var t=n.nodeName;return t==="LI"||t==="BR"},n._getNextNodeInLineOfTable=function(n){var t=n.nextSibling,i;if(n.nodeName!=="LI"||t)r.a.isListNode(t)&&(t=t.firstChild);else for(i=n.parentNode;!r.a.isCellNode(i);){if(i.nextSibling){t=i.nextSibling;break}i=i.parentNode}return t},n._getLinesOfSelectionInTable=function(n){for(var u=n.startContainer,f=n.endContainer,e=n.startOffset,o=n.endOffset,t=this._getFirstNodeInLineOfTable(u,e),s=this._getLastNodeInLineOfTable(f,o),r=[],i=[];t;){if(i.push(t),this._isLastNodeInLineOfTable(t)&&(r.push(i),i=[]),t===s){i.length&&r.push(i);break}t=this._getNextNodeInLineOfTable(t)}return r},n._createListElement=function(n){return document.createElement(n==="TASK"?"UL":n)},n._createListItemElement=function(n,t){var i=document.createElement("li"),r;return n.forEach(function(n){i.appendChild(n)}),t==="TASK"&&(r=this.wwe.componentManager.getManager("task"),r.formatTask(i)),i},n._mergeListWithPreviousSibiling=function(n){var t=n.previousSibling,i=n;return t&&n.nodeName===t.nodeName&&(this._mergeList(n,t),i=t),i},n._mergeListWithNextSibiling=function(n){var t=n.nextSibling;return t&&n.nodeName===t.nodeName&&this._mergeList(t,n),n},n.createListInTable=function(n,t){var o=this,r=this._getLinesOfSelectionInTable(n),u=r[r.length-1],f=u[u.length-1],h=f.nextSibling,c=f.parentNode,i=this._createListElement(t),l=i,a=l.nodeName,e=[];return r.forEach(function(n){var f=n[0],u,r,h;f.nodeName==="LI"?(r=f.parentNode,u=f,r.nodeName!==a&&(h=r.childNodes,s()(h).forEach(function(){i.appendChild(r.firstChild)}),r.parentNode.replaceChild(i,r)),i=u.parentNode):(u=o._createListItemElement(n,t),i.appendChild(u));e.push(u)}),i.parentNode||c.insertBefore(i,h),i=this._mergeListWithPreviousSibiling(i),this._mergeListWithNextSibiling(i),e},n.adjustRange=function(n,t,i,u,f){var e=r.a.containsNode(f[0],n)?n:f[0],o=r.a.containsNode(f[f.length-1],t)?t:f[f.length-1],s=n.nodeName==="TD"?0:i,h=t.nodeName==="TD"?0:u;this.wwe.setSelectionByContainerAndOffset(e,s,o,h)},t}(),vp=ap,vu="task-list-item",yu="data-te-task",pu="checked",yp=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="task";this._init()}var n=t.prototype;return n._init=function(){this._initKeyHandler();this._initEvent();this.wwe.getEditor().addEventListener("mousedown",function(n){var t=getComputedStyle(n.target,":before");n.target.hasAttribute(yu)&&r.a.isInsideButtonBox(t,n.offsetX,n.offsetY)&&(n.preventDefault(),r.a.toggleClass(n.target,pu))})},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueAfter",function(){n._removeTaskListClass()})},n._initKeyHandler=function(){var n=this;this.wwe.addKeyEventHandler("ENTER",function(t,i){n.isInTaskList(i)&&n.wwe.defer(function(){var i=n.wwe.getRange(),t=r.a.closest(i.startContainer,"li");t&&h()(t,pu)})})},n.isInTaskList=function(n){var t,i;return n||(n=this.wwe.getEditor().getSelection().cloneRange()),n.startContainer.nodeType===Node.ELEMENT_NODE&&n.startContainer.tagName==="LI"?t=n.startContainer:(i=r.a.parents(n.startContainer,"li"),t=i[0]),!!t&&it()(t,vu)},n.unformatTask=function(n){var t=r.a.closest(n,"li");h()(t,vu);h()(t,pu);t.removeAttribute(yu);t.getAttribute("class")||t.removeAttribute("class")},n.formatTask=function(n){var t=r.a.closest(n,"li");l()(t,vu);t.setAttribute(yu,"")},n._formatTaskIfNeed=function(){var n=this.wwe.getEditor().getSelection().cloneRange();this.isInTaskList(n)&&this.formatTask(n.startContainer)},n._removeTaskListClass=function(){r.a.findAll(this.wwe.getBody(),".task-list").forEach(function(n){h()(n,"task-list")})},t}(),pp=yp,wi=v.a.msie&&v.a.version===10,wp="te-content-table-",bp=v.a.msie&&(v.a.version===10||v.a.version===11),kp=v.a.msie?"":"<br>",fo="te-cell-selected",dp=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="table";this._lastCellNode=null;this._init()}var n=t.prototype;return n._init=function(){this._initKeyHandler();this._initEvent();this.tableID=0},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygRangeChangeAfter.table",function(){var i=n.wwe.getEditor().getSelection(),r=n.wwe.isInTable(i),t;n._unwrapBlockInTable();n._completeTableIfNeed();r||(t=n.wwe.componentManager.getManager("tableSelection"),t.removeClassAttrbuteFromAllCellsIfNeed());n._insertDefaultBlockBetweenTable()});this.eventManager.listen("wysiwygSetValueAfter.table",function(){n._unwrapBlockInTable();n._insertDefaultBlockBetweenTable()});this.eventManager.listen("wysiwygProcessHTMLText.table",function(n){return n.replace(/<br \/>(<\/td>|<\/th>)/g,"$1")});this.eventManager.listen("cut.table",function(){var t=n.wwe.componentManager.getManager("tableSelection"),i=t.getSelectedCells();i.length&&i.forEach(function(n){n.innerHTML=kp});t.removeClassAttrbuteFromAllCellsIfNeed()});this.eventManager.listen("copyBefore.table",function(t){var i=t.clipboardContainer;return n.updateTableHtmlOfClipboardIfNeed(i)})},n.updateTableHtmlOfClipboardIfNeed=function(n){var i=this,u=this.wwe.componentManager.getManager("tableSelection"),f=u.getSelectedCells(),t;f.length&&(u.createRangeBySelectedCells(),t=this.wwe.getEditor().getSelection().cloneContents(),s()(t.children).forEach(function(n){if(i.isTableOrSubTableElement(n.nodeName))if(n.nodeName==="TABLE"&&n.querySelector("thead")&&n.querySelector("tbody"))r.a.remove(n);else if(n.previousSibling&&n.previousSibling.nodeName==="TABLE")n.previousSibling.appendChild(n);else if(i._completeIncompleteTable(n),n.nodeName!=="TABLE"&&n.nodeName!=="THEAD"){var t=r.a.closest(n,"table").querySelector("thead");r.a.remove(t)}}),n.appendChild(t),r.a.findAll(n,"."+fo).forEach(function(n){h()(n,fo)}))},n.pasteTableData=function(n){this._expandTableIfNeed(n);this._pasteDataIntoTable(n)},n._initKeyHandler=function(){var n=this;this.keyEventHandlers={DEFAULT:function(t,i,r){var u=n.wwe.isInTable(i);u&&!n._isModifierKey(r)?(n._recordUndoStateIfNeed(i),n._removeContentsAndChangeSelectionIfNeed(i,r,t)):!u&&n._lastCellNode&&n._recordUndoStateAndResetCellNode(i);u&&!n._isModifierKeyPushed(t)&&n.wwe.getEditor().modifyDocument(function(){var t=n.wwe.componentManager.getManager("tableSelection");t.removeClassAttrbuteFromAllCellsIfNeed()})},ENTER:function(t,i){var r;return n._isAfterTable(i)?(t.preventDefault(),i.setStart(i.startContainer,i.startOffset-1),n.wwe.breakToNewDefaultBlock(i),r=!1):n._isBeforeTable(i)?(t.preventDefault(),n.wwe.breakToNewDefaultBlock(i,"before"),r=!1):n.wwe.isInTable(i)&&(!n._isInList(i.startContainer)&&n._isInStyledText(i)?n.wwe.defer(function(){n._removeBRinStyleText()}):n._isEmptyFirstLevelLI(i)&&n.wwe.defer(function(){var t=n.wwe.getRange().cloneRange(),i=t.startContainer,r=document.createElement("br");i.parentNode.replaceChild(r,i);t.setStartBefore(r);t.collapse(!0);n.wwe.getEditor().setSelection(t)}),n._appendBrIfTdOrThNotHaveAsLastChild(i),r=!1),r},BACK_SPACE:function(t,i,r){return n._handleBackspaceAndDeleteKeyEvent(t,i,r)},DELETE:function(t,i,r){return n._handleBackspaceAndDeleteKeyEvent(t,i,r)},TAB:function(){return n._moveCursorTo("next","cell")},"SHIFT+TAB":function(t){return n._moveCursorTo("previous","cell",t)},UP:function(t){return n._moveCursorTo("previous","row",t)},DOWN:function(t){return n._moveCursorTo("next","row",t)}};ut()(this.keyEventHandlers,function(t,i){return n.wwe.addKeyEventHandler(i,t)})},n._isEmptyListItem=function(n){var t=n.childNodes,i=n.nodeName;return i==="LI"&&t.length===1&&t[0].nodeName==="BR"},n._isEmptyFirstLevelLI=function(n){var i=n.collapsed,t=n.startContainer,u=n.startOffset;return i&&u===0&&this._isEmptyListItem(t)&&r.a.isFirstLevelListItem(t)},n._isInStyledText=function(n){var t=n.startContainer,i;return i=r.a.isTextNode(t)?t.parentNode:t,n.collapsed&&r.a.isStyledNode(i)},n._removeBRinStyleText=function(){var t=this.wwe.getRange(),u=t.startContainer,h=t.startOffset,i,n,s;if(i=u.nodeName==="TD"?r.a.getChildNodeByOffset(u,h-1):r.a.getParentUntil(u,"TD"),n=i.querySelector("br"),n){var e=i,f=e.parentNode,o=e.nodeName;o!=="CODE"||n.previousSibling?o!=="CODE"||n.nextSibling?(s=this._splitByBR(i,n),t.setStart(s,0)):(f.insertBefore(n,i.nextSibling),t.setStart(f,r.a.getNodeOffsetOfParent(n)+1)):(f.insertBefore(n,i),t.setStart(i,0));t.collapse(!0);this.wwe.getEditor().setSelection(t)}},n._splitByBR=function(n,t){var i=n.cloneNode(!0),o=document.createElement("br"),e=n.parentNode,u,f;return r.a.removeNodesByDirection(n,t,!1),t.parentNode.removeChild(t),u=i.querySelector("br"),r.a.removeNodesByDirection(i,u,!0),u.parentNode.removeChild(u),e.insertBefore(i,n.nextSibling),e.insertBefore(o,i),f=r.a.getLeafNode(i),r.a.getTextLength(f)||(f.textContent="​"),f},n._isBeforeTable=function(n){return r.a.getNodeName(r.a.getChildNodeByOffset(n.startContainer,n.startOffset))==="TABLE"},n._isAfterTable=function(n){var t=r.a.getPrevOffsetNodeUntil(n.startContainer,n.startOffset);return r.a.getNodeName(t)==="TABLE"&&n.commonAncestorContainer===this.wwe.getBody()},n._handleBackspaceAndDeleteKeyEvent=function(n,t,i){var u=i==="BACK_SPACE",s=this.wwe.componentManager.getManager("tableSelection"),h=s.getSelectedCells(),f=!0,e,o;return t.collapsed?this.wwe.isInTable(t)?(u?this._tableHandlerOnBackspace(t,n):this._tableHandlerOnDelete(t,n),this._removeContentsAndChangeSelectionIfNeed(t,i,n),f=!1):(!u&&this._isBeforeTable(t)||u&&this._isAfterTable(t))&&(n.preventDefault(),e=u?t.startOffset-1:t.startOffset,this._removeTable(t,r.a.getChildNodeByOffset(t.startContainer,e)),f=!1):this.wwe.isInTable(t)&&h.length>0&&(o=this._removeContentsAndChangeSelectionIfNeed(t,i,n),o&&(n.preventDefault(),f=!1)),f},n._moveListItemToPreviousOfList=function(n,t){var i=n.parentNode,f=n.firstChild,u=document.createDocumentFragment();r.a.mergeNode(n,u);i.parentNode.insertBefore(u,i);t.setStart(f,0);t.collapse(!0);this.wwe.getEditor().setSelection(t);i.hasChildNodes()||i.parentNode.removeChild(i)},n._isInList=function(n){return r.a.getParentUntilBy(n,function(n){return n&&(r.a.isListNode(n)||n.nodeName==="LI")},function(n){return n&&(n.nodeName==="TD"||n.nodeName==="TH")})},n._findListItem=function(n){return r.a.getParentUntilBy(n,function(n){return n&&r.a.isListNode(n)},function(n){return n&&(n.nodeName==="TD"||n.nodeName==="TH")})},n._tableHandlerOnBackspace=function(n,t){var f=n.startContainer,e=n.startOffset,i=this._findListItem(f),u,o;i&&e===0&&r.a.isFirstListItem(i)&&r.a.isFirstLevelListItem(i)?(this.wwe.getEditor().saveUndoState(n),this._moveListItemToPreviousOfList(i,n),t.preventDefault()):(u=r.a.getPrevOffsetNodeUntil(f,e,"TR"),o=r.a.getNodeName(u),o==="BR"&&u.parentNode.childNodes.length!==1&&(t.preventDefault(),r.a.remove(u)))},n._isDeletingBR=function(n){var t=this._getCurrentNodeInCell(n),i=t&&t.nextSibling;return r.a.getNodeName(t)==="BR"&&!!i&&r.a.getNodeName(i)==="BR"},n._getCurrentNodeInCell=function(n){var t=n.startContainer,u=n.startOffset,i;return r.a.getNodeName(t)==="TD"?i=r.a.getChildNodeByOffset(t,u):r.a.getParentUntil(t,"TD")&&(i=t),i},n._isEndOfList=function(n,t){var i=t.startContainer,o=t.startOffset,f=!1,e;if(!n.nextSibling)if(n===i)e=r.a.getOffsetLength(n),n.lastChild.nodeName==="BR"&&(e-=1),f=e===o;else{var s=r.a.getParentUntil(i,"li")||i,h=r.a.getOffsetLength(i),u=n.lastChild;u.nodeName==="BR"&&(u=u.previousSibling);f=u===s&&h===o}return f},n._getNextLineNode=function(n){for(var i=document.createDocumentFragment(),e=r.a.getParentUntil(n,"TD"),t=e.nextSibling,u,f;t;){if(u=t,f=u.nextSibling,i.appendChild(t),t.nodeName==="BR")break;t=f}return i},n._tableHandlerOnDelete=function(n,t){var i=this._findListItem(n.startContainer),u;i&&this._isEndOfList(i,n)?(this.wwe.getEditor().saveUndoState(n),i.lastChild.nodeName==="BR"&&i.removeChild(i.lastChild),r.a.mergeNode(this._getNextLineNode(i),i),t.preventDefault()):this._isDeletingBR(n)&&(u=this._getCurrentNodeInCell(n),u.parentNode.removeChild(u.nextSibling),t.preventDefault())},n._appendBrIfTdOrThNotHaveAsLastChild=function(n){var f=r.a.getNodeName(n.startContainer),i,u,t;f==="TD"||f==="TH"?i=n.startContainer:(u=r.a.parentsUntil(n.startContainer,"tr"),i=u[u.length-1]);t=r.a.getNodeName(i.lastChild);t==="BR"||t==="DIV"||t==="UL"||t==="OL"||bp||r.a.append(i,"<br />")},n._unwrapBlockInTable=function(){var n=r.a.findAll(this.wwe.getBody(),"td div,th div,tr>br,td>br,th>br");n.forEach(function(n){if(r.a.getNodeName(n)==="BR"){var t=r.a.getNodeName(n.parentNode),i=/TD|TH/.test(t),u=n.parentNode.textContent.length===0,f=n.parentNode.lastChild===n;(t==="TR"||i&&!u&&f)&&r.a.remove(n)}else r.a.unwrap(n)})},n._insertDefaultBlockBetweenTable=function(){var n=r.a.findAll(this.wwe.getBody(),"table");n.forEach(function(n){if(n.nextElementSibling&&n.nextElementSibling.nodeName==="TABLE"){var t=document.createElement("div");t.appendChild(document.createElement("br"));r.a.insertAfter(t,n)}})},n._removeTable=function(n,t){t.tagName==="TABLE"&&(this.wwe.getEditor().saveUndoState(n),this.wwe.saveSelection(n),r.a.remove(t),this.wwe.restoreSavedSelection())},n._recordUndoStateIfNeed=function(n){var t=r.a.getParentUntil(n.startContainer,"TR");n.collapsed&&t&&this._lastCellNode!==t&&(this.wwe.getEditor().saveUndoState(n),this._lastCellNode=t)},n._recordUndoStateAndResetCellNode=function(n){this.wwe.getEditor().saveUndoState(n);this.resetLastCellNode()},n._pasteDataIntoTable=function(n){var s=this.wwe.getEditor().getSelection(),u=s.startContainer,o=this._getTableDataFromTable(n),h=u.nodeName==="TD"||u.nodeName==="TH",c=wi?"":"<br />",t,i,f,e;for(h?t=u:(t=r.a.getParentUntilBy(u,function(n){return n&&(n.nodeName==="TD"||n.nodeName==="TH")},function(n){return!!r.a.closest(n,"table")}),t=t?t.parentNode:null),t=t?t:u.querySelector("th,td"),i=t;o.length;){for(f=o.shift();i&&f.length;)e=f.shift(),e.length?i.textContent=e:i.innerHTML=c,i=r.a.getTableCellByDirection(i,"next");i=r.a.getSiblingRowCellByDirection(t,"next",!1);t=i}},n._getTableDataFromTable=function(n){var t=[];return r.a.findAll(n,"tr").forEach(function(n){var i=[];s()(n.children).forEach(function(n){i.push(n.textContent)});i.length&&t.push(i)}),t},n._removeTableContents=function(n){this.wwe.getEditor().saveUndoState();s()(n).forEach(function(n){var t=wi?"":"<br />";n.innerHTML=t})},n.wrapDanglingTableCellsIntoTrIfNeed=function(n){var i=r.a.children(n,"td,th"),u,t;return i.length&&(t=document.createElement("tr"),s()(i).forEach(function(n){r.a.append(t,n)}),u=t),u},n.wrapTrsIntoTbodyIfNeed=function(n){var i=r.a.children(n,"tr"),t=[],f,u;return s()(i).forEach(function(n){t=t.concat(n.querySelectorAll("th"))}),t.length&&s()(t).forEach(function(n){var t=document.createElement("td");t.innerHTML=n.innerHTML;r.a.insertBefore(n,t);r.a.remove(n)}),i.length&&(u=document.createElement("tbody"),s()(i).forEach(function(n){r.a.append(u,n)}),f=u),f},n.wrapTheadAndTbodyIntoTableIfNeed=function(n){var i=r.a.children(n,"thead"),u=r.a.children(n,"tbody"),t=document.createElement("table"),f;return!u.length&&i.length?(r.a.append(t,i[0]),r.a.append(t,this._createTheadOrTboday("tbody")),f=t):u.length&&!i.length?(r.a.append(t,this._createTheadOrTboday("thead")),r.a.append(t,u[0]),f=t):u.length&&i.length&&(r.a.append(t,i[0]),r.a.append(t,u[0]),f=t),f},n.isTableOrSubTableElement=function(n){return n==="TABLE"||n==="TBODY"||n==="THEAD"||n==="TR"||n==="TD"},n._createTheadOrTboday=function(n){var t=document.createElement(n),i=document.createElement("tr");return t.appendChild(i),t},n._stuffTableCellsIntoIncompleteRow=function(n,t){s()(n).forEach(function(n){for(var u=n.querySelectorAll("th,td"),f=r.a.getNodeName(n.parentNode),e=f==="THEAD"?"th":"td",i=u.length;i<t;i+=1)r.a.append(n,ii(1,e))})},n.prepareToTableCellStuffing=function(n){var t=n[0].querySelectorAll("th,td").length,i=!1;return s()(n).forEach(function(n){var r=n.querySelectorAll("th,td").length;t!==r&&(i=!0,t<r&&(t=r))}),{maximumCellLength:t,needTableCellStuffingAid:i}},n._addTbodyOrTheadIfNeed=function(n){var t=!n.querySelector("thead"),i=!n.querySelector("tbody");t?r.a.prepend(n,"<thead><tr><\/tr><\/thead>"):i&&r.a.append(n,"<tbody><tr><\/tr><\/tbody>")},n.tableCellAppendAidForTableElement=function(n){this._addTbodyOrTheadIfNeed(n);this._addTrIntoContainerIfNeed(n);var t=n.querySelectorAll("tr"),i=this.prepareToTableCellStuffing(t),r=i.maximumCellLength,u=i.needTableCellStuffingAid;u&&this._stuffTableCellsIntoIncompleteRow(t,r)},n._generateTheadAndTbodyFromTbody=function(n){var t=document.createElement("tr"),i=document.createElement("thead");return r.a.append(t,ii(n.querySelector("tr > td").length,"th")),r.a.append(i,t),{thead:i,tbody:n}},n._generateTheadAndTbodyFromThead=function(n){var t=document.createElement("tr"),i=document.createElement("tbody");return r.a.append(t,ii(n.querySelectorAll("th").length,"td")),r.a.append(i,t),{thead:n,tbody:i}},n._generateTheadAndTbodyFromTr=function(n){var u=document.createElement("thead"),f=document.createElement("tbody"),t,i;return n.children[0].tagName==="TH"?(t=n,i=r.a.createElementWith("<tr>"+ii(n.querySelectorAll("th").length,"td")+"<\/tr>")):(t=r.a.createElementWith("<tr>"+ii(n.querySelectorAll("td").length,"th")+"<\/tr>"),i=n),r.a.append(u,t),r.a.append(f,i),{thead:u,tbody:f}},n._completeIncompleteTable=function(n){var r=n.tagName,t,i;r==="TABLE"?t=n:(t=document.createElement("table"),n.parentNode.insertBefore(t,n.nextSibling),r==="TBODY"?i=this._generateTheadAndTbodyFromTbody(n):r==="THEAD"?i=this._generateTheadAndTbodyFromThead(n):r==="TR"&&(i=this._generateTheadAndTbodyFromTr(n)),t.appendChild(i.thead),t.appendChild(i.tbody));this._removeEmptyRows(t);this.tableCellAppendAidForTableElement(t)},n._removeEmptyRows=function(n){r.a.findAll(n,"tr").forEach(function(n){n.cells.length||n.parentNode.removeChild(n)})},n._completeTableIfNeed=function(){var n=this,t=this.wwe.getEditor().getBody();s()(t.children).forEach(function(t){n.isTableOrSubTableElement(t.nodeName)&&(t.nodeName!=="TABLE"||t.querySelector("tbody")?n._completeIncompleteTable(t):r.a.remove(t))})},n.resetLastCellNode=function(){this._lastCellNode=null},n.setLastCellNode=function(n){this._lastCellNode=n},n._isModifierKey=function(n){return/((META|SHIFT|ALT|CONTROL)\+?)/g.test(n)},n._isModifierKeyPushed=function(n){return n.metaKey||n.ctrlKey||n.altKey||n.shiftKey},n._addTrIntoContainerIfNeed=function(n){s()(n.children).forEach(function(n){var t=n.querySelectorAll("tr").length===0;t&&r.a.append(n,"<tr><\/tr>")})},n._expandTableIfNeed=function(n){var i=this.wwe.getEditor().getSelection().cloneRange(),f=r.a.parents(i.startContainer,"table"),u=f[0],t=this._getColumnAndRowDifference(n,i);t.column<0&&this._appendCellForAllRow(u,t.column);t.row<0&&this._appendRow(u,t.row)},n._getColumnAndRowDifference=function(n,t){var u=this._getTableDataFromTable(n),s=u.length,h=u[0].length,i=r.a.closest(t.startContainer,"th,td"),f=i.parentNode,c=r.a.getNodeOffsetOfParent(i),e=r.a.getNodeOffsetOfParent(i.parentNode),l=r.a.parents(f,"table"),o=l[0],a=o.querySelector("tr").children.length,v=o.querySelectorAll("tr").length,y=!!r.a.parents(f,"tbody").length;return y&&(e+=1),{row:v-(e+s),column:a-(c+h)}},n._appendCellForAllRow=function(n,t){var i=wi?"":"<br />";r.a.findAll(n,"tr").forEach(function(n,u){for(var f,e=t;e<0;e+=1)f=u===0?"th":"td",r.a.append(n,"<"+f+">"+i+"<\/"+f+">")})},n._appendRow=function(n,t){var i=n.querySelectorAll("tr"),u=i[i.length-1].cloneNode(!0),f=wi?"":"<br />";for(r.a.findAll(u,"td").forEach(function(n){n.innerHTML=f});t<0;t+=1)r.a.append(n.querySelector("tbody"),u.cloneNode(!0))},n._changeSelectionToTargetCell=function(n,t,i,u){var e=i==="next",o=u==="row",f,s;o?f=r.a.getSiblingRowCellByDirection(n,i,!1):(f=r.a.getTableCellByDirection(n,i),f||(f=r.a.getSiblingRowCellByDirection(n,i,!0)));f?(o&&!e?this._moveToCursorEndOfCell(f,t):t.setStart(f,0),t.collapse(!0)):(s=r.a.parents(n,"table"),f=s[0],e?t.setStart(f.nextElementSibling,0):f.previousElementSibling&&f.previousElementSibling.nodeName!=="TABLE"?t.setStart(f.previousElementSibling,1):t.setStartBefore(f),t.collapse(!0))},n._moveToCursorEndOfCell=function(n,t){var i;r.a.isListNode(n.lastChild)&&(i=r.a.getLastNodeBy(n.lastChild,function(n){return n.nodeName!=="LI"||n.nextSibling!==null}));var u=r.a.getLastNodeBy(i||n,function(n){return!r.a.isTextNode(n)}),f=u||i||n,e=u?u.length:f.childNodes.length-1;t.setStart(f,e)},n._moveCursorTo=function(n,t,i){var e=this.wwe.getEditor(),u=e.getSelection().cloneRange(),o=r.a.closest(u.startContainer,"td,th"),f;if(u.collapsed&&this.wwe.isInTable(u)&&o){if(t==="row"&&!this._isMovedCursorToRow(u,n))return f;n!=="previous"&&t!=="row"||lu()(i)||i.preventDefault();this._changeSelectionToTargetCell(o,u,n,t);e.setSelection(u);f=!1}return f},n._isMovedCursorToRow=function(n,t){var i=n.startContainer;return this._isInList(i)?this._isMovedCursorFromListToRow(i,t):this._isMovedCursorFromTextToRow(n,t)},n._isMovedCursorFromListToRow=function(n,t){var i=t+"Sibling",f=this._findListItem(n),u=r.a.getParentNodeBy(f,function(n,t){var u=t[i]===null&&n[i]===null;return!r.a.isCellNode(n)&&u}),e=r.a.isListNode(u)&&u[i]===null;return r.a.isCellNode(u.parentNode)&&e},n._isMovedCursorFromTextToRow=function(n,t){var i=n.startContainer,f=n.startOffset,e=r.a.isCellNode(i)?i.childNodes[f]:i,o=r.a.getParentNodeBy(e,function(n){return!r.a.isCellNode(n)&&!r.a.isTextNode(n)}),u=r.a.getSiblingNodeBy(o,t,function(n){return n!==null&&n.nodeName!=="BR"});return u&&u[t+"Sibling"]===null},n._removeContentsAndChangeSelectionIfNeed=function(n,t,i){var o=t.length<=1,u=t==="BACK_SPACE"||t==="DELETE",r=this.wwe.componentManager.getManager("tableSelection").getSelectedCells(),f=r[0],e=!1;return(o||u)&&!this._isModifierKeyPushed(i)&&r.length&&(u&&this._recordUndoStateIfNeed(n),this._removeTableContents(r),this._lastCellNode=f,n.setStart(f,0),n.collapse(!0),this.wwe.getEditor().setSelection(n),e=!0),e},n.getTableIDClassName=function(){var n=wp+this.tableID;return this.tableID+=1,n},n.destroy=function(){var n=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");ut()(this.keyEventHandlers,function(t,i){return n.wwe.removeKeyEventHandler(i,t)})},t}();var eo=dp,et="te-cell-selected",gp=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="tableSelection";this._init()}var n=t.prototype;return n._init=function(){this._initEvent();v.a.firefox&&(document.execCommand("enableObjectResizing",!1,"false"),document.execCommand("enableInlineTableEditing",!1,"false"))},n._initEvent=function(){var n=this,i,t,f;this._tableSelectionTimer=null;this._removeSelectionTimer=null;this._isSelectionStarted=!1;var e=function(u){t=r.a.closest(u.data.target,"[contenteditable=true] td,th");var e=n.wwe.getEditor().getSelection(),o=r.a.parents(t,"[contenteditable=true] table"),s=i===t,h=n._isTextSelect(e,s)&&!it()(i,et);n._isSelectionStarted&&o&&!h&&(window.getSelection().removeAllRanges(),v.a.firefox&&!n._removeSelectionTimer&&(n._removeSelectionTimer=setInterval(function(){window.getSelection().removeAllRanges()},10)),i&&t&&(n.highlightTableCellsBy(i,t),f=t))},u=function(){n._isSelectionStarted&&(n._isSelectionStarted=!1,n.eventManager.removeEventHandler("mouseover.tableSelection"),n.eventManager.removeEventHandler("mouseup.tableSelection"))},o=function(e){t=r.a.closest(e.data.target,"[contenteditable=true] td,th");var o=n.wwe.getEditor().getSelection(),s=i===t,h=n._isTextSelect(o,s)&&!it()(i,et);n._clearTableSelectionTimerIfNeed();n._isSelectionStarted&&(h||n._isListSelect(o)?n.removeClassAttrbuteFromAllCellsIfNeed():(n.wwe.componentManager.getManager("table").resetLastCellNode(),t=t||f,o=n.wwe.getEditor().getSelection(),o.setStart(t,0),v.a.msie?o.setEnd(t,1):(o.setEnd(t,0),o.collapse(!1)),n.wwe.getEditor().setSelection(o)),n.onDragEnd&&n.onDragEnd());u()},s=function(f){var h=2,s;if(i=r.a.closest(f.data.target,"[contenteditable=true] td,th"),s=!!i&&it()(i,et),t=null,!s||s&&f.data.button!==h){if(n.removeClassAttrbuteFromAllCellsIfNeed(),i&&(n.setTableSelectionTimerIfNeed(i),n.eventManager.listen("mouseover.tableSelection",e),n.eventManager.listen("mouseup.tableSelection",o),n.onDragStart))n.onDragStart(i)}else f.data.button===h&&u()};this.eventManager.listen("mousedown.tableSelection",s);this.eventManager.listen("copyBefore.tableSelection",u);this.eventManager.listen("pasteBefore.tableSelection",u)},n._isTextSelect=function(n,t){return/TD|TH|TEXT/i.test(n.commonAncestorContainer.nodeName)&&t},n._isListSelect=function(n){return/UL|OL|LI/i.test(n.commonAncestorContainer.nodeName)},n.setTableSelectionTimerIfNeed=function(n){var t=r.a.parents(n,"[contenteditable=true] table").length;t&&(this._isSelectionStarted=!0)},n._clearTableSelectionTimerIfNeed=function(){clearTimeout(this._tableSelectionTimer);v.a.firefox&&this._removeSelectionTimer&&(clearTimeout(this._removeSelectionTimer),this._removeSelectionTimer=null)},n._reArrangeSelectionIfneed=function(n,t){var f=r.a.parents(n,"[contenteditable=true] table").length,e=r.a.parents(t,"[contenteditable=true] table").length,c=e&&!f,l=!e&&f,i,o,s,h,u;return c?(o=r.a.parents(t,"[contenteditable=true] table"),i=o[0],s=i.querySelectorAll("th"),n=s[0]):l&&(h=r.a.parents(n,"[contenteditable=true] table"),i=h[0],u=i.querySelectorAll("td"),t=u[u.length-1]),{startContainer:n,endContainer:t}},n._applySelectionDirection=function(n,t){var f=r.a.getNodeOffsetOfParent,i=n.startContainer,u=n.endContainer,e=f(r.a.closest(i,"[contenteditable=true] tr"))-f(r.a.closest(u,"[contenteditable=true] tr")),o=f(i)-f(u),s=e===0,h=e<0,c=o>0;return s?c?(t.setStart(u,0),t.setEnd(i,1)):(t.setStart(i,0),t.setEnd(u,1)):h?(t.setStart(i,0),t.setEnd(u,1)):(t.setStart(u,0),t.setEnd(i,1)),t},n.getSelectionRangeFromTable=function(n,t){var i=r.a.getNodeOffsetOfParent,e=i(n.parentNode),o=i(t.parentNode),c=i(n),l=i(t),a=r.a.getParentUntil(n,"TABLE"),v=r.a.getParentUntil(t,"TABLE"),y=r.a.getNodeName(a)==="TBODY"&&r.a.getNodeName(v)==="THEAD",p=a!==v,w=!!r.a.parents(n,"tbody").length&&!!r.a.parents(t,"tbody").length,u={row:e,cell:c},f={row:o,cell:l},s,h;return y?u.row+=1:p?f.row+=1:w&&(u.row+=1,f.row+=1),e>o||e===o&&c>l?(s=f,h=u):(s=u,h=f),{from:s,to:h}},n.highlightTableCellsBy=function(n,t){var e=r.a.findAll(r.a.parents(n,"[contenteditable=true] table")[0],"tr"),i=this.getSelectionRangeFromTable(n,t),u=i.from.row,o=i.from.cell,f=i.to.row,s=i.to.cell;e.forEach(function(n,t){r.a.findAll(n,"td,th").forEach(function(n,i){var r=t===u,e=t===f;r&&i<o||e&&i>s||t<u||t>f?h()(n,et):l()(n,et)})})},n.removeClassAttrbuteFromAllCellsIfNeed=function(){var n=r.a.findAll(this.wwe.getBody(),"td."+et+",th."+et);n.forEach(function(n){h()(n,et);n.getAttribute("class")||n.removeAttribute("class")})},n.getSelectedCells=function(){return this.wwe.getBody().querySelectorAll("."+et)},n.createRangeBySelectedCells=function(){var i=this.wwe.getEditor(),n=i.getSelection().cloneRange(),t=this.getSelectedCells(),u=t[0],r=t[t.length-1];t.length&&this.wwe.isInTable(n)&&(n.setStart(u,0),n.setEnd(r,r.childNodes.length),i.setSelection(n))},n.styleToSelectedCells=function(n,t){this.createRangeBySelectedCells();n(this.wwe.getEditor(),t)},n.destroy=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")},t}(),oo=gp,nw=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="hr";this._init()}var n=t.prototype;return n._init=function(){this._initEvent()},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueAfter",function(){n._insertEmptyLineIfNeed();n._changeHRForWysiwyg()})},n._insertEmptyLineIfNeed=function(){var n=this.wwe.getBody(),t=n.firstChild,i=n.lastChild;t&&t.nodeName==="HR"?n.insertBefore(r.a.createEmptyLine(),t):i&&i.nodeName==="HR"&&n.appendChild(r.a.createEmptyLine())},n._changeHRForWysiwyg=function(){var n=this.wwe.getBody();r.a.findAll(n,"hr").forEach(function(n){var t=n.parentNode;t.replaceChild(r.a.createHorizontalRule(),n)})},t}(),tw=nw,iw=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="p";this._initEvent()}var n=t.prototype;return n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueBefore",function(t){return n._splitPtagContentLines(t)});this.eventManager.listen("wysiwygSetValueAfter",function(){n._ensurePtagContentWrappedWithDiv();n._unwrapPtags()})},n._splitPtagContentLines=function(n){if(n){var t=r.a.createElementWith("<div>"+n+"<\/div>");r.a.findAll(t,"p").forEach(function(n){var i=n.attributes,u=n.nextElementSibling,e=n.innerHTML,f=e.split(/<br>/gi),o=f.length-1,t="";t=f.map(function(n,t){if(t>0&&t<o&&(n=n?n:"<br>"),n){var r=document.createElement("div");return Object.keys(i).forEach(function(n){var t=i[n],u=t.name,f=t.value;r.setAttribute(u,f)}),r.innerHTML=n,r.outerHTML}return""});(u&&u.nodeName==="P"||n.getAttribute("contenteditable")==="false")&&t.push("<div><br><\/div>");r.a.replaceWith(n,t.join(""))});n=t.innerHTML}return n},n._ensurePtagContentWrappedWithDiv=function(){var n=this;r.a.findAll(this.wwe.getBody(),"p").forEach(function(t){t.querySelectorAll("div").length||r.a.wrapInner(t,"div");n._findNextParagraph(t,"p")&&r.a.append(t,"<div><br><\/div>")})},n._unwrapPtags=function(){r.a.findAll(this.wwe.getBody(),"div").forEach(function(n){var t=n.parentNode;t.tagName==="P"&&r.a.unwrap(t)})},n._findNextParagraph=function(n,t){var i=n.nextElementSibling;return t?i&&tt()(i,t)?i:null:i},t}(),rw=iw,bi=/h[\d]/i,uw=v.a.msie&&v.a.version===10,fw=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="heading";this._init()}var n=t.prototype;return n._init=function(){this._initEvent();this._initKeyHandler()},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueAfter",function(){n._wrapDefaultBlockToHeadingInner()})},n._initKeyHandler=function(){var n=this;this.wwe.addKeyEventHandler("ENTER",function(t,i){return n.wwe.hasFormatWithRx(bi)?(n._onEnter(t,i),!1):!0});this.wwe.addKeyEventHandler("BACK_SPACE",function(t,i){return n.wwe.hasFormatWithRx(bi)?(n._addBrToEmptyBlock(i),n._removePrevTopNodeIfNeed(t,i),!1):!0})},n._wrapDefaultBlockToHeadingInner=function(){var n=r.a.findAll(this.wwe.getBody(),"h1, h2, h3, h4, h5, h6");n.forEach(function(n){var t=!r.a.children(n,"div, p").length;t&&r.a.wrapInner(n,"div")})},n._unwrapHeading=function(){this.wwe.unwrapBlockTag(function(n){return bi.test(n)})},n._onEnter=function(n,t){var i=this;t.startOffset>0?this.wwe.defer(function(n){i._unwrapHeading();n.getEditor().removeLastUndoStack()}):(n.preventDefault(),this._insertEmptyBlockToPrevious(t))},n._insertEmptyBlockToPrevious=function(n){this.wwe.getEditor().saveUndoState(n);var t=r.a.createElementWith("<div><br><\/div>");r.a.insertBefore(t,r.a.getParentUntil(n.startContainer,this.wwe.getBody()))},n._removePrevTopNodeIfNeed=function(n,t){var u=!1;if(t.collapsed&&t.startOffset===0){var f=t.startContainer,i=r.a.getTopPrevNodeUnder(f,this.wwe.getBody()),e=i&&i.textContent.length===0,o=this.wwe.getEditor();f.textContent.length===0?u=this._removeHedingAndChangeSelection(n,t,i):e&&(n.preventDefault(),o.saveUndoState(t),r.a.remove(i),u=!0)}return u},n._getHeadingElement=function(n){var t=bi.test(r.a.getNodeName(n));return t?n:r.a.parents(n,"h1,h2,h3,h4,h5,h6")[0]},n._addBrToEmptyBlock=function(n){var e=n.collapsed,o=n.startOffset,t=n.startContainer,i,u,f;e&&o===1&&(i=this._getHeadingElement(t),u=r.a.children(i.firstChild,"br"),uw||u.length||(f=document.createElement("br"),t.parentNode.appendChild(f)))},n._removeHedingAndChangeSelection=function(n,t,i){var s=t.startContainer,u=this.wwe.getEditor(),h=this.wwe.getBody(),c=this._getHeadingElement(s),f=i,e=1,o;return n.defaultPrevented||(n.preventDefault(),u.saveUndoState(t)),r.a.remove(c),i||(o=r.a.children(h,"div"),f=o[0],e=0),t.setStart(f,e),t.collapse(!0),u.setSelection(t),!0},t}(),ew=fw,ow=i(42),sw=i.n(ow),so=v.a.msie&&v.a.version===10,ho=so?"":"<br>",hw={"&":"&amp;","<":"&lt;",">":"&gt;"},cw=/\u200B/g,lw="data-te-codeblock",aw=function(){function t(n){this.wwe=n;this.eventManager=n.eventManager;this.name="codeblock";this._init()}var n=t.prototype;return n._init=function(){this._initKeyHandler();this._initEvent()},n._initKeyHandler=function(){var n=this;this._keyEventHandlers={BACK_SPACE:this._onBackspaceKeyEventHandler.bind(this),ENTER:function(t,i){!n.wwe.isInTable(i)&&n.wwe.getEditor().hasFormat("CODE")&&n.wwe.defer(function(){var i=n.wwe.getRange(),u=i.startContainer,t=n._getCodeNode(u);t&&!r.a.getTextLength(t)&&t.parentNode.removeChild(t)})}};ut()(this._keyEventHandlers,function(t,i){return n.wwe.addKeyEventHandler(i,t)})},n._getCodeNode=function(n){var t;return n.nodeName==="CODE"?t=n:n.parentNode.nodeName==="CODE"&&(t=n.parentNode),t},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygSetValueAfter.codeblock",function(){n.modifyCodeBlockForWysiwyg()});this.eventManager.listen("wysiwygProcessHTMLText.codeblock",function(t){return n._changePreToPreCode(t)})},n.prepareToPasteOnCodeblock=function(n){var i=this.wwe.getEditor().getDocument().createDocumentFragment(),t=this.convertNodesToText(n);return t=t.replace(/\n$/,""),i.appendChild(document.createTextNode(t)),i},n.convertNodesToText=function(n){for(var i="",t=n.shift(),u,f;sw()(t);)u=t,f=u.childNodes,i+=f&&r.a.isBlockNode(t)?this.convertNodesToText(s()(t.childNodes)):t.nodeName==="BR"?"\n":t.textContent,t=n.shift();return i},n._copyCodeblockTypeFromRangeCodeblock=function(n,t){var i=r.a.getParentUntil(t.commonAncestorContainer,this.wwe.getBody()),u;return r.a.getNodeName(i)==="PRE"&&(u=i.attributes,ut()(u,function(t){n.setAttribute(t.name,t.value)})),n},n._changePreToPreCode=function(n){return n.replace(/<pre( .*?)?>((.|\n)*?)<\/pre>/g,function(n,t,i){return"<pre><code"+(t||"")+">"+i+"<\/code><\/pre>"})},n.modifyCodeBlockForWysiwyg=function(n){n||(n=this.wwe.getBody());r.a.findAll(n,"pre").forEach(function(n){var i=n.querySelector("code"),t,u,f,e;i&&(t=i.getAttribute("data-language"),u=i.getAttribute("data-backticks"));n.children.length>1&&s()(n.children).forEach(function(n){n.nodeName!=="DIV"&&n.nodeName!=="P"||n.querySelectorAll("br").length||(n.innerHTML+=n.innerHTML+"\n")});f=n.querySelectorAll("br");f.length&&r.a.replaceWith(f,"\n");e=n.textContent.replace(/\s+$/,"");r.a.empty(n);n.innerHTML=e?co(e):ho;t&&(n.setAttribute("data-language",t),l()(n,"lang-"+t));u&&n.setAttribute("data-backticks",u);n.setAttribute(lw,"")})},n._onBackspaceKeyEventHandler=function(n,t){var r=!0,f=this.wwe.getEditor(),i=t.commonAncestorContainer;if(this._isCodeBlockFirstLine(t)&&!this._isFrontCodeblock(t))this._removeCodeblockFirstLine(i),t.collapse(!0),r=!1;else if(t.collapsed&&this._isEmptyLine(i)&&this._isBetweenSameCodeblocks(i)){var u=i.previousSibling,e=i.nextSibling,o=u.textContent.length;f.saveUndoState(t);i.parentNode.removeChild(i);this._mergeCodeblocks(u,e);t.setStart(u.childNodes[0],o);t.collapse(!0);r=!1}return r||(f.setSelection(t),n.preventDefault()),r},n._isEmptyLine=function(n){var i=n.nodeName,t=n.childNodes,r=so?n.textContent==="":t.length===1&&t[0].nodeName==="BR";return i==="DIV"&&r},n._isBetweenSameCodeblocks=function(n){var t=n.previousSibling,i=n.nextSibling;return r.a.getNodeName(t)==="PRE"&&r.a.getNodeName(i)==="PRE"&&t.getAttribute("data-language")===i.getAttribute("data-language")},n._mergeCodeblocks=function(n,t){var i=t.textContent;n.childNodes[0].textContent+="\n"+i;t.parentNode.removeChild(t)},n._isCodeBlockFirstLine=function(n){return this.isInCodeBlock(n)&&n.collapsed&&n.startOffset===0},n._isFrontCodeblock=function(n){var i=r.a.getParentUntil(n.startContainer,this.wwe.getEditor().getRoot()),t=i.previousSibling;return t&&t.nodeName==="PRE"},n._removeCodeblockFirstLine=function(n){var t=this.wwe.getEditor(),i=n.nodeName==="PRE"?n:n.parentNode,r=i.textContent.replace(cw,"");t.modifyBlocks(function(){var n=t.getDocument().createDocumentFragment(),u=r.split("\n"),e=document.createElement("div"),o=u.shift(),f;return e.innerHTML=""+co(o)+ho,n.appendChild(e),u.length&&(f=i.cloneNode(),f.textContent=u.join("\n"),n.appendChild(f)),n})},n.isInCodeBlock=function(n){var t;return t=n.collapsed?n.startContainer:n.commonAncestorContainer,!!r.a.closest(t,"pre")},n.destroy=function(){var n=this;this.eventManager.removeEventHandler("wysiwygSetValueAfter.codeblock");this.eventManager.removeEventHandler("wysiwygProcessHTMLText.codeblock");ut()(this._keyEventHandlers,function(t,i){return n.wwe.removeKeyEventHandler(i,t)})},t}();var lo=aw,vw=i(55),ao=i.n(vw);var pw=/\b(H[\d]|LI|P|BLOCKQUOTE|TD)\b/,vo=/Trident\/[456]\./.test(navigator.userAgent),ww=function(n){function i(){for(var t,r=arguments.length,u=new Array(r),i=0;i<r;i++)u[i]=arguments[i];return t=n.call.apply(n,[this].concat(u))||this,t._decorateHandlerToCancelable("copy"),t._decorateHandlerToCancelable(vo?"beforecut":"cut"),t._decorateHandlerToCancelable(vo?"beforepaste":"paste"),t.getBody=function(){return t.body=t.body||t.getRoot(),t.body},t}yw(i,n);var t=i.prototype;return t._decorateHandlerToCancelable=function(n){var t=this._events[n],i;if(t.length>1)throw new Error("too many"+n+"handlers in squire");i=t[0].bind(this);t[0]=function(n){n.defaultPrevented||n.squirePrevented||i(n)}},t.changeBlockFormat=function(n,t){var i=this;this.modifyBlocks(function(u){var f,o,l,e,c,h,a,v;if(u.childNodes.length?f=u.childNodes.item(0):(f=i.createDefaultBlock(),u.appendChild(f)),n){while(f.firstChild)f=f.firstChild;for(a=function(n){e.appendChild(n)};f!==u;){if(v=f,c=v.tagName,le()(n)?n(c):c===n){e=f.childNodes.item(0);(!r.a.isElemNode(e)||f.childNodes.length>1)&&(e=i.createDefaultBlock(),s()(f.childNodes).forEach(a),h=e.lastChild,h&&r.a.getNodeName(h)==="BR"&&e.removeChild(h));l=t?i.createElement(t,[e]):e;o=i.getDocument().createDocumentFragment();o.appendChild(l);u=o;break}f=f.parentNode}}return o&&n||!t||r.a.getNodeName(u.childNodes[0])!=="DIV"||(u=i.createElement(t,[u.childNodes[0]])),u})},t.changeBlockFormatTo=function(n){this.changeBlockFormat(function(n){return pw.test(n)},n)},t.getCaretPosition=function(){return this.getCursorPosition()},t.replaceSelection=function(n,t){t&&this.setSelection(t);this._ignoreChange=!0;this.insertHTML(n)},t.replaceRelativeOffset=function(n,t,i){var r=this.getSelection().cloneRange();this._replaceRelativeOffsetOfSelection(n,t,i,r)},t._replaceRelativeOffsetOfSelection=function(n,t,i,u){var o,s,h,f=u.endContainer,e=u.endOffset;r.a.getNodeName(f)!=="TEXT"&&(f=this._getClosestTextNode(f,e),f&&(e=r.a.isTextNode(f)?f.nodeValue.length:f.textContent.length));f?(o=this.getSelectionInfoByOffset(f,e+t),u.setStart(o.element,o.offset),h=e+(t+i),s=this.getSelectionInfoByOffset(f,h),u.setEnd(s.element,s.offset),this.replaceSelection(n,u)):this.replaceSelection(n)},t._getClosestTextNode=function(n,t){var i=r.a.getChildNodeByOffset(n,t-1);return r.a.getNodeName(i)!=="TEXT"&&(i=i.previousSibling),i},t.getSelectionInfoByOffset=function(n,t){var i,f,u,e,o=t>=0?"next":"previous",s=Math.abs(t),h=i;for(i=o==="next"?n:n.previousSibling,u=s,e=0;i;){if(f=r.a.isTextNode(i)?i.nodeValue.length:i.textContent.length,e+=f,s<=e)break;u-=f;r.a.getTextLength(i)>0&&(h=i);i=i[o+"Sibling"]}return i||(i=h,u=r.a.getTextLength(i)),o==="previous"&&(u=r.a.getTextLength(i)-u),{element:i,offset:u}},t.getSelectionPosition=function(n,t,i){var u=this.createElement("INPUT"),f=n.cloneRange(),o=this.getSelectionInfoByOffset(n.endContainer,n.endOffset+(i||0)),e;return f.setStart(f.startContainer,f.startOffset),f.setEnd(o.element,o.offset),this._ignoreChange=!0,this.insertElement(u,f),e=r.a.getOffset(u),t!=="over"&&(e.top+=u.offsetHeight),u.parentNode.removeChild(u),n.setStart(n.endContainer,n.endOffset),n.collapse(!0),this.setSelection(n),e},t.removeLastUndoStack=function(){this._undoStack.length&&(this._undoStackLength-=1,this._undoIndex-=1,this._undoStack.pop(),this._isInUndoState=!1)},t.replaceParent=function(n,t,i){var u=r.a.closest(n,t,this.getBody());u&&(r.a.wrapInner(u,i),r.a.unwrap(u))},t.preserveLastLine=function(){var t=this.getBody().children,n=t[t.length-1];n&&r.a.getNodeName(n)!=="DIV"&&(this._ignoreChange=!0,r.a.insertAfter(this.createDefaultBlock(),n))},t.scrollTop=function(n){return lu()(n)||(this.getBody().scrollTop=n),this.getBody().scrollTop},t.isIgnoreChange=function(){return this._ignoreChange},t.focus=function(){ao.a.prototype.focus.call(this)},t.blockCommandShortcuts=function(){var n=this,t=nu.b?"meta":"ctrl";["b","i","u","shift-7","shift-5","shift-6","shift-8","shift-9","[","]","d"].forEach(function(i){n.setKeyHandler(t+"-"+i,function(n,t){t.preventDefault()})})},i}(ao.a),bw=ww,kw=v.a.msie&&v.a.version===11,dw=navigator.appVersion.indexOf("Win")!==-1&&v.a.chrome,gw=/Windows (NT )?10/g.test(navigator.appVersion),nb=kw||dw&&!gw,tb=function(){function t(n,t){this._wwe=n;nb&&(this.isComposition=!1,this._initCompositionEvent());this.setRange(t||this._wwe.getRange())}var n=t.prototype;return n._initCompositionEvent=function(){var n=this;this._wwe.getEditor().addEventListener("compositionstart",function(){n.isComposition=!0});this._wwe.getEditor().addEventListener("compositionend",function(){n.isComposition=!1})},n.setRange=function(n){this._range&&this._range.detach();this._range=n},n.expandStartOffset=function(){var n=this._range;r.a.isTextNode(n.startContainer)&&n.startOffset>0&&n.setStart(n.startContainer,n.startOffset-1)},n.expandEndOffset=function(){var n=this._range;r.a.isTextNode(n.endContainer)&&n.endOffset<n.endContainer.nodeValue.length&&n.setEnd(n.endContainer,n.endOffset+1)},n.setEndBeforeRange=function(n){var t=n.startOffset;this.isComposition&&(t+=1);this._range.setEnd(n.startContainer,t)},n.getTextContent=function(){return this._range.cloneContents().textContent},n.replaceContent=function(n){this._wwe.getEditor().setSelection(this._range);this._wwe.getEditor().insertHTML(n);this._wwe.isInTable(this._range)&&this._wwe.eventManager.emit("wysiwygRangeChangeAfter",this._wwe);this._range=this._wwe.getRange()},n.deleteContent=function(){this._wwe.getEditor().setSelection(this._range);this._wwe.getEditor().insertHTML("");this._range=this._wwe.getRange()},n.peekStartBeforeOffset=function(n){var t=this._range.cloneRange();return t.setStart(t.startContainer,Math.max(t.startOffset-n,0)),t.setEnd(this._range.startContainer,this._range.startOffset),t.cloneContents().textContent},t}(),ib=tb,rb=function(){function t(n){var t=n.eventManager,i=n.container,r=n.attachedSelector;this._eventManager=t;this._attachedSelector="[contenteditable=true] "+r;this._container=i;this._attachedElement=null;this.active=!1;this._createElement();this._initEvent()}var n=t.prototype;return n._createElement=function(){this.el=r.a.createElementWith('<div class="te-ww-block-overlay"><\/div>');e()(this.el,{position:"absolute",display:"none",zIndex:1});r.a.append(this._container,this.el)},n._initEvent=function(){var n=this;this._eventManager.listen("change",this._onChange.bind(this));this._eventManager.listen("mouseover",this._onMouseOver.bind(this));this._eventManager.listen("focus",function(){n.setVisibility(!1)});this._eventManager.listen("mousedown",function(){n.setVisibility(!1)})},n._onChange=function(){this._attachedElement&&r.a.isContain(document.body,this._attachedElement)?this.syncLayout():this.setVisibility(!1)},n._onMouseOver=function(n){var u=n.data,t=u.target,i=r.a.closest(t,this._attachedSelector);i?(this._attachedElement=i,this.setVisibility(!0)):r.a.closest(t,this.el)?this.setVisibility(!0):this.active||this.setVisibility(!1)},n.syncLayout=function(){var n=r.a.getOffset(this._attachedElement),t=r.a.getOuterWidth(this._attachedElement),i=r.a.getOuterHeight(this._attachedElement);r.a.setOffset(this.el,n);e()(this.el,{width:t+"px"});e()(this.el,{height:i+"px"})},n.getAttachedElement=function(){return this._attachedElement||null},n.getVisibility=function(){return this.el.style.display==="block"},n.setVisibility=function(n){n&&this._attachedElement?this.getVisibility()||(e()(this.el,{display:"block"}),this.syncLayout(),this.onShow()):n||this.getVisibility()&&(e()(this.el,{display:"none"}),this.onHide())},n.onShow=function(){},n.onHide=function(){this.active=!1;this._attachedElement=null},t}(),ub=rb;var eb=26,ob=250,sb=30,hb=function(n){function i(t){var i,r=t.eventManager,u=t.container,f=t.wysiwygEditor;return i=n.call(this,{eventManager:r,container:u,attachedSelector:"pre"})||this,i._wysiwygEditor=f,i._popupCodeBlockLanguages=null,i._initDOM(),i._initDOMEvent(),i}fb(i,n);var t=i.prototype;return t._initDOM=function(){var n=this;l()(this.el,"code-block-header");this._languageLabel=r.a.createElementWith("<span>text<\/span>");r.a.append(this.el,this._languageLabel);this._buttonOpenModalEditor=r.a.createElementWith('<button type="button">Editor<\/button>');r.a.append(this.el,this._buttonOpenModalEditor);this._eventManager.emit("removeEditor",function(){vt()(n._buttonOpenModalEditor,"click");n._buttonOpenModalEditor=null})},t._initDOMEvent=function(){var n=this;at()(this._buttonOpenModalEditor,"click",function(){return n._openPopupCodeBlockEditor()})},t._openPopupCodeBlockEditor=function(){this._eventManager.emit("openPopupCodeBlockEditor",this.getAttachedElement())},t._updateLanguage=function(){var n=this.getAttachedElement(),t=n?n.getAttribute("data-language"):null;this._languageLabel.textContent=t||"text"},t.syncLayout=function(){var n=this.getAttachedElement(),t=r.a.getOffset(n,".te-editor"),i=t.top;e()(this.el,{top:i+"px",right:eb+"px",width:ob+"px",height:sb+"px"})},t.onShow=function(){var t=this;n.prototype.onShow.call(this);this._onAttachedElementChange=function(){return t._updateLanguage()};this._eventManager.listen("changeLanguage",this._onAttachedElementChange);this._updateLanguage()},t.onHide=function(){this._eventManager.removeEventHandler("changeLanguage",this._onAttachedElementChange);n.prototype.onHide.call(this)},i}(ub),cb=hb,lb=ht.getSharedInstance(),ab=/<([a-z]+|h\d)>(<br>|<br \/>)<\/\1>/gi,vb=/(?:<br>|<br \/>)<\/(.+?)>/gi,yb=/\b(H[\d]|LI|P|BLOCKQUOTE|TD|PRE)\b/,pb=/<span([^>]*)>[\u0020]/g,wb=/[\u0020]<\/span>/g,yo=/^(TABLE|H[1-6])$/,bb="tui-editor-contents",po="tui-editor-contents-placeholder",kb=typeof MutationObserver!="undefined",db=function(){function t(n,t,i){var r=this;i===void 0&&(i={});this.componentManager=new ce(this);this.eventManager=t;this.editorContainerEl=n;this._height=0;this._silentChange=!1;this._keyEventHandlers={};this._managers={};this._linkAttribute=i.linkAttribute||{};this._sanitizer=i.sanitizer;this._initEvent();this._initDefaultKeyEventHandler();this.debouncedPostProcessForChange=yi()(function(){return r.postProcessForChange()},0)}var n=t.prototype;return n.init=function(){var n=document.createElement("div");this.editorContainerEl.appendChild(n);this.editor=new bw(n,{blockTag:"DIV",leafNodeNames:{HR:!1},allowedBlocks:this._sanitizer?[]:["details","summary"]});this.editor.blockCommandShortcuts();this._clipboardManager=new ep(this);this._initSquireEvent();this._clipboardManager.init();l()(this.getBody(),bb);e()(this.editorContainerEl,"position","relative");this._togglePlaceholder();this.codeBlockGadget=new cb({eventManager:this.eventManager,container:this.editorContainerEl,wysiwygEditor:this})},n._initEvent=function(){var n=this;this.eventManager.listen("wysiwygKeyEvent",function(t){return n._runKeyEventHandlers(t.data,t.keyMap)});this.eventManager.listen("wysiwygRangeChangeAfter",function(){return n.scrollIntoCursor()});this.eventManager.listen("contentChangedFromWysiwyg",function(){n._togglePlaceholder()})},n.addKeyEventHandler=function(n,t){var i=this;t||(t=n,n="DEFAULT");fy()(n)||(n=[n]);n.forEach(function(n){i._keyEventHandlers[n]||(i._keyEventHandlers[n]=[]);i._keyEventHandlers[n].push(t)})},n.removeKeyEventHandler=function(n,t){t||(t=n,n="DEFAULT");var i=this._keyEventHandlers[n];i&&(this._keyEventHandlers[n]=i.filter(function(n){return n!==t}))},n._runKeyEventHandlers=function(n,t){var u=this.getRange(),i,r;i=this._keyEventHandlers.DEFAULT;i&&vi()(i,function(i){return r=i(n,u,t)});i=this._keyEventHandlers[t];i&&r!==!1&&vi()(i,function(i){return i(n,u,t)})},n._initSquireEvent=function(){var n=this,t=this.getEditor(),i=!1;t.addEventListener("copy",function(t){n.eventManager.emit("copy",{source:"wysiwyg",data:t});yi()(function(){n.isEditorValid()&&n.eventManager.emit("copyAfter",{source:"wysiwyg",data:t})})()});t.addEventListener(v.a.msie?"beforecut":"cut",function(t){n.eventManager.emit("cut",{source:"wysiwyg",data:t});yi()(function(){n.isEditorValid()&&n.eventManager.emit("cutAfter",{source:"wysiwyg",data:t})})()});t.addEventListener(v.a.msie?"beforepaste":"paste",function(t){n.eventManager.emit("paste",{source:"wysiwyg",data:t})});t.addEventListener("dragover",function(n){return n.preventDefault(),!1});t.addEventListener("drop",function(t){return t.preventDefault(),n.eventManager.emit("drop",{source:"wysiwyg",data:t}),!1});t.addEventListener("input",yi()(function(){if(n.isEditorValid()){if(n._silentChange)n._silentChange=!1;else{var t={source:"wysiwyg"};n.eventManager.emit("changeFromWysiwyg",t);n.eventManager.emit("change",t);n.eventManager.emit("contentChangedFromWysiwyg",n)}n.getEditor().preserveLastLine()}},0));t.addEventListener("keydown",function(t){var r=n.getEditor().getSelection();r.collapsed||(i=!0);n.eventManager.emit("keydown",{source:"wysiwyg",data:t});n._onKeyDown(t)});v.a.firefox&&(t.addEventListener("keypress",function(t){var r=t.keyCode,u;(r===13||r===9)&&(u=n.getEditor().getSelection(),u.collapsed||(i=!0),n.eventManager.emit("keydown",{source:"wysiwyg",data:t}),n._onKeyDown(t))}),t.addEventListener("keyup",function(){var t=n.getRange(),i,u;r.a.isTextNode(t.commonAncestorContainer)&&r.a.isTextNode(t.commonAncestorContainer.previousSibling)&&(i=t.commonAncestorContainer.previousSibling.length,u=t.commonAncestorContainer,t.commonAncestorContainer.previousSibling.appendData(t.commonAncestorContainer.data),t.setStart(t.commonAncestorContainer.previousSibling,i+t.startOffset),t.collapse(!0),r.a.remove(u),n.setRange(t),t.detach())}));t.addEventListener("keyup",function(t){i&&(n.debouncedPostProcessForChange(),i=!1);n.eventManager.emit("keyup",{source:"wysiwyg",data:t})});at()(this.editorContainerEl,"scroll",function(t){n.eventManager.emit("scroll",{source:"wysiwyg",data:t})});t.addEventListener("click",function(t){n.eventManager.emit("click",{source:"wysiwyg",data:t})});t.addEventListener("mousedown",function(t){n.eventManager.emit("mousedown",{source:"wysiwyg",data:t})});t.addEventListener("mouseover",function(t){n.eventManager.emit("mouseover",{source:"wysiwyg",data:t})});t.addEventListener("mouseout",function(t){n.eventManager.emit("mouseout",{source:"wysiwyg",data:t})});t.addEventListener("mouseup",function(t){n.eventManager.emit("mouseup",{source:"wysiwyg",data:t})});t.addEventListener("contextmenu",function(t){n.eventManager.emit("contextmenu",{source:"wysiwyg",data:t})});t.addEventListener("focus",function(){n.eventManager.emit("focus",{source:"wysiwyg"})});t.addEventListener("blur",function(){n.fixIMERange();n.eventManager.emit("blur",{source:"wysiwyg"})});t.addEventListener("pathChange",function(t){var i={strong:/(^B>|>B$|>B>|^B$|STRONG)/.test(t.path),emph:/(>I|>EM|^I$|^EM$)/.test(t.path),strike:/(^S>|>S$|>S>|^S$|DEL)/.test(t.path),code:/CODE/.test(t.path),codeBlock:/PRE/.test(t.path),blockQuote:/BLOCKQUOTE/.test(t.path),table:/TABLE/.test(t.path),heading:/H[1-6]/.test(t.path),list:/UL>LI(?!.task-list-item)/.test(t.path),orderedList:/OL>LI(?!.task-list-item)/.test(t.path),taskList:/[UL|OL]>LI.task-list-item/.test(t.path),source:"wysiwyg"};n.eventManager.emit("stateChange",i)});t.addEventListener("willPaste",function(t){t.fragment&&n.eventManager.emit("willPaste",{source:"wysiwyg",data:t})})},n._togglePlaceholder=function(){var n=this.getEditor();n.modifyDocument(function(){var t=n.getRoot();t.textContent||t.childNodes.length>1?t.classList.remove(po):t.classList.add(po)})},n._onKeyDown=function(n){var t=lb.convert(n);n.keyCode&&(this.eventManager.emit("keyMap",{source:"wysiwyg",keyMap:t,data:n}),n.defaultPrevented||this.eventManager.emit("wysiwygKeyEvent",{keyMap:t,data:n}))},n._initDefaultKeyEventHandler=function(){var n=this;this.addKeyEventHandler("ENTER",function(t,i){n._isInOrphanText(i)&&n.defer(function(){n._wrapDefaultBlockToOrphanTexts();n.breakToNewDefaultBlock(i,"before")});n.defer(function(){return n.scrollIntoCursor()})});this.addKeyEventHandler("TAB",function(t){var i=n.getEditor(),u=i.getSelection(),f=u.collapsed&&n._isCursorNotInRestrictedAreaOfTabAction(i),e=!u.collapsed&&r.a.isTextNode(u.commonAncestorContainer);return(t.preventDefault(),f||e)?(i.insertPlainText("    "),!1):!0});this.addKeyEventHandler("BACK_SPACE",function(t,i,r){return n._handleRemoveKeyEvent(t,i,r)});this.addKeyEventHandler("DELETE",function(t,i,r){return n._handleRemoveKeyEvent(t,i,r)})},n._handleRemoveKeyEvent=function(n,t,i){var r=this.getEditor(),u;return this._isStartHeadingOrTableAndContainsThem(t)?(u=i==="BACK_SPACE"?"backspace":"delete",r.removeAllFormatting(),r._keyHandlers[u](r,n,r.getSelection()),r.removeLastUndoStack(),!1):!0},n._isStartHeadingOrTableAndContainsThem=function(n){var t=n.startContainer,f=n.startOffset,e=n.commonAncestorContainer,o=n.collapsed,i=this.getEditor().getRoot(),u=!1;return o||e!==i||(t===i?u=yo.test(r.a.getChildNodeByOffset(t,f).nodeName):f===0&&(u=yo.test(r.a.getParentUntil(t,i).nodeName))),u},n._wrapDefaultBlockToOrphanTexts=function(){var n=s()(this.getBody().childNodes).filter(function(n){return r.a.isTextNode(n)});r.a.getAllTextNode(this.getBody());n.forEach(function(n){n.nextSibling&&n.nextSibling.tagName==="BR"&&r.a.remove(n.nextSibling);r.a.wrap(n,document.createElement("div"))})},n._isInOrphanText=function(n){return n.startContainer.nodeType===Node.TEXT_NODE&&n.startContainer.parentNode===this.getBody()},n._wrapDefaultBlockTo=function(n){this.saveSelection(n);this._joinSplitedTextNodes();this.restoreSavedSelection();n=this.getRange();var i=n.startContainer,u=n.startOffset,f=this.getEditor().createDefaultBlock([n.startContainer]),t=r.a.getChildNodeByOffset(n.startContainer,n.startOffset);t?n.setStartBefore(t):n.selectNodeContents(n.startContainer);n.collapse(!0);n.insertNode(f);n.setStart(i,u);n.collapse(!0);this.setRange(n)},n._joinSplitedTextNodes=function(){var n,t,i=[],u=s()(this.getBody().childNodes).filter(function(n){return r.a.isTextNode(n)});u.forEach(function(r){n===r.previousSibling?(t.nodeValue+=r.nodeValue,i.push(r)):t=r;n=r});r.a.remove(i)},n.saveSelection=function(n){n||(n=this.getRange());this.getEditor()._saveRangeToBookmark(n)},n.setSelectionByContainerAndOffset=function(n,t,i,r){var f=this.getEditor(),u=f.getSelection();return u.setStart(n,t),u.setEnd(i,r),f.setSelection(u),u},n.restoreSavedSelection=function(){this.setRange(this.getEditor()._getRangeAndRemoveBookmark())},n.reset=function(){this.setValue("")},n.changeBlockFormatTo=function(n){this.getEditor().changeBlockFormatTo(n);this.eventManager.emit("wysiwygRangeChangeAfter",this)},n.makeEmptyBlockCurrentSelection=function(){var n=this;this.getEditor().modifyBlocks(function(t){return t.textContent||(t=n.getEditor().createDefaultBlock()),t})},n.focus=function(){var n=this.scrollTop();this.editor.focus();n!==this.scrollTop()&&this.scrollTop(n)},n.blur=function(){this.editor.blur()},n.remove=function(){vt()(this.editorContainerEl,"scroll");this.getEditor().destroy();this.editor=null;this.body=null;this.eventManager=null},n.setHeight=function(n){this._height=n;e()(this.editorContainerEl,{overflow:"auto",height:"100%"});e()(this.editorContainerEl.parentNode,{height:te()(n)?n+"px":n});var t=this.editorContainerEl.style,i=this.getBody().style,r=parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10),u=parseInt(i.marginTop,10)-parseInt(i.marginBottom,10);e()(this.getBody(),{minHeight:n-u-r+"px"})},n.setMinHeight=function(n){var t=this.getBody();e()(t,"minHeight",n+"px")},n.setPlaceholder=function(n){n&&this.getEditor().getRoot().setAttribute("data-placeholder",n)},n.getLinkAttribute=function(){return this._linkAttribute},n.setValue=function(n,t){t===void 0&&(t=!0);n=this.eventManager.emitReduce("wysiwygSetValueBefore",n);this.editor.setHTML(n);this.eventManager.emit("wysiwygSetValueAfter",this);this.eventManager.emit("contentChangedFromWysiwyg",this);t&&this.moveCursorToEnd();this.getEditor().preserveLastLine();this.getEditor().removeLastUndoStack();this.getEditor().saveUndoState()},n.insertText=function(n){this.editor.insertPlainText(n)},n.getValue=function(){this._prepareGetHTML();var n=this.editor.getHTML();return n=n.replace(ab,function(n,t){return t==="li"?n:t==="td"||t==="th"?"<"+t+"><\/"+t+">":"<br />"}),n=n.replace(pb,"<span$1>&nbsp;"),n=n.replace(wb,"&nbsp;<\/span>"),n=n.replace(vb,"<\/$1>"),n=n.replace(/<div[^>]*>/g,""),n=n.replace(/<\/div>/g,"<br />"),this.eventManager.emitReduce("wysiwygProcessHTMLText",n)},n._prepareGetHTML=function(){var n=this;this.getEditor().modifyDocument(function(){n._joinSplitedTextNodes();n.eventManager.emit("wysiwygGetValueBefore",n)})},n.postProcessForChange=function(){var n=this;this.isEditorValid()&&this.getEditor().modifyDocument(function(){n.eventManager.emit("wysiwygRangeChangeAfter",n)})},n.readySilentChange=function(){kb&&!this.getEditor().isIgnoreChange()&&(this._silentChange=!0)},n.getEditor=function(){return this.editor},n.replaceSelection=function(n,t){this.getEditor().replaceSelection(n,t)},n.replaceRelativeOffset=function(n,t,i){this.getEditor().replaceRelativeOffset(n,t,i)},n.addWidget=function(n,t,i,u){var f=this.getEditor().getSelectionPosition(n,i,u),o=r.a.getOffset(this.editorContainerEl);this.editorContainerEl.appendChild(t);e()(t,{position:"absolute",top:f.top-o.top+"px",left:f.left-o.left+"px"})},n.getBody=function(){return this.getEditor().getBody()},n.hasFormatWithRx=function(n){return this.getEditor().getPath().match(n)},n.breakToNewDefaultBlock=function(n,t){var i=this.editor.createDefaultBlock(),f=r.a.getChildNodeByOffset(n.startContainer,n.startOffset)||r.a.getChildNodeByOffset(n.startContainer,n.startOffset-1),u=r.a.getParentUntil(f,this.getBody());t==="before"?r.a.insertBefore(i,u):r.a.insertAfter(i,u);n.setStart(i,0);n.collapse(!0);this.setRange(n)},n.replaceContentText=function(n,t,i){var r=n.innerHTML;n.innerHTML=r.replace(t,i)},n.unwrapBlockTag=function(n){n||(n=function(n){return yb.test(n)});this.getEditor().changeBlockFormat(n);this.eventManager.emit("wysiwygRangeChangeAfter",this)},n.scrollIntoCursor=function(){var n=this.scrollTop(),t=this.getEditor().getCursorPosition(),i=t.top,o=t.height,r=this.editorContainerEl.getBoundingClientRect(),u=r.top,s=r.height,f=i-u,e=i+o-(u+s);f<0?this.scrollTop(n+f):e>0&&this.scrollTop(Math.ceil(n+e))},n.moveCursorToEnd=function(){this.getEditor().moveCursorToEnd();this.scrollIntoCursor();this._correctRangeAfterMoveCursor("end")},n.moveCursorToStart=function(){this.getEditor().moveCursorToStart();this.scrollTop(0)},n.scrollTop=function(n){return lu()(n)||(this.editorContainerEl.scrollTop=n),this.editorContainerEl.scrollTop},n._correctRangeAfterMoveCursor=function(n){var i=this.getRange(),t=this.getBody();if(n==="start")while(t.firstChild)t=t.firstChild;else while(t.lastChild)t=t.lastChild;t.tagName==="BR"?i.setStartBefore(t):i.setStartAfter(t);i.collapse(!0);this.setRange(i)},n.getRange=function(){return this.getEditor().getSelection().cloneRange()},n.getIMERange=function(){var t,n=getSelection();return n&&n.rangeCount&&(t=n.getRangeAt(0).cloneRange()),t},n.fixIMERange=function(){var n=this.getIMERange(),t,i;n&&(t=r.a.getParentUntil(n.commonAncestorContainer,this.editorContainerEl),i=!!(t&&t.parentNode),i&&this.setRange(n))},n.setRange=function(n){this.getEditor().setSelection(n)},n.isInTable=function(n){var t=n.collapsed?n.startContainer:n.commonAncestorContainer;return!!r.a.closest(t,"[contenteditable=true] table")},n.getTextObject=function(n){return new ib(this,n)},n.defer=function(n,t){var i=this,r=t?t:0;setTimeout(function(){i.isEditorValid()&&n(i)},r)},n.isEditorValid=function(){return this.getEditor()&&r.a.isContain(document.body,this.editorContainerEl)},n._isCursorNotInRestrictedAreaOfTabAction=function(n){return!n.hasFormat("li")&&!n.hasFormat("blockquote")&&!n.hasFormat("table")},n.getSanitizer=function(){return this._sanitizer},t.factory=function(n,i,r){var u=new t(n,i,r);return u.init(),u.componentManager.addManager(sp),u.componentManager.addManager(vp),u.componentManager.addManager(pp),u.componentManager.addManager(oo),u.componentManager.addManager(eo),u.componentManager.addManager(tw),u.componentManager.addManager(rw),u.componentManager.addManager(ew),u.componentManager.addManager(lo),u},t}(),gb=db,nk='<div class="tui-editor"><div class="te-md-container"><div class="te-editor"><\/div><div class="te-md-splitter"><\/div><div class="te-preview"><\/div><\/div><div class="te-ww-container"><div class="te-editor"><\/div><\/div><\/div>',tk=function(){function t(n,t){this.el=n.el;this.height=n.height;this.type=n.initialEditType;this.eventManager=t;this.init();this._initEvent()}var n=t.prototype;return n.init=function(){this._renderLayout();this._initMarkdownAndPreviewSection();this._initWysiwygSection()},n._initEvent=function(){this.eventManager.listen("hide",this.hide.bind(this));this.eventManager.listen("show",this.show.bind(this))},n._renderLayout=function(){e()(this.el,{boxSizing:"border-box"});this.containerEl=r.a.createElementWith(nk,this.el)},n.switchToWYSIWYG=function(){h()(this.containerEl,"te-md-mode");l()(this.containerEl,"te-ww-mode")},n.switchToMarkdown=function(){h()(this.containerEl,"te-ww-mode");l()(this.containerEl,"te-md-mode")},n._initMarkdownAndPreviewSection=function(){this.mdEditorContainerEl=this.containerEl.querySelector(".te-md-container .te-editor");this.previewEl=this.containerEl.querySelector(".te-md-container .te-preview")},n._initWysiwygSection=function(){this.wwEditorContainerEl=this.containerEl.querySelector(".te-ww-container .te-editor")},n._verticalSplitStyle=function(){var n=this.containerEl.querySelector(".te-md-container");h()(n,"te-preview-style-tab");l()(n,"te-preview-style-vertical")},n._tabStyle=function(){var n=this.containerEl.querySelector(".te-md-container");h()(n,"te-preview-style-vertical");l()(n,"te-preview-style-tab")},n.changePreviewStyle=function(n){n==="tab"?this._tabStyle():n==="vertical"&&this._verticalSplitStyle()},n.hide=function(){l()(this.el.querySelector(".tui-editor"),"te-hide")},n.show=function(){h()(this.el.querySelector(".tui-editor"),"te-hide")},n.remove=function(){r.a.remove(this.el.querySelector(".tui-editor"))},n.getEditorEl=function(){return this.containerEl},n.getPreviewEl=function(){return this.previewEl},n.getMdEditorContainerEl=function(){return this.mdEditorContainerEl},n.getWwEditorContainerEl=function(){return this.wwEditorContainerEl},t}(),ik=tk,rk=i(36),o=i(1),uk=i(14),ct=i.n(uk),wo=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g,fk=function(){function n(n){this.eventManager=n;this._initEvent();this._initDefaultImageImporter()}n.decodeURIGraceful=function(n){var r=n.split(" "),i=[],t;return vi()(r,function(n){try{t=decodeURIComponent(n);t=t.replace(/ /g,"%20")}catch(r){t=n}return i.push(t)}),i.join(" ")};n.encodeMarkdownCharacters=function(n){return n.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/</g,"%3C").replace(/>/g,"%3E")};n.escapeMarkdownCharacters=function(n){return n.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/</g,"\\<").replace(/>/g,"\\>")};var t=n.prototype;return t._initEvent=function(){var n=this;this.eventManager.listen("drop",function(t){var i=t.data.dataTransfer&&t.data.dataTransfer.files;n._processBlobItems(i,t.data)});this.eventManager.listen("willPaste",function(t){var u=t.data.fragment,i=u.querySelectorAll("*"),r;i.length===1&&i[0].tagName==="IMG"&&/^data:image/.test(i[0].src)&&(t.data.preventDefault(),r=ek(i[0].src),n._emitAddImageBlobHook(r,"paste"))});this.eventManager.listen("paste",function(t){n._processClipboard(t.data)});this.eventManager.listen("pasteBefore",function(t){n._decodeURL(t)})},t._initDefaultImageImporter=function(){this.eventManager.listen("addImageBlobHook",function(n,t){var i=new FileReader;i.onload=function(n){t(n.target.result)};i.readAsDataURL(n)})},t._emitAddImageBlobHook=function(n,t){var i=this;this.eventManager.emit("addImageBlobHook",n,function(t,r){i.eventManager.emit("command","AddImage",{imageUrl:t,altText:r||n.name||"image"})},t)},t._decodeURL=function(t){var f=n.decodeURIGraceful,e=n.encodeMarkdownCharacters,u,i;if(t.source==="markdown"&&t.data.text)u=t.data.text,i=u[0],u.length===1&&i.match(wo)&&(i=f(i),i=e(i),t.data.update(null,null,[i]));else if(t.source==="wysiwyg"){var o=t.clipboardContainer,h=o.childNodes,r=h[0],s=r.innerText;o.childNodes.length===1&&r.tagName==="A"&&s.match(wo)&&(r.innerText=f(s),r.href=e(r.href))}},t._processClipboard=function(n){var t=n.clipboardData||window.clipboardData,r=t&&t.items,i=t.types;r&&i&&i.length===1&&ct()("Files",[].slice.call(i))!==-1&&this._processBlobItems(r,n)},t._processBlobItems=function(n,t){var i=this;n&&vi()(n,function(n){if(n.type.indexOf("image")!==-1){t.preventDefault();t.stopPropagation();t.codemirrorIgnore=!0;var r=n.name?n:n.getAsFile();return i._emitAddImageBlobHook(r,t.type),!1}return!0})},n}();var ft=fk,ok=i(37),sk=i(46),hk=i(23),bo="en-US",ck=function(){function t(){this._code=bo;this._langs=new hk.a}var n=t.prototype;return n.setCode=function(n){this._code=n},n.setLanguage=function(n,t){var i=this;n=[].concat(n);n.forEach(function(n){if(i._langs.has(n)){var r=i._langs.get(n);i._langs.set(n,b()(r,t))}else i._langs.set(n,t)})},n.get=function(n,t){var i,r;if(t||(t=this._code),i=this._langs.get(t),i||(i=this._langs.get(bo)),r=i[n],!r)throw new Error('There is no text key "'+n+'" in '+t);return r},t}(),f=new ck,lk=i(57),ak=i(9),ki=i.n(ak),vk=i(54),yk=i.n(vk),pk=i(58),wk=i.n(pk);wu=["click","mousedown","mousemove","mouseup","mouseover","mouseout","scroll"];bu=-1;ko=function(){function t(n){n===void 0&&(n={});di(this,"tagName",void 0);di(this,"className",void 0);di(this,"el",void 0);di(this,"_id",void 0);n=b()({tagName:"div"},n);this.tagName=n.tagName;this.className=n.className;this._id=bk();this.customEventManager=new wk.a;this._setRootElement(n.rootElement)}var n=t.prototype;return n.on=function(n,t){var i=this;yk()(n)?ut()(n,function(n,t){i._addEvent(t,n)}):this._addEvent(n,t)},n._bindDomEvent=function(n,t,i){t?r.a.findAll(this.el,t).forEach(function(t){at()(t,n,i)}):at()(this.el,n,i)},n._addEvent=function(n,t){var r=this._parseEventType(n),i=r.event,u=r.selector;if(ct()(i,wu)>-1)this._bindDomEvent(i,u,t);else this.customEventManager.on(i,t)},n._unbindDomEvent=function(n,t,i){t?r.a.findAll(this.el,t).forEach(function(t){vt()(t,n,i)}):vt()(this.el,n,i)},n.off=function(n,t){var r=this._parseEventType(n),i=r.event,u=r.selector;ct()(i,wu)>-1?this._unbindDomEvent(i,u,t):this.customEventManager.off(i,t)},n._parseEventType=function(n){var t=n.split(" "),i=t.shift(),r=t.join(" ");return{event:i,selector:r}},n._setRootElement=function(n){if(!n){var t=this.tagName;n=document.createElement(t);n.className=this.className||"uic"+this._id}this.el=n},n.trigger=function(n,t){this.customEventManager.fire(n,t)},n.remove=function(){this.el&&r.a.remove(this.el)},n.destroy=function(){var n=this;this.remove();ut()(this,function(t,i){n[i]=null})},t}();pt=ko;gi=function(n){function t(i){var r;return i===void 0&&(i={name:t.name}),r=n.call(this,b()({className:t.className},i))||this,r._name=i.name,r}kk(t,n);var i=t.prototype;return i.getName=function(){return this._name},t}(pt);go(gi,"name","item");go(gi,"className","tui-toolbar-item");var ri=gi,dk='<div class="arrow"><\/div><span class="text"><\/span><\/span>',gk=7,nd=function(){function t(){this.el=r.a.createElementWith('<div class="tui-tooltip">'+dk+"<\/div>");document.body.appendChild(this.el);this.hide()}var n=t.prototype;return n.show=function(n,t){var i=n.getBoundingClientRect(),r=i.left+window.pageXOffset,u=i.top+window.pageYOffset;e()(this.el,{top:u+n.clientHeight+gk+"px",left:r+3+"px"});this.el.querySelector(".text").innerHTML=t;e()(this.el,{display:"block"})},n.hide=function(){e()(this.el,{display:"none"})},n.remove=function(){r.a.remove(this.el)},t}(),ku=new nd;nr=function(n){function i(t){var r;t===void 0&&(t={tagName:"button",name:i.name});r=n.call(this,{name:t.name,tagName:"button",className:t.className+" "+i.className,rootElement:t.el})||this;r._setOptions(t);r._render();r.on("click",r._onClick.bind(du(r)));if(t.tooltip){r.on("mouseover",r._onOver.bind(du(r)));r.on("mouseout",r._onOut.bind(du(r)))}return r}td(i,n);var t=i.prototype;return t.setTooltip=function(n){this._tooltip=n},t._setOptions=function(n){this._command=n.command;this._event=n.event;this._text=n.text;this._tooltip=n.tooltip;this._style=n.style;this._state=n.state},t._render=function(){var n=document.createTextNode(this._text||"");this.el.appendChild(n);this.el.setAttribute("type","button");this._style&&this.el.setAttribute("style",this._style)},t._onClick=function(){this.isEnabled()&&(this._command?this.trigger("command",this._command):this._event&&this.trigger("event",this._event),this.trigger("clicked"))},t._onOver=function(){this.isEnabled()&&ku.show(this.el,this._tooltip)},t._onOut=function(){ku.hide()},t.enable=function(){this.el.disabled=!1},t.disable=function(){this.el.disabled=!0},t.isEnabled=function(){return!this.el.disabled},i}(ri);ns(nr,"name","button");ns(nr,"className","tui-toolbar-icons");p=nr;tr=function(n){function t(){return n.call(this,{name:t.name,tagName:"div",className:t.className})||this}return id(t,n),t}(ri);ts(tr,"name","divider");ts(tr,"className","tui-toolbar-divider");var rd=tr,ud=function(){function n(){}return n.create=function(n,t){var i;switch(n){case"heading":i=new p({name:"heading",className:"tui-heading",event:"openHeadingSelect",tooltip:f.get("Headings"),state:"heading"});break;case"bold":i=new p({name:"bold",className:"tui-bold",command:"Bold",tooltip:f.get("Bold"),state:"strong"});break;case"italic":i=new p({name:"italic",className:"tui-italic",command:"Italic",tooltip:f.get("Italic"),state:"emph"});break;case"strike":i=new p({name:"strike",className:"tui-strike",command:"Strike",tooltip:f.get("Strike"),state:"strike"});break;case"hr":i=new p({name:"hr",className:"tui-hrline",command:"HR",tooltip:f.get("Line"),state:"thematicBreak"});break;case"quote":i=new p({name:"quote",className:"tui-quote",command:"Blockquote",tooltip:f.get("Blockquote"),state:"blockQuote"});break;case"ul":i=new p({name:"ul",className:"tui-ul",command:"UL",tooltip:f.get("Unordered list"),state:"list"});break;case"ol":i=new p({name:"ol",className:"tui-ol",command:"OL",tooltip:f.get("Ordered list"),state:"orderedList"});break;case"task":i=new p({name:"task",className:"tui-task",command:"Task",tooltip:f.get("Task"),state:"taskList"});break;case"table":i=new p({name:"table",className:"tui-table",event:"openPopupAddTable",tooltip:f.get("Insert table"),state:"table"});break;case"image":i=new p({name:"image",className:"tui-image",event:"openPopupAddImage",tooltip:f.get("Insert image"),state:""});break;case"link":i=new p({name:"link",className:"tui-link",event:"openPopupAddLink",tooltip:f.get("Insert link")});break;case"code":i=new p({name:"code",className:"tui-code",command:"Code",tooltip:f.get("Code"),state:"code"});break;case"codeblock":i=new p({name:"codeblock",className:"tui-codeblock",command:"CodeBlock",tooltip:f.get("Insert CodeBlock"),state:"codeBlock"});break;case"indent":i=new p({name:"indent",className:"tui-indent",command:"Indent",tooltip:f.get("Indent")});break;case"outdent":i=new p({name:"outdent",className:"tui-outdent",command:"Outdent",tooltip:f.get("Outdent")});break;case"divider":i=new rd;break;case"button":i=new p(t);break;case"item":default:i=new ri(t)}return i},n}(),gu=ud;us=function(n){function i(t,i){var r;return i===void 0&&(i=[]),r=n.call(this,{tagName:"div",className:"tui-editor-defaultUI-toolbar"})||this,rs(is(r),"_items",[]),rs(is(r),"_eventManager",void 0),r._eventManager=t,r.setItems(i),r._initEvent(t),r}fd(i,n);var t=i.prototype;return t._initEvent=function(n){var t=this;n.listen("stateChange",function(n){t._items.forEach(function(t){t._state&&r.a.toggleClass(t.el,"active",!!n[t._state])})});n.listen("changePreviewTabPreview",function(){return t.disableAllButton()});n.listen("changePreviewTabWrite",function(){return t.enableAllButton()});n.listen("changeMode",function(){return t.enableAllButton()})},t.disableAllButton=function(){this._items.forEach(function(n){n instanceof p&&n.disable()})},t.enableAllButton=function(){this._items.forEach(function(n){n instanceof p&&n.enable()})},t.getItems=function(){return this._items.slice(0)},t.getItem=function(n){return this._items[n]},t.setItems=function(n){this.removeAllItems();n.forEach(this.addItem.bind(this))},t.addItem=function(n){this.insertItem(this._items.length,n)},t.insertItem=function(n,t){var u=this,i;ki()(t)?t=gu.create(t):ki()(t.type)&&(t=gu.create(t.type,t.options));i=this.el.children;n>=0&&n<i.length?(r.a.insertBefore(t.el,i[n]),this._items.splice(n,0,t)):(this.el.appendChild(t.el),this._items.push(t));t.onCommandHandler=function(n){return u._eventManager.emit("command",n)};t.onEventHandler=function(n){return u._eventManager.emit(n)};t.on("command",t.onCommandHandler);t.on("event",t.onEventHandler)},t.indexOfItem=function(n){var t,i;return n instanceof ri?t=this._items.indexOf(n):ki()(n)&&(i=n,t=this._items.map(function(n){return n.getName()}).indexOf(i)),t},t.removeItem=function(n,t){t===void 0&&(t=!0);var u,i;return u=n instanceof ri?this.indexOfItem(n):n,u>=0&&(i=this._items.splice(u,1)[0]),i&&(t?i.destroy():(i.off("command",i.onCommandHandler),i.off("event",i.onEventHandler),r.a.remove(i.el))),i},t.removeAllItems=function(){while(this._items&&this._items.length>0)this.removeItem(0)},t.destroy=function(){this.removeAllItems();n.prototype.destroy.call(this)},i}(pt);nf=us;var y="tui-popup-",fs="fit-window",sd='<div class="'+y+'header">\n        <span class="'+y+'title"><\/span>\n        <div class="'+y+'header-buttons">\n            <button type="button" class="'+y+'close-button"><\/button>\n        <\/div>\n    <\/div>\n    <div class="'+y+'body"><\/div>',hd='<div class="'+y+'wrapper">\n        <div class="'+y+'header">\n            <span class="'+y+'title"><\/span>\n            <div class="'+y+'header-buttons">\n                <button type="button" class="'+y+'close-button"><\/button>\n            <\/div>\n        <\/div>\n        <div class="'+y+'body"><\/div>\n    <\/div>',cd=function(n){function i(t){var i;return t=b()({header:!0,target:document.body,textContent:""},t),i=n.call(this,{tagName:"div",className:t.modal?y+"modal-background":y+"wrapper",rootElement:t.el})||this,i._clickEventMap={},i._onClickCloseButton=i.hide.bind(ed(i)),i._initInstance(t),i._initDOM(t),i._initDOMEvent(t),i._initEditorEvent(t),i}od(i,n);var t=i.prototype;return t._initInstance=function(n){this._target=n.target;n.el&&(this.el=n.el,this._isExternalHtmlUse=!0);this.content=n.content?n.content:n.textContent;this.options=n},t._initDOM=function(){var n,i,t;this._initLayout();this._isExternalHtmlUse||(hi()(this.options.title)&&this.setTitle(this.options.title),this.setContent(this.content));n=this.options.headerButtons;n&&(i=r.a.findAll(this.el,"."+y+"close-button"),i.forEach(function(n){r.a.remove(n)}),t=this.el.querySelector("."+y+"header-buttons"),r.a.empty(t),t.innerHTML=n);this.options.css&&e()(this.el,this.options.css)},t._initDOMEvent=function(){var n=this,t=this.options,i=t.openerCssQuery,u=t.closerCssQuery,e=document,f=e.body;i&&r.a.findAll(f,i).forEach(function(t){var i="click."+n._id;n._clickEventMap[i]=n.show.bind(n);at()(t,"click",n._clickEventMap[i])});u&&r.a.findAll(f,u).forEach(function(t){var i="click."+n._id;n._clickEventMap[i]=n.hide.bind(n);at()(t,"click",n._clickEventMap[i])});this.on("click ."+y+"close-button",this._onClickCloseButton)},t._initEditorEvent=function(){},t._initLayout=function(){var n=this.options,t;this._isExternalHtmlUse?(this.hide(),this._target.appendChild(this.el)):(t=n.modal?hd:sd,this.el.innerHTML=t,n.className&&l.a.apply(void 0,[this.el].concat(n.className.split(/\s+/g))),this.hide(),this._target.appendChild(this.el),this.body=this.el.querySelector("."+y+"body"),n.header||r.a.remove(this.el.querySelector("."+y+"header")))},t.setContent=function(n){r.a.empty(this.body);ki()(n)?this.body.innerHTML=n:this.body.appendChild(n)},t.setTitle=function(n){var t=this.el.querySelector("."+y+"title");r.a.empty(t);t.innerHTML=n},t.getTitleElement=function(){return this.el.querySelector("."+y+"title")},t.hide=function(){e()(this.el,{display:"none"});this._isShow=!1;this.trigger("hidden",this)},t.show=function(){e()(this.el,{display:"block"});this._isShow=!0;this.trigger("shown",this)},t.isShow=function(){return this._isShow},t.remove=function(){var n=this,t=this.options,i=t.openerCssQuery,u=t.closerCssQuery,e=document,f=e.body;this.trigger("remove",this);this.off("click ."+y+"close-button",this._onClickCloseButton);i&&r.a.findAll(f,i).forEach(function(t){vt()(t,"click",n._clickEventMap["click."+n._id]);delete n._clickEventMap["click."+n._id]});u&&r.a.findAll(f,u).forEach(function(t){vt()(t,"click",n._clickEventMap["click."+n._id]);delete n._clickEventMap["click."+n._id]});r.a.remove(this.el);this.el=null},t.setFitToWindow=function(n){r.a.toggleClass(this.el,fs,n)},t.isFitToWindow=function(){return it()(this.el,fs)},t.toggleFitToWindow=function(){var n=!this.isFitToWindow();return this.setFitToWindow(n),n},i}(pt),ot=cd;tf=function(n){function i(t){return t=b()({header:!1,className:"te-dropdown-toolbar"},t),n.call(this,t)||this}ld(i,n);var t=i.prototype;return t.getToolbar=function(){return this._toolbar},t.getItems=function(){return this.getToolbar().getItems()},t.getItem=function(n){return this.getToolbar().getItem(n)},t.setItems=function(n){this.getToolbar().setItems(n)},t.addItem=function(n){this.getToolbar().addItem(n)},t.insertItem=function(n,t){this.getToolbar().insertItem(n,t)},t.indexOfItem=function(n){return this.getToolbar().indexOfItem(n)},t.removeItem=function(n,t){return this.getToolbar().removeItem(n,t)},t.removeAllItems=function(){this.getToolbar().removeAllItems()},t._initInstance=function(t){n.prototype._initInstance.call(this,t);var r=t.button,i=t.eventManager;this._button=r;this._eventManager=i;this._toolbar=new nf(i)},t._initDOM=function(){n.prototype._initDOM.call(this);this.setContent(this._toolbar.el)},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this._eventManager.listen("focus",function(){return t.hide()});this._eventManager.listen("closeAllPopup",function(){return t.hide()});this._eventManager.listen(i.OPEN_EVENT,function(){var u=t.isShow();t._eventManager.emit("closeAllPopup");u||t.show();e()(t.el,{left:"-1000px"});var n=t._button,i=r.a.getOuterHeight(n,!0),f=(i-r.a.getOuterHeight(n))/2,o=n.offsetTop+i-f,s=n.offsetLeft+r.a.getOuterWidth(n,!0)-r.a.getOuterWidth(t.el,!0);e()(t.el,{top:o+"px",left:s+"px"})})},i}(ot);ad(tf,"OPEN_EVENT","openDropdownToolbar");rf=tf;var yd="more",pd=function(n){function i(t,i){var r;return r=n.call(this,t,i)||this,ff(uf(r),"_moreButton",void 0),ff(uf(r),"_popupDropdownToolbar",void 0),ff(uf(r),"_observer",void 0),r._init(t),r._bindWidthChangedEvent(),r}vd(i,n);var t=i.prototype;return t.insertItem=function(t,i){n.prototype.insertItem.call(this,t,i);this._arrangeMoreButton()},t._init=function(n){var t=gu.create("button",{name:yd,className:"tui-more",tooltip:f.get("More"),event:rf.OPEN_EVENT});this._moreButton=t;this._popupDropdownToolbar=new rf({eventManager:n,target:this.el,button:t.el});this.addItem(t)},t._bindWidthChangedEvent=function(){var n=this;this._observer=new lk.a(function(){n._popupDropdownToolbar.hide();n._balanceButtons()});this._observer.observe(this.el)},t._balanceButtons=function(){var t=this,u=this._popupDropdownToolbar.getItems(),i,r;u.forEach(function(i){t._popupDropdownToolbar.removeItem(i,!1);var r=t.getItems().length;n.prototype.insertItem.call(t,r,i)});this.removeItem(this._moreButton,!1);n.prototype.insertItem.call(this,0,this._moreButton);i=this.getItems();r=i.filter(function(n){return n.el.offsetTop>t.el.clientHeight});r.forEach(function(n){t.removeItem(n,!1);t._popupDropdownToolbar.addItem(n)});this._arrangeMoreButton()},t._arrangeMoreButton=function(){if(this._popupDropdownToolbar){this.removeItem(this._moreButton,!1);var t=this._popupDropdownToolbar.getItems().length>0,i=this.getItems().length;t&&n.prototype.insertItem.call(this,i,this._moreButton)}},t.destroy=function(){this._observer&&(this._observer.disconnect(),this._observer=null)},i}(nf),wd=pd;var ir="te-tab-active",kd=function(n){function i(t){var i;return t===void 0&&(t={}),i=n.call(this,{tagName:"div",className:"te-tab"})||this,i.sections=t.sections,i._activeButton=null,i._render(t),i._initEvent(t),i}bd(i,n);var t=i.prototype;return t._initEvent=function(n){var t=n.onItemClick;if(t)this.on("itemClick",t);this.on("click button",this._onTabButton.bind(this))},t._render=function(n){for(var i=n.items,u=n.initName,r=[],t=0,f=i.length;t<f;t+=1)r.push('<button type="button" data-index="'+t+'">'+i[t]+"<\/button>");this.el.innerHTML=r.join("");this.activate(u)},t._findButtonContained=function(n,t,i){return r.a.findAll(n,t).filter(function(n){return new RegExp(i).test(n.textContent)})},t.activate=function(n){var t=this._findButtonContained(this.el,"button",n),i=t[0];this._activateTabByButton(i)},t._onTabButton=function(n){var t=n.target;this._activateTabByButton(t);this.trigger("itemClick",t.textContent)},t._activateTabByButton=function(n){this._isActivatedButton(n)||this._updateClassByButton(n)},t._updateClassByButton=function(n){var t,i;this._activeButton&&(t=this._activeButton.getAttribute("data-index"),h()(this._activeButton,ir),this.sections&&h()(this.sections[t],ir));l()(n,ir);this._activeButton=n;i=n.getAttribute("data-index");this.sections&&l()(this.sections[i],ir)},t._isActivatedButton=function(n){return this._activeButton&&this._activeButton.textContent===n.textContent},i}(pt),es=kd;var of="markdown",os="wysiwyg",ss=function(n){function i(t,i,r){var u;return u=n.call(this,{tagName:"div",className:"te-mode-switch"})||this,rr(ef(u),"_buttons",{}),rr(ef(u),"_type",void 0),rr(ef(u),"_rootElement",void 0),u._eventManager=r,u._render(t),u._switchType(hi()(i)?i:of),u._initEvent(),u}dd(i,n);var t=i.prototype;return t.isShown=function(){return this._rootElement.style.display==="block"},t.show=function(){e()(this._rootElement,{display:"block"})},t.hide=function(){e()(this._rootElement,{display:"none"})},t._render=function(n){this._buttons.markdown=r.a.createElementWith('<button class="te-switch-button markdown" type="button">'+f.get("Markdown")+"<\/button>");this._buttons.wysiwyg=r.a.createElementWith('<button class="te-switch-button wysiwyg" type="button">'+f.get("WYSIWYG")+"<\/button>");this.el.appendChild(this._buttons.markdown);this.el.appendChild(this._buttons.wysiwyg);n&&(n.appendChild(this.el),this._rootElement=n);this.on("click .markdown",this._changeMarkdown.bind(this));this.on("click .wysiwyg",this._changeWysiwyg.bind(this));this.show()},t._changeMarkdown=function(){this._switchType(of)},t._changeWysiwyg=function(){this._switchType(os)},t._setActiveButton=function(n){h()(this._buttons.markdown,"active");h()(this._buttons.wysiwyg,"active");l()(this._buttons[""+n],"active")},t._switchType=function(n){this._type!==n&&(this._type=n,this._setActiveButton(n),this.trigger("modeSwitched",this._type))},t._initEvent=function(){var n=this;this._eventManager.listen("changeMode",function(t){n._type!==t&&(n._type=t,n._setActiveButton(t))})},i}(pt);rr(ss,"TYPE",{MARKDOWN:of,WYSIWYG:os});ur=ss;var ng=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/,tg=function(n){function i(t){var i,r='\n            <label for="url">'+f.get("URL")+'<\/label>\n            <input type="text" class="te-url-input" />\n            <label for="linkText">'+f.get("Link text")+'<\/label>\n            <input type="text" class="te-link-text-input" />\n            <div class="te-button-section">\n                <button type="button" class="te-ok-button">'+f.get("OK")+'<\/button>\n                <button type="button" class="te-close-button">'+f.get("Cancel")+"<\/button>\n            <\/div>\n        ";return t=b()({header:!0,title:f.get("Insert link"),className:"te-popup-add-link tui-editor-popup",content:r},t),i=n.call(this,t)||this,i._disabledLinkText=!1,i}gd(i,n);var t=i.prototype;return t._initInstance=function(t){n.prototype._initInstance.call(this,t);this._editor=t.editor;this._eventManager=t.editor.eventManager},t._initDOM=function(){n.prototype._initDOM.call(this);var t=this.el;this._inputText=t.querySelector(".te-link-text-input");this._inputURL=t.querySelector(".te-url-input")},t._initDOMEvent=function(){var t=this;n.prototype._initDOMEvent.call(this);this.on("click .te-close-button",function(){return t.hide()});this.on("click .te-ok-button",function(){return t._addLink()});this.on("shown",function(){t._disabledLinkText=t._editor.isWysiwygMode()&&!t._editor.getRange().collapsed;t._disableLinkTextInput();var r=t._inputText,i=t._inputURL,n=t._editor.getSelectedText().trim();r.value=n;ng.exec(n)&&(i.value=n);i.focus()});this.on("hidden",function(){t._resetInputs()})},t._initEditorEvent=function(){var i=this,t;n.prototype._initEditorEvent.call(this);t=this._eventManager;t.listen("focus",function(){return i.hide()});t.listen("closeAllPopup",function(){return i.hide()});t.listen("openPopupAddLink",function(n){t.emit("closeAllPopup");n&&(i._inputURL.value=n.url);i.show()})},t._disableLinkTextInput=function(){var n=this._inputText;this._disabledLinkText?(n.setAttribute("disabled","disabled"),l()(n,"disabled")):(n.removeAttribute("disabled"),h()(n,"disabled"))},t._addLink=function(){var n=this._getValue(),t=n.url,i=n.linkText;if(this._clearValidationStyle(),!this._disabledLinkText&&i.length<1){l()(this._inputText,"wrong");return}if(t.length<1){l()(this._inputURL,"wrong");return}this._eventManager.emit("command","AddLink",{linkText:i,url:t});this.hide()},t._getValue=function(){var n=this._inputURL.value,t=this._inputText.value;return{url:n,linkText:t}},t._clearValidationStyle=function(){h()(this._inputURL,"wrong","disabled");h()(this._inputText,"wrong")},t._resetInputs=function(){this._inputText.removeAttribute("disabled");this._inputText.value="";this._inputURL.value="";this._clearValidationStyle()},i}(ot),ig=tg;var hs="te-image-url-input",sf="te-image-file-input",cs="te-alt-text-input",ls="te-ok-button",as="te-close-button",vs="te-file-type",ys="te-url-type",ps="te-tab-section",ug="ui",fg=function(n){function i(t){var i='\n            <div class="'+ps+'"><\/div>\n            <div class="'+ys+'">\n                <label for="">'+f.get("Image URL")+'<\/label>\n                <input type="text" class="'+hs+'" />\n            <\/div>\n            <div class="'+vs+'">\n                <label for="">'+f.get("Select image file")+'<\/label>\n                <input type="file" class="'+sf+'" accept="image/*" />\n            <\/div>\n            <label for="url">'+f.get("Description")+'<\/label>\n            <input type="text" class="'+cs+'" />\n            <div class="te-button-section">\n                <button type="button" class="'+ls+'">'+f.get("OK")+'<\/button>\n                <button type="button" class="'+as+'">'+f.get("Cancel")+"<\/button>\n            <\/div>\n        ";return t=b()({header:!0,title:f.get("Insert image"),className:"te-popup-add-image tui-editor-popup",content:i},t),n.call(this,t)||this}rg(i,n);var t=i.prototype;return t._initInstance=function(t){n.prototype._initInstance.call(this,t);this.eventManager=t.eventManager},t._initDOM=function(){var t;n.prototype._initDOM.call(this);t=this.el;this._imageUrlInput=t.querySelector("."+hs);this._imageFileInput=t.querySelector("."+sf);this._altTextInput=t.querySelector("."+cs);var i=t.querySelector("."+vs),r=t.querySelector("."+ys),u=this.body.querySelector("."+ps);this.tab=new es({initName:f.get("File"),items:[f.get("File"),f.get("URL")],sections:[i,r]});u.appendChild(this.tab.el)},t._initDOMEvent=function(){var t=this;n.prototype._initDOMEvent.call(this);this.on("shown",function(){return t._imageUrlInput.focus()});this.on("hidden",function(){return t._resetInputs()});this.on("change ."+sf,function(){var n=t._imageFileInput.value.split("\\").pop();t._altTextInput.value=n});this.on("click ."+as,function(){return t.hide()});this.on("click ."+ls,function(){var i=t._imageUrlInput.value,r=t._altTextInput.value,n,u,f;i?t._applyImage(i,r):(n=t._imageFileInput.files,n.length&&(u=n.item(0),f=function(n,i){return t._applyImage(n,i||r)},t.eventManager.emit("addImageBlobHook",u,f,ug)));t.hide()});this.tab.on("itemClick",function(){return t._resetInputs()})},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this.eventManager.listen("focus",function(){return t.hide()});this.eventManager.listen("closeAllPopup",function(){return t.hide()});this.eventManager.listen("openPopupAddImage",function(){t.eventManager.emit("closeAllPopup");t.show()})},t._applyImage=function(n,t){this.eventManager.emit("command","AddImage",{imageUrl:n,altText:t||"image"});this.hide()},t._resetInputs=function(){r.a.findAll(this.el,"input").forEach(function(n){n.value=""})},t.remove=function(){this.tab.remove();n.prototype.remove.call(this)},i}(ot),eg=fg;var ws="te-table-remove-row",bs="te-context-menu-disabled",sg=function(n){function i(t){var i='\n      <button type="button" class="te-table-add-row">'+f.get("Add row")+'<\/button>\n      <button type="button" class="te-table-add-col">'+f.get("Add col")+'<\/button>\n      <button type="button" class="te-table-remove-row">'+f.get("Remove row")+'<\/button>\n      <button type="button" class="te-table-remove-col">'+f.get("Remove col")+'<\/button>\n      <hr/>\n      <button type="button" class="te-table-col-align-left">'+f.get("Align left")+'<\/button>\n      <button type="button" class="te-table-col-align-center">'+f.get("Align center")+'<\/button>\n      <button type="button" class="te-table-col-align-right">'+f.get("Align right")+'<\/button>\n      <hr/>\n      <button type="button" class="te-table-remove">'+f.get("Remove table")+"<\/button>\n    ";return t=b()({header:!1,className:"te-popup-table-utils",content:i},t),n.call(this,t)||this}og(i,n);var t=i.prototype;return t._initInstance=function(t){n.prototype._initInstance.call(this,t);this.eventManager=t.eventManager},t._initDOMEvent=function(){var t=this;n.prototype._initDOMEvent.call(this);this.on("click .te-table-add-row",function(){return t.eventManager.emit("command","AddRow")});this.on("click .te-table-add-col",function(){return t.eventManager.emit("command","AddCol")});this.on("click .te-table-col-align-left",function(){return t.eventManager.emit("command","AlignCol","left")});this.on("click .te-table-col-align-center",function(){return t.eventManager.emit("command","AlignCol","center")});this.on("click .te-table-col-align-right",function(){return t.eventManager.emit("command","AlignCol","right")});this.on("click .te-table-remove-col",function(){return t.eventManager.emit("command","RemoveCol")});this.on("click .te-table-remove",function(){return t.eventManager.emit("command","RemoveTable")});this._bindClickEventOnRemoveRowMenu()},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this.eventManager.listen("focus",function(){return t.hide()});this.eventManager.listen("mousedown",function(){return t.hide()});this.eventManager.listen("closeAllPopup",function(){return t.hide()});this.eventManager.listen("openPopupTableUtils",function(n){var i=t.el.parentNode.getBoundingClientRect(),r=i.left,u=i.top;t._disableRemoveRowMenu(n.target);e()(t.el,{position:"absolute",top:n.clientY-u+5+"px",left:n.clientX-r+10+"px"});t.eventManager.emit("closeAllPopup");t.show()})},t._bindClickEventOnRemoveRowMenu=function(){var n=this;this.on("click ."+ws,function(t){var i=t.target;it()(i,bs)?t.preventDefault():n.eventManager.emit("command","RemoveRow")})},t._disableRemoveRowMenu=function(n){var t=this.el.querySelector("."+ws);r.a.toggleClass(t,bs,n.nodeName==="TH")},i}(ot),ks=sg;var wt="te-table-selection",ds="te-table-header",gs="te-table-body",nh="te-selection-area",th="te-description",cg='\n    <div class="'+wt+'">\n        <div class="'+ds+'"><\/div>\n        <div class="'+gs+'"><\/div>\n        <div class="'+nh+'"><\/div>\n    <\/div>\n    <p class="'+th+'"><\/p>\n',fr=25,ui=17,er=7,lg=14,or=5,ag=9,hf=1,cf=1,vg=1,sr=1,fi=function(n){function i(t){return t=b()({header:!1,className:"te-popup-add-table",content:cg},t),n.call(this,t)||this}hg(i,n);var t=i.prototype;return t._initInstance=function(t){n.prototype._initInstance.call(this,t);this._selectedBound={};this._tableBound={};this._eventManager=t.eventManager;this._button=t.button;this._eventHandlers={onMousedown:this._selectTableRange.bind(this),onClick:this._fireCommandEvent.bind(this)}},t._initDOM=function(){n.prototype._initDOM.call(this);this._cacheElements();this._setTableSizeByBound(or,er)},t._initDOMEvent=function(t){n.prototype._initDOMEvent.call(this,t);this.on("mousemove ."+wt,this._eventHandlers.onMousedown);this.on("click ."+wt,this._eventHandlers.onClick)},t._selectTableRange=function(n){var i=n.pageX-this._selectionOffset.left,r=n.pageY-this._selectionOffset.top,t=this._getSelectionBoundByOffset(i,r);this._resizeTableBySelectionIfNeed(t.col,t.row);this._setSelectionAreaByBound(t.col,t.row);this._setDisplayText(t.col,t.row);this._setSelectedBound(t.col,t.row)},t._fireCommandEvent=function(){var n=this._getSelectedTableSize();this._eventManager.emit("command","Table",n.col,n.row)},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this._eventManager.listen("focus",function(){return t.hide()});this._eventManager.listen("closeAllPopup",function(){return t.hide()});this._eventManager.listen("openPopupAddTable",function(){var n=t._button,u=n.offsetTop,f=n.offsetLeft;e()(t.el,{top:u+r.a.getOuterHeight(n)+"px",left:f+"px"});t._eventManager.emit("closeAllPopup");t.show();var i=t.el.querySelector("."+wt).getBoundingClientRect(),o=i.left,s=i.top;t._selectionOffset={left:o+window.pageXOffset,top:s+window.pageYOffset}})},t._cacheElements=function(){this.header=this.el.querySelector("."+ds);this.body=this.el.querySelector("."+gs);this.selection=this.el.querySelector("."+nh);this.desc=this.el.querySelector("."+th)},t._resizeTableBySelectionIfNeed=function(n,t){var i=this._getResizedTableBound(n,t);i&&this._setTableSizeByBound(i.col,i.row)},t._getResizedTableBound=function(n,t){var i,r,u;return n>=or&&n<ag?i=n+1:n<or&&(i=or),t>=er&&t<lg?r=t+1:t<er&&(r=er),this._isNeedResizeTable(i,r)&&(u={row:r||this._tableBound.row,col:i||this._tableBound.col}),u},t._isNeedResizeTable=function(n,t){return n&&n!==this._tableBound.col||t&&t!==this._tableBound.row},t._getBoundByOffset=function(n,t){var i=parseInt(t/ui,10),r=parseInt(n/fr,10);return{row:i,col:r}},t._getOffsetByBound=function(n,t){var i=n*fr+fr,r=t*ui+ui;return{x:i,y:r}},t._setTableSizeByBound=function(n,t){var i=this._getOffsetByBound(n,t-vg);this._setTableSize(i.x,i.y);this._tableBound.row=t;this._tableBound.col=n},t._getSelectionBoundByOffset=function(n,t){var i=this._getBoundByOffset(n,t);return i.row<hf?i.row=hf:i.row>this._tableBound.row&&(i.row=this._tableBound.row),i.col<cf?i.col=cf:i.col>this._tableBound.col&&(i.col=this._tableBound.col),i},t._setSelectionAreaByBound=function(n,t){var i=this._getOffsetByBound(n,t);this._setSelectionArea(i.x,i.y)},t._setSelectedBound=function(n,t){this._selectedBound.col=n;this._selectedBound.row=t},t._getSelectedTableSize=function(){return{row:this._selectedBound.row+1,col:this._selectedBound.col+1}},t._setDisplayText=function(n,t){this.desc.innerHTML=n+1+" x "+(t+1)},t._setTableSize=function(n,t){n+=sr;t+=sr;e()(this.header,{height:ui+"px",width:n+"px"});e()(this.body,{height:t+"px",width:n+"px"});e()(this.el,{width:n+30+"px"})},t._setSelectionArea=function(n,t){n+=sr;t+=sr;e()(this.selection,{height:t+"px",width:n+"px"})},t.remove=function(){this.off("mousemove ."+wt,this._eventHandlers.onMousedown);this.off("click ."+wt,this._eventHandlers.onClick);n.prototype.remove.call(this)},i}(ot);fi.CELL_WIDTH=fr;fi.CELL_HEIGHT=ui;fi.MIN_ROW_SELECTION_INDEX=hf;fi.MIN_COL_SELECTION_INDEX=cf;ih=fi;rh=function(n){function t(t){var i='\n      <ul>\n        <li data-value="1" data-type="Heading"><h1>'+f.get("Heading")+' 1<\/h1><\/li>\n        <li data-value="2" data-type="Heading"><h2>'+f.get("Heading")+' 2<\/h2><\/li>\n        <li data-value="3" data-type="Heading"><h3>'+f.get("Heading")+' 3<\/h3><\/li>\n        <li data-value="4" data-type="Heading"><h4>'+f.get("Heading")+' 4<\/h4><\/li>\n        <li data-value="5" data-type="Heading"><h5>'+f.get("Heading")+' 5<\/h5><\/li>\n        <li data-value="6" data-type="Heading"><h6>'+f.get("Heading")+' 6<\/h6><\/li>\n        <li data-type="Paragraph"><div>'+f.get("Paragraph")+"<\/div><\/li>\n      <\/ul>\n    ";return t=b()({header:!1,className:"te-heading-add",content:i},t),n.call(this,t)||this}yg(t,n);var i=t.prototype;return i._initInstance=function(t){n.prototype._initInstance.call(this,t);this._eventManager=t.eventManager;this._button=t.button},i._initDOMEvent=function(){var t=this;n.prototype._initDOMEvent.call(this);this.on("click li",function(n){var i=r.a.closest(n.target,"li");t._eventManager.emit("command",i.getAttribute("data-type"),i.getAttribute("data-value"))})},i._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this._eventManager.listen("focus",this.hide.bind(this));this._eventManager.listen("closeAllPopup",this.hide.bind(this));this._eventManager.listen("openHeadingSelect",function(){var n=t._button,i=n.offsetTop,u=n.offsetLeft;e()(t.el,{top:i+r.a.getOuterHeight(n)+"px",left:u+"px"});t._eventManager.emit("closeAllPopup");t.show()})},t}(ot);uh=rh;ei="te-popup-code-block-lang-";var wg=function(n){function i(t){var i=t,r=i.languages;return t=b()({header:!1,className:"te-popup-code-block-languages",content:fh(r)},t),n.call(this,t)||this}pg(i,n);var t=i.prototype;return t._initInstance=function(t){var i=this;n.prototype._initInstance.call(this,t);this.eventManager=t.eventManager;this._onSelectedLanguage=null;this._onDismissed=null;this._currentButton=null;this._buttons=null;this._languages=t.languages;this._btnMousedownHandler=function(n){var t=n.target.getAttribute("data-lang");i._onSelectedLanguage&&i._onSelectedLanguage(t);i.hide()}},t._initDOM=function(t){n.prototype._initDOM.call(this,t);e()(this.el,"zIndex",1e4);this._buttons=r.a.findAll(this.el,"button");this._activateButtonByIndex(0)},t._initDOMEvent=function(){n.prototype._initDOMEvent.call(this);this._addBtnMouseDownHandler()},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this.eventManager.listen("openPopupCodeBlockLanguages",function(n){return t.show(n.callback),e()(t.el,{top:n.offset.top+"px"}),e()(t.el,{left:n.offset.left+"px"}),t.setCurrentLanguage(n.language),t});this.eventManager.listen("focus",function(){return t.hide()});this.eventManager.listen("mousedown",function(){return t.hide()});this.eventManager.listen("closeAllPopup",function(){return t.hide()});this.eventManager.listen("closePopupCodeBlockLanguages",function(){return t.hide()});this.eventManager.listen("scroll",function(){return t.hide()});this.eventManager.listen("setCodeBlockLanguages",function(n){return t._changeLanguageButtons(n)})},t._activateButtonByIndex=function(n){this._currentButton&&h()(this._currentButton,"active");this._buttons.length&&(this._currentButton=this._buttons[n],l()(this._currentButton,"active"),this._currentButton.scrollIntoView())},t.prev=function(){var n=ct()(this._currentButton,this._buttons)-1;n<0&&(n=this._buttons.length-1);this._activateButtonByIndex(n)},t.next=function(){var n=ct()(this._currentButton,this._buttons)+1;n>=this._buttons.length&&(n=0);this._activateButtonByIndex(n)},t.getCurrentLanguage=function(){return this._currentButton.getAttribute("data-lang")},t.setCurrentLanguage=function(n){var t=this._buttons.filter(function(t){return tt()(t,"."+ei+n)}),i;t.length>0&&(i=ct()(t[0],this._buttons),this._activateButtonByIndex(i))},t.show=function(t){this._onSelectedLanguage=t.selected;this._onDismissed=t.dismissed;n.prototype.show.call(this)},t.hide=function(){this._onDismissed&&this._onDismissed();this._onSelectedLanguage=null;this._onDismissed=null;n.prototype.hide.call(this)},t._addBtnMouseDownHandler=function(){var n=this;this._languages.forEach(function(t){n.off("mousedown ."+ei+t,n._btnMousedownHandler);n.on("mousedown ."+ei+t,n._btnMousedownHandler)})},t._changeLanguageButtons=function(n){this._languages=n;n&&n.length&&(this.content=fh(n),this.setContent(this.content),this._addBtnMouseDownHandler(),this._buttons=r.a.findAll(this.el,"button"),this._activateButtonByIndex(0))},i}(ot),bg=wg,kg="tui-split-scroll",hr="single-content",lf="scroll-sync",dg="tui-split-scroll-wrapper",gg="tui-split-scroll-content",nn="tui-splitter",eh="requireScrollIntoView",tn={left:"tui-split-content-left",right:"tui-split-content-right"},rn=function(){function t(n,t,i,r){r===void 0&&(r={});r=b()({showScrollSyncButton:!1,scrollSync:!0,splitView:!0},r);this._baseElement=n;this._eventManager=r.eventManager;this._contentElements=[];this._initDom(t,i,r);this._initDomEvent()}var n=t.prototype;return n._initDom=function(n,t,i){var u=document.createElement("div"),r,f,e;u.className=kg;this._el=u;r=document.createElement("div");r.className=dg;this._scrollWrapper=r;this._setScrollSync(i.scrollSync);this.setSplitView(i.splitView);f=document.createElement("div");f.className=gg;this._contentWrapper=f;e=document.createElement("div");e.className=nn;this._baseElement.appendChild(u);u.appendChild(r);r.appendChild(f);r.appendChild(e);this._setLeft(n);this._setRight(t)},n._initDomEvent=function(){this._contentWrapper.addEventListener("scroll",this.sync.bind(this))},n._requireScrollIntoView=function(n){var i=n.getBoundingClientRect(),u=i.top,f=i.bottom,t;if(this.isScrollSynced())t=this._contentWrapper;else if(r.a.parents(n,this._contentElements.left).length)t=this._contentElements.left;else if(r.a.parents(n,this._contentElements.right).length)t=this._contentElements.right;else return;var e=t.getBoundingClientRect(),o=e.top,s=e.bottom;u<o?t.scrollTop=t.scrollTop+u-o:f>s&&(t.scrollTop=t.scrollTop+f-s);this.sync()},n._setContentElement=function(n,t){var i=this,r=this._contentElements[t];r&&(this._eventManager.removeEventHandler(eh),this._contentWrapper.removeChild(r));l()(n,tn[t]);this._contentWrapper.appendChild(n);this._eventManager.listen(eh,function(n){return i._requireScrollIntoView(n)});this._eventManager.listen("requireScrollSync",function(){return i.sync()});this._contentElements[t]=n;this.sync()},n._setLeft=function(n){this._setContentElement(n,"left")},n._setRight=function(n){this._setContentElement(n,"right")},n._setScrollSync=function(n){r.a.toggleClass(this._el,lf,n)},n.toggleScrollSync=function(){r.a.toggleClass(this._el,lf)},n.setSplitView=function(n){n?h()(this._el,hr):l()(this._el,hr)},n.toggleSplitView=function(){r.a.toggleClass(this._el,hr)},n.isScrollSynced=function(){return it()(this._el,lf)},n.isSplitView=function(){return!it()(this._el,hr)},n.sync=function(){if(this._contentElements.left&&this._contentElements.right){var t=this._contentWrapper.clientHeight,o=this._contentWrapper.scrollTop,n=this._contentElements.left,r=this._contentElements.right,i=n.offsetHeight-t>0?n:r,u=i===n?r:n,f=i.offsetHeight,s=Math.max(f-t,0),h=Math.max(u.offsetHeight,t),c=f-h;e()(i,{top:0});e()(u,{top:o/s*c+"px"})}},n.scrollTop=function(n){this._contentWrapper.scrollTop=n},t}(),un=rn;var en=function(n){function i(t,i){var r;return r=n.call(this,t,{singleCursorHeightPerLine:!1,theme:"none"})||this,r._language="",r._eventManager=i,r._initEvent(),r}fn(i,n);var t=i.prototype;return t._initEvent=function(){var n=this;this.on("cursorActivity",this._onRequireScrollIntoView.bind(this));this.on("beforeChange",function(t,i){i.origin==="paste"&&n._eventManager.emit("pasteBefore",{source:"codeblock",data:i})})},t._onRequireScrollIntoView=function(){var n=this,t=this.getCursor(),i=this.getWrapperElement();setTimeout(function(){var r=i.querySelector("pre:nth-child("+(t.line+1)+")");r&&n._eventManager.emit("requireScrollIntoView",r)},0)},t.load=function(n){var t=n.cloneNode(!0);this.setLanguage(t.getAttribute("data-language")||"");this.setEditorCodeText(t.textContent)},t.save=function(n){n.innerHTML="";n.textContent=this.getEditorCodeText();n.setAttribute("data-language",this._language);this._eventManager.emit("changeLanguage")},t.clear=function(){this.setLanguage("");this.setEditorCodeText("")},t.getLanguage=function(){return this._language},t.setLanguage=function(n){n===void 0&&(n="");this._language=n},t.getEditorCodeText=function(){return this.getValue()},t.setEditorCodeText=function(n){n===void 0&&(n="");this.setValue(n)},t.refresh=function(){this.cm.refresh()},i}(oe),on=en,sn=i(38);var ln=function(n){function t(t,i,r,u){var f;return f=n.call(this,t,i,r,!0)||this,f._codeBlockEditor=u,f._initEvent(),f.lazyRunner.registerLazyRunFunction("refresh",f.refresh,f.delayCodeBlockTime,hn(f)),f}cn(t,n);var i=t.prototype;return i._initEvent=function(){var n=this;this._codeBlockEditor.on("update",function(){return n.lazyRunner.run("refresh")})},i.refresh=function(){var t=this._codeBlockEditor.getLanguage(),i=this._codeBlockEditor.getEditorCodeText();n.prototype.refresh.call(this,"```"+t+"\n"+i+"\n```");this.eventManager.emit("requireScrollSync")},i.clear=function(){n.prototype.render.call(this,"")},t}(sn.a),an=ln,vn=function(){function t(n,t){this._eventManager=n;this._languages=t;this._initDOM();this._initDOMEvent();this._initEvent()}var n=t.prototype;return n._initDOM=function(){this._inputLanguage=r.a.createElementWith('<input type="text" maxlength="20" placeholder="'+f.get("Choose language")+'" />');this._wrapper=r.a.createElementWith('<span class="te-input-language"><\/span>');this._wrapper.appendChild(this._inputLanguage);this._hide()},n._initDOMEvent=function(){var n=this;this._inputLanguage.addEventListener("keydown",function(t){return n._onKeyEvent(t)});this._inputLanguage.addEventListener("focus",function(){return n._showPopupCodeBlockLanguages()});this._inputLanguage.addEventListener("focusout",function(){return n._onFocusOut()});this._wrapper.addEventListener("mousedown",function(t){t.target===n._wrapper&&(t.preventDefault(),n._toggleFocus())})},n._initEvent=function(){var n=this;this._eventManager.listen("setCodeBlockLanguages",function(t){n._languages=t;t&&t.length?n._show():n._hide()})},n._showPopupCodeBlockLanguages=function(){var n=this,t=this._inputLanguage.getBoundingClientRect();l()(this._wrapper,"active");this.active=!0;this._popupCodeBlockLanguages=this._eventManager.emitReduce("openPopupCodeBlockLanguages",{language:this._prevStoredLanguage,offset:{left:t.left,top:t.bottom},callback:{selected:function(t){return n._onLanguageSelectedFromList(t)},dismissed:function(){n._popupCodeBlockLanguages=null}}})},n._toggleFocus=function(){var n=this._inputLanguage;it()(this._wrapper,"active")?n.blur():n.focus()},n._onFocusOut=function(){h()(this._wrapper,"active");this._inputLanguage.value=this._prevStoredLanguage;this._hidePopupCodeBlockLanguages()},n._onKeyEvent=function(n){if(this._popupCodeBlockLanguages)switch(n.which){case ht.keyCode("UP"):this._popupCodeBlockLanguages.prev();n.preventDefault();break;case ht.keyCode("DOWN"):this._popupCodeBlockLanguages.next();n.preventDefault();break;case ht.keyCode("ENTER"):case ht.keyCode("TAB"):var t=this._popupCodeBlockLanguages.getCurrentLanguage();this._inputLanguage.value=t;this._storeInputLanguage();n.preventDefault();break;default:this._popupCodeBlockLanguages.hide()}else(n.which===ht.keyCode("ENTER")||n.which===ht.keyCode("TAB"))&&(this._storeInputLanguage(),n.preventDefault())},n._onLanguageSelectedFromList=function(n){this._inputLanguage.value=n;this._storeInputLanguage()},n.setOnLanguageSelected=function(n){this._onLanguageSelected=n},n._hidePopupCodeBlockLanguages=function(){this._eventManager.emit("closePopupCodeBlockLanguages")},n.setLanguage=function(n){this._prevStoredLanguage=n;this._inputLanguage.value=n},n._storeInputLanguage=function(){var n=this._inputLanguage.value;this.setLanguage(n);this._onLanguageSelected&&this._onLanguageSelected(n);this._hidePopupCodeBlockLanguages()},n.getElement=function(){return this._wrapper},n._show=function(){e()(this._wrapper,{display:"inline-block"})},n._hide=function(){e()(this._wrapper,{display:"none"})},t}(),yn=vn;var k="popup-editor-",af="te-ok-button",vf="te-close-button",wn='\n    <button type="button" class="'+k+'toggle-scroll"><\/button>\n    <button type="button" class="'+k+'toggle-preview"><\/button>\n    <button type="button" class="'+k+'toggle-fit"><\/button>\n    <button type="button" class="tui-popup-close-button"><\/button>\n',bn=function(n){function i(t){var i='\n            <div class="'+k+'body"><\/div>\n            <div class="te-button-section">\n                <button type="button" class="'+af+'">'+f.get("OK")+'<\/button>\n                <button type="button" class="'+vf+'">'+f.get("Cancel")+"<\/button>\n            <\/div>\n        ";return t=b()({header:!0,title:"CodeBlock Editor",content:i,className:"tui-popup-code-block-editor",headerButtons:wn,modal:!0},t),n.call(this,t)||this}pn(i,n);var t=i.prototype;return t._initInstance=function(t){n.prototype._initInstance.call(this,t);this.eventManager=t.eventManager;this.convertor=t.convertor;this.languages=t.languages},t._initDOM=function(t){n.prototype._initDOM.call(this,t);var i=this.el,r=this.eventManager;this._body=i.querySelector("."+k+"body");this._toggleFitButton=i.querySelector("."+k+"toggle-fit");this._togglePreviewButton=i.querySelector("."+k+"toggle-preview");this._toggleScrollButton=i.querySelector("."+k+"toggle-scroll");this._okButton=i.querySelector("."+af);this._closeButton=i.querySelector("."+vf);this._codeMirrorWrapper=this._createCodeBlockEditor();this._previewWrapper=this._createPreview();this._scrollSyncSplit=new un(this._body,this._codeMirrorWrapper,this._previewWrapper,{eventManager:r});this._updateFitWindowButton();this._updatePreviewButton();this._updateScrollButton();this._codeBlockLanguagesCombo=this._createCodeBlockLanguagesCombo()},t._initDOMEvent=function(){var t=this;n.prototype._initDOMEvent.call(this);this.on("scroll",function(n){return n.preventDefault()});this.on("click ."+k+"toggle-fit",function(){return t._toggleFitToWindow()});this.on("click ."+k+"toggle-preview",function(){return t._togglePreview()});this.on("click ."+k+"toggle-scroll",function(){return t._toggleScroll()});this.on("click ."+af,function(){return t._save()});this.on("click ."+vf,function(){return t.hide()});this.on("click ."+k+"close",function(){return t.hide()});this.on("click ."+k+"editor-wrapper",function(n){n.target===t._codeMirrorWrapper&&t._focusEditor(!0)})},t._initEditorEvent=function(){var t=this;n.prototype._initEditorEvent.call(this);this.eventManager.listen("openPopupCodeBlockEditor",function(n){return t.eventManager.emit("closeAllPopup"),t.show(n),t});this.eventManager.listen("closeAllPopup",this.hide.bind(this));this.eventManager.listen("closePopupCodeBlockEditor",this.hide.bind(this))},t._createCodeBlockEditor=function(){var n=document.createElement("div");return n.className=k+"editor-wrapper",this._codeBlockEditor=new on(n,this.eventManager),n},t._createPreview=function(){var n=document.createElement("div");return this._codeBlockPreview=new an(n,this.eventManager,this.convertor,this._codeBlockEditor),n},t._createCodeBlockLanguagesCombo=function(){var n=this,i=this.getTitleElement(),t=new yn(this.eventManager,this.languages);return t.setOnLanguageSelected(function(t){n._codeBlockEditor.setLanguage(t);n._codeBlockEditor.refresh();n._focusEditor()}),i.innerHTML="CodeBlock Editor",i.appendChild(t.getElement()),t},t._updateFitWindowButton=function(){r.a.toggleClass(this._toggleFitButton,"active",this.isFitToWindow())},t._updatePreviewButton=function(){r.a.toggleClass(this._togglePreviewButton,"active",this._scrollSyncSplit.isSplitView())},t._updateScrollButton=function(){this._scrollSyncSplit.isSplitView()?e()(this._toggleScrollButton,{display:"inline-block"}):e()(this._toggleScrollButton,{display:"none"});r.a.toggleClass(this._toggleScrollButton,"active",this._scrollSyncSplit.isScrollSynced())},t._focusEditor=function(n){this._codeBlockEditor.focus();n?this._codeBlockEditor.moveCursorToEnd():this._codeBlockEditor.moveCursorToStart()},t._togglePreview=function(){this._scrollSyncSplit.toggleSplitView();this._updatePreviewButton();this._updateScrollButton();this._codeBlockEditor.refresh()},t._toggleFitToWindow=function(){this.toggleFitToWindow();this._updateFitWindowButton();this._codeBlockEditor.refresh()},t._toggleScroll=function(){this._scrollSyncSplit.toggleScrollSync();this._updateScrollButton()},t._save=function(){this._codeBlockEditor.save(this._codeBlockElement);this.hide()},t._load=function(n){this._codeBlockElement=n;this._codeBlockEditor.load(n);this._codeBlockLanguagesCombo.setLanguage(this._codeBlockEditor.getLanguage());this._focusEditor();this._codeBlockPreview.refresh()},t.show=function(t){if(n.prototype.show.call(this),!t)throw new Error("should be called with codeBlockElement");this._load(t)},t.hide=function(){this.setFitToWindow(!1);this._codeBlockEditor&&this._codeBlockEditor.clear();this._codeBlockPreview&&this._codeBlockPreview.clear();this._codeBlockElement=null;n.prototype.hide.call(this)},i}(ot),kn=bn;var oh="te-toolbar-section",sh="te-markdown-tab-section",hh="te-editor-section",ch="te-mode-switch-section",dn=['<div class="tui-editor-defaultUI">','<div class="'+oh+'"><div class="'+sh+'"><\/div><\/div>','<div class="'+hh+'"><\/div>','<div class="'+ch+'"><\/div>',"<\/div>"].join(""),gn=function(){function t(n){rt(this,"name","default");rt(this,"el",void 0);rt(this,"_toolbar",void 0);rt(this,"_container",void 0);rt(this,"_editorSection",void 0);rt(this,"_initialEditType",void 0);rt(this,"_editor",void 0);rt(this,"_markdownTabSection",void 0);rt(this,"_markdownTab",void 0);rt(this,"_modeSwitch",void 0);rt(this,"_popups",[]);this._editor=n;this._initialEditType=n.options.initialEditType;this._init(n.options);this._initEvent()}var n=t.prototype;return n._init=function(n){var t=n.el,i=n.toolbarItems,u=n.hideModeSwitch;this.el=r.a.createElementWith(dn,t);this._container=t;this._editorSection=this.el.querySelector("."+hh);this._editorSection.appendChild(this._editor.layout.getEditorEl());this._initToolbar(this._editor.eventManager,i);this._initModeSwitch(this._editor.eventManager,u);this._initPopupAddLink();this._initPopupAddImage();this._initPopupAddTable();this._initPopupAddHeading();this._initPopupTableUtils();this._initPopupCodeBlockLanguages();this._initPopupCodeBlockEditor();this._initMarkdownTab()},n._initEvent=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))},n._initToolbar=function(n,t){var i=new wd(n,t);this._toolbar=i;this.el.querySelector("."+oh).appendChild(i.el)},n._initModeSwitch=function(n,t){var r=this,u=this.el.querySelector("."+ch),f=this._initialEditType==="markdown"?ur.TYPE.MARKDOWN:ur.TYPE.WYSIWYG,i=new ur(u,f,n);this._modeSwitch=i;t&&i.hide();i.on("modeSwitched",function(n){return r._editor.changeMode(n)})},n._initMarkdownTab=function(){var n=this._editor;this._markdownTab=new es({initName:f.get("Write"),items:[f.get("Write"),f.get("Preview")],sections:[n.layout.getMdEditorContainerEl(),n.layout.getPreviewEl()]});this._markdownTabSection=this.el.querySelector("."+sh);this._markdownTabSection.appendChild(this._markdownTab.el);this._markdownTab.on("itemClick",function(t){t===f.get("Preview")?(n.eventManager.emit("previewNeedsRefresh"),n.eventManager.emit("changePreviewTabPreview"),n.eventManager.emit("closeAllPopup")):(n.getCodeMirror().focus(),n.eventManager.emit("changePreviewTabWrite"))})},n._markdownTabControl=function(){this._editor.isMarkdownMode()&&this._editor.getCurrentPreviewStyle()==="tab"?(e()(this._markdownTabSection,{display:"block"}),this._markdownTab.activate(f.get("Write"))):e()(this._markdownTabSection,{display:"none"})},n._initPopupAddLink=function(){this._popups.push(new ig({target:this.el,editor:this._editor}))},n._initPopupAddImage=function(){this._popups.push(new eg({target:this.el,eventManager:this._editor.eventManager}))},n._initPopupAddTable=function(){this._popups.push(new ih({target:this._toolbar.el,eventManager:this._editor.eventManager,button:this.el.querySelector("button.tui-table"),css:{position:"absolute"}}))},n._initPopupAddHeading=function(){this._popups.push(new uh({target:this._toolbar.el,eventManager:this._editor.eventManager,button:this.el.querySelector("button.tui-heading"),css:{position:"absolute"}}))},n._initPopupTableUtils=function(){var n=this;this._editor.eventManager.listen("contextmenu",function(t){r.a.parents(t.data.target,"[contenteditable=true] table").length>0&&(t.data.preventDefault(),n._editor.eventManager.emit("openPopupTableUtils",t.data))});this._popups.push(new ks({target:this.el,eventManager:this._editor.eventManager}))},n._initPopupCodeBlockLanguages=function(){var n=this._editor;this._popups.push(new bg({target:this.el,eventManager:n.eventManager,languages:n.codeBlockLanguages}))},n._initPopupCodeBlockEditor=function(){this._popups.push(new kn({target:this.el,eventManager:this._editor.eventManager,convertor:this._editor.convertor,languages:this._editor.codeBlockLanguages}))},n.getToolbar=function(){return this._toolbar},n.setToolbar=function(n){this._toolbar.destroy();this._toolbar=n},n.getModeSwitch=function(){return this._modeSwitch},n.getEditorSectionHeight=function(){var n=this._editorSection.getBoundingClientRect();return n.bottom-n.top},n.getEditorHeight=function(){var n=this._container.getBoundingClientRect();return n.bottom-n.top},n.getPopupTableUtils=function(){var n;return this._popups.forEach(function(t){t instanceof ks&&(n=t)}),n},n.hide=function(){l()(this.el,"te-hide")},n.show=function(){h()(this.el,"te-hide")},n.remove=function(){r.a.remove(this.el);this._markdownTab.remove();this._modeSwitch.remove();this._toolbar.destroy();this._popups.forEach(function(n){return n.remove()});this._popups=[];ku.hide()},n.createPopup=function(n){return new ot(n)},t}(),ntt=gn,ttt=i(30),itt=i(32),lh=i.n(itt);var utt=lh.a.Renderer.factory(lh.a.gfmRenderer,{"EM, I":function(n,t){return this.isEmptyText(t)?"":yf(n,t,"*")},"STRONG, B":function(n,t){return this.isEmptyText(t)?"":yf(n,t,"**")},"DEL, S":function(n,t){return this.isEmptyText(t)?"":yf(n,t,"~~")}}),ah=i(31),ftt=function(n,t){var i=n.start,r=n.end,u,f,e;return i.ch>=t&&(f={line:i.line,ch:i.ch-t},e={line:r.line,ch:r.ch+t},u={from:f,to:e}),u},lt=function(n,t){var i=t.length;return n.substr(i,n.length-i*2)},oi=function(n,t){return""+t+n+t},si=function(n,t,i,r,u){var f=ftt(t,i),e=!1;if(f){var o=f.from,s=f.to,h=n.getRange(o,s);r(h)&&(n.setSelection(o,s),n.replaceSelection(u(h),"around"),e=!0)}return e},cr=function(n,t,i,r){var u=!1;return i(t)&&(n.replaceSelection(r(t),"around"),u=!0),u},vh=function(n,t,i,r,u){var h=n.getCursor(),a=h.line,v=h.ch,e=n.getSelection(),o=i.length,s=function(n){return r.test(n)},c,l,f;si(n,t,o,s,function(n){return lt(n,i)})||cr(n,e,s,function(n){return lt(n,i)})||(c=e.replace(u,"$1"),n.replaceSelection(oi(c,i),"around"));l=n.getSelection();f=v;e||(s(l)?f+=o:f-=o,n.setCursor(a,f))},ett=/^(\*{2}|_{2}).*\1$/,ott=/[*_]{2,}([^*_]*)[*_]{2,}/g,stt="**",htt=o.a.command("markdown",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(n){var t=n.getEditor(),i=t.getDoc(),r=n.getRange();vh(i,r,stt,ett,ott);t.focus()}}),ctt=htt,ltt=/^(\*{3}|_{3}).*\1$/,att=/^(\*{2}|_{2}).*\1$/,vtt=/^(\*|_).*\1$/,ytt=/([^*_])[*_]([^*_]+)[*_]([^*_])/g,lr=function(n){return ltt.test(n)},ar=function(n){return att.test(n)},vr=function(n){return vtt.test(n)},g="*",yr=g.length,yh=2,ph=3,pf=function(n){return n?n.replace(ytt,"$1$2$3"):""},ptt=function(n,t,i){var r=si.bind(this,n,i);return r(ph,lr,function(n){return lt(n,g)})||r(yh,ar,function(n){return oi(pf(n),g)})||r(yr,vr,function(n){return lt(n,g)})||cr(n,t,lr,function(n){return lt(n,g)})||cr(n,t,ar,function(n){return oi(pf(n),g)})||cr(n,t,vr,function(n){return lt(n,g)})},wtt=function(n,t){return si(n,t,ph,lr,function(n){return lt(n,g)})||si(n,t,yh,ar,function(n){return oi(n,g)})||si(n,t,yr,vr,function(){return""})||n.replaceSelection(""+g+g,"around")},btt=o.a.command("markdown",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(n){var f=n.getEditor(),t=f.getDoc(),e=t.getCursor(),s=e.line,h=e.ch,o=n.getRange(),u=t.getSelection(),i,r;u?ptt(t,u,o)||t.replaceSelection(oi(pf(u),g),"around"):(wtt(t,o),i=t.getSelection(),r=h,lr(i)||vr(i)&&!ar(i)?r+=yr:r-=yr,t.setCursor(s,r));f.focus()}}),ktt=btt,dtt=/^~~.*~~$/,gtt=/~~([^~]*)~~/g,nit="~~",tit=o.a.command("markdown",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(n){var t=n.getEditor(),i=t.getDoc(),r=n.getRange();vh(i,r,nit,dtt,gtt);t.focus()}}),iit=tit,wh=/^> ?/,rit=o.a.command("markdown",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(n){var u=n.getEditor(),r=u.getDoc(),t=n.getCurrentRange(),f={line:t.from.line,ch:0},e={line:t.to.line,ch:r.getLineHandle(t.to.line).text.length},c=r.getRange(f,e),i=c.split("\n"),o=this._haveBlockquote(i),s,h;s=o?this._removeBlockquote(i):this._addBlockquote(i);r.replaceRange(s.join("\n"),f,e);o?(h=i.length,t.to.ch-=this._isBlockquoteWithSpace(i[h-1])?2:1):t.to.ch+=2;r.setCursor(t.to);u.focus()},_haveBlockquote:function(n){for(var t=0;t<n.length;t+=1)if(!wh.test(n[t]))return!1;return!0},_addBlockquote:function(n){return n.map(function(n){return"> "+n})},_removeBlockquote:function(n){return n.map(function(n){return n.replace(wh,"")})},_isBlockquoteWithSpace:function(n){return/^> /.test(n)}}),uit=rit,fit=/^#+\s/g,eit=o.a.command("markdown",{name:"Heading",exec:function(n,t){var o=n.getEditor(),i=o.getDoc(),r=n.getCurrentRange(),f={line:r.from.line,ch:0},u={line:r.to.line,ch:i.getLineHandle(r.to.line).text.length},h=i.getLine(u.line).length,c=i.getRange(f,u),e=c.split("\n");s()(e).forEach(function(n,i){e[i]=oit(n,t)});i.replaceRange(e.join("\n"),f,u);r.to.ch+=i.getLine(u.line).length-h;i.setSelection(f,r.to);o.focus()}});bh=eit;kh=o.a.command("markdown",{name:"Paragraph",exec:function(n){var e=n.getEditor(),t=e.getDoc(),r=n.getCurrentRange(),u={line:r.from.line,ch:0},i={line:r.to.line,ch:t.getLineHandle(r.to.line).text.length},o=t.getLine(i.line).length,h=t.getRange(u,i),f=h.split("\n");s()(f).forEach(function(n,t){f[t]=sit(n)});t.replaceRange(f.join("\n"),u,i);r.to.ch+=t.getLine(i.line).length-o;t.setSelection(u,i);e.focus()}});var hit=kh,cit=o.a.command("markdown",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(n){var f=n.getEditor(),i=f.getDoc(),u="",t=n.getCurrentRange(),r={line:t.from.line,ch:t.from.ch},e={line:t.to.line,ch:t.to.ch};t.collapsed&&(u=i.getLine(r.line),r.ch=0,e.ch=i.getLineHandle(t.to.line).text.length);u+=i.getLine(r.line).length?"\n\n* * *\n\n":"\n* * *\n";i.replaceRange(u,r,e);f.focus()}}),lit=cit,ait=ft.decodeURIGraceful,vit=ft.encodeMarkdownCharacters,dh=/!\[.*\]\(.*\)/g,yit=/\(|\)|\[|\]|<|>/g;var wit=o.a.command("markdown",{name:"AddLink",exec:function(n,t){var f=n.getEditor(),o=f.getDoc(),r=n.getCurrentRange(),s={line:r.from.line,ch:r.from.ch},h={line:r.to.line,ch:r.to.ch},i=t.linkText,u=t.url,e;i=ait(i);i=pit(i);u=vit(u);e="["+i+"]("+u+")";o.replaceRange(e,s,h);f.focus()}}),bit=wit,kit=ft.decodeURIGraceful,dit=ft.encodeMarkdownCharacters,git=ft.escapeMarkdownCharacters,nrt=o.a.command("markdown",{name:"AddImage",exec:function(n,t){var f=n.getEditor(),o=f.getDoc(),r=n.getCurrentRange(),s={line:r.from.line,ch:r.from.ch},h={line:r.to.line,ch:r.to.ch},i=t.altText,u=t.imageUrl,e;i=kit(i);i=git(i);u=dit(u);e="!["+i+"]("+u+")";o.replaceRange(e,s,h,"+addImage");f.focus()}}),trt=nrt,irt=o.a.command("markdown",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(n){var t=n.getCurrentRange(),i=n.componentManager.getManager("list");i.changeSyntax(t,"ul")}}),rrt=irt,urt=o.a.command("markdown",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(n){var t=n.getCurrentRange(),i=n.componentManager.getManager("list");i.changeSyntax(t,"ol")}}),frt=urt,ert=o.a.command("markdown",{name:"Indent",exec:function(n){var t=n.getEditor();t.execCommand("indentOrderedList")}}),ort=ert,srt=o.a.command("markdown",{name:"Outdent",exec:function(n){var t=n.getEditor();t.execCommand("indentLessOrderedList")}}),hrt=srt,crt=o.a.command("markdown",{name:"Table",exec:function(n,t,i,r){var u=n.getEditor(),e=u.getDoc(),f="\n";u.getCursor().ch>0&&(f+="\n");f+=lrt(t,r);f+=art(t,i-1,r);e.replaceSelection(f);r||u.setCursor(u.getCursor().line-i,2);n.focus()}});var vrt=crt,yrt=o.a.command("markdown",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(n){var t=n.getCurrentRange(),i=n.componentManager.getManager("list");i.changeSyntax(t,"task")}}),prt=yrt,wrt=/^`([^`]+)`$/,brt=/`([^`]+)`/g,krt=o.a.command("markdown",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(n){var r=n.getEditor(),u=r.getDoc(),i=u.getSelection(),e=r.getCursor(),f=this.hasStrikeSyntax(i),t;f?(t=this.remove(i),t=this._removeCodeSyntax(t)):(t=this._removeCodeSyntax(i),t=this.append(t));u.replaceSelection(t,"around");i||f||this.setCursorToCenter(u,e,f);r.focus()},setCursorToCenter:function(n,t,i){var r=i?-1:1;n.setCursor(t.line,t.ch+r)},hasStrikeSyntax:function(n){return wrt.test(n)},append:function(n){return"`"+n+"`"},remove:function(n){return n.substr(1,n.length-2)},_removeCodeSyntax:function(n){return n?n.replace(brt,"$1"):""}}),drt=krt,grt=o.a.command("markdown",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(n){var i=n.getEditor(),r=i.getDoc(),t=n.getCurrentRange(),u=["```",r.getSelection(),"```"],f=1;t.from.ch!==0&&(u.unshift(""),f+=1);t.to.ch!==r.getLine(t.to.line).length&&u.push("");r.replaceSelection(u.join("\n"));i.setCursor(t.from.line+f,0);i.focus()}}),nut=grt,tut=/^\[(\s*)(x?)(\s*)\](?:\s+)/i,iut=o.a.command("markdown",{name:"ChangeTaskMarker",exec:function(n){var t=n.getEditor(),s=t.getCursor(),h=s.line,f=s.ch,v=t.getLine(h).length===f?f:f+1,y=n.getToastMark().findNodeAtPosition([h+1,v]),e=Object(u.b)(y,function(n){return n.type==="paragraph"&&n.parent&&n.parent.type==="item"});if(e&&e.firstChild){var c=e.firstChild,p=c.literal,w=c.sourcepos,l=w[0],b=l[0],k=l[1],i=p.match(tut);if(i){var d=i[1],a=i[2],g=i[3],o=d.length+g.length,r={line:b-1,ch:k};a?t.replaceRange(a,r,Object(u.a)(r,o?o+1:0)):o||t.replaceRange(" ",r,r)}}}}),rut=iut,uut=o.a.command("markdown",{name:"ToggleTaskMarker",exec:function(n){var i=this,t=n.getEditor(),r=t.listSelections();r.forEach(function(r){for(var e=r.anchor,o=r.head,s=Math.min(e.line,o.line),h=Math.max(e.line,o.line),u,f=s,c=h;f<=c;f+=1)u=n.getToastMark().findFirstNodeAtLine(f+1),(u.type==="list"||u.type==="item")&&i._changeTaskState(u,f,t)})},_changeTaskState:function(n,t,i){var r=n.listData,e=n.sourcepos,o=r.task,s=r.checked,h=r.padding;if(o){var c=s?" ":"x",l=e[0],a=l[1],f={line:t,ch:a+h};i.replaceRange(c,f,Object(u.a)(f,1))}}}),fut=uut,eut=o.a.command("markdown",{name:"MoveNextCursorOrIndent",exec:function(n){var t=n.getEditor(),r=t.getCursor(),f=r.line,i=r.ch,o=t.getLine(f).length===i?i:i+1,s=n.getToastMark().findNodeAtPosition([f+1,o]),e=Object(u.b)(s,function(n){return Object(u.l)(n)});e?this._moveCursorNextCell(e,t):t.execCommand("indentOrderedList")},_moveCursorNextCell:function(n,t){var o=n.next,i=n.parent,r=Object(u.f)(n),f=Object(u.c)(n)+2,e;o?f=Object(u.c)(o):(e=!i.next&&i.parent.type==="tableHead"?i.parent.next.firstChild:i.next,e&&(r=r+1,f=Object(u.c)(e.firstChild)));t.setCursor({line:r-1,ch:f-1})}}),out=eut,sut=o.a.command("markdown",{name:"MovePrevCursorOrOutdent",exec:function(n){var t=n.getEditor(),r=t.getCursor(),f=r.line,i=r.ch,o=t.getLine(f).length===i?i:i+1,s=n.getToastMark().findNodeAtPosition([f+1,o]),e=Object(u.b)(s,function(n){return Object(u.l)(n)});e?this._moveCursorPrevCell(e,t):t.execCommand("indentLessOrderedList")},_moveCursorPrevCell:function(n,t){var o=n.prev,i=n.parent,r=Object(u.f)(n),f=1,e;o?f=Object(u.c)(o):(e=!i.prev&&i.parent.type==="tableBody"?i.parent.prev.lastChild:i.prev,e&&(r=r-1,f=Object(u.c)(e.lastChild)));t.setCursor({line:r-1,ch:f-1})}}),hut=sut;var lut=o.a.command("markdown",{name:"AddLine",exec:function(n){var t=n.getEditor(),r=t.getCursor(),f=r.line,i=r.ch,o=t.getLine(f).length===i?i:i+1,s=n.getToastMark().findNodeAtPosition([f+1,o]),e=Object(u.b)(s,function(n){return Object(u.l)(n)&&(n.parent.type==="tableDelimRow"||n.parent.parent.type==="tableBody")});e?this._addTableRowByCell(e,t):t.execCommand("newlineAndIndentContinueMarkdownList")},_addTableRowByCell:function(n,t){var i=Object(u.f)(n),r=n.parent,f=r.next,o=t.getLine(i-1),e=cut(r);f&&f.type==="tableRow"||o!==e?(t.setCursor(i-1,Object(u.c)(r)),t.replaceSelection("\n"+e),t.setCursor(i,2)):t.execCommand("deleteLine")}}),aut=lut,vut=o.a.command("wysiwyg",{name:"Bold",keyMap:["CTRL+B","META+B"],exec:function(n){var t=n.getEditor(),u=n.componentManager.getManager("tableSelection"),i;n.focus();t.hasFormat("table")&&u.getSelectedCells().length?(u.styleToSelectedCells(gh),i=t.getSelection(),i.collapse(!0),t.setSelection(i)):(gh(t),r.a.optimizeRange(t.getSelection(),"B"))}});nc=vut;tc=o.a.command("wysiwyg",{name:"Italic",keyMap:["CTRL+I","META+I"],exec:function(n){var t=n.getEditor(),u=n.componentManager.getManager("tableSelection"),i;n.focus();t.hasFormat("table")&&u.getSelectedCells().length?(u.styleToSelectedCells(ic),i=t.getSelection(),i.collapse(!0),t.setSelection(i)):(ic(t),r.a.optimizeRange(t.getSelection(),"I"))}});rc=tc;uc=o.a.command("wysiwyg",{name:"Strike",keyMap:["CTRL+S","META+S"],exec:function(n){var t=n.getEditor(),u=n.componentManager.getManager("tableSelection"),i;n.focus();t.hasFormat("table")&&u.getSelectedCells().length?(u.styleToSelectedCells(fc),i=t.getSelection(),i.collapse(!0),t.setSelection(i)):(fc(t),r.a.optimizeRange(t.getSelection(),"S"))}});var yut=uc,put=o.a.command("wysiwyg",{name:"Blockquote",keyMap:["ALT+Q","ALT+Q"],exec:function(n){var t=n.getEditor();n.focus();t.hasFormat("TABLE")||t.hasFormat("PRE")||(t.hasFormat("BLOCKQUOTE")?t.decreaseQuoteLevel():t.increaseQuoteLevel())}}),wut=put,but=ft.decodeURIGraceful,kut=ft.encodeMarkdownCharacters,dut=o.a.command("wysiwyg",{name:"AddImage",exec:function(n,t){var u=n.getEditor(),i=t.altText,r=t.imageUrl;i=but(i);r=kut(r);n.focus();u.hasFormat("PRE")||u.insertImage(r,{alt:i})}}),gut=dut,nft=ft.decodeURIGraceful,tft=ft.encodeMarkdownCharacters,ift=o.a.command("wysiwyg",{name:"AddLink",exec:function(n,t){var i=n.getEditor(),e=n.getLinkAttribute(),r=t.url,u=t.linkText,h=n.componentManager.getManager("link"),o,s,f;u=nft(u);r=tft(r);n.focus();i.hasFormat("PRE")||(i.removeAllFormatting(),o=i.getSelectedText(),s=this._isSelectedImageOnly(i.getSelection()),o||s?i.makeLink(r,e):(f=i.createElement("A",b()({href:r},e)),f.textContent=u,i.insertElement(f)),h.addClassNameToImageLinksInSelection())},_isSelectedImageOnly:function(n){if(!n.collapsed){var t=n.startContainer,i=n.endContainer;if(t&&t===i)return r.a.isElemNode(t)&&t.firstChild.nodeName==="IMG"}return!1}}),rft=ift,uft=o.a.command("wysiwyg",{name:"HR",keyMap:["CTRL+L","META+L"],exec:function(n){var u=n.getEditor(),i=u.getSelection(),e;if(i.collapsed&&!u.hasFormat("TABLE")&&!u.hasFormat("PRE")){var f=document.createElement("hr"),o=r.a.getChildNodeByOffset(i.startContainer,i.startOffset),t=r.a.getTopNextNodeUnder(o,n.getBody());if(t&&!r.a.isTextNode(t))while(t&&t.getAttribute("contenteditable")==="false")t=t.nextSibling;t||(t=r.a.createEmptyLine(),r.a.append(n.getBody(),t));u.modifyBlocks(function(n){return n.appendChild(f),n});e=f.previousSibling;e&&r.a.isTextNode(e)&&r.a.getTextLength(e)===0&&f.parentNode.removeChild(e);f.parentNode.replaceChild(r.a.createHorizontalRule(),f);i.selectNodeContents(t);i.collapse(!0);u.setSelection(i);u.saveUndoState(i)}n.focus()}}),fft=uft,eft=o.a.command("wysiwyg",{name:"Heading",exec:function(n,t){var i=n.getEditor(),u="h1, h2, h3, h4, h5, h6, div";n.focus();i.hasFormat("TABLE")||i.hasFormat("PRE")||i.modifyBlocks(function(n){var i=r.a.children(n,u);return s()(i).forEach(function(n){var u="h"+t,i;r.a.getNodeName(n)==="DIV"?r.a.wrap(n,u):(i=document.createElement(u),r.a.insertBefore(i,n),i.innerHTML=n.innerHTML,r.a.remove(n))}),n})}}),oft=eft,sft=o.a.command("wysiwyg",{name:"Paragraph",exec:function(n){var t=n.getEditor();n.focus();t.hasFormat("TABLE")||t.hasFormat("PRE")||t.modifyBlocks(function(n){var t=document.createDocumentFragment();return s()(n.childNodes).forEach(function(n){n.nodeName.match(/h\d/i)?ec(t,n.children):n.nodeName.match(/ul|ol/i)?r.a.findAll(n,"li").forEach(function(n){ec(t,n.children)}):t.appendChild(n)}),t})}});var hft=sft,cft=o.a.command("wysiwyg",{name:"UL",keyMap:["CTRL+U","META+U"],exec:function(n){var o=n.getEditor(),t=o.getSelection(),i=n.componentManager.getManager("list"),s=t.startContainer,h=t.endContainer,c=t.startOffset,l=t.endOffset,r=[],f,u,e;if(n.focus(),o.saveUndoState(t),i.isAvailableMakeListInTable())r=i.createListInTable(t,"UL");else for(f=i.getLinesOfSelection(s,h),u=0;u<f.length;u+=1)e=this._changeFormatToUnorderedListIfNeed(n,f[u]),e&&r.push(e);r.length&&i.adjustRange(s,h,c,l,r)},_changeFormatToUnorderedListIfNeed:function(n,t){var i=n.getEditor(),r=i.getSelection(),f=n.componentManager.getManager("task"),u;return i.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),i.setSelection(r),i.hasFormat("LI")?(n.saveSelection(r),f.unformatTask(r.startContainer),i.replaceParent(r.startContainer,"ol","ul"),n.restoreSavedSelection()):(n.unwrapBlockTag(),i.makeUnorderedList()),u=i.getSelection().startContainer),u}}),lft=cft,aft=o.a.command("wysiwyg",{name:"OL",keyMap:["CTRL+O","META+O"],exec:function(n){var o=n.getEditor(),t=o.getSelection(),i=n.componentManager.getManager("list"),s=t.startContainer,c=t.startOffset,h=t.endContainer,l=t.endOffset,r=[],f,u,e;if(n.focus(),o.saveUndoState(t),i.isAvailableMakeListInTable())r=i.createListInTable(t,"OL");else for(f=i.getLinesOfSelection(s,h),u=0;u<f.length;u+=1)e=this._changeFormatToOrderedListIfNeed(n,f[u]),e&&r.push(e);r.length&&i.adjustRange(s,h,c,l,r)},_changeFormatToOrderedListIfNeed:function(n,t){var i=n.getEditor(),r=i.getSelection(),f=n.componentManager.getManager("task"),u;return i.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),i.setSelection(r),i.hasFormat("LI")?(n.saveSelection(r),f.unformatTask(r.startContainer),i.replaceParent(r.startContainer,"ul","ol"),n.restoreSavedSelection()):(n.unwrapBlockTag(),i.makeOrderedList()),u=i.getSelection().startContainer),u}}),vft=aft,yft=o.a.command("wysiwyg",{name:"Table",exec:function(n,t,i,r){var u=n.getEditor(),e=n.componentManager.getManager("table").getTableIDClassName(),f;if(!u.getSelection().collapsed||u.hasFormat("TABLE")||u.hasFormat("PRE")){n.focus();return}f='<table class="'+e+'">';f+=wft(t,r);f+=bft(t,i-1,r);f+="<\/table>";u.insertHTML(f);n.focus();r||pft(u,n.getBody().querySelector("."+e))}});oc=yft;sc=o.a.command("wysiwyg",{name:"AddRow",exec:function(n){var i=n.getEditor(),f=i.getSelection().cloneRange(),s=kft(n),t,u,e,c,o;if(n.focus(),i.hasFormat("TD")){for(i.saveUndoState(f),t=r.a.closest(f.startContainer,"tr"),e=0;e<s;e+=1)u=hc(t),r.a.insertAfter(u,t);cc(i,u)}else if(i.hasFormat("TH")){i.saveUndoState(f);t=r.a.closest(f.startContainer,"tr");var l=r.a.parents(t,"thead"),a=l[0],h=a.nextSibling;for(tt()(h,"tbody")&&(c=r.a.children(h,"tr"),t=c[0]),o=0;o<s;o+=1)u=hc(t),r.a.insertBefore(u,t);cc(i,u)}}});lc=sc;ac=o.a.command("wysiwyg",{name:"AddCol",exec:function(n){var t=n.getEditor(),r=t.getSelection().cloneRange(),u=dft(n),i;n.focus();t.hasFormat("TR")&&(t.saveUndoState(r),i=gft(r),net(i,u),tet(t,i))}});vc=ac;yc=o.a.command("wysiwyg",{name:"RemoveRow",exec:function(n){var t=n.getEditor(),i=t.getSelection().cloneRange(),c=r.a.parents(i.startContainer,"table"),e=c[0],o=n.componentManager.getManager("tableSelection"),l=n.componentManager.getManager("table"),u=ret(i,o,e),a=e.querySelectorAll("tbody tr").length;if(n.focus(),(t.hasFormat("TD")||t.hasFormat("TABLE"))&&a>1){t.saveUndoState(i);var s=u[0],f=u[u.length-1],h=f&&f.nextSibling?f.nextSibling:s&&s.previousSibling;h&&iet(t,i,h,l);u.forEach(function(n){return r.a.remove(n)})}o.removeClassAttrbuteFromAllCellsIfNeed()}});wc=yc;bc=o.a.command("wysiwyg",{name:"RemoveCol",exec:function(n){var u=n.getEditor(),t=u.getSelection().cloneRange(),c=r.a.parents(t.startContainer,"table"),l=c[0],a=n.componentManager.getManager("table"),v=n.componentManager.getManager("tableSelection"),y=r.a.closest(t.startContainer,"table").querySelectorAll("thead tr th").length>1,e,o,h,f;if(n.focus(),t.collapse(!0),u.setSelection(t),u.hasFormat("TR",null,t)&&y){var s=l.querySelectorAll("tbody tr"),p=s.length?s[0].querySelectorAll("td").length:0,i=v.getSelectedCells();i.length<p&&(u.saveUndoState(t),i.length>1?(o=i[i.length-1],h=i[0],e=o.nextSibling?o.nextSibling:h.previousSibling,fet(i)):(f=uet(t),e=f.nextSibling?f.nextSibling:f.previousSibling,kc(f)),eet(u,e,a))}}});dc=bc;gc=o.a.command("wysiwyg",{name:"AlignCol",exec:function(n,t){var i=n.getEditor(),u=i.getSelection().cloneRange(),f=n.componentManager.getManager("tableSelection"),o=het(u,f);if(n.focus(),i.hasFormat("TR")){i.saveUndoState(u);var s=r.a.parents(u.startContainer,"table"),e=s[0],h=set(e,o);oet(e,t,h)}f.removeClassAttrbuteFromAllCellsIfNeed()}});var cet=gc,aet=o.a.command("wysiwyg",{name:"RemoveTable",exec:function(n){var t=n.getEditor(),i=t.getSelection().cloneRange();t.hasFormat("TABLE")&&(t.saveUndoState(i),r.a.remove(r.a.closest(i.startContainer,"table")));n.focus()}}),vet=aet,yet=o.a.command("wysiwyg",{name:"Indent",exec:function(n){var c=n.componentManager.getManager("list"),l=n.getEditor().getSelection(),t=r.a.closest(l.startContainer,"li"),f,e,o,u=t&&t.previousSibling,i,h;u&&(i=t.querySelector("li"),n.getEditor().saveUndoState(),e=t.className,f=u.className,t.className="",u.className="",i&&(o=i.className,h=s()(i.children).filter(function(n){return tt()(n,"div")}),h.length||(i.className="")),n.getEditor().increaseListLevel(),c.mergeList(t),t.className=e,u.className=f,i&&(i.className=o))}}),pet=yet,wet=o.a.command("wysiwyg",{name:"Outdent",exec:function(n){var t=nl(n),i;t&&bet(t)&&(n.getEditor().saveUndoState(),i=t.className,n.getEditor().decreaseListLevel(),t=nl(n),t&&i&&(t.className=i))}});var ket=wet,det=o.a.command("wysiwyg",{name:"Task",keyMap:["ALT+T","ALT+T"],exec:function(n){var o=n.getEditor(),t=o.getSelection(),i=n.componentManager.getManager("list"),s=t.startContainer,h=t.endContainer,c=t.startOffset,l=t.endOffset,r=[],f,u,e;if(n.focus(),o.saveUndoState(t),i.isAvailableMakeListInTable())r=i.createListInTable(t,"TASK");else for(f=i.getLinesOfSelection(s,h),u=0;u<f.length;u+=1)e=this._changeFormatToTaskIfNeed(n,f[u]),e&&r.push(e);r.length&&i.adjustRange(s,h,c,l,r)},_changeFormatToTaskIfNeed:function(n,t){var i=n.getEditor(),r=i.getSelection(),u=n.componentManager.getManager("task"),f;return i.hasFormat("PRE")||(r.setStart(t,0),r.collapse(!0),i.setSelection(r),i.hasFormat("li")||(i.makeUnorderedList(),t=i.getSelection().startContainer),it()(t,"task-list-item")?u.unformatTask(t):u.formatTask(t),f=i.getSelection().startContainer),f}}),get=det,not=o.a.command("wysiwyg",{name:"Code",keyMap:["SHIFT+CTRL+C","SHIFT+META+C"],exec:function(n){var t=n.getEditor(),r=n.componentManager.getManager("tableSelection"),u=iot.bind(null,n.getEditor()),i;n.focus();t.hasFormat("table")&&r.getSelectedCells().length?(r.styleToSelectedCells(u),i=t.getSelection(),i.collapse(!0),t.setSelection(i)):u(t)}});var rot=not,wf="te-content-codeblock-temp",uot="data-te-codeblock",fot=o.a.command("wysiwyg",{name:"CodeBlock",keyMap:["SHIFT+CTRL+P","SHIFT+META+P"],exec:function(n,t){var i=n.getEditor(),f=i.getSelection().cloneRange(),r,u;i.hasFormat("PRE")||i.hasFormat("TABLE")||(r=uot+' class = "'+wf+'"',t&&(r+=' data-language="'+t+'"'),u=oot(f,n),i.insertHTML("<pre "+r+">"+u+"<\/pre>"),eot(n.getBody().querySelector("."+wf),n));n.focus()}});var sot=fot,hot=200,cot=15,pr=null,tl=null;var d=i(18),bt=i(24),lot=.5,bf=!1,kf=null;wr=!1;gf=null;var kot="tui-scrollsync",fl="tui-scrollsync active",br=!0;kr=!0;kt=[];st=function(){function t(n){var s=this,i;this.initialHtml=n.el.innerHTML;n.el.innerHTML="";this.options=b()({previewStyle:"tab",previewHighlight:!0,initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en-US",useDefaultHTMLSanitizer:!0,useCommandShortcut:!0,usageStatistics:!0,toolbarItems:["heading","bold","italic","strike","divider","hr","quote","divider","ul","ol","task","indent","outdent","divider","table","image","link","divider","code","codeblock"],hideModeSwitch:!1,linkAttribute:null,extendedAutolinks:!1,customConvertor:null,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1},n);this.codeBlockLanguages=[];this.eventManager=new rk.a;this.importManager=new ft(this.eventManager);this.commandManager=new o.a(this,{useCommandShortcut:this.options.useCommandShortcut});var h=Object(nu.c)(this.options.linkAttribute),r=Object(ah.a)(this.options.plugins),y=r.renderer,c=r.parser,l=r.plugins,t=this.options,p=t.customHTMLRenderer,w=t.customHTMLSanitizer,a=t.extendedAutolinks,v=t.referenceDefinition,k=t.useDefaultHTMLSanitizer,u=t.frontMatter,e={linkAttribute:h,customHTMLRenderer:dr({},y,p),extendedAutolinks:a,referenceDefinition:v,customParser:c,frontMatter:u,customProp:{showFrontMatter:u}};this.convertor=this.options.customConvertor?new this.options.customConvertor(this.eventManager,e):new ok.a(this.eventManager,e);i=w||(k?ti.a:null);i&&this.convertor.initHtmlSanitizer(i);this.options.hooks&&ut()(this.options.hooks,function(n,t){return s.addHook(t,n)});this.options.events&&ut()(this.options.events,function(n,t){return s.on(t,n)});this.layout=new ik(n,this.eventManager);this.i18n=f;this.i18n.setCode(this.options.language);this.setUI(this.options.UI||new ntt(this));this.toastMark=new gr.ToastMark("",{disallowedHtmlBlockTags:["br"],extendedAutolinks:a,referenceDefinition:v,disallowDeepHeading:!0,customParser:c,frontMatter:u});this.mdEditor=gv.factory(this.layout.getMdEditorContainerEl(),this.eventManager,this.toastMark,this.options);this.preview=new ny.a(this.layout.getPreviewEl(),this.eventManager,this.convertor,dr({},e,{isViewer:!1,highlight:this.options.previewHighlight}));this.wwEditor=gb.factory(this.layout.getWwEditorContainerEl(),this.eventManager,{sanitizer:i,linkAttribute:h});this.toMarkOptions={gfm:!0,renderer:utt};l&&Object(ah.b)(l,this);this.changePreviewStyle(this.options.previewStyle);this.changeMode(this.options.initialEditType,!0);this.minHeight(this.options.minHeight);this.height(this.options.height);this.setMarkdown(this.options.initialValue,!1);this.options.placeholder&&this.setPlaceholder(this.options.placeholder);this.options.initialValue||this.setHtml(this.initialHtml,!1);this.eventManager.emit("load",this);kt.push(this);this._addDefaultCommands();this.options.usageStatistics&&Object(nu.d)();tst(this)}var n=t.prototype;return n.changePreviewStyle=function(n){this.layout.changePreviewStyle(n);this.mdPreviewStyle=n;this.eventManager.emit("changePreviewStyle",n);this.eventManager.emit("previewNeedsRefresh",this.getMarkdown())},n.exec=function(){var n;(n=this.commandManager).exec.apply(n,arguments)},n._addDefaultCommands=function(){this.addCommand(ctt);this.addCommand(ktt);this.addCommand(uit);this.addCommand(bh);this.addCommand(hit);this.addCommand(lit);this.addCommand(bit);this.addCommand(trt);this.addCommand(rrt);this.addCommand(frt);this.addCommand(ort);this.addCommand(hrt);this.addCommand(vrt);this.addCommand(prt);this.addCommand(drt);this.addCommand(nut);this.addCommand(iit);this.addCommand(rut);this.addCommand(fut);this.addCommand(out);this.addCommand(hut);this.addCommand(aut);this.addCommand(nc);this.addCommand(rc);this.addCommand(wut);this.addCommand(lft);this.addCommand(vft);this.addCommand(gut);this.addCommand(rft);this.addCommand(fft);this.addCommand(oft);this.addCommand(hft);this.addCommand(pet);this.addCommand(ket);this.addCommand(get);this.addCommand(oc);this.addCommand(lc);this.addCommand(vc);this.addCommand(wc);this.addCommand(dc);this.addCommand(cet);this.addCommand(vet);this.addCommand(rot);this.addCommand(sot);this.addCommand(yut)},n.addCommand=function(n,t){t?this.commandManager.addCommand(o.a.command(n,t)):this.commandManager.addCommand(n)},n.afterAddedCommand=function(){this.eventManager.emit("afterAddedCommand",this)},n.on=function(n,t){this.eventManager.listen(n,t)},n.off=function(n){this.eventManager.removeEventHandler(n)},n.addHook=function(n,t){this.eventManager.removeEventHandler(n);this.eventManager.listen(n,t)},n.removeHook=function(n){this.eventManager.removeEventHandler(n)},n.getCodeMirror=function(){return this.mdEditor.getEditor()},n.getSquire=function(){return this.wwEditor.getEditor()},n.focus=function(){this.getCurrentModeEditor().focus()},n.blur=function(){this.getCurrentModeEditor().blur()},n.moveCursorToEnd=function(){this.getCurrentModeEditor().moveCursorToEnd()},n.moveCursorToStart=function(){this.getCurrentModeEditor().moveCursorToStart()},n.setMarkdown=function(n,t){t===void 0&&(t=!0);n=n||"";this.isMarkdownMode()?this.mdEditor.setValue(n,t):this.wwEditor.setValue(this.convertor.toHTML(n),t);this.eventManager.emit("setMarkdownAfter",n)},n.setHtml=function(n,t){if(t===void 0&&(t=!0),n=n||"",this.wwEditor.setValue(n,t),this.isMarkdownMode()){var i=this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions);this.mdEditor.setValue(i,t);this.eventManager.emit("setMarkdownAfter",i)}},n.getMarkdown=function(){return this.isMarkdownMode()?this.mdEditor.getValue():this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)},n.getHtml=function(){return this.isWysiwygMode()&&this.mdEditor.setValue(this.convertor.toMarkdown(this.wwEditor.getValue(),this.toMarkOptions)),this.convertor.toHTML(this.mdEditor.getValue())},n.insertText=function(n){this.isMarkdownMode()?this.mdEditor.replaceSelection(n):this.wwEditor.insertText(n)},n.addWidget=function(n,t,i,r){this.getCurrentModeEditor().addWidget(n,t,i,r)},n.height=function(n){if(hi()(n)){var t=this.options.el;n==="auto"?(l()(t,"auto-height"),this.minHeight(this.minHeight())):(h()(t,"auto-height"),this.minHeight(n));te()(n)&&(n=n+"px");e()(this.options.el,{height:n});this._height=n}return this._height},n.minHeight=function(n){if(hi()(n)){var t=this._ui.getEditorHeight(),i=this._ui.getEditorSectionHeight(),r=t-i;this._minHeight=n;n=parseInt(n,10);n=Math.max(n-r,0);this.wwEditor.setMinHeight(n);this.mdEditor.setMinHeight(n);this.preview.setMinHeight(n)}return this._minHeight},n.getCurrentModeEditor=function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor},n.isMarkdownMode=function(){return this.currentMode==="markdown"},n.isWysiwygMode=function(){return this.currentMode==="wysiwyg"},n.isViewer=function(){return!1},n.getCurrentPreviewStyle=function(){return this.mdPreviewStyle},n.changeMode=function(n,t){this.currentMode!==n&&(this.eventManager.emit("changeModeBefore",this.currentMode),this.currentMode=n,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",n),t||this.focus())},n.remove=function(){var t=this,n=kt.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(n,i){t.off(i)}),this.eventManager=null;n>=0;n-=1)kt[n]===this&&kt.splice(n,1)},n.hide=function(){this.eventManager.emit("hide",this)},n.show=function(){this.eventManager.emit("show",this);this.getCodeMirror().refresh()},n.scrollTop=function(n){return this.getCurrentModeEditor().scrollTop(n)},n.setUI=function(n){this._ui=n},n.getUI=function(){return this._ui},n.reset=function(){this.wwEditor.reset();this.mdEditor.reset()},n.getRange=function(){return this.getCurrentModeEditor().getRange()},n.getTextObject=function(n){return this.getCurrentModeEditor().getTextObject(n)},n.getSelectedText=function(){var n=this.getRange(),t=this.getTextObject(n);return t.getTextContent()||""},n.setPlaceholder=function(n){this.mdEditor.setPlaceholder(n);this.wwEditor.setPlaceholder(n)},n.setCodeBlockLanguages=function(n){var t=this;n===void 0&&(n=[]);n.forEach(function(n){t.codeBlockLanguages.indexOf(n)<0&&t.codeBlockLanguages.push(n)});this.eventManager.emit("setCodeBlockLanguages",this.codeBlockLanguages)},t.getInstances=function(){return kt},t.factory=function(n){return n.viewer?new sk.a(n):new t(n)},t.setLanguage=function(n,t){f.setLanguage(n,t)},t}();st._createMarkdownToHTML=wl;st.isViewer=!1;st.codeBlockManager=ttt.a;st.WwCodeBlockManager=lo;st.WwTableManager=eo;st.WwTableSelectionManager=oo;st.CommandManager=o.a;var ol=st,oht=i(50),sht=i(51),hht=i(41),cht=i(52);ol.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"});ust=t["default"]=ol}])["default"]})},,function(n,t,i){"use strict";i.r(t);var f=i(0),r=i.n(f),e=i(1),u=i.n(e);r.a.fn.toastuiEditor=function(){var n,t,i=this.get(0),s;if(i){for(var o=arguments.length,e=new Array(o),f=0;f<o;f++)e[f]=arguments[f];if(n=e[0]||{},t=r.a.data(i,"toastuiEditor"),t){if(typeof n=="string")return(s=t)[n].apply(s,e.slice(1))}else n.el=i,t=u.a.factory(n),r.a.data(i,"toastuiEditor",t)}return this};t["default"]=u.a},function(n){(function(t,i){n.exports=i()})(this,function(){"use strict";function gr(n){return new RegExp("(^|\\s)"+n+"(?:$|\\s)\\s*")}function pi(n){for(var t=n.childNodes.length;t>0;--t)n.removeChild(n.firstChild);return n}function ct(n,t){return pi(n).appendChild(t)}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),typeof t=="string")u.appendChild(document.createTextNode(t));else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function nu(n,t,r,u){var f=i(n,t,r,u);return f.setAttribute("role","presentation"),f}function wi(n,t){if(t.nodeType==3&&(t=t.parentNode),n.contains)return n.contains(t);do if(t.nodeType==11&&(t=t.host),t==n)return!0;while(t=t.parentNode)}function oi(){var n;try{n=document.activeElement}catch(t){n=document.body||null}while(n&&n.shadowRoot&&n.shadowRoot.activeElement)n=n.shadowRoot.activeElement;return n}function ur(n,t){var i=n.className;gr(t).test(i)||(n.className+=(i?" ":"")+t)}function ks(n,t){for(var r=n.split(" "),i=0;i<r.length;i++)r[i]&&!gr(r[i]).test(t)&&(t+=" "+r[i]);return t}function ds(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function fr(n,t,i){t||(t={});for(var r in n)n.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=n[r]);return t}function vt(n,t,i,r,u){var f,e,o;for(t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length)),f=r||0,e=u||0;;){if(o=n.indexOf("\t",f),o<0||o>=t)return e+(t-f);e+=o-f;e+=i-e%i;f=o+1}}function g(n,t){for(var i=0;i<n.length;++i)if(n[i]==t)return i;return-1}function nh(n,t,i){for(var f,e,r=0,u=0;;){if(f=n.indexOf("\t",r),f==-1&&(f=n.length),e=f-r,f==n.length||u+e>=t)return r+Math.min(e,t-u);if(u+=f-r,u+=i-u%i,r=f+1,u>=t)return r}}function th(n){while(lf.length<=n)lf.push(s(lf)+" ");return lf[n]}function s(n){return n[n.length-1]}function ro(n,t){for(var r=[],i=0;i<n.length;i++)r[i]=t(n[i],i);return r}function ok(n,t,i){for(var r=0,u=i(t);r<n.length&&i(n[r])<=u;)r++;n.splice(r,0,t)}function oa(){}function sa(n,t){var i;return Object.create?i=Object.create(n):(oa.prototype=n,i=new oa),t&&fr(t,i),i}function ih(n){return/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||ha.test(n))}function uo(n,t){return t?t.source.indexOf("\\w")>-1&&ih(n)?!0:t.test(n):ih(n)}function ca(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function rh(n){return n.charCodeAt(0)>=768&&la.test(n)}function aa(n,t,i){while((i<0?t>0:t<n.length)&&rh(n.charAt(t)))t+=i;return t}function af(n,t,i){for(var f=t>i?-1:1,u,r;;){if(t==i)return t;if(u=(t+i)/2,r=f<0?Math.ceil(u):Math.floor(u),r==t)return n(r)?t:i;n(r)?i=r:t=r+f}}function sk(n,t,i,r){var e,f,u;if(!n)return r(t,i,"ltr",0);for(e=!1,f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",f),e=!0);e||r(t,i,"ltr")}function vf(n,t,i){var f,r,u;for(ru=null,r=0;r<n.length;++r){if(u=n[r],u.from<t&&u.to>t)return r;u.to==t&&(u.from!=u.to&&i=="before"?f=r:ru=r);u.from==t&&(u.from!=u.to&&i!="before"?f=r:ru=r)}return f!=null?f:ru}function hi(n,t){var i=n.order;return i==null&&(i=n.order=va(n.text,t)),i}function fh(n,t){return n._handlers&&n._handlers[t]||uh}function lt(n,t,i){var u,r,f;n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent?n.detachEvent("on"+t,i):(u=n._handlers,r=u&&u[t],r&&(f=g(r,i),f>-1&&(u[t]=r.slice(0,f).concat(r.slice(f+1)))))}function p(n,t){var r=fh(n,t),u,i;if(r.length)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function w(n,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),p(n,i||t.type,n,t),eh(t)||t.codemirrorIgnore}function ya(n){var i=n._handlers&&n._handlers.cursorActivity,r,t;if(i)for(r=n.curOp.cursorActivityHandlers||(n.curOp.cursorActivityHandlers=[]),t=0;t<i.length;++t)g(r,i[t])==-1&&r.push(i[t])}function yt(n,t){return fh(n,t).length>0}function uu(n){n.prototype.on=function(n,t){r(this,n,t)};n.prototype.off=function(n,t){lt(this,n,t)}}function ft(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function pa(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function eh(n){return n.defaultPrevented!=null?n.defaultPrevented:n.returnValue==!1}function yf(n){ft(n);pa(n)}function oh(n){return n.target||n.srcElement}function wa(n){var t=n.which;return t==null&&(n.button&1?t=1:n.button&2?t=3:n.button&4&&(t=2)),at&&n.ctrlKey&&t==1&&(t=3),t}function hk(n){var t,r;return sh==null&&(t=i("span","​"),ct(n,i("span",[t,document.createTextNode("x")])),n.firstChild.offsetHeight!=0&&(sh=t.offsetWidth<=1&&t.offsetHeight>2&&!(e&&l<8))),r=sh?i("span","​"):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px"),r.setAttribute("cm-text",""),r}function ck(n){if(hh!=null)return hh;var i=ct(n,document.createTextNode("AخA")),t=tu(i,0,1).getBoundingClientRect(),r=tu(i,1,2).getBoundingClientRect();return(pi(n),!t||t.left==t.right)?!1:hh=r.right-t.right<3}function vk(n){if(lh!=null)return lh;var t=ct(n,i("span","x")),r=t.getBoundingClientRect(),u=tu(t,0,1).getBoundingClientRect();return lh=Math.abs(r.left-u.left)>1}function yk(n,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2));fo[n]=t}function pk(n,t){er[n]=t}function eo(n){if(typeof n=="string"&&er.hasOwnProperty(n))n=er[n];else if(n&&typeof n.name=="string"&&er.hasOwnProperty(n.name)){var t=er[n.name];typeof t=="string"&&(t={name:t});n=sa(t,n);n.name=t.name}else{if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(n))return eo("application/xml");if(typeof n=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(n))return eo("application/json")}return typeof n=="string"?{name:n}:n||{name:"null"}}function ah(n,t){var f,i,u,r,e;if(t=eo(t),f=fo[t.name],!f)return ah(n,"text/plain");if(i=f(n,t),or.hasOwnProperty(t.name)){u=or[t.name];for(r in u)u.hasOwnProperty(r)&&(i.hasOwnProperty(r)&&(i["_"+r]=i[r]),i[r]=u[r])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(e in t.modeProps)i[e]=t.modeProps[e];return i}function wk(n,t){var i=or.hasOwnProperty(n)?or[n]:or[n]={};fr(t,i)}function sr(n,t){var r,u,i;if(t===!0)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r}function vh(n,t){for(var i;n.innerMode;){if(i=n.innerMode(t),!i||i.mode==n)break;t=i.state;n=i.mode}return i||{mode:n,state:t}}function ka(n,t,i){return n.startState?n.startState(t,i):!0}function t(n,t){var i,r,u,f;if(t-=n.first,t<0||t>=n.size)throw new Error("There is no line "+(t+n.first)+" in the document.");for(i=n;!i.lines;)for(r=0;;++r){if(u=i.children[r],f=u.chunkSize(),t<f){i=u;break}t-=f}return i.lines[t]}function hr(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch));r==t.line&&(f=f.slice(t.ch));u.push(f);++r}),u}function yh(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function ni(n,t){var r=t-n.height,i;if(r)for(i=n;i;i=i.parent)i.height+=r}function c(n){var i,u,t,r;if(n.parent==null)return null;for(i=n.parent,u=g(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;;++r){if(t.children[r]==i)break;u+=t.children[r].chunkSize()}return u+i.first}function cr(n,t){var f=n.first,r,u,e,i,s,o;n:do{for(r=0;r<n.children.length;++r){if(u=n.children[r],e=u.height,t<e){n=u;continue n}t-=e;f+=u.chunkSize()}return f}while(!n.lines);for(i=0;i<n.lines.length;++i){if(s=n.lines[i],o=s.height,t<o)break;t-=o}return f+i}function pf(n,t){return t>=n.first&&t<n.first+n.size}function ph(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function n(t,i,r){if(r===void 0&&(r=null),!(this instanceof n))return new n(t,i,r);this.line=t;this.ch=i;this.sticky=r}function u(n,t){return n.line-t.line||n.ch-t.ch}function wh(n,t){return n.sticky==t.sticky&&u(n,t)==0}function bh(t){return n(t.line,t.ch)}function oo(n,t){return u(n,t)<0?t:n}function so(n,t){return u(n,t)<0?n:t}function da(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function f(i,r){if(r.line<i.first)return n(i.first,0);var u=i.first+i.size-1;return r.line>u?n(u,t(i,u).text.length):bk(r,t(i,r.line).text.length)}function bk(t,i){var r=t.ch;return r==null||r>i?n(t.line,i):r<0?n(t.line,0):t}function ga(n,t){for(var r=[],i=0;i<t.length;i++)r[i]=f(n,t[i]);return r}function nv(n,t,i,r){var u=[n.state.modeGen],f={},o,s,e;for(fv(n,t.text,n.doc.mode,i,function(n,t){return u.push(n,t)},f,r),o=i.state,s=function(r){i.baseTokens=u;var s=n.state.overlays[r],e=1,h=0;i.state=!0;fv(n,t.text,s.mode,i,function(n,t){for(var i=e,r,f;h<n;)r=u[e],r>n&&u.splice(e,1,n,u[e+1],r),e+=2,h=Math.min(n,r);if(t)if(s.opaque)u.splice(i,e-i,n,"overlay "+t),e=i+2;else for(;i<e;i+=2)f=u[i+1],u[i+1]=(f?f+" ":"")+"overlay "+t},f);i.state=o;i.baseTokens=null;i.baseTokenPos=1},e=0;e<n.state.overlays.length;++e)s(e);return{styles:u,classes:f.bgClass||f.textClass?f:null}}function tv(n,t,i){if(!t.styles||t.styles[0]!=n.state.modeGen){var r=bf(n,c(t)),u=t.text.length>n.options.maxHighlightLength&&sr(n.doc.mode,r.state),f=nv(n,t,r);u&&(r.state=u);t.stateAfter=r.save(!u);t.styles=f.styles;f.classes?t.styleClasses=f.classes:t.styleClasses&&(t.styleClasses=null);i===n.doc.highlightFrontier&&(n.doc.modeFrontier=Math.max(n.doc.modeFrontier,++n.doc.highlightFrontier))}return t.styles}function bf(n,i,r){var u=n.doc,o=n.display;if(!u.mode.startState)return new bt(u,!0,i);var e=kk(n,i,r),s=e>u.first&&t(u,e-1).stateAfter,f=s?bt.fromSaved(u,s,e):new bt(u,ka(u.mode),e);return u.iter(e,i,function(t){kh(n,t.text,f);var r=f.line;t.stateAfter=r==i-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?f.save():null;f.nextLine()}),r&&(u.modeFrontier=f.line),f}function kh(n,t,i,r){var f=n.doc.mode,u=new y(t,n.options.tabSize,i);for(u.start=u.pos=r||0,t==""&&iv(f,i.state);!u.eol();)dh(f,u,i.state),u.start=u.pos}function iv(n,t){if(n.blankLine)return n.blankLine(t);if(n.innerMode){var i=vh(n,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function dh(n,t,i,r){for(var f,u=0;u<10;u++)if(r&&(r[0]=vh(n,i).mode),f=n.token(t,i),t.pos>t.start)return f;throw new Error("Mode "+n.name+" failed to advance stream.");}function rv(n,i,r,u){var o=n.doc,l=o.mode,h;i=f(o,i);var a=t(o,i.line),s=bf(n,i.line,r),e=new y(a.text,n.options.tabSize,s),c;for(u&&(c=[]);(u||e.pos<i.ch)&&!e.eol();)e.start=e.pos,h=dh(l,e,s.state),u&&c.push(new gh(e,h,sr(o.mode,s.state)));return u?c:new gh(e,h,s.state)}function uv(n,t){var i,r;if(n)for(;;){if(i=n.match(/(?:^|\s+)line-(background-)?(\S+)/),!i)break;n=n.slice(0,i.index)+n.slice(i.index+i[0].length);r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return n}function fv(n,t,i,r,u,f,e){var c=i.flattenSpans,a,p;c==null&&(c=n.options.flattenSpans);var s=0,l=null,o=new y(t,n.options.tabSize,r),h,v=n.options.addModeClass&&[null];for(t==""&&uv(iv(i,r.state),f);!o.eol();){if(o.pos>n.options.maxHighlightLength?(c=!1,e&&kh(n,t,r,o.pos),o.pos=t.length,h=null):h=uv(dh(i,o,r.state,v),f),v&&(a=v[0].name,a&&(h="m-"+(h?a+" "+h:a))),!c||l!=h){while(s<o.start)s=Math.min(o.start,s+5e3),u(s,l);l=h}o.start=o.pos}while(s<o.pos)p=Math.min(o.pos,s+5e3),u(p,l),s=p}function kk(n,i,r){for(var s,e,h,c,o,f=n.doc,l=r?-1:i-(n.doc.mode.innerMode?1e3:100),u=i;u>l;--u){if(u<=f.first)return f.first;if(s=t(f,u-1),e=s.stateAfter,e&&(!r||u+(e instanceof wf?e.lookAhead:0)<=f.modeFrontier))return u;h=vt(s.text,null,n.options.tabSize);(o==null||c>h)&&(o=u-1,c=h)}return o}function dk(n,i){var u,r,f;if(n.modeFrontier=Math.min(n.modeFrontier,i),!(n.highlightFrontier<i-10)){for(u=n.first,r=i-1;r>u;r--)if(f=t(n,r).stateAfter,f&&(!(f instanceof wf)||r+f.lookAhead<i)){u=r+1;break}n.highlightFrontier=Math.min(n.highlightFrontier,u)}}function gk(){nc=!0}function nd(){ti=!0}function ho(n,t,i){this.marker=n;this.from=t;this.to=i}function kf(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function td(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function id(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t];t.marker.attachLine(n)}function rd(n,t,i){var e,u,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t);!s&&(r.from!=t||f.type!="bookmark"||i&&r.marker.insertLeft)||(o=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push(new ho(f,r.from,o?null:r.to)))}return e}function ud(n,t,i){var e,u,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t);(s||r.from==t&&f.type=="bookmark"&&(!i||r.marker.insertLeft))&&(o=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push(new ho(f,o?null:r.from-t,r.to==null?null:r.to-t)))}return e}function tc(n,i){var w,b,a,h,v,y,e,it,p,d,g,c,nt;if(i.full||(w=pf(n,i.from.line)&&t(n,i.from.line).markedSpans,b=pf(n,i.to.line)&&t(n,i.to.line).markedSpans,!w&&!b))return null;var k=i.from.ch,rt=i.to.ch,tt=u(i.from,i.to)==0,r=rd(w,k,tt),f=ud(b,rt,tt),o=i.text.length==1,l=s(i.text).length+(o?k:0);if(r)for(a=0;a<r.length;++a)h=r[a],h.to==null&&(v=kf(f,h.marker),v?o&&(h.to=v.to==null?null:v.to+l):h.to=k);if(f)for(y=0;y<f.length;++y)e=f[y],e.to!=null&&(e.to+=l),e.from==null?(it=kf(r,e.marker),it||(e.from=l,o&&(r||(r=[])).push(e))):(e.from+=l,o&&(r||(r=[])).push(e));if(r&&(r=ev(r)),f&&f!=r&&(f=ev(f)),p=[r],!o){if(d=i.text.length-2,d>0&&r)for(c=0;c<r.length;++c)r[c].to==null&&(g||(g=[])).push(new ho(r[c].marker,null,null));for(nt=0;nt<d;++nt)p.push(g);p.push(f)}return p}function ev(n){for(var i,t=0;t<n.length;++t)i=n[t],i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&n.splice(t--,1);return n.length?n:null}function fd(n,t,i){var r=null,o,h,c,f,s,e;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,i.readOnly&&(!r||g(r,i)==-1)&&(r||(r=[])).push(i)}),!r)return null;for(o=[{from:t,to:i}],h=0;h<r.length;++h)for(c=r[h],f=c.find(0),s=0;s<o.length;++s)if(e=o[s],!(u(e.to,f.from)<0)&&!(u(e.from,f.to)>0)){var l=[s,1],a=u(e.from,f.from),v=u(e.to,f.to);(a<0||!c.inclusiveLeft&&!a)&&l.push({from:e.from,to:f.from});(v>0||!c.inclusiveRight&&!v)&&l.push({from:f.to,to:e.to});o.splice.apply(o,l);s+=l.length-3}return o}function ov(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function sv(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function co(n){return n.inclusiveLeft?-1:0}function lo(n){return n.inclusiveRight?1:0}function ic(n,t){var r=n.lines.length-t.lines.length,i;if(r!=0)return r;var f=n.find(),e=t.find(),o=u(f.from,e.from)||co(n)-co(t);return o?-o:(i=u(f.to,e.to)||lo(n)-lo(t),i)?i:t.id-n.id}function hv(n,t){var f=ti&&n.markedSpans,r,i,u;if(f)for(i=void 0,u=0;u<f.length;++u)i=f[u],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||ic(r,i.marker)<0)&&(r=i.marker);return r}function cv(n){return hv(n,!0)}function ao(n){return hv(n,!1)}function ed(n,t){var f=ti&&n.markedSpans,r,u,i;if(f)for(u=0;u<f.length;++u)i=f[u],i.marker.collapsed&&(i.from==null||i.from<t)&&(i.to==null||i.to>t)&&(!r||ic(r,i.marker)<0)&&(r=i.marker);return r}function lv(n,i,r,f,e){var v=t(n,i),l=ti&&v.markedSpans,h,o;if(l)for(h=0;h<l.length;++h)if(o=l[h],o.marker.collapsed){var s=o.marker.find(0),c=u(s.from,r)||co(o.marker)-co(e),a=u(s.to,f)||lo(o.marker)-lo(e);if((!(c>=0)||!(a<=0))&&(!(c<=0)||!(a>=0))&&(c<=0&&(o.marker.inclusiveRight&&e.inclusiveLeft?u(s.to,r)>=0:u(s.to,r)>0)||c>=0&&(o.marker.inclusiveRight&&e.inclusiveLeft?u(s.from,f)<=0:u(s.from,f)<0)))return!0}}function ii(n){for(var t;t=cv(n);)n=t.find(-1,!0).line;return n}function od(n){for(var t;t=ao(n);)n=t.find(1,!0).line;return n}function sd(n){for(var i,t;i=ao(n);)n=i.find(1,!0).line,(t||(t=[])).push(n);return t}function rc(n,i){var r=t(n,i),u=ii(r);return r==u?i:c(u)}function av(n,i){if(i>n.lastLine())return i;var r=t(n,i),u;if(!bi(n,r))return i;while(u=ao(r))r=u.find(1,!0).line;return c(r)+1}function bi(n,t){var u=ti&&t.markedSpans,i,r;if(u)for(i=void 0,r=0;r<u.length;++r)if(i=u[r],i.marker.collapsed){if(i.from==null)return!0;if(!i.marker.widgetNode&&i.from==0&&i.marker.inclusiveLeft&&uc(n,t,i))return!0}}function uc(n,t,i){var f,r,u;if(i.to==null)return f=i.marker.find(1,!0),uc(n,f.line,kf(f.line.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(r=void 0,u=0;u<t.markedSpans.length;++u)if(r=t.markedSpans[u],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&uc(n,t,r))return!0}function ci(n){var r,t,u,e,i,f,o;for(n=ii(n),r=0,t=n.parent,u=0;u<t.lines.length;++u)if(e=t.lines[u],e==n)break;else r+=e.height;for(i=t.parent;i;t=i,i=t.parent)for(f=0;f<i.children.length;++f)if(o=i.children[f],o==t)break;else r+=o.height;return r}function vo(n){var i,r,t,u,f;if(n.height==0)return 0;for(i=n.text.length,t=n;r=cv(t);)u=r.find(0,!0),t=u.from.line,i+=u.from.ch-u.to.ch;for(t=n;r=ao(t);)f=r.find(0,!0),i-=t.text.length-f.from.ch,t=f.to.line,i+=t.text.length-f.to.ch;return i}function fc(n){var i=n.display,r=n.doc;i.maxLine=t(r,r.first);i.maxLineLength=vo(i.maxLine);i.maxLineChanged=!0;r.iter(function(n){var t=vo(n);t>i.maxLineLength&&(i.maxLineLength=t,i.maxLine=n)})}function hd(n,t,i,r){n.text=t;n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null);n.order!=null&&(n.order=null);ov(n);sv(n,i);var u=r?r(n):1;u!=n.height&&ni(n,u)}function cd(n){n.parent=null;ov(n)}function pv(n,t){if(!n||/^\s*$/.test(n))return null;var i=t.addModeClass?yv:vv;return i[n]||(i[n]=n.replace(/\S+/g,"cm-$&"))}function wv(n,t){var o=nu("span",null,null,it?"padding-right: .1px":null),i={pre:nu("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:n,trailingSpace:!1,splitSpaces:n.getOption("lineWrapping")},u,r,e,s,f;for(t.measure={},u=0;u<=(t.rest?t.rest.length:0);u++)r=u?t.rest[u-1]:t.line,e=void 0,i.pos=0,i.addToken=ad,ck(n.display.measure)&&(e=hi(r,n.doc.direction))&&(i.addToken=yd(i.addToken,e)),i.map=[],s=t!=n.display.externalMeasured&&c(r),pd(r,i,tv(n,r,s)),r.styleClasses&&(r.styleClasses.bgClass&&(i.bgClass=ks(r.styleClasses.bgClass,i.bgClass||"")),r.styleClasses.textClass&&(i.textClass=ks(r.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(hk(n.display.measure))),u==0?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}));return it&&(f=i.content.lastChild,(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")),p(n,"renderLine",n,t.line,i.pre),i.pre.className&&(i.textClass=ks(i.pre.className,i.textClass||"")),i}function ld(n){var t=i("span","•","cm-invalidchar");return t.title="\\u"+n.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ad(n,t,r,u,f,o,s){var v,c,y,w,a,g,nt,b,tt,p;if(t){var k=n.splitSpaces?vd(t,n.trailingSpace):t,d=n.cm.state.specialChars,it=!1,h;if(d.test(t))for(h=document.createDocumentFragment(),v=0;;){if(d.lastIndex=v,c=d.exec(t),y=c?c.index-v:t.length-v,y&&(w=document.createTextNode(k.slice(v,v+y)),e&&l<9?h.appendChild(i("span",[w])):h.appendChild(w),n.map.push(n.pos,n.pos+y,w),n.col+=y,n.pos+=y),!c)break;v+=y+1;a=void 0;c[0]=="\t"?(g=n.cm.options.tabSize,nt=g-n.col%g,a=h.appendChild(i("span",th(nt),"cm-tab")),a.setAttribute("role","presentation"),a.setAttribute("cm-text","\t"),n.col+=nt):c[0]=="\r"||c[0]=="\n"?(a=h.appendChild(i("span",c[0]=="\r"?"␍":"␤","cm-invalidchar")),a.setAttribute("cm-text",c[0]),n.col+=1):(a=n.cm.options.specialCharPlaceholder(c[0]),a.setAttribute("cm-text",c[0]),e&&l<9?h.appendChild(i("span",[a])):h.appendChild(a),n.col+=1);n.map.push(n.pos,n.pos+1,a);n.pos++}else n.col+=t.length,h=document.createTextNode(k),n.map.push(n.pos,n.pos+t.length,h),e&&l<9&&(it=!0),n.pos+=t.length;if(n.trailingSpace=k.charCodeAt(t.length-1)==32,r||u||f||it||o||s){if(b=r||"",u&&(b+=u),f&&(b+=f),tt=i("span",[h],b,o),s)for(p in s)s.hasOwnProperty(p)&&p!="style"&&p!="class"&&tt.setAttribute(p,s[p]);return n.content.appendChild(tt)}n.content.appendChild(h)}}function vd(n,t){var u,f,i,r;if(n.length>1&&!/  /.test(n))return n;for(u=t,f="",i=0;i<n.length;i++)r=n.charAt(i),r==" "&&u&&(i==n.length-1||n.charCodeAt(i+1)==32)&&(r=" "),f+=r,u=r==" ";return f}function yd(n,t){return function(i,r,u,f,e,o,s){var c,a,h,l;for(u=u?u+" cm-force-border":"cm-force-border",c=i.pos,a=c+r.length;;){for(h=void 0,l=0;l<t.length;l++)if(h=t[l],h.to>c&&h.from<=c)break;if(h.to>=a)return n(i,r,u,f,e,o,s);n(i,r.slice(0,h.to-c),u,f,null,o,s);f=null;r=r.slice(h.to-c);c=h.to}}}function bv(n,t,i,r){var u=!r&&i.widgetNode;u&&n.map.push(n.pos,n.pos+t,u);!r&&n.cm.display.input.needsContentAttribute&&(u||(u=n.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",i.id));u&&(n.cm.display.input.setUneditable(u),n.content.appendChild(u));n.pos+=t;n.trailingSpace=!1}function pd(n,t,i){var it=n.markedSpans,rt=n.text,p=0,a,d,h,g,f,u,et,y,nt,l,tt,ot;if(!it){for(a=1;a<i.length;a+=2)t.addToken(t,rt.slice(p,p=i[a]),pv(i[a+1],t.cm.options));return}for(var ut=rt.length,r=0,st=1,s="",ft,v,o=0,w,b,k,e,c;;){if(o==r){for(w=b=k=v="",c=null,e=null,o=Infinity,d=[],h=void 0,g=0;g<it.length;++g)if(f=it[g],u=f.marker,u.type=="bookmark"&&f.from==r&&u.widgetNode)d.push(u);else if(f.from<=r&&(f.to==null||f.to>r||u.collapsed&&f.to==r&&f.from==r)){if(f.to!=null&&f.to!=r&&o>f.to&&(o=f.to,b=""),u.className&&(w+=" "+u.className),u.css&&(v=(v?v+";":"")+u.css),u.startStyle&&f.from==r&&(k+=" "+u.startStyle),u.endStyle&&f.to==o&&(h||(h=[])).push(u.endStyle,f.to),u.title&&((c||(c={})).title=u.title),u.attributes)for(et in u.attributes)(c||(c={}))[et]=u.attributes[et];u.collapsed&&(!e||ic(e.marker,u)<0)&&(e=f)}else f.from>r&&o>f.from&&(o=f.from);if(h)for(y=0;y<h.length;y+=2)h[y+1]==o&&(b+=" "+h[y]);if(!e||e.from==r)for(nt=0;nt<d.length;++nt)bv(t,0,d[nt]);if(e&&(e.from||0)==r){if(bv(t,(e.to==null?ut+1:e.to)-r,e.marker,e.from==null),e.to==null)return;e.to==r&&(e=!1)}}if(r>=ut)break;for(l=Math.min(ut,o);;){if(s){if(tt=r+s.length,e||(ot=tt>l?s.slice(0,l-r):s,t.addToken(t,ot,ft?ft+w:w,k,r+ot.length==o?b:"",v,c)),tt>=l){s=s.slice(l-r);r=l;break}r=tt;k=""}s=rt.slice(p,p=i[st++]);ft=pv(i[st++],t.cm.options)}}}function kv(n,t,i){this.line=t;this.rest=sd(t);this.size=this.rest?c(s(this.rest))-i+1:1;this.node=this.text=null;this.hidden=bi(n,t)}function yo(n,i,r){for(var f,e=[],o,u=i;u<r;u=o)f=new kv(n.doc,t(n.doc,u),u),o=u+f.size,e.push(f);return e}function wd(n){ar?ar.ops.push(n):n.ownsGroup=ar={ops:[n],delayedCallbacks:[]}}function bd(n){var u=n.delayedCallbacks,i=0,r,t;do{for(;i<u.length;i++)u[i].call(null);for(r=0;r<n.ops.length;r++)if(t=n.ops[r],t.cursorActivityHandlers)while(t.cursorActivityCalled<t.cursorActivityHandlers.length)t.cursorActivityHandlers[t.cursorActivityCalled++].call(null,t.cm)}while(i<u.length)}function kd(n,t){var i=n.ownsGroup;if(i)try{bd(i)}finally{ar=null;t(i)}}function d(n,t){var u=fh(n,t),f,i,e,r;if(u.length)for(f=Array.prototype.slice.call(arguments,2),ar?i=ar.delayedCallbacks:fu?i=fu:(i=fu=[],setTimeout(dd,0)),e=function(n){i.push(function(){return u[n].apply(null,f)})},r=0;r<u.length;++r)e(r)}function dd(){var t=fu,n;for(fu=null,n=0;n<t.length;++n)t[n]()}function dv(n,t,i,r){for(var u,f=0;f<t.changes.length;f++)u=t.changes[f],u=="text"?ng(n,t):u=="gutter"?ny(n,t,i,r):u=="class"?ec(n,t):u=="widget"&&tg(n,t,r);t.changes=null}function df(n){return n.node==n.text&&(n.node=i("div",null,null,"position: relative"),n.text.parentNode&&n.text.parentNode.replaceChild(n.node,n.text),n.node.appendChild(n.text),e&&l<8&&(n.node.style.zIndex=2)),n.node}function gd(n,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass,u;r&&(r+=" CodeMirror-linebackground");t.background?r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null):r&&(u=df(t),t.background=u.insertBefore(i("div",null,r),u.firstChild),n.display.input.setUneditable(t.background))}function gv(n,t){var i=n.display.externalMeasured;return i&&i.line==t.line?(n.display.externalMeasured=null,t.measure=i.measure,i.built):wv(n,t)}function ng(n,t){var r=t.text.className,i=gv(n,t);t.text==t.node&&(t.node=i.pre);t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ec(n,t)):r&&(t.text.className=r)}function ec(n,t){gd(n,t);t.line.wrapClass?df(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ny(n,t,r,u){var c,f,l,e,s,o,h;if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(c=df(t),t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px; width: "+u.gutterTotalWidth+"px"),n.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)),f=t.line.gutterMarkers,(n.options.lineNumbers||f)&&(l=df(t),e=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),n.display.input.setUneditable(e),l.insertBefore(e,t.text),t.line.gutterClass&&(e.className+=" "+t.line.gutterClass),!n.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(t.lineNumber=e.appendChild(i("div",ph(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+n.display.lineNumInnerWidth+"px"))),f))for(s=0;s<n.display.gutterSpecs.length;++s)o=n.display.gutterSpecs[s].className,h=f.hasOwnProperty(o)&&f[o],h&&e.appendChild(i("div",[h],"CodeMirror-gutter-elt","left: "+u.gutterLeft[o]+"px; width: "+u.gutterWidth[o]+"px"))}function tg(n,t,i){var f,r,u;for(t.alignable&&(t.alignable=null),f=gr("CodeMirror-linewidget"),r=t.node.firstChild,u=void 0;r;r=u)u=r.nextSibling,f.test(r.className)&&t.node.removeChild(r);ty(n,t,i)}function ig(n,t,i,r){var u=gv(n,t);return t.text=t.node=u.pre,u.bgClass&&(t.bgClass=u.bgClass),u.textClass&&(t.textClass=u.textClass),ec(n,t),ny(n,t,i,r),ty(n,t,r),t.node}function ty(n,t,i){if(iy(n,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)iy(n,t.rest[r],t,i,!1)}function iy(n,t,r,u,f){var h,s,c,e,o;if(t.widgets)for(h=df(r),s=0,c=t.widgets;s<c.length;++s)e=c[s],o=i("div",[e.node],"CodeMirror-linewidget"+(e.className?" "+e.className:"")),e.handleMouseEvents||o.setAttribute("cm-ignore-events","true"),rg(e,o,r,u),n.display.input.setUneditable(o),f&&e.above?h.insertBefore(o,r.gutter||r.text):h.appendChild(o),d(e,"redraw")}function rg(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px";n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px");t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function gf(n){var t,r;return n.height!=null?n.height:(t=n.doc.cm,!t)?0:(wi(document.body,n.node)||(r="position: relative;",n.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),n.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),ct(t.display.measure,i("div",[n.node],null,r))),n.height=n.node.parentNode.offsetHeight)}function li(n,t){for(var i=oh(t);i!=n.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==n.sizer&&i!=n.mover)return!0}function po(n){return n.lineSpace.offsetTop}function oc(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function ry(n){if(n.cachedPaddingH)return n.cachedPaddingH;var r=ct(n.measure,i("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,t={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return isNaN(t.left)||isNaN(t.right)||(n.cachedPaddingH=t),t}function ri(n){return ea-n.display.nativeBarWidth}function vr(n){return n.display.scroller.clientWidth-ri(n)-n.display.barWidth}function sc(n){return n.display.scroller.clientHeight-ri(n)-n.display.barHeight}function ug(n,t,i){var f=n.options.lineWrapping,h=f&&vr(n),e,u,r,o,s;if(!t.measure.heights||f&&t.measure.width!=h){if(e=t.measure.heights=[],f)for(t.measure.width=h,u=t.text.firstChild.getClientRects(),r=0;r<u.length-1;r++)o=u[r],s=u[r+1],Math.abs(o.bottom-s.bottom)>2&&e.push((o.bottom+s.top)/2-i.top);e.push(i.bottom-i.top)}}function uy(n,t,i){var r,u;if(n.line==t)return{map:n.measure.map,cache:n.measure.cache};for(r=0;r<n.rest.length;r++)if(n.rest[r]==t)return{map:n.measure.maps[r],cache:n.measure.caches[r]};for(u=0;u<n.rest.length;u++)if(c(n.rest[u])>i)return{map:n.measure.maps[u],cache:n.measure.caches[u],before:!0}}function fg(n,t){var r,i,u;return t=ii(t),r=c(t),i=n.display.externalMeasured=new kv(n.doc,t,r),i.lineN=r,u=i.built=wv(n,i),i.text=u.pre,ct(n.display.lineMeasure,u.pre),i}function fy(n,t,i,r){return ui(n,eu(n,t),i,r)}function hc(n,t){if(t>=n.display.viewFrom&&t<n.display.viewTo)return n.display.view[wr(n,t)];var i=n.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function eu(n,t){var u=c(t),i=hc(n,u),r;return i&&!i.text?i=null:i&&i.changes&&(dv(n,i,u,wc(n)),n.curOp.forceUpdate=!0),i||(i=fg(n,t)),r=uy(i,t,u),{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ui(n,t,i,r,u){t.before&&(i=-1);var e=i+(r||""),f;return t.cache.hasOwnProperty(e)?f=t.cache[e]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ug(n,t.view,t.rect),t.hasHeights=!0),f=og(n,t,i,r),f.bogus||(t.cache[e]=f)),{left:f.left,right:f.right,top:u?f.rtop:f.top,bottom:u?f.rbottom:f.bottom}}function ey(n,t,i){for(var s,u,h,o,e,f,r=0;r<n.length;r+=3)if(e=n[r],f=n[r+1],t<e?(u=0,h=1,o="left"):t<f?(u=t-e,h=u+1):(r==n.length-3||t==f&&n[r+3]>t)&&(h=f-e,u=h-1,t>=f&&(o="right")),u!=null){if(s=n[r+2],e==f&&i==(s.insertLeft?"left":"right")&&(o=i),i=="left"&&u==0)while(r&&n[r-2]==n[r-3]&&n[r-1].insertLeft)s=n[(r-=3)+2],o="left";if(i=="right"&&u==f-e)while(r<n.length-3&&n[r+3]==n[r+4]&&!n[r+5].insertLeft)s=n[(r+=3)+2],o="right";break}return{node:s,start:u,end:h,collapse:o,coverStart:e,coverEnd:f}}function eg(n,t){var i=cc,r,u;if(t=="left"){for(r=0;r<n.length;r++)if((i=n[r]).left!=i.right)break}else for(u=n.length-1;u>=0;u--)if((i=n[u]).left!=i.right)break;return i}function og(n,t,i,r){var o=ey(t.map,i,r),s=o.node,f=o.start,h=o.end,v=o.collapse,u,w,b,c;if(s.nodeType==3){for(w=0;w<4;w++){while(f&&rh(t.line.text.charAt(o.coverStart+f)))--f;while(o.coverStart+h<o.coverEnd&&rh(t.line.text.charAt(o.coverStart+h)))++h;if(u=e&&l<9&&f==0&&h==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():eg(tu(s,f,h).getClientRects(),r),u.left||u.right||f==0)break;h=f;f=f-1;v="right"}e&&l<11&&(u=sg(n.display.measure,u))}else f>0&&(v=r="right"),u=n.options.lineWrapping&&(b=s.getClientRects()).length>1?b[r=="right"?b.length-1:0]:s.getBoundingClientRect();e&&l<9&&!f&&(!u||!u.left&&!u.right)&&(c=s.parentNode.getClientRects()[0],u=c?{left:c.left,right:c.left+su(n.display),top:c.top,bottom:c.bottom}:cc);for(var k=u.top-t.rect.top,d=u.bottom-t.rect.top,g=(k+d)/2,y=t.view.measure.heights,a=0;a<y.length-1;a++)if(g<y[a])break;var nt=a?y[a-1]:0,tt=y[a],p={left:(v=="right"?u.right:u.left)-t.rect.left,right:(v=="left"?u.left:u.right)-t.rect.left,top:nt,bottom:tt};return u.left||u.right||(p.bogus=!0),n.options.singleCursorHeightPerLine||(p.rtop=k,p.rbottom=d),p}function sg(n,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vk(n))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function oy(n){if(n.measure&&(n.measure.cache={},n.measure.heights=null,n.rest))for(var t=0;t<n.rest.length;t++)n.measure.caches[t]={}}function sy(n){n.display.externalMeasure=null;pi(n.display.lineMeasure);for(var t=0;t<n.display.view.length;t++)oy(n.display.view[t])}function ne(n){sy(n);n.display.cachedCharWidth=n.display.cachedTextHeight=n.display.cachedPaddingH=null;n.options.lineWrapping||(n.display.maxLineChanged=!0);n.display.lineNumChars=null}function hy(){return ge&&no?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cy(){return ge&&no?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function lc(n){var i=0,t;if(n.widgets)for(t=0;t<n.widgets.length;++t)n.widgets[t].above&&(i+=gf(n.widgets[t]));return i}function wo(n,t,i,r,u){var e,f,o,s;return(u||(e=lc(t),i.top+=e,i.bottom+=e),r=="line")?i:(r||(r="local"),f=ci(t),r=="local"?f+=po(n.display):f-=n.display.viewOffset,(r=="page"||r=="window")&&(o=n.display.lineSpace.getBoundingClientRect(),f+=o.top+(r=="window"?0:cy()),s=o.left+(r=="window"?0:hy()),i.left+=s,i.right+=s),i.top+=f,i.bottom+=f,i)}function ly(n,t,i){var r,u,f,e;return i=="div"?t:(r=t.left,u=t.top,i=="page"?(r-=hy(),u-=cy()):i!="local"&&i||(f=n.display.sizer.getBoundingClientRect(),r+=f.left,u+=f.top),e=n.display.lineSpace.getBoundingClientRect(),{left:r-e.left,top:u-e.top})}function ac(n,i,r,u,f){return u||(u=t(n.doc,i.line)),wo(n,u,fy(n,u,i.ch,f),r)}function kt(n,i,r,u,f,e){function c(t,i){var o=ui(n,f,t,i?"right":"left",e);return i?o.left=o.right:o.right=o.left,wo(n,u,o,r)}function l(n,t,i){var r=h[t],u=r.level==1;return c(i?n-1:n,u!=i)}u=u||t(n.doc,i.line);f||(f=eu(n,u));var h=hi(u,n.doc.direction),o=i.ch,s=i.sticky;if(o>=u.text.length?(o=u.text.length,s="before"):o<=0&&(o=0,s="after"),!h)return c(s=="before"?o-1:o,s=="before");var y=vf(h,o,s),a=ru,v=l(o,y,s=="before");return a!=null&&(v.other=l(o,a,s!="before")),v}function ay(n,i){var r=0,u,e;return i=f(n.doc,i),n.options.lineWrapping||(r=su(n.display)*i.ch),u=t(n.doc,i.line),e=ci(u)+po(n.display),{left:r,right:r,top:e,bottom:e+u.height}}function vc(t,i,r,u,f){var e=n(t,i,r);return e.xRel=f,u&&(e.outside=u),e}function yc(n,i,r){var u=n.doc,f,h,o,e,c,s;if(r+=n.display.viewOffset,r<0)return vc(u.first,0,null,-1,-1);if(f=cr(u,r),h=u.first+u.size-1,f>h)return vc(u.first+u.size-1,t(u,h).text.length,null,1,1);for(i<0&&(i=0),o=t(u,f);;){if(e=hg(n,o,f,i,r),c=ed(o,e.ch+(e.xRel>0||e.outside>0?1:0)),!c)return e;if(s=c.find(1),s.line==f)return s;o=t(u,f=s.line)}}function vy(n,t,i,r){r-=lc(t);var u=t.text.length,f=af(function(t){return ui(n,i,t-1).bottom<=r},u,0);return u=af(function(t){return ui(n,i,t).top>r},f,u),{begin:f,end:u}}function yy(n,t,i,r){i||(i=eu(n,t));var u=wo(n,t,ui(n,i,r),"line").top;return vy(n,t,i,u)}function pc(n,t,i,r){return n.bottom<=i?!1:n.top>i?!0:(r?n.left:n.right)>t}function hg(t,i,r,u,f){var s,b,k,a;f-=ci(i);var c=eu(t,i),v=lc(i),y=0,p=i.text.length,o=!0,d=hi(i,t.doc.direction);d&&(s=(t.options.lineWrapping?lg:cg)(t,i,r,c,d,u,f),o=s.level!=1,y=o?s.from:s.to-1,p=o?s.to:s.from-1);var g=null,h=null,e=af(function(n){var i=ui(t,c,n);return(i.top+=v,i.bottom+=v,!pc(i,u,f,!1))?!1:(i.top<=f&&i.left<=u&&(g=n,h=i),!0)},y,p),w,l,nt=!1;return h?(b=u-h.left<h.right-u,k=b==o,e=g+(k?0:1),l=k?"after":"before",w=b?h.left:h.right):(o||e!=p&&e!=y||e++,l=e==0?"after":e==i.text.length?"before":ui(t,c,e-(o?1:0)).bottom+v<=f==o?"after":"before",a=kt(t,n(r,e,l),"line",i,c),w=a.left,nt=f<a.top?-1:f>=a.bottom?1:0),e=aa(i.text,e,1),vc(r,e,l,nt,u-w)}function cg(t,i,r,u,f,e,o){var h=af(function(s){var h=f[s],c=h.level!=1;return pc(kt(t,n(r,c?h.to:h.from,c?"before":"after"),"line",i,u),e,o,!0)},0,f.length-1),s=f[h],c,l;return h>0&&(c=s.level!=1,l=kt(t,n(r,c?s.from:s.to,c?"after":"before"),"line",i,u),pc(l,e,o,!0)&&l.top>o&&(s=f[h-1])),s}function lg(n,t,i,r,u,f,e){var y=vy(n,t,r,e),c=y.begin,h=y.end,o,a,l,s;for(/\s/.test(t.text.charAt(h-1))&&h--,o=null,a=null,l=0;l<u.length;l++)if(s=u[l],!(s.from>=h)&&!(s.to<=c)){var w=s.level!=1,v=ui(n,r,w?Math.min(h,s.to)-1:Math.max(c,s.from)).right,p=v<f?f-v+1e9:v-f;(!o||a>p)&&(o=s,a=p)}return o||(o=u[u.length-1]),o.from<c&&(o={from:c,to:o.to,level:o.level}),o.to>h&&(o={from:o.from,to:h,level:o.level}),o}function ou(n){var r,t;if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(yr==null){for(yr=i("pre",null,"CodeMirror-line-like"),r=0;r<49;++r)yr.appendChild(document.createTextNode("x")),yr.appendChild(i("br"));yr.appendChild(document.createTextNode("x"))}return ct(n.measure,yr),t=yr.offsetHeight/50,t>3&&(n.cachedTextHeight=t),pi(n.measure),t||1}function su(n){var r,f,u,t;return n.cachedCharWidth!=null?n.cachedCharWidth:(r=i("span","xxxxxxxxxx"),f=i("pre",[r],"CodeMirror-line-like"),ct(n.measure,f),u=r.getBoundingClientRect(),t=(u.right-u.left)/10,t>2&&(n.cachedCharWidth=t),t||10)}function wc(n){for(var r,i=n.display,u={},f={},o=i.gutters.clientLeft,t=i.gutters.firstChild,e=0;t;t=t.nextSibling,++e)r=n.display.gutterSpecs[e].className,u[r]=t.offsetLeft+t.clientLeft+o,f[r]=t.clientWidth;return{fixedPos:bc(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function bc(n){return n.scroller.getBoundingClientRect().left-n.sizer.getBoundingClientRect().left}function py(n){var t=ou(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/su(n.display)-3);return function(u){var e,f;if(bi(n.doc,u))return 0;if(e=0,u.widgets)for(f=0;f<u.widgets.length;f++)u.widgets[f].height&&(e+=u.widgets[f].height);return i?e+(Math.ceil(u.text.length/r)||1)*t:e+t}}function kc(n){var t=n.doc,i=py(n);t.iter(function(n){var t=i(n);t!=n.height&&ni(n,t)})}function pr(i,r,u,f){var a=i.display,s,c,h,e,o,l;if(!u&&oh(r).getAttribute("cm-not-content")=="true")return null;h=a.lineSpace.getBoundingClientRect();try{s=r.clientX-h.left;c=r.clientY-h.top}catch(v){return null}return e=yc(i,s,c),f&&e.xRel>0&&(o=t(i.doc,e.line).text).length==e.ch&&(l=vt(o,o.length,i.options.tabSize)-o.length,e=n(e.line,Math.max(0,Math.round((s-ry(i.display).left)/su(i.display))-l))),e}function wr(n,t){var r,i;if(t>=n.display.viewTo||(t-=n.display.viewFrom,t<0))return null;for(r=n.display.view,i=0;i<r.length;i++)if(t-=r[i].size,t<0)return i}function et(n,t,i,r){var u,e,o,s,h,f;t==null&&(t=n.doc.first);i==null&&(i=n.doc.first+n.doc.size);r||(r=0);u=n.display;r&&i<u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>t)&&(u.updateLineNumbers=t);n.curOp.viewChanged=!0;t>=u.viewTo?ti&&rc(n.doc,t)<u.viewTo&&di(n):i<=u.viewFrom?ti&&av(n.doc,i+r)>u.viewFrom?di(n):(u.viewFrom+=r,u.viewTo+=r):t<=u.viewFrom&&i>=u.viewTo?di(n):t<=u.viewFrom?(e=bo(n,i,i+r,1),e?(u.view=u.view.slice(e.index),u.viewFrom=e.lineN,u.viewTo+=r):di(n)):i>=u.viewTo?(o=bo(n,t,t,-1),o?(u.view=u.view.slice(0,o.index),u.viewTo=o.lineN):di(n)):(s=bo(n,t,t,-1),h=bo(n,i,i+r,1),s&&h?(u.view=u.view.slice(0,s.index).concat(yo(n,s.lineN,h.lineN)).concat(u.view.slice(h.index)),u.viewTo+=r):di(n));f=u.externalMeasured;f&&(i<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(u.externalMeasured=null))}function ki(n,t,i){var r,u,f,e;(n.curOp.viewChanged=!0,r=n.display,u=n.display.externalMeasured,u&&t>=u.lineN&&t<u.lineN+u.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)||(f=r.view[wr(n,t)],f.node!=null)&&(e=f.changes||(f.changes=[]),g(e,i)==-1&&e.push(i))}function di(n){n.display.viewFrom=n.display.viewTo=n.doc.first;n.display.view=[];n.display.viewOffset=0}function bo(n,t,i,r){var u=wr(n,t),o,f=n.display.view,e,s;if(!ti||i==n.doc.first+n.doc.size)return{index:u,lineN:i};for(e=n.display.viewFrom,s=0;s<u;s++)e+=f[s].size;if(e!=t){if(r>0){if(u==f.length-1)return null;o=e+f[u].size-t;u++}else o=e-t;t+=o;i+=o}while(rc(n.doc,i)!=i){if(u==(r<0?0:f.length-1))return null;i+=r*f[u-(r<0?1:0)].size;u+=r}return{index:u,lineN:i}}function ag(n,t,i){var r=n.display,u=r.view;u.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=yo(n,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=yo(n,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(wr(n,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(yo(n,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,wr(n,i))));r.viewTo=i}function wy(n){for(var t,r=n.display.view,u=0,i=0;i<r.length;i++)t=r[i],t.hidden||t.node&&!t.changes||++u;return u}function te(n){n.display.input.showSelection(n.display.input.prepareSelection())}function by(n,t){var r,i,e;t===void 0&&(t=!0);var u=n.doc,f={},o=f.cursors=document.createDocumentFragment(),s=f.selection=document.createDocumentFragment();for(r=0;r<u.sel.ranges.length;r++)(t||r!=u.sel.primIndex)&&((i=u.sel.ranges[r],i.from().line>=n.display.viewTo||i.to().line<n.display.viewFrom)||(e=i.empty(),(e||n.options.showCursorWhenSelecting)&&ky(n,i.head,o),e||vg(n,i,s)));return f}function ky(n,t,r){var u=kt(n,t,"div",null,null,!n.options.singleCursorHeightPerLine),e=r.appendChild(i("div"," ","CodeMirror-cursor")),f;e.style.left=u.left+"px";e.style.top=u.top+"px";e.style.height=Math.max(0,u.bottom-u.top)*n.options.cursorHeight+"px";u.other&&(f=r.appendChild(i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")),f.style.display="",f.style.left=u.other.left+"px",f.style.top=u.other.top+"px",f.style.height=(u.other.bottom-u.other.top)*.85+"px")}function ko(n,t){return n.top-t.top||n.left-t.left}function vg(r,u,f){function h(n,t,r,u){t<0&&(t=0);t=Math.round(t);u=Math.round(u);k.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px;\n                             top: "+t+"px; width: "+(r==null?l-n:r)+"px;\n                             height: "+(u-t)+"px"))}function p(i,u,f){function p(t,u){return ac(r,n(i,t),"div",a,u)}function y(n,t,i){var u=yy(r,a,null,n),f=t=="ltr"==(i=="after")?"left":"right",e=i=="after"?u.begin:u.end-(/\s/.test(a.text.charAt(u.end-1))?2:1);return p(e,f)[f]}var a=t(v,i),b=a.text.length,o,c,w=hi(a,v.direction);return sk(w,u||0,f==null?b:f,function(n,t,i,r){var k=i=="ltr",a=p(n,k?"left":"right"),v=p(t-1,k?"right":"left"),d=u==null&&n==0,g=f==null&&t==b,it=r==0,rt=!w||r==w.length-1,nt,ut,tt,ft;if(v.top-a.top<=3){var ot=(e?d:g)&&it,st=(e?g:d)&&rt,et=ot?s:(k?a:v).left,ht=st?l:(k?v:a).right;h(et,a.top,ht-et,a.bottom)}else k?(nt=e&&d&&it?s:a.left,ut=e?l:y(n,i,"before"),tt=e?s:y(t,i,"after"),ft=e&&g&&rt?l:v.right):(nt=e?y(n,i,"before"):s,ut=!e&&d&&it?l:a.right,tt=!e&&g&&rt?s:v.left,ft=e?y(t,i,"after"):l),h(nt,a.top,ut-nt,a.bottom),a.bottom<v.top&&h(s,a.bottom,null,v.top),h(tt,v.top,ft-tt,v.bottom);(!o||ko(a,o)<0)&&(o=a);ko(v,o)<0&&(o=v);(!c||ko(a,c)<0)&&(c=a);ko(v,c)<0&&(c=v)}),{start:o,end:c}}var b=r.display,v=r.doc,k=document.createDocumentFragment(),d=ry(r.display),s=d.left,l=Math.max(b.sizerWidth,vr(r)-b.sizer.offsetLeft)-d.right,e=v.direction=="ltr",a=u.from(),y=u.to();if(a.line==y.line)p(a.line,a.ch,y.ch);else{var g=t(v,a.line),nt=t(v,y.line),w=ii(g)==ii(nt),o=p(a.line,a.ch,w?g.text.length+1:null).end,c=p(y.line,w?0:null,y.ch).start;w&&(o.top<c.top-2?(h(o.right,o.top,null,o.bottom),h(s,c.top,c.left,c.bottom)):h(o.right,o.top,c.left-o.right,o.bottom));o.bottom<c.top&&h(s,o.bottom,null,c.top)}f.appendChild(k)}function dc(n){var t,i;n.state.focused&&(t=n.display,clearInterval(t.blinker),i=!0,t.cursorDiv.style.visibility="",n.options.cursorBlinkRate>0?t.blinker=setInterval(function(){n.hasFocus()||hu(n);t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},n.options.cursorBlinkRate):n.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function dy(n){n.hasFocus()||(n.display.input.focus(),n.state.focused||nl(n))}function gc(n){n.state.delayingBlurEvent=!0;setTimeout(function(){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1,n.state.focused&&hu(n))},100)}function nl(n,t){(n.state.delayingBlurEvent&&!n.state.draggingText&&(n.state.delayingBlurEvent=!1),n.options.readOnly!="nocursor")&&(n.state.focused||(p(n,"focus",n,t),n.state.focused=!0,ur(n.display.wrapper,"CodeMirror-focused"),n.curOp||n.display.selForContextMenu==n.doc.sel||(n.display.input.reset(),it&&setTimeout(function(){return n.display.input.reset(!0)},20)),n.display.input.receivedFocus()),dc(n))}function hu(n,t){n.state.delayingBlurEvent||(n.state.focused&&(p(n,"blur",n,t),n.state.focused=!1,yi(n.display.wrapper,"CodeMirror-focused")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.display.shift=!1)},150))}function go(n){for(var h,r,c,u,a,f=n.display,v=f.lineDiv.offsetTop,o=0;o<f.view.length;o++){var t=f.view[o],y=n.options.lineWrapping,i=void 0,s=0;if(!t.hidden){if(e&&l<8?(h=t.node.offsetTop+t.node.offsetHeight,i=h-v,v=h):(r=t.node.getBoundingClientRect(),i=r.bottom-r.top,!y&&t.text.firstChild&&(s=t.text.firstChild.getBoundingClientRect().right-r.left-1)),c=t.line.height-i,(c>.005||c<-.005)&&(ni(t.line,i),gy(t.line),t.rest))for(u=0;u<t.rest.length;u++)gy(t.rest[u]);s>n.display.sizerWidth&&(a=Math.ceil(s/su(n.display)),a>n.display.maxLineLength&&(n.display.maxLineLength=a,n.display.maxLine=t.line,n.display.maxLineChanged=!0))}}}function gy(n){var t,i,r;if(n.widgets)for(t=0;t<n.widgets.length;++t)i=n.widgets[t],r=i.node.parentNode,r&&(i.height=r.offsetHeight)}function ns(n,i,r){var f=r&&r.top!=null?Math.max(0,r.top):n.scroller.scrollTop,o,s;f=Math.floor(f-po(n));var h=r&&r.bottom!=null?r.bottom:f+n.wrapper.clientHeight,u=cr(i,f),e=cr(i,h);return r&&r.ensure&&(o=r.ensure.from.line,s=r.ensure.to.line,o<u?(u=o,e=cr(i,ci(t(i,o))+n.wrapper.clientHeight)):Math.min(s,i.lastLine())>=e&&(u=cr(i,ci(t(i,s))-n.wrapper.clientHeight),e=s)),{from:u,to:Math.max(e,u+1)}}function yg(n,t){var u;if(!w(n,"scrollCursorIntoView")){var f=n.display,e=f.sizer.getBoundingClientRect(),r=null;t.top+e.top<0?r=!0:t.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1);r==null||uk||(u=i("div","​",null,"position: absolute;\n                         top: "+(t.top-f.viewOffset-po(n.display))+"px;\n                         height: "+(t.bottom-t.top+ri(n)+f.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),n.display.lineSpace.appendChild(u),u.scrollIntoView(r),n.display.lineSpace.removeChild(u))}}function pg(t,i,r,u){var s,h;for(u==null&&(u=0),t.options.lineWrapping||i!=r||(i=i.ch?n(i.line,i.sticky=="before"?i.ch-1:i.ch,"after"):i,r=i.sticky=="before"?n(i.line,i.ch+1,"before"):i),h=0;h<5;h++){var c=!1,f=kt(t,i),e=!r||r==i?f:kt(t,r);s={left:Math.min(f.left,e.left),top:Math.min(f.top,e.top)-u,right:Math.max(f.left,e.left),bottom:Math.max(f.bottom,e.bottom)+u};var o=tl(t,s),l=t.doc.scrollTop,a=t.doc.scrollLeft;if(o.scrollTop!=null&&(re(t,o.scrollTop),Math.abs(t.doc.scrollTop-l)>1&&(c=!0)),o.scrollLeft!=null&&(br(t,o.scrollLeft),Math.abs(t.doc.scrollLeft-a)>1&&(c=!0)),!c)break}return s}function wg(n,t){var i=tl(n,t);i.scrollTop!=null&&re(n,i.scrollTop);i.scrollLeft!=null&&br(n,i.scrollLeft)}function tl(n,t){var r=n.display,h=ou(n.display),o;t.top<0&&(t.top=0);var e=n.curOp&&n.curOp.scrollTop!=null?n.curOp.scrollTop:r.scroller.scrollTop,u=sc(n),i={};t.bottom-t.top>u&&(t.bottom=t.top+u);var c=n.doc.height+oc(r),v=t.top<h,y=t.bottom>c-h;t.top<e?i.scrollTop=v?0:t.top:t.bottom>e+u&&(o=Math.min(t.top,(y?c:t.bottom)-u),o!=e&&(i.scrollTop=o));var l=n.options.fixedGutter?0:r.gutters.offsetWidth,a=n.curOp&&n.curOp.scrollLeft!=null?n.curOp.scrollLeft:r.scroller.scrollLeft-l,f=vr(n)-r.gutters.offsetWidth,s=t.right-t.left>f;return s&&(t.right=t.left+f),t.left<10?i.scrollLeft=0:t.left<a?i.scrollLeft=Math.max(0,t.left+l-(s?0:10)):t.right>f+a-3&&(i.scrollLeft=t.right+(s?0:10)-f),i}function il(n,t){t!=null&&(ts(n),n.curOp.scrollTop=(n.curOp.scrollTop==null?n.doc.scrollTop:n.curOp.scrollTop)+t)}function cu(n){ts(n);var t=n.getCursor();n.curOp.scrollToPos={from:t,to:t,margin:n.options.cursorScrollMargin}}function ie(n,t,i){(t!=null||i!=null)&&ts(n);t!=null&&(n.curOp.scrollLeft=t);i!=null&&(n.curOp.scrollTop=i)}function bg(n,t){ts(n);n.curOp.scrollToPos=t}function ts(n){var t=n.curOp.scrollToPos,i,r;t&&(n.curOp.scrollToPos=null,i=ay(n,t.from),r=ay(n,t.to),np(n,i,r,t.margin))}function np(n,t,i,r){var u=tl(n,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ie(n,u.scrollLeft,u.scrollTop)}function re(n,t){Math.abs(n.doc.scrollTop-t)<2||(ei||fl(n,{top:t}),tp(n,t,!0),ei&&fl(n),fe(n,100))}function tp(n,t,i){(t=Math.max(0,Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,t)),n.display.scroller.scrollTop!=t||i)&&(n.doc.scrollTop=t,n.display.scrollbars.setScrollTop(t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t))}function br(n,t,i,r){(t=Math.max(0,Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth)),(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)&&!r)||(n.doc.scrollLeft=t,ep(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbars.setScrollLeft(t))}function ue(n){var t=n.display,i=t.gutters.offsetWidth,r=Math.round(n.doc.height+oc(n.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:n.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+ri(n)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}function au(n,t){var i,r,u;for(t||(t=ue(n)),i=n.display.barWidth,r=n.display.barHeight,ip(n,t),u=0;u<4&&i!=n.display.barWidth||r!=n.display.barHeight;u++)i!=n.display.barWidth&&n.options.lineWrapping&&go(n),ip(n,ue(n)),i=n.display.barWidth,r=n.display.barHeight}function ip(n,t){var i=n.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px";i.heightForcer.style.borderBottom=r.bottom+"px solid transparent";r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="";r.bottom&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}function rp(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&yi(n.display.wrapper,n.display.scrollbars.addClass));n.display.scrollbars=new rl[n.options.scrollbarStyle](function(t){n.display.wrapper.insertBefore(t,n.display.scrollbarFiller);r(t,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)});t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?br(n,t):re(n,t)},n);n.display.scrollbars.addClass&&ur(n.display.wrapper,n.display.scrollbars.addClass)}function kr(n){n.curOp={cm:n,viewChanged:!1,startHeight:n.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++up};wd(n.curOp)}function dr(n){var t=n.curOp;t&&kd(t,function(n){for(var t=0;t<n.ops.length;t++)n.ops[t].cm.curOp=null;kg(n)})}function kg(n){for(var i,r,u,f,t=n.ops,e=0;e<t.length;e++)dg(t[e]);for(i=0;i<t.length;i++)gg(t[i]);for(r=0;r<t.length;r++)nn(t[r]);for(u=0;u<t.length;u++)tn(t[u]);for(f=0;f<t.length;f++)rn(t[f])}function dg(n){var t=n.cm,i=t.display;fn(t);n.updateMaxLine&&fc(t);n.mustUpdate=n.viewChanged||n.forceUpdate||n.scrollTop!=null||n.scrollToPos&&(n.scrollToPos.from.line<i.viewFrom||n.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;n.update=n.mustUpdate&&new ee(t,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}function gg(n){n.updatedDisplay=n.mustUpdate&&ul(n.cm,n.update)}function nn(n){var t=n.cm,i=t.display;n.updatedDisplay&&go(t);n.barMeasure=ue(t);i.maxLineChanged&&!t.options.lineWrapping&&(n.adjustWidthTo=fy(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=n.adjustWidthTo,n.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+n.adjustWidthTo+ri(t)+t.display.barWidth),n.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+n.adjustWidthTo-vr(t)));(n.updatedDisplay||n.selectionChanged)&&(n.preparedSelection=i.input.prepareSelection())}function tn(n){var t=n.cm,i;n.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=n.adjustWidthTo+"px",n.maxScrollLeft<t.doc.scrollLeft&&br(t,Math.min(t.display.scroller.scrollLeft,n.maxScrollLeft),!0),t.display.maxLineChanged=!1);i=n.focus&&n.focus==oi();n.preparedSelection&&t.display.input.showSelection(n.preparedSelection,i);(n.updatedDisplay||n.startHeight!=t.doc.height)&&au(t,n.barMeasure);n.updatedDisplay&&ol(t,n.barMeasure);n.selectionChanged&&dc(t);t.state.focused&&n.updateInput&&t.display.input.reset(n.typing);i&&dy(n.cm)}function rn(n){var t=n.cm,o=t.display,s=t.doc,h,i,r,u,e;if(n.updatedDisplay&&fp(t,n.update),o.wheelStartX!=null&&(n.scrollTop!=null||n.scrollLeft!=null||n.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),n.scrollTop!=null&&tp(t,n.scrollTop,n.forceScroll),n.scrollLeft!=null&&br(t,n.scrollLeft,!0,!0),n.scrollToPos&&(h=pg(t,f(s,n.scrollToPos.from),f(s,n.scrollToPos.to),n.scrollToPos.margin),yg(t,h)),i=n.maybeHiddenMarkers,r=n.maybeUnhiddenMarkers,i)for(u=0;u<i.length;++u)i[u].lines.length||p(i[u],"hide");if(r)for(e=0;e<r.length;++e)r[e].lines.length&&p(r[e],"unhide");o.wrapper.offsetHeight&&(s.scrollTop=t.display.scroller.scrollTop);n.changeObjs&&p(t,"changes",t,n.changeObjs);n.update&&n.update.finish()}function ot(n,t){if(n.curOp)return t();kr(n);try{return t()}finally{dr(n)}}function b(n,t){return function(){if(n.curOp)return t.apply(n,arguments);kr(n);try{return t.apply(n,arguments)}finally{dr(n)}}}function rt(n){return function(){if(this.curOp)return n.apply(this,arguments);kr(this);try{return n.apply(this,arguments)}finally{dr(this)}}}function k(n){return function(){var t=this.cm;if(!t||t.curOp)return n.apply(this,arguments);kr(t);try{return n.apply(this,arguments)}finally{dr(t)}}}function fe(n,t){n.doc.highlightFrontier<n.display.viewTo&&n.state.highlight.set(t,ds(un,n))}function un(n){var i=n.doc;if(!(i.highlightFrontier>=n.display.viewTo)){var u=+new Date+n.options.workTime,t=bf(n,i.highlightFrontier),r=[];i.iter(t.line,Math.min(i.first+i.size,n.display.viewTo+500),function(f){var o,e,c,s;if(t.line>=n.display.viewFrom){var h=f.styles,l=f.text.length>n.options.maxHighlightLength?sr(i.mode,t.state):null,a=nv(n,f,t,!0);for(l&&(t.state=l),f.styles=a.styles,o=f.styleClasses,e=a.classes,e?f.styleClasses=e:o&&(f.styleClasses=null),c=!h||h.length!=f.styles.length||o!=e&&(!o||!e||o.bgClass!=e.bgClass||o.textClass!=e.textClass),s=0;!c&&s<h.length;++s)c=h[s]!=f.styles[s];c&&r.push(t.line);f.stateAfter=t.save();t.nextLine()}else f.text.length<=n.options.maxHighlightLength&&kh(n,f.text,t),f.stateAfter=t.line%5==0?t.save():null,t.nextLine();if(+new Date>u)return fe(n,n.options.workDelay),!0});i.highlightFrontier=t.line;i.modeFrontier=Math.max(i.modeFrontier,t.line);r.length&&ot(n,function(){for(var t=0;t<r.length;t++)ki(n,r[t],"text")})}}function fn(n){var t=n.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ri(n)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ri(n)+"px",t.scrollbarsClipped=!0)}function en(n){var r,i,t;return n.hasFocus()?null:(r=oi(),!r||!wi(n.display.lineDiv,r))?null:(i={activeElt:r},window.getSelection&&(t=window.getSelection(),t.anchorNode&&t.extend&&wi(n.display.lineDiv,t.anchorNode)&&(i.anchorNode=t.anchorNode,i.anchorOffset=t.anchorOffset,i.focusNode=t.focusNode,i.focusOffset=t.focusOffset)),i)}function on(n){if(n&&n.activeElt&&n.activeElt!=oi()&&(n.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(n.activeElt.nodeName)&&n.anchorNode&&wi(document.body,n.anchorNode)&&wi(document.body,n.focusNode))){var t=window.getSelection(),i=document.createRange();i.setEnd(n.anchorNode,n.anchorOffset);i.collapse(!1);t.removeAllRanges();t.addRange(i);t.extend(n.focusNode,n.focusOffset)}}function ul(n,i){var r=n.display,e=n.doc,s,o,c;if(i.editorIsHidden)return di(n),!1;if(!i.force&&i.visible.from>=r.viewFrom&&i.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&wy(n)==0)return!1;op(n)&&(di(n),i.dims=wc(n));var h=e.first+e.size,u=Math.max(i.visible.from-n.options.viewportMargin,e.first),f=Math.min(h,i.visible.to+n.options.viewportMargin);return(r.viewFrom<u&&u-r.viewFrom<20&&(u=Math.max(e.first,r.viewFrom)),r.viewTo>f&&r.viewTo-f<20&&(f=Math.min(h,r.viewTo)),ti&&(u=rc(n.doc,u),f=av(n.doc,f)),s=u!=r.viewFrom||f!=r.viewTo||r.lastWrapHeight!=i.wrapperHeight||r.lastWrapWidth!=i.wrapperWidth,ag(n,u,f),r.viewOffset=ci(t(n.doc,r.viewFrom)),n.display.mover.style.top=r.viewOffset+"px",o=wy(n),!s&&o==0&&!i.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))?!1:(c=en(n),o>4&&(r.lineDiv.style.display="none"),sn(n,r.updateLineNumbers,i.dims),o>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,on(c),pi(r.cursorDiv),pi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=i.wrapperHeight,r.lastWrapWidth=i.wrapperWidth,fe(n,400)),r.updateLineNumbers=null,!0)}function fp(n,t){for(var u,i=t.viewport,r=!0;;r=!1){if(r&&n.options.lineWrapping&&t.oldDisplayWidth!=vr(n))r&&(t.visible=ns(n.display,n.doc,i));else if(i&&i.top!=null&&(i={top:Math.min(n.doc.height+oc(n.display)-sc(n),i.top)}),t.visible=ns(n.display,n.doc,i),t.visible.from>=n.display.viewFrom&&t.visible.to<=n.display.viewTo)break;if(!ul(n,t))break;go(n);u=ue(n);te(n);au(n,u);ol(n,u);t.force=!1}t.signal(n,"update",n);(n.display.viewFrom!=n.display.reportedViewFrom||n.display.viewTo!=n.display.reportedViewTo)&&(t.signal(n,"viewportChange",n,n.display.viewFrom,n.display.viewTo),n.display.reportedViewFrom=n.display.viewFrom,n.display.reportedViewTo=n.display.viewTo)}function fl(n,t){var i=new ee(n,t),r;ul(n,i)&&(go(n),fp(n,i),r=ue(n),te(n),au(n,r),ol(n,r),i.finish())}function sn(n,t,i){function c(t){var i=t.nextSibling;return it&&at&&n.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var r,a,h,e=n.display,v=n.options.lineNumbers,o=e.lineDiv,u=o.firstChild,l=e.view,f=e.viewFrom,s=0;s<l.length;s++){if(r=l[s],!r.hidden)if(r.node&&r.node.parentNode==o){while(u!=r.node)u=c(u);h=v&&t!=null&&t<=f&&r.lineNumber;r.changes&&(g(r.changes,"gutter")>-1&&(h=!1),dv(n,r,f,i));h&&(pi(r.lineNumber),r.lineNumber.appendChild(document.createTextNode(ph(n.options,f))));u=r.node.nextSibling}else a=ig(n,r,f,i),o.insertBefore(a,u);f+=r.size}while(u)u=c(u)}function el(n){var t=n.gutters.offsetWidth;n.sizer.style.marginLeft=t+"px"}function ol(n,t){n.display.sizer.style.minHeight=t.docHeight+"px";n.display.heightForcer.style.top=t.docHeight+"px";n.display.gutters.style.height=t.docHeight+n.display.barHeight+ri(n)+"px"}function ep(n){var i=n.display,r=i.view,t,u,f;if(i.alignWidgets||i.gutters.firstChild&&n.options.fixedGutter){var o=bc(i)-i.scroller.scrollLeft+n.doc.scrollLeft,s=i.gutters.offsetWidth,e=o+"px";for(t=0;t<r.length;t++)if(!r[t].hidden&&(n.options.fixedGutter&&(r[t].gutter&&(r[t].gutter.style.left=e),r[t].gutterBackground&&(r[t].gutterBackground.style.left=e)),u=r[t].alignable,u))for(f=0;f<u.length;f++)u[f].style.left=e;n.options.fixedGutter&&(i.gutters.style.left=o+s+"px")}}function op(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=ph(n.options,u.first+u.size-1),t=n.display;if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o)+1,t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",el(n.display),!0}return!1}function sl(n,t){for(var i,f,r=[],e=!1,u=0;u<n.length;u++){if(i=n[u],f=null,typeof i!="string"&&(f=i.style,i=i.className),i=="CodeMirror-linenumbers")if(t)e=!0;else continue;r.push({className:i,style:f})}return t&&!e&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function sp(n){var r=n.gutters,u=n.gutterSpecs,t;for(pi(r),n.lineGutter=null,t=0;t<u.length;++t){var e=u[t],o=e.className,s=e.style,f=r.appendChild(i("div",null,"CodeMirror-gutter "+o));s&&(f.style.cssText=s);o=="CodeMirror-linenumbers"&&(n.lineGutter=f,f.style.width=(n.lineNumWidth||1)+"px")}r.style.display=u.length?"":"none";el(n)}function oe(n){sp(n.display);et(n);ep(n)}function hn(n,t,r,u){var f=this,o;this.input=r;f.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler");f.scrollbarFiller.setAttribute("cm-not-content","true");f.gutterFiller=i("div",null,"CodeMirror-gutter-filler");f.gutterFiller.setAttribute("cm-not-content","true");f.lineDiv=nu("div",null,"CodeMirror-code");f.selectionDiv=i("div",null,null,"position: relative; z-index: 1");f.cursorDiv=i("div",null,"CodeMirror-cursors");f.measure=i("div",null,"CodeMirror-measure");f.lineMeasure=i("div",null,"CodeMirror-measure");f.lineSpace=nu("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");o=nu("div",[f.lineSpace],"CodeMirror-lines");f.mover=i("div",[o],null,"position: relative");f.sizer=i("div",[f.mover],"CodeMirror-sizer");f.sizerWidth=null;f.heightForcer=i("div",null,null,"position: absolute; height: "+ea+"px; width: 1px;");f.gutters=i("div",null,"CodeMirror-gutters");f.lineGutter=null;f.scroller=i("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll");f.scroller.setAttribute("tabIndex","-1");f.wrapper=i("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror");e&&l<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0);it||ei&&hf||(f.scroller.draggable=!0);n&&(n.appendChild?n.appendChild(f.wrapper):n(f.wrapper));f.viewFrom=f.viewTo=t.first;f.reportedViewFrom=f.reportedViewTo=t.first;f.view=[];f.renderedView=null;f.externalMeasured=null;f.viewOffset=0;f.lastWrapHeight=f.lastWrapWidth=0;f.updateLineNumbers=null;f.nativeBarWidth=f.barHeight=f.barWidth=0;f.scrollbarsClipped=!1;f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null;f.alignWidgets=!1;f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null;f.maxLine=null;f.maxLineLength=0;f.maxLineChanged=!1;f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null;f.shift=!1;f.selForContextMenu=null;f.activeTouch=null;f.gutterSpecs=sl(u.gutters,u.lineNumbers);sp(f);r.init(f)}function hp(n){var i=n.wheelDeltaX,t=n.wheelDeltaY;return i==null&&n.detail&&n.axis==n.HORIZONTAL_AXIS&&(i=n.detail),t==null&&n.detail&&n.axis==n.VERTICAL_AXIS?t=n.detail:t==null&&(t=n.wheelDelta),{x:i,y:t}}function cn(n){var t=hp(n);return t.x*=st,t.y*=st,t}function cp(n,t){var v=hp(t),e=v.x,u=v.y,i=n.display,r=i.scroller,y=r.scrollWidth>r.clientWidth,h=r.scrollHeight>r.clientHeight,f,c,o;if(e&&y||u&&h){if(u&&at&&it)n:for(f=t.target,c=i.view;f!=r;f=f.parentNode)for(o=0;o<c.length;o++)if(c[o].node==f){n.display.currentWheelTarget=f;break n}if(e&&!ei&&!wt&&st!=null){u&&h&&re(n,Math.max(0,r.scrollTop+u*st));br(n,Math.max(0,r.scrollLeft+e*st));(!u||u&&h)&&ft(t);i.wheelStartX=null;return}if(u&&st!=null){var l=u*st,s=n.doc.scrollTop,a=s+i.wrapper.clientHeight;l<0?s=Math.max(0,s+l-50):a=Math.min(n.doc.height,a+l+50);fl(n,{top:s,bottom:a})}se<20&&(i.wheelStartX==null?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=e,i.wheelDY=u,setTimeout(function(){if(i.wheelStartX!=null){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;(i.wheelStartX=i.wheelStartY=null,u)&&(st=(st*se+u)/(se+1),++se)}},200)):(i.wheelDX+=e,i.wheelDY+=u))}}function dt(n,t,i){var a=n&&n.options.selectionsMayTouch,v=t[i],r;for(t.sort(function(n,t){return u(n.from(),t.from())}),i=g(t,v),r=1;r<t.length;r++){var f=t[r],e=t[r-1],s=u(e.to(),f.from());if(a&&!f.empty()?s>0:s>=0){var h=so(e.from(),f.from()),c=oo(e.to(),f.to()),l=e.empty()?f.from()==f.head:e.from()==e.head;r<=i&&--i;t.splice(--r,2,new o(l?c:h,l?h:c))}}return new ht(t,i)}function nr(n,t){return new ht([new o(n,t||n)],0)}function tr(t){return t.text?n(t.from.line+t.text.length-1,s(t.text).length+(t.text.length==1?t.from.ch:0)):t.to}function lp(t,i){if(u(t,i.from)<0)return t;if(u(t,i.to)<=0)return tr(i);var f=t.line+i.text.length-(i.to.line-i.from.line)-1,r=t.ch;return t.line==i.to.line&&(r+=tr(i).ch-i.to.ch),n(f,r)}function hl(n,t){for(var r,u=[],i=0;i<n.sel.ranges.length;i++)r=n.sel.ranges[i],u.push(new o(lp(r.anchor,t),lp(r.head,t)));return dt(n.cm,u,n.sel.primIndex)}function ap(t,i,r){return t.line==i.line?n(r.line,t.ch-i.ch+r.ch):n(r.line+(t.line-i.line),t.ch)}function ln(t,i,r){for(var v,y,h=[],e=n(t.first,0),c=e,f=0;f<i.length;f++){var l=i[f],s=ap(l.from,e,c),a=ap(tr(l),e,c);e=l.to;c=a;r=="around"?(v=t.sel.ranges[f],y=u(v.head,v.anchor)<0,h[f]=new o(y?a:s,y?s:a)):h[f]=new o(s,s)}return new ht(h,t.sel.primIndex)}function cl(n){n.doc.mode=ah(n.options,n.doc.modeOption);he(n)}function he(n){n.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null)});n.doc.modeFrontier=n.doc.highlightFrontier=n.doc.first;fe(n,100);n.state.modeGen++;n.curOp&&et(n)}function vp(n,t){return t.from.ch==0&&t.to.ch==0&&s(t.text)==""&&(!n.cm||n.cm.options.wholeLineUpdateBefore)}function ll(n,i,r,u){function a(n){return r?r[n]:null}function h(n,t,r){hd(n,t,r,u);d(n,"change",n,i)}function y(n,t){for(var r=[],i=n;i<t;++i)r.push(new lr(f[i],a(i),u));return r}var e=i.from,c=i.to,f=i.text,o=t(n,e.line),l=t(n,c.line),w=s(f),p=a(f.length-1),v=c.line-e.line,b,k,g;i.full?(n.insert(0,y(0,f.length)),n.remove(f.length,n.size-f.length)):vp(n,i)?(b=y(0,f.length-1),h(l,l.text,p),v&&n.remove(e.line,v),b.length&&n.insert(e.line,b)):o==l?f.length==1?h(o,o.text.slice(0,e.ch)+w+o.text.slice(c.ch),p):(k=y(1,f.length-1),k.push(new lr(w+o.text.slice(c.ch),p,u)),h(o,o.text.slice(0,e.ch)+f[0],a(0)),n.insert(e.line+1,k)):f.length==1?(h(o,o.text.slice(0,e.ch)+f[0]+l.text.slice(c.ch),a(0)),n.remove(e.line+1,v)):(h(o,o.text.slice(0,e.ch)+f[0],a(0)),h(l,w+l.text.slice(c.ch),p),g=y(1,f.length-1),v>1&&n.remove(e.line+1,v-1),n.insert(e.line+1,g));d(n,"change",n,i)}function ir(n,t,i){function r(n,u,f){var o,e,s;if(n.linked)for(o=0;o<n.linked.length;++o)(e=n.linked[o],e.doc!=u)&&(s=f&&e.sharedHist,!i||s)&&(t(e.doc,s),r(e.doc,n,s))}r(n,null,!0)}function yp(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t;t.cm=n;kc(n);cl(n);pp(n);n.options.lineWrapping||fc(n);n.options.mode=t.modeOption;et(n)}function pp(n){(n.doc.direction=="rtl"?ur:yi)(n.display.lineDiv,"CodeMirror-rtl")}function an(n){ot(n,function(){pp(n);et(n)})}function is(n){this.done=[];this.undone=[];this.undoDepth=Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=n||1}function al(n,t){var i={from:bh(t.from),to:tr(t),text:hr(n,t.from,t.to)};return kp(n,i,t.from.line,t.to.line+1),ir(n,function(n){return kp(n,i,t.from.line,t.to.line+1)},!0),i}function wp(n){while(n.length){var t=s(n);if(t.ranges)n.pop();else break}}function vn(n,t){return t?(wp(n.done),s(n.done)):n.done.length&&!s(n.done).ranges?s(n.done):n.done.length>1&&!n.done[n.done.length-2].ranges?(n.done.pop(),s(n.done)):void 0}function bp(n,t,i,r){var f=n.history,h,e,o,c;if(f.undone.length=0,h=+new Date,(f.lastOp==r||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>h-(n.cm?n.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(e=vn(f,f.lastOp==r)))o=s(e.changes),u(t.from,t.to)==0&&u(t.from,o.to)==0?o.to=tr(t):e.changes.push(al(n,t));else for(c=s(f.done),c&&c.ranges||rs(n.sel,f.done),e={changes:[al(n,t)],generation:f.generation},f.done.push(e);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift();f.done.push(i);f.generation=++f.maxGeneration;f.lastModTime=f.lastSelTime=h;f.lastOp=f.lastSelOp=r;f.lastOrigin=f.lastSelOrigin=t.origin;o||p(n,"historyAdded")}function yn(n,t,i,r){var u=t.charAt(0);return u=="*"||u=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)}function pn(n,t,i,r){var u=n.history,f=r&&r.origin;i==u.lastSelOp||f&&u.lastSelOrigin==f&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==f||yn(n,f,s(u.done),t))?u.done[u.done.length-1]=t:rs(t,u.done);u.lastSelTime=+new Date;u.lastSelOrigin=f;u.lastSelOp=i;r&&r.clearRedo!==!1&&wp(u.undone)}function rs(n,t){var i=s(t);i&&i.ranges&&i.equals(n)||t.push(n)}function kp(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans);++f})}function wn(n){var t,i;if(!n)return null;for(i=0;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function bn(n,t){var u=t["spans_"+n.id],r,i;if(!u)return null;for(r=[],i=0;i<t.text.length;++i)r.push(wn(u[i]));return r}function dp(n,t){var i=bn(n,t),s=tc(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function vu(n,t,i){for(var u,l,e,o,r,a,f,h=[],c=0;c<n.length;++c){if(u=n[c],u.ranges){h.push(i?ht.prototype.deepCopy.call(u):u);continue}for(l=u.changes,e=[],h.push({changes:e}),o=0;o<l.length;++o)if(r=l[o],a=void 0,e.push({from:r.from,to:r.to,text:r.text}),t)for(f in r)(a=f.match(/^spans_(\d+)$/))&&g(t,Number(a[1]))>-1&&(s(e)[f]=r[f],delete r[f])}return h}function vl(n,t,i,r){var f,e;return r?(f=n.anchor,i&&(e=u(t,f)<0,e!=u(i,f)<0?(f=t,t=i):e!=u(t,i)<0&&(t=i)),new o(f,t)):new o(i||t,t)}function us(n,t,i,r,u){u==null&&(u=n.cm&&(n.cm.display.shift||n.extend));nt(n,new ht([vl(n.sel.primary(),t,i,u)],0),r)}function gp(n,t,i){for(var f,u=[],e=n.cm&&(n.cm.display.shift||n.extend),r=0;r<n.sel.ranges.length;r++)u[r]=vl(n.sel.ranges[r],t[r],null,e);f=dt(n.cm,u,n.sel.primIndex);nt(n,f,i)}function yl(n,t,i,r){var u=n.sel.ranges.slice(0);u[t]=i;nt(n,dt(n.cm,u,n.sel.primIndex),r)}function nw(n,t,i,r){nt(n,nr(t,i),r)}function kn(n,t,i){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++)this.ranges[i]=new o(f(n,t[i].anchor),f(n,t[i].head))},origin:i&&i.origin};return p(n,"beforeSelectionChange",n,r),n.cm&&p(n.cm,"beforeSelectionChange",n.cm,r),r.ranges!=t.ranges?dt(n.cm,r.ranges,r.ranges.length-1):t}function tw(n,t,i){var r=n.history.done,u=s(r);u&&u.ranges?(r[r.length-1]=t,fs(n,t,i)):nt(n,t,i)}function nt(n,t,i){fs(n,t,i);pn(n,n.sel,n.cm?n.cm.curOp.id:NaN,i)}function fs(n,t,i){(yt(n,"beforeSelectionChange")||n.cm&&yt(n.cm,"beforeSelectionChange"))&&(t=kn(n,t,i));var r=i&&i.bias||(u(t.primary().head,n.sel.primary().head)<0?-1:1);iw(n,uw(n,t,r,!0));i&&i.scroll===!1||!n.cm||cu(n.cm)}function iw(n,t){t.equals(n.sel)||(n.sel=t,n.cm&&(n.cm.curOp.updateInput=1,n.cm.curOp.selectionChanged=!0,ya(n.cm)),d(n,"cursorActivity",n))}function rw(n){iw(n,uw(n,n.sel,null,!1))}function uw(n,t,i,r){for(var u,f=0;f<t.ranges.length;f++){var e=t.ranges[f],s=t.ranges.length==n.sel.ranges.length&&n.sel.ranges[f],h=es(n,e.anchor,s&&s.anchor,i,r),c=es(n,e.head,s&&s.head,i,r);(u||h!=e.anchor||c!=e.head)&&(u||(u=t.ranges.slice(0,f)),u[f]=new o(h,c))}return u?dt(n.cm,u,t.primIndex):t}function yu(n,i,r,f,e){var c=t(n,i.line),a,s,v,l;if(c.markedSpans)for(a=0;a<c.markedSpans.length;++a){var h=c.markedSpans[a],o=h.marker,y="selectLeft"in o?!o.selectLeft:o.inclusiveLeft,w="selectRight"in o?!o.selectRight:o.inclusiveRight;if((h.from==null||(y?h.from<=i.ch:h.from<i.ch))&&(h.to==null||(w?h.to>=i.ch:h.to>i.ch))){if(e&&(p(o,"beforeCursorEnter"),o.explicitlyCleared))if(c.markedSpans){--a;continue}else break;if(!o.atomic)continue;return r&&(s=o.find(f<0?1:-1),v=void 0,(f<0?w:y)&&(s=fw(n,s,-f,s&&s.line==i.line?c:null)),s&&s.line==i.line&&(v=u(s,r))&&(f<0?v<0:v>0))?yu(n,s,i,f,e):(l=o.find(f<0?-1:1),(f<0?y:w)&&(l=fw(n,l,f,l.line==i.line?c:null)),l?yu(n,l,i,f,e):null)}}return i}function es(t,i,r,u,f){var e=u||1,o=yu(t,i,r,e,f)||!f&&yu(t,i,r,e,!0)||yu(t,i,r,-e,f)||!f&&yu(t,i,r,-e,!0);return o?o:(t.cantEdit=!0,n(t.first,0))}function fw(i,r,u,e){return u<0&&r.ch==0?r.line>i.first?f(i,n(r.line-1)):null:u>0&&r.ch==(e||t(i,r.line)).text.length?r.line<i.first+i.size-1?n(r.line+1,0):null:new n(r.line,r.ch+u)}function ew(t){t.setSelection(n(t.firstLine(),0),n(t.lastLine()),gt)}function ow(n,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return(i&&(r.update=function(t,i,u,e){t&&(r.from=f(n,t));i&&(r.to=f(n,i));u&&(r.text=u);e!==undefined&&(r.origin=e)}),p(n,"beforeChange",n,r),n.cm&&p(n.cm,"beforeChange",n.cm,r),r.canceled)?(n.cm&&(n.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function pu(n,t,i){var u,r;if(n.cm){if(!n.cm.curOp)return b(n.cm,pu)(n,t,i);if(n.cm.state.suppressEdits)return}if(!yt(n,"beforeChange")&&(!n.cm||!yt(n.cm,"beforeChange"))||(t=ow(n,t,!0),t))if(u=nc&&!i&&fd(n,t.from,t.to),u)for(r=u.length-1;r>=0;--r)sw(n,{from:u[r].from,to:u[r].to,text:r?[""]:t.text,origin:t.origin});else sw(n,t)}function sw(n,t){var i,r;(t.text.length!=1||t.text[0]!=""||u(t.from,t.to)!=0)&&(i=hl(n,t),bp(n,t,i,n.cm?n.cm.curOp.id:NaN),ce(n,t,i,tc(n,t)),r=[],ir(n,function(n,i){i||g(r,n.history)!=-1||(aw(n.history,t),r.push(n.history));ce(n,t,null,tc(n,t))}))}function os(n,t,i){var a=n.cm&&n.cm.state.suppressEdits,c,y,p,o,l;if(!a||i){for(var u=n.history,r,v=n.sel,f=t=="undo"?u.done:u.undone,h=t=="undo"?u.undone:u.done,e=0;e<f.length;e++)if(r=f[e],i?r.ranges&&!r.equals(n.sel):!r.ranges)break;if(e!=f.length){for(u.lastOrigin=u.lastSelOrigin=null;;)if(r=f.pop(),r.ranges){if(rs(r,h),i&&!r.equals(n.sel)){nt(n,r,{clearRedo:!1});return}v=r}else{if(a){f.push(r);return}break}for(c=[],rs(v,h),h.push({changes:c,generation:u.generation}),u.generation=r.generation||++u.maxGeneration,y=yt(n,"beforeChange")||n.cm&&yt(n.cm,"beforeChange"),p=function(i){var u=r.changes[i],o,e;if(u.origin=t,y&&!ow(n,u,!1))return f.length=0,{};c.push(al(n,u));o=i?hl(n,u):s(f);ce(n,u,o,dp(n,u));!i&&n.cm&&n.cm.scrollIntoView({from:u.from,to:tr(u)});e=[];ir(n,function(n,t){t||g(e,n.history)!=-1||(aw(n.history,u),e.push(n.history));ce(n,u,null,dp(n,u))})},o=r.changes.length-1;o>=0;--o)if(l=p(o),l)return l.v}}}function hw(t,i){if(i!=0&&(t.first+=i,t.sel=new ht(ro(t.sel.ranges,function(t){return new o(n(t.anchor.line+i,t.anchor.ch),n(t.head.line+i,t.head.ch))}),t.sel.primIndex),t.cm)){et(t.cm,t.first,t.first-i,i);for(var u=t.cm.display,r=u.viewFrom;r<u.viewTo;r++)ki(t.cm,r,"gutter")}}function ce(i,r,u,f){var o,e;if(i.cm&&!i.cm.curOp)return b(i.cm,ce)(i,r,u,f);if(r.to.line<i.first){hw(i,r.text.length-1-(r.to.line-r.from.line));return}r.from.line>i.lastLine()||(r.from.line<i.first&&(o=r.text.length-1-(i.first-r.from.line),hw(i,o),r={from:n(i.first,0),to:n(r.to.line+o,r.to.ch),text:[s(r.text)],origin:r.origin}),e=i.lastLine(),r.to.line>e&&(r={from:r.from,to:n(e,t(i,e).text.length),text:[r.text[0]],origin:r.origin}),r.removed=hr(i,r.from,r.to),u||(u=hl(i,r)),i.cm?dn(i.cm,r,f):ll(i,r,f),fs(i,u,gt),i.cantEdit&&es(i,n(i.firstLine(),0))&&(i.cantEdit=!1))}function dn(n,i,r){var f=n.doc,e=n.display,u=i.from,o=i.to,s=!1,h=u.line,y,l,a,v;n.options.lineWrapping||(h=c(ii(t(f,u.line))),f.iter(h,o.line+1,function(n){if(n==e.maxLine)return s=!0,!0}));f.sel.contains(i.from,i.to)>-1&&ya(n);ll(f,i,r,py(n));n.options.lineWrapping||(f.iter(h,u.line+i.text.length,function(n){var t=vo(n);t>e.maxLineLength&&(e.maxLine=n,e.maxLineLength=t,e.maxLineChanged=!0,s=!1)}),s&&(n.curOp.updateMaxLine=!0));dk(f,u.line);fe(n,400);y=i.text.length-(o.line-u.line)-1;i.full?et(n):u.line!=o.line||i.text.length!=1||vp(n.doc,i)?et(n,u.line,o.line+1,y):ki(n,u.line,"text");l=yt(n,"changes");a=yt(n,"change");(a||l)&&(v={from:u,to:o,text:i.text,removed:i.removed,origin:i.origin},a&&d(n,"change",n,v),l&&(n.curOp.changeObjs||(n.curOp.changeObjs=[])).push(v));n.display.selForContextMenu=null}function wu(n,t,i,r,f){var e;r||(r=i);u(r,i)<0&&(e=[r,i],i=e[0],r=e[1]);typeof t=="string"&&(t=n.splitLines(t));pu(n,{from:i,to:r,text:t,origin:f})}function cw(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function lw(t,i,r,u){for(var f,c,s,h,e,o=0;o<t.length;++o){if(f=t[o],c=!0,f.ranges){for(f.copied||(f=t[o]=f.deepCopy(),f.copied=!0),s=0;s<f.ranges.length;s++)cw(f.ranges[s].anchor,i,r,u),cw(f.ranges[s].head,i,r,u);continue}for(h=0;h<f.changes.length;++h)if(e=f.changes[h],r<e.from.line)e.from=n(e.from.line+u,e.from.ch),e.to=n(e.to.line+u,e.to.ch);else if(i<=e.to.line){c=!1;break}c||(t.splice(0,o+1),o=0)}}function aw(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;lw(n.done,i,r,u);lw(n.undone,i,r,u)}function le(n,i,r,u){var f=i,e=i;return(typeof i=="number"?e=t(n,da(n,i)):f=c(i),f==null)?null:(u(e,f)&&n.cm&&ki(n.cm,f,r),e)}function ae(n){var i,t;for(this.lines=n,this.parent=null,i=0,t=0;t<n.length;++t)n[t].parent=this,i+=n[t].height;this.height=i}function ve(n){var r,u,t,i;for(this.children=n,r=0,u=0,t=0;t<n.length;++t)i=n[t],r+=i.chunkSize(),u+=i.height,i.parent=this;this.size=r;this.height=u;this.parent=null}function vw(n,t,i){ci(t)<(n.curOp&&n.curOp.scrollTop||n.doc.scrollTop)&&il(n,i)}function gn(n,t,i,r){var u=new bu(n,i,r),f=n.cm;return f&&u.noHScroll&&(f.display.alignWidgets=!0),le(n,t,"widget",function(t){var i=t.widgets||(t.widgets=[]),r;return u.insertAt==null?i.push(u):i.splice(Math.min(i.length,Math.max(0,u.insertAt)),0,u),u.line=t,f&&!bi(n,t)&&(r=ci(t)<n.scrollTop,ni(t,t.height+gf(u)),r&&il(f,u.height),f.curOp.forceUpdate=!0),!0}),f&&d(f,"lineWidgetAdded",f,u,typeof t=="number"?t:c(t)),u}function ku(n,t,i,f,e){var o,l,h,s,a,c;if(f&&f.shared)return ntt(n,t,i,f,e);if(n.cm&&!n.cm.curOp)return b(n.cm,ku)(n,t,i,f,e);if(o=new ai(n,e),l=u(t,i),f&&fr(f,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=nu("span",[o.replacedWith],"CodeMirror-widget"),f.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),f.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(lv(n,t.line,t,i,o)||t.line!=i.line&&lv(n,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");nd()}if(o.addToHistory&&bp(n,{from:t,to:i,origin:"markText"},n.sel,NaN),h=t.line,s=n.cm,n.iter(h,i.line+1,function(n){s&&o.collapsed&&!s.options.lineWrapping&&ii(n)==s.display.maxLine&&(a=!0);o.collapsed&&h!=t.line&&ni(n,0);id(n,new ho(o,h==t.line?t.ch:null,h==i.line?i.ch:null));++h}),o.collapsed&&n.iter(t.line,i.line+1,function(t){bi(n,t)&&ni(t,0)}),o.clearOnEnter&&r(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(gk(),(n.history.done.length||n.history.undone.length)&&n.clearHistory()),o.collapsed&&(o.id=++pl,o.atomic=!0),s){if(a&&(s.curOp.updateMaxLine=!0),o.collapsed)et(s,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(c=t.line;c<=i.line;c++)ki(s,c,"text");o.atomic&&rw(s.doc);d(s,"markerAdded",s,o)}return o}function ntt(n,t,i,r,u){r=fr(r);r.shared=!1;var e=[ku(n,t,i,r,u)],o=e[0],h=r.widgetNode;return ir(n,function(n){h&&(r.widgetNode=h.cloneNode(!0));e.push(ku(n,f(n,t),f(n,i),r,u));for(var c=0;c<n.linked.length;++c)if(n.linked[c].isParent)return;o=s(e)}),new du(e,o)}function yw(t){return t.findMarks(n(t.first,0),t.clipPos(n(t.lastLine())),function(n){return n.parent})}function ttt(n,t){for(var f,r=0;r<t.length;r++){var i=t[r],e=i.find(),o=n.clipPos(e.from),s=n.clipPos(e.to);u(o,s)&&(f=ku(n,o,s,i.primary,i.primary.type),i.markers.push(f),f.parent=i)}}function itt(n){for(var i=function(t){var i=n[t],f=[i.primary.doc],r,u;for(ir(i.primary.doc,function(n){return f.push(n)}),r=0;r<i.markers.length;r++)u=i.markers[r],g(f,u.doc)==-1&&(u.parent=null,i.markers.splice(r--,1))},t=0;t<n.length;t++)i(t)}function rtt(n){var t=this,i,r,u,c,o,s;if((ww(t),!w(t,n)&&!li(t.display,n))&&(ft(n),e&&(wl=+new Date),i=pr(t,n,!0),r=n.dataTransfer.files,i&&!t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File){var l=r.length,a=Array(l),v=0,h=function(){++v==l&&b(t,function(){i=f(t.doc,i);var n={from:i,to:i,text:t.doc.splitLines(a.filter(function(n){return n!=null}).join(t.doc.lineSeparator())),origin:"paste"};pu(t.doc,n);tw(t.doc,nr(f(t.doc,i),f(t.doc,tr(n))))})()},y=function(n,i){if(t.options.allowDropFileTypes&&g(t.options.allowDropFileTypes,n.type)==-1){h();return}var r=new FileReader;r.onerror=function(){return h()};r.onload=function(){var n=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(n)){h();return}a[i]=n;h()};r.readAsText(n)};for(u=0;u<r.length;u++)y(r[u],u)}else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(n);setTimeout(function(){return t.display.input.focus()},20);return}try{if(c=n.dataTransfer.getData("Text"),c){if(t.state.draggingText&&!t.state.draggingText.copy&&(o=t.listSelections()),fs(t.doc,nr(i,i)),o)for(s=0;s<o.length;++s)wu(t.doc,"",o[s].anchor,o[s].head,"drag");t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(p){}}}function utt(n,t){if(e&&(!n.state.draggingText||+new Date-wl<100)){yf(t);return}if(!w(n,t)&&!li(n.display,t)&&(t.dataTransfer.setData("Text",n.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ws)){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";wt&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop);t.dataTransfer.setDragImage(r,0,0);wt&&r.parentNode.removeChild(r)}}function ftt(n,t){var u=pr(n,t),r;u&&(r=document.createDocumentFragment(),ky(n,u,r),n.display.dragCursor||(n.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),n.display.lineSpace.insertBefore(n.display.dragCursor,n.display.cursorDiv)),ct(n.display.dragCursor,r))}function ww(n){n.display.dragCursor&&(n.display.lineSpace.removeChild(n.display.dragCursor),n.display.dragCursor=null)}function bw(n){var r,t,i,u;if(document.getElementsByClassName){for(r=document.getElementsByClassName("CodeMirror"),t=[],i=0;i<r.length;i++)u=r[i].CodeMirror,u&&t.push(u);t.length&&t[0].operation(function(){for(var i=0;i<t.length;i++)n(t[i])})}}function ett(){bl||(ott(),bl=!0)}function ott(){var n;r(window,"resize",function(){n==null&&(n=setTimeout(function(){n=null;bw(stt)},100))});r(window,"blur",function(){return bw(hu)})}function stt(n){var t=n.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=!1;n.setSize()}function htt(n){var i=n.split(/-(?!$)/),u,f,e,o,r,t;for(n=i[i.length-1],r=0;r<i.length-1;r++)if(t=i[r],/^(cmd|meta|m)$/i.test(t))o=!0;else if(/^a(lt)?$/i.test(t))u=!0;else if(/^(c|ctrl|control)$/i.test(t))f=!0;else if(/^s(hift)?$/i.test(t))e=!0;else throw new Error("Unrecognized modifier name: "+t);return u&&(n="Alt-"+n),f&&(n="Ctrl-"+n),o&&(n="Cmd-"+n),e&&(n="Shift-"+n),n}function ctt(n){var e={},t,o,r,u,f,i,s,h;for(t in n)if(n.hasOwnProperty(t)){if(o=n[t],/^(name|fallthrough|(de|at)tach)$/.test(t))continue;if(o=="..."){delete n[t];continue}for(r=ro(t.split(" "),htt),u=0;u<r.length;u++)if(f=void 0,i=void 0,u==r.length-1?(i=r.join(" "),f=o):(i=r.slice(0,u+1).join(" "),f="..."),s=e[i],s){if(s!=f)throw new Error("Inconsistent bindings for "+i);}else e[i]=f;delete n[t]}for(h in e)n[h]=e[h];return n}function tf(n,t,i,r){var u,f,e;if(t=ss(t),u=t.call?t.call(n,r):t[n],u===!1)return"nothing";if(u==="...")return"multi";if(u!=null&&i(u))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return tf(n,t.fallthrough,i,r);for(f=0;f<t.fallthrough.length;f++)if(e=tf(n,t.fallthrough[f],i,r),e)return e}}function kw(n){var t=typeof n=="string"?n:vi[n.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function dw(n,t,i){var r=n;return t.altKey&&r!="Alt"&&(n="Alt-"+n),(bs?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(n="Ctrl-"+n),(bs?t.ctrlKey:t.metaKey)&&r!="Mod"&&(n="Cmd-"+n),!i&&t.shiftKey&&r!="Shift"&&(n="Shift-"+n),n}function gw(n,t){if(wt&&n.keyCode==34&&n.char)return!1;var i=vi[n.keyCode];return i==null||n.altGraphKey?!1:(n.keyCode==3&&n.code&&(i=n.code),dw(i,n,t))}function ss(n){return typeof n=="string"?fi[n]:n}function rf(n,t){for(var r,e,o=n.doc.sel.ranges,i=[],f=0;f<o.length;f++){for(r=t(o[f]);i.length&&u(r.from,s(i).to)<=0;)if(e=i.pop(),u(e.from,r.from)<0){r.from=e.from;break}i.push(r)}ot(n,function(){for(var t=i.length-1;t>=0;t--)wu(n.doc,"",i[t].from,i[t].to,"+delete");cu(n)})}function kl(n,t,i){var r=aa(n.text,t+i,i);return r<0||r>n.text.length?null:r}function dl(t,i,r){var u=kl(t,i.ch,r);return u==null?null:new n(i.line,u,r<0?"after":"before")}function gl(t,i,r,u,f){var h,c,a;if(t&&(i.doc.direction=="rtl"&&(f=-f),h=hi(r,i.doc.direction),h)){var o=f<0?s(h):h[0],v=f<0==(o.level==1),l=v?"after":"before",e;return o.level>0||i.doc.direction=="rtl"?(c=eu(i,r),e=f<0?r.text.length-1:0,a=ui(i,c,e).top,e=af(function(n){return ui(i,c,n).top==a},f<0==(o.level==1)?o.from:o.to-1,e),l=="before"&&(e=kl(r,e,1))):e=f<0?o.to:o.from,new n(u,e,l)}return new n(u,f<0?r.text.length:0,f<0?"before":"after")}function ltt(t,i,r,u){var o=hi(i,t.doc.direction),v,f,l,e,b,p,h,a;if(!o||(r.ch>=i.text.length?(r.ch=i.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after"),v=vf(o,r.ch,r.sticky),f=o[v],t.doc.direction=="ltr"&&f.level%2==0&&(u>0?f.to>r.ch:f.from<r.ch)))return dl(i,r,u);var s=function(t,r){return kl(i,t instanceof n?t.ch:t,r)},y,w=function(n){return t.options.lineWrapping?(y=y||eu(t,i),yy(t,i,y,n)):{begin:0,end:i.text.length}},c=w(r.sticky=="before"?s(r,-1):r.ch);return(t.doc.direction=="rtl"||f.level==1)&&(l=f.level==1==u<0,e=s(r,l?1:-1),e!=null&&(l?e<=f.to&&e<=c.end:e>=f.from&&e>=c.begin))?(b=l?"before":"after",new n(r.line,e,b)):(p=function(t,i,u){for(var c=function(t,i){return i?new n(r.line,s(t,1),"before"):new n(r.line,t,"after")};t>=0&&t<o.length;t+=i){var e=o[t],h=i>0==(e.level!=1),f=h?u.begin:s(u.end,-1);if(e.from<=f&&f<e.to||(f=h?e.from:s(e.to,-1),u.begin<=f&&f<u.end))return c(f,h)}},h=p(v+u,u,c),h)?h:(a=u>0?c.end:s(c.begin,-1),a!=null&&!(u>0&&a==i.text.length)&&(h=p(u>0?0:o.length-1,u,w(a)),h))?h:null}function nb(n,i){var u=t(n.doc,i),r=ii(u);return r!=u&&(i=c(r)),gl(!0,n,r,i,1)}function att(n,i){var r=t(n.doc,i),u=od(r);return u!=r&&(i=c(u)),gl(!0,n,r,i,-1)}function tb(i,r){var u=nb(i,r.line),e=t(i.doc,u.line),o=hi(e,i.doc.direction),f,s;return!o||o[0].level==0?(f=Math.max(u.ch,e.text.search(/\S/)),s=r.line==u.line&&r.ch<=f&&r.ch,n(u.line,s?0:f,u.sticky)):u}function hs(n,t,i){if(typeof t=="string"&&(t=uf[t],!t))return!1;n.display.input.ensurePolled();var u=n.display.shift,r=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0);i&&(n.display.shift=!1);r=t(n)!=io}finally{n.display.shift=u;n.state.suppressEdits=!1}return r}function vtt(n,t,i){for(var u,r=0;r<n.state.keyMaps.length;r++)if(u=tf(t,n.state.keyMaps[r],i,n),u)return u;return n.options.extraKeys&&tf(t,n.options.extraKeys,i,n)||tf(t,n.options.keyMap,i,n)}function pe(n,t,i,r){var u=n.state.keySeq;if(u){if(kw(t))return"handled";if(/\'$/.test(t)?n.state.keySeq=null:ib.set(50,function(){n.state.keySeq==u&&(n.state.keySeq=null,n.display.input.reset())}),rb(n,u+" "+t,i,r))return!0}return rb(n,t,i,r)}function rb(n,t,i,r){var u=vtt(n,t,r);return u=="multi"&&(n.state.keySeq=t),u=="handled"&&d(n,"keyHandled",n,t,i),(u=="handled"||u=="multi")&&(ft(i),dc(n)),!!u}function ub(n,t){var i=gw(t,!0);return i?t.shiftKey&&!n.state.keySeq?pe(n,"Shift-"+i,t,function(t){return hs(n,t,!0)})||pe(n,i,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return hs(n,t)}):pe(n,i,t,function(t){return hs(n,t)}):!1}function ytt(n,t,i){return pe(n,"'"+i+"'",t,function(t){return hs(n,t,!0)})}function fb(n){var t=this,i,r;n.target&&n.target!=t.display.input.getField()||(t.curOp.focus=oi(),w(t,n))||(e&&l<11&&n.keyCode==27&&(n.returnValue=!1),i=n.keyCode,t.display.shift=i==16||n.shiftKey,r=ub(t,n),wt&&(cs=r?i:null,r||i!=88||ak||!(at?n.metaKey:n.ctrlKey)||t.replaceSelection("",null,"cut")),ei&&!at&&!r&&i==46&&n.shiftKey&&!n.ctrlKey&&document.execCommand&&document.execCommand("cut"),i!=18||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||ptt(t))}function ptt(n){function t(n){n.keyCode!=18&&n.altKey||(yi(i,"CodeMirror-crosshair"),lt(document,"keyup",t),lt(document,"mouseover",t))}var i=n.display.lineDiv;ur(i,"CodeMirror-crosshair");r(document,"keyup",t);r(document,"mouseover",t)}function eb(n){n.keyCode==16&&(this.doc.sel.shift=!1);w(this,n)}function ob(n){var t=this,i,r,u;if((!n.target||n.target==t.display.input.getField())&&!li(t.display,n)&&!w(t,n)&&(!n.ctrlKey||n.altKey)&&(!at||!n.metaKey)){if(i=n.keyCode,r=n.charCode,wt&&i==cs){cs=null;ft(n);return}if((!wt||!(!n.which||n.which<10)||!ub(t,n))&&(u=String.fromCharCode(r==null?i:r),u!="\b")&&!ytt(t,n,u))t.display.input.onKeyPress(n)}}function wtt(n,t){var i=+new Date;return be&&be.compare(i,n,t)?(we=be=null,"triple"):we&&we.compare(i,n,t)?(be=new ls(i,n,t),we=null,"double"):(we=new ls(i,n,t),be=null,"single")}function hb(n){var t=this,i=t.display;if(!w(t,n)&&(!i.activeTouch||!i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=n.shiftKey,li(i,n)){it||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!na(t,n)){var r=pr(t,n),u=wa(n),f=r?wtt(r,u):"single";if(window.focus(),u==1&&t.state.selectingText&&t.state.selectingText(n),!r||!btt(t,u,r,f,n))if(u==1)r?dtt(t,r,f,n):oh(n)==i.scroller&&ft(n);else if(u==2)r&&us(t.doc,r),setTimeout(function(){return i.input.focus()},20);else if(u==3)if(to)t.display.input.onContextMenu(n);else gc(t)}}}function btt(n,t,i,r,u){var f="Click";return r=="double"?f="Double"+f:r=="triple"&&(f="Triple"+f),f=(t==1?"Left":t==2?"Middle":"Right")+f,pe(n,dw(f,u),u,function(t){if(typeof t=="string"&&(t=uf[t]),!t)return!1;var r=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0);r=t(n,i)!=io}finally{n.state.suppressEdits=!1}return r})}function ktt(n,t,i){var u=n.getOption("configureMouse"),r=u?u(n,t,i):{},f;return r.unit==null&&(f=fk?i.shiftKey&&i.metaKey:i.altKey,r.unit=f?"rectangle":t=="single"?"char":t=="double"?"word":"line"),(r.extend==null||n.doc.extend)&&(r.extend=n.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=at?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(at?i.altKey:i.ctrlKey)),r}function dtt(n,t,i,r){e?setTimeout(ds(dy,n),0):n.curOp.focus=oi();var o=ktt(n,i,r),s=n.doc.sel,f;n.options.dragDrop&&ba&&!n.isReadOnly()&&i=="single"&&(f=s.contains(t))>-1&&(u((f=s.ranges[f]).from(),t)<0||t.xRel>0)&&(u(f.to(),t)>0||t.xRel<0)?gtt(n,r,t,o):nit(n,r,t,o)}function gtt(n,t,i,u){var f=n.display,s=!1,o=b(n,function(t){it&&(f.scroller.draggable=!1);n.state.draggingText=!1;n.state.delayingBlurEvent&&(n.hasFocus()?n.state.delayingBlurEvent=!1:gc(n));lt(f.wrapper.ownerDocument,"mouseup",o);lt(f.wrapper.ownerDocument,"mousemove",h);lt(f.scroller,"dragstart",c);lt(f.scroller,"drop",o);s||(ft(t),u.addNew||us(n.doc,i,null,null,u.extend),it&&!ws||e&&l==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0});f.input.focus()},20):f.input.focus())}),h=function(n){s=s||Math.abs(t.clientX-n.clientX)+Math.abs(t.clientY-n.clientY)>=10},c=function(){return s=!0};it&&(f.scroller.draggable=!0);n.state.draggingText=o;o.copy=!u.moveOnDrag;r(f.wrapper.ownerDocument,"mouseup",o);r(f.wrapper.ownerDocument,"mousemove",h);r(f.scroller,"dragstart",c);r(f.scroller,"drop",o);n.state.delayingBlurEvent=!0;setTimeout(function(){return f.input.focus()},20);f.scroller.dragDrop&&f.scroller.dragDrop()}function cb(t,i,r){if(r=="char")return new o(i,i);if(r=="word")return t.findWordAt(i);if(r=="line")return new o(n(i.line,0),f(t.doc,n(i.line+1,0)));var u=r(t,i);return new o(u.from,u.to)}function nit(i,s,h,c){function ot(r){var e,st,k,v,rt;if(u(g,r)!=0)if(g=r,c.unit=="rectangle"){var s=[],b=i.options.tabSize,ut=vt(t(l,h.line).text,h.ch,b),ft=vt(t(l,r.line).text,r.ch,b),et=Math.min(ut,ft),ot=Math.max(ut,ft);for(e=Math.min(h.line,r.line),st=Math.min(i.lastLine(),Math.max(h.line,r.line));e<=st;e++)k=t(l,e).text,v=nh(k,et,b),et==ot?s.push(new o(n(e,v),n(e,v))):k.length>v&&s.push(new o(n(e,v),n(e,nh(k,ot,b))));s.length||s.push(new o(h,h));nt(l,dt(i,w.ranges.slice(0,a).concat(s),a),{origin:"*mouse",scroll:!1});i.scrollIntoView(r)}else{var tt=y,p=cb(i,r,c.unit),d=tt.anchor,it;u(p.anchor,d)>0?(it=p.head,d=so(tt.from(),p.anchor)):(it=p.anchor,d=oo(tt.to(),p.head));rt=w.ranges.slice(0);rt[a]=tit(i,new o(f(l,d),it));nt(l,dt(i,rt,a),gs)}}function rt(n){var e=++k,t=pr(i,n,!0,c.unit=="rectangle"),r,f;t&&(u(t,g)!=0?(i.curOp.focus=oi(),ot(t),r=ns(v,l),(t.line>=r.to||t.line<r.from)&&setTimeout(b(i,function(){k==e&&rt(n)}),150)):(f=n.clientY<it.top?-20:n.clientY>it.bottom?20:0,f&&setTimeout(b(i,function(){k==e&&(v.scroller.scrollTop+=f,rt(n))}),50)))}function et(n){i.state.selectingText=!1;k=Infinity;n&&(ft(n),v.input.focus());lt(v.wrapper.ownerDocument,"mousemove",ut);lt(v.wrapper.ownerDocument,"mouseup",tt);l.history.lastSelOrigin=null}var v,l,y,a,w,p,d,g,it,k,ut,tt;e&&gc(i);v=i.display;l=i.doc;ft(s);w=l.sel;p=w.ranges;c.addNew&&!c.extend?(a=l.sel.contains(h),y=a>-1?p[a]:new o(h,h)):(y=l.sel.primary(),a=l.sel.primIndex);c.unit=="rectangle"?(c.addNew||(y=new o(h,h)),h=pr(i,s,!0,!0),a=-1):(d=cb(i,h,c.unit),y=c.extend?vl(y,d.anchor,d.head,c.extend):d);c.addNew?a==-1?(a=p.length,nt(l,dt(i,p.concat([y]),a),{scroll:!1,origin:"*mouse"})):p.length>1&&p[a].empty()&&c.unit=="char"&&!c.extend?(nt(l,dt(i,p.slice(0,a).concat(p.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),w=l.sel):yl(l,a,y,gs):(a=0,nt(l,new ht([y],0),gs),w=l.sel);g=h;it=v.wrapper.getBoundingClientRect();k=0;ut=b(i,function(n){n.buttons!==0&&wa(n)?rt(n):et(n)});tt=b(i,et);i.state.selectingText=tt;r(v.wrapper.ownerDocument,"mousemove",ut);r(v.wrapper.ownerDocument,"mouseup",tt)}function tit(i,r){var f=r.anchor,e=r.head,d=t(i.doc,f.line),s,l,h,c,a,v,y;if(u(f,e)==0&&f.sticky==e.sticky||(s=hi(d),!s)||(l=vf(s,f.ch,f.sticky),h=s[l],h.from!=f.ch&&h.to!=f.ch)||(c=l+(h.from==f.ch==(h.level!=1)?0:1),c==0||c==s.length))return r;e.line!=f.line?a=(e.line-f.line)*(i.doc.direction=="ltr"?1:-1)>0:(v=vf(s,e.ch,e.sticky),y=v-l||(e.ch-f.ch)*(h.level==1?-1:1),a=v==c-1||v==c?y<0:y>0);var p=s[c+(a?-1:0)],w=a==(p.level==1),b=w?p.from:p.to,k=w?"after":"before";return f.ch==b&&f.sticky==k?r:new o(new n(f.line,b,k),e)}function lb(n,t,i,r){var e,u,o,s,f,h,c,l;if(t.touches)e=t.touches[0].clientX,u=t.touches[0].clientY;else try{e=t.clientX;u=t.clientY}catch(a){return!1}if(e>=Math.floor(n.display.gutters.getBoundingClientRect().right))return!1;if(r&&ft(t),o=n.display,s=o.lineDiv.getBoundingClientRect(),u>s.bottom||!yt(n,i))return eh(t);for(u-=s.top-o.viewOffset,f=0;f<n.display.gutterSpecs.length;++f)if(h=o.gutters.childNodes[f],h&&h.getBoundingClientRect().right>=e)return c=cr(n.doc,u),l=n.display.gutterSpecs[f],p(n,i,n,c,l.className,t),eh(t)}function na(n,t){return lb(n,t,"gutterClick",!0)}function ab(n,t){if(!li(n.display,t)&&!iit(n,t)&&!w(n,t,"contextmenu")&&!to)n.display.input.onContextMenu(t)}function iit(n,t){return yt(n,"gutterContextMenu")?lb(n,t,"gutterContextMenu",!1):!1}function vb(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-");ne(n)}function rit(t){function i(n,i,u,f){t.defaults[n]=i;u&&(r[n]=f?function(n,t,i){i!=ff&&u(n,t,i)}:u)}var r=t.optionHandlers;t.defineOption=i;t.Init=ff;i("value","",function(n,t){return n.setValue(t)},!0);i("mode",null,function(n,t){n.doc.modeOption=t;cl(n)},!0);i("indentUnit",2,cl,!0);i("indentWithTabs",!1);i("smartIndent",!0);i("tabSize",4,function(n){he(n);ne(n);et(n)},!0);i("lineSeparator",null,function(t,i){var r,f,u;if(t.doc.lineSep=i,i)for(r=[],f=t.doc.first,t.doc.iter(function(t){for(var u,e=0;;){if(u=t.text.indexOf(i,e),u==-1)break;e=u+i.length;r.push(n(f,u))}f++}),u=r.length-1;u>=0;u--)wu(t.doc,i,r[u],n(r[u].line,r[u].ch+i.length))});i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,t,i){n.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");i!=ff&&n.refresh()});i("specialCharPlaceholder",ld,function(n){return n.refresh()},!0);i("electricChars",!0);i("inputStyle",hf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor");},!0);i("spellcheck",!1,function(n,t){return n.getInputField().spellcheck=t},!0);i("autocorrect",!1,function(n,t){return n.getInputField().autocorrect=t},!0);i("autocapitalize",!1,function(n,t){return n.getInputField().autocapitalize=t},!0);i("rtlMoveVisually",!ek);i("wholeLineUpdateBefore",!0);i("theme","default",function(n){vb(n);oe(n)},!0);i("keyMap","default",function(n,t,i){var u=ss(t),r=i!=ff&&ss(i);r&&r.detach&&r.detach(n,u);u.attach&&u.attach(n,r||null)});i("extraKeys",null);i("configureMouse",null);i("lineWrapping",!1,fit,!0);i("gutters",[],function(n,t){n.display.gutterSpecs=sl(t,n.options.lineNumbers);oe(n)},!0);i("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?bc(n.display)+"px":"0";n.refresh()},!0);i("coverGutterNextToScrollbar",!1,function(n){return au(n)},!0);i("scrollbarStyle","native",function(n){rp(n);au(n);n.display.scrollbars.setScrollTop(n.doc.scrollTop);n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0);i("lineNumbers",!1,function(n,t){n.display.gutterSpecs=sl(n.options.gutters,t);oe(n)},!0);i("firstLineNumber",1,oe,!0);i("lineNumberFormatter",function(n){return n},oe,!0);i("showCursorWhenSelecting",!1,te,!0);i("resetSelectionOnContextMenu",!0);i("lineWiseCopyCut",!0);i("pasteLinesPerSelection",!0);i("selectionsMayTouch",!1);i("readOnly",!1,function(n,t){t=="nocursor"&&(hu(n),n.display.input.blur());n.display.input.readOnlyChanged(t)});i("screenReaderLabel",null,function(n,t){t=t===""?null:t;n.display.input.screenReaderLabelChanged(t)});i("disableInput",!1,function(n,t){t||n.display.input.reset()},!0);i("dragDrop",!0,uit);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,te,!0);i("singleCursorHeightPerLine",!0,te,!0);i("workTime",100);i("workDelay",100);i("flattenSpans",!0,he,!0);i("addModeClass",!1,he,!0);i("pollInterval",100);i("undoDepth",200,function(n,t){return n.doc.history.undoDepth=t});i("historyEventDelay",1250);i("viewportMargin",10,function(n){return n.refresh()},!0);i("maxHighlightLength",1e4,he,!0);i("moveInputWithCursor",!0,function(n,t){t||n.display.input.resetPosition()});i("tabindex",null,function(n,t){return n.display.input.getField().tabIndex=t||""});i("autofocus",null);i("direction","ltr",function(n,t){return n.doc.setDirection(t)},!0);i("phrases",null)}function uit(n,t,i){var e=i&&i!=ff,u,f;!t!=!e&&(u=n.display.dragFunctions,f=t?r:lt,f(n.display.scroller,"dragstart",u.start),f(n.display.scroller,"dragenter",u.enter),f(n.display.scroller,"dragover",u.over),f(n.display.scroller,"dragleave",u.leave),f(n.display.scroller,"drop",u.drop))}function fit(n){n.options.lineWrapping?(ur(n.display.wrapper,"CodeMirror-wrap"),n.display.sizer.style.minWidth="",n.display.sizerWidth=null):(yi(n.display.wrapper,"CodeMirror-wrap"),fc(n));kc(n);et(n);ne(n);setTimeout(function(){return au(n)},100)}function a(n,t){var u=this,i,s,r,f,o;if(!(this instanceof a))return new a(n,t);this.options=t=t?fr(t):{};fr(yb,t,!1);i=t.value;typeof i=="string"?i=new ut(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode);this.doc=i;s=new a.inputStyles[t.inputStyle](this);r=this.display=new hn(n,i,s,t);r.wrapper.CodeMirror=this;vb(this);t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");rp(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new si,keySeq:null,specialChars:null};t.autofocus&&!hf&&r.input.focus();e&&l<11&&setTimeout(function(){return u.display.input.reset(!0)},20);eit(this);ett();kr(this);this.curOp.forceUpdate=!0;yp(this,i);t.autofocus&&!hf||this.hasFocus()?setTimeout(function(){u.hasFocus()&&!u.state.focused&&nl(u)},20):hu(this);for(f in as)as.hasOwnProperty(f)&&as[f](this,t[f],ff);for(op(this),t.finishInit&&t.finishInit(this),o=0;o<vs.length;++o)vs[o](this);dr(this);it&&t.lineWrapping&&getComputedStyle(r.lineDiv).textRendering=="optimizelegibility"&&(r.lineDiv.style.textRendering="auto")}function eit(t){function c(){i.activeTouch&&(h=setTimeout(function(){return i.activeTouch=null},1e3),s=i.activeTouch,s.end=+new Date)}function v(n){if(n.touches.length!=1)return!1;var t=n.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(n,t){if(t.left==null)return!0;var i=t.left-n.left,r=t.top-n.top;return i*i+r*r>400}var i=t.display,h,s,u;r(i.scroller,"mousedown",b(t,hb));e&&l<11?r(i.scroller,"dblclick",b(t,function(n){var i,r;w(t,n)||(i=pr(t,n),!i||na(t,n)||li(t.display,n))||(ft(n),r=t.findWordAt(i),us(t.doc,r.anchor,r.head))})):r(i.scroller,"dblclick",function(n){return w(t,n)||ft(n)});r(i.scroller,"contextmenu",function(n){return ab(t,n)});r(i.input.getField(),"contextmenu",function(n){i.scroller.contains(n.target)||ab(t,n)});s={end:0};r(i.scroller,"touchstart",function(n){if(!w(t,n)&&!v(n)&&!na(t,n)){i.input.ensurePolled();clearTimeout(h);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-s.end<=300?s:null};n.touches.length==1&&(i.activeTouch.left=n.touches[0].pageX,i.activeTouch.top=n.touches[0].pageY)}});r(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)});r(i.scroller,"touchend",function(r){var u=i.activeTouch,e,s;u&&!li(i,r)&&u.left!=null&&!u.moved&&new Date-u.start<300&&(e=t.coordsChar(i.activeTouch,"page"),s=!u.prev||a(u,u.prev)?new o(e,e):!u.prev.prev||a(u,u.prev.prev)?t.findWordAt(e):new o(n(e.line,0),f(t.doc,n(e.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),ft(r));c()});r(i.scroller,"touchcancel",c);r(i.scroller,"scroll",function(){i.scroller.clientHeight&&(re(t,i.scroller.scrollTop),br(t,i.scroller.scrollLeft,!0),p(t,"scroll",t))});r(i.scroller,"mousewheel",function(n){return cp(t,n)});r(i.scroller,"DOMMouseScroll",function(n){return cp(t,n)});r(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0});i.dragFunctions={enter:function(n){w(t,n)||yf(n)},over:function(n){w(t,n)||(ftt(t,n),yf(n))},start:function(n){return utt(t,n)},drop:b(t,rtt),leave:function(n){w(t,n)||ww(t)}};u=i.input.getField();r(u,"keyup",function(n){return eb.call(t,n)});r(u,"keydown",b(t,fb));r(u,"keypress",b(t,ob));r(u,"focus",function(n){return nl(t,n)});r(u,"blur",function(n){return hu(t,n)})}function ke(i,r,u,f){var s=i.doc,d,c,e,l,y,w,a,b,k;u==null&&(u="add");u=="smart"&&(s.mode.indent?d=bf(i,r).state:u="prev");var v=i.options.tabSize,h=t(s,r),p=vt(h.text,null,v);if(h.stateAfter&&(h.stateAfter=null),c=h.text.match(/^\s*/)[0],f||/\S/.test(h.text)){if(u=="smart"&&(e=s.mode.indent(d,h.text.slice(c.length),h.text),e==io||e>150)){if(!f)return;u="prev"}}else e=0,u="not";if(u=="prev"?e=r>s.first?vt(t(s,r-1).text,null,v):0:u=="add"?e=p+i.options.indentUnit:u=="subtract"?e=p-i.options.indentUnit:typeof u=="number"&&(e=p+u),e=Math.max(0,e),l="",y=0,i.options.indentWithTabs)for(w=Math.floor(e/v);w;--w)y+=v,l+="\t";if(y<e&&(l+=th(e-y)),l!=c)return wu(s,l,n(r,0),n(r,c.length),"+input"),h.stateAfter=null,!0;for(a=0;a<s.sel.ranges.length;a++)if(b=s.sel.ranges[a],b.head.line==r&&b.head.ch<c.length){k=n(r,c.length);yl(s,a,new o(k,k));break}}function ys(n){pt=n}function ta(i,r,u,f,e){var p=i.doc,y,g,v,b;i.display.shift=!1;f||(f=p.sel);var k=+new Date-200,l=e=="paste"||i.state.pasteIncoming>k,a=ch(r),o=null;if(l&&f.ranges.length>1)if(pt&&pt.text.join("\n")==r){if(f.ranges.length%pt.text.length==0)for(o=[],y=0;y<pt.text.length;y++)o.push(p.splitLines(pt.text[y]))}else a.length==f.ranges.length&&i.options.pasteLinesPerSelection&&(o=ro(a,function(n){return[n]}));for(g=i.curOp.updateInput,v=f.ranges.length-1;v>=0;v--){var w=f.ranges[v],h=w.from(),c=w.to();w.empty()&&(u&&u>0?h=n(h.line,h.ch-u):i.state.overwrite&&!l?c=n(c.line,Math.min(t(p,c.line).text.length,c.ch+s(a).length)):l&&pt&&pt.lineWise&&pt.text.join("\n")==a.join("\n")&&(h=c=n(h.line,0)));b={from:h,to:c,text:o?o[v%o.length]:a,origin:e||(l?"paste":i.state.cutIncoming>k?"cut":"+input")};pu(i.doc,b);d(i,"inputRead",i,b)}r&&!l&&wb(i,r);cu(i);i.curOp.updateInput<2&&(i.curOp.updateInput=g);i.curOp.typing=!0;i.state.pasteIncoming=i.state.cutIncoming=-1}function pb(n,t){var i=n.clipboardData&&n.clipboardData.getData("Text");if(i)return n.preventDefault(),t.isReadOnly()||t.options.disableInput||ot(t,function(){return ta(t,i,0,null,"paste")}),!0}function wb(n,i){var e,u,r,f,o,s;if(n.options.electricChars&&n.options.smartIndent)for(e=n.doc.sel,u=e.ranges.length-1;u>=0;u--)if(r=e.ranges[u],!(r.head.ch>100)&&(!u||e.ranges[u-1].head.line!=r.head.line)){if(f=n.getModeAt(r.head),o=!1,f.electricChars){for(s=0;s<f.electricChars.length;s++)if(i.indexOf(f.electricChars.charAt(s))>-1){o=ke(n,r.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(t(n.doc,r.head.line).text.slice(0,r.head.ch))&&(o=ke(n,r.head.line,"smart"));o&&d(n,"electricInput",n,r.head.line)}}function bb(t){for(var u,i,f=[],e=[],r=0;r<t.doc.sel.ranges.length;r++)u=t.doc.sel.ranges[r].head.line,i={anchor:n(u,0),head:n(u+1,0)},e.push(i),f.push(t.getRange(i.anchor,i.head));return{text:f,ranges:e}}function kb(n,t,i,r){n.setAttribute("autocorrect",i?"":"off");n.setAttribute("autocapitalize",r?"":"off");n.setAttribute("spellcheck",!!t)}function db(){var n=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[n],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return it?n.style.width="1000px":n.setAttribute("wrap","off"),sf&&(n.style.border="1px solid black"),kb(n),t}function oit(i){var u=i.optionHandlers,r=i.helpers={};i.prototype={constructor:i,focus:function(){window.focus();this.display.input.focus()},setOption:function(n,t){var i=this.options,r=i[n];(i[n]!=t||n=="mode")&&(i[n]=t,u.hasOwnProperty(n)&&b(this,u[n])(this,t,r),p(this,"optionChange",this,n))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,t){this.state.keyMaps[t?"push":"unshift"](ss(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if(i[t]==n||i[t].name==n)return i.splice(t,1),!0},addOverlay:rt(function(n,t){var r=n.token?n:i.getMode(this.options,n);if(r.startState)throw new Error("Overlays may not be stateful.");ok(this.state.overlays,{mode:r,modeSpec:n,opaque:t&&t.opaque,priority:t&&t.priority||0},function(n){return n.priority});this.state.modeGen++;et(this)}),removeOverlay:rt(function(n){for(var r,i=this.state.overlays,t=0;t<i.length;++t)if(r=i[t].modeSpec,r==n||typeof n=="string"&&r.name==n){i.splice(t,1);this.state.modeGen++;et(this);return}}),indentLine:rt(function(n,t,i){typeof t!="string"&&typeof t!="number"&&(t=t==null?this.options.smartIndent?"smart":"prev":t?"add":"subtract");pf(this.doc,n)&&ke(this,n,t,i)}),indentSelection:rt(function(n){for(var i,u,f,e=this.doc.sel.ranges,r=-1,t=0;t<e.length;t++)if(i=e[t],i.empty())i.head.line>r&&(ke(this,i.head.line,n,!0),r=i.head.line,t==this.doc.sel.primIndex&&cu(this));else{var s=i.from(),h=i.to(),c=Math.max(r,s.line);for(r=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1,u=c;u<r;++u)ke(this,u,n);f=this.doc.sel.ranges;s.ch==0&&e.length==f.length&&f[t].from().ch>0&&yl(this.doc,t,new o(s,f[t].to()),gt)}}),getTokenAt:function(n,t){return rv(this,n,t)},getLineTokens:function(t,i){return rv(this,n(t),i,!0)},getTokenTypeAt:function(n){var i,e;n=f(this.doc,n);var u=tv(this,t(this.doc,n.line)),s=0,h=(u.length-1)/2,o=n.ch,r;if(o==0)r=u[2];else for(;;)if(i=s+h>>1,(i?u[i*2-1]:0)>=o)h=i;else if(u[i*2+1]<o)s=i+1;else{r=u[i*2+2];break}return e=r?r.indexOf("overlay "):-1,e<0?r:e==0?null:r.slice(0,e-1)},getModeAt:function(n){var t=this.doc.mode;return t.innerMode?i.innerMode(t,this.getTokenAt(n).state).mode:t},getHelper:function(n,t){return this.getHelpers(n,t)[0]},getHelpers:function(n,t){var f=[],u,i,e,h,o,s;if(!r.hasOwnProperty(t))return f;if(u=r[t],i=this.getModeAt(n),typeof i[t]=="string")u[i[t]]&&f.push(u[i[t]]);else if(i[t])for(e=0;e<i[t].length;e++)h=u[i[t][e]],h&&f.push(h);else i.helperType&&u[i.helperType]?f.push(u[i.helperType]):u[i.name]&&f.push(u[i.name]);for(o=0;o<u._global.length;o++)s=u._global[o],s.pred(i,this)&&g(f,s.val)==-1&&f.push(s.val);return f},getStateAfter:function(n,t){var i=this.doc;return n=da(i,n==null?i.first+i.size-1:n),bf(this,n+1,t).state},cursorCoords:function(n,t){var r,i=this.doc.sel.primary();return r=n==null?i.head:typeof n=="object"?f(this.doc,n):n?i.from():i.to(),kt(this,r,t||"page")},charCoords:function(n,t){return ac(this,f(this.doc,n),t||"page")},coordsChar:function(n,t){return n=ly(this,n,t||"page"),yc(this,n.left,n.top)},lineAtHeight:function(n,t){return n=ly(this,{top:n,left:0},t||"page").top,cr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,r){var f=!1,u,e;return typeof n=="number"?(e=this.doc.first+this.doc.size-1,n<this.doc.first?n=this.doc.first:n>e&&(n=e,f=!0),u=t(this.doc,n)):u=n,wo(this,u,{top:0,left:0},i||"page",r||f).top+(f?this.doc.height-ci(u):0)},defaultTextHeight:function(){return ou(this.display)},defaultCharWidth:function(){return su(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,t,i,r,u){var s=this.display,o,e,h,c;n=kt(this,f(this.doc,n));o=n.bottom;e=n.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);s.sizer.appendChild(t);r=="over"?o=n.top:(r=="above"||r=="near")&&(h=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth),(r=="above"||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?o=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(o=n.bottom),e+t.offsetWidth>c&&(e=c-t.offsetWidth));t.style.top=o+"px";t.style.left=t.style.right="";u=="right"?(e=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(u=="left"?e=0:u=="middle"&&(e=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px");i&&wg(this,{left:e,top:o,right:e+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:rt(fb),triggerOnKeyPress:rt(ob),triggerOnKeyUp:eb,triggerOnMouseDown:rt(hb),execCommand:function(n){if(uf.hasOwnProperty(n))return uf[n].call(null,this)},triggerElectric:rt(function(n){wb(this,n)}),findPosH:function(n,t,i,r){var o=1,u,e;for(t<0&&(o=-1,t=-t),u=f(this.doc,n),e=0;e<t;++e)if(u=ia(this.doc,u,o,i,r),u.hitSide)break;return u},moveH:rt(function(n,t){var i=this;this.extendSelectionsBy(function(r){return i.display.shift||i.doc.extend||r.empty()?ia(i.doc,r.head,n,t,i.options.rtlMoveVisually):n<0?r.from():r.to()},cf)}),deleteH:rt(function(n,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):rf(this,function(r){var u=ia(i,r.head,n,t,!1);return n<0?{from:u,to:r.head}:{from:r.head,to:u}})}),findPosV:function(n,t,i,r){var h=1,o=r,u,s,e;for(t<0&&(h=-1,t=-t),u=f(this.doc,n),s=0;s<t;++s)if(e=kt(this,u,"div"),o==null?o=e.left:e.left=o,u=gb(this,e,h,i),u.hitSide)break;return u},moveV:rt(function(n,t){var u=this,i=this.doc,f=[],e=!this.display.shift&&!i.extend&&i.sel.somethingSelected(),r;if(i.extendSelectionsBy(function(r){var o,s;return e?n<0?r.from():r.to():(o=kt(u,r.head,"div"),r.goalColumn!=null&&(o.left=r.goalColumn),f.push(o.left),s=gb(u,o,n,t),t=="page"&&r==i.sel.primary()&&il(u,ac(u,s,"div").top-o.top),s)},cf),f.length)for(r=0;r<i.sel.ranges.length;r++)i.sel.ranges[r].goalColumn=f[r]}),findWordAt:function(i){var c=this.doc,u=t(c,i.line).text,r=i.ch,f=i.ch,e,s,h;if(u){for(e=this.getHelper(i,"wordChars"),(i.sticky=="before"||f==u.length)&&r?--r:++f,s=u.charAt(r),h=uo(s,e)?function(n){return uo(n,e)}:/\s/.test(s)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!uo(n)};r>0&&h(u.charAt(r-1));)--r;while(f<u.length&&h(u.charAt(f)))++f}return new o(n(i.line,r),n(i.line,f))},toggleOverwrite:function(n){(n==null||n!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?ur(this.display.cursorDiv,"CodeMirror-overwrite"):yi(this.display.cursorDiv,"CodeMirror-overwrite"),p(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==oi()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:rt(function(n,t){ie(this,n,t)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-ri(this)-this.display.barHeight,width:n.scrollWidth-ri(this)-this.display.barWidth,clientHeight:sc(this),clientWidth:vr(this)}},scrollIntoView:rt(function(t,i){t==null?(t={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof t=="number"?t={from:n(t,0),to:null}:t.from==null&&(t={from:t,to:null});t.to||(t.to=t.from);t.margin=i||0;t.from.line!=null?bg(this,t):np(this,t.from,t.to,t.margin)}),setSize:rt(function(n,t){var u=this,r=function(n){return typeof n=="number"||/^\d+$/.test(String(n))?n+"px":n},i;n!=null&&(this.display.wrapper.style.width=r(n));t!=null&&(this.display.wrapper.style.height=r(t));this.options.lineWrapping&&sy(this);i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(n){if(n.widgets)for(var t=0;t<n.widgets.length;t++)if(n.widgets[t].noHScroll){ki(u,i,"widget");break}++i});this.curOp.forceUpdate=!0;p(this,"refresh",this)}),operation:function(n){return ot(this,n)},startOperation:function(){return kr(this)},endOperation:function(){return dr(this)},refresh:rt(function(){var n=this.display.cachedTextHeight;et(this);this.curOp.forceUpdate=!0;ne(this);ie(this,this.doc.scrollLeft,this.doc.scrollTop);el(this.display);(n==null||Math.abs(n-ou(this.display))>.5||this.options.lineWrapping)&&kc(this);p(this,"refresh",this)}),swapDoc:rt(function(n){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yp(this,n),ne(this),this.display.input.reset(),ie(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,d(this,"swapDoc",this,t),t}),phrase:function(n){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};uu(i);i.registerHelper=function(n,t,u){r.hasOwnProperty(n)||(r[n]=i[n]={_global:[]});r[n][t]=u};i.registerGlobalHelper=function(n,t,u,f){i.registerHelper(n,t,f);r[n]._global.push({pred:u,val:f})}}function ia(i,r,u,f,e){function k(){var u=r.line+w;return u<i.first||u>=i.first+i.size?!1:(r=new n(u,r.ch,r.sticky),o=t(i,u))}function h(t){var s,h;if(f=="codepoint"?(h=o.text.charCodeAt(r.ch+(f>0?0:-1)),s=isNaN(h)?null:new n(r.line,Math.max(0,Math.min(o.text.length,r.ch+u*(h>=55296&&h<56320?2:1))),-u)):s=e?ltt(i.cm,o,r,u):dl(o,r,u),s==null)if(!t&&k())r=gl(e,i.cm,o,r.line,w);else return!1;else r=s;return!0}var p=r,b=u,o=t(i,r.line),w=e&&i.direction=="rtl"?-u:u,c,l,s,a;if(f=="char"||f=="codepoint")h();else if(f=="column")h(!0);else if(f=="word"||f=="group"){var v=null,y=f=="group",d=i.cm&&i.cm.getHelper(r,"wordChars");for(c=!0;;c=!1){if(u<0&&!h(!c))break;if(l=o.text.charAt(r.ch)||"\n",s=uo(l,d)?"w":y&&l=="\n"?"n":!y||/\s/.test(l)?null:"p",!y||c||s||(s="s"),v&&v!=s){u<0&&(u=1,h(),r.sticky="after");break}if(s&&(v=s),u>0&&!h(!c))break}}return a=es(i,r,p,b,!0),wh(p,a)&&(a.hitSide=!0),a}function gb(n,t,i,r){var s=n.doc,h=t.left,u,e,o,f;for(r=="page"?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=Math.max(e-.5*ou(n.display),3),u=(i>0?t.bottom:t.top)+i*o):r=="line"&&(u=i>0?t.bottom+3:t.top-3);;){if(f=yc(n,h,u),!f.outside)break;if(i<0?u<=0:u>=s.height){f.hitSide=!0;break}u+=i*5}return f}function nk(n,i){var u=hc(n,i.line),s,r;if(!u||u.hidden)return null;var f=t(n.doc,i.line),h=uy(u,f,i.line),e=hi(f,n.doc.direction),o="left";return e&&(s=vf(e,i.ch),o=s%2?"right":"left"),r=ey(h.map,i.ch,o),r.offset=r.collapse=="right"?r.end:r.start,r}function sit(n){for(var t=n;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ef(n,t){return t&&(n.bad=!0),n}function hit(t,i,r,u,f){function v(n){return function(t){return t.id==n}}function l(){s&&(e+=h,o&&(e+=h),s=o=!1)}function c(n){n&&(l(),e+=n)}function a(i){var e,y,p,w,b,r;if(i.nodeType==1){if(e=i.getAttribute("cm-text"),e){c(e);return}if(y=i.getAttribute("cm-marker"),y){w=t.findMarks(n(u,0),n(f+1,0),v(+y));w.length&&(p=w[0].find(0))&&c(hr(t.doc,p.from,p.to).join(h));return}if(i.getAttribute("contenteditable")=="false")return;if(b=/^(pre|div|p|li|table|br)$/i.test(i.nodeName),!/^br$/i.test(i.nodeName)&&i.textContent.length==0)return;for(b&&l(),r=0;r<i.childNodes.length;r++)a(i.childNodes[r]);/^(pre|p)$/i.test(i.nodeName)&&(o=!0);b&&(s=!0)}else i.nodeType==3&&c(i.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var e="",s=!1,h=t.doc.lineSeparator(),o=!1;;){if(a(i),i==r)break;i=i.nextSibling;o=!1}return e}function ps(t,i,r){var u,f,e;if(i==t.display.lineDiv){if(u=t.display.lineDiv.childNodes[r],!u)return ef(t.clipPos(n(t.display.viewTo-1)),!0);i=null;r=0}else for(u=i;;u=u.parentNode){if(!u||u==t.display.lineDiv)return null;if(u.parentNode&&u.parentNode==t.display.lineDiv)break}for(f=0;f<t.display.view.length;f++)if(e=t.display.view[f],e.node==u)return cit(e,i,r)}function cit(t,i,r){function w(i,r,u){for(var o,e,s,l,h,f=-1;f<(v?v.length:0);f++)for(o=f<0?p.map:v[f],e=0;e<o.length;e+=3)if(s=o[e+2],s==i||s==r)return l=c(f<0?t.line:t.rest[f]),h=o[e]+u,(u<0||s!=i)&&(h=o[e+(u?1:0)]),n(l,h)}var a=t.text.firstChild,l=!1,y,f,e,p,v,u,o,b,h,k;if(!i||!wi(a,i))return ef(n(c(t.line),0),!0);if(i==a&&(l=!0,i=a.childNodes[r],r=0,!i))return y=t.rest?s(t.rest):t.line,ef(n(c(y),y.text.length),l);for(f=i.nodeType==3?i:null,e=i,f||i.childNodes.length!=1||i.firstChild.nodeType!=3||(f=i.firstChild,r&&(r=f.nodeValue.length));e.parentNode!=a;)e=e.parentNode;if(p=t.measure,v=p.maps,u=w(f,e,r),u)return ef(u,l);for(o=e.nextSibling,b=f?f.nodeValue.length-r:0;o;o=o.nextSibling){if(u=w(o,o.firstChild,0),u)return ef(n(u.line,u.ch-b),l);b+=o.textContent.length}for(h=e.previousSibling,k=r;h;h=h.previousSibling){if(u=w(h,h.firstChild,-1),u)return ef(n(u.line,u.ch+k),l);k+=h.textContent.length}}function lit(n,t){function u(){n.value=s.getValue()}var f,e,i,o,s;if(t=t?fr(t):{},t.value=n.value,!t.tabindex&&n.tabIndex&&(t.tabindex=n.tabIndex),!t.placeholder&&n.placeholder&&(t.placeholder=n.placeholder),t.autofocus==null&&(f=oi(),t.autofocus=f==n||n.getAttribute("autofocus")!=null&&f==document.body),n.form&&(r(n.form,"submit",u),!t.leaveSubmitMethodAlone)){i=n.form;e=i.submit;try{o=i.submit=function(){u();i.submit=e;i.submit();i.submit=o}}catch(h){}}return t.finishInit=function(i){i.save=u;i.getTextArea=function(){return n};i.toTextArea=function(){i.toTextArea=isNaN;u();n.parentNode.removeChild(i.getWrapperElement());n.style.display="";n.form&&(lt(n.form,"submit",u),t.leaveSubmitMethodAlone||typeof n.form.submit!="function"||(n.form.submit=e))}},n.style.display="none",s=a(function(t){return n.parentNode.insertBefore(t,n.nextSibling)},t)}function ait(t){t.off=lt;t.on=r;t.wheelEventPixels=cn;t.Doc=ut;t.splitLines=ch;t.countColumn=vt;t.findColumn=nh;t.isWordChar=ih;t.Pass=io;t.signal=p;t.Line=lr;t.changeEnd=tr;t.scrollbarModel=rl;t.Pos=n;t.cmpPos=u;t.modes=fo;t.mimeModes=er;t.resolveMode=eo;t.getMode=ah;t.modeExtensions=or;t.extendMode=wk;t.copyState=sr;t.startState=ka;t.innerMode=vh;t.commands=uf;t.keyMap=fi;t.keyName=gw;t.isModifierKey=kw;t.lookupKey=tf;t.normalizeKeyMap=ctt;t.StringStream=y;t.SharedTextMarker=du;t.TextMarker=ai;t.LineWidget=bu;t.e_preventDefault=ft;t.e_stopPropagation=pa;t.e_stop=yf;t.addClass=ur;t.contains=wi;t.rmClass=yi;t.keyNames=vi}var tt=navigator.userAgent,ra=navigator.platform,ei=/gecko\/\d/i.test(tt),ua=/MSIE \d/.test(tt),fa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tt),of=/Edge\/(\d+)/.exec(tt),e=ua||fa||of,l=e&&(ua?document.documentMode||6:+(of||fa)[1]),it=!of&&/WebKit\//.test(tt),ik=it&&/Qt\/\d+\.\d+/.test(tt),ge=!of&&/Chrome\//.test(tt),wt=/Opera\//.test(tt),ws=/Apple Computer/.test(navigator.vendor),rk=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(tt),uk=/PhantomJS/.test(tt),sf=!of&&/AppleWebKit/.test(tt)&&/Mobile\/\w+/.test(tt),no=/Android/.test(tt),hf=sf||no||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(tt),at=sf||/Mac/.test(ra),fk=/\bCrOS\b/.test(tt),ek=/win/i.test(ra),rr=wt&&tt.match(/Version\/(\d*\.\d*)/),bs,to,yi,tu,iu,si,lf,ha,la,ru,va,uh,r,ba,sh,hh,fo,er,or,y,wf,bt,gh,nc,ti,lr,vv,yv,ar,fu,cc,yr,gi,lu,rl,up,ee,se,st,ht,o,bu,pl,ai,du,pw,ut,wl,bl,vi,gu,ye,nf,fi,uf,ib,cs,sb,ls,we,be,vs,pt,h,v,tk,de;rr&&(rr=Number(rr[1]));rr&&rr>=15&&(wt=!1,it=!0);bs=at&&(ik||wt&&(rr==null||rr<12.11));to=ei||e&&l>=9;yi=function(n,t){var r=n.className,i=gr(t).exec(r),u;i&&(u=r.slice(i.index+i[0].length),n.className=r.slice(0,i.index)+(u?i[1]+u:""))};tu=document.createRange?function(n,t,i,r){var u=document.createRange();return u.setEnd(r||n,i),u.setStart(n,t),u}:function(n,t,i){var r=document.body.createTextRange();try{r.moveToElementText(n.parentNode)}catch(u){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};iu=function(n){n.select()};sf?iu=function(n){n.selectionStart=0;n.selectionEnd=n.value.length}:e&&(iu=function(n){try{n.select()}catch(t){}});si=function(){this.id=null;this.f=null;this.time=0;this.handler=ds(this.onTimeout,this)};si.prototype.onTimeout=function(n){n.id=0;n.time<=+new Date?n.f():setTimeout(n.handler,n.time-+new Date)};si.prototype.set=function(n,t){this.f=t;var i=+new Date+n;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,n),this.time=i)};var ea=50,io={toString:function(){return"CodeMirror.Pass"}},gt={scroll:!1},gs={origin:"*mouse"},cf={origin:"+move"};lf=[""];ha=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;la=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;ru=null;va=function(){function o(n){return n<=247?f.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":n==8204?"b":"L"}function n(n,t,i){this.level=n;this.from=t;this.to=i}var f="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",h=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/;return function(f,e){var nt=e=="ltr"?"L":"R",a,c,st,ut,vt,yt,tt,pt,ft,d,g,ht,p,wt,w,kt,ct,et,bt,lt,b,k,at,v,it,l,gt,y,ti;if(f.length==0||e=="ltr"&&!h.test(f))return!1;for(a=f.length,c=[],st=0;st<a;++st)c.push(o(f.charCodeAt(st)));for(ut=0,vt=nt;ut<a;++ut)yt=c[ut],yt=="m"?c[ut]=vt:vt=yt;for(tt=0,pt=nt;tt<a;++tt)ft=c[tt],ft=="1"&&pt=="r"?c[tt]="n":i.test(ft)&&(pt=ft,ft=="r"&&(c[tt]="R"));for(d=1,g=c[0];d<a-1;++d)ht=c[d],ht=="+"&&g=="1"&&c[d+1]=="1"?c[d]="1":ht==","&&g==c[d+1]&&(g=="1"||g=="n")&&(c[d]=g),g=ht;for(p=0;p<a;++p)if(wt=c[p],wt==",")c[p]="N";else if(wt=="%"){for(w=void 0,w=p+1;w<a&&c[w]=="%";++w);for(kt=p&&c[p-1]=="!"||w<a&&c[w]=="1"?"1":"N",ct=p;ct<w;++ct)c[ct]=kt;p=w-1}for(et=0,bt=nt;et<a;++et)lt=c[et],bt=="L"&&lt=="1"?c[et]="L":i.test(lt)&&(bt=lt);for(b=0;b<a;++b)if(t.test(c[b])){for(k=void 0,k=b+1;k<a&&t.test(c[k]);++k);var dt=(b?c[b-1]:nt)=="L",ii=(k<a?c[k]:nt)=="L",ri=dt==ii?dt?"L":"R":nt;for(at=b;at<k;++at)c[at]=ri;b=k-1}for(v=[],l=0;l<a;)if(r.test(c[l])){for(gt=l,++l;l<a&&r.test(c[l]);++l);v.push(new n(0,gt,l))}else{var rt=l,ot=v.length,ni=e=="rtl"?1:0;for(++l;l<a&&c[l]!="L";++l);for(y=rt;y<l;)if(u.test(c[y])){for(rt<y&&(v.splice(ot,0,new n(1,rt,y)),ot+=ni),ti=y,++y;y<l&&u.test(c[y]);++y);v.splice(ot,0,new n(2,ti,y));ot+=ni;rt=y}else++y;rt<l&&v.splice(ot,0,new n(1,rt,l))}return e=="ltr"&&(v[0].level==1&&(it=f.match(/^\s+/))&&(v[0].from=it[0].length,v.unshift(new n(0,0,it[0].length))),s(v).level==1&&(it=f.match(/\s+$/))&&(s(v).to-=it[0].length,v.push(new n(0,a-it[0].length,a)))),e=="rtl"?v.reverse():v}}();uh=[];r=function(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={});r[t]=(r[t]||uh).concat(i)}};ba=function(){if(e&&l<9)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}();var ch="\n\nb".split(/\n/).length!=3?function(n){for(var i=0,f=[],e=n.length,t,r,u;i<=e;)t=n.indexOf("\n",i),t==-1&&(t=n.length),r=n.slice(i,n.charAt(t-1)=="\r"?t-1:t),u=r.indexOf("\r"),u!=-1?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},lk=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(t){return!1}}:function(n){var t;try{t=n.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=n?!1:t.compareEndPoints("StartToEnd",t)!=0},ak=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),lh=null;for(fo={},er={},or={},y=function(n,t,i){this.pos=this.start=0;this.string=n;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i},y.prototype.eol=function(){return this.pos>=this.string.length},y.prototype.sol=function(){return this.pos==this.lineStart},y.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},y.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},y.prototype.eat=function(n){var t=this.string.charAt(this.pos),i;return i=typeof n=="string"?t==n:t&&(n.test?n.test(t):n(t)),i?(++this.pos,t):void 0},y.prototype.eatWhile=function(n){for(var t=this.pos;this.eat(n););return this.pos>t},y.prototype.eatSpace=function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},y.prototype.skipToEnd=function(){this.pos=this.string.length},y.prototype.skipTo=function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return this.pos=t,!0},y.prototype.backUp=function(n){this.pos-=n},y.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=vt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?vt(this.string,this.lineStart,this.tabSize):0)},y.prototype.indentation=function(){return vt(this.string,null,this.tabSize)-(this.lineStart?vt(this.string,this.lineStart,this.tabSize):0)},y.prototype.match=function(n,t,i){var u,f,r;if(typeof n=="string"){if(u=function(n){return i?n.toLowerCase():n},f=this.string.substr(this.pos,n.length),u(f)==u(n))return t!==!1&&(this.pos+=n.length),!0}else return(r=this.string.slice(this.pos).match(n),r&&r.index>0)?null:(r&&t!==!1&&(this.pos+=r[0].length),r)},y.prototype.current=function(){return this.string.slice(this.start,this.pos)},y.prototype.hideFirstChars=function(n,t){this.lineStart+=n;try{return t()}finally{this.lineStart-=n}},y.prototype.lookAhead=function(n){var t=this.lineOracle;return t&&t.lookAhead(n)},y.prototype.baseToken=function(){var n=this.lineOracle;return n&&n.baseToken(this.pos)},wf=function(n,t){this.state=n;this.lookAhead=t},bt=function(n,t,i,r){this.state=t;this.doc=n;this.line=i;this.maxLookAhead=r||0;this.baseTokens=null;this.baseTokenPos=1},bt.prototype.lookAhead=function(n){var t=this.doc.getLine(this.line+n);return t!=null&&n>this.maxLookAhead&&(this.maxLookAhead=n),t},bt.prototype.baseToken=function(n){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=n)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},bt.prototype.nextLine=function(){this.line++;this.maxLookAhead>0&&this.maxLookAhead--},bt.fromSaved=function(n,t,i){return t instanceof wf?new bt(n,sr(n.mode,t.state),i,t.lookAhead):new bt(n,sr(n.mode,t),i)},bt.prototype.save=function(n){var t=n!==!1?sr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wf(t,this.maxLookAhead):t},gh=function(n,t,i){this.start=n.start;this.end=n.pos;this.string=n.current();this.type=t||null;this.state=i},nc=!1,ti=!1,lr=function(n,t,i){this.text=n;sv(this,t);this.height=i?i(this):1},lr.prototype.lineNo=function(){return c(this)},uu(lr),vv={},yv={},ar=null,fu=null,cc={left:0,right:0,top:0,bottom:0},gi=function(n,t,u){this.cm=u;var f=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");f.tabIndex=o.tabIndex=-1;n(f);n(o);r(f,"scroll",function(){f.clientHeight&&t(f.scrollTop,"vertical")});r(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;e&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},gi.prototype.update=function(n){var i=n.scrollWidth>n.clientWidth+1,r=n.scrollHeight>n.clientHeight+1,t=n.nativeBarWidth,u,f;return r?(this.vert.style.display="block",this.vert.style.bottom=i?t+"px":"0",u=n.viewHeight-(i?t:0),this.vert.firstChild.style.height=Math.max(0,n.scrollHeight-n.clientHeight+u)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),i?(this.horiz.style.display="block",this.horiz.style.right=r?t+"px":"0",this.horiz.style.left=n.barLeft+"px",f=n.viewWidth-n.barLeft-(r?t:0),this.horiz.firstChild.style.width=Math.max(0,n.scrollWidth-n.clientWidth+f)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&n.clientHeight>0&&(t==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?t:0,bottom:i?t:0}},gi.prototype.setScrollLeft=function(n){this.horiz.scrollLeft!=n&&(this.horiz.scrollLeft=n);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gi.prototype.setScrollTop=function(n){this.vert.scrollTop!=n&&(this.vert.scrollTop=n);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gi.prototype.zeroWidthHack=function(){var n=at&&!rk?"12px":"18px";this.horiz.style.height=this.vert.style.width=n;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new si;this.disableVert=new si},gi.prototype.enableZeroWidthBar=function(n,t,i){function r(){var u=n.getBoundingClientRect(),f=i=="vert"?document.elementFromPoint(u.right-1,(u.top+u.bottom)/2):document.elementFromPoint((u.right+u.left)/2,u.bottom-1);f!=n?n.style.pointerEvents="none":t.set(1e3,r)}n.style.pointerEvents="auto";t.set(1e3,r)},gi.prototype.clear=function(){var n=this.horiz.parentNode;n.removeChild(this.horiz);n.removeChild(this.vert)},lu=function(){},lu.prototype.update=function(){return{bottom:0,right:0}},lu.prototype.setScrollLeft=function(){},lu.prototype.setScrollTop=function(){},lu.prototype.clear=function(){},rl={"native":gi,"null":lu},up=0,ee=function(n,t,i){var r=n.display;this.viewport=t;this.visible=ns(r,n.doc,t);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=vr(n);this.force=i;this.dims=wc(n);this.events=[]},ee.prototype.signal=function(n,t){yt(n,t)&&this.events.push(arguments)},ee.prototype.finish=function(){for(var n=0;n<this.events.length;n++)p.apply(null,this.events[n])},se=0,st=null,e?st=-.53:ei?st=15:ge?st=-.7:ws&&(st=-1/3),ht=function(n,t){this.ranges=n;this.primIndex=t},ht.prototype.primary=function(){return this.ranges[this.primIndex]},ht.prototype.equals=function(n){var t,i,r;if(n==this)return!0;if(n.primIndex!=this.primIndex||n.ranges.length!=this.ranges.length)return!1;for(t=0;t<this.ranges.length;t++)if(i=this.ranges[t],r=n.ranges[t],!wh(i.anchor,r.anchor)||!wh(i.head,r.head))return!1;return!0},ht.prototype.deepCopy=function(){for(var t=[],n=0;n<this.ranges.length;n++)t[n]=new o(bh(this.ranges[n].anchor),bh(this.ranges[n].head));return new ht(t,this.primIndex)},ht.prototype.somethingSelected=function(){for(var n=0;n<this.ranges.length;n++)if(!this.ranges[n].empty())return!0;return!1},ht.prototype.contains=function(n,t){var i,r;for(t||(t=n),i=0;i<this.ranges.length;i++)if(r=this.ranges[i],u(t,r.from())>=0&&u(n,r.to())<=0)return i;return-1},o=function(n,t){this.anchor=n;this.head=t},o.prototype.from=function(){return so(this.anchor,this.head)},o.prototype.to=function(){return oo(this.anchor,this.head)},o.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ae.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var r,i=n,u=n+t;i<u;++i)r=this.lines[i],this.height-=r.height,cd(r),d(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.push.apply(n,this.lines)},insertInner:function(n,t,i){this.height+=i;this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}},ve.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),(t-=f)==0)break;n=0}else n-=u;this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ae))&&(e=[],this.collapse(e),this.children=[new ae(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0;t<this.children.length;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,r,o,s,f,e;for(this.size+=t.length,this.height+=i,u=0;u<this.children.length;++u){if(r=this.children[u],o=r.chunkSize(),n<=o){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){for(s=r.lines.length%25+25,f=s;f<r.lines.length;)e=new ae(r.lines.slice(f,f+=25)),r.height-=e.height,this.children.splice(++u,0,e),e.parent=this;r.lines=r.lines.slice(0,s);this.maybeSpill()}break}n-=o}},maybeSpill:function(){var n,r,t,i,u;if(!(this.children.length<=10)){n=this;do r=n.children.splice(n.children.length-5,5),t=new ve(r),n.parent?(n.size-=t.size,n.height-=t.height,u=g(n.parent.children,n),n.parent.children.splice(u+1,0,t)):(i=new ve(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0;r<this.children.length;++r)if(f=this.children[r],u=f.chunkSize(),n<u){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if((t-=e)==0)break;n=0}else n-=u}},bu=function(n,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=n;this.node=t},bu.prototype.clear=function(){var n=this.doc.cm,t=this.line.widgets,i=this.line,u=c(i),r,f;if(u!=null&&t){for(r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);f=gf(this);ni(i,Math.max(0,i.height-f));n&&(ot(n,function(){vw(n,i,-f);ki(n,u,"widget")}),d(n,"lineWidgetCleared",n,this,u))}},bu.prototype.changed=function(){var r=this,u=this.height,n=this.doc.cm,t=this.line,i;(this.height=null,i=gf(this)-u,i)&&(bi(this.doc,t)||ni(t,t.height+i),n&&ot(n,function(){n.curOp.forceUpdate=!0;vw(n,t,i);d(n,"lineWidgetChanged",n,r,c(t))}))},uu(bu),pl=0,ai=function(n,t){this.lines=[];this.type=t;this.doc=n;this.id=++pl},ai.prototype.clear=function(){var n,s,u,i,f,e,t,r,o,h,l;if(!this.explicitlyCleared){for(n=this.doc.cm,s=n&&!n.curOp,s&&kr(n),yt(this,"clear")&&(u=this.find(),u&&d(this,"clear",u.from,u.to)),i=null,f=null,e=0;e<this.lines.length;++e)t=this.lines[e],r=kf(t.markedSpans,this),n&&!this.collapsed?ki(n,c(t),"text"):n&&(r.to!=null&&(f=c(t)),r.from!=null&&(i=c(t))),t.markedSpans=td(t.markedSpans,r),r.from==null&&this.collapsed&&!bi(this.doc,t)&&n&&ni(t,ou(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(o=0;o<this.lines.length;++o)h=ii(this.lines[o]),l=vo(h),l>n.display.maxLineLength&&(n.display.maxLine=h,n.display.maxLineLength=l,n.display.maxLineChanged=!0);i!=null&&n&&this.collapsed&&et(n,i,f+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&rw(n.doc));n&&d(n,"markerCleared",n,this,i,f);s&&dr(n);this.parent&&this.parent.clear()}},ai.prototype.find=function(t,i){var f,o,e,r,u;for(t==null&&this.type=="bookmark"&&(t=1),e=0;e<this.lines.length;++e){if(r=this.lines[e],u=kf(r.markedSpans,this),u.from!=null&&(f=n(i?r:c(r),u.from),t==-1))return f;if(u.to!=null&&(o=n(i?r:c(r),u.to),t==1))return o}return f&&{from:f,to:o}},ai.prototype.changed=function(){var r=this,i=this.find(-1,!0),t=this,n=this.doc.cm;i&&n&&ot(n,function(){var u=i.line,s=c(i.line),e=hc(n,s),o,f;e&&(oy(e),n.curOp.selectionChanged=n.curOp.forceUpdate=!0);n.curOp.updateMaxLine=!0;bi(t.doc,u)||t.height==null||(o=t.height,t.height=null,f=gf(t)-o,f&&ni(u,u.height+f));d(n,"markerChanged",n,r)})},ai.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&g(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},ai.prototype.detachLine=function(n){if(this.lines.splice(g(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},uu(ai),du=function(n,t){this.markers=n;this.primary=t;for(var i=0;i<n.length;++i)n[i].parent=this},du.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();d(this,"clear")}},du.prototype.find=function(n,t){return this.primary.find(n,t)},uu(du),pw=0,ut=function(t,i,r,u,f){if(!(this instanceof ut))return new ut(t,i,r,u,f);r==null&&(r=0);ve.call(this,[new ae([new lr("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=r;var e=n(r,0);this.sel=nr(e);this.history=new is(null);this.id=++pw;this.modeOption=i;this.lineSep=u;this.direction=f=="rtl"?"rtl":"ltr";this.extend=!1;typeof t=="string"&&(t=this.splitLines(t));ll(this,{from:e,to:e,text:t});nt(this,nr(e),gt)},ut.prototype=sa(ve.prototype,{constructor:ut,iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=yh(this,this.first,this.first+this.size);return n===!1?t:t.join(n||this.lineSeparator())},setValue:k(function(i){var r=n(this.first,0),u=this.first+this.size-1;pu(this,{from:r,to:n(u,t(this,u).text.length),text:this.splitLines(i),origin:"setValue",full:!0},!0);this.cm&&ie(this.cm,0,0);nt(this,nr(r),gt)}),replaceRange:function(n,t,i,r){t=f(this,t);i=i?f(this,i):t;wu(this,n,t,i,r)},getRange:function(n,t,i){var r=hr(this,f(this,n),f(this,t));return i===!1?r:r.join(i||this.lineSeparator())},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},getLineHandle:function(n){if(pf(this,n))return t(this,n)},getLineNumber:function(n){return c(n)},getLineHandleVisualStart:function(n){return typeof n=="number"&&(n=t(this,n)),ii(n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return f(this,n)},getCursor:function(n){var t=this.sel.primary();return n==null||n=="head"?t.head:n=="anchor"?t.anchor:n=="end"||n=="to"||n===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:k(function(t,i,r){nw(this,f(this,typeof t=="number"?n(t,i||0):t),null,r)}),setSelection:k(function(n,t,i){nw(this,f(this,n),f(this,t||n),i)}),extendSelection:k(function(n,t,i){us(this,f(this,n),t&&f(this,t),i)}),extendSelections:k(function(n,t){gp(this,ga(this,n),t)}),extendSelectionsBy:k(function(n,t){var i=ro(this.sel.ranges,n);gp(this,ga(this,i),t)}),setSelections:k(function(n,t,i){var u,r;if(n.length){for(u=[],r=0;r<n.length;r++)u[r]=new o(f(this,n[r].anchor),f(this,n[r].head));t==null&&(t=Math.min(n.length-1,this.sel.primIndex));nt(this,dt(this.cm,u,t),i)}}),addSelection:k(function(n,t,i){var r=this.sel.ranges.slice(0);r.push(new o(f(this,n),f(this,t||n)));nt(this,dt(this.cm,r,r.length-1),i)}),getSelection:function(n){for(var u,r=this.sel.ranges,t,i=0;i<r.length;i++)u=hr(this,r[i].from(),r[i].to()),t=t?t.concat(u):u;return n===!1?t:t.join(n||this.lineSeparator())},getSelections:function(n){for(var i,u=[],r=this.sel.ranges,t=0;t<r.length;t++)i=hr(this,r[t].from(),r[t].to()),n!==!1&&(i=i.join(n||this.lineSeparator())),u[t]=i;return u},replaceSelection:function(n,t,i){for(var u=[],r=0;r<this.sel.ranges.length;r++)u[r]=n;this.replaceSelections(u,t,i||"+input")},replaceSelections:k(function(n,t,i){for(var e,o,f,u=[],s=this.sel,r=0;r<s.ranges.length;r++)e=s.ranges[r],u[r]={from:e.from(),to:e.to(),text:this.splitLines(n[r]),origin:i};for(o=t&&t!="end"&&ln(this,u,t),f=u.length-1;f>=0;f--)pu(this,u[f]);o?tw(this,o):this.cm&&cu(this.cm)}),undo:k(function(){os(this,"undo")}),redo:k(function(){os(this,"redo")}),undoSelection:k(function(){os(this,"undo",!0)}),redoSelection:k(function(){os(this,"redo",!0)}),setExtending:function(n){this.extend=n},getExtending:function(){return this.extend},historySize:function(){for(var t,n=this.history,r=0,u=0,i=0;i<n.done.length;i++)n.done[i].ranges||++r;for(t=0;t<n.undone.length;t++)n.undone[t].ranges||++u;return{undo:r,redo:u}},clearHistory:function(){var n=this;this.history=new is(this.history.maxGeneration);ir(this,function(t){return t.history=n.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(n){return n&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(n){return this.history.generation==(n||this.cleanGeneration)},getHistory:function(){return{done:vu(this.history.done),undone:vu(this.history.undone)}},setHistory:function(n){var t=this.history=new is(this.history.maxGeneration);t.done=vu(n.done.slice(0),null,!0);t.undone=vu(n.undone.slice(0),null,!0)},setGutterMarker:k(function(n,t,i){return le(this,n,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&ca(r)&&(n.gutterMarkers=null),!0})}),clearGutter:k(function(n){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[n]&&le(t,i,"gutter",function(){return i.gutterMarkers[n]=null,ca(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(n){var i;if(typeof n=="number"){if(!pf(this,n)||(i=n,n=t(this,n),!n))return null}else if(i=c(n),i==null)return null;return{line:i,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},addLineClass:k(function(n,t,i){return le(this,n,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(n[r]){if(gr(i).test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:k(function(n,t,i){return le(this,n,t=="gutter"?"gutter":"class",function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",u=n[f],r,e;if(u)if(i==null)n[f]=null;else{if(r=u.match(gr(i)),!r)return!1;e=r.index+r[0].length;n[f]=u.slice(0,r.index)+(!r.index||e==u.length?"":" ")+u.slice(e)||null}else return!1;return!0})}),addLineWidget:k(function(n,t,i){return gn(this,n,t,i)}),removeLineWidget:function(n){n.clear()},markText:function(n,t,i){return ku(this,f(this,n),f(this,t),i,i&&i.type||"range")},setBookmark:function(n,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return n=f(this,n),ku(this,n,n,i,"bookmark")},findMarksAt:function(n){var e,r,u,i;if(n=f(this,n),e=[],r=t(this,n.line).markedSpans,r)for(u=0;u<r.length;++u)i=r[u],(i.from==null||i.from<=n.ch)&&(i.to==null||i.to>=n.ch)&&e.push(i.marker.parent||i.marker);return e},findMarks:function(n,t,i){n=f(this,n);t=f(this,t);var u=[],r=n.line;return this.iter(n.line,t.line+1,function(f){var s=f.markedSpans,o,e;if(s)for(o=0;o<s.length;o++)e=s[o],e.to!=null&&r==n.line&&n.ch>=e.to||e.from==null&&r!=n.line||e.from!=null&&r==t.line&&e.from>=t.ch||i&&!i(e.marker)||u.push(e.marker.parent||e.marker);++r}),u},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)r[i].from!=null&&n.push(r[i].marker)}),n},posFromIndex:function(t){var i,r=this.first,u=this.lineSeparator().length;return this.iter(function(n){var f=n.text.length+u;if(f>t)return i=t,!0;t-=f;++r}),f(this,n(r,i))},indexFromPos:function(n){var t,i;return(n=f(this,n),t=n.ch,n.line<this.first||n.ch<0)?0:(i=this.lineSeparator().length,this.iter(this.first,n.line,function(n){t+=n.text.length+i}),t)},copy:function(n){var t=new ut(yh(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var i,r,t;return n||(n={}),i=this.first,r=this.first+this.size,n.from!=null&&n.from>i&&(i=n.from),n.to!=null&&n.to<r&&(r=n.to),t=new ut(yh(this,i,r),n.mode||this.modeOption,i,this.lineSep,this.direction),n.sharedHist&&(t.history=this.history),(this.linked||(this.linked=[])).push({doc:t,sharedHist:n.sharedHist}),t.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],ttt(t,yw(this)),t},unlinkDoc:function(n){var t,r,i;if(n instanceof a&&(n=n.doc),this.linked)for(t=0;t<this.linked.length;++t)if(r=this.linked[t],r.doc==n){this.linked.splice(t,1);n.unlinkDoc(this);itt(yw(this));break}n.history==this.history&&(i=[n.id],ir(n,function(n){return i.push(n.id)},!0),n.history=new is(null),n.history.done=vu(this.history.done,i),n.history.undone=vu(this.history.undone,i))},iterLinkedDocs:function(n){ir(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(n){return this.lineSep?n.split(this.lineSep):ch(n)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:k(function(n){(n!="rtl"&&(n="ltr"),n!=this.direction)&&(this.direction=n,this.iter(function(n){return n.order=null}),this.cm&&an(this.cm))})}),ut.prototype.eachLine=ut.prototype.iter,wl=0,bl=!1,vi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},gu=0;gu<10;gu++)vi[gu+48]=vi[gu+96]=String(gu);for(ye=65;ye<=90;ye++)vi[ye]=String.fromCharCode(ye);for(nf=1;nf<=12;nf++)vi[nf+111]=vi[nf+63235]="F"+nf;fi={};fi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};fi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};fi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};fi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};fi["default"]=at?fi.macDefault:fi.pcDefault;uf={selectAll:ew,singleSelection:function(n){return n.setSelection(n.getCursor("anchor"),n.getCursor("head"),gt)},killLine:function(i){return rf(i,function(r){if(r.empty()){var u=t(i.doc,r.head.line).text.length;return r.head.ch==u&&r.head.line<i.lastLine()?{from:r.head,to:n(r.head.line+1,0)}:{from:r.head,to:n(r.head.line,u)}}return{from:r.from(),to:r.to()}})},deleteLine:function(t){return rf(t,function(i){return{from:n(i.from().line,0),to:f(t.doc,n(i.to().line+1,0))}})},delLineLeft:function(t){return rf(t,function(t){return{from:n(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(n){return rf(n,function(t){var i=n.charCoords(t.head,"div").top+5,r=n.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(n){return rf(n,function(t){var i=n.charCoords(t.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(n){return n.undo()},redo:function(n){return n.redo()},undoSelection:function(n){return n.undoSelection()},redoSelection:function(n){return n.redoSelection()},goDocStart:function(t){return t.extendSelection(n(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(n(t.lastLine()))},goLineStart:function(n){return n.extendSelectionsBy(function(t){return nb(n,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(n){return n.extendSelectionsBy(function(t){return tb(n,t.head)},{origin:"+move",bias:1})},goLineEnd:function(n){return n.extendSelectionsBy(function(t){return att(n,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(t){var i=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:i},"div")},cf)},goLineLeft:function(n){return n.extendSelectionsBy(function(t){var i=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:0,top:i},"div")},cf)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(t){var r=n.cursorCoords(t.head,"div").top+5,i=n.coordsChar({left:0,top:r},"div");return i.ch<n.getLine(i.line).search(/\S/)?tb(n,t.head):i},cf)},goLineUp:function(n){return n.moveV(-1,"line")},goLineDown:function(n){return n.moveV(1,"line")},goPageUp:function(n){return n.moveV(-1,"page")},goPageDown:function(n){return n.moveV(1,"page")},goCharLeft:function(n){return n.moveH(-1,"char")},goCharRight:function(n){return n.moveH(1,"char")},goColumnLeft:function(n){return n.moveH(-1,"column")},goColumnRight:function(n){return n.moveH(1,"column")},goWordLeft:function(n){return n.moveH(-1,"word")},goGroupRight:function(n){return n.moveH(1,"group")},goGroupLeft:function(n){return n.moveH(-1,"group")},goWordRight:function(n){return n.moveH(1,"word")},delCharBefore:function(n){return n.deleteH(-1,"codepoint")},delCharAfter:function(n){return n.deleteH(1,"char")},delWordBefore:function(n){return n.deleteH(-1,"word")},delWordAfter:function(n){return n.deleteH(1,"word")},delGroupBefore:function(n){return n.deleteH(-1,"group")},delGroupAfter:function(n){return n.deleteH(1,"group")},indentAuto:function(n){return n.indentSelection("smart")},indentMore:function(n){return n.indentSelection("add")},indentLess:function(n){return n.indentSelection("subtract")},insertTab:function(n){return n.replaceSelection("\t")},insertSoftTab:function(n){for(var r,e,u=[],f=n.listSelections(),t=n.options.tabSize,i=0;i<f.length;i++)r=f[i].from(),e=vt(n.getLine(r.line),r.ch,t),u.push(th(t-e%t));n.replaceSelections(u)},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.execCommand("insertTab")},transposeChars:function(i){return ot(i,function(){for(var r,u,f,s=i.listSelections(),h=[],e=0;e<s.length;e++)s[e].empty()&&(r=s[e].head,u=t(i.doc,r.line).text,u&&(r.ch==u.length&&(r=new n(r.line,r.ch-1)),r.ch>0?(r=new n(r.line,r.ch+1),i.replaceRange(u.charAt(r.ch-1)+u.charAt(r.ch-2),n(r.line,r.ch-2),r,"+transpose")):r.line>i.doc.first&&(f=t(i.doc,r.line-1).text,f&&(r=new n(r.line,1),i.replaceRange(u.charAt(0)+i.doc.lineSeparator()+f.charAt(f.length-1),n(r.line-1,f.length-1),r,"+transpose")))),h.push(new o(r,r)));i.setSelections(h)})},newlineAndIndent:function(n){return ot(n,function(){for(var r,t=n.listSelections(),i=t.length-1;i>=0;i--)n.replaceRange(n.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");for(t=n.listSelections(),r=0;r<t.length;r++)n.indentLine(t[r].from().line,null,!0);cu(n)})},openLine:function(n){return n.replaceSelection("\n","start")},toggleOverwrite:function(n){return n.toggleOverwrite()}};ib=new si;cs=null;sb=400;ls=function(n,t,i){this.time=n;this.pos=t;this.button=i};ls.prototype.compare=function(n,t,i){return this.time+sb>n&&u(t,this.pos)==0&&i==this.button};var ff={toString:function(){return"CodeMirror.Init"}},yb={},as={};a.defaults=yb;a.optionHandlers=as;vs=[];a.defineInitHook=function(n){return vs.push(n)};pt=null;h=function(n){this.cm=n;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new si;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};h.prototype.init=function(n){function e(n){for(var t=n.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function o(n){var u,o,r,s,h;if(e(n)&&!w(t,n)){if(t.somethingSelected())ys({lineWise:!1,text:t.getSelections()}),n.type=="cut"&&t.replaceSelection("",null,"cut");else if(t.options.lineWiseCopyCut)u=bb(t),ys({lineWise:!0,text:u.text}),n.type=="cut"&&t.operation(function(){t.setSelections(u.ranges,0,gt);t.replaceSelection("",null,"cut")});else return;if(n.clipboardData&&(n.clipboardData.clearData(),o=pt.text.join("\n"),n.clipboardData.setData("Text",o),n.clipboardData.getData("Text")==o)){n.preventDefault();return}r=db();s=r.firstChild;t.display.lineSpace.insertBefore(r,t.display.lineSpace.firstChild);s.value=pt.text.join("\n");h=document.activeElement;iu(s);setTimeout(function(){t.display.lineSpace.removeChild(r);h.focus();h==i&&f.showPrimarySelection()},50)}}var u=this,f=this,t=f.cm,i=f.div=n.lineDiv;kb(i,t.options.spellcheck,t.options.autocorrect,t.options.autocapitalize);r(i,"paste",function(n){!e(n)||w(t,n)||pb(n,t)||l<=11&&setTimeout(b(t,function(){return u.updateFromDOM()}),20)});r(i,"compositionstart",function(n){u.composing={data:n.data,done:!1}});r(i,"compositionupdate",function(n){u.composing||(u.composing={data:n.data,done:!1})});r(i,"compositionend",function(n){u.composing&&(n.data!=u.composing.data&&u.readFromDOMSoon(),u.composing.done=!0)});r(i,"touchstart",function(){return f.forceCompositionEnd()});r(i,"input",function(){u.composing||u.readFromDOMSoon()});r(i,"copy",o);r(i,"cut",o)};h.prototype.screenReaderLabelChanged=function(n){n?this.div.setAttribute("aria-label",n):this.div.removeAttribute("aria-label")};h.prototype.prepareSelection=function(){var n=by(this.cm,!1);return n.focus=document.activeElement==this.div,n};h.prototype.showSelection=function(n,t){n&&this.cm.display.view.length&&((n.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(n))};h.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};h.prototype.showPrimarySelection=function(){var n=this.getSelection(),t=this.cm,y=t.doc.sel.primary(),c=y.from(),l=y.to(),r,f,s,i,v,h;if(t.display.viewTo==t.display.viewFrom||c.line>=t.display.viewTo||l.line<t.display.viewFrom){n.removeAllRanges();return}if(r=ps(t,n.anchorNode,n.anchorOffset),f=ps(t,n.focusNode,n.focusOffset),!r||r.bad||!f||f.bad||u(so(r,f),c)!=0||u(oo(r,f),l)!=0){var a=t.display.view,e=c.line>=t.display.viewFrom&&nk(t,c)||{node:a[0].measure.map[2],offset:0},o=l.line<t.display.viewTo&&nk(t,l);if(o||(s=a[a.length-1].measure,i=s.maps?s.maps[s.maps.length-1]:s.map,o={node:i[i.length-1],offset:i[i.length-2]-i[i.length-3]}),!e||!o){n.removeAllRanges();return}v=n.rangeCount&&n.getRangeAt(0);try{h=tu(e.node,e.offset,o.offset,o.node)}catch(p){}h&&(!ei&&t.state.focused?(n.collapse(e.node,e.offset),h.collapsed||(n.removeAllRanges(),n.addRange(h))):(n.removeAllRanges(),n.addRange(h)),v&&n.anchorNode==null?n.addRange(v):ei&&this.startGracePeriod());this.rememberSelection()}};h.prototype.startGracePeriod=function(){var n=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){n.gracePeriod=!1;n.selectionChanged()&&n.cm.operation(function(){return n.cm.curOp.selectionChanged=!0})},20)};h.prototype.showMultipleSelections=function(n){ct(this.cm.display.cursorDiv,n.cursors);ct(this.cm.display.selectionDiv,n.selection)};h.prototype.rememberSelection=function(){var n=this.getSelection();this.lastAnchorNode=n.anchorNode;this.lastAnchorOffset=n.anchorOffset;this.lastFocusNode=n.focusNode;this.lastFocusOffset=n.focusOffset};h.prototype.selectionInEditor=function(){var n=this.getSelection(),t;return n.rangeCount?(t=n.getRangeAt(0).commonAncestorContainer,wi(this.div,t)):!1};h.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())};h.prototype.blur=function(){this.div.blur()};h.prototype.getField=function(){return this.div};h.prototype.supportsTouch=function(){return!0};h.prototype.receivedFocus=function(){function t(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,t))}var n=this;this.selectionInEditor()?this.pollSelection():ot(this.cm,function(){return n.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,t)};h.prototype.selectionChanged=function(){var n=this.getSelection();return n.anchorNode!=this.lastAnchorNode||n.anchorOffset!=this.lastAnchorOffset||n.focusNode!=this.lastFocusNode||n.focusOffset!=this.lastFocusOffset};h.prototype.pollSelection=function(){var n,t,i,r;if(this.readDOMTimeout==null&&!this.gracePeriod&&this.selectionChanged()){if(n=this.getSelection(),t=this.cm,no&&ge&&this.cm.display.gutterSpecs.length&&sit(n.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}this.composing||(this.rememberSelection(),i=ps(t,n.anchorNode,n.anchorOffset),r=ps(t,n.focusNode,n.focusOffset),i&&r&&ot(t,function(){nt(t.doc,nr(i,r),gt);(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}};h.prototype.pollContent=function(){var d,v,b,k,y,g,i,e,nt,tt;this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var r=this.cm,f=r.display,it=r.doc.sel.primary(),h=it.from(),a=it.to();if((h.ch==0&&h.line>r.firstLine()&&(h=n(h.line-1,t(r.doc,h.line-1).length)),a.ch==t(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=n(a.line+1,0)),h.line<f.viewFrom||a.line>f.viewTo-1)||(h.line==f.viewFrom||(d=wr(r,h.line))==0?(v=c(f.view[0].line),b=f.view[0].node):(v=c(f.view[d].line),b=f.view[d-1].node.nextSibling),k=wr(r,a.line),k==f.view.length-1?(y=f.viewTo-1,g=f.lineDiv.lastChild):(y=c(f.view[k+1].line)-1,g=f.view[k+1].node.previousSibling),!b))return!1;for(i=r.doc.splitLines(hit(r,b,g,v,y)),e=hr(r.doc,n(v,0),n(y,t(r.doc,y).text.length));i.length>1&&e.length>1;)if(s(i)==s(e))i.pop(),e.pop(),y--;else if(i[0]==e[0])i.shift(),e.shift(),v++;else break;for(var o=0,l=0,rt=i[0],ut=e[0],ft=Math.min(rt.length,ut.length);o<ft&&rt.charCodeAt(o)==ut.charCodeAt(o);)++o;for(var p=s(i),w=s(e),et=Math.min(p.length-(i.length==1?o:0),w.length-(e.length==1?o:0));l<et&&p.charCodeAt(p.length-l-1)==w.charCodeAt(w.length-l-1);)++l;if(i.length==1&&e.length==1&&v==h.line)while(o&&o>h.ch&&p.charCodeAt(p.length-l-1)==w.charCodeAt(w.length-l-1))o--,l++;return i[i.length-1]=p.slice(0,p.length-l).replace(/^\u200b+/,""),i[0]=i[0].slice(o).replace(/\u200b+$/,""),nt=n(v,o),tt=n(y,e.length?s(e).length-l:0),i.length>1||i[0]||u(nt,tt)?(wu(r.doc,i,nt,tt,"+input"),!0):void 0};h.prototype.ensurePolled=function(){this.forceCompositionEnd()};h.prototype.reset=function(){this.forceCompositionEnd()};h.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())};h.prototype.readFromDOMSoon=function(){var n=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(n.readDOMTimeout=null,n.composing)if(n.composing.done)n.composing=null;else return;n.updateFromDOM()},80))};h.prototype.updateFromDOM=function(){var n=this;(this.cm.isReadOnly()||!this.pollContent())&&ot(this.cm,function(){return et(n.cm)})};h.prototype.setUneditable=function(n){n.contentEditable="false"};h.prototype.onKeyPress=function(n){n.charCode==0||this.composing||(n.preventDefault(),this.cm.isReadOnly()||b(this.cm,ta)(this.cm,String.fromCharCode(n.charCode==null?n.keyCode:n.charCode),0))};h.prototype.readOnlyChanged=function(n){this.div.contentEditable=String(n!="nocursor")};h.prototype.onContextMenu=function(){};h.prototype.resetPosition=function(){};h.prototype.needsContentAttribute=!0;v=function(n){this.cm=n;this.prevInput="";this.pollingFast=!1;this.polling=new si;this.hasSelection=!1;this.composing=null};v.prototype.init=function(n){function o(n){if(!w(t,n)){if(t.somethingSelected())ys({lineWise:!1,text:t.getSelections()});else if(t.options.lineWiseCopyCut){var r=bb(t);ys({lineWise:!0,text:r.text});n.type=="cut"?t.setSelections(r.ranges,null,gt):(u.prevInput="",i.value=r.text.join("\n"),iu(i))}else return;n.type=="cut"&&(t.state.cutIncoming=+new Date)}}var f=this,u=this,t=this.cm,i;this.createField(n);i=this.textarea;n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild);sf&&(i.style.width="0px");r(i,"input",function(){e&&l>=9&&f.hasSelection&&(f.hasSelection=null);u.poll()});r(i,"paste",function(n){w(t,n)||pb(n,t)||(t.state.pasteIncoming=+new Date,u.fastPoll())});r(i,"cut",o);r(i,"copy",o);r(n.scroller,"paste",function(r){if(!li(n,r)&&!w(t,r)){if(!i.dispatchEvent){t.state.pasteIncoming=+new Date;u.focus();return}var f=new Event("paste");f.clipboardData=r.clipboardData;i.dispatchEvent(f)}});r(n.lineSpace,"selectstart",function(t){li(n,t)||ft(t)});r(i,"compositionstart",function(){var n=t.getCursor("from");u.composing&&u.composing.range.clear();u.composing={start:n,range:t.markText(n,t.getCursor("to"),{className:"CodeMirror-composing"})}});r(i,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})};v.prototype.createField=function(){this.wrapper=db();this.textarea=this.wrapper.firstChild};v.prototype.screenReaderLabelChanged=function(n){n?this.textarea.setAttribute("aria-label",n):this.textarea.removeAttribute("aria-label")};v.prototype.prepareSelection=function(){var n=this.cm,t=n.display,e=n.doc,i=by(n);if(n.options.moveInputWithCursor){var r=kt(n,e.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))}return i};v.prototype.showSelection=function(n){var i=this.cm,t=i.display;ct(t.cursorDiv,n.cursors);ct(t.selectionDiv,n.selection);n.teTop!=null&&(this.wrapper.style.top=n.teTop+"px",this.wrapper.style.left=n.teLeft+"px")};v.prototype.reset=function(n){var t,i;this.contextMenuPending||this.composing||(t=this.cm,t.somethingSelected()?(this.prevInput="",i=t.getSelection(),this.textarea.value=i,t.state.focused&&iu(this.textarea),e&&l>=9&&(this.hasSelection=i)):n||(this.prevInput=this.textarea.value="",e&&l>=9&&(this.hasSelection=null)))};v.prototype.getField=function(){return this.textarea};v.prototype.supportsTouch=function(){return!1};v.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!hf||oi()!=this.textarea))try{this.textarea.focus()}catch(n){}};v.prototype.blur=function(){this.textarea.blur()};v.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};v.prototype.receivedFocus=function(){this.slowPoll()};v.prototype.slowPoll=function(){var n=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){n.poll();n.cm.state.focused&&n.slowPoll()})};v.prototype.fastPoll=function(){function i(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,i))}var t=!1,n=this;n.pollingFast=!0;n.polling.set(20,i)};v.prototype.poll=function(){var i=this,n=this.cm,f=this.textarea,r=this.prevInput,t,o,u,s;if(this.contextMenuPending||!n.state.focused||lk(f)&&!r&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq||(t=f.value,t==r&&!n.somethingSelected()))return!1;if(e&&l>=9&&this.hasSelection===t||at&&/[\uf700-\uf7ff]/.test(t))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu&&(o=t.charCodeAt(0),o!=8203||r||(r="​"),o==8666))return this.reset(),this.cm.execCommand("undo");for(u=0,s=Math.min(r.length,t.length);u<s&&r.charCodeAt(u)==t.charCodeAt(u);)++u;return ot(n,function(){ta(n,t.slice(u),r.length-u,null,i.composing?"*compose":null);t.length>1e3||t.indexOf("\n")>-1?f.value=i.prevInput="":i.prevInput=t;i.composing&&(i.composing.range.clear(),i.composing.range=n.markText(i.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0};v.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};v.prototype.onKeyPress=function(){e&&l>=9&&(this.hasSelection=null);this.fastPoll()};v.prototype.onContextMenu=function(n){function p(){if(f.selectionStart!=null){var n=i.somethingSelected(),r="​"+(n?f.value:"");f.value="⇚";f.value=r;t.prevInput=n?"":"​";f.selectionStart=1;f.selectionEnd=r.length;u.selForContextMenu=i.doc.sel}}function s(){if(t.contextMenuPending==s&&(t.contextMenuPending=!1,t.wrapper.style.cssText=k,f.style.cssText=w,e&&l<9&&u.scrollbars.setScrollTop(u.scroller.scrollTop=c),f.selectionStart!=null)){(!e||e&&l<9)&&p();var r=0,n=function(){u.selForContextMenu==i.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="​"?b(i,ew)(i):r++<10?u.detectingSelectAll=setTimeout(n,500):(u.selForContextMenu=null,u.input.reset())};u.detectingSelectAll=setTimeout(n,200)}}var t=this,i=t.cm,u=i.display,f=t.textarea,o,c,a,y,h;if(t.contextMenuPending&&t.contextMenuPending(),o=pr(i,n),c=u.scroller.scrollTop,o&&!wt){a=i.options.resetSelectionOnContextMenu;a&&i.doc.sel.contains(o)==-1&&b(i,nt)(i.doc,nr(o),gt);var w=f.style.cssText,k=t.wrapper.style.cssText,v=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";f.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(n.clientY-v.top-5)+"px; left: "+(n.clientX-v.left-5)+"px;\n      z-index: 1000; background: "+(e?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";it&&(y=window.scrollY);u.input.focus();it&&window.scrollTo(null,y);u.input.reset();i.somethingSelected()||(f.value=t.prevInput=" ");t.contextMenuPending=s;u.selForContextMenu=i.doc.sel;clearTimeout(u.detectingSelectAll);e&&l>=9&&p();to?(yf(n),h=function(){lt(window,"mouseup",h);setTimeout(s,20)},r(window,"mouseup",h)):setTimeout(s,50)}};v.prototype.readOnlyChanged=function(n){n||this.reset();this.textarea.disabled=n=="nocursor";this.textarea.readOnly=!!n};v.prototype.setUneditable=function(){};v.prototype.needsContentAttribute=!1;rit(a);oit(a);tk="iter insert remove copy getEditor constructor".split(" ");for(de in ut.prototype)ut.prototype.hasOwnProperty(de)&&g(tk,de)<0&&(a.prototype[de]=function(n){return function(){return n.apply(this.doc,arguments)}}(ut.prototype[de]));return uu(ut),a.inputStyles={textarea:v,contenteditable:h},a.defineMode=function(n){a.defaults.mode||n=="null"||(a.defaults.mode=n);yk.apply(this,arguments)},a.defineMIME=pk,a.defineMode("null",function(){return{token:function(n){return n.skipToEnd()}}}),a.defineMIME("text/plain","null"),a.defineExtension=function(n,t){a.prototype[n]=t},a.defineDocExtension=function(n,t){ut.prototype[n]=t},a.fromTextArea=lit,ait(a),a.version="5.58.3",a})}])["default"]});
  /*!
   * TOAST UI Editor : i18n
   * @version 2.5.1
   * @author NHN FE Development Lab <dl_javascript@nhn.com>
   * @license MIT
   */
  (function(n,t){var i,r;if(typeof exports=="object"&&typeof module=="object")module.exports=t(require("@toast-ui/editor"));else if(typeof define=="function"&&define.amd)define(["@toast-ui/editor"],t);else{i=typeof exports=="object"?t(require("@toast-ui/editor")):t(n.toastui.Editor);for(r in i)(typeof exports=="object"?exports:n)[r]=i[r]}})(window,function(n){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=20)}({0:function(t){t.exports=n},20:function(n,t,i){"use strict";i.r(t);var r=i(0),u=i.n(r);u.a.setLanguage("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":"选择语言"})}})});
  /*!
   * Markdown : Argo@163.com
   * @version 5.1.0
   */
  (function(n){n.extend({bb_markdown:function(t,i,r,u){var f=n(t),e;u==="setMarkdown"?f.toastuiEditor("setMarkdown",r):(n.extend(r,{events:{blur:function(){var n=f.toastuiEditor("getMarkdown"),t=f.toastuiEditor("getHtml");i.invokeMethodAsync(u,[n,t])}}}),e=window.setInterval(function(){f.is(":visible")&&(window.clearInterval(e),f.toastuiEditor(r))},100))}})})(jQuery);