UNPKG

@progress/kendo-react-editor

Version:
1 lines • 839 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("@progress/kendo-react-intl"),require("@progress/kendo-drawing"),require("react-dom"),require("react-transition-group"),require("react-dom/server")):"function"==typeof define&&define.amd?define(["prop-types","react","@progress/kendo-react-intl","@progress/kendo-drawing","react-dom","react-transition-group","react-dom/server"],t):"object"==typeof exports?exports.KendoReactEditor=t(require("prop-types"),require("react"),require("@progress/kendo-react-intl"),require("@progress/kendo-drawing"),require("react-dom"),require("react-transition-group"),require("react-dom/server")):e.KendoReactEditor=t(e.PropTypes,e.React,e.KendoReactIntl,e.KendoDrawing,e.ReactDOM,e.ReactTransitionGroup,e.ReactDOMServer)}(window,(function(e,t,n,r,o,i,a){return 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}return 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=25)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";n.d(t,"l",(function(){return q})),n.d(t,"g",(function(){return W})),n.d(t,"e",(function(){return r})),n.d(t,"k",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"m",(function(){return a})),n.d(t,"f",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"b",(function(){return k})),n.d(t,"h",(function(){return C})),n.d(t,"n",(function(){return O})),n.d(t,"p",(function(){return E})),n.d(t,"o",(function(){return S})),n.d(t,"j",(function(){return T})),n.d(t,"i",(function(){return _})),n.d(t,"a",(function(){return H}));var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return!0!==e&&!!e})).map((function(e){return Array.isArray(e)?r.apply(void 0,e):"object"==typeof e?Object.keys(e).map((function(t,n){return e[n]||e[t]&&t||null})).filter((function(e){return null!==e})).join(" "):e})).filter((function(e){return!!e})).join(" ")},o=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},i={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},a=function(){};function s(e,t,n,r){if(e){var o={syntheticEvent:t,nativeEvent:t.nativeEvent,target:n};e.call(void 0,Object.assign(o,r))}}var l=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),c=n(1),u=n(0),p=function(e,t){return function(n){return t(e(n))}},d=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},f=function(e,t,n){return e&&e.removeEventListener&&e.removeEventListener(t,n)},h=function(){},m=function(e){return e.preventDefault()},v=/touch/;function g(e){return e.type.match(v)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var y=function(e){var t=this,n=e.press;void 0===n&&(n=h);var r=e.drag;void 0===r&&(r=h);var o=e.release;void 0===o&&(o=h);var i=e.mouseOnly;void 0===i&&(i=!1),this._pressHandler=p(g,n),this._dragHandler=p(g,r),this._releaseHandler=p(g,o),this._ignoreMouse=!1,this._mouseOnly=i,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(d(document,"mousemove",t._mousemove),d(document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){f(document,"mousemove",t._mousemove),f(document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(d(document,"pointermove",t._pointermove),d(document,"pointerup",t._pointerup),d(document,"pointercancel",t._pointerup),d(document,"contextmenu",m),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(f(document,"pointermove",t._pointermove),f(document,"pointerup",t._pointerup),f(document,"pointercancel",t._pointerup),f(document,"contextmenu",m),t._releaseHandler(e))}};y.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},y.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},y.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?d(e,"pointerdown",this._pointerdown):(d(e,"mousedown",this._mousedown),this._mouseOnly||(d(e,"touchstart",this._touchstart),d(e,"touchmove",this._touchmove),d(e,"touchend",this._touchend)))},y.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return f(e,"pointerdown",this._pointerdown),f(document,"pointermove",this._pointermove),f(document,"pointerup",this._pointerup),f(document,"contextmenu",m),void f(document,"pointercancel",this._pointerup);f(e,"mousedown",this._mousedown),this._mouseOnly||(f(e,"touchstart",this._touchstart),f(e,"touchmove",this._touchmove),f(e,"touchend",this._touchend))},y.prototype._usePointers=function(){return!this._mouseOnly&&y.supportPointerEvent()},y.prototype.update=function(e){var t=e.press;void 0===t&&(t=h);var n=e.drag;void 0===n&&(n=h);var r=e.release;void 0===r&&(r=h);var o=e.mouseOnly;void 0===o&&(o=!1),this._pressHandler=p(g,t),this._dragHandler=p(g,n),this._releaseHandler=p(g,r),this._mouseOnly=o},y.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},y.default=y;var b,w=y,x=(b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),k=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.element=null,t.draggable=new w({press:function(e){t.element&&t.props.onPress&&t.props.onPress.call(void 0,{target:t,event:e,element:t.element})},drag:function(e){t.element&&t.props.onDrag&&t.props.onDrag.call(void 0,{target:t,event:e,element:t.element})},release:function(e){t.element&&t.props.onRelease&&t.props.onRelease.call(void 0,{target:t,event:e})}}),t.assingRef=function(e){t.element=e},t}return x(t,e),t.prototype.componentDidMount=function(){this.element&&this.draggable.bindTo(this.element)},t.prototype.componentWillUnmount=function(){this.draggable.destroy()},t.prototype.render=function(){return c.cloneElement(c.Children.only(this.props.children),{ref:this.assingRef})},t.propTypes={children:u.element.isRequired},t}(c.Component),C=function(e){if(e){if((e instanceof HTMLInputElement||-1!==e.tabIndex)&&e.focus)return void e.focus();var t=e.querySelector('input, [tabindex]:not([tabindex="-1"])');t&&t.focus&&t.focus()}};function O(e,t,n){var r=c.useState(t),o=r[0],i=r[1];return c.useEffect((function(){if(!o&&window&&e.current){var t=window.getComputedStyle(e.current).direction;t&&i(t)}}),n),o}function S(e,t){var n=t.onPress,r=t.onDrag,o=t.onRelease,i=c.useMemo((function(){return new w({press:n,drag:r,release:o})}),[]);c.useEffect((function(){var t=e.current;if(t)return i.bindTo(t),function(){i.destroy()}}),[]),c.useEffect((function(){i.update({press:n,drag:r,release:o})}),[n,r,o])}function E(e,t,n){var r=c.useState(t),o=r[0],i=r[1];return c.useEffect((function(){if(!o&&window&&e.current){var t=window.getComputedStyle(e.current).direction;t&&i(t)}}),n),o}var I=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;function D(e){var t=[];return e.replace(I,(function(e,n,r,o){t.push(void 0!==n?n:r||o)})),t}var N={};function T(e){if(N[e])return N[e];var t=D(e);return N[e]=function(e){for(var n=e,r=0;r<t.length&&n;r++)n=n[t[r]];return n},N[e]}N.undefined=function(){};var _=function(e,t,n){var r="string"==typeof e?parseInt(e,void 0):e;if(NaN!==r)return void 0!==r?r:t?n?void 0:-1:0},M={default:"",xsmall:"k-icon-xs",small:"k-icon-sm",medium:"k-icon-md",large:"k-icon-lg",xlarge:"k-icon-xl"},P=function(){return(P=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},j=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},A=c.forwardRef((function(e,t){var n=e.className,o=e.name,i=e.themeColor,a=e.size,s=e.flip,l=e.style,u=j(e,["className","name","themeColor","size","flip","style"]),p=c.useRef(null);c.useImperativeHandle(t,(function(){return{element:p.current}}));var d=c.useMemo((function(){return i||z.themeColor}),[i]),f=c.useMemo((function(){return a||z.size}),[a]),h=c.useMemo((function(){return s||z.flip}),[s]),m=c.useMemo((function(){return r("k-icon","k-i-"+o,"k-color-"+d,{"k-flip-h":"horizontal"===h||"both"===h,"k-flip-v":"vertical"===h||"both"===h},M[f],n)}),[o,d,f,h,n]);return c.createElement("span",P({className:m,style:l,ref:p,role:"presentation"},u))}));A.propTypes={style:u.object,classNames:u.string,name:u.string,themeColor:u.oneOf(["inherit","primary","secondary","tertiary","info","success","error","warning","dark","light","inverse"]),size:u.oneOf(["default","xsmall","small","medium","large","xlarge"]),flip:u.oneOf(["default","horizontal","vertical","both"])};var z={size:"default",themeColor:"inherit",flip:"default"};A.displayName="KendoIcon";var R=function(){return(R=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},B=c.forwardRef((function(e,t){var n=e.children,o=e.className,i=e.svgClassName,a=e.icon,s=e.flip,l=e.size,u=e.style,p=e.svgStyle,d=e.themeColor,f=e.viewBox,h=L(e,["children","className","svgClassName","icon","flip","size","style","svgStyle","themeColor","viewBox"]),m=c.useRef(null);c.useImperativeHandle(t,(function(){return{element:m.current}}));var v=c.useMemo((function(){return a?a.name:F.icon}),[a]),g=c.useMemo((function(){return d||F.themeColor}),[d]),y=c.useMemo((function(){return l||F.size}),[l]),b=c.useMemo((function(){return s||F.flip}),[s]),w=c.useMemo((function(){return f||F.viewBox}),[f]),x=c.useMemo((function(){return r("k-svg-icon","k-color-"+g,"k-svg-i-"+v,{"k-flip-h":"horizontal"===b||"both"===b,"k-flip-v":"vertical"===b||"both"===b},M[y],o)}),[v,g,y,b,o]),k=c.useMemo((function(){return e.width&&e.height?R({width:e.width,height:e.height},u):e.width?R({width:e.width,height:e.width},u):e.height?R({width:e.height,height:e.height},u):R({},u)}),[e.width,e.height,u]);return c.createElement("span",{className:x,style:k,ref:m},c.createElement("svg",R({className:i,style:p,"aria-hidden":!0,focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:a?a.viewBox:w,dangerouslySetInnerHTML:a?{__html:a.content}:void 0},h),a?void 0:n))}));B.propTypes={style:u.object,classNames:u.string,children:u.any,icon:u.object,themeColor:u.oneOf(["inherit","primary","secondary","tertiary","info","success","error","warning","dark","light","inverse"]),size:u.oneOf(["default","xsmall","small","medium","large","xlarge"]),flip:u.oneOf(["default","horizontal","vertical","both"])};var F={size:"default",themeColor:"inherit",flip:"default",icon:"",viewBox:"0 0 24 24"};B.displayName="KendoSvgIcon";var V=function(){return"undefined"!=typeof document?document:{}},H=function(){function e(){}return Object.defineProperty(e.prototype,"scrollbarWidth",{get:function(){var e=V();if(!this.scrollbar&&e&&e.createElement){var t=e.createElement("div");t.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",t.innerHTML="&nbsp;",e.body.appendChild(t),this.scrollbar=t.offsetWidth-t.scrollWidth,e.body.removeChild(t)}return this.scrollbar},enumerable:!0,configurable:!0}),e}(),K=function(){return(K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function U(e,t,n){var r;return n?K({},e,((r={})[t]=n.length?n.slice():void 0,r)):e&&e[t]?e[t].slice():[]}var q=function(e,t,n){return e.map((function(e){return function e(t,n,r){if(t[n]){var o=U(t,n).map((function(t){return e(t,n,r)}));return r(U(t,n,o))}return r(t)}(e,t,n)})).slice()},W=function(e,t,n){var r;return Object.assign({},e,e[t]?((r={})[t]=e[t].slice(),r):{},n||{})}},function(e,t){e.exports=n},function(e,t,n){"use strict";function r(e){this.content=e}n.r(t),n.d(t,"getHtml",(function(){return Ot})),n.d(t,"setHtml",(function(){return St})),n.d(t,"parseContent",(function(){return Ct})),n.d(t,"applyInlineStyle",(function(){return Qt})),n.d(t,"getInlineStyles",(function(){return Yt})),n.d(t,"toggleInlineFormat",(function(){return Xt})),n.d(t,"applyLink",(function(){return tn})),n.d(t,"removeLink",(function(){return en})),n.d(t,"insertText",(function(){return nn})),n.d(t,"insertImage",(function(){return rn})),n.d(t,"alignBlocks",(function(){return hn})),n.d(t,"isAligned",(function(){return mn})),n.d(t,"cleanFormatting",(function(){return vn})),n.d(t,"hasNode",(function(){return pn})),n.d(t,"activeNode",(function(){return fn})),n.d(t,"formatBlockElements",(function(){return sn})),n.d(t,"getBlockFormats",(function(){return cn})),n.d(t,"parentBlockFormat",(function(){return dn})),n.d(t,"changeTextBlock",(function(){return on})),n.d(t,"blockNodes",(function(){return an})),n.d(t,"cleanTextBlockFormatting",(function(){return ln})),n.d(t,"hasMark",(function(){return Kt})),n.d(t,"getMark",(function(){return Wt})),n.d(t,"getActiveMarks",(function(){return $t})),n.d(t,"removeAllMarks",(function(){return Vt})),n.d(t,"cleanMarks",(function(){return Ht})),n.d(t,"selectionMarks",(function(){return qt})),n.d(t,"indent",(function(){return Bn})),n.d(t,"canIndentAsListItem",(function(){return zn})),n.d(t,"outdent",(function(){return Fn})),n.d(t,"canOutdentAsListItem",(function(){return Rn})),n.d(t,"isIndented",(function(){return An})),n.d(t,"canBeIndented",(function(){return Ln})),n.d(t,"indentBlocks",(function(){return jn})),n.d(t,"toggleOrderedList",(function(){return Sr})),n.d(t,"toggleUnorderedList",(function(){return Or})),n.d(t,"toggleList",(function(){return Cr})),n.d(t,"hasSameMarkup",(function(){return Pt})),n.d(t,"getSelectionText",(function(){return jt})),n.d(t,"getNodeFromSelection",(function(){return At})),n.d(t,"selectedLineTextOnly",(function(){return zt})),n.d(t,"canInsert",(function(){return Nt})),n.d(t,"insertNode",(function(){return Mt})),n.d(t,"indentHtml",(function(){return Rt})),n.d(t,"alignLeftRules",(function(){return Ir})),n.d(t,"alignCenterRules",(function(){return Nr})),n.d(t,"alignRightRules",(function(){return Dr})),n.d(t,"alignJustifyRules",(function(){return Tr})),n.d(t,"alignRemoveRules",(function(){return _r})),n.d(t,"indentRules",(function(){return Mn})),n.d(t,"outdentRules",(function(){return Pn})),n.d(t,"nodes",(function(){return wl})),n.d(t,"marks",(function(){return bl})),n.d(t,"buildKeymap",(function(){return uc})),n.d(t,"buildListKeymap",(function(){return pc})),n.d(t,"bold",(function(){return nc})),n.d(t,"italic",(function(){return rc})),n.d(t,"underline",(function(){return oc})),n.d(t,"strikethrough",(function(){return ic})),n.d(t,"subscript",(function(){return ac})),n.d(t,"superscript",(function(){return sc})),n.d(t,"link",(function(){return lc})),n.d(t,"sanitize",(function(){return xc})),n.d(t,"removeComments",(function(){return kc})),n.d(t,"removeTag",(function(){return Cc})),n.d(t,"pasteCleanup",(function(){return Nc})),n.d(t,"sanitizeClassAttr",(function(){return Sc})),n.d(t,"sanitizeStyleAttr",(function(){return Dc})),n.d(t,"removeAttribute",(function(){return Oc})),n.d(t,"convertMsLists",(function(){return wc})),n.d(t,"createTable",(function(){return Tc})),n.d(t,"find",(function(){return Mc})),n.d(t,"findAt",(function(){return _c})),n.d(t,"findAll",(function(){return Pc})),n.d(t,"replace",(function(){return jc})),n.d(t,"replaceAll",(function(){return Ac})),n.d(t,"placeholder",(function(){return Bc})),n.d(t,"spacesFix",(function(){return Hc})),n.d(t,"textHighlight",(function(){return Uc})),n.d(t,"textHighlightKey",(function(){return Kc})),n.d(t,"autoJoin",(function(){return pr})),n.d(t,"baseKeymap",(function(){return yr})),n.d(t,"chainCommands",(function(){return dr})),n.d(t,"createParagraphNear",(function(){return tr})),n.d(t,"deleteSelection",(function(){return Vn})),n.d(t,"exitCode",(function(){return er})),n.d(t,"joinBackward",(function(){return Hn})),n.d(t,"joinDown",(function(){return Yn})),n.d(t,"joinForward",(function(){return Wn})),n.d(t,"joinUp",(function(){return Jn})),n.d(t,"lift",(function(){return Zn})),n.d(t,"liftEmptyBlock",(function(){return nr})),n.d(t,"macBaseKeymap",(function(){return vr})),n.d(t,"newlineInCode",(function(){return Xn})),n.d(t,"pcBaseKeymap",(function(){return mr})),n.d(t,"selectAll",(function(){return ar})),n.d(t,"selectNodeBackward",(function(){return Un})),n.d(t,"selectNodeForward",(function(){return $n})),n.d(t,"selectParentNode",(function(){return ir})),n.d(t,"setBlockType",(function(){return cr})),n.d(t,"splitBlock",(function(){return rr})),n.d(t,"splitBlockKeepMarks",(function(){return or})),n.d(t,"toggleMark",(function(){return ur})),n.d(t,"wrapIn",(function(){return lr})),n.d(t,"dropCursor",(function(){return qc})),n.d(t,"GapCursor",(function(){return $c})),n.d(t,"gapCursor",(function(){return Jc})),n.d(t,"HistoryState",(function(){return Il})),n.d(t,"closeHistory",(function(){return Al})),n.d(t,"history",(function(){return Ll})),n.d(t,"redo",(function(){return Fl})),n.d(t,"redoDepth",(function(){return Hl})),n.d(t,"undo",(function(){return Bl})),n.d(t,"undoDepth",(function(){return Vl})),n.d(t,"InputRule",(function(){return Kl})),n.d(t,"closeDoubleQuote",(function(){return Yl})),n.d(t,"closeSingleQuote",(function(){return Xl})),n.d(t,"ellipsis",(function(){return Gl})),n.d(t,"emDash",(function(){return $l})),n.d(t,"inputRules",(function(){return Ul})),n.d(t,"openDoubleQuote",(function(){return Jl})),n.d(t,"openSingleQuote",(function(){return Zl})),n.d(t,"smartQuotes",(function(){return Ql})),n.d(t,"textblockTypeInputRule",(function(){return tc})),n.d(t,"undoInputRule",(function(){return Wl})),n.d(t,"wrappingInputRule",(function(){return ec})),n.d(t,"keydownHandler",(function(){return Wr})),n.d(t,"keymap",(function(){return qr})),n.d(t,"ContentMatch",(function(){return P})),n.d(t,"DOMParser",(function(){return ee})),n.d(t,"DOMSerializer",(function(){return pe})),n.d(t,"Fragment",(function(){return i})),n.d(t,"Mark",(function(){return u})),n.d(t,"MarkType",(function(){return Z})),n.d(t,"Node",(function(){return N})),n.d(t,"NodeRange",(function(){return E})),n.d(t,"NodeType",(function(){return $})),n.d(t,"ReplaceError",(function(){return p})),n.d(t,"ResolvedPos",(function(){return x})),n.d(t,"Schema",(function(){return X})),n.d(t,"Slice",(function(){return d})),n.d(t,"addListNodes",(function(){return On})),n.d(t,"bulletList",(function(){return xn})),n.d(t,"liftListItem",(function(){return In})),n.d(t,"listItem",(function(){return kn})),n.d(t,"orderedList",(function(){return wn})),n.d(t,"sinkListItem",(function(){return Dn})),n.d(t,"splitListItem",(function(){return En})),n.d(t,"wrapInList",(function(){return Sn})),n.d(t,"AllSelection",(function(){return st})),n.d(t,"EditorState",(function(){return vt})),n.d(t,"NodeSelection",(function(){return it})),n.d(t,"Plugin",(function(){return bt})),n.d(t,"PluginKey",(function(){return kt})),n.d(t,"Selection",(function(){return et})),n.d(t,"SelectionRange",(function(){return nt})),n.d(t,"TextSelection",(function(){return rt})),n.d(t,"Transaction",(function(){return pt})),n.d(t,"CellSelection",(function(){return ss})),n.d(t,"TableMap",(function(){return Fa})),n.d(t,"TableView",(function(){return Qs})),n.d(t,"__clipCells",(function(){return ds})),n.d(t,"__insertCells",(function(){return ms})),n.d(t,"__pastedCells",(function(){return us})),n.d(t,"addColSpan",(function(){return is})),n.d(t,"addColumn",(function(){return Ts})),n.d(t,"addColumnAfter",(function(){return Ms})),n.d(t,"addColumnBefore",(function(){return _s})),n.d(t,"addRow",(function(){return zs})),n.d(t,"addRowAfter",(function(){return Ls})),n.d(t,"addRowBefore",(function(){return Rs})),n.d(t,"cellAround",(function(){return $a})),n.d(t,"colCount",(function(){return es})),n.d(t,"columnIsHeader",(function(){return as})),n.d(t,"columnResizing",(function(){return nl})),n.d(t,"columnResizingPluginKey",(function(){return tl})),n.d(t,"deleteColumn",(function(){return js})),n.d(t,"deleteRow",(function(){return Fs})),n.d(t,"deleteTable",(function(){return Xs})),n.d(t,"findCell",(function(){return Qa})),n.d(t,"fixTables",(function(){return Ds})),n.d(t,"fixTablesKey",(function(){return Is})),n.d(t,"goToNextCell",(function(){return Zs})),n.d(t,"handlePaste",(function(){return ks})),n.d(t,"inSameTable",(function(){return Xa})),n.d(t,"isInTable",(function(){return Ga})),n.d(t,"mergeCells",(function(){return Hs})),n.d(t,"moveCellForward",(function(){return Za})),n.d(t,"nextCell",(function(){return ts})),n.d(t,"pointsAtCell",(function(){return Ya})),n.d(t,"removeColSpan",(function(){return rs})),n.d(t,"removeColumn",(function(){return Ps})),n.d(t,"removeRow",(function(){return Bs})),n.d(t,"rowIsHeader",(function(){return As})),n.d(t,"selectedRect",(function(){return Ns})),n.d(t,"selectionCell",(function(){return Ja})),n.d(t,"setAttr",(function(){return ns})),n.d(t,"setCellAttr",(function(){return qs})),n.d(t,"splitCell",(function(){return Ks})),n.d(t,"splitCellWithType",(function(){return Us})),n.d(t,"tableEditing",(function(){return ll})),n.d(t,"tableEditingKey",(function(){return Wa})),n.d(t,"tableNodeTypes",(function(){return qa})),n.d(t,"tableNodes",(function(){return Ua})),n.d(t,"toggleHeader",(function(){return $s})),n.d(t,"toggleHeaderCell",(function(){return Ys})),n.d(t,"toggleHeaderColumn",(function(){return Js})),n.d(t,"toggleHeaderRow",(function(){return Gs})),n.d(t,"updateColumnsOnResize",(function(){return el})),n.d(t,"AddMarkStep",(function(){return Fe})),n.d(t,"MapResult",(function(){return ve})),n.d(t,"Mapping",(function(){return ye})),n.d(t,"RemoveMarkStep",(function(){return Ve})),n.d(t,"ReplaceAroundStep",(function(){return Ie})),n.d(t,"ReplaceStep",(function(){return Ee})),n.d(t,"Step",(function(){return Oe})),n.d(t,"StepMap",(function(){return ge})),n.d(t,"StepResult",(function(){return Se})),n.d(t,"Transform",(function(){return we})),n.d(t,"TransformError",(function(){return be})),n.d(t,"canJoin",(function(){return je})),n.d(t,"canSplit",(function(){return Pe})),n.d(t,"dropPoint",(function(){return Le})),n.d(t,"findWrapping",(function(){return _e})),n.d(t,"insertPoint",(function(){return Re})),n.d(t,"joinPoint",(function(){return ze})),n.d(t,"liftTarget",(function(){return Te})),n.d(t,"replaceStep",(function(){return He})),n.d(t,"Decoration",(function(){return fa})),n.d(t,"DecorationSet",(function(){return ga})),n.d(t,"EditorView",(function(){return Ta})),n.d(t,"__endComposition",(function(){return ra})),n.d(t,"__parseFromClipboard",(function(){return Di})),n.d(t,"__serializeForClipboard",(function(){return Ii})),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,i=o.find(e),a=o.content.slice();return-1==i?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new r(a)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),a=o.find(e);return i.splice(-1==a?i.length:a,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var o=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:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};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,p=Math.min(s.text.length,l.text.length);u<p&&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 d=e(s.content,l.content,r-1,o-1);if(d)return d}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 p(e){var t=Error.call(this,e);return t.__proto__=p.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=[],p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="ReplaceError";var d=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},f={size:{configurable:!0}};function h(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("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,p=c.end;return b(s,function e(t,n,r,o,a){var s=t.depth>a&&v(t,n,a+1),l=o.depth>a&&v(r,o,a+1),c=[];y(null,t,a,c),s&&l&&n.index(a)==r.index(a)?(m(s,l),g(b(s,e(t,n,r,o,a+1)),c)):(s&&g(b(s,w(t,n,a+1)),c),y(n,r,a,c),l&&g(b(l,w(r,o,a+1)),c));return y(o,null,a,c),new i(c)}(t,u,p,n,o))}var d=t.parent,f=d.content;return b(d,f.cut(0,t.parentOffset).append(r.content).append(f.cut(n.parentOffset)))}return b(s,w(t,n,o))}(e,t,n,0)}function m(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){var r=e.node(n);return m(r,t.node(n)),r}function g(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 y(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&&(g(e.nodeAfter,r),i++));for(var s=i;s<a;s++)g(o.child(s),r);t&&t.depth==n&&t.textOffset&&g(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new p("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(y(null,e,n,r),e.depth>n)&&g(b(v(e,t,n+1),w(e,t,n+1)),r);return y(t,null,n,r),new i(r)}f.size.get=function(){return this.content.size-this.openStart-this.openEnd},d.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 d(n,this.openStart,this.openEnd)},d.prototype.removeBetween=function(e,t){return new d(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)},d.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},d.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},d.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},d.fromJSON=function(e,t){if(!t)return d.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 d(i.fromJSON(e,t.content),n,r)},d.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 d(e,n,r)},Object.defineProperties(d.prototype,f),d.empty=new d(i.empty,0,0);var x=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},k={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};x.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},k.parent.get=function(){return this.node(this.depth)},k.doc.get=function(){return this.node(0)},x.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},x.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},x.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},x.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},x.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},x.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]},x.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},k.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},k.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},k.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)},x.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o<e;o++)r+=n.child(o).nodeSize;return r},x.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},x.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},x.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},x.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 E(this,e,n)},x.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},x.prototype.max=function(e){return e.pos>this.pos?e:this},x.prototype.min=function(e){return e.pos<this.pos?e:this},x.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},x.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 x(t,n,o)},x.resolveCached=function(e,t){for(var n=0;n<C.length;n++){var r=C[n];if(r.pos==t&&r.doc==e)return r}var o=C[O]=x.resolve(e,t);return O=(O+1)%S,o},Object.defineProperties(x.prototype,k);var C=[],O=0,S=12,E=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},I={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};I.start.get=function(){return this.$from.before(this.depth+1)},I.end.get=function(){return this.$to.after(this.depth+1)},I.parent.get=function(){return this.$from.node(this.depth)},I.startIndex.get=function(){return this.$from.index(this.depth)},I.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(E.prototype,I);var D=Object.create(null),N=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||i.empty,this.marks=r||u.none},T={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};T.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},T.childCount.get=function(){return this.content.childCount},N.prototype.child=function(e){return this.content.child(e)},N.prototype.maybeChild=function(e){return this.content.maybeChild(e)},N.prototype.forEach=function(e){this.content.forEach(e)},N.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},N.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},T.textContent.get=function(){return this.textBetween(0,this.content.size,"")},N.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},T.firstChild.get=function(){return this.content.firstChild},T.lastChild.get=function(){return this.content.lastChild},N.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},N.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},N.prototype.hasMarkup=function(e,t,n){return this.type==e&&c(this.attrs,t||e.defaultAttrs||D)&&u.sameSet(this.marks,n||u.none)},N.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},N.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},N.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},N.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return d.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 d(s,r.depth-i,o.depth-i)},N.prototype.replace=function(e,t,n){return h(this.resolve(e),this.resolve(t),n)},N.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}},N.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}},N.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}},N.prototype.resolve=function(e){return x.resolveCached(this,e)},N.prototype.resolveNoCache=function(e){return x.resolve(this,e)},N.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},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},N.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()+")"),M(this.marks,e)},N.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},N.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},N.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},N.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},N.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()}))},N.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},N.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(N.prototype,T);var _=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:{configurable:!0},nodeSize:{configurable:!0}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):M(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}(N);function M(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=[]},j={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};P.parse=function(e,t){var n=new A(e,t);if(null==n.next)return P.empty;var r=R(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];K(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(H);i.next.push(o[a],t[s.join(",")]||n(s))}return i}(K(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,p=0;p<t.min;p++){var d=n();o(e(t.expr,u),d),u=d}if(-1==t.max)o(e(t.expr,u),u);else for(var f=t.min;f<t.max;f++){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 (see https://prosemirror.net/docs/guide/#generatable)")}}(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},j.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInl