(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0e1a"],{"49oK":function(e,t,n){"use strict";for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),s=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=s||i&&+i[1]<57,c=0;c<10;c++)r[48+c]=r[96+c]=String(c);for(c=1;c<=24;c++)r[c+111]="F"+c;for(c=65;c<=90;c++)r[c]=String.fromCharCode(c+32),o[c]=String.fromCharCode(c);for(var u in r)o.hasOwnProperty(u)||(o[u]=r[u]);var d=n("b/sn");n.d(t,"a",function(){return m});const p="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function h(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(i=r[n.keyCode])&&i!=s){let r=t[f(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}else if(c&&n.shiftKey){let r=t[f(s,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}(e)}})}},"8gFn":function(e,t,n){"use strict";var r=function(){};r.prototype.append=function(e){return e.length?(e=r.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},r.prototype.prepend=function(e){return e.length?r.from(e).append(this):this},r.prototype.appendInner=function(e){return new i(this,e)},r.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?r.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},r.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},r.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},r.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},r.from=function(e){return e instanceof r?e:e&&e.length?new o(e):r.empty};var o=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(r);r.empty=new o([]);var i=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(r),s=r,a=n("uSMm"),l=n("b/sn");n.d(t,"a",function(){return x}),n.d(t,"b",function(){return T}),n.d(t,"c",function(){return C}),n.d(t,"d",function(){return M});const c=500;class u{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new d(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new d(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new u(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;ch&&(s=function(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&0==t--)return n=r,!1}),e.slice(n)}(s,l),i-=l),new u(s.append(o),i)}remapping(e,t){let n=new a.a;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(e){return 0==this.eventCount?this:new u(this.items.append(e.map(e=>new d(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let a=t;this.items.forEach(t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new d(l,i,c))}else n.push(new d(l))},r);let l=[];for(let c=t;cc&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new d(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else i.map&&n--},this.items.length,0),new u(s.from(r.reverse()),o)}}u.empty=new u(s.empty,0);class d{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new d(t.getMap().invert(),t,this.selection)}}}class p{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const h=20;function f(e){let t=[];return e.forEach((e,n,r,o)=>t.push(r,o)),t}function m(e,t){if(!e)return null;let n=[];for(let r=0;rnew p(u.empty,u.empty,null,0),apply:(t,n,r)=>(function(e,t,n,r){let o,i=n.getMeta(w);if(i)return i.historyState;n.getMeta(k)&&(e=new p(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(w))return s.getMeta(w).redo?new p(e.done.addTransform(n,void 0,r,b(t)),e.undone,f(n.mapping.maps[n.steps.length-1]),e.prevTime):new p(e.done,e.undone.addTransform(n,void 0,r,b(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new p(e.done.rebased(n,o),e.undone.rebased(n,o),m(e.prevRanges,n.mapping),e.prevTime):new p(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),m(e.prevRanges,n.mapping),e.prevTime);{let o=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o=t[o]&&(n=!0)}),n}(n,e.prevRanges)),i=s?m(e.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new p(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,b(t)),u.empty,i,n.time)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?C:"historyRedo"==n?T:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const C=(e,t)=>{let n=w.getState(e);return!(!n||0==n.done.eventCount)&&(t&&g(n,e,t,!1),!0)},T=(e,t)=>{let n=w.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&g(n,e,t,!0),!0)};function M(e){let t=w.getState(e);return t?t.done.eventCount:0}},"9RMS":function(e,t,n){},RCw7:function(e,t,n){"use strict";n.d(t,"a",function(){return D}),n.d(t,"b",function(){return M}),n.d(t,"c",function(){return s}),n.d(t,"d",function(){return m}),n.d(t,"e",function(){return d}),n.d(t,"f",function(){return h}),n.d(t,"g",function(){return v}),n.d(t,"h",function(){return C}),n.d(t,"i",function(){return T}),n.d(t,"j",function(){return x});var r=n("uSMm"),o=n("byeC"),i=n("b/sn");const s=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function a(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}function l(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function c(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function u(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let s=u(e,n);if(!s)return!1;let a=p(s);if(!a)return!1;let c=a.nodeAfter;if(y(e,a,t))return!0;if(0==s.parent.content.size&&(l(c,"start")||i.c.isSelectable(c))){let n=Object(r.l)(e.doc,s.before(),s.after(),o.j.empty);if(n&&n.slice.size=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function f(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=f(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,a.createAndFill());o.setSelection(i.f.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0};const g=function(e){return(t,n)=>{let{$from:o,$to:s}=t.selection;if(t.selection instanceof i.c&&t.selection.node.isBlock)return!(!o.parentOffset||!Object(r.g)(t.doc,o.pos)||(n&&n(t.tr.split(o.pos).scrollIntoView()),0));if(!o.parent.isBlock)return!1;if(n){let a=s.parentOffset==s.parent.content.size,l=t.tr;(t.selection instanceof i.h||t.selection instanceof i.a)&&l.deleteSelection();let c=0==o.depth?null:f(o.node(-1).contentMatchAt(o.indexAfter(-1))),u=e&&e(s.parent,a),d=u?[u]:a&&c?[{type:c}]:void 0,p=Object(r.g)(l.doc,l.mapping.map(o.pos),1,d);if(d||p||!Object(r.g)(l.doc,l.mapping.map(o.pos),1,c?[{type:c}]:void 0)||(c&&(d=[{type:c}]),p=!0),p&&(l.split(l.mapping.map(o.pos),1,d),!a&&!o.parentOffset&&o.parent.type!=c)){let e=l.mapping.map(o.before()),t=l.doc.resolve(e);c&&o.node(-1).canReplaceWith(t.index(),t.index()+1,c)&&l.setNodeMarkup(l.mapping.map(o.before()),c)}n(l.scrollIntoView())}return!0}}(),v=(e,t)=>(t&&t(e.tr.setSelection(new i.a(e.doc))),!0);function y(e,t,n){let s,a,c=t.nodeBefore,u=t.nodeAfter;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(function(e,t,n){let o=t.nodeBefore,i=t.nodeAfter,s=t.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(s,s+1)||!i.isTextblock&&!Object(r.f)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let d=t.parent.canReplace(t.index(),t.index()+1);if(d&&(s=(a=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&a.matchType(s[0]||u.type).validEnd){if(n){let i=t.pos+u.nodeSize,a=o.c.empty;for(let e=s.length-1;e>=0;e--)a=o.c.from(s[e].create(null,a));a=o.c.from(c.copy(a));let l=e.tr.step(new r.b(t.pos-1,i,t.pos,i,new o.j(a,1,0),s.length,!0)),d=i+2*s.length;Object(r.f)(l.doc,d)&&l.join(d),n(l.scrollIntoView())}return!0}let p=i.f.findFrom(t,1),h=p&&p.$from.blockRange(p.$to),f=h&&Object(r.k)(h);if(null!=f&&f>=t.depth)return n&&n(e.tr.lift(h,f).scrollIntoView()),!0;if(d&&l(u,"start",!0)&&l(c,"end")){let i=c,s=[];for(;s.push(i),!i.isTextblock;)i=i.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(i.canReplace(i.childCount,i.childCount,a.content)){if(n){let i=o.c.empty;for(let e=s.length-1;e>=0;e--)i=o.c.from(s[e].copy(i));n(e.tr.step(new r.b(t.pos-s.length,t.pos+u.nodeSize,t.pos+l,t.pos+u.nodeSize-l,new o.j(i,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function b(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(t.tr.setSelection(i.h.create(t.doc,e<0?o.start(s):o.end(s)))),!0)}}const w=b(-1),k=b(1);function x(e,t=null){return function(n,o){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),l=a&&Object(r.i)(a,e,t);return!!l&&(o&&o(n.tr.wrap(a,l).scrollIntoView()),!0)}}function C(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(i)e.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let o=!1,i=n.tr;for(let t=0;!o&&t{let s=a(e,n);if(!s)return!1;let u=c(s);if(!u){let n=s.blockRange(),o=n&&Object(r.k)(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let d=u.nodeBefore;if(!d.type.spec.isolating&&y(e,u,t))return!0;if(0==s.parent.content.size&&(l(d,"end")||i.c.isSelectable(d))){let n=Object(r.l)(e.doc,s.before(),s.after(),o.j.empty);if(n&&n.slice.size{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=c(r)}let a=s&&s.nodeBefore;return!(!a||!i.c.isSelectable(a)||(t&&t(e.tr.setSelection(i.c.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),0))}),E=M(s,d,(e,t,n)=>{let{$head:r,empty:o}=e.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof i.a||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=f(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Object(r.g)(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let o=n.blockRange(),i=o&&Object(r.k)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},g),"Mod-Enter":m,Backspace:S,"Mod-Backspace":S,"Shift-Backspace":S,Delete:E,"Mod-Delete":E,"Mod-a":v},O={"Ctrl-h":N.Backspace,"Alt-Backspace":N["Mod-Backspace"],"Ctrl-d":N.Delete,"Ctrl-Alt-Backspace":N["Mod-Delete"],"Alt-Delete":N["Mod-Delete"],"Alt-d":N["Mod-Delete"],"Ctrl-a":w,"Ctrl-e":k};for(let A in N)O[A]=N[A];const D=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?O:N},WGVu:function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return jp});var r=n("byeC"),o=n("cD+i"),i=n("uSMm"),s=n("b/sn"),a=n("49oK"),l=n("RCw7"),c=n("cqjR"),u=n("8gFn"),d=function(e,t){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0&&rX}(o)||(window.localStorage.setItem(r,(new Date).getTime()),setTimeout(function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Z("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})},1e3)))};/Mac/.test(navigator.platform);var Y=/[\u0020]+/g,ee=/[>(){}[\]+-.!#|]/g,te=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>||<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,ne=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,re=/[*_~`]/g,oe=/!\[.*\]\(.*\)/g,ie=/[[\]]/g,se=/(?:^|[^\\])\\(?!\\)/g,ae=new RegExp('[&<>"]',"g");function le(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}}function ce(e){return ae.test(e)?e.replace(ae,le):e}function ue(e,t){return-1!==e.indexOf(t)}var de=["rel","target","hreflang","type"],pe={codeblock:/(^ {4}[^\n]+\n*)+/,thematicBreak:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,atxHeading:/^(#{1,6}) +[\s\S]+/,seTextheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,fencedCodeblock:/^((`|~){3,})/};function he(e){if(!e)return null;var t={};return de.forEach(function(n){D(e[n])||(t[n]=e[n])}),t}function fe(e,t){for(var n="",r=0;re[0]&&nt?[t,e]:[e,t]}var Se=w;var Ee=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],Se(e,function(e){t.push(e)})}return t};function Ne(e,t){var n=e.nodes.paragraph;return t?n.create(null,y(t)?e.text(t):t):n.createAndFill()}function Oe(e,t,n){return e.text(t,n)}function De(e,t,n){void 0===n&&(n=t);var r=e.doc.content.size,o=r>0?r-1:1;return s.h.create(e.doc,Math.min(t,o),Math.min(n,o))}function Ae(e,t,n){var r=t.pos;return e.replaceWith(r,r,Ne(n)),e.setSelection(De(e,r+1))}function Le(e){for(var t=e.state,n=e.from,o=e.startIndex,i=e.endIndex,s=e.createText,a=t.tr,l=t.doc,c=t.schema,u=o;u<=i;u+=1){var d=l.child(u),p=d.nodeSize,h=d.textContent,f=d.content,m=s(h),g=m?Oe(c,m):r.c.empty,v=a.mapping.map(n),y=v+f.size;a.replaceWith(v,y,g),n+=p}return a}function Ie(e,t,n,r){var o=n.length;e.split(t).delete(t-o,t).insert(e.mapping.map(t),r).setSelection(De(e,e.mapping.map(t)-o))}function Re(e){return e.sourcepos[0][0]}function Pe(e){return e.sourcepos[1][0]}function Be(e){return e.sourcepos[0][1]}function Fe(e){return e.sourcepos[1][1]}function He(e){var t=e.type;return"strike"===t||"strong"===t||"emph"===t||"code"===t||"link"===t||"image"===t}function je(e){return e&&("item"===e.type||"list"===e.type)}function ze(e){return je(e)&&"ordered"===e.listData.type}function qe(e){return je(e)&&"ordered"!==e.listData.type}function Ve(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function $e(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;){if(t(e))return e;e=e.parent}return null}function _e(e,t){return[e[0],e[1]+t]}function Ue(e,t){return[e[0],t]}function We(e){var t=e.firstChild.literal;switch(e.type){case"emph":return"*"+t+"*";case"strong":return"**"+t+"**";case"strike":return"~~"+t+"~~";case"code":return"`"+t+"`";case"link":case"image":var n=e,r=n.destination,o=n.title;return("link"===e.type?"":"!")+"["+t+"]("+r+(o?' "'+o+'"':"")+")";default:return null}}function Je(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var o=r.node;"text"===o.type&&t.push(o.literal)}return t.join("")}var Ke=[],Ge={},Ze=/\$\$widget\d+\s/;function Xe(e){var t=e.search(Ze);if(-1!==t){var n=e.substring(t).replace(Ze,"").replace("$$","");e=e.substring(0,t),e+=Xe(n)}return e}function Qe(e,t){return"$$"+e+" "+t+"$$"}function Ye(e,t){var n=Ge[e],r=n.rule,o=n.toDOM,i=Xe(t).match(r);return i&&(t=i[0]),o(t)}function et(){return Ke}function tt(e){(Ke=e).forEach(function(e,t){Ge["widget"+t]=e})}function nt(e,t,n,r){return e.concat(rt(t,n,r))}function rt(e,t,n){void 0===n&&(n=0);var r=[],o=(Ke[n]||{}).rule,i=n+1;if(e=Xe(e),o&&o.test(e)){for(var s=void 0;-1!==(s=e.search(o));){var a=e.substring(0,s);a&&(r=nt(r,a,t,i));var l=(e=e.substring(s)).match(o)[0],c="widget"+n;r.push(t.nodes.widget.create({info:c},t.text(Qe(c,l)))),e=e.substring(l.length)}e&&(r=nt(r,e,t,i))}else e&&(r=n-1)},ct=O,ut=Ee,dt=Element.prototype,pt=dt.matches||dt.webkitMatchesSelector||dt.mozMatchesSelector||dt.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return ct(this,ut(t.querySelectorAll(e)))>-1};var ht=function(e,t){return pt.call(e,t)},ft="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",mt="<([A-Za-z][A-Za-z0-9-]*)("+ft+")*\\s*/?>",gt="(?:"+mt+"|([A-Za-z][A-Za-z0-9-]*)\\s*[>])",vt=new RegExp("^"+gt,"i"),yt=/
/i,bt=/|/,wt="
";function kt(e,t,n){var r=parseInt(e.left,10),o=parseInt(e.top,10),i=parseInt(e.width,10)+parseInt(e.paddingLeft,10)+parseInt(e.paddingRight,10),s=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+i&&n>=o&&n<=o+s}var xt="toastui-editor-";function Ct(){for(var e=[],t=0;t/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var Rt=new s.e("widget"),Pt=function(){function e(e,t){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=e.dom.parentElement,this.eventEmitter=t,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",function(){n.rootEl=Dt(e.dom.parentElement,"."+Ct("defaultUI"))}),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=Rt.getState(e.state);if(this.removeWidget(),t){var n=t.node,r=t.style,o=e.coordsAtPos(t.pos),i=o.top,s=o.left,a=o.bottom-i,l=this.rootEl.getBoundingClientRect(),c=i-l.top;E(n,{opacity:"0"}),this.rootEl.appendChild(n),E(n,{position:"absolute",left:s-l.left+5+"px",top:("bottom"===r?c+a-5:c-a)+"px",opacity:"1"}),this.popup=n,e.focus()}},e.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},e}();function Bt(e,t,n){e.emit("addImageBlobHook",t,function(n,r){e.emit("command","addImage",{imageUrl:n,altText:r||t.name||"image"})},n)}function Ft(e){var t=Ee(e).filter(function(e){return-1!==e.type.indexOf("image")});if(1===t.length){var n=t[0];if(n)return n.getAsFile()}return null}var Ht=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function jt(e){var t=document.createElement("span"),n=Ye(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function zt(e){return"widget"===e.type.name}var qt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(e){return{info:e.textContent.match(/\$\$(widget\d+)/)[1]}}}]}},enumerable:!1,configurable:!0}),t}(Ht),Vt=function(){function e(e){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=e,this.placeholder={text:""}}return e.prototype.createState=function(){return s.b.create({schema:this.schema,plugins:this.createPlugins()})},e.prototype.initEvent=function(){var e=this.eventEmitter,t=this.view,n=this.editorType;t.dom.addEventListener("focus",function(){return e.emit("focus",n)}),t.dom.addEventListener("blur",function(){return e.emit("blur",n)})},e.prototype.emitChangeEvent=function(e){this.eventEmitter.emit("caretChange",this.editorType),e.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(e.prototype,"defaultPlugins",{get:function(){var e=this.createInputRules(),t=f(f([],this.keymaps),[Object(a.a)(h({"Shift-Enter":l.a.Enter},l.a)),Object(u.a)(),function(e){return new s.d({props:{decorations:function(t){var n=t.doc;if(e.text&&1===n.childCount&&n.firstChild.isTextblock&&0===n.firstChild.content.size){var r=document.createElement("span");return z(r,"placeholder"),e.className&&z(r,e.className),r.textContent=e.text,o.b.create(n,[o.a.widget(1,r)])}return null}}})}(this.placeholder),function(e){return new s.d({key:Rt,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(t){return new Pt(t,e)}})}(this.eventEmitter),function(e){var t=e.eventEmitter;return new s.d({props:{handleDOMEvents:{drop:function(e,n){var r,o=null===(r=n.dataTransfer)||void 0===r?void 0:r.files;return o&&w(o,function(e){return-1===e.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),Bt(t,e,n.type),!1)}),!0}}}})}(this.context)]);return e?t.concat(e):t},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=et().map(function(e){var t=e.rule;return new c.a(t,function(e,n,r,o){var i=e.schema,s=e.tr,a=e.doc,l=n.input.match(new RegExp(t,"g")),c=a.resolve(r),u=c.parent,d=0;if(zt(u)&&(u=c.node(c.depth-1)),u.forEach(function(e){return zt(e)&&(d+=1)}),l.length>d){var p=be(l),h=rt(p,i);return s.replaceWith(o-p.length+1,o,h)}return null})});return e.length?Object(c.b)({rules:e}):null},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.createSchema=function(){return new r.i({nodes:this.specs.nodes,marks:this.specs.marks})},e.prototype.createKeymaps=function(e){var t=it(),n=t.undo,r=t.redo,o=this.specs.keymaps(e),i={"Mod-z":n(),"Shift-Mod-z":r()};return e?o.concat(Object(a.a)(i)):o},e.prototype.createCommands=function(){return this.specs.commands(this.view)},e.prototype.createPluginProps=function(){var e=this;return this.extraPlugins.map(function(t){return t(e.eventEmitter)})},e.prototype.focus=function(){var e=this;this.clearTimer(),this.timer=setTimeout(function(){e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView())})},e.prototype.blur=function(){this.view.dom.blur()},e.prototype.destroy=function(){var e=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach(function(t){delete e[t]})},e.prototype.moveCursorToStart=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(De(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(De(t,t.doc.content.size-1)).scrollIntoView()),e&&this.focus()},e.prototype.setScrollTop=function(e){this.view.dom.scrollTop=e},e.prototype.getScrollTop=function(){return this.view.dom.scrollTop},e.prototype.setPlaceholder=function(e){this.placeholder.text=e,this.view.dispatch(this.view.state.tr.scrollIntoView())},e.prototype.setHeight=function(e){E(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){E(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}();var $t=function(e){return e instanceof Function},_t=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function Ut(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var Wt=function(){function e(e){this.specs=e}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this.specs.filter(function(e){return"node"===e.type}).reduce(function(e,t){var n,r=t.name,o=t.schema;return h(h({},e),((n={})[r]=o,n))},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"marks",{get:function(){return this.specs.filter(function(e){return"mark"===e.type}).reduce(function(e,t){var n,r=t.name,o=t.schema;return h(h({},e),((n={})[r]=o,n))},{})},enumerable:!1,configurable:!0}),e.prototype.commands=function(e,t){var n=this.specs.filter(function(e){return e.commands}).reduce(function(t,n){var r={},o=n.commands();return $t(o)?r[n.name]=function(t){return Ut(e,o,t)}:Object.keys(o).forEach(function(t){r[t]=function(n){return Ut(e,o[t],n)}}),h(h({},t),r)},{}),r=it();return Object.keys(r).forEach(function(t){n[t]=function(n){return Ut(e,r[t],n)}}),t&&Object.keys(t).forEach(function(r){n[r]=function(n){return Ut(e,t[r],n)}}),n},e.prototype.keymaps=function(e){return this.specs.filter(function(e){return e.keymaps}).map(function(e){return e.keymaps()}).map(function(t){return e||Object.keys(t).forEach(function(e){ue(_t,e)||delete t[e]}),Object(a.a)(t)})},e.prototype.setContext=function(e){this.specs.forEach(function(t){t.setContext(e)})},e}();function Jt(e){var t=e.from,n=e.to;return e instanceof s.a?[t+1,n-1]:[t,n]}function Kt(e){return e.index(0)+1}function Gt(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach(function(e,o){zt(e)&&o+2 ?/,In=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Tt("block-quote")},0]}}},enumerable:!1,configurable:!0}),t.prototype.createBlockQuoteText=function(e,t){return t?e.replace(Ln,"").trim():"> "+e.trim()},t.prototype.extendBlockQuote=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.tr,s=t.schema,a=Yt(r),l=a.endFromOffset,c=a.endToOffset,u=a.endIndex,d=a.to,p=An(o,u);if(Ln.test(p)&&d>l&&r.empty){if(!p.replace(Ln,"").trim())i.deleteRange(l,c).split(i.mapping.map(c));else{var h=p.slice(d-l).trim();Ie(i,c,h,Oe(s,e.createBlockQuoteText(h)))}return n(i),!0}return!1}},t.prototype.commands=function(){var e=this;return function(){return function(t,n){var r=t.selection,o=t.doc,i=Yt(r),s=i.startFromOffset,a=i.endToOffset,l=i.startIndex,c=i.endIndex,u=Ln.test(An(o,l)),d=Le({state:t,startIndex:l,endIndex:c,from:s,createText:function(t){return e.createBlockQuoteText(t,u)}});return n(d.setSelection(De(d,d.mapping.map(a)))),!0}}},t.prototype.keymaps=function(){var e=this.commands()();return{"alt-q":e,"alt-Q":e,Enter:this.extendBlockQuote()}},t}(On),Rn=/(^\s*)([-*+] |[\d]+\. )/,Pn=/(^\s*)([\d])+\.( \[[ xX]])? /,Bn=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,Fn=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,Hn=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,jn=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,zn=/(^\s*)([-*+])( \[[ xX]]) /;function qn(e){return Pn.test(e)?"ordered":"bullet"}function Vn(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function $n(e,t,n,r){for(var o=e.getLineTexts().length,i=[],s=t;r?s1;){s=r?s+1:s-1;var a=e.findFirstNodeAtLine(s),l=Vn(a);if(l===n)i.push({line:s,depth:n,mdNode:a});else if(l0;c-=1){var u=t.findFirstNodeAtLine(c),d=Dn(n,c)&&!!$e(u,function(e){return je(e)}),p=Bn.exec(Dn(n,c));if(!p&&!d)break;if(p||!d){var h=p,f=h[1],m=h[3];if(!f){s=Number(m),a=c;break}}else l+=1}return{changedResults:[{text:s+r-a-l+". "+i,line:r}]}},task:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* [ ] "+Dn(t,n),line:n}]}}},Kn={bullet:function(e){var t=e.line,n=Dn(e.doc,t),r=Hn.exec(n);return{listSyntax:""+r[1]+r[2]}},ordered:function(e){var t=e.toastMark,n=e.line,r=e.mdNode,o=e.doc,i=Vn(r),s=Dn(o,n),a=Bn.exec(s),l=a[1],c=a[3],u=a[4],d=Number(c)+1,p=""+l+d+u,f=$n(t,n,i,!0).filter(function(e){var t=Bn.exec(Dn(o,e.line));return t&&t[1].length===l.length&&!!$e(e.mdNode,function(e){return ze(e)})});return h({listSyntax:p},_n(o,f,"ordered",d))}};var Gn=/(^\s{1,4})(.*)/;function Zn(e,t,n){return ei){var h=e(t,n,r,1,p);r=h.line,s=s.concat(h.nodes)}if(pt.childCount)break;a=Dn(t,r),l=Bn.exec(a)}return{nodes:s,line:r}}(c,i,e,Number(f),m),v=g.line,y=g.nodes;t=Math.max(t,v-1);for(var b=en(c,e-1).startOffset,w=e-1;w<=t-1;w+=1){var k=c.child(w),x=k.nodeSize,C=k.content,T=a.mapping.map(b),M=T+C.size;a.replaceWith(T,M,y[w-e+1]),b+=x}var S=De(a,l.from,l.to);r.dispatch(a.setSelection(S))},t.prototype.indent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.schema,i=n.selection,s=n.doc,a=Yt(i),l=a.from,c=a.to,u=a.startFromOffset,d=a.startIndex,p=a.endIndex;if(e&&Xn(s,o,i))return!1;var h=An(s,d);if(e&&Zn(l,c,h)||!e&&Rn.test(h)){var f=Le({state:n,from:u,startIndex:d,endIndex:p,createText:function(e){return" "+e}}),m={type:"indent",from:l,to:c,lineLen:p-d};r(f.setSelection(Qn(f,m))),Bn.test(h)&&t.reorderList(d+1,p+1)}else e&&r(n.tr.insert(c,Oe(o," ")));return!0}}},t.prototype.outdent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.selection,i=n.doc,s=n.schema,a=Yt(o),l=a.from,c=a.to,u=a.startFromOffset,d=a.startIndex,p=a.endIndex;if(e&&Xn(i,s,o))return!1;var h=An(i,d);if(e&&Zn(l,c,h)||!e&&Rn.test(h)){var f=[],m=Le({state:n,from:u,startIndex:d,endIndex:p,createText:function(e){var t=Gn.exec(e);return f.push(t?t[1].length:0),e.replace(Gn,"$2")}}),g={type:"outdent",from:l,to:c,spaceLenList:f};r(m.setSelection(Qn(m,g))),Bn.test(h)&&t.reorderList(d+1,p+1)}else if(e){var v=h.slice(0,c-u),y=v.replace(/\s{1,4}$/,""),b=c-(v.length-y.length);r(n.tr.delete(b,c))}return!0}}},t.prototype.deleteLines=function(){var e=this;return function(t,n){var r=e.context.view,o=Yt(t.selection),i=o.startFromOffset,s=o.endToOffset;return Object(l.b)(function(){return n(t.tr.deleteRange(i,s)),!0},l.e)(t,n,r)}},t.prototype.moveDown=function(){return function(e,t){var n=e.doc,r=e.tr,o=e.selection,i=e.schema,s=Yt(o),a=s.startFromOffset,l=s.endToOffset,c=s.endIndex;if(c0){var u=r.child(c-1),d=u.nodeSize,p=u.textContent;return n.delete(a-d,a).split(n.mapping.map(l)).insert(n.mapping.map(l),Oe(i,p)),t(n),!0}return!1}},t.prototype.commands=function(){return{indent:this.indent(),outdent:this.outdent()}},t.prototype.keymaps=function(){return{Tab:this.indent(!0)(),"Shift-Tab":this.outdent(!0)(),"Mod-d":this.deleteLines(),"Mod-D":this.deleteLines(),"Alt-ArrowUp":this.moveUp(),"Alt-ArrowDown":this.moveDown()}},t}(Ht),er=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),t}(Ht),tr=/^#{1,6}\s/,nr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:{level:{default:1},seText:{default:!1}},toDOM:function(e){var t=e.attrs,n="heading|heading"+t.level;return t.seText&&(n+="|delimiter|setext"),["span",{class:Tt.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),t.prototype.createHeadingText=function(e,t,n){for(var r=t.replace(n,"").trim(),o="";e>0;)o+="#",e-=1;return o+" "+r},t.prototype.commands=function(){var e=this;return function(t){return function(n,r){var o=t.level,i=Yt(n.selection),s=i.startFromOffset,a=i.endToOffset,l=Le({state:n,from:s,startIndex:i.startIndex,endIndex:i.endIndex,createText:function(t){var n=t.match(tr),r=n?n[0]:"";return e.createHeadingText(o,t,r)}});return r(l.setSelection(De(l,l.mapping.map(a)))),!0}}},t}(On),rr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Tt("code-block")},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=e.tr,i=Yt(n),s=i.startFromOffset,a=i.endToOffset,l=Oe(r,"```");return o.insert(s,l).split(s+"```".length),o.split(o.mapping.map(a)).insert(o.mapping.map(a),l),t(o.setSelection(De(o,o.mapping.map(a)-("```".length+2)))),!0}}},t.prototype.keepIndentation=function(){var e=this;return function(t,n){var r=t.selection,o=t.tr,i=t.doc,s=t.schema,a=e.context.toastMark,l=Yt(r),c=l.startFromOffset,u=l.endToOffset,d=l.endIndex,p=l.from,h=l.to,f=An(i,d);if(p===h&&f.trim()){var m=f.match(/^\s+/);if(function(e){return e&&"codeBlock"===e.type}(a.findFirstNodeAtLine(d+1))&&m){var g=m[0],v=f.slice(h-c);return Ie(o,u,v,Oe(s,g+v)),n(o),!0}}return!1}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,Enter:this.keepIndentation()}},t}(On),or=/\||\s/g;function ir(e,t){for(var n="|",r=0;r0&&(t+="\n")}),t},t.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=Qt(n.doc,e,t),o=r[0],i=r[1];this.view.dispatch(n.setSelection(De(n,o,i)).scrollIntoView())},t.prototype.replaceSelection=function(e,t,n){var o,i=this.view.state,s=i.tr,a=i.schema,l=i.doc,c=e.split(Or).map(function(e){return Ne(a,rt(e,a))}),u=new r.j(r.c.from(c),1,1);if(this.focus(),t&&n){var d=Qt(l,t,n),p=d[0],h=d[1];o=s.replaceRange(p,h,u)}else o=s.replaceSelection(u);this.view.dispatch(o.scrollIntoView())},t.prototype.deleteSelection=function(e,t){var n,r=this.view.state,o=r.tr,i=r.doc;if(e&&t){var s=Qt(i,e,t),a=s[0],l=s[1];n=o.deleteRange(a,l)}else n=o.deleteSelection();this.view.dispatch(n.scrollIntoView())},t.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,s=o.to;if(e&&t){var a=Qt(r,e,t);i=a[0],s=a[1]}return r.textBetween(i,s,"\n")},t.prototype.getSelection=function(){var e=this.view.state.selection,t=e.from,n=e.to;return Zt(this.view.state.tr.doc,t,n)},t.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(Or),r=this.view.state,o=r.tr,i=r.doc,s=r.schema,a=n.map(function(e){return Ne(s,rt(e,s))});this.view.dispatch(o.replaceWith(0,i.content.size,a)),t&&this.moveCursorToEnd(!0)},t.prototype.addWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.doc,s=r.selection,a=n?Qt(i,n,n)[0]:s.to;this.view.dispatch(o.setMeta("widget",{pos:a,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.schema,s=Qt(r.doc,e,t),a=rt(n,i);this.view.dispatch(o.replaceWith(s[0],s[1],a))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e||Zt(n,r.from)[0],i=this.toastMark.findNodeAtPosition(o);return"text"===i.type&&"paragraph"!==i.parent.type&&(i=i.parent),i.sourcepos[1][1]+=1,{range:i.sourcepos,type:i.type}},t.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map(function(e){return Xe(e)}).join("\n")},t.prototype.getToastMark=function(){return this.toastMark},t}(Vt),Ar="_feEventKey";var Lr=function(e,t){var n,r=e[Ar];return r||(r=e[Ar]={}),(n=r[t])||(n=r[t]=[]),n},Ir=y,Rr=T,Pr=Lr;function Br(e,t,n){var r,o=Pr(e,t);n?(Rr(o,function(o,i){return n!==o.handler||(Fr(e,t,o.wrappedHandler),r=i,!1)}),o.splice(r,1)):(Rr(o,function(n){Fr(e,t,n.wrappedHandler)}),o.splice(0,o.length))}function Fr(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}var Hr=function(e,t,n){Ir(t)?Rr(t.split(/\s+/g),function(t){Br(e,t,n)}):Rr(t,function(t,n){Br(e,n,t)})},jr=y,zr=T,qr=Lr;function Vr(e,t,n,r){function o(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,o):"attachEvent"in e&&e.attachEvent("on"+t,o),function(e,t,n,r){var o=qr(e,t),i=!1;zr(o,function(e){return e.handler!==n||(i=!0,!1)}),i||o.push({handler:n,wrappedHandler:r})}(e,t,n,o)}var $r=function(e,t,n,r){jr(t)?zr(t.split(/\s+/g),function(t){Vr(e,t,n,r)}):zr(t,function(t,r){Vr(e,r,t,n)})},_r=function(e,t){return(_r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};
/*! *****************************************************************************
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.
***************************************************************************** */function Ur(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}_r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Wr=function(){return(Wr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=55296&&i<=57343){if(i>=55296&&i<=56319&&r+1=56320&&s<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}Zr.defaultChars=";/?:@&=+$,-_.!~*'()#",Zr.componentChars="-_.!~*'()";var Xr=Zr,Qr={},Yr={},eo={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:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",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:"IJ",ijlig:"ij",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:"ʼn",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:""},to={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:"ÿ"},no={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},ro={},oo=Kr&&Kr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ro,"__esModule",{value:!0});var io=oo({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}),so=String.fromCodePoint||function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)};ro.default=function(e){return e>=55296&&e<=57343||e>1114111?"�":(e in io.default&&(e=io.default[e]),so(e))};var ao=Kr&&Kr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.decodeHTML=Yr.decodeHTMLStrict=Yr.decodeXML=void 0;var lo=ao(eo),co=ao(to),uo=ao(no),po=ao(ro),ho=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function fo(e){var t=go(e);return function(e){return String(e).replace(ho,t)}}Yr.decodeXML=fo(uo.default),Yr.decodeHTMLStrict=fo(lo.default);var mo=function(e,t){return e1?So(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var No=new RegExp(wo.source+"|"+Mo.source,"g");function Oo(e){return function(t){return t.replace(No,function(t){return e[t]||Eo(t)})}}vo.escape=function(e){return e.replace(No,Eo)},vo.escapeUTF8=function(e){return e.replace(wo,Eo)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.encodeHTML5=e.encodeHTML4=e.escapeUTF8=e.escape=e.encodeNonAsciiHTML=e.encodeHTML=e.encodeXML=e.encode=e.decodeStrict=e.decode=void 0;var t=Yr,n=vo;e.decode=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTML)(e)},e.decodeStrict=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?n.encodeXML:n.encodeHTML)(e)};var r=vo;Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return r.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return r.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return r.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return r.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return r.encodeHTML}});var o=Yr;Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return o.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return o.decodeXML}})}(Qr);var Do="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",Ao=/[\\&]/,Lo="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",Io=new RegExp("\\\\"+Lo+"|"+Do,"gi"),Ro=new RegExp('[&<>"]',"g"),Po=function(e){return 92===e.charCodeAt(0)?e.charAt(1):Qr.decodeHTML(e)};function Bo(e){return Ao.test(e)?e.replace(Io,Po):e}function Fo(e){try{return Xr(e)}catch(t){return e}}function Ho(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}}function jo(e){return Ro.test(e)?e.replace(Ro,Ho):e}function zo(e,t){for(var n=[],r=0;r`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",fi="[A-Za-z][A-Za-z0-9-]*\\s*[>]",mi=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|[A-Za-z][A-Za-z0-9-]*\\s*[>]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i");if(String.fromCodePoint)pi=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var gi=String.fromCharCode,vi=Math.floor;pi=function(){for(var e=[],t=0;t1114111||vi(l)!==l)return String.fromCharCode(65533);l<=65535?o.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,o.push(n,r)),(i+1===s||o.length>16384)&&(a+=gi.apply(void 0,o),o.length=0)}return a}}var yi=pi,bi="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",wi="[^<\\s]*[^!.,:*_?~\\s]",ki="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function xi(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0,o=e;r?@\[\]\\^_`{|}~\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]/),Ai=new RegExp('^(?:"('+Oi+'|[^"\\x00])*"|\'('+Oi+"|[^'\\x00])*'|\\(("+Oi+"|[^()\\x00])*\\))"),Li=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,Ii=new RegExp("^"+Lo),Ri=new RegExp("^"+Do,"i"),Pi=/`+/,Bi=/^`+/,Fi=/\.\.\./g,Hi=/--+/g,ji=/^<([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])?)*)>/,zi=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,qi=/^ *(?:\n *)?/,Vi=/^[ \t\n\x0b\x0c\x0d]/,$i=/^\s/,_i=/ *$/,Ui=/^ */,Wi=/^ *(?:\n|$)/,Ji=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,Ki=/^[^\n`\[\]\\!<&*_'"~$]+/m,Gi=function(){function e(e){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=e}return e.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],r=this.lineStartNum+this.lineIdx,o=[r,e+n];return"number"==typeof t?[o,[r,t+n]]:o},e.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},e.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},e.prototype.peek=function(){return this.pos1){var l=Mi(a);this.lineIdx+=a.length-1,this.linePosOffset=-(this.pos-l.length-n.length),s[1]=this.sourcepos(this.pos),i=a.join(" ")}var c=si("code",s);return i.length>0&&null!==i.match(/[^ ]/)&&" "==i[0]&&" "==i[i.length-1]?c.literal=i.slice(1,i.length-1):c.literal=i,c.tickCount=n.length,e.appendChild(c),!0}return this.pos=o,e.appendChild(di(n,this.sourcepos(t,this.pos-1))),!0},e.prototype.parseBackslash=function(e){var t,n=this.subject;this.pos+=1;var r=this.pos;return 10===this.peek()?(this.pos+=1,t=si("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):Ii.test(n.charAt(this.pos))?(e.appendChild(di(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(di("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,o=this.pos+1;return(t=this.match(ji))?(n=t.slice(1,t.length-1),(r=si("link",this.sourcepos(o,this.pos))).destination=Fo("mailto:"+n),r.title="",r.appendChild(di(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(zi))&&(n=t.slice(1,t.length-1),(r=si("link",this.sourcepos(o,this.pos))).destination=Fo(n),r.title="",r.appendChild(di(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(mi);if(null===n)return!1;var r=si("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.scanDelims=function(e){var t=0,n=this.pos;if(39===e||34===e)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(126===e||36===e))return this.pos=n,null;var r,o=0===n?"\n":this.subject.charAt(n-1),i=this.peek();r=-1===i?"\n":yi(i);var s,a,l=$i.test(r),c=Di.test(r),u=$i.test(o),d=Di.test(o),p=!l&&(!c||u||d),h=!u&&(!d||l||c);return 95===e?(s=p&&(!h||d),a=h&&(!p||c)):39===e||34===e?(s=p&&!h,a=h):36===e?(s=!l,a=!u):(s=p,a=h),this.pos=n,{numdelims:t,canOpen:s,canClose:a}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,o=this.pos+1;this.pos+=r;var i=di(39===e?"’":34===e?"“":this.subject.slice(o-1,this.pos),this.sourcepos(o,this.pos));return t.appendChild(i),(n.canOpen||n.canClose)&&(this.options.smart||39!==e&&34!==e)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:i,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},e.prototype.removeDelimiter=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},e.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},e.prototype.processEmphasis=function(e){var t,n,r,o,i,s,a,l=!1,c=((t={})[95]=[e,e,e],t[42]=[e,e,e],t[39]=[e],t[34]=[e],t[126]=[e],t[36]=[e],t);for(r=this.delimiters;null!==r&&r.previous!==e;)r=r.previous;for(;null!==r;){var u=r.cc,d=95===u||42===u;if(r.canClose){for(n=r.previous,a=!1;null!==n&&n!==e&&n!==c[u][d?r.origdelims%3:0];){if(l=d&&(r.canOpen||n.canClose)&&r.origdelims%3!=0&&(n.origdelims+r.origdelims)%3==0,n.cc===r.cc&&n.canOpen&&!l){a=!0;break}n=n.previous}if(o=r,d||126===u||36===u)if(a){if(n){var p=r.numdelims>=2&&n.numdelims>=2?2:1,h=d?0:1;i=n.node,s=r.node;var f=d?1===p?"emph":"strong":"strike";36===u&&(f="customInline");var m=si(f),g=i.sourcepos[1],v=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-p+1],[v[0],v[1]+p-1]],i.sourcepos[1][1]-=p,s.sourcepos[0][1]+=p,i.literal=i.literal.slice(p),s.literal=s.literal.slice(p),n.numdelims-=p,r.numdelims-=p;for(var y=i.next,b=void 0;y&&y!==s;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(36===u){var w=m.firstChild,k=w.literal||"",x=k.split(/\s/)[0];m.info=x,k.length<=x.length?w.unlink():(w.sourcepos[0][1]+=x.length,w.literal=k.replace(x+" ",""))}if(i.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=h&&(0===n.numdelims&&i.unlink(),this.removeDelimiter(n)),r.numdelims<=h){0===r.numdelims&&s.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else 39===u?(r.node.literal="’",a&&(n.node.literal="‘"),r=r.next):34===u&&(r.node.literal="”",a&&(n.node.literal="“"),r=r.next);a||(c[u][d?o.origdelims%3:0]=o.previous,o.canOpen||this.removeDelimiter(o))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(Ai);return null===e?null:Bo(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(Li);if(null===e){if(60===this.peek())return null;for(var t=this.pos,n=0,r=void 0;-1!==(r=this.peek());)if(92===r&&Ii.test(this.subject.charAt(this.pos+1)))this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===r)this.pos+=1,n+=1;else if(41===r){if(n<1)break;this.pos+=1,n-=1}else{if(null!==Vi.exec(yi(r)))break;this.pos+=1}return this.pos===t&&41!==r?null:0!==n?null:Fo(Bo(e=this.subject.substr(t,this.pos-t)))}return Fo(Bo(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(Ji);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=di("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},e.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=di("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{n=di("!",this.sourcepos(this.pos,this.pos));e.appendChild(n)}return!0},e.prototype.parseCloseBracket=function(e){var t=null,n=null,r=!1;this.pos+=1;var o=this.pos,i=this.brackets;if(null===i)return e.appendChild(di("]",this.sourcepos(o,o))),!0;if(!i.active)return e.appendChild(di("]",this.sourcepos(o,o))),this.removeBracket(),!0;var s=i.image,a=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(Vi.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle()),1)&&this.spnl()&&41===this.peek()?(this.pos+=1,r=!0):this.pos=a);var l="";if(!r){var c=this.pos,u=this.parseLinkLabel();if(u>2?l=this.subject.slice(c,c+u):i.bracketAfter||(l=this.subject.slice(i.index,o)),0===u&&(this.pos=a),l){l=Si(l);var d=this.refMap[l];d&&(t=d.destination,n=d.title,r=!0)}}if(r){var p=si(s?"image":"link");p.destination=t,p.title=n||"",p.sourcepos=[i.startpos,this.sourcepos(this.pos)];for(var h=i.node.next,f=void 0;h;)f=h.next,h.unlink(),p.appendChild(h),h=f;if(e.appendChild(p),this.processEmphasis(i.previousDelimiter),this.removeBracket(),i.node.unlink(),!s)for(i=this.brackets;null!==i;)i.image||(i.active=!1),i=i.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0}return this.removeBracket(),this.pos=o,e.appendChild(di("]",this.sourcepos(o,o))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0},e.prototype.addBracket=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+(n?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},e.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},e.prototype.parseEntity=function(e){var t,n=this.pos+1;return!!(t=this.match(Ri))&&(e.appendChild(di(Qr.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(Ki)){if(this.options.smart){var r=t.replace(Fi,"…").replace(Hi,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),zo("—",n)+zo("–",t)});e.appendChild(di(r,this.sourcepos(n,this.pos)))}else{var o=di(t,this.sourcepos(n,this.pos));e.appendChild(o)}return!0}return!1},e.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&"text"===t.type&&" "===t.literal[t.literal.length-1]){var n=" "===t.literal[t.literal.length-2],r=t.literal.length;t.literal=t.literal.replace(_i,"");var o=r-t.literal.length;t.sourcepos[1][1]-=o,e.appendChild(si(n?"linebreak":"softbreak",this.sourcepos(this.pos-o,this.pos)))}else e.appendChild(si("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(Ui),!0},e.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,r=this.pos,o=this.parseLinkLabel();if(0===o)return 0;var i=this.subject.substr(0,o);if(58!==this.peek())return this.pos=r,0;this.pos++,this.spnl();var s=this.parseLinkDestination();if(null===s)return this.pos=r,0;var a=this.pos;this.spnl(),this.pos!==a&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=a);var l=!0;if(null===this.match(Wi)&&(""===n?l=!1:(n="",this.pos=a,l=null!==this.match(Wi))),!l)return this.pos=r,0;var c=Si(i);if(""===c)return this.pos=r,0;var u=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=u[1][0]+1;var d=si("refDef",u);return d.title=n,d.dest=s,d.label=c,e.insertBefore(d),t[c]?this.refDefCandidateMap[d.id]=d:t[c]=js(d),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,o=t.node;if(r&&"text"===o.type)n.push(o);else if(1===n.length)n=[];else if(n.length>1){var i=n[0],s=n[n.length-1];i.sourcepos&&s.sourcepos&&(i.sourcepos[1]=s.sourcepos[1]),i.next=s.next,i.next&&(i.next.prev=i);for(var a=1;as&&d.push(di(o.substring(s,m[0]),u(s,m[0]-1)));var y=si("link",u.apply(void 0,m));y.appendChild(di(v,u.apply(void 0,m))),y.destination=g,y.extendedAutolink=!0,d.push(y),s=m[1]+1}s=t.listData.markerOffset+t.listData.padding))return 1;e.advanceOffset(t.listData.markerOffset+t.listData.padding,!0)}return 0},finalize:function(e,t){if(t.firstChild&&"paragraph"===t.firstChild.type){var n=t.firstChild,r=n.stringContent.match(Zi);if(r){var o=r[0].length;n.stringContent=n.stringContent.substring(o-1),n.sourcepos[0][1]+=o,n.lineOffsets[0]+=o,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},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:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var o=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(es);if(o&&o[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+o[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.fenceOffset;i>0&&os(ns(n,e.offset));)e.advanceOffset(1,!0),i--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){var n;if(null!==t.stringContent){if(t.isFenced){var r=t.stringContent,o=r.indexOf("\n"),i=r.slice(0,o),s=r.slice(o+1),a=i.match(/^(\s*)(.*)/);t.infoPadding=a[1].length,t.info=Bo(a[2].trim()),t.literal=s}else t.literal=null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},htmlBlock:{continue:function(e,t){return!e.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(e,t){var n;t.literal=(null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===ns(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&rs(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},table:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableHead"===e||"tableBody"===e},acceptsLines:!1},tableBody:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableRow"===e},acceptsLines:!1},tableHead:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableRow"===e||"tableDelimRow"===e},acceptsLines:!1},tableRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableCell"===e},acceptsLines:!1},tableCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},tableDelimRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableDelimCell"===e},acceptsLines:!1},tableDelimCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},refDef:ss,customBlock:{continue:function(e,t){var n=e.currentLine,r=n.match(is);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.offset;o>0&&os(ns(n,e.offset));)e.advanceOffset(1,!0),o--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),o=n.slice(0,r),i=n.slice(r+1),s=o.match(/^(\s*)(.*)/);t.info=Bo(s[2].trim()),t.literal=i,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},frontMatter:ss};function ls(e){for(var t=0,n=0,r=[],o=0;o|$)/i,/^/,/\?>/,/>/,/\]\]>/],Ss=/^[#`~*+_=<>0-9-;$]/,Es=/\r\n|\n|\r/;function Ns(){return si("document",[[1,1],[0,0]])}var Os={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},Ds=function(){function e(e){this.options=Wr(Wr({},Os),e),this.doc=Ns(),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.lines=[],this.options.frontMatter&&(as.frontMatter=Ts,ks.unshift(Cs)),this.inlineParser=new Gi(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,o,i=this.currentLine;e>0&&(o=i[this.offset]);)"\t"===o?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},e.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},e.prototype.findNextNonspace=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},e.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=zo(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+"\n"},e.prototype.addChild=function(e,t){for(;!as[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=si(e,[[this.lineNumber,n],[0,0]]);return r.stringContent="",this.tip.appendChild(r),this.tip=r,r},e.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},e.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],as[e.type].finalize(this,e),this.tip=n},e.prototype.processInlines=function(e){var t,n=this.options.customParser,r=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=r.next();){var o=t.node,i=t.entering,s=o.type;n&&n[s]&&n[s](o,{entering:i,options:this.options}),i||"paragraph"!==s&&"heading"!==s&&("tableCell"!==s||o.ignored)||this.inlineParser.parse(o)}},e.prototype.incorporateLine=function(e){var t=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var n,r=!0;(n=t.lastChild)&&n.open;){switch(t=n,this.findNextNonspace(),as[t.type].continue(this,t)){case 0:break;case 1:r=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var o="paragraph"!==t.type&&as[t.type].acceptsLines,i=ks.length;!o;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!Ss.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s=1&&t.htmlBlockType<=5&&Ms[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offsett[0]?-1:e[1]t[1]?-1:0}function Ls(e,t){var n=e[0];return 1===As(e[1],t)?1:-1===As(n,t)?-1:0}function Is(e,t){for(var n=0,r=t;nt?-1:0}function Ps(e,t){for(var n=e.firstChild;n;){var r=Rs(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function Bs(e){return function(e){return Uo[e]}(e)||null}function Fs(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var o=r.next();if(!o)break;t=o.node}}var Hs=/\r\n|\n|\r/;function js(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var zs=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null===t||void 0===t?void 0:t.referenceDefinition),this.parser=new Ds(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Hs),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,o=e[0],i=e[1],s=t[0],a=t[1],l=n.split(Hs),c=l.length,u=this.lineTexts[o-1],d=this.lineTexts[s-1];l[0]=u.slice(0,i-1)+l[0],l[c-1]=l[c-1]+d.slice(a-1);var p=s-o+1;return(r=this.lineTexts).splice.apply(r,Jr([o-1,p],l)),c-p},e.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 e=this.lineTexts,t=e.length-1;""===e[t];)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},e.prototype.replaceRangeNodes=function(e,t,n){e?(Is(e,n),function(e,t){if(e.parent===t.parent&&e!==t){for(var n=e.next;n&&n!==t;){for(var r=n.next,o=0,i=["parent","prev","next"];o=0;n-=1)e.prependChild(t[n])}(this.root,n)},e.prototype.getNodeRange=function(e,t){var n=Ps(this.root,e[0]),r=Ps(this.root,t[0]);return r&&r.next&&t[0]+1===r.next.sourcepos[0][0]&&(r=r.next),[n,r]},e.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach(function(e){e(t)})},e.prototype.extendEndLine=function(e){for(;""===this.lineTexts[e];)e+=1;return e},e.prototype.parseRange=function(e,t,n,r){e&&e.prev&&(li(e.prev)&&function(e){var t=e.match(/^[ \t]+/);if(t&&(t[0].length>=2||/\t/.test(t[0])))return!0;var n=t?e.slice(t.length):e;return ys.test(n)||bs.test(n)}(this.lineTexts[n-1])||function(e){return"table"===e.type}(e.prev)&&function(e){return!rs(e)&&-1!==e.indexOf("|")}(this.lineTexts[n-1]))&&(n=(e=e.prev).sourcepos[0][0]);for(var o=this.lineTexts.slice(n-1,r),i=this.parser.partialParseStart(n,o),s=t?t.next:this.root.firstChild,a=i.lastChild,l=a&&ai(a)&&a.open,c=a&&ui(a)&&a.open,u=a&&li(a);(l||c)&&s||u&&s&&("list"===s.type||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=s,r=d,s=s.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(i),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&ci(e)||t&&ci(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},e.prototype.markDeletedRefMap=function(e,t){var n=this;if(!Ni(this.refMap)){var r=function(e){if(ci(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Fs(r,e.parent,t),t&&Fs(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!Ni(this.refMap)){var n=function(e){if(ci(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=js(e))}};e.forEach(function(e){Fs(n,e)})}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;Ni(this.refDefCandidateMap)||Ei(this.refDefCandidateMap,function(t,n){var r=n.label,o=n.sourcepos,i=e.refMap[r];(!i||i.unlinked||i.sourcepos[0][0]>o[0][0])&&(e.refMap[r]=js(n))})},e.prototype.getRangeWithRefDef=function(e,t,n,r,o){if(this.referenceDefinition&&!Ni(this.refMap)){var i=Ps(this.root,e-1),s=Ps(this.root,t+1);i&&ci(i)&&i!==n&&i!==r&&(e=(n=i).sourcepos[0][0]),s&&ci(s)&&s!==n&&s!==r&&(r=s,t=this.extendEndLine(r.sourcepos[1][0]+o))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),o=r[0],i=r[1],s=o?Math.min(o.sourcepos[0][0],e[0]):e[0],a=this.extendEndLine((i?Math.max(i.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(s,a,o,i,n)),c=l.newNodes,u=l.extStartNode,d=l.extEndNode,p=this.getRemovedNodeRange(u,d),h=d?d.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(u,d),this.replaceRangeNodes(u,d,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(u,d,c),{nodes:c,removedNodeRange:p,nextNode:h}},e.prototype.parseRefLink=function(){var e=this,t=[];return Ni(this.refMap)||Ei(this.refMap,function(n,r){r.unlinked&&delete e.refMap[n],Ei(e.refLinkCandidateMap,function(r,o){var i=o.node;o.refLabel===n&&t.push(e.parse(i.sourcepos[0],i.sourcepos[1]))})}),t},e.prototype.removeUnlinkedCandidate=function(){Ni(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){Ei(e,function(t){(function(e){var t=Bs(e);if(!t)return!0;for(;t&&"document"!==t.type;){if(!t.parent&&!t.prev&&!t.next)return!0;t=t.parent}return!1})(t)&&delete e[t]})})},e.prototype.editMarkdown=function(e,t,n){var r=this.updateLineTexts(e,t,n),o=this.parse(e,t,r),i=function(e){for(var t=[],n=1;n]*>)","ig");function Vs(e){return qs.test(e)?e.replace(qs,function(e,t){return"<"+t}):e}var $s={heading:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"h"+e.level,outerNewLine:!0}},text:function(e){return{type:"text",content:e.literal}},softbreak:function(e,t){return{type:"html",content:t.options.softbreak}},linebreak:function(){return{type:"html",content:"
\n"}},emph:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"em"}},strong:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"strong"}},paragraph:function(e,t){var n,r=t.entering,o=null===(n=e.parent)||void 0===n?void 0:n.parent;return o&&"list"===o.type&&o.listData.tight?null:{type:r?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(e,t){var n=t.entering,r=e.listData,o=r.type,i=r.start,s="bullet"===o?"ul":"ol",a={};return"ol"===s&&null!==i&&1!==i&&(a.start=i.toString()),{type:n?"openTag":"closeTag",tagName:s,attributes:a,outerNewLine:!0}},item:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(e,t){return{type:"html",content:t.options.tagFilter?Vs(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?Vs(e.literal):e.literal;return n.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(e){return[{type:"openTag",tagName:"code"},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e.info,n=t?t.split(/\s+/):[],r=[];return n.length>0&&n[0].length>0&&r.push("language-"+jo(n[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:r},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(e,t){if(t.entering){var n=e,r=n.title,o=n.destination;return{type:"openTag",tagName:"a",attributes:Wr({href:jo(o)},r&&{title:jo(r)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,o=e,i=o.title,s=o.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:Wr({src:jo(s),alt:n(e)},i&&{title:jo(i)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),o=n[r];if(o)try{return o(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+r+" block node was parsed in markdown renderer: "+e)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(e){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(e,t,n){var r=e,o=r.info,i=r.firstChild,s=o.trim().toLowerCase(),a=n[s],l=t.entering;if(a)try{return a(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+s+" inline node was parsed in markdown renderer: "+e)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+o+(i?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},_s={strike:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(e,t){var n=t.entering,r=e.listData,o=r.checked,i=r.task;if(n){var s={type:"openTag",tagName:"li",outerNewLine:!0};return i?[s,{type:"openTag",tagName:"input",selfClose:!0,attributes:Wr(Wr({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:s}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(e,t){if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(e.lastChild)for(var r=e.parent.parent.columns.length,o=e.lastChild.endIdx+1;o0&&this.buffer.push(' class="'+r.join(" ")+'"'),o&&Object.keys(o).forEach(function(e){var n=o[e];t.buffer.push(" "+e+'="'+n+'"')}),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},e.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push(""+t+">")},e.prototype.addNewLine=function(){this.buffer.length&&"\n"!==Mi(Mi(this.buffer))&&this.buffer.push("\n")},e.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},e.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},e.prototype.renderTextNode=function(e){this.buffer.push(jo(e.content))},e.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},e.prototype.renderElementNode=function(e){"openTag"===e.type?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},e}();
/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */var Ks=Object.hasOwnProperty,Gs=Object.setPrototypeOf,Zs=Object.isFrozen,Xs=Object.getPrototypeOf,Qs=Object.getOwnPropertyDescriptor,Ys=Object.freeze,ea=Object.seal,ta=Object.create,na="undefined"!=typeof Reflect&&Reflect,ra=na.apply,oa=na.construct;ra||(ra=function(e,t,n){return e.apply(t,n)}),Ys||(Ys=function(e){return e}),ea||(ea=function(e){return e}),oa||(oa=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1?n-1:0),o=1;o/gm),La=ea(/^data-[\-\w.\u00B7-\uFFFF]/),Ia=ea(/^aria-[\-\w]+$/),Ra=ea(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pa=ea(/^(?:\w+script|data):/i),Ba=ea(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Ha(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:ja(),n=function(t){return e(t)};if(n.version="2.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,d=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,p=t.Text,h=t.Comment,f=t.DOMParser,m=t.trustedTypes,g=l.prototype,v=ya(g,"cloneNode"),y=ya(g,"nextSibling"),b=ya(g,"childNodes"),w=ya(g,"parentNode");if("function"==typeof s){var k=o.createElement("template");k.content&&k.content.ownerDocument&&(o=k.content.ownerDocument)}var x=za(m,r),C=x&&te?x.createHTML(""):"",T=o,M=T.implementation,S=T.createNodeIterator,E=T.createDocumentFragment,N=T.getElementsByTagName,O=r.importNode,D={};try{D=va(o).documentMode?o.documentMode:{}}catch(e){}var A={};n.isSupported="function"==typeof w&&M&&void 0!==M.createHTMLDocument&&9!==D;var L=Da,I=Aa,R=La,P=Ia,B=Pa,F=Ba,H=Ra,j=null,z=ga({},[].concat(Ha(ba),Ha(wa),Ha(ka),Ha(Ca),Ha(Ma))),q=null,V=ga({},[].concat(Ha(Sa),Ha(Ea),Ha(Na),Ha(Oa))),$=null,_=null,U=!0,W=!0,J=!1,K=!1,G=!1,Z=!1,X=!1,Q=!1,Y=!1,ee=!0,te=!1,ne=!0,re=!0,oe=!1,ie={},se=null,ae=ga({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=null,ce=ga({},["audio","video","img","source","image","track"]),ue=null,de=ga({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",me=fe,ge=!1,ve=void 0,ye=["application/xhtml+xml","text/html"],be=void 0,we=null,ke=o.createElement("form"),xe=function(e){we&&we===e||(e&&"object"===(void 0===e?"undefined":Fa(e))||(e={}),e=va(e),j="ALLOWED_TAGS"in e?ga({},e.ALLOWED_TAGS):z,q="ALLOWED_ATTR"in e?ga({},e.ALLOWED_ATTR):V,ue="ADD_URI_SAFE_ATTR"in e?ga(va(de),e.ADD_URI_SAFE_ATTR):de,le="ADD_DATA_URI_TAGS"in e?ga(va(ce),e.ADD_DATA_URI_TAGS):ce,se="FORBID_CONTENTS"in e?ga({},e.FORBID_CONTENTS):ae,$="FORBID_TAGS"in e?ga({},e.FORBID_TAGS):{},_="FORBID_ATTR"in e?ga({},e.FORBID_ATTR):{},ie="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,J=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,Q=e.RETURN_DOM||!1,Y=e.RETURN_DOM_FRAGMENT||!1,ee=!1!==e.RETURN_DOM_IMPORT,te=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,H=e.ALLOWED_URI_REGEXP||H,me=e.NAMESPACE||fe,ve=ve=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ve?function(e){return e}:la,K&&(W=!1),Y&&(Q=!0),ie&&(j=ga({},[].concat(Ha(Ma))),q=[],!0===ie.html&&(ga(j,ba),ga(q,Sa)),!0===ie.svg&&(ga(j,wa),ga(q,Ea),ga(q,Oa)),!0===ie.svgFilters&&(ga(j,ka),ga(q,Ea),ga(q,Oa)),!0===ie.mathMl&&(ga(j,Ca),ga(q,Na),ga(q,Oa))),e.ADD_TAGS&&(j===z&&(j=va(j)),ga(j,e.ADD_TAGS)),e.ADD_ATTR&&(q===V&&(q=va(q)),ga(q,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&ga(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(se===ae&&(se=va(se)),ga(se,e.FORBID_CONTENTS)),re&&(j["#text"]=!0),G&&ga(j,["html","head","body"]),j.table&&(ga(j,["tbody"]),delete $.tbody),Ys&&Ys(e),we=e)},Ce=ga({},["mi","mo","mn","ms","mtext"]),Te=ga({},["foreignobject","desc","title","annotation-xml"]),Me=ga({},wa);ga(Me,ka),ga(Me,xa);var Se=ga({},Ca);ga(Se,Ta);var Ee=function(e){aa(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=C}catch(t){e.remove()}}},Ne=function(e,t){try{aa(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){aa(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!q[e])if(Q||Y)try{Ee(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Oe=function(e){var t=void 0,n=void 0;if(X)e=""+e;else{var r=ca(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ve&&(e=''+e+"");var i=x?x.createHTML(e):e;if(me===fe)try{t=(new f).parseFromString(i,ve)}catch(e){}if(!t||!t.documentElement){t=M.createDocument(me,"template",null);try{t.documentElement.innerHTML=ge?"":i}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(o.createTextNode(n),s.childNodes[0]||null),me===fe?N.call(t,G?"html":"body")[0]:G?t.documentElement:s},De=function(e){return S.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Ae=function(e){return"object"===(void 0===a?"undefined":Fa(a))?e instanceof a:e&&"object"===(void 0===e?"undefined":Fa(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Le=function(e,t,r){A[e]&&ia(A[e],function(e){e.call(n,t,r,we)})},Ie=function(e){var t=void 0;if(Le("beforeSanitizeElements",e,null),function(e){return!(e instanceof p||e instanceof h||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof d&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)}(e))return Ee(e),!0;if(ca(e.nodeName,/[\u0080-\uFFFF]/))return Ee(e),!0;var r=be(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:j}),!Ae(e.firstElementChild)&&(!Ae(e.content)||!Ae(e.content.firstElementChild))&&ha(/<[/\w]/g,e.innerHTML)&&ha(/<[/\w]/g,e.textContent))return Ee(e),!0;if("select"===r&&ha(/=0;--s)o.insertBefore(v(i[s],!0),y(e))}return Ee(e),!0}return e instanceof l&&!function(e){var t=w(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});var n=la(e.tagName),r=la(t.tagName);if(e.namespaceURI===he)return t.namespaceURI===fe?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Me[n]);if(e.namespaceURI===pe)return t.namespaceURI===fe?"math"===n:t.namespaceURI===he?"math"===n&&Te[r]:Boolean(Se[n]);if(e.namespaceURI===fe){if(t.namespaceURI===he&&!Te[r])return!1;if(t.namespaceURI===pe&&!Ce[r])return!1;var o=ga({},["title","style","font","a","script"]);return!Se[n]&&(o[n]||!Me[n])}return!1}(e)?(Ee(e),!0):"noscript"!==r&&"noembed"!==r||!ha(/<\/no(script|embed)/i,e.innerHTML)?(K&&3===e.nodeType&&(t=e.textContent,t=ua(t,L," "),t=ua(t,I," "),e.textContent!==t&&(aa(n.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(Ee(e),!0)},Re=function(e,t,n){if(ne&&("id"===t||"name"===t)&&(n in o||n in ke))return!1;if(W&&!_[t]&&ha(R,t));else if(U&&ha(P,t));else{if(!q[t]||_[t])return!1;if(ue[t]);else if(ha(H,ua(n,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==da(n,"data:")||!le[e])if(J&&!ha(B,ua(n,F,"")));else if(n)return!1}return!0},Pe=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;Le("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:q};for(i=s.length;i--;){var l=t=s[i],c=l.name,u=l.namespaceURI;if(r=pa(t.value),o=be(c),a.attrName=o,a.attrValue=r,a.keepAttr=!0,a.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,a),r=a.attrValue,!a.forceKeepAttr&&(Ne(c,e),a.keepAttr))if(ha(/\/>/i,r))Ne(c,e);else{K&&(r=ua(r,L," "),r=ua(r,I," "));var d=be(e.nodeName);if(Re(d,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),sa(n.removed)}catch(e){}}}Le("afterSanitizeAttributes",e,null)}},Be=function e(t){var n=void 0,r=De(t);for(Le("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Le("uponSanitizeShadowNode",n,null),Ie(n)||(n.content instanceof i&&e(n.content),Pe(n));Le("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var s=void 0,l=void 0,c=void 0,u=void 0,d=void 0;if((ge=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ae(e)){if("function"!=typeof e.toString)throw fa("toString is not a function");if("string"!=typeof(e=e.toString()))throw fa("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Fa(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ae(e))return t.toStaticHTML(e.outerHTML)}return e}if(Z||xe(o),n.removed=[],"string"==typeof e&&(oe=!1),oe);else if(e instanceof a)1===(l=(s=Oe("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName?s=l:"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!Q&&!K&&!G&&-1===e.indexOf("<"))return x&&te?x.createHTML(e):e;if(!(s=Oe(e)))return Q?null:C}s&&X&&Ee(s.firstChild);for(var p=De(oe?e:s);c=p.nextNode();)3===c.nodeType&&c===u||Ie(c)||(c.content instanceof i&&Be(c.content),Pe(c),u=c);if(u=null,oe)return e;if(Q){if(Y)for(d=E.call(s.ownerDocument);s.firstChild;)d.appendChild(s.firstChild);else d=s;return ee&&(d=O.call(r,d,!0)),d}var h=G?s.outerHTML:s.innerHTML;return K&&(h=ua(h,L," "),h=ua(h,I," ")),x&&te?x.createHTML(h):h},n.setConfig=function(e){xe(e),Z=!0},n.clearConfig=function(){we=null,Z=!1},n.isValidAttribute=function(e,t,n){we||xe({});var r=be(e),o=be(t);return Re(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(A[e]=A[e]||[],aa(A[e],t))},n.removeHook=function(e){A[e]&&sa(A[e])},n.removeHooks=function(e){A[e]&&(A[e]=[])},n.removeAllHooks=function(){A={}},n}(),Va=["iframe","embed"],$a=[];function _a(e){ue(Va,e)&&$a.push(e.toLowerCase())}function Ua(e,t){return qa.sanitize(e,h({ADD_TAGS:$a,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function Wa(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|("+t+"\\s*[>])","ig"),"").trim()}function Ja(e){var t=(e=e.match(vt)[0]).match(new RegExp(ft,"g"));return t?t.reduce(function(e,t){var n=t.trim().split("="),r=n[0],o=n.slice(1);return o.length&&(e[r]=o.join("=").replace(/'|"/g,"").trim()),e},{}):{}}function Ka(e){return Ee(e.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e},{})}function Ga(e,t,n,r){var o=r.getToDOMNode(t)(e),i=n(o.outerHTML),s=document.createElement("div");return s.innerHTML=i,{dom:o=s.firstChild,htmlAttrs:Ka(o)}}var Za={htmlBlock:function(e,t,n){return{atom:!0,content:"block+",group:"block",attrs:{htmlAttrs:{default:{}},childrenHTML:{default:""},htmlBlock:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:Ka(e),childrenHTML:e.innerHTML}}}],toDOM:function(r){var o=Ga(r,e,t,n),i=o.dom,s=o.htmlAttrs;return s.class=s.class?s.class+" html-block":"html-block",f([e,s],Ee(i.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:Ka(e)}}}],toDOM:function(r){var o=Ga(r,e,t,n).htmlAttrs;return[e,o,0]}}}};var Xa=/^\s*<\s*\//,Qa={paragraph:function(e,t){var n=t.entering,r=t.origin;return t.options.nodeId?{type:n?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:r()},softbreak:function(e){return{type:"html",content:e.prev&&"htmlInline"===e.prev.type&&/
/.test(e.prev.literal)?"\n":"
\n"}},item:function(e,t){if(t.entering){var n={},r=[];return e.listData.task&&(n["data-task"]="",r.push("task-list-item"),e.listData.checked&&(r.push("checked"),n["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:r,attributes:n,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code",attributes:{"data-backticks":String(e.tickCount)}},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e,n=t.fenceLength,r=t.info,o=r?r.split(/\s+/):[],i=[],s={};if(n>3&&(s["data-backticks"]=n),o.length>0&&o[0].length>0){var a=o[0];i.push("lang-"+a),s["data-language"]=a}return[{type:"openTag",tagName:"pre",classNames:i},{type:"openTag",tagName:"code",attributes:s},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,o=t.skipChildren,i=e.info;return-1!==i.indexOf("widget")&&r?(o(),[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:Ye(i,ot(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function Ya(e,t){var n=h({},Qa);return e&&(n.link=function(t,n){var r=n.entering,o=(0,n.origin)();return r&&(o.attributes=h(h({},o.attributes),e)),o}),t&&Object.keys(t).forEach(function(e){var r=n[e],o=t[e];r&&$t(o)?n[e]=function(e,t){var n=h({},t);return n.origin=function(){return r(e,t)},o(e,n)}:ue(["htmlBlock","htmlInline"],e)&&!$t(o)?n[e]=function(e,t){var n=e.literal.match(vt);if(n){var r=n[0],i=n[1],s=n[3],a=(i||s).toLowerCase(),l=o[a],c=Wa(e,a);if(l){var u=h({},e);return u.attrs=Ja(r),u.childrenHTML=c,u.type=a,t.entering=!Xa.test(e.literal),l(u,t)}}return t.origin()}:n[e]=o}),n}var el=["list","item","blockQuote"],tl=["UL","OL","BLOCKQUOTE"];function nl(e,t){var n,r=e.child(t);return!r.childCount||1===r.childCount&&!(null===(n=r.firstChild.text)||void 0===n?void 0:n.trim())}function rl(e,t,n){var r=Re(t)-1,o=Pe(t)-1,i=n[r].getBoundingClientRect(),s=n[o].offsetTop-n[r].offsetTop+n[o].clientHeight;return{height:s<=0?n[r].clientHeight:s+function(e,t,n){var r=e.childCount-1,o=0;for(;n<=r&&nl(e,n);)o+=t[n].clientHeight,n+=1;return o}(e,n,Math.min(o+1,e.childCount-1)),rect:i}}function ol(e,t){for(var n=0;e&&e!==t&&(ue(tl,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function il(e,t,n){return e&&t>n+e.offsetTop?il(e.nextElementSibling,t,n)||e:null}function sl(e,t){for(var n=e.querySelector('[data-nodeid="'+t.id+'"]');!n||He(t);)t=t.parent,n=e.querySelector('[data-nodeid="'+t.id+'"]');return function(e){var t=e.mdNode,n=e.el;for(;(ue(el,t.type)||"table"===t.type)&&t.firstChild;)t=t.firstChild,n=n.firstElementChild;return{mdNode:t,el:n}}({mdNode:t,el:n})}var al={};function ll(e){e&&(delete al[Number(e.getAttribute("data-nodeid"))],Ee(e.children).forEach(function(e){ll(e)}))}function cl(e,t,n){var r=function(e){return al[e]&&al[e].height}(n),o=function(e){return al[e]&&al[e].offsetTop}(n),i=r||e.clientHeight,s=o||ol(e,t)||e.offsetTop;return r||function(e,t){al[e]=al[e]||{},al[e].height=t}(n,i),o||function(e,t){al[e]=al[e]||{},al[e].offsetTop=t}(n,s),{nodeHeight:i,offsetTop:s}}var ul=Ct("md-preview-highlight");var dl=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=Ct("md-preview");var r=t.linkAttributes,o=t.customHTMLRenderer,i=t.sanitizer,s=t.highlight,a=void 0!==s&&s;this.renderer=new Js({gfm:!0,nodeId:!0,convertors:Ya(r,o)}),this.cursorNodeId=null,this.sanitizer=i,this.initEvent(a),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=Nt(''),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){Et(this.el,"active",e)},e.prototype.initEvent=function(e){var t=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),this.isViewer||(e&&(this.eventEmitter.listen("changeToolbarState",function(e){var n=e.mdNode,r=e.cursorPos;t.updateCursorNode(n,r)}),this.eventEmitter.listen("blur",function(){t.removeHighlight()})),$r(this.el,"scroll",function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var o=n.firstElementChild;if(!o)break;r=n,n=il(o,e,ol(n,t))}var i=n||r;return i===t?null:i}(e.target.scrollTop,t.previewContent))}),this.eventEmitter.listen("changePreviewTabPreview",function(){return t.toggleActive(!0)}),this.eventEmitter.listen("changePreviewTabWrite",function(){return t.toggleActive(!1)}))},e.prototype.removeHighlight=function(){if(this.cursorNodeId){var e=this.getElementByNodeId(this.cursorNodeId);e&&U(e,ul)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=$e(e,function(e){return!function(e){switch(e.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}(e)})).type?e=function(e,t){for(var n=e.firstChild;n&&n.next&&!(Be(n.next)>t+1);)n=n.next;return n}(e,t[1]):"tableBody"===e.type&&(e=null));var n=e?e.id:null;if(this.cursorNodeId!==n){var r=this.getElementByNodeId(this.cursorNodeId),o=this.getElementByNodeId(n);r&&U(r,ul),o&&z(o,ul),this.cursorNodeId=n}},e.prototype.getElementByNodeId=function(e){return e?this.previewContent.querySelector('[data-nodeid="'+e+'"]'):null},e.prototype.update=function(e){var t=this;e.forEach(function(e){return t.replaceRangeNodes(e)}),this.eventEmitter.emit("afterPreviewRender",this)},e.prototype.replaceRangeNodes=function(e){var t=this,n=e.nodes,r=e.removedNodeRange,o=this.previewContent,i=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map(function(e){return t.renderer.render(e)}).join("")));if(r){var s=r.id,a=s[0],l=s[1],c=this.getElementByNodeId(a),u=this.getElementByNodeId(l);if(c){c.insertAdjacentHTML("beforebegin",i);for(var d=c;d&&d!==u;){var p=d.nextElementSibling;St(d),ll(d),d=p}(null===d||void 0===d?void 0:d.parentNode)&&(St(d),ll(d))}}else o.insertAdjacentHTML("afterbegin",i)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){Hr(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return It(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){E(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){E(this.el,{minHeight:e+"px"})},e}();function pl(e,t){for(var n=e.depth;n;){var r=e.node(n);if(t(r,n))return{node:r,depth:n,offset:n>0?e.before(n):0};n-=1}return null}function hl(e){return!!pl(e,function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name})}function fl(e){return!!pl(e,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name})}function ml(e){return pl(e,function(e){return"listItem"===e.type.name})}function gl(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({},t&&{rawHTML:t})}}}function vl(e){return Object.keys(e).reduce(function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t},{})}function yl(e){return{tag:e,getAttrs:function(e){return["rawHTML","colspan","rowspan","extended"].reduce(function(t,n){var r="rawHTML"===n?"data-raw-html":n,o=e.getAttribute(r);return o&&(t[n]=ue(["rawHTML","extended"],n)?o:Number(o)),t},{})}}}function bl(e){var t=e.htmlAttrs,n=e.classNames;return h(h({},t),{class:n?n.join(" "):null})}function wl(e,t,n,o){var s=t.$from,a=t.$to,l=t.depth,c=t,u=!1;if(l>=2&&s.node(l-1).type.compatibleContent(n)&&0===t.startIndex&&s.index(l-1)){var d=e.doc.resolve(t.start-2);c=new r.g(d,d,l),t.endIndex=0;h-=1)p=r.c.from(n[h].type.create(n[h].attrs,p));e.step(new i.b(a-(o?2:0),l,a,l,new r.j(p,0,0),n.length,!0));var f=0;for(h=0;ha;s-=1)o-=n.child(s).nodeSize,e.delete(o-1,o+1);var l=e.doc.resolve(t.start),c=l.nodeAfter,u=0===t.startIndex,d=t.endIndex===n.childCount,p=l.node(-1),h=l.index(-1),f=p.canReplace(h+(u?0:1),h+1,null===c||void 0===c?void 0:c.content.append(d?r.c.empty:r.c.from(n)));if(c&&f){var m=l.pos,g=m+c.nodeSize;e.step(new i.b(m-(u?1:0),g+(d?1:0),m+1,g-1,new r.j((u?r.c.empty:r.c.from(n.copy(r.c.empty))).append(d?r.c.empty:r.c.from(n.copy(r.c.empty))),u?0:1,d?0:1),u?0:1))}return e}(o,c)),!0)}}function Ml(){return function(){return function(e,t){var n=e.selection,o=e.schema,s=n.$from,a=n.$to;return!(!s.blockRange(a)||!hl(s))&&function(e){return function(t,n){var o=t.tr,s=t.selection,a=s.$from,l=s.$to,c=a.blockRange(l,function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e});if(c&&c.startIndex>0){var u=c.parent,d=u.child(c.startIndex-1);if(d.type!==e)return!1;var p=d.lastChild&&d.lastChild.type===u.type,h=p?r.c.from(e.create()):null,f=new r.j(r.c.from(e.create(null,r.c.from(u.type.create(null,h)))),p?3:1,0),m=c.start,g=c.end;return o.step(new i.b(m-(p?3:1),g,m,g,f,1,!0)),n(o),!0}return!1}}(o.nodes.listItem)(e,t)}}}function Sl(){return{indent:Ml(),outdent:function(){return function(e,t){var n=e.selection,r=e.schema,o=n.$from,i=n.$to;return!(!o.blockRange(i)||!hl(o))&&Tl(r.nodes.listItem)(e,t)}}}}var El=new Map,Nl=function(){function e(e,t,n,r){this.table=e,this.tableRows=t,this.tableStartPos=n,this.rowInfo=r}return e.create=function(t){var n=pl(t,function(e){return"table"===e.type.name});if(n){var r=n.node,o=n.depth,i=n.offset,s=El.get(r);if((null===s||void 0===s?void 0:s.tableStartPos)===i+1)return s;var a=[],l=t.start(o),c=r.child(0),u=r.child(1),d=Ol(c,l),p=Ol(u,l+c.nodeSize);c.forEach(function(e){return a.push(e)}),u.forEach(function(e){return a.push(e)});var h=new e(r,a,l,d.concat(p));return El.set(r,h),h}return null},Object.defineProperty(e.prototype,"totalRowCount",{get:function(){return this.rowInfo.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalColumnCount",{get:function(){return this.rowInfo[0].length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableStartOffset",{get:function(){return this.tableStartPos},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableEndOffset",{get:function(){return this.tableStartPos+this.table.nodeSize-1},enumerable:!1,configurable:!0}),e.prototype.getCellInfo=function(e,t){return this.rowInfo[e][t]},e.prototype.posAt=function(e,t){for(var n=0,r=this.tableStartPos;;n+=1){var o=r+this.tableRows[n].nodeSize;if(n===e){for(var i=t;ie.pos)return[t,r];return[0,0]},e.prototype.getRectOffsets=function(e,t){var n,r,o;void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var i=this.getCellIndex(e),s=i[0],a=i[1],l=this.getCellIndex(t),c=l[0],u=l[1];return s=(r=Me(s,c))[0],c=r[1],a=(o=Me(a,u))[0],u=o[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:a,endRowIdx:c,endColIdx:u})},e.prototype.getSpannedOffsets=function(e){return e},e}(),Ol=function(e,t){var n=[];return e.forEach(function(e,r){var o={rowspanMap:{},colspanMap:{},length:0};e.forEach(function(e,n){for(var i=e.nodeSize,s=0;o[s];)s+=1;o[s]={offset:t+r+n+2,nodeSize:i},o.length+=1}),n.push(o)}),n};function Dl(e,t){return Te(Nl.prototype,e),Ol=t,Nl}var Al=function(e){function t(t,n){void 0===n&&(n=t);var r=this,o=t.node(0),i=Nl.create(t),a=function(e,t,n){for(var r=n.startRowIdx,o=n.startColIdx,i=n.endRowIdx,a=n.endColIdx,l=[],c=r;c<=i;c+=1)for(var u=o;u<=a;u+=1){var d=t.getCellInfo(c,u),p=d.offset,h=d.nodeSize;l.push(new s.g(e.resolve(p+1),e.resolve(p+h-1)))}return l}(o,i,i.getRectOffsets(t,n));return(r=e.call(this,a[0].$from,a[0].$to,a)||this).startCell=t,r.endCell=n,r.offsetMap=i,r.isCellSelection=!0,r.visible=!1,r}return p(t,e),t.prototype.map=function(e,n){var r=this.startCell.pos,o=this.endCell.pos,i=e.resolve(n.map(r)),a=e.resolve(n.map(o)),l=Nl.create(i);if(this.offsetMap.totalColumnCount>l.totalColumnCount||this.offsetMap.totalRowCount>l.totalRowCount){var c={tableBody:1,tableRow:2,tableCell:3,paragraph:4}[a.parent.type.name],u=a.end(a.depth-c),d=Math.min(u-4,a.pos);return s.h.create(e,d)}return new t(i,a)},t.prototype.eq=function(e){return e instanceof t&&e.startCell.pos===this.startCell.pos&&e.endCell.pos===this.endCell.pos},t.prototype.content=function(){for(var e=this.startCell.node(-2),t=this.startCell.start(-2),n=e.child(1).firstChild,o=e.child(0).type.create(),i=e.child(1).type.create(),s=Nl.create(this.startCell),a=s.getRectOffsets(this.startCell,this.endCell),l=a.startRowIdx,c=a.startColIdx,u=a.endRowIdx,d=a.endColIdx,p=!1,h=l;h<=u;h+=1){for(var f=[],m=c;m<=d;m+=1){var g=s.getCellInfo(h,m).offset,v=e.nodeAt(g-t);v&&(p="tableHeadCell"===v.type.name,s.extendedRowspan(h,m)||s.extendedColspan(h,m)?f.push(v.type.create({extended:!0})):f.push(v.copy(v.content)))}var y=n.copy(r.c.from(f)),b=p?o:i;b.content=b.content.append(r.c.from(y))}return new r.j(function(e,t){var n=[];return e.childCount&&n.push(e),t.childCount&&n.push(t),r.c.from(n)}(o,i),1,1)},t.prototype.toJSON=function(){return JSON.stringify(this)},t}(s.f);function Ll(e,t,n,r){for(var o=n.nodes,i=o.tableRow,s=o.tableBodyCell,a=o.paragraph,l=[],c=0;c0&&o>0||"table"===(null===(t=n.firstChild)||void 0===t?void 0:t.type.name));)r-=1,o-=1,n=n.firstChild.content;if("tableHead"===n.firstChild.type.name||"tableBody"===n.firstChild.type.name)return n}return null}function Hl(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}function jl(e,t){return h(h({},e.attrs),t)}var zl=new s.e("cellSelection"),ql=function(){function e(e){this.view=e,this.handlers={mousedown:this.handleMousedown.bind(this),mousemove:this.handleMousemove.bind(this),mouseup:this.handleMouseup.bind(this)},this.startCellPos=null,this.init()}return e.prototype.init=function(){this.view.dom.addEventListener("mousedown",this.handlers.mousedown)},e.prototype.handleMousedown=function(e){var t=Rl(e.target,this.view.dom);if(2!==e.button){if(t){var n=this.getCellPos(e);n&&(this.startCellPos=n),this.bindEvent()}}else e.preventDefault()},e.prototype.handleMousemove=function(e){var t,n=zl.getState(this.view.state),r=this.getCellPos(e),o=this.startCellPos;n?t=this.view.state.doc.resolve(n):o!==r&&(t=o),t&&o&&r&&this.setCellSelection(o,r)},e.prototype.handleMouseup=function(){this.startCellPos=null,this.unbindEvent(),null!==zl.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(zl,-1))},e.prototype.bindEvent=function(){var e=this.view.dom;e.addEventListener("mousemove",this.handlers.mousemove),e.addEventListener("mouseup",this.handlers.mouseup)},e.prototype.unbindEvent=function(){var e=this.view.dom;e.removeEventListener("mousemove",this.handlers.mousemove),e.removeEventListener("mouseup",this.handlers.mouseup)},e.prototype.getCellPos=function(e){var t=e.clientX,n=e.clientY,r=this.view.posAtCoords({left:t,top:n});if(r){var o=this.view.state.doc,i=o.resolve(r.pos),s=Pl(i);if(s){var a=i.before(s.depth);return o.resolve(a)}}return null},e.prototype.setCellSelection=function(e,t){var n=this.view.state,r=n.selection,o=n.tr,i=null===zl.getState(this.view.state),s=new Al(e,t);if(i||!r.eq(s)){var a=o.setSelection(s);i&&a.setMeta(zl,t.pos),this.view.dispatch(a)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),Vl=Ct("cell-selected");function $l(e){var t=e.selection,n=e.doc;if(t instanceof Al){var r=[];return t.ranges.forEach(function(e){var t=e.$from,n=e.$to;r.push(o.a.node(t.pos-1,n.pos+1,{class:Vl}))}),o.b.create(n,r)}return null}var _l=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return O(e,this.keys)},e.prototype.get=function(e){return this.values[this.getKeyIndex(e)]},e.prototype.set=function(e,t){var n=this.getKeyIndex(e);return n>-1?this.values[n]=t:(this.keys.push(e),this.values.push(t)),this},e.prototype.has=function(e){return this.getKeyIndex(e)>-1},e.prototype.delete=function(e){var t=this.getKeyIndex(e);return t>-1&&(this.keys.splice(t,1),this.values.splice(t,1),!0)},e.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=this),this.values.forEach(function(r,o){r&&n.keys[o]&&e.call(t,r,n.keys[o],n)})},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),Ul="en-US",Wl=new(function(){function e(){this.code=Ul,this.langs=new _l}return e.prototype.setCode=function(e){this.code=e||Ul},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEach(function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,v(r,t))}else n.langs.set(e,t)})},e.prototype.get=function(e,t){t||(t=this.code);var n=this.langs.get(t);n||(n=this.langs.get(Ul));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}()),Jl=[[{action:"Add row to up",command:"addRowToUp",disableInThead:!0,className:"add-row-up"},{action:"Add row to down",command:"addRowToDown",disableInThead:!0,className:"add-row-down"},{action:"Remove row",command:"removeRow",disableInThead:!0,className:"remove-row"}],[{action:"Add column to left",command:"addColumnToLeft",className:"add-column-left"},{action:"Add column to right",command:"addColumnToRight",className:"add-column-right"},{action:"Remove column",command:"removeColumn",className:"remove-column"}],[{action:"Align column to left",command:"alignColumn",payload:{align:"left"},className:"align-column-left"},{action:"Align column to center",command:"alignColumn",payload:{align:"center"},className:"align-column-center"},{action:"Align column to right",command:"alignColumn",payload:{align:"right"},className:"align-column-right"}],[{action:"Remove table",command:"removeTable",className:"remove-table"}]];function Kl(e){return new s.d({props:{handleDOMEvents:{contextmenu:function(t,n){var r=Rl(n.target,t.dom);if(r){n.preventDefault();var o=n,i=o.clientX,s=o.clientY,a=t.dom.parentNode.getBoundingClientRect(),l=a.left,c=a.top,u="TH"===r.nodeName;return e.emit("contextmenu",{pos:{left:i-l+10+"px",top:s-c+30+"px"},menuGroups:function(e,t){return Jl.map(function(n){return n.map(function(n){var r=n.action,o=n.command,i=n.payload,s=n.disableInThead,a=n.className;return{label:Wl.get(r),onClick:function(){e.emit("command",o,i)},disabled:t&&!!s,className:a}})}).concat()}(e,u),tableCell:r}),!0}return!1}}}})}var Gl=["image","link","customBlock","frontMatter"],Zl=["strong","strike","emph","code"],Xl=["bulletList","orderedList","taskList"];function Ql(e,t,n){var r=e.$from,o=e.$to,i=e.from,s=e.to,a={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}};return t.nodesBetween(i,s,function(e,t,i){var s=function(e,t){var n=e.type.name;return"listItem"===n?e.attrs.task?"taskList":t.type.name:-1!==n.indexOf("table")?"table":n}(e,i);ue(Gl,s)||(ue(Xl,s)?(!function(e,t){t[e]={active:!0},Xl.filter(function(t){return t!==e}).forEach(function(e){t[e]&&delete t[e]})}(s,a),a.indent.disabled=!1,a.outdent.disabled=!1):"paragraph"===s||"text"===s?function(e,t,n,r){Zl.forEach(function(o){var i=n.marks[o],s=e.marksAcross(t)||[];i.isInSet(s)&&(r[o]={active:!0})})}(r,o,n,a):a[s]={active:!0})}),a}var Yl=function(){function e(e,t,n,r){var i=this;this.openEditor=function(){if(i.innerEditorView)throw new Error("The editor is already opened.");i.dom.draggable=!1,i.wrapper.style.display="none",i.innerViewContainer.style.display="block",i.innerEditorView=new o.c(i.innerViewContainer,{state:s.b.create({doc:i.node,plugins:[Object(a.a)({"Mod-z":function(){return Object(u.c)(i.innerEditorView.state,i.innerEditorView.dispatch)},"Shift-Mod-z":function(){return Object(u.b)(i.innerEditorView.state,i.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("\t")),!0},Enter:l.f,Escape:function(){return i.cancelEditing(),!0},"Ctrl-Enter":function(){return i.saveAndFinishEditing(),!0}}),Object(u.a)()]}),dispatchTransaction:function(e){return i.dispatchInner(e)},handleDOMEvents:{mousedown:function(){return i.editorView.hasFocus()&&i.innerEditorView.focus(),!0},blur:function(){return i.saveAndFinishEditing(),!0}}}),i.innerEditorView.focus()},this.node=e,this.editorView=t,this.getPos=n,this.toDOMAdaptor=r,this.innerEditorView=null,this.canceled=!1,this.dom=document.createElement("div"),this.dom.className=Ct("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=Ct("custom-block-view"),this.createInnerViewContainer(),this.renderCustomBlock(),this.dom.appendChild(this.innerViewContainer),this.dom.appendChild(this.wrapper)}return e.prototype.renderToolArea=function(){var e=this,t=document.createElement("div"),n=document.createElement("span"),r=document.createElement("button");t.className="tool",n.textContent=this.node.attrs.info,n.className="info",r.type="button",r.addEventListener("click",function(){return e.openEditor()}),t.appendChild(n),t.appendChild(r),this.wrapper.appendChild(t)},e.prototype.renderCustomBlock=function(){var e=this.toDOMAdaptor.getToDOMNode(this.node.attrs.info);if(e){for(var t=e(this.node);this.wrapper.hasChildNodes();)this.wrapper.removeChild(this.wrapper.lastChild);t&&this.wrapper.appendChild(t),this.renderToolArea()}},e.prototype.createInnerViewContainer=function(){this.innerViewContainer=document.createElement("div"),this.innerViewContainer.className=Ct("custom-block-editor"),this.innerViewContainer.style.display="none"},e.prototype.closeEditor=function(){this.innerEditorView&&(this.innerEditorView.destroy(),this.innerEditorView=null,this.innerViewContainer.style.display="none"),this.wrapper.style.display="block"},e.prototype.saveAndFinishEditing=function(){var e=this.editorView.state.selection.to,t=this.editorView.state;this.editorView.dispatch(t.tr.setSelection(De(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=Object(u.d)(this.innerEditorView.state);for(this.canceled=!0;e--;)Object(u.c)(this.innerEditorView.state,this.innerEditorView.dispatch),Object(u.c)(this.editorView.state,this.editorView.dispatch);this.canceled=!1;var t=this.editorView.state.selection.to,n=this.editorView.state;this.editorView.dispatch(n.tr.setSelection(s.h.create(n.doc,t))),this.editorView.focus(),this.closeEditor()},e.prototype.dispatchInner=function(e){var t=this.innerEditorView.state.applyTransaction(e),n=t.state,r=t.transactions;if(this.innerEditorView.updateState(n),!this.canceled&&$t(this.getPos)){for(var o=this.editorView.state.tr,s=i.d.offset(this.getPos()+1),a=0;a
":"")+t.innerHTML}var hc="\x3c!--StartFragment--\x3e",fc="\x3c!--EndFragment--\x3e";function mc(e){return function(e){return oc.test(e)}(e=function(e){return/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e=""+e+"
"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e=""),e}(e=function(e){var t=e.indexOf(hc),n=e.lastIndexOf(fc);return t>-1&&n>-1&&(e=e.slice(t+hc.length,n)),e.replace(/
]*>/g,wt)}(e)))&&(e=pc(e)),e}function gc(e,t,n){for(var r=[],o=e.childCount,i=0;it.childCount?e:t}).childCount}(e);if(n&&r)return t.nodes.table.create(null,[wc(e,o,t)]);var i=e[0],s=e.slice(1),a=[function(e,t,n){var r=vc(e,0,n);return n.nodes.tableHead.create(null,r)}(i,0,t)];return s.length&&a.push(wc(s,o,t)),t.nodes.table.create(null,a)}var xc=4,Cc=2;function Tc(e){return e*xc}function Mc(e,t){var n=e.state,o=n.selection,i=n.schema,s=n.tr,a=Bl(o),l=a.anchor,c=a.head;if(l&&c){var u=Fl(t);if(!u)return!1;var d=Nl.create(l),p=d.getRectOffsets(l,c),h=function(e,t,n){var r=[],o=bc(e),i=(o[0].childCount,o.length),s=0===t.startRowIdx,a=o.slice(0,i);if(s){var l=a.shift();if(l){var c=vc(l,0,n).content;r.push(c)}}return a.forEach(function(e){if(!e.attrs.dummyRowForPasting){var t=yc(e,0,n).content;r.push(t)}}),r}(u,p,i),f=function(e,t,n){for(var r=t.startRowIdx,o=t.startColIdx,i=n.length,s=0,a=function(e){var t=n[e].childCount;n[e].forEach(function(e){var n=e.attrs.colspan;n>1&&(t+=n-1)}),s=Math.max(s,t)},l=0;l=i&&h<=a-c){var b=n.getCellInfo(h,l-u),w=e.mapping.map(b.offset),k=v+Tc(u);o[p]={rowIdx:h,startColIdx:s,endColIdx:l,dummyOffsets:[w,k]},p+=1}}}(s,i,d,f,m),f.addedRowCount&&function(e,t,n,r,o){var i=r.addedRowCount,s=r.addedColumnCount,a=r.startColIdx,l=r.endColIdx,c=e.mapping.maps.length,u=n.tableEndOffset-2,d=Ll(i,n.totalColumnCount+s,t),p=u;e.insert(e.mapping.slice(c).map(p),d);for(var h=0;h=t&&e<=n}(a.pos,u[0],u[1])&&!p){var h=Ae(o,d,s);if(h)return r(h),!0}}return!1}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,ArrowUp:this.moveCursor("up"),ArrowDown:this.moveCursor("down")}},t}(Ht),Lc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"bulletList"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[gl("ul")],toDOM:function(e){return["ul",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.changeList=function(){return function(e,t){return xl(e.schema.nodes.bulletList)(e,t)}},t.prototype.commands=function(){return{bulletList:this.changeList,taskList:Cl}},t.prototype.keymaps=function(){var e=this.changeList(),t=Sl(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},t}(Ht),Ic=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"orderedList"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:h({order:{default:1},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"ol",getAttrs:function(e){var t=e.getAttribute("start"),n=e.getAttribute("data-raw-html");return h({order:e.hasAttribute("start")?Number(t):1},n&&{rawHTML:n})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",h({start:1===t.order?null:t.order},bl(t)),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return xl(e.schema.nodes.orderedList)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()(),t=Sl(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},t}(Ht),Rc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"paragraph block*",selectable:!1,attrs:{task:{default:!1},checked:{default:!1},rawHTML:{default:null}},defining:!0,parseDOM:[{tag:"li",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({task:e.hasAttribute("data-task"),checked:e.hasAttribute("data-task-checked")},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs,n=t.task,r=t.checked;if(!n)return[t.rawHTML||"li",0];var o=["task-list-item"];return r&&o.push("checked"),[t.rawHTML||"li",h({class:o.join(" "),"data-task":n},r&&{"data-task-checked":r}),0]}}},enumerable:!1,configurable:!0}),t.prototype.liftToPrevListItem=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from,s=n.empty,a=o.nodes.listItem,l=i.parent,c=i.node(-1);if(s&&!l.childCount&&c.type===a){if(i.index(-2)>=1)return r.delete(i.start(-1)-1,i.end(-1)),t(r),!0;if(i.node(-3).type===a)return r.delete(i.start(-2)-1,i.end(-1)),t(r),!0}return!1}},t.prototype.keymaps=function(){return{Backspace:this.liftToPrevListItem(),Enter:function(e,t){return function(e){return function(t,n){var o=t.tr,a=t.selection,l=a.$from,c=a.$to;if(l.depth<2||!l.sameParent(c))return!1;var u=l.node(-1);if(u.type!==e)return!1;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==e||l.index(-2)!==l.node(-2).childCount-1)return!1;for(var d=l.index(-1)>0,p=r.c.empty,h=l.depth-(d?1:2);h>=l.depth-3;h-=1)p=r.c.from(l.node(h).copy(p));return p=p.append(r.c.from(e.createAndFill())),o.replace(d?l.before():l.before(-1),l.after(-3),new r.j(p,d?3:2,2)),o.setSelection(s.f.near(o.doc.resolve(l.pos+(d?3:2)))),n(o),!0}var f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,m=f&&[null,{type:f}];return o.delete(l.pos,c.pos),!!Object(i.g)(o.doc,l.pos,2,m)&&(o.split(l.pos,2,m),n(o),!0)}}(e.schema.nodes.listItem)(e,t)}}},t}(Ht),Pc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"block+",group:"block",parseDOM:[gl("blockquote")],toDOM:function(e){return["blockquote",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return Object(l.j)(e.schema.nodes.blockQuote)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},t}(Ht),Bc={left:function(e,t){var n=e[0],r=e[1],o=t.totalColumnCount,i=0===r;if(0!==n||!i){r-=1,i&&(n-=1,r=o-1);var s=t.getCellInfo(n,r),a=s.offset,l=s.nodeSize;return a+l-2}return null},right:function(e,t){var n=e[0],r=e[1],o=t.totalRowCount,i=t.totalColumnCount,s=r===i-1;if(n!==o-1||!s){var a=r+1,l=t.getColspanStartInfo(n,r);(null===l||void 0===l?void 0:l.count)>1&&(a+=l.count-1),(s||a===i)&&(n+=1,a=0);var c=t.getCellInfo(n,a).offset;return c+2}return null},up:function(e,t){var n=e[0],r=e[1];if(n>0){var o=t.getCellInfo(n-1,r),i=o.offset,s=o.nodeSize;return i+s-2}return null},down:function(e,t){var n=e[0],r=e[1],o=t.totalRowCount;if(n1&&(i+=s.count-1);var a=t.getCellInfo(i,r).offset;return a+2}return null}};function Fc(e,t,n){var r=n[0],o=n[1],i=t.getRowspanStartInfo(r,o),s="up"===e&&0===r,a="down"===e&&((null===i||void 0===i?void 0:i.count)>1?r+i.count-1:r)===t.totalRowCount-1;return s||a}function Hc(e,t,n,r){void 0===r&&(r=!1);var o=e.doc.resolve(t.tableEndOffset);return r||!o.nodeAfter?Ae(e,o,n):e.setSelection(s.f.near(o,1))}function jc(e,t,n,r){var o=(0,Bc[e])(n,r);if(o){var i="right"===e||"down"===e?1:-1;return t.setSelection(s.f.near(t.doc.resolve(o),i))}return null}function zc(e,t,n){var r=e.getCellInfo(t,0).offset,o=e.getCellInfo(t,n-1);return{from:r,to:o.offset+o.nodeSize}}var qc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableHead{1} tableBody{1}",group:"block",attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[gl("table")],toDOM:function(e){return["table",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t.prototype.addTable=function(){return function(e){return void 0===e&&(e={rowCount:2,columnCount:1,data:[]}),function(t,n){var r=e.rowCount,o=e.columnCount,i=e.data,s=t.schema,a=t.selection,l=t.tr,c=a.from,u=a.to,d=a.$from;if(c===u&&!fl(d)){var p=s.nodes,h=p.tableHead,f=p.tableBody,m=null===i||void 0===i?void 0:i.slice(0,o),g=null===i||void 0===i?void 0:i.slice(o,i.length),v=function(e,t,n){for(var r=t.nodes,o=r.tableRow,i=r.tableHeadCell,s=r.paragraph,a=[],l=0;l=d;m-=1){var g=a.getCellInfo(f,m),v=g.offset,y=g.nodeSize,b=r.mapping.slice(h).map(v),w=b+y;r.delete(b,w)}return t(r),!0}return!1}}},t.prototype.addRow=function(e){return function(){return function(t,n){var r=t.selection,o=t.schema,i=t.tr,s=Bl(r),a=s.anchor,l=s.head;if(a&&l){var c=Nl.create(a),u=c.totalColumnCount,d=c.getRectOffsets(a,l),p=Hl(d).rowCount,h=function(e,t,n){var r,o,i;return"up"===e?(r=n.startRowIdx,o=0,i=-1):(r=n.endRowIdx,o=t.totalColumnCount-1,i=t.getCellInfo(r,o).nodeSize+1),{targetRowIdx:r,insertColIdx:o,nodeSize:i}}(e,c,d),f=h.targetRowIdx,m=h.insertColIdx,g=h.nodeSize;if(!(0===f)){for(var v=[],y=i.mapping.map(c.posAt(f,m))+g,b=[],w=0;w=p;f-=1){var m=zc(a,f,c),g=m.from,v=m.to;r.delete(g-1,v+1)}return t(r),!0}return!1}}},t.prototype.alignColumn=function(){return function(e){return void 0===e&&(e={align:"center"}),function(t,n){var r=e.align,o=t.selection,i=t.tr,s=Bl(o),a=s.anchor,l=s.head;if(a&&l){for(var c=Nl.create(a),u=c.totalRowCount,d=c.getRectOffsets(a,l),p=d.startColIdx,h=d.endColIdx,f=0;f=s,l=a?o+1:i,c=function(e,t,n,r,o){var i=t[0],s=t[1],a=t[2];if("left"===e||"up"===e){if(o&&!function(e,t,n){var r=n[0],o=n[1],i=t.resolve(e.before(r-1));return o===r&&!i.nodeBefore}(n,r,[i,s]))return!1;var l=n.before(a);if(r.resolve(l).nodeBefore)return!1}return!0}(e,[i,s,l],n,r,a),u=function(e,t,n,r,o){if("right"===e||"down"===e){if(o&&!function(e){for(var t,n,r=e.depth;r&&"tableBodyCell"!==(n=e.node(r)).type.name;){if("listItem"===n.type.name){var o=e.node(r-1).lastChild===n,i="paragraph"!==(null===(t=n.lastChild)||void 0===t?void 0:t.type.name);return!!o&&!i}r-=1}return!1}(n))return!1;var i=n.after(t);if(r.resolve(i).nodeAfter)return!1}return!0}(e,l,n,r,a);return c&&u}(e,[p,d.depth],c,a)){var h=Bl(o).anchor,f=Nl.create(h),m=f.getCellIndex(h),g=void 0;if(!function(e,t,n){var r=n[0],o=n[1];if("up"===e||"down"===e)return!1;var i=t.tableStartOffset,s=t.tableEndOffset,a=t.getCellInfo(r,o),l=a.offset,c=a.nodeSize;return("left"===e?i:s)===("left"===e?l-2:l+c+3)}(e,f,m)?Fc(e,f,m)?"up"===e?g=function(e,t,n){var r=e.doc.resolve(t.tableStartOffset-1);return r.nodeBefore?e.setSelection(s.f.near(r,-1)):Ae(e,r,n)}(i,f,l):"down"===e&&(g=Hc(i,f,l)):g=jc(e,i,m,f):g=function(e,t,n){var r=e.doc.resolve(t.before(n-3));return e.setSelection(new s.c(r))}(i,c,p),g)return r(g),!0}}return!1}},t.prototype.deleteCells=function(){return function(e,t){var n=e.schema,r=e.selection,o=e.tr,i=Bl(r),a=i.anchor,l=i.head,c=r instanceof s.h;if(a&&l&&!c){for(var u=Nl.create(a),d=u.getRectOffsets(a,l),p=d.startRowIdx,h=d.startColIdx,f=d.endRowIdx,m=d.endColIdx,g=p;g<=f;g+=1)for(var v=h;v<=m;v+=1)if(!u.extendedRowspan(g,v)&&!u.extendedColspan(g,v)){var y=u.getNodeAndPos(g,v),b=y.node,w=y.pos,k=Il(1,g,n,b.attrs);o.replaceWith(o.mapping.map(w),o.mapping.map(w+b.nodeSize),k)}return t(o),!0}return!1}},t.prototype.exitTable=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from;if(pl(i,function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name})&&pl(i,function(e){return"paragraph"===e.type.name})){var s=Bl(n).anchor;return t(Hc(r,Nl.create(s),o,!0)),!0}return!1}},t.prototype.commands=function(){return{addTable:this.addTable(),removeTable:this.removeTable(),addColumnToLeft:this.addColumn("left"),addColumnToRight:this.addColumn("right"),removeColumn:this.removeColumn(),addRowToUp:this.addRow("up"),addRowToDown:this.addRow("down"),removeRow:this.removeRow(),alignColumn:this.alignColumn()}},t.prototype.keymaps=function(){var e=this.deleteCells();return{Tab:this.moveToCell("right"),"Shift-Tab":this.moveToCell("left"),ArrowUp:this.moveInCell("up"),ArrowDown:this.moveInCell("down"),ArrowLeft:this.moveInCell("left"),ArrowRight:this.moveInCell("right"),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e,"Mod-Enter":this.exitTable()}},t}(Ht),Vc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableHead"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableRow{1}",attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[gl("thead")],toDOM:function(e){return["thead",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ht),$c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableBody"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"tableRow+",attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tbody",getAttrs:function(e){var t=e.querySelectorAll("tr")[0].children.length,n=e.getAttribute("data-raw-html");return!!t&&h({},n&&{rawHTML:n})}}],toDOM:function(e){return["tbody",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ht),_c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableRow"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"(tableHeadCell | tableBodyCell)*",attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tr",getAttrs:function(e){var t=e.children.length,n=e.getAttribute("data-raw-html");return!!t&&h({},n&&{rawHTML:n})}}],toDOM:function(e){return["tr",bl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ht),Uc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableHeadCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"paragraph+",attrs:h({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),isolating:!0,parseDOM:[yl("th")],toDOM:function(e){var t=e.attrs,n=vl(t);return["th",h(h({},n),bl(t)),0]}}},enumerable:!1,configurable:!0}),t}(Ht),Wc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"tableBodyCell"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"(paragraph | bulletList | orderedList)+",attrs:{align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},rowspan:{default:null},extended:{default:null}},isolating:!0,parseDOM:[yl("td")],toDOM:function(e){return["td",vl(e.attrs),0]}}},enumerable:!1,configurable:!0}),t}(Ht),Jc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"image"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{inline:!0,attrs:h({imageUrl:{default:""},altText:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"img[src]",getAttrs:function(e){var t=Ua(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("src")||"",r=t.getAttribute("data-raw-html"),o=t.getAttribute("alt");return h({imageUrl:n,altText:o},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",h(h({src:ce(t.imageUrl)},t.altText&&{alt:t.altText}),bl(t))]}}},enumerable:!1,configurable:!0}),t.prototype.addImage=function(){return function(e){return function(t,n){var r=t.schema,o=t.tr,i=e,s=i.imageUrl,a=i.altText;if(!s)return!1;var l=r.nodes.image.createAndFill(h({imageUrl:s},a&&{altText:a}));return n(o.replaceSelectionWith(l).scrollIntoView()),!0}}},t.prototype.commands=function(){return{addImage:this.addImage()}},t}(Ht),Kc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"block",parseDOM:[{tag:"hr"}],selectable:!1,toDOM:function(e){var t=e.attrs;return["div",bl(t),[t.rawHTML||"hr"]]}}},enumerable:!1,configurable:!0}),t.prototype.hr=function(){var e=this;return function(){return function(t,n){var r,o=t.selection,i=o.$from;if(i===o.$to){var s=t.doc,a=t.schema.nodes,l=a.thematicBreak,c=a.paragraph,u=[l.create()],d=i.node(1),p=s.child(s.childCount-1)===d,h=s.resolve(i.after(1)),f=(null===(r=i.nodeAfter)||void 0===r?void 0:r.type.name)===e.name;return(p||f)&&u.push(c.create()),n(t.tr.insert(h.pos,u).scrollIntoView()),!0}return!1}}},t.prototype.commands=function(){return{hr:this.hr()}},t.prototype.keymaps=function(){var e=this.hr()();return{"Mod-l":e,"Mod-L":e}},t}(Ht),Gc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["b","strong"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({},t&&{rawHTML:t})}}});return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",bl(t)]}}},enumerable:!1,configurable:!0}),t.prototype.bold=function(){return function(){return function(e,t){return Object(l.i)(e.schema.marks.strong)(e,t)}}},t.prototype.commands=function(){return{bold:this.bold()}},t.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},t}(On),Zc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["i","em"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({},t&&{rawHTML:t})}}});return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",bl(t)]}}},enumerable:!1,configurable:!0}),t.prototype.italic=function(){return function(){return function(e,t){return Object(l.i)(e.schema.marks.emph)(e,t)}}},t.prototype.commands=function(){return{italic:this.italic()}},t.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},t}(On),Xc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=["s","del"].map(function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({},t&&{rawHTML:t})}}});return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",bl(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return Object(l.i)(e.schema.marks.strike)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},t}(On),Qc=function(e){function t(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return{attrs:h({linkUrl:{default:""},title:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=Ua(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,n=t.getAttribute("href")||"",r=t.getAttribute("title")||"",o=t.getAttribute("data-raw-html");return h({linkUrl:n,title:r},o&&{rawHTML:o})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"a",h(h({href:ce(n.linkUrl)},e.linkAttributes),bl(n))]}}},enumerable:!1,configurable:!0}),t.prototype.addLink=function(){return function(e){return function(t,n){var r=e,o=r.linkUrl,i=r.linkText,s=void 0===i?"":i,a=t.schema,l=t.tr,c=t.selection,u=c.empty,d=c.from,p=c.to;if(d&&p&&o){var h={linkUrl:o},f=a.mark("link",h);if(u&&s){var m=Oe(a,s,f);l.replaceRangeWith(d,p,m)}else l.addMark(d,p,f);return n(l.scrollIntoView()),!0}return!1}}},t.prototype.toggleLink=function(){return function(e){return function(t,n){return Object(l.i)(t.schema.marks.link,e)(t,n)}}},t.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},t}(On),Yc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{attrs:h({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return h({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",bl(t)]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t){return Object(l.i)(e.schema.marks.code)(e,t)}}},t.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},t}(On),eu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:{info:{default:null}},atom:!0,code:!0,defining:!0,parseDOM:[{tag:"div[data-custom-info]",getAttrs:function(e){return{info:e.getAttribute("data-custom-info")}}}],toDOM:function(e){return["div",{"data-custom-info":e.attrs.info||null},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(e){return function(t,n){return!(null===e||void 0===e||!e.info)&&Object(l.h)(t.schema.nodes.customBlock,e)(t,n)}}},t}(Ht),tu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"frontMatter"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-front-matter]"}],toDOM:function(){return["div",{"data-front-matter":"true"},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!(!n.endOfTextblock("down")||"frontMatter"!==r.node().type.name)&&Object(l.d)(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(Ht),nu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"htmlComment"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-html-comment]"}],toDOM:function(){return["div",{"data-html-comment":"true"},0]}}},enumerable:!1,configurable:!0}),t.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!(!n.endOfTextblock("down")||"htmlComment"!==r.node().type.name)&&Object(l.d)(e,t)}}},t.prototype.keymaps=function(){return{Enter:this.commands()()}},t}(Ht);var ru=Ct("contents"),ou=function(e){function t(t,n){var r=e.call(this,t)||this,o=n.toDOMAdaptor,i=n.htmlSchemaMap,s=void 0===i?{}:i,a=n.linkAttributes,l=void 0===a?{}:a,c=n.useCommandShortcut,u=void 0===c||c,d=n.wwPlugins,p=void 0===d?[]:d,f=n.wwNodeViews,m=void 0===f?{}:f;return r.editorType="wysiwyg",r.el.classList.add("ww-mode"),r.toDOMAdaptor=o,r.linkAttributes=l,r.extraPlugins=p,r.pluginNodeViews=m,r.specs=r.createSpecs(),r.schema=r.createSchema(s),r.context=r.createContext(),r.keymaps=r.createKeymaps(u),r.view=r.createView(),r.commands=r.createCommands(),r.specs.setContext(h(h({},r.context),{view:r.view})),r.initEvent(),r}return p(t,e),t.prototype.createSpecs=function(){return function(e){return new Wt([new Sc,new Ec,new Oc,new Dc,new Ac,new Lc,new Ic,new Rc,new Pc,new qc,new Vc,new $c,new _c,new Uc,new Wc,new Jc,new Kc,new Gc,new Zc,new Xc,new Qc(e),new Yc,new eu,new tu,new qt,new nu])}(this.linkAttributes)},t.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},t.prototype.createSchema=function(e){return new r.i({nodes:h(h({},this.specs.nodes),e.nodes),marks:h(h({},this.specs.marks),e.marks)})},t.prototype.createPlugins=function(){return f([new s.d({key:zl,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(zl);if(n)return-1===n?null:n;if(J(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:$l,createSelectionBetween:function(e){var t=e.state;return J(zl.getState(t))?null:t.selection}},view:function(e){return new ql(e)}}),Kl(this.eventEmitter),new s.d({props:{handleDOMEvents:{mousedown:function(e,t){var n=t,r=n.clientX,o=n.clientY,i=e.posAtCoords({left:r,top:o});if(i){var s=e.state,a=s.doc,l=s.tr,c=a.resolve(i.pos),u=ml(c),d=t.target,p=getComputedStyle(d,":before"),f=t,m=f.offsetX,g=f.offsetY;if(!u||!kt(p,m,g))return!1;t.preventDefault();var v=c.before(u.depth),y=u.node.attrs;return l.setNodeMarkup(v,null,h(h({},y),{checked:!y.checked})),e.dispatch(l),!0}return!1}}}}),function(e){return new s.d({view:function(){return{update:function(t){var n=t.state,r=n.selection,o=n.doc,i=n.schema;e.emit("changeToolbarState",{toolbarState:Ql(r,o,i)})}}}})}(this.eventEmitter)],this.createPluginProps()).concat(this.defaultPlugins)},t.prototype.createPluginNodeViews=function(){var e=this.eventEmitter,t=this.pluginNodeViews,n={};return t&&Object.keys(t).forEach(function(r){n[r]=function(n,o,i){return t[r](n,o,i,e)}}),n},t.prototype.createView=function(){var e=this,t=this.toDOMAdaptor,n=this.eventEmitter;return new o.c(this.el,{state:this.createState(),attributes:{class:ru},nodeViews:h({customBlock:function(e,n,r){return new Yl(e,n,r,t)},image:function(e,t,r){return new tc(e,t,r,n)},codeBlock:function(e,t,r){return new nc(e,t,r,n)},widget:jt},this.createPluginNodeViews()),dispatchTransaction:function(t){var n=e.view.state.applyTransaction(t).state;e.view.updateState(n),e.emitChangeEvent(t.scrollIntoView()),e.eventEmitter.emit("setFocusedNode",n.selection.$from.node(1))},transformPastedHTML:mc,transformPasted:function(t){return function(e,t,n){var o=[],i=e.content,s=e.openStart,a=e.openEnd;return i.forEach(function(e){if("table"===e.type.name){var i=Fl(new r.j(r.c.from(e),0,0));if(i){var s=bc(i),a="tableBody"===i.firstChild.type.name,l=kc(s,t,a,n);o.push(l)}}else o.push(e)}),new r.j(r.c.from(o),s,a)}(t,e.schema,fl(e.view.state.selection.$from))},handlePaste:function(e,t,n){return Mc(e,n)},handleKeyDown:function(t,n){return e.eventEmitter.emit("keydown",e.editorType,n),!1},handleDOMEvents:{paste:function(t,n){var r=n.clipboardData||window.clipboardData,o=null===r||void 0===r?void 0:r.items;if(o&&!Ee(o).some(function(e){return"string"===e.kind&&"text/rtf"===e.type})){var i=Ft(o);i&&(n.preventDefault(),Bt(e.eventEmitter,i,n.type))}return!1},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0}}})},t.prototype.createCommands=function(){return this.specs.commands(this.view,Sl())},t.prototype.getHTML=function(){return It(this.view.dom.innerHTML)},t.prototype.getModel=function(){return this.view.state.doc},t.prototype.getSelection=function(){var e=this.view.state.selection;return[e.from,e.to]},t.prototype.getSchema=function(){return this.view.state.schema},t.prototype.replaceSelection=function(e,t,n){var o=this.view.state,i=o.schema,s=o.tr,a=e.split("\n").map(function(e){return Ne(i,rt(e,i))}),l=new r.j(r.c.from(a),1,1),c=W(t)&&W(n)?s.replaceRange(t,n,l):s.replaceSelection(l);this.view.dispatch(c),this.focus()},t.prototype.deleteSelection=function(e,t){var n=this.view.state.tr,r=W(e)&&W(t)?n.deleteRange(e,t):n.deleteSelection();this.view.dispatch(r.scrollIntoView())},t.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,s=o.to;return W(e)&&W(t)&&(i=e,s=t),r.textBetween(i,s,"\n")},t.prototype.setModel=function(e,t){void 0===t&&(t=!1);var n=this.view.state,r=n.tr,o=n.doc;this.view.dispatch(r.replaceWith(0,o.content.size,e)),t&&this.moveCursorToEnd(!0)},t.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=De(n,e,t);this.view.dispatch(n.setSelection(r).scrollIntoView())},t.prototype.addWidget=function(e,t,n){var r=this.view,o=r.dispatch,i=r.state;o(i.tr.setMeta("widget",{pos:null!==n&&void 0!==n?n:i.selection.to,node:e,style:t}))},t.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=rt(n,r.schema);this.view.dispatch(o.replaceWith(e,t,i))},t.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e?n.resolve(e):r.$from,i=o.marks(),s=o.node(),a=o.start(),l=o.end(),c=s.type.name;if(i.length||"paragraph"===c){var u=i[i.length-1];c=u?u.type.name:"text",s.forEach(function(e,t){var n=e.isText,r=e.nodeSize,i=e.marks,s=o.pos-a;n&&t<=s&&t+r>=s&&function(e){return!e.length||ue(e,u)}(i)&&(l=(a+=t)+r)})}return{range:[a,l],type:c}},t}(Vt),iu=D,su=J;var au=function(e){return!iu(e)&&!su(e)};var lu=function(e){return au(e)&&!1!==e};var cu=function(e){return!lu(e)},uu=["afterPreviewRender","updatePreview","changeMode","needChangeMode","command","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","scroll","contextmenu","show","hide","changeLanguage","changeToolbarState","toggleScrollSync","mixinTableOffsetMapPrototype","setFocusedNode","removePopupWidget","query","openPopup","closePopup","addImageBlobHook","beforePreviewRender","beforeConvertWysiwygToMarkdown","load","loadUI","change","caretChange","destroy","focus","blur","keydown","keyup"],du=function(){function e(){var e=this;this.events=new _l,this.eventTypes=uu.reduce(function(e,t){return h(h({},e),{type:t})},{}),this.hold=!1,uu.forEach(function(t){e.addEventType(t)})}return e.prototype.listen=function(e,t){var n=this.getTypeInfo(e),r=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)},e.prototype.emit=function(e){for(var t=[],n=1;n=0&&n.splice(r,1)}},e.prototype.removeEventHandlerWithTypeInfo=function(e,t){var n=[],r=this.events.get(e);r&&(r.map(function(e){return e.namespace!==t&&n.push(e),null}),this.events.set(e,n))},e.prototype.getEvents=function(){return this.events},e.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},e}(),pu=function(){function e(e,t,n,r){this.eventEmitter=e,this.mdCommands=t,this.wwCommands=n,this.getEditorType=r,this.initEvent()}return e.prototype.initEvent=function(){var e=this;this.eventEmitter.listen("command",function(t,n){e.exec(t,n)})},e.prototype.addCommand=function(e,t,n){"markdown"===e?this.mdCommands[t]=n:this.wwCommands[t]=n},e.prototype.deleteCommand=function(e,t){"markdown"===e?delete this.mdCommands[t]:delete this.wwCommands[t]},e.prototype.exec=function(e,t){"markdown"===this.getEditorType()?this.mdCommands[e](t):this.wwCommands[e](t)},e}();function hu(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function fu(e,t){var n=e.schema,r=t.literal.match(vt);if(r){var o=r[1],i=r[3],s=(o||i).toLowerCase();return"htmlInline"===t.type&&!(!n.marks[s]&&!n.nodes[s])}return!1}function mu(e){return ue(["text","strong","emph","strike","image","link","code"],e.type)}function gu(e){return"softbreak"===(null===e||void 0===e?void 0:e.type)}function vu(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(vt);if(r){var o=r[1],i=r[3],s=o||i;if(s)return ue(["ul","ol","li"],s.toLowerCase())}return!1}function yu(e){for(var t=[],n=1;n=0;r-=1){var o=this.stack[r];if(null===(n=o.attrs)||void 0===n||!n.rawHTML)break;o.content.length?this.closeNode():this.stack.pop()}},e.prototype.convert=function(e,t){for(var n=e.walker(),r=n.next(),o=function(){var e=r.node,o=r.entering,s=i.convertors[e.type],a=!1;if(s){var l={entering:o,leaf:!function(e){switch(e.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":case"customInline":return!0;default:return!1}}(e),getChildrenText:Je,options:{gfm:!0,nodeId:!1,tagFilter:!1,softbreak:"\n"},skipChildren:function(){a=!0}};if(i.closeUnmatchedHTMLInline(e,o),s(i,e,l),(null===t||void 0===t?void 0:t.node)===e){var c=i.stack.reduce(function(e,t){return e+t.content.reduce(function(e,t){return e+t.nodeSize},0)},0)+1;t.setMappedPos(c)}}a&&(n.resumeAt(e,!1),n.next()),r=n.next()},i=this;r;)o()},e.prototype.convertNode=function(e,t){return this.convert(e,t),this.stack.length?this.closeNode():null},e}();var Cu={text:function(e,t){var n,r=t.node,o=null!==(n=r.text)&&void 0!==n?n:"";(r.marks||[]).some(function(e){return"link"===e.type.name})?e.text(me(o),!1):e.text(o)},paragraph:function(e,t){var n=t.node,r=t.parent,o=t.index,i=void 0===o?0:o;if(e.stopNewline)e.convertInline(n);else{var s=0===i,a=!s&&r.child(i-1),l=a&&0===a.childCount,c=i\n");else if(!d||l||s)e.convertInline(n),u?e.write("\n"):e.closeBlock(n);else{if("listItem"===(null===r||void 0===r?void 0:r.type.name)){var p=e.getDelim();e.setDelim(""),e.write("
"),e.setDelim(p)}e.write("\n")}}},heading:function(e,t,n){var r=t.node,o=n.delim;"atx"===r.attrs.headingType?(e.write(o+" "),e.convertInline(r),e.closeBlock(r)):(e.convertInline(r),e.ensureNewLine(),e.write(o),e.closeBlock(r))},codeBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,s=o,a=s[0],l=s[1];e.write(a),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},blockQuote:function(e,t,n){var r=t.node,o=t.parent,i=n.delim;(null===o||void 0===o?void 0:o.type.name)===r.type.name&&e.flushClose(1),e.wrapBlock(i,null,r,function(){return e.convertNode(r)})},bulletList:function(e,t,n){var r=t.node,o=n.delim;e.convertList(r,fe(" ",4),function(){return o+" "})},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,fe(" ",4),function(e){return String(r+e)+". "})},listItem:function(e,t){var n=t.node,r=n.attrs,o=r.task,i=r.checked;o&&e.write("["+(i?"x":" ")+"] "),e.convertNode(n)},image:function(e,t,n){var r=n.attrs;e.write("+")")},thematicBreak:function(e,t,n){var r=t.node,o=n.delim;e.write(o),e.closeBlock(r)},table:function(e,t){var n=t.node;e.convertNode(n),e.closeBlock(n)},tableHead:function(e,t,n){var r=t.node,o=n.delim,i=r.firstChild;e.convertNode(r);var s=null!==o&&void 0!==o?o:"";!o&&i&&i.forEach(function(e){var t=function(e,t){var n=e.length,r="",o="";return"left"===t?(r=":",n-=1):"right"===t?(o=":",n-=1):"center"===t&&(r=":",o=":",n-=2),""+r+fe("-",Math.max(n,3))+o}(e.textContent,e.attrs.align);s+="| "+t+" "}),e.write(s+"|"),e.ensureNewLine()},tableBody:function(e,t){var n=t.node;e.convertNode(n)},tableRow:function(e,t){var n=t.node;e.convertNode(n),e.write("|"),e.ensureNewLine()},tableHeadCell:function(e,t,n){var r=t.node,o=n.delim,i=void 0===o?"| ":o;e.write(i),e.convertTableCell(r),e.write(" ")},tableBodyCell:function(e,t,n){var r=t.node,o=n.delim,i=void 0===o?"| ":o;e.write(i),e.convertTableCell(r),e.write(" ")},customBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,s=o,a=s[0],l=s[1];e.write(a),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},frontMatter:function(e,t,n){var r=t.node,o=n.text;e.text(o,!1),e.closeBlock(r)},widget:function(e,t,n){var r=n.text;e.write(r)},html:function(e,t,n){var r=t.node,o=n.text;e.write(o),r.attrs.htmlBlock&&e.closeBlock(r)},htmlComment:function(e,t,n){var r=t.node,o=n.text;e.write(o),e.closeBlock(r)}};function Tu(e,t){var n=e.text,r=/`+/g,o=0;if(e.isText&&n)for(var i=r.exec(n);i;)o=Math.max(o,i[0].length),i=r.exec(n);for(var s=o>0&&t>0?" `":"`",a=0;a0&&t<0&&(s+=" "),s}function Mu(e){return e?["<"+e+">",""+e+">"]:null}function Su(e){return e?"<"+e+">":null}function Eu(e){return e?""+e+">":null}var Nu={heading:function(e){var t=e.node.attrs,n=t.level,r=fe("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:Mu(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:Mu(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:Mu(e.node.attrs.rawHTML)}},bulletList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ul"),{delim:"*",rawHTML:Mu(o)}},orderedList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ol"),{rawHTML:Mu(o)}},listItem:function(e,t){var n=e.node,r=t.inTable,o=n.attrs,i=o.task,s=o.checked,a=n.attrs.rawHTML;return r&&(a=a||"li"),{rawHTML:a?["<"+a+(i?' class="task-list-item'+(s?" checked":"")+'"':"")+(i?" data-task"+(s?" data-task-checked":""):"")+">",""+a+">"]:null}},table:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:Mu(e.node.attrs.rawHTML)}},image:function(e){var t=e.node.attrs,n=t.rawHTML,r=t.altText,o=t.imageUrl.replace(/&/g,"&"),i=r?' alt="'+ce(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+ce(o)+'"'+i+">":null,attrs:{altText:me(r||""),imageUrl:o}}},thematicBreak:function(e){return{delim:"***",rawHTML:Su(e.node.attrs.rawHTML)}},customBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["$$"+n.info,"$$"],text:r}},frontMatter:function(e){return{text:e.node.textContent}},widget:function(e){return{text:e.node.textContent}},strong:function(e,t,n){var r=e.node,o=t.entering,i=r.attrs.rawHTML,s="**";return n||(s=o?"":""),{delim:s,rawHTML:o?Su(i):Eu(i)}},emph:function(e,t,n){var r=e.node,o=t.entering,i=r.attrs.rawHTML,s="*";return n||(s=o?"":""),{delim:s,rawHTML:o?Su(i):Eu(i)}},strike:function(e,t,n){var r=e.node,o=t.entering,i=r.attrs.rawHTML,s="~~";return n||(s=o?"":""),{delim:s,rawHTML:o?Su(i):Eu(i)}},link:function(e,t){var n=e.node,r=t.entering,o=n.attrs,i=o.title,s=o.rawHTML,a=o.linkUrl.replace(/&/g,"&"),l=i?' title="'+ce(i)+'"':"";return r?{delim:"[",rawHTML:s?"<"+s+' href="'+ce(a)+'"'+l+">":null}:{delim:"]("+a+(i?" "+function(e){var t;return(t=-1===e.indexOf('"')?'""':-1===e.indexOf("'")?"''":"()")[0]+e+t[1]}(me(i)):"")+")",rawHTML:Eu(s)}},code:function(e,t){var n=e.node,r=e.parent,o=e.index,i=void 0===o?0:o,s=t.entering;return{delim:s?Tu(r.child(i),-1):Tu(r.child(i-1),1),rawHTML:s?Su(n.attrs.rawHTML):Eu(n.attrs.rawHTML)}},htmlComment:function(e){return{text:e.node.textContent}},html:function(e,t){var n=e.node,r=t.entering,o=n.type.name,i=n.attrs.htmlAttrs,s="<"+o,a=""+o+">";return Object.keys(i).forEach(function(e){s+=" "+e+'="'+i[e].replace(/"/g,"'")+'"'}),s+=">",n.attrs.htmlInline?{rawHTML:r?s:a}:{text:""+s+n.attrs.childrenHTML+a}}},Ou={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function Du(e){var t={};return Object.keys(Cu).forEach(function(n){t[n]=function(t,r){if(Cu[n]){var o=e[n],i=o?o(r,{inTable:t.inTable}):{};!function(e,t){var n=t.state,r=t.nodeInfo,o=t.params,i=o.rawHTML;i?O(e,["heading","codeBlock"])>-1?function(e,t,n){var r=n[0],o=n[1];e.write(r),e.convertInline(t),e.write(o)}(n,r.node,i):O(e,["image","thematicBreak"])>-1?n.write(i):function(e,t,n){var r=t.node,o=t.parent,i=n[0],s=n[1];e.stopNewline=!0,e.write(i),e.convertNode(r),e.write(s),"doc"===(null===o||void 0===o?void 0:o.type.name)&&(e.closeBlock(r),e.stopNewline=!1)}(n,r,i):Cu[e](n,r,o)}(n,{state:t,nodeInfo:r,params:i})}}}),t}function Au(e){return Object.keys(e).forEach(function(t){var n=Nu[t],r=e[t];Nu[t]=n?function(e,t){return t.origin=function(){return n(e,t)},r(e,t)}:r,delete e[t]}),{nodeTypeConvertors:Du(Nu),markTypeConvertors:function(e){var t={};return Object.keys(Ou).forEach(function(n){t[n]=function(t,r,o){var i=Ou[n],s=e[n],a=s&&t&&!D(r)?s(t,{entering:r},o):{};return h(h({},a),i)}}),t}(Nu)}}var Lu=function(){function e(e){var t=e.nodeTypeConvertors,n=e.markTypeConvertors;this.nodeTypeConvertors=t,this.markTypeConvertors=n,this.delim="",this.result="",this.closed=!1,this.tightList=!1,this.stopNewline=!1,this.inTable=!1}return e.prototype.getMarkConvertor=function(e){var t=e.attrs.htmlInline?"html":e.type.name;return this.markTypeConvertors[t]},e.prototype.isInBlank=function(){return/(^|\n)$/.test(this.result)},e.prototype.isBetweenSpaces=function(e,t){var n,r,o=e.content,i=0===t||function(e){return/(\S*)\s$/g.test(e)}(null!==(n=o.child(t-1).text)&&void 0!==n?n:"a"),s=t>=o.childCount-1||function(e){return/^\s(\S*)/g.test(e)}(null!==(r=o.child(t+1).text)&&void 0!==r?r:"a");return i&&s},e.prototype.markText=function(e,t,n,r){var o=this.getMarkConvertor(e);if(o){var i=o({node:e,parent:n,index:r},t,this.isBetweenSpaces(n,t?r:r-1)),s=i.delim;return i.rawHTML||s}return""},e.prototype.setDelim=function(e){this.delim=e},e.prototype.getDelim=function(){return this.delim},e.prototype.flushClose=function(e){if(!this.stopNewline&&this.closed){if(this.isInBlank()||(this.result+="\n"),e||(e=2),e>1){var t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(var r=1;rb?a=a.slice(0,b).concat(d).concat(a.slice(b,y)).concat(a.slice(y+1,v)):b>y&&(a=a.slice(0,y).concat(a.slice(y+1,b)).concat(d).concat(a.slice(b,v)));break}}}for(var k=0;k"))}),this.stopNewline=!1,this.inTable=!1},e.prototype.convertNode=function(e,t){var n=this;return e.forEach(function(r,o,i){if(n.convertBlock(r,e,i),(null===t||void 0===t?void 0:t.node)===r){var s=n.result.split("\n");t.setMappedPos([s.length,be(s).length+1])}}),this.result},e}(),Iu=function(){function e(e,t,n,r){var o=this;this.setMappedPos=function(e){o.mappedPosWhenConverting=e},this.schema=e,this.eventEmitter=r,this.focusedNode=null,this.mappedPosWhenConverting=null,this.toWwConvertors=function(e){var t=Object.keys(e),n=h({},ku),r=new Js({gfm:!0,nodeId:!0,convertors:e}).getConvertors();return t.forEach(function(t){var o=ku[t];o&&!ue(["htmlBlock","htmlInline"],t)&&(n[t]=function(n,i,s){s.origin=function(){return r[t](i,s,r)};var a,l=e[t](i,s);if(l){var c=Array.isArray(l)?l[0]:l;a={htmlAttrs:c.attributes,classNames:c.classNames}}o(n,i,s,a)})}),n}(n),this.toMdConvertors=Au(t||{}),this.eventEmitter.listen("setFocusedNode",function(e){return o.focusedNode=e})}return e.prototype.getMappedPos=function(){return this.mappedPosWhenConverting},e.prototype.getInfoForPosSync=function(){return{node:this.focusedNode,setMappedPos:this.setMappedPos}},e.prototype.toWysiwygModel=function(e){return new xu(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new Lu(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return t=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}();function Ru(e){var t=e.plugins,n=e.eventEmitter,i=e.usageStatistics,l=e.instance;return n.listen("mixinTableOffsetMapPrototype",Dl),(null!==t&&void 0!==t?t:[]).reduce(function(e,t){var u=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:s.d,PluginKey:s.e,Selection:s.f,TextSelection:s.h},pmView:{Decoration:o.a,DecorationSet:o.b},pmModel:{Fragment:r.c},pmRules:{InputRule:c.a,inputRules:c.b,undoInputRule:c.c},pmKeymap:{keymap:a.a},i18n:Wl};if(b(t)){var i=t[0],l=t[1];return i(n,void 0===l?{}:l)}return t(n)}({plugin:t,eventEmitter:n,usageStatistics:i,instance:l});if(!u)throw new Error("The return value of the executed plugin is empty.");var d=u.markdownParsers,p=u.toHTMLRenderers,f=u.toMarkdownRenderers,m=u.markdownPlugins,g=u.wysiwygPlugins,v=u.wysiwygNodeViews,y=u.markdownCommands,w=u.wysiwygCommands,k=u.toolbarItems;return p&&(e.toHTMLRenderers=ke(e.toHTMLRenderers,p)),f&&(e.toMarkdownRenderers=ke(e.toMarkdownRenderers,f)),m&&(e.mdPlugins=e.mdPlugins.concat(m)),g&&(e.wwPlugins=e.wwPlugins.concat(g)),v&&(e.wwNodeViews=h(h({},e.wwNodeViews),v)),y&&(e.mdCommands=h(h({},e.mdCommands),y)),w&&(e.wwCommands=h(h({},e.wwCommands),w)),k&&(e.toolbarItems=e.toolbarItems.concat(k)),d&&(e.markdownParsers=h(h({},e.markdownParsers),d)),e},{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var Pu=function(){function e(e){var t=this;this.options=v({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new du;var n=he(this.options.linkAttributes),r=Ru({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},o=r.toHTMLRenderers,i=r.markdownParsers,s=this.options,a=s.customHTMLRenderer,l=s.extendedAutolinks,c=s.referenceDefinition,u=s.frontMatter,d=s.customHTMLSanitizer,p={linkAttributes:n,customHTMLRenderer:h(h({},o),a),extendedAutolinks:l,referenceDefinition:c,frontMatter:u,sanitizer:d||Ua};!function(e){["htmlBlock","htmlInline"].forEach(function(t){e[t]&&Object.keys(e[t]).forEach(function(e){return _a(e)})})}(p.customHTMLRenderer),this.options.events&&g(this.options.events,function(e,n){t.on(n,e)});var f=this.options,m=f.el,y=f.initialValue,b=f.theme,w=m.innerHTML;"light"!==b&&m.classList.add(Ct(b)),m.innerHTML="",this.toastMark=new zs("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:l,referenceDefinition:c,disallowDeepHeading:!0,frontMatter:u,customParser:i}),this.preview=new dl(this.eventEmitter,h(h({},p),{isViewer:!0})),$r(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),y?this.setMarkdown(y):w&&this.preview.setHTML(w),m.appendChild(this.preview.previewContent),this.eventEmitter.emit("load",this)}return e.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute("data-task-disabled")&&t.hasAttribute("data-task")&&kt(n,e.offsetX,e.offsetY)&&(Et(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,be(t).length+1],r=this.toastMark.editMarkdown([1,1],n,e||"");this.eventEmitter.emit("updatePreview",r)},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.destroy=function(){Hr(this.preview.el,"mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},e.prototype.isViewer=function(){return!0},e.prototype.isMarkdownMode=function(){return!1},e.prototype.isWysiwygMode=function(){return!1},e}();function Bu(e){return e instanceof r.f}function Fu(e){return ue(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var Hu={openTag:function(e,t){var n=e,r=n.tagName,o=n.classNames,i=n.attributes,s=document.createElement(r),a={};o&&(s.className=o.join(" ")),i&&(a=h(h({},a),i)),Lt(a,s),t.push(s)},closeTag:function(e,t){if(t.length>1){var n=t.pop();be(t).appendChild(n)}},html:function(e,t){be(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);be(t).appendChild(n)}},ju=function(){function e(e,t){var n=Ya(e,t),r=h(h({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(r)),this.renderer=new Js({gfm:!0,convertors:h(h({},n),r)}),this.convertors=this.renderer.getConvertors()}return e.prototype.generateTokens=function(e){var t=function(e){var t=e.attrs,n=e.type.name,r={type:n,wysiwygNode:!0,literal:!Fu(n)&&Bu(e)?e.textContent:null},o={heading:{level:t.level},link:{destination:t.linkUrl,title:t.title},image:{destination:t.imageUrl},codeBlock:{info:t.language},bulletList:{type:"list",listData:{type:"bullet"}},orderedList:{type:"list",listData:{type:"ordered",start:t.order}},listItem:{type:"item",listData:{task:t.task,checked:t.checked}},tableHeadCell:{type:"tableCell",cellType:"head",align:t.align},tableBodyCell:{type:"tableCell",cellType:"body",align:t.align},customBlock:{info:t.info}}[n],i=h(h({},r),o),s=e.attrs,a=s.htmlAttrs,l=s.childrenHTML;return a?h(h({},i),{attrs:a,childrenHTML:l}):i}(e),n={entering:!0,leaf:!!Bu(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return Bu(e)?e.textContent:""},skipChildren:function(){return!1}},r=this.convertors[e.type.name],o=r(t,n,this.convertors),i=b(o)?o:[o];return(Fu(e.type.name)||e.attrs.htmlInline)&&(n.entering=!1,i.push({type:"text",content:Bu(e)?e.textContent:""}),i=i.concat(r(t,n,this.convertors))),i},e.prototype.toDOMNode=function(e){var t=[];return this.generateTokens(e).forEach(function(e){return Hu[e.type](e,t)}),t[0]},e.prototype.getToDOMNode=function(e){return ue(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),zu=100,qu=15,Vu=null,$u=null;function _u(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;$u&&clearTimeout($u),n(e),$u=setTimeout(function(){r()},qu)}var Uu=function(){function e(e,t,n){this.latestEditorScrollTop=null,this.latestPreviewScrollTop=null,this.blockedScroll=null,this.active=!0,this.timer=null;var r=t.previewContent,o=t.el;this.previewRoot=r,this.previewEl=o,this.mdEditor=e,this.editorView=e.view,this.toastMark=e.getToastMark(),this.eventEmitter=n,this.addScrollSyncEvent()}return e.prototype.addScrollSyncEvent=function(){var e=this;this.eventEmitter.listen("afterPreviewRender",function(){e.clearTimer(),e.timer=setTimeout(function(){e.syncPreviewScrollTop(!0)},200)}),this.eventEmitter.listen("scroll",function(t,n){e.active&&("editor"===t&&"editor"!==e.blockedScroll?e.syncPreviewScrollTop():"preview"===t&&"preview"!==e.blockedScroll&&e.syncEditorScrollTop(n))}),this.eventEmitter.listen("toggleScrollSync",function(t){e.active=t})},e.prototype.getMdNodeAtPos=function(e,t){var n=e.content.findIndex(t.pos).index;return this.toastMark.findFirstNodeAtLine(n+1)},e.prototype.getScrollTopByCaretPos=function(){var e=this.mdEditor.getSelection(),t=this.toastMark.findFirstNodeAtLine(e[0][0]),n=this.previewEl.clientHeight,r=sl(this.previewRoot,t).el,o=(ol(r,this.previewRoot)||r.offsetTop)+r.clientHeight-.5*n;return this.latestEditorScrollTop=null,r.getBoundingClientRect().top-this.previewEl.getBoundingClientRect().topC.top?Math.min((s-C.top)/x,1):0)}v=this.getResolvedScrollTop("editor",p,v,u),this.latestEditorScrollTop=p}v!==u&&this.run("editor",v,u)}},e.prototype.syncEditorScrollTop=function(e){var t=this.toastMark,n=this.editorView,r=this.previewRoot,o=this.previewEl,i=n.dom,s=n.state,a=o.scrollTop,l=o.clientHeight,c=o.scrollHeight-a<=l,u=i.scrollTop,d=c?i.scrollHeight:0;if(a&&e&&!c){if(!(e=function(e,t){for(;!e.getAttribute("data-nodeid")&&e.parentElement!==t;)e=e.parentElement;return e}(e,r)).getAttribute("data-nodeid"))return;var p=i.children,h=Number(e.getAttribute("data-nodeid")),f=sl(this.previewRoot,t.findNodeById(h)),m=f.mdNode,g=f.el;d=p[Re(m)-1].offsetTop;var v=rl(s.doc,m,p).height,y=cl(g,r,h),b=y.nodeHeight;d+=function(e,t,n,r){return Math.min((e-t)/n,1)*r}(a,y.offsetTop,b,v),d=this.getResolvedScrollTop("preview",a,d,u),this.latestPreviewScrollTop=a}d!==u&&this.run("preview",d,u)},e.prototype.getResolvedScrollTop=function(e,t,n,r){var o="editor"===e?this.latestEditorScrollTop:this.latestPreviewScrollTop;return null===o?n:o
<\/p>/gi,""),n=new RegExp(gt,"ig"),r=t.match(n);return null===r||void 0===r||r.forEach(function(e,n){if(yt.test(e)){var o=wt;if(n){var i=r[n-1].match(mt);if(i&&!/br/i.test(i[1])){var s=i[1];o=""+s+"><"+s+">"}}t=t.replace(yt,o)}}),t}(e);var o=r.a.fromSchema(this.wwEditor.schema).parse(n);this.isMarkdownMode()?this.mdEditor.setMarkdown(this.convertor.toMarkdownText(o),t):this.wwEditor.setModel(o,t)},e.prototype.getMarkdown=function(){return this.isMarkdownMode()?this.mdEditor.getMarkdown():this.convertor.toMarkdownText(this.wwEditor.getModel())},e.prototype.getHTML=function(){var e=this;this.eventEmitter.holdEventInvoke(function(){if(e.isMarkdownMode()){var t=e.toastMark.getRootNode(),n=e.convertor.toWysiwygModel(t);e.wwEditor.setModel(n)}});var t=It(this.wwEditor.view.dom.innerHTML);if(this.placeholder){var n=new RegExp('","i");return t.replace(n,"")}return t},e.prototype.insertText=function(e){this.getCurrentModeEditor().replaceSelection(e)},e.prototype.setSelection=function(e,t){this.getCurrentModeEditor().setSelection(e,t)},e.prototype.replaceSelection=function(e,t,n){this.getCurrentModeEditor().replaceSelection(e,t,n)},e.prototype.deleteSelection=function(e,t){this.getCurrentModeEditor().deleteSelection(e,t)},e.prototype.getSelectedText=function(e,t){return this.getCurrentModeEditor().getSelectedText(e,t)},e.prototype.getRangeInfoOfNode=function(e){return this.getCurrentModeEditor().getRangeInfoOfNode(e)},e.prototype.addWidget=function(e,t,n){this.getCurrentModeEditor().addWidget(e,t,n)},e.prototype.replaceWithWidget=function(e,t,n){this.getCurrentModeEditor().replaceWithWidget(e,t,n)},e.prototype.setHeight=function(e){var t=this.options.el;y(e)&&("auto"===e?z(t,"auto-height"):U(t,"auto-height"),this.setMinHeight(this.getMinHeight())),E(t,{height:e}),this.height=e},e.prototype.getHeight=function(){return this.height},e.prototype.setMinHeight=function(e){if(e!==this.minHeight){var t=this.height||this.options.height;"auto"!==t&&this.options.el.querySelector("."+Ct("main"))&&(e=Math.min(parseInt(e,10),parseInt(t,10)-75)+"px");var n=parseInt(e,10);this.minHeight=e,this.wwEditor.setMinHeight(n),this.mdEditor.setMinHeight(n),this.preview.setMinHeight(n)}},e.prototype.getMinHeight=function(){return this.minHeight},e.prototype.isMarkdownMode=function(){return"markdown"===this.mode},e.prototype.isWysiwygMode=function(){return"wysiwyg"===this.mode},e.prototype.isViewer=function(){return!1},e.prototype.getCurrentPreviewStyle=function(){return this.mdPreviewStyle},e.prototype.changeMode=function(e,t){if(this.mode!==e){if(this.mode=e,this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r)}else{r=this.wwEditor.getModel();this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),!t)}if(this.eventEmitter.emit("removePopupWidget"),this.eventEmitter.emit("changeMode",e),!t){var o=this.convertor.getMappedPos();this.focus(),this.isWysiwygMode()&&W(o)?this.wwEditor.setSelection(o):Array.isArray(o)&&this.mdEditor.setSelection(o)}}},e.prototype.destroy=function(){var e=this;this.wwEditor.destroy(),this.mdEditor.destroy(),this.preview.destroy(),this.scrollSync.destroy(),this.eventEmitter.emit("destroy"),this.eventEmitter.getEvents().forEach(function(t,n){return e.off(n)})},e.prototype.hide=function(){this.eventEmitter.emit("hide")},e.prototype.show=function(){this.eventEmitter.emit("show")},e.prototype.setScrollTop=function(e){this.getCurrentModeEditor().setScrollTop(e)},e.prototype.getScrollTop=function(){return this.getCurrentModeEditor().getScrollTop()},e.prototype.reset=function(){this.wwEditor.setModel([]),this.mdEditor.setMarkdown("")},e.prototype.getSelection=function(){return this.getCurrentModeEditor().getSelection()},e.prototype.setPlaceholder=function(e){this.placeholder=e,this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)},e.prototype.getEditorElements=function(){return{mdEditor:this.mdEditor.getElement(),mdPreview:this.preview.getElement(),wwEditor:this.wwEditor.getElement()}},e.prototype.convertPosToMatchEditorMode=function(e,t,n){var r,o;void 0===t&&(t=e),void 0===n&&(n=this.mode);var i=this.mdEditor.view.state.doc,s=Array.isArray(e),a=Array.isArray(t),l=e,c=t;if(s!==a)throw new Error("Types of arguments must be same");return"markdown"!==n||s||a?"wysiwyg"===n&&s&&a&&(l=(o=Qt(i,e,t))[0],c=o[1]):(l=(r=Zt(i,e,t))[0],c=r[1]),[l,c]},e}();var Ku=function(e){return"boolean"==typeof e||e instanceof Boolean},Gu=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.walk=function(){var e=this.entering,t=this.current;return t?(e?t.firstChild?(this.current=t.firstChild,this.entering=!0):this.entering=!1:t===this.root?this.current=null:t.next?(this.current=t.next,this.entering=!0):(this.current=t.parent,this.entering=!1),{vnode:t,entering:e}):null},e}(),Zu=function(){function e(e,t,n){this.parent=null,this.old=null,this.firstChild=null,this.next=null,this.skip=!1,this.type=e,this.props=t,this.children=n,this.props.children=n,t.ref&&(this.ref=t.ref,delete t.ref),t.key&&(this.key=t.key,delete t.key)}return e.prototype.walker=function(){return new Gu(this)},e.removalNodes=[],e}();function Xu(e,t){var n=e;Ku(e)||null==e?n=null:(y(e)||W(e))&&(n=function(e){return new Zu("TEXT_NODE",{nodeValue:e},[])}(String(e))),n&&t.push(n)}var Qu=function(e){for(var t,n,r=arguments,o=1,i="",s="",a=[0],l=function(e){1===o&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(e?r[e]:i):3===o&&(e||i)?(a[1]=e?r[e]:i,o=2):2===o&&"..."===i&&e?a[2]=Te(a[2]||{},r[e]):2===o&&i&&!e?(a[2]=a[2]||{})[i]=!0:o>=5&&(5===o?((a[2]=a[2]||{})[n]=e?i?i+r[e]:r[e]:i,o=6):(e||i)&&(a[2][n]+=e?i+r[e]:i)),i=""},c=0;c"===t?(o=1,i=""):i=t+i[0]:s?t===s?s="":i+=t:'"'===t||"'"===t?s=t:">"===t?(l(),o=1):o&&("="===t?(o=5,n=i,i=""):"/"===t&&(o<5||">"===e[c][r+1])?(l(),3===o&&(a=a[0]),o=a,(a=a[0]).push(this.apply(null,o.slice(1))),o=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(l(),o=2):i+=t),3===o&&"!--"===i&&(o=4,a=a[0])}return l(),a.length>2?a.slice(1):a[1]}.bind(function(e,t){for(var n=[],r=2;r\n \n
\n
\n
0},e}(),Hd="undefined"!=typeof WeakMap?new WeakMap:new vd,jd=function(){return function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Md.getInstance(),r=new Fd(t,n,this);Hd.set(this,r)}}();["observe","unobserve","disconnect"].forEach(function(e){jd.prototype[e]=function(){var t;return(t=Hd.get(this))[e].apply(t,arguments)}});var zd,qd,Vd,$d,_d,Ud,Wd,Jd,Kd,Gd,Zd,Xd,Qd,Yd,ep,tp,np=void 0!==bd.ResizeObserver?bd.ResizeObserver:jd,rp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execCommand=function(e){var t=Dt(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},t.prototype.render=function(){var e=this;return Qu(qd||(qd=m(["\n
\n "],["\n
\n "])),function(t){return e.execCommand(t)},Wl.get("Headings"),[1,2,3,4,5,6].map(function(e){return Qu(zd||(zd=m(['\n
\n <',">"," ","$>\n \n "],['\n
\n <',">"," ","$>\n \n "])),e,"h"+e,Wl.get("Heading"),e)}),Wl.get("Paragraph"))},t}(hd),op=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},t.prototype.render=function(){var e=this;return Qu($d||($d=m(['\n
\n ',"\n
\n "],['\n
\n ',"\n
\n "])),Ct("tabs"),this.props.tabs.map(function(t){var n=t.name,r=t.text,o=e.props.activeTab===n;return Qu(Vd||(Vd=m(['\n
\n ',"\n
\n "],['\n
\n ',"\n
\n "])),o?" active":"",function(t){return e.toggleTab(t,n)},Wl.get(r),o?"true":"false",o?"0":"-1",Wl.get(r))}))},t}(hd),ip=function(e){function t(t){var n=e.call(this,t)||this;return n.initialize=function(e){void 0===e&&(e="file");var t=n.refs.url;t.value="",n.refs.altText.value="",n.refs.file.value="",U(t,"wrong"),n.setState({activeTab:e,file:null,fileNameElClassName:""})},n.execCommand=function(){"file"===n.state.activeTab?n.emitAddImageBlob():n.emitAddImage()},n.toggleTab=function(e,t){t!==n.state.activeTab&&n.initialize(t)},n.showFileSelectBox=function(){n.refs.file.click()},n.changeFile=function(e){var t=e.target.files;(null===t||void 0===t?void 0:t.length)&&n.setState({file:t[0]})},n.state={activeTab:"file",file:null,fileNameElClassName:""},n.tabs=[{name:"file",text:"File"},{name:"url",text:"URL"}],n}return p(t,e),t.prototype.emitAddImageBlob=function(){var e=this,t=this.refs.file.files,n=this.refs.altText,r=" wrong";if(null===t||void 0===t?void 0:t.length){r="";var o=t.item(0);this.props.eventEmitter.emit("addImageBlobHook",o,function(t,r){return e.props.execCommand("addImage",{imageUrl:t,altText:r||n.value})},"ui")}this.setState({fileNameElClassName:r})},t.prototype.emitAddImage=function(){var e=this.refs.url,t=this.refs.altText,n=e.value,r=t.value||"image";U(e,"wrong"),n.length?n&&this.props.execCommand("addImage",{imageUrl:n,altText:r}):z(e,"wrong")},t.prototype.preventSelectStart=function(e){e.preventDefault()},t.prototype.updated=function(){this.props.show||this.initialize()},t.prototype.render=function(){var e=this,t=this.state,n=t.activeTab,r=t.file,o=t.fileNameElClassName;return Qu(_d||(_d=m(['\n