1"use strict";(self.webpackChunkStammer_ai=self.webpackChunkStammer_ai||[]).push([[2692],{42683:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward")},95550:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward")},56599:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code")},90061:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter")},15970:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify")},89849:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft")},9472:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight")},1682:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold")},48333:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic")},61812:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted")},51257:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered")},54397:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined")},24094:function(t,e,n){var r=n(81056),o=n(78685);e.A=(0,r.A)((0,o.jsx)("path",{d:"M10 10.02h5V21h-5zM17 21h3c1.1 0 2-.9 2-2v-9h-5zm3-18H5c-1.1 0-2 .9-2 2v3h19V5c0-1.1-.9-2-2-2M3 19c0 1.1.9 2 2 2h3V10H3z"}),"TableChart")},35972:function(t,e,n){n.d(e,{A:function(){return T}});var r=n(2057),o=n(26493),i=n(47836),a=n(7098),s=n(52446),u=n(38753),c=n(78153),l=n(52932),f=n(4099),d=n(59620),h=n(63958),p=n(26542);function v(t){return(0,p.Ay)("MuiButtonGroup",t)}var m=(0,h.A)("MuiButtonGroup",["root","contained","outlined","text","disableElevation","disabled","firstButton","fullWidth","horizontal","vertical","colorPrimary","colorSecondary","grouped","groupedHorizontal","groupedVertical","groupedText","groupedTextHorizontal","groupedTextVertical","groupedTextPrimary","groupedTextSecondary","groupedOutlined","groupedOutlinedHorizontal","groupedOutlinedVertical","groupedOutlinedPrimary","groupedOutlinedSecondary","groupedContained","groupedContainedHorizontal","groupedContainedVertical","groupedContainedPrimary","groupedContainedSecondary","lastButton","middleButton"]),y=n(79723),g=n(47879),b=n(78685),k=["children","className","color","component","disabled","disableElevation","disableFocusRipple","disableRipple","fullWidth","orientation","size","variant"];function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
1e%2?D(Object(n),!0).forEach((function(e){M(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||E(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||E(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){if(t){if("string"==typeof t)return x(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function M(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=w(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==w(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var O=(0,c.Ay)("div",{name:"MuiButtonGroup",slot:"Root",overridesResolver:function(t,e){var n=t.ownerState;return[M({},"& .".concat(m.grouped),e.grouped),M({},"& .".concat(m.grouped),e["grouped".concat((0,u.A)(n.orientation))]),M({},"& .".concat(m.grouped),e["grouped".concat((0,u.A)(n.variant))]),M({},"& .".concat(m.grouped),e["grouped".concat((0,u.A)(n.variant)).concat((0,u.A)(n.orientation))]),M({},"& .".concat(m.grouped),e["grouped".concat((0,u.A)(n.variant)).concat((0,u.A)(n.color))]),M({},"& .".concat(m.firstButton),e.firstButton),M({},"& .".concat(m.lastButton),e.lastButton),M({},"& .".concat(m.middleButton),e.middleButton),e.root,e[n.variant],!0===n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth,"vertical"===n.orientation&&e.vertical]}})((0,l.A)((function(t){var e=t.theme;return M({display:"inline-flex",borderRadius:(e.vars||e).shape.borderRadius,variants:[{props:{variant:"contained"},style:{boxShadow:(e.vars||e).shadows[2]}},{props:{disableElevation:!0},style:{boxShadow:"none"}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"vertical"},style:M(M({flexDirection:"column"},"& .".concat(m.lastButton,",& .").concat(m.middleButton),{borderTopRightRadius:0,borderTopLeftRadius:0}),"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderBottomRightRadius:0,borderBottomLeftRadius:0})},{props:{orientation:"horizontal"},style:M(M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderTopRightRadius:0,borderBottomRightRadius:0}),"& .".concat(m.lastButton,",& .").concat(m.middleButton),{borderTopLeftRadius:0,borderBottomLeftRadius:0})},{props:{variant:"text",orientation:"horizontal"},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),M({borderRight:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroundChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}))},{props:{variant:"text",orientation:"vertical"},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),M({borderBottom:e.vars?"1px solid rgba(".concat(e.vars.palette.common.onBackgroun
1dChannel," / 0.23)"):"1px solid ".concat("light"===e.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)")},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}))}].concat(A(Object.entries(e.palette).filter((0,f.A)()).flatMap((function(t){var n=S(t,1)[0];return[{props:{variant:"text",color:n},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderColor:e.vars?"rgba(".concat(e.vars.palette[n].mainChannel," / 0.5)"):(0,a.X4)(e.palette[n].main,.5)})}]}))),[{props:{variant:"outlined",orientation:"horizontal"},style:M(M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderRightColor:"transparent","&:hover":{borderRightColor:"currentColor"}}),"& .".concat(m.lastButton,",& .").concat(m.middleButton),{marginLeft:-1})},{props:{variant:"outlined",orientation:"vertical"},style:M(M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderBottomColor:"transparent","&:hover":{borderBottomColor:"currentColor"}}),"& .".concat(m.lastButton,",& .").concat(m.middleButton),{marginTop:-1})},{props:{variant:"contained",orientation:"horizontal"},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),M({borderRight:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(m.disabled),{borderRight:"1px solid ".concat((e.vars||e).palette.action.disabled)}))},{props:{variant:"contained",orientation:"vertical"},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),M({borderBottom:"1px solid ".concat((e.vars||e).palette.grey[400])},"&.".concat(m.disabled),{borderBottom:"1px solid ".concat((e.vars||e).palette.action.disabled)}))}],A(Object.entries(e.palette).filter((0,f.A)(["dark"])).map((function(t){var n=S(t,1)[0];return{props:{variant:"contained",color:n},style:M({},"& .".concat(m.firstButton,",& .").concat(m.middleButton),{borderColor:(e.vars||e).palette[n].dark})}}))))},"& .".concat(m.grouped),{minWidth:40,boxShadow:"none",props:{variant:"contained"},style:{"&:hover":{boxShadow:"none"}}})}))),T=r.forwardRef((function(t,e){var n=(0,d.b)({props:t,name:"MuiButtonGroup"}),a=n.children,c=n.className,l=n.color,f=void 0===l?"primary":l,h=n.component,p=void 0===h?"div":h,m=n.disabled,w=void 0!==m&&m,D=n.disableElevation,S=void 0!==D&&D,A=n.disableFocusRipple,E=void 0!==A&&A,x=n.disableRipple,M=void 0!==x&&x,T=n.fullWidth,N=void 0!==T&&T,F=n.orientation,R=void 0===F?"horizontal":F,P=n.size,B=void 0===P?"medium":P,j=n.variant,L=void 0===j?"outlined":j,I=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,k),z=C(C({},n),{},{color:f,component:p,disabled:w,disableElevation:S,disableFocusRipple:E,disableRipple:M,fullWidth:N,orientation:R,size:B,variant:L}),$=function(t){var e=t.classes,n=t.color,r=t.disabled,o=t.disableElevation,a=t.fullWidth,s=t.orientation,c=t.variant,l={root:["root",c,s,a&&"fullWidth",o&&"disableElevation","color".concat((0,u.A)(n))],grouped:["grouped","grouped".concat((0,u.A)(s)),"grouped".concat((0,u.A)(c)),"grouped".concat((0,u.A)(c)).concat((0,u.A)(s)),"grouped".concat((0,u.A)(c)).concat((0,u.A)(n)),r&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return(0,i.A)(l,v,e)}(z),H=r.useMemo((function(){return{className:$.grouped,color:f,disabled:w,disableElevation:S,disableFocusRipple:E,disableRipple:M,fullWidth:N,size:B,variant:L}}),[f,w,S,E,M,N,B,L,$.grouped]),V=(0,s.A)(a),_=V.length,K=function(t){var e=0===t,n=t===_-1;return e&&n?"":e?$.firstButton:n?$.lastButton:$.middleButton};return(0,b.jsx)(O,C(C({as:p,role:"group",className:(0,o.A)($.root,c),ref:e,ownerState:z},I),{},{children:(0,b.jsx)(y.A.Provider,{value:H,children:V.map((function(t,e){return(0,b.jsx)(g.A.Provider,{value:K(e),children:t},e)}))})}))}))},74176:function(t,e,n){ 2/** 3 * @license React 4 * use-sync-external-store-shim.production.js 5 * 6 * Copyright (c) Meta Platforms, Inc. and affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */ 11var r=n(2057);var o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=r.useState,a=r.useEffect,s=r.useLayoutEffect,u=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!o(t,n)}catch(t){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=i({inst:{value:n,getSnapshot:e}}),o=r[0].inst,l=r[1];return s((function(){o.value=n,o.getSnapshot=e,c(o)&&l({inst:o})}),[t,n,e]),a((function(){return c(o)&&l({inst:o}),t((function(){c(o)&&l({inst:o})}))}),[t]),u(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},90651:function(t,e,n){ 12/** 13 * @license React 14 * use-sync-external-store-shim/with-selector.production.js 15 * 16 * Copyright (c) Meta Platforms, Inc. and affiliates. 17 * 18 * This source code is licensed under the MIT license found in the 19 * LICENSE file in the root directory of this source tree. 20 */ 21var r=n(2057),o=n(43723);var i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=o.useSyncExternalStore,s=r.useRef,u=r.useEffect,c=r.useMemo,l=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,o){var f=s(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=c((function(){function t(t){if(!u){if(u=!0,a=t,t=r(t),void 0!==o&&d.hasValue){var e=d.value;if(o(e,t))return s=e}return s=t}if(e=s,i(a,t))return e;var n=r(t);return void 0!==o&&o(e,n)?(a=t,e):(a=t,s=n)}var a,s,u=!1,c=void 0===n?null:n;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,n,r,o]);var h=a(t,f[0],f[1]);return u((function(){d.hasValue=!0,d.value=h}),[h]),l(h),h}},43723:function(t,e,n){t.exports=n(74176)},99505:function(t,e,n){t.exports=n(90651)},51222:function(t,e,n){n.d(e,{KE:function(){return Qn},YY:function(){return $n},CU:function(){return Pn},bP:function(){return mr},Nz:function(){return or},gk:function(){return xe},AB:function(){return ir},T7:function(){return be},Nx:function(){return ke},eL:function(){return we},gu:function(){return He},FF:function(){return _e},iI:function(){return Ce},hO:function(){return Ke},fl:function(){return We},Pg:function(){return bt},QN:function(){return Ye},J_:function(){return Ge},rU:function(){return ee},Op:function(){return Qe},BQ:function(){return tn},OX:function(){return tr},Zc:function(){return yr},KV:function(){return Te},jT:function(){return er},Dd:function(){return hr},kj:function(){return pr},JJ:function(){return nr},tG:function(){return rr}});var r=n(441),o=n(42959),i=n(17386),a=function(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)};function s(t,e){var n=t.selection.$cursor;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var u=function(t,e,n){var a=s(t,n);if(!a)return!1;var u=d(a);if(!u){var c=a.blockRange(),f=c&&(0,r.jP)(c);return null!=f&&(e&&e(t.tr.lift(c,f).scrollIntoView()),!0)}var h=u.nodeBefore;if(S(t,u,e,-1))return!0;
21if(0==a.parent.content.size&&(l(h,"end")||i.nh.isSelectable(h)))for(var p=a.depth;;p--){var v=(0,r.$L)(t.doc,a.before(p),a.after(p),o.Ji.empty);if(v&&v.slice.size<v.to-v.from){if(e){var m=t.tr.step(v);m.setSelection(l(h,"end")?i.LN.findFrom(m.doc.resolve(m.mapping.map(u.pos,-1)),-1):i.nh.create(m.doc,u.pos-h.nodeSize)),e(m.scrollIntoView())}return!0}if(1==p||a.node(p-1).childCount>1)break}return!(!h.isAtom||u.depth!=a.depth-1)&&(e&&e(t.tr.delete(u.pos-h.nodeSize,u.pos).scrollIntoView()),!0)};function c(t,e,n){for(var a=e.nodeBefore,s=e.pos-1;!a.isTextblock;s--){if(a.type.spec.isolating)return!1;var u=a.lastChild;if(!u)return!1;a=u}for(var c=e.nodeAfter,l=e.pos+1;!c.isTextblock;l++){if(c.type.spec.isolating)return!1;var f=c.firstChild;if(!f)return!1;c=f}var d=(0,r.$L)(t.doc,s,l,o.Ji.empty);if(!d||d.from!=s||d instanceof r.Ln&&d.slice.size>=l-s)return!1;if(n){var h=t.tr.step(d);h.setSelection(i.U3.create(h.doc,s)),n(h.scrollIntoView())}return!0}function l(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var f=function(t,e,n){var r=t.selection,o=r.$head,a=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;a=d(o)}var s=a&&a.nodeBefore;return!(!s||!i.nh.isSelectable(s))&&(e&&e(t.tr.setSelection(i.nh.create(t.doc,a.pos-s.nodeSize)).scrollIntoView()),!0)};function d(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function h(t,e){var n=t.selection.$cursor;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}var p=function(t,e,n){var a=h(t,n);if(!a)return!1;var s=m(a);if(!s)return!1;var u=s.nodeAfter;if(S(t,s,e,1))return!0;if(0==a.parent.content.size&&(l(u,"start")||i.nh.isSelectable(u))){var c=(0,r.$L)(t.doc,a.before(),a.after(),o.Ji.empty);if(c&&c.slice.size<c.to-c.from){if(e){var f=t.tr.step(c);f.setSelection(l(u,"start")?i.LN.findFrom(f.doc.resolve(f.mapping.map(s.pos)),1):i.nh.create(f.doc,f.mapping.map(s.pos))),e(f.scrollIntoView())}return!0}}return!(!u.isAtom||s.depth!=a.depth-1)&&(e&&e(t.tr.delete(s.pos,s.pos+u.nodeSize).scrollIntoView()),!0)},v=function(t,e,n){var r=t.selection,o=r.$head,a=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;a=m(o)}var s=a&&a.nodeAfter;return!(!s||!i.nh.isSelectable(s))&&(e&&e(t.tr.setSelection(i.nh.create(t.doc,a.pos)).scrollIntoView()),!0)};function m(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}var y=function(t,e){var n=t.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function g(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var b=function(t,e){var n=t.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),u=g(a.contentMatchAt(s));if(!u||!a.canReplaceWith(s,s,u))return!1;if(e){var c=r.after(),l=t.tr.replaceWith(c,c,u.createAndFill());l.setSelection(i.LN.near(l.doc.resolve(c),1)),e(l.scrollIntoView())}return!0},k=function(t,e){var n=t.selection,r=n.$from,o=n.$to;if(n instanceof i.i5||r.parent.inlineContent||o.parent.inlineContent)return!1;var a=g(o.parent.contentMatchAt(o.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,u=t.tr.insert(s,a.createAndFill());u.setSelection(i.U3.create(u.doc,s+1)),e(u.scrollIntoView())}return!0},w=function(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if((0,r.zy)(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),a=i&&(0,r.jP)(i);return null!=a&&(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)};var D,C=function(t,e){var n=t.selection,o=n.$from,a=n.$to;if(t.selection instanceof i.nh&&t.selection.node.isBlock)return!(!o.parentOffset||!(0,r.zy)(t.doc,o.pos)||(e&&e(t.tr.split(o.pos).scrollIntoView()),0));if(!o.depth)return!1;for(var s,u,c=[],l=!1,f=!1,d=o.depth;;d--){if(o.node(d).isBlock){l=o.end(d)==o.pos+(o.depth-d),f=o.start(d)==o.pos-(o.depth-d),u=g(o.node(d-1).contentMatchAt(o.indexAfter(d-1)));var h=D&&D(a.parent,l,o);c.unshift(h||(l&&u?{type:u}:null)),s=d;break}if(1==d)return!1;c.unshift(null)}var p=t.tr;(t.selection instanceof i.U3||t.selection instanceof i.i5)&&p.deleteSelection();var v=p.mapping.map(o.pos),m=(0,r.zy)(p.doc,v,c.length,c);if(m||(c[0]=u?{type:u}:null,m=(0,r.zy)(p.doc,v,c.length,c)),!m)return!1;if(p.split(v,c.length,c),!l&&f&&o.node(s).type!=u){var y=p.mapping.map(o.before(s)),b=p.doc.resolve(y);u&&o.node(s-1).canReplaceWith(b.index(),b.index()+1,u)&&p.setNodeMarkup(p.mapping.map(o.before(s)),u)}return e&&e(p.scrollIntoView()),!0};function S(t,e,n,a){var s,u,c=e.nodeBefore,f=e.nodeAfter,d=c.type.spec.isolating||f.type.spec.isolating;
21if(!d&&function(t,e,n){var o=e.nodeBefore,i=e.nodeAfter,a=e.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&e.parent.canReplace(a-1,a)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(a,a+1)||!i.isTextblock&&!(0,r.n9)(t.doc,e.pos)||(n&&n(t.tr.join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;var h=!d&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(s=(u=c.contentMatchAt(c.childCount)).findWrapping(f.type))&&u.matchType(s[0]||f.type).validEnd){if(n){for(var p=e.pos+f.nodeSize,v=o.FK.empty,m=s.length-1;m>=0;m--)v=o.FK.from(s[m].create(null,v));v=o.FK.from(c.copy(v));var y=t.tr.step(new r.Wg(e.pos-1,p,e.pos,p,new o.Ji(v,1,0),s.length,!0)),g=y.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==c.type&&(0,r.n9)(y.doc,g.pos)&&y.join(g.pos),n(y.scrollIntoView())}return!0}var b=f.type.spec.isolating||a>0&&d?null:i.LN.findFrom(e,1),k=b&&b.$from.blockRange(b.$to),w=k&&(0,r.jP)(k);if(null!=w&&w>=e.depth)return n&&n(t.tr.lift(k,w).scrollIntoView()),!0;if(h&&l(f,"start",!0)&&l(c,"end")){for(var D=c,C=[];C.push(D),!D.isTextblock;)D=D.lastChild;for(var S=f,A=1;!S.isTextblock;S=S.firstChild)A++;if(D.canReplace(D.childCount,D.childCount,S.content)){if(n){for(var E=o.FK.empty,x=C.length-1;x>=0;x--)E=o.FK.from(C[x].copy(E));n(t.tr.step(new r.Wg(e.pos-C.length,e.pos+f.nodeSize,e.pos+A,e.pos+f.nodeSize-A,new o.Ji(E,C.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function A(t){return function(e,n){for(var r=e.selection,o=t<0?r.$from:r.$to,a=o.depth;o.node(a).isInline;){if(!a)return!1;a--}return!!o.node(a).isTextblock&&(n&&n(e.tr.setSelection(i.U3.create(e.doc,t<0?o.start(a):o.end(a)))),!0)}}var E=A(-1),x=A(1);function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){for(var o=!1,i=0;i<n.selection.ranges.length&&!o;i++){var a=n.selection.ranges[i],s=a.$from.pos,u=a.$to.pos;n.doc.nodesBetween(s,u,(function(r,i){if(o)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)o=!0;else{var a=n.doc.resolve(i),s=a.index();o=a.parent.canReplaceWith(s,s+1,t)}}))}if(!o)return!1;if(r){for(var c=n.tr,l=0;l<n.selection.ranges.length;l++){var f=n.selection.ranges[l],d=f.$from.pos,h=f.$to.pos;c.setBlockType(d,h,t,e)}r(c.scrollIntoView())}return!0}}function O(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var T=O(a,u,f),N=O(a,p,v),F={Enter:O(y,k,w,C),"Mod-Enter":b,Backspace:T,"Mod-Backspace":T,"Shift-Backspace":T,Delete:N,"Mod-Delete":N,"Mod-a":function(t,e){return e&&e(t.tr.setSelection(new i.i5(t.doc))),!0}},R={"Ctrl-h":F.Backspace,"Alt-Backspace":F["Mod-Backspace"],"Ctrl-d":F.Delete,"Ctrl-Alt-Backspace":F["Mod-Delete"],"Alt-Delete":F["Mod-Delete"],"Alt-d":F["Mod-Delete"],"Ctrl-a":E,"Ctrl-e":x};for(var P in F)R[P]=F[P];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,i){var a=n.selection,s=a.$from,u=a.$to,c=s.blockRange(u);if(!c)return!1;var l=i?n.tr:null;return!!function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=!1,s=e,u=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&0==e.startIndex){if(0==e.$from.index(e.depth-1))return!1;var c=u.resolve(e.start-2);s=new o.u$(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new o.u$(e.$from,u.resolve(e.$to.end(e.depth)),e.depth)),a=!0}var l=(0,r.oM)(s,n,i,e);if(!l)return!1;t&&function(t,e,n,i,a){for(var s=o.FK.empty,u=n.length-1;u>=0;u--)s=o.FK.from(n[u].type.create(n[u].attrs,s));t.step(new r.Wg(e.start-(i?2:0),e.end,e.start,e.end,new o.Ji(s,0,0),n.length,!0));for(var c=0,l=0;l<n.length;l++)n[l].type==a&&(c=l+1);for(var f=n.length-c,d=e.start+n.length-(i?2:0),h=e.parent,p=e.startIndex,v=e.endIndex,m=!0;p<v;p++,m=!1)!m&&(0,r.zy)(t.doc,d,f)&&(t.split(d,f),d+=2*f),d+=h.child(p).nodeSize}(t,e,l,a,n);return!0}(l,c,t,e)&&(i&&i(l.scrollIntoView()),!0)}}function j(t){return function(e,n){var i=e.selection,a=i.$from,s=i.$to,u=a.blockRange(s,(function(e){return e.childCount>0&&e.firstChild.type==t}));return!!u&&(!n||(a.node(u.depth-1).type==t?function(t,e,n,i){var a=t.tr,s=i.end,u=i.$to.end(i.depth);s<u&&(a.step(new r.Wg(s-1,u,s,u,new o.Ji(o.FK.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.u$(a.doc.resolve(i.$from.pos),a.doc.resolve(u),i.depth));var c=(0,r.jP)(i);if(null==c)return!1;a.lift(i,c);var l=a.doc.resolve(a.mapping.map(s,-1)-1);(0,r.n9)(a.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&a.join(l.pos);return e(a.scrollIntoView()),!0}(e,n,t,u):function(t,e,n){for(var i=t.tr,a=n.parent,s=n.end,u=n.endIndex-1,c=n.startIndex;u>c;u--)s-=a.child(u).nodeSize,i.delete(s-1,s+1);var l=i.doc.resolve(n.start),f=l.nodeAfter;if(i.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;
21var d=0==n.startIndex,h=n.endIndex==a.childCount,p=l.node(-1),v=l.index(-1);if(!p.canReplace(v+(d?0:1),v+1,f.content.append(h?o.FK.empty:o.FK.from(a))))return!1;var m=l.pos,y=m+f.nodeSize;return i.step(new r.Wg(m-(d?1:0),y+(h?1:0),m+1,y-1,new o.Ji((d?o.FK.empty:o.FK.from(a.copy(o.FK.empty))).append(h?o.FK.empty:o.FK.from(a.copy(o.FK.empty))),d?0:1,h?0:1),d?0:1)),e(i.scrollIntoView()),!0}(e,n,u)))}}var L=n(33822),I=n(28591);function z(t,e,n){return e=_(e),function(t,e){if(e&&("object"==U(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,$()?Reflect.construct(e,n||[],_(t).constructor):e.apply(t,n))}function $(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($=function(){return!!t})()}function H(t,e,n,r){var o=V(_(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function V(){return V="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},V.apply(null,arguments)}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&W(t,e)}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},W(t,e)}function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function J(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||q(t)||X(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Y(t,e){return Q(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||X(t,e)||G()}function G(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function X(t,e){if(t){if("string"==typeof t)return Z(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(t,e):void 0}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Q(t){if(Array.isArray(t))return t}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,at(r.key),r)}}function nt(t,e,n){return e&&et(t.prototype,e),n&&et(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};
21e%2?rt(Object(n),!0).forEach((function(e){it(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function it(t,e,n){return(e=at(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function at(t){var e=function(t,e){if("object"!=U(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=U(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==U(e)?e:e+""}var st=Object.defineProperty,ut=function(t,e){for(var n in e)st(t,n,{get:e[n],enumerable:!0})};function ct(t){var e=t.state,n=t.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return ot(ot({},e),{},{apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}})}var lt=function(){return nt((function t(e){tt(this,t),this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}),[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var t=this,e=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map((function(e){var n=Y(e,2),r=n[0],s=n[1];return[r,function(){var e=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||t.hasCustomState||o.dispatch(i),e}]})))}},{key:"chain",get:function(){var t=this;return function(){return t.createChain()}}},{key:"can",get:function(){var t=this;return function(){return t.createCan()}}},{key:"createChain",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s=[],u=!!t,c=t||i.tr,l=ot(ot({},Object.fromEntries(Object.entries(r).map((function(t){var r=Y(t,2),o=r[0],i=r[1];return[o,function(){var t=e.buildProps(c,n),r=i.apply(void 0,arguments)(t);return s.push(r),l}]})))),{},{run:function(){return u||!n||c.getMeta("preventDispatch")||e.hasCustomState||a.dispatch(c),s.every((function(t){return!0===t}))}});return l}},{key:"createCan",value:function(t){var e=this,n=this.rawCommands,r=this.state,o=!1,i=t||r.tr,a=this.buildProps(i,o),s=Object.fromEntries(Object.entries(n).map((function(t){var e=Y(t,2),n=e[0],r=e[1];return[n,function(){return r.apply(void 0,arguments)(ot(ot({},a),{},{dispatch:void 0}))}]})));return ot(ot({},s),{},{chain:function(){return e.createChain(i,o)}})}},{key:"buildProps",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s={tr:t,editor:o,view:a,state:ct({state:i,transaction:t}),dispatch:n?function(){}:void 0,chain:function(){return e.createChain(t,n)},can:function(){return e.createCan(t)},get commands(){return Object.fromEntries(Object.entries(r).map((function(t){var e=Y(t,2),n=e[0],r=e[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}])}(),ft={};ut(ft,{blur:function(){return dt},clearContent:function(){return ht},clearNodes:function(){return pt},command:function(){return vt},createParagraphNear:function(){return mt},cut:function(){return yt},deleteCurrentNode:function(){return gt},deleteNode:function(){return kt},deleteRange:function(){return wt},deleteSelection:function(){return Dt},enter:function(){return Ct},exitCode:function(){return St},extendMarkRange:function(){return Nt},first:function(){return Ft},focus:function(){return It},forEach:function(){return zt},insertContent:function(){return $t},insertContentAt:function(){return Kt},joinBackward:function(){return Jt},joinDown:function(){return Ut},joinForward:function(){return qt},joinItemBackward:function(){return Yt},joinItemForward:function(){return Gt},joinTextblockBackward:function(){return Xt},joinTextblockForward:function(){return Zt},joinUp:function(){return Wt},keyboardShortcut:function(){return te},lift:function(){return ne},liftEmptyBlock:function(){return re},liftListItem:function(){return oe},newlineInCode:function(){return ie},resetAttributes:function(){return ue},scrollIntoView:function(){return ce},selectAll:function(){return le},selectNodeBackward:function(){return fe},selectNodeForward:function(){return de},selectParentNode:function(){return he},selectTextblockEnd:function(){return pe},selectTextblockStart:function(){return ve},setContent:function(){return ye},setMark:function(){return on},setMeta:function(){return an},setNode:function(){return sn},setNodeSelection:function(){return un},setTextDirection:function(){return cn},setTextSelection:function(){return ln},sinkListItem:function(){return fn},splitBlock:function(){return hn},splitListItem:function(){return pn},toggleList:function(){return yn},toggleMark:function(){return gn},toggleNode:function(){return bn},toggleWrap:function(){return kn},undoInputRule:function(){return wn},unsetAllMarks:function(){return Dn},unsetMark:function(){return Cn},unsetTextDirection:function(){return Sn},updateAttributes:function(){return An},wrapIn:function(){return En},wrapInList:function(){return xn}});var dt=function(){return function(t){var e=t.editor,n=t.view;return requestAnimationFrame((function(){var t;e.isDestroyed||(n.dom.blur(),null==(t=null==window?void 0:window.getSelection())||t.removeAllRanges())})),!0}},ht=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(e){return e.commands.setContent("",{emitUpdate:t})}},pt=function(){return function(t){var e=t.state,n=t.tr,o=t.dispatch,i=n.selection.ranges;return!o||(i.forEach((function(t){var o=t.$from,i=t.$to;e.doc.nodesBetween(o.pos,i.pos,(function(t,e){if(!t.type.isText){var o=n.doc,i=n.mapping,a=o.resolve(i.map(e)),s=o.resolve(i.map(e+t.nodeSize)),u=a.blockRange(s);if(u){var c=(0,r.jP)(u);if(t.type.isTextblock){var l=a.parent.contentMatchAt(a.index()).defaultType;n.setNodeMarkup(u.start,l)}(c||0===c)&&n.lift(u,c)}}}))})),!0)}},vt=function(t){return function(e){return t(e)}},mt=function(){return function(t){var e=t.state,n=t.dispatch;
21return k(e,n)}},yt=function(t,e){return function(n){var r=n.editor,o=n.tr,a=r.state.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);var s=o.mapping.map(e);return o.insert(s,a.content),o.setSelection(new i.U3(o.doc.resolve(Math.max(s-1,0)))),!0}},gt=function(){return function(t){var e=t.tr,n=t.dispatch,r=e.selection.$anchor.node();if(r.content.size>0)return!1;for(var o=e.selection.$anchor,i=o.depth;i>0;i-=1){if(o.node(i).type===r.type){if(n){var a=o.before(i),s=o.after(i);e.delete(a,s).scrollIntoView()}return!0}}return!1}};function bt(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error("There is no node type named '".concat(t,"'. Maybe you forgot to add the extension?"));return e.nodes[t]}return t}var kt=function(t){return function(e){for(var n=e.tr,r=e.state,o=e.dispatch,i=bt(t,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var u=a.before(s),c=a.after(s);n.delete(u,c).scrollIntoView()}return!0}}return!1}},wt=function(t){return function(e){var n=e.tr,r=e.dispatch,o=t.from,i=t.to;return r&&n.delete(o,i),!0}},Dt=function(){return function(t){var e=t.state,n=t.dispatch;return a(e,n)}},Ct=function(){return function(t){return t.commands.keyboardShortcut("Enter")}},St=function(){return function(t){var e=t.state,n=t.dispatch;return b(e,n)}};function At(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function Et(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(e);return!r.length||r.every((function(r){return n.strict?e[r]===t[r]:At(e[r])?e[r].test(t[r]):e[r]===t[r]}))}function xt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.find((function(t){return t.type===e&&Et(Object.fromEntries(Object.keys(n).map((function(e){return[e,t.attrs[e]]}))),n)}))}function Mt(t,e){return!!xt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function Ot(t,e,n){var r;if(t&&e){var o=t.parent.childAfter(t.parentOffset);if(o.node&&o.node.marks.some((function(t){return t.type===e}))||(o=t.parent.childBefore(t.parentOffset)),o.node&&o.node.marks.some((function(t){return t.type===e})))if(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),xt(J(o.node.marks),e,n)){for(var i=o.index,a=t.start()+o.offset,s=i+1,u=a+o.node.nodeSize;i>0&&Mt(J(t.parent.child(i-1).marks),e,n);)i-=1,a-=t.parent.child(i).nodeSize;for(;s<t.parent.childCount&&Mt(J(t.parent.child(s).marks),e,n);)u+=t.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}function Tt(t,e){if("string"==typeof t){if(!e.marks[t])throw Error("There is no mark type named '".concat(t,"'. Maybe you forgot to add the extension?"));return e.marks[t]}return t}var Nt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,a=n.dispatch,s=Tt(t,o.schema),u=r.doc,c=r.selection,l=c.$from,f=c.from,d=c.to;if(a){var h=Ot(l,s,e);if(h&&h.from<=f&&h.to>=d){var p=i.U3.create(u,h.from,h.to);r.setSelection(p)}}return!0}},Ft=function(t){return function(e){for(var n="function"==typeof t?t(e):t,r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1}};function Rt(t){return t instanceof i.U3}function Pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(t,e),n)}function Bt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return null;var n=i.LN.atStart(t),r=i.LN.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;var o=n.from,a=r.to;return"all"===e?i.U3.create(t,Pt(0,o,a),Pt(t.content.size,o,a)):i.U3.create(t,Pt(e,o,a),Pt(e,o,a))}function jt(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Lt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var It=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,i=n.tr,a=n.dispatch;e=ot({scrollIntoView:!0},e);var s=function(){(Lt()||jt())&&o.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&r.commands.scrollIntoView())}))};if(o.hasFocus()&&null===t||!1===t)return!0;
21if(a&&null===t&&!Rt(r.state.selection))return s(),!0;var u=Bt(i.doc,t)||r.state.selection,c=r.state.selection.eq(u);return a&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0}},zt=function(t,e){return function(n){return t.every((function(t,r){return e(t,ot(ot({},n),{},{index:r}))}))}},$t=function(t,e){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},t,e)}},Ht=function(t){for(var e=t.childNodes,n=e.length-1;n>=0;n-=1){var r=e[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):1===r.nodeType&&Ht(r)}return t};function Vt(t){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");var e="<body>".concat(t,"</body>"),n=(new window.DOMParser).parseFromString(e,"text/html").body;return Ht(n)}function _t(t,e,n){if(t instanceof o.bP||t instanceof o.FK)return t;n=ot({slice:!0,parseOptions:{}},n);var r="string"==typeof t;if("object"===U(t)&&null!==t)try{if(Array.isArray(t)&&t.length>0)return o.FK.fromArray(t.map((function(t){return e.nodeFromJSON(t)})));var i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),_t("",e,n)}if(r){if(n.errorOnInvalidContent){var a=!1,s="",u=new o.Sj({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:function(t){return a=!0,s="string"==typeof t?t:t.outerHTML,null}}]}})});if(n.slice?o.S4.fromSchema(u).parseSlice(Vt(t),n.parseOptions):o.S4.fromSchema(u).parse(Vt(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error("Invalid element found: ".concat(s))})}var c=o.S4.fromSchema(e);return n.slice?c.parseSlice(Vt(t),n.parseOptions).content:c.parse(Vt(t),n.parseOptions)}return _t("",e,n)}var Kt=function(t,e,n){return function(a){var s,u=a.tr,c=a.dispatch,l=a.editor;if(c){var f;n=ot({parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1},n);var d=function(t){l.emit("contentError",{editor:l,error:t,disableCollaboration:function(){"collaboration"in l.storage&&"object"===U(l.storage.collaboration)&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},h=ot({preserveWhitespace:"full"},n.parseOptions);if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{_t(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(t){d(t)}try{f=_t(e,l.schema,{parseOptions:h,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:l.options.enableContentCheck})}catch(t){return d(t),!1}var p,v="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},m=v.from,y=v.to,g=!0,b=!0;if(("type"in f?[f]:f).forEach((function(t){t.check(),g=!!g&&(t.isText&&0===t.marks.length),b=!!b&&t.isBlock})),m===y&&b){var k=u.doc.resolve(m).parent;k.isTextblock&&!k.type.spec.code&&!k.childCount&&(m-=1,y+=1)}if(g){if(Array.isArray(e))p=e.map((function(t){return t.text||""})).join("");else if(e instanceof o.FK){var w="";e.forEach((function(t){t.text&&(w+=t.text)})),p=w}else p="object"===U(e)&&e&&e.text?e.text:e;u.insertText(p,m,y)}else{p=f;var D=u.doc.resolve(m),C=D.node(),S=0===D.parentOffset,A=C.isText||C.isTextblock,E=C.content.size>0;S&&A&&E&&(m=Math.max(0,m-1)),u.replaceWith(m,y,p)}n.updateSelection&&function(t,e,n){var o=t.steps.length-1;if(!(o<e)){var a=t.steps[o];if(a instanceof r.Ln||a instanceof r.Wg){var s=t.mapping.maps[o],u=0;s.forEach((function(t,e,n,r){0===u&&(u=r)})),t.setSelection(i.LN.near(t.doc.resolve(u),n))}}}(u,u.steps.length-1,-1),n.applyInputRules&&u.setMeta("applyInputRules",{from:m,text:p}),n.applyPasteRules&&u.setMeta("applyPasteRules",{from:m,text:p})}return!0}},Wt=function(){return function(t){return function(t,e){var n,o=t.selection,a=o instanceof i.nh;if(a){if(o.node.isTextblock||!(0,r.n9)(t.doc,o.from))return!1;n=o.from}else if(null==(n=(0,r.N0)(t.doc,o.from,-1)))return!1;if(e){var s=t.tr.join(n);a&&s.setSelection(i.nh.create(s.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0}(t.state,t.dispatch)}},Ut=function(){return function(t){return function(t,e){var n,o=t.selection;if(o instanceof i.nh){if(o.node.isTextblock||!(0,r.n9)(t.doc,o.to))return!1;n=o.to}else if(null==(n=(0,r.N0)(t.doc,o.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}(t.state,t.dispatch)}},Jt=function(){return function(t){var e=t.state,n=t.dispatch;return u(e,n)}},qt=function(){return function(t){var e=t.state,n=t.dispatch;return p(e,n)}},Yt=function(){return function(t){var e=t.state,n=t.dispatch,o=t.tr;try{var i=(0,r.N0)(e.doc,e.selection.$from.pos,-1);return null!=i&&(o.join(i,2),n&&n(o),!0)}catch(t){return!1}}},Gt=function(){return function(t){var e=t.state,n=t.dispatch,o=t.tr;try{var i=(0,r.N0)(e.doc,e.selection.$from.pos,1);return null!=i&&(o.join(i,2),n&&n(o),!0)}catch(t){return!1}}},Xt=function(){return function(t){return function(t,e,n){var r=s(t,n);if(!r)return!1;var o=d(r);return!!o&&c(t,o,e)}(t.state,t.dispatch)}},Zt=function(){return function(t){return function(t,e,n){var r=h(t,n);if(!r)return!1;var o=m(r);return!!o&&c(t,o,e)}(t.state,t.dispatch)}};function Qt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var te=function(t){return function(e){var n=e.editor,r=e.view,o=e.tr,i=e.dispatch,a=function(t){var e,n,r,o,i=t.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(var s=0;s<i.length-1;s+=1){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))e=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: ".concat(u));Lt()||Qt()?o=!0:n=!0}}return e&&(a="Alt-".concat(a)),n&&(a="Ctrl-".concat(a)),o&&(a="Meta-".concat(a)),r&&(a="Shift-".concat(a)),a}(t).split(/-(?!$)/),s=a.find((function(t){return!["Alt","Ctrl","Meta","Shift"].includes(t)}
21)),u=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction((function(){r.someProp("handleKeyDown",(function(t){return t(r,u)}))}));return null==c||c.steps.forEach((function(t){var e=t.map(o.mapping);e&&i&&o.maybeStep(e)})),!0}};function ee(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection,o=r.from,i=r.to,a=r.empty,s=e?bt(e,t.schema):null,u=[];t.doc.nodesBetween(o,i,(function(t,e){if(!t.isText){var n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);u.push({node:t,from:n,to:r})}}));var c=i-o,l=u.filter((function(t){return!s||s.name===t.node.type.name})).filter((function(t){return Et(t.node.attrs,n,{strict:!1})}));return a?!!l.length:l.reduce((function(t,e){return t+e.to-e.from}),0)>=c}var ne=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=n.state,i=n.dispatch;return!!ee(o,bt(t,o.schema),e)&&function(t,e){var n=t.selection,o=n.$from,i=n.$to,a=o.blockRange(i),s=a&&(0,r.jP)(a);return null!=s&&(e&&e(t.tr.lift(a,s).scrollIntoView()),!0)}(o,i)}},re=function(){return function(t){var e=t.state,n=t.dispatch;return w(e,n)}},oe=function(t){return function(e){var n=e.state,r=e.dispatch;return j(bt(t,n.schema))(n,r)}},ie=function(){return function(t){var e=t.state,n=t.dispatch;return y(e,n)}};function ae(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function se(t,e){var n="string"==typeof e?[e]:e;return Object.keys(t).reduce((function(e,r){return n.includes(r)||(e[r]=t[r]),e}),{})}var ue=function(t,e){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=ae("string"==typeof t?t:t.name,o.schema);if(!u)return!1;"node"===u&&(a=bt(t,o.schema)),"mark"===u&&(s=Tt(t,o.schema));var c=!1;return r.selection.ranges.forEach((function(t){o.doc.nodesBetween(t.$from.pos,t.$to.pos,(function(t,n){a&&a===t.type&&(c=!0,i&&r.setNodeMarkup(n,void 0,se(t.attrs,e))),s&&t.marks.length&&t.marks.forEach((function(o){s===o.type&&(c=!0,i&&r.addMark(n,n+t.nodeSize,s.create(se(o.attrs,e))))}))}))})),c}},ce=function(){return function(t){var e=t.tr;return t.dispatch&&e.scrollIntoView(),!0}},le=function(){return function(t){var e=t.tr;if(t.dispatch){var n=new i.i5(e.doc);e.setSelection(n)}return!0}},fe=function(){return function(t){var e=t.state,n=t.dispatch;return f(e,n)}},de=function(){return function(t){var e=t.state,n=t.dispatch;return v(e,n)}},he=function(){return function(t){return function(t,e){var n,r=t.selection,o=r.$from,a=r.to,s=o.sharedDepth(a);return 0!=s&&(n=o.before(s),e&&e(t.tr.setSelection(i.nh.create(t.doc,n))),!0)}(t.state,t.dispatch)}},pe=function(){return function(t){var e=t.state,n=t.dispatch;return x(e,n)}},ve=function(){return function(t){var e=t.state,n=t.dispatch;return E(e,n)}};function me(t,e){return _t(t,e,{slice:!1,parseOptions:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},errorOnInvalidContent:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).errorOnInvalidContent})}var ye=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.errorOnInvalidContent,r=e.emitUpdate,o=void 0===r||r,i=e.parseOptions,a=void 0===i?{}:i;return function(e){var r=e.editor,i=e.tr,s=e.dispatch,u=e.commands,c=i.doc;if("full"!==a.preserveWhitespace){var l=me(t,r.schema,a,{errorOnInvalidContent:null!=n?n:r.options.enableContentCheck});return s&&i.replaceWith(0,c.content.size,l).setMeta("preventUpdate",!o),!0}return s&&i.setMeta("preventUpdate",!o),u.insertContentAt({from:0,to:c.content.size},t,{parseOptions:a,errorOnInvalidContent:null!=n?n:r.options.enableContentCheck})}};function ge(t,e){var n=Tt(e,t.schema),r=t.selection,o=r.from,i=r.to,a=r.empty,s=[];a?(t.storedMarks&&s.push.apply(s,J(t.storedMarks)),s.push.apply(s,J(t.selection.$head.marks()))):t.doc.nodesBetween(o,i,(function(t){s.push.apply(s,J(t.marks))}));var u=s.find((function(t){return t.type.name===n.name}));return u?ot({},u.attrs):{}}function be(t,e){var n=new r.dL(t);return e.forEach((function(t){t.steps.forEach((function(t){n.step(t)}))})),n}function ke(t,e,n){var r=[];return t.nodesBetween(e.from,e.to,(function(t,e){n(t)&&r.push({node:t,pos:e})})),r}function we(t,e){for(var n=t.depth;
21n>0;n-=1){var r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function De(t){return function(e){return we(e.$from,t)}}function Ce(t,e,n){return void 0===t.config[e]&&t.parent?Ce(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind(ot(ot({},n),{},{parent:t.parent?Ce(t.parent,e,n):null})):t.config[e]}function Se(t){return t.map((function(t){var e=Ce(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t].concat(J(Se(e()))):t})).flat(10)}function Ae(t,e){var n=o.ZF.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Ee(t){return"function"==typeof t}function xe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Ee(t)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return e?t.bind(e).apply(void 0,r):t.apply(void 0,r)}return t}function Me(t){return{baseExtensions:t.filter((function(t){return"extension"===t.type})),nodeExtensions:t.filter((function(t){return"node"===t.type})),markExtensions:t.filter((function(t){return"mark"===t.type}))}}function Oe(t){var e=[],n=Me(t),r=n.nodeExtensions,o=n.markExtensions,i=[].concat(J(r),J(o)),a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach((function(t){var n=Ce(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:i});n&&n().forEach((function(t){t.types.forEach((function(n){Object.entries(t.attributes).forEach((function(t){var r=Y(t,2),o=r[0],i=r[1];e.push({type:n,name:o,attribute:ot(ot({},a),i)})}))}))}))})),i.forEach((function(t){var n={name:t.name,options:t.options,storage:t.storage},r=Ce(t,"addAttributes",n);if(r){var o=r();Object.entries(o).forEach((function(n){var r=Y(n,2),o=r[0],i=r[1],s=ot(ot({},a),i);"function"==typeof(null==s?void 0:s.default)&&(s.default=s.default()),(null==s?void 0:s.isRequired)&&void 0===(null==s?void 0:s.default)&&delete s.default,e.push({type:t.name,name:o,attribute:s})}))}})),e}function Te(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.filter((function(t){return!!t})).reduce((function(t,e){var n=ot({},t);return Object.entries(e).forEach((function(t){var e=Y(t,2),r=e[0],o=e[1];if(n[r])if("class"===r){var i=o?String(o).split(" "):[],a=n[r]?n[r].split(" "):[],s=i.filter((function(t){return!a.includes(t)}));n[r]=[].concat(J(a),J(s)).join(" ")}else if("style"===r){var u=o?o.split(";").map((function(t){return t.trim()})).filter(Boolean):[],c=n[r]?n[r].split(";").map((function(t){return t.trim()})).filter(Boolean):[],l=new Map;c.forEach((function(t){var e=Y(t.split(":").map((function(t){return t.trim()})),2),n=e[0],r=e[1];l.set(n,r)})),u.forEach((function(t){var e=Y(t.split(":").map((function(t){return t.trim()})),2),n=e[0],r=e[1];l.set(n,r)})),n[r]=Array.from(l.entries()).map((function(t){var e=Y(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(r)})).join("; ")}else n[r]=o;else n[r]=o})),n}),{})}function Ne(t,e){return e.filter((function(e){return e.type===t.type.name})).filter((function(t){return t.attribute.rendered})).map((function(e){return e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:it({},e.name,t.attrs[e.name])})).reduce((function(t,e){return Te(t,e)}),{})}function Fe(t,e){return"style"in t?t:ot(ot({},t),{},{getAttrs:function(n){var r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;var o=e.reduce((function(t,e){var r=e.attribute.parseHTML?e.attribute.parseHTML(n):function(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}(n.getAttribute(e.name));return null==r?t:ot(ot({},t),{},it({},e.name,r))}),{});return ot(ot({},r),o)}})}function Re(t){return Object.fromEntries(Object.entries(t).filter((function(t){var e=Y(t,2),n=e[0],r=e[1];return("attrs"!==n||!function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(t).length&&t.constructor===Object}(r))&&null!=r})))}function Pe(t){var e,n,r={};return!(null==(e=null==t?void 0:t.attribute)?void 0:e.isRequired)&&"default"in((null==t?void 0:t.attribute)||{})&&(r.default=t.attribute.default),void 0!==(null==(n=null==t?void 0:t.attribute)?void 0:n.validate)&&(r.validate=t.attribute.validate),[t.name,r]}function Be(t,e){var n,r=Oe(t),i=Me(t),a=i.nodeExtensions,s=i.markExtensions,u=null==(n=a.find((function(t){return Ce(t,"topNode")})))?void 0:n.name,c=Object.fromEntries(a.map((function(n){var o=r.filter((function(t){return t.type===n.name})),i={name:n.name,options:n.options,storage:n.storage,editor:e},a=t.reduce((function(t,e){var r=Ce(e,"extendNodeSchema",i);return ot(ot({},t),r?r(n):{})}),{}),s=Re(ot(ot({},a),{},{content:xe(Ce(n,"content",i)),marks:xe(Ce(n,"marks",i)),group:xe(Ce(n,"group",i)),inline:xe(Ce(n,"inline",i)),atom:xe(Ce(n,"atom",i)),selectable:xe(Ce(n,"selectable",i)),draggable:xe(Ce(n,"draggable",i)),code:xe(Ce(n,"code",i)),whitespace:xe(Ce(n,"whitespace",i)),linebreakReplacement:xe(Ce(n,"linebreakReplacement",i)),defining:xe(Ce(n,"defining",i)),isolating:xe(Ce(n,"isolating",i)),attrs:Object.fromEntries(o.map(Pe))})),u=xe(Ce(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(t){return Fe(t,o)})));var c=Ce(n,"renderHTML",i);c&&(s.toDOM=function(t){return c({node:t,HTMLAttributes:Ne(t,o)})});var l=Ce(n,"renderText",i);return l&&(s.toText=l),[n.name,s]}))),l=Object.fromEntries(s.map((function(n){var o=r.filter((function(t){return t.type===n.name})),i={name:n.name,options:n.options,storage:n.storage,editor:e},a=t.reduce((function(t,e){var r=Ce(e,"extendMarkSchema",i);return ot(ot({},t),r?r(n):{})}),{}),s=Re(ot(ot({},a),{},{inclusive:xe(Ce(n,"inclusive",i)),excludes:xe(Ce(n,"excludes",i)),group:xe(Ce(n,"group",i)),spanning:xe(Ce(n,"spanning",i)),code:xe(Ce(n,"code",i)),attrs:Object.fromEntries(o.map(Pe))})),u=xe(Ce(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(t){return Fe(t,o)})));var c=Ce(n,"renderHTML",i);return c&&(s.toDOM=function(t){return c({mark:t,HTMLAttributes:Ne(t,o)})}),[n.name,s]})));return new o.Sj({topNode:u,nodes:c,marks:l})}function je(t){return t.sort((function(t,e){var n=Ce(t,"priority")||100,r=Ce(e,"priority")||100;return n>r?-1:n<r?1:0}))}function Le(t){var e,n,r=je(Se(t)),o=(e=r.map((function(t){return t.name})),n=e.filter((function(t,n){return e.indexOf(t)!==n})),Array.from(new Set(n)));return o.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(o.map((function(t){return"'".concat(t,"'")})).join(", "),"]. This can lead to issues.")),r}function Ie(t,e,n){var r=e.from,o=e.to,i=n||{}
21,a=i.blockSeparator,s=void 0===a?"\n\n":a,u=i.textSerializers,c=void 0===u?{}:u,l="";return t.nodesBetween(r,o,(function(t,n,i,a){var u;t.isBlock&&n>r&&(l+=s);var f=null==c?void 0:c[t.type.name];if(f)return i&&(l+=f({node:t,pos:n,parent:i,index:a,range:e})),!1;t.isText&&(l+=null==(u=null==t?void 0:t.text)?void 0:u.slice(Math.max(r,n)-n,o-n))})),l}function ze(t,e){return Ie(t,{from:0,to:t.content.size},e)}function $e(t){return Object.fromEntries(Object.entries(t.nodes).filter((function(t){return Y(t,2)[1].spec.toText})).map((function(t){var e=Y(t,2);return[e[0],e[1].spec.toText]})))}function He(t,e){var n=ae("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){var n=bt(e,t.schema),r=t.selection,o=r.from,i=r.to,a=[];t.doc.nodesBetween(o,i,(function(t){a.push(t)}));var s=a.reverse().find((function(t){return t.type.name===n.name}));return s?ot({},s.attrs):{}}(t,e):"mark"===n?ge(t,e):{}}function Ve(t){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return t.filter((function(t){var r=e(t);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(t);return 1===e.length?e:e.filter((function(t,n){return!e.filter((function(t,e){return e!==n})).some((function(e){return t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to}))}))}function _e(t){var e=t.mapping,n=t.steps,r=[];return e.maps.forEach((function(t,o){var i=[];if(t.ranges.length)t.forEach((function(t,e){i.push({from:t,to:e})}));else{var a=n[o],s=a.from,u=a.to;if(void 0===s||void 0===u)return;i.push({from:s,to:u})}i.forEach((function(t){var n=t.from,i=t.to,a=e.slice(o).map(n,-1),s=e.slice(o).map(i),u=e.invert().map(a,-1),c=e.invert().map(s);r.push({oldRange:{from:u,to:c},newRange:{from:a,to:s}})}))})),Ve(r)}function Ke(t,e,n){var r=[];return t===e?n.resolve(t).marks().forEach((function(e){var o=Ot(n.resolve(t),e.type);o&&r.push(ot({mark:e},o))})):n.nodesBetween(t,e,(function(t,e){t&&void 0!==(null==t?void 0:t.nodeSize)&&r.push.apply(r,J(t.marks.map((function(n){return{from:e,to:e+t.nodeSize,mark:n}}))))})),r}var We=function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,o=t.doc.resolve(n),i=r,a=null;i>0&&null===a;){var s=o.node(i);(null==s?void 0:s.type.name)===e?a=s:i-=1}return[a,i]};function Ue(t,e){return e.nodes[t]||e.marks[t]||null}function Je(t,e,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=Y(n,1)[0],o=t.find((function(t){return t.type===e&&t.name===r}));return!!o&&o.attribute.keepOnSplit})))}function qe(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection,o=r.empty,i=r.ranges,a=e?Tt(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter((function(t){return!a||a.name===t.type.name})).find((function(t){return Et(t.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(e){var n=e.$from,r=e.$to,o=n.pos,i=r.pos;t.doc.nodesBetween(o,i,(function(t,e){if(t.isText||t.marks.length){var n=Math.max(o,e),r=Math.min(i,e+t.nodeSize);s+=r-n,u.push.apply(u,J(t.marks.map((function(t){return{mark:t,from:n,to:r}}))))}}))})),0===s)return!1;var c=u.filter((function(t){return!a||a.name===t.mark.type.name})).filter((function(t){return Et(t.mark.attrs,n,{strict:!1})})).reduce((function(t,e){return t+e.to-e.from}),0),l=u.filter((function(t){return!a||t.mark.type!==a&&t.mark.type.excludes(a)})).reduce((function(t,e){return t+e.to-e.from}),0);return(c>0?c+l:c)>=s}var Ye=function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.$anchor;if(e){var a=De((function(t){return t.type.name===e}))(t.selection);if(!a)return!1;var s=t.doc.resolve(a.pos+1);return i.pos+1===s.end()}return!(o.parentOffset<o.parent.nodeSize-2||r.pos!==o.pos)},Ge=function(t){var e=t.selection,n=e.$from,r=e.$to;return!(n.parentOffset>0||n.pos!==r.pos)};function Xe(t,e){return Array.isArray(e)?e.some((function(e){return("string"==typeof e?e:e.name)===t.name})):e}function Ze(t,e){var n=Me(e).nodeExtensions.find((function(e){return e.name===t}));if(!n)return!1;var r=xe(Ce(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function Qe(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.checkChildren,o=void 0===r||r,i=n.ignoreWhitespace,a=void 0!==i&&i;if(a){if("hardBreak"===t.type.name)return!0;
21if(t.isText)return/^\s*$/m.test(null!=(e=t.text)?e:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(o){var s=!0;return t.content.forEach((function(t){!1!==s&&(Qe(t,{ignoreWhitespace:a,checkChildren:o})||(s=!1))})),s}return!1}function tn(t){return t instanceof i.nh}var en=function(){function t(e){tt(this,t),this.position=e}return nt(t,[{key:"toJSON",value:function(){return{position:this.position}}}],[{key:"fromJSON",value:function(e){return new t(e.position)}}])}();function nn(t,e){var n=e.mapping.mapResult(t.position);return{position:new en(n.pos),mapResult:n}}function rn(t){return new en(t)}var on=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=r.selection,s=a.empty,u=a.ranges,c=Tt(t,o.schema);if(i)if(s){var l=ge(o,c);r.addStoredMark(c.create(ot(ot({},l),e)))}else u.forEach((function(t){var n=t.$from.pos,i=t.$to.pos;o.doc.nodesBetween(n,i,(function(t,o){var a=Math.max(o,n),s=Math.min(o+t.nodeSize,i);t.marks.find((function(t){return t.type===c}))?t.marks.forEach((function(t){c===t.type&&r.addMark(a,s,c.create(ot(ot({},t.attrs),e)))})):r.addMark(a,s,c.create(e))}))}));return function(t,e,n){var r,o=e.selection,i=null;if(Rt(o)&&(i=o.$cursor),i){var a=null!=(r=t.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some((function(t){return t.type.excludes(n)})))}return o.ranges.some((function(e){var r=e.$from,o=e.$to,i=0===r.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(r.pos,o.pos,(function(t,e,r){if(i)return!1;if(t.isInline){var o=!r||r.type.allowsMarkType(n),a=!!n.isInSet(t.marks)||!t.marks.some((function(t){return t.type.excludes(n)}));i=o&&a}return!i})),i}))}(o,r,c)}},an=function(t,e){return function(n){return n.tr.setMeta(t,e),!0}},sn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.state,i=n.dispatch,a=n.chain,s=bt(t,o.schema);return o.selection.$anchor.sameParent(o.selection.$head)&&(r=o.selection.$anchor.parent.attrs),s.isTextblock?a().command((function(t){var n=t.commands;return!!M(s,ot(ot({},r),e))(o)||n.clearNodes()})).command((function(t){var n=t.state;return M(s,ot(ot({},r),e))(n,i)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},un=function(t){return function(e){var n=e.tr;if(e.dispatch){var r=n.doc,o=Pt(t,0,r.content.size),a=i.nh.create(r,o);n.setSelection(a)}return!0}},cn=function(t,e){return function(n){var r,o,i=n.tr,a=n.state,s=n.dispatch,u=a.selection;return"number"==typeof e?(r=e,o=e):e&&"from"in e&&"to"in e?(r=e.from,o=e.to):(r=u.from,o=u.to),s&&i.doc.nodesBetween(r,o,(function(e,n){e.isText||i.setNodeMarkup(n,void 0,ot(ot({},e.attrs),{},{dir:t}))})),!0}},ln=function(t){return function(e){var n=e.tr;if(e.dispatch){var r=n.doc,o="number"==typeof t?{from:t,to:t}:t,a=o.from,s=o.to,u=i.U3.atStart(r).from,c=i.U3.atEnd(r).to,l=Pt(a,u,c),f=Pt(s,u,c),d=i.U3.create(r,l,f);n.setSelection(d)}return!0}},fn=function(t){return function(e){var n,i=e.state,a=e.dispatch,s=bt(t,i.schema);return(n=s,function(t,e){var i=t.selection,a=i.$from,s=i.$to,u=a.blockRange(s,(function(t){return t.childCount>0&&t.firstChild.type==n}));if(!u)return!1;var c=u.startIndex;if(0==c)return!1;var l=u.parent,f=l.child(c-1);if(f.type!=n)return!1;if(e){var d=f.lastChild&&f.lastChild.type==l.type,h=o.FK.from(d?n.create():null),p=new o.Ji(o.FK.from(n.create(null,o.FK.from(l.type.create(null,h)))),d?3:1,0),v=u.start,m=u.end;e(t.tr.step(new r.Wg(v-(d?3:1),m,v,m,p,1,!0)).scrollIntoView())}return!0})(i,a)}};function dn(t,e){var n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){var r=n.filter((function(t){return null==e?void 0:e.includes(t.type.name)}));t.tr.ensureMarks(r)}}var hn=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).keepMarks,e=void 0===t||t;return function(t){var n=t.tr,o=t.state,a=t.dispatch,s=t.editor,u=n.selection,c=n.doc,l=u.$from,f=u.$to,d=Je(s.extensionManager.attributes,l.node().type.name,l.node().attrs);if(u instanceof i.nh&&u.node.isBlock)return!(!l.parentOffset||!(0,r.zy)(c,l.pos))&&(a&&
21(e&&dn(o,s.extensionManager.splittableMarks),n.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;var h=f.parentOffset===f.parent.content.size,p=0===l.depth?void 0:function(t){for(var e=0;e<t.edgeCount;e+=1){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1))),v=h&&p?[{type:p,attrs:d}]:void 0,m=(0,r.zy)(n.doc,n.mapping.map(l.pos),1,v);if(v||m||!(0,r.zy)(n.doc,n.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(m=!0,v=p?[{type:p,attrs:d}]:void 0),a){if(m&&(u instanceof i.U3&&n.deleteSelection(),n.split(n.mapping.map(l.pos),1,v),p&&!h&&!l.parentOffset&&l.parent.type!==p)){var y=n.mapping.map(l.before()),g=n.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&n.setNodeMarkup(n.mapping.map(l.before()),p)}e&&dn(o,s.extensionManager.splittableMarks),n.scrollIntoView()}return m}},pn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a,s=n.tr,u=n.state,c=n.dispatch,l=n.editor,f=bt(t,u.schema),d=u.selection,h=d.$from,p=d.$to,v=u.selection.node;if(v&&v.isBlock||h.depth<2||!h.sameParent(p))return!1;var m=h.node(-1);if(m.type!==f)return!1;var y=l.extensionManager.attributes;if(0===h.parent.content.size&&h.node(-1).childCount===h.indexAfter(-1)){if(2===h.depth||h.node(-3).type!==f||h.index(-2)!==h.node(-2).childCount-1)return!1;if(c){for(var g=o.FK.empty,b=h.index(-1)?1:h.index(-2)?2:3,k=h.depth-b;k>=h.depth-3;k-=1)g=o.FK.from(h.node(k).copy(g));var w=h.indexAfter(-1)<h.node(-2).childCount?1:h.indexAfter(-2)<h.node(-3).childCount?2:3,D=ot(ot({},Je(y,h.node().type.name,h.node().attrs)),e),C=(null==(a=f.contentMatch.defaultType)?void 0:a.createAndFill(D))||void 0;g=g.append(o.FK.from(f.createAndFill(null,C)||void 0));var S=h.before(h.depth-(b-1));s.replace(S,h.after(-w),new o.Ji(g,4-b,0));var A=-1;s.doc.nodesBetween(S,s.doc.content.size,(function(t,e){if(A>-1)return!1;t.isTextblock&&0===t.content.size&&(A=e+1)})),A>-1&&s.setSelection(i.U3.near(s.doc.resolve(A))),s.scrollIntoView()}return!0}var E=p.pos===h.end()?m.contentMatchAt(0).defaultType:null,x=ot(ot({},Je(y,m.type.name,m.attrs)),e),M=ot(ot({},Je(y,h.node().type.name,h.node().attrs)),e);s.delete(h.pos,p.pos);var O=E?[{type:f,attrs:x},{type:E,attrs:M}]:[{type:f,attrs:x}];if(!(0,r.zy)(s.doc,h.pos,2))return!1;if(c){var T=u.selection,N=u.storedMarks,F=l.extensionManager.splittableMarks,R=N||T.$to.parentOffset&&T.$from.marks();if(s.split(h.pos,2,O).scrollIntoView(),!R||!c)return!0;var P=R.filter((function(t){return F.includes(t.type.name)}));s.ensureMarks(P)}return!0}},vn=function(t,e){var n=De((function(t){return t.type===e}))(t.selection);if(!n)return!0;var o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;var i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,r.n9)(t.doc,n.pos)||(t.join(n.pos),!0)},mn=function(t,e){var n=De((function(t){return t.type===e}))(t.selection);if(!n)return!0;var o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;var i=t.doc.nodeAt(o);return n.node.type!==(null==i?void 0:i.type)||!(0,r.n9)(t.doc,o)||(t.join(o),!0)},yn=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(o){var i=o.editor,a=o.tr,s=o.state,u=o.dispatch,c=o.chain,l=o.commands,f=o.can,d=i.extensionManager,h=d.extensions,p=d.splittableMarks,v=bt(t,s.schema),m=bt(e,s.schema),y=s.selection,g=s.storedMarks,b=y.$from,k=y.$to,w=b.blockRange(k),D=g||y.$to.parentOffset&&y.$from.marks();if(!w)return!1;var C=De((function(t){return Ze(t.type.name,h)}))(y);if(w.depth>=1&&C&&w.depth-C.depth<=1){if(C.node.type===v)return l.liftListItem(m);if(Ze(C.node.type.name,h)&&v.validContent(C.node.content)&&u)return c().command((function(){return a.setNodeMarkup(C.pos,v),!0})).command((function(){return vn(a,v)})).command((function(){return mn(a,v)})).run()}return n&&D&&u?c().command((function(){var t=f().wrapInList(v,r),e=D.filter((function(t){return p.includes(t.type.name)}));return a.ensureMarks(e),!!t||l.clearNodes()})).wrapInList(v,r).command((function(){return vn(a,v)})).command((function(){return mn(a,v)})).run():c().command((function(){return!!f().wrapInList(v,r)||l.clearNodes()}
21)).wrapInList(v,r).command((function(){return vn(a,v)})).command((function(){return mn(a,v)})).run()}},gn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,u=Tt(t,o.schema);return qe(o,u,e)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,e)}},bn=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o,i=r.state,a=r.commands,s=bt(t,i.schema),u=bt(e,i.schema),c=ee(i,s,n);return i.selection.$anchor.sameParent(i.selection.$head)&&(o=i.selection.$anchor.parent.attrs),c?a.setNode(u,o):a.setNode(s,ot(ot({},o),n))}},kn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=bt(t,r.schema);return ee(r,i,e)?o.lift(i):o.wrapIn(i,e)}},wn=function(){return function(t){for(var e=t.state,n=t.dispatch,r=e.plugins,o=0;o<r.length;o+=1){var i=r[o],a=void 0;if(i.spec.isInputRules&&(a=i.getState(e))){if(n){for(var s=e.tr,u=a.transform,c=u.steps.length-1;c>=0;c-=1)s.step(u.steps[c].invert(u.docs[c]));if(a.text){var l=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,e.schema.text(a.text,l))}else s.delete(a.from,a.to)}return!0}}return!1}},Dn=function(){return function(t){var e=t.tr,n=t.dispatch,r=e.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(t){e.removeMark(t.$from.pos,t.$to.pos)})),!0}},Cn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=e.extendEmptyMarkRange,u=void 0!==s&&s,c=o.selection,l=Tt(t,i.schema),f=c.$from,d=c.empty,h=c.ranges;if(!a)return!0;if(d&&u){var p=c.from,v=c.to,m=null==(r=f.marks().find((function(t){return t.type===l})))?void 0:r.attrs,y=Ot(f,l,m);y&&(p=y.from,v=y.to),o.removeMark(p,v,l)}else h.forEach((function(t){o.removeMark(t.$from.pos,t.$to.pos,l)}));return o.removeStoredMark(l),!0}},Sn=function(t){return function(e){var n,r,o=e.tr,i=e.state,a=e.dispatch,s=i.selection;return"number"==typeof t?(n=t,r=t):t&&"from"in t&&"to"in t?(n=t.from,r=t.to):(n=s.from,r=s.to),a&&o.doc.nodesBetween(n,r,(function(t,e){if(!t.isText){var n=ot({},t.attrs);delete n.dir,o.setNodeMarkup(e,void 0,n)}})),!0}},An=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=ae("string"==typeof t?t:t.name,o.schema);if(!u)return!1;"node"===u&&(a=bt(t,o.schema)),"mark"===u&&(s=Tt(t,o.schema));var c=!1;return r.selection.ranges.forEach((function(t){var n,u,l,f,d=t.$from.pos,h=t.$to.pos;r.selection.empty?o.doc.nodesBetween(d,h,(function(t,e){a&&a===t.type&&(c=!0,l=Math.max(e,d),f=Math.min(e+t.nodeSize,h),n=e,u=t)})):o.doc.nodesBetween(d,h,(function(t,o){o<d&&a&&a===t.type&&(c=!0,l=Math.max(o,d),f=Math.min(o+t.nodeSize,h),n=o,u=t),o>=d&&o<=h&&(a&&a===t.type&&(c=!0,i&&r.setNodeMarkup(o,void 0,ot(ot({},t.attrs),e))),s&&t.marks.length&&t.marks.forEach((function(n){if(s===n.type&&(c=!0,i)){var a=Math.max(o,d),u=Math.min(o+t.nodeSize,h);r.addMark(a,u,s.create(ot(ot({},n.attrs),e)))}})))})),u&&(void 0!==n&&i&&r.setNodeMarkup(n,void 0,ot(ot({},u.attrs),e)),s&&u.marks.length&&u.marks.forEach((function(t){s===t.type&&i&&r.addMark(l,f,s.create(ot(ot({},t.attrs),e)))})))})),c}},En=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=n.state,i=n.dispatch;return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,o){var i=n.selection,a=i.$from,s=i.$to,u=a.blockRange(s),c=u&&(0,r.oM)(u,t,e);return!!c&&(o&&o(n.tr.wrap(u,c).scrollIntoView()),!0)}}(bt(t,o.schema),e)(o,i)}},xn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return B(bt(t,r.schema),e)(r,o)}},Mn=function(){return nt((function t(){tt(this,t),this.callbacks={}}),[{key:"on",value:function(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=this.callbacks[t];
21return i&&i.forEach((function(t){return t.apply(e,r)})),this}},{key:"off",value:function(t,e){var n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((function(t){return t!==e})):delete this.callbacks[t]),this}},{key:"once",value:function(t,e){var n=this,r=function(){n.off(t,r);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];e.apply(n,i)};return this.on(t,r)}},{key:"removeAllListeners",value:function(){this.callbacks={}}}])}(),On=nt((function t(e){var n;tt(this,t),this.find=e.find,this.handler=e.handler,this.undoable=null==(n=e.undoable)||n}));function Tn(t){var e,n=t.editor,r=t.from,o=t.to,i=t.text,a=t.rules,s=t.plugin,u=n.view;if(u.composing)return!1;var c=u.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(e=c.nodeBefore||c.nodeAfter)?void 0:e.marks.find((function(t){return t.type.spec.code}))))return!1;var l=!1,f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(function(t,e,o,i){var a,s,u=(null==(s=(a=t.type.spec).toText)?void 0:s.call(a,{node:t,pos:e,parent:o,index:i}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?u:u.slice(0,Math.max(0,r-e))})),n}(c)+i;return a.forEach((function(t){if(!l){var e=function(t,e){if(At(e))return e.exec(t);var n=e(t);if(!n)return null;var r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r}(f,t.find);if(e){var a=u.state.tr,c=ct({state:u.state,transaction:a}),d={from:r-(e[0].length-i.length),to:o},h=new lt({editor:n,state:c}),p=h.commands,v=h.chain,m=h.can;null!==t.handler({state:c,range:d,match:e,commands:p,chain:v,can:m})&&a.steps.length&&(t.undoable&&a.setMeta(s,{transform:a,from:r,to:o,text:i}),u.dispatch(a),l=!0)}}})),l}function Nn(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Fn(t,e){var n=ot({},t);return Nn(t)&&Nn(e)&&Object.keys(e).forEach((function(r){Nn(e[r])&&Nn(t[r])?n[r]=Fn(t[r],e[r]):n[r]=e[r]})),n}var Rn=function(){return nt((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tt(this,t),this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config=ot(ot({},this.config),e),this.name=this.config.name}),[{key:"options",get:function(){return ot({},xe(Ce(this,"addOptions",{name:this.name}))||{})}},{key:"storage",get:function(){return ot({},xe(Ce(this,"addStorage",{name:this.name,options:this.options}))||{})}},{key:"configure",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.extend(ot(ot({},this.config),{},{addOptions:function(){return Fn(t.options,e)}}));return n.name=this.name,n.parent=this.parent,n}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new this.constructor(ot(ot({},this.config),t));return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}}])}(),Pn=function(t){function e(){var t;return tt(this,e),(t=z(this,e,arguments)).type="mark",t}return K(e,t),nt(e,[{key:"configure",value:function(t){return H(e,"configure",this,3)([t])}},{key:"extend",value:function(t){var n="function"==typeof t?t():t;return H(e,"extend",this,3)([n])}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e("function"==typeof t?t():t)}},{key:"handleExit",value:function(t){var e=t.editor,n=t.mark,r=e.state.tr,o=e.state.selection.$from;if(o.pos===o.end()){var i=o.marks();if(!!!i.find((function(t){return(null==t?void 0:t.type.name)===n.name})))return!1;var a=i.find((function(t){return(null==t?void 0:t.type.name)===n.name}));return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}])}(Rn);var Bn=nt((function t(e){tt(this,t),this.find=e.find,this.handler=e.handler}));function jn(t){var e=t.editor,n=t.state,r=t.from,o=t.to,i=t.rule,a=t.pasteEvent,s=t.dropEvent,u=new lt({editor:e,state:n}),c=u.commands,l=u.chain,f=u.can,d=[];return n.doc.nodesBetween(r,o,(function(t,e){var u,h,p,v,m;if(!(null==(h=null==(u=t.type)?void 0:u.spec)?void 0:h.code)&&(t.isText||t.isTextblock||t.isInline)){var y=null!=(m=null!=(v=null==(p=t.content)?void 0:p.size)?v:t.nodeSize)?m:0,g=Math.max(r,e),b=Math.min(o,e+y);if(!(g>=b))(function(t,e,n){if(At(e))return J(t.matchAll(e));var r=e(t,n);return r?r.map((function(e){var n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n})):[]})(t.isText?t.text||"":t.textBetween(g-e,b-e,void 0,""),i.find,a).forEac
21h((function(t){if(void 0!==t.index){var e=g+t.index+1,r=e+t[0].length,o={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},u=i.handler({state:n,range:o,match:t,commands:c,chain:l,can:f,pasteEvent:a,dropEvent:s});d.push(u)}}))}})),d.every((function(t){return null!==t}))}var Ln=null;function In(t){var e,n=t.editor,r=t.rules,a=null,s=!1,u=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{e="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(t){e=null}var l=function(t){var r=t.state,o=t.from,i=t.to,a=t.rule,s=t.pasteEvt,u=r.tr,l=ct({state:r,transaction:u});if(jn({editor:n,state:l,from:Math.max(o-1,0),to:i.b-1,rule:a,pasteEvent:s,dropEvent:e})&&u.steps.length){try{e="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(t){e=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,u}};return r.map((function(t){return new i.k_({view:function(t){var e=function(e){var r;(a=(null==(r=t.dom.parentElement)?void 0:r.contains(e.target))?t.dom.parentElement:null)&&(Ln=n)},r=function(){Ln&&(Ln=null)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",r),{destroy:function(){window.removeEventListener("dragstart",e),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:function(t,n){if(u=a===t.dom.parentElement,e=n,!u){var r=Ln;(null==r?void 0:r.isEditable)&&setTimeout((function(){var t=r.state.selection;t&&r.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:function(t,e){var n,r=null==(n=e.clipboardData)?void 0:n.getData("text/html");return c=e,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(e,n,r){var i=e[0],a="paste"===i.getMeta("uiEvent")&&!s,f="drop"===i.getMeta("uiEvent")&&!u,d=i.getMeta("applyPasteRules"),h=!!d;if(a||f||h){if(h){var p=d.text;"string"==typeof p||(p=Ae(o.FK.from(p),r.schema));var v=d.from,m=v+p.length,y=function(t){var e,n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(e=n.clipboardData)||e.setData("text/html",t),n}(p);return l({rule:t,state:r,from:v,to:{b:m},pasteEvt:y})}var g=n.doc.content.findDiffStart(r.doc.content),b=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof g&&b&&g!==b.b)return l({rule:t,state:r,from:g,to:b,pasteEvt:c})}}})}))}var zn=function(){return nt((function t(e,n){tt(this,t),this.splittableMarks=[],this.editor=n,this.baseExtensions=e,this.extensions=Le(e),this.schema=Be(this.extensions,n),this.setupExtensions()}),[{key:"commands",get:function(){var t=this;return this.extensions.reduce((function(e,n){var r=Ce(n,"addCommands",{name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:t.editor,type:Ue(n.name,t.schema)});return r?ot(ot({},e),r()):e}),{})}},{key:"plugins",get:function(){var t=this,e=this.editor;return je(J(this.extensions).reverse()).flatMap((function(n){var r={name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:e,type:Ue(n.name,t.schema)},a=[],s=Ce(n,"addKeyboardShortcuts",r),u={};if("mark"===n.type&&Ce(n,"exitable",r)&&(u.ArrowRight=function(){return Pn.handleExit({editor:e,mark:n})}),s){var c=Object.fromEntries(Object.entries(s()).map((function(t){var n=Y(t,2),r=n[0],o=n[1];return[r,function(){return o({editor:e})}]})));u=ot(ot({},u),c)}var l=(0,I.w)(u);a.push(l);var f=Ce(n,"addInputRules",r);if(Xe(n,e.options.enableInputRules)&&f){var d=f();if(d&&d.length){var h=function(t){var e=t.editor,n=t.rules,r=new i.k_({state:{init:function(){return null},apply:function(t,i,a){var s=t.getMeta(r);if(s)return s;var u=t.getMeta("applyInputRules");return!!u&&setTimeout((function(){var t=u.text;"string"==typeof t||(t=Ae(o.FK.from(t),a.schema));var i=u.from,s=i+t.length;Tn({editor:e,from:i,to:s,text:t,rules:n,plugin:r})})),t.selectionSet||t.docChanged?null:i}},props:{handleTextInput:function(t,o,i,a){return Tn({editor:e,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(t){return setTimeout((function(){var o=t.state.selection.$cursor;o&&Tn({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(t,o){if("Enter"!==o.key)return!1;var i=t.state.selection.$cursor;return!!i&&Tn({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:d}),p=Array.isArray(h)?h:[h];a.push.apply(a,J(p))}}var v=Ce(n,"addPasteRules",r);
21if(Xe(n,e.options.enablePasteRules)&&v){var m=v();if(m&&m.length){var y=In({editor:e,rules:m});a.push.apply(a,J(y))}}var g=Ce(n,"addProseMirrorPlugins",r);if(g){var b=g();a.push.apply(a,J(b))}return a}))}},{key:"attributes",get:function(){return Oe(this.extensions)}},{key:"nodeViews",get:function(){var t=this,e=this.editor,n=Me(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(t){return!!Ce(t,"addNodeView")})).map((function(n){var r=t.attributes.filter((function(t){return t.type===n.name})),o={name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:e,type:bt(n.name,t.schema)},i=Ce(n,"addNodeView",o);if(!i)return[];var a=i();if(!a)return[];return[n.name,function(t,o,i,s,u){var c=Ne(t,r);return a({node:t,view:o,getPos:i,decorations:s,innerDecorations:u,editor:e,extension:n,HTMLAttributes:c})}]})))}},{key:"markViews",get:function(){var t=this,e=this.editor,n=Me(this.extensions).markExtensions;return Object.fromEntries(n.filter((function(t){return!!Ce(t,"addMarkView")})).map((function(n){var r=t.attributes.filter((function(t){return t.type===n.name})),o={name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:e,type:Tt(n.name,t.schema)},i=Ce(n,"addMarkView",o);if(!i)return[];return[n.name,function(t,o,a){var s=Ne(t,r);return i()({mark:t,view:o,inline:a,editor:e,extension:n,HTMLAttributes:s,updateAttributes:function(n){vr(t,e,n)}})}]})))}},{key:"setupExtensions",value:function(){var t=this,e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((function(t){return[t.name,t.storage]}))),e.forEach((function(e){var n,r={name:e.name,options:e.options,storage:t.editor.extensionStorage[e.name],editor:t.editor,type:Ue(e.name,t.schema)};"mark"===e.type&&((null==(n=xe(Ce(e,"keepOnSplit",r)))||n)&&t.splittableMarks.push(e.name));var o=Ce(e,"onBeforeCreate",r),i=Ce(e,"onCreate",r),a=Ce(e,"onUpdate",r),s=Ce(e,"onSelectionUpdate",r),u=Ce(e,"onTransaction",r),c=Ce(e,"onFocus",r),l=Ce(e,"onBlur",r),f=Ce(e,"onDestroy",r);o&&t.editor.on("beforeCreate",o),i&&t.editor.on("create",i),a&&t.editor.on("update",a),s&&t.editor.on("selectionUpdate",s),u&&t.editor.on("transaction",u),c&&t.editor.on("focus",c),l&&t.editor.on("blur",l),f&&t.editor.on("destroy",f)}))}}])}();zn.resolve=Le,zn.sort=je,zn.flatten=Se;ut({},{ClipboardTextSerializer:function(){return Hn},Commands:function(){return Vn},Delete:function(){return _n},Drop:function(){return Kn},Editable:function(){return Wn},FocusEvents:function(){return Jn},Keymap:function(){return qn},Paste:function(){return Yn},Tabindex:function(){return Gn},TextDirection:function(){return Xn},focusEventsPluginKey:function(){return Un}});var $n=function(t){function e(){var t;return tt(this,e),(t=z(this,e,arguments)).type="extension",t}return K(e,t),nt(e,[{key:"configure",value:function(t){return H(e,"configure",this,3)([t])}},{key:"extend",value:function(t){var n="function"==typeof t?t():t;return H(e,"extend",this,3)([n])}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e("function"==typeof t?t():t)}}])}(Rn),Hn=$n.create({name:"clipboardTextSerializer",addOptions:function(){return{blockSeparator:void 0}},addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var e=t.editor,n=e.state,r=e.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,J(i.map((function(t){return t.$from.pos})))),s=Math.max.apply(Math,J(i.map((function(t){return t.$to.pos})))),u=$e(r);return Ie(o,{from:a,to:s},ot(ot({},void 0!==t.options.blockSeparator?{blockSeparator:t.options.blockSeparator}:{}),{},{textSerializers:u}))}}})]}}),Vn=$n.create({name:"commands",addCommands:function(){return ot({},ft)}}),_n=$n.create({name:"delete",onUpdate:function(t){var e,n,o,i=this,a=t.transaction,s=t.appendedTransactions,u=function(){var t,e,n,o;if(!(null!=(o=null==(n=null==(e=null==(t=i.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:e.filterTransaction)?void 0:n.call(e,a))?o:a.getMeta("y-sync$"))){var u=be(a.before,[a].concat(J(s)));_e(u).forEach((function(t){u.mapping.mapResult(t.oldRange.from).deletedAfter&&u.mapping.mapResult(t.oldRange.to).deletedBefore&&u.before.nodesBetween(t.oldRange.from,t.oldRange.to,(function(e,n){var r=n+e.nodeSize-2,o=t.oldRange.from<=n&&r<=t.oldRange.to;i.editor.emit("delete",{type:"node",node:e,from:n,to:r,newFrom:u.mapping.map(n),newTo:u.mapping.map(r),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:i.editor,transaction:a,combinedTransform:u})}))}));var c=u.mapping;u.steps.forEach((function(t,e){var n,o;if(t instanceof r.Ys){var s=c.slice(e).map(t.from,-1),l=c.slice(e).map(t.to),f=c.invert().map(s,-1),d=c.invert().map(l),h=null==(n=u.doc.nodeAt(s-1))?void 0:n.marks.some((function(e){return e.eq(t.mark)})),p=null==(o=u.doc.nodeAt(l))?void 0:o.marks.some((function(e){return e.eq(t.mark)}));i.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:f,to:d},newRange:{from:s,to:l},partial:Boolean(p||h),editor:i.editor,transaction:a,combinedTransform:u})}}))}};null==(o=null==(n=null==(e=this.editor.options.coreExtensionOptions)?void 0:e.delete)?void 0:n.async)||o?setTimeout(u,0):u()}}),Kn=$n.create({name:"drop",addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("tiptapDrop"),props:{handleDrop:function(e,n,r,o){t.editor.emit("drop",{editor:t.editor,event:n,slice:r,moved:o})}}})]}}),Wn=$n.create({name:"editable",addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("editable"),props:{editable:function(){return t.editor.options.editable}}})]}}),Un=new i.hs("focusEvents"),Jn=$n.create({name:"focusEvents",addProseMirrorPlugins:function(){var t=this.editor;
21return[new i.k_({key:Un,props:{handleDOMEvents:{focus:function(e,n){t.isFocused=!0;var r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:function(e,n){t.isFocused=!1;var r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),qn=$n.create({name:"keymap",addKeyboardShortcuts:function(){var t=this,e=function(){return t.editor.commands.first((function(t){var e=t.commands;return[function(){return e.undoInputRule()},function(){return e.command((function(t){var n=t.tr,r=n.selection,o=n.doc,a=r.empty,s=r.$anchor,u=s.pos,c=s.parent,l=s.parent.isTextblock&&u>0?n.doc.resolve(u-1):s,f=l.parent.type.spec.isolating,d=s.pos-s.parentOffset,h=f&&1===l.parent.childCount?d===s.pos:i.LN.atStart(o).from===u;return!(!a||!c.type.isTextblock||c.textContent.length||!h||h&&"paragraph"===s.parent.type.name)&&e.clearNodes()}))},function(){return e.deleteSelection()},function(){return e.joinBackward()},function(){return e.selectNodeBackward()}]}))},n=function(){return t.editor.commands.first((function(t){var e=t.commands;return[function(){return e.deleteSelection()},function(){return e.deleteCurrentNode()},function(){return e.joinForward()},function(){return e.selectNodeForward()}]}))},r={Enter:function(){return t.editor.commands.first((function(t){var e=t.commands;return[function(){return e.newlineInCode()},function(){return e.createParagraphNear()},function(){return e.liftEmptyBlock()},function(){return e.splitBlock()}]}))},"Mod-Enter":function(){return t.editor.commands.exitCode()},Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:n,"Mod-Delete":n,"Mod-a":function(){return t.editor.commands.selectAll()}},o=ot({},r),a=ot(ot({},r),{},{"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return t.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return t.editor.commands.selectTextblockEnd()}});return Lt()||Qt()?a:o},addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("clearDocument"),appendTransaction:function(e,n,r){if(!e.some((function(t){return t.getMeta("composition")}))){var o=e.some((function(t){return t.docChanged}))&&!n.doc.eq(r.doc),a=e.some((function(t){return t.getMeta("preventClearDocument")}));if(o&&!a){var s=n.selection,u=s.empty,c=s.from,l=s.to,f=i.LN.atStart(n.doc).from,d=i.LN.atEnd(n.doc).to;if(!u&&(c===f&&l===d))if(Qe(r.doc)){var h=r.tr,p=ct({state:r,transaction:h});if(new lt({editor:t.editor,state:p}).commands.clearNodes(),h.steps.length)return h}}}}})]}}),Yn=$n.create({name:"paste",addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("tiptapPaste"),props:{handlePaste:function(e,n,r){t.editor.emit("paste",{editor:t.editor,event:n,slice:r})}}})]}}),Gn=$n.create({name:"tabindex",addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("tabindex"),props:{attributes:function(){return t.editor.isEditable?{tabindex:"0"}:{}}}})]}}),Xn=$n.create({name:"textDirection",addOptions:function(){return{direction:void 0}},addGlobalAttributes:function(){var t=this;return this.options.direction?[{types:Me(this.extensions).nodeExtensions.filter((function(t){return"text"!==t.name})).map((function(t){return t.name})),attributes:{dir:{default:this.options.direction,parseHTML:function(e){var n=e.getAttribute("dir");return!n||"ltr"!==n&&"rtl"!==n&&"auto"!==n?t.options.direction:n},renderHTML:function(t){return t.dir?{dir:t.dir}:{}}}}}]:[]},addProseMirrorPlugins:function(){var t=this;return[new i.k_({key:new i.hs("textDirection"),props:{attributes:function(){var e=t.options.direction;return e?{dir:e}:{}}}})]}}),Zn=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;tt(this,t),this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}return nt(t,[{key:"name",get:function(){return this.node.type.name}},{key:"node",get:function(){return this.currentNode||this.resolvedPos.node()}},{key:"element",get:function(){return this.editor.view.domAtPos(this.pos).node}},{key:"depth",get:function(){var t;
21return null!=(t=this.actualDepth)?t:this.resolvedPos.depth}},{key:"pos",get:function(){return this.resolvedPos.pos}},{key:"content",get:function(){return this.node.content},set:function(t){var e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error("You canât set content on a block node. Tried to set content on ".concat(this.name," at ").concat(this.pos));e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}},{key:"attributes",get:function(){return this.node.attrs}},{key:"textContent",get:function(){return this.node.textContent}},{key:"size",get:function(){return this.node.nodeSize}},{key:"from",get:function(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}},{key:"range",get:function(){return{from:this.from,to:this.to}}},{key:"to",get:function(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}},{key:"parent",get:function(){if(0===this.depth)return null;var e=this.resolvedPos.start(this.resolvedPos.depth-1);return new t(this.resolvedPos.doc.resolve(e),this.editor)}},{key:"before",get:function(){var e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}},{key:"after",get:function(){var e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}},{key:"children",get:function(){var e=this,n=[];return this.node.content.forEach((function(r,o){var i=r.isBlock&&!r.isTextblock,a=r.isAtom&&!r.isText,s=e.pos+o+(a?0:1);if(!(s<0||s>e.resolvedPos.doc.nodeSize-2)){var u=e.resolvedPos.doc.resolve(s);if(i||!(u.depth<=e.depth)){var c=new t(u,e.editor,i,i?r:null);i&&(c.actualDepth=e.depth+1),n.push(new t(u,e.editor,i,i?r:null))}}})),n}},{key:"firstChild",get:function(){return this.children[0]||null}},{key:"lastChild",get:function(){var t=this.children;return t[t.length-1]||null}},{key:"closest",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=this.parent;r&&!n;){if(r.node.type.name===t)if(Object.keys(e).length>0)for(var o=r.node.attrs,i=Object.keys(e),a=0;a<i.length;a+=1){var s=i[a];if(o[s]!==e[s])break}else n=r;r=r.parent}return n}},{key:"querySelector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(t,e,!0)[0]||null}},{key:"querySelectorAll",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[];if(!this.children||0===this.children.length)return r;var o=Object.keys(e);return this.children.forEach((function(i){if(!(n&&r.length>0)){if(i.node.type.name===t){var a=o.every((function(t){return e[t]===i.node.attrs[t]}));a&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(t,e,n)))}})),r}},{key:"setAttribute",value:function(t){var e=this.editor.state.tr;e.setNodeMarkup(this.from,void 0,ot(ot({},this.node.attrs),t)),this.editor.view.dispatch(e)}}])}();var Qn=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tt(this,e),(t=z(this,e)).css=null,t.className="tiptap",t.editorView=null,t.isFocused=!1,t.isInitialized=!1,t.extensionStorage={},t.instanceId=Math.random().toString(36).slice(2,9),t.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:function(){return null},onCreate:function(){return null},onMount:function(){return null},onUnmount:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null},onContentError:function(t){throw t.error},onPaste:function(){return null},onDrop:function(){return null},onDelete:function(){return null}},t.isCapturingTransaction=!1,t.capturedTransaction=null,t.utils={getUpdatedPosition:nn,createMappablePosition:rn},t.setOptions(n),t.createExtensionManager(),t.createCommandManager(),t.createSchema(),t.on("beforeCreate",t.options.onBeforeCreate),t.emit("beforeCreate",{editor:t}),t.on("mount",t.options.onMount),t.on("unmount",t.options.onUnmount),t.on("contentError",t.options.onContentError),t.on("create",t.options.onCreate),t.on("update",t.options.onUpdate),t.on("selectionUpdate",t.options.onSelectionUpdate),t.on("transaction",t.options.onTransaction),t.on("focus",t.options.onFocus),t.on("blur",t.options.onBlur),t.on("destroy",t.options.onDestroy),t.on("drop",(function(e){var n=e.event,r=e.slice,o=e.moved;return t.options.onDrop(n,r,o)})),t.on("paste",(function(e){var n=e.event,r=e.slice;return t.options.onPaste(n,r)})),t.on("delete",t.options.onDelete);var r=t.createDoc(),o=Bt(r,t.options.autofocus);return t.editorState=i.$t.create({doc:r,schema:t.schema,selection:o||void 0}),t.options.element&&t.mount(t.options.element),t}return K(e,t),nt(e,[{key:"mount",value:function(t){var e=this;if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");
21this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout((function(){e.isDestroyed||(!1!==e.options.autofocus&&null!==e.options.autofocus&&e.commands.focus(e.options.autofocus),e.emit("create",{editor:e}),e.isInitialized=!0)}),0)}},{key:"unmount",value:function(){if(this.editorView){var t=this.editorView.dom;(null==t?void 0:t.editor)&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(".".concat(this.className)).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}},{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(t,e,n){var r=document.querySelector("style[data-tiptap-style".concat(n?"-".concat(n):"","]"));if(null!==r)return r;var o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style".concat(n?"-".concat(n):""),""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
21\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=ot(ot({},this.options),t),this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"view",get:function(){var t=this;return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:function(e){t.editorState=e},dispatch:function(e){t.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:function(e,n){if(t.editorView)return t.editorView[n];if("state"===n)return t.editorState;if(n in e)return Reflect.get(e,n);throw new Error("[tiptap error]: The editor view is not available. Cannot access view['".concat(n,"']. The editor may not be mounted yet."))}})}},{key:"state",get:function(){return this.editorView&&(this.editorState=this.view.state),this.editorState}},{key:"registerPlugin",value:function(t,e){var n=Ee(e)?e(t,J(this.state.plugins)):[].concat(J(this.state.plugins),[t]),r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}},{key:"unregisterPlugin",value:function(t){if(!this.isDestroyed){var e=this.state.plugins,n=e;if([].concat(t).forEach((function(t){var e="string"==typeof t?"".concat(t,"$"):t.key;n=n.filter((function(t){return!t.key.startsWith(e)}))})),e.length!==n.length){var r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}}}},{key:"createExtensionManager",value:function(){var t,e,n=this,r=this.options.enableCoreExtensions?[Wn,Hn.configure({blockSeparator:null==(e=null==(t=this.options.coreExtensionOptions)?void 0:t.clipboardTextSerializer)?void 0:e.blockSeparator}),Vn,Jn,qn,Gn,Kn,Yn,_n,Xn.configure({direction:this.options.textDirection})].filter((function(t){return"object"!==U(n.options.enableCoreExtensions)||!1!==n.options.enableCoreExtensions[t.name]})):[],o=[].concat(J(r),J(this.options.extensions)).filter((function(t){return["extension","node","mark"].includes(null==t?void 0:t.type)}));this.extensionManager=new zn(o,this)}},{key:"createCommandManager",value:function(){this.commandManager=new lt({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createDoc",value:function(){var t,e=this;try{t=me(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message)))throw n;this.emit("contentError",{editor:this,error:n,disableCollaboration:function(){"collaboration"in e.storage&&"object"===U(e.storage.collaboration)&&e.storage.collaboration&&(e.storage.collaboration.isDisabled=!0),e.options.extensions=e.options.extensions.filter((function(t){return"collaboration"!==t.name})),e.createExtensionManager()}}),t=me(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}},{key:"createView",value:function(t){var e;this.editorView=new L.Lz(t,ot(ot({},this.options.editorProps),{},{attributes:ot({role:"textbox"},null==(e=this.options.editorProps)?void 0:e.attributes),dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}},{key:"prependClass",value:function(){this.view.dom.className="".concat(this.className," ").concat(this.view.dom.className)}},{key:"captureTransaction",value:function(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;var e=this.capturedTransaction;return this.capturedTransaction=null,e}},{key:"dispatchTransaction",value:function(t){var e=this;
21if(!this.view.isDestroyed){if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((function(t){var n;return null==(n=e.capturedTransaction)?void 0:n.step(t)})):void(this.capturedTransaction=t);var n=this.state.applyTransaction(t),r=n.state,o=n.transactions,i=!this.state.selection.eq(r.selection),a=o.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:r}),a){this.view.updateState(r),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:o.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:t});var u=o.findLast((function(t){return t.getMeta("focus")||t.getMeta("blur")})),c=null==u?void 0:u.getMeta("focus"),l=null==u?void 0:u.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:u}),l&&this.emit("blur",{editor:this,event:l.event,transaction:u}),t.getMeta("preventUpdate")||!o.some((function(t){return t.docChanged}))||s.doc.eq(r.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:o.slice(1)})}}}},{key:"getAttributes",value:function(t){return He(this.state,t)}},{key:"isActive",value:function(t,e){var n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return ee(t,null,n)||qe(t,null,n);var r=ae(e,t.schema);return"node"===r?ee(t,e,n):"mark"===r&&qe(t,e,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Ae(this.state.doc.content,this.schema)}},{key:"getText",value:function(t){var e=t||{},n=e.blockSeparator,r=void 0===n?"\n\n":n,o=e.textSerializers,i=void 0===o?{}:o;return ze(this.state.doc,{blockSeparator:r,textSerializers:ot(ot({},$e(this.schema)),i)})}},{key:"isEmpty",get:function(){return Qe(this.state.doc)}},{key:"destroy",value:function(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var t,e;return null==(e=null==(t=this.editorView)?void 0:t.isDestroyed)||e}},{key:"$node",value:function(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelector(t,e))||null}},{key:"$nodes",value:function(t,e){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(t,e))||null}},{key:"$pos",value:function(t){var e=this.state.doc.resolve(t);return new Zn(e,this)}},{key:"$doc",get:function(){return this.$pos(0)}}])}(Mn);function tr(t){return new On({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=xe(t.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],u=o[0];if(s){var c=u.search(/\S/),l=r.from+u.indexOf(s),f=l+s.length;if(Ke(r.from,r.to,n.doc).filter((function(e){return e.mark.type.excluded.find((function(n){return n===t.type&&n!==e.mark.type}))})).filter((function(t){return t.to>l})).length)return null;f<r.to&&a.delete(f,r.to),l>r.from&&a.delete(r.from+c,l);var d=r.from+c+s.length;a.addMark(r.from+c,d,t.type.create(i||{})),a.removeStoredMark(t.type)}},undoable:t.undoable})}function er(t){return new On({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=xe(t.getAttributes,void 0,o)||{},a=n.tr,s=r.from,u=r.to,c=t.type.create(i);if(o[1]){var l=s+o[0].lastIndexOf(o[1]);l>u?l=u:u=l+o[1].length;var f=o[0][o[0].length-1];a.insertText(f,s+o[0].length-1),a.replaceWith(l,u,c)}else if(o[0]){var d=t.type.isInline?s:s-1;a.insert(d,t.type.create(i)).delete(a.mapping.map(s),a.mapping.map(u))}a.scrollIntoView()},undoable:t.undoable})}function nr(t){return new On({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=n.doc.resolve(r.from),a=xe(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,a)},undoable:t.undoable})}function rr(t){return new On({find:t.find,handler:function(e){var n=e.state,o=e.range,i=e.match,a=e.chain,s=xe(t.getAttributes,void 0,i)||{},u=n.tr.delete(o.from,o.to),c=u.doc.resolve(o.from).blockRange(),l=c&&(0,r.oM)(c,t.type,s);if(!l)return null;if(u.wrap(c,l),t.keepMarks&&t.editor){var f=n.selection,d=n.storedMarks,h=t.editor.extensionManager.splittableMarks,p=d||f.$to.parentOffset&&f.$from.marks();if(p){var v=p.filter((function(t){return h.includes(t.type.name)}
21));u.ensureMarks(v)}}if(t.keepAttributes){var m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";a().updateAttributes(m,s).run()}var y=u.doc.resolve(o.from-1).nodeBefore;y&&y.type===t.type&&(0,r.n9)(u.doc,o.from-1)&&(!t.joinPredicate||t.joinPredicate(i,y))&&u.join(o.from-1)},undoable:t.undoable})}var or=function(){return nt((function t(e){var n,r,o,i,a,s,u=this;tt(this,t),this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=function(t){if(u.isResizing&&u.activeHandle){var e=t.clientX-u.startX,n=t.clientY-u.startY;u.handleResize(e,n)}},this.handleTouchMove=function(t){if(u.isResizing&&u.activeHandle){var e=t.touches[0];if(e){var n=e.clientX-u.startX,r=e.clientY-u.startY;u.handleResize(n,r)}}},this.handleMouseUp=function(){if(u.isResizing){var t=u.element.offsetWidth,e=u.element.offsetHeight;u.onCommit(t,e),u.isResizing=!1,u.activeHandle=null,u.container.dataset.resizeState="false",u.classNames.resizing&&u.container.classList.remove(u.classNames.resizing),document.removeEventListener("mousemove",u.handleMouseMove),document.removeEventListener("mouseup",u.handleMouseUp),document.removeEventListener("keydown",u.handleKeyDown),document.removeEventListener("keyup",u.handleKeyUp)}},this.handleKeyDown=function(t){"Shift"===t.key&&(u.isShiftKeyPressed=!0)},this.handleKeyUp=function(t){"Shift"===t.key&&(u.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(n=e.options)?void 0:n.min)&&(this.minSize=ot(ot({},this.minSize),e.options.min)),(null==(r=e.options)?void 0:r.max)&&(this.maxSize=e.options.max),(null==(o=null==e?void 0:e.options)?void 0:o.directions)&&(this.directions=e.options.directions),(null==(i=e.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(a=e.options)?void 0:a.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}),[{key:"dom",get:function(){return this.container}},{key:"contentDOM",get:function(){return this.contentElement}},{key:"handleEditorUpdate",value:function(){var t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}},{key:"update",value:function(t,e,n){return t.type===this.node.type&&(this.node=t,!this.onUpdate||this.onUpdate(t,e,n))}},{key:"destroy",value:function(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}},{key:"createContainer",value:function(){var t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}},{key:"createWrapper",value:function(){var t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}},{key:"createHandle",value:function(t){var e=document.createElement("div");
21return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}},{key:"positionHandle",value:function(t,e){var n=e.includes("top"),r=e.includes("bottom"),o=e.includes("left"),i=e.includes("right");n&&(t.style.top="0"),r&&(t.style.bottom="0"),o&&(t.style.left="0"),i&&(t.style.right="0"),"top"!==e&&"bottom"!==e||(t.style.left="0",t.style.right="0"),"left"!==e&&"right"!==e||(t.style.top="0",t.style.bottom="0")}},{key:"attachHandles",value:function(){var t=this;this.directions.forEach((function(e){var n;(n=t.createCustomHandle?t.createCustomHandle(e):t.createHandle(e))instanceof HTMLElement||(console.warn('[ResizableNodeView] createCustomHandle("'.concat(e,'") did not return an HTMLElement. Falling back to default handle.')),n=t.createHandle(e)),t.createCustomHandle||t.positionHandle(n,e),n.addEventListener("mousedown",(function(n){return t.handleResizeStart(n,e)})),n.addEventListener("touchstart",(function(n){return t.handleResizeStart(n,e)})),t.handleMap.set(e,n),t.wrapper.appendChild(n)}))}},{key:"removeHandles",value:function(){this.handleMap.forEach((function(t){return t.remove()})),this.handleMap.clear()}},{key:"applyInitialSize",value:function(){var t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width="".concat(t,"px"),this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height="".concat(e,"px"),this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}},{key:"handleResizeStart",value:function(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,"touches"in t?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight);this.getPos();this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}},{key:"handleResize",value:function(t,e){if(this.activeHandle){var n=this.preserveAspectRatio||this.isShiftKeyPressed,r=this.calculateNewDimensions(this.activeHandle,t,e),o=r.width,i=r.height,a=this.applyConstraints(o,i,n);this.element.style.width="".concat(a.width,"px"),this.element.style.height="".concat(a.height,"px"),this.onResize&&this.onResize(a.width,a.height)}}},{key:"calculateNewDimensions",value:function(t,e,n){var r=this.startWidth,o=this.startHeight,i=t.includes("right"),a=t.includes("left"),s=t.includes("bottom"),u=t.includes("top");return i?r=this.startWidth+e:a&&(r=this.startWidth-e),s?o=this.startHeight+n:u&&(o=this.startHeight-n),"right"!==t&&"left"!==t||(r=this.startWidth+(i?e:-e)),"top"!==t&&"bottom"!==t||(o=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,o,t):{width:r,height:o}}},{key:"applyConstraints",value:function(t,e,n){var r,o,i,a;if(!n){var s=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(null==(r=this.maxSize)?void 0:r.width)&&(s=Math.min(this.maxSize.width,s)),(null==(o=this.maxSize)?void 0:o.height)&&(u=Math.min(this.maxSize.height,u)),{width:s,height:u}}var c=t,l=e;return c<this.minSize.width&&(l=(c=this.minSize.width)/this.aspectRatio),l<this.minSize.height&&(c=(l=this.minSize.height)*this.aspectRatio),(null==(i=this.maxSize)?void 0:i.width)&&c>this.maxSize.width&&(l=(c=this.maxSize.width)/this.aspectRatio),(null==(a=this.maxSize)?void 0:a.height)&&l>this.maxSize.height&&(c=(l=this.maxSize.height)*this.aspectRatio),{width:c,height:l}}},{key:"applyAspectRatio",value:function(t,e,n){var r="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:t,height:t/this.aspectRatio}:r?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}}])}();function ir(t,e){var n=t.selection,r=n.$from;if(n instanceof i.nh){var o=r.index();return r.parent.canReplaceWith(o,o+1,e)}for(var a=r.depth;a>=0;){var s=r.index(a);if(r.node(a).contentMatchAt(s).matchType(e))return!0;a-=1}return!1}function ar(t){if(!(null==t?void 0:t.trim()))return{};var e={},n=[],r=t.replace(/["']([^"']*)["']/g,(function(t){return n.push(t),"__QUOTED_".concat(n.length-1,"__")}
21)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){var i=o.map((function(t){return t.trim().slice(1)}));e.class=i.join(" ")}var a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(e.id=a[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((function(t){var r,o=Y(t,3),i=o[1],a=o[2],s=parseInt((null==(r=a.match(/__QUOTED_(\d+)__/))?void 0:r[1])||"0",10),u=n[s];u&&(e[i]=u.slice(1,-1))}));var s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();s&&s.split(/\s+/).filter(Boolean).forEach((function(t){t.match(/^[a-zA-Z][\w-]*$/)&&(e[t]=!0)}));return e}function sr(t){if(!t||0===Object.keys(t).length)return"";var e=[];t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach((function(t){return e.push(".".concat(t))}));return t.id&&e.push("#".concat(t.id)),Object.entries(t).forEach((function(t){var n=Y(t,2),r=n[0],o=n[1];"class"!==r&&"id"!==r&&(!0===o?e.push(r):!1!==o&&null!=o&&e.push("".concat(r,'="').concat(String(o),'"')))})),e.join(" ")}function ur(t){var e=t.nodeName,n=t.name,r=t.parseAttributes,o=void 0===r?ar:r,i=t.serializeAttributes,a=void 0===i?sr:i,s=t.defaultAttributes,u=void 0===s?{}:s,c=t.requiredAttributes,l=void 0===c?[]:c,f=t.allowedAttributes,d=n||e;return{parseMarkdown:function(t,n){var r=ot(ot({},u),t.attributes);return n.createNode(e,r,[])},markdownTokenizer:{name:e,level:"block",start:function(t){var e,n=new RegExp("^:::".concat(d,"(?:\\s|$)"),"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize:function(t,n,r){var i=new RegExp("^:::".concat(d,"(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")),a=t.match(i);if(a){var s=a[1]||"",u=o(s);if(!l.find((function(t){return!(t in u)})))return{type:e,raw:a[0],attributes:u}}}},renderMarkdown:function(t){var e=function(t){if(!f)return t;var e={};return f.forEach((function(n){n in t&&(e[n]=t[n])})),e}(t.attrs||{}),n=a(e),r=n?" {".concat(n,"}"):"";return":::".concat(d).concat(r," :::")}}}function cr(t){var e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?ar:o,a=t.serializeAttributes,s=void 0===a?sr:a,u=t.defaultAttributes,c=void 0===u?{}:u,l=t.content,f=void 0===l?"block":l,d=t.allowedAttributes,h=n||e;return{parseMarkdown:function(t,n){var o;if(r){var i=r(t);o="string"==typeof i?[{type:"text",text:i}]:i}else o="block"===f?n.parseChildren(t.tokens||[]):n.parseInline(t.tokens||[]);var a=ot(ot({},c),t.attributes);return n.createNode(e,a,o)},markdownTokenizer:{name:e,level:"block",start:function(t){var e,n=new RegExp("^:::".concat(h),"m"),r=null==(e=t.match(n))?void 0:e.index;return void 0!==r?r:-1},tokenize:function(t,n,r){var o,a=new RegExp("^:::".concat(h,"(?:\\s+\\{([^}]*)\\})?\\s*\\n")),s=t.match(a);if(s){var u=Y(s,2),c=u[0],l=u[1],d=i(void 0===l?"":l),p=1,v=c.length,m="",y=/^:::([\w-]*)(\s.*)?/gm,g=t.slice(v);for(y.lastIndex=0;;){var b=y.exec(g);if(null===b)break;var k=b.index,w=b[1];if(!(null==(o=b[2])?void 0:o.endsWith(":::")))if(w)p+=1;else if(0===(p-=1)){var D=g.slice(0,k);m=D.trim();var C=t.slice(0,v+k+b[0].length),S=[];if(m)if("block"===f)for((S=r.blockTokens(D)).forEach((function(t){!t.text||t.tokens&&0!==t.tokens.length||(t.tokens=r.inlineTokens(t.text))}));S.length>0;){var A=S[S.length-1];if("paragraph"!==A.type||A.text&&""!==A.text.trim())break;S.pop()}else S=r.inlineTokens(m);return{type:e,raw:C,attributes:d,content:m,tokens:S}}}}}},renderMarkdown:function(t,e){var n=function(t){if(!d)return t;var e={};return d.forEach((function(n){n in t&&(e[n]=t[n])})),e}(t.attrs||{}),r=s(n),o=r?" {".concat(r,"}"):"",i=e.renderChildren(t.content||[],"\n\n");return":::".concat(h).concat(o,"\n\n").concat(i,"\n\n:::")}}}function lr(t){if(!t.trim())return{};for(var e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(t);null!==r;){var o=Y(r,4),i=o[1],a=o[2],s=o[3];e[i]=a||s,r=n.exec(t)}return e}function fr(t){return Object.entries(t).filter((function(t){var e=Y(t,2)[1];return null!=e})).map((function(t){var e=Y(t,2),n=e[0],r=e[1];return"".concat(n,'="').concat(r,'"')})).join(" ")}function dr(t){var e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?lr:o,a=t.serializeAttributes,s=void 0===a?fr:a,u=t.defaultAttributes,c=void 0===u?{}
21:u,l=t.selfClosing,f=void 0!==l&&l,d=t.allowedAttributes,h=n||e,p=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:function(t,n){var o=ot(ot({},c),t.attributes);if(f)return n.createNode(e,o);var i=r?r(t):t.content||"";return i?n.createNode(e,o,[n.createTextNode(i)]):n.createNode(e,o,[])},markdownTokenizer:{name:e,level:"inline",start:function(t){var e=f?new RegExp("\\[".concat(p,"\\s*[^\\]]*\\]")):new RegExp("\\[".concat(p,"\\s*[^\\]]*\\][\\s\\S]*?\\[\\/").concat(p,"\\]")),n=t.match(e),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize:function(t,n,r){var o=f?new RegExp("^\\[".concat(p,"\\s*([^\\]]*)\\]")):new RegExp("^\\[".concat(p,"\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(p,"\\]")),a=t.match(o);if(a){var s="",u="";if(f){u=Y(a,2)[1]}else{var c=Y(a,3);u=c[1],s=c[2]||""}var l=i(u.trim());return{type:e,raw:a[0],content:s.trim(),attributes:l}}}},renderMarkdown:function(t){var e="";r?e=r(t):t.content&&t.content.length>0&&(e=t.content.filter((function(t){return"text"===t.type})).map((function(t){return t.text})).join(""));var n=function(t){if(!d)return t;var e={};return d.forEach((function(n){var r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in t){var i=t[r];if(void 0!==o&&i===o)return;e[r]=i}})),e}(t.attrs||{}),o=s(n),i=o?" ".concat(o):"";return f?"[".concat(h).concat(i,"]"):"[".concat(h).concat(i,"]").concat(e,"[/").concat(h,"]")}}}function hr(t,e,n){for(var r,o,i,a,s,u=t.split("\n"),c=[],l="",f=0,d=e.baseIndentSize||2,h=function(){var t=u[f],s=t.match(e.itemPattern);if(!s)return c.length>0?0:""===t.trim()?(f+=1,l="".concat(l).concat(t,"\n"),1):{v:void 0};var h=e.extractItemData(s),p=h.indentLevel,v=h.mainContent;l="".concat(l).concat(t,"\n");var m,y=[v];for(f+=1;f<u.length;){var g=u[f];if(""===g.trim()){var b=u.slice(f+1).findIndex((function(t){return""!==t.trim()}));if(-1===b)break;var k=u[f+1+b];if(((null==(o=null==(r=k.match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>p){y.push(g),l="".concat(l).concat(g,"\n"),f+=1;continue}break}if(!(((null==(a=null==(i=g.match(/^(\s*)/))?void 0:i[1])?void 0:a.length)||0)>p))break;y.push(g),l="".concat(l).concat(g,"\n"),f+=1}var w=y.slice(1);if(w.length>0){var D=w.map((function(t){return t.slice(p+d)})).join("\n");D.trim()&&(m=e.customNestedParser?e.customNestedParser(D):n.blockTokens(D))}var C=e.createToken(h,m);c.push(C)};f<u.length&&0!==(s=h());)if(1!==s&&s)return s.v;if(0!==c.length)return{items:c,raw:l}}function pr(t,e,n,r){if(!t||!Array.isArray(t.content))return"";var o,i="function"==typeof n?n(r):n,a=Q(o=t.content)||q(o)||X(o)||G(),s=a[0],u=a.slice(1),c=e.renderChildren([s]),l=["".concat(i).concat(c)];return u&&u.length>0&&u.forEach((function(t){var n=e.renderChildren([t]);if(n){var r=n.split("\n").map((function(t){return t?e.indent(t):""})).join("\n");l.push(r)}})),l.join("\n")}function vr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.state,o=r.doc,i=r.tr,a=t;o.descendants((function(e,r){var o=i.mapping.map(r),s=i.mapping.map(r)+e.nodeSize,u=null;if(e.marks.forEach((function(t){if(t!==a)return!1;u=t})),u){var c=!1;if(Object.keys(n).forEach((function(t){n[t]!==u.attrs[t]&&(c=!0)})),c){var l=t.type.create(ot(ot({},t.attrs),n));i.removeMark(o,s,t.type),i.addMark(o,s,l)}}})),i.docChanged&&e.view.dispatch(i)}ut({},{createAtomBlockMarkdownSpec:function(){return ur},createBlockMarkdownSpec:function(){return cr},createInlineMarkdownSpec:function(){return dr},parseAttributes:function(){return ar},parseIndentedBlocks:function(){return hr},renderNestedMarkdownContent:function(){return pr},serializeAttributes:function(){return sr}});var mr=function(t){function e(){var t;return tt(this,e),(t=z(this,e,arguments)).type="node",t}return K(e,t),nt(e,[{key:"configure",value:function(t){return H(e,"configure",this,3)([t])}},{key:"extend",value:function(t){var n="function"==typeof t?t():t;return H(e,"extend",this,3)([n])}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e("function"==typeof t?t():t)}}])}(Rn);function yr(t){return new Bn({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=e.pasteEvent,a=xe(t.getAttributes,void 0,o,i);if(!1===a||null===a)return null;var s=n.tr,u=o[o.length-1],c=o[0],l=r.to;if(u){var f=c.search(/\S/),d=r.from+c.indexOf(u),h=d+u.length;if(Ke(r.from,r.to,n.doc).filter((function(e){return e.mark.type.excluded.find((function(n){return n===t.type&&n!==e.mark.type}))})).filter((function(t){return t.to>d})).length)return null;h<r.to&&s.delete(h,r.to),d>r.from&&s.delete(r.from+f,d),l=r.from+f+u.length,s.addMark(r.from+f,l,t.type.create(a||{})),s.removeStoredMark(t.type)}}})}},31754:function(t,e,n){n.d(e,{Ay:function(){return s}});var r=n(51222);function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}
21finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var a=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,s=r.bP.create({name:"image",addOptions:function(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline:function(){return this.options.inline},group:function(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:function(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML:function(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML:function(t){var e=t.HTMLAttributes;return["img",(0,r.KV)(this.options.HTMLAttributes,e)]},parseMarkdown:function(t,e){return e.createNode("image",{src:t.href,title:t.title,alt:t.text})},renderMarkdown:function(t){var e,n,r,o,i,a,s=null!=(n=null==(e=t.attrs)?void 0:e.src)?n:"",u=null!=(o=null==(r=t.attrs)?void 0:r.alt)?o:"",c=null!=(a=null==(i=t.attrs)?void 0:i.title)?a:"";return c?".concat(s,' "').concat(c,'")'):".concat(s,")")},addNodeView:function(){var t=this;if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;var e=this.options.resize,n=e.directions,i=e.minWidth,a=e.minHeight,s=e.alwaysPreserveAspectRatio;return function(e){var u=e.node,c=e.getPos,l=e.HTMLAttributes,f=e.editor,d=document.createElement("img");Object.entries(l).forEach((function(t){var e=o(t,2),n=e[0],r=e[1];if(null!=r)switch(n){case"width":case"height":break;default:d.setAttribute(n,r)}})),d.src=l.src;var h=new r.Nz({element:d,editor:f,node:u,getPos:c,onResize:function(t,e){d.style.width="".concat(t,"px"),d.style.height="".concat(e,"px")},onCommit:function(e,n){var r=c();void 0!==r&&t.editor.chain().setNodeSelection(r).updateAttributes(t.name,{width:e,height:n}).run()},onUpdate:function(t,e,n){return t.type===u.type},options:{directions:n,min:{width:i,height:a},preserveAspectRatio:!0===s}}),p=h.dom;return p.style.visibility="hidden",p.style.pointerEvents="none",d.onload=function(){p.style.visibility="",p.style.pointerEvents=""},h}},addCommands:function(){var t=this;return{setImage:function(e){return function(n){return n.commands.insertContent({type:t.name,attrs:e})}}}}
21,addInputRules:function(){return[(0,r.jT)({find:a,type:this.type,getAttributes:function(t){var e=o(t,5),n=e[2];return{src:e[3],alt:n,title:e[4]}}})]}})},16850:function(t,e,n){n.d(e,{A:function(){return r}});var r=n(45533).Or},45384:function(t,e,n){n.d(e,{R0:function(){return Yt}});var r,o,i=n(51222),a=n(17386),s=n(42959),u=n(33822),c=n(28591),l=n(441);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function d(t,e,n){return e=p(e),function(t,e){if(e&&("object"==f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,h()?Reflect.construct(e,n||[],p(t).constructor):e.apply(t,n))}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function m(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function g(t,e,n){return(e=D(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,D(r.key),r)}}function w(t,e,n){return e&&k(t.prototype,e),n&&k(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function D(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==f(e)?e:e+""}if("undefined"!=typeof WeakMap){var C=new WeakMap;r=function(t){return C.get(t)},o=function(t,e){return C.set(t,e),e}}else{var S=[],A=0;r=function(t){for(var e=0;e<S.length;e+=2)if(S[e]==t)return S[e+1]},o=function(t,e){return 10==A&&(A=0),S[A++]=t,S[A++]=e}}var E=function(){return w((function t(e,n,r,o){b(this,t),this.width=e,this.height=n,this.map=r,this.problems=o}),[{key:"findCell",value:function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var r=e%this.width,o=e/this.width|0,i=r+1,a=o+1,s=1;i<this.width&&this.map[e+s]==n;s++)i++;for(var u=1;a<this.height&&this.map[e+this.width*u]==n;u++)a++;return{left:r,top:o,right:i,bottom:a}}}throw new RangeError("No cell with offset ".concat(t," found"))}},{key:"colCount",value:function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset ".concat(t," found"))}},{key:"nextCell",value:function(t,e,n){var r=this.findCell(t),o=r.left,i=r.right,a=r.top,s=r.bottom;return"horiz"==e?(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)]}},{key:"rectBetween",value:function(t,e){var n=this.findCell(t),r=n.left,o=n.right,i=n.top,a=n.bottom,s=this.findCell(e),u=s.left,c=s.right,l=s.top,f=s.bottom;return{left:Math.min(r,u),top:Math.min(i,l),right:Math.max(o,c),bottom:Math.max(a,f)}}},{key:"cellsInRect",value:function(t){for(var e=[],n={},r=t.top;r<t.bottom;r++)for(var o=t.left;o<t.right;o++){var i=r*this.width+o,a=this.map[i];
21n[a]||(n[a]=!0,o==t.left&&o&&this.map[i-1]==a||r==t.top&&r&&this.map[i-this.width]==a||e.push(a))}return e}},{key:"positionAt",value:function(t,e,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==t){for(var a=e+t*this.width,s=(t+1)*this.width;a<s&&this.map[a]<o;)a++;return a==s?i-1:this.map[a]}o=i}}}],[{key:"get",value:function(t){return r(t)||o(t,x(t))}}])}();function x(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,r=0;r<t.childCount;r++){var o=t.child(r),i=0;if(n)for(var a=0;a<r;a++)for(var s=t.child(a),u=0;u<s.childCount;u++){var c=s.child(u);a+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}for(var l=0;l<o.childCount;l++){var f=o.child(l);i+=f.attrs.colspan,f.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,r=[],o=0,i=null,a=[],s=0,u=e*n;s<u;s++)r[s]=0;for(var c=0,l=0;c<n;c++){var f=t.child(c);l++;for(var d=0;;d++){for(;o<r.length&&0!=r[o];)o++;if(d==f.childCount)break;for(var h=f.child(d),p=h.attrs,v=p.colspan,m=p.rowspan,y=p.colwidth,g=0;g<m;g++){if(g+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:m-g});break}for(var b=o+g*e,k=0;k<v;k++){0==r[b+k]?r[b+k]=l:(i||(i=[])).push({type:"collision",row:c,pos:l,n:v-k});var w=y&&y[k];if(w){var D=(b+k)%e*2,C=a[D];null==C||C!=w&&1==a[D+1]?(a[D]=w,a[D+1]=1):C==w&&a[D+1]++}}}o+=v,l+=h.nodeSize}for(var S=(c+1)*e,A=0;o<S;)0==r[o++]&&A++;A&&(i||(i=[])).push({type:"missing",row:c,n:A}),l++}0!==e&&0!==n||(i||(i=[])).push({type:"zero_sized"});for(var x=new E(e,n,r,i),O=!1,T=0;!O&&T<a.length;T+=2)null!=a[T]&&a[T+1]<n&&(O=!0);return O&&function(t,e,n){t.problems||(t.problems=[]);for(var r={},o=0;o<t.map.length;o++){var i=t.map[o];if(!r[i]){r[i]=!0;var a=n.nodeAt(i);if(!a)throw new RangeError("No cell with offset ".concat(i," found"));for(var s=null,u=a.attrs,c=0;c<u.colspan;c++){var l=e[(o+c)%t.width*2];null==l||u.colwidth&&u.colwidth[c]==l||((s||(s=M(u)))[c]=l)}s&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(x,a,t),x}function M(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function O(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}return e}var T=new a.hs("selectingCells");function N(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function F(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function R(t){var e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;var n=N(e.$head)||P(e.$head);if(n)return n;throw new RangeError("No cell found around position ".concat(e.head))}function P(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(var o=t.nodeBefore,i=t.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return t.doc.resolve(i-o.nodeSize)}}function B(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function j(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function L(t,e,n){var r=t.node(-1),o=E.get(r),i=t.start(-1),a=o.nextCell(t.pos-i,e,n);return null==a?null:t.node(0).resolve(i+a)}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=y(y({},t),{},{colspan:t.colspan-n});return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((function(t){return t>0}))||(r.colwidth=null)),r}function z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=y(y({},t),{},{colspan:t.colspan+n});if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}var $=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;b(this,e);var o=t.node(-1),i=E.get(o),s=t.start(-1),u=i.rectBetween(t.pos-s,r.pos-s),c=t.node(0),l=i.cellsInRect(u).filter((function(t){return t!=r.pos-s}));l.unshift(r.pos-s);var f=l.map((function(t){var e=o.nodeAt(t);if(!e)throw new RangeError("No cell with offset ".concat(t," found"));var n=s+t+1;return new a.yn(c.resolve(n),c.resolve(n+e.content.size))}));return(n=d(this,e,[f[0].$from,f[0].$to,f])).$anchorCell=t,n.$headCell=r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),w(e,[{key:"map",value:function(t,n){var r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(B(r)&&B(o)&&j(r,o)){var i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?e.rowSelection(r,o):i&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return a.U3.between(r,o)}},{key:"content",value:function(){for(var t=this.$anchorCell.node(-1),e=E.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var u=[],c=a*e.width+r.left,l=r.left;l<r.right;l++,c++){var f=e.map[c];if(!o[f]){o[f]=!0;var d=e.findCell(f),h=t.nodeAt(f);if(!h)throw new RangeError("No cell with offset ".concat(f," found"));var p=r.left-d.left,v=d.right-r.right;if(p>0||v>0){var m=h.attrs;if(p>0&&(m=I(m,0,p)),v>0&&(m=I(m,m.colspan-v,v)),d.left<r.left){if(!(h=h.type.createAndFill(m)))throw new RangeError("Could not create cell with attrs ".concat(JSON.stringify(m)))}else h=h.type.create(m,h.content)}if(d.top<r.top||d.bottom>r.bottom){var g=y(y({},h.attrs),{},{rowspan:Math.min(d.bottom,r.bottom)-Math.max(d.top,r.top)});h=d.top<r.top?h.type.createAndFill(g):h.type.create(g,h.content)}u.push(h)}}i.push(t.child(a).copy(s.FK.from(u)))}var b=this.isColSelection()&&this.isRowSelection()?t:i;return new s.Ji(s.FK.from(b),1,1)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.Ji.empty,n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],u=i.$from,c=i.$to,l=t.mapping.slice(n);t.replace(l.map(u.pos),l.map(c.pos),o?s.Ji.empty:e)}var f=a.LN.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);f&&t.setSelection(f)}},{key:"replaceWith",value:function(t,e){this.replace(t,new s.Ji(s.FK.from(e),0,0))}}
21,{key:"forEachCell",value:function(t){for(var e=this.$anchorCell.node(-1),n=E.get(e),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)t(e.nodeAt(o[i]),r+o[i])}},{key:"isColSelection",value:function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}},{key:"isRowSelection",value:function(){var t=this.$anchorCell.node(-1),e=E.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),o=e.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;var i=r+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==e.width}},{key:"eq",value:function(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}},{key:"toJSON",value:function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}},{key:"getBookmark",value:function(){return new H(this.$anchorCell.pos,this.$headCell.pos)}}],[{key:"colSelection",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),o=E.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),u=t.node(0);return a.top<=s.top?(a.top>0&&(t=u.resolve(i+o.map[a.left])),s.bottom<o.height&&(n=u.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=u.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=u.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new e(t,n)}},{key:"rowSelection",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),o=E.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),u=t.node(0);return a.left<=s.left?(a.left>0&&(t=u.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(n=u.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=u.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=u.resolve(i+o.map[o.width*(a.top+1)-1]))),new e(t,n)}},{key:"fromJSON",value:function(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}},{key:"create",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;return new e(t.resolve(n),t.resolve(r))}}])}(a.LN);$.prototype.visible=!1,a.LN.jsonID("cell",$);var H=function(){function t(e,n){b(this,t),this.anchor=e,this.head=n}return w(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&j(e,n)?new $(e,n):a.LN.near(n,1)}}])}();function V(t){if(!(t.selection instanceof $))return null;var e=[];return t.selection.forEachCell((function(t,n){e.push(u.NZ.node(n,n+t.nodeSize,{class:"selectedCell"}))})),u.zF.create(t.doc,e)}var _=new a.hs("fix-tables");function K(t,e,n,r){var o=t.childCount,i=e.childCount;t:for(var a=0,s=0;a<i;a++){for(var u=e.child(a),c=s,l=Math.min(o,a+3);c<l;c++)if(t.child(c)==u){s=c+1,n+=u.nodeSize;continue t}r(u,n),s<o&&t.child(s).sameMarkup(u)?K(t.child(s),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function W(t,e){var n,r=function(e,r){"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){var o=E.get(e);if(!o.problems)return r;r||(r=t.tr);for(var i,a,s=[],u=0;u<o.height;u++)s.push(0);for(var c=0;c<o.problems.length;c++){var l=o.problems[c];if("collision"==l.type){var f=e.nodeAt(l.pos);if(!f)continue;for(var d=f.attrs,h=0;h<d.rowspan;h++)s[l.row+h]+=l.n;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,I(d,d.colspan-l.n,l.n))}else if("missing"==l.type)s[l.row]+=l.n;else if("overlong_rowspan"==l.type){var p=e.nodeAt(l.pos);if(!p)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,y(y({},p.attrs),{},{rowspan:p.attrs.rowspan-l.n}))}else if("colwidth mismatch"==l.type){var v=e.nodeAt(l.pos);if(!v)continue;r.setNodeMarkup(r.mapping.map(n+1+l.pos),null,y(y({},v.attrs),{},{colwidth:l.colwidth}))}else if("zero_sized"==l.type){var m=r.mapping.map(n);r.delete(m,m+e.nodeSize)}}for(var g=0;g<s.length;g++)s[g]&&(null==i&&(i=g),a=g);for(var b=0,k=n+1;b<o.height;b++){var w=e.child(b),D=k+w.nodeSize,C=s[b];if(C>0){var S="cell";w.firstChild&&(S=w.firstChild.type.spec.tableRole);for(var A=[],x=0;x<C;x++){var M=O(t.schema)[S].createAndFill();M&&A.push(M)}var T=0!=b&&i!=b-1||a!=b?D-1:k+1;r.insert(r.mapping.map(T),A)}k=D}return r.setMeta(_,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&K(e.doc,t.doc,0,r):t.doc.descendants(r),n}function U(t){var e=t.selection,n=R(t),r=n.node(-1),o=n.start(-1),i=E.get(r);return y(y({},e instanceof $?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o)),{},{tableStart:o,map:i,table:r})}function J(t,e,n){var r=e.map,o=e.tableStart,i=e.table,a=n>0?-1:0;(function(t,e,n){for(var r=O(e.type.schema).header_cell,o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.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 u=s*r.width+n;if(n>0&&n<r.width&&r.map[u-1]==r.map[u]){var c=r.map[u],l=i.nodeAt(c);t.setNodeMarkup(t.mapping.map(o+c),null,z(l.attrs,n-r.colCount(c))),s+=l.attrs.rowspan-1}else{var f=null==a?O(i.type.schema).cell:i.nodeAt(r.map[u+a]).type,d=r.positionAt(s,n,i);t.insert(t.mapping.map(o+d),f.createAndFill())}}return t}function q(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,a=t.mapping.maps.length,s=0;s<r.height;){var u=s*r.width+n,c=r.map[u],l=o.nodeAt(c),f=l.attrs;if(n>0&&r.map[u-1]==c||n<r.width-1&&r.map[u+1]==c)t.setNodeMarkup(t.mapping.slice(a).map(i+c),null,I(f,n-r.colCount(c)));else{var d=t.mapping.slice(a).map(i+c);t.delete(d,d+l.nodeSize)}s+=f.rowspan}}function Y(t,e,n){for(var r=e.map,o=e.tableStart,i=e.table,a=o,s=0;s<n;s++)a+=i.child(s).nodeSize;var u=[],c=n>0?-1:0;(function(t,e,n){for(var r,o=O(e.type.schema).header_cell,i=0;i<t.width;i++)if((null===(r=e.nodeAt(t.map[i+n*t.width]))||void 0===r?void 0:r.type)!=o)return!1;return!0})(r,i,n+c)&&(c=0==n||n==r.height?null:0);for(var l=0,f=r.width*n;l<r.width;l++,f++)if(n>0&&n<r.height&&r.map[f]==r.map[f-r.width]){var d=r.map[f],h=i.nodeAt(d).attrs;t.setNodeMarkup(o+d,null,y(y({},h),{},{rowspan:h.rowspan+1})),l+=h.colspan-1}else{var p,v=null==c?O(i.type.schema).cell:null===(p=i.nodeAt(r.map[f+c*r.width]))||void 0===p?void 0:p.type,m=null==v?void 0:v.createAndFill();m&&u.push(m)}return t.insert(a,O(i.type.schema).row.create(null,u)),t}function G(t,e,n){for(var r=e.map,o=e.table,i=e.tableStart,a=0,s=0;s<n;s++)a+=o.child(s).nodeSize;var u=a+o.child(n).nodeSize,c=t.mapping.maps.length;t.delete(a+i,u+i);for(var l=new Set,f=0,d=n*r.width;f<r.width;f++,d++){var h=r.map[d];if(!l.has(h))if(l.add(h),n>0&&h==r.map[d-r.width]){var p=o.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(c).map(h+i),null,y(y({},p),{},{rowspan:p.rowspan-1})),f+=p.colspan-1}else if(n<r.height&&h==r.map[d+r.width]){var v=o.nodeAt(h),m=v.attrs,g=v.type.create(y(y({},m),{},{rowspan:v.attrs.rowspan-1}),v.content),b=r.positionAt(n+1,f,o);t.insert(t.mapping.slice(c).map(i+b),g),f+=m.colspan-1}}}function X(t){var e=t.content;return 1==e.childCount&&e.child(0).isTextblock&&0==e.child(0).childCount}function Z(t,e){var n=t.selection;if(!(n instanceof $)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=U(t),o=r.map;if(function(t,e){for(var n=t.width,r=t.height,o=t.map,i=e.top*n+e.left,a=i,s=(e.bottom-1)*n+e.left,u=i+(e.right-e.left-1),c=e.top;c<e.bottom;c++){if(e.left>0&&o[a]==o[a-1]||e.right<n&&o[u]==o[u+1])return!0;a+=n,u+=n}for(var l=e.left;l<e.right;l++){if(e.top>0&&o[i]==o[i-n]||e.bottom<r&&o[s]==o[s+n])return!0;
21i++,s++}return!1}(o,r))return!1;if(e){for(var i,a,u=t.tr,c={},l=s.FK.empty,f=r.top;f<r.bottom;f++)for(var d=r.left;d<r.right;d++){var h=o.map[f*o.width+d],p=r.table.nodeAt(h);if(!c[h]&&p)if(c[h]=!0,null==i)i=h,a=p;else{X(p)||(l=l.append(p.content));var v=u.mapping.map(h+r.tableStart);u.delete(v,v+p.nodeSize)}}if(null==i||null==a)return!0;if(u.setNodeMarkup(i+r.tableStart,null,y(y({},z(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan)),{},{rowspan:r.bottom-r.top})),l.size>0){var m=i+1+a.content.size,g=X(a)?i+1:m;u.replaceWith(g+r.tableStart,m+r.tableStart,l)}u.setSelection(new $(u.doc.resolve(i+r.tableStart))),e(u)}return!0}function Q(t,e){var n,r=O(t.schema);return(n=function(t){var e=t.node;return r[e.type.spec.tableRole]},function(t,e){var r,o,i=t.selection;if(i instanceof $){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{var a;if(!(r=function(t){for(var e=t.depth;e>0;e--){var n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from)))return!1;o=null===(a=N(i.$from))||void 0===a?void 0:a.pos}if(null==r||null==o)return!1;if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(e){var s=r.attrs,u=[],c=s.colwidth;s.rowspan>1&&(s=y(y({},s),{},{rowspan:1})),s.colspan>1&&(s=y(y({},s),{},{colspan:1}));for(var l,f=U(t),d=t.tr,h=0;h<f.right-f.left;h++)u.push(c?y(y({},s),{},{colwidth:c&&c[h]?[c[h]]:null}):s);for(var p=f.top;p<f.bottom;p++){var v=f.map.positionAt(p,f.left,f.table);p==f.top&&(v+=r.nodeSize);for(var m=f.left,g=0;m<f.right;m++,g++)m==f.left&&p==f.top||d.insert(l=d.mapping.map(v+f.tableStart,1),n({node:r,row:p,col:m}).createAndFill(u[g]))}d.setNodeMarkup(o,n({node:r,row:f.top,col:f.left}),u[0]),i instanceof $&&d.setSelection(new $(d.doc.resolve(i.$anchorCell.pos),l?d.doc.resolve(l):void 0)),e(d)}return!0})(t,e)}function tt(t,e,n){for(var r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),o=0;o<r.length;o++){var i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function et(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!F(e))return!1;if(n){for(var r=O(e.schema),o=U(e),i=e.tr,a=o.map.cellsInRect("column"==t?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==t?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=a.map((function(t){return o.table.nodeAt(t)})),u=0;u<a.length;u++)s[u].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[u],r.cell,s[u].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}}(t):function(e,n){if(!F(e))return!1;if(n){var r=O(e.schema),o=U(e),i=e.tr,a=tt("row",o,r),s=tt("column",o,r),u=("column"===t?a:"row"===t&&s)?1:0,c="column"==t?{left:0,top:u,right:1,bottom:o.map.height}:"row"==t?{left:u,top:0,right:o.map.width,bottom:1}:o,l="column"==t?s?r.cell:r.header_cell:"row"==t?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach((function(t){var e=t+o.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,l,n.attrs)})),n(i)}return!0}}et("row",{useDeprecatedLogic:!0}),et("column",{useDeprecatedLogic:!0});var nt=et("cell",{useDeprecatedLogic:!0});function rt(t){return function(e,n){if(!F(e))return!1;var r,o=function(t,e){if(e<0){var n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(var r=t.index(-1)-1,o=t.before();r>=0;r--){var i=t.node(-1).child(r),a=i.lastChild;if(a)return o-1-a.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;for(var s=t.node(-1),u=t.indexAfter(-1),c=t.after();u<s.childCount;u++){var l=s.child(u);if(l.childCount)return c+1;c+=l.nodeSize}}return null}(R(e),t);if(null==o)return!1;if(n){var i=e.doc.resolve(o);n(e.tr.setSelection(a.U3.between(i,(r=i,r.node(0).resolve(r.pos+r.nodeAfter.nodeSize)))).scrollIntoView())}return!0}}function ot(t,e){var n=t.selection;if(!(n instanceof $))return!1;if(e){var r=t.tr,o=O(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(o)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new s.Ji(o,0,0))})),r.docChanged&&e(r)}return!0}function it(t){if(0===t.size)return null;for(var e=t.content,n=t.openStart,r=t.openEnd;1==e.childCount&&(n>0&&r>0||"table"==e.child(0).type.spec.tableRole);)n--,r--,e=e.child(0).content;var o=e.child(0),i=o.type.spec.tableRole,a=o.type.schema,u=[];
21if("row"==i)for(var c=0;c<e.childCount;c++){var l=e.child(c).content,f=c?0:Math.max(0,n-1),d=c<e.childCount-1?0:Math.max(0,r-1);(f||d)&&(l=at(O(a).row,new s.Ji(l,f,d)).content),u.push(l)}else{if("cell"!=i&&"header_cell"!=i)return null;u.push(n||r?at(O(a).row,new s.Ji(e,n,r)).content:e)}return function(t,e){for(var n=[],r=0;r<e.length;r++)for(var o=e[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,u=a.rowspan,c=a.colspan,l=r;l<r+u;l++)n[l]=(n[l]||0)+c;for(var f=0,d=0;d<n.length;d++)f=Math.max(f,n[d]);for(var h=0;h<n.length;h++)if(h>=e.length&&e.push(s.FK.empty),n[h]<f){for(var p=O(t).cell.createAndFill(),v=[],m=n[h];m<f;m++)v.push(p);e[h]=e[h].append(s.FK.from(v))}return{height:e.length,width:f,rows:e}}(a,u)}function at(t,e){var n=t.createAndFill();return new l.dL(n).replace(0,n.content.size,e).doc}function st(t,e,n,r,o,i,a,s){if(0==a||a==e.height)return!1;for(var u=!1,c=o;c<i;c++){var l=a*e.width+c,f=e.map[l];if(e.map[l-e.width]==f){u=!0;var d=n.nodeAt(f),h=e.findCell(f),p=h.top,v=h.left;t.setNodeMarkup(t.mapping.slice(s).map(f+r),null,y(y({},d.attrs),{},{rowspan:a-p})),t.insert(t.mapping.slice(s).map(e.positionAt(a,v,n)),d.type.createAndFill(y(y({},d.attrs),{},{rowspan:p+d.attrs.rowspan-a}))),c+=d.attrs.colspan-1}}return u}function ut(t,e,n,r,o,i,a,s){if(0==a||a==e.width)return!1;for(var u=!1,c=o;c<i;c++){var l=c*e.width+a,f=e.map[l];if(e.map[l-1]==f){u=!0;var d=n.nodeAt(f),h=e.colCount(f),p=t.mapping.slice(s).map(f+r);t.setNodeMarkup(p,null,I(d.attrs,a-h,d.attrs.colspan-(a-h))),t.insert(p+d.nodeSize,d.type.createAndFill(I(d.attrs,0,a-h))),c+=d.attrs.rowspan-1}}return u}function ct(t,e,n,r,o){var i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");var a=E.get(i),u=r.top,c=r.left,l=c+o.width,f=u+o.height,d=t.tr,h=0;function p(){if(!(i=n?d.doc.nodeAt(n-1):d.doc))throw new Error("No table found");a=E.get(i),h=d.mapping.maps.length}(function(t,e,n,r,o,i,a){var u,c,l=O(t.doc.type.schema);if(o>e.width)for(var f=0,d=0;f<e.height;f++){var h=n.child(f);d+=h.nodeSize;var p=[],v=void 0;v=null==h.lastChild||h.lastChild.type==l.cell?u||(u=l.cell.createAndFill()):c||(c=l.header_cell.createAndFill());for(var m=e.width;m<o;m++)p.push(v);t.insert(t.mapping.slice(a).map(d-1+r),p)}if(i>e.height){for(var y=[],g=0,b=(e.height-1)*e.width;g<Math.max(e.width,o);g++){var k=!(g>=e.width)&&n.nodeAt(e.map[b+g]).type==l.header_cell;y.push(k?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}for(var w=l.row.create(null,s.FK.from(y)),D=[],C=e.height;C<i;C++)D.push(w);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),D)}return!(!u&&!c)})(d,a,i,n,l,f,h)&&p(),st(d,a,i,n,c,l,u,h)&&p(),st(d,a,i,n,c,l,f,h)&&p(),ut(d,a,i,n,u,f,c,h)&&p(),ut(d,a,i,n,u,f,l,h)&&p();for(var v=u;v<f;v++){var m=a.positionAt(v,c,i),y=a.positionAt(v,l,i);d.replace(d.mapping.slice(h).map(m+n),d.mapping.slice(h).map(y+n),new s.Ji(o.rows[v-u],0,0))}p(),d.setSelection(new $(d.doc.resolve(n+a.positionAt(u,c,i)),d.doc.resolve(n+a.positionAt(f-1,l-1,i)))),e(d)}var lt=(0,c.K)({ArrowLeft:dt("horiz",-1),ArrowRight:dt("horiz",1),ArrowUp:dt("vert",
21-1),ArrowDown:dt("vert",1),"Shift-ArrowLeft":ht("horiz",-1),"Shift-ArrowRight":ht("horiz",1),"Shift-ArrowUp":ht("vert",-1),"Shift-ArrowDown":ht("vert",1),Backspace:ot,"Mod-Backspace":ot,Delete:ot,"Mod-Delete":ot});function ft(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function dt(t,e){return function(n,r,o){if(!o)return!1;var i=n.selection;if(i instanceof $)return ft(n,r,a.LN.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;var s=yt(o,t,e);if(null==s)return!1;if("horiz"==t)return ft(n,r,a.LN.near(n.doc.resolve(i.head+e),e));var u,c=n.doc.resolve(s),l=L(c,t,e);return u=l?a.LN.near(l,1):e<0?a.LN.near(n.doc.resolve(c.before(-1)),-1):a.LN.near(n.doc.resolve(c.after(-1)),1),ft(n,r,u)}}function ht(t,e){return function(n,r,o){if(!o)return!1;var i,a=n.selection;if(a instanceof $)i=a;else{var s=yt(o,t,e);if(null==s)return!1;i=new $(n.doc.resolve(s))}var u=L(i.$headCell,t,e);return!!u&&ft(n,r,new $(i.$anchorCell,u))}}function pt(t,e){var n=N(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new $(n))),!0)}function vt(t,e,n){if(!F(t.state))return!1;var r=it(n),o=t.state.selection;if(o instanceof $){r||(r={width:1,height:1,rows:[s.FK.from(at(O(t.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),u=E.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=function(t,e,n){var r=t.width,o=t.height,i=t.rows;if(r!=e){for(var a=[],u=[],c=0;c<i.length;c++){for(var l=i[c],f=[],d=a[c]||0,h=0;d<e;h++){var p=l.child(h%l.childCount);d+p.attrs.colspan>e&&(p=p.type.createChecked(I(p.attrs,p.attrs.colspan,d+p.attrs.colspan-e),p.content)),f.push(p),d+=p.attrs.colspan;for(var v=1;v<p.attrs.rowspan;v++)a[c+v]=(a[c+v]||0)+p.attrs.colspan}u.push(s.FK.from(f))}i=u,r=e}if(o!=n){for(var m=[],g=0,b=0;g<n;g++,b++){for(var k=[],w=i[b%o],D=0;D<w.childCount;D++){var C=w.child(D);g+C.attrs.rowspan>n&&(C=C.type.create(y(y({},C.attrs),{},{rowspan:Math.max(1,n-C.attrs.rowspan)}),C.content)),k.push(C)}m.push(s.FK.from(k))}i=m,o=n}return{width:r,height:o,rows:i}}(r,u.right-u.left,u.bottom-u.top),ct(t.state,t.dispatch,a,u,r),!0}if(r){var c=R(t.state),l=c.start(-1);return ct(t.state,t.dispatch,l,E.get(c.node(-1)).findCell(c.pos-l),r),!0}return!1}function mt(t,e){var n;if(0==e.button&&!e.ctrlKey&&!e.metaKey){var r,o=gt(t,e.target);if(e.shiftKey&&t.state.selection instanceof $)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&null!=(r=N(t.state.selection.$anchor))&&(null===(n=bt(t,e))||void 0===n?void 0:n.pos)!=r.pos)i(r,e),e.preventDefault();else if(!o)return;t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",s)}function i(e,n){var r=bt(t,n),o=null==T.getState(t.state);if(!r||!j(e,r)){if(!o)return;r=e}var i=new $(e,r);if(o||!t.state.selection.eq(i)){var a=t.state.tr.setSelection(i);o&&a.setMeta(T,e.pos),t.dispatch(a)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",s),null!=T.getState(t.state)&&t.dispatch(t.state.tr.setMeta(T,-1))}function s(n){var r,s=n,u=T.getState(t.state);if(null!=u)r=t.state.doc.resolve(u);else if(gt(t,s.target)!=o&&!(r=bt(t,e)))return a();r&&i(r,s)}}function yt(t,e,n){if(!(t.state.selection instanceof a.U3))return null;for(var r=t.state.selection.$head,o=r.depth-1;o>=0;o--){var i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var s=r.before(o),u="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?s:null}}return null}function gt(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e;return null}function bt(t,e){var n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return null;var r=n.inside,o=n.pos;return r>=0&&N(t.state.doc.resolve(r))||N(t.state.doc.resolve(o))}var kt=function(){return w((function t(e,n){b(this,t),this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width","".concat(n,"px")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),wt(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}),[{key:"update",value:function(t){return t.type==this.node.type&&(this.node=t,wt(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}},{key:"ignoreMutation",value:function(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}}])}();function wt(t,e,n,r,o,i){var a=0,s=!0,u=e.firstChild,c=t.firstChild;if(c){for(var l=0,f=0;l<c.childCount;l++)for(var d=c.child(l).attrs,h=d.colspan,p=d.colwidth,v=0;v<h;v++,f++){var m=o==f?i:p&&p[v],y=m?m+"px":"";if(a+=m||r,m||(s=!1),u)u.style.width!=y&&(u.style.width=y),u=u.nextSibling;else{var g=document.createElement("col");g.style.width=y,e.appendChild(g)}}for(;u;){var b,k=u.nextSibling;null===(b=u.parentNode)||void 0===b||b.removeChild(u),u=k}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var Dt=new a.hs("tableColumnResizing");function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.handleWidth,n=void 0===e?5:e,r=t.cellMinWidth,o=void 0===r?25:r,i=t.defaultCellMinWidth,s=void 0===i?100:i,c=t.View,l=void 0===c?kt:c,f=t.lastColumnResizable,d=void 0===f||f,h=new a.k_({key:Dt,state:{init:function(t,e){var n,r=null===(n=h.spec)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.nodeViews,o=O(e.schema).table.name;return l&&r&&(r[o]=function(t,e){return new l(t,s,e)}),new St(-1,!1)},apply:function(t,e){return e.apply(t)}},props:{attributes:function(t){var e=Dt.getState(t);return e&&e.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:function(t,e){!function(t,e,n,r){if(!t.editable)return;var o=Dt.getState(t.state);if(!o)return;if(!o.dragging){var i=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),a=-1;if(i){var s=i.getBoundingClientRect(),u=s.left,c=s.right;e.clientX-u<=n?a=At(t,e,"left",n):c-e.clientX<=n&&(a=At(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&-1!==a){var l=t.state.doc.resolve(a),f=l.node(-1),d=E.get(f),h=l.start(-1);
21if(d.colCount(l.pos-h)+l.nodeAfter.attrs.colspan-1==d.width-1)return}xt(t,a)}}}(t,e,n,d)},mouseleave:function(t){!function(t){if(!t.editable)return;var e=Dt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&xt(t,-1)}(t)},mousedown:function(t,e){!function(t,e,n,r){var o;if(!t.editable)return!1;var i=null!==(o=t.dom.ownerDocument.defaultView)&&void 0!==o?o:window,a=Dt.getState(t.state);if(!a||-1==a.activeHandle||a.dragging)return!1;var s=t.state.doc.nodeAt(a.activeHandle),u=function(t,e,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=t.domAtPos(e),s=a.node.childNodes[a.offset].offsetWidth,u=r;if(o)for(var c=0;c<r;c++)o[c]&&(s-=o[c],u--);return s/u}(t,a.activeHandle,s.attrs);function c(e){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",l);var r=Dt.getState(t.state);(null==r?void 0:r.dragging)&&(!function(t,e,n){for(var r=t.state.doc.resolve(e),o=r.node(-1),i=E.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr,c=0;c<i.height;c++){var l=c*i.width+s;if(!c||i.map[l]!=i.map[l-i.width]){var f=i.map[l],d=o.nodeAt(f).attrs,h=1==d.colspan?0:s-i.colCount(f);if(!d.colwidth||d.colwidth[h]!=n){var p=d.colwidth?d.colwidth.slice():Ot(d.colspan);p[h]=n,u.setNodeMarkup(a+f,null,y(y({},d),{},{colwidth:p}))}}}u.docChanged&&t.dispatch(u)}(t,r.activeHandle,Et(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(Dt,{setDragging:null})))}function l(e){if(!e.which)return c(e);var o=Dt.getState(t.state);if(o&&o.dragging){var i=Et(o.dragging,e,n);Mt(t,o.activeHandle,i,r)}}t.dispatch(t.state.tr.setMeta(Dt,{setDragging:{startX:e.clientX,startWidth:u}})),Mt(t,a.activeHandle,u,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",l),e.preventDefault()}(t,e,o,s)}},decorations:function(t){var e=Dt.getState(t);if(e&&e.activeHandle>-1)return function(t,e){var n=[],r=t.doc.resolve(e),o=r.node(-1);if(!o)return u.zF.empty;for(var i=E.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,c=0;c<i.height;c++){var l=s+c*i.width;if(!(s!=i.width-1&&i.map[l]==i.map[l+1]||0!=c&&i.map[l]==i.map[l-i.width])){var f,d=i.map[l],h=a+d+o.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(null===(f=Dt.getState(t))||void 0===f?void 0:f.dragging)&&n.push(u.NZ.node(a+d,a+d+o.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(u.NZ.widget(h,p))}}return u.zF.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return h}var St=function(){function t(e,n){b(this,t),this.activeHandle=e,this.dragging=n}return w(t,[{key:"apply",value:function(e){var n=this,r=e.getMeta(Dt);if(r&&null!=r.setHandle)return new t(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new t(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){var o=e.mapping.map(n.activeHandle,-1);return B(e.doc.resolve(o))||(o=-1),new t(o,n.dragging)}return n}}])}();function At(t,e,n,r){var o="right"==n?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;var a=i.pos,s=N(t.state.doc.resolve(a));if(!s)return-1;if("right"==n)return s.pos;var u=E.get(s.node(-1)),c=s.start(-1),l=u.map.indexOf(s.pos-c);return l%u.width==0?-1:c+u.map[l-1]}function Et(t,e,n){var r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function xt(t,e){t.dispatch(t.state.tr.setMeta(Dt,{setHandle:e}))}function Mt(t,e,n,r){for(var o=t.state.doc.resolve(e),i=o.node(-1),a=o.start(-1),s=E.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,u=t.domAtPos(o.start(-1)).node;u&&"TABLE"!=u.nodeName;)u=u.parentNode;u&&wt(i,u.firstChild,u,r,s,n)}function Ot(t){return Array(t).fill(0)}function Tt(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).allowTableNodeSelection,e=void 0!==t&&t;return new a.k_({key:T,state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(T);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;var r=t.mapping.mapResult(e),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:V,handleDOMEvents:{mousedown:mt},createSelectionBetween:function(t){return null!=T.getState(t.state)?t.state.selection:null},handleTripleClick:pt,handleKeyDown:lt,handlePaste:vt},appendTransaction:function(t,n,r){return function(t,e,n){var r,o,i=(e||t).selection,s=(e||t).doc;if(i instanceof a.nh&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=$.create(s,i.from);else if("row"==o){var u=s.resolve(i.from+1);r=$.rowSelection(u,u)}else if(!n){var c=E.get(i.node),l=i.from+1,f=l+c.map[c.width*c.height-1];r=$.create(s,l+1,f)}}else i instanceof a.U3&&function(t){var e=t.$from,n=t.$to;if(e.pos==n.pos||e.pos<n.pos-6)return!1;for(var r=e.pos,o=n.pos,i=e.depth;i>=0&&!(e.after(i+1)<e.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(e.node(i).type.spec.tableRole)}(i)?r=a.U3.create(s,i.from):i instanceof a.U3&&function(t){for(var e,n,r=t.$from,o=t.$to,i=r.depth;i>0;
21i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){e=a;break}}for(var s=o.depth;s>0;s--){var u=o.node(s);if("cell"===u.type.spec.tableRole||"header_cell"===u.type.spec.tableRole){n=u;break}}return e!==n&&0===o.parentOffset}(i)&&(r=a.U3.create(s,i.$from.start(),i.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(r,W(r,n),e)}})}function Nt(t){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(t)}function Ft(t){return function(t){if(Array.isArray(t))return Lt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||jt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Pt(r.key),r)}}function Pt(t){var e=function(t,e){if("object"!=Nt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Nt(e)?e:e+""}function Bt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||jt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(t,e){if(t){if("string"==typeof t)return Lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(t,e):void 0}}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var It=i.bP.create({name:"tableCell",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(t){var e,n,r=t.getAttribute("colwidth"),o=r?r.split(",").map((function(t){return parseInt(t,10)})):null;if(!o){var i=null==(e=t.closest("table"))?void 0:e.querySelectorAll("colgroup > col"),a=Array.from((null==(n=t.parentElement)?void 0:n.children)||[]).indexOf(t);if(a&&a>-1&&i&&i[a]){var s=i[a].getAttribute("width");return s?[parseInt(s,10)]:null}}return o}}}},tableRole:"cell",isolating:!0,parseHTML:function(){return[{tag:"td"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["td",(0,i.KV)(this.options.HTMLAttributes,e),0]}}),zt=i.bP.create({name:"tableHeader",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(t){var e=t.getAttribute("colwidth");return e?e.split(",").map((function(t){return parseInt(t,10)})):null}}}},tableRole:"header_cell",isolating:!0,parseHTML:function(){return[{tag:"th"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["th",(0,i.KV)(this.options.HTMLAttributes,e),0]}}),$t=i.bP.create({name:"tableRow",addOptions:function(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:function(){return[{tag:"tr"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["tr",(0,i.KV)(this.options.HTMLAttributes,e),0]}});function Ht(t,e){return e?["width","".concat(Math.max(e,t),"px")]:["min-width","".concat(t,"px")]}function Vt(t,e,n,r,o,i){var a,s=0,u=!0,c=e.firstChild,l=t.firstChild;if(null!==l)for(var f=0,d=0;f<l.childCount;f+=1)for(var h=l.child(f).attrs,p=h.colspan,v=h.colwidth,m=0;m<p;m+=1,d+=1){var y=o===d?i:v&&v[m],g=y?"".concat(y,"px"):"";if(s+=y||r,y||(u=!1),c){if(c.style.width!==g){var b=Bt(Ht(r,y),2),k=b[0],w=b[1];c.style.setProperty(k,w)}c=c.nextSibling}else{var D=document.createElement("col"),C=Bt(Ht(r,y),2),S=C[0],A=C[1];D.style.setProperty(S,A),e.appendChild(D)}}for(;c;){var E=c.nextSibling;null==(a=c.parentNode)||a.removeChild(c),c=E}var x=t.attrs.style&&"string"==typeof t.attrs.style&&/\bwidth\s*:/i.test(t.attrs.style);u&&!x?(n.style.width="".concat(s,"px"),n.style.minWidth=""):(n.style.width="",n.style.minWidth="".concat(s,"px"))}var _t=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Vt(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))},(e=[{key:"update",value:function(t){return t.type===this.node.type&&(this.node=t,Vt(t,this.colgroup,this.table,this.cellMinWidth),!0)}},{key:"ignoreMutation",value:function(t){var e=t.target,n=this.dom.contains(e),r=this.contentDOM.contains(e);return!(!n||r||"attributes"!==t.type&&"childList"!==t.type&&"characterData"!==t.type)}}])&&Rt(t.prototype,e),n&&Rt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function Kt(t,e){return e?t.createChecked(null,e):t.createAndFill()}function Wt(t,e,n,r,o){for(var i=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;var e={};
21return Object.keys(t.nodes).forEach((function(n){var r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)})),t.cached.tableNodeTypes=e,e}(t),a=[],s=[],u=0;u<n;u+=1){var c=Kt(i.cell,o);if(c&&s.push(c),r){var l=Kt(i.header_cell,o);l&&a.push(l)}}for(var f=[],d=0;d<e;d+=1)f.push(i.row.createChecked(null,r&&0===d?a:s));return i.table.createChecked(null,f)}var Ut=function(t){var e=t.editor,n=e.state.selection;if(!(n instanceof $))return!1;var r=0,o=(0,i.eL)(n.ranges[0].$from,(function(t){return"table"===t.type.name}));return null==o||o.node.descendants((function(t){if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(r+=1)})),r===n.ranges.length&&(e.commands.deleteTable(),!0)};var Jt=function(t,e){var n,r=null!=(n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).cellLineSeparator)?n:"�";if(!t||!t.content||0===t.content.length)return"";var o=[];t.content.forEach((function(t){var n=[];t.content&&t.content.forEach((function(t){var o="";t.content&&Array.isArray(t.content)&&t.content.length>1?o=t.content.map((function(t){return e.renderChildren(t)})).join(r):o=t.content?e.renderChildren(t.content):"";var i=(o||"").replace(/\s+/g," ").trim(),a="tableHeader"===t.type;n.push({text:i,isHeader:a})})),o.push(n)}));var i=o.reduce((function(t,e){return Math.max(t,e.length)}),0);if(0===i)return"";var a=new Array(i).fill(0);o.forEach((function(t){for(var e,n=0;n<i;n+=1){var r=((null==(e=t[n])?void 0:e.text)||"").length;r>a[n]&&(a[n]=r),a[n]<3&&(a[n]=3)}}));var s=function(t,e){return t+" ".repeat(Math.max(0,e-t.length))},u=o[0],c=u.some((function(t){return t.isHeader})),l="\n",f=new Array(i).fill(0).map((function(t,e){return c&&u[e]&&u[e].text||""}));return l+="| ".concat(f.map((function(t,e){return s(t,a[e])})).join(" | ")," |\n"),l+="| ".concat(a.map((function(t){return"-".repeat(Math.max(3,t))})).join(" | ")," |\n"),(c?o.slice(1):o).forEach((function(t){l+="| ".concat(new Array(i).fill(0).map((function(e,n){return s(t[n]&&t[n].text||"",a[n])})).join(" | ")," |\n")})),l},qt=i.bP.create({name:"table",addOptions:function(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:_t,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:function(){return[{tag:"table"}]},renderHTML:function(t){var e=t.node,n=t.HTMLAttributes,r=function(t,e,n,r){var o=0,i=!0,a=[],s=t.firstChild;if(!s)return{};for(var u=0,c=0;u<s.childCount;u+=1)for(var l=s.child(u).attrs,f=l.colspan,d=l.colwidth,h=0;h<f;h+=1,c+=1){var p=n===c?r:d&&d[h];o+=p||e,p||(i=!1);var v=Bt(Ht(e,p),2),m=v[0],y=v[1];a.push(["col",{style:"".concat(m,": ").concat(y)}])}var g=i?"".concat(o,"px"):"",b=i?"":"".concat(o,"px");return{colgroup:["colgroup",{}].concat(a),tableWidth:g,tableMinWidth:b}}(e,this.options.cellMinWidth),o=r.colgroup,a=r.tableWidth,s=r.tableMinWidth,u=n.style;var c=["table",(0,i.KV)(this.options.HTMLAttributes,n,{style:u||(a?"width: ".concat(a):"min-width: ".concat(s))}),o,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},c]:c},parseMarkdown:function(t,e){var n=[];if(t.header){var r=[];t.header.forEach((function(t){r.push(e.createNode("tableHeader",{},[{type:"paragraph",content:e.parseInline(t.tokens)}]))})),n.push(e.createNode("tableRow",{},r))}return t.rows&&t.rows.forEach((function(t){var r=[];t.forEach((function(t){r.push(e.createNode("tableCell",{},[{type:"paragraph",content:e.parseInline(t.tokens)}]))})),n.push(e.createNode("tableRow",{},r))})),e.createNode("table",void 0,n)},renderMarkdown:function(t,e){return Jt(t,e)},addCommands:function(){return{insertTable:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.rows,n=void 0===e?3:e,r=t.cols,o=void 0===r?3:r,i=t.withHeaderRow,s=void 0===i||i;return function(t){var e=t.tr,r=t.dispatch,i=Wt(t.editor.schema,n,o,s);if(r){var u=e.selection.from+1;e.replaceSelectionWith(i).scrollIntoView().setSelection(a.U3.near(e.doc.resolve(u)))}return!0}},addColumnBefore:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t);e(J(t.tr,n,n.left))}return!0}(t.state,t.dispatch)}},addColumnAfter:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t);e(J(t.tr,n,n.right))}return!0}(t.state,t.dispatch)}},deleteColumn:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;q(r,n,o),o!=n.left;o--){var i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=E.get(i)}e(r)}return!0}(t.state,t.dispatch)}},addRowBefore:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t);e(Y(t.tr,n,n.top))}return!0}(t.state,t.dispatch)}},addRowAfter:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t);e(Y(t.tr,n,n.bottom))}return!0}(t.state,t.dispatch)}},deleteRow:function(){return function(t){return function(t,e){if(!F(t))return!1;if(e){var n=U(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;G(r,n,o),o!=n.top;o--){var i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=E.get(n.table)}e(r)}return!0}(t.state,t.dispatch)}},deleteTable:function(){return function(t){return function(t,e){for(var n=t.selection.$anchor,r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(t.state,t.dispatch)}},mergeCells:function(){return function(t){return Z(t.state,t.dispatch)}},splitCell:function(){return function(t){return Q(t.state,t.dispatch)}},toggleHeaderColumn:function(){return function(t){var e=t.state,n=t.dispatch;return et("column")(e,n)}},toggleHeaderRow:function(){return function(t){var e=t.state,n=t.dispatch;return et("row")(e,n)}},toggleHeaderCell:function(){return function(t){var e=t.state,n=t.dispatch;return nt(e,n)}},mergeOrSplit:function(){return function(t){var e=t.state,n=t.dispatch;return!!Z(e,n)||Q(e,n)}},setCellAttribute:function(t,e){return function(n){var r=n.state,o=n.dispatch;return function(t,e){return function(n,r){if(!F(n))return!1;var o=R(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){var i=n.tr;n.selection instanceof $?n.selection.forEachCell((function(n,r){n.attrs[t]!==e&&i.setNodeMarkup(r,null,y(y({},n.attrs),{},g({},t,e)))})):i.setNodeMarkup(o.pos,null,y(y({},o.nodeAfter.attrs),{},g({},t,e))),r(i)}return!0}}(t,e)(r,o)}},goToNextCell:function(){return function(t){var e=t.state,n=t.dispatch;return rt(1)(e,n)}},goToPreviousCell:function(){return function(t){var e=t.state,n=t.dispatch;return rt(-1)(e,n)}},fixTables:function(){return function(t){var e=t.state;return t.dispatch&&W(e),!0}},setCellSelection:function(t){return function(e){var n=e.tr;if(e.dispatch){var r=$.create(n.doc,t.anchorCell,t.headCell);n.setSelection(r)}return!0}}}},addKeyboardShortcuts:function(){var t=this;return{Tab:function(){return!!t.editor.commands.goToNextCell()||!!t.editor.can().addRowAfter()&&t.editor.chain().addRowAfter().goToNextCell().run()},"Shift-Tab":function(){return t.editor.commands.goToPreviousCell()},Backspace:Ut,"Mod-Backspace":Ut,Delete:Ut,"Mod-Delete":Ut}},addProseMirrorPlugins:function(){var t=this.options.resizable&&this.editor.isEditable;
21return[].concat(Ft(t?[Ct({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[]),[Tt({allowTableNodeSelection:this.options.allowTableNodeSelection})])},extendNodeSchema:function(t){var e={name:t.name,options:t.options,storage:t.storage};return{tableRole:(0,i.gk)((0,i.iI)(t,"tableRole",e))}}}),Yt=i.YY.create({name:"tableKit",addExtensions:function(){var t=[];return!1!==this.options.table&&t.push(qt.configure(this.options.table)),!1!==this.options.tableCell&&t.push(It.configure(this.options.tableCell)),!1!==this.options.tableHeader&&t.push(zt.configure(this.options.tableHeader)),!1!==this.options.tableRow&&t.push($t.configure(this.options.tableRow)),t}})},53708:function(t,e,n){n.d(e,{n:function(){return r}});var r=n(51222).YY.create({name:"textAlign",addOptions:function(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes:function(){var t=this;return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:function(e){var n=e.style.textAlign;return t.options.alignments.includes(n)?n:t.options.defaultAlignment},renderHTML:function(t){return t.textAlign?{style:"text-align: ".concat(t.textAlign)}:{}}}}}]},addCommands:function(){var t=this;return{setTextAlign:function(e){return function(n){var r=n.commands;return!!t.options.alignments.includes(e)&&t.options.types.map((function(t){return r.updateAttributes(t,{textAlign:e})})).some((function(t){return t}))}},unsetTextAlign:function(){return function(e){var n=e.commands;return t.options.types.map((function(t){return n.resetAttributes(t,"textAlign")})).some((function(t){return t}))}},toggleTextAlign:function(e){return function(n){var r=n.editor,o=n.commands;return!!t.options.alignments.includes(e)&&(r.isActive({textAlign:e})?o.unsetTextAlign():o.setTextAlign(e))}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-l":function(){return t.editor.commands.setTextAlign("left")},"Mod-Shift-e":function(){return t.editor.commands.setTextAlign("center")},"Mod-Shift-r":function(){return t.editor.commands.setTextAlign("right")},"Mod-Shift-j":function(){return t.editor.commands.setTextAlign("justify")}}}})},47592:function(t,e,n){n.d(e,{xJ:function(){return s}});var r=n(51222);function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return!t.children.length||e>20||Array.from(t.children).forEach((function(t){"SPAN"===t.tagName?n.push(t):t.children.length&&n.push.apply(n,o(a(t,e+1)))})),n},s=r.CU.create({name:"textStyle",priority:101,addOptions:function(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML:function(){var t=this;return[{tag:"span",consuming:!1,getAttrs:function(e){return!!e.hasAttribute("style")&&(t.options.mergeNestedSpanStyles&&function(t){if(t.children.length){var e=a(t);e&&e.forEach((function(t){var e,n,r=t.getAttribute("style"),o=null==(n=null==(e=t.parentElement)?void 0:e.closest("span"))?void 0:n.getAttribute("style");t.setAttribute("style","".concat(o,";").concat(r))}))}}(e),{})}}]},renderHTML:function(t){var e=t.HTMLAttributes;return["span",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands:function(){var t=this;return{toggleTextStyle:function(e){return function(n){return n.commands.toggleMark(t.name,e)}},removeEmptyTextStyle:function(){return function(e){var n=e.tr,r=n.selection;return n.doc.nodesBetween(r.from,r.to,(function(e,r){if(e.isTextblock)return!0;e.marks.filter((function(e){return e.type===t.type})).some((function(t){return Object.values(t.attrs).some((function(t){return!!t}))}))||n.removeMark(r,r+e.nodeSize,t.type)})),!0}}}}}),u=r.YY.create({name:"backgroundColor",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:function(t){var e,n=t.getAttribute("style");if(n)for(var r=n.split(";").map((function(t){return t.trim()}
21)).filter(Boolean),o=r.length-1;o>=0;o-=1){var i=r[o].split(":");if(i.length>=2){var a=i[0].trim().toLowerCase(),s=i.slice(1).join(":").trim();if("background-color"===a)return s.replace(/['"]+/g,"")}}return null==(e=t.style.backgroundColor)?void 0:e.replace(/['"]+/g,"")},renderHTML:function(t){return t.backgroundColor?{style:"background-color: ".concat(t.backgroundColor)}:{}}}}}]},addCommands:function(){return{setBackgroundColor:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{backgroundColor:t}).run()}},unsetBackgroundColor:function(){return function(t){return(0,t.chain)().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}}}),c=r.YY.create({name:"color",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:function(t){var e,n=t.getAttribute("style");if(n)for(var r=n.split(";").map((function(t){return t.trim()})).filter(Boolean),o=r.length-1;o>=0;o-=1){var i=r[o].split(":");if(i.length>=2){var a=i[0].trim().toLowerCase(),s=i.slice(1).join(":").trim();if("color"===a)return s.replace(/['"]+/g,"")}}return null==(e=t.style.color)?void 0:e.replace(/['"]+/g,"")},renderHTML:function(t){return t.color?{style:"color: ".concat(t.color)}:{}}}}}]},addCommands:function(){return{setColor:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{color:t}).run()}},unsetColor:function(){return function(t){return(0,t.chain)().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}}}),l=r.YY.create({name:"fontFamily",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:function(t){return t.style.fontFamily},renderHTML:function(t){return t.fontFamily?{style:"font-family: ".concat(t.fontFamily)}:{}}}}}]},addCommands:function(){return{setFontFamily:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{fontFamily:t}).run()}},unsetFontFamily:function(){return function(t){return(0,t.chain)().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}}}),f=r.YY.create({name:"fontSize",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:function(t){return t.style.fontSize},renderHTML:function(t){return t.fontSize?{style:"font-size: ".concat(t.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:t}).run()}},unsetFontSize:function(){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),d=r.YY.create({name:"lineHeight",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:function(t){return t.style.lineHeight},renderHTML:function(t){return t.lineHeight?{style:"line-height: ".concat(t.lineHeight)}:{}}}}}]},addCommands:function(){return{setLineHeight:function(t){return function(e){return(0,e.chain)().setMark("textStyle",{lineHeight:t}).run()}},unsetLineHeight:function(){return function(t){return(0,t.chain)().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}}}});r.YY.create({name:"textStyleKit",addExtensions:function(){var t=[];return!1!==this.options.backgroundColor&&t.push(u.configure(this.options.backgroundColor)),!1!==this.options.color&&t.push(c.configure(this.options.color)),!1!==this.options.fontFamily&&t.push(l.configure(this.options.fontFamily)),!1!==this.options.fontSize&&t.push(f.configure(this.options.fontSize)),!1!==this.options.lineHeight&&t.push(d.configure(this.options.lineHeight)),!1!==this.options.textStyle&&t.push(s.configure(this.options.textStyle)),t}})},45533:function(t,e,n){n.d(e,{QO:function(){return ot},vR:function(){return it},Or:function(){return at},JU:function(){return ut},lb:function(){return ct}});var r=n(51222),o=n(17386),i=n(441);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,u(r.key),r)}}function u(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==a(e)?e:e+""}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new o.k_({view:function(e){return new l(e,t)}})}var l=function(){return t=function t(e,n){var r,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){o[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))},(e=[{key:"destroy",value:function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,a=o.height/r.offsetHeight;if(n){var s=e.nodeBefore,u=e.nodeAfter;if(s||u){var c=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(c){var l=c.getBoundingClientRect(),f=s?l.bottom:l.top;s&&u&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);var d=this.width/2*a;t={left:l.left,right:l.right,top:f-d,bottom:f+d}}}}if(!t){var h=this.editorView.coordsAtPos(this.cursorPos),p=this.width/2*i;t={left:h.left-p,right:h.left+p,top:h.top,bottom:h.bottom}}var v,m,y=this.editorView.dom.offsetParent;if(this.element||(this.element=y.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!y||y==document.body&&"static"==getComputedStyle(y).position)v=-pageXOffset,m=-pageYOffset;else{var g=y.getBoundingClientRect(),b=g.width/y.offsetWidth,k=g.height/y.offsetHeight;v=g.left-y.scrollLeft*b,m=g.top-y.scrollTop*k}this.element.style.left=(t.left-v)/i+"px",this.element.style.top=(t.top-m)/a+"px",this.element.style.width=(t.right-t.left)/i+"px",this.element.style.height=(t.bottom-t.top)/a+"px"}},{key:"scheduleRemoval",value:function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)}},{key:"dragover",value:function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,e,t):r;if(e&&!o){var a=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var s=(0,i.Um)(this.editorView.state.doc,a,this.editorView.dragging.slice);null!=s&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}])&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),f=n(33822),d=n(28591),h=n(42959);function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}function y(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==p(e)?e:e+""}function b(t,e,n){return e=w(e),function(t,e){if(e&&("object"==p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(e,n||[],w(t).constructor):e.apply(t,n))}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(k=function(){return!!t})()}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}var C=function(t){function e(t){return v(this,e),b(this,e,[t,t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&D(t,e)}(e,t),y(e,[{key:"map",value:function(t,n){var r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):o.LN.near(r)}},{key:"content",value:function(){return h.Ji.empty}},{key:"eq",value:function(t){return t instanceof e&&t.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new S(this.anchor)}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))}},{key:"valid",value:function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),r=t.node(e);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||A(o.type))return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||A(o.type))return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t:for(;;){if(!r&&e.valid(t))return t;for(var i=t.pos,a=null,s=t.depth;;s--){var u=t.node(s);if(n>0?t.indexAfter(s)<u.childCount:t.index(s)>0){a=u.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;i+=n;var c=t.doc.resolve(i);if(e.valid(c))return c}for(;;){var l=n>0?a.firstChild:a.lastChild;if(!l){if(a.isAtom&&!a.isText&&!o.nh.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue t}break}a=l,i+=n;var f=t.doc.resolve(i);if(e.valid(f))return f}return null}}}])}(o.LN);C.prototype.visible=!1,C.findFrom=C.findGapCursorFrom,o.LN.jsonID("gapcursor",C);var S=function(){function t(e){v(this,t),this.pos=e}return y(t,[{key:"map",value:function(e){return new t(e.map(this.pos))}},{key:"resolve",value:function(t){var e=t.resolve(this.pos);return C.valid(e)?new C(e):o.LN.near(e)}}])}();function A(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}var E=(0,d.K)({ArrowLeft:x("horiz",-1),ArrowRight:x("horiz",1),ArrowUp:x("vert",-1),ArrowDown:x("vert",1)});function x(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){var a=t.selection,s=e>0?a.$to:a.$from,u=a.empty;if(a instanceof o.U3){if(!i.endOfTextblock(n)||0==s.depth)return!1;u=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=C.findGapCursorFrom(s,e,u);return!!c&&(r&&r(t.tr.setSelection(new C(c))),!0)}}function M(t,e,n){if(!t||!t.editable)return!1;var r=t.state.doc.resolve(e);if(!C.valid(r))return!1;var i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&o.nh.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new C(r))),!0)}function O(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof C))return!1;var n=t.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;for(var i=h.FK.empty,a=r.length-1;a>=0;a--)i=h.FK.from(r[a].createAndFill(null,i));var s=t.state.tr.replace(n.pos,n.pos,new h.Ji(i,0,0));
vendor: 4,557 bytes, line 21
21return s.setSelection(o.U3.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function T(t){if(!(t.selection instanceof C))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",f.zF.create(t.doc,[f.NZ.widget(t.selection.head,e,{key:"gapcursor"})])}var N=200,F=function(){};F.prototype.append=function(t){return t.length?(t=F.from(t),!this.length&&t||t.length<N&&this.leafAppend(t)||this.length<N&&t.leafPrepend(this)||this.appendInner(t)):this},F.prototype.prepend=function(t){return t.length?F.from(t).append(this):this},F.prototype.appendInner=function(t){return new P(this,t)},F.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?F.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},F.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},F.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},F.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},F.from=function(t){return t instanceof F?t:t&&t.length?new R(t):F.empty};var R=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o<n;o++)if(!1===t(this.values[o],r+o))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var o=e-1;o>=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=N)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=N)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(F);F.empty=new R([]);var P=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var o=this.left.length;return!(e<o&&!1===this.left.forEachInner(t,e,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(t,Math.min(e,o),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(F),B=F;function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$(r.key),r)}}function z(t,e,n){return e&&I(t.prototype,e),n&&I(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function $(t){var e=function(t,e){if("object"!=j(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=j(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==j(e)?e:e+""}var H=function(){function t(e,n){L(this,t),this.items=e,this.eventCount=n}return z(t,[{key:"popEvent",value:function(e,n){var r=this;if(0==this.eventCount)return null;for(var o,i,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}n&&(o=this.remapping(a,this.items.length),i=o.maps.length);var s,u,c=e.tr,l=[],f=[];return this.items.forEach((function(e,n){if(!e.step)return o||(o=r.remapping(a,n+1),i=o.maps.length),i--,void f.push(e);if(o){f.push(new V(e.map));var d,h=e.step.map(o.slice(i));h&&c.maybeStep(h).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],l.push(new V(d,void 0,void 0,l.length+f.length))),i--,d&&o.appendMap(d,i)}else c.maybeStep(e.step);return e.selection?(s=o?e.selection.map(o.slice(i)):e.selection,u=new t(r.items.slice(0,a).append(f.reverse().concat(l)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:u,transform:c,selection:s}}},{key:"addTransform",value:function(e,n,r,o){for(var i=[],a=this.eventCount,s=this.items,u=!o&&s.length?s.get(s.length-1):null,c=0;c<e.steps.length;c++){var l,f=e.steps[c].invert(e.docs[c]),d=new V(e.mapping.maps[c],f,n);(l=u&&u.merge(d))&&(d=l,c?i.pop():s=s.slice(0,s.length-1)),i.push(d),n&&(a++,n=void 0),o||(u=d)}var h,p,v,m=a-r.depth;return m>
21K&&(p=m,(h=s).forEach((function(t,e){if(t.selection&&0==p--)return v=e,!1})),s=h.slice(v),a-=m),new t(s.append(i),a)}},{key:"remapping",value:function(t,e){var n=new i.X9;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,o)}),t,e),n}},{key:"addMaps",value:function(e){return 0==this.eventCount?this:new t(this.items.append(e.map((function(t){return new V(t)}))),this.eventCount)}},{key:"rebased",value:function(e,n){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-n),i=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),o);var u=n;this.items.forEach((function(t){var n=i.getMirror(--u);if(null!=n){a=Math.min(a,n);var o=i.maps[n];if(t.step){var c=e.steps[n].invert(e.docs[n]),l=t.selection&&t.selection.map(i.slice(u+1,n));l&&s++,r.push(new V(o,c,l))}else r.push(new V(o))}}),o);for(var c=[],l=n;l<a;l++)c.push(new V(i.maps[l]));var f=new t(this.items.slice(0,o).append(c).append(r),s);return f.emptyItemCount()>500&&(f=f.compress(this.items.length-r.length)),f}},{key:"emptyItemCount",value:function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t}},{key:"compress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((function(t,a){if(a>=e)o.push(t),t.selection&&i++;else if(t.step){var s=t.step.map(n.slice(r)),u=s&&s.getMap();if(r--,u&&n.appendMap(u,r),s){var c=t.selection&&t.selection.map(n.slice(r));c&&i++;var l,f=new V(u.invert(),s,c),d=o.length-1;(l=o.length&&o[d].merge(f))?o[d]=l:o.push(f)}}else t.map&&r--}),this.items.length,0),new t(B.from(o.reverse()),i)}}])}();H.empty=new H(B.empty,0);var V=function(){function t(e,n,r,o){L(this,t),this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}return z(t,[{key:"merge",value:function(e){if(this.step&&e.step&&!e.selection){var n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}}])}(),_=z((function t(e,n,r,o,i){L(this,t),this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i})),K=20;function W(t){for(var e=[],n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach((function(t,n,r,o){return e.push(r,o)}));return e}function U(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}var J=!1,q=null;function Y(t){var e=t.plugins;if(q!=e){J=!1,q=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){J=!0;break}}return J}var G=new o.hs("history"),X=new o.hs("closeHistory");function Z(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new o.k_({key:G,state:{init:function(){return new _(H.empty,H.empty,null,0,-1)},apply:function(e,n,r){return function(t,e,n,r){var o,i=n.getMeta(G);if(i)return i.historyState;n.getMeta(X)&&(t=new _(t.done,t.undone,null,0,-1));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(G))return a.getMeta(G).redo?new _(t.done.addTransform(n,void 0,r,Y(e)),t.undone,W(n.mapping.maps),t.prevTime,t.prevComposition):new _(t.done,t.undone.addTransform(n,void 0,r,Y(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new _(t.done.rebased(n,o),t.undone.rebased(n,o),U(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new _(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),U(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);var s=n.getMeta("composition"),u=0==t.prevTime||!a&&t.prevComposition!=s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var o=0;o<e.length;o+=2)t<=e[o+1]&&r>=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=a?U(t.prevRanges,n.mapping):W(n.mapping.maps);return new _(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Y(e)),H.empty,c,n.time,null==s?t.prevComposition:s)}(n,r,e,t)}}
21,config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n=e.inputType,r="historyUndo"==n?tt:"historyRedo"==n?et:null;return!(!r||!t.editable)&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function Q(t,e){return function(n,r){var o=G.getState(n);if(!o||0==(t?o.undone:o.done).eventCount)return!1;if(r){var i=function(t,e,n){var r=Y(e),o=G.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;var a=i.selection.resolve(i.transform.doc),s=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),u=new _(n?s:i.remaining,n?i.remaining:s,null,0,-1);return i.transform.setSelection(a).setMeta(G,{redo:n,historyState:u})}(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}var tt=Q(!1,!0),et=Q(!0,!0);Q(!1,!1),Q(!0,!1);function nt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return rt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}r.YY.create({name:"characterCount",addOptions:function(){return{limit:null,mode:"textSize",textCounter:function(t){return t.length},wordCounter:function(t){return t.split(" ").filter((function(t){return""!==t})).length}}},addStorage:function(){return{characters:function(){return 0},words:function(){return 0}}},onBeforeCreate:function(){var t=this;this.storage.characters=function(e){var n=(null==e?void 0:e.node)||t.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||t.options.mode)){var r=n.textBetween(0,n.content.size,void 0," ");return t.options.textCounter(r)}return n.nodeSize},this.storage.words=function(e){var n=(null==e?void 0:e.node)||t.editor.state.doc,r=n.textBetween(0,n.content.size," "," ");return t.options.wordCounter(r)}},addProseMirrorPlugins:function(){var t=this,e=!1;return[new o.k_({key:new o.hs("characterCount"),appendTransaction:function(n,r,o){if(!e){var i=t.options.limit;if(null!=i&&0!==i){var a=t.storage.characters({node:o.doc});if(a>i){var s=a-i;console.warn("[CharacterCount] Initial content exceeded limit of ".concat(i," characters. Content was automatically trimmed."));var u=o.tr.deleteRange(0,s);return e=!0,u}e=!0}else e=!0}},filterTransaction:function(e,n){var r=t.options.limit;if(!e.docChanged||0===r||null==r)return!0;var o=t.storage.characters({node:n.doc}),i=t.storage.characters({node:e.doc});if(i<=r)return!0;if(o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o)return!1;if(!e.getMeta("paste"))return!1;var a=e.selection.$head.pos,s=a-(i-r),u=a;return e.deleteRange(s,u),!(t.storage.characters({node:e.doc})>r)}})]}});var ot=r.YY.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins:function(){return[c(this.options)]}}),it=(r.YY.create({name:"focus",addOptions:function(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins:function(){var t=this;return[new o.k_({key:new o.hs("focus"),props:{decorations:function(e){var n=e.doc,r=e.selection,o=t.editor,i=o.isEditable,a=o.isFocused,s=r.anchor,u=[];if(!i||!a)return f.zF.create(n,[]);var c=0;"deepest"===t.options.mode&&n.descendants((function(t,e){if(!t.isText){if(!(s>=e&&s<=e+t.nodeSize-1))return!1;c+=1}}));var l=0;return n.descendants((function(e,n){return!e.isText&&(s>=n&&s<=n+e.nodeSize-1&&(l+=1,"deepest"===t.options.mode&&c-l>0||"shallowest"===t.options.mode&&l>1?"deepest"===t.options.mode:void u.push(f.NZ.node(n,n+e.nodeSize,{class:t.options.className}))))})),f.zF.create(n,u)}}})]}}),r.YY.create({name:"gapCursor",addProseMirrorPlugins:function(){return[new o.k_({props:{decorations:T,createSelectionBetween:function(t,e,n){return e.pos==n.pos&&C.valid(n)?new C(n):null}
21,handleClick:M,handleKeyDown:E,handleDOMEvents:{beforeinput:O}}})]},extendNodeSchema:function(t){var e,n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!=(e=(0,r.gk)((0,r.iI)(t,"allowGapCursor",n)))?e:null}}})),at=r.YY.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var t=this;return[new o.k_({key:new o.hs("placeholder"),props:{decorations:function(e){var n=e.doc,o=e.selection,i=t.editor.isEditable||!t.options.showOnlyWhenEditable,a=o.anchor,s=[];if(!i)return null;var u=t.editor.isEmpty;return n.descendants((function(e,n){var o=a>=n&&a<=n+e.nodeSize,i=!e.isLeaf&&(0,r.Op)(e);if((o||!t.options.showOnlyCurrent)&&i){var c=[t.options.emptyNodeClass];u&&c.push(t.options.emptyEditorClass);var l=f.NZ.node(n,n+e.nodeSize,{class:c.join(" "),"data-placeholder":"function"==typeof t.options.placeholder?t.options.placeholder({editor:t.editor,node:e,pos:n,hasAnchor:o}):t.options.placeholder});s.push(l)}return t.options.includeChildren})),f.zF.create(n,s)}}})]}});r.YY.create({name:"selection",addOptions:function(){return{className:"selection"}},addProseMirrorPlugins:function(){var t=this.editor,e=this.options;return[new o.k_({key:new o.hs("selection"),props:{decorations:function(n){return n.selection.empty||t.isFocused||!t.isEditable||(0,r.BQ)(n.selection)||t.view.dragging?null:f.zF.create(n.doc,[f.NZ.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function st(t){var e=t.types,n=t.node;return n&&Array.isArray(e)&&e.includes(n.type)||(null==n?void 0:n.type)===e}var ut=r.YY.create({name:"trailingNode",addOptions:function(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins:function(){var t,e=this,n=new o.hs(this.name),r=this.options.node||(null==(t=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:t.name)||"paragraph",i=Object.entries(this.editor.schema.nodes).map((function(t){return nt(t,2)[1]})).filter((function(t){return(e.options.notAfter||[]).concat(r).includes(t.name)}));return[new o.k_({key:n,appendTransaction:function(t,e,o){var i=o.doc,a=o.tr,s=o.schema,u=n.getState(o),c=i.content.size,l=s.nodes[r];if(u)return a.insert(c,l.create())},state:{init:function(t,e){return!st({node:e.tr.doc.lastChild,types:i})},apply:function(t,e){return t.docChanged?t.getMeta("__uniqueIDTransaction")?e:!st({node:t.doc.lastChild,types:i}):e}}})]}}),ct=r.YY.create({name:"undoRedo",addOptions:function(){return{depth:100,newGroupDelay:500}},addCommands:function(){return{undo:function(){return function(t){var e=t.state,n=t.dispatch;return tt(e,n)}},redo:function(){return function(t){var e=t.state,n=t.dispatch;return et(e,n)}}}},addProseMirrorPlugins:function(){return[Z(this.options)]},addKeyboardShortcuts:function(){var t=this;return{"Mod-z":function(){return t.editor.commands.undo()},"Shift-Mod-z":function(){return t.editor.commands.redo()},"Mod-y":function(){return t.editor.commands.redo()},"Mod-Ñ":function(){return t.editor.commands.undo()},"Shift-Mod-Ñ":function(){return t.editor.commands.redo()}}}})},49711:function(t,e,n){n.d(e,{$Z:function(){return ft},hG:function(){return yt}});var r=n(2057),o=n(22520),i=n(43723),a=n(78685),s=n(51222);function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty;function d(t,e){return function(n,r,o){return t(n,r,o)&&e(n,r,o)}}function h(t){return function(e,n,r){if(!e||!n||"object"!==u(e)||"object"!==u(n))return t(e,n,r);var o=r.cache,i=o.get(e),a=o.get(n);if(i&&a)return i===n&&a===e;o.set(e,n),o.set(n,e);var s=t(e,n,r);return o.delete(e),o.delete(n),s}}function p(t){return c(t).concat(l(t))}var v=Object.hasOwn||function(t,e){return f.call(t,e)};function m(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var y=Object.getOwnPropertyDescriptor,g=Object.keys;function b(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t),new Uint8Array(e))}function k(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function w(t,e){return t.byteLength===e.byteLength&&F(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function D(t,e){return m(t.getTime(),e.getTime())}function C(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function S(t,e){return t===e}function A(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var o,i,a=new Array(r),s=t.entries(),u=0;(o=s.next())&&!o.done;){for(var c=e.entries(),l=!1,f=0;(i=c.next())&&!i.done;)if(a[f])f++;else{var d=o.value,h=i.value;if(n.equals(d[0],h[0],u,f,t,e,n)&&n.equals(d[1],h[1],d[0],h[0],t,e,n)){l=a[f]=!0;break}f++}if(!l)return!1;u++}return!0}var E=m;function x(t,e,n){var r=g(t),o=r.length;
21if(g(e).length!==o)return!1;for(;o-- >0;)if(!P(t,e,n,r[o]))return!1;return!0}function M(t,e,n){var r,o,i,a=p(t),s=a.length;if(p(e).length!==s)return!1;for(;s-- >0;){if(!P(t,e,n,r=a[s]))return!1;if(o=y(t,r),i=y(e,r),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function O(t,e){return m(t.valueOf(),e.valueOf())}function T(t,e){return t.source===e.source&&t.flags===e.flags}function N(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var o,i,a=new Array(r),s=t.values();(o=s.next())&&!o.done;){for(var u=e.values(),c=!1,l=0;(i=u.next())&&!i.done;){if(!a[l]&&n.equals(o.value,i.value,o.value,i.value,t,e,n)){c=a[l]=!0;break}l++}if(!c)return!1}return!0}function F(t,e){var n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function R(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function P(t,e,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!t.$$typeof&&!e.$$typeof)||v(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var B={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},j=Object.prototype.toString;function L(t){var e=t.areArrayBuffersEqual,n=t.areArraysEqual,r=t.areDataViewsEqual,o=t.areDatesEqual,i=t.areErrorsEqual,a=t.areFunctionsEqual,s=t.areMapsEqual,c=t.areNumbersEqual,l=t.areObjectsEqual,f=t.arePrimitiveWrappersEqual,d=t.areRegExpsEqual,h=t.areSetsEqual,p=t.areTypedArraysEqual,v=t.areUrlsEqual,m=t.unknownTagComparators;return function(t,y,g){if(t===y)return!0;if(null==t||null==y)return!1;var b=u(t);if(b!==u(y))return!1;if("object"!==b)return"number"===b?c(t,y,g):"function"===b&&a(t,y,g);var k=t.constructor;if(k!==y.constructor)return!1;if(k===Object)return l(t,y,g);if(Array.isArray(t))return n(t,y,g);if(k===Date)return o(t,y,g);if(k===RegExp)return d(t,y,g);if(k===Map)return s(t,y,g);if(k===Set)return h(t,y,g);var w,D=j.call(t);if("[object Date]"===D)return o(t,y,g);if("[object RegExp]"===D)return d(t,y,g);if("[object Map]"===D)return s(t,y,g);if("[object Set]"===D)return h(t,y,g);if("[object Object]"===D)return"function"!=typeof t.then&&"function"!=typeof y.then&&l(t,y,g);if("[object URL]"===D)return v(t,y,g);if("[object Error]"===D)return i(t,y,g);if("[object Arguments]"===D)return l(t,y,g);if(B[D])return p(t,y,g);if("[object ArrayBuffer]"===D)return e(t,y,g);if("[object DataView]"===D)return r(t,y,g);if("[object Boolean]"===D||"[object Number]"===D||"[object String]"===D)return f(t,y,g);if(m){var C=m[D];if(!C){var S=null!=(w=t)?w[Symbol.toStringTag]:void 0;S&&(C=m[S])}if(C)return C(t,y,g)}return!1}}var I=z();z({strict:!0}),z({circular:!0}),z({circular:!0,strict:!0}),z({createInternalComparator:function(){return m}}),z({strict:!0,createInternalComparator:function(){return m}}),z({circular:!0,createInternalComparator:function(){return m}}),z({circular:!0,createInternalComparator:function(){return m},strict:!0});function z(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.circular,r=void 0!==n&&n,o=e.createInternalComparator,i=e.createState,a=e.strict,s=void 0!==a&&a,u=function(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArrayBuffersEqual:b,areArraysEqual:r?M:k,areDataViewsEqual:w,areDatesEqual:D,areErrorsEqual:C,areFunctionsEqual:S,areMapsEqual:r?d(A,M):A,areNumbersEqual:E,areObjectsEqual:r?M:x,arePrimitiveWrappersEqual:O,areRegExpsEqual:T,areSetsEqual:r?d(N,M):N,areTypedArraysEqual:r?d(F,M):F,areUrlsEqual:R,unknownTagComparators:void 0};if(n&&(o=Object.assign({},o,n(o))),e){var i=h(o.areArraysEqual),a=h(o.areMapsEqual),s=h(o.areObjectsEqual),u=h(o.areSetsEqual);o=Object.assign({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return o}(e),c=L(u);return function(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(t,a){var s=r(),u=s.cache,c=void 0===u?e?new WeakMap:void 0:u,l=s.meta;return n(t,a,{cache:c,equals:o,meta:l,strict:i})};if(e)return function(t,e){return n(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return n(t,e,a)}}({circular:r,comparator:c,createState:i,equals:o?o(c):(t=c,function(e,n,r,o,i,a,s){return t(e,n,s)}),strict:s})}var $=n(99505),H=["editor","innerRef"];function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}
21finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||U(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function W(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"==typeof t)return J(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(t,e):void 0}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,at(r.key),r)}}function G(t,e,n){return e&&Y(t.prototype,e),n&&Y(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function X(t,e,n){return e=tt(e),Z(t,Q()?Reflect.construct(e,n||[],tt(t).constructor):e.apply(t,n))}function Z(t,e){if(e&&("object"==V(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Q(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Q=function(){return!!t})()}function tt(t){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tt(t)}function et(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nt(t,e)}function nt(t,e){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nt(t,e)}function rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(n),!0).forEach((function(e){it(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function it(t,e,n){return(e=at(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function at(t){var e=function(t,e){if("object"!=V(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==V(e)?e:e+""}var st=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){e.forEach((function(e){"function"==typeof e?e(t):e&&(e.current=t)}))}},ut=function(t){var e=t.contentComponent,n=(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,a.jsx)(a.Fragment,{children:Object.values(n)})};var ct=function(t){function e(t){var n,o;return q(this,e),(n=X(this,e,[t])).editorContentRef=r.createRef(),n.initialized=!1,n.state={hasContentComponentInitialized:Bo
21olean(null==(o=t.editor)?void 0:o.contentComponent)},n}return et(e,t),G(e,[{key:"componentDidMount",value:function(){this.init()}},{key:"componentDidUpdate",value:function(){this.init()}},{key:"init",value:function(){var t,e,n,r=this,i=this.props.editor;if(i&&!i.isDestroyed&&(null==(t=i.view.dom)?void 0:t.parentNode)){if(i.contentComponent)return;var a=this.editorContentRef.current;a.append.apply(a,W(i.view.dom.parentNode.childNodes)),i.setOptions({element:a}),i.contentComponent=(e=new Set,n={},{subscribe:function(t){return e.add(t),function(){e.delete(t)}},getSnapshot:function(){return n},getServerSnapshot:function(){return n},setRenderer:function(t,r){n=ot(ot({},n),{},it({},t,o.createPortal(r.reactElement,r.element,t))),e.forEach((function(t){return t()}))},removeRenderer:function(t){var r=ot({},n);delete r[t],n=r,e.forEach((function(t){return t()}))}}),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=i.contentComponent.subscribe((function(){r.setState((function(t){return t.hasContentComponentInitialized?t:{hasContentComponentInitialized:!0}})),r.unsubscribeToContentComponent&&r.unsubscribeToContentComponent()}))),i.createNodeViews(),this.initialized=!0}}},{key:"componentWillUnmount",value:function(){var t,e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!(null==(t=e.view.dom)?void 0:t.parentNode))return;var n=document.createElement("div");n.append.apply(n,W(e.view.dom.parentNode.childNodes)),e.setOptions({element:n})}catch(t){}}}},{key:"render",value:function(){var t=this.props,e=t.editor,n=t.innerRef,r=K(t,H);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",ot({ref:st(n,this.editorContentRef)},r)),(null==e?void 0:e.contentComponent)&&(0,a.jsx)(ut,{contentComponent:e.contentComponent})]})}}])}(r.Component),lt=(0,r.forwardRef)((function(t,e){var n=r.useMemo((function(){return Math.floor(4294967295*Math.random()).toString()}),[t.editor]);return r.createElement(ct,ot({key:n,innerRef:e},t))})),ft=r.memo(lt),dt="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,ht=function(){return G((function t(e){q(this,t),this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}),[{key:"getSnapshot",value:function(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}},{key:"getServerSnapshot",value:function(){return{editor:null,transactionNumber:0}}},{key:"subscribe",value:function(t){var e=this;return this.subscribers.add(t),function(){e.subscribers.delete(t)}}},{key:"watch",value:function(t){var e=this;if(this.editor=t,this.editor){var n=function(){e.transactionNumber+=1,e.subscribers.forEach((function(t){return t()}))},r=this.editor;return r.on("transaction",n),function(){r.off("transaction",n)}}}}])}();var pt="undefined"==typeof window,vt=pt||Boolean("undefined"!=typeof window&&window.next),mt=function(){function t(e){q(this,t),this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}return G(t,[{key:"setEditor",value:function(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((function(t){return t()}))}},{key:"getInitialEditor",value:function(){return void 0===this.options.current.immediatelyRender?pt||vt?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}},{key:"createEditor",value:function(){var t=this,e=ot(ot({},this.options.current),{},{onBeforeCreate:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onBeforeCreate)?void 0:(e=r).call.apply(e,[n].concat(i))},onBlur:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onBlur)?void 0:(e=r).call.apply(e,[n].concat(i))},onCreate:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onCreate)?void 0:(e=r).call.apply(e,[n].concat(i))},onDestroy:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onDestroy)?void 0:(e=r).call.apply(e,[n].concat(i))},onFocus:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onFocus)?void 0:(e=r).call.apply(e,[n].concat(i))},onSelectionUpdate:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onSelectionUpdate)?void 0:(e=r).call.apply(e,[n].concat(i))},onTransaction:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onTransaction)?void 0:(e=r).call.apply(e,[n].concat(i))},onUpdate:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onUpdate)?void 0:(e=r).call.apply(e,[n].concat(i))},onContentError:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onContentError)?void 0:(e=r).call.apply(e,[n].concat(i))},onDrop:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onDrop)?void 0:(e=r).call.apply(e,[n].concat(i))},onPaste:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onPaste)?void 0:(e=r).call.apply(e,[n].concat(i))},onDelete:function(){for(var e,n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return null==(r=(n=t.options.current).onDelete)?void 0:(e=r).call.apply(e,[n].concat(i))}});return new s.KE(e)}},{key:"getEditor",value:function(){return this.editor}},{key:"getServerSnapshot",value:function(){return null}},{key:"subscribe",value:function(t){var e=this;return this.subscriptions.add(t),function(){e.subscriptions.delete(t)}}},{key:"onRender",value:function(e){var n=this;return function(){return n.isComponentMounted=!0,clearTimeout(n.scheduledDestructionTimeout),n.editor&&!n.editor.isDestroyed&&0===e.length?t.compareOptions(n.options.current,n.editor.options)||n.editor.setOptions(ot(ot({},n.options.current),{},{editable:n.editor.isEditable})):n.refreshEditorInstance(e),function(){n.isComponentMounted=!1,n.scheduleDestroy()}}}},{key:"refreshEditorInstance",value:function(t){if(this.editor&&!this.editor.isDestroyed){
21if(null===this.previousDeps)return void(this.previousDeps=t);if(this.previousDeps.length===t.length&&this.previousDeps.every((function(e,n){return e===t[n]})))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}},{key:"scheduleDestroy",value:function(){var t=this,e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout((function(){t.isComponentMounted&&t.instanceId===e?n&&n.setOptions(t.options.current):n&&!n.isDestroyed&&(n.destroy(),t.instanceId===e&&t.setEditor(null))}),1)}}],[{key:"compareOptions",value:function(t,e){return Object.keys(t).every((function(n){return!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&t.extensions&&e.extensions?t.extensions.length===e.extensions.length&&t.extensions.every((function(t,n){var r;return t===(null==(r=e.extensions)?void 0:r[n])})):t[n]===e[n])}))}}])}();function yt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,r.useRef)(t);n.current=t;var o=_((0,r.useState)((function(){return new mt(n)})),1)[0],a=(0,i.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,r.useDebugValue)(a),(0,r.useEffect)(o.onRender(e)),function(t){var e,n=_((0,r.useState)((function(){return new ht(t.editor)})),1)[0],o=(0,$.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,null!=(e=t.equalityFn)?e:I);dt((function(){return n.watch(t.editor)}),[t.editor,n]),(0,r.useDebugValue)(o)}({editor:a,selector:function(e){var n=e.transactionNumber;return!1===t.shouldRerenderOnTransaction||void 0===t.shouldRerenderOnTransaction?null:t.immediatelyRender&&0===n?0:n+1}}),a}var gt=(0,r.createContext)({editor:null});gt.Consumer;var bt=(0,r.createContext)({onDragStart:function(){},nodeViewContentChildren:void 0,nodeViewContentRef:function(){}}),kt=function(){return(0,r.useContext)(bt)};r.forwardRef((function(t,e){var n=kt().onDragStart,r=t.as||"div";return(0,a.jsx)(r,ot(ot({},t),{},{ref:e,"data-node-view-wrapper":"",onDragStart:n,style:ot({whiteSpace:"normal"},t.style)}))}));r.createContext({markViewContentRef:function(){}})},62118:function(t,e,n){n.d(e,{A:function(){return Un}});var r=n(51222),o=["children"];var i=function(t,e){if("slot"===t)return 0;if(t instanceof Function)return t(e);var n=null!=e?e:{},r=n.children,i=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(n,o);if("svg"===t)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,i,r]};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l=/^\s*>\s$/,f=r.bP.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(t){var e=t.HTMLAttributes;return i("blockquote",u(u({},(0,r.KV)(this.options.HTMLAttributes,e)),{},{children:i("slot",{})}))},parseMarkdown:function(t,e){return e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[]))},renderMarkdown:function(t,e){if(!t.content)return"";var n=[];return t.content.forEach((function(t){var r=e.renderChildren([t]).split("\n").map((function(t){return""===t.trim()?">":"".concat(">"," ").concat(t)}));n.push(r.join("\n"))})),n.join("\n".concat(">","\n"))},addCommands:function(){var t=this;return{setBlockquote:function(){return function(e){return e.commands.wrapIn(t.name)}},toggleBlockquote:function(){return function(e){return e.commands.toggleWrap(t.name)}},unsetBlockquote:function(){return function(e){return e.commands.lift(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-b":function(){return t.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[(0,r.tG)({find:l,type:this.type})]}});function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){v(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var m=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,g=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,b=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,k=r.CU.create({name:"bold",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){var t=this;return[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!==t.style.fontWeight&&null}},{style:"font-weight=400",clearMark:function(e){return e.type.name===t.name}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}]},renderHTML:function(t){var e=t.HTMLAttributes;return i("strong",p(p({},(0,r.KV)(this.options.HTMLAttributes,e)),{},{children:i("slot",{})}))},markdownTokenName:"strong",parseMarkdown:function(t,e){return e.applyMark("bold",e.parseInline(t.tokens||[]))},renderMarkdown:function(t,e){return"**".concat(e.renderChildren(t),"**")},addCommands:function(){var t=this;return{setBold:function(){return function(e){return e.commands.setMark(t.name)}},toggleBold:function(){return function(e){return e.commands.toggleMark(t.name)}},unsetBold:function(){return function(e){return e.commands.unsetMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-b":function(){return t.editor.commands.toggleBold()},"Mod-B":function(){return t.editor.commands.toggleBold()}}},addInputRules:function(){return[(0,r.OX)({find:m,type:this.type}),(0,r.OX)({find:g,type:this.type})]}
21,addPasteRules:function(){return[(0,r.Zc)({find:y,type:this.type}),(0,r.Zc)({find:b,type:this.type})]}}),w=/(^|[^`])`([^`]+)`(?!`)$/,D=/(^|[^`])`([^`]+)`(?!`)/g,C=r.CU.create({name:"code",addOptions:function(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML:function(){return[{tag:"code"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["code",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:function(t,e){return e.applyMark("code",[{type:"text",text:t.text||""}])},renderMarkdown:function(t,e){return t.content?"`".concat(e.renderChildren(t.content),"`"):""},addCommands:function(){var t=this;return{setCode:function(){return function(e){return e.commands.setMark(t.name)}},toggleCode:function(){return function(e){return e.commands.toggleMark(t.name)}},unsetCode:function(){return function(e){return e.commands.unsetMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-e":function(){return t.editor.commands.toggleCode()}}},addInputRules:function(){return[(0,r.OX)({find:w,type:this.t
21ype})]},addPasteRules:function(){return[(0,r.Zc)({find:D,type:this.type})]}}),S=n(17386);function A(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return E(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var x=/^```([a-z]+)?[\s\n]$/,M=/^~~~([a-z]+)?[\s\n]$/,O=r.bP.create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var t=this;return{language:{default:this.options.defaultLanguage,parseHTML:function(e){var n,r=t.options.languageClassPrefix;if(!r)return null;var o=A((null==(n=e.firstElementChild)?void 0:n.classList)||[]).filter((function(t){return t.startsWith(r)})).map((function(t){return t.replace(r,"")}))[0];return o||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(t){var e=t.node,n=t.HTMLAttributes;return["pre",(0,r.KV)(this.options.HTMLAttributes,n),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:function(t,e){var n;return!1===(null==(n=t.raw)?void 0:n.startsWith("```"))&&"indented"!==t.codeBlockStyle?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:function(t,e){var n,r="",o=(null==(n=t.attrs)?void 0:n.language)||"";t.content?r=["```".concat(o),e.renderChildren(t.content),"```"].join("\n"):r="```".concat(o,"\n\n```");return r},addCommands:function(){var t=this;return{setCodeBlock:function(e){return function(n){return n.commands.setNode(t.name,e)}},toggleCodeBlock:function(e){return function(n){return n.commands.toggleNode(t.name,"paragraph",e)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Alt-c":function(){return t.editor.commands.toggleCodeBlock()},Backspace:function(){var e=t.editor.state.selection,n=e.empty,r=e.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==t.name)&&(!(!o&&r.parent.textContent.length)&&t.editor.commands.clearNodes())},Tab:function(e){var n,r=e.editor;if(!t.options.enableTabIndentation)return!1;var o=null!=(n=t.options.tabSize)?n:4,i=r.state,a=i.selection,s=a.$from,u=a.empty;if(s.parent.type!==t.type)return!1;var c=" ".repeat(o);return u?r.commands.insertContent(c):r.commands.command((function(t){var e=t.tr,n=a.from,r=a.to,o=i.doc.textBetween(n,r,"\n","\n").split("\n").map((function(t){return c+t})).join("\n");return e.replaceWith(n,r,i.schema.text(o)),!0}))},"Shift-Tab":function(e){var n,r=e.editor;if(!t.options.enableTabIndentation)return!1;var o=null!=(n=t.options.tabSize)?n:4,i=r.state,a=i.selection,s=a.$from,u=a.empty;return s.parent.type===t.type&&(u?r.commands.command((function(t){for(var e,n=t.tr,r=s.pos,a=s.start(),u=s.end(),c=i.doc.textBetween(a,u,"\n","\n").split("\n"),l=0,f=0,d=r-a,h=0;h<c.length;h+=1){if(f+c[h].length>=d){l=h;break}f+=c[h].length+1}var p=(null==(e=c[l].match(/^ */))?void 0:e[0])||"",v=Math.min(p.length,o);if(0===v)return!0;for(var m=a,y=0;y<l;y+=1)m+=c[y].length+1;return n.delete(m,m+v),r-m<=v&&n.setSelection(S.U3.create(n.doc,m)),!0})):r.commands.command((function(t){var e=t.tr,n=a.from,r=a.to,s=i.doc.textBetween(n,r,"\n","\n").split("\n").map((function(t){var e,n=(null==(e=t.match(/^ */))?void 0:e[0])||"",r=Math.min(n.length,o);return t.slice(r)})).join("\n");return e.replaceWith(n,r,i.schema.text(s)),!0})))},Enter:function(e){var n=e.editor;if(!t.options.exitOnTripleEnter)return!1;var r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==t.type)return!1;var i=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith("\n\n");return!(!i||!a)&&n.chain().command((function(t){return t.tr.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:function(e){var n=e.editor;if(!t.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==t.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(i.nodeAt(s)?n.commands.command((function(t){return t.tr.setSelection(S.LN.near(i.resolve(s))),!0}
21)):n.commands.exitCode())}}},addInputRules:function(){return[(0,r.JJ)({find:x,type:this.type,getAttributes:function(t){return{language:t[1]}}}),(0,r.JJ)({find:M,type:this.type,getAttributes:function(t){return{language:t[1]}}})]},addProseMirrorPlugins:function(){var t=this;return[new S.k_({key:new S.hs("codeBlockVSCodeHandler"),props:{handlePaste:function(e,n){if(!n.clipboardData)return!1;if(t.editor.isActive(t.type.name))return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null==i?void 0:i.mode;if(!r||!a)return!1;var s=e.state,u=s.tr,c=s.schema.text(r.replace(/\r\n?/g,"\n"));return u.replaceSelectionWith(t.type.create({language:a},c)),u.selection.$from.parent.type!==t.type&&u.setSelection(S.U3.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta("paste",!0),e.dispatch(u),!0}}})]}}),T=r.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:function(t,e){return t.content?e.renderChildren(t.content,"\n\n"):""}}),N=r.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["br",(0,r.KV)(this.options.HTMLAttributes,e)]},renderText:function(){return"\n"},renderMarkdown:function(){return" \n"},parseMarkdown:function(){return{type:"hardBreak"}},addCommands:function(){var t=this;return{setHardBreak:function(){return function(e){var n=e.commands,r=e.chain,o=e.state,i=e.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var e=o.selection,n=o.storedMarks;if(e.$from.parent.type.spec.isolating)return!1;var a=t.options.keepMarks,s=i.extensionManager.splittableMarks,u=n||e.$to.parentOffset&&e.$from.marks();return r().insertContent({type:t.name}).command((function(t){var e=t.tr;if(t.dispatch&&u&&a){var n=u.filter((function(t){return s.includes(t.type.name)}));e.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Enter":function(){return t.editor.commands.setHardBreak()},"Shift-Enter":function(){return t.editor.commands.setHardBreak()}}}});function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function R(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function B(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){L(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=F(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==F(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var I=r.bP.create({name:"heading",addOptions:function(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return this.options.levels.map((function(t){return{tag:"h".concat(t),attrs:{level:t}}}))},renderHTML:function(t){var e=t.node,n=t.HTMLAttributes,o=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return["h".concat(o),(0,r.KV)(this.options.HTMLAttributes,n),0]},parseMarkdown:function(t,e){return e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[]))},renderMarkdown:function(t,e){var n,r=(null==(n=t.attrs)?void 0:n.level)?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?"".concat(o," ").concat(e.renderChildren(t.content)):""},addCommands:function(){var t=this;return{setHeading:function(e){return function(n){var r=n.commands;return!!t.options.levels.includes(e.level)&&r.setNode(t.name,e)}},toggleHeading:function(e){return function(n){var r=n.commands;return!!t.options.levels.includes(e.level)&&r.toggleNode(t.name,"paragraph",e)}}}},addKeyboardShortcuts:function(){var t=this;return this.options.levels.reduce((function(e,n){return j(j({},e),L({},"Mod-Alt-".concat(n),(function(){return t.editor.commands.toggleHeading({level:n})}
21)))}),{})},addInputRules:function(){var t=this;return this.options.levels.map((function(e){return(0,r.JJ)({find:new RegExp("^(#{".concat(Math.min.apply(Math,R(t.options.levels)),",").concat(e,"})\\s$")),type:t.type,getAttributes:{level:e}})}))}}),z=r.bP.create({name:"horizontalRule",addOptions:function(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML:function(){return[{tag:"hr"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["hr",(0,r.KV)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:function(t,e){return e.createNode("horizontalRule")},renderMarkdown:function(){return"---"},addCommands:function(){var t=this;return{setHorizontalRule:function(){return function(e){var n=e.chain,o=e.state;if(!(0,r.AB)(o,o.schema.nodes[t.name]))return!1;var i=o.selection,a=i.$to,s=n();return(0,r.BQ)(i)?s.insertContentAt(a.pos,{type:t.name}):s.insertContent({type:t.name}),s.command((function(e){var n=e.state,r=e.tr;if(e.dispatch){var o=r.selection.$to,i=o.end();if(o.nodeAfter)o.nodeAfter.isTextblock?r.setSelection(S.U3.create(r.doc,o.pos+1)):o.nodeAfter.isBlock?r.setSelection(S.nh.create(r.doc,o.pos)):r.setSelection(S.U3.create(r.doc,o.pos));else{var a=n.schema.nodes[t.options.nextNodeType]||o.parent.type.contentMatch.defaultType,s=null==a?void 0:a.create();s&&(r.insert(i,s),r.setSelection(S.U3.create(r.doc,i+1)))}r.scrollIntoView()}return!0})).run()}}}},addInputRules:function(){return[(0,r.jT)({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
21ype})]}}),$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,H=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,V=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,K=r.CU.create({name:"italic",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){var t=this;return[{tag:"em"},{tag:"i",getAttrs:function(t){return"normal"!==t.style.fontStyle&&null}},{style:"font-style=normal",clearMark:function(e){return e.type.name===t.name}},{style:"font-style=italic"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["em",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands:function(){var t=this;return{setItalic:function(){return function(e){return e.commands.setMark(t.name)}},toggleItalic:function(){return function(e){return e.commands.toggleMark(t.name)}},unsetItalic:function(){return function(e){return e.commands.unsetMark(t.name)}}}},markdownTokenName:"em",parseMarkdown:function(t,e){return e.applyMark("italic",e.parseInline(t.tokens||[]))},renderMarkdown:function(t,e){return"*".concat(e.renderChildren(t),"*")},addKeyboardShortcuts:function(){var t=this;return{"Mod-i":function(){return t.editor.commands.toggleItalic()},"Mod-I":function(){return t.editor.commands.toggleItalic()}}},addInputRules:function(){return[(0,r.OX)({find:$,type:this.type}
21),(0,r.OX)({find:V,type:this.type})]},addPasteRules:function(){return[(0,r.Zc)({find:H,type:this.type}),(0,r.Zc)({find:_,type:this.type})]}});function W(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return U(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?U(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tt(r.key),r)}}function q(t,e,n){return e=G(e),function(t,e){if(e&&("object"==Z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Y()?Reflect.construct(e,n||[],G(t).constructor):e.apply(t,n))}function Y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Y=function(){return!!t})()}function G(t){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},G(t)}function X(t,e){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},X(t,e)}function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function Q(t,e,n){return(e=tt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tt(t){var e=function(t,e){if("object"!=Z(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Z(e)?e:e+""}var et="numeric",nt="ascii",rt="alpha",ot="asciinumeric",it="alphanumeric",at="domain",st="emoji",ut="whitespace";function ct(t,e){return t in e||(e[t]=[]),e[t]}function lt(t,e,n){for(var r in e[et]&&(e[ot]=!0,e[it]=!0),e[nt]&&(e[ot]=!0,e[rt]=!0),e[ot]&&(e[it]=!0),e[rt]&&(e[it]=!0),e[it]&&(e[at]=!0),e[st]&&(e[at]=!0),e){var o=ct(r,n);o.indexOf(t)<0&&o.push(t)}}function ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.j={},this.jr=[],this.jd=null,this.t=t}ft.groups={},ft.prototype={accepts:function(){return!!this.t},go:function(t){var e=this,n=e.j[t];if(n)return n;for(var r=0;r<e.jr.length;r++){var o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has:function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t in this.j:!!this.go(t)},ta:function(t,e,n,r){for(var o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr:function(t,e,n,r){var o;return r=r||ft.groups,e&&e.j?o=e:(o=new ft(e),n&&r&<(e,n,r)),this.jr.push([t,o]),o},ts:function(t,e,n,r){var o=this,i=t.length;if(!i)return o;for(var a=0;a<i-1;a++)o=o.tt(t[a]);return o.tt(t[i-1],e,n,r)},tt:function(t,e,n,r){r=r||ft.groups;var o=this;if(e&&e.j)return o.j[t]=e,e;var i,a=e,s=o.go(t);if(s?(i=new ft,Object.assign(i.j,s.j),i.jr.push.apply(i.jr,s.jr),i.jd=s.jd,i.t=s.t):i=new ft,a){if(r)if(i.t&&"string"==typeof i.t){var u=Object.assign(function(t,e){var n={};for(var r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(i.t,r),n);lt(a,u,r)}else n&<(a,n,r);i.t=a}return o.j[t]=i,i}};var dt=function(t,e,n,r,o){return t.ta(e,n,r,o)},ht=function(t,e,n,r,o){return t.tr(e,n,r,o)},pt=function(t,e,n,r,o){return t.ts(e,n,r,o)},vt=function(t,e,n,r,o){return t.tt(e,n,r,o)},mt="WORD",yt="UWORD",gt="ASCIINUMERICAL",bt="ALPHANUMERICAL",kt="LOCALHOST",wt="TLD",Dt="UTLD",Ct="SCHEME",St="SLASH_SCHEME",At="NUM",Et="WS",xt="NL",Mt="OPENBRACE",Ot="CLOSEBRACE",Tt="OPENBRACKET",Nt="CLOSEBRACKET",Ft="OPENPAREN",Rt="CLOSEPAREN",Pt="OPENANGLEBRACKET",Bt="CLOSEANGLEBRACKET",jt="FULLWIDTHLEFTPAREN",Lt="FULLWIDTHRIGHTPAREN",It="LEFTCORNERBRACKET",zt="RIGHTCORNERBRACKET",$t="LEFTWHITECORNERBRACKET",Ht="RIGHTWHITECORNERBRACKET",Vt="FULLWIDTHLESSTHAN",_t="FULLWIDTHGREATERTHAN",Kt="AMPERSAND",Wt="APOSTROPHE",Ut="ASTERISK",Jt="AT",qt="BACKSLASH",Yt="BACKTICK",Gt="CARET",Xt="COLON",Zt="COMMA",Qt="DOLLAR",te="DOT",ee="EQUALS",ne="EXCLAMATION",re="HYPHEN",oe="PERCENT",ie="PIPE",ae
21="PLUS",se="POUND",ue="QUERY",ce="QUOTE",le="FULLWIDTHMIDDLEDOT",fe="SEMI",de="SLASH",he="TILDE",pe="UNDERSCORE",ve="EMOJI",me="SYM",ye=Object.freeze({__proto__:null,ALPHANUMERICAL:bt,AMPERSAND:Kt,APOSTROPHE:Wt,ASCIINUMERICAL:gt,ASTERISK:Ut,AT:Jt,BACKSLASH:qt,BACKTICK:Yt,CARET:Gt,CLOSEANGLEBRACKET:Bt,CLOSEBRACE:Ot,CLOSEBRACKET:Nt,CLOSEPAREN:Rt,COLON:Xt,COMMA:Zt,DOLLAR:Qt,DOT:te,EMOJI:ve,EQUALS:ee,EXCLAMATION:ne,FULLWIDTHGREATERTHAN:_t,FULLWIDTHLEFTPAREN:jt,FULLWIDTHLESSTHAN:Vt,FULLWIDTHMIDDLEDOT:le,FULLWIDTHRIGHTPAREN:Lt,HYPHEN:re,LEFTCORNERBRACKET:It,LEFTWHITECORNERBRACKET:$t,LOCALHOST:kt,NL:xt,NUM:At,OPENANGLEBRACKET:Pt,OPENBRACE:Mt,OPENBRACKET:Tt,OPENPAREN:Ft,PERCENT:oe,PIPE:ie,PLUS:ae,POUND:se,QUERY:ue,QUOTE:ce,RIGHTCORNERBRACKET:zt,RIGHTWHITECORNERBRACKET:Ht,SCHEME:Ct,SEMI:fe,SLASH:de,SLASH_SCHEME:St,SYM:me,TILDE:he,TLD:wt,UNDERSCORE:pe,UTLD:Dt,UWORD:yt,WORD:mt,WS:Et}),ge=/[a-z]/,be=/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
21D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])/,ke=/(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEDC-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9\uDEF0-\uDEF8])/,we=/\d/,De=/\s/,Ce=null,Se=null;function Ae(t,e){for(var n=function(t){var e=[],n=t.length,r=0;for(;r<n;){var o=t.charCodeAt(r),i=void 0,a=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}(e.replace(/[A-Z]/g,(function(t){return t.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a<r;){for(var s=t,u=null,c=0,l=null,f=-1,d=-1;a<r&&(u=s.go(n[a]));)(s=u).accepts()?(f=0,d=0,l=s):f>=0&&(f+=n[a].length,d++),c+=n[a].length,i+=n[a].length,a++;i-=f,a-=d,c-=f,o.push({t:l.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function Ee(t,e,n,r,o){for(var i,a=e.length,s=0;s<a-1;s++){var u=e[s];t.j[u]?i=t.j[u]:((i=new ft(r)).jr=o.slice(),t.j[u]=i),t=i}return(i=new ft(n)).jr=o.slice(),t.j[e[a-1]]=i,i}function xe(t){for(var e=[],n=[],r=0;r<t.length;){for(var o=0;"0123456789".indexOf(t[r+o])>=0;)o++;if(o>0){e.push(n.join(""));for(var i=parseInt(t.substring(r,r+o),10);i>0;i--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Me={defaultProtocol:"http",events:null,format:Te,formatHref:Te,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Oe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Object.assign({},Me);t&&(n=Object.assign(n,t instanceof Oe?t.o:t));for(var r=n.ignoreTags,o=[],i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}function Te(t){return t}Oe.prototype={o:Me,ignoreTags:[],defaultRender:function(t){return t},check:function(t){return this.get("validate",t.toString(),t)},get:function(t,e,n){var r=null!=e,o=this.o[t];return o?("object"===Z(o)?"function"==typeof(o=n.t in o?o[n.t]:Me[t])&&r&&(
21o=o(e,n)):"function"==typeof o&&r&&(o=o(e,n.t,n)),o):o},getObj:function(t,e,n){var r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render:function(t){var e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Ne(t,e){this.t="token",this.v=t,this.tk=e}function Fe(t,e){var n=function(e){function n(e,r){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(o=q(this,n,[e,r])).t=t,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&X(t,e)}(n,e),r=n,o&&J(r.prototype,o),i&&J(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o,i}(Ne);for(var r in e)n.prototype[r]=e[r];return n.t=t,n}Ne.prototype={isLink:!1,toString:function(){return this.v},toHref:function(t){return this.toString()},toFormattedString:function(t){var e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"â¦":r},toFormattedHref:function(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Me.defaultProtocol;return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject:function(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate:function(t){return t.get("validate",this.toString(),this)},render:function(t){var e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),a={},s=t.get("className",n,e),u=t.get("target",n,e),c=t.get("rel",n,e),l=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return a.href=r,s&&(a.class=s),u&&(a.target=u),c&&(a.rel=c),l&&Object.assign(a,l),{tagName:o,attributes:a,content:i,eventListeners:f}}};var Re=Fe("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Pe=Fe("text"),Be=Fe("nl"),je=Fe("url",{isLink:!0,toHref:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Me.defaultProtocol;return this.hasProtocol()?this.v:"".concat(t,"://").concat(this.v)},hasProtocol:function(){var t=this.tk;return t.length>=2&&t[0].t!==kt&&t[1].t===Xt}}),Le=function(t){return new ft(t)};function Ie(t,e,n){var r=n[0].s,o=n[n.length-1].e;return new t(e.slice(r,o),n)}var ze="undefined"!=typeof console&&console&&console.warn||function(){},$e="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",He={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ve(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(He.initialized&&ze('linkifyjs: already initialized - will not register custom scheme "'.concat(t,'" ').concat($e)),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');He.customSchemes.push([t,e])}function _e(){He.scanner=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e={};ft.groups=e;var n=new ft;null==Ce&&(Ce=xe("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
21ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Se&&(Se=xe("ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
21ºÐ´2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5راÙ
ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5Ù
غرب5Ù
ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2Ù
اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ
3Ù
صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4ÙÙ
راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å
«å¦2å
¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é
åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ
å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å
2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2")),vt(n,"'",Wt),vt(n,"{",Mt),vt(n,"}",Ot),vt(n,"[",Tt),vt(n,"]",Nt),vt(n,"(",Ft),vt(n,")",Rt),vt(n,"<",Pt),vt(n,">",Bt),vt(n,"ï¼",jt),vt(n,"ï¼",Lt),vt(n,"ã",It),vt(n,"ã",zt),vt(n,"ã",$t),vt(n,"ã",Ht),vt(n,"ï¼",Vt),vt(n,"ï¼",_t),vt(n,"&",Kt),vt(n,"*",Ut),vt(n,"@",Jt),vt(n,"`",Yt),vt(n,"^",Gt),vt(n,":",Xt),vt(n,",",Zt),vt(n,"$",Qt),vt(n,".",te),vt(n,"=",ee),vt(n,"!",ne),vt(n,"-",re),vt(n,"%",oe),vt(n,"|",ie),vt(n,"+",ae),vt(n,"#",se),vt(n,"?",ue),vt(n,'"',ce),vt(n,"/",de),vt(n,";",fe),vt(n,"~",he),vt(n,"_",pe),vt(n,"\\",qt),vt(n,"ã»",le);var r=ht(n,we,At,Q({},et,!0));ht(r,we,r);var o=ht(r,ge,gt,Q({},ot,!0)),i=ht(r,be,bt,Q({},it,!0)),a=ht(n,ge,mt,Q({},nt,!0));ht(a,we,o),ht(a,ge,a),ht(o,we,o),ht(o,ge,o);var s=ht(n,be,yt,Q({},rt,!0));ht(s,ge),ht(s,we,i),ht(s,be,s),ht(i,we,i),ht(i,ge),ht(i,be,i);var u=vt(n,"\n",xt,Q({},ut,!0)),c=vt(n,"\r",Et,Q({},ut,!0)),l=ht(n,De,Et,Q({},ut,!0));vt(n,"",l),vt(c,"\n",u),vt(c,"",l),ht(c,De,l),vt(l,"\r"),vt(l,"\n"),ht(l,De,l),vt(l,"",l);var f=ht(n,ke,ve,Q({},st,!0));vt(f,"#"),ht(f,ke,f),vt(f,"ï¸",f);var d=vt(f,"â");vt(d,"#"),ht(d,ke,f);for(var h=[[ge,a],[we,o]],p=[[ge,null],[be,s],[we,i]],v=0;v<Ce.length;v++)Ee(n,Ce[v],wt,mt,h);for(var m=0;m<Se.length;m++)Ee(n,Se[m],Dt,yt,p);lt(wt,{tld:!0,ascii:!0},e),lt(Dt,{utld:!0,alpha:!0},e),Ee(n,"file",Ct,mt,h),Ee(n,"mailto",Ct,mt,h),Ee(n,"http",St,mt,h),Ee(n,"https",St,mt,h),Ee(n,"ftp",St,mt,h),Ee(n,"ftps",St,mt,h),lt(Ct,{scheme:!0,ascii:!0},e),lt(St,{slashscheme:!0,ascii:!0},e),t=t.sort((function(t,e){return t[0]>e[0]?1:-1}));for(var y=0;y<t.length;y++){var g=t[y][0],b=Q({},t[y][1]?"scheme":"slashscheme",!0);g.indexOf("-")>=0?b[at]=!0:ge.test(g)?we.test(g)?b[ot]=!0:b[nt]=!0:b[et]=!0,pt(n,g,g,b)}return pt(n,"localhost",kt,{ascii:!0}),n.jd=new ft(me),{start:n,tokens:Object.assign({groups:e},ye)}}(He.customSchemes);for(var t=0;t<He.tokenQueue.length;t++)He.tokenQueue[t][1]({scanner:He.scanner});He.parser=function(t){var e=t.groups,n=e.domain.concat([Kt,Ut,Jt,qt,Yt,Gt,Qt,ee,re,At,oe,ie,ae,se,de,me,he,pe]),r=[Wt,Xt,Zt,te,ne,oe,ue,ce,fe,Pt,Bt,Mt,Ot,Nt,Tt,Ft,Rt,jt,Lt,It,zt,$t,Ht,Vt,_t],o=[Kt,Wt,Ut,qt,Yt,Gt,Qt,ee,re,Mt,Ot,oe,ie,ae,se,ue,de,me,he,pe],i=Le(),a=vt(i,he);dt(a,o,a),dt(a,e.domain,a);var s=Le(),u=Le(),c=Le();dt(i,e.domain,s),dt(i,e.scheme,u),dt(i,e.slashscheme,c),dt(s,o,a),dt(s,e.domain,s);var l=vt(s,Jt);vt(a,Jt,l),vt(u,Jt,l),vt(c,Jt,l);var f=vt(a,te);dt(f,o,a),dt(f,e.domain,a);var d=Le();dt(l,e.domain,d),dt(d,e.domain,d);var h=vt(d,te);dt(h,e.domain,d);var p=Le(Re);dt(h,e.tld,p),dt(h,e.utld,p),vt(l,kt,p);var v=vt(d,re);vt(v,re,v),dt(v,e.domain,d),dt(p,e.domain,d),vt(p,te,h),vt(p,re,v);var m=vt(p,Xt);dt(m,e.numeric,Re);var y=vt(s,re),g=vt(s,te);vt(y,re,y),dt(y,e.domain,s),dt(g,o,a),dt(g,e.domain,s);var b=Le(je);dt(g,e.tld,b),dt(g,e.utld,b),dt(b,e.domain,s),dt(b,o,a),vt(b,te,g),vt(b,re,y),vt(b,Jt,l);var k=vt(b,Xt),w=Le(je);dt(k,e.numeric,w);var D=Le(je),C=Le();dt(D,n,D),dt(D,r,C),dt(C,n,D),dt(C,r,C),vt(b,de,D),vt(w,de,D);var S=vt(u,Xt),A=vt(c,Xt),E=vt(A,de),x=vt(E,de);dt(u,e.domain,s),vt(u,te,g),vt(u,re,y),dt(c,e.domain,s),vt(c,te,g),vt(c,re,y),dt(S,e.domain,D),vt(S,de,D),vt(S,ue,D),dt(x,e.domain,D),dt(x,n,D),vt(x,de,D);for(var M=[[Mt,Ot],[Tt,Nt],[Ft,Rt],[Pt,Bt],[jt,Lt],[It,zt],[$t,Ht],[Vt,_t]],O=0;O<M.length;O++){var T=W(M[O],2),N=T[0],F=T[1],R=vt(D,N);vt(C,N,R),vt(R,F,D);var P=Le(je);dt(R,n,P);var B=Le();dt(R,r),dt(P,n,P),dt(P,r,B),dt(B,n,P),dt(B,r,B),vt(P,F,D),vt(B,F,D)}return vt(i,kt,b),vt(i,xt,Be),{start:i,tokens:ye}}(He.scanner.tokens);for(var e=0;e<He.pluginQueue.length;e++)He.pluginQueue[e][1]({scanner:He.scanner,parser:He.parser});return He.initialized=!0,He}function Ke(t){return He.initialized||_e(),function(t,e,n){for(var r=n.length,o=0,i=[],a=[];o<r;){for(var s=t,u=null,c=null,l=0,f=null,d=-1;o<r&&!(u=s.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=u||s.go(n[o].t));)u=null,(s=c).accepts()?(d=0,f=s):d>=0&&d++,o++,l++;if(d<0)(o-=l)<r&&(a.push(n[o]),o++);else{a.length>0&&(i.push(Ie(Pe,e,a)),a=[]),o-=d,l-=d;var h=f.t,p=n.slice(o-l,o);i.push(Ie(h,e,p))}}return a.length>0&&i.push(Ie(Pe,e,a)),i}
21(He.parser.start,t,Ae(He.scanner.start,t))}function We(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e&&"object"===Z(e)){if(n)throw Error("linkifyjs: Invalid link type ".concat(e,"; must be a string"));n=e,e=null}for(var r=new Oe(n),o=Ke(t),i=[],a=0;a<o.length;a++){var s=o[a];!s.isLink||e&&s.t!==e||!r.check(s)||i.push(s.toFormattedObject(r))}return i}function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Je(Object(n),!0).forEach((function(e){Ye(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ye(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Ue(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ue(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ue(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ge(t){return function(t){if(Array.isArray(t))return Xe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Xe(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Ke.scan=Ae;var Ze="[\0- Â áá â-\u2029âã]",Qe=new RegExp(Ze),tn=new RegExp("".concat(Ze,"$")),en=new RegExp(Ze,"g");function nn(t,e){var n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((function(t){var e="string"==typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(en,"").match(new RegExp("^(?:(?:".concat(n.join("|"),"):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))"),"i"))}var rn=r.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate:function(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((function(t){"string"!=typeof t?Ve(t.scheme,t.optionalSlashes):Ve(t)}))},onDestroy:function(){ft.groups={},He.scanner=null,He.parser=null,He.tokenQueue=[],He.pluginQueue=[],He.customSchemes=[],He.initialized=!1},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:function(t,e){return!!nn(t,e.protocols)},validate:function(t){return!!t},shouldAutoLink:function(t){return!!t}}},addAttributes:function(){return{href:{default:null,parseHTML:function(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){var t=this;return[{tag:"a[href]",getAttrs:function(e){var n=e.getAttribute("href");return!(!n||!t.options.isAllowedUri(n,{defaultValidate:function(e){return!!nn(e,t.options.protocols)},protocols:t.options.protocols,defaultProtocol:t.options.defaultProtocol}))&&null}}]},renderHTML:function(t){var e=this,n=t.HTMLAttributes;return this.options.isAllowedUri(n.href,{defaultValidate:function(t){return!!nn(t,e.options.protocols)},protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,r.KV)(this.options.HTMLAttributes,n),0]:["a",(0,r.KV)(this.options.HTMLAttributes,qe(qe({},n),{},{href:""})),0]},markdownTokenName:"link",parseMarkdown:function(t,e){return e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null})},renderMarkdown:function(t,e){var n,r=(null==(n=t.attrs)?void 0:n.href)||"",o=e.renderChildren(t);return"[".concat(o,"](").concat(r,")")},addCommands:function(){var t=this;return{setLink:function(e){return function(n){var r=n.chain,o=e.href;return!!t.options.isAllowedUri(o,{defaultValidate:function(e){return!!nn(e,t.options.protocols)},protocols:t.options.protocols,defaultProtocol:t.options.defaultProtocol})&&r().setMark(t.name,e).setMeta("preventAutolink",!0).run()}},toggleLink:function(e){return function(n){var r=n.chain,o=(e||{}).href;return!(o&&!t.options.isAllowedUri(o,{defaultValidate:function(e){return!!nn(e,t.options.protocols)},protocols:t.options.protocols,defaultProtocol:t.options.defaultProtocol}))&&r().toggleMark(t.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(e){return(0,e.chain)().unsetMark(t.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var t=this;return[(0,r.Zc)({find:function(e){var n=[];if(e){var r=t.options,o=r.protocols,i=r.defaultProtocol,a=We(e).filter((function(e){return e.isLink&&t.options.isAllowedUri(e.value,{defaultValidate:function(t){return!!nn(t,o)},protocols:o,defaultProtocol:i})}));a.length&&a.forEach((function(e){t.options.shouldAutoLink(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})}))}return n}
21,type:this.type,getAttributes:function(t){var e;return{href:null==(e=t.data)?void 0:e.href}}})]},addProseMirrorPlugins:function(){var t=this,e=[],n=this.options,o=n.protocols,i=n.defaultProtocol;return this.options.autolink&&e.push(function(t){return new S.k_({key:new S.hs("autolink"),appendTransaction:function(e,n,o){var i=e.some((function(t){return t.docChanged}))&&!n.doc.eq(o.doc),a=e.some((function(t){return t.getMeta("preventAutolink")}));if(i&&!a){var s=o.tr,u=(0,r.T7)(n.doc,Ge(e));if((0,r.FF)(u).forEach((function(e){var n,i,a,u=e.newRange,c=(0,r.Nx)(o.doc,u,(function(t){return t.isTextblock}));if(c.length>1)n=c[0],i=o.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(c.length){var l=o.doc.textBetween(u.from,u.to," "," ");if(!tn.test(l))return;n=c[0],i=o.doc.textBetween(n.pos,u.to,void 0," ")}if(n&&i){var f=i.split(Qe).filter(Boolean);if(f.length<=0)return!1;var d=f[f.length-1],h=n.pos+i.lastIndexOf(d);if(!d)return!1;var p=Ke(d).map((function(e){return e.toObject(t.defaultProtocol)}));if(!(1===(a=p).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;p.filter((function(t){return t.isLink})).map((function(t){return qe(qe({},t),{},{from:h+t.start+1,to:h+t.end+1})})).filter((function(t){return!o.schema.marks.code||!o.doc.rangeHasMark(t.from,t.to,o.schema.marks.code)})).filter((function(e){return t.validate(e.value)})).filter((function(e){return t.shouldAutoLink(e.value)})).forEach((function(e){(0,r.hO)(e.from,e.to,o.doc).some((function(e){return e.mark.type===t.type}))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}})),s.steps.length)return s}}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:function(e){return t.options.isAllowedUri(e,{defaultValidate:function(t){return!!nn(t,o)},protocols:o,defaultProtocol:i})},shouldAutoLink:this.options.shouldAutoLink})),e.push(function(t){return new S.k_({key:new S.hs("handleClickLink"),props:{handleClick:function(e,n,o){var i,a;if(0!==o.button)return!1;if(!e.editable)return!1;var s=!1;if(t.enableClickSelection&&(s=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var u=null;if(o.target instanceof HTMLAnchorElement)u=o.target;else{for(var c=o.target,l=[];"DIV"!==c.nodeName;)l.push(c),c=c.parentNode;u=l.find((function(t){return"A"===t.nodeName}))}if(!u)return s;var f=(0,r.gu)(e.state,t.type.name),d=null!=(i=null==u?void 0:u.href)?i:f.href,h=null!=(a=null==u?void 0:u.target)?a:f.target;u&&d&&(window.open(d,h),s=!0)}return s}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(t){return new S.k_({key:new S.hs("handlePasteLink"),props:{handlePaste:function(e,n,r){var o=t.shouldAutoLink;if(e.state.selection.empty)return!1;var i="";r.content.forEach((function(t){i+=t.textContent}));var a=We(i,{defaultProtocol:t.defaultProtocol}).find((function(t){return t.isLink&&t.value===i}));return!(!i||!a||void 0!==o&&!o(a.href))&&t.editor.commands.setMark(t.type,{href:a.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}});function on(t){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},on(t)}var an=["start"];function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function un(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sn(Object(n),!0).forEach((function(e){cn(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function cn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=on(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=on(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==on(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ln(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||dn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fn(t){return function(t){if(Array.isArray(t))return hn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||dn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dn(t,e){if(t){if("string"==typeof t)return hn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hn(t,e):void 0}}function hn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var pn=Object.defineProperty,vn="textStyle",mn=/^\s*([-+*])\s$/,yn=r.bP.create({name:"bulletList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:"ul"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["ul",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:function(t,e){return"list"!==t.type||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]}},renderMarkdown:function(t,e){return t.content?e.renderChildren(t.content,"\n"):""},markdownOptions:{indentsContent:!0},addCommands:function(){var t=this;return{toggleBulletList:function(){return function(e){var n=e.commands,r=e.chain;return t.options.keepAttributes?r().toggleList(t.name,t.options.itemTypeName,t.options.keepMarks).updateAttributes("listItem",t.editor.getAttributes(vn)).run():n.toggleList(t.name,t.options.itemTypeName,t.options.keepMarks)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-8":function(){return t.editor.commands.toggleBulletList()}}},addInputRules:function(){var t=this,e=(0,r.tG)({find:mn,type:this.t
21ype});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:mn,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(){return t.editor.getAttributes(vn)},editor:this.editor})),[e]}}),gn=r.bP.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:function(t,e){if("list_item"!==t.type)return[];var n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some((function(t){return"paragraph"===t.type})))n=e.parseChildren(t.tokens);else{var r=t.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(r.tokens)}],t.tokens.length>1){var o,i=t.tokens.slice(1),a=e.parseChildren(i);(o=n).push.apply(o,fn(a))}}else n=e.parseChildren(t.tokens)}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:function(t,e,n){return(0,r.kj)(t,e,(function(t){return"bulletList"===t.parentType?"- ":"orderedList"===t.parentType?"".concat(t.index+1,". "):"- "}),n)},addKeyboardShortcuts:function(){var t=this;return{Enter:function(){return t.editor.commands.splitListItem(t.name)},Tab:function(){return t.editor.commands.sinkListItem(t.name)},"Shift-Tab":function(){return t.editor.commands.liftListItem(t.name)}}}});!function(t,e){for(var n in e)pn(t,n,{get:e[n],enumerable:!0})}({},{findListItemPos:function(){return bn},getNextListDepth:function(){return kn},handleBackspace:function(){return Sn},handleDelete:function(){return xn},hasListBefore:function(){return wn},hasListItemAfter:function(){return Mn},hasListItemBefore:function(){return Dn},listItemHasSubList:function(){return Cn},nextListIsDeeper:function(){return An},nextListIsHigher:function(){return En}});var bn=function(t,e){for(var n=e.selection.$from,o=(0,r.Pg)(t,e.schema),i=n.depth,a=n.pos,s=null;i>0&&null===s;)n.node(i).type===o?s=i:(i-=1,a-=1);return null===s?null:{$pos:e.doc.resolve(a),depth:s}},kn=function(t,e){var n=bn(t,e);return!!n&&ln((0,r.fl)(e,t,n.$pos.pos+4),2)[1]},wn=function(t,e,n){var r=t.selection.$anchor,o=Math.max(0,r.pos-2),i=t.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},Dn=function(t,e){var n,r=e.selection.$anchor,o=e.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===t},Cn=function(t,e,n){if(!n)return!1;var o=(0,r.Pg)(t,e.schema),i=!1;return n.descendants((function(t){t.type===o&&(i=!0)})),i},Sn=function(t,e,n){if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!(0,r.rU)(t.state,e)&&wn(t.state,e,n)){var o=t.state.selection.$anchor,i=t.state.doc.resolve(o.before()-1),a=[];i.node().descendants((function(t,n){t.type.name===e&&a.push({node:t,pos:n})}));var s=a.at(-1);if(!s)return!1;var u=t.state.doc.resolve(i.start()+s.pos+1);return t.chain().cut({from:o.start()-1,to:o.end()+1},u.end()).joinForward().run()}if(!(0,r.rU)(t.state,e))return!1;if(!(0,r.J_)(t.state))return!1;var c=bn(e,t.state);if(!c)return!1;var l=t.state.doc.resolve(c.$pos.pos-2).node(c.depth),f=Cn(e,t.state,l);return Dn(e,t.state)&&!f?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},An=function(t,e){var n=kn(t,e),r=bn(t,e);return!(!r||!n)&&n>r.depth},En=function(t,e){var n=kn(t,e),r=bn(t,e);return!(!r||!n)&&n<r.depth},xn=function(t,e){if(!(0,r.rU)(t.state,e))return!1;if(!(0,r.QN)(t.state,e))return!1;var n=t.state.selection,o=n.$from,i=n.$to;return!(!n.empty&&o.sameParent(i))&&(An(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():En(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},Mn=function(t,e){var n,r=e.selection.$anchor,o=e.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===t},On=r.YY.create({name:"listKeymap",addOptions:function(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts:function(){var t=this;return{Delete:function(e){var n=e.editor,r=!1;
21return t.options.listTypes.forEach((function(t){var e=t.itemName;void 0!==n.state.schema.nodes[e]&&xn(n,e)&&(r=!0)})),r},"Mod-Delete":function(e){var n=e.editor,r=!1;return t.options.listTypes.forEach((function(t){var e=t.itemName;void 0!==n.state.schema.nodes[e]&&xn(n,e)&&(r=!0)})),r},Backspace:function(e){var n=e.editor,r=!1;return t.options.listTypes.forEach((function(t){var e=t.itemName,o=t.wrapperNames;void 0!==n.state.schema.nodes[e]&&Sn(n,e,o)&&(r=!0)})),r},"Mod-Backspace":function(e){var n=e.editor,r=!1;return t.options.listTypes.forEach((function(t){var e=t.itemName,o=t.wrapperNames;void 0!==n.state.schema.nodes[e]&&Sn(n,e,o)&&(r=!0)})),r}}}}),Tn=/^(\s*)(\d+)\.\s+(.*)$/,Nn=/^\s/;function Fn(t,e,n){for(var r,o=[],i=0;i<t.length;){var a=t[i];if(a.indent===e){var s=a.content.split("\n"),u=(null==(r=s[0])?void 0:r.trim())||"",c=[];u&&c.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});var l=s.slice(1).join("\n").trim();if(l){var f=n.blockTokens(l);c.push.apply(c,fn(f))}for(var d=i+1,h=[];d<t.length&&t[d].indent>e;)h.push(t[d]),d+=1;if(h.length>0){var p=Math.min.apply(Math,fn(h.map((function(t){return t.indent})))),v=Fn(h,p,n);c.push({type:"list",ordered:!0,start:h[0].number,items:v,raw:h.map((function(t){return t.raw})).join("\n")})}o.push({type:"list_item",raw:a.raw,tokens:c}),i=d}else i+=1}return o}var Rn="textStyle",Pn=/^(\d+)\.\s$/,Bn=r.bP.create({name:"orderedList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},addAttributes:function(){return{start:{default:1,parseHTML:function(t){return t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}},type:{default:null,parseHTML:function(t){return t.getAttribute("type")}}}},parseHTML:function(){return[{tag:"ol"}]},renderHTML:function(t){var e=t.HTMLAttributes,n=e.start,o=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,an);return 1===n?["ol",(0,r.KV)(this.options.HTMLAttributes,o),0]:["ol",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:function(t,e){if("list"!==t.type||!t.ordered)return[];var n=t.start||1,r=t.items?function(t,e){return t.map((function(t){if("list_item"!==t.type)return e.parseChildren([t])[0];var n=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach((function(t){if("paragraph"===t.type||"list"===t.type||"blockquote"===t.type||"code"===t.type)n.push.apply(n,fn(e.parseChildren([t])));else if("text"===t.type&&t.tokens){var r=e.parseChildren([t]);n.push({type:"paragraph",content:r})}else{var o=e.parseChildren([t]);o.length>0&&n.push.apply(n,fn(o))}})),{type:"listItem",content:n}}))}(t.items,e):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:function(t,e){return t.content?e.renderChildren(t.content,"\n"):""},markdownTokenizer:{name:"orderedList",level:"block",start:function(t){var e=t.match(/^(\s*)(\d+)\.\s+/),n=null==e?void 0:e.index;return void 0!==n?n:-1},tokenize:function(t,e,n){var r,o=t.split("\n"),i=function(t){for(var e=[],n=0,r=0;n<t.length;){var o=t[n],i=o.match(Tn);if(!i)break;for(var a=ln(i,4),s=a[1],u=a[2],c=a[3],l=s.length,f=c,d=n+1,h=[o];d<t.length;){var p=t[d];if(p.match(Tn))break;if(""===p.trim())h.push(p),f+="\n",d+=1;else{if(!p.match(Nn))break;h.push(p),f+="\n".concat(p.slice(l+2)),d+=1}}e.push({indent:l,number:parseInt(u,10),content:f.trim(),raw:h.join("\n")}),r=d,n=d}return[e,r]}(o),a=ln(i,2),s=a[0],u=a[1];if(0!==s.length){var c=Fn(s,0,n);if(0!==c.length)return{type:"list",ordered:!0,start:(null==(r=s[0])?void 0:r.number)||1,items:c,raw:o.slice(0,u).join("\n")}}}},markdownOptions:{indentsContent:!0},addCommands:function(){var t=this;return{toggleOrderedList:function(){return function(e){var n=e.commands,r=e.chain;return t.options.keepAttributes?r().toggleList(t.name,t.options.itemTypeName,t.options.keepMarks).updateAttributes("listItem",t.editor.getAttributes(Rn)).run():n.toggleList(t.name,t.options.itemTypeName,t.options.keepMarks)}}}},addKeyboardShortcuts:function(){var t=this;
21return{"Mod-Shift-7":function(){return t.editor.commands.toggleOrderedList()}}},addInputRules:function(){var t=this,e=(0,r.tG)({find:Pn,type:this.type,getAttributes:function(t){return{start:+t[1]}},joinPredicate:function(t,e){return e.childCount+e.attrs.start===+t[1]}});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:Pn,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:function(e){return un({start:+e[1]},t.editor.getAttributes(Rn))},joinPredicate:function(t,e){return e.childCount+e.attrs.start===+t[1]},editor:this.editor})),[e]}}),jn=/^\s*(\[([( |x])?\])\s$/,Ln=r.bP.create({name:"taskItem",addOptions:function(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content:function(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(t){var e=t.getAttribute("data-checked");return""===e||"true"===e},renderHTML:function(t){return{"data-checked":t.checked}}}}},parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(t){var e=t.node,n=t.HTMLAttributes;return["li",(0,r.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:function(t,e){var n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){var r=e.parseChildren(t.nestedTokens);n.push.apply(n,fn(r))}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:function(t,e){var n,o=(null==(n=t.attrs)?void 0:n.checked)?"x":" ",i="- [".concat(o,"] ");return(0,r.kj)(t,e,i)},addKeyboardShortcuts:function(){var t=this,e={Enter:function(){return t.editor.commands.splitListItem(t.name)},"Shift-Tab":function(){return t.editor.commands.liftListItem(t.name)}};return this.options.nested?un(un({},e),{},{Tab:function(){return t.editor.commands.sinkListItem(t.name)}}):e},addNodeView:function(){var t=this;return function(e){var n=e.node,r=e.HTMLAttributes,o=e.getPos,i=e.editor,a=document.createElement("li"),s=document.createElement("label"),u=document.createElement("span"),c=document.createElement("input"),l=document.createElement("div"),f=function(e){var n,r;c.ariaLabel=(null==(r=null==(n=t.options.a11y)?void 0:n.checkboxLabel)?void 0:r.call(n,e,c.checked))||"Task item checkbox for ".concat(e.textContent||"empty task item")};return f(n),s.contentEditable="false",c.type="checkbox",c.addEventListener("mousedown",(function(t){return t.preventDefault()})),c.addEventListener("change",(function(e){if(i.isEditable||t.options.onReadOnlyChecked){var r=e.target.checked;i.isEditable&&"function"==typeof o&&i.chain().focus(void 0,{scrollIntoView:!1}).command((function(t){var e=t.tr,n=o();if("number"!=typeof n)return!1;var i=e.doc.nodeAt(n);return e.setNodeMarkup(n,void 0,un(un({},null==i?void 0:i.attrs),{},{checked:r})),!0})).run(),!i.isEditable&&t.options.onReadOnlyChecked&&(t.options.onReadOnlyChecked(n,r)||(c.checked=!c.checked))}else c.checked=!c.checked})),Object.entries(t.options.HTMLAttributes).forEach((function(t){var e=ln(t,2),n=e[0],r=e[1];a.setAttribute(n,r)})),a.dataset.checked=n.attrs.checked,c.checked=n.attrs.checked,s.append(c,u),a.append(s,l),Object.entries(r).forEach((function(t){var e=ln(t,2),n=e[0],r=e[1];a.setAttribute(n,r)})),{dom:a,contentDOM:l,update:function(e){return e.type===t.type&&(a.dataset.checked=e.attrs.checked,c.checked=e.attrs.checked,f(e),!0)}}}}
21,addInputRules:function(){return[(0,r.tG)({find:jn,type:this.type,getAttributes:function(t){return{checked:"x"===t[t.length-1]}}})]}}),In=r.bP.create({name:"taskList",addOptions:function(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(t){var e=t.HTMLAttributes;return["ul",(0,r.KV)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:function(t,e){return e.createNode("taskList",{},e.parseChildren(t.items||[]))},renderMarkdown:function(t,e){return t.content?e.renderChildren(t.content,"\n"):""},markdownTokenizer:{name:"taskList",level:"block",start:function(t){var e,n=null==(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:e.index;return void 0!==n?n:-1},tokenize:function(t,e,n){var o=function(t){var e=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:function(t){return{indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}},createToken:function(t,e){return{type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}},customNestedParser:o},n);return e?[{type:"taskList",raw:e.raw,items:e.items}]:n.blockTokens(t)},i=(0,r.Dd)(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:function(t){return{indentLevel:t[1].length,mainContent:t[4],checked:"x"===t[3].toLowerCase()}},createToken:function(t,e){return{type:"taskItem",raw:"",mainContent:t.mainContent,indentLevel:t.indentLevel,checked:t.checked,text:t.mainContent,tokens:n.inlineTokens(t.mainContent),nestedTokens:e}},customNestedParser:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands:function(){var t=this;return{toggleTaskList:function(){return function(e){return e.commands.toggleList(t.name,t.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Shift-9":function(){return t.editor.commands.toggleTaskList()}}}}),zn=(r.YY.create({name:"listKit",addExtensions:function(){var t=[];return!1!==this.options.bulletList&&t.push(yn.configure(this.options.bulletList)),!1!==this.options.listItem&&t.push(gn.configure(this.options.listItem)),!1!==this.options.listKeymap&&t.push(On.configure(this.options.listKeymap)),!1!==this.options.orderedList&&t.push(Bn.configure(this.options.orderedList)),!1!==this.options.taskItem&&t.push(Ln.configure(this.options.taskItem)),!1!==this.options.taskList&&t.push(In.configure(this.options.taskList)),t}}),r.bP.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(t){var e=t.HTMLAttributes;return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:function(t,e){var n=t.tokens||[];return 1===n.length&&"image"===n[0].type?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:function(t,e){return t&&Array.isArray(t.content)?e.renderChildren(t.content):""},addCommands:function(){var t=this;return{setParagraph:function(){return function(e){return e.commands.setNode(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-Alt-0":function(){return t.editor.commands.setParagraph()}}}})),$n=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Hn=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Vn=r.CU.create({name:"strike",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:function(t){return!!t.includes("line-through")&&{}}}]},renderHTML:function(t){var e=t.HTMLAttributes;return["s",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:function(t,e){return e.applyMark("strike",e.parseInline(t.tokens||[]))},renderMarkdown:function(t,e){return"~~".concat(e.renderChildren(t),"~~")},addCommands:function(){var t=this;return{setStrike:function(){return function(e){return e.commands.setMark(t.name)}},toggleStrike:function(){return function(e){return e.commands.toggleMark(t.name)}},unsetStrike:function(){return function(e){return e.commands.unsetMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;
21return{"Mod-Shift-s":function(){return t.editor.commands.toggleStrike()}}},addInputRules:function(){return[(0,r.OX)({find:$n,type:this.type})]},addPasteRules:function(){return[(0,r.Zc)({find:Hn,type:this.type})]}}),_n=r.bP.create({name:"text",group:"inline",parseMarkdown:function(t){return{type:"text",text:t.text||""}},renderMarkdown:function(t){return t.text||""}}),Kn=r.CU.create({name:"underline",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:function(t){return!!t.includes("underline")&&{}}}]},renderHTML:function(t){var e=t.HTMLAttributes;return["u",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:function(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:function(t,e){return"++".concat(e.renderChildren(t),"++")},markdownTokenizer:{name:"underline",level:"inline",start:function(t){return t.indexOf("++")},tokenize:function(t,e,n){var r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(r){var o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}}},addCommands:function(){var t=this;return{setUnderline:function(){return function(e){return e.commands.setMark(t.name)}},toggleUnderline:function(){return function(e){return e.commands.toggleMark(t.name)}},unsetUnderline:function(){return function(e){return e.commands.unsetMark(t.name)}}}},addKeyboardShortcuts:function(){var t=this;return{"Mod-u":function(){return t.editor.commands.toggleUnderline()},"Mod-U":function(){return t.editor.commands.toggleUnderline()}}}}),Wn=n(45533),Un=r.YY.create({name:"starterKit",addExtensions:function(){var t,e,n,r,o=[];return!1!==this.options.bold&&o.push(k.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(f.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(yn.configure(this.options.bulletList)),!1!==this.options.code&&o.push(C.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(O.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(T.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Wn.QO.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(Wn.vR.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(N.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(I.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(Wn.lb.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(z.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(K.configure(this.options.italic)),!1!==this.options.listItem&&o.push(gn.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(On.configure(null==(t=this.options)?void 0:t.listKeymap)),!1!==this.options.link&&o.push(rn.configure(null==(e=this.options)?void 0:e.link)),!1!==this.options.orderedList&&o.push(Bn.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(zn.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(Vn.configure(this.options.strike)),!1!==this.options.text&&o.push(_n.configure(this.options.text)),!1!==this.options.underline&&o.push(Kn.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Wn.JU.configure(null==(r=this.options)?void 0:r.trailingNode)),o}})},28591:function(t,e,n){n.d(e,{K:function(){return v},w:function(){return p}});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),a="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s=0;s<10;s++)r[48+s]=r[96+s]=String(s);for(s=1;s<=24;s++)r[s+111]="F"+s;for(s=65;s<=90;s++)r[s]=String.fromCharCode(s+32),o[s]=String.fromCharCode(s);for(var u in r)o.hasOwnProperty(u)||(o[u]=r[u]);var c=n(17386),l="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),f="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function d(t){var e,n,r,o,i=t.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var u=i[s];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))e=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);l?o=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function h(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];
21return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function p(t){return new c.k_({props:{handleKeyDown:v(t)}})}function v(t){var e=function(t){var e=Object.create(null);for(var n in t)e[d(n)]=t[n];return e}(t);return function(t,n){var s,u=function(t){var e=!(i&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||a&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?o:r)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),c=e[h(u,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==u.length&&" "!=u){if(n.shiftKey){var l=e[h(u,n,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(f&&n.ctrlKey&&n.altKey)&&(s=r[n.keyCode])&&s!=u){var d=e[h(s,n)];if(d&&d(t.state,t.dispatch,t))return!0}}return!1}}},42959:function(t,e,n){function r(t){this.content=t}n.d(e,{S4:function(){return ht},ZF:function(){return Ct},FK:function(){return w},CU:function(){return A},sX:function(){return lt},bP:function(){return W},u$:function(){return _},vI:function(){return E},Sj:function(){return ft},Ji:function(){return x}}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),a=o.content.slice();return-1==i?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new r(a)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),a=o.find(t);return i.splice(-1==a?i.length:a,0,e,n),new r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};var o=r;function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function s(){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},s.apply(null,arguments)}function u(t,e,n){return e=h(e),function(t,e){if(e&&("object"==p(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function l(t){var e="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(f())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&d(o,n.prototype),o}(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)},l(t)}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}
21function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}function y(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t){var e=function(t,e){if("object"!=p(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==p(e)?e:e+""}function b(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=b(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function k(t,e,n,r){for(var o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=t.child(--o),s=e.child(--i),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var c=0,l=Math.min(a.text.length,s.text.length);c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var f=k(a.content,s.content,n-1,r-1);if(f)return f}n-=u,r-=u}else n-=u,r-=u}}var w=function(){function t(e,n){if(v(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r<e.length;r++)this.size+=e[r].nodeSize}return y(t,[{key:"nodesBetween",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;a<e;i++){var s=this.content[i],u=a+s.nodeSize;if(u>t&&!1!==n(s,r+a,o||null,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,e-c),n,r+c)}a=u}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(a,s){var u=a.isText?a.text.slice(Math.max(t,s)-s,e-s):a.isLeaf?r?"function"==typeof r?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&n&&(i?i=!1:o+=n),o+=u}),0),o}},{key:"append",value:function(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new t(o,this.size+e.size)}},{key:"cut",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],o=0;if(n>e)for(var i=0,a=0;a<n;i++){var s=this.content[i],u=a+s.nodeSize;u>e&&((a<e||u>n)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=u}return new t(r,o)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new t(o,i)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}},{key:"maybeChild",value:function(t){return this.content[t]||null}}
21,{key:"forEach",value:function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}}},{key:"findDiffStart",value:function(t){return b(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function(t){return k(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size)}},{key:"findIndex",value:function(t){if(0==t)return C(0,t);if(t==this.size)return C(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var e=0,n=0;;e++){var r=n+this.child(e).nodeSize;if(r>=t)return r==t?C(e+1,r):C(e,n);n=r}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,o=0;o<e.length;o++){var i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new t(n||e,r)}},{key:"from",value:function(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}])}();w.empty=new w([],0);var D={index:0,offset:0};function C(t,e){return D.index=t,D.offset=e,D}function S(t,e){if(t===e)return!0;if(!t||"object"!=p(t)||!e||"object"!=p(e))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!S(t[r],e[r]))return!1}else{for(var o in t)if(!(o in e)||!S(t[o],e[o]))return!1;for(var i in e)if(!(i in t))return!1}return!0}var A=function(){function t(e,n){v(this,t),this.type=e,this.attrs=n}return y(t,[{key:"addToSet",value:function(t){for(var e,n=!1,r=0;r<t.length;r++){var o=t[r];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,r));else{if(o.type.excludes(this.type))return t;!n&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}},{key:"eq",value:function(t){return this==t||this.type==t.type&&S(this.attrs,t.attrs)}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type ".concat(e.type," in this schema"));var r=n.create(e.attrs);return n.checkAttrs(r.attrs),r}},{key:"sameSet",value:function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}},{key:"setFrom",value:function(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];var n=e.slice();return n.sort((function(t,e){return t.type.rank-e.type.rank})),n}}])}();A.none=[];var E=function(t){function e(){return v(this,e),u(this,e,arguments)}return c(e,t),y(e)}(l(Error)),x=function(){function t(e,n,r){v(this,t),this.content=e,this.openStart=n,this.openEnd=r}return y(t,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(e,n){var r=O(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(e,n){return new t(M(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new t(w.fromJSON(e,n.content),r,o)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;
21for(var a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new t(e,r,o)}}])}();function M(t,e,n){var r=t.findIndex(e),o=r.index,i=r.offset,a=t.maybeChild(o),s=t.findIndex(n),u=s.index,c=s.offset;if(i==e||a.isText){if(c!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(o,a.copy(M(a.content,e-i-1,n-i-1)))}function O(t,e,n,r){var o=t.findIndex(e),i=o.index,a=o.offset,s=t.maybeChild(i);if(a==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));var u=O(s.content,e-a-1,n,s);return u&&t.replaceChild(i,s.copy(u))}function T(t,e,n){if(n.openStart>t.depth)throw new E("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new E("Inconsistent open depths");return N(t,e,n,0)}function N(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){var a=N(t,e,n,r+1);return i.copy(i.content.replaceChild(o,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){var s=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),o=n-1;o>=0;o--)r=e.node(o).copy(w.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return j(i,L(t,s.start,s.end,e,r))}var u=t.parent,c=u.content;return j(u,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}return j(i,I(t,e,r))}function F(t,e){if(!e.type.compatibleContent(t.type))throw new E("Cannot join "+e.type.name+" onto "+t.type.name)}function R(t,e,n){var r=t.node(n);return F(r,e.node(n)),r}function P(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function B(t,e,n,r){var o=(e||t).node(n),i=0,a=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(P(t.nodeAfter,r),i++));for(var s=i;s<a;s++)P(o.child(s),r);e&&e.depth==n&&e.textOffset&&P(e.nodeBefore,r)}function j(t,e){return t.type.checkContent(e),t.copy(e)}function L(t,e,n,r,o){var i=t.depth>o&&R(t,e,o+1),a=r.depth>o&&R(n,r,o+1),s=[];return B(null,t,o,s),i&&a&&e.index(o)==n.index(o)?(F(i,a),P(j(i,L(t,e,n,r,o+1)),s)):(i&&P(j(i,I(t,e,o+1)),s),B(e,n,o,s),a&&P(j(a,I(n,r,o+1)),s)),B(r,null,o,s),new w(s)}function I(t,e,n){var r=[];(B(null,t,n,r),t.depth>n)&&P(j(R(t,e,n+1),I(t,e,n+1)),r);return B(e,null,n,r),new w(r)}x.empty=new x(w.empty,0,0);var z=function(){function t(e,n,r){v(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return y(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}},{key:"after",value:function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o<t;o++)r+=n.child(o).nodeSize;return r}},{key:"marks",value:function(){var t=this.parent,e=this.index();if(0==t.content.size)return A.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);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}},{key:"marksAcross",value:function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),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}},{key:"sharedDepth",value:function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new _(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos<this.pos?t:this}},{key:"toString",value:function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}}],[{key:"resolve",value:function(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=e;;){var s=a.content.findIndex(i),u=s.index,c=s.offset,l=i-c;if(r.push(a,u,o+c),!l)break;if((a=a.child(u)).isText)break;
21i=l-1,o+=c+1}return new t(n,r,i)}},{key:"resolveCached",value:function(e,n){var r=V.get(e);if(r)for(var o=0;o<r.elts.length;o++){var i=r.elts[o];if(i.pos==n)return i}else V.set(e,r=new $);var a=r.elts[r.i]=t.resolve(e,n);return r.i=(r.i+1)%H,a}}])}(),$=y((function t(){v(this,t),this.elts=[],this.i=0})),H=12,V=new WeakMap,_=function(){return y((function t(e,n,r){v(this,t),this.$from=e,this.$to=n,this.depth=r}),[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}])}(),K=Object.create(null),W=function(){function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:A.none;v(this,t),this.type=e,this.attrs=n,this.marks=o,this.content=r||w.empty}return y(t,[{key:"children",get:function(){return this.content.content}},{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}},{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&S(this.attrs,e||t.defaultAttrs||K)&&A.sameSet(this.marks,n||A.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return x.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),a=r.start(i),s=r.node(i).content.cut(r.pos-a,o.pos-a);return new x(s,r.depth-i,o.depth-i)}},{key:"replace",value:function(t,e,n){return T(this.resolve(t),this.resolve(e),n)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}},{key:"resolve",value:function(t){return z.resolveCached(this,t)}},{key:"resolveNoCache",value:function(t){return z.resolve(this,t)}},{key:"rangeHasMark",value:function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}}
21,{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),J(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(t).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var s=r;s<o;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(t).matchType(n),i=o&&o.matchFragment(this.content,e);return!!i&&i.validEnd}},{key:"canAppend",value:function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}},{key:"check",value:function(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);for(var t=A.none,e=0;e<this.marks.length;e++){var n=this.marks[e];n.type.checkAttrs(n.attrs),t=n.addToSet(t)}if(!A.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(t){return t.type.name}))));this.content.forEach((function(t){return t.check()}))}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=void 0;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=w.fromJSON(t,e.content),o=t.nodeType(e.type).create(e.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}])}();W.prototype.text=void 0;var U=function(t){function e(t,n,r,o){var i;if(v(this,e),i=u(this,e,[t,n,null,o]),!r)throw new RangeError("Empty text nodes are not allowed");return i.text=r,i}return c(e,t),y(e,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):J(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(t,e){return this.text.slice(t,e)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}},{key:"withText",value:function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}},{key:"cut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t,n,r,o,i,a=(t=e,n="toJSON",r=this,i=s(h(1&(o=3)?t.prototype:t),n,r),2&o&&"function"==typeof i?function(t){return i.apply(r,t)}:i)([]);return a.text=this.text,a}}])}(W);function J(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var q=function(){function t(e){v(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return y(t,[{key:"matchType",value:function(t){for(var e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}},{key:"matchFragment",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,o=e;r&&o<n;o++)r=r.matchType(t.child(o).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var t=0;t<this.next.length;t++){var e=this.next[t].type;if(!e.isText&&!e.hasRequiredAttrs())return e}return null}},{key:"compatible",value:function(t){for(var e=0;e<this.next.length;e++)for(var n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function o(i,a){var s=i.matchFragment(t,n);if(s&&(!e||s.validEnd))return w.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u<i.next.length;u++){var c=i.next[u],l=c.type,f=c.next;if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(f)){r.push(f);var d=o(f,a.concat(l));if(d)return d}}return null}(this,[])}},{key:"findWrapping",value:function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}},{key:"computeWrapping",value:function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(t)){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++){var u=o.next[s],c=u.type,l=u.next;c.isLeaf||c.hasRequiredAttrs()||c.name in e||r.type&&!l.validEnd||(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(t){if(t>=this.next.length)throw new RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return function e(n){t.push(n);for(var r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",o=0;o<e.next.length;o++)r+=(o?", ":"")+e.next[o].type.name+"->"+t.indexOf(e.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(e,n){var r=new Y(e,n);if(null==r.next)return t.empty;var o=G(r);r.next&&r.err("Unexpected trailing text");var i=rt(function(t){var e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var o={term:r,to:n};return e[t].push(o),o}function o(t,e){t.forEach((function(t){return t.to=e}))}function i(t,e){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(i(n,e))}),[]);if("seq"!=t.type){if("star"==t.type){var a=n();return r(e,a),o(i(t.expr,a),a),[r(a)]}if("plus"==t.type){var s=n();return o(i(t.expr,e),s),o(i(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(i(t.expr,e));if("range"==t.type){for(var u=e,c=0;c<t.min;c++){var l=n();o(i(t.expr,u),l),u=l}if(-1==t.max)o(i(t.expr,u),u);else for(var f=t.min;f<t.max;f++){var d=n();r(u,d),o(i(t.expr,u),d),u=d}
21return[r(u)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(var h=0;;h++){var p=i(t.exprs[h],e);if(h==t.exprs.length-1)return p;o(p,e=n())}}}(o));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s++){var u=o.next[s],c=u.type,l=u.next;a.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,r),i}}])}();q.empty=new q(!0);var Y=function(){return y((function t(e,n){v(this,t),this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}),[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(t){return this.next==t&&(this.pos++||!0)}},{key:"err",value:function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}])}();function G(t){var e=[];do{e.push(X(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function X(t){var e=[];do{e.push(Z(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Z(t){for(var e=function(t){if(t.eat("(")){var e=G(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.isInGroup(e)&&o.push(a)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=tt(t,e)}return e}function Q(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function tt(t,e){var n=Q(t),r=n;return t.eat(",")&&(r="}"!=t.next?Q(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function et(t,e){return e-t}function nt(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,u=a.to;s||-1!=n.indexOf(u)||e(u)}}(e),n.sort(et)}function rt(t){var e=Object.create(null);return function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){for(var i,a=0;a<o.length;a++)o[a][0]==n&&(i=o[a][1]);nt(t,r).forEach((function(t){i||o.push([n,i=[]]),-1==i.indexOf(t)&&i.push(t)}))}}))}));for(var i=e[r.join(",")]=new q(r.indexOf(t.length-1)>-1),a=0;a<o.length;a++){var s=o[a][1].sort(et);i.next.push({type:o[a][0],next:e[s.join(",")]||n(s)})}return i}(nt(t,0))}function ot(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function it(t,e){var n=Object.create(null);for(var r in t){var o=e&&e[r];if(void 0===o){var i=t[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function at(t,e,n,r){for(var o in e)if(!(o in t))throw new RangeError("Unsupported attribute ".concat(o," for ").concat(n," of type ").concat(o));for(var i in t){var a=t[i];a.validate&&a.validate(e[i])}}function st(t,e){var n=Object.create(null);if(e)for(var r in e)n[r]=new ct(t,r,e[r]);return n}var ut=function(){function t(e,n,r){v(this,t),this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=st(e,r.attrs),this.defaultAttrs=ot(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}return y(t,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==q.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"isInGroup",value:function(t){return this.groups.indexOf(t)>-1}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(t){return this==t||this.contentMatch.compatible(t.contentMatch)}},{key:"computeAttrs",value:function(t){return!t&&this.defaultAttrs?this.defaultAttrs:it(this.attrs,t)}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new W(this,this.computeAttrs(t),w.from(e),A.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=w.from(e),this.checkContent(e),new W(this,this.computeAttrs(t),e,A.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=w.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var o=this.contentMatch.matchFragment(e),i=o&&o.fillBefore(w.empty,!0);return i?new W(this,t,e.append(i),A.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(t){if(!this.validContent(t))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}},{key:"checkAttrs",value:function(t){at(this.attrs,t,"node",this.name)}},{key:"allowsMarkType",value:function(t){return null==this.markSet||this.markSet.indexOf(t)>-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}},{key:"allowedMarks",value:function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:A.none:t}}
21],[{key:"compile",value:function(e,n){var r=Object.create(null);e.forEach((function(e,o){return r[e]=new t(e,n,o)}));var o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}])}();var ct=function(){return y((function t(e,n,r){v(this,t),this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?function(t,e,n){var r=n.split("|");return function(n){var o=null===n?"null":p(n);if(r.indexOf(o)<0)throw new RangeError("Expected value of type ".concat(r," for attribute ").concat(e," on type ").concat(t,", got ").concat(o))}}(e,n,r.validate):r.validate}),[{key:"isRequired",get:function(){return!this.hasDefault}}])}(),lt=function(){function t(e,n,r,o){v(this,t),this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=st(e,o.attrs),this.excluded=null;var i=ot(this.attrs);this.instance=i?new A(this,i):null}return y(t,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new A(this,it(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]}},{key:"checkAttrs",value:function(t){at(this.attrs,t,"mark",this.name)}},{key:"excludes",value:function(t){return this.excluded.indexOf(t)>-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),o=0;return e.forEach((function(e,i){return r[e]=new t(e,o++,n,i)})),r}}])}(),ft=function(){return y((function t(e){var n=this;v(this,t),this.linebreakReplacement=null,this.cached=Object.create(null);var r=this.spec={};for(var i in e)r[i]=e[i];r.nodes=o.from(e.nodes),r.marks=o.from(e.marks||{}),this.nodes=ut.compile(this.spec.nodes,this),this.marks=lt.compile(this.spec.marks,this);var a=Object.create(null);for(var s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");var u=this.nodes[s],c=u.spec.content||"",l=u.spec.marks;if(u.contentMatch=a[c]||(a[c]=q.parse(c,this.nodes)),u.inlineContent=u.contentMatch.inlineContent,u.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!u.isInline||!u.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=u}u.markSet="_"==l?null:l?dt(this,l.split(" ")):""!=l&&u.inlineContent?null:[]}for(var f in this.marks){var d=this.marks[f],h=d.spec.excludes;d.excluded=null==h?[d]:""==h?[]:dt(this,h.split(" "))}this.nodeFromJSON=function(t){return W.fromJSON(n,t)},this.markFromJSON=function(t){return A.fromJSON(n,t)},this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}),[{key:"node",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof ut))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new U(n,n.defaultAttrs,t,A.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}])}();function dt(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=t.marks[o],a=i;if(i)n.push(i);else for(var s in t.marks){var u=t.marks[s];("_"==o||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var ht=function(){function t(e,n){var r=this;v(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[];var o=this.matchedStyles=[];
21n.forEach((function(t){if(function(t){return null!=t.tag}(t))r.tags.push(t);else if(function(t){return null!=t.style}(t)){var e=/[^=]*/.exec(t.style)[0];o.indexOf(e)<0&&o.push(e),r.styles.push(t)}})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}return y(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new bt(this,e,!1);return n.addAll(t,A.none,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new bt(this,e,!0);return n.addAll(t,A.none,e.from,e.to),x.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var o=this.tags[r];if(kt(t,o.tag)&&(void 0===o.namespace||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i||void 0}return o}}}},{key:"matchStyle",value:function(t,e,n,r){for(var o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){var i=this.styles[o],a=i.style;if(!(0!=a.indexOf(t)||i.context&&!n.matchesContext(i.context)||a.length>t.length&&(61!=a.charCodeAt(t.length)||a.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var o=e[r];if((null==o.priority?50:o.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=wt(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))};for(var o in t.marks)r(o);var i=function(e){var r=t.nodes[e].spec.parseDOM;r&&r.forEach((function(t){n(t=wt(t)),t.node||t.ignore||t.mark||(t.node=e)}))};for(var a in t.nodes)i(a);return e}},{key:"fromSchema",value:function(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}}])}(),pt={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},vt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mt={ol:!0,ul:!0};function yt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var gt=function(){return y((function t(e,n,r,o,i,a){v(this,t),this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=A.none,this.match=i||(4&a?null:e.contentMatch)}),[{key:"findWrapping",value:function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(w.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}},{key:"finish",value:function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];if(n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-e[0].length))}}var o=w.from(this.content);return!t&&this.match&&(o=o.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o}},{key:"inlineContext",value:function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!pt.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}])}(),bt=function(){return y((function t(e,n,r){v(this,t),this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;var o,i=n.topNode,a=yt(null,n.preserveWhitespace,0)|(r?4:0);o=i?new gt(i.type,i.attrs,A.none,!0,n.topMatch||i.type.contentMatch,a):new gt(r?null:e.schema.topNodeType,null,A.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}),[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}},{key:"addTextNode",value:function(t,e){var n=t.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,i=this.parser.schema;if("full"===o||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if
21(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){for(var a=n.split(/\r?\n|\r/),s=0;s<a.length;s++)s&&this.insertNode(i.linebreakReplacement.create(),e,!0),a[s]&&this.insertNode(i.text(a[s]),e,!/\S/.test(a[s]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){var u=r.content[r.content.length-1],c=t.previousSibling;(!u||c&&"BR"==c.nodeName||u.isText&&/[ \t\r\n\u000c]$/.test(u.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}},{key:"addElement",value:function(t,e,n){var r=this.localPreserveWS,o=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);var i,a=t.nodeName.toLowerCase();mt.hasOwnProperty(a)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&mt.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var s=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));t:if(s?s.ignore:vt.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(t=s.skip);var u,c=this.needsBlock;if(pt.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),u=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}var l=s&&s.skip?e:this.readStyles(t,e);l&&this.addAll(t,l),u&&this.sync(o),this.needsBlock=c}else{var f=this.readStyles(t,e);f&&this.addElementByRule(t,s,f,!1===s.consuming?i:void 0)}this.localPreserveWS=r}},{key:"leafFallback",value:function(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}},{key:"ignoreFallback",value:function(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}},{key:"readStyles",value:function(t,e){var n=this,r=t.style;if(r&&r.length)for(var o=0;o<this.parser.matchedStyles.length;o++){var i=this.parser.matchedStyles[o],a=r.getPropertyValue(i);if(a)for(var s,u=function(t){var r=n.parser.matchStyle(i,a,n,t);return r?r.ignore?{v:null}:(e=r.clearMark?e.filter((function(t){return!r.clearMark(t)})):e.concat(n.parser.schema.marks[r.mark].create(r.attrs)),!1!==r.consuming?(c=t,0):void(c=t=r)):(c=t,0)},c=void 0;0!==(s=u(c));)if(s)return s.v}return e}},{key:"addElementByRule",value:function(t,e,n,r){var o,i,a=this;if(e.node)if((i=this.parser.schema.nodes[e.node]).isLeaf)this.insertNode(i.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{var s=this.enter(i,e.attrs||null,n,e.preserveWhitespace);s&&(o=!0,n=s)}else{var u=this.parser.schema.marks[e.mark];n=n.concat(u.create(e.attrs))}var c=this.top;if(i&&i.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return a.insertNode(t,n,!1)}));else{var l=t;"string"==typeof e.contentElement?l=t.querySelector(e.contentElement):"function"==typeof e.contentElement?l=e.contentElement(t):e.contentElement&&(l=e.contentElement),this.findAround(t,l,!0),this.addAll(l,n),this.findAround(t,l,!1)}o&&this.sync(c)&&this.open--}},{key:"addAll",value:function(t,e,n,r){for(var o=n||0,i=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(i,e);this.findAtPoint(t,o)}},{key:"findPlace",value:function(t,e,n){for(var r,o,i=this.open,a=0;i>=0;i--){var s=this.nodes[i],u=s.findWrapping(t);if(u&&(!r||r.length>u.length+a)&&(r=u,o=s,!u.length))break;if(s.solid){if(n)break;a+=2}}if(!r)return null;this.sync(o);for(var c=0;c<r.length;c++)e=this.enterInner(r[c],null,e,!1);return e}},{key:"insertNode",value:function(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){var r=this.textblockFromContext();r&&(e=this.enterInner(r,null,e))}var o=this.findPlace(t,e,n);if(o){this.closeExtra();var a=this.top;a.match&&(a.match=a.match.matchType(t.type));var s,u=A.none,c=i(o.concat(t.marks));try{for(c.s();!(s=c.n()).done;){var l=s.value;(a.type?a.type.allowsMarkType(l.type):Dt(l.type,t.type))&&(u=l.addToSet(u))}}catch(t){c.e(t)}
21finally{c.f()}return a.content.push(t.mark(u)),!0}return!1}},{key:"enter",value:function(t,e,n,r){var o=this.findPlace(t.create(e),n,!1);return o&&(o=this.enterInner(t,e,n,!0,r)),o}},{key:"enterInner",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;this.closeExtra();var i=this.top;i.match=i.match&&i.match.matchType(t);var a=yt(t,o,i.options);4&i.options&&0==i.content.length&&(a|=4);var s=A.none;return n=n.filter((function(e){return!(i.type?i.type.allowsMarkType(e.type):Dt(e.type,t))||(s=e.addToSet(s),!1)})),this.nodes.push(new gt(t,e,s,r,null,a)),this.open++,n}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}},{key:"sync",value:function(t){for(var e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}},{key:"findAround",value:function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node))e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}},{key:"findInText",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}},{key:"matchesContext",value:function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(t,s){for(;t>=0;t--){var u=n[t];if(""==u){if(t==n.length-1||0==t)continue;for(;s>=i;s--)if(a(t-1,s))return!0;return!1}var c=s>0||0==s&&o?e.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;s--}return!0};return a(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}}])}();function kt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function wt(t){var e={};for(var n in t)e[n]=t[n];return e}function Dt(t,e){var n,r=e.schema.nodes,o=function(){var n=r[i];if(!n.allowsMarkType(t))return 0;var o=[],a=function(t){o.push(t);for(var n=0;n<t.edgeCount;n++){var r=t.edge(n),i=r.type,s=r.next;if(i==e)return!0;if(o.indexOf(s)<0&&a(s))return!0}};return a(n.contentMatch)?{v:!0}:void 0};for(var i in r)if(0!==(n=o())&&n)return n.v}var Ct=function(){function t(e,n){v(this,t),this.nodes=e,this.marks=n}return y(t,[{key:"serializeFragment",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=At(n).createDocumentFragment());var o=r,i=[];return t.forEach((function(t){if(i.length||t.marks.length){for(var r=0,a=0;r<i.length&&a<t.marks.length;){var s=t.marks[a];if(e.marks[s.type.name]){if(!s.eq(i[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<i.length;)o=i.pop()[1];for(;a<t.marks.length;){var u=t.marks[a++],c=e.serializeMark(u,t.isInline,n);c&&(i.push([u,o]),o.appendChild(c.dom),o=c.contentDOM||c.dom)}}o.appendChild(e.serializeNodeInner(t,n))})),r}},{key:"serializeNodeInner",value:function(t,e){var n=Mt(At(e),this.nodes[t.type.n
21ame](t),null,t.attrs),r=n.dom,o=n.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,o)}return r}},{key:"serializeNode",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.marks[t.type.name];return r&&Mt(At(n),r(t,e),null,t.attrs)}}],[{key:"renderSpec",value:function(t,e){return Mt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0)}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=St(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return St(t.marks)}}])}();function St(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function At(t){return t.document||window.document}var Et=new WeakMap;function xt(t){var e=Et.get(t);return void 0===e&&Et.set(t,e=function(t){var e=null;function n(t){if(t&&"object"==p(t))if(Array.isArray(t))if("string"==typeof t[0])e||(e=[]),e.push(t);else for(var r=0;r<t.length;r++)n(t[r]);else for(var o in t)n(t[o])}return n(t),e}(t)),e}function Mt(t,e,n,r){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var o,i=e[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=xt(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");var a,s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));var u=n?t.createElementNS(n,i):t.createElement(i),c=e[1],l=1;if(c&&"object"==p(c)&&null==c.nodeType&&!Array.isArray(c))for(var f in l=2,c)if(null!=c[f]){var d=f.indexOf(" ");d>0?u.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):"style"==f&&u.style?u.style.cssText=c[f]:u.setAttribute(f,c[f])}for(var h=l;h<e.length;h++){var v=e[h];if(0===v){if(h<e.length-1||h>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}var m=Mt(t,v,n,r),y=m.dom,g=m.contentDOM;if(u.appendChild(y),g){if(a)throw new RangeError("Multiple content holes");a=g}}return{dom:u,contentDOM:a}}},17386:function(t,e,n){n.d(e,{$t:function(){return B},LN:function(){return g},U3:function(){return D},hs:function(){return $},i5:function(){return E}
21,k_:function(){return L},nh:function(){return S},yn:function(){return b}});var r=n(42959),o=n(441);function i(t,e,n){return e=c(e),function(t,e){if(e&&("object"==d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,n||[],c(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function s(t,e,n,r){var o=u(c(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},u.apply(null,arguments)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,m(r.key),r)}}function v(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function m(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==d(e)?e:e+""}var y=Object.create(null),g=function(){return v((function t(e,n,r){h(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new b(e.min(n),e.max(n))]}),[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty,n=e.content.lastChild,o=null,i=0;i<e.openEnd;i++)o=n,n=n.lastChild;for(var a=t.steps.length,s=this.ranges,u=0;u<s.length;u++){var c=s[u],l=c.$from,f=c.$to,d=t.mapping.slice(a);t.replaceRange(d.map(l.pos),d.map(f.pos),u?r.Ji.empty:e),0==u&&O(t,a,(n?n.isInline:o&&o.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(t,e){for(var n=t.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,u=t.mapping.slice(n),c=u.map(a.pos),l=u.map(s.pos);o?t.deleteRange(c,l):(t.replaceRangeWith(c,l,e),O(t,n,e.isInline?-1:1))}}},{key:"getBookmark",value:function(){return D.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new D(t):M(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var o=t.depth-1;o>=0;o--){var i=e<0?M(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):M(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new E(t.node(0))}},{key:"atStart",value:function(t){return M(t,t,0,0,1)||new E(t)}},{key:"atEnd",value:function(t){return M(t,t,t.content.size,t.childCount,-1)||new E(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=y[e.type];if(!n)throw new RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in y)throw new RangeError("Duplicate use of selection JSON ID "+t);return y[t]=e,e.prototype.jsonID=t,e}}])}();g.prototype.visible=!0;var b=v((function t(e,n){h(this,t),this.$from=e,this.$to=n})),k=!1;function w(t){k||t.parent.inlineContent||(k=!0,console.warn("TextSelection endpoint not pointing into a
21node with inline content ("+t.parent.type.name+")"))}var D=function(t){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return h(this,e),w(t),w(n),i(this,e,[t,n])}return l(e,t),v(e,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,n){var r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return g.near(r);var o=t.resolve(n.map(this.anchor));return new e(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(s(e,"replace",this,3)([t,n]),n==r.Ji.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}}},{key:"eq",value:function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new C(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,n,r){var o=t.pos-n.pos;if(r&&!o||(r=o>=0?1:-1),!n.parent.inlineContent){var i=g.findFrom(n,r,!0)||g.findFrom(n,-r,!0);if(!i)return g.near(n,r);n=i.$head}return t.parent.inlineContent||(0==o||(t=(g.findFrom(t,-r,!0)||g.findFrom(t,r,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new e(t,n)}}])}(g);g.jsonID("text",D);var C=function(){function t(e,n){h(this,t),this.anchor=e,this.head=n}return v(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){return D.between(t.resolve(this.anchor),t.resolve(this.head))}}])}(),S=function(t){function e(t){var n;h(this,e);var r=t.nodeAfter,o=t.node(0).resolve(t.pos+r.nodeSize);return(n=i(this,e,[t,o])).node=r,n}return l(e,t),v(e,[{key:"map",value:function(t,n){var r=n.mapResult(this.anchor),o=r.deleted,i=r.pos,a=t.resolve(i);return o?g.near(a):new e(a)}},{key:"content",value:function(){return new r.Ji(r.FK.from(this.node),0,0)}},{key:"eq",value:function(t){return t instanceof e&&t.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new A(this.anchor)}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}},{key:"create",value:function(t,n){return new e(t.resolve(n))}},{key:"isSelectable",value:function(t){return!t.isText&&!1!==t.type.spec.selectable}}])}(g);S.prototype.visible=!1,g.jsonID("node",S);var A=function(){function t(e){h(this,t),this.anchor=e}return v(t,[{key:"map",value:function(e){var n=e.mapResult(this.anchor),r=n.deleted,o=n.pos;return r?new C(o,o):new t(o)}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&S.isSelectable(n)?new S(e):g.near(e)}}])}(),E=function(t){function e(t){return h(this,e),i(this,e,[t.resolve(0),t.resolve(t.content.size)])}return l(e,t),v(e,[{key:"replace",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Ji.empty;if(n==r.Ji.empty){t.delete(0,t.doc.content.size);var o=g.atStart(t.doc);o.eq(t.selection)||t.setSelection(o)}else s(e,"replace",this,3)([t,n])}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new e(t)}},{key:"eq",value:function(t){return t instanceof e}},{key:"getBookmark",value:function(){return x}}],[{key:"fromJSON",value:function(t){return new e(t)}}])}(g);g.jsonID("all",E);var x={map:function(){return this},resolve:function(t){return new E(t)}};function M(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return D.create(t,n);for(var a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){var s=e.child(a);if(s.isAtom){if(!i&&S.isSelectable(s))return S.create(t,n-(o<0?s.nodeSize:0))}else{var u=M(t,s,n+o,o<0?s.childCount:0,o,i);if(u)return u}n+=s.nodeSize*o}return null}function O(t,e,n){var r=t.steps.length-1;if(!(r<e)){var i,a=t.steps[r];if(a instanceof o.Ln||a instanceof o.Wg)t.mapping.maps[r].forEach((function(t,e,n,r){null==i&&(i=r)})),t.setSelection(g.near(t.doc.resolve(i),n))}}var T=function(t){function e(t){var n;return h(this,e),(n=i(this,e,[t.doc])).curSelectionFor=0,n.updated=0,n.meta=Object.create(null),n.time=Date.now(),n.curSelection=t.selection,n.storedMarks=t.storedMarks,n}return l(e,t),v(e,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,n){s(e,"addStep",this,3)([t,n]),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(null==n&&(n=e),!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.selection.to!=e+t.length||this.setSelection(g.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}])}(o.dL);function N(t,e){return e&&t?t.bind(e):t}var F=v((function t(e,n,r){h(this,t),this.name=e,this.init=N(n.init,r),this.apply=N(n.apply,r)})),R=[new F("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new F("selection",{init:function(t,e){return t.selection||g.atStart(e.doc)},apply:function(t){return t.selection}}),new F("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new F("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],P=v((function t(e,n){var r=this;h(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=R.slice(),n&&n.forEac
21h((function(t){if(r.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new F(t.key,t.spec.state,t))}))})),B=function(){function t(e){h(this,t),this.config=e}return v(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}},{key:"applyTransaction",value:function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var 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,u=r?r[i].state:this,c=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,u,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:e.length})}}if(!o)return{state:n,transactions:e}}}},{key:"applyInner",value:function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new t(this.config),r=this.config.fields,o=0;o<r.length;o++){var i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}},{key:"tr",get:function(){return new T(this)}},{key:"reconfigure",value:function(e){for(var n=new P(this.schema,e.plugins),r=n.fields,o=new t(n),i=0;i<r.length;i++){var a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]:r[i].init(e,o)}return o}},{key:"toJSON",value:function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==d(t))for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],o=r.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(r,this[r.key]))}return e}}],[{key:"create",value:function(e){for(var n=new P(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n),o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}},{key:"fromJSON",value:function(e,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new P(e.schema,e.plugins),a=new t(i);return i.fields.forEach((function(t){if("doc"==t.name)a.doc=r.bP.fromJSON(e.schema,n.doc);else if("selection"==t.name)a.selection=g.fromJSON(a.doc,n.selection);else if("storedMarks"==t.name)n.storedMarks&&(a.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(o)for(var i in o){var s=o[i],u=s.spec.state;if(s.key==t.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,i))return void(a[t.name]=u.fromJSON.call(s,e,n[i],a))}a[t.name]=t.init(e,a)}})),a}}])}();function j(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=j(o,e,{})),n[r]=o}return n}var L=function(){return v((function t(e){h(this,t),this.spec=e,this.props={},e.props&&j(e.props,this,this.props),this.key=e.key?e.key.key:z("plugin")}),[{key:"getState",value:function(t){return t[this.key]}}])}(),I=Object.create(null);function z(t){return t in I?t+"$"+ ++I[t]:(I[t]=0,t+"$")}var $=function(){return v((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";h(this,t),this.key=z(e)}),[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}])}()},441:function(t,e,n){n.d(e,{$L:function(){return _},Ln:function(){return M},N0:function(){return H},Um:function(){return V},Wg:function(){return O},X9:function(){return b},Ys:function(){return A},dL:function(){return nt},jP:function(){return R},n9:function(){return z},oM:function(){return P},zy:function(){return I}});var r=n(42959);function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&c(o,n.prototype),o}(t,arguments,s(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)},o(t)}function i(t,e,n){return e=s(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,a()?Reflect.construct(e,n||[],s(t).constructor):e.apply(t,n))}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}
21function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,p(r.key),r)}}function h(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function p(t){var e=function(t,e){if("object"!=l(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==l(e)?e:e+""}var v=Math.pow(2,16);function m(t){return 65535&t}var y=function(){return h((function t(e,n,r){f(this,t),this.pos=e,this.delInfo=n,this.recover=r}),[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}])}(),g=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(f(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return h(t,[{key:"recover",value:function(t){var e=0,n=m(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/v}(t)}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>t)break;var u=this.ranges[a+o],c=this.ranges[a+i],l=s+u;if(t<=l){var f=s+r+((u?t==s?-1:t==l?1:e:e)<0?0:c);if(n)return f;var d=t==(e<0?s:l)?null:a/3+(t-s)*v,h=t==s?2:t==l?1:4;return(e<0?t!=s:t!=l)&&(h|=8),new y(f,h,d)}r+=c-u}return n?t+r:new y(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=m(e),o=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>t)break;var u=this.ranges[a+o];if(t<=s+u&&a==3*r)return!0;n+=this.ranges[a+i]-u}return!1}},{key:"forEach",value:function(t){for(var e=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),u=this.ranges[r+e],c=this.ranges[r+n];t(a,a+u,s,s+c),o+=c-u}}},{key:"invert",value:function(){return new t(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(e){return 0==e?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}}])}();g.empty=new g([]);var b=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e?e.length:0;f(this,t),this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}return h(t,[{key:"maps",get:function(){return this._maps}},{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new t(this._maps,this.mirror,e,n)}},{key:"appendMap",value:function(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),null!=e&&this.setMirror(this._maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this._maps.length;e<t._maps.length;e++){var r=t.getMirror(e);this.appendMap(t._maps[e],null!=r&&r<e?n+r:void 0)}}},{key:"getMirror",value:function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}},{key:"setMirror",value:function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}},{key:"appendMappingInverted",value:function(t){for(var e=t.maps.length-1,n=this._maps.length+t._maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t._maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this._maps[n].map(t,e);return t}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,o=this.from;o<this.to;o++){var i=this._maps[o].mapResult(t,e);if(null!=i.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,t=this._maps[a].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new y(t,r,null)}}])}(),k=Object.create(null),w=function(){return h((function t(){f(this,t)}),[{key:"getMap",value:function(){return g.empty}},{key:"merge",value:function(t){return null}}],[{key:"fromJSON",value:function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=k[e.stepType];if(!n)throw new RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in k)throw new RangeError("Duplicate use of step JSON ID "+t);return k[t]=e,e.prototype.jsonID=t,e}}])}(),D=function(){function t(e,n){f(this,t),this.doc=e,this.failed=n}return h(t,null,[{key:"ok",value:function(e){return new t(e,null)}},{key:"fail",value:function(e){return new t(null,e)}},{key:"fromReplace",value:function(e,n,o,i){try{return t.ok(e.replace(n,o,i))}catch(e){if(e instanceof r.vI)return t.fail(e.message);throw e}}}])}();function C(t,e,n){for(var o=[],i=0;i<t.childCount;i++){var a=t.child(i);a.content.size&&(a=a.copy(C(a.content,e,a))),a.isInline&&(a=e(a,n,i)),o.push(a)}return r.FK.fromArray(o)}var S=function(t){function e(t,n,r){var o;return f(this,e),(o=i(this,e)).from=t,o.to=n,o.mark=r,o}return u(e,t),h(e,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new r.Ji(C(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),i),n.openStart,n.openEnd);return D.fromReplace(t,this.from,this.to,a)}},{key:"invert",value:function(){return new A(this.from,this.to,this.mark)}},{key:"map",value:function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}}])}(w);w.jsonID("addMark",S);var A=function(t){function e(t,n,r){var o;return f(this,e),(o=i(this,e)).from=t,o.to=n,o.mark=r,o}return u(e,t),h(e,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),o=new r.Ji(C(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))}),t),n.openStart,n.openEnd);return D.fromReplace(t,this.from,this.to,o)}},{key:"invert",value:function(){return new S(this.from,this.to,this.mark)}},{key:"map",value:function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}}])}(w);w.jsonID("removeMark",A);var E=function(t){function e(t,n){var r;return f(this,e),(r=i(this,e)).pos=t,r.mark=n,r}return u(e,t),h(e,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return D.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return D.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var n=t.nodeAt(this.pos);if(n){var r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(var o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new e(this.pos,n.marks[o]);return new e(this.pos,this.mark)}}return new x(this.pos,this.mark)}},{key:"map",value:function(t){var n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}}])}(w);w.jsonID("addNodeMark",E);var x=function(t){function e(t,n){var r;return f(this,e),(r=i(this,e)).pos=t,r.mark=n,r}return u(e,t),h(e,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return D.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return D.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new E(this.pos,this.mark):this}},{key:"map",value:function(t){var n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}}
21,{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}}])}(w);w.jsonID("removeNodeMark",x);var M=function(t){function e(t,n,r){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return f(this,e),(o=i(this,e)).from=t,o.to=n,o.slice=r,o.structure=a,o}return u(e,t),h(e,[{key:"apply",value:function(t){return this.structure&&T(t,this.from,this.to)?D.fail("Structure replace would overwrite content"):D.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new g([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}},{key:"merge",value:function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var o=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),o,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,r.Ji.fromJSON(t,n.slice),!!n.structure)}}])}(w);w.jsonID("replace",M);var O=function(t){function e(t,n,r,o,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return f(this,e),(u=i(this,e)).from=t,u.to=n,u.gapFrom=r,u.gapTo=o,u.slice=a,u.insert=s,u.structure=c,u}return u(e,t),h(e,[{key:"apply",value:function(t){if(this.structure&&(T(t,this.from,this.gapFrom)||T(t,this.gapTo,this.to)))return D.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return D.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?D.fromReplace(t,this.from,this.to,n):D.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new g([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,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 e(n.from,n.to,n.gapFrom,n.gapTo,r.Ji.fromJSON(t,n.slice),n.insert,!!n.structure)}}])}(w);function T(t,e,n){for(var r=t.resolve(e),o=n-e,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 N(t,e,n){for(var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t.doc.nodeAt(e),s=[],u=e+1,c=0;c<a.childCount;c++){var l=a.child(c),f=u+l.nodeSize,d=o.matchType(l.type);if(d){o=d;for(var h=0;h<l.marks.length;h++)n.allowsMarkType(l.marks[h].type)||t.step(new A(u,f,l.marks[h]));if(i&&l.isText&&"pre"!=n.whitespace)for(var p=void 0,v=/\r?\n|\r/g,m=void 0;p=v.exec(l.text);)m||(m=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new M(u+p.index,u+p.index+p[0].length,m))}else s.push(new M(u,f,r.Ji.empty));u=f}
21if(!o.validEnd){var y=o.fillBefore(r.FK.empty,!0);t.replace(u,u,new r.Ji(y,0,0))}for(var g=s.length-1;g>=0;g--)t.step(s[g])}function F(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function R(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth,r=0,o=0;;--n){var i=t.$from.node(n),a=t.$from.index(n)+r,s=t.$to.indexAfter(n)-o;if(n<t.depth&&i.canReplace(a,s,e))return n;if(0==n||i.type.spec.isolating||!F(i,a,s))break;a&&(r=1),s<i.childCount&&(o=1)}return null}function P(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,o=function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;var a=i.length?i[0]:e;return n.canReplaceWith(r,o,a)?i:null}(t,e),i=o&&function(t,e){var n=t.parent,r=t.startIndex,o=t.endIndex,i=n.child(r),a=e.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,u=r;s&&u<o;u++)s=s.matchType(n.child(u).type);return s&&s.validEnd?a:null}(r,e);return i?o.map(B).concat({type:e,attrs:n}).concat(i.map(B)):null}function B(t){return{type:t,attrs:null}}function j(t,e,n,r){e.forEach((function(o,i){if(o.isText)for(var a,s=/\r?\n|\r/g;a=s.exec(o.text);){var u=t.mapping.slice(r).map(n+1+i+a.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}))}function L(t,e,n,r){e.forEach((function(o,i){if(o.type==o.type.schema.linebreakReplacement){var a=t.mapping.slice(r).map(n+1+i);t.replaceWith(a,a+1,e.type.schema.text("\n"))}}))}function I(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=t.resolve(e),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,u=n-2;s>i;s--,u--){var c=o.node(s),l=o.index(s);if(c.type.spec.isolating)return!1;var f=c.content.cutByIndex(l,c.childCount),d=r&&r[u+1];d&&(f=f.replaceChild(0,d.type.create(d.attrs)));var h=r&&r[u]||c;if(!c.canReplace(l+1,c.childCount)||!h.type.validContent(f))return!1}var p=o.indexAfter(i),v=r&&r[0];return o.node(i).canReplaceWith(p,p,v?v.type:o.node(i+1).type)}function z(t,e){var n=t.resolve(e),r=n.index();return $(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $(t,e){return!(!t||!e||t.isLeaf||!function(t,e){e.content.size||t.type.compatibleContent(e.type);for(var n=t.contentMatchAt(t.childCount),r=t.type.schema.linebreakReplacement,o=0;o<e.childCount;o++){var i=e.child(o),a=i.type==r?t.type.schema.nodes.text:i.type;if(!(n=n.matchType(a)))return!1;if(!t.type.allowsMarks(i.marks))return!1}return n.validEnd}(t,e))}function H(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=t.resolve(e),o=r.depth;;o--){var i=void 0,a=void 0,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&$(i,a)&&r.node(o).canReplace(s,s+1))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function V(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;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 u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(u>0?1:0),l=r.node(s),f=!1;if(1==a)f=l.canReplace(c,c,o);else{var d=l.contentMatchAt(c).findWrapping(o.firstChild.type);f=d&&l.canReplaceWith(c,c,d[0])}if(f)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function _(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.Ji.empty;if(e==n&&!o.size)return null;var i=t.resolve(e),a=t.resolve(n);return K(i,a,o)?new M(e,n,o):new W(i,a,o).fit()}function K(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}w.jsonID("replaceAround",O);var W=function(){return h((function t(e,n,o){f(this,t),this.$from=e,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=r.FK.empty;for(var i=0;i<=e.depth;
21i++){var a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(var s=e.depth;s>0;s--)this.placed=r.FK.from(e.node(s).copy(this.placed))}),[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;for(var a=this.placed,s=o.depth,u=i.depth;s&&u&&1==a.childCount;)a=a.firstChild.content,s--,u--;var c=new r.Ji(a,s,u);return e>-1?new O(o.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||o.pos!=this.$to.pos?new M(o.pos,i.pos,c):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,o=this.unplaced.openEnd;n<t;n++){var i=e.firstChild;if(e.childCount>1&&(o=0),i.type.spec.isolating&&o<=n){t=n;break}e=i.content}for(var a=1;a<=2;a++)for(var s=1==a?t:this.unplaced.openStart;s>=0;s--)for(var u=null,c=(s?(u=q(this.unplaced.content,s-1).firstChild).content:this.unplaced.content).firstChild,l=this.depth;l>=0;l--){var f=this.frontier[l],d=f.type,h=f.match,p=void 0,v=null;if(1==a&&(c?h.matchType(c.type)||(v=h.fillBefore(r.FK.from(c),!1)):u&&d.compatibleContent(u.type)))return{sliceDepth:s,frontierDepth:l,parent:u,inject:v};if(2==a&&c&&(p=h.findWrapping(c.type)))return{sliceDepth:s,frontierDepth:l,parent:u,wrap:p};if(u&&h.matchType(u.type))break}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,i=q(e,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new r.Ji(e,n+1,Math.max(o,i.size+n>=e.size-o?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,i=q(e,n);if(i.childCount<=1&&n>0){var a=e.size-n<=n+i.size;this.unplaced=new r.Ji(U(e,n-1,1),n-1,a?n-1:o)}else this.unplaced=new r.Ji(U(e,n,1),n,o)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,o=t.parent,i=t.inject,a=t.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var s=0;s<a.length;s++)this.openFrontierNode(a[s]);var u=this.unplaced,c=o?o.content:u.content,l=u.openStart-e,f=0,d=[],h=this.frontier[n],p=h.match,v=h.type;if(i){for(var m=0;m<i.childCount;m++)d.push(i.child(m));p=p.matchFragment(i)}for(var y=c.size+e-(u.content.size-u.openEnd);f<c.childCount;){var g=c.child(f),b=p.matchType(g.type);if(!b)break;(++f>1||0==l||g.content.size)&&(p=b,d.push(Y(g.mark(v.allowedMarks(g.marks)),1==f?l:0,f==c.childCount?y:-1)))}var k=f==c.childCount;k||(y=-1),this.placed=J(this.placed,n,r.FK.from(d)),this.frontier[n].match=p,k&&y<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,D=c;w<y;w++){var C=D.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),D=C.content}this.unplaced=k?0==e?r.Ji.empty:new r.Ji(U(u.content,e-1,1),e-1,y<0?u.openEnd:e-1):new r.Ji(U(u.content,e,f),u.openStart,u.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!G(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=G(t,e,o,r,i);if(a){for(var s=e-1;s>=0;s--){var u=this.frontier[s],c=u.match,l=G(t,s,u.type,c,!0);if(!l||l.childCount)continue t}return{depth:e,fit:a,move:i?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=J(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=J(this.placed,this.depth,r.FK.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(r.FK.empty,!0);t.childCount&&(this.placed=J(this.placed,this.frontier.length,t))}}])}();function U(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(U(t.firstChild.content,e-1,n)))}function J(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(J(t.lastChild.content,e-1,n)))}function q(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function Y(t,e,n){if(e<=0)return t;var o=t.content;return e>1&&(o=o.replaceChild(0,Y(o.firstChild,e-1,1==o.childCount?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),t.copy(o)}function G(t,e,n,r,o){var i=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,i.content,a)?s:null}function X(t,e,n,o,i){if(e<n){var a=t.firstChild;t=t.replaceChild(0,a.copy(X(a.content,e+1,n,o,a)))}if(e>o){var s=i.contentMatchAt(0),u=s.fillBefore(t).append(t);t=u.append(s.matchFragment(u).fillBefore(r.FK.empty,!0))}return t}function Z(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(o<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(o==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==o-1)&&n.push(r)}return n}var Q=function(t){function e(t,n,r){var o;return f(this,e),(o=i(this,e)).pos=t,o.attr=n,o.value=r,o}return u(e,t),h(e,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return D.fail("No node at attribute step's position");var n=Object.create(null);for(var o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return D.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,e.isLeaf?0:1))}},{key:"getMap",value:function(){return g.empty}},{key:"invert",value:function(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}}])}(w);w.jsonID("attr",Q);var tt=function(t){function e(t,n){var r;return f(this,e),(r=i(this,e)).attr=t,r.value=n,r}return u(e,t),h(e,[{key:"apply",value:function(t){var e=Object.create(null);for(var n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;var r=t.type.create(e,t.content,t.marks);return D.ok(r)}},{key:"getMap",value:function(){return g.empty}},{key:"invert",value:function(t){return new e(this.attr,t.attrs[this.attr])}},{key:"map",value:function(t){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}}])}(w);w.jsonID("docAttr",tt);var et=Error;((et=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype)).constructor=et,et.prototype.name="TransformError";var nt=function(){return h((function t(e){f(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new b}),[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var e=this.maybeStep(t);if(e.failed)throw new et(e.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.Ji.empty,o=_(this.doc,t,e,n);return o&&this.step(o),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new r.Ji(r.FK.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,r.Ji.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return function(t,e,n,o){if(!o.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),a=t.doc.resolve(n);if(K(i,a,o))return t.step(new M(e,n,o));var s=Z(i,a);0==s[s.length-1]&&s.pop();var u=-(i.depth+1);s.unshift(u);for(var c=i.depth,l=i.pos-1;c>0;c--,l--){var f=i.node(c).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;s.indexOf(c)>-1?u=c:i.before(c)==l&&s.splice(1,0,-c)}for(var d,h=s.indexOf(u),p=[],v=o.openStart,m=o.content,y=0;;y++){var g=m.firstChild;if(p.push(g),y==o.openStart)break;m=g.content}for(var b=v-1;b>=0;b--){var k=p[b],w=(d=k.type).spec.defining||d.spec.definingForContent;if(w&&!k.sameMarkup(i.node(Math.abs(u)-1)))v=b;else if(w||!k.type.isTextblock)break}for(var D=o.openStart;D>=0;D--){var C=(D+v+1)%(o.openStart+1),S=p[C];if(S)for(var A=0;A<s.length;A++){var E=s[(A+h)%s.length],x=!0;E<0&&(x=!1,E=-E);var O=i.node(E-1),T=i.index(E-1);if(O.canReplaceWith(T,T,S.type,S.marks))return t.replace(i.before(E),x?a.after(E):n,new r.Ji(X(o.content,0,o.openStart,C),C,o.openEnd))}}for(var N=t.steps.length,F=s.length-1;F>=0&&(t.replace(e,n,o),!(t.steps.length>N));F--){var R=s[F];R<0||(e=i.before(R),n=a.after(R))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){return function(t,e,n,o){if(!o.isInline&&e==n&&t.doc.resolve(e).parent.content.size){var i=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var 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}return null}(t.doc,e,o.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new r.Ji(r.FK.from(o),0,0))}(this,t,e,n),this}},{key:"deleteRange",value:function(t,e){return function(t,e,n){for(var r=t.doc.resolve(e),o=t.doc.resolve(n),i=Z(r,o),a=0;a<i.length;a++){var s=i[a],u=a==i.length-1;if(u&&0==s||r.node(s).type.contentMatch.validEnd)return t.delete(r.start(s),o.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return t.delete(r.before(s),o.after(s))}for(var c=1;c<=r.depth&&c<=o.depth;c++)if(e-r.start(c)==r.depth-c&&n>r.end(c)&&o.end(c)-n!=o.depth-c&&r.start(c-1)==o.start(c-1)&&r.node(c-1).canReplace(r.index(c-1),o.index(c-1)))return t.delete(r.before(c),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return function(t,e,n){for(var o=e.$from,i=e.$to,a=e.depth,s=o.before(a+1),u=i.after(a+1),c=s,l=u,f=r.FK.empty,d=0,h=a,p=!1;h>n;h--)p||o.index(h)>0?(p=!0,f=r.FK.from(o.node(h).copy(f)),d++):c--;for(var v=r.FK.empty,m=0,y=a,g=!1;y>n;
21y--)g||i.after(y+1)<i.end(y)?(g=!0,v=r.FK.from(i.node(y).copy(v)),m++):l++;t.step(new O(c,l,s,u,new r.Ji(f.append(v),d,m),f.size-d,!0))}(this,t,e),this}},{key:"join",value:function(t){return function(t,e,n){var o=null,i=t.doc.type.schema.linebreakReplacement,a=t.doc.resolve(e-n),s=a.node().type;if(i&&s.inlineContent){var u="pre"==s.whitespace,c=!!s.contentMatch.matchType(i);u&&!c?o=!1:!u&&c&&(o=!0)}var l=t.steps.length;if(!1===o){var f=t.doc.resolve(e+n);L(t,f.node(),f.before(),l)}s.inlineContent&&N(t,e+n-1,s,a.node().contentMatchAt(a.index()),null==o);var d=t.mapping.slice(l),h=d.map(e-n);if(t.step(new M(h,d.map(e+n,-1),r.Ji.empty,!0)),!0===o){var p=t.doc.resolve(h);j(t,p.node(),p.before(),t.steps.length)}}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this}},{key:"wrap",value:function(t,e){return function(t,e,n){for(var o=r.FK.empty,i=n.length-1;i>=0;i--){if(o.size){var a=n[i].type.contentMatch.matchFragment(o);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=r.FK.from(n[i].type.create(n[i].attrs,o))}var s=e.start,u=e.end;t.step(new O(s,u,s,u,new r.Ji(o,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){return function(t,e,n,o,i){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=t.steps.length;t.doc.nodesBetween(e,n,(function(e,n){var s="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(o,s)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(t.doc,t.mapping.slice(a).map(n),o)){var u=null;if(o.schema.linebreakReplacement){var c="pre"==o.whitespace,l=!!o.contentMatch.matchType(o.schema.linebreakReplacement);c&&!l?u=!1:!c&&l&&(u=!0)}!1===u&&L(t,e,n,a),N(t,t.mapping.slice(a).map(n,1),o,void 0,null===u);var f=t.mapping.slice(a),d=f.map(n,1),h=f.map(n+e.nodeSize,1);return t.step(new O(d,h,d+1,h-1,new r.Ji(r.FK.from(o.create(s,null,e.marks)),0,0),1,!0)),!0===u&&j(t,e,n,a),!1}}))}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,arguments.length>2?arguments[2]:void 0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:null),this}},{key:"setNodeMarkup",value:function(t,e){return function(t,e,n,o,i){var a=t.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");n||(n=a.type);var s=n.create(o,null,i||a.marks);if(a.isLeaf)return t.replaceWith(e,e+a.nodeSize,s);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new O(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new r.Ji(r.FK.from(s),0,0),1,!0))}(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,arguments.length>3?arguments[3]:void 0),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new Q(t,e,n)),this}},{key:"setDocAttribute",value:function(t,e){return this.step(new tt(t,e)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new E(t,e)),this}},{key:"removeNodeMark",value:function(t,e){var n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(e instanceof r.CU)e.isInSet(n.marks)&&this.step(new x(t,e));else{for(var o,i=n.marks,a=[];o=e.isInSet(i);)a.push(new x(t,o)),i=o.removeFromSet(i);for(var s=a.length-1;s>=0;s--)this.step(a[s])}return this}},{key:"split",value:function(t){return function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),a=r.FK.empty,s=r.FK.empty,u=i.depth,c=i.depth-n,l=n-1;u>c;u--,l--){a=r.FK.from(i.node(u).copy(a));var f=o&&o[l];s=r.FK.from(f?f.type.create(f.attrs,s):i.node(u).copy(s))}t.step(new M(e,e,new r.Ji(a.append(s),n,n),!0))}(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0),this}},{key:"addMark",value:function(t,e,n){return function(t,e,n,r){var o,i,a=[],s=[];t.doc.nodesBetween(e,n,(function(t,u,c){if(t.isInline){var l=t.marks;if(!r.isInSet(l)&&c.type.allowsMarkType(r.type)){for(var f=Math.max(u,e),d=Math.min(u+t.nodeSize,n),h=r.addToSet(l),p=0;p<l.length;p++)l[p].isInSet(h)||(o&&o.to==f&&o.mark.eq(l[p])?o.to=d:a.push(o=new A(f,d,l[p])));i&&i.to==f?i.to=d:s.push(i=new S(f,d,r))}}})),a.forEach((function(e){return t.step(e)}
21)),s.forEach((function(e){return t.step(e)}))}(this,t,e,n),this}},{key:"removeMark",value:function(t,e,n){return function(t,e,n,o){var i=[],a=0;t.doc.nodesBetween(e,n,(function(t,s){if(t.isInline){a++;var u=null;if(o instanceof r.sX)for(var c,l=t.marks;c=o.isInSet(l);)(u||(u=[])).push(c),l=c.removeFromSet(l);else o?o.isInSet(t.marks)&&(u=[o]):u=t.marks;if(u&&u.length)for(var f=Math.min(s+t.nodeSize,n),d=0;d<u.length;d++){for(var h=u[d],p=void 0,v=0;v<i.length;v++){var m=i[v];m.step==a-1&&h.eq(i[v].style)&&(p=m)}p?(p.to=f,p.step=a):i.push({style:h,from:Math.max(s,e),to:f,step:a})}}})),i.forEach((function(e){return t.step(new A(e.from,e.to,e.style))}))}(this,t,e,n),this}},{key:"clearIncompatible",value:function(t,e,n){return N(this,t,e,n),this}}])}()},33822:function(t,e,n){n.d(e,{Lz:function(){return Pn},NZ:function(){return on},zF:function(){return un}});var r=n(17386),o=n(42959),i=n(441);function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||u(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=u(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function l(t,e,n){return e=p(e),function(t,e){if(e&&("object"==y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,n||[],p(t).constructor):e.apply(t,n))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}function d(t,e,n,r){var o=h(p(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=p(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},h.apply(null,arguments)}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,w(r.key),r)}}function k(t,e,n){return e&&b(t.prototype,e),n&&b(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function w(t){var e=function(t,e){if("object"!=y(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}
21(t,"string");return"symbol"==y(e)?e:e+""}var D=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},C=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},S=null,A=function(t,e,n){var r=S||(S=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},E=function(t,e,n,r){return n&&(M(t,e,n,r,-1)||M(t,e,n,r,1))},x=/^(img|br|input|textarea|hr)$/i;function M(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:O(t))){var a=t.parentNode;if(!a||1!=a.nodeType||T(t)||x.test(t.nodeName)||"false"==t.contentEditable)return!1;e=D(t)+(o<0?0:1),t=a}else{if(1!=t.nodeType)return!1;var s=t.childNodes[e+(o<0?-1:0)];if(1==s.nodeType&&"false"==s.contentEditable){if(!(null===(i=s.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;e+=o}else t=s,e=o<0?O(t):0}}}function O(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function T(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var N=function(t){return t.focusNode&&E(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function F(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}var R="undefined"!=typeof navigator?navigator:null,P="undefined"!=typeof document?document:null,B=R&&R.userAgent||"",j=/Edge\/(\d+)/.exec(B),L=/MSIE \d/.exec(B),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(B),z=!!(L||I||j),$=L?document.documentMode:I?+I[1]:j?+j[1]:0,H=!z&&/gecko\/(\d+)/i.test(B);H&&(/Firefox\/(\d+)/.exec(B)||[0,0])[1];var V=!z&&/Chrome\/(\d+)/.exec(B),_=!!V,K=V?+V[1]:0,W=!z&&!!R&&/Apple Computer/.test(R.vendor),U=W&&(/Mobile\/\w+/.test(B)||!!R&&R.maxTouchPoints>2),J=U||!!R&&/Mac/.test(R.platform),q=!!R&&/Win/.test(R.platform),Y=/Android \d/.test(B),G=!!P&&"webkitFontSmoothing"in P.documentElement.style,X=G?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Z(t){var e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Q(t,e){return"number"==typeof t?t:t[e]}function tt(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function et(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,a=n||t.dom;a;)if(1==a.nodeType){var s=a,u=s==i.body,c=u?Z(i):tt(s),l=0,f=0;if(e.top<c.top+Q(r,"top")?f=-(c.top-e.top+Q(o,"top")):e.bottom>c.bottom-Q(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Q(o,"top")-c.top:e.bottom-c.bottom+Q(o,"bottom")),e.left<c.left+Q(r,"left")?l=-(c.left-e.left+Q(o,"left")):e.right>c.right-Q(r,"right")&&(l=e.right-c.right+Q(o,"right")),l||f)if(u)i.defaultView.scrollBy(l,f);else{var d=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),l&&(s.scrollLeft+=l);var p=s.scrollLeft-d,v=s.scrollTop-h;e={left:e.left-p,top:e.top-v,right:e.right-p,bottom:e.bottom-v}}var m=u?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(m))break;a="absolute"==m?a.offsetParent:C(a)}else a=C(a)}function nt(t){for(var e=[],n=t.ownerDocument,r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=C(r));return e}function rt(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=r.dom,i=r.top,a=r.left;o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=a&&(o.scrollLeft=a)}}var ot=null;function it(t,e){for(var n,r,o,i,a=2e8,s=0,u=e.top,c=e.top,l=t.firstChild,f=0;l;l=l.nextSibling,f++){var d=void 0;if(1==l.nodeType)d=l.getClientRects();else{if(3!=l.nodeType)continue;d=A(l).getClientRects()}for(var h=0;h<d.length;h++){var p=d[h];if(p.top<=u&&p.bottom>=c){u=Math.max(p.bottom,u),c=Math.min(p.top,c);var v=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(v<a){n=l,a=v,r=v&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==l.nodeType&&v&&(s=f+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!o&&p.left<=e.left&&p.right>=e.left&&(o=l,i={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(s=f+1)}}return!n&&o&&(n=o,r=i,a=0),n&&3==n.nodeType?function(t,e){for(var n,r=t.no
21deValue.length,o=document.createRange(),i=0;i<r;i++){o.setEnd(t,i+1),o.setStart(t,i);var a=lt(o,1);if(a.top!=a.bottom&&at(e,a)){n={node:t,offset:i+(e.left>=(a.left+a.right)/2?1:0)};break}}return o.detach(),n||{node:t,offset:0}}(n,r):!n||a&&1==n.nodeType?{node:t,offset:s}:it(n,r)}function at(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function st(t,e,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){var a=t.childNodes[i];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var c=s[u];if(at(e,c))return st(a,e,c)}if((i=(i+1)%r)==o)break}return t}function ut(t,e){var n,r=t.dom.ownerDocument,o=0,i=function(t,e,n){if(t.caretPositionFromPoint)try{var r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(O(r.offsetNode),r.offset)}}catch(t){}if(t.caretRangeFromPoint){var o=t.caretRangeFromPoint(e,n);if(o)return{node:o.startContainer,offset:Math.min(O(o.startContainer),o.startOffset)}}}(r,e.left,e.top);i&&(n=i.node,o=i.offset);var a,s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){var u=t.dom.getBoundingClientRect();if(!at(e,u))return null;if(!(s=st(t.dom,e,u)))return null}if(W)for(var c=s;n&&c;c=C(c))c.draggable&&(n=void 0);if(s=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(s,e),n){if(H&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length))<n.childNodes.length){var l,f=n.childNodes[o];"IMG"==f.nodeName&&(l=f.getBoundingClientRect()).right<=e.left&&l.bottom>e.top&&o++}var d;G&&o&&1==n.nodeType&&1==(d=n.childNodes[o-1]).nodeType&&"false"==d.contentEditable&&d.getBoundingClientRect().top>=e.top&&o--,n==t.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(a=function(t,e,n,r){for(var o=-1,i=e,a=!1;i!=t.dom;){var s=t.docView.nearestDesc(i,!0),u=void 0;if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((u=s.dom.getBoundingClientRect()).width||u.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!a&&u.left>r.left||u.top>r.top?o=s.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(o=s.posAfter),a=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?s.posBefore:s.posAfter;i=s.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}(t,n,o,e))}null==a&&(a=function(t,e,n){var r=it(e,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(o,i,a)}(t,s,e));var h=t.docView.nearestDesc(s,!0);return{pos:a,inside:h?h.posAtStart-h.border:-1}}function ct(t){return t.top<t.bottom||t.left<t.right}function lt(t,e){var n=t.getClientRects();if(n.length){var r=n[e<0?0:n.length-1];if(ct(r))return r}return Array.prototype.find.call(n,ct)||t.getBoundingClientRect()}var ft=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function dt(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,a=r.atom,s=G||H;if(3==o.nodeType){if(!s||!ft.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var u=i,c=i,l=n<0?1:-1;return n<0&&!i?(c++,l=-1):n>=0&&i==o.nodeValue.length?(u--,l=1):n<0?u--:c++,ht(lt(A(o,u,c),l),l<0)}var f=lt(A(o,i,i),n);if(H&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){var d=lt(A(o,i-1,i-1),-1);if(d.top==f.top){var h=lt(A(o,i,i+1),-1);if(h.top!=f.top)return ht(h,h.left<d.left)}}return f}if(!t.state.doc.resolve(e-(a||0)).parent.inlineContent){if(null==a&&i&&(n<0||i==O(o))){var p=o.childNodes[i-1];if(1==p.nodeType)return pt(p.getBoundingClientRect(),!1)}if(null==a&&i<O(o)){var v=o.childNodes[i];if(1==v.nodeType)return pt(v.getBoundingClientRect(),!0)}return pt(o.getBoundingClientRect(),n>=0)}if(null==a&&i&&(n<0||i==O(o))){var m=o.childNodes[i-1],y=3==m.nodeType?A(m,O(m)-(s?0:1)):1!=m.nodeType||"BR"==m.n
21odeName&&m.nextSibling?null:m;if(y)return ht(lt(y,1),!1)}if(null==a&&i<O(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var b=g?3==g.nodeType?A(g,0,s?0:1):1==g.nodeType?g:null:null;if(b)return ht(lt(b,-1),!0)}return ht(lt(3==o.nodeType?A(o):o,-n),n>=0)}function ht(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function pt(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function vt(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var mt=/[\u0590-\u08ac]/;var yt=null,gt=null,bt=!1;function kt(t,e,n){return yt==e&>==n?bt:(yt=e,gt=n,bt="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return vt(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.contentDOM||r.dom;break}e=r.dom.parentNode}for(var i=dt(t,o.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=A(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var c=s[u];if(c.bottom>c.top+1&&("up"==n?i.top-c.top>2*(c.bottom-i.top):c.bottom-i.bottom>2*(i.bottom-c.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=t.domSelection();return s?mt.test(r.parent.textContent)&&s.modify?vt(t,e,(function(){var e=t.domSelectionRange(),o=e.focusNode,i=e.focusOffset,a=e.anchorNode,u=e.anchorOffset,c=s.caretBidiLevel;s.modify("move",n,"character");var l=r.depth?t.docView.domAfterPos(r.before()):t.dom,f=t.domSelectionRange(),d=f.focusNode,h=f.focusOffset,p=d&&!l.contains(1==d.nodeType?d:d.parentNode)||o==d&&i==h;try{s.collapse(a,u),o&&(o!=a||i!=u)&&s.extend&&s.extend(o,i)}catch(t){}return null!=c&&(s.caretBidiLevel=c),p})):"left"==n||"backward"==n?i:a:r.pos==r.start()||r.pos==r.end()}(t,e,n))}var wt=function(){return k((function t(e,n,r,o){g(this,t),this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}),[{key:"matchesWidget",value:function(t){return!1}},{key:"matchesMark",value:function(t){return!1}},{key:"matchesNode",value:function(t,e,n){return!1}},{key:"matchesHack",value:function(t){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(t){return!1}},{key:"size",get:function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var t=0;t<this.children.length;t++)this.children[t].destroy()}},{key:"posBeforeChild",value:function(t){for(var e=0,n=this.posAtStart;;e++){var r=this.children[e];if(r==t)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,o;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(o=r.pmViewDesc)||o.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(o)+o.size:this.posAtStart}var i,a;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(t==this.dom&&this.contentDOM)s=e>D(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var u=t;;u=u.parentNode){if(u==this.dom){s=!1;break}if(u.previousSibling)break}if(null==s&&e==t.childNodes.length)for(var c=t;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!e||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==t.nodeType?t:t.parentNode):i==t))return o;n=!1}}}},{key:"getDesc",value:function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e}},{key:"posFromDOM",value:function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1}},{key:"descAt",value:function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],o=n+r.size;if(n==t&&o!=n){for(;!r.border&&r.children.length;)for(var i=0;i<r.children.length;i++){var a=r.children[i];if(a.size){r=a;break}}return r}if(t<o)return r.descAt(t-n-r.border);n=o}}},{key:"domFromPos",value:function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};for(var n,r=0,o=0,i=0;r<this.children.length;r++){var a=this.children[r],s=i+a.size;if(s>t||a instanceof Mt){o=t-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Dt&&n.side>=0;r--);if(e<=0){for(var u,c=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,c=!1);return u&&e&&c&&!u.border&&!u.domAtom?u.domFromPos(u.size,e):{node:this.contentDOM,offset:u?D(u.dom)+1:0}}for(var l,f=!0;(l=r<this.children.length?this.children[r]:null)&&l.dom.parentNode!=this.contentDOM;r++,f=!1);return l&&f&&!l.border&&!l.domAtom?l.domFromPos(0,e):{node:this.contentDOM,offset:l?D(l.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],u=i+s.size;if(-1==r&&t<=u){var c=i+s.border;if(t>=c&&e<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,c);t=i;for(var l=a;l>0;
21l--){var f=this.children[l-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=D(f.dom)+1;break}t-=f.size}-1==r&&(r=0)}if(r>-1&&(u>e||a==this.children.length-1)){e=u;for(var d=a+1;d<this.children.length;d++){var h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=D(h.dom);break}e+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=u}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:o}}},{key:"emptyChildAt",value:function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}},{key:"domAfterPos",value:function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}},{key:"setSelection",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=Math.min(t,e),i=Math.max(t,e),a=0,s=0;a<this.children.length;a++){var u=this.children[a],c=s+u.size;if(o>s&&i<c)return u.setSelection(t-s-u.border,e-s-u.border,n,r);s=c}var l=this.domFromPos(t,t?-1:1),f=e==t?l:this.domFromPos(e,e?-1:1),d=n.root.getSelection(),h=n.domSelectionRange(),p=!1;if((H||W)&&t==e){var v=l,m=v.node,y=v.offset;if(3==m.nodeType){if((p=!(!y||"\n"!=m.nodeValue[y-1]))&&y==m.nodeValue.length)for(var g,b=m;b;b=b.parentNode){if(g=b.nextSibling){"BR"==g.nodeName&&(l=f={node:g.parentNode,offset:D(g)+1});break}var k=b.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{var w=m.childNodes[y-1];p=w&&("BR"==w.nodeName||"false"==w.contentEditable)}}if(H&&h.focusNode&&h.focusNode!=f.node&&1==h.focusNode.nodeType){var C=h.focusNode.childNodes[h.focusOffset];C&&"false"==C.contentEditable&&(r=!0)}if(r||p&&W||!E(l.node,l.offset,h.anchorNode,h.anchorOffset)||!E(f.node,f.offset,h.focusNode,h.focusOffset)){var S=!1;if((d.extend||t==e)&&(!p||!H)){d.collapse(l.node,l.offset);try{t!=e&&d.extend(f.node,f.offset),S=!0}catch(t){}}if(!S){if(t>e){var A=l;l=f,f=A}var x=document.createRange();x.setEnd(f.node,f.offset),x.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(x)}}}},{key:"ignoreMutation",value:function(t){return!this.contentDOM&&"selection"!=t.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(t,e){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var a=n+o.border,s=i-o.border;if(t>=a&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=a||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-a,e-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}},{key:"ignoreForSelection",get:function(){return!1}},{key:"isText",value:function(t){return!1}}])}(),Dt=function(t){function e(t,n,r,o){var i;g(this,e);var a,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return a?a.parent?a.parent.posBeforeChild(a):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var u=document.createElement("span");u.appendChild(s),s=u}s.contentEditable="false",s.classList.add("ProseMirror-widget")}return(i=l(this,e,[t,[],s,null])).widget=n,i.widget=n,a=i,i}return v(e,t),k(e,[{key:"matchesWidget",value:function(t){return 0==this.dirty&&t.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)}},{key:"ignoreMutation",value:function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),d(e,"destroy",this,3)([])}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForSelection",get:function(){return!!this.widget.type.spec.relaxedSide}},{key:"side",get:function(){return this.widget.type.side}}])}(wt),Ct=function(t){function e(t,n,r,o){var i;return g(this,e),(i=l(this,e,[t,[],n,null])).textDOM=r,i.text=o,i}return v(e,t),k(e,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}},{key:"domFromPos",value:function(t){return{node:this.textDOM,offset:t}}},{key:"ignoreMutation",value:function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}])}(wt),St=function(t){function e(t,n,r,o,i){var a;return g(this,e),(a=l(this,e,[t,[],r,o])).mark=n,a.spec=i,a}return v(e,t),k(e,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}},{key:"matchesMark",value:function(t){return 3!=this.dirty&&this.mark.eq(t)}},{key:"markDirty",value:function(t,n){if(d(e,"markDirty",this,3)([t,n]),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(t,n,r){var o=e.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=Ht(i,n,a,r)),t>
210&&(i=Ht(i,0,t,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o}},{key:"ignoreMutation",value:function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):d(e,"ignoreMutation",this,3)([t])}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),d(e,"destroy",this,3)([])}}],[{key:"create",value:function(t,n,r,i){var a=i.nodeViews[n.type.name],s=a&&a(n,i,r);return s&&s.dom||(s=o.ZF.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,s.dom,s.contentDOM||s.dom,s)}}])}(wt),At=function(t){function e(t,n,r,o,i,a,s,u,c){var f;return g(this,e),(f=l(this,e,[t,[],i,a])).node=n,f.outerDeco=r,f.innerDeco=o,f.nodeDOM=s,f}return v(e,t),k(e,[{key:"parseRule",value:function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=function(){return o.FK.empty})}else e.contentElement=this.contentDOM;else e.getContent=function(){return t.node.content};return e}},{key:"matchesNode",value:function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Lt(e,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(t,e){var n=this,r=this.node.inlineContent,i=e,a=t.composing?this.localCompositionInfo(t,e):null,s=a&&a.pos>-1?a:null,u=a&&a.pos<0,c=new zt(this,s&&s.node,t);!function(t,e,n,r){var o=e.locals(t),i=0;if(0==o.length){for(var a=0;a<t.childCount;a++){var s=t.child(a);r(s,o,e.forChild(i,s),a),i+=s.nodeSize}return}for(var u=0,c=[],l=null,f=0;;){for(var d=void 0,h=void 0;u<o.length&&o[u].to==i;){var p=o[u++];p.widget&&(d?(h||(h=[d])).push(p):d=p)}if(d)if(h){h.sort($t);for(var v=0;v<h.length;v++)n(h[v],f,!!l)}else n(d,f,!!l);var m=void 0,y=void 0;if(l)y=-1,m=l,l=null;else{if(!(f<t.childCount))break;y=f,m=t.child(f++)}for(var g=0;g<c.length;g++)c[g].to<=i&&c.splice(g--,1);for(;u<o.length&&o[u].from<=i&&o[u].to>i;)c.push(o[u++]);var b=i+m.nodeSize;if(m.isText){var k=b;u<o.length&&o[u].from<k&&(k=o[u].from);for(var w=0;w<c.length;w++)c[w].to<k&&(k=c[w].to);k<b&&(l=m.cut(k-i),m=m.cut(0,k-i),b=k,y=-1)}else for(;u<o.length&&o[u].to<b;)u++;r(m,m.isInline&&!m.isLeaf?c.filter((function(t){return!t.inline})):c.slice(),e.forChild(i,m),y),i=b}}(this.node,this.innerDeco,(function(e,a,s){e.spec.marks?c.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!s&&c.syncToMarks(a==n.node.childCount?o.CU.none:n.node.child(a).marks,r,t),c.placeWidget(e,t,i)}),(function(e,n,o,s){var l;c.syncToMarks(e.marks,r,t),c.findNodeMatch(e,n,o,s)||u&&t.state.selection.from>i&&t.state.selection.to<i+e.nodeSize&&(l=c.findIndexWithChild(a.node))>-1&&c.updateNodeAt(e,n,o,l,t)||c.updateNextNode(e,n,o,t,s,i)||c.addNode(e,n,o,t,i),i+=e.nodeSize})),c.syncToMarks([],r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),Tt(this.contentDOM,this.children,t),U&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}},{key:"localCompositionInfo",value:function(t,e){var n=t.state.selection,o=n.from,i=n.to;if(!(t.state.selection instanceof r.U3)||o<e||i>e+this.node.content.size)return null;var a=t.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){var s=a.nodeValue,u=function(t,e,n,r){for(var o=0,i=0;o<t.childCount&&i<=r;){var a=t.child(o++),s=i;if(i+=a.nodeSize,a.isText){for(var u=a.text;o<t.childCount;){var c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;u+=c.text}if(i>=n){if(i>=r&&u.slice(r-e.length-s,r-s)==e)return r-e.length;var l=s<r?u.lastIndexOf(e,r-s-1):-1;if(l>=0&&l+e.length+s>=n)return s+l;if(n==r&&u.length>=r+e.length-s&&u.slice(r-s,r-s+e.length)==e)return r}}}return-1}(this.node.content,s,o-e,i-e);return u<0?null:{node:a,pos:u,text:s}}return{node:a,pos:-1,text:""}}
21},{key:"protectLocalComposition",value:function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new Ct(this,i,n,o);t.input.compositionNodes.push(a),this.children=Ht(this.children,r,r+o.length,t,a)}}},{key:"update",value:function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}},{key:"updateInner",value:function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(t){if(!Lt(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Pt(this.dom,this.nodeDOM,Rt(this.outerDeco,this.node,e),Rt(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(t,n,r,i,a,s){var u,c=a.nodeViews[n.type.name],l=c&&c(n,a,(function(){return u?u.parent?u.parent.posBeforeChild(u):void 0:s}),r,i),f=l&&l.dom,d=l&&l.contentDOM;if(n.isText)if(f){if(3!=f.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else f=document.createTextNode(n.text);else if(!f){var h=o.ZF.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);f=h.dom,d=h.contentDOM}d||n.isText||"BR"==f.nodeName||(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));var p=f;return f=jt(f,r,n),l?u=new Ot(t,n,r,i,f,d||null,p,l,a,s+1):n.isText?new xt(t,n,r,i,f,p,a):new e(t,n,r,i,f,d||null,p,a,s+1)}}])}(wt);function Et(t,e,n,r,o){jt(r,e,t);var i=new At(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}var xt=function(t){function e(t,n,r,o,i,a,s){return g(this,e),l(this,e,[t,n,r,o,i,null,a,s,0])}return v(e,t),k(e,[{key:"parseRule",value:function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}},{key:"update",value:function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}},{key:"domFromPos",value:function(t){return{node:this.nodeDOM,offset:t}}},{key:"localPosFromDOM",value:function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):d(e,"localPosFromDOM",this,3)([t,n,r])}},{key:"ignoreMutation",value:function(t){return"characterData"!=t.type&&"selection"!=t.type}},{key:"slice",value:function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(t,n){d(e,"markDirty",this,3)([t,n]),this.dom==this.nodeDOM||0!=t&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}},{key:"isText",value:function(t){return this.node.text==t}}])}(At),Mt=function(t){function e(){return g(this,e),l(this,e,arguments)}return v(e,t),k(e,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(t){return 0==this.dirty&&this.dom.nodeName==t}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}])}(wt),Ot=function(t){function e(t,n,r,o,i,a,s,u,c,f){var d;return g(this,e),(d=l(this,e,[t,n,r,o,i,a,s,c,f])).spec=u,d}return v(e,t),k(e,[{key:"update",value:function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){var i=this.spec.update(t,n,r);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&d(e,"update",this,3)([t,n,r,o])}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():d(e,"selectNode",this,3)([])}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():d(e,"deselectNode",this,3)([])}},{key:"setSelection",value:function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r.root):d(e,"setSelection",this,3)([t,n,r,o])}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),d(e,"destroy",this,3)([])}},{key:"stopEvent",value:function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}},{key:"ignoreMutation",value:function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):d(e,"ignoreMutation",this,3)([t])}}])}(At);function Tt(t,e,n){for(var r=t.firstChild,o=!1,i=0;i<e.length;i++){var a=e[i],s=a.dom;if(s.parentNode==t){for(;s!=r;)r=It(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(s,r);if(a instanceof St){var u=r?r.previousSibling:t.lastChild;Tt(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=It(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}var Nt=function(t){t&&(this.nodeName=t)};Nt.prototype=Object.create(null);var Ft=[new Nt];function Rt(t,e,n){if(0==t.length)return Ft;
21for(var r=n?Ft[0]:new Nt,o=[r],i=0;i<t.length;i++){var a=t[i].type.attrs;if(a)for(var s in a.nodeName&&o.push(r=new Nt(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==o.length&&o.push(r=new Nt(e.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return o}function Pt(t,e,n,r){if(n==Ft&&r==Ft)return e;for(var o=e,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var u=void 0;s&&s.nodeName==a.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(o),s=Ft[0]),o=u}Bt(o,s||Ft[0],a)}return o}function Bt(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<i.length;s++)-1==a.indexOf(i[s])&&t.classList.remove(i[s]);for(var u=0;u<a.length;u++)-1==i.indexOf(a[u])&&t.classList.add(a[u]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var c,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=l.exec(e.style);)t.style.removeProperty(c[1]);n.style&&(t.style.cssText+=n.style)}}function jt(t,e,n){return Pt(t,t,Ft,Rt(e,n,1!=t.nodeType))}function Lt(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function It(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var zt=function(){return k((function t(e,n,r){g(this,t),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(t,e){var n=e,r=n.children.length,o=t.childCount,i=new Map,a=[];t:for(;o>0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof St)){s=u,r--;break}n=u,r=u.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=t.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(e.node.content,e)}),[{key:"destroyBetween",value:function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(t,e,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,t.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){var u=this.top.children[s];if(u.matchesMark(t[o])&&!this.isLocked(u.dom)){a=s;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=St.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(t,e,n,r){var o,i=-1;
21if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(t,e,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var u=this.top.children[a];if(u.matchesNode(t,e,n)&&!this.preMatch.matched.has(u)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}},{key:"updateNodeAt",value:function(t,e,n,r,o){var i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(t,e,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}t=e}}},{key:"updateNextNode",value:function(t,e,n,r,o,i){for(var a=this.index;a<this.top.children.length;a++){var s=this.top.children[a];if(s instanceof At){var u=this.preMatch.matched.get(s);if(null!=u&&u!=o)return!1;var c=s.dom,l=void 0,f=this.isLocked(c)&&!(t.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==t.text&&3!=s.dirty&&Lt(e,s.outerDeco));if(!f&&s.update(t,e,n,r))return this.destroyBetween(this.index,a),s.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(l=this.recreateWrapper(s,t,e,n,r,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=l,l.contentDOM&&(l.dirty=2,l.updateChildren(r,i+1),l.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}},{key:"recreateWrapper",value:function(t,e,n,r,o,i){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!Lt(n,t.outerDeco)||!r.eq(t.innerDeco))return null;var a=At.create(this.top,e,n,r,o,i);if(a.contentDOM){a.children=t.children,t.children=[];var u,c=s(a.children);try{for(c.s();!(u=c.n()).done;){u.value.parent=a}}catch(t){c.e(t)}finally{c.f()}}return t.destroy(),a}},{key:"addNode",value:function(t,e,n,r,o){var i=At.create(this.top,t,e,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}},{key:"placeWidget",value:function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var o=new Dt(this.top,t,e,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var t=this.top.children[this.index-1],e=this.top;t instanceof St;)t=(e=t).children[e.children.length-1];(!t||!(t instanceof xt)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((W||_)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{var n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");var r=new Mt(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}},{key:"isLocked",value:function(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}])}();function $t(t,e){return t.type.side-e.type.side}function Ht(t,e,n,r,o){for(var i=[],a=0,s=0;a<t.length;a++){var u=t[a],c=s,l=s+=u.size;c>=n||l<=e?i.push(u):(c<e&&i.push(u.slice(0,e-c,r)),o&&(i.push(o),o=void 0),l>n&&i.push(u.slice(n-c,u.size,r)))}return i}function Vt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;var i=t.docView.nearestDesc(n.focusNode),s=i&&0==i.size,u=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(u<0)return null;var c,l,f=o.resolve(u);if(N(n)){for(c=u;i&&!i.node;)i=i.parent;var d=i.node;if(i&&d.isAtom&&r.nh.isSelectable(d)&&i.parent&&(!d.isInline||!function(t,e,n){for(var r=0==e,o=e==O(t);r||o;){if(t==n)return!0;var i=D(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==O(t)}}(n.focusNode,n.focusOffset,i.dom))){var h=i.posBefore;l=new r.nh(u==h?f:o.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){for(var p=u,v=u,m=0;m<n.rangeCount;m++){var y=n.getRangeAt(m);p=Math.min(p,t.docView.posFromDOM(y.startContainer,y.startOffset,1)),v=Math.max(v,t.docView.posFromDOM(y.endContainer,y.endOffset,-1))}if(p<0)return null;var g=a(v==t.state.selection.anchor?[v,p]:[p,v],2);c=g[0],u=g[1],f=o.resolve(u)}else c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}var b=o.resolve(c);l||(l=Xt(t,b,f,"pointer"==e||t.state.selection.head<f.pos&&!s?1:-1));return l}function _t(t){return t.editable?t.hasFocus():Qt(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Kt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.state.selection;if(Yt(t,n),_t(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&_){var o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&E(o.anchorNode,o.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.domSelection();if(!e)return;var n=t.cursorWrapper.dom,r="IMG"==n.nodeName;r?e.collapse(n.parentNode,D(n)+1):e.collapse(n,0);!r&&!t.state.selection.visible&&z&&$<=11&&(n.disabled=!0,n.disabled=!1)}(t);
21else{var a,s,u=n.anchor,c=n.head;!Wt||n instanceof r.U3||(n.$from.parent.inlineContent||(a=Ut(t,n.from)),n.empty||n.$from.parent.inlineContent||(s=Ut(t,n.to))),t.docView.setSelection(u,c,t,e),Wt&&(a&&qt(a),s&&qt(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);var n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((function(){_t(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var Wt=W||_&&K<63;function Ut(t,e){var n=t.docView.domFromPos(e,0),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(W&&i&&"false"==i.contentEditable)return Jt(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return Jt(i);if(a)return Jt(a)}}function Jt(t){return t.contentEditable="true",W&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function qt(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Yt(t,e){if(e instanceof r.nh){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Gt(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Gt(t)}function Gt(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Xt(t,e,n,o){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}
21))||r.U3.between(e,n,o)}function Zt(t){return!(t.editable&&!t.hasFocus())&&Qt(t)}function Qt(t){var e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function te(t,e){var n=t.selection,o=n.$anchor,i=n.$head,a=e>0?o.max(i):o.min(i),s=a.parent.inlineContent?a.depth?t.doc.resolve(e>0?a.after():a.before()):null:a;return s&&r.LN.findFrom(s,e)}function ee(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ne(t,e,n){var o=t.state.selection;if(!(o instanceof r.U3)){if(o instanceof r.nh&&o.node.isInline)return ee(t,new r.U3(e>0?o.$to:o.$from));var i=te(t.state,e);return!!i&&ee(t,i)}if(n.indexOf("s")>-1){var a=o.$head,s=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;var u=t.state.doc.resolve(a.pos+s.nodeSize*(e<0?-1:1));return ee(t,new r.U3(o.$anchor,u))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){var c=te(t.state,e);return!!(c&&c instanceof r.nh)&&ee(t,c)}if(!(J&&n.indexOf("m")>-1)){var l,f=o.$head,d=f.textOffset?null:e<0?f.nodeBefore:f.nodeAfter;if(!d||d.isText)return!1;var h=e<0?f.pos-d.nodeSize:f.pos;return!!(d.isAtom||(l=t.docView.descAt(h))&&!l.contentDOM)&&(r.nh.isSelectable(d)?ee(t,new r.nh(e<0?t.state.doc.resolve(f.pos-d.nodeSize):f)):!!G&&ee(t,new r.U3(t.state.doc.resolve(e<0?h:h+d.nodeSize))))}}function re(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function oe(t,e){var n=t.pmViewDesc;return n&&0==n.size&&(e<0||t.nextSibling||"BR"!=t.nodeName)}function ie(t,e){return e<0?function(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;var o,i,a=!1;H&&1==n.nodeType&&r<re(n)&&oe(n.childNodes[r],-1)&&(a=!0);for(;;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(oe(s,-1))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(ae(n))break;for(var u=n.previousSibling;u&&oe(u,-1);)o=n.parentNode,i=D(u),u=u.previousSibling;if(u)r=re(n=u);else{if((n=n.parentNode)==t.dom)break;r=0}}a?se(t,n,r):o&&se(t,o,i)}(t):function(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;for(var o,i,a=re(n);;)if(r<a){if(1!=n.nodeType)break;if(!oe(n.childNodes[r],1))break;o=n,i=++r}else{if(ae(n))break;for(var s=n.nextSibling;s&&oe(s,1);)o=s.parentNode,i=D(s)+1,s=s.nextSibling;if(s)r=0,a=re(n=s);else{if((n=n.parentNode)==t.dom)break;r=a=0}}o&&se(t,o,i)}(t)}function ae(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function se(t,e,n){var r,o;3!=e.nodeType&&((o=function(t,e){for(;t&&e==t.childNodes.length&&!T(t);)e=D(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){var n=t.childNodes[e];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=n,e=0}}(e,n))?(e=o,n=0):(r=function(t,e){for(;t&&!e&&!T(t);)e=D(t),t=t.parentNode;for(;t&&e;){var n=t.childNodes[e-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=(t=n).childNodes.length}}(e,n))&&(e=r,n=r.nodeValue.length));var i=t.domSelection();if(i){if(N(i)){var a=document.createRange();a.setEnd(e,n),a.setStart(e,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(e,n);t.domObserver.setCurSelection();var s=t.state;setTimeout((function(){t.state==s&&Kt(t)}),50)}}function ue(t,e){var n=t.state.doc.resolve(e);if(!_&&!q&&n.parent.inlineContent){var r=t.coordsAtPos(e);if(e>n.start()){var o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){var a=t.coordsAtPos(e+1),s=(a.top+a.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(t.dom).direction?"rtl":"ltr"}function ce(t,e,n){var o=t.state.selection;if(o instanceof r.U3&&!o.empty||n.indexOf("s")>-1)return!1;if(J&&n.indexOf("m")>-1)return!1;var i=o.$from,a=o.$to;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=te(t.state,e);if(s&&s instanceof r.nh)return ee(t,s)}if(!i.parent.inlineContent){var u=e<0?i:a,c=o instanceof r.i5?r.LN.near
21(u,e):r.LN.findFrom(u,e);return!!c&&ee(t,c)}return!1}function le(t,e){if(!(t.state.selection instanceof r.U3))return!0;var n=t.state.selection,o=n.$head,i=n.$anchor,a=n.empty;if(!o.sameParent(i))return!0;if(!a)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!o.textOffset&&(e<0?o.nodeBefore:o.nodeAfter);if(s&&!s.isText){var u=t.state.tr;return e<0?u.delete(o.pos-s.nodeSize,o.pos):u.delete(o.pos,o.pos+s.nodeSize),t.dispatch(u),!0}return!1}function fe(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function de(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);if(8==n||J&&72==n&&"c"==r)return le(t,-1)||ie(t,-1);if(46==n&&!e.shiftKey||J&&68==n&&"c"==r)return le(t,1)||ie(t,1);if(13==n||27==n)return!0;if(37==n||J&&66==n&&"c"==r){var o=37==n?"ltr"==ue(t,t.state.selection.from)?-1:1:-1;return ne(t,o,r)||ie(t,o)}if(39==n||J&&70==n&&"c"==r){var i=39==n?"ltr"==ue(t,t.state.selection.from)?1:-1:1;return ne(t,i,r)||ie(t,i)}return 38==n||J&&80==n&&"c"==r?ce(t,-1,r)||ie(t,-1):40==n||J&&78==n&&"c"==r?function(t){if(!W||t.state.selection.$head.parentOffset>0)return!1;var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;fe(t,o,"true"),setTimeout((function(){return fe(t,o,"false")}),20)}return!1}(t)||ce(t,1,r)||ie(t,1):r==(J?"m":"c")&&(66==n||73==n||89==n||90==n)}function he(t,e){t.someProp("transformCopied",(function(n){e=n(e,t)}));for(var n=[],r=e,i=r.content,a=r.openStart,s=r.openEnd;a>1&&s>1&&1==i.childCount&&1==i.firstChild.childCount;){a--,s--;var u=i.firstChild;n.push(u.type.name,u.attrs!=u.type.defaultAttrs?u.attrs:null),i=u.content}var c=t.someProp("clipboardSerializer")||o.ZF.fromSchema(t.state.schema),l=Ce(),f=l.createElement("div");f.appendChild(c.serializeFragment(i,{document:l}));for(var d,h=f.firstChild,p=0;h&&1==h.nodeType&&(d=we[h.nodeName.toLowerCase()]);){for(var v=d.length-1;v>=0;v--){for(var m=l.createElement(d[v]);f.firstChild;)m.appendChild(f.firstChild);f.appendChild(m),p++}h=f.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice","".concat(a," ").concat(s).concat(p?" -".concat(p):""," ").concat(JSON.stringify(n))),{dom:f,text:t.someProp("clipboardTextSerializer",(function(n){return n(e,t)}))||e.content.textBetween(0,e.content.size,"\n\n"),slice:e}}function pe(t,e,n,r,i){var a,s,u=i.parent.type.spec.code;if(!n&&!e)return null;var c=!!e&&(r||u||!n);if(c){if(t.someProp("transformPastedText",(function(n){e=n(e,u||r,t)})),u)return s=new o.Ji(o.FK.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0),t.someProp("transformPasted",(function(e){s=e(s,t,!0)})),s;var l=t.someProp("clipboardTextParser",(function(n){return n(e,i,r,t)}));if(l)s=l;else{var f=i.marks(),d=t.state.schema,h=o.ZF.fromSchema(d);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=a.appendChild(document.createElement("p"));t&&e.appendChild(h.serializeNode(d.text(t,f)))}))}}else t.someProp("transformPastedHTML",(function(e){n=e(n,t)})),a=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=Ce().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&we[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""));if(r.innerHTML=function(t){var e=window.trustedTypes;if(!e)return t;Se||(Se=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:function(t){return t}}));return Se.createHTML(t)}(t),n)for(var i=0;i<n.length;i++)r=r.querySelector(n[i])||r;return r}(n),G&&function(t){for(var e=t.querySelectorAll(_?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var r=e[n];1==r.childNodes.length&&"Â "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(a);var p=a&&a.querySelector("[data-pm-slice]"),v=p&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(p.getAttribute("data-pm-slice")||"");if(v&&v[3])for(var m=+v[3];m>0;m--){for(var y=a.firstChild;y&&1!=y.nodeType;)y=y.nextSibling;if(!y)break;a=y}if(!s){var g=t.someProp("clipboardParser")||t.someProp("domParser")||o.S4.fromSchema(t.state.schema);s=g.parseSlice(a,{preserveWhitespace:!(!c&&!v),context:i,ruleFromNode:function(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||ve.test(t.parentNode.nodeName)?null:{ignore:!0}}})}if(v)s=function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var i=t.content,a=t.openStart,s=t.openEnd,u=n.length-2;u>=0;u-=2){var c=r.nodes[n[u]];if(!c||c.hasRequiredAttrs())break;i=o.FK.from(c.create(n[u+1],i)),a++,s++}return new o.Ji(i,a,s)}(ke(s,+v[1],+v[2]),v[4]);else if(s=o.Ji.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n,r=function(){var n,r=e.node(i).contentMatchAt(e.index(i)),a=[];
21if(t.forEach((function(t){if(a){var e,o=r.findWrapping(t.type);if(!o)return a=null;if(e=a.length&&n.length&&ye(o,n,t,a[a.length-1],0))a[a.length-1]=e;else{a.length&&(a[a.length-1]=ge(a[a.length-1],n.length));var i=me(t,o);a.push(i),r=r.matchType(i.type),n=o}}})),a)return{v:o.FK.from(a)}},i=e.depth;i>=0;i--)if(n=r())return n.v;return t}(s.content,i),!0),s.openStart||s.openEnd){for(var b=0,k=0,w=s.content.firstChild;b<s.openStart&&!w.type.spec.isolating;b++,w=w.firstChild);for(var D=s.content.lastChild;k<s.openEnd&&!D.type.spec.isolating;k++,D=D.lastChild);s=ke(s,b,k)}return t.someProp("transformPasted",(function(e){s=e(s,t,c)})),s}var ve=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function me(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.length-1;r>=n;r--)t=e[r].create(null,o.FK.from(t));return t}function ye(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){var a=ye(t,e,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(o.FK.from(me(n,t,i+1))))}}function ge(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,ge(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(o.FK.empty,!0);return t.copy(n.append(r))}function be(t,e,n,r,i,a){var s=e<0?t.firstChild:t.lastChild,u=s.content;return t.childCount>1&&(a=0),i<r-1&&(u=be(u,e,n,r,i+1,a)),i>=n&&(u=e<0?s.contentMatchAt(0).fillBefore(u,a<=i).append(u):u.append(s.contentMatchAt(s.childCount).fillBefore(o.FK.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(u))}function ke(t,e,n){return e<t.openStart&&(t=new o.Ji(be(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new o.Ji(be(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var we={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},De=null;function Ce(){return De||(De=document.implementation.createHTMLDocument("title"))}var Se=null;var Ae={},Ee={},xe={touchstart:!0,touchmove:!0},Me=k((function t(){g(this,t),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}));function Oe(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Te(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=function(e){return Ne(t,e)})}))}function Ne(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function Fe(t){return{left:t.clientX,top:t.clientY}}function Re(t,e,n,r,o){if(-1==r)return!1;for(var i,a=t.state.doc.resolve(r),s=function(r){if(t.someProp(e,(function(e){return r>a.depth?e(t,n,a.nodeAfter,a.before(r),o,!0):e(t,n,a.node(r),a.before(r),o,!1)})))return{v:!0}},u=a.depth+1;u>0;u--)if(i=s(u))return i.v;return!1}function Pe(t,e,n){if(t.focused||t.focus(),!t.state.selection.eq(e)){var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}}function Be(t,e,n,o,i){return Re(t,"handleClickOn",e,n,o)||t.someProp("handleClick",(function(n){return n(t,e,o)}))||(i?function(t,e){if(-1==e)return!1;var n,o,i=t.state.selection;i instanceof r.nh&&(n=i.node);for(var a=t.state.doc.resolve(e),s=a.depth+1;s>0;s--){var u=s>a.depth?a.nodeAfter:a.node(s);if(r.nh.isSelectable(u)){o=n&&i.$from.depth>0&&s>=i.$from.depth&&a.before(i.$from.depth+1)==i.$from.pos?a.before(i.$from.depth):a.before(s);break}}
21return null!=o&&(Pe(t,r.nh.create(t.state.doc,o),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),o=n.nodeAfter;return!!(o&&o.isAtom&&r.nh.isSelectable(o))&&(Pe(t,new r.nh(n),"pointer"),!0)}(t,n))}function je(t,e,n,r){return Re(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Le(t,e,n,o){return Re(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",(function(n){return n(t,e,o)}))||function(t,e,n){if(0!=n.button)return!1;var o=t.state.doc;if(-1==e)return!!o.inlineContent&&(Pe(t,r.U3.create(o,0,o.content.size),"pointer"),!0);for(var i=o.resolve(e),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a),u=i.before(a);if(s.inlineContent)Pe(t,r.U3.create(o,u+1,u+1+s.content.size),"pointer");else{if(!r.nh.isSelectable(s))continue;Pe(t,r.nh.create(o,u),"pointer")}return!0}}(t,n,o)}function Ie(t){return Ue(t)}Ee.keydown=function(t,e){var n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!He(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!Y||!_||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!U||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(function(e){return e(t,n)}))||de(t,n)?n.preventDefault():Oe(t,"key");else{var r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout((function(){t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",(function(e){return e(t,F(13,"Enter"))})),t.input.lastIOSEnter=0)}),200)}},Ee.keyup=function(t,e){16==e.keyCode&&(t.input.shiftKey=!1)},Ee.keypress=function(t,e){var n=e;if(!(He(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||J&&n.metaKey))if(t.someProp("handleKeyPress",(function(e){return e(t,n)})))n.preventDefault();else{var o=t.state.selection;if(!(o instanceof r.U3&&o.$from.sameParent(o.$to))){var i=String.fromCharCode(n.charCode),a=function(){return t.state.tr.insertText(i).scrollIntoView()};/[\r\n]/.test(i)||t.someProp("handleTextInput",(function(e){return e(t,o.$from.pos,o.$to.pos,i,a)}))||t.dispatch(a()),n.preventDefault()}}};var ze=J?"metaKey":"ctrlKey";Ae.mousedown=function(t,e){var n=e;t.input.shiftKey=n.shiftKey;var r=Ie(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[ze]&&t.input.lastClick.button==n.button&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};var a=t.posAtCoords(Fe(n));a&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new $e(t,a,n,!!r)):("doubleClick"==i?je:Le)(t,a.pos,a.inside,n)?n.preventDefault():Oe(t,"pointer"))};var $e=function(){return k((function t(e,n,o,i){var a,s,u=this;if(g(this,t),this.view=e,this.pos=n,this.event=o,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!o[ze],this.allowDefault=o.shiftKey,n.inside>-1)a=e.state.doc.nodeAt(n.inside),s=n.inside;else{var c=e.state.doc.resolve(n.pos);a=c.parent,s=c.depth?c.before():0}var l=i?null:o.target,f=l?e.docView.nearestDesc(l,!0):null;this.target=f&&1==f.nodeDOM.nodeType?f.nodeDOM:null;var d=e.state.selection;(0==o.button&&a.type.spec.draggable&&!1!==a.type.spec.selectable||d instanceof r.nh&&d.from<=s&&d.to>s)&&(this.mightDrag={node:a,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!H||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){u.view.input.mouseDown==u&&u.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Oe(e,"pointer")}),[{key:"done",value:function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return Kt(t.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(t){if(this.done(),this.view.dom.contains(t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Fe(t))),this.updateAllowDefault(t),this.allowDefault||!e?Oe(this.view,"pointer"):Be(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||W&&this.mightDrag&&!this.mightDrag.node.isAtom||_&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Pe(this.view,r.LN.near
21(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Oe(this.view,"pointer")}}},{key:"move",value:function(t){this.updateAllowDefault(t),Oe(this.view,"pointer"),0==t.buttons&&this.done()}},{key:"updateAllowDefault",value:function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}])}();function He(t,e){return!!t.composing||!!(W&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Ae.touchstart=function(t){t.input.lastTouch=Date.now(),Ie(t),Oe(t,"pointer")},Ae.touchmove=function(t){t.input.lastTouch=Date.now(),Oe(t,"pointer")},Ae.contextmenu=function(t){return Ie(t)};var Ve=Y?5e3:-1;function _e(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((function(){return Ue(t)}),e))}function Ke(t){var e;for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=((e=document.createEvent("Event")).initEvent("event",!0,!0),e.timeStamp));t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function We(t){var e=t.domSelectionRange();if(!e.focusNode)return null;var n=function(t,e){for(;;){if(3==t.nodeType&&e)return t;if(1==t.nodeType&&e>0){if("false"==t.contentEditable)return null;e=O(t=t.childNodes[e-1])}else{if(!t.parentNode||T(t))return null;e=D(t),t=t.parentNode}}}(e.focusNode,e.focusOffset),r=function(t,e){for(;;){if(3==t.nodeType&&e<t.nodeValue.length)return t;if(1==t.nodeType&&e<t.childNodes.length){if("false"==t.contentEditable)return null;t=t.childNodes[e],e=0}else{if(!t.parentNode||T(t))return null;e=D(t)+1,t=t.parentNode}}}(e.focusNode,e.focusOffset);if(n&&r&&n!=r){var o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){var a=n.pmViewDesc;if(a&&a.isText(n.nodeValue))return r}}return n||r}function Ue(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(Y&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Ke(t),e||t.docView&&t.docView.dirty){var n=Vt(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}Ee.compositionstart=Ee.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$to;if(e.selection instanceof r.U3&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))||_&&q&&function(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n||1!=n.nodeType||r>=n.childNodes.length)return!1;var o=n.childNodes[r];return 1==o.nodeType&&"false"==o.contentEditable}(t)))t.markCursor=t.state.storedMarks||n.marks(),Ue(t,!0),t.markCursor=null;else if(Ue(t,!e.selection.empty),H&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var o=t.domSelectionRange(),i=o.focusNode,a=o.focusOffset;i&&1==i.nodeType&&0!=a;){var s=a<0?i.lastChild:i.childNodes[a-1];if(!s)break;if(3==s.nodeType){var u=t.domSelection();u&&u.collapse(s,s.nodeValue.length);break}i=s,a=-1}t.input.composing=!0}_e(t,Ve)},Ee.compositionend=function(t,e){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then((function(){return t.domObserver.flush()})),t.input.compositionID++,_e(t,20))};var Je=z&&$<15||U&&X<604;function qe(t,e,n,r,i){var a=pe(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,i,a||o.Ji.empty)})))return!0;if(!a)return!1;var s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(a),u=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(a);return t.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ye(t){var e=t.getData("text/plain")||t.getData("Text");if(e)return e;
21var n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ae.copy=Ee.cut=function(t,e){var n=e,r=t.state.selection,o="cut"==n.type;if(!r.empty){var i=Je?null:n.clipboardData,a=he(t,r.content()),s=a.dom,u=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",u)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ee.paste=function(t,e){var n=e;if(!t.composing||Y){var r=Je?null:n.clipboardData,o=t.input.shiftKey&&45!=t.input.lastKeyCode;r&&qe(t,Ye(r),r.getData("text/html"),o,n)?n.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();var o=t.input.shiftKey&&45!=t.input.lastKeyCode;setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?qe(t,r.value,null,o,e):qe(t,r.textContent,r.innerHTML,o,e)}),50)}}(t,n)}};var Ge=k((function t(e,n,r){g(this,t),this.slice=e,this.move=n,this.node=r})),Xe=J?"altKey":"ctrlKey";function Ze(t,e){var n=t.someProp("dragCopies",(function(t){return!t(e)}));return null!=n?n:!e[Xe]}for(var Qe in Ae.dragstart=function(t,e){var n=e,o=t.input.mouseDown;if(o&&o.done(),n.dataTransfer){var i,a=t.state.selection,s=a.empty?null:t.posAtCoords(Fe(n));if(s&&s.pos>=a.from&&s.pos<=(a instanceof r.nh?a.to-1:a.to));else if(o&&o.mightDrag)i=r.nh.create(t.state.doc,o.mightDrag.pos);else if(n.target&&1==n.target.nodeType){var u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(i=r.nh.create(t.state.doc,u.posBefore))}var c=he(t,(i||t.state.selection).content()),l=c.dom,f=c.text,d=c.slice;(!n.dataTransfer.files.length||!_||K>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Je?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Je||n.dataTransfer.setData("text/plain",f),t.dragging=new Ge(d,Ze(t,n),i)}},Ae.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},Ee.dragover=Ee.dragenter=function(t,e){return e.preventDefault()},Ee.drop=function(t,e){try{!function(t,e,n){if(!e.dataTransfer)return;var a=t.posAtCoords(Fe(e));if(!a)return;var s=t.state.doc.resolve(a.pos),u=n&&n.slice;u?t.someProp("transformPasted",(function(e){u=e(u,t,!1)})):u=pe(t,Ye(e.dataTransfer),Je?null:e.dataTransfer.getData("text/html"),!1,s);var c=!(!n||!Ze(t,e));if(t.someProp("handleDrop",(function(n){return n(t,e,u||o.Ji.empty,c)})))return void e.preventDefault();if(!u)return;e.preventDefault();var l=u?(0,i.Um)(t.state.doc,s.pos,u):s.pos;null==l&&(l=s.pos);var f=t.state.tr;if(c){var d=n.node;d?d.replace(f):f.deleteSelection()}var h=f.mapping.map(l),p=0==u.openStart&&0==u.openEnd&&1==u.content.childCount,v=f.doc;p?f.replaceRangeWith(h,h,u.content.firstChild):f.replaceRange(h,h,u);if(f.doc.eq(v))return;var m=f.doc.resolve(h);if(p&&r.nh.isSelectable(u.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(u.content.firstChild))f.setSelection(new r.nh(m));else{var y=f.mapping.map(l);f.mapping.maps[f.mapping.maps.length-1].forEach((function(t,e,n,r){return y=r})),f.setSelection(Xt(t,m,f.doc.resolve(y)))}t.focus(),t.dispatch(f.setMeta("uiEvent","drop"))}(t,e,t.dragging)}finally{t.dragging=null}},Ae.focus=function(t){t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kt(t)}),20))},Ae.blur=function(t,e){var n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Ae.beforeinput=function(t,e){if(_&&Y&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.input.domChangeCount;setTimeout((function(){if(t.input.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,F(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},Ee)Ae[Qe]=Ee[Qe];function tn(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var en=function(){function t(e,n){g(this,t),this.toDOM=e,this.spec=n||sn,this.side=this.spec.side||0}return k(t,[{key:"map",value:function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new on(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&tn(this.spec,e.spec))}},{key:"destroy",value:function(t){this.spec.destroy&&this.spec.destroy(t)}}])}(),nn=function(){function t(e,n){g(this,t),this.attrs=e,this.spec=n||sn}return k(t,[{key:"map",value:function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new on(o,i,this)}},{key:"valid",value:function(t,e){return e.from<e.to}},{key:"eq",value:function(e){return this==e||e instanceof t&&tn(this.attrs,e.attrs)&&tn(this.spec,e.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(e){return e.type instanceof t}}])}(),rn=function(){function t(e,n){g(this,t),this.attrs=e,this.spec=n||sn}return k(t,[{key:"map",value:function(t,e,n,r){var o=t.mapResult(e.from+r,1);if(o.deleted)return null;var i=t.mapResult(e.to+r,-1);return i.deleted||i.pos<=o.pos?null:new on(o.pos-n,i.pos-n,this)}},{key:"valid",value:function(t,e){var n,r=t.content.findIndex(e.from),o=r.index,i=r.offset;return i==e.from&&!(n=t.child(o)).isText&&i+n.nodeSize==e.to}},{key:"eq",value:function(e){return this==e||e instanceof t&&tn(this.attrs,e.attrs)&&tn(this.spec,e.spec)}},{key:"destroy",value:function(){}}])}(),on=function(){function t(e,n,r){g(this,t),this.from=e,this.to=n,this.type=r}
21return k(t,[{key:"copy",value:function(e,n){return new t(e,n,this.type)}},{key:"eq",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}},{key:"map",value:function(t,e,n){return this.type.map(t,this,e,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof nn}},{key:"widget",get:function(){return this.type instanceof en}}],[{key:"widget",value:function(e,n,r){return new t(e,e,new en(n,r))}},{key:"inline",value:function(e,n,r,o){return new t(e,n,new nn(r,o))}},{key:"node",value:function(e,n,r,o){return new t(e,n,new rn(r,o))}}])}(),an=[],sn={},un=function(){function t(e,n){g(this,t),this.local=e.length?e:an,this.children=n.length?n:an}return k(t,[{key:"find",value:function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r}},{key:"findInner",value:function(t,e,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=e&&a.to>=t&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){var u=this.children[s]+1;this.children[s+2].findInner(t-u,e-u,n,r+u,o)}}},{key:"map",value:function(t,e,n){return this==cn||0==t.maps.length?this:this.mapInner(t,e,0,0,n||sn)}},{key:"mapInner",value:function(e,n,r,o,i){for(var a,s=0;s<this.local.length;s++){var u=this.local[s].map(e,r,o);u&&u.type.valid(n,u)?(a||(a=[])).push(u):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?fn(this.children,a||[],e,n,r,o,i):a?new t(a.sort(mn),an):cn}},{key:"add",value:function(e,n){return n.length?this==cn?t.create(e,n):this.addInner(e,n,0):this}},{key:"addInner",value:function(e,n,r){var o,i=this,a=0;e.forEach((function(t,e){var s,u=e+r;if(s=hn(n,t,u)){for(o||(o=i.children.slice());a<o.length&&o[a]<e;)a+=3;o[a]==e?o[a+2]=o[a+2].addInner(t,s,u+1):o.splice(a,0,e,e+t.nodeSize,vn(s,t,u+1,sn)),a+=3}}));for(var s=dn(a?pn(n):n,-r),u=0;u<s.length;u++)s[u].type.valid(e,s[u])||s.splice(u--,1);return new t(s.length?this.local.concat(s).sort(mn):this.local,o||this.children)}},{key:"remove",value:function(t){return 0==t.length||this==cn?this:this.removeInner(t,0)}},{key:"removeInner",value:function(e,n){for(var r=this.children,o=this.local,i=0;i<r.length;i+=3){for(var a,s=void 0,u=r[i]+n,c=r[i+1]+n,l=0;l<e.length;l++)(a=e[l])&&a.from>u&&a.to<c&&(e[l]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var f=r[i+2].removeInner(s,u+1);f!=cn?r[i+2]=f:(r.splice(i,3),i-=3)}}if(o.length)for(var d,h=0;h<e.length;h++)if(d=e[h])for(var p=0;p<o.length;p++)o[p].eq(d,n)&&(o==this.local&&(o=this.local.slice()),o.splice(p--,1));return r==this.children&&o==this.local?this:o.length||r.length?new t(o,r):cn}},{key:"forChild",value:function(e,n){if(this==cn)return this;if(n.isLeaf)return t.empty;for(var r,o,i=0;i<this.children.length;i+=3)if(this.children[i]>=e){this.children[i]==e&&(r=this.children[i+2]);break}for(var a=e+1,s=a+n.content.size,u=0;u<this.local.length;u++){var c=this.local[u];if(c.from<s&&c.to>a&&c.type instanceof nn){var l=Math.max(a,c.from)-a,f=Math.min(s,c.to)-a;l<f&&(o||(o=[])).push(c.copy(l,f))}}if(o){var d=new t(o.sort(mn),an);return r?new ln([d,r]):d}return r||cn}},{key:"eq",value:function(e){if(this==e)return!0;if(!(e instanceof t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}},{key:"locals",value:function(t){return yn(this.localsInner(t))}},{key:"localsInner",value:function(t){if(this==cn)return an;if(t.inlineContent||!this.local.some(nn.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof nn||e.push(this.local[n]);return e}},{key:"forEachSet",value:function(t){t(this)}}],[{key:"create",value:function(t,e){return e.length?vn(e,t,0,sn):cn}}])}();un.empty=new un([],[]),un.removeOverlap=yn;var cn=un.empty,ln=function(){function t(e){g(this,t),this.members=e}return k(t,[{key:"map",value:function(e,n){var r=this.members.map((function(t){return t.map(e,n,sn)}));return t.from(r)}},{key:"forChild",value:function(e,n){if(n.isLeaf)return un.empty;for(var r=[],o=0;o<this.members.length;o++){var i=this.members[o].forChild(e,n);i!=cn&&(i instanceof t?r=r.concat(i.members):r.push(i))}return t.from(r)}},{key:"eq",value:function(e){if(!(e instanceof t)||e.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}},{key:"locals",value:function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(t);if(o.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<o.length;i++)e.push(o[i])}else e=o}return e?yn(n?e:e.sort(mn)):an}}
21,{key:"forEachSet",value:function(t){for(var e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}],[{key:"from",value:function(e){switch(e.length){case 0:return cn;case 1:return e[0];default:return new t(e.every((function(t){return t instanceof un}))?e:e.reduce((function(t,e){return t.concat(e instanceof un?e:e.members)}),[]))}}}])}();function fn(t,e,n,r,o,i,a){for(var s=t.slice(),u=function(t){var e=0;n.maps[c].forEach((function(n,r,o,i){for(var a=i-o-(r-n),u=0;u<s.length;u+=3){var c=s[u+1];if(!(c<0||n>c+t-e)){var l=s[u]+t-e;r>=l?s[u+1]=n<=l?-2:-1:n>=t&&a&&(s[u]+=a,s[u+1]+=a)}}e+=a})),t=n.maps[c].map(t,-1),l=t},c=0,l=i;c<n.maps.length;c++)u(l);for(var f=!1,d=0;d<s.length;d+=3)if(s[d+1]<0){if(-2==s[d+1]){f=!0,s[d+1]=-1;continue}var h=n.map(t[d]+i),p=h-o;if(p<0||p>=r.content.size){f=!0;continue}var v=n.map(t[d+1]+i,-1)-o,m=r.content.findIndex(p),y=m.index,g=m.offset,b=r.maybeChild(y);if(b&&g==p&&g+b.nodeSize==v){var k=s[d+2].mapInner(n,b,h+1,t[d]+i+1,a);k!=cn?(s[d]=p,s[d+1]=v,s[d+2]=k):(s[d+1]=-2,f=!0)}else f=!0}if(f){var w=function(t,e,n,r,o,i,a){function s(t,e){for(var i=0;i<t.local.length;i++){var u=t.local[i].map(r,o,e);u?n.push(u):a.onRemove&&a.onRemove(t.local[i].spec)}for(var c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+e+1)}for(var u=0;u<t.length;u+=3)-1==t[u+1]&&s(t[u+2],e[u]+i+1);return n}(s,t,e,n,o,i,a),D=vn(w,r,0,a);e=D.local;for(var C=0;C<s.length;C+=3)s[C+1]<0&&(s.splice(C,3),C-=3);for(var S=0,A=0;S<D.children.length;S+=3){for(var E=D.children[S];A<s.length&&s[A]<E;)A+=3;s.splice(A,0,D.children[S],D.children[S+1],D.children[S+2])}}return new un(e.sort(mn),s)}function dn(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var o=t[r];n.push(new on(o.from+e,o.to+e,o.type))}return n}function hn(t,e,n){if(e.isLeaf)return null;for(var r,o=n+e.nodeSize,i=null,a=0;a<t.length;a++)(r=t[a])&&r.from>n&&r.to<o&&((i||(i=[])).push(r),t[a]=null);return i}function pn(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function vn(t,e,n,r){var o=[],i=!1;e.forEach((function(e,a){var s=hn(t,e,a+n);if(s){i=!0;var u=vn(s,e,n+a+1,r);u!=cn&&o.push(a,a+e.nodeSize,u)}}));for(var a=dn(i?pn(t):t,-n).sort(mn),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new un(a,o):cn}function mn(t,e){return t.from-e.from||t.to-e.to}function yn(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var o=n+1;o<e.length;o++){var i=e[o];if(i.from!=r.from){i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),gn(e,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),gn(e,o+1,i.copy(r.to,i.to)))}}return e}function gn(t,e,n){for(;e<t.length&&mn(n,t[e])>0;)e++;t.splice(e,0,n)}function bn(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=cn&&e.push(r)})),t.cursorWrapper&&e.push(un.create(t.state.doc,[t.cursorWrapper.deco])),ln.from(e)}var kn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},wn=z&&$<=11,Dn=function(){return k((function t(){g(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}),[{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}])}(),Cn=function(){return k((function t(e,n){var r=this;g(this,t),this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Dn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)r.queue.push(t[e]);z&&$<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?r.flushSoon():r.flush()})),wn&&(this.onCharData=function(t){r.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}),[{key:"flushSoon",value:function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,kn)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(Zt(this.view)){if(this.suppressingSelectionUpdates)return Kt(this.view);if(z&&$<=11&&!this.view.state.selection.empty){var t=this.view.domSelectionRange();if(t.focusNode&&E(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function(t){if(!t.focusNode)return!0;for(var e,n=new Set,r=t.focusNode;r;r=C(r))n.add(r);for(var o=t.anchorNode;o;o=C(o))if(n.has(o)){e=o;break}var i=e&&this.view.docView.nearestDesc(e);return i&&i.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}},{key:"pendingRecords",value:function(){if(this.observer){var t,e=s(this.observer.takeRecords());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.queue.push(n)}}catch(t){e.e(t)}finally{e.f()}}return this.queue}},{key:"flush",value:function(){var t=this.view;if(t.docView&&!(this.flushingSoon>-1)){var e=this.pendingRecords();e.length&&(this.queue=[]);var n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Zt(t)&&!this.ignoreSelectionChange(n),i=-1,u=-1,c=!1,l=[];
21if(t.editable)for(var f=0;f<e.length;f++){var d=this.registerMutation(e[f],l);d&&(i=i<0?d.from:Math.min(d.from,i),u=u<0?d.to:Math.max(d.to,u),d.typeOver&&(c=!0))}if(H&&l.length){var h=l.filter((function(t){return"BR"==t.nodeName}));if(2==h.length){var p=a(h,2),v=p[0],m=p[1];v.parentNode&&v.parentNode.parentNode==m.parentNode?m.remove():v.remove()}else{var y,g=this.currentSelection.focusNode,b=s(h);try{for(b.s();!(y=b.n()).done;){var k=y.value,w=k.parentNode;!w||"LI"!=w.nodeName||g&&xn(t,g)==w||k.remove()}}catch(t){b.e(t)}finally{b.f()}}}else if((_||W)&&l.some((function(t){return"BR"==t.nodeName}))&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){var D,C=s(l);try{for(C.s();!(D=C.n()).done;){var S=D.value;if("BR"==S.nodeName&&S.parentNode){var A=S.nextSibling;A&&1==A.nodeType&&"false"==A.contentEditable&&S.parentNode.removeChild(S)}}}catch(t){C.e(t)}finally{C.f()}}var E=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&N(n)&&(E=Vt(t))&&E.eq(r.LN.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Kt(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,u),function(t){if(Sn.has(t))return;if(Sn.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)){if(t.requiresGeckoHackNode=H,An)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),An=!0}}(t)),this.handleDOMChange(i,u,c,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||Kt(t),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;r<t.addedNodes.length;r++){var o=t.addedNodes[r];e.push(o),3==o.nodeType&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var i=t.previousSibling,a=t.nextSibling;if(z&&$<=11&&t.addedNodes.length)for(var s=0;s<t.addedNodes.length;s++){var u=t.addedNodes[s],c=u.previousSibling,l=u.nextSibling;(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(i=c),(!l||Array.prototype.indexOf.call(t.addedNodes,l)<0)&&(a=l)}var f=i&&i.parentNode==t.target?D(i)+1:0,d=n.localPosFromDOM(t.target,f,-1),h=a&&a.parentNode==t.target?D(a):t.target.childNodes.length;return{from:d,to:n.localPosFromDOM(t.target,h,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=t.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}])}(),Sn=new WeakMap,An=!1;function En(t,e){var n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,a=t.domAtPos(t.state.selection.anchor);if(E(a.node,a.offset,o,i)){var s=[o,i,n,r];n=s[0],r=s[1],o=s[2],i=s[3]}return{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function xn(t,e){for(var n=e.parentNode;n&&n!=t.dom;n=n.parentNode){var r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Mn(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(W&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||W&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var On=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Tn(t,e,n,i,a){var s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){var u=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,c=Vt(t,u);if(c&&!t.state.selection.eq(c)){if(_&&Y&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",(function(e){return e(t,F(13,"Enter"))})))return;var l=t.state.tr.setSelection(c);"pointer"==u?l.setMeta("pointer",!0):"key"==u&&l.scrollIntoView(),s&&l.setMeta("composition",s),t.dis
21patch(l)}}else{var f=t.state.doc.resolve(e),d=f.sharedDepth(n);e=f.before(d+1),n=t.state.doc.resolve(n).after(d+1);var h,p,v=t.state.selection,m=function(t,e,n){var r,i=t.docView.parseRange(e,n),a=i.node,s=i.fromOffset,u=i.toOffset,c=i.from,l=i.to,f=t.domSelectionRange(),d=f.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:f.anchorOffset}],N(f)||r.push({node:f.focusNode,offset:f.focusOffset})),_&&8===t.input.lastKeyCode)for(var h=u;h>s;h--){var p=a.childNodes[h-1],v=p.pmViewDesc;if("BR"==p.nodeName&&!v){u=h;break}if(!v||v.size)break}var m=t.state.doc,y=t.someProp("domParser")||o.S4.fromSchema(t.state.schema),g=m.resolve(c),b=null,k=y.parse(a,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:s,to:u,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Mn,context:g});if(r&&null!=r[0].pos){var w=r[0].pos,D=r[1]&&r[1].pos;null==D&&(D=w),b={anchor:w+c,head:D+c}}return{doc:k,sel:b,from:c,to:l}}(t,e,n),y=t.state.doc,g=y.slice(m.from,m.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;var b=function(t,e,n,r,o){var i=t.findDiffStart(e,n);if(null==i)return null;var a=t.findDiffEnd(e,n+t.size,n+e.size),s=a.a,u=a.b;if("end"==o){r-=s+Math.max(0,i-Math.min(s,u))-i}if(s<i&&t.size<e.size){var c=r<=i&&r>=s?i-r:0;(i-=c)&&i<e.size&&Rn(e.textBetween(i-1,i+1))&&(i+=c?1:-1),u=i+(u-s),s=i}else if(u<i){var l=r<=i&&r>=u?i-r:0;(i-=l)&&i<t.size&&Rn(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-u),u=i}return{start:i,endA:s,endB:u}}(g.content,m.doc.content,m.from,h,p);if(b&&t.input.domChangeCount++,(U&&t.input.lastIOSEnter>Date.now()-225||Y)&&a.some((function(t){return 1==t.nodeType&&!On.test(t.nodeName)}))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",(function(e){return e(t,F(13,"Enter"))})))t.input.lastIOSEnter=0;else{if(!b){if(!(i&&v instanceof r.U3&&!v.empty&&v.$head.sameParent(v.$anchor))||t.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var k=Nn(t,t.state.doc,m.sel);if(k&&!k.eq(t.state.selection)){var w=t.state.tr.setSelection(k);
21s&&w.setMeta("composition",s),t.dispatch(w)}}return}b={start:v.from,endA:v.to,endB:v.to}}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof r.U3&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=m.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=m.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),z&&$<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>m.from&&" Â "==m.doc.textBetween(b.start-m.from-1,b.start-m.from+1)&&(b.start--,b.endA--,b.endB--);var D=m.doc.resolveNoCache(b.start-m.from),C=m.doc.resolveNoCache(b.endB-m.from),S=y.resolve(b.start),A=D.sameParent(C)&&D.parent.inlineContent&&S.end()>=b.endA;if((U&&t.input.lastIOSEnter>Date.now()-225&&(!A||a.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!A&&D.pos<m.doc.content.size&&(!D.sameParent(C)||!D.parent.inlineContent)&&D.pos<C.pos&&!/\S/.test(m.doc.textBetween(D.pos,C.pos,"","")))&&t.someProp("handleKeyDown",(function(e){return e(t,F(13,"Enter"))})))t.input.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,r,o){if(n-e<=o.pos-r.pos||Fn(r,!0,!1)<o.pos)return!1;var i=t.resolve(e);if(!r.parent.isTextblock){var a=i.nodeAfter;return null!=a&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var s=t.resolve(Fn(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Fn(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(y,b.start,b.endA,D,C)&&t.someProp("handleKeyDown",(function(e){return e(t,F(8,"Backspace"))})))Y&&_&&t.domObserver.suppressSelectionUpdates();else{_&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),Y&&!A&&D.start()!=C.start()&&0==C.parentOffset&&D.depth==C.depth&&m.sel&&m.sel.anchor==m.sel.head&&m.sel.head==b.endA&&(b.endB-=2,C=m.doc.resolveNoCache(b.endB-m.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,F(13,"Enter"))}))}),20));var E,x=b.start,M=b.endA,O=function(e){var n=e||t.state.tr.replace(x,M,m.doc.slice(b.start-m.from,b.endB-m.from));if(m.sel){var r=Nn(t,n.doc,m.sel);r&&!(_&&t.composing&&r.empty&&(b.start!=b.endB||t.input.lastChromeDelete<Date.now()-100)&&(r.head==x||r.head==n.mapping.map(M)-1)||z&&r.empty&&r.head==x)&&n.setSelection(r)}return s&&n.setMeta("composition",s),n.scrollIntoView()};if(A)if(D.pos==C.pos){z&&$<=11&&0==D.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return Kt(t)}),20));var T=O(t.state.tr.delete(x,M)),R=y.resolve(b.start).marksAcross(y.resolve(b.endA));R&&T.ensureMarks(R),t.dispatch(T)}else if(b.endA==b.endB&&(E=function(t,e){for(var n,r,i,a=t.firstChild.marks,s=e.firstChild.marks,u=a,c=s,l=0;l<s.length;l++)u=s[l].removeFromSet(u);for(var f=0;f<a.length;f++)c=a[f].removeFromSet(c);if(1==u.length&&0==c.length)r=u[0],n="add",i=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=u.length||1!=c.length)return null;r=c[0],n="remove",i=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var d=[],h=0;h<e.childCount;h++)d.push(i(e.child(h)));if(o.FK.from(d).eq(t))return{mark:r,type:n}}(D.parent.content.cut(D.parentOffset,C.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start())))){var P=O(t.state.tr);"add"==E.type?P.addMark(x,M,E.mark):P.removeMark(x,M,E.mark),t.dispatch(P)}else if(D.parent.child(D.index()).isText&&D.index()==C.index()-(C.textOffset?0:1)){var B=D.parent.textBetween(D.parentOffset,C.parentOffset),j=function(){return O(t.state.tr.insertText(B,x,M))};t.someProp("handleTextInput",(function(e){return e(t,x,M,B,j)}))||t.dispatch(j())}else t.dispatch(O());else t.dispatch(O())}}}}function Nn(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Xt(t,e.resolve(n.anchor),e.resolve(n.head))}function Fn(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Rn(t){if(2!=t.length)return!1;var e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}var Pn=function(){return k((function t(e,n){var r=this;g(this,t),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Me,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(zn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ln(this),jn(this),this.nodeViews=In(this),this.docView=Et(this.state.doc,Bn(this),bn(this),this.dom,this),this.domObserver=new Cn(this,(function(t,e,n,o){return Tn(r,t,e,n,o)})),this.domObserver.start(),function(t){var e=function(){var e=Ae[n];t.dom.addEventListener(n,t.input.eventHandlers[n]=function(n){!function(t,e){if(!e.bubbles)return!0;
21if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,n)||Ne(t,n)||!t.editable&&n.type in Ee||e(t,n)},xe[n]?{passive:!0}:void 0)};for(var n in Ae)e();W&&t.dom.addEventListener("input",(function(){return null})),Te(t)}(this),this.updatePluginViews()}),[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props}},{key:"update",value:function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Te(this);var e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(zn),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}},{key:"setProps",value:function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)}},{key:"updateState",value:function(t){this.updateStateInner(t,this._props)}},{key:"updateStateInner",value:function(t,e){var n,r=this.state,o=!1,i=!1;t.storedMarks&&this.composing&&(Ke(this),i=!0),this.state=t;var a=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(a||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){var s=In(this);(function(t,e){var n=0,r=0;for(var o in t){if(t[o]!=e[o])return!0;n++}for(var i in e)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,o=!0)}(a||e.handleDOMEvents!=this._props.handleDOMEvents)&&Te(this),this.editable=Ln(this),jn(this);var u=bn(this),c=Bn(this),l=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",f=o||!this.docView.matchesNode(t.doc,c,u);!f&&t.selection.eq(r.selection)||(i=!0);var d,h,p,v,m,y,g,b,k,w,D,C="preserve"==l&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=t.root.elementFromPoint(i,a);if(s&&s!=t.dom&&t.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=o-20){e=s,n=u.top;break}}}return{refDOM:e,refTop:n,stack:nt(t.dom)}}(this);if(i){this.domObserver.stop();var S=f&&(z||_)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(v=r.selection,m=t.selection,y=Math.min(v.$anchor.sharedDepth(v.head),m.$anchor.sharedDepth(m.head)),v.$anchor.start(y)!=m.$anchor.start(y));if(f){var A=_?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=We(this)),!o&&this.docView.update(t.doc,c,u,this)||(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Et(t.doc,c,u,this.dom,this)),A&&!this.trackWrites&&(S=!0)}S||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(d=this,h=d.docView.domFromPos(d.state.selection.anchor,0),p=d.domSelectionRange(),E(h.node,h.offset,p.anchorNode,p.anchorOffset)))?Kt(this,S):(Yt(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():C&&(b=(g=C).refDOM,k=g.refTop,w=g.stack,D=b?b.getBoundingClientRect().top:0,rt(w,0==D?0:D-k))}},{key:"scrollToSelection",value:function(){var t=this,e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(function(e){return e(t)})));else if(this.state.selection instanceof r.nh){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&et(this,n.getBoundingClientRect(),e)}else et(this,this.coordsAtPos(this.state.selection.head,1),e);else;}},{key:"destroyPluginViews",value:function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()}},{key:"updatePluginViews",value:function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var o=this.directPlugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"updateDraggedNode",value:function(t,e){var n=t.node,o=-1;if(this.state.doc.nodeAt(n.from)==n.node)o=n.from;
21else{var i=n.from+(this.state.doc.content.size-e.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==n.node&&(o=i)}this.dragging=new Ge(t.slice,t.move,o<0?void 0:r.nh.create(this.state.doc,o))}},{key:"someProp",value:function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(var o=0;o<this.directPlugins.length;o++){var i=this.directPlugins[o].props[t];if(null!=i&&(n=e?e(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var u=a[s].props[t];if(null!=u&&(n=e?e(u):u))return n}}},{key:"hasFocus",value:function(){if(z){var t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(ot)return t.focus(ot);var e=nt(t);t.focus(null==ot?{get preventScroll(){return ot={preventScroll:!0},!0}}:void 0),ot||(ot=!1,rt(e,0))}(this.dom),Kt(this),this.domObserver.start()}},{key:"root",get:function(){var t=this,e=this._root;if(null==e)for(var n,r=function(e){if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return e.ownerDocument.getSelection()}),{v:t._root=e}},o=this.dom.parentNode;o;o=o.parentNode)if(n=r(o))return n.v;return e||document}},{key:"updateRoot",value:function(){this._root=null}},{key:"posAtCoords",value:function(t){return ut(this,t)}},{key:"coordsAtPos",value:function(t){return dt(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)}},{key:"domAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(t,e)}},{key:"nodeDOM",value:function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null}},{key:"posAtDOM",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(t,e){return kt(this,e||this.state,t)}},{key:"pasteHTML",value:function(t,e){return qe(this,"",t,!1,e||new ClipboardEvent("paste"))}},{key:"pasteText",value:function(t,e){return qe(this,t,null,!0,e||new ClipboardEvent("paste"))}},{key:"serializeForClipboard",value:function(t){return he(this,t)}},{key:"destroy",value:function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,S=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(t){return function(t,e){Ne(t,e)||!Ae[e.type]||!t.editable&&e.type in Ee||Ae[e.type](t,e)}(this,t)}},{key:"domSelectionRange",value:function(){var t=this.domSelection();return t?W&&11===this.root.nodeType&&function(t){for(var e=t.activeElement;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t,e){if(e.getComposedRanges){var n=e.getComposedRanges(t.root)[0];if(n)return En(t,n)}var r;function o(t){t.preventDefault(),t.stopImmediatePropagation(),r=t.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",o,!0),r?En(t,r):null}(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}},{key:"domSelection",value:function(){return this.root.getSelection()}}])}();function Bn(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e.class+=" "+n[r]:"style"==r?e.style=(e.style?e.style+";":"")+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))}
21)),e.translate||(e.translate="no"),[on.node(0,t.state.doc.content.size,e)]}function jn(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:on.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Ln(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function In(t){var e=Object.create(null);function n(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function zn(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Pn.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.