PageSourceSearch

https://flexiv.com/_next/static/chunks/8605.b4939a5f600bee7c.js

js flexiv.com collected 2026-10-03 22:04:47 UTC 338,623 bytes, 18 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8605],{9582:function(t){!/*!
2 * TOAST UI Editor : Code Syntax Highlight Plugin
3 * @version 3.1.0 | Fri Aug 05 2022
4 * @author NHN Cloud FE Development Lab <[email protected]>
5 * @license MIT
6 */function(){"use strict";var e={928:function(t,e,n){var r=n(322);t.exports=function(t,e,n){var i,o;if(n=n||0,!r(e))return -1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t,n);for(o=e.length,i=n;n>=0&&i<o;i+=1)if(e[i]===t)return i;return -1}},690:function(t,e,n){var r=n(322),i=n(893),o=n(956);t.exports=function(t,e,n){r(t)?i(t,e,n):o(t,e,n)}},893:function(t){t.exports=function(t,e,n){var r=0,i=t.length;for(n=n||null;r<i&&!1!==e.call(n,t[r],r,t);r+=1);}},956:function(t){t.exports=function(t,e,n){var r;for(r in n=n||null,t)if(t.hasOwnProperty(r)&&!1===e.call(n,t[r],r,t))break}},990:function(t,e,n){var r=n(893);t.exports=function(t){var e;try{e=Array.prototype.slice.call(t)}catch(n){e=[],r(t,function(t){e.push(t)})}return e}},24:function(t,e,n){var r=n(322),i=n(929);t.exports=function(t,e){if(e=(e=r(e)?e.join(" "):e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),i(t.className.baseVal)){t.className=e;return}t.className.baseVal=e}},204:function(t,e,n){var r=n(690),i=n(928),o=n(902),s=n(24);t.exports=function(t){var e,n=Array.prototype.slice.call(arguments,1),a=t.classList,l=[];if(a){r(n,function(e){t.classList.add(e)});return}(e=o(t))&&(n=[].concat(e.split(/\s+/),n)),r(n,function(t){0>i(t,l)&&l.push(t)}),s(t,l)}},522:function(t,e,n){var r=n(758),i=n(690);t.exports=function(t,e,n){var o=t.style;if(r(e)){o[e]=n;return}i(e,function(t,e){o[e]=t})}},902:function(t,e,n){var r=n(929);t.exports=function(t){return t&&t.className?r(t.className.baseVal)?t.className:t.className.baseVal:""}},714:function(t,e,n){var r=n(928),i=n(902);t.exports=function(t,e){return t.classList?t.classList.contains(e):r(e,i(t).split(/\s+/))>-1}},462:function(t,e,n){var r=n(893),i=n(928),o=n(902),s=n(24);t.exports=function(t){var e,n,a=Array.prototype.slice.call(arguments,1),l=t.classList;if(l){r(a,function(t){l.remove(t)});return}e=o(t).split(/\s+/),n=[],r(e,function(t){0>i(t,a)&&n.push(t)}),s(t,n)}},322:function(t){t.exports=function(t){return t instanceof Array}},294:function(t){t.exports=function(t){return t instanceof Function}},758:function(t){t.exports=function(t){return"string"==typeof t||t instanceof String}},929:function(t){t.exports=function(t){return void 0===t}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};!function(){r.d(i,{default:function(){return M}});var t=r(294),e=r.n(t),n=r(758),o=r.n(n),s=function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t};function a(t,e,n){var r,i=e.pmView,a=[];return(r=[],t.descendants(function(t,e){t.isBlock&&"codeBlock"===t.type.name&&r.push({node:t,pos:e})}),r).forEach(function(t){var e=t.pos,r=t.node,l=r.attrs.language,h=n.languages[l],c=function t(e){return e.reduce(function(e,n){return e.concat(Array.isArray(n)?t(n):n)},[])}(function t(e,n){return(void 0===n&&(n=[]),o()(e))?[{text:e,classes:n}]:e.map(function(e){var r=e.type,i=e.alias,a=[],l=[];r&&(a=["token",r]),i&&(l=o()(i)?[i]:i);var h=s(s(s([],n),a),l);return o()(e)?{text:e,classes:h}:t(e.content,h)})}(h?n.tokenize(r.textContent,h):[])),u=e+1;c.forEach(function(t){var e=t.text,n=t.classes,r=u,o=r+e.length;u=o;var s=n.join(" "),l=i.Decoration.inline(r,o,{class:s});s.length&&a.push(l)})}),i.DecorationSet.create(t,a)}var l=r(204),h=r.n(l);function c(t){return parseInt(t,10)}function u(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.map(function(t){return"toastui-editor-"+t}).join(" ")}var f=r(522),p=r.n(f),d=r(462),m=r.n(d),g=r(714),v=r.n(g),y=r(990),k=r.n(y),w=r(928),x=r.n(w),b="data-language",S=function(){function t(t,e,n){var r=this;this.buttons=[],this.prevStoredLanguage="",this.onSelectToggleButton=function(t){var e,n,i,o,s=t.target,a=getComputedStyle(s,":after"),l=t.offsetX,h=t.offsetY;e=c(a.left),n=c(a.top),i=c(a.width)+c(a.paddingLeft)+c(a.paddingRight),o=c(a.height)+c(a.paddingTop)+c(a.paddingBottom),l>=e&&l<=e+i&&h>=n&&h<=n+o&&(t.preventDefault(),r.toggleFocus())},this.onSelectLanguageButtons=function(t){var e=t.target.getAttribute(b);e&&r.selectLanguage(e)},this.handleKeydown=function(t){var e=t.key;"ArrowUp"===e?(r.selectPrevLanguage(),t.preventDefault()):"ArrowDown"===e?(r.selectNextLanguage(),t.preventDefault()):"Enter"===e||"Tab"===e?(r.storeInputLanguage(),t.preventDefault()):r.hideList()},this.showLangugaeSelectBox=function(t,e){var n=t.top,i=t.right;e&&r.setLanguage(e),r.show();var o=r.input.parentElement.getBoundingClientRect().width;p()(r.wrapper,{top:n+10+"px",left:i-o-10+"px"}),r.toggleFocus()},this.rootEl=t,this.eventEmitter=e,this.languages=n,this.createElement(),this.bindDOMEvent(),this.bindEvent()}return t.prototype.createElement=function(){this.wrapper=document.createElement("div"),h()(this.wrapper,u
6("code-block-language")),this.createInputElement(),this.createLanguageListElement(),this.rootEl.appendChild(this.wrapper),this.hide()},t.prototype.createInputElement=function(){var t=document.createElement("span");h()(t,u("code-block-language-input"));var e=document.createElement("input");e.type="text",e.setAttribute("maxlength","20"),this.input=e,t.appendChild(this.input),this.wrapper.appendChild(t)},t.prototype.createLanguageListElement=function(){this.list=document.createElement("div"),h()(this.list,u("code-block-language-list"));var t=document.createElement("div");h()(t,"buttons"),t.innerHTML=this.languages.map(function(t){return'<button type="button" data-language="'+t+'">'+t+"</button>"}).join(""),this.buttons=k()(t.children),this.list.appendChild(t),this.wrapper.appendChild(this.list),this.activateButtonByIndex(0),this.hideList()},t.prototype.bindDOMEvent=function(){var t=this;this.wrapper.addEventListener("mousedown",this.onSelectToggleButton),this.input.addEventListener("keydown",this.handleKeydown),this.input.addEventListener("focus",function(){return t.activateSelectBox()}),this.input.addEventListener("blur",function(){return t.inactivateSelectBox()}),this.list.addEventListener("mousedown",this.onSelectLanguageButtons)},t.prototype.bindEvent=function(){this.eventEmitter.listen("showCodeBlockLanguages",this.showLangugaeSelectBox)},t.prototype.activateSelectBox=function(){h()(this.wrapper,"active"),p()(this.list,{display:"block"})},t.prototype.inactivateSelectBox=function(){this.input.value=this.prevStoredLanguage,m()(this.wrapper,"active"),this.hideList()},t.prototype.toggleFocus=function(){v()(this.wrapper,"active")?this.input.blur():this.input.focus()},t.prototype.storeInputLanguage=function(){var t=this.input.value;this.setLanguage(t),this.hideList(),this.eventEmitter.emit("selectLanguage",t)},t.prototype.activateButtonByIndex=function(t){this.currentButton&&m()(this.currentButton,"active"),this.buttons.length&&(this.currentButton=this.buttons[t],this.input.value=this.currentButton.getAttribute(b),h()(this.currentButton,"active"),this.currentButton.scrollIntoView())},t.prototype.selectLanguage=function(t){this.input.value=t,this.storeInputLanguage()},t.prototype.selectPrevLanguage=function(){var t=x()(this.currentButton,this.buttons)-1;t<0&&(t=this.buttons.length-1),this.activateButtonByIndex(t)},t.prototype.selectNextLanguage=function(){var t=x()(this.currentButton,this.buttons)+1;t>=this.buttons.length&&(t=0),this.activateButtonByIndex(t)},t.prototype.hideList=function(){p()(this.list,{display:"none"})},t.prototype.show=function(){p()(this.wrapper,{display:"inline-block"})},t.prototype.hide=function(){p()(this.wrapper,{display:"none"})},t.prototype.setLanguage=function(t){this.prevStoredLanguage=t,this.input.value=t;var e=this.buttons.filter(function(e){return e.getAttribute(b)===t});if(e.length){var n=x()(e[0],this.buttons);this.activateButtonByIndex(n)}},t.prototype.destroy=function(){var t;(t=this.wrapper).parentNode&&t.parentNode.removeChild(t),this.eventEmitter.removeEventHandler("showCodeBlockLanguages",this.showLangugaeSelectBox)},t}(),_=function(){return(_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},C=function(){function t(t,n,r,i,o){var s=this;this.node=t,this.view=n,this.getPos=r,this.eventEmitter=i,this.languages=o,this.contentDOM=null,this.languageSelectBox=null,this.onSelectLanguage=function(t){s.languageEditing&&s.changeLanguage(t)},this.onClickEditingButton=function(t){var n=t.target;if("none"!==getComputedStyle(n,":after").backgroundImage&&e()(s.getPos)){var r=s.view.coordsAtPos(s.getPos());s.openLanguageSelectBox(r)}},this.finishLanguageEditing=function(){s.languageEditing&&s.reset()},this.node=t,this.view=n,this.getPos=r,this.eventEmitter=i,this.languageEditing=!1,this.languages=o,this.createElement(),this.bindDOMEvent(),this.bindEvent()}return t.prototype.createElement=function(){var t=this.node.attrs.language,e=document.createElement("div");e.setAttribute("data-language",t||"text"),h()(e,u("ww-code-block-highlighting"));var n=this.createCodeBlockElement(),r=n.firstChild;t&&(h()(n,"language-"+t),h()(r,"language-"+t)),e.appendChild(n),this.dom=e,this.contentDOM=r},t.prototype.createCodeBlockElement=function(){var t,e,n,r=document.createElement("pre"),i=document.createElement("code"),o=this.node.attrs.language,s=(e=(t=this.node.attrs).htmlAttrs,n=t.classNames,_(_({},e),{class:n?n.join(" "):null}));return o&&i.setAttribute("data-language",o),Object.keys(s).forEac
6h(function(t){s[t]&&r.setAttribute(t,s[t])}),r.appendChild(i),r},t.prototype.bindDOMEvent=function(){this.dom&&(this.dom.addEventListener("click",this.onClickEditingButton),this.view.dom.addEventListener("mousedown",this.finishLanguageEditing),window.addEventListener("resize",this.finishLanguageEditing))},t.prototype.bindEvent=function(){this.eventEmitter.listen("selectLanguage",this.onSelectLanguage),this.eventEmitter.listen("scroll",this.finishLanguageEditing),this.eventEmitter.listen("finishLanguageEditing",this.finishLanguageEditing)},t.prototype.openLanguageSelectBox=function(t){this.languageSelectBox=new S(this.view.dom.parentElement,this.eventEmitter,this.languages),this.eventEmitter.emit("showCodeBlockLanguages",t,this.node.attrs.language),this.languageEditing=!0},t.prototype.changeLanguage=function(t){if(e()(this.getPos)){this.reset();var n=this.getPos(),r=this.view.state.tr;r.setNodeMarkup(n,null,{language:t}),this.view.dispatch(r)}},t.prototype.reset=function(){this.languageSelectBox&&(this.languageSelectBox.destroy(),this.languageSelectBox=null),this.languageEditing=!1},t.prototype.stopEvent=function(){return!0},t.prototype.update=function(t){return!!t.sameMarkup(this.node)&&(this.node=t,!0)},t.prototype.destroy=function(){this.reset(),this.dom&&(this.dom.removeEventListener("click",this.onClickEditingButton),this.view.dom.removeEventListener("mousedown",this.finishLanguageEditing),window.removeEventListener("resize",this.finishLanguageEditing)),this.eventEmitter.removeEventHandler("selectLanguage",this.onSelectLanguage),this.eventEmitter.removeEventHandler("scroll",this.finishLanguageEditing),this.eventEmitter.removeEventHandler("finishLanguageEditing",this.finishLanguageEditing)},t}();window,window.Prism=window.Prism||{},window.Prism.manual=!0;var M=function(t,n){if(n){var r=t.eventEmitter,i=n.highlighter;r.addEventType("showCodeBlockLanguages"),r.addEventType("selectLanguage"),r.addEventType("finishLanguageEditing");var o=i.languages,s=Object.keys(o).filter(function(t){return!e()(o[t])});return{toHTMLRenderers:{codeBlock:function(t){var e=t.fenceLength,n=t.info,r=n?n.split(/\s+/):[],o=[],s={};e>3&&(s["data-backticks"]=e);var a=t.literal;if(r.length&&r[0].length){var l=r[0];o.push("lang-"+l),s["data-language"]=l;var h=i.languages[l];h&&(a=i.highlight(t.literal,h,l))}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:s},{type:"html",content:a},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]}},wysiwygPlugins:[function(){return new t.pmState.Plugin({state:{init:function(e,n){return a(n.doc,t,i)},apply:function(e,n){return e.docChanged?a(e.doc,t,i):n.map(e.mapping,e.doc)}},props:{decorations:function(t){return this.getState(t)}}})}],wysiwygNodeViews:{codeBlock:function(t,e,n,r){return new C(t,e,n,r,s)}}}}return{}}}(),t.exports=i.default}()},2922:function(t){!/*!
7 * TOAST UI Editor : Table Merged Cell Plugin
8 * @version 3.1.0 | Fri Aug 05 2022
9 * @author NHN Cloud FE Development Lab <[email protected]>
10 * @license MIT
11 */function(){"use strict";var e={893:function(t){t.exports=function(t,e,n){var r=0,i=t.length;for(n=n||null;r<i&&!1!==e.call(n,t[r],r,t);r+=1);}},990:function(t,e,n){var r=n(893);t.exports=function(t){var e;try{e=Array.prototype.slice.call(t)}catch(n){e=[],r(t,function(t){e.push(t)})}return e}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};!function(){function t(t,e,n){var r=RegExp("^((?:"+n+"=[0-9]+:)?)"+e+"=([0-9]+):(.*)").exec(t),i=1;return r&&(i=parseInt(r[2],10),t=r[1]+r[3]),[i,t]}r.d(i,{default:function(){return M}});var e,n,o={tableRow:function(t,e){if(e.entering&&(t.rowspanMap={},t.prev&&!t.firstChild)){var n=t.prev.rowspanMap;Object.keys(n).forEach(function(e){n[e]>1&&(t.rowspanMap[e]=n[e]-1)})}},tableCell:function(e,n){var r,i,o=n.entering,s=e.parent,a=e.prev,l=e.stringContent;if(o){var h={},c=l,u=1,f=1;u=(r=t(c,"@cols","@rows"))[0],f=(i=t(c=r[1],"@rows","@cols"))[0],c=i[1],e.stringContent=c,a&&(e.startIdx=a.endIdx+1,e.endIdx=e.startIdx),u>1&&(h.colspan=u,e.endIdx+=u-1),f>1&&(h.rowspan=f),e.attrs=h,function(t,e,n){var r=e.prev;if(r)for(var i=e.parent.parent.columns.length,o=t.startIdx;o<i;o+=1){var s=r.rowspanMap[o];s&&s>1&&(e.rowspanMap[o]=s-1,o<=t.endIdx&&(t.startIdx+=1,t.endIdx+=1))}if(n>1)for(var a=t.startIdx,l=t.endIdx,o=a;o<=l;
11o+=1)e.rowspanMap[o]=n}(e,s,f);var p=s.parent;"tableBody"===p.type&&e.endIdx>=p.parent.columns.length&&(e.ignored=!0)}}},s=function(){return(s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a={tableRow:function(t,e){var n=e.entering,r=e.origin;if(n)return r();var i=[];if(t.lastChild)for(var o=t.parent.parent.columns.length,s=t.lastChild.endIdx,a=s+1;a<o;a+=1)t.prev&&t.prev.rowspanMap[a]&&!(t.prev.rowspanMap[a]<=1)||i.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return i.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),i},tableCell:function(t,e){var n=e.entering,r=(0,e.origin)();if(t.ignored)return r;if(n){var i=s({},t.attrs);r.attributes=s(s({},r.attributes),i)}return r}};function l(t){var e=t.attrs,n=e.rowspan,r=e.colspan,i="";return n&&(i="@rows="+n+":"),r&&(i="@cols="+r+":"+i),{delim:"| "+i}}var h={tableHead:function(t){var e=t.node.firstChild,n="";return e&&e.forEach(function(t){var e,r,i,o,s=t.textContent,a=t.attrs,l=(e=a.align,r=s.length,i="",o="","left"===e?(i=":",r-=1):"right"===e?(o=":",r-=1):"center"===e&&(i=":",o=":",r-=2),""+i+function(t,e){for(var n="",r=0;r<e;r+=1)n+="-";return n}(0,Math.max(r,3))+o);if(n+="| "+l+" ",a.colspan)for(var h=0;h<a.colspan-1;h+=1)n+="| "+l+" "}),{delim:n}},tableHeadCell:function(t){return l(t.node)},tableBodyCell:function(t){return l(t.node)}},c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},u={extendedRowspan:function(t,e){var n=this.rowInfo[t].rowspanMap[e];return!!n&&n.startSpanIdx!==t},extendedColspan:function(t,e){var n=this.rowInfo[t].colspanMap[e];return!!n&&n.startSpanIdx!==e},getRowspanCount:function(t,e){var n=this.rowInfo[t].rowspanMap[e];return n?n.count:0},getColspanCount:function(t,e){var n=this.rowInfo[t].colspanMap[e];return n?n.count:0},decreaseColspanCount:function(t,e){var n=this.rowInfo[t].colspanMap[e],r=this.rowInfo[t].colspanMap[n.startSpanIdx];return r.count-=1,r.count},decreaseRowspanCount:function(t,e){var n=this.rowInfo[t].rowspanMap[e],r=this.rowInfo[n.startSpanIdx].rowspanMap[e];return r.count-=1,r.count},getColspanStartInfo:function(t,e){var n=this.rowInfo[t].colspanMap,r=n[e];if(r){var i=r.startSpanIdx,o=this.rowInfo[t][i];return{node:this.table.nodeAt(o.offset-this.tableStartOffset),pos:o.offset,startSpanIdx:i,count:n[i].count}}return null},getRowspanStartInfo:function(t,e){var n=this.rowInfo[t].rowspanMap[e];if(n){var r=n.startSpanIdx,i=this.rowInfo[r][e];return{node:this.table.nodeAt(i.offset-this.tableStartOffset),pos:i.offset,startSpanIdx:r,count:this.rowInfo[r].rowspanMap[e].count}}return null},getSpannedOffsets:function(t){for(var e=t.startRowIdx,n=t.startColIdx,r=t.endRowIdx,i=t.endColIdx,o=r;o>=e;o-=1)if(this.rowInfo[o])for(var s=this.rowInfo[o],a=s.rowspanMap,l=s.colspanMap,h=i;h>=n;h-=1){var c=a[h],u=l[h];c&&(e=Math.min(e,c.startSpanIdx)),u&&(n=Math.min(n,u.startSpanIdx))}for(var o=e;o<=r;o+=1)if(this.rowInfo[o])for(var f=this.rowInfo[o],a=f.rowspanMap,l=f.colspanMap,h=n;h<=i;h+=1){var c=a[h],u=l[h];c&&(r=Math.max(r,o+c.count-1)),u&&(i=Math.max(i,h+u.count-1))}return{startRowIdx:e,startColIdx:n,endRowIdx:r,endColIdx:i}}},f=function(t,e,n){void 0===n&&(n=!1);var r=[],i="tableBody"===t.type.name;return t.forEach(function(t,o,s){var a,l,h,u,f,p=i&&!n?s+1:s,d=r[s-1],m={rowspanMap:{},colspanMap:{},length:0};d&&(l=(a=m).rowspanMap,h=a.colspanMap,u=d.rowspanMap,f=d.colspanMap,Object.keys(u).forEach(function(t){var e=Number(t),n=u[e];if((null==n?void 0:n.count)>1){var r=f[e],i=n.count,o=n.startSpanIdx;l[e]={count:i-1,startSpanIdx:o},h[e]=r,a[e]=c(c({},d[e]),{extended:!0}),a.length+=1}})),t.forEach(function(t,n){for(var r,i,s=t.nodeSize,a=t.attrs,l=null!==(r=a.colspan)&&void 0!==r?r:1,h=null!==(i=a.rowspan)&&void 0!==i?i:1,u=0;m[u];)u+=1;m[u]={offset:e+o+n+2,nodeSize:s},m.length+=1,h>1&&(m.rowspanMap[u]={count:h,startSpanIdx:p}),l>1&&(m.colspanMap[u]={count:l,startSpanIdx:u},function(t,e,n,r,i){for(var o=i.rowspanMap,s=i.colspanMap,a=1;a<e;a+=1)s[r+a]={count:e-a,startSpanIdx:r},t>1&&(o[r+a]={count:t,startSpanIdx:n}),i[r+a]=c({},i[r]),i.length+=1}(h,l,p,u,m))}),r.push(m)}),r},p=r(990),d=r.n(p),m=".toastui-editor-cell-selected";function g(t){return Number(t.getAttribute("colspan"))>1||Number(t.getAttribute("rowspan"))>1}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function y(t,e){if(t instanceof e.pmState.TextSelection){var n=t.$anchor,r=function(t,e){for(var n=t.depth;
11n>=0;){var r=t.node(n);if(e(r,n))return{node:r,depth:n,offset:n>0?t.before(n):0};n-=1}return null}(n,function(t){var e=t.type;return"tableHeadCell"===e.name||"tableBodyCell"===e.name});if(r){var i=n.node(0).resolve(n.before(r.depth));return{anchor:i,head:i}}}return{anchor:t.startCell,head:t.endCell}}function k(t){var e=t.startRowIdx,n=t.startColIdx;return{rowCount:t.endRowIdx-e+1,columnCount:t.endColIdx-n+1}}function w(t,e){return v(v({},t.attrs),e)}function x(t){return Object.getPrototypeOf(t).constructor}function b(t,e,n,r){void 0===r&&(r=null);for(var i=n.nodes,o=i.tableHeadCell,s=i.tableBodyCell,a=i.paragraph,l=0===e?o:s,h=[],c=0;c<t;c+=1)h.push(l.create(r,a.create()));return h}function S(t,e,n,r){var i=r.getNodeAndPos(t,e).node.content;return i.size>2?n.append(i):n}function _(t,e,r){return function(i,o,s){var a,l,h,c,u=o.selection,f=o.schema,p=o.tr,d=y(u,t),m=d.anchor,g=d.head;if(!m||!g)return!1;var v=e.create(m),x=v.totalColumnCount,S=v.getRectOffsets(m,g),_=k(S).rowCount,C=(r===n.UP?(a=S.startRowIdx,l=function(t){return v.extendedRowspan(a,t)},h=0,c=-1):(a=S.endRowIdx,l=function(t){return v.getRowspanCount(a,t)>1},h=v.totalColumnCount-1,c=v.extendedRowspan(a,h)?2:v.getCellInfo(a,h).nodeSize+1),{targetRowIdx:a,judgeToExtendRowspan:l,insertColIdx:h,nodeSize:c}),M=C.targetRowIdx,E=C.judgeToExtendRowspan,O=C.insertColIdx,A=C.nodeSize;if(0===M)return!1;for(var I=[],R=p.mapping.map(v.posAt(M,O))+A,T=[],N=0;N<x;N+=1)if(E(N)){var z=v.getRowspanStartInfo(M,N),F=z.node,B=z.pos,j=w(F,{rowspan:F.attrs.rowspan+_});p.setNodeMarkup(p.mapping.map(B),null,j)}else T=T.concat(b(1,M,f));for(var $=0;$<_;$+=1)I.push(f.nodes.tableRow.create(null,T));return s(p.insert(R,I)),!0}}function C(t,e,r){return function(i,o,s){var a,l,h,c=o.selection,u=o.tr,f=o.schema,p=y(c,t),d=p.anchor,m=p.head;if(!d||!m)return!1;for(var g=e.create(d),v=g.getRectOffsets(d,m),x=(r===n.LEFT?(a=v.startColIdx,l=function(t){return g.extendedColspan(t,a)},h=a):(a=v.endColIdx,l=function(t){return g.getColspanCount(t,a)>1},h=a+1),{targetColIdx:a,judgeToExtendColspan:l,insertColIdx:h}),S=x.targetColIdx,_=x.judgeToExtendColspan,C=x.insertColIdx,M=k(v).columnCount,E=g.totalRowCount,O=0;O<E;O+=1)if(_(O)){var A=g.getColspanStartInfo(O,S),I=A.node,R=A.pos,T=w(I,{colspan:I.attrs.colspan+M});u.setNodeMarkup(u.mapping.map(R),null,T)}else{var N=b(M,O,f);u.insert(u.mapping.map(g.posAt(O,C)),N)}return s(u),!0}}function M(t){var e,r=t.i18n,i=t.eventEmitter.emitReduce("mixinTableOffsetMapPrototype",u,f);return r.setLanguage(["ko","ko-KR"],{"Merge cells":"셀 병합","Split cells":"셀 병합해제","Cannot change part of merged cell":"병합된 셀의 일부를 변경할 수 없습니다.","Cannot paste row merged cells into the table header":"테이블 헤더에는 행 병합된 셀을 붙여넣을 수 없습니다."}),r.setLanguage(["en","en-US"],{"Merge cells":"Merge cells","Split cells":"Split cells","Cannot change part of merged cell":"Cannot change part of merged cell.","Cannot paste row merged cells into the table header":"Cannot paste row merged cells into the table header."}),r.setLanguage(["es","es-ES"],{"Merge cells":"Combinar celdas","Split cells":"Separar celdas","Cannot change part of merged cell":"No se puede cambiar parte de una celda combinada.","Cannot paste row merged cells into the table header":"No se pueden pegar celdas combinadas en el encabezado de tabla."}),r.setLanguage(["ja","ja-JP"],{"Merge cells":"セルの結合","Split cells":"セルの結合を解除","Cannot change part of merged cell":"結合されたセルの一部を変更することはできません。","Cannot paste row merged cells into the table header":"行にマージされたセルをヘッダーに貼り付けることはできません。"}),r.setLanguage(["nl","nl-NL"],{"Merge cells":"Cellen samenvoegen","Split cells":"Samengevoegde cellen ongedaan maken","Cannot change part of merged cell":"Kan geen deel uit van een samengevoegde cel veranderen.","Cannot paste row merged cells into the table header":"Kan geen rij met samengevoegde cellen in de koptekst plakken."}),r.setLanguage("zh-CN",{"Merge cells":"合并单元格","Split cells":"取消合并单元格","Cannot change part of merged cell":"无法更改合并单元格的一部分。","Cannot paste row merged cells into the table header":"无法å°
11†è¡Œåˆå¹¶å•元格粘贴到标题中。"}),r.setLanguage(["de","de-DE"],{"Merge cells":"Zellen zusammenf\xfchren","Split cells":"Zusammenf\xfchren r\xfcckg\xe4ngig machen","Cannot change part of merged cell":"Der Teil der verbundenen Zelle kann nicht ge\xe4ndert werden.","Cannot paste row merged cells into the table header":"Die Zeile der verbundenen Zellen kann nicht in die Kopfzeile eingef\xfcgt werden."}),r.setLanguage(["ru","ru-RU"],{"Merge cells":"Объединить ячейки","Split cells":"Разъединить ячейки","Cannot change part of merged cell":"Вы не можете изменять часть комбинированной ячейки.","Cannot paste row merged cells into the table header":"Вы не можете вставлять объединенные ячейки в заголовок таблицы."}),r.setLanguage(["fr","fr-FR"],{"Merge cells":"Fusionner les cellules","Split cells":"S\xe9parer les cellules","Cannot change part of merged cell":"Impossible de modifier une partie de la cellule fusionn\xe9e.","Cannot paste row merged cells into the table header":"Impossible de coller les cellules fusionn\xe9es dans l'en-t\xeate du tableau."}),r.setLanguage(["uk","uk-UA"],{"Merge cells":"Об'єднати комірки","Split cells":"Роз'єднати комірки","Cannot change part of merged cell":"Ви не можете змінювати частину комбінованої комірки.","Cannot paste row merged cells into the table header":"Ви не можете вставляти об'єднані комірки в заголовок таблиці."}),r.setLanguage(["tr","tr-TR"],{"Merge cells":"H\xfccreleri birleştir","Split cells":"H\xfccreleri ayır","Cannot change part of merged cell":"Birleştirilmiş h\xfccrelerin bir kısmı değiştirelemez.","Cannot paste row merged cells into the table header":"Satırda birleştirilmiş h\xfccreler s\xfctun başlığına yapıştırılamaz"}),r.setLanguage(["fi","fi-FI"],{"Merge cells":"Yhdist\xe4 solut","Split cells":"Jaa solut","Cannot change part of merged cell":"Yhdistettyjen solujen osaa ei voi muuttaa","Cannot paste row merged cells into the table header":"Soluja ei voi yhdist\xe4\xe4 taulukon otsikkoriviin"}),r.setLanguage(["cs","cs-CZ"],{"Merge cells":"Spojit buňky","Split cells":"Rozpojit buňky","Cannot change part of merged cell":"Nelze měnit č\xe1st spojen\xe9 buňky","Cannot paste row merged cells into the table header":"Nelze vkl\xe1dat spojen\xe9 buňky do z\xe1hlav\xed tabulky"}),r.setLanguage("ar",{"Merge cells":"دمج الوحدات","Split cells":"إلغاء دمج الوحدات","Cannot change part of merged cell":"لا يمكن تغيير جزء من الخلية المدموجة","Cannot paste row merged cells into the table header":"لا يمكن لصق الخلايا المدموجة من صف واحد في رأس الجدول"}),r.setLanguage(["pl","pl-PL"],{"Merge cells":"Scal kom\xf3rki","Split cells":"Rozłącz kom\xf3rki","Cannot change part of merged cell":"Nie można zmienić części scalonej kom\xf3rki.","Cannot paste row merged cells into the table header":"Nie można wkleić kom\xf3rek o scalonym rzędzie w nagł\xf3wek tabeli."}),r.setLanguage("zh-TW",{"Merge cells":"合併儲存格","Split cells":"取消合併儲存格","Cannot change part of merged cell":"無法變更儲存格的一部分。","Cannot paste row merged cells into the table header":"無法將合併的儲存格貼上至表格標題中。"}),r.setLanguage(["gl","gl-ES"],{"Merge cells":"Combinar celas","Split cells":"Separar celas","Cannot change part of merged cell":"Non se pode cambiar parte dunha cela combinada","Cannot paste row merged cells into the table header":"Non se poden pegar celas no encabezado da t\xe1boa"}),r.setLanguage(["sv","sv-SE"],{"Merge cells":"Sammanfoga celler","Split cells":"Dela celler","Cannot change part of merged cell":"Ej m\xf6jligt att \xe4ndra en del av en sammanfogad cell","Cannot paste row merged cells into the table header":"Ej m\xf6jligt att klistra in rad-sammanfogade celler i tabellens huvud"}),r.setLanguage(["it","it-IT"],{"Merge cells":"Unisci celle","Split cells":"Separa celle","Cannot change part of merged cell":"Non \xe8 possibile modificare parte di una cella unita","Cannot paste row merged cells into the table header":"Non \xe8 possibile incollare celle unite per riga nell'intestazione della tabella"}),r.setLanguage(["nb","nb-NO"],{"Merge cells":"Sl\xe5 sammen celler","Split cells":"Separer celler","Cannot change part of merged cell":"Kan ikke endre deler av sammensl\xe5tte celler","Cannot paste row merged cells into the table header":"Kan ikke lime inn rad med sammensl\xe5tte celler"}),r.setLanguage(["hr","hr-HR"],{"Merge cells":"Spoji ćelije","Split cells":"Odspoji ćelije","Cannot change part of merged cell":"Ne mogu mijenjati dio spojene ćelije.","Cannot paste row merged cells into the table header":"Ne mogu zaljepiti redak spojenih ćelija u zaglavlje tablice"}),function(t){t.eventEmitter.listen("contextmenu",function(){for(var e,n,r,i,o,s,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var h=a[0],c=h.menuGroups,u=(e=t,n=h.tableCell,r=e.i18n,i=e.eventEmitter,o=n.parentElement.parentElement,s=[],o.querySelectorAll(m).length&&s.push({label:r.get("Merge cells"),onClick:function(){return i.emit("command","mergeCells")},className:"merge-cells"}),(g(n)||d()(o.querySelectorAll(m)).some(g))&&s.push({label:r.get("Split cells"),onClick:function(){return i.emit("command","splitCells")},className:"split-cells"}),s);u.length&&c.splice(2,0,u)})}(t),{toHTMLRenderers:a,markdownParsers:o,toMarkdownRenderers:h,wysiwygCommands:{mergeCells:(e=t.pmModel.Fragment,function(n,r,o){var s,a,l,h,c,u,f=r.selection,p=r.tr,d=y(f,t),m=d.anchor,g=d.head;if(!m||!g||!f.isCellSelection)return!1;var v=i.create(m),b=x(f),_=v.totalRowCount,C=v.totalColumnCount,M=v.getRectOffsets(m,g),E=k(M),O=E.rowCount,A=E.columnCount,I=M.startRowIdx,R=M.startColId
11x,T=M.endRowIdx,N=M.endColIdx;if(O>=_-1&&A===C||0===I&&T>I)return!1;for(var z=e.empty,F=I;F<=T;F+=1)for(var B=R;B<=N;B+=1)if(F===I&&B===R)z=S(F,B,z,v);else if(!v.extendedRowspan(F,B)&&!v.extendedColspan(F,B)){var j=v.getCellInfo(F,B),$=j.offset,L=j.nodeSize,D=p.mapping.map($),P=D+L;z=S(F,B,z,v),p.delete(D,P)}var J=v.getNodeAndPos(I,R),q=J.node,H=J.pos;return s=z,l=(a={startNode:q,startPos:H,rowCount:O,columnCount:A}).startNode,h=a.startPos,c=a.rowCount,u=a.columnCount,p.setNodeMarkup(h,null,w(l,{colspan:u,rowspan:c})),s.size&&p.replaceWith(h+1,h+l.content.size,s),p.setSelection(new b(p.doc.resolve(H))),o(p),!0}),splitCells:function(e,n,r,o){var s=n.selection,a=n.tr,l=y(s,t),h=l.anchor,c=l.head;if(!h||!c)return!1;for(var u=i.create(h),f=u.getRectOffsets(h,c),p=f.startRowIdx,d=f.startColIdx,m=f.endRowIdx,g=f.endColIdx,v=-1,k=p;k<=m;k+=1)for(var b=d;b<=g;b+=1)if(u.extendedRowspan(k,b)||u.extendedColspan(k,b)){var S=u.getNodeAndPos(k,b).node,_=function(t,e,n){var r=e;if(!n.extendedRowspan(t,e)&&n.extendedColspan(t,e)){var i=n.getColspanStartInfo(t,e);r=i.startSpanIdx+i.count}return r}(k,b,u),C=u.posAt(k,_),M=a.mapping.map(C);(function(t,e,n,r){var i=t.totalColumnCount;return t.extendedRowspan(n,r)&&t.extendedRowspan(n,i-1)&&e===t.posAt(n,i-1)})(u,C,k,_)&&(M+=2),v=Math.max(M,v),a.insert(M,S.type.createAndFill(w(S,{colspan:null,rowspan:null})))}else{var E=u.getNodeAndPos(k,b),S=E.node,M=E.pos;v=Math.max(a.mapping.map(M),v),a.setNodeMarkup(a.mapping.map(M),null,w(S,{colspan:null,rowspan:null}))}return r(a),function(t,e,n,r,i){if(e.isCellSelection){var o=t.state.tr,s=x(e),a=i.startRowIdx,l=i.startColIdx,h=i.endRowIdx,c=i.endColIdx,u=n.create(o.doc.resolve(r)),f=u.getCellInfo(a,l).offset,p=u.getCellInfo(h,c).offset;o.setSelection(new s(o.doc.resolve(f),o.doc.resolve(p))),t.dispatch(o)}}(o,s,i,u.tableStartOffset,f),!0},addRowToUp:_(t,i,n.UP),addRowToDown:_(t,i,n.DOWN),removeRow:function(e,n,r){var o=n.selection,s=n.tr,a=y(o,t),l=a.anchor,h=a.head;if(l&&h){var c=i.create(l),u=c.totalRowCount,f=c.totalColumnCount,p=c.getRectOffsets(l,h),d=k(p).rowCount,m=p.startRowIdx,g=p.endRowIdx;if(d===u-1||0===m)return!1;for(var v=g;v>=m;v-=1){var x=s.mapping.maps.length,b=function(t,e){for(var n=t.totalColumnCount,r=Number.MAX_VALUE,i=0,o=0;o<n;o+=1)if(!t.extendedRowspan(e,o)){var s=t.getCellInfo(e,o),a=s.offset,l=s.nodeSize;r=Math.min(r,a),i=Math.max(i,a+l)}return{from:r,to:i}}(c,v),S=b.from,_=b.to;s.delete(S-1,_+1);for(var C=0;C<f;C+=1){var M=c.getRowspanStartInfo(v,C);if((null==M?void 0:M.count)>1&&!c.extendedColspan(v,C)){if(c.extendedRowspan(v,C)){var E=c.getRowspanStartInfo(v,C),O=E.node,A=E.pos,I=c.decreaseRowspanCount(v,C),R=w(O,{rowspan:I>1?I:null});s.setNodeMarkup(s.mapping.slice(x).map(A),null,R)}else if(!c.extendedRowspan(v,C)){var T=c.getRowspanStartInfo(v,C),O=T.node,N=T.count,R=w(O,{rowspan:N>2?N-1:null}),z=O.type.create(R,O.content);s.insert(s.mapping.slice(x).map(c.posAt(v+1,C)),z)}}}c=i.create(s.doc.resolve(c.tableStartOffset))}return r(s),!0}return!1},addColumnToLeft:C(t,i,n.LEFT),addColumnToRight:C(t,i,n.RIGHT),removeColumn:function(e,n,r){var o=n.selection,s=n.tr,a=y(o,t),l=a.anchor,h=a.head;if(!l||!h)return!1;var c=i.create(l),u=c.getRectOffsets(l,h),f=c.totalColumnCount,p=c.totalRowCount;if(k(u).columnCount===f)return!1;for(var d=u.startColIdx,m=u.endColIdx,g=s.mapping.maps.length,v=0;v<p;v+=1)for(var x=m;x>=d;x-=1){var b=c.getCellInfo(v,x),S=b.offset,_=b.nodeSize,C=c.getColspanStartInfo(v,x);if(!c.extendedRowspan(v,x)){if((null==C?void 0:C.count)>1){var M=c.getColspanStartInfo(v,x),E=M.node,O=M.pos,A=c.decreaseColspanCount(v,x),I=w(E,{colspan:A>1?A:null});s.setNodeMarkup(s.mapping.slice(g).map(O),null,I)}else{var R=s.mapping.slice(g).map(S),T=R+_;s.delete(R,T)}}}return r(s),!0}}}}(e=n||(n={})).LEFT="left",e.RIGHT="right",e.UP="up",e.DOWN="down"}(),t.exports=i.default}()},1936:function(t,e,n){var r;self,t.exports=(r=n(1018),function(){"use strict";var t={94:function(t){t.exports=r}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){n.d(i,{default:function(){return o}});var t=n(94),e=n.n(t);function r(t,n){var r;try{if(!e())throw Error("plantuml-encoder dependency required");r='<img src="'+n+e().encode(t)+'" />'}catch(t){r="Error occurred on encoding uml: "+t.message}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:r},{type:"closeTag",tagName:"div",outerNewLine:!0}]}function o(t,e){void 0===e&&(e={});var n=e.rendererURL,i=void 0===n?"//www.plantuml.com/plantuml/png/":n;return{toHTMLRenderers:{uml:function(t){return r(t.literal,i)},plantUml:function(t){return r(t.literal,i)}}}}}(),i=i.default}())},5792:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return S}});var r=n(5893);n(2128);var i=n(7294),o=n(471),s=n(87),a=n.n(s),l=function(t,e){return(l=Object.setPrototypeOf||({__proto__:[]}
11)instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}l(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};!function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootEl=i.createRef(),e}h(e,t),e.prototype.getRootElement=function(){return this.rootEl.current},e.prototype.getInstance=function(){return this.editorInst},e.prototype.getBindingEventNames=function(){var t=this;return Object.keys(this.props).filter(function(t){return/^on[A-Z][a-zA-Z]+/.test(t)}).filter(function(e){return t.props[e]})},e.prototype.bindEventHandlers=function(t){var e=this;this.getBindingEventNames().forEach(function(n){var r=n[2].toLowerCase()+n.slice(3);e.editorInst.off(r),e.editorInst.on(r,t[n])})},e.prototype.getInitEvents=function(){var t=this;return this.getBindingEventNames().reduce(function(e,n){return e[n[2].toLowerCase()+n.slice(3)]=t.props[n],e},{})},e.prototype.componentDidMount=function(){this.editorInst=new o.ZP(c(c({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},e.prototype.shouldComponentUpdate=function(t){var e=this.getInstance(),n=t.height,r=t.previewStyle;return n&&this.props.height!==n&&e.setHeight(n),r&&this.props.previewStyle!==r&&e.changePreviewStyle(r),this.bindEventHandlers(t),!1},e.prototype.render=function(){return i.createElement("div",{ref:this.rootEl})}}(i.Component);var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootEl=i.createRef(),e}return h(e,t),e.prototype.getRootElement=function(){return this.rootEl.current},e.prototype.getInstance=function(){return this.viewerInst},e.prototype.getBindingEventNames=function(){var t=this;return Object.keys(this.props).filter(function(t){return/^on[A-Z][a-zA-Z]+/.test(t)}).filter(function(e){return t.props[e]})},e.prototype.bindEventHandlers=function(t){var e=this;this.getBindingEventNames().forEach(function(n){var r=n[2].toLowerCase()+n.slice(3);e.viewerInst.off(r),e.viewerInst.on(r,t[n])})},e.prototype.getInitEvents=function(){var t=this;return this.getBindingEventNames().reduce(function(e,n){return e[n[2].toLowerCase()+n.slice(3)]=t.props[n],e},{})},e.prototype.componentDidMount=function(){this.viewerInst=new(a())(c(c({el:this.rootEl.current},this.props),{events:this.getInitEvents()}))},e.prototype.shouldComponentUpdate=function(t){return this.bindEventHandlers(t),!1},e.prototype.render=function(){return i.createElement("div",{ref:this.rootEl})},e}(i.Component),f=n(9582),p=n.n(f);n(6776);var d=n(5660),m=n.n(d);n(2812),n(4563),n(7802);var g=n(2523),v=n.n(g),y=n(2922),k=n.n(y);n(4723);var w=n(1936),x=n.n(w);let b=t=>{let{className:e,content:n}=t;return(0,r.jsx)(u,{initialValue:n,plugins:[[p(),{highlighter:m()}],[v(),{minWidth:100,maxWidth:600,minHeight:100,maxHeight:300}],k(),x()]})};var S=b},7802:function(){},6776:function(){},4723:function(){},2128:function(){},4563:function(){},1018:function(t,e,n){t.exports={encode:n(6857).encode,decode:n(9252).decode}},9252:function(t){t.exports=(function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var l=Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=n[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,n,r)}return n[s].exports}for(var o=void 0,s=0;s<r.length;s++)i(r[s]);return i})({1:[function(t,e,n){"use strict";var r=t("pako/lib/inflate.js");e.exports=function(t){return r.inflateRaw(t,{to:"string"})}},{"pako/lib/inflate.js":4}],2:[function(t,e,n){"use strict";function r(t){var e=t.charCodeAt(0);return"_"===t?63:"-"===t?62:e>=97?e-61:e>=65?e-55:e>=48?e-48:"?"}e.exports=function(t){var e="",n=0;for(n=0;n<t.length;n+=4){var i=function(t){var e=r(t[0]),n=r(t[1]),i=r(t[2]);return[e<<2|n>>4&63,n<<4&240|i>>2&15,i<<6&192|63&r(t[3])]}(t.substring(n,n+4));e+=String.fromCharCode(i[0])+String.fromCharCode(i[1])+String.fromCharCode(i[2])}return e}},{}],3:[function(t,e,n){"use strict";var r=t("./inflate"),i=t("./decode64");e.exports.decode=function(t){return r(i(t))}},{"./decode64":2,"./inflate":1}],4:[function(t,e,n){"use strict";var r=t("./zlib/inflate"),i=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/constants"),a=t("./zlib/messages"),l=t("./zlib/zstream"),h=t("./zlib/gzheader"),c=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits)==0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK||(this.header=new h,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===c.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK)))throw Error(a[n])}function f(t,e){var n=new u(e);
11if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}u.prototype.push=function(t,e){var n,a,l,h,u,f=this.strm,p=this.options.chunkSize,d=this.options.dictionary,m=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(n=r.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&d&&(n=r.inflateSetDictionary(this.strm,d)),n===s.Z_BUF_ERROR&&!0===m&&(n=s.Z_OK,m=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0===f.avail_out||n===s.Z_STREAM_END||0===f.avail_in&&(a===s.Z_FINISH||a===s.Z_SYNC_FLUSH))&&("string"===this.options.to?(l=o.utf8border(f.output,f.next_out),h=f.next_out-l,u=o.buf2string(f.output,l),f.next_out=h,f.avail_out=p-h,h&&i.arraySet(f.output,f.output,l,h,0),this.onData(u)):this.onData(i.shrinkBuf(f.output,f.next_out))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return(n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH)?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):(a===s.Z_SYNC_FLUSH&&(this.onEnd(s.Z_OK),f.avail_out=0),!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=u,n.inflate=f,n.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},n.ungzip=f},{"./utils/common":5,"./utils/strings":6,"./zlib/constants":8,"./zlib/gzheader":10,"./zlib/inflate":12,"./zlib/messages":14,"./zlib/zstream":15}],5:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n,r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var i in r)n=i,Object.prototype.hasOwnProperty.call(r,n)&&(t[i]=r[i])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray){t.set(e.subarray(n,n+r),i);return}for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,s;for(e=0,r=0,n=t.length;e<n;e++)r+=t[e].length;for(e=0,s=new Uint8Array(r),i=0,n=t.length;e<n;e++)o=t[e],s.set(o,i),i+=o.length;return s}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],6:[function(t,e,n){"use strict";var r=t("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new r.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,n.string2buf=function(t){var e,n,i,o,s,a=t.length,l=0;for(o=0;o<a;o++)(64512&(n=t.charCodeAt(o)))==55296&&o+1<a&&(64512&(i=t.charCodeAt(o+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(s=0,e=new r.Buf8(l),o=0;s<l;o++)(64512&(n=t.charCodeAt(o)))==55296&&o+1<a&&(64512&(i=t.charCodeAt(o+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,o,a=e||t.length,h=Array(2*a);for(r=0,n=0;n<a;){if((i=t[n++])<128){h[r++]=i;continue}if((o=s[i])>4){h[r++]=65533,n+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&t[n++],o--;
11if(o>1){h[r++]=65533;continue}i<65536?h[r++]=i:(i-=65536,h[r++]=55296|i>>10&1023,h[r++]=56320|1023&i)}return l(h,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&(192&t[n])==128;)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},{"./common":5}],7:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do o=o+(i=i+e[r++]|0)|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}},{}],8:[function(t,e,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],9:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=i+n;t^=-1;for(var s=i;s<o;s++)t=t>>>8^r[(t^e[s])&255];return -1^t}},{}],10:[function(t,e,n){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){var n,r,i,o,s,a,l,h,c,u,f,p,d,m,g,v,y,k,w,x,b,S,_,C,M;n=t.state,r=t.next_in,C=t.input,i=r+(t.avail_in-5),o=t.next_out,M=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),l=n.dmax,h=n.wsize,c=n.whave,u=n.wnext,f=n.window,p=n.hold,d=n.bits,m=n.lencode,g=n.distcode,v=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;t:do{d<15&&(p+=C[r++]<<d,d+=8,p+=C[r++]<<d,d+=8),k=m[p&v];e:for(;;){if(p>>>=w=k>>>24,d-=w,0==(w=k>>>16&255))M[o++]=65535&k;else if(16&w){x=65535&k,(w&=15)&&(d<w&&(p+=C[r++]<<d,d+=8),x+=p&(1<<w)-1,p>>>=w,d-=w),d<15&&(p+=C[r++]<<d,d+=8,p+=C[r++]<<d,d+=8),k=g[p&y];n:for(;;){if(p>>>=w=k>>>24,d-=w,16&(w=k>>>16&255)){if(b=65535&k,d<(w&=15)&&(p+=C[r++]<<d,(d+=8)<w&&(p+=C[r++]<<d,d+=8)),(b+=p&(1<<w)-1)>l){t.msg="invalid distance too far back",n.mode=30;break t}if(p>>>=w,d-=w,b>(w=o-s)){if((w=b-w)>c&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=0,_=f,0===u){if(S+=h-w,w<x){x-=w;do M[o++]=f[S++];while(--w);S=o-b,_=M}}else if(u<w){if(S+=h+u-w,(w-=u)<x){x-=w;do M[o++]=f[S++];while(--w);if(S=0,u<x){x-=w=u;do M[o++]=f[S++];while(--w);S=o-b,_=M}}}else if(S+=u-w,w<x){x-=w;do M[o++]=f[S++];while(--w);S=o-b,_=M}for(;x>2;)M[o++]=_[S++],M[o++]=_[S++],M[o++]=_[S++],x-=3;x&&(M[o++]=_[S++],x>1&&(M[o++]=_[S++]))}else{S=o-b;do M[o++]=M[S++],M[o++]=M[S++],M[o++]=M[S++],x-=3;while(x>2);x&&(M[o++]=M[S++],x>1&&(M[o++]=M[S++]))}}else if((64&w)==0){k=g[(65535&k)+(p&(1<<w)-1)];continue n}else{t.msg="invalid distance code",n.mode=30;break t}break}}else if((64&w)==0){k=m[(65535&k)+(p&(1<<w)-1)];continue e}else if(32&w){n.mode=12;break t}else{t.msg="invalid literal/length code",n.mode=30;break t}break}}while(r<i&&o<a);r-=x=d>>3,d-=x<<3,p&=(1<<d)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=o<a?257+(a-o):257-(o-a),n.hold=p,n.bits=d}},{}],12:[function(t,e,n){"use strict";var r,i,o=t("../utils/common"),s=t("./adler32"),a=t("./crc32"),l=t("./inffast"),h=t("./inftrees");function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new o.Buf32(852),e.distcode=e.distdyn=new o.Buf32(592),e.sane=1,e.back=-1,0):-2}function p(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,f(t)):-2}function d(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?-2:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,p(t)):-2}function m(t,e){var n,r;return t?(r=new u,t.state=r,r.window=null,0!==(n=d(t,e))&&(t.state=null),n):-2}var g=!0;function v(t,e,n,r){var i,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new o.Buf8(s.wsize)),r>=s.wsize?(o.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((i=s.wsize-s.wnext)>r&&(i=r),o.arraySet(s.window,e,n-r,i,s.wnext),(r-=i)?(o.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0}n.inflateReset=p,n.inflateReset2=d,n.inflateResetKeep=f,n.inflateInit=function(t){return m(t,15)},n.inflateInit2=m,n.inflate=function(t,e){var n,u,f,p,d,m,y,k,w,x,b,S,_,C,M,E,O,A,I,R,T,N,z,F,B=0,j=new o.Buf8(4),$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return -2;12===(n=t.state).mode&&(n.mode=13),d=t.next_out,f=t.output,y=t.avail_out,p=t.next_in,u=t.input,m=t.avail_in,k=n.hold,w=n.bits,x=m,b=y,N=0;r:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;w<16;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(2&n.wrap&&35615===k){n.check=0,j[0]=255&k,j[1]=k>>>8&255,n.check=a(n.check,j,2,0),k=0,w=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&k)<<8)+(k>>8))%31){t.msg="incorrect header check",n.mode=30;break}if((15&k)!=8){t.msg="unknown compression method",n.mode=30;break}if(k>>>=4,w-=4,T=(15&k)+8,0===n.wbits)n.wbits=T;else if(T>n.wbits){t.msg="invalid window size",n.mode=30;break}n.dmax=1<<T,t.adler=n.check=1,n.mode=512&k?10:12,k=0,w=0;break;case 2:for(;w<16;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(n.flags=k,(255&n.flags)!=8){t.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=k>>8&1),512&n.flags&&(j[0]=255&k,j[1]=k>>>8&255,n.check=a(n.check,j,2,0)),k=0,w=0,n.mode=3;case 3:for(;w<32;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.head&&(n.head.time=k),512&n.flags&&(j[0]=255&k,j[1]=k>>>8&255,j[2]=k>>>16&255,j[3]=k>>>24&255,n.check=a(n.check,j,4,0)),k=0,w=0,n.mode=4;case 4:for(;w<16;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.head&&(n.head.xflags=255&k,n.head.os=k>>8),512&n.flags&&(j[0]=255&k,j[1]=k>>>8&255,n.check=a(n.check,j,2,0)),k=0,w=0,n.mode=5;case 5:if(1024&n.flags){for(;w<16;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.length=k,n.head&&(n.head.extra_len=k),512&n.flags&&(j[0]=255&k,j[1]=k>>>8&255,n.check=a(n.check,j,2,0)),k=0,w=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((S=n.length)>m&&(S=m),S&&(n.head&&(T=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),o.arraySet(n.head.extra,u,p,S,T)),512&n.flags&&(n.check=a(n.check,u,S,p)),m-=S,p+=S,n.length-=S),n.length))break r;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===m)break r;S=0;do T=u[p+S++],n.head&&T&&n.length<65536&&(n.head.name+=String.fromCharCode(T));while(T&&S<m);if(512&n.flags&&(n.check=a(n.check,u,S,p)),m-=S,p+=S,T)break r}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===m)break r;S=0;do T=u[p+S++],n.head&&T&&n.length<65536&&(n.head.comment+=String.fromCharCode(T));while(T&&S<m);if(512&n.flags&&(n.check=a(n.check,u,S,p)),m-=S,p+=S,T)break r}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;w<16;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(k!==(65535&n.check)){t.msg="header crc mismatch",n.mode=30;break}k=0,w=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=12;break;case 10:for(;w<32;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}t.adler=n.check=c(k),k=0,w=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=d,t.avail_out=y,t.next_in=p,t.avail_in=m,n.hold=k,n.bits=w,2;t.adler=n.check=1,n.mode=12;case 12:if(5===e||6===e)break r;case 13:if(n.last){k>>>=7&w,w-=7&w,n.mode=27;break}for(;w<3;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}switch(n.last=1&k,w-=1,3&(k>>>=1)){case 0:n.mode=14;break;case 1:if(function(t){if(g){var e;
vendor: 4,138 bytes, line 11
11for(r=new o.Buf32(512),i=new o.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(h(1,t.lens,0,288,r,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;h(2,t.lens,0,32,i,0,t.work,{bits:5}),g=!1}t.lencode=r,t.lenbits=9,t.distcode=i,t.distbits=5}(n),n.mode=20,6===e){k>>>=2,w-=2;break r}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=30}k>>>=2,w-=2;break;case 14:for(k>>>=7&w,w-=7&w;w<32;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if((65535&k)!=(k>>>16^65535)){t.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&k,k=0,w=0,n.mode=15,6===e)break r;case 15:n.mode=16;case 16:if(S=n.length){if(S>m&&(S=m),S>y&&(S=y),0===S)break r;o.arraySet(f,u,p,S,d),m-=S,p+=S,y-=S,d+=S,n.length-=S;break}n.mode=12;break;case 17:for(;w<14;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(n.nlen=(31&k)+257,k>>>=5,w-=5,n.ndist=(31&k)+1,k>>>=5,w-=5,n.ncode=(15&k)+4,k>>>=4,w-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;w<3;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.lens[$[n.have++]]=7&k,k>>>=3,w-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},N=h(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,N){t.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;M=(B=n.lencode[k&(1<<n.lenbits)-1])>>>24,E=B>>>16&255,O=65535&B,!(M<=w);){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(O<16)k>>>=M,w-=M,n.lens[n.have++]=O;else{if(16===O){for(F=M+2;w<F;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(k>>>=M,w-=M,0===n.have){t.msg="invalid bit length repeat",n.mode=30;break}T=n.lens[n.have-1],S=3+(3&k),k>>>=2,w-=2}else if(17===O){for(F=M+3;w<F;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}k>>>=M,w-=M,T=0,S=3+(7&k),k>>>=3,w-=3}else{for(F=M+7;w<F;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}k>>>=M,w-=M,T=0,S=11+(127&k),k>>>=7,w-=7}if(n.have+S>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=30;break}for(;S--;)n.lens[n.have++]=T}}if(30===n.mode)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,z={bits:n.lenbits},N=h(1,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,N){t.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},N=h(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,N){t.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===e)break r;case 20:n.mode=21;case 21:if(m>=6&&y>=258){t.next_out=d,t.avail_out=y,t.next_in=p,t.avail_in=m,n.hold=k,n.bits=w,l(t,b),d=t.next_out,f=t.output,y=t.avail_out,p=t.next_in,u=t.input,m=t.avail_in,k=n.hold,w=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;M=(B=n.lencode[k&(1<<n.lenbits)-1])>>>24,E=B>>>16&255,O=65535&B,!(M<=w);){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(E&&(240&E)==0){for(A=M,I=E,R=O;M=(B=n.lencode[R+((k&(1<<A+I)-1)>>A)])>>>24,E=B>>>16&255,O=65535&B,!(A+M<=w);){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}k>>>=A,w-=A,n.back+=A}if(k>>>=M,w-=M,n.back+=M,n.length=O,0===E){n.mode=26;break}if(32&E){n.back=-1,n.mode=12;break}if(64&E){t.msg="invalid literal/length code",n.mode=30;break}n.extra=15&E,n.mode=22;case 22:if(n.extra){for(F=n.extra;w<F;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.length+=k&(1<<n.extra)-1,k>>>=n.extra,w-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;M=(B=n.distcode[k&(1<<n.distbits)-1])>>>24,E=B>>>16&255,O=65535&B,!(M<=w);){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if((240&E)==0){for(A=M,I=E,R=O;M=(B=n.distcode[R+((k&(1<<A+I)-1)>>A)])>>>24,E=B>>>16&255,O=65535&B,!(A+M<=w);){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}k>>>=A,w-=A,n.back+=A}if(k>>>=M,w-=M,n.back+=M,64&E){t.msg="invalid distance code",n.mode=30;break}n.offset=O,n.extra=15&E,n.mode=24;case 24:if(n.extra){for(F=n.extra;w<F;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}n.offset+=k&(1<<n.extra)-1,k>>>=n.extra,w-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===y)break r;if(S=b-y,n.offset>S){if((S=n.offset-S)>
11n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=30;break}S>n.wnext?(S-=n.wnext,_=n.wsize-S):_=n.wnext-S,S>n.length&&(S=n.length),C=n.window}else C=f,_=d-n.offset,S=n.length;S>y&&(S=y),y-=S,n.length-=S;do f[d++]=C[_++];while(--S);0===n.length&&(n.mode=21);break;case 26:if(0===y)break r;f[d++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;w<32;){if(0===m)break r;m--,k|=u[p++]<<w,w+=8}if(b-=y,t.total_out+=b,n.total+=b,b&&(t.adler=n.check=n.flags?a(n.check,f,b,d-b):s(n.check,f,b,d-b)),b=y,(n.flags?k:c(k))!==n.check){t.msg="incorrect data check",n.mode=30;break}k=0,w=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;w<32;){if(0===m)break r;m--,k+=u[p++]<<w,w+=8}if(k!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=30;break}k=0,w=0}n.mode=29;case 29:N=1;break r;case 30:N=-3;break r;case 31:return -4;default:return -2}return(t.next_out=d,t.avail_out=y,t.next_in=p,t.avail_in=m,n.hold=k,n.bits=w,(n.wsize||b!==t.avail_out&&n.mode<30&&(n.mode<27||4!==e))&&v(t,t.output,t.next_out,b-t.avail_out))?(n.mode=31,-4):(x-=t.avail_in,b-=t.avail_out,t.total_in+=x,t.total_out+=b,n.total+=b,n.wrap&&b&&(t.adler=n.check=n.flags?a(n.check,f,b,t.next_out-b):s(n.check,f,b,t.next_out-b)),t.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===x&&0===b||4===e)&&0===N&&(N=-5),N)},n.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},n.inflateGetHeader=function(t,e){var n;return t&&t.state&&(2&(n=t.state).wrap)!=0?(n.head=e,e.done=!1,0):-2},n.inflateSetDictionary=function(t,e){var n,r=e.length;return t&&t.state&&(0===(n=t.state).wrap||11===n.mode)?11===n.mode&&s(1,e,r,0)!==n.check?-3:v(t,e,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":5,"./adler32":7,"./crc32":9,"./inffast":11,"./inftrees":13}],13:[function(t,e,n){"use strict";var r=t("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,n,l,h,c,u,f){var p,d,m,g,v,y,k,w,x,b=f.bits,S=0,_=0,C=0,M=0,E=0,O=0,A=0,I=0,R=0,T=0,N=null,z=0,F=new r.Buf16(16),B=new r.Buf16(16),j=null,$=0;for(S=0;S<=15;S++)F[S]=0;for(_=0;_<l;_++)F[e[n+_]]++;for(M=15,E=b;M>=1&&0===F[M];M--);if(E>M&&(E=M),0===M)return h[c++]=20971520,h[c++]=20971520,f.bits=1,0;for(C=1;C<M&&0===F[C];C++);for(E<C&&(E=C),I=1,S=1;S<=15;S++)if(I<<=1,(I-=F[S])<0)return -1;if(I>0&&(0===t||1!==M))return -1;for(S=1,B[1]=0;S<15;S++)B[S+1]=B[S]+F[S];for(_=0;_<l;_++)0!==e[n+_]&&(u[B[e[n+_]]++]=_);if(0===t?(N=j=u,y=19):1===t?(N=i,z-=257,j=o,$-=257,y=256):(N=s,j=a,y=-1),T=0,_=0,S=C,v=c,O=E,A=0,m=-1,g=(R=1<<E)-1,1===t&&R>852||2===t&&R>592)return 1;for(;;){k=S-A,u[_]<y?(w=0,x=u[_]):u[_]>y?(w=j[$+u[_]],x=N[z+u[_]]):(w=96,x=0),p=1<<S-A,C=d=1<<O;do h[v+(T>>A)+(d-=p)]=k<<24|w<<16|x|0;while(0!==d);for(p=1<<S-1;T&p;)p>>=1;if(0!==p?(T&=p-1,T+=p):T=0,_++,0==--F[S]){if(S===M)break;S=e[n+u[_]]}if(S>E&&(T&g)!==m){for(0===A&&(A=E),v+=C,I=1<<(O=S-A);O+A<M&&!((I-=F[O+A])<=0);)O++,I<<=1;if(R+=1<<O,1===t&&R>852||2===t&&R>592)return 1;h[m=T&g]=E<<24|O<<16|v-c|0}}return 0!==T&&(h[v+T]=S-A<<24|4194304),f.bits=E,0}},{"../utils/common":5}],14:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],15:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[3])(3)},6857:function(t){t.exports=(function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var l=Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}
11var h=n[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,n,r)}return n[s].exports}for(var o=void 0,s=0;s<r.length;s++)i(r[s]);return i})({1:[function(t,e,n){"use strict";var r=t("pako/lib/deflate.js");e.exports=function(t){return r.deflateRaw(t,{level:9,to:"string"})}},{"pako/lib/deflate.js":4}],2:[function(t,e,n){"use strict";function r(t){return t<10?String.fromCharCode(48+t):(t-=10)<26?String.fromCharCode(65+t):(t-=26)<26?String.fromCharCode(97+t):0==(t-=26)?"-":1===t?"_":"?"}function i(t,e,n){return""+(r(63&t>>2)+r(63&((3&t)<<4|e>>4))+r(63&((15&e)<<2|n>>6))+r(63&(63&n)))}e.exports=function(t){for(var e="",n=0;n<t.length;n+=3)n+2===t.length?e+=i(t.charCodeAt(n),t.charCodeAt(n+1),0):n+1===t.length?e+=i(t.charCodeAt(n),0,0):e+=i(t.charCodeAt(n),t.charCodeAt(n+1),t.charCodeAt(n+2));return e}},{}],3:[function(t,e,n){"use strict";var r=t("./deflate"),i=t("./encode64");e.exports.encode=function(t){return i(r(t))}},{"./deflate":1,"./encode64":2}],4:[function(t,e,n){"use strict";var r=t("./zlib/deflate"),i=t("./utils/common"),o=t("./utils/strings"),s=t("./zlib/messages"),a=t("./zlib/zstream"),l=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=r.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(0!==c)throw Error(s[c]);if(n.header&&r.deflateSetHeader(this.strm,n.header),n.dictionary){if(e="string"==typeof n.dictionary?o.string2buf(n.dictionary):"[object ArrayBuffer]"===l.call(n.dictionary)?new Uint8Array(n.dictionary):n.dictionary,0!==(c=r.deflateSetDictionary(this.strm,e)))throw Error(s[c]);this._dict_set=!0}}function c(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(t,e){var n,s,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===l.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(h),a.next_out=0,a.avail_out=h),1!==(n=r.deflate(a,s))&&0!==n)return this.onEnd(n),this.ended=!0,!1;(0===a.avail_out||0===a.avail_in&&(4===s||2===s))&&("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==n);return 4===s?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):(2===s&&(this.onEnd(0),a.avail_out=0),!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=h,n.deflate=c,n.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},n.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":5,"./utils/strings":6,"./zlib/deflate":9,"./zlib/messages":10,"./zlib/zstream":12}],5:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n,r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var i in r)n=i,Object.prototype.hasOwnProperty.call(r,n)&&(t[i]=r[i])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray){t.set(e.subarray(n,n+r),i);return}for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,s;for(e=0,r=0,n=t.length;e<n;e++)r+=t[e].length;for(e=0,s=new Uint8Array(r),i=0,n=t.length;e<n;e++)o=t[e],s.set(o,i),i+=o.length;return s}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],6:[function(t,e,n){"use strict";var r=t("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new r.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,n.string2buf=function(t){var e,n,i,o,s,a=t.length,l=0;for(o=0;o<a;o++)(64512&(n=t.charCodeAt(o)))==55296&&o+1<a&&(64512&(i=t.charCodeAt(o+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(s=0,e=new r.Buf8(l),o=0;s<l;o++)(64512&(n=t.charCodeAt(o)))==55296&&o+1<a&&(64512&(i=t.charCodeAt(o+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},n.buf2binstring=function(t){return l(t,t.length)},n.binstring2buf=function(t){for(var e=new r.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,r,i,o,a=e||t.length,h=Array(2*a);for(r=0,n=0;n<a;){if((i=t[n++])<128){h[r++]=i;continue}if((o=s[i])>4){h[r++]=65533,n+=o-1;continue}for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&t[n++],o--;
11if(o>1){h[r++]=65533;continue}i<65536?h[r++]=i:(i-=65536,h[r++]=55296|i>>10&1023,h[r++]=56320|1023&i)}return l(h,r)},n.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&(192&t[n])==128;)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},{"./common":5}],7:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do o=o+(i=i+e[r++]|0)|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}},{}],8:[function(t,e,n){"use strict";var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();e.exports=function(t,e,n,i){var o=i+n;t^=-1;for(var s=i;s<o;s++)t=t>>>8^r[(t^e[s])&255];return -1^t}},{}],9:[function(t,e,n){"use strict";var r,i=t("../utils/common"),o=t("./trees"),s=t("./adler32"),a=t("./crc32"),l=t("./messages");function h(t,e){return t.msg=l[e],e}function c(t){return(t<<1)-(t>4?9:0)}function u(t){for(var e=t.length;--e>=0;)t[e]=0}function f(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(i.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,f(t.strm)}function d(t,e){t.pending_buf[t.pending++]=e}function m(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function g(t,e){var n,r,i=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,c=t.w_mask,u=t.prev,f=t.strstart+258,p=h[o+s-1],d=h[o+s];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(n=e)+s]!==d||h[n+s-1]!==p||h[n]!==h[o]||h[++n]!==h[o+1])continue;o+=2,n++;do;while(h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&h[++o]===h[++n]&&o<f);if(r=258-(f-o),o=f-258,r>s){if(t.match_start=e,s=r,r>=a)break;p=h[o+s-1],d=h[o+s]}}while((e=u[e&c])>l&&0!=--i);return s<=t.lookahead?s:t.lookahead}function v(t){var e,n,r,o,l,h=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=h+(h-262)){i.arraySet(t.window,t.window,h,h,0),t.match_start-=h,t.strstart-=h,t.block_start-=h,e=n=t.hash_size;do r=t.head[--e],t.head[e]=r>=h?r-h:0;while(--n);e=n=h;do r=t.prev[--e],t.prev[e]=r>=h?r-h:0;while(--n);o+=h}if(0===t.strm.avail_in)break;if(n=function(t,e,n,r){var o=t.avail_in;return(o>r&&(o=r),0===o)?0:(t.avail_in-=o,i.arraySet(e,t.input,t.next_in,o,n),1===t.state.wrap?t.adler=s(t.adler,e,o,n):2===t.state.wrap&&(t.adler=a(t.adler,e,o,n)),t.next_in+=o,t.total_in+=o,o)}(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=n,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function y(t,e){for(var n,r;;){if(t.lookahead<262){if(v(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-262&&(t.match_length=g(t,n)),t.match_length>=3){if(r=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask}else r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=t.strstart<2?t.strstart:2,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function k(t,e){for(var n,r,i;;){if(t.lookahead<262){if(v(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-262&&(t.match_length=g(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(p(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=o._tr_tally(t,0,t.window[t.strstart-1]))&&p(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return(t.match_available&&(r=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function w(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}function x(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),u(this.dyn_ltree),u(this.dyn_dtree),u(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),u(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),u(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):h(t,-2)}function S(t){var e,n=b(t);return 0===n&&((e=t.state).window_size=2*e.w_size,u(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function _(t,e,n,r,o,s){if(!t)return -2;var a=1;if(-1===e&&(e=6),r<0?(a=0,r=-r):r>
1115&&(a=2,r-=16),o<1||o>9||8!==n||r<8||r>15||e<0||e>9||s<0||s>4)return h(t,-2);8===r&&(r=9);var l=new x;return t.state=l,l.strm=t,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=s,l.method=n,S(t)}r=[new w(0,0,0,0,function(t,e){var n=65535;for(65535>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(v(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,p(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)}
vendor: 5,581 bytes, line 11
11),new w(4,4,8,4,y),new w(4,5,16,8,y),new w(4,6,32,32,y),new w(4,4,16,16,k),new w(8,16,32,32,k),new w(8,16,128,128,k),new w(8,32,128,256,k),new w(32,128,258,1024,k),new w(32,258,258,4096,k)],n.deflateInit=function(t,e){return _(t,e,8,15,8,0)},n.deflateInit2=_,n.deflateReset=S,n.deflateResetKeep=b,n.deflateSetHeader=function(t,e){return t&&t.state&&2===t.state.wrap?(t.state.gzhead=e,0):-2},n.deflate=function(t,e){if(!t||!t.state||e>5||e<0)return t?h(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return h(t,0===t.avail_out?-5:-2);if(i.strm=t,n=i.last_flush,i.last_flush=e,42===i.status){if(2===i.wrap)t.adler=0,d(i,31),d(i,139),d(i,8),i.gzhead?(d(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),d(i,255&i.gzhead.time),d(i,i.gzhead.time>>8&255),d(i,i.gzhead.time>>16&255),d(i,i.gzhead.time>>24&255),d(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),d(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(d(i,255&i.gzhead.extra.length),d(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=a(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(d(i,0),d(i,0),d(i,0),d(i,0),d(i,0),d(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),d(i,3),i.status=113);else{var n,i,s,l,g=8+(i.w_bits-8<<4)<<8;g|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=32),g+=31-g%31,i.status=113,m(i,g),0!==i.strstart&&(m(i,t.adler>>>16),m(i,65535&t.adler)),t.adler=1}}if(69===i.status){if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending!==i.pending_buf_size));)d(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73}if(73===i.status){if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,d(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91}if(91===i.status){if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),f(t),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,d(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>s&&(t.adler=a(t.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.status=103)}else i.status=103}if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&f(t),i.pending+2<=i.pending_buf_size&&(d(i,255&t.adler),d(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(f(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&c(e)<=c(n)&&4!==e)return h(t,-5);if(666===i.status&&0!==t.avail_in)return h(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var y=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(v(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var n,r,i,s,a=t.window;;){if(t.lookahead<=258){if(v(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=a[i=t.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){s=t.strstart+258;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);t.match_length=258-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(p(t,!1),0===t.strm.avail_out))return 1}return(t.insert=0,4===e)?(p(t,!0),0===t.strm.avail_out)?3:4:t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(i,e):r[i.level].func(i,e);if((3===y||4===y)&&(i.status=666),1===y||3===y)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===y&&(1===e?o._tr_align(i):5!==e&&(o._tr_stored_block(i,0,0,!1),3===e&&(u(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),f(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(d(i,255&t.adler),d(i,t.adler>>8&255),d(i,t.adler>>16&255),d(i,t.adler>>24&255),d(i,255&t.total_in),d(i,t.total_in>>8&255),d(i,t.total_in>>16&255),d(i,t.total_in>>24&255)):(m(i,t.adler>>>16),m(i,65535&t.adler)),f(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},n.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?h(t,-2):(t.state=null,113===e?h(t,-3):0):-2},n.deflateSetDictionary=function(t,e){var n,r,o,a,l,h,c,f,p=e.length;if(!t||!t.state||2===(a=(n=t.state).wrap)||1===a&&42!==n.status||n.lookahead)return -2;for(1===a&&(t.adler=s(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===a&&(u(n.head),n.strstart=0,n.block_start=0,n.insert=0),f=new i.Buf8(n.w_size),i.arraySet(f,e,p-n.w_size,n.w_size,0),e=f,p=n.w_size),l=t.avail_in,h=t.next_in,
11c=t.input,t.avail_in=p,t.next_in=0,t.input=e,v(n);n.lookahead>=3;){r=n.strstart,o=n.lookahead-2;do n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++;while(--o);n.strstart=r,n.lookahead=2,v(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=c,t.avail_in=l,n.wrap=a,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":5,"./adler32":7,"./crc32":8,"./messages":10,"./trees":11}],10:[function(t,e,n){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(t,e,n){"use strict";var r,i,o,s=t("../utils/common");function a(t){for(var e=t.length;--e>=0;)t[e]=0}var l=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],h=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=Array(576);a(f);var p=Array(60);a(p);var d=Array(512);a(d);var m=Array(256);a(m);var g=Array(29);a(g);var v=Array(30);function y(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?d[t]:d[256+(t>>>7)]}function x(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function b(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,x(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function S(t,e,n){b(t,n[2*e],n[2*e+1])}function _(t,e){var n=0;do n|=1&t,t>>>=1,n<<=1;while(--e>0);return n>>>1}function C(t,e,n){var r,i,o=Array(16),s=0;for(r=1;r<=15;r++)o[r]=s=s+n[r-1]<<1;for(i=0;i<=e;i++){var a=t[2*i+1];0!==a&&(t[2*i]=_(o[a]++,a))}}function M(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){t.bi_valid>8?x(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function O(t,e,n,r){var i=2*e,o=2*n;return t[i]<t[o]||t[i]===t[o]&&r[e]<=r[n]}function A(t,e,n){for(var r=t.heap[n],i=n<<1;i<=t.heap_len&&(i<t.heap_len&&O(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!O(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function I(t,e,n){var r,i,o,s,a=0;if(0!==t.last_lit)do r=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],i=t.pending_buf[t.l_buf+a],a++,0===r?S(t,i,e):(S(t,(o=m[i])+256+1,e),0!==(s=l[o])&&b(t,i-=g[o],s),S(t,o=w(--r),n),0!==(s=h[o])&&b(t,r-=v[o],s));while(a<t.last_lit);S(t,256,e)}function R(t,e){var n,r,i,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(n=0,t.heap_len=0,t.heap_max=573;n<l;n++)0!==o[2*n]?(t.heap[++t.heap_len]=h=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(i=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[i]=0,t.opt_len--,a&&(t.static_len-=s[2*i+1]);for(e.max_code=h,n=t.heap_len>>1;n>=1;n--)A(t,o,n);i=l;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,A(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,r,i,o,s,a,l=e.dyn_tree,h=e.max_code,c=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(l[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=l[2*l[2*(r=t.heap[n])+1]+1]+1)>d&&(o=d,m++),l[2*r+1]=o,!(r>h)&&(t.bl_count[o]++,s=0,r>=p&&(s=f[r-p]),a=l[2*r],t.opt_len+=a*(o+s),u&&(t.static_len+=a*(c[2*r+1]+s)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(r=t.bl_count[o];0!==r;)!((i=t.heap[--n])>h)&&(l[2*i+1]!==o&&(t.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),r--)}}(t,e),C(o,h,t.bl_count)}
11function T(t,e,n){var r,i,o=-1,s=e[1],a=0,l=7,h=4;for(0===s&&(l=138,h=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)i=s,s=e[(r+1)*2+1],++a<l&&i===s||(a<h?t.bl_tree[2*i]+=a:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,o=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))}function N(t,e,n){var r,i,o=-1,s=e[1],a=0,l=7,h=4;for(0===s&&(l=138,h=3),r=0;r<=n;r++)if(i=s,s=e[(r+1)*2+1],!(++a<l)||i!==s){if(a<h)do S(t,i,t.bl_tree);while(0!=--a);else 0!==i?(i!==o&&(S(t,i,t.bl_tree),a--),S(t,16,t.bl_tree),b(t,a-3,2)):a<=10?(S(t,17,t.bl_tree),b(t,a-3,3)):(S(t,18,t.bl_tree),b(t,a-11,7));a=0,o=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}}a(v);var z=!1;function F(t,e,n,r){var i;b(t,0+(r?1:0),3),E(i=t),x(i,n),x(i,~n),s.arraySet(i.pending_buf,i.window,e,n,i.pending),i.pending+=n}n._tr_init=function(t){z||(function(){var t,e,n,s,a,u=Array(16);for(s=0,n=0;s<28;s++)for(t=0,g[s]=n;t<1<<l[s];t++)m[n++]=s;for(m[n-1]=s,a=0,s=0;s<16;s++)for(t=0,v[s]=a;t<1<<h[s];t++)d[a++]=s;for(a>>=7;s<30;s++)for(t=0,v[s]=a<<7;t<1<<h[s]-7;t++)d[256+a++]=s;for(e=0;e<=15;e++)u[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,u[8]++;for(;t<=255;)f[2*t+1]=9,t++,u[9]++;for(;t<=279;)f[2*t+1]=7,t++,u[7]++;for(;t<=287;)f[2*t+1]=8,t++,u[8]++;for(C(f,287,u),t=0;t<30;t++)p[2*t+1]=5,p[2*t]=_(t,5);r=new y(f,l,257,286,15),i=new y(p,h,0,30,15),o=new y([],c,0,19,7)}(),z=!0),t.l_desc=new k(t.dyn_ltree,r),t.d_desc=new k(t.dyn_dtree,i),t.bl_desc=new k(t.bl_tree,o),t.bi_buf=0,t.bi_valid=0,M(t)},n._tr_stored_block=F,n._tr_flush_block=function(t,e,n,r){var i,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),R(t,t.l_desc),R(t,t.d_desc),s=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*u[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==e?F(t,e,n,r):4===t.strategy||o===i?(b(t,2+(r?1:0),3),I(t,f,p)):(b(t,4+(r?1:0),3),function(t,e,n,r){var i;for(b(t,e-257,5),b(t,n-1,5),b(t,r-4,4),i=0;i<r;i++)b(t,t.bl_tree[2*u[i]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),I(t,t.dyn_ltree,t.dyn_dtree)),M(t),r&&E(t)},n._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[(m[n]+256+1)*2]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},n._tr_align=function(t){var e;b(t,2,3),S(t,256,f),16===(e=t).bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":5}],12:[function(t,e,n){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[3])(3)},2812:function(){Prism.languages.clojure={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},char:/\\\w+/,symbol:{pattern:/(^|[\s()\[\]{},])::?[\w*+!?'<>=/.-]+/,lookbehind:!0},keyword:{pattern:/(\()(?:-|->|->>|\.|\.\.|\*|\/|\+|<|<=|=|==|>|>=|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|cond|conj|cons|constantly|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|declare|def|def-|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defproject|defprotocol|defrecord|defstruct|deftype|deref|difference|disj|dissoc|distinct|do|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|fn|fnseq|for|frest|gensym|get|get-proxy-class|hash-map|hash-set|identical\?|identity|if|if-let|if-not|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|let|line-seq|list|list\*|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|monitor-enter|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|quote|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|recur|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|set!|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|throw|time|to-array|to-array-2d|tree-seq|true\?|try|union|up|update-proxy|val|vals|var|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[\s)]|$)/,lookbehind:!0},boolean:/\b(?:false|nil|true)\b/,number:{pattern:/(^|[^\w$@])(?:\d+(?:[/.]\d+)?(?:e[+-]?\d+)?|0x[a-f0-9]+|[1-9]\d?r[a-z0-9]+)[lmn]?(?![\w$@])/i,lookbehind:!0},function:{pattern:/((?:^|[^'])\()[\w*+!?'<>=/.-]+(?=[\s)]|$)/,lookbehind:!0},operator:/[#@^`~]/,punctuation:/[{}\[\](),]/}},5660:function(t,e,n){/**
12 * Prism: Lightweight, robust, elegant syntax highlighting
13 *
14 * @license MIT <https://opensource.org/licenses/MIT>
15 * @author Lea Verou <https://lea.verou.me>
16 * @namespace
17 * @public
18 */var r,i,o,s=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(e){return e instanceof o?new o(e.type,t(e.content),e.alias):Array.isArray(e)?e.map(t):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++n}),t.__id},clone:function t(e,n){var r,o;switch(n=n||{},i.util.type(e)){case"Object":if(n[o=i.util.objId(e)])return n[o];for(var s in r={},n[o]=r,e)e.hasOwnProperty(s)&&(r[s]=t(e[s],n));return r;case"Array":if(n[o=i.util.objId(e)])return n[o];return r=[],n[o]=r,e.forEach(function(e,i){r[i]=t(e,n)}),r;default:return e}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw Error()}catch(r){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(t){var e=document.getElementsByTagName("script");for(var n in e)if(e[n].src==t)return e[n]}return null}},isActive:function(t,e,n){for(var r="no-"+e;t;){var i=t.classList;if(i.contains(e))return!0;if(i.contains(r))return!1;t=t.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(t,e){var n=i.util.clone(i.languages[t]);for(var r in e)n[r]=e[r];return n},insertBefore:function(t,e,n,r){var o=(r=r||i.languages)[t],s={};for(var a in o)if(o.hasOwnProperty(a)){if(a==e)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(a)||(s[a]=o[a])}var h=r[t];
18return r[t]=s,i.languages.DFS(i.languages,function(e,n){n===h&&e!=t&&(this[e]=s)}),s},DFS:function t(e,n,r,o){o=o||{};var s=i.util.objId;for(var a in e)if(e.hasOwnProperty(a)){n.call(e,a,e[a],r||a);var l=e[a],h=i.util.type(l);"Object"!==h||o[s(l)]?"Array"!==h||o[s(l)]||(o[s(l)]=!0,t(l,n,a,o)):(o[s(l)]=!0,t(l,n,null,o))}}},plugins:{},highlightAll:function(t,e){i.highlightAllUnder(document,t,e)},highlightAllUnder:function(t,e,n){var r={callback:n,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var o,s=0;o=r.elements[s++];)i.highlightElement(o,!0===e,r.callback)},highlightElement:function(e,n,r){var o=i.util.getLanguage(e),s=i.languages[o];i.util.setLanguage(e,o);var a=e.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,o);var l=e.textContent,h={element:e,language:o,grammar:s,code:l};function c(t){h.highlightedCode=t,i.hooks.run("before-insert",h),h.element.innerHTML=h.highlightedCode,i.hooks.run("after-highlight",h),i.hooks.run("complete",h),r&&r.call(h.element)}if(i.hooks.run("before-sanity-check",h),(a=h.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!h.code){i.hooks.run("complete",h),r&&r.call(h.element);return}if(i.hooks.run("before-highlight",h),!h.grammar){c(i.util.encode(h.code));return}if(n&&t.Worker){var u=new Worker(i.filename);u.onmessage=function(t){c(t.data)},u.postMessage(JSON.stringify({language:h.language,code:h.code,immediateClose:!0}))}else c(i.highlight(h.code,h.grammar,h.language))},highlight:function(t,e,n){var r={code:t,grammar:e,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),o.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(t,e){var n=e.rest;if(n){for(var r in n)e[r]=n[r];delete e.rest}var h=new a;return l(h,h.head,t),function t(e,n,r,a,h,c){for(var u in r)if(r.hasOwnProperty(u)&&r[u]){var f=r[u];f=Array.isArray(f)?f:[f];for(var p=0;p<f.length;++p){if(c&&c.cause==u+","+p)return;var d=f[p],m=d.inside,g=!!d.lookbehind,v=!!d.greedy,y=d.alias;if(v&&!d.pattern.global){var k=d.pattern.toString().match(/[imsuy]*$/)[0];d.pattern=RegExp(d.pattern.source,k+"g")}for(var w=d.pattern||d,x=a.next,b=h;x!==n.tail&&(!c||!(b>=c.reach));b+=x.value.length,x=x.next){var S,_=x.value;if(n.length>e.length)return;if(!(_ instanceof o)){var C=1;if(v){if(!(S=s(w,b,e,g))||S.index>=e.length)break;var M=S.index,E=S.index+S[0].length,O=b;for(O+=x.value.length;M>=O;)O+=(x=x.next).value.length;if(O-=x.value.length,b=O,x.value instanceof o)continue;for(var A=x;A!==n.tail&&(O<E||"string"==typeof A.value);A=A.next)C++,O+=A.value.length;C--,_=e.slice(b,O),S.index-=b}else if(!(S=s(w,0,_,g)))continue;var M=S.index,I=S[0],R=_.slice(0,M),T=_.slice(M+I.length),N=b+_.length;c&&N>c.reach&&(c.reach=N);var z=x.prev;R&&(z=l(n,z,R),b+=R.length),function(t,e,n){for(var r=e.next,i=0;i<n&&r!==t.tail;i++)r=r.next;e.next=r,r.prev=e,t.length-=i}(n,z,C);var F=new o(u,m?i.tokenize(I,m):I,y,I);if(x=l(n,z,F),T&&l(n,x,T),C>1){var B={cause:u+","+p,reach:N};t(e,n,r,x.prev,b,B),c&&B.reach>c.reach&&(c.reach=B.reach)}}}}}}(t,h,e,h.head,0),function(t){for(var e=[],n=t.head.next;n!==t.tail;)e.push(n.value),n=n.next;return e}(h)},hooks:{all:{},add:function(t,e){var n=i.hooks.all;n[t]=n[t]||[],n[t].push(e)},run:function(t,e){var n=i.hooks.all[t];if(n&&n.length)for(var r,o=0;r=n[o++];)r(e)}},Token:o};function o(t,e,n,r){this.type=t,this.content=e,this.alias=n,this.length=0|(r||"").length}function s(t,e,n,r){t.lastIndex=e;var i=t.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function a(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function l(t,e,n){var r=e.next,i={value:n,prev:e,next:r};return e.next=i,r.prev=i,t.length++,i}if(t.Prism=i,o.stringify=function t(e,n){if("string"==typeof e)return e;if(Array.isArray(e)){var r="";return e.forEach(function(e){r+=t(e,n)}),r}var o={type:e.type,content:t(e.content,n),tag:"span",classes:["token",e.type],attributes:{},language:n},s=e.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(o.classes,s):o.classes.push(s)),i.hooks.run("wrap",o);var a="";for(var l in o.attributes)a+=" "+l+'="'+(o.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+o.tag+' class="'+o.classes.join(" ")+'"'+a+">"+o.content+"</"+o.tag+">"},!t.document)return t.addEventListener&&(i.disableWorkerMessageHandler||t.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,o=n.code,s=n.immediateClose;t.postMessage(i.highlight(o,i.languages[r],r)),s&&t.close()},!1)),i;var h=i.util.currentScript();function c(){i.manual||i.highlightAll()}if(h&&(i.filename=h.src,h.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var u=document.readyState;"loading"===u||"interactive"===u&&h&&h.defer?document.addEventListener("DOMContentLoaded",c):window.requestAnimationFrame?window.requestAnimationFrame(c):window.setTimeout(c,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});t.exports&&(t.exports=s),void 0!==n.g&&(n.g.Prism=s),s.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>
18\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},s.languages.markup.tag.inside["attr-value"].inside.entity=s.languages.markup.entity,s.languages.markup.doctype.inside["internal-subset"].inside=s.languages.markup,s.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(s.languages.markup.tag,"addInlined",{value:function(t,e){var n={};n["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:s.languages[e]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+e]={pattern:/[\s\S]+/,inside:s.languages[e]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:r},s.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(s.languages.markup.tag,"addAttribute",{value:function(t,e){s.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:s.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),s.languages.html=s.languages.markup,s.languages.mathml=s.languages.markup,s.languages.svg=s.languages.markup,s.languages.xml=s.languages.extend("markup",{}),s.languages.ssml=s.languages.xml,s.languages.atom=s.languages.xml,s.languages.rss=s.languages.xml,i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,(r=s).languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css,(o=r.languages.markup)&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css")),s.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},s.languages.javascript=s.languages.extend("clike",{"class-name":[s.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|")+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?
18:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),s.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,s.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:s.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:s.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:s.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:s.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:s.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),s.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:s.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),s.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),s.languages.markup&&(s.languages.markup.tag.addInlined("script","javascript"),s.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),s.languages.js=s.languages.javascript,function(){if(void 0!==s&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},e="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+e+'="'+r+'"]):not(['+e+'="'+n+'"])';s.hooks.add("before-highlightall",function(t){t.selector+=", "+i}),s.hooks.add("before-sanity-check",function(o){var a=o.element;if(a.matches(i)){o.code="",a.setAttribute(e,n);var l,h,c,u=a.appendChild(document.createElement("CODE"));u.textContent="Loading…";var f=a.getAttribute("data-src"),p=o.language;if("none"===p){var d=(/\.(\w+)$/.exec(f)||[,"none"])[1];p=t[d]||d}s.util.setLanguage(u,p),s.util.setLanguage(a,p);var m=s.plugins.autoloader;m&&m.loadLanguages(p),l=function(t){a.setAttribute(e,r);var n=function(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var n=Number(e[1]),r=e[2],i=e[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(a.getAttribute("data-range"));if(n){var i=t.split(/\r\n?|\n/g),o=n[0],l=null==n[1]?i.length:n[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),t=i.slice(o,l).join("\n"),a.hasAttribute("data-start")||a.setAttribute("data-start",String(o+1))}u.textContent=t,s.highlightElement(u)},h=function(t){a.setAttribute(e,"failed"),u.textContent=t},(c=new XMLHttpRequest).open("GET",f,!0),c.onreadystatechange=function(){4==c.readyState&&(c.status<400&&c.responseText?l(c.responseText):c.status>=400?h("✖ Error "+c.status+" while fetching file: "+c.statusText):h("✖ Error: File does not exist or is empty"))},c.send(null)}}),s.plugins.fileHighlight={highlight:function(t){for(var e,n=(t||document).querySelectorAll(i),r=0;e=n[r++];)s.highlightElement(e)}};var o=!1;s.fileHighlight=function(){o||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),o=!0),s.plugins.fileHighlight.highlight.apply(this,arguments)}}}()},6586:function(t){"use strict";function e(t){this.content=t}e.prototype={constructor:e,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(r||t,n):(s[o+1]=n,r&&(s[o]=r)),new e(s)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,n,r),new e(o)}
18,forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=e.from(t)).size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=e.from(t)).size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)},t.exports=e},8665:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r(e)?e:String(e)}(i.key),i)}}var o,s,a,l=n(2391),h=n(2843),c=(o=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")})(this,t),this.match=e,this.match=e,this.handler="string"==typeof n?function(t,e,r,i){var o=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);o+=e[0].slice(s+e[1].length);var a=(r+=s)-i;a>0&&(o=e[0].slice(s-a,s)+o,r=i)}return t.tr.insertText(o,r,i)}:n,this.undoable=!1!==r.undoable,this.inCode=r.inCode||!1},s&&i(o.prototype,s),a&&i(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o);function u(t,e,n,r,i,o){if(t.composing)return!1;for(var s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,h=0;h<i.length;h++){var c=i[h];if(a.parent.type.spec.code){if(!c.inCode)continue}else if("only"===c.inCode)continue;var u=c.match.exec(l),f=u&&c.handler(s,u,e-(u[0].length-r.length),n);if(f)return c.undoable&&f.setMeta(o,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}var f=new c(/--$/,"—"),p=new c(/\.\.\.$/,"…"),d=new c(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),m=new c(/"$/,"”"),g=new c(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),v=new c(/'$/,"’");e.InputRule=c,e.closeDoubleQuote=m,e.closeSingleQuote=v,e.ellipsis=p,e.emDash=f,e.inputRules=function(t){var e=t.rules,n=new l.Plugin({state:{init:function(){return null},apply:function(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,i,o){return u(t,r,i,o,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout(function(){var r=t.state.selection.$cursor;r&&u(t,r.pos,r.pos,"",e,n)})}}},isInputRules:!0});return n},e.openDoubleQuote=d,e.openSingleQuote=g,e.smartQuotes=[d,m,g,v],e.textblockTypeInputRule=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new c(t,function(t,r,i,o){var s=t.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,a):null})},e.undoInputRule=function(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var i=n[r],o=void 0;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){for(var s=t.tr,a=o.transform,l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(o.text){var h=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,h))}else s.delete(o.from,o.to);e(s)}return!0}}return!1},e.wrappingInputRule=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return new c(t,function(t,i,o,s){var a=n instanceof Function?n(i):n,l=t.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&h.findWrapping(c,e,a);if(!u)return null;
18l.wrap(c,u);var f=l.doc.resolve(o-1).nodeBefore;return f&&f.type==e&&h.canJoin(l.doc,o-1)&&(!r||r(i,f))&&l.join(o-1),l})}},7354:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(6691),i=n(2391),o="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function s(t,e){var n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function a(t){var e=function(t){var e=Object.create(null);for(var n in t)e[function(t){var e,n,r,i,s=t.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(var l=0;l<s.length-1;l++){var h=s[l];if(/^(cmd|meta|m)$/i.test(h))i=!0;else if(/^a(lt)?$/i.test(h))e=!0;else if(/^(c|ctrl|control)$/i.test(h))n=!0;else if(/^s(hift)?$/i.test(h))r=!0;else if(/^mod$/i.test(h))o?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+h)}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(n)]=t[n];return e}(t);return function(t,n){var i,o=r.keyName(n),a=e[s(o,n)];if(a&&a(t.state,t.dispatch,t))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){var l=e[s(o,n,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=r.base[n.keyCode])&&i!=o){var h=e[s(i,n)];if(h&&h(t.state,t.dispatch,t))return!0}}return!1}}e.keydownHandler=a,e.keymap=function(t){return new i.Plugin({props:{handleKeyDown:a(t)}})}},9443:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function s(t){var e=h();return function(){var n,r=u(t);if(e){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}function l(t,e,n){return(l=h()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&c(i,n.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function c(t,e){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==f(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==f(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
18(t,"string");return"symbol"===f(e)?e:String(e)}(r.key),r)}}function m(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var g=n(6586),v=function(){function t(e,n){if(p(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r<e.length;r++)this.size+=e[r].nodeSize}return m(t,[{key:"nodesBetween",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,s=0;s<e;o++){var a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){var h=s+1;a.nodesBetween(Math.max(0,t-h),Math.min(a.content.size,e-h),n,r+h)}s=l}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,function(s,a){var l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l},0),i}},{key:"append",value:function(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new t(i,this.size+e.size)}},{key:"cut",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],i=0;if(n>e)for(var o=0,s=0;s<n;o++){var a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new t(r,i)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(t){var e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}},{key:"maybeChild",value:function(t){return this.content[t]||null}},{key:"forEach",value:function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}}},{key:"findDiffStart",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function t(e,n,r){for(var i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;var o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(var a=0;o.text[a]==s.text[a];a++)r++;return r}if(o.content.size||s.content.size){var l=t(o.content,s.content,r+1);if(null!=l)return l}r+=o.nodeSize}}(this,t,e)}},{key:"findDiffEnd",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size;return function t(e,n,r,i){for(var o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};var a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){for(var c=0,u=Math.min(a.text.length,l.text.length);c<u&&a.text[a.text.length-c-1]==l.text[l.text.length-c-1];)c++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){var f=t(a.content,l.content,r-1,i-1);if(f)return f}r-=h,i-=h}}(this,t,e,n)}},{key:"findIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t)return k(0,t);if(t==this.size)return k(this.content.length,t);if(t>this.size||t<0)throw RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return k(n+1,i);return k(n,r)}r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,i=0;i<e.length;i++){var o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new t(n||e,r)}},{key:"from",value:function(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),t}();v.empty=new v([],0);var y={index:0,offset:0};function k(t,e){return y.index=t,y.offset=e,y}function w(t,e){if(t===e)return!0;
18if(!(t&&"object"==f(t))||!(e&&"object"==f(e)))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!w(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!w(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}var x=function(){function t(e,n){p(this,t),this.type=e,this.attrs=n}return m(t,[{key:"addToSet",value:function(t){for(var e,n=!1,r=0;r<t.length;r++){var i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}},{key:"eq",value:function(t){return this==t||this.type==t.type&&w(this.attrs,t.attrs)}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw RangeError("There is no mark type ".concat(e.type," in this schema"));return n.create(e.attrs)}},{key:"sameSet",value:function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}},{key:"setFrom",value:function(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];var n=e.slice();return n.sort(function(t,e){return t.type.rank-e.type.rank}),n}}]),t}();x.none=[];var b=function(t){o(n,t);var e=s(n);function n(){return p(this,n),e.apply(this,arguments)}return m(n)}(a(Error)),S=function(){function t(e,n,r){p(this,t),this.content=e,this.openStart=n,this.openEnd=r}return m(t,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(e,n){var r=function t(e,n,r,i){var o=e.findIndex(n),s=o.index,a=o.offset,l=e.maybeChild(s);if(a==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var h=t(l.content,n-a-1,r);return h&&e.replaceChild(s,l.copy(h))}(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(e,n){return new t(function t(e,n,r){var i=e.findIndex(n),o=i.index,s=i.offset,a=e.maybeChild(o),l=e.findIndex(r),h=l.index,c=l.offset;if(s==n||a.isText){if(c!=r&&!e.child(h).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(o!=h)throw RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new t(v.fromJSON(e,n.content),r,i)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new t(e,r,i)}}]),t}();function _(t,e){if(!e.type.compatibleContent(t.type))throw new b("Cannot join "+e.type.name+" onto "+t.type.name)}function C(t,e,n){var r=t.node(n);return _(r,e.node(n)),r}function M(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}
18function E(t,e,n,r){var i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(M(t.nodeAfter,r),o++));for(var a=o;a<s;a++)M(i.child(a),r);e&&e.depth==n&&e.textOffset&&M(e.nodeBefore,r)}function O(t,e){return t.type.checkContent(e),t.copy(e)}function A(t,e,n){var r=[];return E(null,t,n,r),t.depth>n&&M(O(C(t,e,n+1),A(t,e,n+1)),r),E(e,null,n,r),new v(r)}S.empty=new S(v.empty,0,0);var I=function(){function t(e,n,r){p(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return m(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}},{key:"after",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i<t;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var t=this.parent,e=this.index();if(0==t.content.size)return x.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var i=n;n=r,r=i}for(var o=n.marks,s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||r&&o[s].isInSet(r.marks)||(o=o[s--].removeFromSet(o));return o}},{key:"marksAcross",value:function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new z(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos<this.pos?t:this}},{key:"toString",value:function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}}],[{key:"resolve",value:function(e,n){if(!(n>=0&&n<=e.content.size))throw RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,s=e;;){var a=s.content.findIndex(o),l=a.index,h=a.offset,c=o-h;if(r.push(s,l,i+h),!c||(s=s.child(l)).isText)break;o=c-1,i+=h+1}return new t(n,r,o)}},{key:"resolveCached",value:function(e,n){for(var r=0;r<R.length;r++){var i=R[r];if(i.pos==n&&i.doc==e)return i}var o=R[T]=t.resolve(e,n);return T=(T+1)%N,o}}]),t}(),R=[],T=0,N=12,z=function(){function t(e,n,r){p(this,t),this.$from=e,this.$to=n,this.depth=r}return m(t,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),t}(),F=Object.create(null),B=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x.none;p(this,t),this.type=e,this.attrs=n,this.marks=i,this.content=r||v.empty}return m(t,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}}
18,{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&w(this.attrs,e||t.defaultAttrs||F)&&x.sameSet(this.marks,n||x.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return S.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o),a=r.
18node(o).content.cut(r.pos-s,i.pos-s);return new S(a,r.depth-o,i.depth-o)}},{key:"replace",value:function(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new b("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new b("Inconsistent open depths");return function t(e,n,r,i){var o=e.index(i),s=e.node(i);if(o==n.index(i)&&i<e.depth-r.openStart){var a=t(e,n,r,i+1);return s.copy(s.content.replaceChild(o,a))}if(!r.content.size)return O(s,A(e,n,i));if(r.openStart||r.openEnd||e.depth!=i||n.depth!=i){var l=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(v.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e),h=l.start,c=l.end;return O(s,function t(e,n,r,i,o){var s=e.depth>o&&C(e,n,o+1),a=i.depth>o&&C(r,i,o+1),l=[];return E(null,e,o,l),s&&a&&n.index(o)==r.index(o)?(_(s,a),M(O(s,t(e,n,r,i,o+1)),l)):(s&&M(O(s,A(e,n,o+1)),l),E(n,r,o,l),a&&M(O(a,A(r,i,o+1)),l)),E(i,null,o,l),new v(l)}(e,h,c,n,i))}var u=e.parent,f=u.content;return O(u,f.cut(0,e.parentOffset).append(r.content).append(f.cut(n.parentOffset)))}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(t){return I.resolveCached(this,t)}},{key:"resolveNoCache",value:function(t){return I.resolve(this,t)}},{key:"rangeHasMark",value:function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,function(t){return n.isInSet(t.marks)&&(r=!0),!r}),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),$(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}},{key:"canReplaceWith",value:function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}},{key:"canAppend",value:function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}},{key:"check",value:function(){this.type.checkContent(this.content);for(var t=x.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!x.sameSet(t,this.marks))throw RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(t){return t.type.name})));this.content.forEach(function(t){return t.check()})}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(function(t){return t.toJSON()})),t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=v.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}]),t}();B.prototype.text=void 0;var j=function(t){o(n,t);var e=s(n);function n(t,r,i,o){var s;if(p(this,n),s=e.call(this,t,r,null,o),!i)throw RangeError("Empty text nodes are not allowed");return s.text=i,s}return m(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(t,e){return this.text.slice(t,e)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(t){return t==this.marks?this:new n(this.type,this.attrs,this.text,t)}},{key:"withText",value:function(t){return t==this.text?this:new n(this.type,this.attrs,t,this.marks)}},{key:"cut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t=i(u(n.prototype),"toJSON",this).call(this);return t.text=this.text,t}}]),n}(B);function $(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var L=function(){function t(e){p(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return m(t,[{key:"matchType",value:function(t){for(var e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}},{key:"matchFragment",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var t=0;t<this.next.length;t++){var e=this.next[t].type;if(!(e.isText||e.hasRequiredAttrs()))return e}return null}},{key:"compatible",value:function(t){for(var e=0;e<this.next.length;e++)for(var n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function i(o,s){var a=o.matchFragment(t,n);if(a&&(!e||a.validEnd))return v.from(s.map(function(t){return t.createAndFill()}));for(var l=0;l<o.next.length;l++){var h=o.next[l],c=h.type,u=h.next;if(!(c.isText||c.hasRequiredAttrs())&&-1==r.indexOf(u)){r.push(u);var f=i(u,s.concat(c));if(f)return f}}return null}(this,[])}},{key:"findWrapping",value:function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}},{key:"computeWrapping",value:function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(t)){for(var o=[],s=r;s.type;s=s.via)o.push(s.type);return o.reverse()}for(var a=0;a<i.next.length;a++){var l=i.next[a],h=l.type,c=l.next;h.isLeaf||h.hasRequiredAttrs()||h.name in e||r.type&&!c.validEnd||(n.push({match:h.contentMatch,type:h,via:r}),e[h.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(t){if(t>=this.next.length)throw RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return function e(n){t.push(n);for(var r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r}).join("\n")}}],[{key:"parse",value:function(e,n){var r,i,o=new D(e,n);if(null==o.next)return t.empty;var s=function t(e){var n=[];do n.push(function(e){var n=[];do n.push(function(e){for(var n=function(e){if(e.eat("(")){var n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=(function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var i=[];for(var o in n){var s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}});return e.pos++,1==r.length?r[0]:{type:"choice",exprs:r}}}(e);;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){var n=P(t),r=n;return t.eat(",")&&(r="}"!=t.next?P(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");var a=(r=function(t){var e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce(function(e,n){return e.concat(t(n,o))},[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],o);if(s==e.exprs.length-1)return a;i(a,o=n())}else if("star"==e.type){var l=n();return r(o,l),i(t(e.expr,l),l),[r(l)]}else if("plus"==e.type){var h=n();return i(t(e.expr,o),h),i(t(e.expr,h),h),[r(h)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){for(var c=o,u=0;u<e.min;u++){var f=n();i(t(e.expr,c),f),c=f}if(-1==e.max)i(t(e.expr,c),c);else for(var p=e.min;p<e.max;p++){var d=n();r(c,d),i(t(e.expr,c),d),c=d}return[r(c)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(function(t){return t.to=e})}}(s),i=Object.create(null),function t(e){var n=[];e.forEach(function(t){r[t].forEach(function(t){var e,i=t.term,o=t.to;if(i){for(var s=0;s<n.length;s++)n[s][0]==i&&(e=n[s][1]);
18q(r,o).forEach(function(t){e||n.push([i,e=[]]),-1==e.indexOf(t)&&e.push(t)})}})});for(var o=i[e.join(",")]=new L(e.indexOf(r.length-1)>-1),s=0;s<n.length;s++){var a=n[s][1].sort(J);o.next.push({type:n[s][0],next:i[a.join(",")]||t(a)})}return o}(q(r,0)));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var i=r[n],o=!i.validEnd,s=[],a=0;a<i.next.length;a++){var l=i.next[a],h=l.type,c=l.next;s.push(h.name),o&&!(h.isText||h.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,o),a}}]),t}();L.empty=new L(!0);var D=function(){function t(e,n){p(this,t),this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return m(t,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(t){return this.next==t&&(this.pos++||!0)}},{key:"err",value:function(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}]),t}();function P(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function J(t,e){return e-t}function q(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var s=i[o],a=s.term,l=s.to;a||-1!=n.indexOf(l)||e(l)}}(e),n.sort(J)}function H(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function W(t,e){var n=Object.create(null);for(var r in t){var i=e&&e[r];if(void 0===i){var o=t[r];if(o.hasDefault)i=o.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function U(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new K(t[n]);return e}var Z=function(){function t(e,n,r){p(this,t),this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=U(r.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}return m(t,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==L.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(t){return this==t||this.contentMatch.compatible(t.contentMatch)}},{key:"computeAttrs",value:function(t){return!t&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,t)}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw Error("NodeType.create can't construct text nodes");return new B(this,this.computeAttrs(t),v.from(e),x.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=v.from(e),this.checkContent(e),new B(this,this.computeAttrs(t),e,x.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=v.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e),o=i&&i.fillBefore(v.empty,!0);return o?new B(this,t,e.append(o),x.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(t){if(!this.validContent(t))throw RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}},{key:"allowsMarkType",value:function(t){return null==this.markSet||this.markSet.indexOf(t)>-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}},{key:"allowedMarks",value:function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:x.none:t}}
18],[{key:"compile",value:function(e,n){var r=Object.create(null);e.forEach(function(e,i){return r[e]=new t(e,n,i)});var i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}]),t}(),K=function(){function t(e){p(this,t),this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}return m(t,[{key:"isRequired",get:function(){return!this.hasDefault}}]),t}(),Y=function(){function t(e,n,r,i){p(this,t),this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=U(i.attrs),this.excluded=null;var o=H(this.attrs);this.instance=o?new x(this,o):null}return m(t,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new x(this,W(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]}},{key:"excludes",value:function(t){return this.excluded.indexOf(t)>-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),i=0;return e.forEach(function(e,o){return r[e]=new t(e,i++,n,o)}),r}}]),t}(),V=function(){function t(e){p(this,t),this.linebreakReplacement=null,this.cached=Object.create(null);var n=this.spec={};for(var r in e)n[r]=e[r];n.nodes=g.from(e.nodes),n.marks=g.from(e.marks||{}),this.nodes=Z.compile(this.spec.nodes,this),this.marks=Y.compile(this.spec.marks,this);var i=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");var s=this.nodes[o],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[a]||(i[a]=L.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet="_"==l?null:l?G(this,l.split(" ")):""!=l&&s.inlineContent?null:[]}for(var h in this.marks){var c=this.marks[h],u=c.spec.excludes;c.excluded=null==u?[c]:""==u?[]:G(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return m(t,[{key:"node",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof t)t=this.nodeType(t);else if(t instanceof Z){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new j(n,n.defaultAttrs,t,x.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeFromJSON",value:function(t){return B.fromJSON(this,t)}},{key:"markFromJSON",value:function(t){return x.fromJSON(this,t)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}]),t}();function G(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(var a in t.marks){var l=t.marks[a];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var Q=function(){function t(e,n){var r=this;p(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(function(t){null!=t.tag?r.tags.push(t):null!=t.style&&r.styles.push(t)}),this.normalizeLists=!this.tags.some(function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)})}return m(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ti(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ti(this,e,!0);return n.addAll(t,e.from,e.to),S.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i,o=this.tags[r];if(i=o.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,i)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs
18){var s=o.getAttrs(t);if(!1===s)continue;o.attrs=s||void 0}return o}}}},{key:"matchStyle",value:function(t,e,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i],s=o.style;if(0==s.indexOf(t)&&(!o.context||n.matchesContext(o.context))&&(!(s.length>t.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(o.getAttrs){var a=o.getAttrs(e);if(!1===a)continue;o.attrs=a||void 0}return o}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var i=e[r];if((null==i.priority?50:i.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach(function(t){n(t=to(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})};for(var i in t.marks)r(i);var o=function(e){var r=t.nodes[e].spec.parseDOM;r&&r.forEach(function(t){n(t=to(t)),t.node||t.ignore||t.mark||(t.node=e)})};for(var s in t.nodes)o(s);return e}},{key:"fromSchema",value:function(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}}]),t}(),X={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},te={ol:!0,ul:!0};function tn(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var tr=function(){function t(e,n,r,i,o,s,a){p(this,t),this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=x.none,this.stashMarks=[],this.match=s||(4&a?null:e.contentMatch)}return m(t,[{key:"findWrapping",value:function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(v.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}}return this.match.findWrapping(t.type)}},{key:"finish",value:function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=v.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(v.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}},{key:"popFromStashMark",value:function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}},{key:"applyPending",value:function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):function(t,e){var n,r=e.schema.nodes;for(var i in r)if(0!==(n=function(){var n=r[i];if(!n.allowsMarkType(t))return 0;var o=[];if(function t(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),s=i.type,a=i.next;if(s==e||0>o.indexOf(a)&&t(a))return!0}}(n.contentMatch))return{v:!0}}())&&n)return n.v}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!X.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}]),t}(),ti=function(){function t(e,n,r){p(this,t),this.parser=e,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,s=tn(null,n.preserveWhitespace,0)|(r?4:0);i=o?new tr(o.type,o.attrs,x.none,x.none,!0,n.topMatch||o.type.contentMatch,s):r?new tr(null,null,x.none,x.none,!0,null,s):new tr(e.schema.topNodeType,null,x.none,x.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return m(t,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}},{key:"withStyleRules",value:function(t,e){var n=t.style;if(!n||!n.length)return e();var i=this.readStyles(t.style);if(i){for(var o=function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,h=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){h=!0,i=t}
18finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return a}}(i,2)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(i,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=o[0],a=o[1],l=this.top,h=0;h<a.length;h++)this.removePendingMark(a[h],l);for(var c=0;c<s.length;c++)this.addPendingMark(s[c]);e();for(var u=0;u<s.length;u++)this.removePendingMark(s[u],l);for(var f=0;f<a.length;f++)this.addPendingMark(a[f])}}},{key:"addTextNode",value:function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}},{key:"addElement",value:function(t,e){var n,r=this,i=t.nodeName.toLowerCase();te.hasOwnProperty(i)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&te.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:tt.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var s,a=this.top,l=this.needsBlock;if(X.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}o&&o.skip?this.addAll(t):this.withStyleRules(t,function(){return r.addAll(t)}),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,function(){r.addElementByRule(t,o,!1===o.consuming?n:void 0)})}},{key:"leafFallback",value:function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(t){for(var e=this,n=x.none,r=x.none,i=0,o=t.length;i<o;i++)for(var s,a=t.item(i),l=void 0;0!==(s=function(i){var o=e.parser.matchStyle(a,t.getPropertyValue(a),e,i);return o?o.ignore?{v:null}:(o.clearMark?e.top.pendingMarks.concat(e.top.activeMarks).forEach(function(t){o.clearMark(t)&&(r=t.addToSet(r))}):n=e.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),!1!==o.consuming)?(l=i,0):void(l=i=o):(l=i,0)}(l));)if(s)return s.v;return[n,r]}},{key:"addElementByRule",value:function(t,e,n){var r,i,o,s=this;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));var a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(function(t){return s.insertNode(t)});else{var l=t;"string"==typeof e.contentElement?l=t.querySelector(e.contentElement):"function"==typeof e.contentElement?l=e.contentElement(t):e.contentElement&&(l=e.contentElement),this.findAround(t,l,!0),this.addAll(l)}r&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}},{key:"addAll",value:function(t,e,n){for(var r=e||0,i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}},{key:"findPlace",value:function(t){for(var e,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>
18o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0}},{key:"insertNode",value:function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}},{key:"enter",value:function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}},{key:"enterInner",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);var o=tn(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new tr(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}},{key:"findAround",value:function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}},{key:"matchesContext",value:function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function t(s,a){for(;s>=0;s--){var l=n[s];if(""==l){if(s==n.length-1||0==s)continue;for(;a>=o;a--)if(t(s-1,a))return!0;return!1}var h=a>0||0==a&&i?e.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!h||h.name!=l&&-1==h.groups.indexOf(l))return!1;a--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var i=r.popFromStashMark(t);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==e)break}}}]),t}();function to(t){var e={};for(var n in t)e[n]=t[n];return e}var ts=function(){function t(e,n){p(this,t),this.nodes=e,this.marks=n}return m(t,[{key:"serializeFragment",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=tl(n).createDocumentFragment());var i=r,o=[];return t.forEach(function(t){if(o.length||t.marks.length){for(var r=0,s=0;r<o.length&&s<t.marks.length;){var a=t.marks[s];if(!e.marks[a.type.name]){s++;continue}if(!a.eq(o[r][0])||!1===a.type.spec.spanning)break;r++,s++}for(;r<o.length;)i=o.pop()[1];for(;s<t.marks.length;){var l=t.marks[s++],h=e.serializeMark(l,t.isInline,n);h&&(o.push([l,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(e.serializeNodeInner(t,n))}),r}}
18,{key:"serializeNodeInner",value:function(e,n){var r=t.renderSpec(tl(n),this.nodes[e.type.name](e)),i=r.dom,o=r.contentDOM;if(o){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return i}},{key:"serializeNode",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[e.type.name];return i&&t.renderSpec(tl(r),i(e,n))}}],[{key:"renderSpec",value:function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:e.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o=n[0],s=o.indexOf(" ");s>0&&(i=o.slice(0,s),o=o.slice(s+1));var a=i?e.createElementNS(i,o):e.createElement(o),l=n[1],h=1;if(l&&"object"==f(l)&&null==l.nodeType&&!Array.isArray(l)){for(var c in h=2,l)if(null!=l[c]){var u=c.indexOf(" ");u>0?a.setAttributeNS(c.slice(0,u),c.slice(u+1),l[c]):a.setAttribute(c,l[c])}}for(var p=h;p<n.length;p++){var d=n[p];if(0===d){if(p<n.length-1||p>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var m=t.renderSpec(e,d,i),g=m.dom,v=m.contentDOM;if(a.appendChild(g),v){if(r)throw RangeError("Multiple content holes");r=v}}return{dom:a,contentDOM:r}}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=ta(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return ta(t.marks)}}]),t}();function ta(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tl(t){return t.document||window.document}e.ContentMatch=L,e.DOMParser=Q,e.DOMSerializer=ts,e.Fragment=v,e.Mark=x,e.MarkType=Y,e.Node=B,e.NodeRange=z,e.NodeType=Z,e.ReplaceError=b,e.ResolvedPos=I,e.Schema=V,e.Slice=S},2391:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=l(t);if(e){var o=l(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}
18Object.defineProperty(e,"__esModule",{value:!0});var f=n(9443),p=n(2843),d=Object.create(null),m=function(){function t(e,n,r){h(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new g(e.min(n),e.max(n))]}return u(t,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Slice.empty,n=e.content.lastChild,r=null,i=0;i<e.openEnd;i++)r=n,n=n.lastChild;for(var o=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var l=s[a],h=l.$from,c=l.$to,u=t.mapping.slice(o);t.replaceRange(u.map(h.pos),u.map(c.pos),a?f.Slice.empty:e),0==a&&M(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(t,e){for(var n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],s=o.$from,a=o.$to,l=t.mapping.slice(n),h=l.map(s.pos),c=l.map(a.pos);i?t.deleteRange(h,c):(t.replaceRangeWith(h,c,e),M(t,n,e.isInline?-1:1))}}},{key:"getBookmark",value:function(){return k.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new k(t):C(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?C(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):C(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new S(t.node(0))}},{key:"atStart",value:function(t){return C(t,t,0,0,1)||new S(t)}},{key:"atEnd",value:function(t){return C(t,t,t.content.size,t.childCount,-1)||new S(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");var n=d[e.type];if(!n)throw RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in d)throw RangeError("Duplicate use of selection JSON ID "+t);return d[t]=e,e.prototype.jsonID=t,e}}]),t}();m.prototype.visible=!0;var g=u(function t(e,n){h(this,t),this.$from=e,this.$to=n}),v=!1;function y(t){v||t.parent.inlineContent||(v=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var k=function(t){o(n,t);var e=a(n);function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return h(this,n),y(t),y(r),e.call(this,t,r)}return u(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return m.near(r);var i=t.resolve(e.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Slice.empty;if(i(l(n.prototype),"replace",this).call(this,t,e),e==f.Slice.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new w(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,e,r){var i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){var o=m.findFrom(e,r,!0)||m.findFrom(e,-r,!0);if(!o)return m.near(e,r);e=o.$head}return t.parent.inlineContent||(0==i?t=e:(t=(m.findFrom(t,-r,!0)||m.findFrom(t,r,!0)).$anchor).pos<e.pos==i<0||(t=e)),new n(t,e)}}]),n}(m);m.jsonID("text",k);var w=function(){function t(e,n){h(this,t),this.anchor=e,this.head=n}return u(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){return k.between(t.resolve(this.anchor),t.resolve(this.head))}}]),t}(),x=function(t){o(n,t);var e=a(n);function n(t){h(this,n);var r,i=t.nodeAfter,o=t.node(0).resolve(t.pos+i.nodeSize);return(r=e.call(this,t,o)).node=i,r}return u(n,[{key:"map",value:function(t,e){var r=e.mapResult(this.anchor),i=r.deleted,o=r.pos,s=t.resolve(o);return i?m.near(s):new n(s)}},{key:"content",value:function(){return new f.Slice(f.Fragment.from(this.node),0,0)}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new b(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new n(t.resolve(e.anchor))}},{key:"create",value:function(t,e){return new n(t.resolve(e))}},{key:"isSelectable",value:function(t){return!t.isText&&!1!==t.type.spec.selectable}}]),n}(m);x.prototype.visible=!1,m.jsonID("node",x);var b=function(){function t(e){h(this,t),this.anchor=e}return u(t,[{key:"map",value:function(e){var n=e.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new w(i,i):new t(i)}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&x.isSelectable(n)?new x(e):m.near(e)}}]),t}(),S=function(t){o(n,t);var e=a(n);function n(t){return h(this,n),e.call(this,t.resolve(0),t.resolve(t.content.size))}return u(n,[{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Slice.empty;if(e==f.Slice.empty){t.delete(0,t.doc.content.size);var r=m.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else i(l(n.prototype),"replace",this).call(this,t,e)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new n(t)}},{key:"eq",value:function(t){return t instanceof n}},{key:"getBookmark",value:function(){return _}}],[{key:"fromJSON",value:function(t){return new n(t)}}]),n}(m);m.jsonID("all",S);var _={map:function(){return this},resolve:function(t){return new S(t)}};function C(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return k.create(t,n);for(var s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){var a=e.child(s);if(a.isAtom){if(!o&&x.isSelectable(a))return x.create(t,n-(i<0?a.nodeSize:0))}else{var l=C(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function M(t,e,n){var r,i=t.steps.length-1;if(!(i<e)){var o=t.steps[i];(o instanceof p.ReplaceStep||o instanceof p.ReplaceAroundStep)&&(t.mapping.maps[i].forEac
18h(function(t,e,n,i){null==r&&(r=i)}),t.setSelection(m.near(t.doc.resolve(r),n)))}}var E=function(t){o(n,t);var e=a(n);function n(t){var r;return h(this,n),(r=e.call(this,t.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=t.selection,r.storedMarks=t.storedMarks,r}return u(n,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return f.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,e){i(l(n.prototype),"addStep",this).call(this,t,e),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||f.Mark.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(e);i=n==e?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(m.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(p.Transform);function O(t,e){return e&&t?t.bind(e):t}var A=u(function t(e,n,r){h(this,t),this.name=e,this.init=O(n.init,r),this.apply=O(n.apply,r)}),I=[new A("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new A("selection",{init:function(t,e){return t.selection||m.atStart(e.doc)},apply:function(t){return t.selection}}),new A("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new A("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],R=u(function t(e,n){var r=this;h(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=I.slice(),n&&n.forEach(function(t){if(r.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new A(t.key,t.spec.state,t))})}),T=function(){function t(e){h(this,t),this.config=e}return u(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}},{key:"applyTransaction",value:function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var s=this.config.plugins[o];if(s.spec.appendTransaction){var a=r?r[o].n:0,l=r?r[o].state:this,h=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}},{key:"applyInner",value:function(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");for(var n=new t(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new E(this)}},{key:"reconfigure",value:function(e){for(var n=new R(this.schema,e.plugins),r=n.fields,i=new t(n),o=0;o<r.length;o++){var s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}},{key:"toJSON",value:function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(function(t){return t.toJSON()})),t&&"object"==r(t))for(var n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");var i=t[n],o=i.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(i,this[i.key]))}return e}}],[{key:"create",value:function(e){for(var n=new R(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}},{key:"fromJSON",value:function(e,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");
18var i=new R(e.schema,e.plugins),o=new t(i);return i.fields.forEach(function(t){if("doc"==t.name)o.doc=f.Node.fromJSON(e.schema,n.doc);else if("selection"==t.name)o.selection=m.fromJSON(o.doc,n.selection);else if("storedMarks"==t.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(var i in r){var s=r[i],a=s.spec.state;if(s.key==t.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){o[t.name]=a.fromJSON.call(s,e,n[i],o);return}}o[t.name]=t.init(e,o)}}),o}}]),t}(),N=function(){function t(e){h(this,t),this.spec=e,this.props={},e.props&&function t(e,n,r){for(var i in e){var o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:F("plugin")}return u(t,[{key:"getState",value:function(t){return t[this.key]}}]),t}(),z=Object.create(null);function F(t){return t in z?t+"$"+ ++z[t]:(z[t]=0,t+"$")}var B=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";h(this,t),this.key=F(e)}return u(t,[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}]),t}();e.AllSelection=S,e.EditorState=T,e.NodeSelection=x,e.Plugin=N,e.PluginKey=B,e.Selection=m,e.SelectionRange=g,e.TextSelection=k,e.Transaction=E},2843:function(t,e,n){"use strict";function r(t){var e="function"==typeof Map?new Map:void 0;return(r=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return i(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}function i(t,e,n){return(i=l()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=l();return function(){var n,r=h(t);if(e){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,n)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==c(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==c(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
18(t,"string");return"symbol"===c(e)?e:String(e)}(r.key),r)}}function p(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var d=n(9443),m=function(){function t(e,n,r){u(this,t),this.pos=e,this.delInfo=n,this.recover=r}return p(t,[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),t}(),g=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return p(t,[{key:"recover",value:function(t){var e=0,n=65535&t;if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;var l=this.ranges[s+i],h=this.ranges[s+o],c=a+l;if(t<=c){var u=l?t==a?-1:t==c?1:e:e,f=a+r+(u<0?0:h);if(n)return f;var p=t==(e<0?a:c)?null:s/3+(t-a)*65536,d=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(d|=8),new m(f,d,p)}r+=h-l}return n?t+r:new m(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>t)break;var l=this.ranges[s+i];if(t<=a+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}},{key:"forEach",value:function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}},{key:"invert",value:function(){return new t(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(e){return 0==e?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}}]),t}();g.empty=new g([]);var v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;u(this,t),this.maps=e,this.mirror=n,this.from=r,this.to=i}return p(t,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new t(this.maps,this.mirror,e,n)}},{key:"copy",value:function(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}},{key:"getMirror",value:function(t){if(this.mirror){for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}},{key:"setMirror",value:function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}},{key:"appendMappingInverted",value:function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(t,e);if(null!=o.recover){var s=this.getMirror(i);if(null!=s&&s>i&&s<this.to){i=s,t=this.maps[s].recover(o.recover);continue}}
18r|=o.delInfo,t=o.pos}return n?t:new m(t,r,null)}}]),t}(),y=Object.create(null),k=function(){function t(){u(this,t)}return p(t,[{key:"getMap",value:function(){return g.empty}},{key:"merge",value:function(t){return null}}],[{key:"fromJSON",value:function(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");var n=y[e.stepType];if(!n)throw RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in y)throw RangeError("Duplicate use of step JSON ID "+t);return y[t]=e,e.prototype.jsonID=t,e}}]),t}(),w=function(){function t(e,n){u(this,t),this.doc=e,this.failed=n}return p(t,null,[{key:"ok",value:function(e){return new t(e,null)}},{key:"fail",value:function(e){return new t(null,e)}},{key:"fromReplace",value:function(e,n,r,i){try{return t.ok(e.replace(n,r,i))}catch(e){if(e instanceof d.ReplaceError)return t.fail(e.message);throw e}}}]),t}();function x(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var o=t.child(i);o.content.size&&(o=o.copy(x(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return d.Fragment.fromArray(r)}var b=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return p(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.no
18de(r.sharedDepth(this.to)),o=new d.Slice(x(n.content,function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t},i),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,o)}},{key:"invert",value:function(){return new S(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addMark",b);var S=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return p(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=new d.Slice(x(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))},t),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,r)}},{key:"invert",value:function(){return new b(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("removeMark",S);var _=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return p(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);if(e){var r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(var i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new n(this.pos,e.marks[i]);return new n(this.pos,this.mark)}}return new C(this.pos,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addNodeMark",_);var C=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return p(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new _(this.pos,this.mark):this}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);
18k.jsonID("removeNodeMark",C);var M=function(t){o(n,t);var e=a(n);function n(t,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return u(this,n),(o=e.call(this)).from=t,o.to=r,o.slice=i,o.structure=s,o}return p(n,[{key:"apply",value:function(t){return this.structure&&O(t,this.from,this.to)?w.fail("Structure replace would overwrite content"):w.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new g([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new n(e.pos,Math.max(e.pos,r.pos),this.slice)}},{key:"merge",value:function(t){if(!(t instanceof n)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var e=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,e,this.structure)}var r=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new n(e.from,e.to,d.Slice.fromJSON(t,e.slice),!!e.structure)}}]),n}(k);k.jsonID("replace",M);var E=function(t){o(n,t);var e=a(n);function n(t,r,i,o,s,a){var l,h=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return u(this,n),(l=e.call(this)).from=t,l.to=r,l.gapFrom=i,l.gapTo=o,l.slice=s,l.insert=a,l.structure=h,l}return p(n,[{key:"apply",value:function(t){if(this.structure&&(O(t,this.from,this.gapFrom)||O(t,this.gapTo,this.to)))return w.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return w.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?w.fromReplace(t,this.from,this.to,n):w.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new g([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var e=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||o>r.pos?null:new n(e.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(e.from,e.to,e.gapFrom,e.gapTo,d.Slice.fromJSON(t,e.slice),e.insert,!!e.structure)}}]),n}(k);function O(t,e,n){for(var r=t.resolve(e),i=n-e,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var s=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}return!1}function A(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=t.doc.nodeAt(e),s=[],a=e+1,l=0;l<o.childCount;l++){var h=o.child(l),c=a+h.nodeSize,u=r.matchType(h.type);if(u){r=u;for(var f=0;f<h.marks.length;f++)n.allowsMarkType(h.marks[f].type)||t.step(new S(a,c,h.marks[f]));if(i&&h.isText&&"pre"!=n.whitespace)for(var p=void 0,m=/\r?\n|\r/g,g=void 0;p=m.exec(h.text);)g||(g=new d.Slice(d.Fragment.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),s.push(new M(a+p.index,a+p.index+p[0].length,g))}else s.push(new M(a,c,d.Slice.empty));a=c}if(!r.validEnd){var v=r.fillBefore(d.Fragment.empty,!0);t.replace(a,a,new d.Slice(v,0,0))}for(var y=s.length-1;y>=0;y--)t.step(s[y])}function I(t){return{type:t,attrs:null}}function R(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function T(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a<r.node(s).childCount)break}return null}function N(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.Slice.empty;if(e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return z(i,o,r)?new M(e,n,r):new F(i,o,r).fit()}function z(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}k.jsonID("replaceAround",E);var F=function(){function t(e,n,r){u(this,t),this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=d.Fragment.empty;for(var i=0;i<=e.depth;
18i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(var s=e.depth;s>0;s--)this.placed=d.Fragment.from(e.node(s).copy(this.placed))}return p(t,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,s=r.depth,a=i.depth;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;var l=new d.Slice(o,s,a);return e>-1?new E(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new M(r.pos,i.pos,l):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){var i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(var o=1;o<=2;o++)for(var s=1==o?t:this.unplaced.openStart;s>=0;s--)for(var a=null,l=(s?(a=$(this.unplaced.content,s-1).firstChild).content:this.unplaced.content).firstChild,h=this.depth;h>=0;h--){var c=this.frontier[h],u=c.type,f=c.match,p=void 0,m=null;if(1==o&&(l?f.matchType(l.type)||(m=f.fillBefore(d.Fragment.from(l),!1)):a&&u.compatibleContent(a.type)))return{sliceDepth:s,frontierDepth:h,parent:a,inject:m};if(2==o&&l&&(p=f.findWrapping(l.type)))return{sliceDepth:s,frontierDepth:h,parent:a,wrap:p};if(a&&f.matchType(a.type))break}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=$(e,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new d.Slice(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=$(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new d.Slice(B(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new d.Slice(B(e,n,1),n,r)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var s=0;s<o.length;s++)this.openFrontierNode(o[s]);var a=this.unplaced,l=r?r.content:a.content,h=a.openStart-e,c=0,u=[],f=this.frontier[n],p=f.match,m=f.type;if(i){for(var g=0;g<i.childCount;g++)u.push(i.child(g));p=p.matchFragment(i)}for(var v=l.size+e-(a.content.size-a.openEnd);c<l.childCount;){var y=l.child(c),k=p.matchType(y.type);if(!k)break;(++c>1||0==h||y.content.size)&&(p=k,u.push(function t(e,n,r){if(n<=0)return e;var i=e.content;return n>1&&(i=i.replaceChild(0,t(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=e.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(d.Fragment.empty,!0)))),e.copy(i)}(y.mark(m.allowedMarks(y.marks)),1==c?h:0,c==l.childCount?v:-1)))}var w=c==l.childCount;w||(v=-1),this.placed=j(this.placed,n,d.Fragment.from(u)),this.frontier[n].match=p,w&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,b=l;x<v;x++){var S=b.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),b=S.content}this.unplaced=w?0==e?d.Slice.empty:new d.Slice(B(a.content,e-1,1),e-1,v<0?a.openEnd:e-1):new d.Slice(B(a.content,e,c),a.openStart,a.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return -1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!L(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(t){i:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=L(t,e,i,r,o);if(s){for(var a=e-1;a>=0;a--){var l=this.frontier[a],h=l.match,c=L(t,a,l.type,h,!0);if(!c||c.childCount)continue i}return{depth:e,fit:s,move:o?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=j(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;
18n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=j(this.placed,this.depth,d.Fragment.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(d.Fragment.empty,!0);t.childCount&&(this.placed=j(this.placed,this.frontier.length,t))}}]),t}();function B(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(B(t.firstChild.content,e-1,n)))}function j(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(j(t.lastChild.content,e-1,n)))}function $(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function L(t,e,n,r,i){var o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;var a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function D(t,e){for(var n=[],r=Math.min(t.depth,e.depth),i=r;i>=0;i--){var o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var P=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).pos=t,o.attr=r,o.value=i,o}return p(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at attribute step's position");var n=Object.create(null);for(var r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(i),0,e.isLeaf?0:1))}},{key:"getMap",value:function(){return g.empty}},{key:"invert",value:function(t){return new n(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new n(e.pos,e.attr,e.value)}}]),n}(k);k.jsonID("attr",P);var J=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).attr=t,i.value=r,i}return p(n,[{key:"apply",value:function(t){var e=Object.create(null);for(var n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;var r=t.type.create(e,t.content,t.marks);return w.ok(r)}},{key:"getMap",value:function(){return g.empty}},{key:"invert",value:function(t){return new n(this.attr,t.attrs[this.attr])}},{key:"map",value:function(t){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new n(e.attr,e.value)}}]),n}(k);k.jsonID("docAttr",J),e.TransformError=function(t){o(n,t);var e=a(n);function n(){return u(this,n),e.apply(this,arguments)}return p(n)}(r(Error)),e.TransformError=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n},e.TransformError.prototype=Object.create(Error.prototype),e.TransformError.prototype.constructor=e.TransformError,e.TransformError.prototype.name="TransformError";var q=function(){function t(e){u(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new v}return p(t,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var n=this.maybeStep(t);if(n.failed)throw new e.TransformError(n.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d.Slice.empty,r=N(this.doc,t,e,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new d.Slice(d.Fragment.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,d.Slice.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),o=t.doc.resolve(n);if(z(i,o,r))return t.step(new M(e,n,r));var s=D(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();var a=-(i.depth+1);s.unshift(a);for(var l=i.depth,h=i.pos-1;l>0;l--,h--){var c=i.node(l).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;s.indexOf(l)>-1?a=l:i.before(l)==h&&s.splice(1,0,-l)}for(var u=s.indexOf(a),f=[],p=r.openStart,m=r.content,g=0;;g++){var v=m.firstChild;if(f.push(v),g==r.openStart)break;m=v.content}for(var y=p-1;y>=0;y--){var k,w=f[y],x=(k=w.type).spec.defining||k.spec.definingForContent;if(x&&!w.sameMarkup(i.node(Math.abs(a)-1)))p=y;else if(x||!w.type.isTextblock)break}for(var b=r.openStart;b>=0;b--){var S=(b+p+1)%(r.openStart+1),_=f[S];if(_)for(var C=0;C<s.length;C++){var E=s[(C+u)%s.length],O=!0;E<0&&(O=!1,E=-E);var A=i.node(E-1),I=i.index(E-1);if(A.canReplaceWith(I,I,_.type,_.marks))return t.replace(i.before(E),O?o.after(E):n,new d.Slice(function t(e,n,r,i,o){if(n<r){var s=e.firstChild;e=e.replaceChild(0,s.copy(t(s.content,n+1,r,i,s)))}if(n>i){var a=o.contentMatchAt(0),l=a.fillBefore(e).append(e);e=l.append(a.matchFragment(l).fillBefore(d.Fragment.empty,!0))}return e}(r.content,0,r.openStart,S),S,r.openEnd))}}for(var R=t.steps.length,T=s.length-1;T>=0&&(t.replace(e,n,r),!(t.steps.length>R));T--){var N=s[T];N<0||(e=i.before(N),n=o.after(N))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){var i=T(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new d.Slice(d.Fragment.from(r),0,0))}(this,t,e,n),this}},{key:"deleteRange",value:function(t,e){return function(t,e,n){for(var r=t.doc.resolve(e),i=t.doc.resolve(n),o=D(r,i),s=0;s<o.length;s++){var a=o[s],l=s==o.length-1;if(l&&0==a||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(var h=1;h<=r.depth&&h<=i.depth;h++)if(e-r.start(h)==r.depth-h&&n>r.end(h)&&i.end(h)-n!=i.depth-h)return t.delete(r.before(h),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return function(t,e,n){for(var r=e.$from,i=e.$to,o=e.depth,s=r.before(o+1),a=i.after(o+1),l=s,h=a,c=d.Fragment.empty,u=0,f=o,p=!1;f>n;f--)p||r.index(f)>0?(p=!0,c=d.Fragment.from(r.node(f).copy(c)),u++):l--;for(var m=d.Fragment.empty,g=0,v=o,y=!1;v>n;v--)y||i.after(v+1)<i.end(v)?(y=!0,m=d.Fragment.from(i.node(v).copy(m)),g++):h++;t.step(new E(l,h,s,a,new d.Slice(c.append(m),u,g),c.size-u,!0))}(this,t,e),this}},{key:"join",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(t,e,n){var r=new M(e-n,e+n,d.Slice.empty,!0);t.step(r)}(this,t,e),this}},{key:"wrap",value:function(t,e){return function(t,e,n){for(var r=d.Fragment.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=d.Fragment.from(n[i].type.create(n[i].attrs,r))}var s=e.start,a=e.end;t.step(new E(s,a,s,a,new d.Slice(r,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return function(t,e,n,r,i){if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");var o=t.steps.length;t.doc.nodesBetween(e,n,function(e,n){if(e.isTextblock&&!e.hasMarkup(r,i)&&(s=t.doc,a=t.mapping.slice(o).map(n),h=(l=s.resolve(a)).index(),l.parent.canReplaceWith(h,h+1,r))){var s,a,l,h,c=null;if(r.schema.linebreakReplacement){var u="pre"==r.whitespace,f=!!r.contentMatch.matchType(r.schema.linebreakReplacement);u&&!f?c=!1:!u&&f&&(c=!0)}!1===c&&function(t,e,n,r){e.forEach(function(i,o){if(i.type==i.type.schema.linebreakReplacement){var s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text("\n"))}})}(t,e,n,o),A(t,t.mapping.slice(o).map(n,1),r,void 0,null===c);var p=t.mapping.slice(o),m=p.map(n,1),g=p.map(n+e.nodeSize,1);return t.step(new E(m,g,m+1,g-1,new d.Slice(d.Fragment.from(r.create(i,null,e.marks)),0,0),1,!0)),!0===c&&function(t,e,n,r){e.forEach(function(i,o){if(i.isText)for(var s,a=/\r?\n|\r/g;s=a.exec(i.text);){var l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}})}(t,e,n,o),!1}})}(this,t,e,n,r),this}},{key:"setNodeMarkup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return function(t,e,n,r,i){var o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||(n=o.type);var s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new E(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new d.Slice(d.Fragment.from(s),0,0),1,!0))}(this,t,e,n,r),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new P(t,e,n)),this}},{key:"setDocAttribute",value:function(t,e){return this.step(new J(t,e)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new _(t,e)),this}}
18,{key:"removeNodeMark",value:function(t,e){if(!(e instanceof d.Mark)){var n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new C(t,e)),this}},{key:"split",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),o=d.Fragment.empty,s=d.Fragment.empty,a=i.depth,l=i.depth-n,h=n-1;a>l;a--,h--){o=d.Fragment.from(i.node(a).copy(o));var c=r&&r[h];s=d.Fragment.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new M(e,e,new d.Slice(o.append(s),n,n),!0))}(this,t,e,n),this}},{key:"addMark",value:function(t,e,n){var r,i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,function(r,l,h){if(r.isInline){var c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){for(var u=Math.max(l,t),f=Math.min(l+r.nodeSize,e),p=n.addToSet(c),d=0;d<c.length;d++)c[d].isInSet(p)||(i&&i.to==u&&i.mark.eq(c[d])?i.to=f:s.push(i=new S(u,f,c[d])));o&&o.to==u?o.to=f:a.push(o=new b(u,f,n))}}}),s.forEach(function(t){return r.step(t)}),a.forEach(function(t){return r.step(t)}),this}},{key:"removeMark",value:function(t,e,n){var r,i,o;return r=this,i=[],o=0,r.doc.nodesBetween(t,e,function(r,s){if(r.isInline){o++;var a=null;if(n instanceof d.MarkType)for(var l,h=r.marks;l=n.isInSet(h);)(a||(a=[])).push(l),h=l.removeFromSet(h);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var c=Math.min(s+r.nodeSize,e),u=0;u<a.length;u++){for(var f=a[u],p=void 0,m=0;m<i.length;m++){var g=i[m];g.step==o-1&&f.eq(i[m].style)&&(p=g)}p?(p.to=c,p.step=o):i.push({style:f,from:Math.max(s,t),to:c,step:o})}}}
18),i.forEach(function(t){return r.step(new S(t.from,t.to,t.style))}),this}},{key:"clearIncompatible",value:function(t,e,n){return A(this,t,e,n),this}}]),t}();e.AddMarkStep=b,e.AddNodeMarkStep=_,e.AttrStep=P,e.DocAttrStep=J,e.MapResult=m,e.Mapping=v,e.RemoveMarkStep=S,e.RemoveNodeMarkStep=C,e.ReplaceAroundStep=E,e.ReplaceStep=M,e.Step=k,e.StepMap=g,e.StepResult=w,e.Transform=q,e.canJoin=function(t,e){var n=t.resolve(e),r=n.index();return R(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},e.canSplit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var a=i.depth-1,l=n-2;a>o;a--,l--){var h=i.node(a),c=i.index(a);if(h.type.spec.isolating)return!1;var u=h.content.cutByIndex(c,h.childCount),f=r&&r[l+1];f&&(u=u.replaceChild(0,f.type.create(f.attrs)));var p=r&&r[l]||h;if(!h.canReplace(c+1,h.childCount)||!p.type.validContent(u))return!1}var d=i.indexAfter(o),m=r&&r[0];return i.node(o).canReplaceWith(d,d,m?m.type:i.node(o+1).type)},e.dropPoint=function(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,h=r.index(a)+(l>0?1:0),c=r.node(a),u=!1;if(1==s)u=c.canReplace(h,h,i);else{var f=c.contentMatchAt(h).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(h,h,f[0])}if(u)return 0==l?r.pos:l<0?r.before(a+1):r.after(a+1)}return null},e.findWrapping=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(I).concat({type:e,attrs:n}).concat(o.map(I)):null},e.insertPoint=T,e.joinPoint=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=t.resolve(e),i=r.depth;;i--){var o=void 0,s=void 0,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&R(o,s)&&r.node(i).canReplace(a,a+1))return e;if(0==i)break;e=n<0?r.before(i):r.after(i)}},e.liftTarget=function(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null},e.replaceStep=N},6691:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});for(var n={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:"'"},r={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&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s=0;s<10;s++)n[48+s]=n[96+s]=String(s);for(var s=1;s<=24;s++)n[s+111]="F"+s;for(var s=65;s<=90;s++)n[s]=String.fromCharCode(s+32),r[s]=String.fromCharCode(s);for(var a in n)r.hasOwnProperty(a)||(r[a]=n[a]);e.base=n,e.keyName=function(t){var e=!(i&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||o&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?r:n)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e},e.shift=r},5804:function(t,e,n){"use strict";n.d(e,{NE:function(){return a},QF:function(){return A},QK:function(){return m},YR:function(){return F},Y_:function(){return f},td:function(){return x},uJ:function(){return E},uo:function(){return v},w9:function(){return O},ym:function(){return M}});var r,i=n(6560),o=n(2806),s=n(2376);let a=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),l=(t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}(t,n);if(!r)return!1;let a=u(r);if(!a){let n=r.blockRange(),o=n&&(0,i.k9)(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)}let l=a.nodeBefore;if(!l.type.spec.isolating&&b(t,a,e))return!0;
18if(0==r.parent.content.size&&(h(l,"end")||s.qv.isSelectable(l))){let n=(0,i.dR)(t.doc,r.before(),r.after(),o.p2.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(h(l,"end")?s.Y1.findFrom(r.doc.resolve(r.mapping.map(a.pos,-1)),-1):s.qv.create(r.doc,a.pos-l.nodeSize)),e(r.scrollIntoView())}return!0}}return!!l.isAtom&&a.depth==r.depth-1&&(e&&e(t.tr.delete(a.pos-l.nodeSize,a.pos).scrollIntoView()),!0)};function h(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let c=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=u(r)}let a=o&&o.nodeBefore;return!!(a&&s.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(s.qv.create(t.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function u(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}let f=(t,e,n)=>{let r=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}(t,n);if(!r)return!1;let a=d(r);if(!a)return!1;let l=a.nodeAfter;if(b(t,a,e))return!0;if(0==r.parent.content.size&&(h(l,"start")||s.qv.isSelectable(l))){let n=(0,i.dR)(t.doc,r.before(),r.after(),o.p2.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(h(l,"start")?s.Y1.findFrom(r.doc.resolve(r.mapping.map(a.pos)),1):s.qv.create(r.doc,r.mapping.map(a.pos))),e(r.scrollIntoView())}return!0}}return!!l.isAtom&&a.depth==r.depth-1&&(e&&e(t.tr.delete(a.pos,a.pos+l.nodeSize).scrollIntoView()),!0)},p=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=d(r)}let a=o&&o.nodeAfter;return!!(a&&s.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(s.qv.create(t.doc,o.pos)).scrollIntoView()),!0)};function d(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let m=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function g(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let v=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),a=g(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,a.createAndFill());i.setSelection(s.Y1.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0},y=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof s.C1||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=g(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(n,o.createAndFill());a.setSelection(s.Bs.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},k=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if((0,i.Ax)(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&(0,i.k9)(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},w=(t,e)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof s.qv&&t.selection.node.isBlock)return!!(n.parentOffset&&(0,i.Ax)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let a=o.parentOffset==o.parent.content.size,l=t.tr;(t.selection instanceof s.Bs||t.selection instanceof s.C1)&&l.deleteSelection();let h=0==n.depth?null:g(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=r&&r(o.parent,a),u=c?[c]:a&&h?[{type:h}]:void 0,f=(0,i.Ax)(l.doc,l.mapping.map(n.pos),1,u);if(!u&&!f&&(0,i.Ax)(l.doc,l.mapping.map(n.pos),1,h?[{type:h}]:void 0)&&(h&&(u=[{type:h}]),f=!0),f&&(l.split(l.mapping.map(n.pos),1,u),!a&&!n.parentOffset&&n.parent.type!=h)){let t=l.mapping.map(n.before()),e=l.doc.resolve(t);h&&n.node(-1).canReplaceWith(e.index(),e.index()+1,h)&&l.setNodeMarkup(l.mapping.map(n.before()),h)}e(l.scrollIntoView())}return!0},x=(t,e)=>(e&&e(t.tr.setSelection(new s.C1(t.doc))),!0);function b(t,e,n){let r,a,l,c=e.nodeBefore,u=e.nodeAfter,f,p;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(r=e.nodeBefore,a=e.nodeAfter,l=e.index(),r&&a&&r.type.compatibleContent(a.type)&&(!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!!(e.parent.canReplace(l,l+1)&&(a.isTextblock||(0,i.Mn)(t.doc,e.pos)))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)))return!0;let d=e.parent.canReplace(e.index(),e.index()+1);if(d&&(f=(p=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&p.matchType(f[0]||u.type).validEnd){if(n){let r=e.pos+u.nodeSize,s=o.HY.empty;for(let t=f.length-1;t>=0;t--)s=o.HY.from(f[t].create(null,s));s=o.HY.from(c.copy(s));let a=t.tr.step(new i.FC(e.pos-1,r,e.pos,r,new o.p2(s,1,0),f.length,!0)),l=r+2*f.length;(0,i.Mn)(a.doc,l)&&a.join(l),n(a.scrollIntoView())}return!0}let m=s.Y1.findFrom(e,1),g=m&&m.$from.blockRange(m.$to),v=g&&(0,i.k9)(g);if(null!=v&&v>=e.depth)return n&&n(t.tr.lift(g,v).scrollIntoView()),!0;if(d&&h(u,"start",!0)&&h(c,"end")){let r=c,s=[];for(;s.push(r),!r.isTextblock;)r=r.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=o.HY.empty;for(let t=s.length-1;t>=0;t--)r=o.HY.from(s[t].copy(r));n(t.tr.step(new i.FC(e.pos-s.length,e.pos+u.nodeSize,e.pos+l,e.pos+u.nodeSize-l,new o.p2(r,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function S(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(e.tr.setSelection(s.Bs.create(e.doc,t<0?i.start(o):i.end(o)))),!0)}}let _=S(-1),C=S(1);function M(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&(0,i.nd)(a,t,e);return!!l&&(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0)}}function E(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;
18if(!(!r.isTextblock||r.hasMarkup(t,e))){if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,t,e)}r(i.scrollIntoView())}return!0}}function O(t,e=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(t,e,n){for(let r=0;r<e.length;r++){let{$from:i,$to:o}=e[r],s=0==i.depth&&t.inlineContent&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,o.pos,t=>{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)}),s)return!0}return!1}(n.doc,s,t))return!1;if(r){if(o)r(t.isInSet(n.storedMarks||o.marks())?n.tr.removeStoredMark(t):n.tr.addStoredMark(t.create(e)));else{let i=!1,o=n.tr;for(let e=0;!i&&e<s.length;e++){let{$from:r,$to:o}=s[e];i=n.doc.rangeHasMark(r.pos,o.pos,t)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(i)o.removeMark(r.pos,a.pos,t);else{let n=r.pos,i=a.pos,s=r.nodeAfter,l=a.nodeBefore,h=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,c=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+h<i&&(n+=h,i-=c),o.addMark(n,i,t.create(e))}}r(o.scrollIntoView())}}return!0}}function A(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let I=A(a,l,c),R=A(a,f,p),T={Enter:A(m,y,k,w),"Mod-Enter":v,Backspace:I,"Mod-Backspace":I,"Shift-Backspace":I,Delete:R,"Mod-Delete":R,"Mod-a":x},N={"Ctrl-h":T.Backspace,"Alt-Backspace":T["Mod-Backspace"],"Ctrl-d":T.Delete,"Ctrl-Alt-Backspace":T["Mod-Delete"],"Alt-Delete":T["Mod-Delete"],"Alt-d":T["Mod-Delete"],"Ctrl-a":_,"Ctrl-e":C};for(let t in T)N[t]=T[t];let z="undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&!!os.platform&&"darwin"==os.platform(),F=z?N:T},6086:function(t,e,n){"use strict";n.d(e,{m8:function(){return k},KX:function(){return b},Yw:function(){return x},of:function(){return S}});var r=function(){};r.prototype.append=function(t){return t.length?(t=r.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},r.prototype.prepend=function(t){return t.length?r.from(t).append(this):this},r.prototype.appendInner=function(t){return new o(this,t)},r.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?r.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},r.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},r.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},r.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},r.from=function(t){return t instanceof r?t:t&&t.length?new i(t):r.empty};var i=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(r);r.empty=new i([]);var o=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(r),s=n(6560),a=n(2376);class l{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}e&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=t.tr,c=[],u=[];
18return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(s,e+1)).maps.length),r--,u.push(t);return}if(n){u.push(new h(t.map));let e=t.step.map(n.slice(r)),i;e&&a.maybeStep(e).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],c.push(new h(i,void 0,void 0,c.length+u.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,o=new l(this.items.slice(0,s).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(t,e,n,r){var i,o;let s,a=[],c=this.eventCount,f=this.items,p=!r&&f.length?f.get(f.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),o=new h(t.mapping.maps[n],i,e),s;(s=p&&p.merge(o))&&(o=s,n?a.pop():f=f.slice(0,f.length-1)),a.push(o),e&&(c++,e=void 0),r||(p=o)}let d=c-n.depth;return d>u&&(i=f,o=d,i.forEach((t,e)=>{if(t.selection&&0==o--)return s=e,!1}),f=i.slice(s),c-=d),new l(f.append(a),c)}remapping(t,e){let n=new s.vs;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new l(this.items.append(t.map(t=>new h(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&s++,n.push(new h(l,o,c))}else n.push(new h(l))},r);let c=[];for(let t=e;t<o;t++)c.push(new h(i.maps[t]));let u=this.items.slice(0,r).append(c).append(n),f=new l(u,s);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,i=[],o=0;return this.items.forEach((r,s)=>{if(s>=t)i.push(r),r.selection&&o++;else if(r.step){let t=r.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=r.selection&&r.selection.map(e.slice(n));a&&o++;let l=new h(s.invert(),t,a),c,u=i.length-1;(c=i.length&&i[u].merge(l))?i[u]=c:i.push(l)}}else r.map&&n--},this.items.length,0),new l(r.from(i.reverse()),o)}}l.empty=new l(r.empty,0);class h{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new h(e.getMap().invert(),e,this.selection)}}}class c{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let u=20;function f(t){let e=[];return t.forEach((t,n,r,i)=>e.push(r,i)),e}function p(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}let d=!1,m=null;function g(t){let e=t.plugins;if(m!=e){d=!1,m=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){d=!0;break}}return d}let v=new a.H$("history"),y=new a.H$("closeHistory");function k(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new a.Sy({key:v,state:{init:()=>new c(l.empty,l.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(v),o;if(i)return i.historyState;n.getMeta(y)&&(t=new c(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(v))return s.getMeta(v).redo?new c(t.done.addTransform(n,void 0,r,g(e)),t.undone,f(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new c(t.done,t.undone.addTransform(n,void 0,r,g(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new c(t.done.rebased(n,o),t.undone.rebased(n,o),p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new c(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),p(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
18return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),a=s?p(t.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new c(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,g(e)),l.empty,a,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?x:"historyRedo"==n?b:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function w(t,e){return(n,r)=>{let i=v.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let o=function(t,e,n){let r=g(e),i=v.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new c(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(v,{redo:n,historyState:l})}(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}let x=w(!1,!0),b=w(!0,!0);function S(t){let e=v.getState(t);return e?e.done.eventCount:0}w(!1,!1),w(!0,!1)},6912:function(t,e,n){"use strict";n.d(e,{Hw:function(){return o},VK:function(){return i},dU:function(){return a}});var r=n(2376);class i{constructor(t,e,n={}){this.match=t,this.match=t,this.handler="string"==typeof e?function(t,n,r,i){let o=e;if(n[1]){let t=n[0].lastIndexOf(n[1]);o+=n[0].slice(t+n[1].length);let e=(r+=t)-i;e>0&&(o=n[0].slice(t-e,t)+o,r=i)}return t.tr.insertText(o,r,i)}:e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function o({rules:t}){let e=new r.Sy({state:{init:()=>null,apply(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>s(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&s(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function s(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let h=0;h<i.length;h++){let c=i[h];if(a.parent.type.spec.code){if(!c.inCode)continue}else if("only"===c.inCode)continue;let u=c.match.exec(l),f=u&&c.handler(s,u,e-(u[0].length-r.length),n);if(f)return c.undoable&&f.setMeta(o,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}let a=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let n=t.tr,r=o.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1};new i(/--$/,"—"),new i(/\.\.\.$/,"…"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new i(/"$/,"”"),new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new i(/'$/,"’")},2696:function(t,e,n){"use strict";n.d(e,{h:function(){return f}});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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(var a=1;a<=24;a++)r[a+111]="F"+a;for(var a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in r)i.hasOwnProperty(l)||(i[l]=r[l]);var h=n(2376);let c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);
vendor: 4,647 bytes, line 18
18function u(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function f(t){let e;return new h.Sy({props:{handleKeyDown:(e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let t=0;t<o.length-1;t++){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))c?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=t[n];return e}(t),function(t,n){var a;let l=("Esc"==(a=!(o&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||s&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a),h,c=e[u(l,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=e[u(l,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(h=r[n.keyCode])&&h!=l){let r=e[u(h,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1})}})}},2806:function(t,e,n){"use strict";function r(t){this.content=t}n.d(e,{aw:function(){return L},PW:function(){return Z},HY:function(){return i},vc:function(){return l},ZU:function(){return B},NB:function(){return S},Ts:function(){return x},e4:function(){return h},V_:function(){return j},p2:function(){return c}}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var i=this.remove(e),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,e,n),new r(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,s=0;s<e;o++){let a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,r+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(s,a)=>{let l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let s=this.content[i],a=o+s.nodeSize;a>t&&((o<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=a}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)}addToStart(t){return new i([t].concat(this.content),this.size+t.no
18deSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){let e=t(a.content,l.content,r-1,i-1);if(e)return e}r-=h,i-=h}}(this,t,e,n)}findIndex(t,e=-1){if(0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let o={index:0,offset:0};function s(t,e){return o.index=t,o.offset=e,o}function a(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!a(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class l{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&a(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;
vendor: 5,543 bytes, line 18
18if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return l.none;if(t instanceof l)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}l.none=[];class h extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:o,offset:s}=e.findIndex(n),a=e.maybeChild(o);if(s==n||a.isText)return i&&!i.canReplace(o,o,r)?null:e.cut(0,n).append(r).append(e.cut(n));let l=t(a.content,n-s-1,r);return l&&e.replaceChild(o,a.copy(l))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:o}=e.findIndex(n),s=e.maybeChild(i),{index:a,offset:l}=e.findIndex(r);if(o==n||s.isText){if(l!=r&&!e.child(a).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=a)throw RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-o-1,r-o-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function u(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function f(t,e,n){let r=t.node(n);return u(r,e.node(n)),r}function p(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function d(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(p(t.nodeAfter,r),o++));for(let t=o;t<s;t++)p(i.child(t),r);e&&e.depth==n&&e.textOffset&&p(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function g(t,e,n){let r=[];return d(null,t,n,r),t.depth>n&&p(m(f(t,e,n+1),g(t,e,n+1)),r),d(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class v{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new x(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:o}=e.content.findIndex(i),s=i-o;if(n.push(e,t,r+o),!s||(e=e.child(t)).isText)break;
18i=s-1,r+=o+1}return new v(e,n,i)}static resolveCached(t,e){for(let n=0;n<y.length;n++){let r=y[n];if(r.pos==e&&r.doc==t)return r}let n=y[k]=v.resolve(t,e);return k=(k+1)%w,n}}let y=[],k=0,w=12;class x{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let b=Object.create(null);class S{constructor(t,e,n,r=l.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&a(this.attrs,e||t.defaultAttrs||b)&&l.sameSet(this.marks,n||l.none)}copy(t=null){return t==this.content?this:new S(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new S(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return c.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o),a=r.
18node(o).content.cut(r.pos-s,i.pos-s);return new c(a,r.depth-o,i.depth-o)}replace(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,o){let s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){let i=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,i))}if(!r.content.size)return m(a,g(e,n,o));if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){let{start:t,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(a,function t(e,n,r,o,s){let a=e.depth>s&&f(e,n,s+1),l=o.depth>s&&f(r,o,s+1),h=[];return d(null,e,s,h),a&&l&&n.index(s)==r.index(s)?(u(a,l),p(m(a,t(e,n,r,o,s+1)),h)):(a&&p(m(a,g(e,n,s+1)),h),d(n,r,s,h),l&&p(m(l,g(r,o,s+1)),h)),d(o,null,s,h),new i(h)}(e,t,s,n,o))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return v.resolveCached(this,t)}resolveNoCache(t){return v.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),C(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=l.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!l.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}S.prototype.text=void 0;class _ extends S{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):C(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}
18mark(t){return t==this.marks?this:new _(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function C(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class M{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new E(t,e);if(null==i.next)return M.empty;let o=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=O(t),r=n;return t.eat(",")&&(r="}"!=t.next?O(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(t){let e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,o)),[]);if("seq"==e.type)for(let r=0;;r++){let s=t(e.exprs[r],o);if(r==e.exprs.length-1)return s;i(s,o=n())}else if("star"==e.type){let s=n();return r(o,s),i(t(e.expr,s),s),[r(s)]}else if("plus"==e.type){let s=n();return i(t(e.expr,o),s),i(t(e.expr,s),s),[r(s)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){let s=o;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,s),r),s=r}if(-1==e.max)i(t(e.expr,s),s);else for(let o=e.min;o<e.max;o++){let o=n();r(s,o),i(t(e.expr,s),o),s=o}return[r(s)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(o),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);I(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let o=r[e.join(",")]=new M(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(A);o.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return o}(I(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(s,a){let l=s.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(a.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=o(n,a.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:s}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}M.empty=new M(!0);class E{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?
18=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function O(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function A(t,e){return e-t}function I(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:o}=i[t];r||-1!=n.indexOf(o)||e(o)}}(e),n.sort(A)}function R(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function T(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function N(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new F(t[n]);return e}class z{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=N(n.attrs),this.defaultAttrs=R(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==M.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:T(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new S(this,this.computeAttrs(t),i.from(e),l.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new S(this,this.computeAttrs(t),e,l.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(i.empty,!0);return o?new S(this,t,e.append(o),l.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new z(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class F{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class B{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=N(r.attrs),this.excluded=null;let i=R(this.attrs);this.instance=i?new l(this,i):null}create(t=null){return!t&&this.instance?this.instance:new l(this,T(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new B(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class j{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];
18e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=z.compile(this.spec.nodes,this),this.marks=B.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=M.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?$(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:$(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof z){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new _(n,n.defaultAttrs,t,l.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return S.fromJSON(this,t)}markFromJSON(t){return l.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function $(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class L{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(t=>{null!=t.tag?this.tags.push(t):null!=t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new W(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new W(this,e,!0);return n.addAll(t,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r;let n=this.tags[i];if(r=n.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,r)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(t)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>t.length)||61==o.charCodeAt(t.length)&&o.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=U(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new L(t,L.schemaRules(t)))}}let D={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},P={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},J={ol:!0,ul:!0};function q(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class H{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=l.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}
18findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):function(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!D.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class W{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,o=q(null,e.preserveWhitespace,0)|(n?4:0);i=r?new H(r.type,r.attrs,l.none,l.none,!0,e.topMatch||r.type.contentMatch,o):n?new H(null,null,l.none,l.none,!0,null,o):new H(t.schema.topNodeType,null,l.none,l.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}withStyleRules(t,e){let n=t.style;if(!n||!n.length)return e();let r=this.readStyles(t.style);if(!r)return;let[i,o]=r,s=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],s);for(let t=0;t<i.length;t++)this.addPendingMark(i[t]);e();for(let t=0;t<i.length;t++)this.removePendingMark(i[t],s);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}
18addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n=t.nodeName.toLowerCase(),r;J.hasOwnProperty(n)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&J.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,e));if(i?i.ignore:P.hasOwnProperty(n))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let e,r=this.top,o=this.needsBlock;if(D.hasOwnProperty(n))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),e=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.addAll(t)),e&&this.sync(r),this.needsBlock=o}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,!1===i.consuming?r:void 0)})}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=l.none,n=l.none;for(let r=0,i=t.length;r<i;r++){let i=t.item(r);for(let r;;){let o=this.parser.matchStyle(i,t.getPropertyValue(i),this,r);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(t=>{o.clearMark(t)&&(n=t.addToSet(n))}):e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1===o.consuming)r=o;else break}}return[e,n]}addElementByRule(t,e,n){let r,i,o;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)(!e.type||e.type.allowsMarkType(t.marks[r].type))&&(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let o=q(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new H(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let a=e[t];
18if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function U(t){let e={};for(let n in t)e[n]=t[n];return e}class Z{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=Y(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;for(;n<i.length&&o<t.marks.length;){let e=t.marks[o];if(!this.marks[e.type.name]){o++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<t.marks.length;){let n=t.marks[o++],s=this.serializeMark(n,t.isInline,e);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Z.renderSpec(Y(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Z.renderSpec(Y(n),r(t,e))}static renderSpec(t,e,n=null){let r;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){for(let t in l=2,a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let i=l;i<e.length;i++){let o=e[i];if(0===o){if(i<e.length-1||i>l)throw RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=Z.renderSpec(t,o,n);if(s.appendChild(e),i){if(r)throw RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Z(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=K(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return K(t.marks)}}function K(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Y(t){return t.document||window.document}},2376:function(t,e,n){"use strict";n.d(e,{Bs:function(){return c},C1:function(){return d},H$:function(){return E},Sy:function(){return _},Y1:function(){return s},qv:function(){return f},xm:function(){return a},yy:function(){return S}});var r=n(2806),i=n(6560);let o=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=r.p2.empty){let n=e.content.lastChild,i=null;for(let t=0;t<e.openEnd;t++)i=n,n=n.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:h}=s[a],c=t.mapping.slice(o);t.replaceRange(c.map(l.pos),c.map(h.pos),a?r.p2.empty:e),0==a&&v(t,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n),l=a.map(o.pos),h=a.map(s.pos);i?t.deleteRange(l,h):(t.replaceRangeWith(l,h,e),v(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new c(t):g(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let i=e<0?g(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):g(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new d(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new d(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new d(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in o)throw RangeError("Duplicate use of selection JSON ID "+t);return o[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function h(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a 
18node with inline content ("+t.parent.type.name+")"))}class c extends s{constructor(t,e=t){h(t),h(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.p2.empty){if(super.replace(t,e),e==r.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos==r<0||(t=e)),new c(t,e)}}s.jsonID("text",c);class u{constructor(t,e){this.anchor=t,this.head=e}map(t){return new u(t.map(this.anchor),t.map(this.head))}resolve(t){return c.between(t.resolve(this.anchor),t.resolve(this.head))}}class f extends s{constructor(t){let e=t.nodeAfter;super(t,t.node(0).resolve(t.pos+e.nodeSize)),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?s.near(i):new f(i)}content(){return new r.p2(r.HY.from(this.node),0,0)}eq(t){return t instanceof f&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new p(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new f(t.resolve(e.anchor))}static create(t,e){return new f(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}f.prototype.visible=!1,s.jsonID("node",f);class p{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new u(n,n):new p(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&f.isSelectable(n)?new f(e):s.near(e)}}class d extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=r.p2.empty){if(e==r.p2.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new d(t)}map(t){return new d(t)}eq(t){return t instanceof d}getBookmark(){return m}}s.jsonID("all",d);let m={map(){return this},resolve:t=>new d(t)};function g(t,e,n,r,i,o=!1){if(e.inlineContent)return c.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&f.isSelectable(r))return f.create(t,n-(i<0?r.nodeSize:0))}else{let e=g(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function v(t,e,n){let r,o=t.steps.length-1;if(o<e)return;let a=t.steps[o];(a instanceof i.Pu||a instanceof i.FC)&&(t.mapping.maps[o].forEach((t,e,n,i)=>{null==r&&(r=i)}),t.setSelection(s.near(t.doc.resolve(r),n)))}class y extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function k(t,e){return e&&t?t.bind(e):t}class w{constructor(t,e,n){this.name=t,this.init=k(e.init,n),this.apply=k(e.apply,n)}}let x=[new w("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new w("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new w("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class b{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=x.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new w(t.key,t.spec.state,t))})}}class S{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
18apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,h=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let e=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new y(this)}static create(t){let e=new b(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new S(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new b(this.schema,t.plugins),n=e.fields,r=new S(e);for(let e=0;e<n.length;e++){let i=n[e].name;r[i]=this.hasOwnProperty(i)?this[i]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new b(t.schema,t.plugins),o=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,r)){o[i.name]=a.fromJSON.call(s,t,e[r],o);return}}o[i.name]=i.init(t,o)}}),o}}class _{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(t.props,this,this.props),this.key=t.key?t.key.key:M("plugin")}getState(t){return t[this.key]}}let C=Object.create(null);function M(t){return t in C?t+"$"+ ++C[t]:(C[t]=0,t+"$")}class E{constructor(t="key"){this.key=M(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},6560:function(t,e,n){"use strict";n.d(e,{Ax:function(){return b},FC:function(){return g},KS:function(){return o},Mn:function(){return S},Pu:function(){return m},dR:function(){return C},k9:function(){return k},nd:function(){return w},nj:function(){return _},vs:function(){return s},wx:function(){return B}});var r=n(2806);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&o.empty)return o.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let h=this.ranges[a+o],c=this.ranges[a+s],u=l+h;if(t<=u){let o=h?t==l?-1:t==u?1:e:e,s=l+r+(o<0?0:c);if(n)return s;let f=t==(e<0?l:u)?null:a/3+(t-l)*65536,p=t==l?2:t==u?1:4;return(e<0?t!=l:t!=u)&&(p|=8),new i(s,p,f)}r+=c-h}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2;
vendor: 10,458 bytes, line 18
18for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+i];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+o]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?o.empty:new o(t<0?[0,-t,0]:[0,0,t])}}o.empty=new o([]);class s{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new s(this.maps,this.mirror,t,e)}copy(){return new s(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new s;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(t,e);if(null!=i.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new i(t,r,null)}}let a=Object.create(null);class l{getMap(){return o.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=a[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class h{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new h(t,null)}static fail(t){return new h(null,t)}static fromReplace(t,e,n,i){try{return h.ok(t.replace(e,n,i))}catch(t){if(t instanceof r.e4)return h.fail(t.message);throw t}}}function c(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(c(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return r.HY.fromArray(i)}class u extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.p2(c(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,o)}invert(){return new f(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new u(e.pos,n.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("addMark",u);class f extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.p2(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,n)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new f(e.pos,n.pos,this.mark)}merge(t){return t instanceof f&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new f(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new f(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("removeMark",f);class p extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new p(this.pos,e.marks[n]);return new p(this.pos,this.mark)}}return new d(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new p(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new p(e.pos,t.markFromJSON(e.mark))}}l.jsonID("addNodeMark",p);class d extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new p(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new d(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new d(e.pos,t.markFromJSON(e.mark))}}l.jsonID("removeNodeMark",d);class m extends l{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&v(t,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(t){return new m(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new m(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof m)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new m(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new m(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(e.from,e.to,r.p2.fromJSON(t,e.slice),!!e.structure)}}l.jsonID("replace",m);class g extends l{constructor(t,e,n,r,i,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(t){if(this.structure&&(v(t,this.from,this.gapFrom)||v(t,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?h.fromReplace(t,this.from,this.to,n):h.fail("Content does not fit in gap")}getMap(){return new o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new g(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(e.from,e.to,e.gapFrom,e.gapTo,r.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function v(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function y(t,e,n,i=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let e=0;e<s.childCount;e++){let h=s.child(e),c=l+h.nodeSize,u=i.matchType(h.type);if(u){i=u;for(let e=0;e<h.marks.length;e++)n.allowsMarkType(h.marks[e].type)||t.step(new f(l,c,h.marks[e]));if(o&&h.isText&&"pre"!=n.whitespace){let t,e=/\r?\n|\r/g,i;for(;t=e.exec(h.text);)i||(i=new r.p2(r.HY.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new m(l+t.index,l+t.index+t[0].length,i))}}else a.push(new m(l,c,r.p2.empty));l=c}if(!i.validEnd){let e=i.fillBefore(r.HY.empty,!0);t.replace(l,l,new r.p2(e,0,0))}for(let e=a.length-1;e>=0;
18e--)t.step(a[e])}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function w(t,e,n=null,r=t){let i=function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<i;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(x).concat({type:e,attrs:n}).concat(o.map(x)):null}function x(t){return{type:t,attrs:null}}function b(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let t=i.depth-1,e=n-2;t>o;t--,e--){let n=i.node(t),o=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[e]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function S(t,e){var n,r;let i=t.resolve(e),o=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&n.canAppend(r))&&i.parent.canReplace(o,o+1)}function _(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t<n.openStart;t++)i=i.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,o=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(o,o,i);else{let t=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(o,o,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function C(t,e,n=e,i=r.p2.empty){if(e==n&&!i.size)return null;let o=t.resolve(e),s=t.resolve(n);return M(o,s,i)?new m(e,n,i):new E(o,s,i).fit()}function M(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}l.jsonID("replaceAround",g);class E{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new r.p2(o,s,a);return t>-1?new g(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=I(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:a}=this.frontier[o],l,h=null;if(1==e&&(i?a.matchType(i.type)||(h=a.fillBefore(r.HY.from(i),!1)):t&&s.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:o,parent:t,inject:h};if(2==e&&i&&(l=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:t,wrap:l};if(t&&a.matchType(t.type))break}}}
18openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=I(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=I(t,e);if(i.childCount<=1&&e>0){let o=t.size-e<=e+i.size;this.unplaced=new r.p2(O(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new r.p2(O(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-t,h=0,c=[],{match:u,type:f}=this.frontier[e];if(i){for(let t=0;t<i.childCount;t++)c.push(i.child(t));u=u.matchFragment(i)}let p=a.size+t-(s.content.size-s.openEnd);for(;h<a.childCount;){let t=a.child(h),e=u.matchType(t.type);if(!e)break;(++h>1||0==l||t.content.size)&&(u=e,c.push(function t(e,n,i){if(n<=0)return e;let o=e.content;return n>1&&(o=o.replaceChild(0,t(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=e.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.HY.empty,!0)))),e.copy(o)}(t.mark(f.allowedMarks(t.marks)),1==h?l:0,h==a.childCount?p:-1)))}let d=h==a.childCount;d||(p=-1),this.placed=A(this.placed,e,r.HY.from(c)),this.frontier[e].match=u,d&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t<p;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==t?r.p2.empty:new r.p2(O(s.content,t-1,1),t-1,p<0?s.openEnd:t-1):new r.p2(O(s.content,t,h),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!R(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){i:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=R(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=R(t,n,r,e,!0);if(!i||i.childCount)continue i}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=A(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=A(this.placed,this.depth,r.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.HY.empty,!0);t.childCount&&(this.placed=A(this.placed,this.frontier.length,t))}}function O(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(O(t.firstChild.content,e-1,n)))}function A(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(A(t.lastChild.content,e-1,n)))}function I(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function R(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function T(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class N extends l{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return h.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,e.isLeaf?0:1))}getMap(){return o.empty}invert(t){return new N(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new N(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new N(e.pos,e.attr,e.value)}}l.jsonID("attr",N);class z extends l{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return h.ok(n)}getMap(){return o.empty}invert(t){return new z(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new z(e.attr,e.value)}}l.jsonID("docAttr",z);
18let F=class extends Error{};(F=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),F.prototype.constructor=F,F.prototype.name="TransformError";class B{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new F(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.p2.empty){let i=C(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.p2(r.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,r.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(M(o,s,i))return t.step(new m(e,n,i));let a=T(o,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:o.before(t)==e&&a.splice(1,0,-t)}let h=a.indexOf(l),c=[],u=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){var f;let e=c[t],n=(f=e.type).spec.defining||f.spec.definingForContent;if(n&&!e.sameMarkup(o.node(Math.abs(l)-1)))u=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let l=(e+u+1)%(i.openStart+1),f=c[l];if(f)for(let e=0;e<a.length;e++){let c=a[(e+h)%a.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),d=o.index(c-1);if(p.canReplaceWith(d,d,f.type,f.marks))return t.replace(o.before(c),u?s.after(c):n,new r.p2(function t(e,n,i,o,s){if(n<i){let r=e.firstChild;e=e.replaceChild(0,r.copy(t(r.content,n+1,i,o,r)))}if(n>o){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.HY.empty,!0))}return e}(i.content,0,i.openStart,l),l,i.openEnd))}}let p=t.steps.length;for(let r=a.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>p));r--){let t=a[r];t<0||(e=o.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)break}return null}(t.doc,e,i.type);null!=r&&(e=n=r)}t.replaceRange(e,n,new r.p2(r.HY.from(i),0,0))}(this,t,e,n),this}deleteRange(t,e){return!function(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=T(r,i);for(let e=0;e<o.length;e++){let n=o[e],s=e==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return t.delete(r.before(o),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:o,depth:s}=e,a=i.before(s+1),l=o.after(s+1),h=a,c=l,u=r.HY.empty,f=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,u=r.HY.from(i.node(t).copy(u)),f++):h--;let p=r.HY.empty,d=0;for(let t=s,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,p=r.HY.from(o.node(t).copy(p)),d++):c++;t.step(new g(h,c,a,l,new r.p2(u.append(p),f,d),u.size-f,!0))}(this,t,e),this}join(t,e=1){return!function(t,e,n){let i=new m(e-n,e+n,r.p2.empty,!0);t.step(i)}(this,t,e),this}wrap(t,e){return!function(t,e,n){let i=r.HY.empty;for(let t=n.length-1;t>=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[t].type.create(n[t].attrs,i))}let o=e.start,s=e.end;t.step(new g(o,s,o,s,new r.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var a,l;let h,c;if(e.isTextblock&&!e.hasMarkup(i,o)&&(a=t.doc,l=t.mapping.slice(s).map(n),c=(h=a.resolve(l)).index(),h.parent.canReplaceWith(c,c+1,i))){let a=null;if(i.schema.linebreakReplacement){let t="pre"==i.whitespace,e=!!i.contentMatch.matchType(i.schema.linebreakReplacement);t&&!e?a=!1:!t&&e&&(a=!0)}!1===a&&function(t,e,n,r){e.forEach((i,o)=>
18{if(i.type==i.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+o);t.replaceWith(i,i+1,e.type.schema.text("\n"))}})}(t,e,n,s),y(t,t.mapping.slice(s).map(n,1),i,void 0,null===a);let l=t.mapping.slice(s),h=l.map(n,1),c=l.map(n+e.nodeSize,1);return t.step(new g(h,c,h+1,c-1,new r.p2(r.HY.from(i.create(o,null,e.marks)),0,0),1,!0)),!0===a&&function(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(i,i+1,e.type.schema.linebreakReplacement.create())}}})}(t,e,n,s),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,o){let s=t.doc.nodeAt(e);if(!s)throw RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);t.step(new g(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.p2(r.HY.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new N(t,e,n)),this}setDocAttribute(t,e){return this.step(new z(t,e)),this}addNodeMark(t,e){return this.step(new p(t,e)),this}removeNodeMark(t,e){if(!(e instanceof r.vc)){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new d(t,e)),this}split(t,e=1,n){return!function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.HY.empty,a=r.HY.empty;for(let t=o.depth,e=o.depth-n,l=n-1;t>e;t--,l--){s=r.HY.from(o.node(t).copy(s));let e=i&&i[l];a=r.HY.from(e?e.type.create(e.attrs,a):o.node(t).copy(a))}t.step(new m(e,e,new r.p2(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,(r,l,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(l,t),p=Math.min(l+r.nodeSize,e),d=n.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(d)||(i&&i.to==h&&i.mark.eq(c[t])?i.to=p:s.push(i=new f(h,p,c[t])));o&&o.to==h?o.to=p:a.push(o=new u(h,p,n))}}),s.forEach(t=>r.step(t)),a.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(t,e,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(n instanceof r.ZU){let t=i.marks,e;for(;e=n.isInSet(t);)(l||(l=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let n=Math.min(a+i.nodeSize,e);for(let e=0;e<l.length;e++){let r=l[e],i;for(let t=0;t<o.length;t++){let e=o[t];e.step==s-1&&r.eq(o[t].style)&&(i=e)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(a,t),to:n,step:s})}}}),o.forEach(t=>i.step(new f(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return y(this,t,e,n),this}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.