PageSourceSearch

https://www.drukwerkdeal.nl/520c8229-27849155095a45a378e6.js

js drukwerkdeal.nl collected 2026-09-25 19:51:58 UTC 109,424 bytes, 2 lines download raw bytes

1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};t.SENTRY_RELEASE={id:"2457d412f2f912f3f16af3c32f611066482dce57"};var e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="bca26263-e817-4c23-9130-c69aa44ec137",t._sentryDebugIdIdentifier="sentry-dbid-bca26263-e817-4c23-9130-c69aa44ec137")}catch(t){}}(),(self.webpackChunklaunchpad=self.webpackChunklaunchpad||[]).push([[8872],{2314:function(t,e,n){n.d(e,{AB:function(){return Mn},BQ:function(){return Ce},CU:function(){return Ln},Ce:function(){return sr},Dd:function(){return Rn},FF:function(){return me},H_:function(){return ke},JJ:function(){return ur},J_:function(){return Ae},KE:function(){return ir},KV:function(){return ne},Nx:function(){return Ht},OX:function(){return ar},Pg:function(){return L},QN:function(){return Me},T7:function(){return Wt},YY:function(){return Wn},Zc:function(){return dr},_n:function(){return _n},_w:function(){return le},bP:function(){return lr},fV:function(){return $n},fl:function(){return ye},gu:function(){return he},hO:function(){return ge},kj:function(){return Dn},rU:function(){return Ot},tG:function(){return cr},zU:function(){return re}});var r=n(9417),o=n(96045),i=n(85501),a=n(56822),s=n(53954),u=n(87695),c=n(60436),l=n(5544),d=n(23029),f=n(92901),p=n(64467),h=(n(53921),n(46449),n(93514),n(26910),n(78350),n(30237),n(38344),n(78687)),v=n(10101),m=n(8924),g=n(70546),y=n(28733),k=n(67736),b=n(14433);function w(t){var e=x();return function(){var n,r=(0,s.A)(t);if(e){var o=(0,s.A)(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return(0,a.A)(this,n)}}function x(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(x=function(){return!!t})()}function M(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,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 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(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 E(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){(0,p.A)(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}var O=Object.defineProperty,C=function(t,e){for(var n in e)O(t,n,{get:e[n],enumerable:!0})};function T(t){var e=t.state,n=t.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return E(E({},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 P=function(){function t(e){(0,d.A)(this,t),this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}return(0,f.A)(t,[{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=(0,l.A)(e,2),r=n[0],s=n[1];return[r,function(){var e=s.apply(void 0,arguments)(a);
1return 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,d=E(E({},Object.fromEntries(Object.entries(r).map((function(t){var r=(0,l.A)(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),d}]})))),{},{run:function(){return u||!n||c.getMeta("preventDispatch")||e.hasCustomState||a.dispatch(c),s.every((function(t){return!0===t}))}});return d}},{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=(0,l.A)(t,2),n=e[0],r=e[1];return[n,function(){return r.apply(void 0,arguments)(E(E({},a),{},{dispatch:void 0}))}]})));return E(E({},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:T({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=(0,l.A)(t,2),n=e[0],r=e[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}],[{key:"createFakeChain",value:function(){var t=new Proxy({},{get:function(e,n){if("then"!==n)return"run"===n?function(){return!1}:function(){return t}}});return t}},{key:"createFallbackCan",value:function(){var e=t.createFakeChain();return new Proxy({chain:function(){return e}},{get:function(t,e){if("then"!==e)return"chain"===e?t.chain:function(){return!1}}})}}]),t}(),j={};C(j,{blur:function(){return R},clearContent:function(){return D},clearNodes:function(){return I},command:function(){return N},createParagraphNear:function(){return $},cut:function(){return z},deleteCurrentNode:function(){return B},deleteNode:function(){return _},deleteRange:function(){return F},deleteSelection:function(){return K},enter:function(){return U},exitCode:function(){return W},extendMarkRange:function(){return G},first:function(){return X},focus:function(){return it},forEach:function(){return at},insertContent:function(){return st},insertContentAt:function(){return ht},insertDefaultBlock:function(){return mt},joinBackward:function(){return kt},joinDown:function(){return yt},joinForward:function(){return bt},joinItemBackward:function(){return wt},joinItemForward:function(){return xt},joinTextblockBackward:function(){return Mt},joinTextblockForward:function(){return At},joinUp:function(){return gt},keyboardShortcut:function(){return Et},lift:function(){return Ct},liftEmptyBlock:function(){return Tt},liftListItem:function(){return Pt},newlineInCode:function(){return jt},resetAttributes:function(){return It},scrollIntoView:function(){return Nt},selectAll:function(){return $t},selectNodeBackward:function(){return zt},selectNodeForward:function(){return Bt},selectParentNode:function(){return Lt},selectTextblockEnd:function(){return _t},selectTextblockStart:function(){return Ft},setContent:function(){return Kt},setMark:function(){return Re},setMeta:function(){return De},setNode:function(){return Ie},setNodeSelection:function(){return Ne},setTextDirection:function(){return $e},setTextSelection:function(){return ze},sinkListItem:function(){return Be},splitBlock:function(){return _e},splitListItem:function(){return Fe},toggleList:function(){return He},toggleMark:function(){return qe},toggleNode:function(){return Je},toggleWrap:function(){return Qe},undoInputRule:function(){return Ye},unsetAllMarks:function(){return Ze},unsetMark:function(){return Ge},unsetTextDirection:function(){return Xe},updateAttributes:function(){return tn},updateDecorations:function(){return nn},wrapIn:function(){return rn},wrapInList:function(){return on}});var R=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}},D=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(e){return e.commands.setContent("",{emitUpdate:t})}},I=function(){return function(t){var e=t.state,n=t.tr,r=t.dispatch,o=n.selection.ranges;
1return!r||(o.forEach((function(t){var r=t.$from,o=t.$to;e.doc.nodesBetween(r.pos,o.pos,(function(t,e){if(!t.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(e)),a=r.resolve(o.map(e+t.nodeSize)),s=i.blockRange(a);if(s){var u=(0,h.jP)(s);if(t.type.isTextblock){var c=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,c)}(u||0===u)&&n.lift(s,u)}}}))})),!0)}},N=function(t){return function(e){return t(e)}},$=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.Z1)(e,n)}},z=function(t,e){return function(n){var r=n.editor,o=n.tr,i=r.state.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);var a=o.mapping.map(e);return o.insert(a,i.content),o.setSelection(new m.U3(o.doc.resolve(Math.max(a-1,0)))),!0}},B=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 L(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 _=function(t){return function(e){for(var n=e.tr,r=e.state,o=e.dispatch,i=L(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}}
1,F=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}},V=function(t,e,n){if(!t.parent.isInline)return t.pos;if("left"===n&&t.pos>t.start()||"right"===n&&t.pos<t.end())return t.pos;var r,o=e.nodes[t.parent.type.name].spec;return(r=o).content&&/^text(\*|\+)/.test(r.content)?"left"===n?t.start()-1:t.end()+1:t.pos},K=function(){return function(t){var e=t.state,n=t.dispatch;if(e.selection.empty)return!1;if(n){var r=e.tr,o=e.selection.ranges,i=r.steps.length;o.forEach((function(t){var n=r.mapping.slice(i),o=function(t,e,n){return{from:V(t,n,"left"),to:V(e,n,"right")}}(r.doc.resolve(n.map(t.$from.pos)),r.doc.resolve(n.map(t.$to.pos)),e.schema),a=o.from,s=o.to;r.deleteRange(a,s)})),r.selection.empty||r.setSelection(m.U3.near(r.doc.resolve(r.selection.from))),r.scrollIntoView(),n(r)}return!0}},U=function(){return function(t){return t.commands.keyboardShortcut("Enter")}},W=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.I$)(e,n)}};function H(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function q(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]:H(e[r])?e[r].test(t[r]):e[r]===t[r]}))}function J(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.find((function(t){return t.type===e&&q(Object.fromEntries(Object.keys(n).map((function(e){return[e,t.attrs[e]]}))),n)}))}function Q(t,e){return!!J(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function Y(t,e,n){if(t&&e){var r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some((function(t){return t.type===e}))||(r=t.parent.childBefore(t.parentOffset)),r.node&&r.node.marks.some((function(t){return t.type===e}))){if(!n){var o=r.node.marks.find((function(t){return t.type===e}));o&&(n=o.attrs)}if(J((0,c.A)(r.node.marks),e,n)){for(var i=r.index,a=t.start()+r.offset,s=i+1,u=a+r.node.nodeSize;i>0&&Q((0,c.A)(t.parent.child(i-1).marks),e,n);)i-=1,a-=t.parent.child(i).nodeSize;for(;s<t.parent.childCount&&Q((0,c.A)(t.parent.child(s).marks),e,n);)u+=t.parent.child(s).nodeSize,s+=1;return{from:a,to:u}}}}}function Z(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 G=function(t,e){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=Z(t,o.schema),s=r.doc,u=r.selection,c=u.$from,l=u.from,d=u.to;if(i){var f=Y(c,a,e);if(f&&f.from<=l&&f.to>=d){var p=m.U3.create(s,f.from,f.to);r.setSelection(p)}}return!0}},X=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 tt(t){return t instanceof m.U3}function et(){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 nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return null;var n=m.LN.atStart(t),r=m.LN.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return r;var o=n.from,i=r.to;return"all"===e?m.U3.create(t,et(0,o,i),et(t.content.size,o,i)):m.U3.create(t,et(e,o,i),et(e,o,i))}function rt(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function ot(){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=E({scrollIntoView:!0},e);var s=function(){(ot()||rt())&&o.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||ot()||rt()||o.dom.focus({preventScroll:!0}),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&r.commands.scrollIntoView())}))};try{if(o.hasFocus()&&null===t||!1===t)return!0}catch(l){return!1}if(a&&null===t&&!tt(r.state.selection))return s(),!0;var u=nt(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}},at=function(t,e){return function(n){return t.every((function(t,r){return e(t,E(E({},n),{},{index:r}))}))}},st=function(t,e){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},t,e)}
1},ut=function t(e){for(var n=e.childNodes,r=n.length-1;r>=0;r-=1){var o=n[r];3===o.nodeType&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?e.removeChild(o):1===o.nodeType&&t(o)}return e};function ct(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 ut(n)}function lt(t){return"function"==typeof(null==t?void 0:t.nodesBetween)}function dt(t,e,n){if(lt(t))return t;var r="object"==typeof t&&null!==t;n=E({slice:!0,parseOptions:{}},n);var o="string"==typeof t;if(r)try{if(Array.isArray(t)&&t.length>0)return g.FK.fromArray(t.map((function(t){return e.nodeFromJSON(t)})));var i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(l){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:l});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",l),dt("",e,n)}if(o){if(n.errorOnInvalidContent){var a=!1,s="",u=new g.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?g.S4.fromSchema(u).parseSlice(ct(t),n.parseOptions):g.S4.fromSchema(u).parse(ct(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error("Invalid element found: ".concat(s))})}var c=g.S4.fromSchema(e);return n.slice?c.parseSlice(ct(t),n.parseOptions).content:c.parse(ct(t),n.parseOptions)}return dt("",e,n)}function ft(t){return!("type"in t)}function pt(t,e,n){var r=t.steps.length-1;if(!(r<e)){var o=t.steps[r];if(o instanceof h.Ln||o instanceof h.Wg){var i=t.mapping.maps[r],a=0;i.forEach((function(t,e,n,r){0===a&&(a=r)})),t.setSelection(m.LN.near(t.doc.resolve(a),n))}}}var ht=function(t,e,n){return function(r){var o,i=r.tr,a=r.dispatch,s=r.editor;if(a){var u;n=E({parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1},n);var c=function(t){s.emit("contentError",{editor:s,error:t,disableCollaboration:function(){"collaboration"in s.storage&&"object"==typeof s.storage.collaboration&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},l=E({preserveWhitespace:"full"},n.parseOptions);if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{dt(e,s.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(S){c(S)}try{u=dt(e,s.schema,{parseOptions:l,errorOnInvalidContent:null!=(o=n.errorOnInvalidContent)?o:s.options.enableContentCheck})}catch(S){return c(S),!1}var d,f="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},p=f.from,h=f.to,v=!0,m=!0,y=ft(u)?u.content:[u];if(y.forEach((function(t){t.check(),v=!!v&&(t.isText&&0===t.marks.length),m=!!m&&t.isBlock})),p===h&&m){var k=i.doc.resolve(p).parent;k.isTextblock&&!k.type.spec.code&&!k.childCount&&(p-=1,h+=1)}if(v)d=Array.isArray(e)?e.map((function(t){return t.text||""})).join(""):lt(e)?y.map((function(t){var e;return null!=(e=t.text)?e:""})).join(""):"object"==typeof e&&e&&e.text?e.text:e,i.insertText(d,p,h);else{d=g.FK.from(y);var b=i.doc.resolve(p),w=b.node(),x=0===b.parentOffset,M=w.isText||w.isTextblock,A=w.content.size>0;x&&M&&A&&m&&(p=Math.max(0,p-1)),i.replaceWith(p,h,y)}n.updateSelection&&pt(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:p,text:d}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:p,text:d})}return!0}};function vt(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}var mt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var n,r=e.tr,o=e.dispatch,i=e.editor,a=t.pos,s=t.attrs,u=t.content,c=t.updateSelection,d=void 0===c||c,f=vt((n="number"==typeof a?r.doc.resolve(a):a||r.selection.$from).parent.contentMatchAt(n.index()));if(!f)return!1;var p,h=Object.keys(f.spec.attrs||{}),v=s?Object.fromEntries(Object.entries(s).filter((function(t){var e=(0,l.A)(t,1)[0];return h.includes(e)}))):{};if(u){var m=dt(u,i.schema);p=f.createAndFill(v,m)}else p=f.createAndFill(v);return!!p&&(o&&(r.insert(n.pos,p),d&&pt(r,r.steps.length-1,-1)),!0)}},gt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.G2)(e,n)}},yt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.bh)(e,n)}},kt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.Qv)(e,n)}},bt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.eT)(e,n)}},wt=function(){return function(t){var e=t.state,n=t.dispatch,r=t.tr;try{var o=(0,h.N0)(e.doc,e.selection.$from.pos,-1);return null!=o&&(r.join(o,2),n&&n(r),!0)}catch(i){return!1}}},xt=function(){return function(t){var e=t.state,n=t.dispatch,r=t.tr;try{var o=(0,h.N0)(e.doc,e.selection.$from.pos,1);return null!=o&&(r.join(o,2),n&&n(r),!0)}catch(i){return!1}}},Mt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.eB)(e,n)}},At=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v._G)(e,n)}};function St(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var Et=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));ot()||St()?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)}
1)),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 Ot(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?L(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 q(t.node.attrs,n,{strict:!1})}));return a?!!l.length:l.reduce((function(t,e){return t+e.to-e.from}),0)>=c}var Ct=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!Ot(r,L(t,r.schema),e)&&(0,v.yY)(r,o)}},Tt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.iz)(e,n)}},Pt=function(t){return function(e){var n=e.state,r=e.dispatch,o=L(t,n.schema);return(0,y.T2)(o)(n,r)}},jt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.pC)(e,n)}};function Rt(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Dt(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 It=function(t,e){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,u=Rt("string"==typeof t?t:t.name,o.schema);if(!u)return!1;"node"===u&&(a=L(t,o.schema)),"mark"===u&&(s=Z(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,Dt(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(Dt(o.attrs,e))))}))}))})),c}},Nt=function(){return function(t){var e=t.tr;return t.dispatch&&e.scrollIntoView(),!0}},$t=function(){return function(t){var e=t.tr;if(t.dispatch){var n=new m.i5(e.doc);e.setSelection(n)}return!0}},zt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v._e)(e,n)}},Bt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.Sd)(e,n)}},Lt=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.hy)(e,n)}},_t=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.ec)(e,n)}},Ft=function(){return function(t){var e=t.state,n=t.dispatch;return(0,v.$f)(e,n)}};function Vt(t,e){return dt(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 Kt=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=Vt(t,r.schema,a,{errorOnInvalidContent:null!=n?n:r.options.enableContentCheck});if(s){var d=ft(l)?l.content:[l];i.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!o)}return!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 Ut(t,e){var n=Z(e,t.schema),r=t.selection,o=r.from,i=r.to,a=r.empty,s=[];a?(t.storedMarks&&s.push.apply(s,(0,c.A)(t.storedMarks)),s.push.apply(s,(0,c.A)(t.selection.$head.marks()))):t.doc.nodesBetween(o,i,(function(t){s.push.apply(s,(0,c.A)(t.marks))}));var u=s.find((function(t){return t.type.name===n.name}));return u?E({},u.attrs):{}}function Wt(t,e){var n=new h.dL(t);return e.forEach((function(t){t.steps.forEach((function(t){n.step(t)}))})),n}function Ht(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 qt(t){return function(e){return function(t,e){for(var n=t.depth;
1n>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}}}(e.$from,t)}}function Jt(t,e,n){return void 0===t.config[e]&&t.parent?Jt(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind(E(E({},n),{},{parent:t.parent?Jt(t.parent,e,n):null})):t.config[e]}function Qt(t){return t.map((function(t){var e=Jt(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t].concat((0,c.A)(Qt(e()))):t})).flat(10)}function Yt(t,e){var n=g.ZF.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Zt(t){return"function"==typeof t}function Gt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(Zt(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 Xt(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 te(t){var e=[],n=Xt(t),r=n.nodeExtensions,o=n.markExtensions,i=[].concat((0,c.A)(r),(0,c.A)(o)),a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=r.filter((function(t){return"text"!==t.name})).map((function(t){return t.name})),u=o.map((function(t){return t.name})),d=[].concat((0,c.A)(s),(0,c.A)(u));return t.forEach((function(t){var n=Jt(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:i});n&&n().forEach((function(t){(Array.isArray(t.types)?t.types:"*"===t.types?d:"nodes"===t.types?s:"marks"===t.types?u:[]).forEac
1h((function(n){Object.entries(t.attributes).forEach((function(t){var r=(0,l.A)(t,2),o=r[0],i=r[1];e.push({type:n,name:o,attribute:E(E({},a),i)})}))}))}))})),i.forEach((function(t){var n={name:t.name,options:t.options,storage:t.storage},r=Jt(t,"addAttributes",n);if(r){var o=r();Object.entries(o).forEach((function(n){var r=(0,l.A)(n,2),o=r[0],i=r[1],s=E(E({},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 ee(t){for(var e=[],n=function(t){for(var e=[],n="",r=!1,o=!1,i=0,a=t.length,s=0;s<a;s+=1){var u=t[s];if("'"!==u||o)if('"'!==u||r){if(!r&&!o){if("("===u){i+=1,n+=u;continue}if(")"===u&&i>0){i-=1,n+=u;continue}if(";"===u&&0===i){e.push(n),n="";continue}}n+=u}else o=!o,n+=u;else r=!r,n+=u}return n&&e.push(n),e}(t||""),r=n.length,o=0;o<r;o+=1){var i=n[o],a=i.indexOf(":");if(-1!==a){var s=i.slice(0,a).trim(),u=i.slice(a+1).trim();s&&u&&e.push([s,u])}}return e}function ne(){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=E({},t);return Object.entries(e).forEach((function(t){var e=(0,l.A)(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((0,c.A)(a),(0,c.A)(s)).join(" ")}else if("style"===r){var u=new Map([].concat((0,c.A)(ee(n[r])),(0,c.A)(ee(o))));n[r]=Array.from(u.entries()).map((function(t){var e=(0,l.A)(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(r)})).join("; ")}else n[r]=o;else n[r]=o})),n}),{})}function re(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)||{}:(0,p.A)({},e.name,t.attrs[e.name])})).reduce((function(t,e){return ne(t,e)}),{})}function oe(t,e){return"style"in t?t:E(E({},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:E(E({},t),{},(0,p.A)({},e.name,r))}),{});return E(E({},r),o)}})}function ie(t){return Object.fromEntries(Object.entries(t).filter((function(t){var e=(0,l.A)(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 ae(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 se(t,e){var n,r=te(t),o=Xt(t),i=o.nodeExtensions,a=o.markExtensions,s=null==(n=i.find((function(t){return Jt(t,"topNode")})))?void 0:n.name,u=Object.fromEntries(i.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=Jt(e,"extendNodeSchema",i);return E(E({},t),r?r(n):{})}),{}),s=ie(E(E({},a),{},{content:Gt(Jt(n,"content",i)),marks:Gt(Jt(n,"marks",i)),group:Gt(Jt(n,"group",i)),inline:Gt(Jt(n,"inline",i)),atom:Gt(Jt(n,"atom",i)),selectable:Gt(Jt(n,"selectable",i)),draggable:Gt(Jt(n,"draggable",i)),code:Gt(Jt(n,"code",i)),whitespace:Gt(Jt(n,"whitespace",i)),linebreakReplacement:Gt(Jt(n,"linebreakReplacement",i)),defining:Gt(Jt(n,"defining",i)),isolating:Gt(Jt(n,"isolating",i)),attrs:Object.fromEntries(o.map(ae))})),u=Gt(Jt(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(t){return oe(t,o)})));var c=Jt(n,"renderHTML",i);c&&(s.toDOM=function(t){return c({node:t,HTMLAttributes:re(t,o)})});var l=Jt(n,"renderText",i);return l&&(s.toText=l),[n.name,s]}))),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=Jt(e,"extendMarkSchema",i);return E(E({},t),r?r(n):{})}),{}),s=ie(E(E({},a),{},{inclusive:Gt(Jt(n,"inclusive",i)),excludes:Gt(Jt(n,"excludes",i)),group:Gt(Jt(n,"group",i)),spanning:Gt(Jt(n,"spanning",i)),code:Gt(Jt(n,"code",i)),attrs:Object.fromEntries(o.map(ae))})),u=Gt(Jt(n,"parseHTML",i));u&&(s.parseDOM=u.map((function(t){return oe(t,o)})));var c=Jt(n,"renderHTML",i);return c&&(s.toDOM=function(t){return c({mark:t,HTMLAttributes:re(t,o)})}),[n.name,s]})));return new g.Sj({topNode:s,nodes:u,marks:c})}function ue(t){return t.sort((function(t,e){var n=Jt(t,"priority")||100,r=Jt(e,"priority")||100;return n>r?-1:n<r?1:0}))}function ce(t){var e,n,r=ue(Qt(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 le(t,e){return se(ce(t),e)}function de(t,e,n){var r=e.from,o=e.to,i=n||{}
1,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 d=null==c?void 0:c[t.type.name];if(d)return i&&(l+=d({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 fe(t,e){return de(t,{from:0,to:t.content.size},e)}function pe(t){return Object.fromEntries(Object.entries(t.nodes).filter((function(t){return(0,l.A)(t,2)[1].spec.toText})).map((function(t){var e=(0,l.A)(t,2);return[e[0],e[1].spec.toText]})))}function he(t,e){var n=Rt("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){var n=L(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?E({},s.attrs):{}}(t,e):"mark"===n?Ut(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 me(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 ge(t,e,n){var r=[];return t===e?n.resolve(t).marks().forEach((function(e){var o=Y(n.resolve(t),e.type);o&&r.push(E({mark:e},o))})):n.nodesBetween(t,e,(function(t,e){t&&void 0!==(null==t?void 0:t.nodeSize)&&r.push.apply(r,(0,c.A)(t.marks.map((function(n){return{from:e,to:e+t.nodeSize,mark:n}}))))})),r}var ye=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]},ke=function(t){var e=t.depth-1;if(e<0)return null;var n=t.index(e);return 0===n?null:t.node(e).child(n-1)};function be(t,e){return e.nodes[t]||e.marks[t]||null}function we(t,e,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=(0,l.A)(n,1)[0],o=t.find((function(t){return t.type===e&&t.name===r}));return!!o&&o.attribute.keepOnSplit})))}function xe(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection,o=r.empty,i=r.ranges,a=e?Z(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 q(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(a&&t.inlineContent&&!t.type.allowsMarkType(a))return!1;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,(0,c.A)(t.marks.map((function(t){return{mark:t,from:n,to:r}}))))}}))})),0===s)return!1;var l=u.filter((function(t){return!a||a.name===t.mark.type.name})).filter((function(t){return q(t.mark.attrs,n,{strict:!1})})).reduce((function(t,e){return t+e.to-e.from}),0),d=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(l>0?l+d:l)>=s}var Me=function(t,e){var n=t.selection,r=n.$from,o=n.$to,i=n.$anchor;if(e){var a=qt((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)},Ae=function(t){var e=t.selection,n=e.$from,r=e.$to;return!(n.parentOffset>0||n.pos!==r.pos)};function Se(t,e){return Array.isArray(e)?e.some((function(e){return("string"==typeof e?e:e.name)===t.name})):e}function Ee(t,e){var n=Xt(e).nodeExtensions.find((function(e){return e.name===t}));if(!n)return!1;var r=Gt(Jt(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function Oe(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;
1if(t.isText)return!/\S/.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&&(Oe(t,{ignoreWhitespace:a,checkChildren:o})||(s=!1))})),s}return!1}function Ce(t){return t instanceof m.nh}var Te=function(){function t(e){(0,d.A)(this,t),this.position=e}return(0,f.A)(t,[{key:"toJSON",value:function(){return{position:this.position}}}],[{key:"fromJSON",value:function(e){return new t(e.position)}}]),t}();function Pe(t,e){var n=e.mapping.mapResult(t.position);return{position:new Te(n.pos),mapResult:n}}function je(t){return new Te(t)}var Re=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=Z(t,o.schema);if(i)if(s){var l=Ut(o,c);r.addStoredMark(c.create(E(E({},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(E(E({},t.attrs),e)))})):r.addMark(a,s,c.create(e))}))}));return function(t,e,n){var r,o=e.selection,i=null;if(tt(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)}},De=function(t,e){return function(n){return n.tr.setMeta(t,e),!0}},Ie=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=L(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!!(0,v.y_)(s,E(E({},r),e))(o)||n.clearNodes()})).command((function(t){var n=t.state;return(0,v.y_)(s,E(E({},r),e))(n,i)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},Ne=function(t){return function(e){var n=e.tr;if(e.dispatch){var r=n.doc,o=et(t,0,r.content.size),i=m.nh.create(r,o);n.setSelection(i)}return!0}},$e=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,E(E({},e.attrs),{},{dir:t}))})),!0}},ze=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,i=o.from,a=o.to,s=m.U3.atStart(r).from,u=m.U3.atEnd(r).to,c=et(i,s,u),l=et(a,s,u),d=m.U3.create(r,c,l);n.setSelection(d)}return!0}},Be=function(t){return function(e){var n=e.state,r=e.dispatch,o=L(t,n.schema);return(0,y.$B)(o)(n,r)}};function Le(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 _e=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,r=t.state,o=t.dispatch,i=t.editor,a=n.selection,s=n.doc,u=a.$from,c=a.$to,l=we(i.extensionManager.attributes,u.node().type.name,u.node().attrs);if(a instanceof m.nh&&a.node.isBlock)return!(!u.parentOffset||!(0,h.zy)(s,u.pos))&&(o&&(e&&Le(r,i.extensionManager.splittableMarks),n.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;var d=c.parentOffset===c.parent.content.size,f=0===u.depth?void 0:vt(u.node(-1).contentMatchAt(u.indexAfter(-1))),p=d&&f?[{type:f,attrs:l}]:void 0,v=(0,h.zy)(n.doc,n.mapping.map(u.pos),1,p);if(p||v||!(0,h.zy)(n.doc,n.mapping.map(u.pos),1,f?[{type:f}]:void 0)||(v=!0,p=f?[{type:f,attrs:l}]:void 0),o){if(v&&(a instanceof m.U3&&n.deleteSelection(),n.split(n.mapping.map(u.pos),1,p),f&&!d&&!u.parentOffset&&u.parent.type!==f)){var g=n.mapping.map(u.before()),y=n.doc.resolve(g);u.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&n.setNodeMarkup(n.mapping.map(u.before()),f)}e&&Le(r,i.extensionManager.splittableMarks),n.scrollIntoView()}return v}},Fe=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=n.editor,u=L(t,i.schema),c=i.selection,l=c.$from,d=c.$to,f=i.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(d))return!1;var p=l.node(-1);if(p.type!==u)return!1;var v=s.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if
1(2===l.depth||l.node(-3).type!==u||l.index(-2)!==l.node(-2).childCount-1)return!1;if(a){for(var y=g.FK.empty,k=l.index(-1)?1:l.index(-2)?2:3,b=l.depth-k;b>=l.depth-3;b-=1)y=g.FK.from(l.node(b).copy(y));var w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,x=E(E({},we(v,l.node().type.name,l.node().attrs)),e),M=(null==(r=u.contentMatch.defaultType)?void 0:r.createAndFill(x))||void 0;y=y.append(g.FK.from(u.createAndFill(null,M)||void 0));var A=l.before(l.depth-(k-1));o.replace(A,l.after(-w),new g.Ji(y,4-k,0));var S=-1;o.doc.nodesBetween(A,o.doc.content.size,(function(t,e){if(S>-1)return!1;t.isTextblock&&0===t.content.size&&(S=e+1)})),S>-1&&o.setSelection(m.U3.near(o.doc.resolve(S))),o.scrollIntoView()}return!0}var O=d.pos===l.end()?p.contentMatchAt(0).defaultType:null,C=E(E({},we(v,p.type.name,p.attrs)),e),T=E(E({},we(v,l.node().type.name,l.node().attrs)),e);o.delete(l.pos,d.pos);var P=O?[{type:u,attrs:C},{type:O,attrs:T}]:[{type:u,attrs:C}];if(!(0,h.zy)(o.doc,l.pos,2))return!1;if(a){var j=i.selection,R=i.storedMarks,D=s.extensionManager.splittableMarks,I=R||j.$to.parentOffset&&j.$from.marks();if(o.split(l.pos,2,P).scrollIntoView(),!I||!a)return!0;var N=I.filter((function(t){return D.includes(t.type.name)}));o.ensureMarks(N)}return!0}};function Ve(t){return t&&"1"!==t?t:null}function Ke(t,e){return Ve(t)===Ve(e)}var Ue=function(t,e){var n=qt((function(t){return t.type===e}))(t.selection);if(!n)return!0;var r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!(0,h.n9)(t.doc,n.pos)||(!Ke(n.node.attrs.type,null==o?void 0:o.attrs.type)||(t.join(n.pos),!0))},We=function(t,e){var n=qt((function(t){return t.type===e}))(t.selection);if(!n)return!0;var r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=t.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!(0,h.n9)(t.doc,r)||(!Ke(n.node.attrs.type,null==o?void 0:o.attrs.type)||(t.join(r),!0))};var He=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,d=o.can,f=i.extensionManager,p=f.extensions,h=f.splittableMarks,v=L(t,s.schema),g=L(e,s.schema),y=s.selection,k=s.storedMarks,b=y.$from,w=y.$to,x=b.blockRange(w),M=k||y.$to.parentOffset&&y.$from.marks();if(!x)return!1;var A=qt((function(t){return Ee(t.type.name,p)}))(y),S=0===y.from&&y.to===s.doc.content.size,E=s.doc.content.content,O=1===E.length?E[0]:null,C=S&&O&&Ee(O.type.name,p)?{node:O,pos:0,depth:0}:null,T=null!=A?A:C,P=!!C;if((!!A&&x.depth>=1&&x.depth-A.depth<=1||P)&&T){if(T.node.type===v)return S&&P?c().command((function(t){var e=t.tr,n=t.dispatch,r=function(t){var e=t.doc,n=e.firstChild;if(!n)return null;var r=e.resolve(1),o=e.resolve(n.nodeSize-1);return m.U3.between(r,o)}(e);return!!r&&(e.setSelection(r),n&&n(e),!0)})).liftListItem(g).run():l.liftListItem(g);if(Ee(T.node.type.name,p)&&v.validContent(T.node.content))return c().command((function(){return a.setNodeMarkup(T.pos,v),!0})).command((function(){return Ue(a,v)})).command((function(){return We(a,v)})).run()}return n&&M&&u?c().command((function(){var t=d().wrapInList(v,r),e=M.filter((function(t){return h.includes(t.type.name)}));return a.ensureMarks(e),!!t||l.clearNodes()})).wrapInList(v,r).command((function(){return Ue(a,v)})).command((function(){return We(a,v)})).run():c().command((function(){return!!d().wrapInList(v,r)||l.clearNodes()})).wrapInList(v,r).command((function(){return Ue(a,v)})).command((function(){return We(a,v)})).run()}},qe=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=Z(t,o.schema);return xe(o,u,e)?i.unsetMark(u,{extendEmptyMarkRange:s}):i.setMark(u,e)}},Je=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=L(t,i.schema),u=L(e,i.schema),c=Ot(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,E(E({},o),n))}},Qe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=L(t,r.schema);return Ot(r,i,e)?o.lift(i):o.wrapIn(i,e)}},Ye=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}},Ze=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};
1return function(e){var n=e.tr,r=e.dispatch,o=e.editor,i=t.ignoreClearable,a=void 0!==i&&i,s=n.selection,u=s.empty,c=s.ranges;if(u)return!0;var l=o.extensionManager.nonClearableMarks;if(r){var d=Object.values(o.schema.marks).filter((function(t){return a||!l.includes(t.name)}));c.forEach((function(t){var e,r=M(d);try{for(r.s();!(e=r.n()).done;){var o=e.value;n.removeMark(t.$from.pos,t.$to.pos,o)}}catch(i){r.e(i)}finally{r.f()}}))}return!0}},Ge=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=Z(t,i.schema),d=c.$from,f=c.empty,p=c.ranges;if(!a)return!0;if(f&&u){var h=c.from,v=c.to,m=null==(r=d.marks().find((function(t){return t.type===l})))?void 0:r.attrs,g=Y(d,l,m);g&&(h=g.from,v=g.to),o.removeMark(h,v,l)}else p.forEach((function(t){o.removeMark(t.$from.pos,t.$to.pos,l)}));return o.removeStoredMark(l),!0}},Xe=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=E({},t.attrs);delete n.dir,o.setNodeMarkup(e,void 0,n)}})),!0}},tn=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=Rt("string"==typeof t?t:t.name,o.schema);if(!u)return!1;"node"===u&&(a=L(t,o.schema)),"mark"===u&&(s=Z(t,o.schema));var c=!1;return r.selection.ranges.forEach((function(t){var n,u,l,d,f=t.$from.pos,p=t.$to.pos;r.selection.empty?o.doc.nodesBetween(f,p,(function(t,e){a&&a===t.type&&(c=!0,l=Math.max(e,f),d=Math.min(e+t.nodeSize,p),n=e,u=t)})):o.doc.nodesBetween(f,p,(function(t,o){o<f&&a&&a===t.type&&(c=!0,l=Math.max(o,f),d=Math.min(o+t.nodeSize,p),n=o,u=t),o>=f&&o<=p&&(a&&a===t.type&&(c=!0,i&&r.setNodeMarkup(o,void 0,E(E({},t.attrs),e))),s&&t.marks.length&&t.marks.forEach((function(n){if(s===n.type&&(c=!0,i)){var a=Math.max(o,f),u=Math.min(o+t.nodeSize,p);r.addMark(a,u,s.create(E(E({},n.attrs),e)))}})))})),u&&(void 0!==n&&i&&r.setNodeMarkup(n,void 0,E(E({},u.attrs),e)),s&&u.marks.length&&u.marks.forEach((function(t){s===t.type&&i&&r.addMark(l,d,s.create(E(E({},t.attrs),e)))})))})),c}},en=new m.hs("__tiptap_decorations__"),nn=function(t){return function(e){var n=e.tr;return e.dispatch&&n.setMeta(en,{type:"force",name:t}),!0}},rn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=L(t,r.schema);return(0,v.Im)(i,e)(r,o)}},on=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=L(t,r.schema);return(0,y.Sd)(i,e)(r,o)}},an=new WeakMap;var sn=function(){function t(){(0,d.A)(this,t),this.callbacks={}}return(0,f.A)(t,[{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];return 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;return this.on(t,(function r(){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)}))}},{key:"removeAllListeners",value:function(){this.callbacks={}}}]),t}(),un="undefined"!=typeof process&&!1;function cn(t){return"widget"===t.kind}function ln(t,e){var n,r=[],o=new Set,i=M(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;"widget"===a.kind&&cn(a)&&o.add(a.key),r.push(a.toPMDecoration(e))}}catch(s){i.e(s)}finally{i.f()}
1return{decorations:r,widgetKeys:o}}function dn(t){var e=t.position,n=t.from,r=t.to,o=t.docSize;return!(e<n)&&(e<r||e===r&&r===o)}function fn(t){var e,n=null==(e=t.spec)?void 0:e.key;return"string"==typeof n?n:void 0}function pn(t){return"attr"===t.jsonID}function hn(t,e){for(var n=null,r=0,o=0,i=0;i<t.childCount&&!(o>e.to);i+=1){var a=o+t.child(i).nodeSize;a>=e.from&&(null===n&&(n=o),r=a),o=a}return null===n?null:{from:n,to:r}}function vn(t,e){if(t.steps.some((function(t){return!function(t){var e=!1;if(t.getMap().forEach((function(){e=!0})),e||pn(t))return!0;var n=t;return"number"==typeof n.from&&"number"==typeof n.to}(t)})))return{type:"full"};var n=me(t).map((function(t){return t.newRange}));t.steps.forEach((function(e,r){if(pn(e)){var o=t.mapping.slice(r);n.push({from:o.map(e.pos,-1),to:o.map(e.pos+1)})}}));var r,o=[],i=M(n);try{for(i.s();!(r=i.n()).done;){var a=hn(e,r.value);a&&o.push(a)}}catch(f){i.e(f)}finally{i.f()}o.sort((function(t,e){return t.from-e.from}));for(var s=[],u=0,c=o;u<c.length;u++){var l=c[u],d=s[s.length-1];d&&l.from<=d.to?d.to=Math.max(d.to,l.to):s.push(E({},l))}return{type:"ranges",ranges:s}}function mn(t,e,n,r){return t.map(e,n,{onRemove:function(t){var e=null==t?void 0:t.key;"string"==typeof e&&r.delete(e)}})}function gn(t,e,n){var r,o,i=null!=(r=e.decorationSetsByExtension[t])?r:k.zF.empty,a=new Set(null!=(o=e.widgetKeysByExtension[t])?o:[]);return{set:mn(i,n.mapping,n.doc,a),widgetKeys:a}}function yn(t,e){var n=Object.values(e).flatMap((function(t){return t.find()}));return k.zF.create(t,n)}function kn(t){for(var e=new Set,n=0,r=Object.values(t);n<r.length;n++){var o,i=M(r[n]);try{for(i.s();!(o=i.n()).done;){var a=o.value;e.add(a)}}catch(s){i.e(s)}finally{i.f()}}return e}function bn(t,e,n){return!!n||"manual"!==t.update&&(t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged)}var wn=new Set;var xn=function(){function t(e){var n=this;(0,d.A)(this,t),this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=function(t){var e=t.nextState,r=en.getState(e);r&&n.warnDuplicateWidgetKeys(r)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach((function(t){return function(t,e){var n;switch(null!=(n=e.update)?n:"document"){case"document":if(e.createInRange)throw new Error('[tiptap error]: Extension "'.concat(t,'" provides createInRange() but does not use the "changedRanges" decoration update strategy.'));return;case"changedRanges":if(!e.createInRange)throw new Error('[tiptap error]: Extension "'.concat(t,'" uses the "changedRanges" decoration update strategy but does not provide createInRange().'));return;case"manual":if(e.createInRange)throw new Error('[tiptap error]: Extension "'.concat(t,'" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.'));if(e.shouldUpdate)throw new Error('[tiptap error]: Extension "'.concat(t,'" cannot combine the "manual" decoration update strategy with shouldUpdate().'));return;default:throw new Error('[tiptap error]: Extension "'.concat(t,'" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".'))}}(t.name,t.spec)})),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}return(0,f.A)(t,[{key:"destroy",value:function(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}},{key:"liveWidgetKeys",value:function(){var t,e;return null!=(e=null==(t=en.getState(this.editor.state))?void 0:t.widgetKeys)?e:wn}},{key:"mountedView",get:function(){return this.editor.isDestroyed?null:this.editor.view}},{key:"resolveEntries",value:function(t){var e,n=[],r=M(t);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=o.name,a=(0,o.addDecorations)();a&&n.push({name:i,spec:a})}}catch(s){r.e(s)}finally{r.f()}return n}},{key:"createPlugin",value:function(){var t=this,e=this.editor,n=this.entries;return new m.k_({key:en,state:{init:function(e,r){var o,i={},a={},s=M(n);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=u.name,l=u.spec,d=t.buildFullSet(c,l,r),f=d.set,p=d.widgetKeys;i[c]=f,a[c]=p}}catch(v){s.e(v)}finally{s.f()}var h={decorationSetsByExtension:i,widgetKeysByExtension:a,mergedDecorationSet:t.buildMergedSet(r.doc,i),widgetKeys:kn(a)};return t.warnDuplicateWidgetKeys(h),h},apply:function(r,o,i,a){var s=r.getMeta(en),u="force"===(null==s?void 0:s.type)&&!s.name,c="force"===(null==s?void 0:s.type)?s.name:void 0,l={},d={},f=new Set;if(function(t,e){var n,r;an.set(t,(null!=(n=an.get(t))?n:0)+1);try{return e()}finally{var o=(null!=(r=an.get(t))?r:1)-1;o>
10?an.set(t,o):an.delete(t)}}(e,(function(){var s,p=M(n);try{for(p.s();!(s=p.n()).done;){var h=s.value,v=h.name,m=h.spec,g=u||c===v;if(bn(m,{editor:e,tr:r,oldState:i,newState:a},g))if("changedRanges"===m.update&&r.docChanged&&!g){var y=t.applyChangedRangesRecompute(v,m,o,r,a);l[v]=y.set,d[v]=y.widgetKeys,f.add(v)}else{var k=t.buildFullSet(v,m,a),b=k.set,w=k.widgetKeys;l[v]=b,d[v]=w,f.add(v)}else{var x=gn(v,o,r);l[v]=x.set,d[v]=x.widgetKeys}}}catch(A){p.e(A)}finally{p.f()}})),0===f.size&&!r.docChanged)return o;var p=t.mergeAfterApply({entries:n,previous:o,tr:r,decorationSetsByExtension:l,recomputedNames:f});return{decorationSetsByExtension:l,widgetKeysByExtension:d,mergedDecorationSet:p,widgetKeys:kn(d)}}},props:{decorations:function(t){var e,n;return null!=(n=null==(e=en.getState(t))?void 0:e.mergedDecorationSet)?n:k.zF.empty}}})}},{key:"applyChangedRangesRecompute",value:function(t,e,n,r,o){var i=vn(r,o.doc);return"full"===i.type?this.buildFullSet(t,e,o):this.rebuildRanges(t,e,n,r,o,i.ranges)}},{key:"rebuildRanges",value:function(t,e,n,r,o,i){var a,s,u,c=this,l=null!=(a=n.decorationSetsByExtension[t])?a:k.zF.empty,d=new Set(null!=(s=n.widgetKeysByExtension[t])?s:[]),f=mn(l,r.mapping,r.doc,d),p=o.doc.content.size,h=M(i);try{var v=function(){var n,r=u.value,i=r.from,a=r.to,s=f.find(i,a).filter((function(t){return dn({position:t.from,from:i,to:a,docSize:p})})),l=M(s);try{for(l.s();!(n=l.n()).done;){var h=fn(n.value);h&&d.delete(h)}}catch(x){l.e(x)}finally{l.f()}f=f.remove(s);var v=function(t){var e=t.decorations,n=t.from,r=t.to,o=t.docSize,i=t.extensionName,a=t.warnedExtensions;return e.filter((function(t){return!!dn({position:t.anchor,from:n,to:r,docSize:o})||(t.anchor===r||a.has(i)||(a.add(i),console.warn('[tiptap warn]: Extension "'.concat(i,'" returned a decoration outside the requested range [').concat(n,", ").concat(r,"). It was ignored."))),!1)}))}({decorations:c.runCreate(t,"createInRange",(function(){return e.createInRange({editor:c.editor,state:o,view:c.mountedView,from:i,to:a})})),from:i,to:a,docSize:p,extensionName:t,warnedExtensions:c.warnedOutOfRangeExtensions}),m=ln(v,t),g=m.decorations,y=m.widgetKeys;f=f.add(o.doc,g);var k,b=M(y);try{for(b.s();!(k=b.n()).done;){var w=k.value;d.add(w)}}catch(x){b.e(x)}finally{b.f()}};for(h.s();!(u=h.n()).done;)v()}catch(m){h.e(m)}finally{h.f()}return{set:f,widgetKeys:d}}},{key:"buildFullSet",value:function(t,e,n){var r=this,o=this.runCreate(t,"create",(function(){return e.create({editor:r.editor,state:n,view:r.mountedView})}));return function(t,e,n){var r=ln(e,n),o=r.decorations,i=r.widgetKeys;return{set:k.zF.create(t,o),widgetKeys:i}}(n.doc,o,t)}},{key:"runCreate",value:function(t,e,n){try{return n()}catch(r){return console.error('[tiptap error]: Extension "'.concat(t,'" threw in `addDecorations().').concat(e,"()`. Its decorations were dropped for this update."),r),[]}}},{key:"warnDuplicateWidgetKeys",value:function(t){if(un)if(0!==t.widgetKeys.size){var e,n=function(t){var e,n,r,o,i=new Map,a=new Map,s=M(t.find());try{for(s.s();!(o=s.n()).done;){var u=o.value,c=fn(u);if(c){var d=null!=(e=u.spec.extensionName)?e:"unknown",f=null!=(n=i.get(c))?n:new Set;f.add(d),i.set(c,f),a.set(c,(null!=(r=a.get(c))?r:0)+1)}}}catch(p){s.e(p)}finally{s.f()}return Array.from(i,(function(t){var e=(0,l.A)(t,2);return{key:e[0],extensions:e[1]}})).filter((function(t){var e,n=t.key;return(null!=(e=a.get(n))?e:0)>1}))}(t.mergedDecorationSet),r=new Set(n.map((function(t){return t.key}))),o=M(n);try{for(o.s();!(e=o.n()).done;){var i=e.value,a=i.key,s=i.extensions;if(!this.warnedWidgetKeys.has(a)){var u=Array.from(s).map((function(t){return'"'.concat(t,'"')})).join(", ");console.warn('[tiptap warn]: Duplicate widget decoration key "'.concat(a,'" in extension').concat(1===s.size?"":"s"," ").concat(u,". Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. `comment-${id}`)."))}}}catch(c){o.e(c)}finally{o.f()}this.warnedWidgetKeys=r}else this.warnedWidgetKeys.clear()}},{key:"buildMergedSet",value:function(t,e){var n=Object.keys(e);return 1===n.length?e[n[0]]:yn(t,e)}},{key:"mergeAfterApply",value:function(t){var e=t.entries,n=t.previous,r=t.tr,o=t.decorationSetsByExtension,i=t.recomputedNames;return 1===e.length?o[e[0].name]:0===i.size?n.mergedDecorationSet.map(r.mapping,r.doc):yn(r.doc,o)}}]),t}();function Mn(t,e){var n=t.selection,r=n.$from;if(n instanceof m.nh){var o=r.index();return r.parent.canReplaceWith(o,o+1,e)}for(var i=r.depth;i>=0;){var a=r.index(i);if(r.node(i).contentMatchAt(a).matchType(e))return!0;
1i-=1}return!1}function An(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Sn(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,"__")})),o=r.match(/(?:^|\s)\.([\w-]+)/g);if(o){var i=o.map((function(t){return t.trim().slice(1)}));e.class=i.join(" ")}var a=r.match(/(?:^|\s)#([\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=(0,l.A)(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)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\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 En(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=(0,l.A)(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 On(t){var e=t.nodeName,n=t.name,r=t.parseAttributes,o=void 0===r?Sn:r,i=t.serializeAttributes,a=void 0===i?En:i,s=t.defaultAttributes,u=void 0===s?{}:s,c=t.requiredAttributes,l=void 0===c?[]:c,d=t.allowedAttributes,f=n||e;return{parseMarkdown:function(t,n){var r=E(E({},u),t.attributes);return n.createNode(e,r,[])},markdownTokenizer:{name:e,level:"block",start:function(t){var e,n=new RegExp("^:::".concat(f,"(?:\\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(f,"(?:\\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(!d)return t;var e={};return d.forEach((function(n){n in t&&(e[n]=t[n])})),e}(t.attrs||{}),n=a(e),r=n?" {".concat(n,"}"):"";return":::".concat(f).concat(r," :::")}}}function Cn(t){var e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?Sn:o,a=t.serializeAttributes,s=void 0===a?En:a,u=t.defaultAttributes,c=void 0===u?{}:u,d=t.content,f=void 0===d?"block":d,p=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=E(E({},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=(0,l.A)(s,2),c=u[0],d=u[1],p=i(void 0===d?"":d),v=1,m=c.length,g="",y=/^:::([\w-]*)(\s.*)?/gm,k=t.slice(m);for(y.lastIndex=0;;){var b=y.exec(k);if(null===b)break;var w=b.index,x=b[1];if(!(null==(o=b[2])?void 0:o.endsWith(":::")))if(x)v+=1;else if(0===(v-=1)){var M=k.slice(0,w);g=M.trim();var A=t.slice(0,m+w+b[0].length),S=[];if(g)if("block"===f)for((S=r.blockTokens(M)).forEach((function(t){!t.text||t.tokens&&0!==t.tokens.length||(t.tokens=r.inlineTokens(t.text))}));S.length>0;){var E=S[S.length-1];if("paragraph"!==E.type||E.text&&""!==E.text.trim())break;S.pop()}else S=r.inlineTokens(g);return{type:e,raw:A,attributes:p,content:g,tokens:S}}}}}},renderMarkdown:function(t,e){var n=function(t){if(!p)return t;var e={};return p.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 Tn(t){if(!t.trim())return{};for(var e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(t);null!==r;){var o=r,i=(0,l.A)(o,4),a=i[1],s=i[2],u=i[3];e[a]=s||u,r=n.exec(t)}return e}function Pn(t){return Object.entries(t).filter((function(t){var e=(0,l.A)(t,2)[1];return null!=e})).map((function(t){var e=(0,l.A)(t,2),n=e[0],r=e[1];return"".concat(n,'="').concat(r,'"')})).join(" ")}function jn(t){var e=t.nodeName,n=t.name,r=t.getContent,o=t.parseAttributes,i=void 0===o?Tn:o,a=t.serializeAttributes,s=void 0===a?Pn:a,u=t.defaultAttributes,c=void 0===u?{}:u,d=t.selfClosing,f=void 0!==d&&d,p=t.allowedAttributes,h=n||e,v=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:function(t,n){var o=E(E({},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(v,"\\s*[^\\]]*\\]")):new RegExp("\\[".concat(v,"\\s*[^\\]]*\\][\\s\\S]*?\\[\\/").concat(v,"\\]")),n=t.match(e),r=null==n?void 0:n.index;return void 0!==r?r:-1}
1,tokenize:function(t,n,r){var o=f?new RegExp("^\\[".concat(v,"\\s*([^\\]]*)\\]")):new RegExp("^\\[".concat(v,"\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(v,"\\]")),a=t.match(o);if(a){var s="",u="";if(f){u=(0,l.A)(a,2)[1]}else{var c=(0,l.A)(a,3);u=c[1],s=c[2]||""}var d=i(u.trim());return{type:e,raw:a[0],content:s.trim(),attributes:d}}}},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(!p)return t;var e={};return p.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 Rn(t,e,n){for(var r,o,i,a,s,u=t.split("\n"),c=[],l="",d=0,f=e.baseIndentSize||2,p=function(){var t=u[d],s=t.match(e.itemPattern);if(!s)return c.length>0?0:""===t.trim()?(d+=1,l="".concat(l).concat(t,"\n"),1):{v:void 0};var p=e.extractItemData(s),h=p.indentLevel,v=p.mainContent;l="".concat(l).concat(t,"\n");var m,g=[v];for(d+=1;d<u.length;){var y=u[d];if(""===y.trim()){var k=u.slice(d+1).findIndex((function(t){return""!==t.trim()}));if(-1===k)break;var b=u[d+1+k];if(((null==(o=null==(r=b.match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>h){g.push(y),l="".concat(l).concat(y,"\n"),d+=1;continue}break}if(!(((null==(a=null==(i=y.match(/^(\s*)/))?void 0:i[1])?void 0:a.length)||0)>h))break;g.push(y),l="".concat(l).concat(y,"\n"),d+=1}var w=g.slice(1);if(w.length>0){var x=w.map((function(t){return t.slice(h+f)})).join("\n");x.trim()&&(m=e.customNestedParser?e.customNestedParser(x):n.blockTokens(x))}var M=e.createToken(p,m);c.push(M)};d<u.length&&0!==(s=p());)if(1!==s&&s)return s.v;if(0!==c.length)return{items:c,raw:l}}function Dn(t,e,n,r){if(!t||!Array.isArray(t.content))return"";var o="function"==typeof n?n(r):n,i=(0,u.A)(t.content),a=i[0],s=i.slice(1),c=e.renderChildren([a]),l="".concat(o).concat(c);return s&&s.length>0&&s.forEach((function(t,n){var r,o,i=null!=(o=null==(r=e.renderChild)?void 0:r.call(e,t,n+1))?o:e.renderChildren([t]);if(null!=i){var a=i.split("\n").map((function(t){return t?e.indent(t):e.indent("")})).join("\n");l+="paragraph"===t.type?"\n\n".concat(a):"\n".concat(a)}})),l}function In(t,e){var n=E({},t);return An(t)&&An(e)&&Object.keys(e).forEach((function(r){An(e[r])&&An(t[r])?n[r]=In(t[r],e[r]):n[r]=e[r]})),n}function Nn(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(E(E({},t.attrs),n));i.removeMark(o,s,t.type),i.addMark(o,s,l)}}})),i.docChanged&&e.view.dispatch(i)}C({},{createAtomBlockMarkdownSpec:function(){return On},createBlockMarkdownSpec:function(){return Cn},createInlineMarkdownSpec:function(){return jn},parseAttributes:function(){return Sn},parseIndentedBlocks:function(){return Rn},renderNestedMarkdownContent:function(){return Dn},serializeAttributes:function(){return En}});var $n=(0,f.A)((function t(e){var n;(0,d.A)(this,t),this.find=e.find,this.handler=e.handler,this.undoable=null==(n=e.undoable)||n}));function zn(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,d=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(H(e))return e.exec(t);var n=e(t);if(!n)return null;var r=[n.text];
1return 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}(d,t.find);if(e){var a=e[0].length-i.length;if(a>0){var f=c.parentOffset-a;if(f<0||c.parent.textBetween(f,c.parentOffset)!==e[0].slice(0,a))return}var p=u.state.tr,h=T({state:u.state,transaction:p}),v={from:r-(e[0].length-i.length),to:o},m=new P({editor:n,state:h}),g=m.commands,y=m.chain,k=m.can;null!==t.handler({state:h,range:v,match:e,commands:g,chain:y,can:k})&&p.steps.length&&(t.undoable&&p.setMeta(s,{transform:p,from:r,to:o,text:i}),u.dispatch(p),l=!0)}}})),l}var Bn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,d.A)(this,t),this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config=E(E({},this.config),e),this.name=this.config.name}return(0,f.A)(t,[{key:"options",get:function(){return E({},Gt(Jt(this,"addOptions",{name:this.name})))}},{key:"storage",get:function(){return E({},Gt(Jt(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(E(E({},this.config),{},{addOptions:function(){return In(t.options,e)}}));return n.name=this.name,n.parent=this.parent,this.child=null,n}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new this.constructor(E(E({},this.config),t));return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}}]),t}(),Ln=function(t){(0,i.A)(n,t);var e=w(n);function n(){var t;return(0,d.A)(this,n),(t=e.apply(this,arguments)).type="mark",t}return(0,f.A)(n,[{key:"configure",value:function(t){return(0,o.A)((0,s.A)(n.prototype),"configure",this).call(this,t)}},{key:"extend",value:function(t){var e="function"==typeof t?t():t;return(0,o.A)((0,s.A)(n.prototype),"extend",this).call(this,e)}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n("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}}]),n}(Bn),_n=(0,f.A)((function t(e){(0,d.A)(this,t),this.find=e.find,this.handler=e.handler}));function Fn(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 P({editor:e,state:n}),l=u.commands,d=u.chain,f=u.can,p=[];return n.doc.nodesBetween(r,o,(function(t,e){var u,h,v,m,g;if(!(null==(h=null==(u=t.type)?void 0:u.spec)?void 0:h.code)&&(t.isText||t.isTextblock||t.isInline)){var y=null!=(g=null!=(m=null==(v=t.content)?void 0:v.size)?m:t.nodeSize)?g:0,k=Math.max(r,e),b=Math.min(o,e+y);if(!(k>=b))(function(t,e,n){if(H(e))return(0,c.A)(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(k-e,b-e,void 0,""),i.find,a).forEach((function(t){if(void 0!==t.index){var e=k+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:l,chain:d,can:f,pasteEvent:a,dropEvent:s});p.push(u)}}))}})),p.every((function(t){return null!==t}))}var Vn=null;function Kn(t){var e,n=t.editor,r=t.rules,o=null,i=!1,a=!1,s="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{e="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(c){e=null}var u=function(t){var r=t.state,o=t.from,i=t.to,a=t.rule,u=t.pasteEvt,c=r.tr,l=T({state:r,transaction:c});if(Fn({editor:n,state:l,from:Math.max(o-1,0),to:i.b-1,rule:a,pasteEvent:u,dropEvent:e})&&c.steps.length){try{e="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(d){e=null}return s="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,c}};return r.map((function(t){return new m.k_({view:function(t){var e=function(e){var r;(o=(null==(r=t.dom.parentElement)?void 0:r.contains(e.target))?t.dom.parentElement:null)&&(Vn=n)},r=function(){Vn&&(Vn=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(a=o===t.dom.parentElement,e=n,!a){var r=Vn;(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 s=e,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(e,n,r){var o=e[0],c="paste"===o.getMeta("uiEvent")&&!i,l="drop"===o.getMeta("uiEvent")&&!a,d=o.getMeta("applyPasteRules"),f=!!d;if(c||l||f){if(f){var p=d.text;"string"==typeof p||(p=Yt(g.FK.from(p),r.schema));var h=d.from,v=h+p.length,m=function(t){var e,n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(e=n.clipboardData)||e.setData("text/html",t),n}(p);return u({rule:t,state:r,from:h,to:{b:v},pasteEvt:m})}
1var y=n.doc.content.findDiffStart(r.doc.content),k=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof y&&k&&y!==k.b)return u({rule:t,state:r,from:y,to:k,pasteEvt:s})}}})}))}var Un=function(){function t(e,n){(0,d.A)(this,t),this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=n,this.baseExtensions=e,this.extensions=ce(e),this.schema=se(this.extensions,n),this.setupExtensions()}return(0,f.A)(t,[{key:"commands",get:function(){var t=this;return this.extensions.reduce((function(e,n){var r=Jt(n,"addCommands",{name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:t.editor,type:be(n.name,t.schema)});return r?E(E({},e),r()):e}),{})}},{key:"plugins",get:function(){var t=this,e=this.editor,n=ue((0,c.A)(this.extensions).reverse()).flatMap((function(n){var r={name:n.name,options:n.options,storage:t.editor.extensionStorage[n.name],editor:e,type:be(n.name,t.schema)},o=[],i=Jt(n,"addKeyboardShortcuts",r),a={};if("mark"===n.type&&Jt(n,"exitable",r)&&(a.ArrowRight=function(){return Ln.handleExit({editor:e,mark:n})}),i){var s=Object.fromEntries(Object.entries(i()).map((function(t){var n=(0,l.A)(t,2),r=n[0],o=n[1];return[r,function(){return o({editor:e})}]})));a=E(E({},a),s)}var u=(0,b.w)(a);o.push(u);var d=Jt(n,"addInputRules",r);if(Se(n,e.options.enableInputRules)&&d){var f=d();if(f&&f.length){var p=function(t){var e=t.editor,n=t.rules,r=new m.k_({state:{init:function(){return null},apply:function(t,o,i){var a=t.getMeta(r);if(a)return a;var s=t.getMeta("applyInputRules");return!!s&&setTimeout((function(){var t=s.text;"string"==typeof t||(t=Yt(g.FK.from(t),i.schema));var o=s.from,a=o+t.length;zn({editor:e,from:o,to:a,text:t,rules:n,plugin:r})})),t.selectionSet||t.docChanged?null:o}},props:{handleTextInput:function(t,o,i,a){return zn({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&&zn({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&&zn({editor:e,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:f}),h=Array.isArray(p)?p:[p];o.push.apply(o,(0,c.A)(h))}}var v=Jt(n,"addPasteRules",r);if(Se(n,e.options.enablePasteRules)&&v){var y=v();if(y&&y.length){var k=Kn({editor:e,rules:y});o.push.apply(o,(0,c.A)(k))}}var w=Jt(n,"addProseMirrorPlugins",r);if(w){var x=w();o.push.apply(o,(0,c.A)(x))}return o})),r=this.createDecorationPlugin();return r&&n.push(r),n}},{key:"createDecorationPlugin",value:function(){var t,e=this,n=this.editor;null==(t=this.decorationManager)||t.destroy();var r=[];return this.extensions.forEach((function(t){var o=Jt(t,"addDecorations",{name:t.name,options:t.options,storage:e.editor.extensionStorage[t.name],editor:n,type:be(t.name,e.schema)});o&&r.push({name:t.name,addDecorations:o})})),this.decorationManager=new xn({editor:n,entries:r}),this.decorationManager.plugin}},{key:"attributes",get:function(){return te(this.extensions)}},{key:"nodeViews",get:function(){var t=this,e=this.editor,n=Xt(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(t){return!!Jt(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:L(n.name,t.schema)},i=Jt(n,"addNodeView",o);if(!i)return[];var a=i();if(!a)return[];return[n.name,function(t,o,i,s,u){var c=re(t,r);return a({node:t,view:o,getPos:i,decorations:s,innerDecorations:u,editor:e,extension:n,HTMLAttributes:c})}]})))}},{key:"dispatchTransaction",value:function(t){var e=this,n=this.editor;return ue((0,c.A)(this.extensions).reverse()).reduceRight((function(t,r){var o={name:r.name,options:r.options,storage:e.editor.extensionStorage[r.name],editor:n,type:be(r.name,e.schema)},i=Jt(r,"dispatchTransaction",o);return i?function(e){i.call(o,{transaction:e,next:t})}:t}),t)}},{key:"transformPastedHTML",value:function(t){var e=this,n=this.editor;return ue((0,c.A)(this.extensions)).reduce((function(t,r){var o={name:r.name,options:r.options,storage:e.editor.extensionStorage[r.name],editor:n,type:be(r.name,e.schema)},i=Jt(r,"transformPastedHTML",o);return i?function(e,n){var r=t(e,n);return i.call(o,r)}:t}),t||function(t){return t})}},{key:"markViews",get:function(){var t=this,e=this.editor,n=Xt(this.extensions).markExtensions;return Object.fromEntries(n.filter((function(t){return!!Jt(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:Z(n.name,t.sc
1hema)},i=Jt(n,"addMarkView",o);if(!i)return[];return[n.name,function(t,o,a){var s=re(t,r);return i()({mark:t,view:o,inline:a,editor:e,extension:n,HTMLAttributes:s,updateAttributes:function(n){Nn(t,e,n)}})}]})))}},{key:"destroy",value:function(){var t;null==(t=this.decorationManager)||t.destroy(),this.extensions.forEach((function(t){for(var e=t;e.parent;){var n=e.parent;n.child===e&&(n.child=null),e=n}})),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}},{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,o={name:e.name,options:e.options,storage:t.editor.extensionStorage[e.name],editor:t.editor,type:be(e.name,t.schema)};"mark"===e.type&&((null==(n=Gt(Jt(e,"keepOnSplit",o)))||n)&&t.splittableMarks.push(e.name),null==(r=Gt(Jt(e,"clearable",o)))||r||t.nonClearableMarks.push(e.name));var i=Jt(e,"onBeforeCreate",o),a=Jt(e,"onCreate",o),s=Jt(e,"onUpdate",o),u=Jt(e,"onSelectionUpdate",o),c=Jt(e,"onTransaction",o),l=Jt(e,"onFocus",o),d=Jt(e,"onBlur",o),f=Jt(e,"onDestroy",o);i&&t.editor.on("beforeCreate",i),a&&t.editor.on("create",a),s&&t.editor.on("update",s),u&&t.editor.on("selectionUpdate",u),c&&t.editor.on("transaction",c),l&&t.editor.on("focus",l),d&&t.editor.on("blur",d),f&&t.editor.on("destroy",f)}))}}]),t}();Un.resolve=ce,Un.sort=ue,Un.flatten=Qt;C({},{ClipboardTextSerializer:function(){return Hn},Commands:function(){return qn},Delete:function(){return Jn},Drop:function(){return Qn},Editable:function(){return Yn},FocusEvents:function(){return Gn},Keymap:function(){return Xn},Paste:function(){return tr},Tabindex:function(){return er},TextDirection:function(){return nr},focusEventsPluginKey:function(){return Zn}});var Wn=function(t){(0,i.A)(n,t);var e=w(n);function n(){var t;return(0,d.A)(this,n),(t=e.apply(this,arguments)).type="extension",t}return(0,f.A)(n,[{key:"configure",value:function(t){return(0,o.A)((0,s.A)(n.prototype),"configure",this).call(this,t)}},{key:"extend",value:function(t){var e="function"==typeof t?t():t;return(0,o.A)((0,s.A)(n.prototype),"extend",this).call(this,e)}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n("function"==typeof t?t():t)}}]),n}(Bn),Hn=Wn.create({name:"clipboardTextSerializer",addOptions:function(){return{blockSeparator:void 0}},addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var e=t.editor,n=e.state,r=e.schema,o=n.doc,i=n.selection,a=pe(r),s=t.options.blockSeparator,u=E(E({},void 0!==s?{blockSeparator:s}:{}),{},{textSerializers:a});return(0,c.A)(i.ranges).sort((function(t,e){return t.$from.pos-e.$from.pos})).map((function(t){var e=t.$from,n=t.$to;return de(o,{from:e.pos,to:n.pos},u)})).join(null!=s?s:"\n\n")}}})]}}),qn=Wn.create({name:"commands",addCommands:function(){return E({},j)}}),Jn=Wn.create({name:"delete",onUpdate:function(t){var e,n,r,o=this,i=t.transaction,a=t.appendedTransactions,s=function(){var t,e,n,r;if(!(null!=(r=null==(n=null==(e=null==(t=o.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:e.filterTransaction)?void 0:n.call(e,i))?r:i.getMeta("y-sync$"))){var s=Wt(i.before,[i].concat((0,c.A)(a)));me(s).forEach((function(t){s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(function(e,n){var r=n+e.nodeSize-2,a=t.oldRange.from<=n&&r<=t.oldRange.to;o.editor.emit("delete",{type:"node",node:e,from:n,to:r,newFrom:s.mapping.map(n),newTo:s.mapping.map(r),deletedRange:t.oldRange,newRange:t.newRange,partial:!a,editor:o.editor,transaction:i,combinedTransform:s})}))}));var u=s.mapping;s.steps.forEach((function(t,e){var n,r;if(t instanceof h.Ys){var a=u.slice(e).map(t.from,-1),c=u.slice(e).map(t.to),l=u.invert().map(a,-1),d=u.invert().map(c),f=a>0&&(null==(n=s.doc.nodeAt(a-1))?void 0:n.marks.some((function(e){return e.eq(t.mark)}))),p=null==(r=s.doc.nodeAt(c))?void 0:r.marks.some((function(e){return e.eq(t.mark)}));o.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:l,to:d},newRange:{from:a,to:c},partial:Boolean(p||f),editor:o.editor,transaction:i,combinedTransform:s})}}))}};null==(r=null==(n=null==(e=this.editor.options.coreExtensionOptions)?void 0:e.delete)?void 0:n.async)||r?setTimeout(s,0):s()}}),Qn=Wn.create({name:"drop",addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.hs("tiptapDrop"),props:{handleDrop:function(e,n,r,o){t.editor.emit("drop",{editor:t.editor,event:n,slice:r,moved:o})}}})]}}),Yn=Wn.create({name:"editable",addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.hs("editable"),props:{editable:function(){return t.editor.options.editable}}})]}}),Zn=new m.hs("focusEvents"),Gn=Wn.create({name:"focusEvents",addProseMirrorPlugins:function(){var t=this.editor;
1return[new m.k_({key:Zn,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}}}})]}}),Xn=Wn.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,i=r.empty,a=r.$anchor,s=a.pos,u=a.parent,c=a.parent.isTextblock&&s>0?n.doc.resolve(s-1):a,l=c.parent.type.spec.isolating,d=a.pos-a.parentOffset,f=l&&1===c.parent.childCount?d===a.pos:m.LN.atStart(o).from===s;return!(!i||!u.type.isTextblock||u.textContent.length||!f||f&&"paragraph"===a.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=E({},r),i=E(E({},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 ot()||St()?i:o},addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.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),i=e.some((function(t){return t.getMeta("preventClearDocument")}));if(o&&!i){var a=n.selection,s=a.empty,u=a.from,c=a.to,l=m.LN.atStart(n.doc).from,d=m.LN.atEnd(n.doc).to;if(!s&&(u===l&&c===d))if(Oe(r.doc)){var f=r.tr,p=T({state:r,transaction:f});if(new P({editor:t.editor,state:p}).commands.clearNodes(),f.steps.length)return f}}}}})]}}),tr=Wn.create({name:"paste",addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.hs("tiptapPaste"),props:{handlePaste:function(e,n,r){t.editor.emit("paste",{editor:t.editor,event:n,slice:r})}}})]}}),er=Wn.create({name:"tabindex",addOptions:function(){return{value:void 0}},addProseMirrorPlugins:function(){var t=this;return[new m.k_({key:new m.hs("tabindex"),props:{attributes:function(){var e;return t.editor.isEditable||void 0!==t.options.value?{tabindex:null!=(e=t.options.value)?e:"0"}:{}}}})]}}),nr=Wn.create({name:"textDirection",addOptions:function(){return{direction:void 0}},addGlobalAttributes:function(){var t=this;return this.options.direction?[{types:Xt(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 m.k_({key:new m.hs("textDirection"),props:{attributes:function(){var e=t.options.direction;return e?{dir:e}:{}}}})]}}),rr=!1;var or=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;(0,d.A)(this,t),this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}return(0,f.A)(t,[{key:"name",get:function(){return this.node.type.n
1ame}},{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;return 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=r.isInline,u=e.pos+o+(a?0:1);if(!(u<0||u>e.resolvedPos.doc.nodeSize-2)){var c=e.resolvedPos.doc.resolve(u);if(i||s||!(c.depth<=e.depth)){var l=new t(c,e.editor,i,i||s?r:null);i&&(l.actualDepth=e.depth+1),n.push(l)}}})),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)o.every((function(t){return e[t]===i.node.attrs[t]}))&&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,E(E({},this.node.attrs),t)),this.editor.view.dispatch(e)}}]),t}(),ir=function(t){(0,i.A)(n,t);var e=w(n);function n(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,d.A)(this,n),(t=e.call(this)).css=null,t.className="tiptap",t.editorView=null,t.isFocused=!1,t.destroyed=!1,t.isInitialized=!1,t.extensionStorage={},t.instanceId=Math.random().toString(36).slice(2,9),t.hasWarnedStaleDecorationRead=!1,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},enableExtensionDispatchTransaction:!0},t.isCapturingTransaction=!1,t.capturedTransaction=null,t.utils={getUpdatedPosition:Pe,createMappablePosition:je},t.setOptions(o),t.createExtensionManager(),t.createCommandManager(),t.createSchema(),t.on("beforeCreate",t.options.onBeforeCreate),t.emit("beforeCreate",{editor:(0,r.A)(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 i=t.createDoc();if(!t.editorState){var a=nt(i,t.options.autofocus);t.editorState=m.$t.create({doc:i,schema:t.schema,selection:a||void 0})}return function(t){if(!rr){var e;rr=!0;try{e=h.Ln.fromJSON(t,{from:0,to:0}).slice.content}catch(n){return}e instanceof g.FK||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}}(t.schema),t.options.element&&t.mount(t.options.element),t}return(0,f.A)(n,[{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.");
1this.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){this.editorState=this.editorView.state;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(e){console.warn("Failed to remove CSS element:",e)}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?this.commandManager.chain():P.createFakeChain()}},{key:"can",value:function(){return this.commandManager?this.commandManager.can():P.createFallbackCan()}},{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}
1\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=E(E({},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(){var t;return un&&!this.hasWarnedStaleDecorationRead&&(t=this,an.has(t))&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}},{key:"registerPlugin",value:function(t,e){var n=Zt(e)?e(t,(0,c.A)(this.state.plugins)):[].concat((0,c.A)(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,r,o=this,i=this.options.enableCoreExtensions?[Yn,Hn.configure({blockSeparator:null==(e=null==(t=this.options.coreExtensionOptions)?void 0:t.clipboardTextSerializer)?void 0:e.blockSeparator}),qn,Gn,Xn,er.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Qn,tr,Jn,nr.configure({direction:this.options.textDirection})].filter((function(t){return"object"!=typeof o.options.enableCoreExtensions||!1!==o.options.enableCoreExtensions[t.name]})):[],a=[].concat((0,c.A)(i),(0,c.A)(this.options.extensions)).filter((function(t){return["extension","node","mark"].includes(null==t?void 0:t.type)}));this.extensionManager=new Un(a,this)}},{key:"createCommandManager",value:function(){this.commandManager=new P({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createDoc",value:function(){var t,e=this;try{t=Vt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(r){if(!(r instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(r.message)))throw r;var n=Vt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=m.$t.create({doc:n,schema:this.schema,selection:nt(n,this.options.autofocus)||void 0}
1),this.emit("contentError",{editor:this,error:r,disableCollaboration:function(){"collaboration"in e.storage&&"object"==typeof 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()}}),this.editorState.doc}return t}},{key:"createView",value:function(t){var e=this.options,n=e.editorProps,r=e.enableExtensionDispatchTransaction,o=n.dispatchTransaction||this.dispatchTransaction.bind(this),i=r?this.extensionManager.dispatchTransaction(o):o,a=n.transformPastedHTML,s=this.extensionManager.transformPastedHTML(a);this.editorView=new k.Lz(t,E(E({},n),{},{attributes:E({role:"textbox"},null==n?void 0:n.attributes),dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews}));var u=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(u),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;if(!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 Ot(t,null,n)||xe(t,null,n);var r=Rt(e,t.schema);return"node"===r?Ot(t,e,n):"mark"===r&&xe(t,e,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Yt(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 fe(this.state.doc,{blockSeparator:r,textSerializers:E(E({},pe(this.schema)),i)})}},{key:"isEmpty",get:function(){return Oe(this.state.doc)}},{key:"destroy",value:function(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}},{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),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new or(e,this,!1,n)}},{key:"$doc",get:function(){return this.$pos(0)}}]),n}(sn);function ar(t){return new $n({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=Gt(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),d=l+s.length;if(ge(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;
1d<r.to&&a.delete(d,r.to),l>r.from&&a.delete(r.from+c,l);var f=r.from+c+s.length;a.addMark(r.from+c,f,t.type.create(i||{})),a.removeStoredMark(t.type)}},undoable:t.undoable})}function sr(t){return new $n({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=Gt(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 d=o[0][o[0].length-1];a.insertText(d,s+o[0].length-1),a.replaceWith(l,u,c)}else if(o[0]){var f=t.type.isInline?s:s-1;a.insert(f,t.type.create(i)).delete(a.mapping.map(s),a.mapping.map(u))}a.scrollIntoView()},undoable:t.undoable})}function ur(t){return new $n({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=n.doc.resolve(r.from),a=Gt(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 cr(t){return new $n({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=e.chain,a=Gt(t.getAttributes,void 0,o)||{},s=n.tr.delete(r.from,r.to),u=s.doc.resolve(r.from).blockRange(),c=u&&(0,h.oM)(u,t.type,a);if(!c)return null;if(s.wrap(u,c),t.keepMarks&&t.editor){var l=n.selection,d=n.storedMarks,f=t.editor.extensionManager.splittableMarks,p=d||l.$to.parentOffset&&l.$from.marks();if(p){var v=p.filter((function(t){return f.includes(t.type.name)}));s.ensureMarks(v)}}if(t.keepAttributes){var m="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";i().updateAttributes(m,a).run()}var g=s.doc.resolve(r.from-1).nodeBefore;g&&g.type===t.type&&(0,h.n9)(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(o,g))&&s.join(r.from-1)},undoable:t.undoable})}var lr=function(t){(0,i.A)(n,t);var e=w(n);function n(){var t;return(0,d.A)(this,n),(t=e.apply(this,arguments)).type="node",t}return(0,f.A)(n,[{key:"configure",value:function(t){return(0,o.A)((0,s.A)(n.prototype),"configure",this).call(this,t)}},{key:"extend",value:function(t){var e="function"==typeof t?t():t;return(0,o.A)((0,s.A)(n.prototype),"extend",this).call(this,e)}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new n("function"==typeof t?t():t)}}]),n}(Bn);function dr(t){return new _n({find:t.find,handler:function(e){var n=e.state,r=e.range,o=e.match,i=e.pasteEvent,a=Gt(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 d=c.search(/\S/),f=r.from+c.indexOf(u),p=f+u.length;if(ge(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>f})).length)return null;p<r.to&&s.delete(p,r.to),f>r.from&&s.delete(r.from+d,f),l=r.from+d+u.length,s.addMark(r.from+d,l,t.type.create(a||{})),void 0!==o.index&&void 0!==o.input&&o.index+o[0].length>=o.input.length||s.removeStoredMark(t.type)}}})}}}]);
2//# sourceMappingURL=520c8229-27849155095a45a378e6.js.map

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.