PageSourceSearch

https://ds.zopi.io/assets/js/module-B0vxmspb.js

js zopi.io collected 2026-09-24 09:52:29 UTC 100,846 bytes, 100 lines download raw bytes

vendor: 6,830 bytes, line 1
1import{a as O,r as R}from"./module-g4nfU4qS.js";import{a as le}from"./module-CLuAD4R5.js";import{r as Pt,t as ue,f as Ut,a as de}from"./module-YKhy6aow.js";import{N as nt,E as pe,P as I,a as N,S as V,T as L,A as fe}from"./module-duNjR6wQ.js";import{d as he}from"./module-BZ17SRdx.js";import{g as me}from"./module-BEIsiqOv.js";import{h as ge,r as ye,u as be}from"./module-DKECUIcb.js";import{E as ve,D as ke,a as Me}from"./module-CPh8vZck.js";import{k as Se}from"./module-fFtbNF-F.js";import{D as we,S as qt,F as H,N as Ee,a as ut,b as xe}from"./module-tV3IJ5Y1.js";import{T as Ae,f as Te,c as Mt,a as X,j as Kt,l as Ce,R as Oe,b as Pe}from"./module-CZPcUW2s.js";import{w as Le,s as Lt,a as Ie,b as $e,c as Re,d as Be,e as Ne,n as He,l as _e,f as De,j as je,g as Fe,h as ze,i as Ve,k as We,m as Ue,o as qe,p as Ke,q as Ge}from"./module-BINVifEP.js";import{w as Je,s as Ye,l as Qe}from"./module-B1TVd3K4.js";function rt(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,o=n.storedMarks,n}}}class st{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:s}=n,{tr:o}=r,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([c,a])=>[c,(...d)=>{const u=a(...d)(i);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(o),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,c=[],a=!!t,l=t||o.tr,d=()=>(!a&&n&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),c.every(p=>p===!0)),u={...Object.fromEntries(Object.entries(r).map(([p,f])=>[p,(...m)=>{const y=this.buildProps(l,n),g=f(...m)(y);return c.push(g),u}])),run:d};return u}createCan(t){const{rawCommands:n,state:r}=this,s=!1,o=t||r.tr,i=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...d)=>l(...d)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}buildProps(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,c={tr:t,editor:s,view:i,state:rt({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([a,l])=>[a,(...d)=>l(...d)(c)]))}};return c}}class Xe{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(s=>s.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(s=>s!==n):delete this.callbacks[t]),this}once(t,n){const r=(...s)=>{this.off(t,r),n.apply(this,s)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}}function b(e,t,n){return e.config[t]===void 0&&e.parent?b(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?b(e.parent,t,n):null}):e.config[t]}function ot(e){const t=e.filter(s=>s.type==="extension"),n=e.filter(s=>s.type==="node"),r=e.filter(s=>s.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function Gt(e){const t=[],{nodeExtensions:n,markExtensions:r}=ot(e),s=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(i=>{const c={name:i.name,options:i.options,storage:i.storage,extensions:s},a=b(i,"addGlobalAttributes",c);if(!a)return;a().forEach(d=>{d.types.forEach(u=>{Object.entries(d.attributes).forEach(([p,f])=>{t.push({type:u,name:p,attribute:{...o,...f}})})})})}),s.forEach(i=>{const c={name:i.name,options:i.options,storage:i.storage},a=b(i,"addAttributes",c);if(!a)return;const l=a();Object.entries(l).forEach(([d,u])=>{const p={...o,...u};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,t.push({type:i.name,name:d,attribute:p})})}),t}function A(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function x(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([s,o])=>{if(!r[s]){r[s]=o;return}if(s==="class"){const c=o?String(o).split(" "):[],a=r[s]?r[s].split(" "):[],l=c.filter(d=>!a.includes(d));r[s]=[...a,...l].join(" ")}else if(s==="style"){const c=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],a=r[s]?r[s].split(";").map(d=>d.trim()).filter(Boolean):[],l=new Map;a.forEach(d=>{const[u,p]=d.split(":").map(f=>f.trim());l.set(u,p)}),c.forEach(d=>{const[u,p]=d.split(":").map(f=>f.trim());l.set(u,p)}),r[s]=Array.from(l.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else r[s]=o}),r},{})}function gt(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>x(n,r),{})}function Jt(e){return typeof e=="function"}function k(e,t=void 0,...n){return Jt(e)?t?e.bind(t)(...n):e(...n):e}function Ze(e={}){return Object.keys(e).length===0&&e.constructor===Object}function tn(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function It(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const s=t.reduce((o,i)=>{const c=i.attribute.parseHTML?i.attribute.parseHTML(n):tn(n.getAttribute(i.name));return c==null?o:{...o,[i.name]:c}},{});return{...r,...s}}}}function $t(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Ze(n)?!1:n!=null))}function en(e,t){var n;const r=Gt(e),{nodeExtensions:s,markExtensions:o}=ot(e),i=(n=s.find(l=>b(l,"topNode")))===null||n===void 0?void 0:n.name,c=Object.fromEntries(s.map(l=>{const d=r.filter(g=>g.type===l.name),u={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((g,v)=>{const M=b(v,"extendNodeSchema",u);return{...g,...M?M(l):{}}},{}),f=$t({...p,content:k(b(l,"content",u)),marks:k(b(l,"marks",u)),group:k(b(l,"group",u)),inline:k(b(l,"inline",u)),atom:k(b(l,"atom",u)),selectable:k(b(l,"selectable",u)),draggable:k(b(l,"draggable",u)),code:k(b(l,"code",u)),whitespace:k(b(l,"whitespace",u)),linebreakReplacement:k(b(l,"linebreakReplacement",u)),defining:k(b(l,"defining",u)),isolating:k(b(l,"isolating",u)),attrs:Object.fromEntries(d.map(g=>{var v;
1return[g.name,{default:(v=g?.attribute)===null||v===void 0?void 0:v.default}]}))}),h=k(b(l,"parseHTML",u));h&&(f.parseDOM=h.map(g=>It(g,d)));const m=b(l,"renderHTML",u);m&&(f.toDOM=g=>m({node:g,HTMLAttributes:gt(g,d)}));const y=b(l,"renderText",u);return y&&(f.toText=y),[l.name,f]})),a=Object.fromEntries(o.map(l=>{const d=r.filter(y=>y.type===l.name),u={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((y,g)=>{const v=b(g,"extendMarkSchema",u);return{...y,...v?v(l):{}}},{}),f=$t({...p,inclusive:k(b(l,"inclusive",u)),excludes:k(b(l,"excludes",u)),group:k(b(l,"group",u)),spanning:k(b(l,"spanning",u)),code:k(b(l,"code",u)),attrs:Object.fromEntries(d.map(y=>{var g;return[y.name,{default:(g=y?.attribute)===null||g===void 0?void 0:g.default}]}))}),h=k(b(l,"parseHTML",u));h&&(f.parseDOM=h.map(y=>It(y,d)));const m=b(l,"renderHTML",u);return m&&(f.toDOM=y=>m({mark:y,HTMLAttributes:gt(y,d)})),[l.name,f]}));return new qt({topNode:i,nodes:c,marks:a})}function dt(e,t){return t.nodes[e]||t.marks[e]||null}function Rt(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function St(e,t){const n=we.fromSchema(t).serializeFragment(e),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}const nn=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(s,o,i,c)=>{var a,l;const d=((l=(a=s.type.spec).toText)===null||l===void 0?void 0:l.call(a,{node:s,pos:o,parent:i,index:c}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,r-o))}),n};function wt(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class it{constructor(t){this.find=t.find,this.handler=t.handler}}const rn=(e,t)=>{if(wt(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,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};function G(e){var t;const{editor:n,from:r,to:s,text:o,rules:i,plugin:c}=e,{view:a}=n;if(a.composing)return!1;const l=a.state.doc.resolve(r);if(l.parent.type.spec.code||!((t=l.nodeBefore||l.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let d=!1;const u=nn(l)+o;return i.forEach(p=>{if(d)return;const f=rn(u,p.find);if(!f)return;const h=a.state.tr,m=rt({state:a.state,transaction:h}),y={from:r-(f[0].length-o.length),to:s},{commands:g,chain:v,can:M}=new st({editor:n,state:m});p.handler({state:m,range:y,match:f,commands:g,chain:v,can:M})===null||!h.steps.length||(h.setMeta(c,{transform:h,from:r,to:s,text:o}),a.dispatch(h),d=!0)}),d}function sn(e){const{editor:t,rules:n}=e,r=new I({state:{init(){return null},apply(s,o,i){const c=s.getMeta(r);if(c)return c;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:d}=a;typeof d=="string"?d=d:d=St(H.from(d),i.schema);const{from:u}=a,p=u+d.length;G({editor:t,from:u,to:p,text:d,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,i,c){return G({editor:t,from:o,to:i,text:c,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&G({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:i}=s.state.selection;return i?G({editor:t,from:i.pos,to:i.pos,text:`
2`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function on(e){return Object.prototype.toString.call(e).slice(8,-1)}function J(e){return on(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function at(e,t){const n={...e};return J(e)&&J(t)&&Object.keys(t).forEach(r=>{J(t[r])&&J(e[r])?n[r]=at(e[r],t[r]):n[r]=t[r]}),n}class B{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(b(this,"addOptions",{name:this.name}))),this.storage=k(b(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new B(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>at(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new B(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=k(b(n,"addOptions",{name:n.name})),n.storage=k(b(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!!!i.find(l=>l?.type.name===n.name))return!1;const a=i.find(l=>l?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),t.view.dispatch(r),!0}return!1}}function an(e){return typeof e=="number"}class cn{constructor(t){this.find=t.find,this.handler=t.handler}}const ln=(e,t,n)=>{if(wt(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(s=>{const o=[s.text];return o.index=s.index,o.input=e,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(s.replaceWith)),o}):[]};function un(e){const{editor:t,state:n,from:r,to:s,rule:o,pasteEvent:i,dropEvent:c}=e,{commands:a,chain:l,can:d}=new st({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,s,(f,h)=>
2{if(!f.isTextblock||f.type.spec.code)return;const m=Math.max(r,h),y=Math.min(s,h+f.content.size),g=f.textBetween(m-h,y-h,void 0,"");ln(g,o.find,i).forEach(M=>{if(M.index===void 0)return;const E=m+M.index+1,S=E+M[0].length,w={from:n.tr.mapping.map(E),to:n.tr.mapping.map(S)},C=o.handler({state:n,range:w,match:M,commands:a,chain:l,can:d,pasteEvent:i,dropEvent:c});u.push(C)})}),u.every(f=>f!==null)}let Y=null;const dn=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function pn(e){const{editor:t,rules:n}=e;let r=null,s=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const a=({state:d,from:u,to:p,rule:f,pasteEvt:h})=>{const m=d.tr,y=rt({state:d,transaction:m});if(!(!un({editor:t,state:y,from:Math.max(u-1,0),to:p.b-1,rule:f,pasteEvent:h,dropEvent:c})||!m.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new I({view(u){const p=h=>{var m;r=!((m=u.dom.parentElement)===null||m===void 0)&&m.contains(h.target)?u.dom.parentElement:null,r&&(Y=t)},f=()=>{Y&&(Y=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(u,p)=>{if(o=r===u.dom.parentElement,c=p,!o){const f=Y;f&&setTimeout(()=>{const h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(u,p)=>{var f;const h=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return i=p,s=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(u,p,f)=>{const h=u[0],m=h.getMeta("uiEvent")==="paste"&&!s,y=h.getMeta("uiEvent")==="drop"&&!o,g=h.getMeta("applyPasteRules"),v=!!g;if(!m&&!y&&!v)return;if(v){let{text:S}=g;typeof S=="string"?S=S:S=St(H.from(S),f.schema);const{from:w}=g,C=w+S.length,$=dn(S);return a({rule:d,state:f,from:w,to:{b:C},pasteEvt:$})}const M=p.doc.content.findDiffStart(f.doc.content),E=p.doc.content.findDiffEnd(f.doc.content);if(!(!an(M)||!E||M===E.b))return a({rule:d,state:f,from:M,to:E,pasteEvt:i})}}))}function fn(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class U{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=U.resolve(t),this.schema=en(this.extensions,n),this.setupExtensions()}static resolve(t){const n=U.sort(U.flatten(t)),r=fn(n.map(s=>s.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},s=b(n,"addExtensions",r);return s?[n,...this.flatten(s())]:n}).flat(10)}static sort(t){return t.sort((r,s)=>{const o=b(r,"priority")||100,i=b(s,"priority")||100;return o>i?-1:o<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:dt(n.name,this.schema)},s=b(n,"addCommands",r);return s?{...t,...s()}:t},{})}get plugins(){const{editor:t}=this,n=U.sort([...this.extensions].reverse()),r=[],s=[],o=n.map(i=>{const c={name:i.name,options:i.options,storage:i.storage,editor:t,type:dt(i.name,this.schema)},a=[],l=b(i,"addKeyboardShortcuts",c);let d={};if(i.type==="mark"&&b(i,"exitable",c)&&(d.ArrowRight=()=>B.handleExit({editor:t,mark:i})),l){const m=Object.fromEntries(Object.entries(l()).map(([y,g])=>[y,()=>g({editor:t})]));d={...d,...m}}const u=Se(d);a.push(u);const p=b(i,"addInputRules",c);Rt(i,t.options.enableInputRules)&&p&&r.push(...p());const f=b(i,"addPasteRules",c);Rt(i,t.options.enablePasteRules)&&f&&s.push(...f());const h=b(i,"addProseMirrorPlugins",c);if(h){const m=h();a.push(...m)}return a}).flat();return[sn({editor:t,rules:r}),...pn({editor:t,rules:s}),...o]}get attributes(){return Gt(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=ot(this.extensions);return Object.fromEntries(n.filter(r=>!!b(r,"addNodeView")).map(r=>{const s=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:A(r.name,this.schema)},i=b(r,"addNodeView",o);if(!i)return[];const c=(a,l,d,u,p)=>{const f=gt(a,s);return i()({node:a,view:l,getPos:d,decorations:u,innerDecorations:p,editor:t,extension:r,HTMLAttributes:f})};return[r.name,c]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:dt(t.name,this.schema)};t.type==="mark"&&(!((n=k(b(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const s=b(t,"onBeforeCreate",r),o=b(t,"onCreate",r),i=b(t,"onUpdate",r),c=b(t,"onSelectionUpdate",r),a=b(t,"onTransaction",r),l=b(t,"onFocus",r),d=b(t,"onBlur",r),u=b(t,"onDestroy",r);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),i&&this.editor.on("update",i),c&&this.editor.on("selectionUpdate",c),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}}class T{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(b(this,"addOptions",{name:this.name}))),this.storage=k(b(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new T(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>at(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new T({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=k(b(n,"addOptions",{name:n.name})),n.storage=k(b(n,"addStorage",{name:n.name,options:n.options})),n}}function Yt(e,t,n){const{from:r,to:s}=t,{blockSeparator:o=`
3
4`,textSerializers:i={}}=n||{};let c="";return e.nodesBetween(r,s,(a,l,d,u)=>{var p;a.isBlock&&l>r&&(c+=o);const f=i?.[a.type.name];if(f)return d&&(c+=f({node:a,pos:l,parent:d,index:u,range:t})),!1;a.isText&&(c+=(p=a?.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,s-l))}),c}function Qt(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const hn=T.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new I({key:new N("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:s}=t,{ranges:o}=s,i=Math.min(...o.map(d=>d.$from.pos)),c=Math.max(...o.map(d=>d.$to.pos)),a=Qt(n);return Yt(r,{from:i,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),mn=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),gn=(e=!1)=>({commands:t})=>t.setContent("",e),yn=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:s}=r;return n&&s.forEach(({$from:o,$to:i})=>{e.doc.nodesBetween(o.pos,i.pos,(c,a)=>{if(c.type.isText)return;const{doc:l,mapping:d}=t,u=l.resolve(d.map(a)),p=l.resolve(d.map(a+c.nodeSize)),f=u.blockRange(p);if(!f)return;const h=Ce(f);if(c.type.isTextblock){const{defaultType:m}=u.parent.contentMatchAt(u.index());t.setNodeMarkup(f.start,m)}(h||h===0)&&t.lift(f,h)})}),!0},bn=e=>t=>e(t),vn=()=>({state:e,dispatch:t})=>Ge(e,t),kn=(e,t)=>({editor:n,tr:r})=>{const{state:s}=n,o=s.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const i=r.mapping.map(t);return r.insert(i,o.content),r.setSelection(new L(r.doc.resolve(i-1))),!0},Mn=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===r.type){if(t){const c=s.before(o),a=s.after(o);e.delete(c,a).scrollIntoView()}return!0}return!1},Sn=e=>({tr:t,state:n,dispatch:r})=>{const s=A(e,n.schema),o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===s){if(r){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},wn=e=>({tr:t,dispatch:n})=>{const{from:r,to:s}=e;return n&&t.delete(r,s),!0},En=()=>({state:e,dispatch:t})=>Ke(e,t),xn=()=>({commands:e})=>e.keyboardShortcut("Enter"),An=()=>({state:e,dispatch:t})=>qe(e,t);function tt(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(s=>n.strict?t[s]===e[s]:wt(t[s])?t[s].test(e[s]):t[s]===e[s]):!0}function Xt(e,t,n={}){return e.find(r=>r.type===t&&tt(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Bt(e,t,n={}){return!!Xt(e,t,n)}function Et(e,t,n){var r;if(!e||!t)return;let s=e.parent.childAfter(e.parentOffset);if((!s.node||!s.node.marks.some(d=>d.type===t))&&(s=e.parent.childBefore(e.parentOffset)),!s.node||!s.node.marks.some(d=>d.type===t)||(n=n||((r=s.node.marks[0])===null||r===void 0?void 0:r.attrs),!Xt([...s.node.marks],t,n)))return;let i=s.index,c=e.start()+s.offset,a=i+1,l=c+s.node.nodeSize;for(;i>0&&Bt([...e.parent.child(i-1).marks],t,n);)i-=1,c-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&Bt([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:c,to:l}}function D(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const Tn=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const o=D(e,r.schema),{doc:i,selection:c}=n,{$from:a,from:l,to:d}=c;if(s){const u=Et(a,o,t);if(u&&u.from<=l&&u.to>=d){const p=L.create(i,u.from,u.to);n.setSelection(p)}}return!0},Cn=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Zt(e){return e instanceof L}function z(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function te(e,t=null){if(!t)return null;const n=V.atStart(e),r=V.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const s=n.from,o=r.to;return t==="all"?L.create(e,z(0,s,o),z(e.content.size,s,o)):L.create(e,z(t,s,o),z(t,s,o))}function On(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}
vendor: 27,301 bytes, lines 4-44
4function xt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Pn=(e=null,t={})=>({editor:n,view:r,tr:s,dispatch:o})=>{t={scrollIntoView:!0,...t};const i=()=>{(xt()||On())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!Zt(n.state.selection))return i(),!0;const c=te(s.doc,e)||n.state.selection,a=n.state.selection.eq(c);return o&&(a||s.setSelection(c),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),i()),!0},Ln=(e,t)=>n=>e.every((r,s)=>t(r,{...n,index:s})),In=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ee=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&ee(r)}return e};function Q(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return ee(n)}function et(e,t,n){if(e instanceof Ee||e instanceof H)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,s=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return H.fromArray(e.map(c=>t.nodeFromJSON(c)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),et("",t,n)}if(s){if(n.errorOnInvalidContent){let i=!1,c="";const a=new qt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:l=>(i=!0,c=typeof l=="string"?l:l.outerHTML,null)}]}})});if(n.slice?ut.fromSchema(a).parseSlice(Q(e),n.parseOptions):ut.fromSchema(a).parse(Q(e),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const o=ut.fromSchema(t);return n.slice?o.parseSlice(Q(e),n.parseOptions).content:o.parse(Q(e),n.parseOptions)}return et("",t,n)}function $n(e,t,n){const r=e.steps.length-1;if(r<t)return;const s=e.steps[r];if(!(s instanceof Oe||s instanceof Pe))return;const o=e.mapping.maps[r];let i=0;o.forEach((c,a,l,d)=>{i===0&&(i=d)}),e.setSelection(V.near(e.doc.resolve(i),n))}const Rn=e=>!("type"in e),Bn=(e,t,n)=>({tr:r,dispatch:s,editor:o})=>{var i;if(s){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c;try{c=et(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(i=n.errorOnInvalidContent)!==null&&i!==void 0?i:o.options.enableContentCheck})}catch(h){return o.emit("contentError",{editor:o,error:h,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:a,to:l}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},d=!0,u=!0;if((Rn(c)?c:[c]).forEach(h=>{h.check(),d=d?h.isText&&h.marks.length===0:!1,u=u?h.isBlock:!1}),a===l&&u){const{parent:h}=r.doc.resolve(a);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(a-=1,l+=1)}let f;if(d){if(Array.isArray(t))f=t.map(h=>h.text||"").join("");else if(t instanceof H){let h="";t.forEach(m=>{m.text&&(h+=m.text)}),f=h}else typeof t=="object"&&t&&t.text?f=t.text:f=t;r.insertText(f,a,l)}else f=c,r.replaceWith(a,l,f);n.updateSelection&&$n(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:f})}return!0},Nn=()=>({state:e,dispatch:t})=>je(e,t),Hn=()=>({state:e,dispatch:t})=>We(e,t),_n=()=>({state:e,dispatch:t})=>Ue(e,t),Dn=()=>({state:e,dispatch:t})=>Ve(e,t),jn=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Kt(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Fn=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Kt(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},zn=()=>({state:e,dispatch:t})=>ze(e,t),Vn=()=>({state:e,dispatch:t})=>Fe(e,t);function ne(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Wn(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,s,o,i;for(let c=0;c<t.length-1;c+=1){const a=t[c];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))o=!0;else if(/^mod$/i.test(a))xt()||ne()?i=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const Un=e=>({editor:t,view:n,tr:r,dispatch:s})=>{const o=Wn(e).split(/-(?!$)/),i=o.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),c=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",l=>l(n,c))});return a?.steps.forEach(l=>{const d=l.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function q(e,t,n={}){const{from:r,to:s,empty:o}=e.selection,i=t?A(t,e.schema):null,c=[];e.doc.nodesBetween(r,s,(u,p)=>{if(u.isText)return;const f=Math.max(r,p),h=Math.min(s,p+u.nodeSize);c.push({node:u,from:f,to:h})});const a=s-r,l=c.filter(u=>i?i.name===u.node.type.name:!0).filter(u=>tt(u.node.attrs,n,{strict:!1}));return o?!!l.length:l.reduce((u,p)=>u+p.to-p.from,0)>=a}const qn=(e,t={})=>({state:n,dispatch:r})=>{const s=A(e,n.schema);return q(n,s,t)?De(n,r):!1},Kn=()=>({state:e,dispatch:t})=>_e(e,t),Gn=e=>({state:t,dispatch:n})=>{const r=A(e,t.schema);return Qe(r)(t,n)},Jn=()=>({state:e,dispatch:t})=>He(e,t);function ct(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Nt(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,s)=>(n.includes(s)||(r[s]=e[s]),r),{})}const Yn=(e,t)=>({tr:n,state:r,dispatch:s})=>{let o=null,i=null;const c=ct(typeof e=="string"?e:e.name,r.schema);return c?(c==="node"&&(o=A(e,r.schema)),c==="mark"&&(i=D(e,r.schema)),s&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(l,d)=>{o&&o===l.type&&n.setNodeMarkup(d,void 0,Nt(l.attrs,t)),i&&l.marks.length&&l.marks.forEach(u=>{i===u.type&&n.addMark(d,d+l.nodeSize,i.create(Nt(u.attrs,t)))})})}),!0):!1},Qn=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Xn=()=>({tr:e,dispatch:t})=>{if(t){const n=new fe(e.doc);e.setSelection(n)}return!0},Zn=()=>({state:e,dispatch:t})=>Ne(e,t),tr=()=>({state:e,dispatch:t})=>Be(e,t),er=()=>({state:e,dispatch:t})=>Re(e,t),nr=()=>({state:e,dispatch:t})=>$e(e,t),rr=()=>({state:e,dispatch:t})=>Ie(e,t);function yt(e,t,n={},r={}){return et(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const sr=(e,t=!1,n={},r={})=>({editor:s,tr:o,dispatch:i,commands:c})=>{var a,l;const{doc:d}=o;if(n.preserveWhitespace!=="full"){const u=yt(e,s.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck});return i&&o.replaceWith(0,d.content.size,u).setMeta("preventUpdate",!t),!0}return i&&o.setMeta("preventUpdate",!t),c.insertContentAt({from:0,to:d.content.size},e,{parseOptions:n,errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:s.options.enableContentCheck})};function re(e,t){const n=D(t,e.schema),{from:r,to:s,empty:o}=e.selection,i=[];o?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,s,a=>{i.push(...a.marks)});const c=i.find(a=>a.type.name===n.name);return c?{...c.attrs}:{}}function or(e,t){const n=new Ae(e);return t.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function ir(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ar(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(s,o)=>{n(s)&&r.push({node:s,pos:o})}),r}function cr(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function At(e){return t=>cr(t.$from,e)}function lr(e,t){const n={from:0,to:e.content.size};return Yt(e,n,t)}function ur(e,t){const n=A(t,e.schema),{from:r,to:s}=e.selection,o=[];e.doc.nodesBetween(r,s,c=>{o.push(c)});const i=o.reverse().find(c=>c.type.name===n.name);return i?{...i.attrs}:{}}function se(e,t){const n=ct(typeof t=="string"?t:t.name,e.schema);return n==="node"?ur(e,t):n==="mark"?re(e,t):{}}function dr(e,t=JSON.stringify){const n={};return e.filter(r=>{const s=t(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function pr(e){const t=dr(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function fr(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((s,o)=>{const i=[];if(s.ranges.length)s.forEach((c,a)=>{i.push({from:c,to:a})});else{const{from:c,to:a}=n[o];if(c===void 0||a===void 0)return;i.push({from:c,to:a})}i.forEach(({from:c,to:a})=>{const l=t.slice(o).map(c,-1),d=t.slice(o).map(a),u=t.invert().map(l,-1),p=t.invert().map(d);r.push({oldRange:{from:u,to:p},newRange:{from:l,to:d}})})}),pr(r)}function Tt(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(s=>{const o=n.resolve(e),i=Et(o,s.type);i&&r.push({mark:s,...i})}):n.nodesBetween(e,t,(s,o)=>{!s||s?.nodeSize===void 0||r.push(...s.marks.map(i=>({from:o,to:o+s.nodeSize,mark:i})))}),r}function Z(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=e.find(o=>o.type===t&&o.name===r);return s?s.attribute.keepOnSplit:!1}))}function bt(e,t,n={}){const{empty:r,ranges:s}=e.selection,o=t?D(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(u=>o?o.name===u.type.name:!0).find(u=>tt(u.attrs,n,{strict:!1}));let i=0;const c=[];if(s.forEach(({$from:u,$to:p})=>{const f=u.pos,h=p.pos;e.doc.nodesBetween(f,h,(m,y)=>{if(!m.isText&&!m.marks.length)return;const g=Math.max(f,y),v=Math.min(h,y+m.nodeSize),M=v-g;i+=M,c.push(...m.marks.map(E=>({mark:E,from:g,to:v})))})}),i===0)return!1;const a=c.filter(u=>o?o.name===u.mark.type.name:!0).filter(u=>tt(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),l=c.filter(u=>o?u.mark.type!==o&&u.mark.type.excludes(o):!0).reduce((u,p)=>u+p.to-p.from,0);return(a>0?a+l:a)>=i}function hr(e,t,n={}){if(!t)return q(e,null,n)||bt(e,null,n);const r=ct(t,e.schema);return r==="node"?q(e,t,n):r==="mark"?bt(e,t,n):!1}function Ht(e,t){const{nodeExtensions:n}=ot(t),r=n.find(i=>i.name===e);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},o=k(b(r,"group",s));return typeof o!="string"?!1:o.split(" ").includes("list")}function lt(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let s=!0;return e.content.forEach(o=>{s!==!1&&(lt(o,{ignoreWhitespace:n,checkChildren:t})||(s=!1))}),s}return!1}function mr(e){return e instanceof nt}function gr(e,t,n){var r;const{selection:s}=t;let o=null;if(Zt(s)&&(o=s.$cursor),o){const c=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(c)||!c.some(a=>a.type.excludes(n))}const{ranges:i}=s;return i.some(({$from:c,$to:a})=>{let l=c.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(c.pos,a.pos,(d,u,p)=>{if(l)return!1;if(d.isInline){const f=!p||p.type.allowsMarkType(n),h=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));l=f&&h}return!l}),l})}const yr=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{selection:o}=n,{empty:i,ranges:c}=o,a=D(e,r.schema);if(s)if(i){const l=re(r,a);n.addStoredMark(a.create({...l,...t}))}else c.forEach(l=>{const d=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(d,u,(p,f)=>{const h=Math.max(f,d),m=Math.min(f+p.nodeSize,u);p.marks.find(g=>g.type===a)?p.marks.forEach(g=>{a===g.type&&n.addMark(h,m,a.create({...g.attrs,...t}))}):n.addMark(h,m,a.create(t))})});return gr(r,n,a)},br=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),vr=(e,t={})=>({state:n,dispatch:r,chain:s})=>{const o=A(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:c})=>Lt(o,{...i,...t})(n)?!0:c.clearNodes()).command(({state:c})=>Lt(o,{...i,...t})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},kr=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,s=z(e,0,r.content.size),o=nt.create(r,s);t.setSelection(o)}return!0},Mr=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:s,to:o}=typeof e=="number"?{from:e,to:e}:e,i=L.atStart(r).from,c=L.atEnd(r).to,a=z(s,i,c),l=z(o,i,c),d=L.create(r,a,l);t.setSelection(d)}return!0},Sr=e=>({state:t,dispatch:n})=>{const r=A(e,t.schema);return Ye(r)(t,n)};function _t(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(s=>t?.includes(s.type.name));e.tr.ensureMarks(r)}}const wr=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:s})=>{const{selection:o,doc:i}=t,{$from:c,$to:a}=o,l=s.extensionManager.attributes,d=Z(l,c.node().type.name,c.node().attrs);if(o instanceof nt&&o.node.isBlock)return!c.parentOffset||!X(i,c.pos)?!1:(r&&(e&&_t(n,s.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const u=a.parentOffset===a.parent.content.size,p=c.depth===0?void 0:ir(c.node(-1).contentMatchAt(c.indexAfter(-1)));let f=u&&p?[{type:p,attrs:d}]:void 0,h=X(t.doc,t.mapping.map(c.pos),1,f);if(!f&&!h&&X(t.doc,t.mapping.map(c.pos),1,p?[{type:p}]:void 0)&&(h=!0,f=p?[{type:p,attrs:d}]:void 0),r){if(h&&(o instanceof L&&t.deleteSelection(),t.split(t.mapping.map(c.pos),1,f),p&&!u&&!c.parentOffset&&c.parent.type!==p)){const m=t.mapping.map(c.before()),y=t.doc.resolve(m);c.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(c.before()),p)}e&&_t(n,s.extensionManager.splittableMarks),t.scrollIntoView()}return h},Er=(e,t={})=>({tr:n,state:r,dispatch:s,editor:o})=>{var i;const c=A(e,r.schema),{$from:a,$to:l}=r.selection,d=r.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==c)return!1;const p=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==c||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let g=H.empty;const v=a.index(-1)?1:a.index(-2)?2:3;for(let $=a.depth-v;$>=a.depth-3;$-=1)g=H.from(a.node($).copy(g));const M=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,E={...Z(p,a.node().type.name,a.node().attrs),...t},S=((i=c.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(E))||void 0;g=g.append(H.from(c.createAndFill(null,S)||void 0));const w=a.before(a.depth-(v-1));n.replace(w,a.after(-M),new xe(g,4-v,0));let C=-1;n.doc.nodesBetween(w,n.doc.content.size,($,ce)=>{if(C>-1)return!1;$.isTextblock&&$.content.size===0&&(C=ce+1)}),C>-1&&n.setSelection(L.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h={...Z(p,u.type.name,u.attrs),...t},m={...Z(p,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,l.pos);const y=f?[{type:c,attrs:h},{type:f,attrs:m}]:[{type:c,attrs:h}];if(!X(n.doc,a.pos,2))return!1;if(s){const{selection:g,storedMarks:v}=r,{splittableMarks:M}=o.extensionManager,E=v||g.$to.parentOffset&&g.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!E||!s)return!0;const S=E.filter(w=>M.includes(w.type.name));n.ensureMarks(S)}return!0},pt=(e,t)=>{const n=At(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return n.node.type===s?.type&&Mt(e.doc,n.pos)&&e.join(n.pos),!0},ft=(e,t)=>{const n=At(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return n.node.type===s?.type&&Mt(e.doc,r)&&e.join(r),!0},xr=(e,t,n,r={})=>({editor:s,tr:o,state:i,dispatch:c,chain:a,commands:l,can:d})=>{const{extensions:u,splittableMarks:p}=s.extensionManager,f=A(e,i.schema),h=A(t,i.schema),{selection:m,storedMarks:y}=i,{$from:g,$to:v}=m,M=g.blockRange(v),E=y||m.$to.parentOffset&&m.$from.marks();if(!M)return!1;const S=At(w=>Ht(w.type.name,u))(m);if(M.depth>=1&&S&&M.depth-S.depth<=1){if(S.node.type===f)return l.liftListItem(h);if(Ht(S.node.type.name,u)&&f.validContent(S.node.content)&&c)return a().command(()=>(o.setNodeMarkup(S.pos,f),!0)).command(()=>pt(o,f)).command(()=>ft(o,f)).run()}return!n||!E||!c?a().command(()=>d().wrapInList(f,r)?!0:l.clearNodes()).wrapInList(f,r).command(()=>pt(o,f)).command(()=>ft(o,f)).run():a().command(()=>{const w=d().wrapInList(f,r),C=E.filter($=>p.includes($.type.name));return o.ensureMarks(C),w?!0:l.clearNodes()}).wrapInList(f,r).command(()=>pt(o,f)).command(()=>ft(o,f)).run()},Ar=(e,t={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:o=!1}=n,i=D(e,r.schema);return bt(r,i,t)?s.unsetMark(i,{extendEmptyMarkRange:o}):s.setMark(i,t)},Tr=(e,t,n={})=>({state:r,commands:s})=>{const o=A(e,r.schema),i=A(t,r.schema),c=q(r,o,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),c?s.setNode(i,a):s.setNode(o,{...a,...n})},Cr=(e,t={})=>({state:n,commands:r})=>{const s=A(e,n.schema);return q(n,s,t)?r.lift(s):r.wrapIn(s,t)},Or=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let o;if(s.spec.isInputRules&&(o=s.getState(e))){if(t){const i=e.tr,c=o.transform;for(let a=c.steps.length-1;a>=0;a-=1)i.step(c.steps[a].invert(c.docs[a]));if(o.text){const a=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,e.schema.text(o.text,a))}else i.delete(o.from,o.to)}return!0}}return!1},Pr=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:s}=n;return r||t&&s.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},Lr=(e,t={})=>({tr:n,state:r,dispatch:s})=>{var o;const{extendEmptyMarkRange:i=!1}=t,{selection:c}=n,a=D(e,r.schema),{$from:l,empty:d,ranges:u}=c;if(!s)return!0;if(d&&i){let{from:p,to:f}=c;const h=(o=l.marks().find(y=>y.type===a))===null||o===void 0?void 0:o.attrs,m=Et(l,a,h);m&&(p=m.from,f=m.to),n.removeMark(p,f,a)}else u.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,a)});return n.removeStoredMark(a),!0},Ir=(e,t={})=>({tr:n,state:r,dispatch:s})=>{let o=null,i=null;const c=ct(typeof e=="string"?e:e.name,r.schema);return c?(c==="node"&&(o=A(e,r.schema)),c==="mark"&&(i=D(e,r.schema)),s&&n.selection.ranges.forEach(a=>{const l=a.$from.pos,d=a.$to.pos;let u,p,f,h;n.selection.empty?r.doc.nodesBetween(l,d,(m,y)=>{o&&o===m.type&&(f=Math.max(y,l),h=Math.min(y+m.nodeSize,d),u=y,p=m)}):r.doc.nodesBetween(l,d,(m,y)=>{y<l&&o&&o===m.type&&(f=Math.max(y,l),h=Math.min(y+m.nodeSize,d),u=y,p=m),y>=l&&y<=d&&(o&&o===m.type&&n.setNodeMarkup(y,void 0,{...m.attrs,...t}),i&&m.marks.length&&m.marks.forEach(g=>{if(i===g.type){const v=Math.max(y,l),M=Math.min(y+m.nodeSize,d);n.addMark(v,M,i.create({...g.attrs,...t}))}}))}),p&&(u!==void 0&&n.setNodeMarkup(u,void 0,{...p.attrs,...t}),i&&p.marks.length&&p.marks.forEach(m=>{i===m.type&&n.addMark(f,h,i.create({...m.attrs,...t}))}))}),!0):!1},$r=(e,t={})=>({state:n,dispatch:r})=>{const s=A(e,n.schema);return Le(s,t)(n,r)},Rr=(e,t={})=>({state:n,dispatch:r})=>{const s=A(e,n.schema);return Je(s,t)(n,r)};var Br=Object.freeze({__proto__:null,blur:mn,clearContent:gn,clearNodes:yn,command:bn,createParagraphNear:vn,cut:kn,deleteCurrentNode:Mn,deleteNode:Sn,deleteRange:wn,deleteSelection:En,enter:xn,exitCode:An,extendMarkRange:Tn,first:Cn,focus:Pn,forEach:Ln,insertContent:In,insertContentAt:Bn,joinBackward:_n,joinDown:Hn,joinForward:Dn,joinItemBackward:jn,joinItemForward:Fn,joinTextblockBackward:zn,joinTextblockForward:Vn,joinUp:Nn,keyboardShortcut:Un,lift:qn,liftEmptyBlock:Kn,liftListItem:Gn,newlineInCode:Jn,resetAttributes:Yn,scrollIntoView:Qn,selectAll:Xn,selectNodeBackward:Zn,selectNodeForward:tr,selectParentNode:er,selectTextblockEnd:nr,selectTextblockStart:rr,setContent:sr,setMark:yr,setMeta:br,setNode:vr,setNodeSelection:kr,setTextSelection:Mr,sinkListItem:Sr,splitBlock:wr,splitListItem:Er,toggleList:xr,toggleMark:Ar,toggleNode:Tr,toggleWrap:Cr,undoInputRule:Or,unsetAllMarks:Pr,unsetMark:Lr,updateAttributes:Ir,wrapIn:$r,wrapInList:Rr});const Nr=T.create({name:"commands",addCommands(){return{...Br}}}),Hr=T.create({name:"drop",addProseMirrorPlugins(){return[new I({key:new N("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),_r=T.create({name:"editable",addProseMirrorPlugins(){return[new I({key:new N("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Dr=T.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new I({key:new N("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),jr=T.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:c})=>{const{selection:a,doc:l}=c,{empty:d,$anchor:u}=a,{pos:p,parent:f}=u,h=u.parent.isTextblock&&p>0?c.doc.resolve(p-1):u,m=h.parent.type.spec.isolating,y=u.pos-u.parentOffset,g=m&&h.parent.childCount===1?y===u.pos:V.atStart(l).from===p;return!d||!f.type.isTextblock||f.textContent.length||!g||g&&u.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xt()||ne()?o:s},addProseMirrorPlugins(){return[new I({key:new N("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(m=>m.getMeta("composition")))return;const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),s=e.some(m=>m.getMeta("preventClearDocument"));if(!r||s)return;const{empty:o,from:i,to:c}=t.selection,a=V.atStart(t.doc).from,l=V.atEnd(t.doc).to;if(o||!(i===a&&c===l)||!lt(n.doc))return;const p=n.tr,f=rt({state:n,transaction:p}),{commands:h}=new st({editor:this.editor,state:f});if(h.clearNodes(),!!p.steps.length)return p}})]}}),Fr=T.create({name:"paste",addProseMirrorPlugins(){return[new I({key:new N("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),zr=T.create({name:"tabindex",addProseMirrorPlugins(){return[new I({key:new N("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class F{get name(){return this.node.type.name}constructor(t,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new F(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new F(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new F(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,i=this.pos+r+(o?0:1),c=this.resolvedPos.doc.resolve(i);if(!s&&c.depth<=this.depth)return;const a=new F(c,this.editor,s,s?n:null);s&&(a.actualDepth=this.depth+1),t.push(new F(c,this.editor,s,s?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===t)if(Object.keys(n).length>0){const o=s.node.attrs,i=Object.keys(n);for(let c=0;c<i.length;c+=1){const a=i[c];if(o[a]!==n[a])break}}else r=s;s=s.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(n);return this.children.forEach(i=>{r&&s.length>0||(i.node.type.name===t&&o.every(a=>n[a]===i.node.attrs[a])&&s.push(i),!(r&&s.length>0)&&(s=s.concat(i.querySelectorAll(t,n,r))))}),s}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const Vr=`.ProseMirror {
5  position: relative;
6}
7
8.ProseMirror {
9  word-wrap: break-word;
10  white-space: pre-wrap;
11  white-space: break-spaces;
12  -webkit-font-variant-ligatures: none;
13  font-variant-ligatures: none;
14  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
15}
16
17.ProseMirror [contenteditable="false"] {
18  white-space: normal;
19}
20
21.ProseMirror [contenteditable="false"] [contenteditable="true"] {
22  white-space: pre-wrap;
23}
24
25.ProseMirror pre {
26  white-space: pre-wrap;
27}
28
29img.ProseMirror-separator {
30  display: inline !important;
31  border: none !important;
32  margin: 0 !important;
33  width: 0 !important;
34  height: 0 !important;
35}
36
37.ProseMirror-gapcursor {
38  display: none;
39  pointer-events: none;
40  position: absolute;
41  margin: 0;
42}
43
44.ProseMirror-gapcursor:after {
45  content: "";
46  display: block;
47  position: absolute;
48  top: -2px;
49  width: 20px;
50  border-top: 1px solid black;
51  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
52}
53
54@keyframes ProseMirror-cursor-blink {
55  to {
56    visibility: hidden;
57  }
58}
59
60.ProseMirror-hideselection *::selection {
61  background: transparent;
62}
63
64.ProseMirror-hideselection *::-moz-selection {
65  background: transparent;
66}
67
68.ProseMirror-hideselection * {
69  caret-color: transparent;
70}
71
72.ProseMirror-focused .ProseMirror-gapcursor {
73  display: block;
74}
75
76.tippy-box[data-animation=fade][data-state=hidden] {
77  opacity: 0
78}`;function Wr(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return t&&s.setAttribute("nonce",t),s.setAttribute("data-tiptap-style",""),s.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(s),s}class Ur extends Xe{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Wr(Vr,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=Jt(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],s=this.state.reconfigure({plugins:r});return this.view.updateState(s),s}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(t).forEach(o=>{const i=typeof o=="string"?`${o}$`:o.key;r=n.filter(c=>!c.key.startsWith(i))}),n.length===r.length)return;const s=this.state.reconfigure({plugins:r});return this.view.updateState(s),s}createExtensionManager(){var t,n;const s=[...this.options.enableCoreExtensions?[_r,hn.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),Nr,Dr,jr,zr,Hr,Fr].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new U(s,this)}createCommandManager(){this.commandManager=new st({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=yt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;
78this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(c=>c.name!=="collaboration"),this.createExtensionManager()}}),n=yt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=te(n,this.options.autofocus);this.view=new ve(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:pe.create({doc:n,selection:r||void 0})});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(i=>{var c;return(c=this.capturedTransaction)===null||c===void 0?void 0:c.step(i)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const s=t.getMeta("focus"),o=t.getMeta("blur");s&&this.emit("focus",{editor:this,event:s.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return se(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,s=typeof t=="string"?n:t;return hr(this.state,r,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return St(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
79
80`,textSerializers:r={}}=t||{};return lr(this.state.doc,{blockSeparator:n,textSerializers:{...Qt(this.schema),...r}})}get isEmpty(){return lt(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new F(n,this)}get $doc(){return this.$pos(0)}}function W(e){return new it({find:e.find,handler:({state:t,range:n,match:r})=>{const s=k(e.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:o}=t,i=r[r.length-1],c=r[0];if(i){const a=c.search(/\S/),l=n.from+c.indexOf(i),d=l+i.length;if(Tt(n.from,n.to,t.doc).filter(f=>f.mark.type.excluded.find(m=>m===e.type&&m!==f.mark.type)).filter(f=>f.to>l).length)return null;
80d<n.to&&o.delete(d,n.to),l>n.from&&o.delete(n.from+a,l);const p=n.from+a+i.length;o.addMark(n.from+a,p,e.type.create(s||{})),o.removeStoredMark(e.type)}}})}function oe(e){return new it({find:e.find,handler:({state:t,range:n,match:r})=>{const s=k(e.getAttributes,void 0,r)||{},{tr:o}=t,i=n.from;let c=n.to;const a=e.type.create(s);if(r[1]){const l=r[0].lastIndexOf(r[1]);let d=i+l;d>c?d=c:c=d+r[1].length;const u=r[0][r[0].length-1];o.insertText(u,i+r[0].length-1),o.replaceWith(d,c,a)}else if(r[0]){const l=e.type.isInline?i:i-1;o.insert(l,e.type.create(s)).delete(o.mapping.map(i),o.mapping.map(c))}o.scrollIntoView()}})}function vt(e){return new it({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),o=k(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function K(e){return new it({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const o=k(e.getAttributes,void 0,r)||{},i=t.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),l=a&&Te(a,e.type,o);if(!l)return null;if(i.wrap(a,l),e.keepMarks&&e.editor){const{selection:u,storedMarks:p}=t,{splittableMarks:f}=e.editor.extensionManager,h=p||u.$to.parentOffset&&u.$from.marks();if(h){const m=h.filter(y=>f.includes(y.type.name));i.ensureMarks(m)}}if(e.keepAttributes){const u=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(u,o).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Mt(i.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&i.join(n.from-1)}})}class P{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(b(this,"addOptions",{name:this.name}))),this.storage=k(b(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new P(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>at(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new P(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=k(b(n,"addOptions",{name:n.name})),n.storage=k(b(n,"addStorage",{name:n.name,options:n.options})),n}}function _(e){return new cn({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const o=k(e.getAttributes,void 0,r,s);if(o===!1||o===null)return null;const{tr:i}=t,c=r[r.length-1],a=r[0];let l=n.to;if(c){const d=a.search(/\S/),u=n.from+a.indexOf(c),p=u+c.length;if(Tt(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(y=>y===e.type&&y!==h.mark.type)).filter(h=>h.to>u).length)return null;p<n.to&&i.delete(p,n.to),u>n.from&&i.delete(n.from+d,u),l=n.from+d+c.length,i.addMark(n.from+d,l,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ie={exports:{}},ht={};/**
81 * @license React
82 * use-sync-external-store-shim.production.min.js
83 *
84 * Copyright (c) Facebook, Inc. and its affiliates.
85 *
86 * This source code is licensed under the MIT license found in the
87 * LICENSE file in the root directory of this source tree.
88 */var Dt;function Kr(){if(Dt)return ht;Dt=1;var e=O;function t(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function c(u,p){var f=p(),h=r({inst:{value:f,getSnapshot:p}}),m=h[0].inst,y=h[1];return o(function(){m.value=f,m.getSnapshot=p,a(m)&&y({inst:m})}
88,[u,f,p]),s(function(){return a(m)&&y({inst:m}),u(function(){a(m)&&y({inst:m})})},[u]),i(f),f}function a(u){var p=u.getSnapshot;u=u.value;try{var f=p();return!n(u,f)}catch{return!0}}function l(u,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return ht.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,ht}ie.exports=Kr();var Ct=ie.exports;const Gr=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Jr=({contentComponent:e})=>{const t=Ct.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return O.createElement(O.Fragment,null,Object.values(t))};function Yr(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:le.createPortal(r.reactElement,r.element,n)},e.forEach(s=>s())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(s=>s())}}}class Qr extends O.Component{constructor(t){var n;super(t),this.editorContentRef=O.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=Yr(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return O.createElement(O.Fragment,null,O.createElement("div",{ref:Gr(n,this.editorContentRef),...r}),t?.contentComponent&&O.createElement(Jr,{contentComponent:t.contentComponent}))}}const Xr=R.forwardRef((e,t)=>{const n=O.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return O.createElement(Qr,{key:n,innerRef:t,...e})}),mo=O.memo(Xr);var Zr=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;for(s of t.entries())if(!e(s[1],n.get(s[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s of t.entries())if(!n.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(t[s]!==n[s])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!(i==="_owner"&&t.$$typeof)&&!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n},ts=qr(Zr),ae={exports:{}},mt={};/**
89 * @license React
90 * use-sync-external-store-shim/with-selector.production.min.js
91 *
92 * Copyright (c) Facebook, Inc. and its affiliates.
93 *
94 * This source code is licensed under the MIT license found in the
95 * LICENSE file in the root directory of this source tree.
96 */var jt;function es(){if(jt)return mt;jt=1;var e=O,t=Ct;function n(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}
96var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,c=e.useMemo,a=e.useDebugValue;return mt.useSyncExternalStoreWithSelector=function(l,d,u,p,f){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=c(function(){function g(w){if(!v){if(v=!0,M=w,w=p(w),f!==void 0&&m.hasValue){var C=m.value;if(f(C,w))return E=C}return E=w}if(C=E,r(M,w))return C;var $=p(w);return f!==void 0&&f(C,$)?C:(M=w,E=$)}var v=!1,M,E,S=u===void 0?null:u;return[function(){return g(d())},S===null?void 0:function(){return g(S())}]},[d,u,p,f]);var y=s(l,h[0],h[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},mt}ae.exports=es();var ns=ae.exports;const rs=typeof window<"u"?R.useLayoutEffect:R.useEffect;class ss{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapsh
96ot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(s=>s())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function os(e){var t;const[n]=R.useState(()=>new ss(e.editor)),r=ns.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:ts);return rs(()=>n.watch(e.editor),[e.editor,n]),R.useDebugValue(r),r}const is=!1,kt=typeof window>"u",as=kt||!!(typeof window<"u"&&window.next);class Ot{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?kt||as?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var s,o;return(o=(s=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(s,...r)},onBlur:(...r)=>{var s,o;return(o=(s=this.options.current).onBlur)===null||o===void 0?void 0:o.call(s,...r)},onCreate:(...r)=>{var s,o;return(o=(s=this.options.current).onCreate)===null||o===void 0?void 0:o.call(s,...r)},onDestroy:(...r)=>{var s,o;return(o=(s=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(s,...r)},onFocus:(...r)=>{var s,o;return(o=(s=this.options.current).onFocus)===null||o===void 0?void 0:o.call(s,...r)},onSelectionUpdate:(...r)=>{var s,o;return(o=(s=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(s,...r)},onTransaction:(...r)=>{var s,o;return(o=(s=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(s,...r)},onUpdate:(...r)=>{var s,o;return(o=(s=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(s,...r)},onContentError:(...r)=>{var s,o;return(o=(s=this.options.current).onContentError)===null||o===void 0?void 0:o.call(s,...r)},onDrop:(...r)=>{var s,o;return(o=(s=this.options.current).onDrop)===null||o===void 0?void 0:o.call(s,...r)},onPaste:(...r)=>{var s,o;return(o=(s=this.options.current).onPaste)===null||o===void 0?void 0:o.call(s,...r)}};return new Ur(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((s,o)=>{var i;return s===((i=n.extensions)===null||i===void 0?void 0:i[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Ot.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){
96if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,s)=>r===t[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}}function go(e={},t=[]){const n=R.useRef(e);n.current=e;const[r]=R.useState(()=>new Ot(n)),s=Ct.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return R.useDebugValue(s),R.useEffect(r.onRender(t)),os({editor:s,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1?null:e.immediatelyRender&&o===0?0:o+1}),s}const cs=R.createContext({editor:null});cs.Consumer;const ls=R.createContext({onDragStart:void 0}),us=()=>R.useContext(ls);O.forwardRef((e,t)=>{const{onDragStart:n}=us(),r=e.as||"div";return O.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function ds(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function ps(e){return new I({key:new N("autolink"),appendTransaction:(t,n,r)=>{const s=t.some(l=>l.docChanged)&&!n.doc.eq(r.doc),o=t.some(l=>l.getMeta("preventAutolink"));if(!s||o)return;const{tr:i}=r,c=or(n.doc,[...t]);if(fr(c).forEach(({newRange:l})=>{const d=ar(r.doc,l,f=>f.isTextblock);let u,p;if(d.length>1?(u=d[0],p=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ")):d.length&&r.doc.textBetween(l.from,l.to," "," ").endsWith(" ")&&(u=d[0],p=r.doc.textBetween(u.pos,l.to,void 0," ")),u&&p){const f=p.split(" ").filter(g=>g!=="");if(f.length<=0)return!1;const h=f[f.length-1],m=u.pos+p.lastIndexOf(h);if(!h)return!1;const y=ue(h).map(g=>g.toObject(e.defaultProtocol));if(!ds(y))return!1;y.filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>e.validate(g.value)).filter(g=>e.shouldAutoLink(g.value)).forEach(g=>{Tt(g.from,g.to,r.doc).some(v=>v.mark.type===e.type)||i.addMark(g.from,g.to,e.type.create({href:g.href}))})}}),!!i.steps.length)return i}})}function fs(e){return new I({key:new N("handleClickLink"),props:{handleClick:(t,n,r)=>{var s,o;if(r.button!==0||!t.editable)return!1;let i=r.target;const c=[];for(;i.nodeName!=="DIV";)c.push(i),i=i.parentNode;if(!c.find(p=>p.nodeName==="A"))return!1;const a=se(t.state,e.type.name),l=r.target,d=(s=l?.href)!==null&&s!==void 0?s:a.href,u=(o=l?.target)!==null&&o!==void 0?o:a.target;return l&&d?(window.open(d,u),!0):!1}}})}function hs(e){return new I({key:new N("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:s}=t,{selection:o}=s,{empty:i}=o;if(i)return!1;let c="";r.content.forEach(l=>{c+=l.textContent});const a=Ut(c,{defaultProtocol:e.defaultProtocol}).find(l=>l.isLink&&l.value===c);return!c||!a?!1:e.editor.commands.setMark(e.type,{href:a.href})}}})}const ms=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function j(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!e||e.replace(ms,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const yo=B.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Pt(e);return}Pt(e.scheme,e.optionalSlashes)})},onDestroy(){de()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>
vendor: 1,878 bytes, line 96
96!!j(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!j(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!j(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",x(this.options.HTMLAttributes,e),0]:["a",x(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!j(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!j(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[_({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,s=Ut(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!j(i,n),protocols:n,defaultProtocol:r}));s.length&&s.forEach(o=>t.push({text:o.value,data:{href:o.href},index:o.start}))}return t}
96,type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(ps({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!j(s,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(fs({type:this.type})),this.options.linkOnPaste&&e.push(hs({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),gs=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var r,s;const o=n.getAttribute("style"),i=(s=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||s===void 0?void 0:s.getAttribute("style");n.setAttribute("style",`${i};${o}`)})},bo=B.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&gs(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",x(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(o=>!!o))||e.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),vo=T.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),ys=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ko=P.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",x(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}}
96,addInputRules(){return[oe({find:ys,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),bs=/^\s*>\s$/,vs=P.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[K({find:bs,type:this.type})]}}),ks=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ms=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Ss=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ws=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Es=B.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}
vendor: 6,792 bytes, lines 96-100
96,addInputRules(){return[W({find:ks,type:this.type}),W({find:Ss,type:this.type})]},addPasteRules(){return[_({find:Ms,type:this.type}),_({find:ws,type:this.type})]}}),xs="listItem",Ft="textStyle",zt=/^\s*([-+*])\s$/,As=P.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",x(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(xs,this.editor.getAttributes(Ft)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=K({find:zt,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=K({find:zt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ft),editor:this.editor})),[e]}}),Ts=/(^|[^`])`([^`]+)`(?!`)/,Cs=/(^|[^`])`([^`]+)`(?!`)/g,Os=B.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[W({find:Ts,type:this.type})]},addPasteRules(){return[_({find:Cs,type:this.type})]}}),Ps=/^```([a-z]+)?[\s\n]$/,Ls=/^~~~([a-z]+)?[\s\n]$/,Is=P.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",x(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
97
98`);return!o||!i?!1:e.chain().command(({tr:c})=>(c.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:s,empty:o}=n;if(!o||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const c=s.after();return c===void 0?!1:r.nodeAt(c)?e.commands.command(({tr:l})=>(l.setSelection(V.near(r.resolve(c))),!0)):e.commands.exitCode()}}},addInputRules(){return[vt({find:Ps,type:this.type,getAttributes:e=>({language:e[1]})}),vt({find:Ls,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new I({key:new N("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,o=s?.mode;if(!n||!o)return!1;const{tr:i,schema:c}=e.state,a=c.text(n.replace(/\r\n?/g,`
99`));return i.replaceSelectionWith(this.type.create({language:o},a)),i.selection.$from.parent.type!==this.type&&i.setSelection(L.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),e.dispatch(i),!0}}})]}}),$s=P.create({name:"doc",topNode:!0,content:"block+"}),Rs=T.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[he(this.options)]}}),Bs=T.create({name:"gapCursor",addProseMirrorPlugins(){return[me()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=k(b(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),Ns=P.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",x(this.options.HTMLAttributes,e)]},renderText(){return`
100`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:s,storedMarks:o}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:c}=r.extensionManager,a=o||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:l,dispatch:d})=>{if(d&&a&&i){const u=a.filter(p=>c.includes(p.type.name));l.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Hs=P.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,x(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>vt({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
100)\\s$`),type:this.type,getAttributes:{level:e}}))}}),_s=T.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>be(e,t),redo:()=>({state:e,dispatch:t})=>ye(e,t)}},addProseMirrorPlugins(){return[ge(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ds=P.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",x(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:s}=n,o=e();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:s.pos},{type:this.name}):mr(n)?o.insertContentAt(s.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:i,dispatch:c})=>{var a;if(c){const{$to:l}=i.selection,d=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(L.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(nt.create(i.doc,l.pos)):i.setSelection(L.create(i.doc,l.pos));else{const u=(a=l.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();u&&(i.insert(d,u),i.setSelection(L.create(i.doc,d+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[oe({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,000 bytes, line 100
100ype})]}}),js=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Fs=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,zs=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Vs=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ws=B.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[W({find:js,type:this.type}),W({find:zs,type:this.type})]},addPasteRules(){return[_({find:Fs,type:this.type}),_({find:Vs,type:this.type})]}}),Us=P.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",x(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),qs="listItem",Vt="textStyle",Wt=/^(\d+)\.\s$/,Ks=P.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",x(this.options.HTMLAttributes,n),0]:["ol",x(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qs,this.editor.getAttributes(Vt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=K({find:Wt,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=K({find:Wt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Vt)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),Gs=P.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Js=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ys=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Qs=B.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}}
100,addInputRules(){return[W({find:Js,type:this.type})]},addPasteRules(){return[_({find:Ys,type:this.type})]}}),Xs=P.create({name:"text",group:"inline"}),Mo=T.create({name:"starterKit",addExtensions(){var e,t,n,r,s,o,i,c,a,l,d,u,p,f,h,m,y,g;const v=[];return this.options.bold!==!1&&v.push(Es.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&v.push(vs.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&v.push(As.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&v.push(Os.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(Is.configure((s=this.options)===null||s===void 0?void 0:s.codeBlock)),this.options.document!==!1&&v.push($s.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(Rs.configure((i=this.options)===null||i===void 0?void 0:i.dropcursor)),this.options.gapcursor!==!1&&v.push(Bs.configure((c=this.options)===null||c===void 0?void 0:c.gapcursor)),this.options.hardBreak!==!1&&v.push(Ns.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&v.push(Hs.configure((l=this.options)===null||l===void 0?void 0:l.heading)),this.options.history!==!1&&v.push(_s.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&v.push(Ds.configure((u=this.options)===null||u===void 0?void 0:u.horizontalRule)),this.options.italic!==!1&&v.push(Ws.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&v.push(Us.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&v.push(Ks.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&v.push(Gs.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&v.push(Qs.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&v.push(Xs.configure((g=this.options)===null||g===void 0?void 0:g.text)),v}}),Zs=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,to=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,So=B.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}
vendor: 2,746 bytes, line 100
100,addInputRules(){return[W({find:Zs,type:this.type})]},addPasteRules(){return[_({find:to,type:this.type})]}}),wo=B.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",x(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Eo=T.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),xo=T.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new I({key:new N("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,s=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((i,c)=>{const a=r>=c&&r<=c+i.nodeSize,l=!i.isLeaf&&lt(i);if((a||!this.options.showOnlyCurrent)&&l){const d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);const u=ke.node(c,c+i.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:c,hasAnchor:a}):this.options.placeholder});s.push(u)}return this.options.includeChildren}),Me.create(e,s)}}})]}});export{vo as C,mo as E,So as H,ko as I,yo as L,B as M,P as N,xo as P,Mo as S,Eo as T,wo as U,bo as a,os as b,x as m,go as u};

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.