Home
last modified time | relevance | path

Searched refs:navigator (Results 126 – 150 of 277) sorted by relevance

12345678910>>...12

/plugin/photogallery/lightGallery/js/
H A Dlg-zoom.js27 var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
H A Dlg-zoom.min.js4 …}(this,function(a){!function(){"use strict";var b=function(){var a=!1,b=navigator.userAgent.match(…
/plugin/jplayer/vendor/robloach/component-installer/src/ComponentInstaller/Resources/
H A Drequire.js25 isBrowser = !!(typeof window !== 'undefined' && navigator && document),
31 readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
/plugin/jplayer/components/
H A Drequire.js25 isBrowser = !!(typeof window !== 'undefined' && navigator && document),
31 readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
/plugin/freechat/phpfreechat/data/public/js/
H A Dprototype.js15 WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
16 Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
17 MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
1205 else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
1257 (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
2377 else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
/plugin/diagramsnet/lib/js/grapheditor/
H A DEditorUi.js985 if (mxClient.IS_IOS && !window.navigator.standalone)
1841 (((!mxClient.IS_FF && navigator.clipboard != null) || !mxClipboard.isEmpty()) &&
2417 if (urlParams['openInSameWin'] != '1' || navigator.standalone)
3892 if (mxClient.IS_IOS && !window.navigator.standalone)
4524 navigator.clipboard.read().then(mxUtils.bind(this, function(data)
4895 if (this.allowAnimation && animate && (navigator.userAgent == null ||
4896 navigator.userAgent.indexOf('Camino') < 0))
/plugin/diagramsnet/lib/js/socket.io/
H A Dsimplepeer9.10.0.min.js6navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&…
/plugin/galleryv1.5/
H A Dscript.js108 var ua = navigator.userAgent;
/plugin/topbarsyntax/
H A Dcsshover3.htc55 if(!REG_MSIE.test(navigator.userAgent) && !REG_COMPAT.test(window.document.compatMode)) return;
/plugin/diagramsnet/lib/math/jax/output/HTML-CSS/fonts/STIX/
H A Dfontdata.js19 …=w.versionAtLeast("5.1")&&w.isMac},Chrome:function(x){if(x.isMac){var w=navigator.appVersion.match…
/plugin/yuriigantt/3rd/dhtmlxgantt/
H A Ddhtmlxgantt.js13navigator.userAgent.indexOf("MSIE")>=0||navigator.userAgent.indexOf("Trident")>=0,isIE6:!window.XM…
/plugin/swfobject/
H A Dscript.js4 …ash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=…
/plugin/imageflow/
H A Dscript.js57 var arVersion = navigator.appVersion.split("MSIE");
/plugin/tagfilter/script/
H A Djquery.history.js1 typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()}(window),function(e,t){"use strict";var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.isHashEqual=function(e,t){return e=encodeURIComponent(e).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),e===t},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a,f=Boolean(o.getHash());return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.setAttribute("src","#"),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash(),r=o.getHash(i.contentWindow.document);return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,f&&r===""?o.back():o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash()||"";return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var n=t&&t.newURL||o.getLocationHref(),r=o.getHashByUrl(n),i=null,s=null,u=null,a;return o.isLastHash(r)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(r),r&&o.isTraditionalAnchor(r)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(i=o.extractState(o.getFullUrl(r||o.getLocationHref()),!0),o.isLastSavedState(i)?(o.busy(!1),!1):(s=o.getHashByState(i),a=o.discardedState(i),a?(o.getHashByIndex(-2)===o.getHashByState(a.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(i.data,i.title,encodeURI(i.url),!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getHash(),c=o.expectedStateId==s.id;return o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),u===f?(o.busy(!1),!1):(o.saveState(s),c||o.Adapter.trigger(e,"statechange"),!o.isHashEqual(u,l)&&!o.isHashEqual(u,o.getShortUrl(o.getLocationHref()))&&o.setHash(u,!1),o.busy(!1),!0)},o.replaceState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getStateByIndex(-2);return o.discardState(a,s,l),u===f?(o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),o.saveState(s),o.Adapter.trigger(e,"statechange"),o.busy(!1)):o.pushState(s.data,s.title,s.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.Hist (…)
/plugin/diagramsnet/lib/js/diagramly/
H A DEditorUi.js1154 fileNode.setAttribute('agent', navigator.appVersion);
4414 if (window.Blob && navigator.msSaveOrOpenBlob)
4419 navigator.msSaveOrOpenBlob(blob, filename);
4441 if (!navigator.standalone && mimeType != null && mimeType.substring(0, 6) == 'image/')
4457 var useDownload = (navigator.userAgent == null ||
4458 navigator.userAgent.indexOf("PaleMoon/") < 0) &&
4462 if (mxClient.IS_GC && navigator.userAgent != null)
4464 var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
4971 allowTab = (allowTab != null) ? allowTab : !mxClient.IS_IOS || !navigator.standalone;
10596 navigator.clipboard.write([cbi])['catch'](error);
[all …]
/plugin/findologicxmlexport/vendor/jms/serializer/
H A DCHANGELOG.md113 - Added graph navigator factories [\#929](https://github.com/schmittjoh/serializer/pull/929) ([goet…
114 - No global graph navigator [\#925](https://github.com/schmittjoh/serializer/pull/925) ([goetas](ht…
116 - Move accessors to graph navigator [\#923](https://github.com/schmittjoh/serializer/pull/923) ([go…
182 - Move data handling from graph navigator to visitor [\#920](https://github.com/schmittjoh/serializ…
222 - Introduce graph navigator interface [\#876](https://github.com/schmittjoh/serializer/pull/876) ([…
493 - Where in the JMS code does the navigator call VisitProperty method for visitor [\#207](https://gi…
/plugin/revealjs/js/
H A Dreveal.js36 UA = navigator.userAgent,
460 ( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS
1492 else if( window.navigator.msPointerEnabled ) {
/plugin/yuriigantt/3rd/dhtmlxgantt/sources/
H A Ddhtmlxgantt.js4304 window.navigator &&
5059 var canEvaluate = typeof navigator == "undefined";
6333 …var isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !…
7122 }else if(window.navigator.pointerEnabled){
7133 }else if (window.navigator.msPointerEnabled){
16922 if (navigator.vibrate)
16960 } else if (window.navigator.pointerEnabled) {
29477 isIE: (navigator.userAgent.indexOf("MSIE") >= 0 || navigator.userAgent.indexOf("Trident") >= 0),
29479 …isIE7: (navigator.userAgent.indexOf("MSIE 7.0") >= 0 && navigator.userAgent.indexOf("Trident") < 0…
29480 …isIE8: (navigator.userAgent.indexOf("MSIE 8.0") >= 0 && navigator.userAgent.indexOf("Trident") >= …
[all …]
/plugin/dokucrypt2/
H A Dscript.js2190 if (navigator.clipboard && window.isSecureContext) {
2192 return navigator.clipboard.writeText(textToCopy);
/plugin/diagramsnet/lib/plugins/
H A Dvoice.js1899 if (navigator.webkitGetUserMedia)
1903 navigator.webkitGetUserMedia({audio:true}, function()
/plugin/diagramsnet/lib/mxgraph/
H A DmxClient.js1navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!n…
2navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OP…
3navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_WEBVIE…
4navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=nav…
5navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_CHROMEOS:/\bCr…
8 …peof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.langu…
14 …a.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:fun…
16 …a+=" ");null!=mxLog.textarea?(mxLog.textarea.value+=a,null!=navigator.userAgent&&0<=navigator.user…
149 …ons)};mxWindow.prototype.setScrollable=function(a){if(null==navigator.userAgent||0>navigator.userA…
/plugin/prosemirror/lib/
H A Dbundle.js1 !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=27)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=o,t.svgIcon=function(e){var t=document.createElement("span");return t.innerHTML=o(e),t};var r={"alert-circle-outline":"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z","chevron-down":"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z","file-image-outline":"M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z","format-bold":"M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z","format-header-pound":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M13,8H15.31L15.63,5H17.63L17.31,8H19.31L19.63,5H21.63L21.31,8H23V10H21.1L20.9,12H23V14H20.69L20.37,17H18.37L18.69,14H16.69L16.37,17H14.37L14.69,14H13V12H14.9L15.1,10H13V8M17.1,10L16.9,12H18.9L19.1,10H17.1Z","format-header-1":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M14,18V16H16V6.31L13.5,7.75V5.44L16,4H18V16H20V18H14Z","format-header-2":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M21,18H15A2,2 0 0,1 13,16C13,15.47 13.2,15 13.54,14.64L18.41,9.41C18.78,9.05 19,8.55 19,8A2,2 0 0,0 17,6A2,2 0 0,0 15,8H13A4,4 0 0,1 17,4A4,4 0 0,1 21,8C21,9.1 20.55,10.1 19.83,10.83L15,16H21V18Z","format-header-3":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V15H15V16H19V12H15V10H19V6H15V7H13V6A2,2 0 0,1 15,4Z","format-header-4":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M18,18V13H13V11L18,4H20V11H21V13H20V18H18M18,11V7.42L15.45,11H18Z","format-header-5":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H20V6H15V10H17A4,4 0 0,1 21,14A4,4 0 0,1 17,18H15A2,2 0 0,1 13,16V15H15V16H17A2,2 0 0,0 19,14A2,2 0 0,0 17,12H15A2,2 0 0,1 13,10V6A2,2 0 0,1 15,4Z","format-header-6":"M3,4H5V10H9V4H11V18H9V12H5V18H3V4M15,4H19A2,2 0 0,1 21,6V7H19V6H15V10H19A2,2 0 0,1 21,12V16A2,2 0 0,1 19,18H15A2,2 0 0,1 13,16V6A2,2 0 0,1 15,4M15,12V16H19V12H15Z","format-header-decrease":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M20.42,7.41L16.83,11L20.42,14.59L19,16L14,11L19,6L20.42,7.41Z","format-header-equal":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M14,10V8H21V10H14M14,12H21V14H14V12Z","format-header-increase":"M4,4H6V10H10V4H12V18H10V12H6V18H4V4M14.59,7.41L18.17,11L14.59,14.59L16,16L21,11L16,6L14.59,7.41Z","format-text":"M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z","format-italic":"M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z","format-list-bulleted":"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z","format-list-numbers":"M7,13H21V11H7M7,19H21V17H7M7,7H21V5H7M2,11H3.8L2,13.1V14H5V13H3.2L5,10.9V10H2M3,8H4V4H2V5H3M2,17H4V17.5H3V18.5H4V19H2V20H5V16H2V17Z","format-paragraph":"M13,4A4,4 0 0,1 17,8A4,4 0 0,1 13,12H11V18H9V4H13M13,10A2,2 0 0,0 15,8A2,2 0 0,0 13,6H11V10H13Z","format-strikethrough":"M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z","format-superscript":"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,9H16.97V8L17.86,7.18C18.62,6.54 19.18,6 19.56,5.55C19.93,5.11 20.12,4.7 20.13,4.32C20.14,4.04 20.05,3.8 19.86,3.62C19.68,3.43 19.39,3.34 19,3.33C18.69,3.34 18.42,3.4 18.16,3.5L17.5,3.89L17.05,2.72C17.32,2.5 17.64,2.33 18.03,2.19C18.42,2.05 18.85,2 19.32,2C20.1,2 20.7,2.2 21.1,2.61C21.5,3 21.72,3.54 21.72,4.18C21.71,4.74 21.53,5.26 21.18,5.73C20.84,6.21 20.42,6.66 19.91,7.09L19.27,7.61V7.63H21.85V9Z","format-subscript":"M16,7.41L11.41,12L16,16.59L14.59,18L10,13.41L5.41,18L4,16.59L8.59,12L4,7.41L5.41,6L10,10.59L14.59,6L16,7.41M21.85,21.03H16.97V20.03L17.86,19.23C18.62,18.58 19.18,18.04 19.56,17.6C19.93,17.16 20.12,16.75 20.13,16.36C20.14,16.08 20.05,15.85 19.86,15.66C19.68,15.5 19.39,15.38 19,15.38C18.69,15.38 18.42,15.44 18.16,15.56L17.5,15.94L17.05,14.77C17.32,14.56 17.64,14.38 18.03,14.24C18.42,14.1 18.85,14 19.32,14C20.1,14.04 20.7,14.25 21.1,14.66C21.5,15.07 21.72,15.59 21.72,16.23C21.71,16.79 21.53,17.31 21.18,17.78C20.84,18.25 20.42,18.7 19.91,19.14L19.27,19.66V19.68H21.85V21.03Z","format-underline":"M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z","format-quote-close":"M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z","console-line":"M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z","translate-off":"M12.17,5.81C11.87,6.69 11.47,7.55 11,8.39L12.35,9.74C13.11,8.5 13.71,7.18 14.13,5.81H17.16V3.75H9.94V1.69H7.87V3.75H6.37L8.43,5.81H12.17M15.53,12.91L17.03,14.41L17.67,12.69L19.08,16.47L22.39,19.77L18.7,9.94H16.64L15.53,12.91M1.31,1.31L0,2.62L1.13,3.75H0.65V5.81H3.19L5.26,7.88H4.46C5.21,9.56 6.24,11.15 7.53,12.58L2.28,17.76L3.75,19.22L8.91,14.07L12.11,17.27L12.8,15.43L14.1,16.72L12,22.31H14.06L15.22,19.22H16.6L21.38,24L22.69,22.69L1.31,1.31Z","link-variant":"M10.59,13.41C11,13.8 11,14.44 10.59,14.83C10.2,15.22 9.56,15.22 9.17,14.83C7.22,12.88 7.22,9.71 9.17,7.76V7.76L12.71,4.22C14.66,2.27 17.83,2.27 19.78,4.22C21.73,6.17 21.73,9.34 19.78,11.29L18.29,12.78C18.3,11.96 18.17,11.14 17.89,10.36L18.36,9.88C19.54,8.71 19.54,6.81 18.36,5.64C17.19,4.46 15.29,4.46 14.12,5.64L10.59,9.17C9.41,10.34 9.41,12.24 10.59,13.41M13.41,9.17C13.8,8.78 14.44,8.78 14.83,9.17C16.78,11.12 16.78,14.29 14.83,16.24V16.24L11.29,19.78C9.34,21.73 6.17,21.73 4.22,19.78C2.27,17.83 2.27,14.66 4.22,12.71L5.71,11.22C5.7,12.04 5.83,12.86 6.11,13.65L5.64,14.12C4.46,15.29 4.46,17.19 5.64,18.36C6.81,19.54 8.71,19.54 9.88,18.36L13.41,14.83C14.59,13.66 14.59,11.76 13.41,10.59C13,10.2 13,9.56 13.41,9.17Z",image:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z","arrow-expand-left":"M20,22H22V2H20V11H5.83L11.33,5.5L9.92,4.08L2,12L9.92,19.92L11.33,18.5L5.83,13H20V22Z","arrow-expand-right":"M4,2H2V22H4V13H18.17L12.67,18.5L14.08,19.92L22,12L14.08,4.08L12.67,5.5L18.17,11H4V2Z",puzzle:"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z","puzzle-outline":"M22,13.5C22,15.26 20.7,16.72 19,16.96V20A2,2 0 0,1 17,22H13.2V21.7A2.7,2.7 0 0,0 10.5,19C9,19 7.8,20.21 7.8,21.7V22H4A2,2 0 0,1 2,20V16.2H2.3C3.79,16.2 5,15 5,13.5C5,12 3.79,10.8 2.3,10.8H2V7A2,2 0 0,1 4,5H7.04C7.28,3.3 8.74,2 10.5,2C12.26,2 13.72,3.3 13.96,5H17A2,2 0 0,1 19,7V10.04C20.7,10.28 22,11.74 22,13.5M17,15H18.5A1.5,1.5 0 0,0 20,13.5A1.5,1.5 0 0,0 18.5,12H17V7H12V5.5A1.5,1.5 0 0,0 10.5,4A1.5,1.5 0 0,0 9,5.5V7H4V9.12C5.76,9.8 7,11.5 7,13.5C7,15.5 5.75,17.2 4,17.88V20H6.12C6.8,18.25 8.5,17 10.5,17C12.5,17 14.2,18.25 14.88,20H17V15Z","code-braces":"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",rss:"M6.18,15.64A2.18,2.18 0 0,1 8.36,17.82C8.36,19 7.38,20 6.18,20C5,20 4,19 4,17.82A2.18,2.18 0 0,1 6.18,15.64M4,4.44A15.56,15.56 0 0,1 19.56,20H16.73A12.73,12.73 0 0,0 4,7.27V4.44M4,10.1A9.9,9.9 0 0,1 13.9,20H11.07A7.07,7.07 0 0,0 4,12.93V10.1Z",emoticon:"M12,17.5C14.33,17.5 16.3,16.04 17.11,14H6.89C7.69,16.04 9.67,17.5 12,17.5M8.5,11A1.5,1.5 0 0,0 10,9.5A1.5,1.5 0 0,0 8.5,8A1.5,1.5 0 0,0 7,9.5A1.5,1.5 0 0,0 8.5,11M15.5,11A1.5,1.5 0 0,0 17,9.5A1.5,1.5 0 0,0 15.5,8A1.5,1.5 0 0,0 14,9.5A1.5,1.5 0 0,0 15.5,11M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z","note-plus-outline":"M15,10H20.5L15,4.5V10M4,3H16L22,9V19A2,2 0 0,1 20,21H4C2.89,21 2,20.1 2,19V5C2,3.89 2.89,3 4,3M4,5V19H20V12H13V5H4M8,17V15H6V13H8V11H10V13H12V15H10V17H8Z","table-plus":"M18,14H20V17H23V19H20V22H18V19H15V17H18V14M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z","table-edit":"M21.7,13.35L20.7,14.35L18.65,12.3L19.65,11.3C19.86,11.08 20.21,11.08 20.42,11.3L21.7,12.58C21.92,12.79 21.92,13.14 21.7,13.35M12,18.94L18.07,12.88L20.12,14.93L14.06,21H12V18.94M4,2H18A2,2 0 0,1 20,4V8.17L16.17,12H12V16.17L10.17,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M4,6V10H10V6H4M12,6V10H18V6H12M4,12V16H10V12H4Z","table-row-plus-before":"M22,14A2,2 0 0,0 20,12H4A2,2 0 0,0 2,14V21H4V19H8V21H10V19H14V21H16V19H20V21H22V14M4,14H8V17H4V14M10,14H14V17H10V14M20,14V17H16V14H20M11,10H13V7H16V5H13V2H11V5H8V7H11V10Z","table-row-plus-after":"M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z","table-row-remove":"M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z","table-column-plus-before":"M13,2A2,2 0 0,0 11,4V20A2,2 0 0,0 13,22H22V2H13M20,10V14H13V10H20M20,16V20H13V16H20M20,4V8H13V4H20M9,11H6V8H4V11H1V13H4V16H6V13H9V11Z","table-column-plus-after":"M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z","table-column-remove":"M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z","table-border":"M21,19A1,1 0 0,1 20,20H19V18H21V19M15,20V18H17V20H15M11,20V18H13V20H11M7,20V18H9V20H7M4,20A1,1 0 0,1 3,19V18H5V20H4M19,4H5A2,2 0 0,0 3,6V8H5L11,8H13L19,8H21V6C21,4.89 20.11,4 19,4M5,14H3V16H5V14M5,10H3V12H5V10M21,10H19V12H21V10M21,14H19V16H21V14M11,16V14H13V16H11M11,12V10H13V12H11","format-align-left":"M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z","format-align-center":"M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z","format-align-right":"M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z","table-merge-cells":"M5,10H3V6A2,2 0 0,1 5,4H11V6H5V10M19,18H13V20H19A2,2 0 0,0 21,18V14H19V18M5,18V14H3V18A2,2 0 0,0 5,20H11V18H5M19,4H13V6H19V10H21V6A2,2 0 0,0 19,4M8,13V15L11,12L8,9V11H3V13H8M16,11V9L13,12L16,15V13H21V11H16Z","arrow-split-vertical":"M18,16V13H15V22H13V2H15V11H18V8L22,12L18,16M2,12L6,16V13H9V22H11V2H9V11H6V8L2,12Z","table-remove":"M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z","settings-outline":"M19.43,12.97L21.54,14.63C21.73,14.78 21.78,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.03 19.05,18.95L16.56,17.94C16.04,18.34 15.5,18.67 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.78,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,12.97M6.5,12C6.5,12.58 6.59,13.13 6.75,13.66L4.68,15.36L5.43,16.66L7.95,15.72C8.69,16.53 9.68,17.12 10.8,17.37L11.24,20H12.74L13.18,17.37C14.3,17.13 15.3,16.54 16.05,15.73L18.56,16.67L19.31,15.37L17.24,13.67C17.41,13.14 17.5,12.58 17.5,12C17.5,11.43 17.41,10.87 17.25,10.35L19.31,8.66L18.56,7.36L16.06,8.29C15.31,7.47 14.31,6.88 13.19,6.63L12.75,4H11.25L10.81,6.63C9.69,6.88 8.69,7.47 7.94,8.29L5.44,7.35L4.69,8.65L6.75,10.35C6.59,10.87 6.5,11.43 6.5,12M12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5M12,10.5A1.5,1.5 0 0,0 10.5,12A1.5,1.5 0 0,0 12,13.5A1.5,1.5 0 0,0 13.5,12A1.5,1.5 0 0,0 12,10.5Z","checkbox-blank-outline":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z","checkbox-marked-outline":"M19,19H5V5H15V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V11H19M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z",undo:"M12.5,8C9.85,8 7.45,9 5.6,10.6L2,7V16H11L7.38,12.38C8.77,11.22 10.54,10.5 12.5,10.5C16.04,10.5 19.05,12.81 20.1,16L22.47,15.22C21.08,11.03 17.15,8 12.5,8Z",redo:"M18.4,10.6C16.55,9 14.15,8 11.5,8C6.85,8 2.92,11.03 1.54,15.22L3.9,16C4.95,12.81 7.95,10.5 11.5,10.5C13.45,10.5 15.23,11.22 16.62,12.38L13,16H22V7L18.4,10.6Z"};function o(e){var t=r["alert-circle-outline"];return void 0!==r[e]?t=r[e]:console.error("SVG icon "+e+" does not exist"),'<svg viewBox="0 0 24 24"><path d="'+t+'" /></svg>'}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,e),"function"!=typeof t.command)throw new TypeError("command is not a function!");this.options=t,"function"==typeof t.isActive&&(this.isActive=t.isActive)}return r(e,[{key:"isActive",value:function(e){return!1}}]),r(e,[{key:"render",value:function(e){var t=this,n=this.renderDOM(e);if(!n)throw new Error("Could not generate dom for "+this.options.label+" "+JSON.stringify(this.options));return n.addEventListener("mousedown",(function(n){n.preventDefault(),t.options.command(e.state,e.dispatch,e)})),this.dom=n,n}},{key:"renderDOM",value:function(t){var n=void 0;return"function"==typeof this.options.render?n=this.options.render(t):(n=jQuery("<span>").addClass("menuitem"),this.options.icon instanceof Element&&n.append(e.renderSVGIcon(this.options.icon,this.options.label)),"string"==typeof this.options.label&&n.append(jQuery("<span>").addClass("menulabel").attr("title",this.options.label).text(this.options.label).get(0)),n=n.get(0)),n}},{key:"update",value:function(e){"function"==typeof this.options.update&&this.options.update(e,this.dom),this.isActive(e.state)?this.dom.classList.add("is-active"):this.dom.classList.remove("is-active"),this.options.command(e.state,null,e)?this.dom.classList.remove("is-disabled"):this.dom.classList.add("is-disabled")}}],[{key:"renderSVGIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return jQuery(e).addClass("menuicon").attr("title",t)}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,null,[{key:"isAvailable",value:function(e){throw new Error("isAvailable is not implemented!")}},{key:"getMenuItem",value:function(e){throw new Error("getMenuItem is not implemented!")}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=n(4),a=n(13),s=n(5),l=n(6),c=n(16);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var f=[],p=0;r=function(e){for(var t=0;t<f.length;t+=2)if(f[t]==e)return f[t+1]},o=function(e,t){return 10==p&&(p=0),f[p++]=e,f[p++]=t}}var d=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},h=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function v(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}h.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,a=o+1,s=1;i<this.width&&this.map[t+s]==n;s++)i++;for(var l=1;a<this.height&&this.map[t+this.width*l]==n;l++)a++;return new d(r,o,i,a)}}throw new RangeError("No cell with offset "+e+" found")},h.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},h.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,a=r.top,s=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[a*this.width+(n<0?o-1:i)]:(n<0?0==a:s==this.height)?null:this.map[o+this.width*(n<0?a-1:s)]},h.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,a=n.bottom,s=this.findCell(t),l=s.left,c=s.right,u=s.top,f=s.bottom;return new d(Math.min(r,l),Math.min(i,u),Math.max(o,c),Math.max(a,f))},h.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t},h.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var a=t+e*this.width,s=(e+1)*this.width;a<s&&this.map[a]<o;)a++;return a==s?i-1:this.map[a]}o=i}},h.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var a=0;a<r;a++)for(var s=e.child(a),l=0;l<s.childCount;l++){var c=s.child(l);a+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}for(var u=0;u<o.childCount;u++){var f=o.child(u);i+=f.attrs.colspan,f.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,a=[],s=0,l=t*n;s<l;s++)r[s]=0;for(var c=0,u=0;c<n;c++){var f=e.child(c);u++;for(var p=0;;p++){for(;o<r.length&&0!=r[o];)o++;if(p==f.childCount)break;for(var d=f.child(p),m=d.attrs,y=m.colspan,g=m.rowspan,b=m.colwidth,w=0;w<g;w++){if(w+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:g-w});break}for(var k=o+w*t,O=0;O<y;O++){0==r[k+O]?r[k+O]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:y-O});var M=b&&b[O];if(M){var S=(k+O)%t*2,_=a[S];null==_||_!=M&&1==a[S+1]?(a[S]=M,a[S+1]=1):_==M&&a[S+1]++}}}o+=y,u+=d.nodeSize}for(var C=(c+1)*t,x=0;o<C;)0==r[o++]&&x++;x&&(i||(i=[])).push({type:"missing",row:c,n:x}),u++}for(var A=new h(t,n,r,i),T=!1,V=0;!T&&V<a.length;V+=2)null!=a[V]&&a[V+1]<n&&(T=!0);T&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var a=n.nodeAt(i),s=null,l=0;l<a.attrs.colspan;l++){var c=(r+l)%e.width,u=t[2*c];null==u||a.attrs.colwidth&&a.attrs.colwidth[l]==u||((s||(s=v(a.attrs)))[l]=u)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(A,a,e);return A}(e))};var m=new i.PluginKey("selectingCells");function y(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function g(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function b(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:y(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function w(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function k(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function O(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function M(e,t,n){var r=e.start(-1),o=h.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function S(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function _(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function C(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}var x=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=h.get(r),a=t.start(-1),s=o.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=o.cellsInRect(s).filter((function(e){return e!=n.pos-a}));c.unshift(n.pos-a);var u=c.map((function(e){var t=r.nodeAt(e),n=e+a+1;return new i.SelectionRange(l.resolve(n),l.resolve(n+t.content.size))}));e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(w(r)&&w(o)&&O(r,o)){var a=this.$anchorCell.node(-1)!=r.node(-1);return a&&this.isRowSelection()?t.rowSelection(r,o):a&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=h.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var l=[],c=a*t.width+r.left,u=r.left;u<r.right;u++,c++){var f=t.map[c];if(!o[f]){o[f]=!0;var p=t.findCell(f),d=e.nodeAt(f),v=r.left-p.left,m=p.right-r.right;if(v>0||m>0){var y=d.attrs;v>0&&(y=_(y,0,v)),m>0&&(y=_(y,y.colspan-m,m)),d=p.left<r.left?d.type.createAndFill(y):d.type.create(y,d.content)}if(p.top<r.top||p.bottom>r.bottom){var g=S(d.attrs,"rowspan",Math.min(p.bottom,r.bottom)-Math.max(p.top,r.top));d=p.top<r.top?d.type.createAndFill(g):d.type.create(g,d.content)}l.push(d)}}i.push(e.child(a).copy(s.Fragment.from(l)))}var b=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(b),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],l=a.$from,c=a.$to,u=t.mapping.slice(r);t.replace(u.map(l.pos),u.map(c.pos),i?s.Slice.empty:n)}var f=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);f&&t.setSelection(f)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=h.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.top<=a.top?(i.top>0&&(e=s.resolve(o+r.map[i.left])),a.bottom<r.height&&(n=s.resolve(o+r.map[r.width*(r.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(o+r.map[a.left])),i.bottom<r.height&&(e=s.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=h.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=h.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.left<=a.left?(i.left>0&&(e=s.resolve(o+r.map[i.top*r.width])),a.right<r.width&&(n=s.resolve(o+r.map[r.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(o+r.map[a.top*r.width])),i.right<r.width&&(e=s.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new A(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);x.prototype.visible=!1,i.Selection.jsonID("cell",x);var A=function(e,t){this.anchor=e,this.head=t};function T(e){if(!(e.selection instanceof x))return null;var t=[];return e.selection.forEachCell((function(e,n){t.push(a.Decoration.node(n,n+e.nodeSize,{class:"selectedCell"}))})),a.DecorationSet.create(e.doc,t)}function V(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(e){return Number(e)})):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var a in t){var s=t[a].getFromDOM,l=s&&s(e);null!=l&&(i[a]=l)}return i}function j(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function E(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}function P(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,l=[];if("row"==i)for(var c=0;c<t.childCount;c++){var u=t.child(c).content,f=c?0:Math.max(0,n-1),p=c<t.childCount-1?0:Math.max(0,r-1);(f||p)&&(u=N(E(a).row,new s.Slice(u,f,p)).content),l.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;l.push(n||r?N(E(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,l=a.rowspan,c=a.colspan,u=r;u<r+l;u++)n[u]=(n[u]||0)+c;for(var f=0,p=0;p<n.length;p++)f=Math.max(f,n[p]);for(var d=0;d<n.length;d++)if(d>=t.length&&t.push(s.Fragment.empty),n[d]<f){for(var h=E(e).cell.createAndFill(),v=[],m=n[d];m<f;m++)v.push(h);t[d]=t[d].append(s.Fragment.from(v))}return{height:t.length,width:f,rows:t}}(a,l)}function N(e,t){var n=e.createAndFill();return new l.Transform(n).replace(0,n.content.size,t).doc}function H(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],l=[],c=0;c<i.length;c++){for(var u=i[c],f=[],p=a[c]||0,d=0;p<t;d++){var h=u.child(d%u.childCount);p+h.attrs.colspan>t&&(h=h.type.create(_(h.attrs,h.attrs.colspan,p+h.attrs.colspan-t),h.content)),f.push(h),p+=h.attrs.colspan;for(var v=1;v<h.attrs.rowspan;v++)a[c+v]=(a[c+v]||0)+h.attrs.colspan}l.push(s.Fragment.from(f))}i=l,r=t}if(o!=n){for(var m=[],y=0,g=0;y<n;y++,g++){for(var b=[],w=i[g%o],k=0;k<w.childCount;k++){var O=w.child(k);y+O.attrs.rowspan>n&&(O=O.type.create(S(O.attrs,"rowspan",n-O.attrs.rowspan),O.content)),b.push(O)}m.push(s.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}function L(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;for(var l=!1,c=o;c<i;c++){var u=a*t.width+c,f=t.map[u];if(t.map[u-t.width]==f){l=!0;var p=n.nodeAt(f),d=t.findCell(f),h=d.top,v=d.left;e.setNodeMarkup(e.mapping.slice(s).map(f+r),null,S(p.attrs,"rowspan",a-h)),e.insert(e.mapping.slice(s).map(t.positionAt(a,v,n)),p.type.createAndFill(S(p.attrs,"rowspan",h+p.attrs.rowspan-a))),c+=p.attrs.colspan-1}}return l}function D(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;for(var l=!1,c=o;c<i;c++){var u=c*t.width+a,f=t.map[u];if(t.map[u-1]==f){l=!0;var p=n.nodeAt(f),d=t.colCount(f),h=e.mapping.slice(s).map(f+r);e.setNodeMarkup(h,null,_(p.attrs,a-d,p.attrs.colspan-(a-d))),e.insert(h+p.nodeSize,p.type.createAndFill(_(p.attrs,0,a-d))),c+=p.attrs.rowspan-1}}return l}function I(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=h.get(i),l=r.top,c=r.left,u=c+o.width,f=l+o.height,p=e.tr,d=0;function v(){i=n?p.doc.nodeAt(n-1):p.doc,a=h.get(i),d=p.mapping.maps.length}(function(e,t,n,r,o,i,a){var l,c,u=E(e.doc.type.schema);if(o>t.width)for(var f=0,p=0;f<t.height;f++){var d=n.child(f);p+=d.nodeSize;var h=[],v=void 0;v=null==d.lastChild||d.lastChild.type==u.cell?l||(l=u.cell.createAndFill()):c||(c=u.header_cell.createAndFill());for(var m=t.width;m<o;m++)h.push(v);e.insert(e.mapping.slice(a).map(p-1+r),h)}if(i>t.height){for(var y=[],g=0,b=(t.height-1)*t.width;g<Math.max(t.width,o);g++){var w=!(g>=t.width)&&n.nodeAt(t.map[b+g]).type==u.header_cell;y.push(w?c||(c=u.header_cell.createAndFill()):l||(l=u.cell.createAndFill()))}for(var k=u.row.create(null,s.Fragment.from(y)),O=[],M=t.height;M<i;M++)O.push(k);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),O)}return!(!l&&!c)})(p,a,i,n,u,f,d)&&v(),L(p,a,i,n,c,u,l,d)&&v(),L(p,a,i,n,c,u,f,d)&&v(),D(p,a,i,n,l,f,c,d)&&v(),D(p,a,i,n,l,f,u,d)&&v();for(var m=l;m<f;m++){var y=a.positionAt(m,c,i),g=a.positionAt(m,u,i);p.replace(p.mapping.slice(d).map(y+n),p.mapping.slice(d).map(g+n),new s.Slice(o.rows[m-l],0,0))}v(),p.setSelection(new x(p.doc.resolve(n+a.positionAt(l,c,i)),p.doc.resolve(n+a.positionAt(f-1,u-1,i)))),t(p)}A.prototype.map=function(e){return new A(e.map(this.anchor),e.map(this.head))},A.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&O(t,n)?new x(t,n):i.Selection.near(n,1)};var R=c.keydownHandler({ArrowLeft:F("horiz",-1),ArrowRight:F("horiz",1),ArrowUp:F("vert",-1),ArrowDown:F("vert",1),"Shift-ArrowLeft":z("horiz",-1),"Shift-ArrowRight":z("horiz",1),"Shift-ArrowUp":z("vert",-1),"Shift-ArrowDown":z("vert",1),Backspace:B,"Mod-Backspace":B,Delete:B,"Mod-Delete":B});function $(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function F(e,t){return function(n,r,o){var a=n.selection;if(a instanceof x)return $(n,r,i.Selection.near(a.$headCell,t));if("horiz"!=e&&!a.empty)return!1;var s=K(o,e,t);if(null==s)return!1;if("horiz"==e)return $(n,r,i.Selection.near(n.doc.resolve(a.head+t),t));var l,c=n.doc.resolve(s),u=M(c,e,t);return l=u?i.Selection.near(u,1):t<0?i.Selection.near(n.doc.resolve(c.before(-1)),-1):i.Selection.near(n.doc.resolve(c.after(-1)),1),$(n,r,l)}}function z(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof x)){var a=K(o,e,t);if(null==a)return!1;i=new x(n.doc.resolve(a))}var s=M(i.$headCell,e,t);return!!s&&$(n,r,new x(i.$anchorCell,s))}}function B(e,t){var n=e.selection;if(!(n instanceof x))return!1;if(t){var r=e.tr,o=E(e.schema).cell.createAndFill().content;n.forEachCell((function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))})),r.docChanged&&t(r)}return!0}function J(e,t){var n=y(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new x(n))),!0)}function W(e,t,n){if(!g(e.state))return!1;var r=P(n),o=e.state.selection;if(o instanceof x){r||(r={width:1,height:1,rows:[s.Fragment.from(N(E(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=h.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=H(r,l.right-l.left,l.bottom-l.top),I(e.state,e.dispatch,a,l,r),!0}if(r){var c=b(e.state),u=c.start(-1);return I(e.state,e.dispatch,u,h.get(c.node(-1)).findCell(c.pos-u),r),!0}return!1}function q(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=G(e,t.target);if(t.shiftKey&&e.state.selection instanceof x)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=y(e.state.selection.$anchor))&&Q(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}function o(t,n){var r=Q(e,n),o=null==m.getState(e.state);if(!r||!O(t,r)){if(!o)return;r=t}var i=new x(t,r);if(o||!e.state.selection.eq(i)){var a=e.state.tr.setSelection(i);o&&a.setMeta(m,t.pos),e.dispatch(a)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=m.getState(e.state)&&e.dispatch(e.state.tr.setMeta(m,-1))}function a(n){var a,s=m.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(G(e,n.target)!=r&&!(a=Q(e,t)))return i();a&&o(a,n)}}function K(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var a=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:a.childCount))return null;if("cell"==a.type.spec.tableRole||"header_cell"==a.type.spec.tableRole){var s=r.before(o),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?s:null}}return null}function G(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?y(e.state.doc.resolve(n.pos)):null}function Z(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=h.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,a,s=[],l=0;l<o.height;l++)s.push(0);for(var c=0;c<o.problems.length;c++){var u=o.problems[c];if("collision"==u.type){for(var f=t.nodeAt(u.pos),p=0;p<f.attrs.rowspan;p++)s[u.row+p]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,_(f.attrs,f.attrs.colspan-u.n,u.n))}else if("missing"==u.type)s[u.row]+=u.n;else if("overlong_rowspan"==u.type){var d=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(d.attrs,"rowspan",d.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var v=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(v.attrs,"colwidth",u.colwidth))}}for(var m=0;m<s.length;m++)s[m]&&(null==i&&(i=m),a=m);for(var y=0,g=n+1;y<o.height;y++){var b=t.child(y),w=g+b.nodeSize,k=s[y];if(k>0){var O="cell";b.firstChild&&(O=b.firstChild.type.spec.tableRole);for(var M=[],C=0;C<k;C++)M.push(E(e.schema)[O].createAndFill());var x=0!=y&&i!=y-1||a!=y?w-1:g+1;r.insert(r.mapping.map(x),M)}g=w}return r}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,a=n.childCount;e:for(var s=0,l=0;s<a;s++){for(var c=n.child(s),u=l,f=Math.min(i,s+3);u<f;u++)if(t.child(u)==c){l=u+1,r+=c.nodeSize;continue e}o(c,r),l<i&&t.child(l).sameMarkup(c)?e(t.child(l),c,r+1,o):c.nodesBetween(0,c.content.size,o,r+1),r+=c.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function U(e){var t,n=e.selection,r=b(e),o=r.node(-1),i=r.start(-1),a=h.get(o);return(t=n instanceof x?a.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):a.findCell(r.pos-i)).tableStart=i,t.map=a,t.table=o,t}function X(e,t,n){var r=t.map,o=t.tableStart,i=t.table,a=n>0?-1:0;(function(e,t,n){for(var r=E(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(r,i,n+a)&&(a=0==n||n==r.width?null:0);for(var s=0;s<r.height;s++){var l=s*r.width+n;if(n>0&&n<r.width&&r.map[l-1]==r.map[l]){var c=r.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(o+c),null,C(u.attrs,n-r.colCount(c))),s+=u.attrs.rowspan-1}else{var f=null==a?E(i.type.schema).cell:i.nodeAt(r.map[l+a]).type,p=r.positionAt(s,n,i);e.insert(e.mapping.map(o+p),f.createAndFill())}}return e}function Y(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=e.mapping.maps.length,s=0;s<r.height;){var l=s*r.width+n,c=r.map[l],u=o.nodeAt(c);if(n>0&&r.map[l-1]==c||n<r.width-1&&r.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,_(u.attrs,n-r.colCount(c)));else{var f=e.mapping.slice(a).map(i+c);e.delete(f,f+u.nodeSize)}s+=u.attrs.rowspan}}function ee(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,a=o,s=0;s<n;s++)a+=i.child(s).nodeSize;var l=[],c=n>0?-1:0;(function(e,t,n){for(var r=E(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(r,i,n+c)&&(c=0==n||n==r.height?null:0);for(var u=0,f=r.width*n;u<r.width;u++,f++)if(n>0&&n<r.height&&r.map[f]==r.map[f-r.width]){var p=r.map[f],d=i.nodeAt(p).attrs;e.setNodeMarkup(o+p,null,S(d,"rowspan",d.rowspan+1)),u+=d.colspan-1}else{var h=null==c?E(i.type.schema).cell:i.nodeAt(r.map[f+c*r.width]).type;l.push(h.createAndFill())}return e.insert(a,E(i.type.schema).row.create(null,l)),e}function te(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=0,s=0;s<n;s++)a+=o.child(s).nodeSize;var l=a+o.child(n).nodeSize,c=e.mapping.maps.length;e.delete(a+i,l+i);for(var u=0,f=n*r.width;u<r.width;u++,f++){var p=r.map[f];if(n>0&&p==r.map[f-r.width]){var d=o.nodeAt(p).attrs;e.setNodeMarkup(e.mapping.slice(c).map(p+i),null,S(d,"rowspan",d.rowspan-1)),u+=d.colspan-1}else if(n<r.width&&p==r.map[f+r.width]){var h=o.nodeAt(p),v=h.type.create(S(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),m=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(c).map(i+m),v),u+=h.attrs.colspan-1}}}function ne(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function re(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function oe(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!g(t))return!1;if(n){for(var r=E(t.schema),o=U(t),i=t.tr,a=o.map.cellsInRect("column"==e?new d(o.left,0,o.right,o.map.height):"row"==e?new d(0,o.top,o.map.width,o.bottom):o),s=a.map((function(e){return o.table.nodeAt(e)})),l=0;l<a.length;l++)s[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[l],r.cell,s[l].attrs);if(0==i.steps.length)for(var c=0;c<a.length;c++)i.setNodeMarkup(o.tableStart+a[c],r.header_cell,s[c].attrs);n(i)}return!0}}(e):function(t,n){if(!g(t))return!1;if(n){var r=E(t.schema),o=U(t),i=t.tr,a=re("row",o,r),s=re("column",o,r),l=("column"===e?a:"row"===e&&s)?1:0,c="column"==e?new d(0,l,1,o.map.height):"row"==e?new d(l,0,o.map.width,1):o,u="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)})),n(i)}return!0}}var ie=oe("row",{useDeprecatedLogic:!0}),ae=oe("column",{useDeprecatedLogic:!0}),se=oe("cell",{useDeprecatedLogic:!0});var le=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ce(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function ce(e,t,n,r,o,i){for(var a=0,s=!0,l=t.firstChild,c=e.firstChild,u=0,f=0;u<c.childCount;u++)for(var p=c.child(u).attrs,d=p.colspan,h=p.colwidth,v=0;v<d;v++,f++){var m=o==f?i:h&&h[v],y=m?m+"px":"";a+=m||r,m||(s=!1),l?(l.style.width!=y&&(l.style.width=y),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=y}for(;l;){var g=l.nextSibling;l.parentNode.removeChild(l),l=g}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}le.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,ce(e,this.colgroup,this.table,this.cellMinWidth),!0)},le.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var ue=new i.PluginKey("tableColumnResizing");var fe=function(e,t){this.activeHandle=e,this.dragging=t};function pe(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY}).pos,o=y(e.state.doc.resolve(r));if(!o)return-1;if("right"==n)return o.pos;var i=h.get(o.node(-1)),a=o.start(-1),s=i.map.indexOf(o.pos-a);return s%i.width==0?-1:a+i.map[s-1]}function de(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function he(e,t){e.dispatch(e.state.tr.setMeta(ue,{setHandle:t}))}function ve(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}fe.prototype.apply=function(e){var t=this,n=e.getMeta(ue);if(n&&null!=n.setHandle)return new fe(n.setHandle,null);if(n&&void 0!==n.setDragging)return new fe(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);w(e.doc.resolve(r))||(r=null),t=new fe(r,t.dragging)}return t},t.tableEditing=function(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:m,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(m);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:T,handleDOMEvents:{mousedown:q},createSelectionBetween:function(e){if(null!=m.getState(e.state))return e.state.selection},handleTripleClick:J,handleKeyDown:R,handlePaste:W},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,a=(t||e).selection,s=(t||e).doc;if(a instanceof i.NodeSelection&&(o=a.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=x.create(s,a.from);else if("row"==o){var l=s.resolve(a.from+1);r=x.rowSelection(l,l)}else if(!n){var c=h.get(a.node),u=a.from+1,f=u+c.map[c.width*c.height-1];r=x.create(s,u+1,f)}}else a instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(a)?r=i.TextSelection.create(s,a.from):a instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var l=o.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(a)&&(r=i.TextSelection.create(s,a.$from.start(),a.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,Z(r,n),t)}})},t.fixTables=Z,t.handlePaste=W,t.cellAround=y,t.isInTable=g,t.selectionCell=b,t.moveCellForward=k,t.inSameTable=O,t.findCell=function(e){return h.get(e.node(-1)).findCell(e.pos-e.start(-1))},t.colCount=function(e){return h.get(e.node(-1)).colCount(e.pos-e.start(-1))},t.nextCell=M,t.tableNodes=function(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return V(e,t)}}],toDOM:function(e){return["td",j(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return V(e,t)}}],toDOM:function(e){return["th",j(e,t),0]}}}},t.CellSelection=x,t.TableMap=h,t.columnResizing=function(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=le);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:ue,state:{init:function(e,t){return this.spec.props.nodeViews[E(t.schema).table.name]=function(e,t){return new r(e,n,t)},new fe(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return ue.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=ue.getState(e.state);if(!i.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var l=a.getBoundingClientRect(),c=l.left,u=l.right;t.clientX-c<=n?s=pe(e,t,"left"):u-t.clientX<=n&&(s=pe(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){var f=e.state.doc.resolve(s),p=f.node(-1),d=h.get(p),v=f.start(-1);if(d.colCount(f.pos-v)+f.nodeAfter.attrs.colspan-1==d.width-1)return}he(e,s)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=ue.getState(e.state);t.activeHandle>-1&&!t.dragging&&he(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=ue.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,l=r;if(o)for(var c=0;c<r;c++)o[c]&&(s-=o[c],l--);return s/l}(e,r.activeHandle,o.attrs);function a(t){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var r=ue.getState(e.state);r.dragging&&(!function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=h.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr,c=0;c<i.height;c++){var u=c*i.width+s;if(!c||i.map[u]!=i.map[u-i.width]){var f=i.map[u],p=o.nodeAt(f).attrs,d=1==p.colspan?0:s-i.colCount(f);if(!p.colwidth||p.colwidth[d]!=n){var v=p.colwidth?p.colwidth.slice():ve(p.colspan);v[d]=n,l.setNodeMarkup(a+f,null,S(p,"colwidth",v))}}}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,de(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ue,{setDragging:null})))}function s(t){if(!t.which)return a(t);var r=ue.getState(e.state),o=de(r.dragging,t,n);!function(e,t,n,r){var o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=h.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;ce(i,l.firstChild,l,r,s,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(ue,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=ue.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=h.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,c=0;c<i.height;c++){var u=l+c*i.width-1;if(!(l!=i.width&&i.map[u]==i.map[u+1]||0!=c&&i.map[u-1]==i.map[u-1-i.width])){var f=i.map[u],p=s+f+o.nodeAt(f).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",n.push(a.Decoration.widget(p,d))}}return a.DecorationSet.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})},t.columnResizingPluginKey=ue,t.updateColumnsOnResize=ce,t.__pastedCells=P,t.__insertCells=I,t.__clipCells=H,t.addColumn=X,t.addColumnBefore=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(X(e.tr,n,n.left))}return!0},t.addColumnAfter=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(X(e.tr,n,n.right))}return!0},t.removeColumn=Y,t.deleteColumn=function(e,t){if(!g(e))return!1;if(t){var n=U(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;Y(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0},t.addRow=ee,t.addRowBefore=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(ee(e.tr,n,n.top))}return!0},t.addRowAfter=function(e,t){if(!g(e))return!1;if(t){var n=U(e);t(ee(e.tr,n,n.bottom))}return!0},t.removeRow=te,t.deleteRow=function(e,t){if(!g(e))return!1;if(t){var n=U(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;te(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=h.get(n.table);t(r)}return!0},t.mergeCells=function(e,t){var n=e.selection;if(!(n instanceof x)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=U(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,a=i,s=(t.bottom-1)*n+t.left,l=i+(t.right-t.left-1),c=t.top;c<t.bottom;c++){if(t.left>0&&o[a]==o[a-1]||t.right<n&&o[l]==o[l+1])return!0;a+=n,l+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[s]==o[s+n])return!0;i++,s++}return!1}(o,r))return!1;if(t){for(var i,a,l=e.tr,c={},u=s.Fragment.empty,f=r.top;f<r.bottom;f++)for(var p=r.left;p<r.right;p++){var d=o.map[f*o.width+p],h=r.table.nodeAt(d);if(!c[d])if(c[d]=!0,null==i)i=d,a=h;else{ne(h)||(u=u.append(h.content));var v=l.mapping.map(d+r.tableStart);l.delete(v,v+h.nodeSize)}}if(l.setNodeMarkup(i+r.tableStart,null,S(C(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var m=i+1+a.content.size,y=ne(a)?i+1:m;l.replaceWith(y+r.tableStart,m+r.tableStart,u)}l.setSelection(new x(l.doc.resolve(i+r.tableStart))),t(l)}return!0},t.splitCell=function(e,t){var n,r,o=e.selection;if(o instanceof x){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{if(!(n=function(e){for(var t=e.depth-1;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(o.$from)))return!1;r=y(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){var i=n.attrs,a=[],s=i.colwidth;i.rowspan>1&&(i=S(i,"rowspan",1)),i.colspan>1&&(i=S(i,"colspan",1));for(var l=U(e),c=e.tr,u=0;u<l.right-l.left;u++)a.push(s?S(i,"colwidth",s&&s[u]?[s[u]]:null):i);for(var f,p=E(e.schema)[n.type.spec.tableRole],d=0;d<l.bottom;d++)if(d>=l.top){var h=l.map.positionAt(d,l.left,l.table);d==l.top&&(h+=n.nodeSize);for(var v=l.left,m=0;v<l.right;v++,m++)v==l.left&&d==l.top||c.insert(f=c.mapping.map(h+l.tableStart,1),p.createAndFill(a[m]))}c.setNodeMarkup(r,null,a[0]),o instanceof x&&c.setSelection(new x(c.doc.resolve(o.$anchorCell.pos),f&&c.doc.resolve(f))),t(c)}return!0},t.setCellAttr=function(e,t){return function(n,r){if(!g(n))return!1;var o=b(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof x?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,S(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,S(o.nodeAfter.attrs,e,t)),r(i)}return!0}},t.toggleHeader=oe,t.toggleHeaderRow=ie,t.toggleHeaderColumn=ae,t.toggleHeaderCell=se,t.goToNextCell=function(e){return function(t,n){if(!g(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var a=e.node(-1),s=e.indexAfter(-1),l=e.after();s<a.childCount;s++){var c=a.child(s);if(c.childCount)return l+1;l+=c.nodeSize}}}(b(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,k(o))).scrollIntoView())}return!0}}},t.deleteTable=function(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(6),i=Object.create(null),a=function(e,t,n){this.ranges=n||[new l(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},s={anchor:{},head:{},from:{},to:{},$from:{},$to:{},empty:{}};s.anchor.get=function(){return this.$anchor.pos},s.head.get=function(){return this.$head.pos},s.from.get=function(){return this.$from.pos},s.to.get=function(){return this.$to.pos},s.$from.get=function(){return this.ranges[0].$from},s.$to.get=function(){return this.ranges[0].$to},s.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},a.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},a.prototype.replace=function(e,t){void 0===t&&(t=r.Slice.empty);for(var n=t.content.lastChild,o=null,i=0;i<t.openEnd;i++)o=n,n=n.lastChild;for(var a=e.steps.length,s=this.ranges,l=0;l<s.length;l++){var c=s[l],u=c.$from,f=c.$to,p=e.mapping.slice(a);e.replaceRange(p.map(u.pos),p.map(f.pos),l?r.Slice.empty:t),0==l&&m(e,a,(n?n.isInline:o&&o.isTextblock)?-1:1)}},a.prototype.replaceWith=function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,l=e.mapping.slice(n),c=l.map(a.pos),u=l.map(s.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),m(e,n,t.isInline?-1:1))}},a.findFrom=function(e,t,n){var r=e.parent.inlineContent?new c(e):v(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?v(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):v(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},a.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new d(e.node(0))},a.atStart=function(e){return v(e,e,0,0,1)||new d(e)},a.atEnd=function(e){return v(e,e,e.content.size,e.childCount,-1)||new d(e)},a.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},a.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},a.prototype.getBookmark=function(){return c.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(a.prototype,s),a.prototype.visible=!0;var l=function(e,t){this.$from=e,this.$to=t},c=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var a=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!a)return e.near(r,o);r=a.$head}return n.parent.inlineContent||(0==i||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0)&&(n=r),new t(n,r)},Object.defineProperties(t.prototype,n),t}(a);a.jsonID("text",c);var u=function(e,t){this.anchor=e,this.head=t};u.prototype.map=function(e){return new u(e.map(this.anchor),e.map(this.head))},u.prototype.resolve=function(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))};var f=function(e){function t(t){var n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,r),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,a=o.pos,s=n.resolve(a);return i?e.near(s):new t(s)},t.prototype.content=function(){return new r.Slice(r.Fragment.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new p(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(a);f.prototype.visible=!1,a.jsonID("node",f);var p=function(e){this.anchor=e};p.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,r=t.pos;return n?new u(r,r):new p(r)},p.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&f.isSelectable(n)?new f(t):a.near(t)};var d=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return h},t}(a);a.jsonID("all",d);var h={map:function(){return this},resolve:function(e){return new d(e)}};function v(e,t,n,r,o,i){if(t.inlineContent)return c.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&f.isSelectable(s))return f.create(e,n-(o<0?s.nodeSize:0))}else{var l=v(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}}function m(e,t,n){var r=e.steps.length-1;if(!(r<t)){var i,s=e.steps[r];if(s instanceof o.ReplaceStep||s instanceof o.ReplaceAroundStep)e.mapping.maps[r].forEach((function(e,t,n,r){null==i&&(i=r)})),e.setSelection(a.near(e.doc.resolve(i),n))}}var y=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return n.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},t.prototype.setSelection=function(e){return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(a.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.Transform);function g(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=g(t.init,n),this.apply=g(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||a.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],k=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))}))},O=function(e){this.config=e},M={schema:{},plugins:{},tr:{}};M.schema.get=function(){return this.config.schema},M.plugins.get=function(){return this.config.plugins},O.prototype.apply=function(e){return this.applyTransaction(e).state},O.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0},O.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,l=r?r[i].state:this,c=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}},O.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new O(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}for(var i=0;i<S.length;i++)S[i](this,e,t);return t},M.tr.get=function(){return new y(this)},O.create=function(e){for(var t=new k(e.schema||e.doc.type.schema,e.plugins),n=new O(t),r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n},O.prototype.reconfigure=function(e){for(var t=new k(e.schema||this.schema,e.plugins),n=t.fields,r=new O(t),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r},O.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t},O.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var o=new k(e.schema,e.plugins),i=new O(o);return o.fields.forEach((function(o){if("doc"==o.name)i.doc=r.Node.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=a.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var s in n){var l=n[s],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,s))return void(i[o.name]=c.fromJSON.call(l,e,t[s],i))}i[o.name]=o.init(e,i)}})),i},O.addApplyListener=function(e){S.push(e)},O.removeApplyListener=function(e){var t=S.indexOf(e);t>-1&&S.splice(t,1)},Object.defineProperties(O.prototype,M);var S=[];var _=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:x("plugin")};_.prototype.getState=function(e){return e[this.key]};var C=Object.create(null);function x(e){return e in C?e+"$"+ ++C[e]:(C[e]=0,e+"$")}var A=function(e){void 0===e&&(e="key"),this.key=x(e)};A.prototype.get=function(e){return e.config.pluginsByKey[this.key]},A.prototype.getState=function(e){return e[this.key]},t.Selection=a,t.SelectionRange=l,t.TextSelection=c,t.NodeSelection=f,t.AllSelection=d,t.Transaction=y,t.EditorState=O,t.Plugin=_,t.PluginKey=A},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(28))&&"object"==typeof r&&"default"in r?r.default:r;var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},a={firstChild:{},lastChild:{},childCount:{}};i.prototype.nodesBetween=function(e,t,n,r,o){void 0===r&&(r=0);for(var i=0,a=0;a<t;i++){var s=this.content[i],l=a+s.nodeSize;if(l>e&&!1!==n(s,r+a,o,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,e-c),Math.min(s.content.size,t-c),n,r+c)}a=l}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf&&r?(o+=r,i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new i(r,this.size+e.size)},i.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],r=0;if(t>e)for(var o=0,a=0;a<t;o++){var s=this.content[o],l=a+s.nodeSize;l>e&&((a<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),r+=s.nodeSize),a=l}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},i.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},i.prototype.maybeChild=function(e){return this.content[e]},i.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}},i.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,r){for(var o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;var i=t.child(o),a=n.child(o);if(i!=a){if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(var s=0;i.text[s]==a.text[s];s++)r++;return r}if(i.content.size||a.content.size){var l=e(i.content,a.content,r+1);if(null!=l)return l}r+=i.nodeSize}else r+=i.nodeSize}}(this,e,t)},i.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,r,o){for(var i=t.childCount,a=n.childCount;;){if(0==i||0==a)return i==a?null:{a:r,b:o};var s=t.child(--i),l=n.child(--a),c=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:r,b:o};if(s.isText&&s.text!=l.text){for(var u=0,f=Math.min(s.text.length,l.text.length);u<f&&s.text[s.text.length-u-1]==l.text[l.text.length-u-1];)u++,r--,o--;return{a:r,b:o}}if(s.content.size||l.content.size){var p=e(s.content,l.content,r-1,o-1);if(p)return p}r-=c,o-=c}else r-=c,o-=c}}(this,e,t,n)},i.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return l(0,e);if(e==this.size)return l(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?l(n+1,o):l(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;r<e.length;r++){var o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new i(t||e,n)},i.from=function(e){if(!e)return i.empty;if(e instanceof i)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new i([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,a);var s={index:0,offset:0};function l(e,t){return s.index=e,s.offset=t,s}function c(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!c(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t)||!c(e[o],t[o]))return!1;for(var i in t)if(!(i in e))return!1}return!0}i.empty=new i([],0);var u=function(e,t){this.type=e,this.attrs=t};function f(e){var t=Error.call(this,e);return t.__proto__=f.prototype,t}u.prototype.addToSet=function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},u.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},u.prototype.eq=function(e){return this==e||this.type==e.type&&c(this.attrs,e.attrs)},u.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},u.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},u.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},u.setFrom=function(e){if(!e||0==e.length)return u.none;if(e instanceof u)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},u.none=[],f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,f.prototype.name="ReplaceError";var p=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},d={size:{}};function h(e,t,n){if(n.openStart>e.depth)throw new f("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new f("Inconsistent open depths");return function e(t,n,r,o){var a=t.index(o),s=t.node(o);if(a==n.index(o)&&o<t.depth-r.openStart){var l=e(t,n,r,o+1);return s.copy(s.content.replaceChild(a,l))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){var c=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=c.start,f=c.end;return b(s,function e(t,n,r,o,a){var s=t.depth>a&&m(t,n,a+1),l=o.depth>a&&m(r,o,a+1),c=[];g(null,t,a,c),s&&l&&n.index(a)==r.index(a)?(v(s,l),y(b(s,e(t,n,r,o,a+1)),c)):(s&&y(b(s,w(t,n,a+1)),c),g(n,r,a,c),l&&y(b(l,w(r,o,a+1)),c));return g(o,null,a,c),new i(c)}(t,u,f,n,o))}var p=t.parent,d=p.content;return b(p,d.cut(0,t.parentOffset).append(r.content).append(d.cut(n.parentOffset)))}return b(s,w(t,n,o))}(e,t,n,0)}function v(e,t){if(!t.type.compatibleContent(e.type))throw new f("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){var r=e.node(n);return v(r,t.node(n)),r}function y(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(y(e.nodeAfter,r),i++));for(var s=i;s<a;s++)y(o.child(s),r);t&&t.depth==n&&t.textOffset&&y(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new f("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(g(null,e,n,r),e.depth>n)&&y(b(m(e,t,n+1),w(e,t,n+1)),r);return g(t,null,n,r),new i(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n),a=i.index,s=i.offset,l=t.maybeChild(a);if(s==n||l.isText)return o&&!o.canReplace(a,a,r)?null:t.cut(0,n).append(r).append(t.cut(n));var c=e(l.content,n-s-1,r);return c&&t.replaceChild(a,l.copy(c))}(this.content,e+this.openStart,t,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(e,t){return new p(function e(t,n,r){var o=t.findIndex(n),i=o.index,a=o.offset,s=t.maybeChild(i),l=t.findIndex(r),c=l.index,u=l.offset;if(a==n||s.isText){if(u!=r&&!t.child(c).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=c)throw new RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-a-1,r-a-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},p.fromJSON=function(e,t){if(!t)return p.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(e,t.content),t.openStart||0,t.openEnd||0)},p.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new p(e,n,r)},Object.defineProperties(p.prototype,d),p.empty=new p(i.empty,0,0);var k=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},O={parent:{},doc:{},textOffset:{},nodeAfter:{},nodeBefore:{}};k.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},O.parent.get=function(){return this.node(this.depth)},O.doc.get=function(){return this.node(0)},k.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},k.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},k.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},k.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},k.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},k.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},k.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},O.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},O.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},O.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},k.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return u.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i},k.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},k.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},k.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new C(this,e,n)},k.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},k.prototype.max=function(e){return e.pos>this.pos?e:this},k.prototype.min=function(e){return e.pos<this.pos?e:this},k.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},k.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var a=i.content.findIndex(o),s=a.index,l=a.offset,c=o-l;if(n.push(i,s,r+l),!c)break;if((i=i.child(s)).isText)break;o=c-1,r+=l+1}return new k(t,n,o)},k.resolveCached=function(e,t){for(var n=0;n<M.length;n++){var r=M[n];if(r.pos==t&&r.doc==e)return r}var o=M[S]=k.resolve(e,t);return S=(S+1)%_,o},Object.defineProperties(k.prototype,O);var M=[],S=0,_=12,C=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},x={start:{},end:{},parent:{},startIndex:{},endIndex:{}};x.start.get=function(){return this.$from.before(this.depth+1)},x.end.get=function(){return this.$to.after(this.depth+1)},x.parent.get=function(){return this.$from.node(this.depth)},x.startIndex.get=function(){return this.$from.index(this.depth)},x.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(C.prototype,x);var A=Object.create(null),T=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||i.empty,this.marks=r||u.none},V={nodeSize:{},childCount:{},textContent:{},firstChild:{},lastChild:{},isBlock:{},isTextblock:{},inlineContent:{},isInline:{},isText:{},isLeaf:{},isAtom:{}};V.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},V.childCount.get=function(){return this.content.childCount},T.prototype.child=function(e){return this.content.child(e)},T.prototype.maybeChild=function(e){return this.content.maybeChild(e)},T.prototype.forEach=function(e){this.content.forEach(e)},T.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},T.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},V.textContent.get=function(){return this.textBetween(0,this.content.size,"")},T.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},V.firstChild.get=function(){return this.content.firstChild},V.lastChild.get=function(){return this.content.lastChild},T.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},T.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},T.prototype.hasMarkup=function(e,t,n){return this.type==e&&c(this.attrs,t||e.defaultAttrs||A)&&u.sameSet(this.marks,n||u.none)},T.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},T.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},T.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},T.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return p.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i).content.cut(r.pos-a,o.pos-a);return new p(s,r.depth-i,o.depth-i)},T.prototype.replace=function(e,t,n){return h(this.resolve(e),this.resolve(t),n)},T.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}},T.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},T.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},T.prototype.resolve=function(e){return k.resolveCached(this,e)},T.prototype.resolveNoCache=function(e){return k.resolve(this,e)},T.prototype.rangeHasMark=function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r},V.isBlock.get=function(){return this.type.isBlock},V.isTextblock.get=function(){return this.type.isTextblock},V.inlineContent.get=function(){return this.type.inlineContent},V.isInline.get=function(){return this.type.isInline},V.isText.get=function(){return this.type.isText},V.isLeaf.get=function(){return this.type.isLeaf},V.isAtom.get=function(){return this.type.isAtom},T.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),E(this.marks,e)},T.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},T.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,r,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var l=r;l<o;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0},T.prototype.canReplaceWith=function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd},T.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},T.prototype.defaultContentType=function(e){return this.contentMatchAt(e).defaultType},T.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach((function(e){return e.check()}))},T.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},T.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=i.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)},Object.defineProperties(T.prototype,V);var j=function(e){function t(t,n,r,o){if(e.call(this,t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{},nodeSize:{}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):E(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(T);function E(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var P=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},N={inlineContent:{},defaultType:{},edgeCount:{}};P.parse=function(e,t){var n=new H(e,t);if(null==n.next)return P.empty;var r=D(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),a=i>-1&&o[i+1];B(e,r).forEach((function(e){a||o.push(n,a=[]),-1==a.indexOf(e)&&a.push(e)}))}}))}));for(var i=t[r.join(",")]=new P(r.indexOf(e.length-1)>-1),a=0;a<o.length;a+=2){var s=o[a+1].sort(z);i.next.push(o[a],t[s.join(",")]||n(s))}return i}(B(e,0))}(function(e){var t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,i))}),[]);if("seq"==t.type)for(var a=0;;a++){var s=e(t.exprs[a],i);if(a==t.exprs.length-1)return s;o(s,i=n())}else{if("star"==t.type){var l=n();return r(i,l),o(e(t.expr,l),l),[r(l)]}if("plus"==t.type){var c=n();return o(e(t.expr,i),c),o(e(t.expr,c),c),[r(c)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){for(var u=i,f=0;f<t.min;f++){var p=n();o(e(t.expr,u),p),u=p}if(-1==t.max)o(e(t.expr,u),u);else for(var d=t.min;d<t.max;d++){var h=n();r(u,h),o(e(t.expr,u),h),u=h}return[r(u)]}if("name"==t.type)return[r(i,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}}(r));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s+=2){var l=o.next[s],c=o.next[s+1];a.push(l.name),!i||l.isText||l.hasRequiredAttrs()||(i=!1),-1==r.indexOf(c)&&r.push(c)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position")}}(o,n),o},P.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},P.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r},N.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},N.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},P.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},P.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var r=[this];return function o(a,s){var l=a.matchFragment(e,n);if(l&&(!t||l.validEnd))return i.from(s.map((function(e){return e.createAndFill()})));for(var c=0;c<a.next.length;c+=2){var u=a.next[c],f=a.next[c+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var p=o(f,s.concat(u));if(p)return p}}}(this,[])},P.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},P.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s+=2){var l=o.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in t||r.type&&!o.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:r}),t[l.name]=!0)}}},N.edgeCount.get=function(){return this.next.length>>1},P.prototype.edge=function(e){var t=e<<1;if(t>this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},P.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r<n.next.length;r+=2)-1==e.indexOf(n.next[r])&&t(n.next[r])}(this),e.map((function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o+=2)r+=(o?", ":"")+t.next[o].name+"->"+e.indexOf(t.next[o+1]);return r})).join("\n")},Object.defineProperties(P.prototype,N),P.empty=new P(!0);var H=function(e,t){this.string=e,this.nodeTypes=t,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.unshift()},L={next:{}};function D(e){var t=[];do{t.push(I(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function I(e){var t=[];do{t.push(R(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function R(e){for(var t=function(e){if(e.eat("(")){var t=D(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(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==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=F(e,t)}return t}function $(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function F(e,t){var n=$(e),r=n;return e.eat(",")&&(r="}"!=e.next?$(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function z(e,t){return e-t}function B(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,l=a.to;s||-1!=n.indexOf(l)||t(l)}}(t),n.sort(z)}function J(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function q(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Q(e[n]);return t}L.next.get=function(){return this.tokens[this.pos]},H.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},H.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(H.prototype,L);var K=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=q(n.attrs),this.defaultAttrs=J(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},G={isInline:{},isTextblock:{},isLeaf:{},isAtom:{}};G.isInline.get=function(){return!this.isBlock},G.isTextblock.get=function(){return this.isBlock&&this.inlineContent},G.isLeaf.get=function(){return this.contentMatch==P.empty},G.isAtom.get=function(){return this.isLeaf||this.spec.atom},K.prototype.hasRequiredAttrs=function(e){for(var t in this.attrs)if(this.attrs[t].isRequired&&(!e||!(t in e)))return!0;return!1},K.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},K.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)},K.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new T(this,this.computeAttrs(e),i.from(t),u.setFrom(n))},K.prototype.createChecked=function(e,t,n){if(t=i.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new T(this,this.computeAttrs(e),t,u.setFrom(n))},K.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=i.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t).fillBefore(i.empty,!0);return o?new T(this,e,t.append(o),u.setFrom(n)):null},K.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},K.prototype.allowedMarks=function(e){var t;if(null==this.markSet)return e;for(var n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:u.empty:e},K.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,r){return n[e]=new K(e,t,r)}));var r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,G);var Q=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},Z={isRequired:{}};Z.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Q.prototype,Z);var U=function(e,t,n,r){this.name=e,this.schema=n,this.spec=r,this.attrs=q(r.attrs),this.rank=t,this.excluded=null;var o=J(this.attrs);this.instance=o&&new u(this,o)};U.prototype.create=function(e){return!e&&this.instance?this.instance:new u(this,W(this.attrs,e))},U.compile=function(e,t){var n=Object.create(null),r=0;return e.forEach((function(e,o){return n[e]=new U(e,r++,t,o)})),n},U.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e.slice(0,t).concat(e.slice(t+1));return e},U.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},U.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var X=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=U.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],a=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[a]||(n[a]=P.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?Y(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var l in this.marks){var c=this.marks[l],u=c.spec.excludes;c.excluded=null==u?[c]:""==u?[]:Y(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=Object.create(null),this.cached.wrappings=Object.create(null)};function Y(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var l=e.marks[s];("_"==o||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}X.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},X.prototype.text=function(e,t){var n=this.nodes.text;return new j(n,n.defaultAttrs,e,u.setFrom(t))},X.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},X.prototype.nodeFromJSON=function(e){return T.fromJSON(this,e)},X.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},X.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)}))};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!0);return n.addAll(e,null,t.from,t.to),p.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;n<this.tags.length;n++){var r=this.tags[n];if(le(e,r.tag)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){var o=r.getAttrs(e);if(!1===o)continue;r.attrs=o}return r}}},ee.prototype.matchStyle=function(e,t,n){for(var r=0;r<this.styles.length;r++){var o=this.styles[r];if(!(0!=o.style.indexOf(e)||o.context&&!n.matchesContext(o.context)||o.style.length>e.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach((function(e){n(e=ce(e)),e.mark=t}))};for(var o in e.marks)r(o);var i;for(var a in e.nodes)i=void 0,(i=e.nodes[a].spec.parseDOM)&&i.forEach((function(e){n(e=ce(e)),e.node=a}));return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={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},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0};function oe(e){return(e?1:0)|("full"===e?2:0)}var ie=function(e,t,n,r,o,i){this.type=e,this.attrs=t,this.solid=r,this.match=o||(4&i?null:e.contentMatch),this.options=i,this.content=[],this.marks=n,this.activeMarks=u.none};ie.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(i.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},ie.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/\s+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var r=i.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r};var ae=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.pendingMarks=[];var r,o=t.topNode,i=oe(t.preserveWhitespace)|(n?4:0);r=o?new ie(o.type,o.attrs,u.none,!0,t.topMatch||o.type.contentMatch,i):new ie(n?null:e.schema.topNodeType,null,u.none,!0,null,i),this.nodes=[r],this.open=0,this.find=t.findPositions,this.needsBlock=!1},se={top:{},currentPos:{}};function le(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ce(e){var t={};for(var n in e)t[n]=e[n];return t}se.top.get=function(){return this.nodes[this.open]},ae.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o])}},ae.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/\S/.test(t)){if(1&n.options)2&n.options||(t=t.replace(/\r?\n|\r/g," "));else if(t=t.replace(/\s+/g," "),/^\s/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/\s$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},ae.prototype.addElement=function(e){var t=e.nodeName.toLowerCase();re.hasOwnProperty(t)&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&re.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||this.parser.matchTag(e,this);if(n?n.ignore:ne.hasOwnProperty(t))this.findInside(e);else if(!n||n.skip){n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,i=this.needsBlock;te.hasOwnProperty(t)&&(r=!0,o.type||(this.needsBlock=!0)),this.addAll(e),r&&this.sync(o),this.needsBlock=i}else this.addElementByRule(e,n)},ae.prototype.readStyles=function(e){for(var t=u.none,n=0;n<e.length;n+=2){var r=this.parser.matchStyle(e[n],e[n+1],this);if(r){if(r.ignore)return null;t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t)}}return t},ae.prototype.addElementByRule=function(e,t){var n,r,o,i=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs)):n=this.enter(r,t.attrs,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var a=this.top;if(r&&r.isLeaf)this.findInside(e);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return i.insertNode(e)}));else{var s=t.contentElement;"string"==typeof s?s=e.querySelector(s):"function"==typeof s&&(s=s(e)),s||(s=e),this.findAround(e,s,!0),this.addAll(s,n)}return n&&(this.sync(a),this.open--),o&&this.removePendingMark(o),!0},ae.prototype.addAll=function(e,t,n,r){for(var o=n||0,i=n?e.childNodes[n]:e.firstChild,a=null==r?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i),t&&te.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,o)},ae.prototype.findPlace=function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0},ae.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;this.applyPendingMarks(n),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));n.content.push(e.mark(r))}},ae.prototype.applyPendingMarks=function(e){for(var t=0;t<this.pendingMarks.length;t++){var n=this.pendingMarks[t];e.type&&!e.type.allowsMarkType(n.type)||n.isInSet(e.activeMarks)||(e.activeMarks=n.addToSet(e.activeMarks),this.pendingMarks.splice(t--,1))}},ae.prototype.enter=function(e,t,n){var r=this.findPlace(e.create(t));return r&&(this.applyPendingMarks(this.top),this.enterInner(e,t,!0,n)),r},ae.prototype.enterInner=function(e,t,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(e,t);var i=null==r?-5&o.options:oe(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ie(e,t,o.activeMarks,n,null,i)),this.open++},ae.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},ae.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ae.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ae.prototype.addPendingMark=function(e){this.pendingMarks.push(e)},ae.prototype.removePendingMark=function(e){var t=this.pendingMarks.lastIndexOf(e);if(t>-1)this.pendingMarks.splice(t,1);else{var n=this.top;n.activeMarks=e.removeFromSet(n.activeMarks)}},se.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},ae.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ae.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ae.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},ae.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ae.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var l=n[e];if(""==l){if(e==n.length-1||0==e)continue;for(;s>=i;s--)if(a(e-1,s))return!0;return!1}var c=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!c||c.name!=l&&-1==c.groups.indexOf(l))return!1;s--}return!0};return a(n.length-1,this.open)},ae.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},Object.defineProperties(ae.prototype,se);var ue=function(e,t){this.nodes=e||{},this.marks=t||{}};function fe(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pe(e){return e.document||window.document}ue.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=pe(t).createDocumentFragment());var o=n,i=null;return e.forEach((function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,a=0;n<i.length&&a<e.marks.length;){var s=e.marks[a];if(r.marks[s.type.name]){if(!s.eq(i[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<i.length;)o=i.pop(),i.pop();for(;a<e.marks.length;){var l=e.marks[a++],c=r.serializeMark(l,e.isInline,t);c&&(i.push(l,o),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(r.serializeNode(e,t))})),n},ue.prototype.serializeNode=function(e,t){void 0===t&&(t={});var n=ue.renderSpec(pe(t),this.nodes[e.type.name](e)),r=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,o,t):this.serializeFragment(e.content,t,o)}return r},ue.prototype.serializeNodeAndMarks=function(e,t){void 0===t&&(t={});for(var n=this.serializeNode(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},ue.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&ue.renderSpec(pe(n),r(e,t))},ue.renderSpec=function(e,t){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var n=e.createElement(t[0]),r=null,o=t[1],i=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o))for(var a in i=2,o)null!=o[a]&&n.setAttribute(a,o[a]);for(var s=i;s<t.length;s++){var l=t[s];if(0===l){if(s<t.length-1||s>i)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var c=ue.renderSpec(e,l),u=c.dom,f=c.contentDOM;if(n.appendChild(u),f){if(r)throw new RangeError("Multiple content holes");r=f}}return{dom:n,contentDOM:r}},ue.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new ue(this.nodesFromSchema(e),this.marksFromSchema(e)))},ue.nodesFromSchema=function(e){var t=fe(e.nodes);return t.text||(t.text=function(e){return e.text}),t},ue.marksFromSchema=function(e){return fe(e.marks)},t.Node=T,t.ResolvedPos=k,t.NodeRange=C,t.Fragment=i,t.Slice=p,t.ReplaceError=f,t.Mark=u,t.Schema=X,t.NodeType=K,t.MarkType=U,t.ContentMatch=P,t.DOMParser=ee,t.DOMSerializer=ue},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=Math.pow(2,16);function i(e){return 65535&e}var a=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},s=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};s.prototype.recover=function(e){var t=0,n=i(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/o}(e)},s.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},s.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},s.prototype._map=function(e,t,n){for(var r=0,i=this.inverted?2:1,s=this.inverted?1:2,l=0;l<this.ranges.length;l+=3){var c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;var u=this.ranges[l+i],f=this.ranges[l+s],p=c+u;if(e<=p){var d=c+r+((u?e==c?-1:e==p?1:t:t)<0?0:f);if(n)return d;var h=l/3+(e-c)*o;return new a(d,t<0?e!=c:e!=p,h)}r+=f-u}return n?e+r:new a(e+r)},s.prototype.touches=function(e,t){for(var n=0,r=i(t),o=this.inverted?2:1,a=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;var c=this.ranges[s+o];if(e<=l+c&&s==3*r)return!0;n+=this.ranges[s+a]-c}return!1},s.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(a,a+l,s,s+c),o+=c-l}},s.prototype.invert=function(){return new s(this.ranges,!this.inverted)},s.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},s.offset=function(e){return 0==e?s.empty:new s(e<0?[0,-e,0]:[0,0,e])},s.empty=new s([]);var l=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function c(e){var t=Error.call(this,e);return t.__proto__=c.prototype,t}l.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new l(this.maps,this.mirror,e,t)},l.prototype.copy=function(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},l.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},l.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},l.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},l.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},l.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},l.prototype.invert=function(){var e=new l;return e.appendMappingInverted(this),e},l.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},l.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},l.prototype._map=function(e,t,n){for(var r=!1,o=null,i=this.from;i<this.to;i++){var s=this.maps[i],l=o&&o[i];if(null!=l&&s.touches(e,l))e=s.recover(l);else{var c=s.mapResult(e,t);if(null!=c.recover){var u=this.getMirror(i);if(null!=u&&u>i&&u<this.to){if(c.deleted){i=u,e=this.maps[u].recover(c.recover);continue}(o||(o=Object.create(null)))[u]=c.recover}}c.deleted&&(r=!0),e=c.pos}}return n?e:new a(e,r)},c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,c.prototype.name="TransformError";var u=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l},f={before:{},docChanged:{}};function p(){throw new Error("Override me")}f.before.get=function(){return this.docs.length?this.docs[0]:this.doc},u.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new c(t.failed);return this},u.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},f.docChanged.get=function(){return this.steps.length>0},u.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(u.prototype,f);var d=Object.create(null),h=function(){};h.prototype.apply=function(e){return p()},h.prototype.getMap=function(){return s.empty},h.prototype.invert=function(e){return p()},h.prototype.map=function(e){return p()},h.prototype.merge=function(e){return null},h.prototype.toJSON=function(){return p()},h.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},h.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var v=function(e,t){this.doc=e,this.failed=t};v.ok=function(e){return new v(e,null)},v.fail=function(e){return new v(null,e)},v.fromReplace=function(e,t,n,o){try{return v.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return v.fail(e.message);throw e}};var m=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&g(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new s([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(h);h.jsonID("replace",m);var y=function(e){function t(t,n,r,o,i,a,s){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(g(e,this.from,this.gapFrom)||g(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new s([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(h);function g(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function b(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){return{type:e,attrs:null}}function k(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function O(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}}function M(e,t,n){for(var o=[],i=0;i<e.childCount;i++){var a=e.child(i);a.content.size&&(a=a.copy(M(a.content,t,a))),a.isInline&&(a=t(a,n,i)),o.push(a)}return r.Fragment.fromArray(o)}h.jsonID("replaceAround",y),u.prototype.lift=function(e,t){for(var n=e.$from,o=e.$to,i=e.depth,a=n.before(i+1),s=o.after(i+1),l=a,c=s,u=r.Fragment.empty,f=0,p=i,d=!1;p>t;p--)d||n.index(p)>0?(d=!0,u=r.Fragment.from(n.node(p).copy(u)),f++):l--;for(var h=r.Fragment.empty,v=0,m=i,g=!1;m>t;m--)g||o.after(m+1)<o.end(m)?(g=!0,h=r.Fragment.from(o.node(m).copy(h)),v++):c++;return this.step(new y(l,c,a,s,new r.Slice(u.append(h),f,v),u.size-f,!0))},u.prototype.wrap=function(e,t){for(var n=r.Fragment.empty,o=t.length-1;o>=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,a=e.end;return this.step(new y(i,a,i,a,new r.Slice(n,0,0),t.length,!0))},u.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(a).map(t),n)){i.clearIncompatible(i.mapping.slice(a).map(t,1),n);var s=i.mapping.slice(a),l=s.map(t,1),c=s.map(t+e.nodeSize,1);return i.step(new y(l,c,l+1,c-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}})),this},u.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var a=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,a);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new y(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(a),0,0),1,!0))},u.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,a=r.Fragment.empty,s=o.depth,l=o.depth-t,c=t-1;s>l;s--,c--){i=r.Fragment.from(o.node(s).copy(i));var u=n&&n[c];a=r.Fragment.from(u?u.type.create(u.attrs,a):o.node(s).copy(a))}return this.step(new m(e,e,new r.Slice(i.append(a),t,t,!0)))},u.prototype.join=function(e,t){void 0===t&&(t=1);var n=new m(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var S=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new r.Slice(M(n.content,(function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),i),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new _(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);h.jsonID("addMark",S);var _=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(M(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new S(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(h);function C(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),a=e.resolve(n);if(T(i,a,o))return new m(t,n,o);var s=function(e,t){var n=function e(t,n,o,i){var a=r.Fragment.empty,s=0,l=o[n];if(t.depth>n){var c=e(t,n+1,o,i||l);s=c.openEnd+1,a=r.Fragment.from(t.node(n+1).copy(c.content))}l&&(a=a.append(l.content),s=l.openEnd);i&&(a=a.append(t.node(n).contentMatchAt(t.indexAfter(n)).fillBefore(r.Fragment.empty,!0)),s=0);return{content:a,openEnd:s}}(e,0,t,!1),o=n.content,i=n.openEnd;return new r.Slice(o,e.depth,i||0)}(i,function(e,t){for(var n=new V(e),r=1;t.size&&r<=3;r++)t=n.placeSlice(t.content,t.openStart,t.openEnd,r);for(;n.open.length;)n.closeNode();return n.placed}(i,o)),l=A(i,a,s);if(!l)return null;if(s.size!=l.size&&function(e,t,n){if(!t.parent.isTextblock)return!1;var r,o=n.openEnd?function(e,t){for(var n=1;n<t;n++)e=e.lastChild.content;return e.lastChild}(n.content,n.openEnd):e.node(e.depth-(n.openStart-n.openEnd));if(!o.isTextblock)return!1;for(var i=t.index();i<t.parent.childCount;i++)if(!o.type.allowsMarks(t.parent.child(i).marks))return!1;n.openEnd?r=o.contentMatchAt(o.childCount):(r=o.contentMatchAt(o.childCount),n.size&&(r=r.matchFragment(n.content,n.openStart?1:0)));return(r=r.matchFragment(t.parent.content,t.index()))&&r.validEnd}(i,a,s)){for(var c=a.depth,u=a.after(c);c>1&&u==a.end(--c);)++u;var f=A(i,e.resolve(u),s);if(f)return new y(t,u,n,a.end(),f,s.size)}return l.size||t!=n?new m(t,n,l):null}function x(e,t,n,o,i,a,s){var l,c=e.childCount,u=c-(s>0?1:0),f=a<0?t:n.node(i);l=a<0?f.contentMatchAt(u):1==c&&s>0?f.contentMatchAt(a?n.index(i):n.indexAfter(i)):f.contentMatchAt(n.indexAfter(i)).matchFragment(e,c>0&&a?1:0,u);var p=o.node(i);if(s>0&&i<o.depth){var d=p.content.cutByIndex(o.indexAfter(i)).addToStart(e.lastChild),h=l.fillBefore(d,!0);if(h&&h.size&&a>0&&1==c&&(h=null),h){var v=x(e.lastChild.content,e.lastChild,n,o,i+1,1==c?a-1:-1,s-1);if(v){var m=e.lastChild.copy(v);return h.size?e.cutByIndex(0,c-1).append(h).addToEnd(m):e.replaceChild(c-1,m)}}}s>0&&(l=l.matchType((1==c&&a>0?n.node(i+1):e.lastChild).type));var y=o.index(i);if(y==p.childCount&&!p.type.compatibleContent(t.type))return null;for(var g=l.fillBefore(p.content,!0,y),b=y;g&&b<p.content.childCount;b++)f.type.allowsMarks(p.content.child(b).marks)||(g=null);if(!g)return null;if(s>0){var w=function e(t,n,o,i,a){var s,l=t.content,c=l.childCount;s=a>=0?o.node(i).contentMatchAt(o.indexAfter(i)).matchFragment(l,a>0?1:0,c):t.contentMatchAt(c);if(n>0){var u=e(l.lastChild,n-1,o,i+1,1==c?a-1:-1);l=l.replaceChild(c-1,u)}return t.copy(l.append(s.fillBefore(r.Fragment.empty,!0)))}(e.lastChild,s-1,n,i+1,1==c?a-1:-1);e=e.replaceChild(c-1,w)}return e=e.append(g),o.depth>i&&(e=e.addToEnd(function e(t,n){var r=t.node(n),o=r.contentMatchAt(0).fillBefore(r.content,!0,t.index(n));t.depth>n&&(o=o.addToEnd(e(t,n+1)));return r.copy(o)}(o,i+1))),e}function A(e,t,n){var o=x(n.content,e.node(0),e,t,0,n.openStart,n.openEnd);return o?function(e,t,n){for(;t>0&&n>0&&1==e.childCount;)e=e.firstChild.content,t--,n--;return new r.Slice(e,t,n)}(o,n.openStart,t.depth):null}function T(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("removeMark",_),u.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],a=null,s=null;return this.doc.nodesBetween(e,t,(function(r,l,c){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){for(var f=Math.max(l,e),p=Math.min(l+r.nodeSize,t),d=n.addToSet(u),h=0;h<u.length;h++)u[h].isInSet(d)||(a&&a.to==f&&a.mark.eq(u[h])?a.to=p:o.push(a=new _(f,p,u[h])));s&&s.to==f?s.to=p:i.push(s=new S(f,p,n))}}})),o.forEach((function(e){return r.step(e)})),i.forEach((function(e){return r.step(e)})),this},u.prototype.removeMark=function(e,t,n){var o=this;void 0===n&&(n=null);var i=[],a=0;return this.doc.nodesBetween(e,t,(function(o,s){if(o.isInline){a++;var l=null;if(n instanceof r.MarkType){var c=n.isInSet(o.marks);c&&(l=[c])}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length)for(var u=Math.min(s+o.nodeSize,t),f=0;f<l.length;f++){for(var p=l[f],d=void 0,h=0;h<i.length;h++){var v=i[h];v.step==a-1&&p.eq(i[h].style)&&(d=v)}d?(d.to=u,d.step=a):i.push({style:p,from:Math.max(s,e),to:u,step:a})}}})),i.forEach((function(e){return o.step(new _(e.from,e.to,e.style))})),this},u.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var o=this.doc.nodeAt(e),i=[],a=e+1,s=0;s<o.childCount;s++){var l=o.child(s),c=a+l.nodeSize,u=n.matchType(l.type,l.attrs);if(u){n=u;for(var f=0;f<l.marks.length;f++)t.allowsMarkType(l.marks[f].type)||this.step(new _(a,c,l.marks[f]))}else i.push(new m(a,c,r.Slice.empty));a=c}if(!n.validEnd){var p=n.fillBefore(r.Fragment.empty,!0);this.replace(a,a,new r.Slice(p,0,0))}for(var d=i.length-1;d>=0;d--)this.step(i[d]);return this},u.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=C(this.doc,e,t,n);return o&&this.step(o),this},u.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},u.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var V=function(e){this.open=[];for(var t=0;t<=e.depth;t++){var n=e.node(t),o=n.contentMatchAt(e.indexAfter(t));this.open.push({parent:n,match:o,content:r.Fragment.empty,wrapper:!1,openEnd:0,depth:t})}this.placed=[]};function j(e,t,n){var r=e.content;if(t>1){var o=j(e.firstChild,t-1,1==e.childCount?n-1:0);r=e.content.replaceChild(0,o)}var i=e.type.contentMatch.fillBefore(r,0==n);return e.copy(i.append(r))}function E(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(E(i.content,t+1,n,r,i)))}return t>r&&(e=o.contentMatchAt(0).fillBefore(e,!0).append(e)),e}function P(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}V.prototype.placeSlice=function(e,t,n,o,i){if(t>0){var a=e.firstChild,s=this.placeSlice(a.content,Math.max(0,t-1),n&&1==e.childCount?n-1:0,o,a);s.content!=a.content&&(s.content.size?(e=e.replaceChild(0,a.copy(s.content)),t=s.openStart+1):(1==e.childCount&&(n=0),e=e.cutByIndex(1),t=0))}var l=this.placeContent(e,t,n,o,i);if(o>2&&l.size&&0==t){for(var c=0;c<l.content.childCount;c++){var u=l.content.child(c);this.placeContent(u.content,0,n&&c==l.content.childCount.length-1?n-1:0,o,u)}l=r.Fragment.empty}return l},V.prototype.placeContent=function(e,t,n,o,i){for(var a=0;a<e.childCount;a++){for(var s=e.child(a),l=!1,c=a==e.childCount-1,u=this.open.length-1;u>=0;u--){var f=this.open[u],p=void 0;if(o>1&&(p=f.match.findWrapping(s.type))&&(!i||!p.length||p[p.length-1]!=i.type)){for(;this.open.length-1>u;)this.closeNode();for(var d=0;d<p.length;d++)f.match=f.match.matchType(p[d]),u++,f={parent:p[d].create(),match:p[d].contentMatch,content:r.Fragment.empty,wrapper:!0,openEnd:0,depth:u+d},this.open.push(f)}var h=f.match.matchType(s.type);if(!h){var v=f.match.fillBefore(r.Fragment.from(s));if(!v){if(i&&f.match.matchType(i.type))break;continue}for(var m=0;m<v.childCount;m++){var y=v.child(m);this.addNode(f,y,0),h=f.match.matchFragment(y)}}for(;this.open.length-1>u;)this.closeNode();s=s.mark(f.parent.type.allowedMarks(s.marks)),t&&(s=j(s,t,c?n:0),t=0),this.addNode(f,s,c?n:0),f.match=h,c&&(n=0),l=!0;break}if(!l)break}return this.open.length>1&&(a>0&&a==e.childCount||i&&this.open[this.open.length-1].parent.type==i.type)&&this.closeNode(),new r.Slice(e.cutByIndex(a),t,n)},V.prototype.addNode=function(e,t,n){var o,i;e.content=(o=e.content,i=e.openEnd,i?o.replaceChild(o.childCount-1,function e(t,n){var o=t.content;if(n>1){var i=e(t.lastChild,n-1);o=t.content.replaceChild(t.childCount-1,i)}var a=t.contentMatchAt(t.childCount).fillBefore(r.Fragment.empty,!0);return t.copy(o.append(a))}(o.lastChild,i)):o).addToEnd(t),e.openEnd=n},V.prototype.closeNode=function(){var e=this.open.pop();0==e.content.size||(e.wrapper?this.addNode(this.open[this.open.length-1],e.parent.copy(e.content),e.openEnd+1):this.placed[e.depth]={depth:e.depth,content:e.content,openEnd:e.openEnd})},u.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if(T(o,i,n))return this.step(new m(e,t,n));var a=P(o,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var l=o.depth,c=o.pos-1;l>0;l--,c--){var u=o.node(l).type.spec;if(u.defining||u.isolating)break;a.indexOf(l)>-1?s=l:o.before(l)==c&&a.splice(1,0,-l)}for(var f=a.indexOf(s),p=[],d=n.openStart,h=n.content,v=0;;v++){var y=h.firstChild;if(p.push(y),v==n.openStart)break;h=y.content}d>0&&p[d-1].type.spec.defining&&o.node(f).type!=p[d-1].type?d-=1:d>=2&&p[d-1].isTextblock&&p[d-2].type.spec.defining&&o.node(f).type!=p[d-2].type&&(d-=2);for(var g=n.openStart;g>=0;g--){var b=(g+d+1)%(n.openStart+1),w=p[b];if(w)for(var k=0;k<a.length;k++){var O=a[(k+f)%a.length],M=!0;O<0&&(M=!1,O=-O);var S=o.node(O-1),_=o.index(O-1);if(S.canReplaceWith(_,_,w.type,w.marks))return this.replace(o.before(O),M?i.after(O):t,new r.Slice(E(n.content,0,n.openStart,b),b,n.openEnd))}}return this.replace(e,t,n)},u.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=O(this.doc,e,n.type);null!=o&&(e=t=o)}return this.replaceRange(e,t,new r.Slice(r.Fragment.from(n),0,0))},u.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),o=P(n,r),i=0;i<o.length;i++){var a=o[i],s=i==o.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),r.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var l=1;l<=n.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l))return this.delete(n.before(l),t);return this.delete(e,t)},t.Transform=u,t.TransformError=c,t.Step=h,t.StepResult=v,t.joinPoint=function(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0;if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),a=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),a=r.node(o+1)),i&&!i.isTextblock&&k(i,a))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}},t.canJoin=function(e,t){var n=e.resolve(t),r=n.index();return k(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},t.canSplit=function(e,t,n,r){void 0===n&&(n=1);var o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,l=n-2;s>i;s--,l--){var c=o.node(s),u=o.index(s);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(u,c.childCount),p=r&&r[l]||c;if(p!=c&&(f=f.replaceChild(0,p.type.create(p.attrs))),!c.canReplace(u+1,c.childCount)||!p.type.validContent(f))return!1}var d=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)},t.insertPoint=O,t.dropPoint=function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(l>0?1:0);if(1==a?r.node(s).canReplace(c,c,o):r.node(s).contentMatchAt(c).findWrapping(o.firstChild.type))return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null},t.liftTarget=function(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!b(r,o,i))break}},t.findWrapping=function(e,t,n,r){void 0===r&&(r=e);var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}(e,t),i=o&&function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<o;l++)s=s.matchType(n.child(l).type);if(!s||!s.validEnd)return null;return a}(r,t);return i?o.map(w).concat({type:t,attrs:n}).concat(i.map(w)):null},t.StepMap=s,t.MapResult=a,t.Mapping=l,t.AddMarkStep=S,t.RemoveMarkStep=_,t.ReplaceStep=m,t.ReplaceAroundStep=y,t.replaceStep=C},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(5),i=["ol",0],a=["ul",0],s=["li",0],l={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?i:["ol",{start:e.attrs.order},0]}},c={parseDOM:[{tag:"ul"}],toDOM:function(){return a}},u={parseDOM:[{tag:"li"}],toDOM:function(){return s},defining:!0};function f(e,t){var n={};for(var r in e)n[r]=e[r];for(var o in t)n[o]=t[o];return n}t.orderedList=l,t.bulletList=c,t.listItem=u,t.addListNodes=function(e,t,n){return e.append({ordered_list:f(l,{content:"list_item+",group:n}),bullet_list:f(c,{content:"list_item+",group:n}),list_item:f(u,{content:t})})},t.wrapInList=function(e,t){return function(n,i){var a=n.selection,s=a.$from,l=a.$to,c=s.blockRange(l),u=!1,f=c;if(!c)return!1;if(c.depth>=2&&s.node(c.depth-1).type.compatibleContent(e)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);f=new o.NodeRange(p,p,c.depth),c.endIndex<c.parent.childCount&&(c=new o.NodeRange(s,n.doc.resolve(l.end(c.depth)),c.depth)),u=!0}var d=r.findWrapping(f,e,t,c);return!!d&&(i&&i(function(e,t,n,i,a){for(var s=o.Fragment.empty,l=n.length-1;l>=0;l--)s=o.Fragment.from(n[l].type.create(n[l].attrs,s));e.step(new r.ReplaceAroundStep(t.start-(i?2:0),t.end,t.start,t.end,new o.Slice(s,0,0),n.length,!0));for(var c=0,u=0;u<n.length;u++)n[u].type==a&&(c=u+1);for(var f=n.length-c,p=t.start+n.length-(i?2:0),d=t.parent,h=t.startIndex,v=t.endIndex,m=!0;h<v;h++,m=!1)!m&&r.canSplit(e.doc,p,f)&&(e.split(p,f),p+=2*f),p+=d.child(h).nodeSize;return e}(n.tr,c,d,u,e).scrollIntoView()),!0)}},t.splitListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=i.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(s))return!1;var c=a.node(-1);if(c.type!=e)return!1;if(0==a.parent.content.size){if(2==a.depth||a.node(-3).type!=e||a.index(-2)!=a.node(-2).childCount-1)return!1;if(n){for(var u=o.Fragment.empty,f=a.index(-1)>0,p=a.depth-(f?1:2);p>=a.depth-3;p--)u=o.Fragment.from(a.node(p).copy(u));u=u.append(o.Fragment.from(e.createAndFill()));var d=t.tr.replace(a.before(f?null:-1),a.after(-3),new o.Slice(u,f?3:2,2));d.setSelection(t.selection.constructor.near(d.doc.resolve(a.pos+(f?3:2)))),n(d.scrollIntoView())}return!0}var h=s.pos==a.end()?c.contentMatchAt(a.indexAfter(-1)).defaultType:null,v=t.tr.delete(a.pos,s.pos),m=h&&[null,{type:h}];return!!r.canSplit(v.doc,a.pos,2,m)&&(n&&n(v.split(a.pos,2,m).scrollIntoView()),!0)}},t.liftListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==e}));return!!l&&(!n||(a.node(l.depth-1).type==e?function(e,t,n,i){var a=e.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(a.step(new r.ReplaceAroundStep(s-1,l,s,l,new o.Slice(o.Fragment.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.NodeRange(a.doc.resolve(i.$from.pos),a.doc.resolve(l),i.depth));return t(a.lift(i,r.liftTarget(i)).scrollIntoView()),!0}(t,n,e,l):function(e,t,n){for(var i=e.tr,a=n.parent,s=n.end,l=n.endIndex-1,c=n.startIndex;l>c;l--)s-=a.child(l).nodeSize,i.delete(s-1,s+1);var u=i.doc.resolve(n.start),f=u.nodeAfter,p=0==n.startIndex,d=n.endIndex==a.childCount,h=u.node(-1),v=u.index(-1);if(!h.canReplace(v+(p?0:1),v+1,f.content.append(d?o.Fragment.empty:o.Fragment.from(a))))return!1;var m=u.pos,y=m+f.nodeSize;return i.step(new r.ReplaceAroundStep(m-(p?1:0),y+(d?1:0),m+1,y-1,new o.Slice((p?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))).append(d?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))),p?0:1,d?0:1),p?0:1)),t(i.scrollIntoView()),!0}(t,n,l)))}},t.sinkListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==e}));if(!l)return!1;var c=l.startIndex;if(0==c)return!1;var u=l.parent,f=u.child(c-1);if(f.type!=e)return!1;if(n){var p=f.lastChild&&f.lastChild.type==u.type,d=o.Fragment.from(p?e.create():null),h=new o.Slice(o.Fragment.from(e.create(null,o.Fragment.from(u.type.create(null,d)))),p?3:1,0),v=l.start,m=l.end;n(t.tr.step(new r.ReplaceAroundStep(v-(p?3:1),m,v,m,h,1,!0)).scrollIntoView())}return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(5),i=n(4);function a(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function s(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",e):o.parentOffset>0))return!1;var a=u(o);if(!a){var s=o.blockRange(),c=s&&r.liftTarget(s);return null!=c&&(t&&t(e.tr.lift(s,c).scrollIntoView()),!0)}var f=a.nodeBefore;if(!f.type.spec.isolating&&w(e,a,t))return!0;if(0==o.parent.content.size&&(l(f,"end")||i.NodeSelection.isSelectable(f))){if(t){var p=e.tr.deleteRange(o.before(),o.after());p.setSelection(l(f,"end")?i.Selection.findFrom(p.doc.resolve(p.mapping.map(a.pos,-1)),-1):i.NodeSelection.create(p.doc,a.pos-f.nodeSize)),t(p.scrollIntoView())}return!0}return!(!f.isAtom||a.depth!=o.depth-1)&&(t&&t(e.tr.delete(a.pos-f.nodeSize,a.pos).scrollIntoView()),!0)}function l(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function c(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=u(r),a=o&&o.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function f(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=d(r);if(!o)return!1;var a=o.nodeAfter;if(w(e,o,t))return!0;if(0==r.parent.content.size&&(l(a,"start")||i.NodeSelection.isSelectable(a))){if(t){var s=e.tr.deleteRange(r.before(),r.after());s.setSelection(l(a,"start")?i.Selection.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):i.NodeSelection.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)}function p(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=d(r),a=o&&o.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos)).scrollIntoView()),!0)}function d(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function h(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function v(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var a=r.node(-1),s=r.indexAfter(-1),l=a.contentMatchAt(s).defaultType;if(!a.canReplaceWith(s,s,l))return!1;if(t){var c=r.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0}function m(e,t){var n=e.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var a=r.parent.contentMatchAt(o.indexAfter()).defaultType;if(!a||!a.isTextblock)return!1;if(t){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=e.tr.insert(s,a.createAndFill());l.setSelection(i.TextSelection.create(l.doc,s+1)),t(l.scrollIntoView())}return!0}function y(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(r.canSplit(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),a=i&&r.liftTarget(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}function g(e,t){var n=e.selection,a=n.$from,s=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!a.parentOffset||!r.canSplit(e.doc,a.pos))&&(t&&t(e.tr.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(t){var l=s.parentOffset==s.parent.content.size,c=e.tr;e.selection instanceof i.TextSelection&&c.deleteSelection();var u=0==a.depth?null:a.node(-1).contentMatchAt(a.indexAfter(-1)).defaultType,f=l&&u?[{type:u}]:null,p=r.canSplit(c.doc,c.mapping.map(a.pos),1,f);f||p||!r.canSplit(c.doc,c.mapping.map(a.pos),1,u&&[{type:u}])||(f=[{type:u}],p=!0),p&&(c.split(c.mapping.map(a.pos),1,f),l||a.parentOffset||a.parent.type==u||!a.node(-1).canReplace(a.index(-1),a.indexAfter(-1),o.Fragment.from(u.create(),a.parent))||c.setNodeMarkup(c.mapping.map(a.before()),u)),t(c.scrollIntoView())}return!0}function b(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}function w(e,t,n){var a,s,l=t.nodeBefore,c=t.nodeAfter;if(l.type.spec.isolating||c.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,a=t.index();return!!(o&&i&&o.type.compatibleContent(i.type))&&(!o.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(a,a+1)||!i.isTextblock&&!r.canJoin(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;if(t.parent.canReplace(t.index(),t.index()+1)&&(a=(s=l.contentMatchAt(l.childCount)).findWrapping(c.type))&&s.matchType(a[0]||c.type).validEnd){if(n){for(var u=t.pos+c.nodeSize,f=o.Fragment.empty,p=a.length-1;p>=0;p--)f=o.Fragment.from(a[p].create(null,f));f=o.Fragment.from(l.copy(f));var d=e.tr.step(new r.ReplaceAroundStep(t.pos-1,u,t.pos,u,new o.Slice(f,1,0),a.length,!0)),h=u+2*a.length;r.canJoin(d.doc,h)&&d.join(h),n(d.scrollIntoView())}return!0}var v=i.Selection.findFrom(t,1),m=v&&v.$from.blockRange(v.$to),y=m&&r.liftTarget(m);return null!=y&&y>=t.depth&&(n&&n(e.tr.lift(m,y).scrollIntoView()),!0)}function k(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var O=k(a,s,c),M=k(a,f,p),S={Enter:k(h,m,y,g),"Mod-Enter":v,Backspace:O,"Mod-Backspace":O,Delete:M,"Mod-Delete":M,"Mod-a":b},_={"Ctrl-h":S.Backspace,"Alt-Backspace":S["Mod-Backspace"],"Ctrl-d":S.Delete,"Ctrl-Alt-Backspace":S["Mod-Delete"],"Alt-Delete":S["Mod-Delete"],"Alt-d":S["Mod-Delete"]};for(var C in S)_[C]=S[C];var x=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?_:S;t.deleteSelection=a,t.joinBackward=s,t.selectNodeBackward=c,t.joinForward=f,t.selectNodeForward=p,t.joinUp=function(e,t){var n,o=e.selection,a=o instanceof i.NodeSelection;if(a){if(o.node.isTextblock||!r.canJoin(e.doc,o.from))return!1;n=o.from}else if(null==(n=r.joinPoint(e.doc,o.from,-1)))return!1;if(t){var s=e.tr.join(n);a&&s.setSelection(i.NodeSelection.create(s.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},t.joinDown=function(e,t){var n,o=e.selection;if(o instanceof i.NodeSelection){if(o.node.isTextblock||!r.canJoin(e.doc,o.to))return!1;n=o.to}else if(null==(n=r.joinPoint(e.doc,o.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},t.lift=function(e,t){var n=e.selection,o=n.$from,i=n.$to,a=o.blockRange(i),s=a&&r.liftTarget(a);return null!=s&&(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)},t.newlineInCode=h,t.exitCode=v,t.createParagraphNear=m,t.liftEmptyBlock=y,t.splitBlock=g,t.splitBlockKeepMarks=function(e,t){return g(e,t&&function(n){var r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})},t.selectParentNode=function(e,t){var n,r=e.selection,o=r.$from,a=r.to,s=o.sharedDepth(a);return 0!=s&&(n=o.before(s),t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,n))),!0)},t.selectAll=b,t.wrapIn=function(e,t){return function(n,o){var i=n.selection,a=i.$from,s=i.$to,l=a.blockRange(s),c=l&&r.findWrapping(l,e,t);return!!c&&(o&&o(n.tr.wrap(l,c).scrollIntoView()),!0)}},t.setBlockType=function(e,t){return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}},t.toggleMark=function(e,t){return function(n,r){var o=n.selection,i=o.empty,a=o.$cursor,s=o.ranges;if(i&&!a||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,a=o.$to,s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,a.pos,(function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,s,e))return!1;if(r)if(a)e.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var l=!1,c=n.tr,u=0;!l&&u<s.length;u++){var f=s[u],p=f.$from,d=f.$to;l=n.doc.rangeHasMark(p.pos,d.pos,e)}for(var h=0;h<s.length;h++){var v=s[h],m=v.$from,y=v.$to;l?c.removeMark(m.pos,y.pos,e):c.addMark(m.pos,y.pos,e.create(t))}r(c.scrollIntoView())}return!0}},t.autoJoin=function(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,o){return e(n,o&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var o=[],i=0;i<n.mapping.maps.length;i++){for(var a=n.mapping.maps[i],s=0;s<o.length;s++)o[s]=a.map(o[s]);a.forEach((function(e,t,n,r){return o.push(n,r)}))}for(var l=[],c=0;c<o.length;c+=2)for(var u=o[c],f=o[c+1],p=n.doc.resolve(u),d=p.sharedDepth(f),h=p.node(d),v=p.indexAfter(d),m=p.after(d+1);m<=f;++v){var y=h.maybeChild(v);if(!y)break;if(v&&-1==l.indexOf(m)){var g=h.child(v-1);g.type==y.type&&t(g,y)&&l.push(m)}m+=y.nodeSize}l.sort((function(e,t){return e-t}));for(var b=l.length-1;b>=0;b--)r.canJoin(n.doc,l[b])&&n.join(l[b]);e(n)}}(o,t))}},t.chainCommands=k,t.pcBaseKeymap=S,t.macBaseKeymap=_,t.baseKeymap=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var o=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.node=t,this.outerView=n,this.getPos=r,this.renderNode(t.attrs)}return r(e,[{key:"renderNode",value:function(e){throw console.log(this.node,e),new Error("renderNode must be implemented by child class!")}}],[{key:"unsetPrefixAttributes",value:function(e,t){var n={};return Object.keys(t).forEach((function(r){r.substr(0,e.length)!==e&&(n[r]=t[r])})),n}}]),e}();t.default=o,window.AbstractNodeView=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(39),a=(r=i)&&r.__esModule?r:{default:r};var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.items=t}return o(e,[{key:"isAvailable",value:function(e){return this.items.some((function(t){return t.isAvailable(e)}))}},{key:"getMenuItem",value:function(e,t){if(!this.isAvailable(e))throw new Error("None of the items is valid for this Schema!");if(!t)throw new Error("dropdown attributes missing!");return new a.default(this.items.filter((function(t){return t.isAvailable(e)})).map((function(t){return t.getMenuItem(e)})),t)}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(30))&&"object"==typeof r&&"default"in r?r.default:r,i=n(6),a=n(4),s=function(e,t){this.items=e,this.eventCount=t};s.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(n.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var a,c,u=e.tr,f=[],p=[];return this.items.forEach((function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void p.push(e);if(r){p.push(new l(e.map));var d,h=e.step.map(r.slice(o));h&&u.maybeStep(h).doc&&(d=u.mapping.maps[u.mapping.maps.length-1],f.push(new l(d,null,null,f.length+p.length))),o--,d&&r.appendMap(d,o)}else u.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(o)):e.selection,c=new s(n.items.slice(0,i).append(p.reverse().concat(f)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:c,transform:u,selection:a}},s.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,a=this.items,c=!r&&a.length?a.get(a.length-1):null,f=0;f<e.steps.length;f++){var p,d=e.steps[f].invert(e.docs[f]),h=new l(e.mapping.maps[f],d,t);(p=c&&c.merge(h))&&(h=p,f?o.pop():a=a.slice(0,a.length-1)),o.push(h),t&&(i++,t=null),r||(c=h)}var v,m,y,g=i-n.depth;return g>u&&(m=g,(v=a).forEach((function(e,t){if(e.selection&&0==m--)return y=t,!1})),a=v.slice(y),i-=g),new s(a.append(o),i)},s.prototype.remapping=function(e,t){var n=new i.Mapping;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?o=n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},s.prototype.addMaps=function(e){return 0==this.eventCount?this:new s(this.items.append(e.map((function(e){return new l(e)}))),this.eventCount)},s.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),r);var c=t;this.items.forEach((function(t){var r=o.getMirror(--c);if(null!=r){i=Math.min(i,r);var s=o.maps[r];if(t.step){var u=e.steps[r].invert(e.docs[r]),f=t.selection&&t.selection.map(o.slice(c+1,r));f&&a++,n.push(new l(s,u,f))}else n.push(new l(s))}}),r);for(var u=[],f=t;f<i;f++)u.push(new l(o.maps[f]));var p=this.items.slice(0,r).append(u).append(n),d=new s(p,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d},s.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},s.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((function(o,a){if(a>=e)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(t.slice(n)),c=s&&s.getMap();if(n--,c&&t.appendMap(c,n),s){var u=o.selection&&o.selection.map(t.slice(n));u&&i++;var f,p=new l(c.invert(),s,u),d=r.length-1;(f=r.length&&r[d].merge(p))?r[d]=f:r.push(p)}}else o.map&&n--}),this.items.length,0),new s(o.from(r.reverse()),i)},s.empty=new s(o.empty,0);var l=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};l.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new l(t.getMap().invert(),t,this.selection)}};var c=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},u=20;function f(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function p(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function d(e,t,n,r){var o=m(t),i=y.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,o);if(a){var s=a.selection.resolve(a.transform.doc),l=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,o),u=new c(r?l:a.remaining,r?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(y,{redo:r,historyState:u}).scrollIntoView())}}var h=!1,v=null;function m(e){var t=e.plugins;if(v!=t){h=!1,v=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){h=!0;break}}return h}var y=new a.PluginKey("history"),g=new a.PluginKey("closeHistory");t.HistoryState=c,t.closeHistory=function(e){return e.setMeta(g,!0)},t.history=function(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new a.Plugin({key:y,state:{init:function(){return new c(s.empty,s.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(y);if(i)return i.historyState;n.getMeta(g)&&(e=new c(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(y))return a.getMeta(y).redo?new c(e.done.addTransform(n,null,r,m(t)),e.undone,f(n.mapping.maps[n.steps.length-1]),e.prevTime):new c(e.done,e.undone.addTransform(n,null,r,m(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new c(e.done.rebased(n,o),e.undone.rebased(n,o),p(e.prevRanges,n.mapping),e.prevTime):new c(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),p(e.prevRanges,n.mapping),e.prevTime);var l=e.prevTime<(n.time||0)-r.newGroupDelay||!a&&!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges),u=a?p(e.prevRanges,n.mapping):f(n.mapping.maps[n.steps.length-1]);return new c(e.done.addTransform(n,l?t.selection.getBookmark():null,r,m(t)),s.empty,u,n.time)}(n,r,t,e)}},config:e})},t.undo=function(e,t){var n=y.getState(e);return!(!n||0==n.done.eventCount)&&(t&&d(n,e,t,!1),!0)},t.redo=function(e,t){var n=y.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&d(n,e,t,!0),!0)},t.undoDepth=function(e){var t=y.getState(e);return t?t.done.eventCount:0},t.redoDepth=function(e){var t=y.getState(e);return t?t.undone.eventCount:0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setBlockTypeNoAttrCheck=function(e,t){return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(t,r){if(s)return!1;if(!t.isTextblock||t.type===e)return!0;var o=n.doc.resolve(r),i=o.index();return s=o.parent.canReplaceWith(i,i+1,e),!0})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(4),i=n(6),a={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var s=/Edge\/(\d+)/.exec(navigator.userAgent),l=/MSIE \d/.test(navigator.userAgent),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);a.mac=/Mac/.test(navigator.platform);var u=a.ie=!!(l||c||s);a.ie_version=l?document.documentMode||6:c?+c[1]:s?+s[1]:null,a.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),a.gecko_version=a.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var f=!u&&/Chrome\/(\d+)/.exec(navigator
[all...]
/plugin/dirtylittlehelper/mermaid/editor/docs/
H A Deditor.worker.js1navigator||m){if("object"==typeof e){r="win32"===e.platform,s="darwin"===e.platform,o="linux"===e.…
/plugin/dirtylittlehelper/mermaid/editor/
H A Deditor.worker.js1navigator||m){if("object"==typeof e){r="win32"===e.platform,s="darwin"===e.platform,o="linux"===e.…
/plugin/diagramsnet/lib/math/jax/output/HTML-CSS/fonts/TeX/
H A Dfontdata.js19 …91,w],bot:[57992,w],ext:[57993,w]}}}}})}},Chrome:function(t){if(t.isPC&&navigator.userAgent.match(…

12345678910>>...12