PageSourceSearch

https://www.qidis26.com/_next/static/chunks/24087ruml3xrb.js

js qidis26.com collected 2026-10-07 20:51:08 UTC 451,515 bytes, 8 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="08d799dd-e000-9ad3-5d44-74672ea21aea")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[558768,e=>{var t=e.i(956799);e.s(["f",()=>t.f])},350219,812121,802659,387163,711379,713249,237336,73923,546754,996425,140644,221214,246208,964892,193964,397455,924080,169444,102402,103987,91155,e=>{var t,r,n,o,i,s,a,l,c,u,d,h,p,f,m,g,y,v,b,w,x,S,k,E,C,O,M,T=e.i(996252),N=e.i(939139),A={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},_=Symbol.for("__remirror__"),R=((t=R||{}).PlainExtension="RemirrorPlainExtension",t.NodeExtension="RemirrorNodeExtension",t.MarkExtension="RemirrorMarkExtension",t.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",t.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",t.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",t.Manager="RemirrorManager",t.Preset="RemirrorPreset",t.PresetConstructor="RemirrorPresetConstructor",t),D=((r=D||{})[r.Critical=1e6]="Critical",r[r.Highest=1e5]="Highest",r[r.High=1e4]="High",r[r.Medium=1e3]="Medium",r[r.Default=100]="Default",r[r.Low=10]="Low",r[r.Lowest=0]="Lowest",r),P=((n=P||{})[n.None=0]="None",n[n.Create=1]="Create",n[n.EditorView=2]="EditorView",n[n.Runtime=3]="Runtime",n[n.Destroy=4]="Destroy",n),I=((o=I||{}).Undo="_|undo|_",o.Redo="_|redo|_",o.Bold="_|bold|_",o.Italic="_|italic|_",o.Underline="_|underline|_",o.Strike="_|strike|_",o.Code="_|code|_",o.Paragraph="_|paragraph|_",o.H1="_|h1|_",o.H2="_|h2|_",o.H3="_|h3|_",o.H4="_|h4|_",o.H5="_|h5|_",o.H6="_|h6|_",o.TaskList="_|task|_",o.BulletList="_|bullet|_",o.OrderedList="_|number|_",o.Quote="_|quote|_",o.Divider="_|divider|_",o.Codeblock="_|codeblock|_",o.ClearFormatting="_|clear|_",o.Superscript="_|sup|_",o.Subscript="_|sub|_",o.LeftAlignment="_|left-align|_",o.CenterAlignment="_|center-align|_",o.RightAlignment="_|right-align|_",o.JustifyAlignment="_|justify-align|_",o.InsertLink="_|link|_",o.Find="_|find|_",o.FindBackwards="_|find-backwards|_",o.FindReplace="_|find-replace|_",o.AddFootnote="_|footnote|_",o.AddComment="_|comment|_",o.ContextMenu="_|context-menu|_",o.IncreaseFontSize="_|inc-font-size|_",o.DecreaseFontSize="_|dec-font-size|_",o.IncreaseIndent="_|indent|_",o.DecreaseIndent="_|dedent|_",o.Shortcuts="_|shortcuts|_",o.Copy="_|copy|_",o.Cut="_|cut|_",o.Paste="_|paste|_",o.PastePlain="_|paste-plain|_",o.SelectAll="_|select-all|_",o.Format="_|format|_",o),L=((i=L||{}).PROD="RMR0000",i.UNKNOWN="RMR0001",i.INVALID_COMMAND_ARGUMENTS="RMR0002",i.CUSTOM="RMR0003",i.CORE_HELPERS="RMR0004",i.MUTATION="RMR0005",i.INTERNAL="RMR0006",i.MISSING_REQUIRED_EXTENSION="RMR0007",i.MANAGER_PHASE_ERROR="RMR0008",i.INVALID_GET_EXTENSION="RMR0010",i.INVALID_MANAGER_ARGUMENTS="RMR0011",i.SCHEMA="RMR0012",i.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",i.INVALID_MANAGER_EXTENSION="RMR0014",i.DUPLICATE_COMMAND_NAMES="RMR0016",i.DUPLICATE_HELPER_NAMES="RMR0017",i.NON_CHAINABLE_COMMAND="RMR0018",i.INVALID_EXTENSION="RMR0019",i.INVALID_CONTENT="RMR0021",i.INVALID_NAME="RMR0050",i.EXTENSION="RMR0100",i.EXTENSION_SPEC="RMR0101",i.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",i.INVALID_SET_EXTENSION_OPTIONS="RMR0103",i.REACT_PROVIDER_CONTEXT="RMR0200",i.REACT_GET_ROOT_PROPS="RMR0201",i.REACT_EDITOR_VIEW="RMR0202",i.REACT_CONTROLLED="RMR0203",i.REACT_NODE_VIEW="RMR0204",i.REACT_GET_CONTEXT="RMR0205",i.REACT_COMPONENTS="RMR0206",i.REACT_HOOKS="RMR0207",i.I18N_CONTEXT="RMR0300",i);e.s(["D",0,L,"z",0,D,"p",0,A,"V",0,"","E",0,P,"r",0,"\0","n",0,I,"I",0,R,"K",0,"ProseMirror-selectednode","f",0,"__state_override__","L",0,_],812121);var B=e.i(12838),V=e.i(910612),F=e.i(8011),j=e.i(856348);let z=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,$=/\S+/g;function U(e,t){let{keepSpecialCharacters:r=!1,keep:n,prefix:o=""}=t||{},i=e.trim().normalize("NFC"),s=i.includes(" "),a=function(e,t){let r={parts:[],prefixes:[]},n=e.matchAll(t),o=0;for(let t of n){if("number"!=typeof t.index)continue;let n=t[0];r.parts.push(n);let i=e.slice(o,t.index).trim();r.prefixes.push(i),o=t.index+n.length}let i=e.slice(o).trim();return i&&(r.parts.push(""),r.prefixes.push(i)),r}(i,s?$:z);return a.parts.map((e,t)=>{let i=a.prefixes[t]||"",l=e;return(!1===r&&(n&&(l=l.normalize("NFD").replace(RegExp(`[^a-zA-Z\xd8\xdf\xf80-9${n.join("")}]`,"g"),"")),n||(l=l.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),i="")),n&&(i=i.replace(RegExp(`[^${n.join("")}]`,"g"),"")),0===t)?i+l:i||l?s&&!i&&o.match(/\s/)?" "+l:(i||o)+l:""}
2).filter(Boolean)}function H(e){let t=e.matchAll(z).next().value,r=t?t.index:0;return e.slice(0,r+1).toUpperCase()+e.slice(r+1).toLowerCase()}function K(e,t){return U(e,t).reduce((e,t)=>e+H(t),"")}function W(e,t,r,n){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){for(var l=arguments.length,c=Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=this,h=Date.now()-s;function p(){s=Date.now(),r.apply(d,c)}i||(n&&!o&&p(),a(),void 0===n&&h>e?p():!0!==t&&(o=setTimeout(n?function(){o=void 0}:p,void 0===n?e-h:e)))}return"boolean"!=typeof t&&(n=r,r=t,t=void 0),l.cancel=function(){a(),i=!0},l}function q(e){return e}function J(e,t,r){let n=e[t];return G(!es(n),r),n}function G(e,t){if(!e)throw new Y(t)}e.s(["u",0,function(e,t){return U(e,t).reduce((e,t,r)=>0!==r&&(t[0]||"").match(z)?e+H(t):e+t.toLowerCase(),"")},"j",0,function(e,t={keepSpecialCharacters:!0}){return U(e,{...t,prefix:" "}).reduce((e,t)=>e+H(t),"")},"F",0,function(e,t){return U(e,{...t,prefix:"_"}).join("").toUpperCase()},"O",0,function(e,t){return U(e,{...t,prefix:"-"}).join("").toLowerCase()},"L",0,K,"G",0,function(e,t={keepSpecialCharacters:!0}){return U(e,t).reduce((e,t,r)=>e+(0===r||"/"===t[0]?"":"/")+t,"")},"h",0,function(e,t){return U(e,{...t,prefix:"_"}).join("").toLowerCase()},"d",0,function(e,t={keepSpecialCharacters:!0}){return U(e,{...t,prefix:" "}).join("")}],802659),e.s(["A",0,function(e,t,r){return void 0===r?W(e,t,!1):W(e,r,!1!==t)},"N",0,W],387163);var Y=class extends N.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function X(e){return Object.entries(e)}function Z(e){return Object.keys(e)}function Q(e){return Object.values(e)}function ee(e,t,r){return e.includes(t,r)}function et(e){return Object.assign(Object.create(null),e)}function er(e){return Object.prototype.toString.call(e)}function en(e){return er(e).slice(8,-1)}function eo(e,t){return r=>typeof r===e&&(!t||t(r))}function ei(e){return t=>en(t)===e}var es=eo("undefined"),ea=eo("string"),el=eo("number",e=>!Number.isNaN(e)),ec=eo("function");function eu(e){if("Object"!==en(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})}function ed(e){return null===e||es(e)}function eh(e){return!ed(e)&&(ec(e)||eo("object")(e))}eo("symbol");var ep=ei("RegExp");function ef(e){return eh(e)&&!ei("Map")(e)&&!ei("Set")(e)&&0===Object.keys(e).length}ei("Date"),ei("Error");var em=Array.isArray;function eg(e){return em(e)&&0===e.length}function ey(e){return em(e)&&e.length>0}function ev(e,t,r=e=>!!e){let n;t.lastIndex=0;let o=[],i=t.flags;i.includes("g")||(t=RegExp(t.source,`g${i}`));do(n=t.exec(e))&&o.push(n);while(r(n))return t.lastIndex=0,o}function eb(){let e=Date.now(),t=eb.last||e;return eb.last=e>t?e:t+1}function ew(e=""){return`${e}${eb().toString(36)}`}function ex(e){return(0,F.default)(e,e=>!es(e))}eb.last=0;var eS=V.default;function ek(e,t=!1){let r=new Set(t?[...e].reverse():e);return t?[...r].reverse():[...r]}function eE(){}function eC(...e){return B.default.all(e,{isMergeableObject:eu})}function eO({min:e,max:t,value:r}){return r<e?e:r>t?t:r}function eM(e,t){return[...e].map((e,t)=>({value:e,index:t})).sort((e,r)=>t(e.value,r.value)||e.index-r.index).map(({value:e})=>e)}function eT(e,t){let r=function(e){if(!eu(e))throw Error("An invalid value was passed into this clone utility. Expected a plain object");return{...e}}(t),n=r;for(let[t,r]of e.entries()){var o;let i=t>=e.length-1,s=n[r];if(i){if(em(n)){let e=Number.parseInt(r.toString(),10);el(e)&&n.splice(e,1)}else Reflect.deleteProperty(n,r);break}if(null==(o=s)||/^[bns]/.test(typeof o))break;s=em(s)?[...s]:{...s},n[r]=s,n=s}return r}function eN(e,t,r=!1){let n=[],o=new Set,i=ec(t)?t:e=>(function(e,t){try{if(ea(t)&&t in e)return e[t];em(t)&&(t=`['${t.join("']['")}']`);let r=e;return t.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(e,t,n,o,i,s)=>(r=r[n||o||i||s],"")),void 0===r?void 0:r}catch{return}})(e,t);for(let t of r?[...e].reverse():e){let e=i(t);o.has(e)||(o.add(e),n.push(t))}return r?n.reverse():n}function eA(e,t){let r=em(e)?e[0]:e;return el(t)?r<=t?Array.from({length:t+1-r},(e,t)=>t+r):Array.from({length:r+1-t},(e,t)=>-1*t+r):Array.from({length:Math.abs(r)},(e,t)=>(r<0?-1:1)*t)}
2function e_(e){return ec(e)?e():e}var eR="https://remirror.io/docs/errors",eD={[L.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[L.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[L.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[L.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[L.MUTATION]:"Mutation of immutable value detected.",[L.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[L.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[L.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[L.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[L.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[L.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[L.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[L.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[L.DUPLICATE_COMMAND_NAMES]:"Command method n
2ames must be unique within the editor.",[L.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[L.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[L.INVALID_EXTENSION]:"The provided extension is invalid.",[L.INVALID_CONTENT]:"The content provided to the editor is not supported.",[L.INVALID_NAME]:"An invalid name was used for the extension.",[L.EXTENSION]:"An error occurred within an extension. More details should be made available.",[L.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[L.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[L.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[L.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[L.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[L.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[L.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[L.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[L.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[L.REACT_COMPONENTS]:"An error occurred within a remirror component.",[L.REACT_HOOKS]:"An error occurred within a remirror hook.",[L.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."},eP=class extends N.BaseError{constructor({code:e,message:t,disableLogging:r=!1}={}){let n,o,i,s=ea(e)&&ee(Q(L),e)?e:L.CUSTOM;super((o=(n=eD[s])?`${n}
3
4`:"",i=t?`${t}
5
6`:"",`${o}${i}For more information visit ${eR}#${s.toLowerCase()}`)),this.errorCode=s,this.url=`${eR}#${s.toLowerCase()}`,r||console.error(this.message)}static create(e={}){return new eP(e)}};function eI(e,t){if(!e)throw eP.create(t)}function eL(e,t={}){return e}function eB(e){this.content=e}e.s(["p",0,q,"n",0,G,"N",0,J,"H",0,function(e){return e.charAt(0).toUpperCase()+e.slice(1)},"O",0,eO,"w",0,eC,"k",0,function(e){if("object"!=typeof e||null===e)return e;let t=Symbol.toStringTag in e&&"Module"===e[Symbol.toStringTag]?e.default??e:e;return t&&"object"==typeof e&&"__esModule"in t&&t.__esModule&&void 0!==t.default?t.default:t},"V",0,X,"a",0,ev,"s",0,eL,"x",0,e_,"J",0,ee,"l",0,eI,"o",0,em,"F",0,function(e){return!0===e||!1===e},"q",0,eg,"r",0,ef,"M",0,eS,"U",0,ec,"v",0,function(e){return t=>eh(t)&&t instanceof e},"e",0,ey,"Y",0,ed,"I",0,el,"C",0,eh,"d",0,eu,"t",0,function(e){let t;return ei("Promise")(e)||!!(null!==(t=e)&&eh(t)&&ec(t.then)&&ec(t.catch))},"D",0,ep,"Z",0,ea,"m",0,es,"b",0,Z,"z",0,function(e){return e[e.length-1]},"_",0,eE,"u",0,et,"T",0,ex,"j",0,eA,"f",0,eM,"$",0,function(e,t){return t=Math.max(Math.min(0,t),t),e.slice(0,t)},"g",0,er,"h",0,ek,"E",0,eN,"G",0,ew,"y",0,eT,"A",0,Q,"B",0,function(e,...t){let r=t.filter(el);return e>=Math.min(...r)&&e<=Math.max(...r)}],350219),eB.prototype={constructor:eB,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,r){var n=r&&r!=e?this.remove(r):this,o=n.find(e),i=n.content.slice();return -1==o?i.push(r||e,t):(i[o+1]=t,r&&(i[o]=r)),new eB(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var r=this.content.slice();return r.splice(t,2),new eB(r)},addToStart:function(e,t){return new eB([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var r=this.remove(e).content.slice();return r.push(e,t),new eB(r)},addBefore:function(e,t,r){var n=this.remove(t),o=n.content.slice(),i=n.find(e);return o.splice(-1==i?o.length:i,0,t,r),new eB(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=eB.from(e)).size?new eB(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=eB.from(e)).size?new eB(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=eB.from(e);for(var r=0;r<e.content.length;r+=2)t=t.remove(e.content[r]);return t},toObject:function(){var e={};return this.forEach(function(t,r){e[t]=r}),e},get size(){return this.content.length>>1}},eB.from=function(e){if(e instanceof eB)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new eB(t)};class eV{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,r,n=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==r(a,n+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),r,n+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}
6textBetween(e,t,r,n){let o="",i=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?n?"function"==typeof n?n(s):n:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&r&&(i?i=!1:o+=r),o+=l},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,n=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(n[n.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)n.push(e.content[o]);return new eV(n,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let r=[],n=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),r.push(s),n+=s.nodeSize),i=a}return new eV(r,n)}cutByIndex(e,t){return e==t?eV.empty:0==e&&t==this.content.length?this:new eV(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let n=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return n[e]=t,new eV(n,o)}addToStart(e){return new eV([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new eV(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let n=this.content[t];e(n,r,t),r+=n.nodeSize}}findDiffStart(e,t=0){return function e(t,r,n){for(let o=0;;o++){if(o==t.childCount||o==r.childCount)return t.childCount==r.childCount?null:n;let i=t.child(o),s=r.child(o);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let e=0;i.text[e]==s.text[e];e++)n++;return n}if(i.content.size||s.content.size){let t=e(i.content,s.content,n+1);if(null!=t)return t}n+=i.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return function e(t,r,n,o){for(let i=t.childCount,s=r.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:o};let a=t.child(--i),l=r.child(--s),c=a.nodeSize;if(a==l){n-=c,o-=c;continue}if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,o--;return{a:n,b:o}}if(a.content.size||l.content.size){let t=e(a.content,l.content,n-1,o-1);if(t)return t}n-=c,o-=c}}(this,e,t,r)}findIndex(e){if(0==e)return ej(0,e);if(e==this.size)return ej(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let n=r+this.child(t).nodeSize;if(n>=e){if(n==e)return ej(t+1,n);return ej(t,r)}r=n}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return eV.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new eV(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return eV.empty;let t,r=0;for(let n=0;n<e.length;n++){let o=e[n];r+=o.nodeSize,n&&o.isText&&e[n-1].sameMarkup(o)?(t||(t=e.slice(0,n)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new eV(t||e,r)}static from(e){if(!e)return eV.empty;if(e instanceof eV)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new eV([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}eV.empty=new eV([],0);let eF={index:0,offset:0};function ej(e,t){return eF.index=e,eF.offset=t,eF}function ez(e,t){if(e===t)return!0;
vendor: 6,895 bytes, line 6
6if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let r=Array.isArray(e);if(Array.isArray(t)!=r)return!1;if(r){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!ez(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!ez(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}class e${constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let n=0;n<e.length;n++){let o=e[n];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,n));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ez(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw RangeError(`There is no mark type ${t.type} in this schema`);let n=r.create(t.attrs);return r.checkAttrs(n.attrs),n}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return e$.none;if(e instanceof e$)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}e$.none=[];class eU extends Error{}class eH{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=function e(t,r,n,o){let{index:i,offset:s}=t.findIndex(r),a=t.maybeChild(i);if(s==r||a.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,r).append(n).append(t.cut(r));let l=e(a.content,r-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}(this.content,e+this.openStart,t);return r&&new eH(r,this.openStart,this.openEnd)}removeBetween(e,t){return new eH(function e(t,r,n){let{index:o,offset:i}=t.findIndex(r),s=t.maybeChild(o),{index:a,offset:l}=t.findIndex(n);if(i==r||s.isText){if(l!=n&&!t.child(a).isText)throw RangeError("Removing non-flat range");return t.cut(0,r).append(t.cut(n))}if(o!=a)throw RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(e(s.content,r-i-1,n-i-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return eH.empty;let r=t.openStart||0,n=t.openEnd||0;if("number"!=typeof r||"number"!=typeof n)throw RangeError("Invalid input for Slice.fromJSON");return new eH(eV.fromJSON(e,t.content),r,n)}static maxOpen(e,t=!0){let r=0,n=0;for(let n=e.firstChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.firstChild)r++;for(let r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)n++;return new eH(e,r,n)}}function eK(e,t){if(!t.type.compatibleContent(e.type))throw new eU("Cannot join "+t.type.name+" onto "+e.type.name)}function eW(e,t,r){let n=e.node(r);return eK(n,t.node(r)),n}function eq(e,t){let r=t.length-1;r>=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function eJ(e,t,r,n){let o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(eq(e.nodeAfter,n),i++));for(let e=i;e<s;e++)eq(o.child(e),n);t&&t.depth==r&&t.textOffset&&eq(t.nodeBefore,n)}function eG(e,t){return e.type.checkContent(t),e.copy(t)}function eY(e,t,r){let n=[];return eJ(null,e,r,n),e.depth>r&&eq(eG(eW(e,t,r+1),eY(e,t,r+1)),n),eJ(t,null,r,n),new eV(n)}eH.empty=new eH(eV.empty,0,0);class eX{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],n=e.child(t);return r?e.child(t).cut(r):n}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],n=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)n+=r.child(t).nodeSize;return n}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return e$.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),n=e.maybeChild(t);if(!r){let e=r;r=n,n=e}let o=r.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||n&&o[i].isInSet(n.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,n=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)!1!==r[o].type.spec.inclusive||n&&r[o].isInSet(n.marks)||(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new e1(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let r=[],n=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(r.push(t,e,n+i),!s||(t=t.child(e)).isText)break;o=s-1,n+=i+1}return new eX(t,r,o)}
6static resolveCached(e,t){let r=e0.get(e);if(r)for(let e=0;e<r.elts.length;e++){let n=r.elts[e];if(n.pos==t)return n}else e0.set(e,r=new eZ);let n=r.elts[r.i]=eX.resolve(e,t);return r.i=(r.i+1)%eQ,n}}class eZ{constructor(){this.elts=[],this.i=0}}let eQ=12,e0=new WeakMap;class e1{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let e2=Object.create(null);class e3{constructor(e,t,r,n=e$.none){this.type=e,this.attrs=t,this.marks=n,this.content=r||eV.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,n=0){this.content.nodesBetween(e,t,r,n,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,n){return this.content.textBetween(e,t,r,n)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ez(this.attrs,t||e.defaultAttrs||e2)&&e$.sameSet(this.marks,r||e$.none)}copy(e=null){return e==this.content?this:new e3(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new e3(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return eH.empty;let n=this.resolve(e),o=this.resolve(t),i=r?0:n.sharedDepth(t),s=n.start(i);return new eH(n.node(i).content.cut(n.pos-s,o.pos-s),n.depth-i,o.depth-i)}replace(e,t,r){var n=this.resolve(e),o=this.resolve(t);if(r.openStart>n.depth)throw new eU("Inserted content deeper than insertion position");if(n.depth-r.openStart!=o.depth-r.openEnd)throw new eU("Inconsistent open depths");return function e(t,r,n,o){let i=t.index(o),s=t.node(o);if(i==r.index(o)&&o<t.depth-n.openStart){let a=e(t,r,n,o+1);return s.copy(s.content.replaceChild(i,a))}if(!n.content.size)return eG(s,eY(t,r,o));if(n.openStart||n.openEnd||t.depth!=o||r.depth!=o){let{start:e,end:i}=function(e,t){let r=t.depth-e.openStart,n=t.node(r).copy(e.content);for(let e=r-1;e>=0;e--)n=t.node(e).copy(eV.from(n));return{start:n.resolveNoCache(e.openStart+r),end:n.resolveNoCache(n.content.size-e.openEnd-r)}}(n,t);return eG(s,function e(t,r,n,o,i){let s=t.depth>i&&eW(t,r,i+1),a=o.depth>i&&eW(n,o,i+1),l=[];return eJ(null,t,i,l),s&&a&&r.index(i)==n.index(i)?(eK(s,a),eq(eG(s,e(t,r,n,o,i+1)),l)):(s&&eq(eG(s,eY(t,r,i+1)),l),eJ(r,n,i,l),a&&eq(eG(a,eY(n,o,i+1)),l)),eJ(o,null,i,l),new eV(l)}(t,e,i,r,o))}{let e=t.parent,o=e.content;return eG(e,o.cut(0,t.parentOffset).append(n.content).append(o.cut(r.parentOffset)))}}(n,o,r,0)}nodeAt(e){for(let t=this;;){let{index:r,offset:n}=t.content.findIndex(e);if(!(t=t.maybeChild(r)))return null;if(n==e||t.isText)return t;e-=n+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let n=this.content.child(t-1);return{node:n,index:t-1,offset:r-n.nodeSize}}resolve(e){return eX.resolveCached(this,e)}resolveNoCache(e){return eX.resolve(this,e)}rangeHasMark(e,t,r){let n=!1;return t>e&&this.nodesBetween(e,t,e=>(r.isInSet(e.marks)&&(n=!0),!n)),n}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}
6toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),e4(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=eV.empty,n=0,o=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,n,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=n;e<o;e++)if(!this.type.allowsMarks(r.child(e).marks))return!1;return!0}canReplaceWith(e,t,r,n){if(n&&!this.type.allowsMarks(n))return!1;let o=this.contentMatchAt(e).matchType(r),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=e$.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!e$.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let r;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,r)}let n=eV.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,n,r);return o.type.checkAttrs(o.attrs),o}}e3.prototype.text=void 0;class e9 extends e3{constructor(e,t,r,n){if(super(e,t,null,n),!r)throw RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):e4(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new e9(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new e9(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function e4(e,t){for(let r=e.length-1;r>=0;r--)t=e[r].type.name+"("+t+")";return t}class e5{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var r;let n,o=new e6(e,t);if(null==o.next)return e5.empty;let i=function e(t){let r=[];do r.push(function(t){let r=[];do r.push(function(t){let r=function(t){if(t.eat("(")){let r=e(t);return t.eat(")")||t.err("Missing closing paren"),r}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let r=e.nodeTypes,n=r[t];if(n)return[n];let o=[];for(let e in r){let n=r[e];n.isInGroup(t)&&o.push(n)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))r={type:"plus",expr:r};else if(t.eat("*"))r={type:"star",expr:r};else if(t.eat("?"))r={type:"opt",expr:r};
6else if(t.eat("{"))r=function(e,t){let r=e8(e),n=r;return e.eat(",")&&(n="}"!=e.next?e8(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}(t,r);else break;return r}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==r.length?r[0]:{type:"seq",exprs:r}}(t));while(t.eat("|"))return 1==r.length?r[0]:{type:"choice",exprs:r}}(o);o.next&&o.err("Unexpected trailing text");let s=(r=function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,r)=>t.concat(e(r,i)),[]);if("seq"==t.type)for(let n=0;;n++){let s=e(t.exprs[n],i);if(n==t.exprs.length-1)return s;o(s,i=r())}else if("star"==t.type){let s=r();return n(i,s),o(e(t.expr,s),s),[n(s)]}else if("plus"==t.type){let s=r();return o(e(t.expr,i),s),o(e(t.expr,s),s),[n(s)]}else if("opt"==t.type)return[n(i)].concat(e(t.expr,i));else if("range"==t.type){let s=i;for(let n=0;n<t.min;n++){let n=r();o(e(t.expr,s),n),s=n}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=r();n(s,i),o(e(t.expr,s),i),s=i}return[n(s)]}else if("name"==t.type)return[n(i,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),r()),t;function r(){return t.push([])-1}function n(e,r,n){let o={term:n,to:r};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(i),n=Object.create(null),function e(t){let o=[];t.forEach(e=>{r[e].forEach(({term:e,to:t})=>{let n;if(e){for(let t=0;t<o.length;t++)o[t][0]==e&&(n=o[t][1]);te(r,t).forEach(t=>{n||o.push([e,n=[]]),-1==n.indexOf(t)&&n.push(t)})}})});let i=n[t.join(",")]=new e5(t.indexOf(r.length-1)>-1);for(let t=0;t<o.length;t++){let r=o[t][1].sort(e7);i.next.push({type:o[t][0],next:n[r.join(",")]||e(r)})}return i}(te(r,0)));return function(e,t){for(let r=0,n=[e];r<n.length;r++){let e=n[r],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:r,next:s}=e.next[t];i.push(r.name),o&&!(r.isText||r.hasRequiredAttrs())&&(o=!1),-1==n.indexOf(s)&&n.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let n=this;for(let o=t;n&&o<r;o++)n=n.matchType(e.child(o).type);return n}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let n=[this];return function o(i,s){let a=i.matchFragment(e,r);if(a&&(!t||a.validEnd))return eV.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:r}=i.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==n.indexOf(r)){n.push(r);let e=o(r,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let n=r.shift(),o=n.match;if(o.matchType(e)){let e=[];for(let t=n;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||n.type&&!s.validEnd||(r.push({match:i.contentMatch,type:i,via:n}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(r){e.push(r);for(let n=0;n<r.next.length;n++)-1==e.indexOf(r.next[n].next)&&t(r.next[n].next)}(this),e.map((t,r)=>{let n=r+(t.validEnd?"*":" ")+" ";for(let r=0;r<t.next.length;r++)n+=(r?", ":"")+t.next[r].type.name+"->"+e.indexOf(t.next[r].next);return n}).join("\n")}}e5.empty=new e5(!0);class e6{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?
6=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function e8(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function e7(e,t){return t-e}function te(e,t){let r=[];return function t(n){let o=e[n];if(1==o.length&&!o[0].term)return t(o[0].to);r.push(n);for(let e=0;e<o.length;e++){let{term:n,to:i}=o[e];n||-1!=r.indexOf(i)||t(i)}}(t),r.sort(e7)}function tt(e){let t=Object.create(null);for(let r in e){let n=e[r];if(!n.hasDefault)return null;t[r]=n.default}return t}function tr(e,t){let r=Object.create(null);for(let n in e){let o=t&&t[n];if(void 0===o){let t=e[n];if(t.hasDefault)o=t.default;else throw RangeError("No value supplied for attribute "+n)}r[n]=o}return r}function tn(e,t,r,n){for(let n in t)if(!(n in e))throw RangeError(`Unsupported attribute ${n} for ${r} of type ${n}`);for(let r in e){let n=e[r];n.validate&&n.validate(t[r])}}function to(e,t){let r=Object.create(null);if(t)for(let n in t)r[n]=new ts(e,n,t[n]);return r}class ti{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=to(e,r.attrs),this.defaultAttrs=tt(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==e5.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:tr(this.attrs,e)}create(e=null,t,r){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new e3(this,this.computeAttrs(e),eV.from(t),e$.setFrom(r))}createChecked(e=null,t,r){return t=eV.from(t),this.checkContent(t),new e3(this,this.computeAttrs(e),t,e$.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=eV.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let n=this.contentMatch.matchFragment(t),o=n&&n.fillBefore(eV.empty,!0);return o?new e3(this,e,t.append(o),e$.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){tn(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:e$.none:e}static compile(e,t){let r=Object.create(null);e.forEach((e,n)=>r[e]=new ti(e,t,n));let n=t.spec.topNode||"doc";if(!r[n])throw RangeError("Schema is missing its top node type ('"+n+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}class ts{constructor(e,t,r){let n;this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate="string"==typeof r.validate?(n=r.validate.split("|"),r=>{let o=null===r?"null":typeof r;if(0>n.indexOf(o))throw RangeError(`Expected value of type ${n} for attribute ${t} on type ${e}, got ${o}`)}):r.validate}get isRequired(){return!this.hasDefault}}class ta{constructor(e,t,r,n){this.name=e,this.rank=t,this.schema=r,this.spec=n,this.attrs=to(e,n.attrs),this.excluded=null;let o=tt(this.attrs);this.instance=o?new e$(this,o):null}create(e=null){return!e&&this.instance?this.instance:new e$(this,tr(this.attrs,e))}static compile(e,t){let r=Object.create(null),n=0;return e.forEach((e,o)=>r[e]=new ta(e,n++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){tn(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class tl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=eB.from(e.nodes),t.marks=eB.from(e.marks||{}),this.nodes=ti.compile(this.spec.nodes,this),this.marks=ta.compile(this.spec.marks,this);let r=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],n=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=r[n]||(r[n]=e5.parse(n,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?tc(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],r=t.spec.excludes;t.excluded=null==r?[t]:""==r?[]:tc(this,r.split(" "))}this.nodeFromJSON=e=>e3.fromJSON(this,e),this.markFromJSON=e=>e$.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,n){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof ti){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,r,n)}text(e,t){let r=this.nodes.text;return new e9(r,r.defaultAttrs,e,e$.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function tc(e,t){let r=[];for(let n=0;n<t.length;n++){let o=t[n],i=e.marks[o],s=i;if(i)r.push(i);else for(let t in e.marks){let n=e.marks[t];("_"==o||n.spec.group&&n.spec.group.split(" ").indexOf(o)>-1)&&r.push(s=n)}if(!s)throw SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}class tu{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];
6t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>r.indexOf(t)&&r.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let r=e.nodes[t.node];return r.contentMatch.matchType(r)})}parse(e,t={}){let r=new tg(this,t,!1);return r.addAll(e,e$.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new tg(this,t,!0);return r.addAll(e,e$.none,t.from,t.to),eH.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){var n,o;let r=this.tags[i];if(n=e,o=r.tag,(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,o)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}matchStyle(e,t,r,n){for(let o=n?this.styles.indexOf(n)+1:0;o<this.styles.length;o++){let n=this.styles[o],i=n.style;if(0==i.indexOf(e)&&(!n.context||r.matchesContext(n.context))&&(!(i.length>e.length)||61==i.charCodeAt(e.length)&&i.slice(e.length+1)==t)){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}static schemaRules(e){let t=[];function r(e){let r=null==e.priority?50:e.priority,n=0;for(;n<t.length;n++){let e=t[n];if((null==e.priority?50:e.priority)<r)break}t.splice(n,0,e)}for(let t in e.marks){let n=e.marks[t].spec.parseDOM;n&&n.forEach(e=>{r(e=ty(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let n=e.nodes[t].spec.parseDOM;n&&n.forEach(e=>{r(e=ty(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new tu(e,tu.schemaRules(e)))}}let td={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},th={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},tp={ol:!0,ul:!0};function tf(e,t,r){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&r}class tm{constructor(e,t,r,n,o,i){this.type=e,this.attrs=t,this.marks=r,this.solid=n,this.options=i,this.content=[],this.activeMarks=e$.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(eV.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,r;return(r=t.findWrapping(e.type))?(this.match=t,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=eV.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(eV.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!td.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class tg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let n=t.topNode,o,i=tf(null,t.preserveWhitespace,0)|4*!!r;o=n?new tm(n.type,n.attrs,e$.none,!0,t.topMatch||n.type.contentMatch,i):r?new tm(null,null,e$.none,!0,null,i):new tm(e.schema.topNodeType,null,e$.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,n=this.top,o=2&n.options?"full":this.localPreserveWS||(1&n.options)>0,{schema:i}=this.parser;if("full"===o||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if("full"===o)r=r.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=r.split(/\r?\n|\r/);for(let r=0;r<e.length;r++)r&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[r]&&this.insertNode(i.text(e[r]),t,!/\S/.test(e[r]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let t=n.content[n.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let n=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),s;tp.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,r=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;
vendor: 5,103 bytes, line 6
6e&&tp.hasOwnProperty(e)&&r?(r.appendChild(t),t=r):"li"==e?r=t:e&&(r=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));e:if(a?a.ignore:th.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let r,n=this.needsBlock;if(td.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=a&&a.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),r&&this.sync(o),this.needsBlock=n}else{let r=this.readStyles(e,t);r&&this.addElementByRule(e,a,r,!1===a.consuming?s:void 0)}this.localPreserveWS=n}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let n=this.parser.matchedStyles[e],o=r.getPropertyValue(n);if(o)for(let e;;){let r=this.parser.matchStyle(n,o,this,e);if(!r)break;if(r.ignore)return null;if(t=r.clearMark?t.filter(e=>!r.clearMark(e)):t.concat(this.parser.schema.marks[r.mark].create(r.attrs)),!1===r.consuming)e=r;else break}}return t}addElementByRule(e,t,r,n){let o,i;if(t.node)if((i=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(i.create(t.attrs),r,"BR"==e.nodeName)||this.leafFallback(e,r);else{let e=this.enter(i,t.attrs||null,r,t.preserveWhitespace);e&&(o=!0,r=e)}else{let e=this.parser.schema.marks[t.mark];r=r.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,r,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,r,!1));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n,r),this.findAround(e,n,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,r,n){let o=r||0;for(let i=r?e.childNodes[r]:e.firstChild,s=null==n?null:e.childNodes[n];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,r){let n,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!n||n.length>a.length+i)&&(n=a,o=s,!a.length))break;if(s.solid){if(r)break;i+=2}}if(!n)return null;this.sync(o);for(let e=0;e<n.length;e++)t=this.enterInner(n[e],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let n=this.findPlace(e,t,r);if(n){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let r=e$.none;for(let o of n.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):tv(o.type,e.type))&&(r=o.addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r,n){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,n)),o}enterInner(e,t,r,n=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=tf(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=e$.none;return r=r.filter(t=>(i.type?!i.type.allowsMarkType(t.type):!tv(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new tm(e,t,a,n,null,s)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let t=r.length-1;t>=0;t--)e+=r[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==e.nodeType&&e.contains(this.find[n].node)&&t.compareDocumentPosition(this.find[n].node)&(r?2:4)&&(this.find[n].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,n=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+ +!n,i=(e,s)=>{for(;e>=0;e--){let a=t[e];
6if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&n?this.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function ty(e){let t={};for(let r in e)t[r]=e[r];return t}function tv(e,t){let r=t.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let r=0;r<e.edgeCount;r++){let{type:n,next:o}=e.edge(r);if(n==t||0>i.indexOf(o)&&s(o))return!0}};if(s(o.contentMatch))return!0}}class tb{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=tx(t).createDocumentFragment());let n=r,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let r=0,i=0;for(;r<o.length&&i<e.marks.length;){let t=e.marks[i];if(!this.marks[t.type.name]){i++;continue}if(!t.eq(o[r][0])||!1===t.type.spec.spanning)break;r++,i++}for(;r<o.length;)n=o.pop()[1];for(;i<e.marks.length;){let r=e.marks[i++],s=this.serializeMark(r,e.isInline,t);s&&(o.push([r,n]),n.appendChild(s.dom),n=s.contentDOM||s.dom)}}n.appendChild(this.serializeNodeInner(e,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:n}=tk(tx(t),this.nodes[e.type.name](e),null,e.attrs);if(n){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,n)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let n=e.marks.length-1;n>=0;n--){let o=this.serializeMark(e.marks[n],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let n=this.marks[e.type.name];return n&&tk(tx(r),n(e,t),null,e.attrs)}static renderSpec(e,t,r=null,n){return tk(e,t,r,n)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new tb(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=tw(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return tw(e.marks)}}function tw(e){let t={};for(let r in e){let n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function tx(e){return e.document||window.document}let tS=new WeakMap;function tk(e,t,r,n){let o,i,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let a=t[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(n&&(void 0===(i=tS.get(n))&&tS.set(n,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let r=0;r<t.length;r++)e(t[r]);else for(let r in t)e(t[r])}(n),i=s)),l=i)&&l.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=a.indexOf(" ");c>0&&(r=a.slice(0,c),a=a.slice(c+1));let u=r?e.createElementNS(r,a):e.createElement(a),d=t[1],h=1;if(d&&"object"==typeof d&&null==d.nodeType&&!Array.isArray(d)){for(let e in h=2,d)if(null!=d[e]){let t=e.indexOf(" ");t>0?u.setAttributeNS(e.slice(0,t),e.slice(t+1),d[e]):"style"==e&&u.style?u.style.cssText=d[e]:u.setAttribute(e,d[e])}}for(let i=h;i<t.length;i++){let s=t[i];if(0===s){if(i<t.length-1||i>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}{let{dom:t,contentDOM:i}=tk(e,s,r,n);if(u.appendChild(t),i){if(o)throw RangeError("Multiple content holes");o=i}}}return{dom:u,contentDOM:o}}e.s(["p",0,tu,"h",0,tb,"y",0,eV,"H",0,e$,"M",0,ta,"$",0,e3,"z",0,e1,"Q",0,ti,"A",0,eU,"o",0,eX,"B",0,tl,"k",0,eH],711379);class tE{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class tC{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&tC.empty)return tC.empty}recover(e){let t=0,r=65535&e;if(!this.inverted)for(let e=0;e<r;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*r]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let n=0,o=this.inverted?2:1,i=this.inverted?1:2;
vendor: 6,601 bytes, line 6
6for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?n:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],u=a+l;if(e<=u){let o=l?e==a?-1:e==u?1:t:t,i=a+n+(o<0?0:c);if(r)return i;let d=e==(t<0?a:u)?null:s/3+(e-a)*65536,h=e==a?2:e==u?1:4;return(t<0?e!=a:e!=u)&&(h|=8),new tE(i,h,d)}n+=c-l}return r?e+n:new tE(e+n,0,null)}touches(e,t){let r=0,n=65535&t,o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?r:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*n)return!0;r+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let n=0,o=0;n<this.ranges.length;n+=3){let i=this.ranges[n],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[n+t],c=this.ranges[n+r];e(s,s+l,a,a+c),o+=c-l}}invert(){return new tC(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?tC.empty:new tC(e<0?[0,-e,0]:[0,0,e])}}tC.empty=new tC([]);class tO{constructor(e,t,r=0,n=e?e.length:0){this.mirror=t,this.from=r,this.to=n,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new tO(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let n=e.getMirror(t);this.appendMap(e._maps[t],null!=n&&n<t?r+n:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let n=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=n&&n>t?r-n-1:void 0)}}invert(){let e=new tO;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let n=0;for(let r=this.from;r<this.to;r++){let o=this._maps[r].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(r);if(null!=t&&t>r&&t<this.to){r=t,e=this._maps[t].recover(o.recover);continue}}n|=o.delInfo,e=o.pos}return r?e:new tE(e,n,null)}}let tM=Object.create(null);class tT{getMap(){return tC.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let r=tM[t.stepType];if(!r)throw RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in tM)throw RangeError("Duplicate use of step JSON ID "+e);return tM[e]=t,t.prototype.jsonID=e,t}}class tN{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new tN(e,null)}static fail(e){return new tN(null,e)}static fromReplace(e,t,r,n){try{return tN.ok(e.replace(t,r,n))}catch(e){if(e instanceof eU)return tN.fail(e.message);throw e}}}function tA(e,t,r){let n=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(tA(i.content,t,i))),i.isInline&&(i=t(i,r,o)),n.push(i)}return eV.fromArray(n)}class t_ extends tT{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),n=r.node(r.sharedDepth(this.to)),o=new eH(tA(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,n),t.openStart,t.openEnd);return tN.fromReplace(e,this.from,this.to,o)}invert(){return new tR(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new t_(t.pos,r.pos,this.mark)}merge(e){return e instanceof t_&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t_(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new t_(t.from,t.to,e.markFromJSON(t.mark))}}tT.jsonID("addMark",t_);class tR extends tT{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new eH(tA(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return tN.fromReplace(e,this.from,this.to,r)}invert(){return new t_(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new tR(t.pos,r.pos,this.mark)}merge(e){return e instanceof tR&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tR(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tR(t.from,t.to,e.markFromJSON(t.mark))}}tT.jsonID("removeMark",tR);class tD extends tT{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tN.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return tN.fromReplace(e,this.pos,this.pos+1,new eH(eV.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let r=0;r<t.marks.length;r++)if(!t.marks[r].isInSet(e))return new tD(this.pos,t.marks[r]);return new tD(this.pos,this.mark)}}return new tP(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new tD(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new tD(t.pos,e.markFromJSON(t.mark))}}tT.jsonID("addNodeMark",tD);class tP extends tT{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return tN.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return tN.fromReplace(e,this.pos,this.pos+1,new eH(eV.from(r),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new tD(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new tP(t.pos,this.mark)}
6toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new tP(t.pos,e.markFromJSON(t.mark))}}tT.jsonID("removeNodeMark",tP);class tI extends tT{constructor(e,t,r,n=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=n}apply(e){return this.structure&&tB(e,this.from,this.to)?tN.fail("Structure replace would overwrite content"):tN.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new tC([this.from,this.to-this.from,this.slice.size])}invert(e){return new tI(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&tI.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new tI(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof tI)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?eH.empty:new eH(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new tI(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?eH.empty:new eH(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new tI(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new tI(t.from,t.to,eH.fromJSON(e,t.slice),!!t.structure)}}
vendor: 17,234 bytes, line 6
6tI.MAP_BIAS=1,tT.jsonID("replace",tI);class tL extends tT{constructor(e,t,r,n,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=n,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(tB(e,this.from,this.gapFrom)||tB(e,this.gapTo,this.to)))return tN.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return tN.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?tN.fromReplace(e,this.from,this.to,r):tN.fail("Content does not fit in gap")}getMap(){return new tC([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new tL(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),n=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||n<t.pos||o>r.pos?null:new tL(t.pos,r.pos,n,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tL(t.from,t.to,t.gapFrom,t.gapTo,eH.fromJSON(e,t.slice),t.insert,!!t.structure)}}function tB(e,t,r){let n=e.resolve(t),o=r-t,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let e=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function tV(e,t,r,n=r.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,u=n.matchType(l.type);if(u){n=u;for(let t=0;t<l.marks.length;t++)r.allowsMarkType(l.marks[t].type)||e.step(new tR(a,c,l.marks[t]));if(o&&l.isText&&"pre"!=r.whitespace){let e,t=/\r?\n|\r/g,n;for(;e=t.exec(l.text);)n||(n=new eH(eV.from(r.schema.text(" ",r.allowedMarks(l.marks))),0,0)),s.push(new tI(a+e.index,a+e.index+e[0].length,n))}}else s.push(new tI(a,c,eH.empty));a=c}if(!n.validEnd){let t=n.fillBefore(eV.empty,!0);e.replace(a,a,new eH(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function tF(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,n=0,o=0;;--r){let i=e.$from.node(r),s=e.$from.index(r)+n,a=e.$to.indexAfter(r)-o;if(r<e.depth&&i.canReplace(s,a,t))return r;if(0==r||i.type.spec.isolating||!((0==s||i.canReplace(s,i.childCount))&&(a==i.childCount||i.canReplace(0,a))))break;s&&(n=1),a<i.childCount&&(o=1)}return null}function tj(e,t,r=null,n=e){let o=function(e,t){let{parent:r,startIndex:n,endIndex:o}=e,i=r.contentMatchAt(n).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return r.canReplaceWith(n,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:r,startIndex:n,endIndex:o}=e,i=r.child(n),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=n;a&&e<o;e++)a=a.matchType(r.child(e).type);return a&&a.validEnd?s:null}(n,t);return i?o.map(tz).concat({type:t,attrs:r}).concat(i.map(tz)):null}function tz(e){return{type:e,attrs:null}}function t$(e,t,r,n){t.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=e.mapping.slice(n).map(r+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function tU(e,t,r,n){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(n).map(r+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function tH(e,t,r=1,n){let o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=r-2;e>i;e--,t--){let r=o.node(e),i=o.index(e);if(r.type.spec.isolating)return!1;let s=r.content.cutByIndex(i,r.childCount),a=n&&n[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=n&&n[t]||r;if(!r.canReplace(i+1,r.childCount)||!l.type.validContent(s))return!1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function tK(e,t){let r=e.resolve(t),n=r.index();return tW(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function tW(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let r=e.contentMatchAt(e.childCount),{linebreakReplacement:n}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==n?e.type.schema.nodes.text:i.type;if(!(r=r.matchType(s))||!e.type.allowsMarks(i.marks))return!1}return r.validEnd}(e,t))}function tq(e,t,r){let n=e.resolve(t);if(!r.content.size)return t;let o=r.content;for(let e=0;e<r.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==r.openStart&&r.size?2:1);e++)for(let t=n.depth;t>=0;t--){let r=t==n.depth?0:n.pos<=(n.start(t+1)+n.end(t+1))/2?-1:1,i=n.index(t)+ +(r>0),s=n.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==r?n.pos:r<0?n.before(t+1):n.after(t+1)}return null}function tJ(e,t,r=t,n=eH.empty){if(t==r&&!n.size)return null;let o=e.resolve(t),i=e.resolve(r);return tG(o,i,n)?new tI(t,r,n):new tY(o,i,n).fit()}function tG(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}tT.jsonID("replaceAround",tL);class tY{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=eV.empty;for(let t=0;t<=e.depth;t++){let r=e.node(t);this.frontier.push({type:r.type,match:r.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=eV.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,n=this.close(e<0?this.$to:r.doc.resolve(e));if(!n)return null;let o=this.placed,i=r.depth,s=n.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new eH(o,i,s);return e>-1?new tL(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new tI(r.pos,n.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,n=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(n=0),o.type.spec.isolating&&n<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=1==t?e:this.unplaced.openStart;r>=0;r--){let e=null,n=(r?(e=tQ(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:i,match:s}=this.frontier[o],a,l=null;if(1==t&&(n?s.matchType(n.type)||(l=s.fillBefore(eV.from(n),!1)):e&&i.compatibleContent(e.type)))return{sliceDepth:r,frontierDepth:o,parent:e,inject:l};if(2==t&&n&&(a=s.findWrapping(n.type)))return{sliceDepth:r,frontierDepth:o,parent:e,wrap:a};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=tQ(e,t);return!!n.childCount&&!n.firstChild.isLeaf&&(this.unplaced=new eH(e,t+1,Math.max(r,n.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,n=tQ(e,t);if(n.childCount<=1&&t>0){let o=e.size-t<=t+n.size;this.unplaced=new eH(tX(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new eH(tX(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:n,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=r?r.content:i.content,a=i.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(n){for(let e=0;e<n.childCount;e++)c.push(n.child(e));u=u.matchFragment(n)}let h=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=u.matchType(e.type);if(!t)break;(++l>1||0==a||e.content.size)&&(u=t,c.push(function e(t,r,n){if(r<=0)return t;let o=t.content;return r>1&&(o=o.replaceChild(0,e(o.firstChild,r-1,1==o.childCount?n-1:0))),r>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(eV.empty,!0)))),t.copy(o)}(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=tZ(this.placed,t,eV.from(c)),this.frontier[t].match=u,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?eH.empty:new eH(tX(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new eH(tX(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!t0(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:r}=this.$to,n=this.$to.after(r);for(;r>1&&n==this.$to.end(--r);)++n;return n}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:n}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=t0(e,t,n,r,o);if(i){for(let r=t-1;r>=0;r--){let{match:t,type:n}=this.frontier[r],o=t0(e,r,n,t,!0);if(!o||o.childCount)continue t}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=tZ(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let t=e.node(r),n=t.type.contentMatch.fillBefore(t.content,!0,e.index(r));this.openFrontierNode(t.type,t.attrs,n)}return e}openFrontierNode(e,t=null,r){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=tZ(this.placed,this.depth,eV.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(eV.empty,!0);e.childCount&&(this.placed=tZ(this.placed,this.frontier.length,e))}}function tX(e,t,r){return 0==t?e.cutByIndex(r,e.childCount):e.replaceChild(0,e.firstChild.copy(tX(e.firstChild.content,t-1,r)))}function tZ(e,t,r){return 0==t?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(tZ(e.lastChild.content,t-1,r)))}function tQ(e,t){for(let r=0;r<t;r++)e=e.firstChild.content;return e}function t0(e,t,r,n,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!function(e,t,r){for(let n=r;n<t.childCount;n++)if(!e.allowsMarks(t.child(n).marks))return!0;return!1}(r,i.content,s)?a:null}function t1(e,t){let r=[],n=Math.min(e.depth,t.depth);for(let o=n;o>=0;o--){let n=e.start(o);if(n<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(n==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==n-1)&&r.push(o)}return r}class t2 extends tT{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return tN.fail("No node at attribute step's position");let r=Object.create(null);for(let e in t.attrs)r[e]=t.attrs[e];r[this.attr]=this.value;let n=t.type.create(r,null,t.marks);return tN.fromReplace(e,this.pos,this.pos+1,new eH(eV.from(n),0,+!t.isLeaf))}getMap(){return tC.empty}invert(e){return new t2(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new t2(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new t2(t.pos,t.attr,t.value)}}tT.jsonID("attr",t2);class t3 extends tT{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return tN.ok(r)}getMap(){return tC.empty}invert(e){return new t3(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new t3(t.attr,t.value)}}tT.jsonID("docAttr",t3);let t9=class extends Error{};(t9=function e(t){let r=Error.call(this,t);return r.__proto__=e.prototype,r}).prototype=Object.create(Error.prototype),t9.prototype.constructor=t9,t9.prototype.name="TransformError";class t4{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tO}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new t9(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let n=this.mapping.maps[r];r&&(e=n.map(e,1),t=n.map(t,-1)),n.forEach((r,n,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=eH.empty){let n=tJ(this.doc,e,t,r);return n&&this.step(n),this}replaceWith(e,t,r){return this.replace(e,t,new eH(eV.from(r),0,0))}delete(e,t){return this.replace(e,t,eH.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return!function(e,t,r,n){if(!n.size)return e.deleteRange(t,r);let o=e.doc.resolve(t),i=e.doc.resolve(r);if(tG(o,i,n))return e.step(new tI(t,r,n));let s=t1(o,i);0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let r=o.node(e).type.spec;if(r.defining||r.definingAsContext||r.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],u=n.openStart;for(let e=n.content,t=0;;t++){let r=e.firstChild;if(c.push(r),t==n.openStart)break;e=r.content}for(let e=u-1;e>=0;e--){var d;let t=c[e],r=(d=t.type).spec.defining||d.spec.definingForContent;if(r&&!t.sameMarkup(o.node(Math.abs(a)-1)))u=e;else if(r||!t.type.isTextblock)break}for(let t=n.openStart;t>=0;t--){let a=(t+u+1)%(n.openStart+1),d=c[a];if(d)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],u=!0;c<0&&(u=!1,c=-c);let h=o.node(c-1),p=o.index(c-1);if(h.canReplaceWith(p,p,d.type,d.marks))return e.replace(o.before(c),u?i.after(c):r,new eH(function e(t,r,n,o,i){if(r<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(e(i.content,r+1,n,o,i)))}if(r>o){let e=i.contentMatchAt(0),r=e.fillBefore(t).append(t);t=r.append(e.matchFragment(r).fillBefore(eV.empty,!0))}return t}(n.content,0,n.openStart,a),a,n.openEnd))}}let h=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,r,n),!(e.steps.length>h));a--){let e=s[a];e<0||(t=o.before(e),r=i.after(e))}}(this,e,t,r),this}replaceRangeWith(e,t,r){var n=e,o=t;if(!r.isInline&&n==o&&this.doc.resolve(n).parent.content.size){let e=function(e,t,r){let n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(0==n.parentOffset)for(let e=n.depth-1;e>=0;e--){let t=n.index(e);if(n.node(e).canReplaceWith(t,t,r))return n.before(e+1);if(t>0)return null}if(n.parentOffset==n.parent.content.size)for(let e=n.depth-1;e>=0;e--){let t=n.indexAfter(e);if(n.node(e).canReplaceWith(t,t,r))return n.after(e+1);if(t<n.node(e).childCount)break}return null}(this.doc,n,r.type);null!=e&&(n=o=e)}return this.replaceRange(n,o,new eH(eV.from(r),0,0)),this}deleteRange(e,t){return!function(e,t,r){let n=e.doc.resolve(t),o=e.doc.resolve(r);if(n.parent.isTextblock&&o.parent.isTextblock&&n.start()!=o.start()&&0==n.parentOffset&&0==o.parentOffset){let i=n.sharedDepth(r),s=!1;for(let e=n.depth;e>i;e--)n.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=n.depth;e>0&&t==n.start(e);e--)t=n.before(e);for(let e=o.depth;e>0&&r==o.start(e);e--)r=o.before(e);n=e.doc.resolve(t),o=e.doc.resolve(r)}}let i=t1(n,o);for(let t=0;t<i.length;t++){let r=i[t],s=t==i.length-1;if(s&&0==r||n.node(r).type.contentMatch.validEnd)return e.delete(n.start(r),o.end(r));if(r>0&&(s||n.node(r-1).canReplace(n.index(r-1),o.indexAfter(r-1))))return e.delete(n.before(r),o.after(r))}for(let i=1;i<=n.depth&&i<=o.depth;i++)if(t-n.start(i)==n.depth-i&&r>n.end(i)&&o.end(i)-r!=o.depth-i&&n.start(i-1)==o.start(i-1)&&n.node(i-1).canReplace(n.index(i-1),o.index(i-1)))return e.delete(n.before(i),r);e.delete(t,r)}(this,e,t),this}lift(e,t){return!function(e,t,r){let{$from:n,$to:o,depth:i}=t,s=n.before(i+1),a=o.after(i+1),l=s,c=a,u=eV.empty,d=0;for(let e=i,t=!1;e>r;e--)t||n.index(e)>
60?(t=!0,u=eV.from(n.node(e).copy(u)),d++):l--;let h=eV.empty,p=0;for(let e=i,t=!1;e>r;e--)t||o.after(e+1)<o.end(e)?(t=!0,h=eV.from(o.node(e).copy(h)),p++):c++;e.step(new tL(l,c,s,a,new eH(u.append(h),d,p),u.size-d,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,r){let n=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-r),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?n=!1:!e&&t&&(n=!0)}let a=e.steps.length;if(!1===n){let n=e.doc.resolve(t+r);tU(e,n.node(),n.before(),a)}s.inlineContent&&tV(e,t+r-1,s,i.node().contentMatchAt(i.index()),null==n);let l=e.mapping.slice(a),c=l.map(t-r);if(e.step(new tI(c,l.map(t+r,-1),eH.empty,!0)),!0===n){let t=e.doc.resolve(c);t$(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,r){let n=eV.empty;for(let e=r.length-1;e>=0;e--){if(n.size){let t=r[e].type.contentMatch.matchFragment(n);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=eV.from(r[e].type.create(r[e].attrs,n))}let o=t.start,i=t.end;e.step(new tL(o,i,o,i,new eH(n,0,0),r.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,n=null){var o=this;if(!r.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let i=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var s,a,l;let c,u,d="function"==typeof n?n(e):n;if(e.isTextblock&&!e.hasMarkup(r,d)&&(s=o.doc,a=o.mapping.slice(i).map(t),l=r,u=(c=s.resolve(a)).index(),c.parent.canReplaceWith(u,u+1,l))){let n=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?n=!1:!e&&t&&(n=!0)}!1===n&&tU(o,e,t,i),tV(o,o.mapping.slice(i).map(t,1),r,void 0,null===n);let s=o.mapping.slice(i),a=s.map(t,1),l=s.map(t+e.nodeSize,1);return o.step(new tL(a,l,a+1,l-1,new eH(eV.from(r.create(d,null,e.marks)),0,0),1,!0)),!0===n&&t$(o,e,t,i),!1}}),this}setNodeMarkup(e,t,r=null,n){return!function(e,t,r,n,o){let i=e.doc.nodeAt(t);if(!i)throw RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!r.validContent(i.content))throw RangeError("Invalid content for node type "+r.name);e.step(new tL(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new eH(eV.from(s),0,0),1,!0))}(this,e,t,r,n),this}setNodeAttribute(e,t,r){return this.step(new t2(e,t,r)),this}setDocAttribute(e,t){return this.step(new t3(e,t)),this}addNodeMark(e,t){return this.step(new tD(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw RangeError("No node at position "+e);if(t instanceof e$)t.isInSet(r.marks)&&this.step(new tP(e,t));else{let n=r.marks,o,i=[];for(;o=t.isInSet(n);)i.push(new tP(e,o)),n=o.removeFromSet(n);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,r){return!function(e,t,r=1,n){let o=e.doc.resolve(t),i=eV.empty,s=eV.empty;for(let e=o.depth,t=o.depth-r,a=r-1;e>t;e--,a--){i=eV.from(o.node(e).copy(i));let t=n&&n[a];s=eV.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new tI(t,t,new eH(i.append(s),r,r),!0))}(this,e,t,r),this}addMark(e,t,r){var n;let o,i,s,a;return n=this,s=[],a=[],n.doc.nodesBetween(e,t,(n,l,c)=>{if(!n.isInline)return;let u=n.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,e),d=Math.min(l+n.nodeSize,t),h=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(h)||(o&&o.to==c&&o.mark.eq(u[e])?o.to=d:s.push(o=new tR(c,d,u[e])));i&&i.to==c?i.to=d:a.push(i=new t_(c,d,r))}}),s.forEach(e=>n.step(e)),a.forEach(e=>n.step(e)),this}removeMark(e,t,r){var n;let o,i;return n=this,o=[],i=0,n.doc.nodesBetween(e,t,(n,s)=>{if(!n.isInline)return;i++;let a=null;if(r instanceof ta){let e=n.marks,t;for(;t=r.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else r?r.isInSet(n.marks)&&(a=[r]):a=n.marks;if(a&&a.length){let r=Math.min(s+n.nodeSize,t);for(let t=0;t<a.length;t++){let n=a[t],l;for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&n.eq(o[e].style)&&(l=t)}l?(l.to=r,l.step=i):o.push({style:n,from:Math.max(s,e),to:r,step:i})}}}
6),o.forEach(e=>n.step(new tR(e.from,e.to,e.style))),this}clearIncompatible(e,t,r){return tV(this,e,t,r),this}}e.s(["x",0,t_,"l",0,tO,"u",0,tR,"w",0,tL,"z",0,tI,"Z",0,tT,"r",0,tN,"h",0,t4,"n",0,tK,"J",0,tH,"s",0,tq,"H",0,tj,"y",0,function(e,t,r=-1){let n=e.resolve(t);for(let e=n.depth;;e--){let o,i,s=n.index(e);if(e==n.depth?(o=n.nodeBefore,i=n.nodeAfter):r>0?(o=n.node(e+1),s++,i=n.node(e).maybeChild(s)):(o=n.node(e).maybeChild(s-1),i=n.node(e+1)),o&&!o.isTextblock&&tW(o,i)&&n.node(e).canReplace(s,s+1))return t;if(0==e)break;t=r<0?n.before(e):n.after(e)}},"j",0,tF,"e",0,tJ],713249);let t5=Object.create(null);class t6{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new t8(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=eH.empty){let r=t.content.lastChild,n=null;for(let e=0;e<t.openEnd;e++)n=r,r=r.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?eH.empty:t),0==s&&rl(e,o,(r?r.isInline:n&&n.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,n=this.ranges;for(let o=0;o<n.length;o++){let{$from:i,$to:s}=n[o],a=e.mapping.slice(r),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),rl(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let n=e.parent.inlineContent?new rt(e):ra(e.node(0),e.parent,e.pos,e.index(),t,r);if(n)return n;for(let n=e.depth-1;n>=0;n--){let o=t<0?ra(e.node(0),e.node(n),e.before(n+1),e.index(n),t,r):ra(e.node(0),e.node(n),e.after(n+1),e.index(n)+1,t,r);if(o)return o}return null}
vendor: 6,659 bytes, line 6
6static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ri(e.node(0))}static atStart(e){return ra(e,e,0,0,1)||new ri(e)}static atEnd(e){return ra(e,e,e.content.size,e.childCount,-1)||new ri(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let r=t5[t.type];if(!r)throw RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in t5)throw RangeError("Duplicate use of selection JSON ID "+e);return t5[e]=t,t.prototype.jsonID=e,t}getBookmark(){return rt.between(this.$anchor,this.$head).getBookmark()}}t6.prototype.visible=!0;class t8{constructor(e,t){this.$from=e,this.$to=t}}let t7=!1;function re(e){t7||e.parent.inlineContent||(t7=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class rt extends t6{constructor(e,t=e){re(e),re(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return t6.near(r);let n=e.resolve(t.map(this.anchor));return new rt(n.parent.inlineContent?n:r,r)}replace(e,t=eH.empty){if(super.replace(e,t),t==eH.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof rt&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new rr(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new rt(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let n=e.resolve(t);return new this(n,r==t?n:e.resolve(r))}static between(e,t,r){let n=e.pos-t.pos;if((!r||n)&&(r=n>=0?1:-1),!t.parent.inlineContent){let e=t6.findFrom(t,r,!0)||t6.findFrom(t,-r,!0);if(!e)return t6.near(t,r);t=e.$head}return e.parent.inlineContent||(0==n?e=t:(e=(t6.findFrom(e,-r,!0)||t6.findFrom(e,r,!0)).$anchor).pos<t.pos!=n<0&&(e=t)),new rt(e,t)}}t6.jsonID("text",rt);class rr{constructor(e,t){this.anchor=e,this.head=t}map(e){return new rr(e.map(this.anchor),e.map(this.head))}resolve(e){return rt.between(e.resolve(this.anchor),e.resolve(this.head))}}class rn extends t6{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:n}=t.mapResult(this.anchor),o=e.resolve(n);return r?t6.near(o):new rn(o)}content(){return new eH(eV.from(this.node),0,0)}eq(e){return e instanceof rn&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ro(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new rn(e.resolve(t.anchor))}static create(e,t){return new rn(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}rn.prototype.visible=!1,t6.jsonID("node",rn);class ro{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new rr(r,r):new ro(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&rn.isSelectable(r)?new rn(t):t6.near(t)}}class ri extends t6{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=eH.empty){if(t==eH.empty){e.delete(0,e.doc.content.size);let t=t6.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new ri(e)}map(e){return new ri(e)}eq(e){return e instanceof ri}getBookmark(){return rs}}t6.jsonID("all",ri);let rs={map(){return this},resolve:e=>new ri(e)};function ra(e,t,r,n,o,i=!1){if(t.inlineContent)return rt.create(e,r);for(let s=n-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let n=t.child(s);if(n.isAtom){if(!i&&rn.isSelectable(n))return rn.create(e,r-(o<0?n.nodeSize:0))}else{let t=ra(e,n,r+o,o<0?n.childCount:0,o,i);if(t)return t}r+=n.nodeSize*o}return null}function rl(e,t,r){let n,o=e.steps.length-1;if(o<t)return;let i=e.steps[o];(i instanceof tI||i instanceof tL)&&(e.mapping.maps[o].forEach((e,t,r,o)=>{null==n&&(n=o)}),e.setSelection(t6.near(e.doc.resolve(n),r)))}class rc extends t4{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return e$.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||e$.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let n=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(n.text(e),!0):this.deleteSelection();{if(null==r&&(r=t),!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=r==t?e.marks():e.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,n.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(t6.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ru(e,t){return t&&e?e.bind(t):e}class rd{constructor(e,t,r){this.name=e,this.init=ru(t.init,r),this.apply=ru(t.apply,r)}}let rh=[new rd("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new rd("selection",{init:(e,t)=>
6e.selection||t6.atStart(t.doc),apply:e=>e.selection}),new rd("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,r,n)=>n.selection.$cursor?e.storedMarks:null}),new rd("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class rp{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rh.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new rd(e.key,e.spec.state,e))})}}class rf{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let t=this.config.plugins[r];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),n=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=n?n[i].n:0,l=n?n[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,r);if(c&&r.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!n){n=[];for(let e=0;e<this.config.plugins.length;e++)n.push(e<i?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}n&&(n[i]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new rf(this.config),r=this.config.fields;for(let n=0;n<r.length;n++){let o=r[n];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new rc(this)}static create(e){let t=new rp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new rf(t);for(let n=0;n<t.fields.length;n++)r[t.fields[n].name]=t.fields[n].init(e,r);return r}reconfigure(e){let t=new rp(this.schema,e.plugins),r=t.fields,n=new rf(t);for(let t=0;t<r.length;t++){let o=r[t].name;n[o]=this.hasOwnProperty(o)?this[o]:r[t].init(e,n)}return n}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let r in e){if("doc"==r||"selection"==r)throw RangeError("The JSON fields `doc` and `selection` are reserved");let n=e[r],o=n.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(n,this[n.key]))}return t}static fromJSON(e,t,r){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let n=new rp(e.schema,e.plugins),o=new rf(n);return n.fields.forEach(n=>{if("doc"==n.name)o.doc=e3.fromJSON(e.schema,t.doc);else if("selection"==n.name)o.selection=t6.fromJSON(o.doc,t.selection);else if("storedMarks"==n.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let i in r){let s=r[i],a=s.spec.state;if(s.key==n.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,i)){o[n.name]=a.fromJSON.call(s,e,t[i],o);return}}o[n.name]=n.init(e,o)}}),o}}class rm{constructor(e){this.spec=e,this.props={},e.props&&function e(t,r,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(r):"handleDOMEvents"==o&&(i=e(i,r,{})),n[o]=i}return n}(e.props,this,this.props),this.key=e.key?e.key.key:ry("plugin")}getState(e){return e[this.key]}}let rg=Object.create(null);function ry(e){return e in rg?e+"$"+ ++rg[e]:(rg[e]=0,e+"$")}class rv{constructor(e="key"){this.key=ry(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}function rb(){return"u">typeof document?document:null}e.s(["i",0,ri,"j",0,rf,"C",0,rn,"x",0,rm,"p",0,rv,"e",0,t6,"D",0,t8,"k",0,rt,"t",0,rc],237336);var rw=F;e.s(["omit",()=>rw.default],73923);var rw=F;e.i(131449);var rx=Object.freeze({__proto__:null,COPY_DESCRIPTION:{id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},COPY_LABEL:{id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},CUT_DESCRIPTION:{id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},CUT_LABEL:{id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},PASTE_DESCRIPTION:{id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},PASTE_LABEL:{id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},SELECT_ALL_DESCRIPTION:{id:"extension.command.select-all.description",message:"Select all c
6ontent within the editor",comment:"Description for select all command."},SELECT_ALL_LABEL:{id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."}}),rS=Object.freeze({__proto__:null,ALT_KEY:{id:"keyboard.shortcut.alt",message:"Alt",comment:"Label for alt key in shortcuts."},ARROW_DOWN_KEY:{id:"keyboard.shortcut.arrowDown",message:"Arrow Down",comment:"Label for arrowDown key in shortcuts."},ARROW_LEFT_KEY:{id:"keyboard.shortcut.arrowLeft",message:"Arrow Left",comment:"Label for arrow left key in shortcuts."},ARROW_RIGHT_KEY:{id:"keyboard.shortcut.arrowRight",message:"Arrow Right",comment:"Label for arrow right key in shortcuts."},ARROW_UP_KEY:{id:"keyboard.shortcut.arrowUp",message:"Arrow Up",comment:"Label for arrow up key in shortcuts."},BACKSPACE_KEY:{id:"keyboard.shortcut.backspace",message:"Backspace",comment:"Label for backspace key in shortcuts."},CAPS_LOCK_KEY:{id:"keyboard.shortcut.capsLock",message:"Caps Lock",comment:"Label for caps lock key in shortcuts."},COMMAND_KEY:{id:"keyboard.shortcut.command",message:"Command",comment:"Label for command key in shortcuts."},CONTROL_KEY:{id:"keyboard.shortcut.control",message:"Control",comment:"Label for control key in shortcuts."},DELETE_KEY:{id:"keyboard.shortcut.delete",message:"Delete",comment:"Label for delete key in shortcuts."},END_KEY:{id:"keyboard.shortcut.end",message:"End",comment:"Label for end key in shortcuts."},ENTER_KEY:{id:"keyboard.shortcut.enter",message:"Enter",comment:"Label for enter key in shortcuts."},ESCAPE_KEY:{id:"keyboard.shortcut.escape",message:"Enter",comment:"Label for escape key in shortcuts."},HOME_KEY:{id:"keyboard.shortcut.home",message:"Home",comment:"Label for home key in shortcuts."},PAGE_DOWN_KEY:{id:"keyboard.shortcut.pageDown",message:"Page Down",comment:"Label for page down key in shortcuts."},PAGE_UP_KEY:{id:"keyboard.shortcut.pageUp",message:"Page Up",comment:"Label for page up key in shortcuts."},SHIFT_KEY:{id:"keyboard.shortcut.shift",message:"Shift",comment:"Label for shift key in shortcuts."},SPACE_KEY:{id:"keyboard.shortcut.space",message:"Space",comment:"Label for space key in shortcuts."},TAB_KEY:{id:"keyboard.shortcut.tab",message:"Tab",comment:"Label for tab key in shortcuts."}}),rk=Object.freeze({__proto__:null,DESCRIPTION:{id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."},LABEL:{id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."}}),rE=Object.freeze({__proto__:null,REDO_DESCRIPTION:{id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."},REDO_LABEL:{id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},UNDO_DESCRIPTION:{id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},UNDO_LABEL:{id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."}}),rC=Object.freeze({__proto__:null,DESCRIPTION:{id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."},LABEL:{id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."}}),rO=Object.freeze({__proto__:null,BULLET_LIST_LABEL:{id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},ORDERED_LIST_LABEL:{id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},TASK_LIST_LABEL:{id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."}}),rM=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:{id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."},CONVERT_LABEL:{id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},INSERT_DESCRIPTION:{id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},INSERT_LABEL:{id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."}}),rT=Object.freeze({__proto__:null,NO_ITEMS_AVAILABLE:{id:"react-components.mention-atom-component.zero-items",message:"No items available",comment:"Shown when no popup items are available"}});e.s(["L",0,rx,"U",0,rS,"K",0,rk,"G",0,rE,"D",0,rC,"Z",0,rO,"o",0,rM,"t",0,rT],546754);class rN{constructor(e,t,r={}){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){let i=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);i+=t[0].slice(e+t[1].length);let n=(r+=e)-o;n>0&&(i=t[0].slice(e-n,e)+i,r=o)}return e.tr.insertText(i,r,o)}):t,this.undoable=!1!==r.undoable,this.inCode=r.inCode||!1,this.inCodeMark=!1!==r.inCodeMark}}function rA({rules:e}){let t=new rm({state:{init:()=>null,apply(e,t){let r=e.getMeta(this);return r||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(r,n,o,i)=>r_(r,n,o,i,e,t),handleDOMEvents:{compositionend:r=>{setTimeout(()=>{let{$cursor:n}=r.state.selection;n&&r_(r,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}function r_(e,t,r,n,o,i){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+n;for(let c=0;c<o.length;c++){let u=o[c];if(!u.inCodeMark&&a.marks().some(e=>e.type.spec.code))continue;if(a.parent.type.spec.code){if(!u.inCode)continue}else if("only"===u.inCode)continue;let d=u.match.exec(l);if(!d||d[0].length<n.length)continue;let h=t-(d[0].length-n.length);if(!u.inCodeMark){let e=!1;if(s.doc.nodesBetween(h,a.pos,t=>{t.isInline&&t.marks.some(e=>e.type.spec.code)&&(e=!0)}),e)continue}let p=u.handler(s,d,h,r);if(p)return u.undoable&&p.setMeta(i,{transform:p,from:t,to:r,text:n}),e.dispatch(p),!0}return!1}let rR=(e,t)=>{let r=e.plugins;for(let n=0;n<r.length;n++){let o=r[n],i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let r=e.tr,n=i.transform;
6for(let e=n.steps.length-1;e>=0;e--)r.step(n.steps[e].invert(n.docs[e]));if(i.text){let t=r.doc.resolve(i.from).marks();r.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else r.delete(i.from,i.to);t(r)}return!0}}return!1};new rN(/--$/,"—",{inCodeMark:!1}),new rN(/\.\.\.$/,"…",{inCodeMark:!1}),new rN(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new rN(/"$/,"”",{inCodeMark:!1}),new rN(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new rN(/'$/,"’",{inCodeMark:!1}),e.s(["E",0,rN,"p",0,rA,"S",0,rR,"D",0,function(e,t,r=null,n){return new rN(e,(e,o,i,s)=>{let a=r instanceof Function?r(o):r,l=e.tr.delete(i,s),c=l.doc.resolve(i).blockRange(),u=c&&tj(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(i-1).nodeBefore;return d&&d.type==t&&tK(l.doc,i-1)&&(!n||n(o,d))&&l.join(i-1),l})}],996425);let rD=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},rP=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},rI=null,rL=function(e,t,r){let n=rI||(rI=document.createRange());return n.setEnd(e,null==r?e.nodeValue.length:r),n.setStart(e,t||0),n},rB=function(){rI=null},rV=function(e,t,r,n){return r&&(rj(e,t,r,n,-1)||rj(e,t,r,n,1))},rF=/^(img|br|input|textarea|hr)$/i;function rj(e,t,r,n,o){for(var i;;){if(e==r&&t==n)return!0;if(t==(o<0?0:rz(e))){let r=e.parentNode;if(!r||1!=r.nodeType||r$(e)||rF.test(e.nodeName)||"false"==e.contentEditable)return!1;t=rD(e)+(o<0?0:1),e=r}else{if(1!=e.nodeType)return!1;let r=e.childNodes[t+(o<0?-1:0)];if(1==r.nodeType&&"false"==r.contentEditable)if(null==(i=r.pmViewDesc)||!i.ignoreForSelection)return!1;else t+=o;else e=r,t=o<0?rz(e):0}}}function rz(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function r$(e){let t;for(let r=e;
6r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let rU=function(e){return e.focusNode&&rV(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function rH(e,t){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}let rK="u">typeof navigator?navigator:null,rW="u">typeof document?document:null,rq=rK&&rK.userAgent||"",rJ=/Edge\/(\d+)/.exec(rq),rG=/MSIE \d/.exec(rq),rY=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rq),rX=!!(rG||rY||rJ),rZ=rG?document.documentMode:rY?+rY[1]:rJ?+rJ[1]:0,rQ=!rX&&/gecko\/(\d+)/i.test(rq);rQ&&(/Firefox\/(\d+)/.exec(rq)||[0,0])[1];let r0=!rX&&/Chrome\/(\d+)/.exec(rq),r1=!!r0,r2=r0?+r0[1]:0,r3=!rX&&!!rK&&/Apple Computer/.test(rK.vendor),r9=r3&&(/Mobile\/\w+/.test(rq)||!!rK&&rK.maxTouchPoints>2),r4=r9||!!rK&&/Mac/.test(rK.platform),r5=!!rK&&/Win/.test(rK.platform),r6=/Android \d/.test(rq),r8=!!rW&&"webkitFontSmoothing"in rW.documentElement.style,r7=r8?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ne(e,t){return"number"==typeof e?e:e[t]}function nt(e,t,r){let n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=r||e.dom;s;){if(1!=s.nodeType){s=rP(s);continue}let e=s,r=e==i.body,a=r?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(i):function(e){let t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}(e),l=0,c=0;if(t.top<a.top+ne(n,"top")?c=-(a.top-t.top+ne(o,"top")):t.bottom>a.bottom-ne(n,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+ne(o,"top")-a.top:t.bottom-a.bottom+ne(o,"bottom")),t.left<a.left+ne(n,"left")?l=-(a.left-t.left+ne(o,"left")):t.right>a.right-ne(n,"right")&&(l=t.right-a.right+ne(o,"right")),l||c)if(r)i.defaultView.scrollBy(l,c);else{let r=e.scrollLeft,n=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-r,i=e.scrollTop-n;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let u=r?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(u))break;s="absolute"==u?s.offsetParent:rP(s)}}function nr(e){let t=[],r=e.ownerDocument;for(let n=e;n&&(t.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),e!=r);n=rP(n));return t}function nn(e,t){for(let r=0;r<e.length;r++){let{dom:n,top:o,left:i}=e[r];n.scrollTop!=o+t&&(n.scrollTop=o+t),n.scrollLeft!=i&&(n.scrollLeft=i)}}let no=null;function ni(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ns(e){return e.top<e.bottom||e.left<e.right}function na(e,t){let r=e.getClientRects();if(r.length){let e=r[t<0?0:r.length-1];if(ns(e))return e}return Array.prototype.find.call(r,ns)||e.getBoundingClientRect()}let nl=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function nc(e,t,r){let{node:n,offset:o,atom:i}=e.docView.domFromPos(t,r<0?-1:1),s=r8||rQ;if(3==n.nodeType)if(s&&(nl.test(n.nodeValue)||(r<0?!o:o==n.nodeValue.length))){let e=na(rL(n,o,o),r);if(rQ&&o&&/\s/.test(n.nodeValue[o-1])&&o<n.nodeValue.length){let t=na(rL(n,o-1,o-1),-1);if(t.top==e.top){let r=na(rL(n,o,o+1),-1);if(r.top!=e.top)return nu(r,r.left<t.left)}}return e}else{let e=o,t=o,i=r<0?1:-1;return r<0&&!o?(t++,i=-1):r>=0&&o==n.nodeValue.length?(e--,i=1):r<0?e--:t++,nu(na(rL(n,e,t),i),i<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(r<0||o==rz(n))){let e=n.childNodes[o-1];if(1==e.nodeType)return nd(e.getBoundingClientRect(),!1)}if(null==i&&o<rz(n)){let e=n.childNodes[o];if(1==e.nodeType)return nd(e.getBoundingClientRect(),!0)}return nd(n.getBoundingClientRect(),r>=0)}if(null==i&&o&&(r<0||o==rz(n))){let e=n.childNodes[o-1],t=3==e.nodeType?rL(e,rz(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return nu(na(t,1),!1)}if(null==i&&o<rz(n)){let e=n.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;
6let t=e?3==e.nodeType?rL(e,0,+!s):1==e.nodeType?e:null:null;if(t)return nu(na(t,-1),!0)}return nu(na(3==n.nodeType?rL(n):n,-r),r>=0)}function nu(e,t){if(0==e.width)return e;let r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function nd(e,t){if(0==e.height)return e;let r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function nh(e,t,r){let n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}let np=/[\u0590-\u08ac]/,nf=null,nm=null,ng=!1;class ny{constructor(e,t,r,n){this.parent=e,this.children=t,this.dom=r,this.contentDOM=n,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let n=this.children[t];if(n==e)return r;r+=n.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){let n;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(r<0){let r,n;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&!((n=r.pmViewDesc)&&n.parent==this);)r=r.previousSibling;return r?this.posBeforeChild(n)+n.size:this.posAtStart}else{let r,n;if(e==this.contentDOM)r=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.nextSibling}for(;r&&!((n=r.pmViewDesc)&&n.parent==this);)r=r.nextSibling;return r?this.posBeforeChild(n):this.posAtEnd}if(e==this.dom&&this.contentDOM)n=t>rD(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))n=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){n=!1;break}if(t.previousSibling)break}if(null==n&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){n=!0;break}if(t.nextSibling)break}}return(null==n?r>0:n)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,n=e;n;n=n.parentNode){let o=this.getDesc(n),i;if(o&&(!t||o.node))if(!r||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;else r=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,r){for(let n=e;n;n=n.parentNode){let o=this.getDesc(n);if(o)return o.localPosFromDOM(e,t,r)}return -1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let n=this.children[t],o=r+n.size;if(r==e&&o!=r){for(;!n.border&&n.children.length;)for(let e=0;e<n.children.length;e++){let t=n.children[e];if(t.size){n=t;break}}return n}if(e<o)return n.descAt(e-r-n.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,n=0;for(let t=0;r<this.children.length;r++){let o=this.children[r],i=t+o.size;if(i>e||o instanceof nE){n=e-t;break}t=i}if(n)return this.children[r].domFromPos(n-this.children[r].border,t);for(let e;r&&!(e=this.children[r-1]).size&&e instanceof nv&&e.side>=0;r--);if(t<=0){let e,n=!0;for(;(e=r?this.children[r-1]:null)&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?rD(e.dom)+1:0}}{let e,n=!0;for(;(e=r<this.children.length?this.children[r]:null)&&e.dom.parentNode!=this.contentDOM;r++,n=!1);return e&&n&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?rD(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let n=-1,o=-1;for(let i=r,s=0;;s++){let r=this.children[s],a=i+r.size;if(-1==n&&e<=a){let o=i+r.border;if(e>=o&&t<=a-r.border&&r.node&&r.contentDOM&&this.contentDOM.contains(r.contentDOM))return r.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let r=this.children[t-1];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(1)){n=rD(r.dom)+1;break}e-=r.size}-1==n&&(n=0)}if(n>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let r=this.children[e];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(-1)){o=rD(r.dom);break}t+=r.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:n,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(1!=t.nodeType||r==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,n=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,r,n);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=r.root.getSelection(),c=r.domSelectionRange(),u=!1;if((rQ||r3)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,r;t;
6t=t.parentNode){if(r=t.nextSibling){"BR"==r.nodeName&&(s=a={node:r.parentNode,offset:rD(r)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let r=e.childNodes[t-1];u=r&&("BR"==r.nodeName||"false"==r.contentEditable)}}if(rQ&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(n=!0)}if(!(n||u&&r3)&&rV(s.node,s.offset,c.anchorNode,c.anchorOffset)&&rV(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((l.extend||e==t)&&!(u&&rQ)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0}catch(e){}}if(!d){if(e>t){let e=s;s=a,a=e}let r=document.createRange();r.setEnd(a.node,a.offset),r.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(r)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,n=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==i?e<=i&&t>=r:e<i&&t>r){let n=r+o.border,s=i-o.border;if(e>=n&&t<=s){this.dirty=e==r||t==i?2:1,e==n&&t==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(e-n,t-n);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=1==e?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class nv extends ny{constructor(e,t,r,n){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:n)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class nb extends ny{constructor(e,t,r,n){super(e,[],t,null),this.textDOM=r,this.text=n}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class nw extends ny{constructor(e,t,r,n,o){super(e,[],r,n),this.mark=t,this.spec=o}static create(e,t,r,n){let o=n.nodeViews[t.type.name],i=o&&o(t,n,r);return i&&i.dom||(i=tb.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new nw(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let n=nw.create(this.parent,this.mark,!0,r),o=this.children,i=this.size;t<i&&(o=nI(o,t,i,r)),e>0&&(o=nI(o,0,e,r));for(let e=0;e<o.length;e++)o[e].parent=n;return n.children=o,n}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class nx extends ny{constructor(e,t,r,n,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=r,this.innerDeco=n,this.nodeDOM=s}static create(e,t,r,n,o,i){let s=o.nodeViews[t.type.name],a,l=s&&s(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:i,r,n),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=tb.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e)}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return(c=nA(c,r,t),l)?a=new nC(e,t,r,n,c,u||null,d,l,o,i+1):t.isText?new nk(e,t,r,n,c,d,o):new nx(e,t,r,n,c,u||null,d,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
6let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>eV.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return 0==this.dirty&&e.eq(this.node)&&n_(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let r=this.node.inlineContent,n=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new nD(this,i&&i.node,e);(function(e,t,r,n){let o=t.locals(e),i=0;if(0==o.length){for(let r=0;r<e.childCount;r++){let s=e.child(r);n(s,o,t.forChild(i,s),r),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d,h,p;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(u?(d||(d=[u])).push(e):u=e)}if(u)if(d){d.sort(nP);for(let e=0;e<d.length;e++)r(d[e],c,!!l)}else r(u,c,!!l);if(l)p=-1,h=l,l=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?a.filter(e=>!e.inline):a.slice();n(h,m,t.forChild(i,h),p),i=f}})(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,r,e,o):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?e$.none:this.node.child(o).marks,r,e,o),a.placeWidget(t,e,n)},(t,i,l,c)=>{let u;a.syncToMarks(t.marks,r,e,c),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>n&&e.state.selection.to<n+t.nodeSize&&(u=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,u,e)||a.updateNextNode(t,i,l,e,c,n)||a.addNode(t,i,l,e,n),n+=t.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),function e(t,r,n){let o=t.firstChild,i=!1;for(let s=0;s<r.length;s++){let a=r[s],l=a.dom;if(l.parentNode==t){for(;l!=o;)o=nR(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(l,o);if(a instanceof nw){let r=o?o.previousSibling:t.lastChild;e(a.contentDOM,a.children,n),o=r?r.nextSibling:t.firstChild}}for(;o;)o=nR(o),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}(this.contentDOM,this.children,e),r9&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:n}=e.state.selection;if(!(e.state.selection instanceof rt)||r<t||n>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(!this.node.inlineContent)return{node:o,pos:-1,text:""};{let e=o.nodeValue,i=function(e,t,r,n){for(let o=0,i=0;o<e.childCount&&i<=n;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=r){if(i>=n&&l.slice(n-t.length-a,n-a)==t)return n-t.length;let e=a<n?l.lastIndexOf(t,n-a-1):-1;if(e>=0&&e+t.length+a>=r)return a+e;if(r==n&&l.length>=n+t.length-a&&l.slice(n-a,n-a+t.length)==t)return n}}return -1}(this.node.content,e,r-t,n-t);return i<0?null:{node:o,pos:i,text:e}}}protectLocalComposition(e,{node:t,pos:r,text:n}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new nb(this,o,t,n);e.input.compositionNodes.push(i),this.children=nI(this.children,r,r+n.length,e,i)}update(e,t,r,n){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,r,n),!0)}updateInner(e,t,r,n){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(n,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(n_(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=nN(this.dom,this.nodeDOM,nT(this.outerDeco,this.node,t),nT(e,this.node,t)),this.dom!=r&&(r.pmVie
6wDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function nS(e,t,r,n,o){nA(n,t,e);let i=new nx(void 0,e,t,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class nk extends nx{constructor(e,t,r,n,o,i,s){super(e,t,r,n,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,n){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,n.trackWrites==this.nodeDOM&&(n.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,r){let n=this.node.cut(e,t),o=document.createTextNode(n.text);return new nk(this.parent,n,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class nE extends ny{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class nC extends nx{constructor(e,t,r,n,o,i,s,a,l,c){super(e,t,r,n,o,i,s,l,c),this.spec=a}update(e,t,r,n){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,n),o}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,r,n)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,n){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let nO=function(e){e&&(this.nodeName=e)};nO.prototype=Object.create(null);let nM=[new nO];function nT(e,t,r){if(0==e.length)return nM;let n=r?nM[0]:new nO,o=[n];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s)for(let e in s.nodeName&&o.push(n=new nO(s.nodeName)),s){let i=s[e];null!=i&&(r&&1==o.length&&o.push(n=new nO(t.isInline?"span":"div")),"class"==e?n.class=(n.class?n.class+" ":"")+i:"style"==e?n.style=(n.style?n.style+";":"")+i:"nodeName"!=e&&(n[e]=i))}}return o}function nN(e,t,r,n){if(r==nM&&n==nM)return t;let o=t;for(let t=0;t<n.length;t++){let i=n[t],s=r[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||((t=document.createElement(i.nodeName)).pmIsDeco=!0,t.appendChild(o),s=nM[0]),o=t}!function(e,t,r){for(let n in t)"class"==n||"style"==n||"nodeName"==n||n in r||e.removeAttribute(n);for(let n in r)"class"!=n&&"style"!=n&&"nodeName"!=n&&r[n]!=t[n]&&e.setAttribute(n,r[n]);if(t.class!=r.class){let n=t.class?t.class.split(" ").filter(Boolean):[],o=r.class?r.class.split(" ").filter(Boolean):[];for(let t=0;t<n.length;t++)-1==o.indexOf(n[t])&&e.classList.remove(n[t]);for(let t=0;t<o.length;t++)-1==n.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=r.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,n;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}r.style&&(e.style.cssText+=r.style)}}(o,s||nM[0],i)}return o}function nA(e,t,r){return nN(e,e,nM,nT(t,r,1!=e.nodeType))}function n_(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].type.eq(t[r].type))return!1;return!0}function nR(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nD{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let r=t,n=r.children.length,o=e.childCount,i=new Map,s=[];r:for(;o>0;){let a;for(;;)if(n){let e=r.children[n-1];if(e instanceof nw)r=e,n=e.children.length;else{a=e,n--;break}}else if(r==t)break r;else n=r.parent.children.indexOf(r),r=r.parent;let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r,n){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;n<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let r=this.top.children[t];if(r.matchesMark(e[i])&&!this.isLocked(r.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let n=nw.create(this.top,e[i],t,r);this.top.children.splice(this.index,0,n),this.top=n,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,r,n){let o=-1,i;if(n>=this.preMatch.index&&(i=this.preMatch.matches[n-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,r))o=this.top.children.indexOf(i,this.index);else for(let n=this.index,i=Math.min(this.top.children.length,n+5);n<i;n++){let i=this.top.children[n];if(i.matchesNode(e,t,r)&&!this.preMatch.matched.has(i)){o=n;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,n,o){let i=this.top.children[n];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,r,o)&&(this.destroyBetween(this.index,n),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,r,n,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof nx){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;
6let c=a.dom,u,d=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&n_(t,a.outerDeco));if(!d&&a.update(e,t,r,n))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(a,e,t,r,n,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(n,i+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,n,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!n_(r,e.outerDeco)||!n.eq(e.innerDeco))return null;let s=nx.create(this.top,t,r,n,o,i);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,r,n,o){let i=nx.create(this.top,e,t,r,n,o);i.contentDOM&&i.updateChildren(n,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,r){let n=this.index<this.top.children.length?this.top.children[this.index]:null;if(n&&n.matchesWidget(e)&&(e==n.widget||!n.widget.type.toDOM.parentNode))this.index++;else{let n=new nv(this.top,e,t,r);this.top.children.splice(this.index++,0,n),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof nw;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof nk)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((r3||r1)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);"IMG"==e&&(r.className="ProseMirror-separator",r.alt=""),"BR"==e&&(r.className="ProseMirror-trailingBreak");let n=new nE(this.top,[],r,null);t!=this.top?t.children.push(n):t.children.splice(this.index++,0,n),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function nP(e,t){return e.type.side-t.type.side}function nI(e,t,r,n,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=r||u<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,n)),o&&(i.push(o),o=void 0),u>r&&i.push(l.slice(r-c,l.size,n)))}return i}function nL(e,t=null){let r=e.domSelectionRange(),n=e.state.doc;if(!r.focusNode)return null;let o=e.docView.nearestDesc(r.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(rU(r)){for(l=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&rn.isSelectable(e)&&o.parent&&!(e.isInline&&function(e,t,r){for(let n=0==t,o=t==rz(e);n||o;){if(e==r)return!0;let t=rD(e);if(!(e=e.parentNode))return!1;n=n&&0==t,o=o&&t==rz(e)}}(r.focusNode,r.focusOffset,o.dom))){let e=o.posBefore;c=new rn(s==e?a:n.resolve(e))}}else{if(r instanceof e.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let t=s,o=s;for(let n=0;n<r.rangeCount;n++){let i=r.getRangeAt(n);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[l,s]=o==e.state.selection.anchor?[o,t]:[t,o],a=n.resolve(s)}else l=e.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let u=n.resolve(l);if(!c){let r="pointer"==t||e.state.selection.head<a.pos&&!i?1:-1;c=nK(e,u,a,r)}return c}function nB(e){return e.editable?e.hasFocus():nq(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nV(e,t=!1){let r=e.state.selection;if(nU(e,r),nB(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&r1){let t=e.domSelectionRange(),r=e.domObserver.currentSelection;if(t.anchorNode&&r.anchorNode&&rV(t.anchorNode,t.anchorOffset,r.anchorNode,r.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let r=e.cursorWrapper.dom,n="IMG"==r.nodeName;n?t.collapse(r.parentNode,rD(r)+1):t.collapse(r,0),!n&&!e.state.selection.visible&&rX&&rZ<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var n;
6let o,i,s,a,{anchor:l,head:c}=r,u,d;nF&&!(r instanceof rt)&&(r.$from.parent.inlineContent||(u=nj(e,r.from)),r.empty||r.$from.parent.inlineContent||(d=nj(e,r.to))),e.docView.setSelection(l,c,e,t),nF&&(u&&n$(u),d&&n$(d)),r.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((o=(n=e).dom.ownerDocument).removeEventListener("selectionchange",n.input.hideSelectionGuard),s=(i=n.domSelectionRange()).anchorNode,a=i.anchorOffset,o.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(i.anchorNode!=s||i.anchorOffset!=a)&&(o.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!nB(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let nF=r3||r1&&r2<63;function nj(e,t){let{node:r,offset:n}=e.docView.domFromPos(t,0),o=n<r.childNodes.length?r.childNodes[n]:null,i=n?r.childNodes[n-1]:null;if(r3&&o&&"false"==o.contentEditable)return nz(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return nz(o);else if(i)return nz(i)}}function nz(e){return e.contentEditable="true",r3&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function n$(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nU(e,t){if(t instanceof rn){let r=e.docView.descAt(t.from);r!=e.lastSelectedViewDesc&&(nH(e),r&&r.selectNode(),e.lastSelectedViewDesc=r)}else nH(e)}function nH(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nK(e,t,r,n){return e.someProp("createSelectionBetween",n=>n(e,t,r))||rt.between(t,r,n)}function nW(e){return(!e.editable||!!e.hasFocus())&&nq(e)}function nq(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function nJ(e,t){let{$anchor:r,$head:n}=e.selection,o=t>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&t6.findFrom(i,t)}function nG(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nY(e,t,r){let n=e.state.selection;if(n instanceof rt){if(r.indexOf("s")>-1){let{$head:r}=n,o=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(r.pos+o.nodeSize*(t<0?-1:1));return nG(e,new rt(n.$anchor,i))}else if(!n.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let r=nJ(e.state,t);return!!r&&r instanceof rn&&nG(e,r)}else if(!(r4&&r.indexOf("m")>-1)){let r=n.$head,o=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,i;if(!o||o.isText)return!1;let s=t<0?r.pos-o.nodeSize:r.pos;return!!(o.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM)&&(rn.isSelectable(o)?nG(e,new rn(t<0?e.state.doc.resolve(r.pos-o.nodeSize):r)):!!r8&&nG(e,new rt(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}else{if(n instanceof rn&&n.node.isInline)return nG(e,new rt(t>0?n.$to:n.$from));let r=nJ(e.state,t);return!!r&&nG(e,r)}}function nX(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nZ(e,t){let r=e.pmViewDesc;return r&&0==r.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nQ(e,t){return t<0?function(e){let t=e.domSelectionRange(),r=t.focusNode,n=t.focusOffset;if(!r)return;let o,i,s=!1;for(rQ&&1==r.nodeType&&n<nX(r)&&nZ(r.childNodes[n],-1)&&(s=!0);;)if(n>0)if(1!=r.nodeType)break;else{let e=r.childNodes[n-1];if(nZ(e,-1))o=r,i=--n;else if(3==e.nodeType)n=(r=e).nodeValue.length;else break}else if(n0(r))break;else{let t=r.previousSibling;for(;t&&nZ(t,-1);)o=r.parentNode,i=rD(t),t=t.previousSibling;if(t)n=nX(r=t);else{if((r=r.parentNode)==e.dom)break;n=0}}s?n1(e,r,n):o&&n1(e,o,i)}(e):function(e){let t,r,n=e.domSelectionRange(),o=n.focusNode,i=n.focusOffset;if(!o)return;let s=nX(o);for(;;)if(i<s){if(1!=o.nodeType)break;if(nZ(o.childNodes[i],1))t=o,r=++i;else break}else if(n0(o))break;else{let n=o.nextSibling;for(;n&&nZ(n,1);)t=n.parentNode,r=rD(n)+1,n=n.nextSibling;if(n)i=0,s=nX(o=n);else{if((o=o.parentNode)==e.dom)break;i=s=0}}t&&n1(e,t,r)}(e)}function n0(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function n1(e,t,r){if(3!=t.nodeType){let e,n;(n=function(e,t){for(;e&&t==e.childNodes.length&&!r$(e);)t=rD(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let r=e.childNodes[t];
vendor: 3,564 bytes, line 6
6if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;e=r,t=0}}(t,r))?(t=n,r=0):(e=function(e,t){for(;e&&!t&&!r$(e);)t=rD(e),e=e.parentNode;for(;e&&t;){let r=e.childNodes[t-1];if(3==r.nodeType)return r;if(1==r.nodeType&&"false"==r.contentEditable)break;t=(e=r).childNodes.length}}(t,r))&&(t=e,r=e.nodeValue.length)}let n=e.domSelection();if(!n)return;if(rU(n)){let e=document.createRange();e.setEnd(t,r),e.setStart(t,r),n.removeAllRanges(),n.addRange(e)}else n.extend&&n.extend(t,r);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&nV(e)},50)}function n2(e,t){let r=e.state.doc.resolve(t);if(!(r1||r5)&&r.parent.inlineContent){let n=e.coordsAtPos(t);if(t>r.start()){let r=e.coordsAtPos(t-1),o=(r.top+r.bottom)/2;if(o>n.top&&o<n.bottom&&Math.abs(r.left-n.left)>1)return r.left<n.left?"ltr":"rtl"}if(t<r.end()){let r=e.coordsAtPos(t+1),o=(r.top+r.bottom)/2;if(o>n.top&&o<n.bottom&&Math.abs(r.left-n.left)>1)return r.left>n.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function n3(e,t,r){let n=e.state.selection;if(n instanceof rt&&!n.empty||r.indexOf("s")>-1||r4&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let r=nJ(e.state,t);if(r&&r instanceof rn)return nG(e,r)}if(!o.parent.inlineContent){let r=t<0?o:i,s=n instanceof ri?t6.near(r,t):t6.findFrom(r,t);return!!s&&nG(e,s)}return!1}function n9(e,t){if(!(e.state.selection instanceof rt))return!0;let{$head:r,$anchor:n,empty:o}=e.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let n=e.state.tr;return t<0?n.delete(r.pos-i.nodeSize,r.pos):n.delete(r.pos,r.pos+i.nodeSize),e.dispatch(n),!0}return!1}function n4(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function n5(e,t){e.someProp("transformCopied",r=>{t=r(t,e)});let r=[],{content:n,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==n.childCount&&1==n.firstChild.childCount;){o--,i--;let e=n.firstChild;r.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),n=e.content}let s=e.someProp("clipboardSerializer")||tb.fromSchema(e.state.schema),a=oo(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,u,d=0;for(;c&&1==c.nodeType&&(u=or[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}c=l.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(r)}`),{dom:l,text:e.someProp("clipboardTextSerializer",r=>r(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function n6(e,t,r,n,o){let i,s,a=o.parent.type.spec.code;if(!r&&!t)return null;let l=!!t&&(n||a||!r);if(l){if(e.someProp("transformPastedText",r=>{t=r(t,a||n,e)}),a)return s=new eH(eV.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0)}),s;let r=e.someProp("clipboardTextParser",r=>r(t,o,n,e));if(r)s=r;else{let r=o.marks(),{schema:n}=e.state,s=tb.fromSchema(n);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(n.text(e,r)))})}}else e.someProp("transformPastedHTML",t=>{r=t(r,e)}),i=function(e){var t;let r,n=/^(\s*<meta [^>]*>)*/.exec(e);n&&(e=e.slice(n[0].length));let o=oo().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e),s;
6if((s=i&&or[i[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),o.innerHTML=(t=e,(r=window.trustedTypes)?(oi||(oi=r.defaultPolicy||r.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),oi.createHTML(t)):t),s)for(let e=0;e<s.length;e++)o=o.querySelector(s[e])||o;return o}(r),r8&&function(e){let t=e.querySelectorAll(r1?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<t.length;r++){let n=t[r];1==n.childNodes.length&&" "==n.textContent&&n.parentNode&&n.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),n)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||tu.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(l||u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||n8.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)s=function(e,t){if(!e.size)return e;let r=e.content.firstChild.type.schema,n;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=eV.from(t.create(n[e+1],o)),i++,s++}return new eH(o,i,s)}(ot(s,+u[1],+u[2]),u[4]);else if((s=eH.maxOpen(function(e,t){if(e.childCount<2)return e;for(let r=t.depth;r>=0;r--){let n=t.node(r).contentMatchAt(t.index(r)),o,i=[];if(e.forEach(e=>{if(!i)return;let t=n.findWrapping(e.type),r;if(!t)return i=null;if(r=i.length&&o.length&&function e(t,r,n,o,i){if(i<t.length&&i<r.length&&t[i]==r[i]){let s=e(t,r,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?n.type:t[i+1]))return o.copy(o.content.append(eV.from(n7(n,t,i+1))))}}(t,o,e,i[i.length-1],0))i[i.length-1]=r;else{i.length&&(i[i.length-1]=function e(t,r){if(0==r)return t;let n=t.content.replaceChild(t.childCount-1,e(t.lastChild,r-1)),o=t.contentMatchAt(t.childCount).fillBefore(eV.empty,!0);return t.copy(n.append(o))}(i[i.length-1],o.length));let r=n7(e,t);i.push(r),n=n.matchType(r.type),o=t}}),i)return eV.from(i)}return e}(s.content,o),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=ot(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e,l)}),s}let n8=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function n7(e,t,r=0){for(let n=t.length-1;n>=r;n--)e=t[n].create(null,eV.from(e));return e}function oe(e,t,r,n,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<n-1&&(a=oe(a,t,r,n,o+1,i)),o>=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(eV.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function ot(e,t,r){return t<e.openStart&&(e=new eH(oe(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),r<e.openEnd&&(e=new eH(oe(e.content,1,r,e.openEnd,0,0),e.openStart,r)),e}let or={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},on=null;function oo(){return on||(on=document.implementation.createHTMLDocument("title"))}let oi=null,oa={},ol={},oc={touchstart:!0,touchmove:!0};class ou{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function od(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function oh(e){e.someProp("handleDOMEvents",t=>{for(let r in t)e.input.eventHandlers[r]||e.dom.addEventListener(r,e.input.eventHandlers[r]=t=>op(e,t))})}function op(e,t){return e.someProp("handleDOMEvents",r=>{let n=r[t.type];return!!n&&(n(e,t)||t.defaultPrevented)})}function of(e){return{left:e.clientX,top:e.clientY}}function om(e,t,r,n,o){if(-1==n)return!1;let i=e.state.doc.resolve(n);for(let n=i.depth+1;n>0;n--)if(e.someProp(t,t=>n>i.depth?t(e,r,i.nodeAfter,i.before(n),o,!0):t(e,r,i.node(n),i.before(n),o,!1)))return!0;return!1}function og(e,t,r){if(e.focused||e.focus(),e.state.selection.eq(t))return;let n=e.state.tr.setSelection(t);"pointer"==r&&n.setMeta("pointer",!0),e.dispatch(n)}ol.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!ob(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!r6||!r1||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!r9||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",r=>r(e,t))||function(e,t){let r,n=t.keyCode,o=(r="",t.ctrlKey&&(r+="c"),t.metaKey&&(r+="m"),t.altKey&&
6(r+="a"),t.shiftKey&&(r+="s"),r);if(8==n||r4&&72==n&&"c"==o)return n9(e,-1)||nQ(e,-1);if(46==n&&!t.shiftKey||r4&&68==n&&"c"==o)return n9(e,1)||nQ(e,1);if(13==n||27==n)return!0;if(37==n||r4&&66==n&&"c"==o){let t=37==n?"ltr"==n2(e,e.state.selection.from)?-1:1:-1;return nY(e,t,o)||nQ(e,t)}if(39==n||r4&&70==n&&"c"==o){let t=39==n?"ltr"==n2(e,e.state.selection.from)?1:-1:1;return nY(e,t,o)||nQ(e,t)}else if(38==n||r4&&80==n&&"c"==o)return n3(e,-1,o)||nQ(e,-1);else if(40==n||r4&&78==n&&"c"==o)return function(e){if(!r3||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(t&&1==t.nodeType&&0==r&&t.firstChild&&"false"==t.firstChild.contentEditable){let r=t.firstChild;n4(e,r,"true"),setTimeout(()=>n4(e,r,"false"),20)}return!1}(e)||n3(e,1,o)||nQ(e,1);else if(o==(r4?"m":"c")&&(66==n||73==n||89==n||90==n))return!0;return!1}(e,t)?t.preventDefault():od(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,rH(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},ol.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},ol.keypress=(e,t)=>{if(ob(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||r4&&t.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,t)))return void t.preventDefault();let r=e.state.selection;if(!(r instanceof rt)||!r.$from.sameParent(r.$to)){let n=String.fromCharCode(t.charCode),o=()=>e.state.tr.insertText(n).scrollIntoView();/[\r\n]/.test(n)||e.someProp("handleTextInput",t=>t(e,r.$from.pos,r.$to.pos,n,o))||e.dispatch(o()),t.preventDefault()}};let oy=r4?"metaKey":"ctrlKey";oa.mousedown=(e,t)=>{var r;let n,o;e.input.shiftKey=t.shiftKey;let i=ok(e),s=Date.now(),a="singleClick";s-e.input.lastClick.time<500&&(n=(r=e.input.lastClick).x-t.clientX)*n+(o=r.y-t.clientY)*o<100&&!t[oy]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:a,button:t.button};let l=e.posAtCoords(of(t));l&&("singleClick"==a?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ov(e,l,t,!!i)):("doubleClick"==a?function(e,t,r,n){return om(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",r=>r(e,t,n))}:function(e,t,r,n){return om(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",r=>r(e,t,n))||function(e,t,r){if(0!=r.button)return!1;let n=e.state.doc;if(-1==t)return!!n.inlineContent&&(og(e,rt.create(n,0,n.content.size),"pointer"),!0);let o=n.resolve(t);for(let t=o.depth+1;t>0;t--){let r=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(r.inlineContent)og(e,rt.create(n,i+1,i+1+r.content.size),"pointer");else{if(!rn.isSelectable(r))continue;og(e,rn.create(n,i),"pointer")}return!0}}(e,r,n)})(e,l.pos,l.inside,t)?t.preventDefault():od(e,"pointer"))};class ov{constructor(e,t,r,n){let o,i;if(this.view=e,this.pos=t,this.event=r,this.flushed=n,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[oy],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let r=e.state.doc.resolve(t.pos);o=r.parent,i=r.depth?r.before():0}let s=n?null:r.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;0==r.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof rn&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&rQ&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),od(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>nV(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(of(e))),this.updateAllowDefault(e),this.allowDefault||!t)od(this.view,"pointer");else{var r,n,o,i;(r=this.view,n=t.pos,o=t.inside,i=this.selectNode,om(r,"handleClickOn",n,o,e)||r.someProp("handleClick",t=>t(r,n,e))||(i?function(e,t){if(-1==t)return!1;let r=e.state.selection,n,o;r instanceof rn&&(n=r.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(rn.isSelectable(t)){o=n&&r.$from.depth>0&&e>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?i.before(r.$from.depth):i.before(e);break}}
6return null!=o&&(og(e,rn.create(e.state.doc,o),"pointer"),!0)}(r,o):function(e,t){if(-1==t)return!1;let r=e.state.doc.resolve(t),n=r.nodeAfter;return!!(n&&n.isAtom&&rn.isSelectable(n))&&(og(e,new rn(r),"pointer"),!0)}(r,o)))?e.preventDefault():0==e.button&&(this.flushed||r3&&this.mightDrag&&!this.mightDrag.node.isAtom||r1&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(og(this.view,t6.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):od(this.view,"pointer")}}move(e){this.updateAllowDefault(e),od(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function ob(e,t){return!!e.composing||!!(r3&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}oa.touchstart=e=>{e.input.lastTouch=Date.now(),ok(e),od(e,"pointer")},oa.touchmove=e=>{e.input.lastTouch=Date.now(),od(e,"pointer")},oa.contextmenu=e=>ok(e);let ow=r6?5e3:-1;function ox(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ok(e),t))}function oS(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ok(e,t=!1){if(!r6||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),oS(e),t||e.docView&&e.docView.dirty){let r=nL(e),n=e.state.selection;return r&&!r.eq(n)?e.dispatch(e.state.tr.setSelection(r)):(e.markCursor||t)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}ol.compositionstart=ol.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,r=t.selection.$to;if(t.selection instanceof rt&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||r1&&r5&&function(e){let{focusNode:t,focusOffset:r}=e.domSelectionRange();if(!t||1!=t.nodeType||r>=t.childNodes.length)return!1;let n=t.childNodes[r];return 1==n.nodeType&&"false"==n.contentEditable}(e)))e.markCursor=e.state.storedMarks||r.marks(),ok(e,!0),e.markCursor=null;else if(ok(e,!t.selection.empty),rQ&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let t=e.domSelectionRange();for(let r=t.focusNode,n=t.focusOffset;r&&1==r.nodeType&&0!=n;){let t=n<0?r.lastChild:r.childNodes[n-1];if(!t)break;if(3==t.nodeType){let r=e.domSelection();r&&r.collapse(t,t.nodeValue.length);break}r=t,n=-1}}e.input.composing=!0}ox(e,ow)},ol.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,ox(e,20))};let oE=rX&&rZ<15||r9&&r7<604;function oC(e,t,r,n,o){let i=n6(e,t,r,n,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||eH.empty)))return!0;if(!i)return!1;let s=0==i.openStart&&0==i.openEnd&&1==i.content.childCount?i.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,n):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function oO(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let r=e.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}oa.copy=ol.cut=(e,t)=>{let r=e.state.selection,n="cut"==t.type;if(r.empty)return;let o=oE?null:t.clipboardData,{dom:i,text:s}=n5(e,r.content());o?(t.preventDefault(),o.clearData(),o.setData("text/html",i.innerHTML),o.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}(e,i),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},ol.paste=(e,t)=>
vendor: 10,729 bytes, line 6
6{if(e.composing&&!r6)return;let r=oE?null:t.clipboardData,n=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&oC(e,oO(r),r.getData("text/html"),n,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let r=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?oC(e,n.value,null,o,t):oC(e,n.textContent,n.innerHTML,o,t)},50)}(e,t)};class oM{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}let oT=r4?"altKey":"ctrlKey";function oN(e,t){let r;return e.someProp("dragCopies",e=>{r=r||e(t)}),null!=r?!r:!t[oT]}for(let e in oa.dragstart=(e,t)=>{let r,n=e.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(of(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof rn?o.to-1:o.to));else if(n&&n.mightDrag)r=rn.create(e.state.doc,n.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let n=e.docView.nearestDesc(t.target,!0);n&&n.node.type.spec.draggable&&n!=e.docView&&(r=rn.create(e.state.doc,n.posBefore))}let s=(r||e.state.selection).content(),{dom:a,text:l,slice:c}=n5(e,s);t.dataTransfer.files.length&&r1&&!(r2>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(oE?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",oE||t.dataTransfer.setData("text/plain",l),e.dragging=new oM(c,oN(e,t),r)},oa.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},ol.dragover=ol.dragenter=(e,t)=>t.preventDefault(),ol.drop=(e,t)=>{try{!function(e,t,r){if(!t.dataTransfer)return;let n=e.posAtCoords(of(t));if(!n)return;let o=e.state.doc.resolve(n.pos),i=r&&r.slice;i?e.someProp("transformPasted",t=>{i=t(i,e,!1)}):i=n6(e,oO(t.dataTransfer),oE?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&oN(e,t));if(e.someProp("handleDrop",r=>r(e,t,i||eH.empty,s)))return t.preventDefault();if(!i)return;t.preventDefault();let a=i?tq(e.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);let l=e.state.tr;if(s){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=l.doc;if(u?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),l.doc.eq(d))return;let h=l.doc.resolve(c);if(u&&rn.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new rn(h));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,r,n,o)=>t=o),l.setSelection(nK(e,h,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},oa.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&nV(e)},20))},oa.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},oa.beforeinput=(e,t)=>{if(r1&&r6&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,rH(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}},ol)oa[e]=ol[e];function oA(e,t){if(e==t)return!0;for(let r in e)if(e[r]!==t[r])return!1;for(let r in t)if(!(r in e))return!1;return!0}class o_{constructor(e,t){this.toDOM=e,this.spec=t||oL,this.side=this.spec.side||0}map(e,t,r,n){let{pos:o,deleted:i}=e.mapResult(t.from+n,this.side<0?-1:1);return i?null:new oP(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof o_&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&oA(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oR{constructor(e,t){this.attrs=e,this.spec=t||oL}map(e,t,r,n){let o=e.map(t.from+n,this.spec.inclusiveStart?-1:1)-r,i=e.map(t.to+n,this.spec.inclusiveEnd?1:-1)-r;return o>=i?null:new oP(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof oR&&oA(this.attrs,e.attrs)&&oA(this.spec,e.spec)}static is(e){return e.type instanceof oR}destroy(){}}class oD{constructor(e,t){this.attrs=e,this.spec=t||oL}map(e,t,r,n){let o=e.mapResult(t.from+n,1);if(o.deleted)return null;let i=e.mapResult(t.to+n,-1);return i.deleted||i.pos<=o.pos?null:new oP(o.pos-r,i.pos-r,this)}valid(e,t){let{index:r,offset:n}=e.content.findIndex(t.from),o;return n==t.from&&!(o=e.child(r)).isText&&n+o.nodeSize==t.to}eq(e){return this==e||e instanceof oD&&oA(this.attrs,e.attrs)&&oA(this.spec,e.spec)}destroy(){}}class oP{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new oP(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new oP(e,e,new o_(t,r))}static inline(e,t,r,n){return new oP(e,t,new oR(r,n))}static node(e,t,r,n){return new oP(e,t,new oD(r,n))}get spec(){return this.type.spec}get inline(){return this.type instanceof oR}get widget(){return this.type instanceof o_}}let oI=[],oL={};class oB{constructor(e,t){this.local=e.length?e:oI,this.children=t.length?t:oI}static create(e,t){return t.length?oU(t,e,0,oL):oV}find(e,t,r){let n=[];return this.findInner(null==e?0:e,null==t?1e9:t,n,0,r),n}findInner(e,t,r,n,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&r.push(s.copy(s.from+n,s.to+n))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,r,n+s,o)}}map(e,t,r){return this==oV||0==e.maps.length?this:this.mapInner(e,t,0,0,r||oL)}mapInner(e,t,r,n,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,r,n);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,r,n,o,i,s){let a=e.slice();for(let e=0,t=i;e<r.maps.length;e++){let n=0;r.maps[e].forEach((e,r,o,i)=>{let s=i-o-(r-e);for(let o=0;o<a.length;o+=3){let i=a[o+1];if(i<0||e>i+t-n)continue;let l=a[o]+t-n;r>=l?a[o+1]=e<=l?-2:-1:e>=t&&s&&(a[o]+=s,a[o+1]+=s)}n+=s}),t=r.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=r.map(e[t]+i),u=c-o;if(u<0||u>=n.content.size){l=!0;continue}let d=r.map(e[t+1]+i,-1)-o,{index:h,offset:p}=n.content.findIndex(u),f=n.maybeChild(h);if(f&&p==u&&p+f.nodeSize==d){let n=a[t+2].mapInner(r,f,c+1,e[t]+i+1,s);n!=oV?(a[t]=u,a[t+1]=d,a[t+2]=n):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=oU(function(e,t,r,n,o,i,s){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,i){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(n,o,i);a?r.push(a):s.onRemove&&s.onRemove(t.local[e].spec)}for(let r=0;r<t.children.length;r+=3)e(t.children[r+2],t.children[r]+i+1)}(e[a+2],t[a]+i+1);return r}(a,e,t,r,o,i,s),n,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let r=l.children[e];for(;t<a.length&&a[t]<r;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new oB(t.sort(oH),a)}(this.children,i||[],e,t,r,n,o):i?new oB(i.sort(oH),oI):oV}add(e,t){return t.length?this==oV?oB.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let n,o=0;e.forEach((e,i)=>{let s=i+r,a;if(a=oz(t,e,s)){for(n||(n=this.children.slice());o<n.length&&n[o]<i;)o+=3;n[o]==i?n[o+2]=n[o+2].addInner(e,a,s+1):n.splice(o,0,i,i+e.nodeSize,oU(a,e,s+1,oL)),o+=3}});let i=oj(o?o$(t):t,-r);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new oB(i.length?this.local.concat(i).sort(oH):this.local,n||this.children)}remove(e){return 0==e.length||this==oV?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,n=this.local;for(let n=0;n<r.length;n+=3){let o,i=r[n]+t,s=r[n+1]+t;for(let t=0,r;t<e.length;t++)(r=e[t])&&r.from>i&&r.to<s&&(e[t]=null,(o||(o=[])).push(r));if(!o)continue;r==this.children&&(r=this.children.slice());let a=r[n+2].removeInner(o,i+1);a!=oV?r[n+2]=a:(r.splice(n,3),n-=3)}if(n.length){for(let r=0,o;r<e.length;r++)if(o=e[r])for(let e=0;e<n.length;e++)n[e].eq(o,t)&&(n==this.local&&(n=this.local.slice()),n.splice(e--,1))}return r==this.children&&n==this.local?this:n.length||r.length?new oB(n,r):oV}forChild(e,t){let r,n;if(this==oV)return this;if(t.isLeaf)return oB.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(r=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof oR){let e=Math.max(o,t.from)-o,r=Math.min(i,t.to)-o;e<r&&(n||(n=[])).push(t.copy(e,r))}}if(n){let e=new oB(n.sort(oH),oI);return r?new oF([e,r]):e}return r||oV}eq(e){if(this==e)return!0;if(!(e instanceof oB)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return oK(this.localsInner(e))}localsInner(e){if(this==oV)return oI;if(e.inlineContent||!this.local.some(oR.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oR||t.push(this.local[e]);return t}forEachSet(e){e(this)}}oB.empty=new oB([],[]),oB.removeOverlap=oK;let oV=oB.empty;class oF{constructor(e){this.members=e}map(e,t){let r=this.members.map(r=>r.map(e,t,oL));return oF.from(r)}forChild(e,t){if(t.isLeaf)return oB.empty;let r=[];for(let n=0;n<this.members.length;n++){let o=this.members[n].forChild(e,t);o!=oV&&(o instanceof oF?r=r.concat(o.members):r.push(o))}return oF.from(r)}eq(e){if(!(e instanceof oF)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let n=0;n<this.members.length;n++){let o=this.members[n].localsInner(e);if(o.length)if(t){r&&(t=t.slice(),r=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?oK(r?t:t.sort(oH)):oI}static from(e){switch(e.length){case 0:return oV;case 1:return e[0];default:return new oF(e.every(e=>e instanceof oB)?e:e.reduce((e,t)=>
vendor: 4,992 bytes, line 6
6e.concat(t instanceof oB?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function oj(e,t){if(!t||!e.length)return e;let r=[];for(let n=0;n<e.length;n++){let o=e[n];r.push(new oP(o.from+t,o.to+t,o.type))}return r}function oz(e,t,r){if(t.isLeaf)return null;let n=r+t.nodeSize,o=null;for(let t=0,i;t<e.length;t++)(i=e[t])&&i.from>r&&i.to<n&&((o||(o=[])).push(i),e[t]=null);return o}function o$(e){let t=[];for(let r=0;r<e.length;r++)null!=e[r]&&t.push(e[r]);return t}function oU(e,t,r,n){let o=[],i=!1;t.forEach((t,s)=>{let a=oz(e,t,s+r);if(a){i=!0;let e=oU(a,t,r+s+1,n);e!=oV&&o.push(s,s+t.nodeSize,e)}});let s=oj(i?o$(e):e,-r).sort(oH);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(n.onRemove&&n.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new oB(s,o):oV}function oH(e,t){return e.from-t.from||e.to-t.to}function oK(e){let t=e;for(let r=0;r<t.length-1;r++){let n=t[r];if(n.from!=n.to)for(let o=r+1;o<t.length;o++){let i=t[o];if(i.from==n.from){i.to!=n.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,n.to),oW(t,o+1,i.copy(n.to,i.to)));continue}i.from<n.to&&(t==e&&(t=e.slice()),t[r]=n.copy(n.from,i.from),oW(t,o,n.copy(i.from,n.to)));break}}return t}function oW(e,t,r){for(;t<e.length&&oH(r,e[t])>0;)t++;e.splice(t,0,r)}function oq(e){let t=[];return e.someProp("decorations",r=>{let n=r(e.state);n&&n!=oV&&t.push(n)}),e.cursorWrapper&&t.push(oB.create(e.state.doc,[e.cursorWrapper.deco])),oF.from(t)}let oJ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},oG=rX&&rZ<=11;class oY{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class oX{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oY,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);rX&&rZ<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():r3&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),oG&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,oJ)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(nW(this.view)){if(this.suppressingSelectionUpdates)return nV(this.view);if(rX&&rZ<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&rV(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let r=e.focusNode;r;r=rP(r))t.add(r);for(let n=e.anchorNode;n;n=rP(n))if(t.has(n)){r=n;break}let n=r&&this.view.docView.nearestDesc(r);if(n&&n.ignoreMutation({type:"selection",target:3==r.nodeType?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&nW(t)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];
6if(t.editable)for(let e=0;e<r.length;e++){let t=this.registerMutation(r[e],l);t&&(i=i<0?t.from:Math.min(t.from,i),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(a=!0))}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(rQ&&l.length){let e=l.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,r]=e;t.parentNode&&t.parentNode.parentNode==r.parentNode?r.remove():t.remove()}else{let{focusNode:r}=this.currentSelection;for(let n of e){let e=n.parentNode;e&&"LI"==e.nodeName&&(!r||function(e,t){for(let r=t.parentNode;r&&r!=e.dom;r=r.parentNode){let t=e.docView.nearestDesc(r,!0);if(t&&t.node.isBlock)return r}return null}(t,r)!=e)&&n.remove()}}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&rU(n)&&(c=nL(t))&&c.eq(t6.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nV(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),e=t,!oZ.has(e)&&(oZ.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=rQ,oQ||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),oQ=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var r;let{focusNode:n,focusOffset:o}=e.domSelectionRange();for(let i of t)if((null==(r=i.parentNode)?void 0:r.nodeName)=="TR"){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let r=t;for(;;){let e=r.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;r=e}r.insertBefore(i,r.firstChild),n==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(t,l)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||nV(t),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(r==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if("childList"==e.type){for(let r=0;r<e.addedNodes.length;r++){let n=e.addedNodes[r];t.push(n),3==n.nodeType&&(this.lastChangedTextNode=n)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let n=e.previousSibling,o=e.nextSibling;if(rX&&rZ<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:r,nextSibling:i}=e.addedNodes[t];(!r||0>Array.prototype.indexOf.call(e.addedNodes,r))&&(n=r),(!i||0>Array.prototype.indexOf.call(e.addedNodes,i))&&(o=i)}let i=n&&n.parentNode==e.target?rD(n)+1:0,s=r.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?rD(o):e.target.childNodes.length;return{from:s,to:r.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:r.posAtStart-r.border,to:r.posAt
vendor: 4,392 bytes, line 6
6End+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let oZ=new WeakMap,oQ=!1;function o0(e,t){let r=t.startContainer,n=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return rV(s.node,s.offset,o,i)&&([r,n,o,i]=[o,i,r,n]),{anchorNode:r,anchorOffset:n,focusNode:o,focusOffset:i}}function o1(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(r3&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||r3&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let o2=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function o3(e,t,r){return Math.max(r.anchor,r.head)>t.content.size?null:nK(e,t.resolve(r.anchor),t.resolve(r.head))}function o9(e,t,r){let n=e.depth,o=t?e.end():e.pos;for(;n>0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r){let t=e.node(n).maybeChild(e.indexAfter(n));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function o4(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),r=e.charCodeAt(1);return t>=56320&&t<=57343&&r>=55296&&r<=56319}class o5{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ou,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(it),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=o7(this),o8(this),this.nodeViews=ie(this),this.docView=nS(this.state.doc,o6(this),oq(this),this.dom,this),this.domObserver=new oX(this,(e,t,r,n)=>(function(e,t,r,n,o){let i,s,a,l=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,r=nL(e,t);if(r&&!e.state.selection.eq(r)){if(r1&&r6&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,rH(13,"Enter"))))return;let n=e.state.tr.setSelection(r);"pointer"==t?n.setMeta("pointer",!0):"key"==t&&n.scrollIntoView(),l&&n.setMeta("composition",l),e.dispatch(n)}return}let c=e.state.doc.resolve(t),u=c.sharedDepth(r);t=c.before(u+1),r=e.state.doc.resolve(r).after(u+1);let d=e.state.selection,h=function(e,t,r){let n,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,r),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(n=[{node:u,offset:c.anchorOffset}],rU(c)||n.push({node:c.focusNode,offset:c.focusOffset})),r1&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],r=t.pmViewDesc;if("BR"==t.nodeName&&!r){s=e;break}if(!r||r.size)break}let d=e.state.doc,h=e.someProp("domParser")||tu.fromSchema(e.state.schema),p=d.resolve(a),f=null,m=h.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:n,ruleFromNode:o1,context:p});if(n&&null!=n[0].pos){let e=n[0].pos,t=n[1]&&n[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,r),p=e.state.doc,f=p.slice(h.from,h.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(i=e.state.selection.to,s="end"):(i=e.state.selection.from,s="start"),e.input.lastKeyCode=null;let m=function(e,t,r,n,o){let i=e.findDiffStart(t,r);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,r+e.size,r+t.size);if("end"==o){let e=Math.max(0,i-Math.min(s,a));n-=s+e-i}if(s<i&&e.size<t.size){let e=n<=i&&n>=s?i-n:0;(i-=e)&&i<t.size&&o4(t.textBetween(i-1,i+1))&&(i+=e?1:-1),a=i+(a-s),s=i}else if(a<i){let t=n<=i&&n>=a?i-n:0;(i-=t)&&i<e.size&&o4(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(f.content,h.doc.content,h.from,i,s);
6if(m&&e.input.domChangeCount++,(r9&&e.input.lastIOSEnter>Date.now()-225||r6)&&o.some(e=>1==e.nodeType&&!o2.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,rH(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(n&&d instanceof rt&&!d.empty&&d.$head.sameParent(d.$anchor)&&!e.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))m={start:d.from,endA:d.to,endB:d.to};else{if(h.sel){let t=o3(e,e.state.doc,h.sel);if(t&&!t.eq(e.state.selection)){let r=e.state.tr.setSelection(t);l&&r.setMeta("composition",l),e.dispatch(r)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof rt&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=h.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=h.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),rX&&rZ<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>h.from&&"  "==h.doc.textBetween(m.start-h.from-1,m.start-h.from+1)&&(m.start--,m.endA--,m.endB--);let g=h.doc.resolveNoCache(m.start-h.from),y=h.doc.resolveNoCache(m.endB-h.from),v=p.resolve(m.start),b=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=m.endA;if((r9&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!b&&g.pos<h.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(h.doc.textBetween(g.pos,y.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,rH(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&function(e,t,r,n,o){if(r-t<=o.pos-n.pos||o9(n,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!n.parent.isTextblock){let e=i.nodeAfter;return null!=e&&r==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(o9(i,!0,!0));return!(!s.parent.isTextblock||s.pos>r||o9(s,!0,!1)<r)&&n.parent.content.cut(n.parentOffset).eq(s.parent.content)}(p,m.start,m.endA,g,y)&&e.someProp("handleKeyDown",t=>t(e,rH(8,"Backspace")))){r6&&r1&&e.domObserver.suppressSelectionUpdates();return}r1&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),r6&&!b&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==m.endA&&(m.endB-=2,y=h.doc.resolveNoCache(m.endB-h.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,rH(13,"Enter"))})},20));let w=m.start,x=m.endA,S=t=>{let r=t||e.state.tr.replace(w,x,h.doc.slice(m.start-h.from,m.endB-h.from));if(h.sel){let t=o3(e,r.doc,h.sel);t&&!(r1&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==r.mapping.map(x)-1)||rX&&t.empty&&t.head==w)&&r.setSelection(t)}return l&&r.setMeta("composition",l),r.scrollIntoView()};if(b)if(g.pos==y.pos){rX&&rZ<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nV(e),20));let t=S(e.state.tr.delete(w,x)),r=p.resolve(m.start).marksAcross(p.resolve(m.endA));r&&t.ensureMarks(r),e.dispatch(t)}else if(m.endA==m.endB&&(a=function(e,t){let r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,l;for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);if(1==o.length&&0==i.length)a=o[0],s="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=o.length||1!=i.length)return null;a=i[0],s="remove",l=e=>e.mark(a.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(l(t.child(e)));if(eV.from(c).eq(e))return{mark:a,type:s}}(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start())))){let t=S(e.state.tr);"add"==a.type?t.addMark(w,x,a.mark):t.removeMark(w,x,a.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-!y.textOffset){let t=g.parent.textBetween(g.parentOffset,y.parentOffset),r=()=>S(e.state.tr.insertText(t,w,x));e.someProp("handleTextInput",n=>n(e,w,x,t,r))||e.dispatch(r())}else e.dispatch(S());else e.dispatch(S())})(this,e,t,r,n)),this.domObserver.start();var r=this;for(let e in oa){let t=oa[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=e=>{!function(e,t){if(!t.bubbles)return!0;
6if(t.defaultPrevented)return!1;for(let r=t.target;r!=e.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(t))return!1;return!0}(r,e)||op(r,e)||!r.editable&&e.type in ol||t(r,e)},oc[e]?{passive:!0}:void 0)}r3&&r.dom.addEventListener("input",()=>null),oh(r),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&oh(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(it),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let r in t.state=this.state,e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r,n,o;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(oS(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=ie(this);(function(e,t){let r=0,n=0;for(let n in e){if(e[n]!=t[n])return!0;r++}for(let e in t)n++;return r!=n})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&oh(this),this.editable=o7(this),o8(this);let c=oq(this),u=o6(this),d=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(i.selection))&&(a=!0);let p="preserve"==d&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,r,n=e.dom.getBoundingClientRect(),o=Math.max(0,n.top);for(let i=(n.left+n.right)/2,s=o+1;s<Math.min(innerHeight,n.bottom);s+=5){let n=e.root.elementFromPoint(i,s);if(!n||n==e.dom||!e.dom.contains(n))continue;let a=n.getBoundingClientRect();if(a.top>=o-20){t=n,r=a.top;break}}return{refDOM:t,refTop:r,stack:nr(e.dom)}}(this);if(a){let t,r,a;this.domObserver.stop();let l=h&&(rX||r1)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(n=i.selection,o=e.selection,a=Math.min(n.$anchor.sharedDepth(n.head),o.$anchor.sharedDepth(o.head)),n.$anchor.start(a)!=o.$anchor.start(a));if(h){let t=r1?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let r=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=rz(e=e.childNodes[t-1])}else{if(!e.parentNode||r$(e))return null;t=rD(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),n=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||r$(e))return null;t=rD(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(r&&n&&r!=n){let t=n.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(r==o||n==o)return o;if(!t||!t.isText(n.nodeValue))return n;if(e.input.compositionNode==n){let e=r.pmViewDesc;if(!(!e||!e.isText(r.nodeValue)))return n}}return r||n}(this)),(s||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=nS(e.doc,u,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(l=!0)}l||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),r=this.domSelectionRange(),rV(t.node,t.offset,r.anchorNode,r.anchorOffset)))?nV(this,l):(nU(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),(null==(r=this.dragging)?void 0:r.node)&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),"reset"==d?this.dom.scrollTop=0:"to selection"==d?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:r}){let n=e?e.getBoundingClientRect().top:0;nn(r,0==n?0:n-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof rn){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&nt(this,t.getBoundingClientRect(),e)}else nt(this,this.coordsAtPos(this.state.selection.head,1),e)}
6destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,n=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)n=r.from;else{let e=r.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==r.node&&(n=e)}this.dragging=new oM(e.slice,e.move,n<0?void 0:rn.create(this.state.doc,n))}someProp(e,t){let r=this._props&&this._props[e],n;if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(rX){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(no)return e.focus(no);let t=nr(e);e.focus(null==no?{get preventScroll(){return no={preventScroll:!0},!0}}:void 0),no||(no=!1,nn(t,0))}(this.dom),nV(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var r;let n,o,i=e.dom.ownerDocument,s,a=0,l=function(e,t,r){if(e.caretPositionFromPoint)try{let n=e.caretPositionFromPoint(t,r);if(n)return{node:n.offsetNode,offset:Math.min(rz(n.offsetNode),n.offset)}}catch(e){}if(e.caretRangeFromPoint){let n=e.caretRangeFromPoint(t,r);if(n)return{node:n.startContainer,offset:Math.min(rz(n.startContainer),n.startOffset)}}}(i,t.left,t.top);l&&({node:s,offset:a}=l);let c=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let r=e.dom.getBoundingClientRect();if(!ni(t,r)||!(c=function e(t,r,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(r.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let n=t.childNodes[s];if(1==n.nodeType){let t=n.getClientRects();for(let o=0;o<t.length;o++){let i=t[o];if(ni(r,i))return e(n,r,i)}}if((s=(s+1)%o)==i)break}return t}(e.dom,t,r)))return null}if(r3)for(let e=c;s&&e;e=rP(e))e.draggable&&(s=void 0);if(c=(n=(r=c).parentNode)&&/^li$/i.test(n.nodeName)&&t.left<r.getBoundingClientRect().left?n:r,s){let r;if(rQ&&1==s.nodeType&&(a=Math.min(a,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[a],r;"IMG"==e.nodeName&&(r=e.getBoundingClientRect()).right<=t.left&&r.bottom>t.top&&a++}r8&&a&&1==s.nodeType&&1==(r=s.childNodes[a-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&a--,s==e.dom&&a==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:(0==a||1!=s.nodeType||"BR"!=s.childNodes[a-1].nodeName)&&(o=function(e,t,r,n){let o=-1;for(let r=t,i=!1;r!=e.dom;){let t=e.docView.nearestDesc(r,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!i&&s.left>n.left||s.top>n.top?o=t.posBefore:(!i&&s.right<n.left||s.bottom<n.top)&&(o=t.posAfter),i=!0),!t.contentDOM&&o<0&&!t.node.isText))return(t.node.isBlock?n.top<(s.top+s.bottom)/2:n.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;r=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,r,-1)}(e,s,a,t))}null==o&&(o=function(e,t,r){let{node:n,offset:o}=function e(t,r){let n,o,i,s=2e8,a,l=0,c=r.top,u=r.top;for(let e=t.firstChild,d=0;e;e=e.nextSibling,d++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=rL(e).getClientRects()}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=u){c=Math.max(p.bottom,c),u=Math.min(p.top,u);let t=p.left>r.left?p.left-r.left:p.right<r.left?r.left-p.right:0;if(t<s){i=e,s=t,a=t&&3==i.nodeType?{left:p.right<r.left?p.right:p.left,top:r.top}
6:r,1==e.nodeType&&t&&(l=d+ +(r.left>=(p.left+p.right)/2));continue}}else p.top>r.top&&!n&&p.left<=r.left&&p.right>=r.left&&(n=e,o={left:Math.max(p.left,Math.min(p.right,r.left)),top:p.top});!i&&(r.left>=p.right&&r.top>=p.top||r.left>=p.left&&r.top>=p.bottom)&&(l=d+1)}}return(!i&&n&&(i=n,a=o,s=0),i&&3==i.nodeType)?function(e,t){let r=e.nodeValue.length,n=document.createRange(),o;for(let i=0;i<r;i++){n.setEnd(e,i+1),n.setStart(e,i);let r=na(n,1);if(r.top!=r.bottom&&ni(t,r)){o={node:e,offset:i+ +(t.left>=(r.left+r.right)/2)};break}}return n.detach(),o||{node:e,offset:0}}(i,a):!i||s&&1==i.nodeType?{node:t,offset:l}:e(i,a)}(t,r),i=-1;if(1==n.nodeType&&!n.firstChild){let e=n.getBoundingClientRect();i=e.left!=e.right&&r.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(n,o,i)}(e,c,t));let u=e.docView.nearestDesc(c,!0);return{pos:o,inside:u?u.posAtStart-u.border:-1}}(this,e)}coordsAtPos(e,t=1){return nc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let n=this.docView.posFromDOM(e,t,r);if(null==n)throw RangeError("DOM position not inside the editor");return n}endOfTextblock(e,t){return function(e,t,r){let n,o;return nf==t&&nm==r?ng:(nf=t,nm=r,ng="up"==r||"down"==r?(n=t.selection,o="up"==r?n.$from:n.$to,nh(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==r?-1:1);for(;;){let r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.contentDOM||r.dom;break}t=r.dom.parentNode}let n=nc(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=rL(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==r?n.top-o.top>(o.bottom-n.top)*2:o.bottom-n.bottom>(n.bottom-o.top)*2))return!1}}return!0})):function(e,t,r){let{$head:n}=t.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=o==n.parent.content.size,s=e.domSelection();return s?np.test(n.parent.textContent)&&s.modify?nh(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:a}=e.domSelectionRange(),l=s.caretBidiLevel;s.modify("move",r,"character");let c=n.depth?e.docView.domAfterPos(n.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),h=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&o==d;try{s.collapse(i,a),t&&(t!=i||o!=a)&&s.extend&&s.extend(t,o)}catch(e){}return null!=l&&(s.caretBidiLevel=l),h}):"left"==r||"backward"==r?!o:i:n.pos==n.start()||n.pos==n.end()}(e,t,r))}(this,t||this.state,e)}pasteHTML(e,t){return oC(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return oC(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return n5(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oq(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rB()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!op(this,e)&&oa[e.type]&&(this.editable||!(e.type in ol))&&oa[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?r3&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let r;if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return o0(e,r)}function n(e){e.preventDefault(),e.stopImmediatePropagation(),r=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0),r?o0(e,r):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function o6(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",r=>{if("function"==typeof r&&(r=r(e.state)),r)for(let e in r)"class"==e?t.class+=" "+r[e]:"style"==e?t.style=(t.style?t.style+";":"")+r[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(r[e]))}
6),t.translate||(t.translate="no"),[oP.node(0,e.state.doc.content.size,t)]}function o8(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:oP.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function o7(e){return!e.someProp("editable",t=>!1===t(e.state))}function ie(e){let t=Object.create(null);function r(e){for(let r in e)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=e[r])}return e.someProp("nodeViews",r),e.someProp("markViews",r),t}function it(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}o5.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},e.s(["G",0,oP,"q",0,oB,"j",0,o5],140644);var ir=e.i(835138),io=((s=io||{}).End="exit-end",s.Removed="delete",s.Split="exit-split",s.InvalidSplit="invalid-exit-split",s.MoveEnd="move-end",s.MoveStart="move-start",s.JumpForward="jump-forward-exit",s.JumpBackward="jump-backward-exit",s.SelectionOutside="selection-outside",s),ii=((a=ii||{}).Start="start",a.Text="change-character",a.SelectionInside="selection-inside",a.Move="move",a.JumpBackward="jump-backward-change",a.JumpForward="jump-forward-change",a),is=["move-end","move-start","selection-outside","jump-forward-exit","jump-backward-exit"];function ia(e){return"invalid-exit-split"===e}var il=["jump-backward-exit","jump-forward-exit"],ic=["jump-backward-change","jump-forward-change"];function iu(e){return!!(e&&e.query.full.length>=e.suggester.matchOffset)}function id(e){return eh(e)&&e instanceof rt}function ih(e){let{match:t,changeReason:r,exitReason:n}=e;return{...t,changeReason:r,exitReason:n}}function ip(e){let{$pos:t,suggester:r}=e,{char:n,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=r,d=iS({char:n,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u});return function(e){let t,{text:r,regexp:n,$pos:o,suggester:i}=e,s=o.start();return ev(r,n).forEach(e=>{if(function(e,t){let{invalidPrefixCharacters:r,validPrefixCharacters:n}=t;return r?!new RegExp(ix(r)).test(e):new RegExp(ix(n)).test(e)}(e.input.slice(Math.max(0,e.index-1),e.index),i)){let r=e.index+s,n=e[0],a=e[1];if(!ea(n)||!ea(a))return;let l=r+n.length,c=Math.min(l,o.pos),u=c-r;r<o.pos&&l>=o.pos&&(t={range:{from:r,to:l,cursor:c},match:e,query:{partial:n.slice(a.length,u),full:n.slice(a.length)},text:{partial:n.slice(0,u),full:n},textAfter:o.doc.textBetween(l,o.end(),"\0","\0"),textBefore:o.doc.textBetween(s,r,"\0","\0"),suggester:i})}}),t}({suggester:r,text:t.doc.textBetween(t.before(),t.end(),"\0","\0"),regexp:d,$pos:t,char:n,name:o})}function im(e){let{state:t,match:r}=e;try{return ip({$pos:t.doc.resolve(r.range.cursor),suggester:r.suggester})}catch{return}}function ig(e){let{prev:t,next:r,state:n}=e;return!r&&t.range.from>=n.doc.nodeSize?{exit:ih({match:t,exitReason:"delete"})}:r&&t.query.partial?t.range.to===r.range.cursor?{exit:ih({match:r,exitReason:"exit-end"})}:t.query.partial?{exit:ih({match:r,exitReason:"exit-split"})}:{}:{exit:ih({match:t,exitReason:"invalid-exit-split"})}}function iy(e,t){for(let r=e.depth;r>0;r--){let n=e.node(r);if(t.includes(n.type.name))return!0}return!1}function iv(e,t){let{$from:r,$to:n}=e;return!!ib(e,t)||eA(r.pos,n.pos).some(e=>{var n,o;let i;return n=r.doc.resolve(e),o=t,i=new Set(n.marks().map(e=>e.type.name)),o.some(e=>i.has(e))})}function ib(e,t){let{$from:r,$to:n}=e,o=new Set((r.marksAcross(n)??[]).map(e=>e.type.name));return t.some(e=>o.has(e))}function iw(e){let{suggesters:t,$pos:r,selectionEmpty:n}=e;for(let e of t)if(!e.emptySelectionsOnly||n)try{let t=ip({suggester:e,$pos:r});if(!t)continue;let n={$from:r.doc.resolve(t.range.from),$to:r.doc.resolve(t.range.to),$cursor:r};if(function(e,t){let{$cursor:r}=t,{validMarks:n,validNodes:o,invalidMarks:i,invalidNodes:s}=e;return!!(!n&&!o&&eg(i)&&eg(s))||!(n&&!ib(t,n)||o&&!iy(r,o)||!n&&iv(t,i)||!o&&iy(r,s))}(e,n)&&e.isValidPosition(n,t))return t}catch{}}function ix(e){return ep(e)?e.source:e}function iS(e){let{char:t,matchOffset:r,startOfLine:n,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=e,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`,u=(ea(t)?new RegExp((0,ir.default)(t)):t).source;return i&&(u=`(${u})`),RegExp(`${n?"^":""}${u}(?:${ix(o)}){${r},}`,c)}var ik={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invali
6dMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},iE="__ignore_prosemirror_suggest_update__",iC=class e{static create(t){return new e(t)}#e=!1;#t=!1;#r;#n;#o;#i=et();view;#s=oB.empty;#a=!1;#l=!1;get decorationSet(){return this.#s}get removed(){return this.#a}get match(){return this.#n?this.#n:this.#o&&this.#i.exit?this.#o:void 0}constructor(e){let t=iO();this.#r=e.map(t),this.#r=eM(this.#r,(e,t)=>t.priority-e.priority)}init(e){return this.view=e,this}setMarkRemoved=()=>{this.#a=!0};createProps(e){let{name:t,char:r}=e.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:t,char:r,...e}}shouldRunExit(){return!this.#t||(this.#t=!1,!1)}findNextTextSelection=e=>{let t=e.$from.doc,r=Math.min(t.nodeSize-2,e.to+1),n=t.resolve(r),o=t6.findFrom(n,1,!0);if(id(o))return o};updateWithNextSelection(e){let t=this.findNextTextSelection(e.selection);if(t)for(let r of this.#r){let n=this.#i.change?.suggester.name,o=this.#i.exit?.suggester.name;r.checkNextValidSelection?.(t.$from,e,{change:n,exit:o})}}changeHandler(e,t){let{change:r,exit:n}=this.#i,o=this.match;if(!r&&!n||!iu(o))return;let i=t===n?.suggester.appendTransaction&&this.shouldRunExit(),s=t===r?.suggester.appendTransaction;if(i||s){var a;if(r&&n&&(a={change:r,exit:n},ee(il,a.exit?.exitReason)||ee(ic,a.change?.changeReason))){let t=this.createProps(n),o=this.createProps(r);n.range.from,r.range.from,i&&n.suggester.onChange(t,e),s&&r.suggester.onChange(o,e),i&&(this.#a=!1);return}r&&s&&r.suggester.onChange(this.createProps(r),e),n&&i&&(n.suggester.onChange(this.createProps(n),e),this.#a=!1,ia(n.exitReason)&&(this.#i=et()))}}mapIgnoredDecorations(e){let t=this.#s.map(e.mapping,e.doc),r=t.find().filter(({from:e,to:t,spec:r})=>t-e!==(ea(r.char)?r.char.length:1));this.#s=t.remove(r)}ignoreNextExit=()=>{this.#t=!0};addIgnored=({from:e,name:t,specific:r=!1})=>{let n=this.#r.find(e=>e.name===t);if(!n)throw Error(`No suggester exists for the name provided: ${t}`);let o=ea(n.char)?n.char.length:1,i=n.ignoredClassName?{class:n.ignoredClassName}:{},s=oP.inline(e,e+o,{nodeName:n.ignoredTag,...i},{name:t,specific:r,char:n.char});this.#s=this.#s.add(this.view.state.doc,[s])};removeIgnored=({from:e,name:t})=>{let r=this.#r.find(e=>e.name===t);if(!r)throw Error(`No suggester exists for the name provided: ${t}`);let n=ea(r.char)?r.char.length:1,o=this.#s.find(e,e+n)[0];o&&o.spec.name===t&&(this.#s=this.#s.remove([o]))};clearIgnored=e=>{if(!e){this.#s=oB.empty;return}let t=this.#s.find().filter(({spec:t})=>t.name===e);this.#s=this.#s.remove(t)};shouldIgnoreMatch({range:e,suggester:{name:t}}){return this.#s.find().some(({spec:r,from:n})=>n===e.from&&(!r.specific||r.name===t))}resetState(){this.#i=et(),this.#n=void 0,this.#a=!1,this.#l=!1}updateReasons(e){let{$pos:t,state:r}=e,n=this.#e,o=this.#r,i=r.selection.empty,s=id(r.selection)?iw({suggesters:o,$pos:t,docChanged:n,selectionEmpty:i}):void 0;this.#n=s&&this.shouldIgnoreMatch(s)?void 0:s,this.#i=function(e){let{prev:t,next:r,state:n,$pos:o}=e,i=et();if(!t&&!r)return i;let s={prev:t,next:r};return s.prev&&s.next&&s.prev.range.from!==s.next.range.from?function(e){let{prev:t,next:r,state:n}=e,o=et(),i=im({state:n,match:t}),{exit:s}=i&&i.query.full!==t.query.full?ig({prev:t,next:i,state:n}):o;return t.range.from<r.range.from?{exit:s??ih({match:t,exitReason:"jump-forward-exit"}),change:ih({match:r,changeReason:"jump-forward-change"})}:{exit:s??ih({match:t,exitReason:"jump-backward-exit"}),change:ih({match:r,changeReason:"jump-backward-change"})}}({prev:s.prev,next:s.next,state:n}):!s.prev&&s.next?{change:ih({match:s.next,changeReason:"start"})}:s.prev&&!s.next?function(e){let{match:t,state:r,$pos:n}=e,{selection:o}=r,i=im({match:t,state:r});return i&&i.text.full===t.text.full?!o.empty&&(o.from<=t.range.from||o.to>=t.range.to)?{exit:ih({match:t,exitReason:"selection-outside"})}:n.pos>t.range.to?{exit:ih({match:t,exitReason:"move-end"})}:n.pos<=t.range.from?{exit:ih({match:t,exitReason:"move-start"})}:{}:ig({prev:t,next:i,state:r})}({$pos:o,match:s.prev,state:n}):s.prev&&s.next&&s.prev.text.full!==s.next.text.full?{change:ih({match:s.next,changeReason:"change-character"})}:s.prev&&s.next&&s.prev.range.cursor!==s.next.range.cursor?{change:ih({match:s.next,changeReason:n.selection.empty?"move":"selection-inside"})}:i}({next:this.#n,prev:this.#o,state:r,$pos:t})}
6findMatchAtPosition=(e,t)=>iw({suggesters:t?this.#r.filter(e=>e.name===t):this.#r,$pos:e,docChanged:!1,selectionEmpty:!0});addSuggester(e){let t=this.#r.find(t=>t.name===e.name),r=iO();if(t)this.#r=this.#r.map(n=>n===t?r(e):n);else{let t=[...this.#r,r(e)];this.#r=eM(t,(e,t)=>t.priority-e.priority)}return()=>this.removeSuggester(e.name)}removeSuggester(e){let t=ea(e)?e:e.name;this.#r=this.#r.filter(e=>e.name!==t),this.clearIgnored(t)}toJSON(){return this.match}apply(e){let{exit:t,change:r}=this.#i;if(this.#l&&(this.#l=!1,!t?.suggester.appendTransaction&&!r?.suggester.appendTransaction))return this;let{tr:n,state:o}=e,i=n.docChanged||n.selectionSet;return!n.getMeta(iE)&&(i||this.#a)&&(this.#e=n.docChanged,this.mapIgnoredDecorations(n),t&&this.resetState(),this.#o=this.#n,this.updateReasons({$pos:n.selection.$from,state:o})),this}createDecorations(e){let t=this.match;if(!iu(t))return this.#s;let{disableDecorations:r}=t.suggester;if(ec(r)?r(e,t):r)return this.#s;let{range:n,suggester:o}=t,{name:i,suggestTag:s,suggestClassName:a}=o,{from:l,to:c}=n;return this.shouldIgnoreMatch(t)?this.#s:this.#s.add(e.doc,[oP.inline(l,c,{nodeName:s,class:i?`${a} suggest-${i}`:a},{name:i})])}setLastChangeFromAppend=()=>{this.#l=!0}};function iO(){let e=new Set;return t=>{if(e.has(t.name))throw Error(`A suggester already exists with the name '${t.name}'. The name provided must be unique.`);let r={...ik,...t};return e.add(t.name),r}}var iM=new rv("suggest");function iT(e){return iM.getState(e)}function iN(e,t){return iT(e).addSuggester(t)}function iA(e){e.setMeta(iE,!0)}function i_(e,t){return iT(e).removeSuggester(t)}function iR(...e){let t=iC.create(e);return new rm({key:iM,view:e=>(t.init(e),{update:e=>t.changeHandler(e.state.tr,!1)}),state:{init:()=>t,apply:(e,r,n,o)=>t.apply({tr:e,state:o})},appendTransaction:(e,r,n)=>{let o=n.tr;return(t.updateWithNextSelection(o),t.changeHandler(o,!0),o.docChanged||o.steps.length>0||o.selectionSet||o.storedMarksSet)?(t.setLastChangeFromAppend(),o):null},props:{decorations:e=>t.createDecorations(e)}})}function iD(e,t){let r=Object.getPrototypeOf(t),n=e.selection,o=e.doc,i=e.storedMarks,s=et();for(let[e,r]of Object.entries(t))s[e]={value:r};return Object.create(r,{...s,storedMarks:{get:()=>i},selection:{get:()=>n},doc:{get:()=>o},tr:{get:()=>(n=e.selection,o=e.doc,i=e.storedMarks,e)}})}function iP(e){return({state:t,dispatch:r,view:n,tr:o})=>e(iD(o,t),r,n)}e.s(["L",0,ii,"i",0,ik,"j",0,iN,"U",0,iS,"D",0,iT,"O",0,iA,"n",0,ia,"W",0,function(e){return"delete"===e},"y",0,function(e){return ee(is,e)},"z",0,function(e){return"exit-split"===e},"s",0,iv,"e",0,i_,"I",0,iR],221214),e.s(["J",0,function(...e){return({state:t,dispatch:r,view:n,tr:o,...i})=>{for(let s of e)if(s({state:t,dispatch:r,view:n,tr:o,...i}))return!0;return!1}},"G",0,iD,"A",0,iP,"C",0,function(e){return t=>(eI(void 0===t.dispatch||t.dispatch===t.view?.dispatch,{code:L.NON_CHAINABLE_COMMAND}),e(t))}],246208);var iI={get isBrowser(){return!!("u">typeof window&&void 0!==window.document&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return iI.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return void 0!==T.default&&null!=T.default.versions&&null!=T.default.versions.node},get isIos(){return iI.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return iI.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return iI.isNode?"darwin"===T.default.platform:!!iI.isBrowser&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function iL(e){return eh(e)&&el(e.nodeType)&&ea(e.nodeName)}function iB(e){return iL(e)&&1===e.nodeType}function iV(e){let{types:t,node:r}=e;if(!r)return!1;let n=e=>e===r.type||e===r.type.name;return em(t)?t.some(n):n(t)}function iF(e){let{predicate:t,selection:r}=e,n=i0(r)?r.selection.$from:i2(r)?r.$from:r;for(let e=n.depth;e>0;e--){let r=n.node(e),o=e>0?n.before(e):0,i=n.start(e),s=o+r.nodeSize;if(t(r,o))return{pos:o,depth:e,node:r,start:i,end:s}}}function ij(e){let{depth:t}=e,r=t>0?e.before(t):0,n=e.node(t),o=e.start(t),i=r+n.nodeSize;return{pos:r,start:o,node:n,end:i,depth:t}}function iz(e){let{types:t,selection:r}=e;return iF({predicate:e=>iV({types:t,node:e}),selection:r})}function i$(e){return i2(e)?e.empty:e.selection.empty}function iU(e){return!!iH(e)}function iH(e){let{state:t,type:r,attrs:n}=e,{selection:o,doc:i}=t,s=ea(r)?i.type.schema.nodes[r]:r;eI(s,{code:L.SCHEMA,message:`No node exists for ${r}`});let a=function(e){let{types:t,selection:r}=e;if(i9(r)&&iV({types:t,node:r.node}))return{pos:r.$from.pos,depth:r.$from.depth,start:r.$from.start(),end:r.$from.pos+r.node.nodeSize,node:r.node}}({selection:o,types:r})??iF({predicate:e=>e.type===s,selection:o});return!n||ef(n)||!a||a.node.hasMarkup(s,{...a.node.attrs,...n})?a:void 0}function iK(...e){return t=>{if(!ey(e))return!1;let[r,...n]=e,o=!1,i=(...e)=>()=>{if(!ey(e))return!1;o=!0;let[,...r]=e;return iK(...e)({...t,next:i(...r)})},s=i(...n),a=r({...t,next:s});return o||a?a:s()}}function iW(e){return function(e,t){let r=new Map,n=et();for(let o of e)for(let[e,i]of X(o)){let o=[...r.get(e)??[],i],s=iK(...o);r.set(e,o),n[e]=t(s)}return n}(e,e=>(t,r,n)=>e({state:t,dispatch:r,view:n,tr:t.tr,next:()=>!1}))}function iq(e,t){let r=e.attrs??{};return Object.entries(t).every(([e,t])=>r[e]===t)}function iJ(e){return eh(e)}function iG(e,t){return em(t)?ee(t,e[_]):t===e[_]}function iY(e){return eh(e)&&e instanceof ta}function iX(e){return eh(e)&&e instanceof e3}function iZ(e){return eh(e)&&e instanceof eV}function iQ(e){return eh(e)&&e instanceof e$}function i0(e){return eh(e)&&e instanceof rf}function i1(e){return eh(e)&&e instanceof rt}function i2(e){return eh(e)&&e instanceof t6}function i3(e){var t;let{trState:r,from:n,to:o,type:i,attrs:s={}}=e,{doc:a}=r,l=(t=a.type.schema,ea(i)?J(t.marks,i):i);if(0===Object.keys(s).length)return a.rangeHasMark(n,o,l);let c=!1;return o>n&&a.nodesBetween(n,o,e=>!c&&!(c=(e.marks??[]).some(e=>e.type===l&&iq(e,s)))),c}function i9(e){return eh(e)&&e instanceof rn}function i4(e){let{trState:t,type:r,attrs:n={},from:o,to:i}=e,{selection:s,doc:a,storedMarks:l}=t;if(eI(ea(r)?a.type.schema.marks[r]:r,{code:L.SCHEMA,message:`Mark type: ${r} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&i3({...e,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(e=>e.type===r&&iq(e,n??{})):i3({...e,from:s.from,to:s.to})}function i5(e){for(let t of Object.values(e.nodes))if("doc"!==t.name&&(t.isBlock||t.isTextblock))return t;eI(!1,{code:L.SCHEMA,message:"No default block node found for the provided schema."})}function i6(e){return e.type===i5(e.type.schema)}function i8(e){return!!e&&e.type.isBlock&&!e.textContent&&!e.childCount}function i7(e,t,r){let n=e.parent.childAfter(e.parentOffset);if(!n.node)return;let o=ea(t)?t:t.name,i=n.node.marks.find(({type:e})=>e.name===o),s=e.index(),a=e.start()+n.offset,l=s+1,c=a+n.node.nodeSize;if(!i)return r&&c<r.pos?i7(e.doc.resolve(c+1),t,r):void 0;for(;s>0&&i.isInSet(e.parent.child(s-1).marks);)s-=1,a-=e.parent.child(s).nodeSize;
6for(;l<e.parent.childCount&&i.isInSet(e.parent.child(l).marks);)c+=e.parent.child(l).nodeSize,l+=1;let u=e.doc.textBetween(a,c,"","\n\n");return{from:a,to:c,text:u,mark:i}}function se(e,t){return 0===t.length||t.some(t=>e instanceof t)}function st(e){return i1(e)?e.$cursor:void 0}function sr(e,t){var r;let n,o=t.nodeSize-2,i=e=>eO({min:0,max:o,value:e});if(i2(e))return e;if("all"===e)return new ri(t);if(el(n="start"===e?0:"end"===e?o:eh(e)&&e instanceof eX?e.pos:e))return n=i(n),rt.near(t.resolve(n));if(eh(r=n)&&el(r.anchor)&&el(r.head)){let e=i(n.anchor),r=i(n.head);return rt.between(t.resolve(e),t.resolve(r))}let s=i(n.from),a=i(n.to);return rt.between(t.resolve(s),t.resolve(a))}function sn(e){let{content:t,schema:r,document:n,stringHandler:o,onError:i,attempts:s=0}=e;if(eI(i&&s<=3||0===s,{code:L.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),ea(t))return eI(o,{code:L.INVALID_CONTENT,message:`The string '${t}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:n,content:t,schema:r});if(i0(t))return t.doc;if(iX(t))return t;try{return r.nodeFromJSON(t)}catch(a){let n=function({json:e,schema:t,...r}){let n=new Set(Z(t.marks)),o=function e(t){let{json:r,validMarks:n,validNodes:o,path:i=[]}=t,s={validMarks:n,validNodes:o},a=[],{type:l,marks:c,content:u}=r,{invalidParentMark:d=!1,invalidParentNode:h=!1}=t;if(c){let e=[];for(let[t,r]of c.entries()){let o=ea(r)?r:r.type;n.has(o)||(e.unshift({name:o,path:[...i,"marks",`${t}`],type:"mark",invalidParentMark:d,invalidParentNode:h}),d=!0)}a.push(...e)}if(o.has(l)||(a.push({name:l,type:"node",path:i,invalidParentMark:d,invalidParentNode:h}),h=!0),u){let t=[];for(let[r,n]of u.entries())t.unshift(...e({...s,json:n,path:[...i,"content",`${r}`],invalidParentMark:d,invalidParentNode:h}));a.unshift(...t)}return a}({json:e,path:[],validNodes:new Set(Z(t.nodes)),validMarks:n});return{json:e,invalidContent:o,transformers:sc,...r}}({schema:r,error:a,json:t}),o=null==i?void 0:i(n);return eI(o,{code:L.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(n.invalidContent,null,2)}`}),sn({...e,content:o,attempts:s+1})}}function so(){let e=rb();if(e)return e;throw Error("Unable to retrieve the document from the global scope. \nIt seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work. \nIf you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string). \nIf you are using Next.js (or other server-side rendering frameworks), please use dynamic import with `ssr: false` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr). \nIf you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror")}function si(e){var t;return(null==e?void 0:e.defaultView)??("u">typeof window?window:void 0)??(null==(t=rb())?void 0:t.defaultView)}function ss(e,t=so()){let r=t.createElement("div");return r.append(function(e,t=so()){var r;let n=(r=e.type.schema,iX(e)&&(r?e.type===r.nodes.doc:"doc"===e.type.name))?e.content:eV.from(e);return tb.fromSchema(e.type.schema).serializeFragment(n,{document:t})}(e,t)),r.innerHTML}function sa(e){let{content:t,schema:r,document:n,fragment:o=!1,...i}=e,s=new(function(e){let t=si(e)??so().defaultView;if(t)return t;throw Error("Unable to retrieve the window from the global scope")}(n)).DOMParser().parseFromString(`<body>${t}</body>`,"text/html").body,a=tu.fromSchema(r);return o?a.parseSlice(s,{...sl,...i}).content:a.parse(s,{...sl,...i})}var sl={preserveWhitespace:!1},sc={remove(e,t){let r=e;for(let e of t)e.invalidParentNode||(r=eT(e.path,r));return r}};function su(e){return!!(i1(e)&&e.$cursor&&e.$cursor.parentOffset>=e.$cursor.parent.content.size)}function sd(e){return!!(i1(e)&&e.$cursor&&e.$cursor.parentOffset<=0)}function sh(e){let t=t6.atStart(e.$anchor.doc);return!!(sd(e)&&t.anchor===e.anchor)}function sp(e,t={}
6,r){return function(n){let{tr:o,dispatch:i,state:s}=n,a=ea(e)?J(s.schema.nodes,e):e,{from:l,to:c}=sr(r??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),h=u.blockRange(d),p=h&&tj(h,a,t);return!!p&&!!h&&(null==i||i(o.wrap(h,p).scrollIntoView()),!0)}}function sf(e,t={},r){return n=>{let{tr:o,state:i}=n;return iH({state:o,type:ea(e)?J(i.schema.nodes,e):e,attrs:t})?function({tr:e,dispatch:t}){let{$from:r,$to:n}=e.selection,o=r.blockRange(n),i=o&&tF(o);return!!el(i)&&!!o&&(null==t||t(e.lift(o,i).scrollIntoView()),!0)}(n):sp(e,t,r)(n)}}function sm(e,t,r,n=!0){return function(o){let i,{tr:s,dispatch:a,state:l}=o,c=ea(e)?J(l.schema.nodes,e):e,{from:u,to:d}=sr(r??s.selection,s.doc),h=!1;return s.doc.nodesBetween(u,d,(e,r)=>{if(h)return!1;if(!e.isTextblock||e.hasMarkup(c,t))return;if(e.type===c){h=!0,i=e.attrs;return}let n=s.doc.resolve(r),o=n.index();(h=n.parent.canReplaceWith(o,o+1,c))&&(i=n.parent.attrs)}),!!h&&(null==a||a(s.setBlockType(u,d,c,{...n?i:{},...t}).scrollIntoView()),!0)}}function sg(e){return t=>{let{tr:r,state:n}=t,{type:o,attrs:i,preserveAttrs:s=!0}=e,a=iH({state:r,type:o,attrs:i}),l=e.toggleType??i5(n.schema);if(a)return sm(l,{...s?a.node.attrs:{},...i})(t);let c=iH({state:r,type:l,attrs:i});return sm(o,{...s?null==c?void 0:c.node.attrs:{},...i})(t)}}function sy(e){let{attrs:t={},appendText:r="",content:n="",keepSelection:o=!1,range:i}=e;return({state:s,tr:a,dispatch:l})=>{var c;let u=s.schema,d=sr(e.selection??i??a.selection,a.doc),h=d.$from.index(),{from:p,to:f,$from:m}=d,g=ea(e.type)?u.nodes[e.type]??u.marks[e.type]:e.type;if(eI(!ea(e.type)||g,{code:L.SCHEMA,message:`Schema contains no marks or nodes with name ${g}`}),eh(g)&&g instanceof ti){if(!m.parent.canReplaceWith(h,h,g))return!1;a.replaceWith(p,f,g.create(t,n?u.text(n):void 0))}else eI(n,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,f,u.text(n,iY(g)?[g.create(t)]:void 0));return r&&a.insertText(r),o&&function(e,t){let{head:r,empty:n,anchor:o}=e;for(let e of t.steps)r=e.getMap().map(r);n?t.setSelection(rt.near(t.doc.resolve(r))):t.setSelection(rt.between(t.doc.resolve(o),t.doc.resolve(r)))}(s.selection,a),l&&(function(e=0){let t=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return!!t&&Number.parseInt(J(t,2),10)>=e}(60)&&(null==(c=document.getSelection())||c.empty()),l(a)),!0}}function sv(e){return({dispatch:t,tr:r,state:n})=>{let{type:o,expand:i=!0,range:s}=e,{from:a,to:l,$from:c,$to:u}=sr(e.selection??s??r.selection,r.doc),d=ea(o)?n.schema.marks[o]:o;null!==d&&eI(d,{code:L.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});let h=d??function e(t,r){let n=t.parent.childAfter(t.parentOffset);if(!n.node)return;let{marks:o,nodeSize:i}=n.node;if(o[0])return o[0].type;let s=t.start()+n.offset;return e(t.doc.resolve(s+i+1),r)}(c);if(!h)return!1;let p=i7(c,h,u);return i&&p&&(a=Math.max(0,Math.min(a,p.from)),l=Math.min(Math.max(l,p.to),r.doc.nodeSize-2)),null==t||t(r.removeMark(a,el(l)?l:a,iY(d)?d:void 0)),!0}}function sb({predicate:e}){return t=>(function(e){let{node:t,predicate:r,descend:n=!0,action:o}=e;eI(iX(t),{code:L.INTERNAL,message:'Invalid "node" parameter passed to "findChildren".'}),eI(ec(r),{code:L.INTERNAL,message:'Invalid "predicate" parameter passed to "findChildren".'});let i=[];return t.descendants((e,t)=>{let s={node:e,pos:t};return r(s)&&(i.push(s),null==o||o(s)),n}),i})({...t,predicate:e})}function sw({captureGroup:e,fullMatch:t,end:r,start:n,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(null==t)return null;let d=(null==a?void 0:a({captureGroup:e,fullMatch:t,start:n,end:r}))??{};e=d.captureGroup??e,t=d.fullMatch??t,n=d.start??n,r=d.end??r;let h=l.doc.resolve(n),p=l.doc.resolve(r);return c&&iv({$from:h,$to:p},c)||o.invalidMarks&&iv({$from:h,$to:p},o.invalidMarks)||i&&(null==e?void 0:e.trim())===""||(null==s?void 0:s({state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"}))||(null==(u=o.shouldSkip)?void 0:u.call(o,{state:l,captureGroup:e,fullMatch:t,start:n,end:r,ruleType:"mark"}))?null:{captureGroup:e,end:r,fullMatch:t,start:n}}sb({predicate:e=>e.node.isText}),sb({predicate:e=>e.node.isInline}),sb({predicate:e=>e.node.isBlock}),e.s(["bV",0,iK,"By",0,function(e,t){let{tr:r}=t;
6return e.forEach(e=>{e.steps.forEach(e=>{r.step(e)})}),r},"iG",0,iq,"iA",0,sn,"$m",0,iI,"rp",0,ij,"k0",0,iF,"As",0,iz,"VS",0,iH,"gn",0,function(e,t=[]){let r=[],{steps:n,mapping:o}=e,i=o.invert();return n.forEach((e,n)=>{if(!se(e,t))return;let s=[],a=e.getMap(),l=o.slice(n);if(0===a.ranges.length&&se(e,[t_,tL,tI,tR])){let{from:t,to:r}=e;s.push({from:t,to:r})}else a.forEach((e,t)=>{s.push({from:e,to:t})});s.forEach(e=>{let t=l.map(e.from,-1),n=l.map(e.to);r.push({from:t,to:n,prevFrom:i.map(t,-1),prevTo:i.map(n)})})}),eN(eM(r,(e,t)=>e.from-t.from),({from:e,to:t,prevFrom:r,prevTo:n})=>`${e}_${t}_${r}_${n}`).filter((e,t,r)=>!r.some((r,n)=>t!==n&&e.prevFrom>=r.prevFrom&&e.prevTo<=r.prevTo&&e.from>=r.from&&e.to<=r.to))},"vn",0,st,"Dm",0,i5,"Qo",0,so,"Vb",0,i7,"KH",0,function(e,t){let r=[],{$from:n,$to:o}=e,i=n;for(;;){let e=i7(i,t,o);if(!e)return r;if(r.push(e),e.to<o.pos){i=n.doc.resolve(e.to+1);continue}return r}},"Zy",0,function(e,t=0){let r=em(e)?e[t]:e;return G(ea(r),`No match string found for match ${e}`),r??""},"zC",0,function(e,t){return ea(e)?J(t.nodes,e):e},"LA",0,function(e){return function(e,t){if(!i1(e.selection))return;let{from:r,to:n}=e.selection,o=(t,r)=>{var n;return(null==(n=rt.between(e.doc.resolve(t),e.doc.resolve(r)).content().content.firstChild)?void 0:n.textContent)??""};for(let e=o(r-1,r);e&&!t.test(e);e=o(--r-1,r));for(let e=o(n,n+1);e&&!t.test(e);e=o(++n,n+1));if(r===n)return;let i=e.doc.textBetween(r,n,"","\n\n");return{from:r,to:n,text:i}}(e,/\W/)},"Po",0,function(e){let t=[];for(let r of e.split("-")){if(function(e){let t=["command","cmd","meta"];return iI.isMac&&t.push("mod"),t.includes(e)}(r=r.toLowerCase())){t.push({type:"modifier",symbol:"⌘",key:"command",i18n:rS.COMMAND_KEY});continue}if(function(e){let t=["control","ctrl"];return iI.isMac||t.push("mod"),t.includes(e)}(r)){t.push({type:"modifier",symbol:"⌃",key:"control",i18n:rS.CONTROL_KEY});continue}switch(r){case"shift":t.push({type:"modifier",symbol:"⇧",key:r,i18n:rS.SHIFT_KEY});continue;case"alt":t.push({type:"modifier",symbol:"⌥",key:r,i18n:rS.ALT_KEY});continue;case"\n":case"\r":case"enter":t.push({type:"named",symbol:"↵",key:r,i18n:rS.ENTER_KEY});continue;case"backspace":t.push({type:"named",symbol:"⌫",key:r,i18n:rS.BACKSPACE_KEY});continue;case"delete":t.push({type:"named",symbol:"⌦",key:r,i18n:rS.DELETE_KEY});continue;case"escape":t.push({type:"named",symbol:"␛",key:r,i18n:rS.ESCAPE_KEY});continue;case"tab":t.push({type:"named",symbol:"⇥",key:r,i18n:rS.TAB_KEY});continue;case"capslock":t.push({type:"named",symbol:"⇪",key:r,i18n:rS.CAPS_LOCK_KEY});continue;case"space":t.push({type:"named",symbol:"␣",key:r,i18n:rS.SPACE_KEY});continue;case"pageup":t.push({type:"named",symbol:"⤒",key:r,i18n:rS.PAGE_UP_KEY});continue;case"pagedown":t.push({type:"named",symbol:"⤓",key:r,i18n:rS.PAGE_DOWN_KEY});continue;case"home":t.push({type:"named",key:r,i18n:rS.HOME_KEY});continue;case"end":t.push({type:"named",key:r,i18n:rS.END_KEY});continue;case"arrowleft":t.push({type:"named",symbol:"←",key:r,i18n:rS.ARROW_LEFT_KEY});continue;case"arrowright":t.push({type:"named",symbol:"→",key:r,i18n:rS.ARROW_RIGHT_KEY});continue;case"arrowup":t.push({type:"named",symbol:"→",key:r,i18n:rS.ARROW_UP_KEY});continue;case"arrowdown":t.push({type:"named",symbol:"↓",key:r,i18n:rS.ARROW_DOWN_KEY});continue;default:t.push({type:"char",key:r});continue}}return t},"tE",0,function(e,t){var r,n;let o=si(null==(n=e)?void 0:n.ownerDocument);return(null==(r=null==o?void 0:o.getComputedStyle(e))?void 0:r.getPropertyValue(t))??""},"Ei",0,sr,"Cs",0,function(e){return e.docChanged||e.selectionSet},"Wg",0,sa,"l8",0,function(e){return eh(e)&&e instanceof ri},"E$",0,i6,"q1",0,function(e,t={}){var r;let n=(null==(r=e.type.schema.nodes.doc)?void 0:r.createAndFill())??void 0;if(!n)return!1;let{ignoreAttributes:o,ignoreDocAttributes:i}=t;return o?function e(t,r){return t===r||t.type===r.type&&e$.sameSet(t.marks,r.marks)&&function(){if(t.content===r.content)return!0;if(t.content.size!==r.content.size)return!1;let n=[],o=[];
6for(let[i,s]of(t.content.forEach(e=>n.push(e)),r.content.forEach(e=>o.push(e)),n.entries())){let t=o[i];if(!t||!e(s,t))return!1}return!0}()}(n,e):i?n.content.eq(e.content):n.eq(e)},"x8",0,iL,"yU",0,iB,"bd",0,i8,"h8",0,su,"OQ",0,iG,"z8",0,i4,"gL",0,iU,"XG",0,iV,"ye",0,i9,"Rc",0,iZ,"Rm",0,iQ,"qz",0,iX,"z3",0,iJ,"Ig",0,i$,"j$",0,sh,"Nf",0,sd,"WZ",0,i1,"Ul",0,function(e){let t,{regexp:r,type:n,getAttributes:o,ignoreWhitespace:i=!1,beforeDispatch:s,updateCaptured:a,shouldSkip:l,invalidMarks:c}=e,u=new rN(r,(e,r,d,h)=>{let{tr:p,schema:f}=e;t||eI(t=ea(n)?f.marks[n]:n,{code:L.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`});let m=r[1],g=r[0],y=sw({captureGroup:m,fullMatch:g,end:h,start:d,rule:u,state:e,ignoreWhitespace:i,invalidMarks:c,shouldSkip:l,updateCaptured:a});if(!y)return null;({start:d,end:h,captureGroup:m,fullMatch:g}=y);let v=ec(o)?o(r):o,b=h,w=[];if(m){let e=g.search(/\S/),t=d+g.indexOf(m),r=t+m.length;w=p.storedMarks??[],r<h&&p.delete(r,h),t>d&&p.delete(d+e,t),b=d+e+m.length}return p.addMark(d,b,t.create(v)),p.setStoredMarks(w),null==s||s({tr:p,match:r,start:d,end:h}),p});return u},"AQ",0,iW,"F9",0,function(e){let{regexp:t,type:r,getAttributes:n,beforeDispatch:o,shouldSkip:i,ignoreWhitespace:s=!1,updateCaptured:a,invalidMarks:l}=e,c=new rN(t,(e,t,u,d)=>{let h=ec(n)?n(t):n,{tr:p,schema:f}=e,m=ea(r)?f.nodes[r]:r,g=t[1],y=t[0],v=sw({captureGroup:g,fullMatch:y,end:d,start:u,rule:c,state:e,ignoreWhitespace:s,invalidMarks:l,shouldSkip:i,updateCaptured:a});if(!v)return null;({start:u,end:d,captureGroup:g,fullMatch:y}=v),eI(m,{code:L.SCHEMA,message:`No node exists for ${r} in the schema.`});let b=m.createAndFill(h);return b&&(p.replaceRangeWith(m.isBlock?p.doc.resolve(u).before():u,d,b),null==o||o({tr:p,match:[y,g??""],start:u,end:d})),p});return c},"Uo",0,function(e,t){let r=Z(t.defaults());return(0,rw.default)({...e},r)},"Fv",0,function(e){let{regexp:t,transformMatch:r,beforeDispatch:n,shouldSkip:o,ignoreWhitespace:i=!1,updateCaptured:s,invalidMarks:a}=e,l=new rN(t,(e,t,c,u)=>{let d=r(t);if(ed(d))return null;let{tr:h,schema:p}=e,f=t[1],m=t[0],g=sw({captureGroup:f,fullMatch:m,end:u,start:c,rule:l,state:e,ignoreWhitespace:i,invalidMarks:a,shouldSkip:o,updateCaptured:s});return g?({start:c,end:u,captureGroup:f,fullMatch:m}=g,""===d?h.delete(c,u):h.replaceWith(c,u,p.text(d)),null==n||n({tr:h,match:t,start:c,end:u}),h):null});return l},"mU",0,ss,"Vy",0,sv,"WM",0,sy,"Ys",0,sm,"vS",0,sg,"fI",0,sf,"Cz",0,function(e){return({dispatch:t,tr:r})=>{let{type:n,attrs:o=et(),appendText:i,range:s}=e,{$from:a,from:l,to:c}=s?rt.between(r.doc.resolve(s.from),r.doc.resolve(s.to)):r.selection,u=0===a.depth&&r.doc.type.allowsMarkType(n);return r.doc.nodesBetween(l,c,e=>{if(u)return!1;e.inlineContent&&e.type.allowsMarkType(n)&&(u=!0)}),!!u&&(null==t||t(r.addMark(l,c,n.create(o))&&i?r.insertText(i):r),!0)}},"E3",0,sp],964892);var rw=F,sx=function(){let e=Array.prototype.slice.call(arguments).filter(Boolean),t={},r=[];e.forEach(e=>{(e?e.split(" "):[]).forEach(e=>{if(e.startsWith("atm_")){let[,r]=e.split("_");t[r]=e}else r.push(e)})});let n=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(t[e]);return n.push(...r),n.join(" ")},sS=j;e.s(["pick",()=>sS.default],193964);var sS=j;let sk=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),sE=(e,t,r)=>{let n=function(e,t){let{$cursor:r}=e.selection;return r&&(t?t.endOfTextblock("backward",e):!(r.parentOffset>0))?r:null}(e,r);if(!n)return!1;let o=sO(n);if(!o){let r=n.blockRange(),o=r&&tF(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(s_(e,o,t,-1))return!0;if(0==n.parent.content.size&&(sC(i,"end")||rn.isSelectable(i)))for(let r=n.depth;;r--){let s=tJ(e.doc,n.before(r),n.after(r),eH.empty);if(s&&s.slice.size<s.to-s.from){if(t){let r=e.tr.step(s);r.setSelection(sC(i,"end")?t6.findFrom(r.doc.resolve(r.mapping.map(o.pos,-1)),-1):rn.create(r.doc,o.pos-i.nodeSize)),t(r.scrollIntoView())}return!0}if(1==r||n.node(r-1).childCount>1)break}return!!i.isAtom&&o.depth==n.depth-1&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function sC(e,t,r=!1){for(let n=e;n;n="start"==t?n.firstChild:n.lastChild){if(n.isTextblock)return!0;
6if(r&&1!=n.childCount)break}return!1}function sO(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function sM(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let r=e.node(t);if(e.index(t)+1<r.childCount)return e.doc.resolve(e.after(t+1));if(r.type.spec.isolating)break}return null}function sT(e){for(let t=0;t<e.edgeCount;t++){let{type:r}=e.edge(t);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}let sN=(e,t)=>{let{$head:r,$anchor:n}=e.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=sT(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let n=r.after(),o=e.tr.replaceWith(n,n,s.createAndFill());o.setSelection(t6.near(o.doc.resolve(n),1)),t(o.scrollIntoView())}return!0},sA=(e,t)=>{let{$from:r,to:n}=e.selection,o,i=r.sharedDepth(n);return 0!=i&&(o=r.before(i),t&&t(e.tr.setSelection(rn.create(e.doc,o))),!0)};function s_(e,t,r,n){let o,i,s,a=t.nodeBefore,l=t.nodeAfter,c,u,d=a.type.spec.isolating||l.type.spec.isolating;if(!d&&(o=t.nodeBefore,i=t.nodeAfter,s=t.index(),o&&i&&o.type.compatibleContent(i.type)&&(!o.content.size&&t.parent.canReplace(s-1,s)?(r&&r(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(i.isTextblock||tK(e.doc,t.pos))&&(r&&r(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let h=!d&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(c=(u=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&u.matchType(c[0]||l.type).validEnd){if(r){let n=t.pos+l.nodeSize,o=eV.empty;for(let e=c.length-1;e>=0;e--)o=eV.from(c[e].create(null,o));o=eV.from(a.copy(o));let i=e.tr.step(new tL(t.pos-1,n,t.pos,n,new eH(o,1,0),c.length,!0)),s=i.doc.resolve(n+2*c.length);s.nodeAfter&&s.nodeAfter.type==a.type&&tK(i.doc,s.pos)&&i.join(s.pos),r(i.scrollIntoView())}return!0}let p=l.type.spec.isolating||n>0&&d?null:t6.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&tF(f);if(null!=m&&m>=t.depth)return r&&r(e.tr.lift(f,m).scrollIntoView()),!0;if(h&&sC(l,"start",!0)&&sC(a,"end")){let n=a,o=[];for(;o.push(n),!n.isTextblock;)n=n.lastChild;let i=l,s=1;for(;!i.isTextblock;i=i.firstChild)s++;if(n.canReplace(n.childCount,n.childCount,i.content)){if(r){let n=eV.empty;for(let e=o.length-1;e>=0;e--)n=eV.from(o[e].copy(n));r(e.tr.step(new tL(t.pos-o.length,t.pos+l.nodeSize,t.pos+s,t.pos+l.nodeSize-s,new eH(n,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function sR(e){return function(t,r){let n=t.selection,o=e<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(r&&r(t.tr.setSelection(rt.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}let sD=sR(-1),sP=sR(1);function sI(e,t=null,r){let n=!1!==(r&&r.removeWhenPresent),o=!1!==(r&&r.enterInlineAtoms),i=!(r&&r.includeWhitespace);return function(r,s){let{empty:a,$cursor:l,ranges:c}=r.selection;if(a&&!l||!function(e,t,r,n){for(let o=0;o<t.length;o++){let{$from:i,$to:s}=t[o],a=0==i.depth&&e.inlineContent&&e.type.allowsMarkType(r);if(e.nodesBetween(i.pos,s.pos,(e,t)=>{if(a||!n&&e.isAtom&&e.isInline&&t>=i.pos&&t+e.nodeSize<=s.pos)return!1;a=e.inlineContent&&e.type.allowsMarkType(r)}),a)return!0}return!1}(r.doc,c,e,o))return!1;if(s)if(l)s(e.isInSet(r.storedMarks||l.marks())?r.tr.removeStoredMark(e):r.tr.addStoredMark(e.create(t)));else{let a,l=r.tr;o||(c=function(e){let t=[];for(let r=0;r<e.length;r++){let{$from:n,$to:o}=e[r];n.doc.nodesBetween(n.pos,o.pos,(e,r)=>{if(e.isAtom&&e.content.size&&e.isInline&&r>=n.pos&&r+e.nodeSize<=o.pos)return r+1>n.pos&&t.push(new t8(n,n.doc.resolve(r+1))),n=n.doc.resolve(r+1+e.content.size),!1}),n.pos<o.pos&&t.push(new t8(n,o))}return t}(c)),a=n?!c.some(t=>r.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!c.every(t=>{let r=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,(n,o,i)=>{if(r)return!1;r=!e.isInSet(n.marks)&&!!i&&i.type.allowsMarkType(e)&&!(n.isText&&/^\s*$/.test(n.textBetween(Math.max(0,t.$from.pos-o),Math.min(n.nodeSize,t.$to.pos-o))))}),!r});for(let r=0;r<c.length;r++){let{$from:n,$to:o}=c[r];if(a){let r=n.pos,s=o.pos,a=n.nodeAfter,c=o.nodeBefore,u=i&&a&&a.isText?/^\s*/.exec(a.text)[0].length:0,d=i&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;r+u<s&&(r+=u,s-=d),l.addMark(r,s,e.create(t))}else l.removeMark(n.pos,o.pos,e)}s(l.scrollIntoView())}return!0}}function sL(...e){return function(t,r,n){for(let o=0;o<e.length;o++)if(e[o](t,r,n))return!0;return!1}}let sB=sL(sk,sE,(e,t,r)=>{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):n.parentOffset>0)return!1;i=sO(n)}let s=i&&i.nodeBefore;return!!s&&!!rn.isSelectable(s)&&(t&&t(e.tr.setSelection(rn.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)}),sV=sL(sk,(e,t,r)=>{let n=function(e,t){let{$cursor:r}=e.selection;return r&&(t?t.endOfTextblock("forward",e):!(r.parentOffset<r.parent.content.size))?r:null}(e,r);if(!n)return!1;let o=sM(n);if(!o)return!1;let i=o.nodeAfter;if(s_(e,o,t,1))return!0;
6if(0==n.parent.content.size&&(sC(i,"start")||rn.isSelectable(i))){let r=tJ(e.doc,n.before(),n.after(),eH.empty);if(r&&r.slice.size<r.to-r.from){if(t){let n=e.tr.step(r);n.setSelection(sC(i,"start")?t6.findFrom(n.doc.resolve(n.mapping.map(o.pos)),1):rn.create(n.doc,n.mapping.map(o.pos))),t(n.scrollIntoView())}return!0}}return!!i.isAtom&&o.depth==n.depth-1&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},(e,t,r)=>{let{$head:n,empty:o}=e.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)return!1;i=sM(n)}let s=i&&i.nodeAfter;return!!s&&!!rn.isSelectable(s)&&(t&&t(e.tr.setSelection(rn.create(e.doc,i.pos)).scrollIntoView()),!0)}),sF={Enter:sL((e,t)=>{let{$head:r,$anchor:n}=e.selection;return!!r.parent.type.spec.code&&!!r.sameParent(n)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)},(e,t)=>{let r=e.selection,{$from:n,$to:o}=r;if(r instanceof ri||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=sT(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let r=(!n.parentOffset&&o.index()<o.parent.childCount?n:o).pos,s=e.tr.insert(r,i.createAndFill());s.setSelection(rt.create(s.doc,r+1)),t(s.scrollIntoView())}return!0},(e,t)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let n=r.before();if(tH(e.doc,n))return t&&t(e.tr.split(n).scrollIntoView()),!0}let n=r.blockRange(),o=n&&tF(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)},(e,t)=>{let{$from:r,$to:n}=e.selection;if(e.selection instanceof rn&&e.selection.node.isBlock)return!!r.parentOffset&&!!tH(e.doc,r.pos)&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],i,s,a=!1,l=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;a=r.end(e)==r.pos+(r.depth-e),l=r.start(e)==r.pos-(r.depth-e),s=sT(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));o.unshift(t||(a&&s?{type:s}:null)),i=e;break}if(1==e)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof rt||e.selection instanceof ri)&&c.deleteSelection();let u=c.mapping.map(r.pos),d=tH(c.doc,u,o.length,o);if(d||(o[0]=s?{type:s}:null,d=tH(c.doc,u,o.length,o)),!d)return!1;if(c.split(u,o.length,o),!a&&l&&r.node(i).type!=s){let e=c.mapping.map(r.before(i)),t=c.doc.resolve(e);s&&r.node(i-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(r.before(i)),s)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":sN,Backspace:sB,"Mod-Backspace":sB,"Shift-Backspace":sB,Delete:sV,"Mod-Delete":sV,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new ri(e.doc))),!0)},sj={"Ctrl-h":sF.Backspace,"Alt-Backspace":sF["Mod-Backspace"],"Ctrl-d":sF.Delete,"Ctrl-Alt-Backspace":sF["Mod-Delete"],"Alt-Delete":sF["Mod-Delete"],"Alt-d":sF["Mod-Delete"],"Ctrl-a":sD,"Ctrl-e":sP};for(let e in sF)sj[e]=sF[e];let sz=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?sj:sF;e.s(["v",0,sz,"J",0,sL,"A",0,sN,"I",0,sE,"V",0,sA,"r",0,sI],397455);for(var s$={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},sU={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sH="u">typeof navigator&&/Mac/.test(navigator.platform),sK="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),sW=0;sW<10;sW++)s$[48+sW]=s$[96+sW]=String(sW);for(var sW=1;sW<=24;sW++)s$[sW+111]="F"+sW;for(var sW=65;sW<=90;sW++)s$[sW]=String.fromCharCode(sW+32),sU[sW]=String.fromCharCode(sW);for(var sq in s$)sU.hasOwnProperty(sq)||(sU[sq]=s$[sq]);function sJ(e){var t=!(sH&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||sK&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?sU:s$)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}e.s(["j",0,s$,"R",0,sJ],924080);let sG="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),sY="u">typeof navigator&&/Win/.test(navigator.platform);
6function sX(e,t,r=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),r&&t.shiftKey&&(e="Shift-"+e),e}function sZ(e){let t=function(e){let t=Object.create(null);for(let r in e)t[function(e){let t,r,n,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))n=!0;else if(/^mod$/i.test(s))sG?o=!0:r=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),r&&(s="Ctrl-"+s),o&&(s="Meta-"+s),n&&(s="Shift-"+s),s}(r)]=e[r];return t}(e);return function(e,r){let n=sJ(r),o,i=t[sX(n,r)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==n.length&&" "!=n){if(r.shiftKey){let o=t[sX(n,r,!1)];if(o&&o(e.state,e.dispatch,e))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(sY&&r.ctrlKey&&r.altKey)&&(o=s$[r.keyCode])&&o!=n){let n=t[sX(o,r)];if(n&&n(e.state,e.dispatch,e))return!0}}return!1}}e.s(["f",0,sZ],169444);var sQ=new rv("pasteRule");function s0(e,t){return function r(n){let{fragment:o,rule:i,nodes:s}=n,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i,d=!1;return o.forEach(n=>{var o;if(u?.includes(n.type.name)||(o=n).type.spec.code||o.type.spec.group?.split(" ").includes("code"))return void s.push(n);if(!n.isText){let e=r({fragment:n.content,rule:i,nodes:[]});d||=e.transformed;let t=eV.fromArray(e.nodes);n.type.validContent(t)?s.push(n.copy(t)):s.push(...e.nodes);return}if(n.marks.some(e=>{var t;return"code"===(t=e).type.name||t.type.spec.group?.split(" ").includes("code")||c?.includes(e.type.name)}))return void s.push(n);let h=n.text??"",p=0;for(let r of ev(h,a)){let o=r[1],a=r[0];if(l&&o?.trim()===""||!a)return;let c=r.index,u=c+a.length;c>p&&s.push(n.cut(p,c));let h=n.cut(c,u);if(a&&o){let e=a.search(/\S/),t=c+a.indexOf(o),r=t+o.length;e&&s.push(n.cut(c,c+e)),h=n.cut(t,r)}e({nodes:s,rule:i,textNode:h,match:r,schema:t}),d=!0,p=u}h&&p<h.length&&s.push(n.cut(p))}),{nodes:s,transformed:d}}}function s1(e){let{nodes:t,rule:r,textNode:n,match:o,schema:i}=e,{transformMatch:s,getAttributes:a,markType:l}=r,c=ec(a)?a(o,!1):a,u=n.text??"",d=l.create(c),h=s?.(o);if(""===h)return;if(!1===h)return void t.push(i.text(u,n.marks));let p=d.addToSet(n.marks);t.push(i.text(h??u,p))}function s2(e){let{nodes:t,rule:r,textNode:n,match:o,schema:i}=e,{transformMatch:s}=r,a=s?.(o);if(""===a||!1===a)return;let l=a??n.text??"";t.push(i.text(l,n.marks))}function s3(e){let{nodes:t,rule:r,textNode:n,match:o}=e,{getAttributes:i,nodeType:s,getContent:a}=r,l=ec(i)?i(o,!1):i,c=(a?a(o):n)||void 0;t.push(s.createChecked(l,c))}
6var s9=["mark","node","text"];let s4=()=>({events:{},emit(e,...t){(this.events[e]||[]).forEach(e=>e(...t))},on(e,t){return(this.events[e]=this.events[e]||[]).push(t),()=>this.events[e]=(this.events[e]||[]).filter(e=>e!==t)}});e.s(["f",0,s4],102402);let s5=function(e,t){};e.s(["f",0,s5],103987);var s6=Object.defineProperty,s8=Object.getOwnPropertyDescriptor,s7=(e,t,r,n)=>{for(var o,i=n>1?void 0:n?s8(t,r):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&s6(t,r,i),i},ae=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},at=(e,t,r)=>(ae(e,t,"read from private field"),r?r.call(e):t.get(e)),ar=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},an=(e,t,r,n)=>(ae(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);function ao(e,t){return e===t}function ai(e){let{previousOptions:t,update:r,equals:n=ao}=e,o=eL({...t,...r}),i=et();for(let e of Z(t)){let r=t[e],s=o[e];if(n(r,s)){i[e]={changed:!1};continue}i[e]={changed:!0,previousValue:r,value:s}}return{changes:eL(i),options:o,pickChanged:e=>{let t=et();for(let r of e){let e=i[r];(null==e?void 0:e.changed)&&(t[r]=e.value)}return t}}}var as={[L.DUPLICATE_HELPER_NAMES]:"helper method",[L.DUPLICATE_COMMAND_NAMES]:"command method"};function aa(e){let{name:t,set:r,code:n}=e,o=as[n];eI(!r.has(t),{code:n,message:`There is a naming conflict for the name: ${t} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),r.add(t)}function al(...e){return ek(sx(...e).split(" ")).join(" ")}var ac="__IGNORE__",au=class{constructor(e,...[t]){this["~O"]={},this._mappedHandlers=et(),this.populateMappedHandlers(),this._options=this._initialOptions=eC(e,this.constructor.defaultOptions,t??et(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){let e=[],{customHandlerKeys:t,handlerKeys:r,staticKeys:n}=this.constructor;for(let o of Z(this._options))n.includes(o)||r.includes(o)||t.includes(o)||e.push(o);return e}ensureAllKeysAreDynamic(e){if(iI.isProduction)return;let t=[];for(let r of Z(e))this._dynamicKeys.includes(r)||t.push(r);eI(eg(t),{code:L.INVALID_SET_EXTENSION_OPTIONS,message:`Invalid properties passed into the 'setOptions()' method: ${JSON.stringify(t)}.`})}setOptions(e){var t;let r=this.getDynamicOptions();this.ensureAllKeysAreDynamic(e);let{changes:n,options:o,pickChanged:i}=ai({previousOptions:r,update:e});this.updateDynamicOptions(o),null==(t=this.onSetOptions)||t.call(this,{reason:"set",changes:n,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var e;let{changes:t,options:r,pickChanged:n}=ai({previousOptions:this.getDynamicOptions(),update:this._initialOptions});this.updateDynamicOptions(r),null==(e=this.onSetOptions)||e.call(this,{reason:"reset",options:r,changes:t,pickChanged:n,initialOptions:this._initialOptions})}getDynamicOptions(){return(0,rw.default)(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(e){this._options={...this._options,...e}}populateMappedHandlers(){for(let e of this.constructor.handlerKeys)this._mappedHandlers[e]=[]}createDefaultHandlerOptions(){let e=et();for(let t of this.constructor.handlerKeys)e[t]=(...e)=>{var r;let{handlerKeyOptions:n}=this.constructor,o=null==(r=n[t])?void 0:r.reducer,i=null==o?void 0:o.getDefault(...e);for(let[,r]of this._mappedHandlers[t]){let s=r(...e);if(function(e,t,r){let{__ALL__:n}=e,o=e[r];return(!!n||!!o)&&(!!o&&o.earlyReturnValue!==ac&&(ec(o.earlyReturnValue)?!0===o.earlyReturnValue(t):t===o.earlyReturnValue)||!!n&&n.earlyReturnValue!==ac&&(ec(n.earlyReturnValue)?!0===n.earlyReturnValue(t):t===n.earlyReturnValue))}(n,i=o?o.accumulator(i,s,...e):s,t))break}return i};return e}addHandler(e,t,r=D.Default){return this._mappedHandlers[e].push([r,t]),this.sortHandlers(e),()=>this._mappedHandlers[e]=this._mappedHandlers[e].filter(([,e])=>e!==t)}hasHandlers(e){return(this._mappedHandlers[e]??[]).length>0}sortHandlers(e){this._mappedHandlers[e]=eM(this._mappedHandlers[e],([e],[t])=>t-e)}addCustomHandler(e,t){var r;return(null==(r=this.onAddCustomHandler)?void 0:r.call(this,{[e]:t}))??eE}};au.defaultOptions={},au.staticKeys=[],au.handlerKeys=[],au.handlerKeyOptions={},au.customHandlerKeys=[];var ad=class extends au{constructor(...e){for(let t of(super(am,...e),this["~E"]={},this._extensions=eN(this.createExtensions(),e=>e.constructor),this.extensionMap=new Map,this._extensions))this.extensionMap.set(t.constructor,t)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${K(this.name)}Extension`}
6get store(){return eI(this._store,{code:L.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),eL(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(e,t){this.extensionMap.has(e)&&(this.extensionMap.set(e,t),this._extensions=this.extensions.map(r=>t.constructor===e?t:r))}createExtensions(){return[]}getExtension(e){let t=this.extensionMap.get(e);return eI(t,{code:L.INVALID_GET_EXTENSION,message:`'${e.name}' does not exist within the preset: '${this.name}'`}),t}isOfType(e){return this.constructor===e}setStore(e){this._store||(this._store=e)}clone(...e){return new this.constructor(...e)}setPriority(e){this.priorityOverride=e}};ad.defaultPriority=D.Default;var ah=class extends ad{static get[_](){return R.PlainExtensionConstructor}get[_](){return R.PlainExtension}},ap=class extends ad{static get[_](){return R.MarkExtensionConstructor}get[_](){return R.MarkExtension}get type(){return J(this.store.schema.marks,this.name)}constructor(...e){super(...e)}};ap.disableExtraAttributes=!1;var af=class extends ad{static get[_](){return R.NodeExtensionConstructor}get[_](){return R.NodeExtension}get type(){return J(this.store.schema.nodes,this.name)}constructor(...e){super(...e)}};af.disableExtraAttributes=!1;var am={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function ag(e){return iJ(e)&&iG(e,[R.PlainExtension,R.MarkExtension,R.NodeExtension])}function ay(e){return iJ(e)&&iG(e,R.PlainExtension)}function av(e){return iJ(e)&&iG(e,R.NodeExtension)}function ab(e){return iJ(e)&&iG(e,R.MarkExtension)}function aw(e){return t=>{let{defaultOptions:r,customHandlerKeys:n,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=e,c=q(t);for(let[e,t]of(r&&(c.defaultOptions=r),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=n??[],Object.entries(l)))c[e]||(c[e]=t);return q(c)}}var ax=class extends ah{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=et(),this.updateAttributes=(e=!0)=>{this.transformAttributes(),e&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var e,t,r;if(this.attributeObject=et(),null==(e=this.store.managerSettings.exclude)?void 0:e.attributes)return void this.store.setStoreKey("attributes",this.attributeObject);for(let e of(this.attributeList=[],this.store.extensions)){if(null==(t=e.options.exclude)?void 0:t.attributes)continue;let n=null==(r=e.createAttributes)?void 0:r.call(e),o={...n,class:al(...e.classNames??[],null==n?void 0:n.class)};this.attributeList.unshift(o)}for(let e of this.attributeList)this.attributeObject={...this.attributeObject,...e,class:al(this.attributeObject.class,e.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function aS(e={}){return(t,r,n)=>{(t.decoratedHelpers??(t.decoratedHelpers={}))[r]=e}}function ak(e={}){return(t,r,n)=>{(t.decoratedCommands??(t.decoratedCommands={}))[r]=e}}function aE(e){return(t,r,n)=>{(t.decoratedKeybindings??(t.decoratedKeybindings={}))[r]=e}}var aC=class{constructor(e){this.promiseCreator=e,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>e=>{let t=!0,{view:r,tr:n,dispatch:o}=e;if(!r)return!1;for(let r of this.validateHandlers)if(!r({...e,dispatch:()=>{}})){t=!1;break}return o&&t?(this.promiseCreator(e).then(e=>{this.runHandlers(this.successHandlers,{value:e,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(e=>{this.runHandlers(this.failureHandlers,{error:e,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),o(n),!0):t}}validate(e,t="push"){return this.validateHandlers[t](e),this}success(e,t="push"){return this.successHandlers[t](e),this}failure(e,t="push"){return this.failureHandlers[t](e),this}runHandlers(e,t){var r;for(let r of e)if(!r({...t,dispatch:()=>{}}))break;null==(r=t.dispatch)||r.call(t,t.tr)}};function aO(e){let{type:t,attrs:r,range:n,selection:o}=e;return e=>{let{dispatch:i,tr:s,state:a}=e,l=ea(t)?a.schema.marks[t]:t;if(eI(l,{code:L.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),n||o){let{from:e,to:a}=sr(o??n??s.selection,s.doc);return i4({trState:s,type:t,...n})?null==i||i(s.removeMark(e,a,l)):null==i||i(s.addMark(e,a,l.create(r))),!0}return iP(sI(l,r))(e)}}var aM=class extends ah{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(e,...t)=>{let{forcedUpdates:r}=this.getCommandMeta(e);return this.setCommandMeta(e,{forcedUpdates:ek([...r,...t])}),e}}get name(){return"commands"}get transaction(){let e=this.store.getState();this._transaction||(this._transaction=e.tr);let t=this._transaction.before.eq(e.doc),r=!eg(this._transaction.steps);if(!t){let t=e.tr;if(r)for(let e of this._transaction.steps)t.step(e);this._transaction=t}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(e){var t;let{extensions:r,helpers:n}=this.store,o=et(),i=new Set,s=et(),a=t=>{var r;let n=et(),i=()=>t??this.transaction,l=[],c=()=>l;for(let[e,t]of Object.entries(o))null!=(r=s[e])&&r.disableChaining||(n[e]=this.chainedFactory({chain:n,command:t.original,getTr:i,getChain:c}));let u=e=>{eI(e===i(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return n.run=(t={})=>{let r=l;for(let e of(l=[],r))if(!e(u)&&t.exitEarly)return;e.dispatch(i())},n.tr=()=>{let e=l;for(let t of(l=[],e))t(u);return i()},n.enabled=()=>{for(let e of l)if(!e())return!1;return!0},n.new=e=>a(e),n};for(let e of r){let r=(null==(t=e.createCommands)?void 0:t.call(e))??{},a=e.decoratedCommands??{},l={};for(let[t,o]of(s={...s,decoratedCommands:a},Object.entries(a))){let i=ea(o.shortcut)&&o.shortcut.startsWith("_|")?{shortcut:n.getNamedShortcut(o.shortcut,e.options)}:void 0;this.updateDecorated(t,{...o,name:e.name,...i}),r[t]=e[t].bind(e),o.active&&(l[t]=()=>{var t;return(null==(t=o.active)?void 0:t.call(o,e.options,this.store))??!1})}ef(r)||this.addCommands({active:l,names:i,commands:o,extensionCommands:r})}for(let[e,t]of Object.entries(a()))a[e]=t;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:e}){this._transaction=e.tr}createPlugin(){return{}}customDispatch(e){return e}insertText(e,t={}){return ea(e)?function(e,t={}){return({tr:r,dispatch:n,state:o})=>{let i=o.schema,s=r.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=t;if(!n)return!0;r.insertText(e,a,l);let u=J(r.steps,r.steps.length-1).getMap().map(l);for(let[e,t]of X(c))r.addMark(a,u,J(i.marks,e).create(t));return n(r),!0}}(e,t):this.store.createPlaceholderCommand({promise:e,placeholder:{type:"inline"},onSuccess:(e,r,n)=>this.insertText(e,{...t,...r})(n)}).generateCommand()}selectText(e,t={}){return({tr:r,dispatch:n})=>{let o=sr(e,r.doc);return(r.selection.anchor!==o.anchor||r.selection.head!==o.head||!!t.forceUpdate)&&(null==n||n(r.setSelection(o)),!0)}}selectMark(e){return t=>{let{tr:r}=t,n=i7(r.selection.$from,e);return!!n&&this.store.commands.selectText.original({from:n.from,to:n.to})(t)}}delete(e){return({tr:t,dispatch:r})=>{let{from:n,to:o}=e??t.selection;return null==r||r(t.delete(n,o)),!0}}emptyUpdate(e){return({tr:t,dispatch:r})=>(r&&(null==e||e(),r(t)),!0)}forceUpdate(...e){return({tr:t,dispatch:r})=>(null==r||r(this.forceUpdateTransaction(t,...e)),!0)}updateNodeAttributes(e,t){return({tr:r,dispatch:n})=>(null==n||n(r.setNodeMarkup(e,void 0,t)),!0)}setContent(e,t){return r=>{let{tr:n,dispatch:o}=r,i=this.store.manager.createState({content:e,selection:t});return!!i&&(null==o||o(n.replaceRangeWith(0,n.doc.nodeSize-2,i.doc)),!0)}}resetContent(){return e=>{let{tr:t,dispatch:r}=e,n=this.store.manager.createEmptyDoc();return n?this.setContent(n)(e):(null==r||r(t.delete(0,t.doc.nodeSize)),!0)}}emptySelection(){return({tr:e,dispatch:t})=>!e.selection.empty&&(null==t||t(e.setSelection(rt.near(e.selection.$anchor))),!0)}insertNewLine(){return({dispatch:e,tr:t})=>!!i1(t.selection)&&(null==e||e(t.insertText("\n")),!0)}insertNode(e,t={}){return({dispatch:r,tr:n,state:o})=>{var i;let{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=t,{from:u,to:d,$from:h}=sr(l??a??n.selection,n.doc);if(iX(e)||iZ(e)){let t=h.before(h.depth);return null==r||r(c&&u===d&&i8(h.parent)?n.replaceWith(t,t+h.parent.nodeSize,e):n.replaceWith(u,d,e)),!0}let p=ea(e)?o.schema.nodes[e]:e;eI(p,{code:L.SCHEMA,message:`The requested node type ${e} does not exist in the schema.`});let f=null==(i=t.marks)?void 0:i.map(e=>{if(e instanceof e$)return e;let t=ea(e)?o.schema.marks[e]:e;return eI(t,{code:L.SCHEMA,message:`The requested mark type ${e} does not exist in the schema.`}),t.create()}),m=p.createAndFill(s,ea(t.content)?o.schema.text(t.content):t.content,f);if(!m)return!1;let g=u!==d;return null==r||r(g?n.replaceRangeWith(u,d,m):n.insert(u,m)),!0}}focus(e){return t=>{let{dispatch:r,tr:n}=t,{view:o}=this.store;if(!1===e||o.hasFocus()&&(void 0===e||!0===e))return!1;if(void 0===e||!0===e){let{from:t=0,to:r=t}=n.selection;e={from:t,to:r}}return r&&this.delayedFocus(),this.selectText(e)(t)}}blur(e){return t=>{let{view:r}=this.store;return!!r.hasFocus()&&(requestAnimationFrame(()=>{r.dom.blur()}),!e||this.selectText(e)(t))}}setBlockNodeType(e,t,r,n=!0){return sm(e,t,r,n)}toggleWrappingNode(e,t,r){return sf(e,t,r)}toggleBlockNodeItem(e){return sg(e)}wrapInNode(e,t,r){return sp(e,t,r)}
6applyMark(e,t,r){return({tr:n,dispatch:o,state:i})=>{let s=sr(r??n.selection,n.doc),a=st(s),l=ea(e)?i.schema.marks[e]:e;if(eI(l,{code:L.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),s.empty&&!a||!function(e,t,r){for(let{$from:n,$to:o}of r){let r=0===n.depth&&t.type.allowsMarkType(e);if(t.nodesBetween(n.pos,o.pos,t=>{if(r)return!1;r=t.inlineContent&&t.type.allowsMarkType(e)}),r)return!0}return!1}(l,n.doc,s.ranges))return!1;if(!o)return!0;if(a)return n.removeStoredMark(l),t&&n.addStoredMark(l.create(t)),o(n),!0;let c=!1;for(let{$from:e,$to:t}of s.ranges){if(c)break;c=n.doc.rangeHasMark(e.pos,t.pos,l)}for(let{$from:e,$to:r}of s.ranges)c&&n.removeMark(e.pos,r.pos,l),t&&n.addMark(e.pos,r.pos,l.create(t));return o(n),!0}}toggleMark(e){return aO(e)}removeMark(e){return sv(e)}setMeta(e,t){return({tr:r})=>(r.setMeta(e,t),!0)}selectAll(){return this.selectText("all")}copy(){return e=>!e.tr.selection.empty&&(e.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var e;return(null==(e=navigator.clipboard)?void 0:e.readText)?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(e,t,r)=>this.insertNode(sa({content:e,schema:r.state.schema}),{selection:t})(r)}).generateCommand()}cut(){return e=>!e.tr.selection.empty&&(e.dispatch&&document.execCommand("cut"),!0)}replaceText(e){return sy(e)}getAllCommandOptions(){let e={};for(let[t,r]of this.decorated)ef(r)||(e[t]=r);return e}getCommandOptions(e){return this.decorated.get(e)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(e,t){if(!t)return void this.decorated.delete(e);let r=this.decorated.get(e)??{name:""};this.decorated.set(e,{...r,...t})}handleIosFocus(){iI.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(e){return this.getCommandMeta(e).forcedUpdates}getCommandMeta(e){let t=e.getMeta(this.pluginKey)??{};return{...aT,...t}}setCommandMeta(e,t){let r=this.getCommandMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addCommands(e){let{extensionCommands:t,commands:r,names:n,active:o}=e;for(let[e,i]of X(t))aa({name:e,set:n,code:L.DUPLICATE_COMMAND_NAMES}),eI(!aN.has(e),{code:L.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),r[e]=this.createUnchainedCommand(i,o[e])}unchainedFactory(e){return(...t)=>{let r,{shouldDispatch:n=!0,command:o}=e,{view:i}=this.store,{state:s}=i;return n&&(r=i.dispatch),o(...t)({state:s,dispatch:r,view:i,tr:s.tr})}}createUnchainedCommand(e,t){let r=this.unchainedFactory({command:e});return r.enabled=this.unchainedFactory({command:e,shouldDispatch:!1}),r.isEnabled=r.enabled,r.original=e,r.active=t,r}chainedFactory(e){return(...t)=>{let{chain:r,command:n,getTr:o,getChain:i}=e,s=i(),{view:a}=this.store,{state:l}=a;return s.push(e=>n(...t)({state:l,dispatch:e,view:a,tr:o()})),r}}};s7([ak()],aM.prototype,"customDispatch",1),s7([ak()],aM.prototype,"insertText",1),s7([ak()],aM.prototype,"selectText",1),s7([ak()],aM.prototype,"selectMark",1),s7([ak()],aM.prototype,"delete",1),s7([ak()],aM.prototype,"emptyUpdate",1),s7([ak()],aM.prototype,"forceUpdate",1),s7([ak()],aM.prototype,"updateNodeAttributes",1),s7([ak()],aM.prototype,"setContent",1),s7([ak()],aM.prototype,"resetContent",1),s7([ak()],aM.prototype,"emptySelection",1),s7([ak()],aM.prototype,"insertNewLine",1),s7([ak()],aM.prototype,"insertNode",1),s7([ak()],aM.prototype,"focus",1),s7([ak()],aM.prototype,"blur",1),s7([ak()],aM.prototype,"setBlockNodeType",1),s7([ak()],aM.prototype,"toggleWrappingNode",1),s7([ak()],aM.prototype,"toggleBlockNodeItem",1),s7([ak()],aM.prototype,"wrapInNode",1),s7([ak()],aM.prototype,"applyMark",1),s7([ak()],aM.prototype,"toggleMark",1),s7([ak()],aM.prototype,"removeMark",1),s7([ak()],aM.prototype,"setMeta",1),s7([ak({description:({t:e})=>e(rx.SELECT_ALL_DESCRIPTION),label:({t:e})=>e(rx.SELECT_ALL_LABEL),shortcut:I.SelectAll})],aM.prototype,"selectAll",1),s7([ak({description:({t:e})=>e(rx.COPY_DESCRIPTION),label:({t:e})=>e(rx.COPY_LABEL),shortcut:I.Copy,icon:"fileCopyLine"})],aM.prototype,"copy",1),s7([ak({description:({t:e})=>e(rx.PASTE_DESCRIPTION),label:({t:e})=>e(rx.PASTE_LABEL),shortcut:I.Paste,icon:"clipboardLine"})],aM.prototype,"paste",1),s7([ak({description:({t:e})=>e(rx.CUT_DESCRIPTION),label:({t:e})=>e(rx.CUT_LABEL),shortcut:I.Cut,icon:"scissorsFill"})],aM.prototype,"cut",1),s7([ak()],aM.prototype,"replaceText",1),s7([aS()],aM.prototype,"getAllCommandOptions",1),s7([aS()],aM.prototype,"getCommandOptions",1),s7([aS()],aM.prototype,"getCommandPro
6p",1),aM=s7([aw({defaultPriority:D.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],aM);var aT={forcedUpdates:[]},aN=new Set(["run","chain","original","raw","enabled","tr","new"]),aA=class extends ah{constructor(){super(...arguments),this.placeholders=oB.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=e=>{let t=ew(),{promise:r,placeholder:n,onFailure:o,onSuccess:i}=e;return new aC(r).validate(e=>this.addPlaceholder(t,n)(e)).success(e=>{let{state:r,tr:n,dispatch:s,view:a,value:l}=e,c=this.store.helpers.findPlaceholder(t);if(!c){let e=Error("The placeholder has been removed");return(null==o?void 0:o({error:e,state:r,tr:n,dispatch:s,view:a}))??!1}return this.removePlaceholder(t)({state:r,tr:n,view:a,dispatch:()=>{}}),i(l,c,{state:r,tr:n,dispatch:s,view:a})}).failure(e=>(this.removePlaceholder(t)({...e,dispatch:()=>{}}),(null==o?void 0:o(e))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:e=>{var t,r,n,o,i,s;let{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(e);if(l){for(let[,e]of(this.placeholders=oB.empty,this.placeholderWidgets))null==(r=(t=e.spec).onDestroy)||r.call(t,this.store.view,e.spec.element);this.placeholderWidgets.clear();return}for(let[,t]of(this.placeholders=this.placeholders.map(e.mapping,e.doc,{onRemove:e=>{var t,r;let n=this.placeholderWidgets.get(e.id);n&&(null==(r=(t=n.spec).onDestroy)||r.call(t,this.store.view,n.spec.element))}}),this.placeholderWidgets))null==(o=(n=t.spec).onUpdate)||o.call(n,this.store.view,t.from,t.spec.element,t.spec.data);for(let t of a){if("inline"===t.type){this.addInlinePlaceholder(t,e);continue}if("node"===t.type){this.addNodePlaceholder(t,e);continue}if("widget"===t.type){this.addWidgetPlaceholder(t,e);continue}}for(let{id:t,data:r}of u){let n=this.placeholderWidgets.get(t);if(!n)continue;let o=oP.widget(n.from,n.spec.element,{...n.spec,data:r});this.placeholders=this.placeholders.remove([n]).add(e.doc,[o]),this.placeholderWidgets.set(t,o)}for(let e of c){let t=this.placeholders.find(void 0,void 0,t=>t.id===e&&t.__type===aR),r=this.placeholderWidgets.get(e);r&&(null==(s=(i=r.spec).onDestroy)||s.call(i,this.store.view,r.spec.element)),this.placeholders=this.placeholders.remove(t),this.placeholderWidgets.delete(e)}}},props:{decorations:e=>{let t=this.options.decorations(e);for(let r of(t=t.add(e.doc,this.placeholders.find()),this.store.extensions)){if(!r.createDecorations)continue;let n=r.createDecorations(e).find();t=t.add(e.doc,n)}return t},handleDOMEvents:{blur:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(aD,!1)),!1),focus:e=>(this.options.persistentSelectionClass&&e.dispatch(e.state.tr.setMeta(aD,!0)),!1)}}}}updateDecorations(){return({tr:e,dispatch:t})=>(null==t||t(e),!0)}addPlaceholder(e,t,r){return({dispatch:n,tr:o})=>!!this.addPlaceholderTransaction(e,t,o,!n)&&(null==n||n(r?o.deleteSelection():o),!0)}updatePlaceholder(e,t){return({dispatch:r,tr:n})=>!!this.updatePlaceholderTransaction({id:e,data:t,tr:n,checkOnly:!r})&&(null==r||r(n),!0)}removePlaceholder(e){return({dispatch:t,tr:r})=>!!this.removePlaceholderTransaction({id:e,tr:r,checkOnly:!t})&&(null==t||t(r),!0)}clearPlaceholders(){return({tr:e,dispatch:t})=>!!this.clearPlaceholdersTransaction({tr:e,checkOnly:!t})&&(null==t||t(e),!0)}findPlaceholder(e){return this.findAllPlaceholders().get(e)}findAllPlaceholders(){let e=new Map;for(let t of this.placeholders.find(void 0,void 0,e=>e.__type===aR))e.set(t.spec.id,{from:t.from,to:t.to});return e}createDecorations(e){var t,r,n;let{persistentSelectionClass:o}=this.options;return!o||(null==(t=this.store.view)?void 0:t.hasFocus())||(null==(n=(r=this.store.helpers).isInteracting)?void 0:n.call(r))?oB.empty:function(e,t,r){let{selection:n,doc:o}=e;if(n.empty)return t;let{from:i,to:s}=n,a=i9(n)?oP.node(i,s,r):oP.inline(i,s,r);return t.add(o,[a])}(e,oB.empty,{class:ea(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(e,t){let{pos:r,createElement:n,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=e,u=(null==n?void 0:n(this.store.view,r))??document.createElement(a);u.classList.add(s);let d=oP.widget(r,u,{id:l,__type:aR,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(t.doc,[d])}addInlinePlaceholder(e,t){let r,{from:n=t.selection.from,to:o=t.selection.to,className:i,nodeName:s,id:a,type:l}=e;if(n===o){let e=document.createElement(s);e.classList.add(i),r=oP.widget(n,e,{id:a,type:l,__type:aR,widget:e})}else r=oP.inline(n,o,{nodeName:s,class:i},{id:a,__type:aR});this.placeholders=this.placeholders.add(t.doc,[r])}
6addNodePlaceholder(e,t){let{pos:r,className:n,nodeName:o,id:i}=e,s=el(r)?t.doc.resolve(r):t.selection.$from,a=el(r)?s.nodeAfter?{pos:r,end:s.nodeAfter.nodeSize}:void 0:ij(s);if(!a)return;let l=oP.node(a.pos,a.end,{nodeName:o,class:n},{id:i,__type:aR});this.placeholders=this.placeholders.add(t.doc,[l])}withRequiredBase(e,t){let{placeholderNodeName:r,placeholderClassName:n}=this.options,{nodeName:o=r,className:i,...s}=t;return{nodeName:o,className:(i?[n,i]:[n]).join(" "),...s,id:e}}getMeta(e){let t=e.getMeta(this.pluginKey)??{};return{...a_,...t}}setMeta(e,t){let r=this.getMeta(e);e.setMeta(this.pluginKey,{...r,...t})}addPlaceholderTransaction(e,t,r,n=!1){if(this.findPlaceholder(e))return!1;if(n)return!0;let{added:o}=this.getMeta(r);return this.setMeta(r,{added:[...o,this.withRequiredBase(e,t)]}),!0}updatePlaceholderTransaction(e){let{id:t,tr:r,checkOnly:n=!1,data:o}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;let{updated:i}=this.getMeta(r);return this.setMeta(r,{updated:ek([...i,{id:t,data:o}])}),!0}removePlaceholderTransaction(e){let{id:t,tr:r,checkOnly:n=!1}=e;if(!this.findPlaceholder(t))return!1;if(n)return!0;let{removed:o}=this.getMeta(r);return this.setMeta(r,{removed:ek([...o,t])}),!0}clearPlaceholdersTransaction(e){let{tr:t,checkOnly:r=!1}=e;return this.getPluginState()!==oB.empty&&(!!r||(this.setMeta(t,{clearTrackers:!0}),!0))}};s7([ak()],aA.prototype,"updateDecorations",1),s7([ak()],aA.prototype,"addPlaceholder",1),s7([ak()],aA.prototype,"updatePlaceholder",1),s7([ak()],aA.prototype,"removePlaceholder",1),s7([ak()],aA.prototype,"clearPlaceholders",1),s7([aS()],aA.prototype,"findPlaceholder",1),s7([aS()],aA.prototype,"findAllPlaceholders",1),aA=s7([aw({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(e,t,r)=>e.add(r.doc,t.find()),getDefault:()=>oB.empty}}},defaultPriority:D.Low})],aA);var a_={added:[],updated:[],clearTrackers:!1,removed:[]},aR="placeholderDecoration",aD="persistentSelectionFocus",aP=class extends ah{get name(){return"docChanged"}onStateUpdate(e){let{firstUpdate:t,transactions:r,tr:n}=e;!t&&(r??[n]).some(e=>null==e?void 0:e.docChanged)&&this.options.docChanged(e)}};aP=s7([aw({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:D.Lowest})],aP);var aI=class extends ah{get name(){return"helpers"}onCreate(){var e;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",sa);let t=et(),r=et(),n=et(),o=new Set;for(let i of this.store.extensions){av(i)&&(r[i.name]=e=>iU({state:this.store.getState(),type:i.type,attrs:e}),n[i.name]=e=>{var t;return null==(t=iH({state:this.store.getState(),type:i.type,attrs:e}))?void 0:t.node.attrs}),ab(i)&&(r[i.name]=e=>i4({trState:this.store.getState(),type:i.type,attrs:e}),n[i.name]=e=>{let t=i7(this.store.getState().selection.$from,i.type);return t&&e?iq(t.mark,e)?t.mark.attrs:void 0:null==t?void 0:t.mark.attrs});let s=(null==(e=i.createHelpers)?void 0:e.call(i))??{};for(let e of Object.keys(i.decoratedHelpers??{}))s[e]=i[e].bind(i);if(!ef(s))for(let[e,r]of X(s))aa({name:e,set:o,code:L.DUPLICATE_HELPER_NAMES}),t[e]=r}this.store.setStoreKey("attrs",n),this.store.setStoreKey("active",r),this.store.setStoreKey("helpers",t),this.store.setExtensionStore("attrs",n),this.store.setExtensionStore("active",r),this.store.setExtensionStore("helpers",t)}isSelectionEmpty(e=this.store.getState()){return i$(e)}isViewEditable(e=this.store.getState()){var t,r;return(null==(r=(t=this.store.view.props).editable)?void 0:r.call(t,e))??!1}getStateJSON(e=this.store.getState()){return e.toJSON()}getJSON(e=this.store.getState()){return e.doc.toJSON()}getRemirrorJSON(e=this.store.getState()){return this.getJSON(e)}insertHtml(e,t){return r=>{let{state:n}=r,o=sa({content:e,schema:n.schema,fragment:!0});return this.store.commands.insertNode.original(o,t)(r)}}getText({lineBreakDivider:e="\n\n",state:t=this.store.getState()}={}){return t.doc.textBetween(0,t.doc.content.size,e,"\0")}
6getTextBetween(e,t,r=this.store.getState().doc){return r.textBetween(e,t,"\n\n","\0")}getHTML(e=this.store.getState()){return ss(e.doc,this.store.document)}textToProsemirrorNode(e){let t=`<pre>${e.content}</pre>`;return this.store.stringHandlers.html({...e,content:t})}};s7([aS()],aI.prototype,"isSelectionEmpty",1),s7([aS()],aI.prototype,"isViewEditable",1),s7([aS()],aI.prototype,"getStateJSON",1),s7([aS()],aI.prototype,"getJSON",1),s7([aS()],aI.prototype,"getRemirrorJSON",1),s7([ak()],aI.prototype,"insertHtml",1),s7([aS()],aI.prototype,"getText",1),s7([aS()],aI.prototype,"getTextBetween",1),s7([aS()],aI.prototype,"getHTML",1),aI=s7([aw({})],aI);var aL=class extends ah{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var e,t;let r=[],n=this.store.markTags[A.ExcludeInputRules];for(let o of this.store.extensions)if((null==(e=this.store.managerSettings.exclude)||!e.inputRules)&&o.createInputRules&&(null==(t=o.options.exclude)||!t.inputRules))for(let e of o.createInputRules())e.shouldSkip=this.options.shouldSkipInputRule,e.invalidMarks=n,r.push(e);return rA({rules:r})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};aL=s7([aw({defaultPriority:D.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],aL);var aB=class extends ah{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:e})=>{var t,r;if(e)return this.extraKeyBindings=[...this.extraKeyBindings,e],null==(r=(t=this.store).rebuildKeymap)||r.call(t),()=>{var t,r;this.extraKeyBindings=this.extraKeyBindings.filter(t=>t!==e),null==(r=(t=this.store).rebuildKeymap)||r.call(t)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){let{shortcuts:e}=this.options;return ea(e)?a$[e]:e}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var e;return(null==(e=this.store.managerSettings.exclude)?void 0:e.keymap)?[]:(this.setupKeydownHandler(),[new rm({props:{handleKeyDown:(e,t)=>{var r;return null==(r=this.keydownHandler)?void 0:r.call(this,e,t)}}})])}setupKeydownHandler(){let e=this.generateKeymapBindings();this.keydownHandler=sZ(e)}generateKeymapBindings(){var e;let t=[],r=this.shortcutMap,n=this.store.getExtension(aM),o=e=>t=>aV({shortcut:t,map:r,store:this.store,options:e.options});for(let i of this.store.extensions){let s=i.decoratedKeybindings??{};if(null==(e=i.options.exclude)||!e.keymap)for(let[e,a]of(i.createKeymap&&t.push(function(e,t){let r,n,o={};for(let[i,s]of(em(e)?[n,r]=e:r=e,X(r)))o[aF(i,t)]=s;return es(n)?o:[n,o]}(i.createKeymap(o(i)),r)),X(s))){if(a.isActive&&!a.isActive(i.options,this.store))continue;let o=i[e].bind(i),s=aV({shortcut:a.shortcut,map:r,options:i.options,store:this.store}),l=ec(a.priority)?a.priority(i.options,this.store):a.priority??D.Low,c=et();for(let e of s)c[e]=o;t.push([l,c]),a.command&&n.updateDecorated(a.command,{shortcut:s})}}return iW(this.sortKeymaps([...this.extraKeyBindings,...t]))}arrowRightShortcut(e){let t=this.store.markTags[A.PreventExits],r=this.store.nodeTags[A.PreventExits];return this.exitMarkForwards(t,r)(e)}arrowLeftShortcut(e){let t=this.store.markTags[A.PreventExits],r=this.store.nodeTags[A.PreventExits];return iK(this.exitNodeBackwards(r),this.exitMarkBackwards(t,r))(e)}backspace(e){let t=this.store.markTags[A.PreventExits],r=this.store.nodeTags[A.PreventExits];return iK(this.exitNodeBackwards(r,!0),this.exitMarkBackwards(t,r,!0))(e)}createKeymap(){let{selectParentNodeOnEscape:e,undoInputRuleOnBackspace:t,excludeBaseKeymap:r}=this.options,n=et();if(!r)for(let[e,t]of X(sz))n[e]=iP(t);return t&&sz.Backspace&&(n.Backspace=iP(sL(rR,sz.Backspace))),e&&(n.Escape=iP(sA)),[D.Low,n]}getNamedShortcut(e,t={}){return e.startsWith("_|")?aV({shortcut:e,map:this.shortcutMap,store:this.store,options:t}):[e]}onSetOptions(e){var t,r;let{changes:n}=e;(n.excludeBaseKeymap.changed||n.selectParentNodeOnEscape.changed||n.undoInputRuleOnBackspace.changed)&&(null==(r=(t=this.store).rebuildKeymap)||r.call(t))}sortKeymaps(e){return eM(e.map(e=>em(e)?e:[D.Default,e]),(e,t)=>t[0]-e[0]).map(e=>e[1])}exitMarkForwards(e,t){return r=>{let{tr:n,dispatch:o}=r;if(!su(n.selection)||iz({selection:n.selection,types:t}))return!1;let i=n.selection.$from.marks().filter(t=>!e.includes(t.type.name));if(eg(i))return!1;if(!o)return!0;for(let e of i)n.removeStoredMark(e);return o(n.insertText(" ",n.selection.from)),!0}}exitNodeBackwards(e,t=!1){return r=>{let{tr:n}=r;if(!(t?sh:sd)(n.selection))return!1;let o=n.selection.$anchor.node();return!(!i8(o)||i6(o)||e.includes(o.type.name))&&this.store.commands.toggleBlockNodeItem.original({type:o.type})(r)}}exitMarkBackwards(e,t,r=!1){return n=>
6{let{tr:o,dispatch:i}=n;if(!(r?sh:sd)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(iz({selection:o.selection,types:t}))return!1;let s=[...o.storedMarks??[],...o.selection.$from.marks()].filter(t=>!e.includes(t.type.name));if(eg(s))return!1;if(!i)return!0;for(let e of s)o.removeStoredMark(e);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};function aV({shortcut:e,map:t,options:r,store:n}){return ea(e)?[aF(e,t)]:em(e)?e.map(e=>aF(e,t)):aV({shortcut:e=e(r,n),map:t,options:r,store:n})}function aF(e,t){return ee(Q(I),e)?t[e]:e}s7([aE({shortcut:"ArrowRight",isActive:e=>e.exitMarksOnArrowPress})],aB.prototype,"arrowRightShortcut",1),s7([aE({shortcut:"ArrowLeft",isActive:e=>e.exitMarksOnArrowPress})],aB.prototype,"arrowLeftShortcut",1),s7([aE({shortcut:"Backspace",isActive:e=>e.exitMarksOnArrowPress})],aB.prototype,"backspace",1),s7([aS()],aB.prototype,"getNamedShortcut",1),aB=s7([aw({defaultPriority:D.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],aB);var aj={[I.Copy]:"Mod-c",[I.Cut]:"Mod-x",[I.Paste]:"Mod-v",[I.PastePlain]:"Mod-Shift-v",[I.SelectAll]:"Mod-a",[I.Undo]:"Mod-z",[I.Redo]:iI.isMac?"Shift-Mod-z":"Mod-y",[I.Bold]:"Mod-b",[I.Italic]:"Mod-i",[I.Underline]:"Mod-u",[I.Strike]:"Mod-d",[I.Code]:"Mod-`",[I.Paragraph]:"Mod-Shift-0",[I.H1]:"Mod-Shift-1",[I.H2]:"Mod-Shift-2",[I.H3]:"Mod-Shift-3",[I.H4]:"Mod-Shift-4",[I.H5]:"Mod-Shift-5",[I.H6]:"Mod-Shift-6",[I.TaskList]:"Mod-Shift-7",[I.BulletList]:"Mod-Shift-8",[I.OrderedList]:"Mod-Shift-9",[I.Quote]:"Mod->",[I.Divider]:"Mod-Shift-|",[I.Codeblock]:"Mod-Shift-~",[I.ClearFormatting]:"Mod-Shift-C",[I.Superscript]:"Mod-.",[I.Subscript]:"Mod-,",[I.LeftAlignment]:"Mod-Shift-L",[I.CenterAlignment]:"Mod-Shift-E",[I.RightAlignment]:"Mod-Shift-R",[I.JustifyAlignment]:"Mod-Shift-J",[I.InsertLink]:"Mod-k",[I.Find]:"Mod-f",[I.FindBackwards]:"Mod-Shift-f",[I.FindReplace]:"Mod-Shift-H",[I.AddFootnote]:"Mod-Alt-f",[I.AddComment]:"Mod-Alt-m",[I.ContextMenu]:"Mod-Shift-\\",[I.IncreaseFontSize]:"Mod-Shift-.",[I.DecreaseFontSize]:"Mod-Shift-,",[I.IncreaseIndent]:"Tab",[I.DecreaseIndent]:"Shift-Tab",[I.Shortcuts]:"Mod-/",[I.Format]:iI.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},az={...aj,[I.Strike]:"Mod-Shift-S",[I.Code]:"Mod-Shift-M",[I.Paragraph]:"Mod-Alt-0",[I.H1]:"Mod-Alt-1",[I.H2]:"Mod-Alt-2",[I.H3]:"Mod-Alt-3",[I.H4]:"Mod-Alt-4",[I.H5]:"Mod-Alt-5",[I.H6]:"Mod-Alt-6",[I.OrderedList]:"Mod-Alt-7",[I.BulletList]:"Mod-Alt-8",[I.Quote]:"Mod-Alt-9",[I.ClearFormatting]:"Mod-\\",[I.IncreaseIndent]:"Mod-[",[I.DecreaseIndent]:"Mod-]"},a$={default:aj,googleDoc:az},aU=class extends ah{get name(){return"nodeViews"}createPlugin(){let e=[],t=et();for(let t of this.store.extensions){if(!t.createNodeViews)continue;let r=t.createNodeViews();e.unshift(ec(r)?{[t.name]:r}:r)}for(let r of(e.unshift(this.store.managerSettings.nodeViews??{}),e))Object.assign(t,r);return{props:{nodeViews:t}}}},aH=class extends ah{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var e,t;let r,n=[];for(let r of this.store.extensions){if((null==(e=this.store.managerSettings.exclude)?void 0:e.pasteRules)||!r.createPasteRules||(null==(t=r.options.exclude)?void 0:t.pasteRules))continue;let o=r.createPasteRules(),i=em(o)?o:[o];n.push(...i)}let o=eM(n,(e,t)=>(t.priority??D.Low)-(e.priority??D.Low)),i=[],s=[];for(let e of o)ee(s9,e.type)?i.push(e):s.push(e);return new rm({key:sQ,view:e=>(r=e,{}),props:{transformPasted:e=>{var t;let n,o=r.state.selection.$from,s=o.node().type.name,a=new Set(o.marks().map(e=>e.type.name));for(let t of i){if(t.ignoredNodes?.includes(s)||t.ignoredMarks?.some(e=>a.has(e)))continue;let n=e.content.firstChild?.textContent??"",o=!r.state.selection.empty&&1===e.content.childCount&&n,i=ev(n,t.regexp)[0];if(o&&i&&"mark"===t.type&&t.replaceSelection){let{from:e,to:n}=r.state.selection,o=r.state.doc.slice(e,n),s=o.content.textBetween(0,o.content.size);if("boolean"!=typeof t.replaceSelection?t.replaceSelection(s):t.replaceSelection){let e=[],{getAttributes:r,markType:n}=t,s=ec(r)?r(i,!0):r,a=n.create(s);return o.content.forEach(t=>{if(t.isText){let r=a.addToSet(t.marks);e.push(t.mark(r))}}),eH.maxOpen(eV.fromArray(e))}}let{nodes:l,transformed:c}=function(e,t,r){let n=[];switch(t.type){case"mark":return s0(s1,r)({fragment:e,nodes:n,rule:t});case"node":return s0(s3,r)({fragment:e,nodes:n,rule:t});default:return s0(s2,r)({fragment:e,nodes:n,rule:t})}}(e.content,t,r.state.schema);c&&(e="node"===t.type&&t.nodeType.isBlock?new eH(eV.fromArray(l),0,0):new eH(eV.fromArray(l),e.openStart,e.openEnd))}return t=e,(n=eH.maxOpen(t.content)).openStart<t.openStart||n.openEnd<t.openEnd?n:t},handleDOMEvents:{paste:(e,t)=>
6{if(!e.props.editable?.(e.state))return!1;let{clipboardData:r}=t;if(!r)return!1;let n=[...r.items].map(e=>e.getAsFile()).filter(e=>!!e);if(0===n.length)return!1;let{selection:o}=e.state;for(let{fileHandler:r,regexp:i}of s){let s=i?n.filter(e=>i.test(e.type)):n;if(0!==s.length&&r({event:t,files:s,selection:o,view:e,type:"paste"}))return t.preventDefault(),!0}return!1},drop:(e,t)=>{if(!e.props.editable?.(e.state))return!1;let{dataTransfer:r,clientX:n,clientY:o}=t;if(!r)return!1;let i=function(e){let{dataTransfer:t}=e;return t?t.files?.length>0?[...t.files]:t.items?.length?[...t.items].map(e=>e.getAsFile()).filter(e=>!!e):[]:[]}(t);if(0===i.length)return!1;let a=e.posAtCoords({left:n,top:o})?.pos??e.state.selection.anchor;for(let{fileHandler:r,regexp:n}of s){let o=n?i.filter(e=>n.test(e.type)):i;if(0!==o.length&&r({event:t,files:o,pos:a,view:e,type:"drop"}))return t.preventDefault(),!0}return!1}}}})}},aK=class extends ah{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=et(),this.stateGetters=new Map,this.getPluginStateCreator=e=>t=>e.getState(t??this.store.getState()),this.getStateByName=e=>{let t=this.stateGetters.get(e);return eI(t,{message:"No plugin exists for the requested extension name."}),t()}}get name(){return"plugins"}onCreate(){let{setStoreKey:e,setExtensionStore:t,managerSettings:r,extensions:n}=this.store;this.updateExtensionStore();let{plugins:o=[]}=r;for(let e of(this.updatePlugins(o,this.managerPlugins),n))e.onApplyState&&this.applyStateHandlers.push(e.onApplyState.bind(e)),e.onInitState&&this.initStateHandlers.push(e.onInitState.bind(e)),e.onAppendTransaction&&this.appendTransactionHandlers.push(e.onAppendTransaction.bind(e)),this.extractExtensionPlugins(e);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),e("pluginKeys",this.pluginKeys),e("getPluginState",this.getStateByName),t("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(e,t,r)=>{let n=r.tr,o={previousState:t,tr:n,transactions:e,state:r};for(let e of this.appendTransactionHandlers)e(o);return this.options.appendTransaction(o),n.docChanged||n.steps.length>0||n.selectionSet||n.storedMarksSet?n:void 0},state:{init:(e,t)=>{for(let e of this.initStateHandlers)e(t)},apply:(e,t,r,n)=>{let o={previousState:r,state:n,tr:e};for(let e of this.applyStateHandlers)e(o);this.options.applyState(o)}}}}extractExtensionPlugins(e){var t,r;if(!(!e.createPlugin&&!e.createExternalPlugins)&&(null==(t=this.store.managerSettings.exclude)||!t.plugins)&&(null==(r=e.options.exclude)||!r.plugins)){if(e.createPlugin){let t=new rv(e.name);this.pluginKeys[e.name]=t;let r=this.getPluginStateCreator(t);e.pluginKey=t,e.getPluginState=r,this.stateGetters.set(e.name,r),this.stateGetters.set(e.constructor,r);let n=new rm({...e.createPlugin(),key:t});this.updatePlugins([n],e.plugin?[e.plugin]:void 0),e.plugin=n}if(e.createExternalPlugins){let t=e.createExternalPlugins();this.updatePlugins(t,e.externalPlugins),e.externalPlugins=t}}}updatePlugins(e,t){if(!t||eg(t)){this.plugins=[...this.plugins,...e];return}if(e.length!==t.length){this.plugins=[...this.plugins.filter(e=>!t.includes(e)),...e];return}let r=new Map;for(let[n,o]of e.entries())r.set(J(t,n),o);this.plugins=this.plugins.map(e=>t.includes(e)?r.get(e):e)}updateExtensionStore(){let{setExtensionStore:e}=this.store;e("updatePlugins",this.updatePlugins.bind(this)),e("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),e("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(e){let t=ag(e)?e:iJ(e)&&iG(e,[R.PlainExtensionConstructor,R.MarkExtensionConstructor,R.NodeExtensionConstructor])?this.store.manager.getExtension(e):this.store.extensions.find(t=>t.name===e);eI(t,{code:L.INVALID_MANAGER_EXTENSION,message:`The extension ${e} does not exist within the editor.`}),this.extractExtensionPlugins(t),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){eI(this.store.phase>=P.EditorView,{code:L.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});let{view:e,updateState:t}=this.store;t(e.state.reconfigure({plugins:this.plugins}))}};
6aK=s7([aw({defaultPriority:D.Highest,handlerKeys:["applyState","appendTransaction"]})],aK);var aW=class extends ah{constructor(){super(...arguments),this.dynamicAttributes={marks:et(),nodes:et()}}get name(){return"schema"}onCreate(){let{managerSettings:e,tags:t,markNames:r,nodeNames:n,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=e;if(e.schema){let{nodes:t,marks:r}=function(e){let t=et(),r=et();for(let[r,n]of Object.entries(e.nodes))t[r]=n.spec;for(let[t,n]of Object.entries(e.marks))r[t]=n.spec;return{nodes:t,marks:r}}(e.schema);this.addSchema(e.schema,t,r);return}let c=i&&t[A.Block].includes(i)?{doc:et(),[i]:et()}:et(),u=et(),d=function(e){let{settings:t,gatheredSchemaAttributes:r,nodeNames:n,markNames:o,tags:i}=e,s=et();if(t.disableExtraAttributes)return s;for(let e of[...r,...t.extraAttributes??[]]??[])for(let t of function(e){let{identifiers:t,nodeNames:r,markNames:n,tags:o}=e;if("nodes"===t)return r;if("marks"===t)return n;if("all"===t)return[...r,...n];if(em(t))return t;eI(eu(t)&&em(t.tags),{code:L.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});let{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=t,d=new Set,h="mark"===u?n:"node"===u?r:[...n,...r],p=e=>h.includes(e)&&!(null==l?void 0:l.includes(e));for(let e of s)p(e)&&d.add(e);let f=new Map;for(let e of i)if(null==c||!c.includes(e))for(let t of o[e]){if(!p(t))continue;if("any"===a){d.add(t);continue}let r=f.get(t)??new Set;r.add(e),f.set(t,r)}for(let[e,t]of f)t.size===i.length&&d.add(e);return[...d]}({identifiers:e.identifiers,nodeNames:n,markNames:o,tags:i})){let r=s[t]??{};s[t]={...r,...e.attributes}}return s}({settings:e,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:n,markNames:r,tags:t});for(let e of o){d[e.name]={...d[e.name],...e.options.extraAttributes};let t=!0===s||!0===e.options.disableExtraAttributes||!0===e.constructor.disableExtraAttributes;if(av(e)){let{spec:r,dynamic:n}=aq({createExtensionSpec:(t,r)=>e.createNodeSpec(t,r),extraAttributes:J(d,e.name),override:{...a,...e.options.nodeOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags});e.spec=r,c[e.name]=r,Object.keys(n).length>0&&(this.dynamicAttributes.nodes[e.name]=n)}if(ab(e)){let{spec:r,dynamic:n}=aq({createExtensionSpec:(t,r)=>e.createMarkSpec(t,r),extraAttributes:J(d,e.name),override:{...l,...e.options.markOverride},ignoreExtraAttributes:t,name:e.constructorName,tags:e.tags??[]});e.spec=r,u[e.name]=r,Object.keys(n).length>0&&(this.dynamicAttributes.marks[e.name]=n)}}let h=new tl({nodes:c,marks:u,topNode:"doc"});this.addSchema(h,c,u)}createPlugin(){return{appendTransaction:(e,t,r)=>{let{tr:n}=r;return e.some(e=>e.docChanged)&&(0!==Object.keys(this.dynamicAttributes.nodes).length||0!==Object.keys(this.dynamicAttributes.marks).length)?(n.doc.descendants((e,t)=>(this.checkAndUpdateDynamicNodes(e,t,n),this.checkAndUpdateDynamicMarks(e,t,n),!0)),n.steps.length>0?n:null):null}}}addSchema(e,t,r){for(let n of(this.store.setStoreKey("nodes",t),this.store.setStoreKey("marks",r),this.store.setStoreKey("schema",e),this.store.setExtensionStore("schema",e),this.store.setStoreKey("defaultBlockNode",i5(e).name),Object.values(e.nodes)))if("doc"!==n.name&&(n.isBlock||n.isTextblock))break}checkAndUpdateDynamicNodes(e,t,r){for(let[n,o]of X(this.dynamicAttributes.nodes))if(e.type.name===n)for(let[n,i]of X(o)){if(!ed(e.attrs[n]))continue;let o={...e.attrs,[n]:i(e)};r.setNodeMarkup(t,void 0,o),iA(r)}}checkAndUpdateDynamicMarks(e,t,r){for(let[n,o]of X(this.dynamicAttributes.marks)){let i=J(this.store.schema.marks,n),s=e.marks.find(e=>e.type.name===n);if(s)for(let[e,n]of X(o)){if(!ed(s.attrs[e]))continue;let o=i7(r.doc.resolve(t),i);if(!o)continue;let{from:a,to:l}=o,c=i.create({...s.attrs,[e]:n(s)});r.removeMark(a,l,i).addMark(a,l,c),iA(r)}}}gatherExtraAttributes(e){let t=[];for(let r of e)r.createSchemaAttributes&&t.push(...r.createSchemaAttributes());return t}};function aq(e){var t,r,n,o,i,s,a,l,c;let{createExtensionSpec:u,extraAttributes:d,ignoreExtraAttributes:h,name:p,tags:f,override:m}=e,g=et(),y=!1,v=(r=d,n=h,o=function(){y=!0},i=function(e,t){g[e]=t},()=>{o();let e=et();if(n)return e;for(let[t,n]of X(r)){let r=aJ(n).default;ec(r)&&(i(t,r),r=null),e[t]=void 0===r?{}:{default:r}}return e}),b=u({defaults:v,parse:(s=d,a=h,e=>{let t=et();if(a)return t;for(let[r,n]of X(s)){let{parseDOM:o,...i}=aJ(n);if(iB(e)){if(ed(o)){t[r]=e.getAttribute(r)??i.default;continue}
6if(ec(o)){t[r]=o(e)??i.default;continue}t[r]=e.getAttribute(o)??i.default}}return t}),dom:(l=d,c=h,e=>{let t=et();if(c)return t;function r(r,n){if(r){if(ea(r)){t[n]=r;return}if(em(r)){let[o,i]=r;t[o]=i??e.attrs[n];return}for(let[e,n]of X(r))t[e]=n}}for(let[o,i]of X(l)){let{toDOM:s,parseDOM:a}=aJ(i);if(ed(s)){t[ea(a)?a:o]=e.attrs[o];continue}if(ec(s)){var n;r(s(e.attrs,iX(n=e)?{node:n}:iQ(n)?{mark:n}:{}),o);continue}r(s,o)}return t})},m);return eI(h||y,{code:L.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${p}' to 'true'.`}),b.group=[...(null==(t=b.group)?void 0:t.split(" "))??[],...f].join(" ")||void 0,{spec:b,dynamic:g}}function aJ(e){return ea(e)||ec(e)?{default:e}:(eI(e,{message:`${er(e)} is not supported`,code:L.EXTENSION_EXTRA_ATTRIBUTES}),e)}aW=s7([aw({defaultPriority:D.Highest})],aW);var aG=class extends ah{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:e})=>{var t;if(e&&(null==(t=this.store.managerSettings.exclude)||!t.suggesters))return iN(this.store.getState(),e)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",e=>iN(this.store.getState(),e)),this.store.setExtensionStore("removeSuggester",e=>i_(this.store.getState(),e))}createExternalPlugins(){var e,t;let r=[];for(let n of this.store.extensions){if(null==(e=this.store.managerSettings.exclude)?void 0:e.suggesters)break;if(!n.createSuggesters||(null==(t=n.options.exclude)?void 0:t.suggesters))continue;let o=n.createSuggesters(),i=em(o)?o:[o];r.push(...i)}return[iR(...r)]}getSuggestState(e){return iT(e??this.store.getState())}getSuggestMethods(){let{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:e,clearIgnored:t,removeIgnored:r,ignoreNextExit:n,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(e){var t;
6return ee(em(e)?e:[e],null==(t=this.getSuggestState().match)?void 0:t.suggester.name)}};s7([aS()],aG.prototype,"getSuggestState",1),s7([aS()],aG.prototype,"getSuggestMethods",1),s7([aS()],aG.prototype,"isSuggesterActive",1),aG=s7([aw({customHandlerKeys:["suggester"]})],aG);var aY=class extends ah{constructor(){super(...arguments),this.allTags=et(),this.plainTags=et(),this.markTags=et(),this.nodeTags=et()}get name(){return"tags"}onCreate(){for(let e of(this.resetTags(),this.store.extensions))this.updateTagForExtension(e);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){let e=et(),t=et(),r=et(),n=et();for(let o of Q(A))e[o]=[],t[o]=[],r[o]=[],n[o]=[];this.allTags=e,this.plainTags=t,this.markTags=r,this.nodeTags=n}updateTagForExtension(e){var t,r,n;let o=new Set([...e.tags??[],...(null==(t=e.createTags)?void 0:t.call(e))??[],...e.options.extraTags??[],...(null==(r=this.store.managerSettings.extraTags)?void 0:r[e.name])??[]]);for(let t of o){eI((n=t,ee(Q(A),n)),{code:L.EXTENSION,message:`The tag provided by the extension: ${e.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[t].push(e.name),ay(e)&&this.plainTags[t].push(e.name),ab(e)&&this.markTags[t].push(e.name),av(e)&&this.nodeTags[t].push(e.name)}e.tags=[...o]}};aY=s7([aw({defaultPriority:D.Highest})],aY);var aX=new rv("remirrorFilePlaceholderPlugin"),aZ=class extends ah{get name(){return"upload"}createExternalPlugins(){let e;return[e=new rm({key:aX,state:{init:()=>({set:oB.empty,payloads:new Map}),apply(t,{set:r,payloads:n}){r=r.map(t.mapping,t.doc);let o=t.getMeta(e);if(o)if(0===o.type){let e=document.createElement("placeholder"),i=oP.widget(o.pos,e,{id:o.id});r=r.add(t.doc,[i]),n.set(o.id,o.payload)}else 1===o.type&&(r=r.remove(r.find(void 0,void 0,e=>e.id===o.id)),n.delete(o.id));return{set:r,payloads:n}}},props:{decorations(t){var r;return(null==(r=e.getState(t))?void 0:r.set)??null}}})]}},aQ=class extends ah{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),this.options.capture)for(let e of this.store.extensions)this.captureCommands(e),this.captureKeybindings(e)}createPlugin(){return{}}captureCommands(e){let t=e.decoratedCommands??{},r=e.createCommands;for(let r of Object.keys(t)){let t=e[r];e[r]=(...n)=>o=>{var i;let s=t(...n)(o);return o.dispatch&&s&&this.setCommandMeta(o.tr,{type:"command",chain:o.dispatch!==(null==(i=o.view)?void 0:i.dispatch),name:r,extension:e.name,decorated:!0}),s}}r&&(e.createCommands=()=>{let t=r();for(let[r,n]of Object.entries(t))t[r]=(...t)=>o=>{var i;let s=n(...t)(o);return o.dispatch&&s&&this.setCommandMeta(o.tr,{type:"command",chain:o.dispatch!==(null==(i=o.view)?void 0:i.dispatch),name:r,extension:e.name,decorated:!1}),s};return t})}captureKeybindings(e){}getCommandMeta(e){return e.getMeta(this.pluginKey)??[]}setCommandMeta(e,t){let r=this.getCommandMeta(e);e.setMeta(this.pluginKey,[...r,t])}};aQ=s7([aw({defaultOptions:{capture:iI.isDevelopment},staticKeys:["capture"],defaultPriority:D.Highest})],aQ);
6var a0=class{constructor(e){ar(this,l,ew()),ar(this,c,void 0),ar(this,u,void 0),ar(this,d,!0),ar(this,h,s4()),ar(this,p,void 0),ar(this,f,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=e=>{var t,r;eI(!this.manager.destroyed,{code:L.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),e=(null==(r=(t=this.props).onDispatchTransaction)?void 0:r.call(t,e,this.getState()))??e;let n=this.getState(),{state:o,transactions:i}=n.applyTransaction(e);an(this,u,n),this.updateState({state:o,tr:e,transactions:i});let s=this.manager.store.getForcedUpdates(e);eg(s)||this.updateViewProps(...s)},this.onChange=(e=et())=>{var t,r;let n=this.eventListenerProps(e);at(this,d)&&an(this,d,!1),null==(r=(t=this.props).onChange)||r.call(t,n)},this.onBlur=e=>{var t,r;let n=this.eventListenerProps();null==(r=(t=this.props).onBlur)||r.call(t,n,e),at(this,h).emit("blur",n,e)},this.onFocus=e=>{var t,r;let n=this.eventListenerProps();null==(r=(t=this.props).onFocus)||r.call(t,n,e),at(this,h).emit("focus",n,e)},this.setContent=(e,{triggerChange:t=!1}={})=>{let{doc:r}=this.manager.createState({content:e}),n=this.getState(),{state:o}=this.getState().applyTransaction(n.tr.replaceRangeWith(0,n.doc.nodeSize-2,r));if(t)return this.updateState({state:o,triggerChange:t});this.view.updateState(o)},this.clearContent=({triggerChange:e=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:e})},this.createStateFromContent=(e,t)=>this.manager.createState({content:e,selection:t}),this.focus=e=>{this.manager.store.commands.focus(e)},this.blur=e=>{this.manager.store.commands.blur(e)};let{getProps:t,initialEditorState:r,element:n}=e;if(an(this,c,t),an(this,f,r),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;let o=this.createView(r,n);this.manager.addView(o)}get addHandler(){return at(this,p)??an(this,p,at(this,h).on.bind(at(this,h)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return at(this,d)}get props(){return at(this,c).call(this)}get previousState(){return this.previousStateOverride??at(this,u)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return at(this,l)}get initialEditorState(){return at(this,f)}updateListener(e){let{state:t,tr:r}=e;return at(this,h).emit("updated",this.eventListenerProps({state:t,tr:r}))}update(e){let{getProps:t}=e;return an(this,c,t),this}updateViewProps(...e){let t=(0,sS.default)(this.updatableViewProps,e);this.view.setProps({...this.view.props,...t})}getAttributes(e){var t;let{attributes:r,autoFocus:n,classNames:o=[],label:i,editable:s}=this.props,a=null==(t=this.manager.store)?void 0:t.attributes,l=ec(r)?r(this.eventListenerProps()):r,c={};(n||el(n))&&(c=e?{autoFocus:!0}:{autofocus:"true"});let u=ek(al(e&&"Prosemirror","remirror-editor",null==a?void 0:a.class,...o).split(" ")).join(" ");return ex({...{role:"textbox",...c,"aria-multiline":"true",...!(s??!0)?{"aria-readonly":"true"}:{},"aria-label":i??"",...a,class:u},...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){at(this,h).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(e=et()){let{state:t,tr:r,transactions:n}=e;return{tr:r,transactions:n,internalUpdate:!r,view:this.view,firstRender:at(this,d),state:t??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:at(this,l),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};l=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,h=new WeakMap,p=new WeakMap,f=new WeakMap;var a1=class{constructor(e,t={}){ar(this,m,void 0),ar(this,g,et()),ar(this,y,et()),ar(this,v,void 0),ar(this,b,void 0),ar(this,w,P.None),ar(this,x,void 0),ar(this,S,!0),ar(this,k,{create:[],view:[],update:[],destroy:[]}),ar(this,E,[]),ar(this,C,s4()),ar(this,O,void 0),ar(this,M,void 0),this.get
6State=()=>{var e;return at(this,w)>=P.EditorView?this.view.state:(eI(at(this,O),{code:L.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),null==(e=at(this,O))?void 0:e.initialEditorState)},this.updateState=e=>{let t=this.getState();this.view.updateState(e),this.onStateUpdate({previousState:t,state:e})};let{extensions:r,extensionMap:n}=function(e,t){let r=[],n=new WeakMap,o=new WeakMap,i=[],s={duplicateMap:o,parentExtensions:[],gatheredExtensions:i,settings:t};for(let t of e)!function e(t,r){var n;let{gatheredExtensions:o,duplicateMap:i,parentExtensions:s,settings:a}=t,{extension:l,parentExtension:c}=r,{names:u=[]}=r;eI(ag(l),{code:L.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${l} was provided to the [[\`RemirrorManager\`]].`});let d=l.extensions;if(l.setPriority(null==(n=a.priority)?void 0:n[l.name]),o.push(l),function(e){let{duplicateMap:t,extension:r,parentExtension:n}=e,o=r.constructor,i=t.get(o),s=n?[n]:[];t.set(o,i?[...i,...s]:s)}({duplicateMap:i,extension:l,parentExtension:c}),0!==d.length){if(u.includes(l.name))return void s5(!1,`Circular dependency encountered when loading extensions: ${u.join(" > ")} > ${l.name}`);for(let r of(u=[...u,l.name],s.push(l),d))e(t,{names:u,extension:r,parentExtension:l})}}(s,{extension:t});i=eM(i,(e,t)=>t.priority-e.priority);let a=new WeakSet,l=new Set;for(let e of i){let t=e.constructor,i=e.name,s=o.get(t);eI(s,{message:`No entries were found for the ExtensionConstructor ${e.name}`,code:L.INTERNAL}),a.has(t)||l.has(i)||(a.add(t),l.add(i),r.push(e),n.set(t,e),s.forEach(r=>null==r?void 0:r.replaceChildExtension(t,e)))}let c=[];for(let e of r)!function(e){let{extension:t,found:r,missing:n}=e;if(t.requiredExtensions)for(let e of t.requiredExtensions??[])r.has(e)||n.push({Constructor:e,extension:t})}({extension:e,found:a,missing:c});return eI(eg(c),{code:L.MISSING_REQUIRED_EXTENSION,message:c.map(({Constructor:e,extension:t})=>`The extension '${t.name}' requires '${e.name} in order to run correctly.`).join("\n")}),{extensions:r,extensionMap:n}}(e,t);for(let e of(an(this,x,t),an(this,v,eL(r)),an(this,b,n),an(this,m,this.createExtensionStore()),an(this,w,P.Create),this.setupLifecycleHandlers(),at(this,k).create)){let t=e();t&&at(this,E).push(t)}}static create(e,t={}){return new a1([...e_(e),...function(e={}){e={...{exitMarksOnArrowPress:aB.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:aB.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:aB.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:aB.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:aA.defaultOptions.persistentSelectionClass},...e};let t=(0,sS.default)(e,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=(0,sS.default)(e,["persistentSelectionClass"]);return[new aY,new aW,new ax,new aK,new aL,new aH,new aU,new aG,new aM,new aI,new aB(t),new aP,new aZ,new aA(r)]}(t.builtin)],t)}get[_](){return R.Manager}get destroyed(){return at(this,w)===P.Destroy}get mounted(){return at(this,w)>=P.EditorView&&at(this,w)<P.Destroy}get output(){var e;return null==(e=at(this,O))?void 0:e.frameworkOutput}get frameworkAttached(){return!!at(this,O)}get extensions(){return at(this,v)}get stringHandlers(){return at(this,g)}get store(){return eL(at(this,y))}get extensionStore(){return eL(at(this,m))}get tr(){return this.getExtension(aM).transaction}get nodes(){return at(this,y).nodes}get marks(){return at(this,y).marks}get schema(){return at(this,y).schema}get extensionTags(){return at(this,y).tags}get view(){return at(this,y).view}get settings(){return at(this,x)}get document(){return at(this,x).document??so()}setupLifecycleHandlers(){let e=at(this,m),t=at(this,k),r=[],n=[],o=[];for(let i of(e.nodeNames=r,e.markNames=n,e.plainNames=o,at(this,v)))!function(e){var t,r,n,o;let{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=e;i.setStore(c);let d=null==(t=i.onCreate)?void 0:t.bind(i),h=null==(r=i.onView)?void 0:r.bind(i),p=null==(n=i.onStateUpdate)?void 0:n.bind(i),f=null==(o=i.onDestroy)?void 0:o.bind(i);d&&u.create.push(d),h&&u.view.push(h),p&&u.update.push(p),f&&u.destroy.push(f),ab(i)&&a.push(i.name),av(i)&&"doc"!==i.name&&s.push(i.name),ay(i)&&l.push(i.name)}({extension:i,nodeNames:r,markNames:n,plainNames:o,handlers:t,store:e})}setStringHandler(e,t){at(this,g)[e]=t}setStoreKey(e,t){at(this,y)[e]=t}getStoreKey(e){let t=at(this,y)[e];return eI(!ed(t),{code:L.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),t}setExtensionStore(e,t){eI(at(this,w)<=P.EditorView,{code:L.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),at(this,m)[e]=t}createExtensionStore(){let e,t,r=et();return Object.defineProperties(r,{extensions:{get:()=>at(this,v),enumerable:!0},phase:{get:()=>at(this,w),enumerable:!0},view:{get:()=>this.view,enumerable:!0},managerSettings:{get:()=>eL(at(this,x)),enumerable:!0},getState:{value:this.getState,enumerable:!0},updateState:{value:this.updateState,enumerable:!0},isMounted:{value:()=>this.mounted,enumerable:!0},getExtension:{value:this.getExtension.bind(this),enumerable:!0},manager:{get:()=>this,enumerable:!0},document:{get:()=>this.document,enumerable:!0},stringHandlers:{get:()=>at(this,g),enumerable:!0},currentState:{get:()=>e??(e=this.getState()),set:t=>{e=t},enumerable:!0},previousState:{get:()=>t,set:e=>{t=e},enumerable:!0}}),r.getStoreKey=this.getStoreKey.bind(this),r.setStoreKey=this.setStoreKey.bind(this),r.setExtensionStore=this.setExtensionStore.bind(this),r.setStringHandler=this.setStringHandler.bind(this),r}addView(e){if(at(this,w)>=P.EditorView)return this;for(let t of(an(this,S,!0),an(this,w,P.EditorView),at(this,y).view=e,at(this,k).view)){let r=t(e);r&&at(this,E).push(r)}return this}attachFramework(e,t){var r;at(this,O)!==e&&(at(this,O)&&(at(this,O).destroy(),null==(r=at(this,M))||r.call(this)),an(this,O,e),an(this,M,this.addHandler("stateUpdate",t)))}createEmptyDoc(){var e;let t=null==(e=this.schema.nodes.doc)?void 0:e.createAndFill();return eI(t,{code:L.INVALID_CONTENT,message:"An empty node could not be created due to an invali
6d schema."}),t}createState(e={}){let{onError:t,defaultSelection:r="end"}=this.settings,{content:n=this.createEmptyDoc(),selection:o=r,stringHandler:i=this.settings.stringHandler}=e,{schema:s,plugins:a}=this.store,l=sn({stringHandler:ea(i)?this.stringHandlers[i]:i,document:this.document,content:n,onError:t,schema:s,selection:o});return rf.create({schema:s,doc:l,plugins:a,selection:sr(o,l)})}addHandler(e,t){return at(this,C).on(e,t)}onStateUpdate(e){let t=at(this,S);at(this,m).currentState=e.state,at(this,m).previousState=e.previousState,t&&(an(this,w,P.Runtime),an(this,S,!1));let r={...e,firstUpdate:t};for(let e of at(this,k).update)e(r);at(this,C).emit("stateUpdate",r)}getExtension(e){let t=at(this,b).get(e);return eI(t,{code:L.INVALID_MANAGER_EXTENSION,message:`'${e.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),t}hasExtension(e){return!!at(this,b).get(e)}clone(){let e=at(this,v).map(e=>e.clone(e.options)),t=a1.create(()=>e,at(this,x));return at(this,C).emit("clone",t),t}recreate(e=[],t={}){let r=at(this,v).map(e=>e.clone(e.initialOptions)),n=a1.create(()=>[...r,...e],t);return at(this,C).emit("recreate",n),n}destroy(){var e,t,r,n,o,i;for(let n of(an(this,w,P.Destroy),(null==(e=this.view)?void 0:e.state.plugins)??[]))null==(r=null==(t=n.getState(this.view.state))?void 0:t.destroy)||r.call(t);for(let e of(null==(n=at(this,O))||n.destroy(),null==(o=at(this,M))||o.call(this),at(this,E)))e();for(let e of at(this,k).destroy)e();null==(i=this.view)||i.destroy(),at(this,C).emit("destroy")}includes(e){let t=[],r=[];for(let e of at(this,v))t.push(e.name,e.constructorName),r.push(e.constructor);return e.every(e=>ea(e)?ee(t,e):ee(r,e))}};m=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap,x=new WeakMap,S=new WeakMap,k=new WeakMap,E=new WeakMap,C=new WeakMap,O=new WeakMap,M=new WeakMap,e.s(["t",0,aP,"e",0,a0,"f",0,aL,"W",0,aB,"E",0,ap,"Z",0,af,"C",0,ah,"D",0,aK,"g",0,a1,"P",0,aG,"$",0,ak,"Q",0,al,"S",0,aw,"R",0,aS,"G",0,av,"d",0,function(e,t){return!!iJ(e)&&!!iG(e,R.Manager)&&(!t||e.includes(t))},"Y",0,aE,"r",0,aO],91155)},155691,e=>{var t=e.i(350219),r=e.i(812121),n=e.i(91155),o=e.i(964892),i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=(e,t,r,n)=>{for(var o,a=n>1?void 0:n?s(t,r):t,l=e.length-1;l>=0;l--)(o=e[l])&&(a=(n?o(t,r,a):o(a))||a);return n&&a&&i(t,r,a),a},l=class extends n.C{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=e=>(n,i)=>{let s=function(e,t){let r=t.target;if(r){let t,n=null===(t=e.docView.posFromDOM(r,0,void 0))||t<0?null:t;if(null!==n){let t=e.state.doc.resolve(n),r=+!t.node().isLeaf;return{pos:n,inside:t.start()-r}}}return e.posAtCoords({left:t.clientX,top:t.clientY})??void 0}(n,i);if(!s)return!1;let a=[],l=[],{inside:c,pos:u}=s;if(-1===c)return!1;let d=n.state.doc.resolve(u),h=d.depth+1;for(let e of(0,t.j)(h,1))a.push({node:e>d.depth&&d.nodeAfter?d.nodeAfter:d.node(e),pos:d.before(e)});for(let{type:e}of d.marksAcross(d)??[]){let t=(0,o.Vb)(d,e);t&&l.push(t)}return e(i,{view:n,nodes:a,marks:l,getMark:e=>{let o=(0,t.Z)(e)?n.state.schema.marks[e]:e;return(0,t.l)(o,{code:r.D.EXTENSION,message:`The mark ${e} being checked does not exist within the editor schema.`}),l.find(e=>e.mark.type===o)},getNode:e=>{var o;let i=(0,t.Z)(e)?n.state.schema.nodes[e]:e;(0,t.l)(i,{code:r.D.EXTENSION,message:"The node being checked does not exist"});let s=a.find(({node:e})=>e.type===i);if(s)return{...s,isRoot:!!(null==(o=a[0])?void 0:o.node.eq(s.node))}}})}}get name(){return"events"}onView(){var e,r;if(null==(e=this.store.managerSettings.exclude)||!e.clickHandler)for(let e of this.store.extensions){if(!e.createEventHandlers||(null==(r=e.options.exclude)?void 0:r.clickHandler))continue;let n=e.createEventHandlers();for(let[e,r]of(0,t.V)(n))this.addHandler(e,r)}}createPlugin(){let e=new WeakMap,n=(n,i,s,a,l,c,u,d)=>{let h=this.store.currentState,{schema:p,doc:f}=h,m=f.resolve(a),g=e.has(u),y=function(e){let{handled:n,view:i,$pos:s,state:a}=e,l={getMark:t._,markRanges:[],view:i,state:a};if(n)return l;for(let{type:e}of s.marksAcross(s)??[]){let t=(0,o.Vb)(s,e);t&&l.markRanges.push(t)}return l.getMark=e=>{let n=(0,t.Z)(e)?a.schema.marks[e]:e;return(0,t.l)(n,{code:r.D.EXTENSION,message:`The mark ${e} being checked does not exist within the editor schema.`}),l.markRanges.find(e=>e.mark.type===n)},l}({$pos:m,handled:g,view:s,state:h}),v=!1;g||(v=n(u,y)||v);let b={...y,pos:a,direct:d,nodeWithPosition:{node:l,pos:c},getNode:e=>{let n=(0,t.Z)(e)?p.nodes[e]:e;return(0,t.l)(n,{code:r.D.EXTENSION,message:"The node being checked does not exist"}),n===l.type?{node:l,pos:c}:void 0}};return e.set(u,!0),i(u,b)||v};return{props:{handleKeyPress:(e,t)=>this.options.keypress(t)||!1,handleKeyDown:(e,t)=>this.options.keydown(t)||!1,handleTextInput:(e,t,r,n)=>this.options.textInput({from:t,to:r,text:n})||!1,handleClickOn:(e,t,r,o,i,s)=>n(this.options.clickMark,this.options.click,e,t,r,o,i,s),handleDoubleClickOn:(e,t,r,o,i,s)=>n(this.options.doubleClickMark,this.options.doubleClick,e,t,r,o,i,s),handleTripleClickOn:(e,t,r,o,i,s)=>n(this.options.tripleClickMark,this.options.tripleClick,e,t,r,o,i,s),handleDOMEvents:{focu
6s:(e,t)=>this.options.focus(t)||!1,blur:(e,t)=>this.options.blur(t)||!1,mousedown:(e,t)=>(this.startMouseover(),this.options.mousedown(t)||!1),mouseup:(e,t)=>(this.endMouseover(),this.options.mouseup(t)||!1),mouseleave:(e,t)=>(this.mouseover=!1,this.options.mouseleave(t)||!1),mouseenter:(e,t)=>(this.mouseover=!0,this.options.mouseenter(t)||!1),keyup:(e,t)=>this.options.keyup(t)||!1,mouseout:this.createMouseEventHandler((e,t)=>{let r={...t,hovering:!1};return this.options.hover(e,r)||!1}),mouseover:this.createMouseEventHandler((e,t)=>{let r={...t,hovering:!0};return this.options.hover(e,r)||!1}),contextmenu:this.createMouseEventHandler((e,t)=>this.options.contextmenu(e,t)||!1),scroll:(e,t)=>this.options.scroll(t)||!1,copy:(e,t)=>this.options.copy(t)||!1,cut:(e,t)=>this.options.cut(t)||!1,paste:(e,t)=>this.options.paste(t)||!1}},view:e=>{let t=e.editable,r=this.options;return{update(e){let n=e.editable;n!==t&&(r.editable(n),t=n)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,this.mousedown||(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};a([(0,n.R)()],l.prototype,"isInteracting",1),l=a([(0,n.S)({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:r.z.High})],l),e.s(["f",0,l])},709188,833965,645689,751959,96996,e=>{var t,r,n,o,i,s,a,l,c,u,d,h,p,f,m,g,y,v,b,w,x,S,k,E=e.i(651325),C=e.i(812121),O=e.i(350219),M=e.i(91155),T=e.i(150506);e.i(121247);var N=e.i(409432),A=e.i(842685),_=e.i(155691),R=M,D=e.i(169444),P=e.i(237336),I=e.i(711379),L=e.i(140644);class B extends P.e{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return B.valid(r)?new B(r):P.e.near(r)}content(){return I.k.empty}eq(e){return e instanceof B&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new B(e.resolve(t.pos))}getBookmark(){return new V(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let r=e.index(t),n=e.node(t);if(0==r){if(n.type.spec.isolating)return!0;continue}for(let e=n.child(r-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||F(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let r=e.indexAfter(t),n=e.node(t);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let e=n.child(r);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||F(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let r=t.type.spec.allowGapCursor;if(null!=r)return r;let n=t.contentMatchAt(e.index()).defaultType;return n&&n.isTextblock}static findGapCursorFrom(e,t,r=!1){n:for(;;){if(!r&&B.valid(e))return e;let n=e.pos,o=null;for(let r=e.depth;;r--){let i=e.node(r);if(t>0?e.indexAfter(r)<i.childCount:e.index(r)>0){o=i.child(t>0?e.indexAfter(r):e.index(r)-1);break}if(0==r)return null;n+=t;let s=e.doc.resolve(n);if(B.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!P.C.isSelectable(o)){e=e.doc.resolve(n+o.nodeSize*t),r=!1;continue n}break}o=i,n+=t;let s=e.doc.resolve(n);if(B.valid(s))return s}return null}}}B.prototype.visible=!1,B.findFrom=B.findGapCursorFrom,P.e.jsonID("gapcursor",B);class V{constructor(e){this.pos=e}map(e){return new V(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return B.valid(t)?new B(t):P.e.near(t)}}function F(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let j=(0,D.f)({ArrowLeft:z("horiz",-1),ArrowRight:z("horiz",1),ArrowUp:z("vert",
6-1),ArrowDown:z("vert",1)});function z(e,t){let r="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,n,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof P.k){if(!o.endOfTextblock(r)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=B.findGapCursorFrom(s,t,a);return!!l&&(n&&n(e.tr.setSelection(new B(l))),!0)}}function $(e,t,r){if(!e||!e.editable)return!1;let n=e.state.doc.resolve(t);if(!B.valid(n))return!1;let o=e.posAtCoords({left:r.clientX,top:r.clientY});return!(o&&o.inside>-1&&P.C.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new B(n))),!0)}function U(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof B))return!1;let{$from:r}=e.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(e.state.schema.nodes.text);if(!n)return!1;let o=I.y.empty;for(let e=n.length-1;e>=0;e--)o=I.y.from(n[e].createAndFill(null,o));let i=e.state.tr.replace(r.pos,r.pos,new I.k(o,0,0));return i.setSelection(P.k.near(i.doc.resolve(r.pos+1))),e.dispatch(i),!1}function H(e){if(!(e.selection instanceof B))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",L.q.create(e.doc,[L.G.widget(e.selection.head,t,{key:"gapcursor"})])}var K=class extends R.C{get name(){return"gapCursor"}createExternalPlugins(){return[new P.x({props:{decorations:H,createSelectionBetween:(e,t,r)=>t.pos==r.pos&&B.valid(r)?new B(r):null,handleClick:$,handleKeyDown:j,handleDOMEvents:{beforeinput
6:U}}})]}};K=((e,t)=>{for(var r,n=t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=r(n)||n);return n})([(0,R.S)({})],K),(0,O.v)(B);var W=M,q=e.i(964892),J=e.i(246208),G=e.i(546754),Y=function(){};Y.prototype.append=function(e){return e.length?(e=Y.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Y.prototype.prepend=function(e){return e.length?Y.from(e).append(this):this},Y.prototype.appendInner=function(e){return new Z(this,e)},Y.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?Y.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Y.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},Y.prototype.forEach=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Y.prototype.map=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=this.length);var n=[];return this.forEach(function(t,r){return n.push(e(t,r))},t,r),n},Y.from=function(e){return e instanceof Y?e:e&&e.length?new X(e):Y.empty};var X=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,r){return 0==e&&r==this.length?this:new t(this.values.slice(e,r))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,r,n){for(var o=t;o<r;o++)if(!1===e(this.values[o],n+o))return!1},t.prototype.forEachInvertedInner=function(e,t,r,n){for(var o=t-1;o>=r;o--)if(!1===e(this.values[o],n+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(Y);Y.empty=new X([]);var Z=function(e){function t(t,r){e.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,r,n){var o=this.left.length;if(t<o&&!1===this.left.forEachInner(e,t,Math.min(r,o),n)||r>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,r)-o,n+o))return!1},t.prototype.forEachInvertedInner=function(e,t,r,n){var o=this.left.length;if(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(r,o)-o,n+o)||r<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),r,n))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var r=this.left.length;return t<=r?this.left.slice(e,t):e>=r?this.right.slice(e-r,t-r):this.left.slice(e,r).append(this.right.slice(0,t-r))},t.prototype.leafAppend=function(e){var r=this.right.leafAppend(e);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(e){var r=this.left.leafPrepend(e);if(r)return new t(r,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Y),Q=e.i(713249);class ee{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let r,n,o,i;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(n=(r=this.remapping(s,this.items.length)).maps.length);let a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){r||(n=(r=this.remapping(s,t+1)).maps.length),n--,c.push(e);return}if(r){c.push(new et(e.map));let t=e.step.map(r.slice(n)),o;t&&a.maybeStep(t).doc&&(o=a.mapping.maps[a.mapping.maps.length-1],l.push(new et(o,void 0,void 0,l.length+c.length))),n--,o&&r.appendMap(o,n)}else a.maybeStep(e.step);if(e.selection)return o=r?e.selection.map(r.slice(n)):e.selection,i=new ee(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:i,transform:a,selection:o}}addTransform(e,t,r,n){var o,i;let s,a=[],l=this.eventCount,c=this.items,u=!n&&c.length?c.get(c.length-1):null;for(let r=0;r<e.steps.length;r++){let o=e.steps[r].invert(e.docs[r]),i=new et(e.mapping.maps[r],o,t),s;(s=u&&u.merge(i))&&(i=s,r?a.pop():c=c.slice(0,c.length-1)),a.push(i),t&&(l++,t=void 0),n||(u=i)}let d=l-r.depth;return d>en&&(o=c,i=d,o.forEach((e,t)=>{if(e.selection&&0==i--)return s=t,!1}),c=o.slice(s),l-=d),new ee(c.append(a),l)}remapping(e,t){let r=new Q.l;
6return this.items.forEach((t,n)=>{let o=null!=t.mirrorOffset&&n-t.mirrorOffset>=e?r.maps.length-t.mirrorOffset:void 0;r.appendMap(t.map,o)},e,t),r}addMaps(e){return 0==this.eventCount?this:new ee(this.items.append(e.map(e=>new et(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],n=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},n);let a=t;this.items.forEach(t=>{let n=o.getMirror(--a);if(null==n)return;i=Math.min(i,n);let l=o.maps[n];if(t.step){let i=e.steps[n].invert(e.docs[n]),c=t.selection&&t.selection.map(o.slice(a+1,n));c&&s++,r.push(new et(l,i,c))}else r.push(new et(l))},n);let l=[];for(let e=t;e<i;e++)l.push(new et(o.maps[e]));let c=new ee(this.items.slice(0,n).append(l).append(r),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-r.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,n=[],o=0;return this.items.forEach((i,s)=>{if(s>=e)n.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(r)),s=e&&e.getMap();if(r--,s&&t.appendMap(s,r),e){let a=i.selection&&i.selection.map(t.slice(r));a&&o++;let l=new et(s.invert(),e,a),c,u=n.length-1;(c=n.length&&n[u].merge(l))?n[u]=c:n.push(l)}}else i.map&&r--},this.items.length,0),new ee(Y.from(n.reverse()),o)}}ee.empty=new ee(Y.empty,0);class et{constructor(e,t,r,n){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=n}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new et(t.getMap().invert(),t,this.selection)}}}class er{constructor(e,t,r,n,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=n,this.prevComposition=o}}let en=20;function eo(e){let t=[];for(let r=e.length-1;r>=0&&0==t.length;r--)e[r].forEach((e,r,n,o)=>t.push(n,o));return t}function ei(e,t){if(!e)return null;let r=[];for(let n=0;n<e.length;n+=2){let o=t.map(e[n],1),i=t.map(e[n+1],-1);o<=i&&r.push(o,i)}return r}let es=!1,ea=null;function el(e){let t=e.plugins;if(ea!=t){es=!1,ea=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){es=!0;break}}return es}let ec=new P.p("history"),eu=new P.p("closeHistory");function ed(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new P.x({key:ec,state:{init:()=>new er(ee.empty,ee.empty,null,0,-1),apply:(t,r,n)=>(function(e,t,r,n){let o=r.getMeta(ec),i;if(o)return o.historyState;r.getMeta(eu)&&(e=new er(e.done,e.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(0==r.steps.length)return e;if(s&&s.getMeta(ec))if(s.getMeta(ec).redo)return new er(e.done.addTransform(r,void 0,n,el(t)),e.undone,eo(r.mapping.maps),e.prevTime,e.prevComposition);else return new er(e.done,e.undone.addTransform(r,void 0,n,el(t)),null,e.prevTime,e.prevComposition);if(!1===r.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(i=r.getMeta("rebased"))return new er(e.done.rebased(r,i),e.undone.rebased(r,i),ei(e.prevRanges,r.mapping),e.prevTime,e.prevComposition);else return new er(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),ei(e.prevRanges,r.mapping),e.prevTime,e.prevComposition);{let o=r.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(r.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let r=!1;return e.mapping.maps[0].forEach((e,n)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&n>=t[o]&&(r=!0)}),r}(r,e.prevRanges)),a=s?ei(e.prevRanges,r.mapping):eo(r.mapping.maps);return new er(e.done.addTransform(r,i?t.selection.getBookmark():void 0,n,el(t)),ee.empty,a,r.time,null==o?e.prevComposition:o)}})(r,n,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,n="historyUndo"==r?ep:"historyRedo"==r?ef:null;return!!n&&!!e.editable&&(t.preventDefault(),n(e.state,e.dispatch))}}}})}function eh(e,t){return(r,n)=>{let o=ec.getState(r);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(n){let i=function(e,t,r){let n=el(t),o=ec.get(t).spec.config,i=(r?e.undone:e.done).popEvent(t,n);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(r?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,n),l=new er(r?a:i.remaining,r?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(ec,{redo:r,historyState:l})}(o,r,e);i&&n(t?i.scrollIntoView():i)}return!0}}let ep=eh(!1,!0),ef=eh(!0,!0);function em(e){let t=ec.getState(e);return t?t.done.eventCount:0}function eg(e){let t=ec.getState(e);return t?t.undone.eventCount:0}eh(!1,!1),eh(!0,!1),e.s(["c",0,ed,"b",0,ef,"E",0,eg,"j",0,ep,"m",0,em],833965);var ey=Object.defineProperty,ev=Object.getOwnPropertyDescriptor,eb=(e,t,r,n)=>{for(var o,i=n>1?void 0:n?ev(t,r):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&ey(t,r,i),i},ew=class extends W.C{constructor(){super(...arguments),this.wrapMethod=(e,t)=>({state:r,dispatch:n,view:o})=>{let{getState:i,getDispatch:s}=this.options,a=e((0,O.U)(i)?i():r,(0,O.U)(s)&&n?s():n,o);return null==t||t(a),a}}get name(){return"history"}createKeymap(){return{"Mod-y":q.$m.isMac?()=>!1:this.wrapMethod(ef,this.options.onRedo),"Mod-z":this.wrapMethod(ep,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(ef,this.options.onRedo)}}undoShortcut(e){return this.wrapMethod(ep,this.options.onUndo)(e)}redoShortcut(e){return this.wrapMethod(ef,this.options.onRedo)(e)}createExternalPlugins(){let{depth:e,newGroupDelay:t}=this.options;return[ed({depth:e,newGroupDelay:t})]}undo(){return(0,J.C)(this.wrapMethod(ep,this.options.onUndo))}redo(){return(0,J.C)(this.wrapMethod(ef,this.options.onRedo))}undoDepth(e=this.store.getState()){return em(e)}redoDepth(e=this.store.getState()){return eg(e)}};
6eb([(0,W.Y)({shortcut:C.n.Undo,command:"undo"})],ew.prototype,"undoShortcut",1),eb([(0,W.Y)({shortcut:C.n.Redo,command:"redo"})],ew.prototype,"redoShortcut",1),eb([(0,W.$)({disableChaining:!0,description:({t:e})=>e(G.G.UNDO_DESCRIPTION),label:({t:e})=>e(G.G.UNDO_LABEL),icon:"arrowGoBackFill"})],ew.prototype,"undo",1),eb([(0,W.$)({disableChaining:!0,description:({t:e})=>e(G.G.REDO_DESCRIPTION),label:({t:e})=>e(G.G.REDO_LABEL),icon:"arrowGoForwardFill"})],ew.prototype,"redo",1),eb([(0,W.R)()],ew.prototype,"undoDepth",1),eb([(0,W.R)()],ew.prototype,"redoDepth",1),ew=eb([(0,W.S)({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],ew),e.s(["f",0,ew],645689);var ex=M,eS=Object.defineProperty,ek=Object.getOwnPropertyDescriptor,eE=(e,t,r,n)=>{for(var o,i=n>1?void 0:n?ek(t,r):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&eS(t,r,i),i},eC=class extends ex.Z{get name(){return"paragraph"}createTags(){return[C.p.LastNodeCompatible,C.p.TextBlock,C.p.Block,C.p.FormattingNode]}createNodeSpec(e,t){return{content:"inline*",draggable:!1,...t,attrs:{...e.defaults()},parseDOM:[{tag:"p",getAttrs:t=>({...e.parse(t)})},...t.parseDOM??[]],toDOM:t=>["p",e.dom(t),0]}}convertParagraph(e={}){let{attrs:t,selection:r,preserveAttrs:n}=e;return this.store.commands.setBlockNodeType.original(this.type,t,r,n)}insertParagraph(e,t={}){let{selection:r,attrs:n}=t;return this.store.commands.insertNode.original(this.type,{content:e,selection:r,attrs:n})}shortcut(e){return this.convertParagraph()(e)}};eE([(0,ex.$)({icon:"paragraph",label:({t:e})=>e(G.o.CONVERT_LABEL),description:({t:e})=>e(G.o.CONVERT_DESCRIPTION)})],eC.prototype,"convertParagraph",1),eE([(0,ex.$)({icon:"paragraph",label:({t:e})=>e(G.o.INSERT_LABEL),description:({t:e})=>e(G.o.INSERT_DESCRIPTION)})],eC.prototype,"insertParagraph",1),eE([(0,ex.Y)({shortcut:C.n.Paragraph,command:"convertParagraph"})],eC.prototype,"shortcut",1),eC=eE([(0,ex.S)({defaultPriority:C.z.Medium})],eC);var eO=e.i(102402),eM=M,eT=e.i(387163),eN=e.i(952197),eA=Object.freeze({__proto__:null,ANIMATED_POPOVER:"remirror-animated-popover",BUTTON:"remirror-button",BUTTON_ACTIVE:"remirror-button-active",COLOR_PICKER:"remirror-color-picker",COLOR_PICKER_CELL:"remirror-color-picker-cell",COLOR_PICKER_CELL_SELECTED:"remirror-color-picker-cell-selected",COMPOSITE:"remirror-composite",DIALOG:"remirror-dialog",DIALOG_BACKDROP:"remirror-dialog-backdrop",EDITOR_WRAPPER:"remirror-editor-wrapper",FLEX_COLUMN:"remirror-flex-column",FLEX_ROW:"remirror-flex-row",FLOATING_POPOVER:"remirror-floating-popover",FORM:"remirror-form",FORM_GROUP:"remirror-form-group",FORM_LABEL:"remirror-form-label",FORM_MESSAGE:"remirror-form-message",GROUP:"remirror-group",INPUT:"remirror-input",MENU:"remirror-menu",MENU_BAR:"remirror-menu-bar",MENU_BUTTON:"remirror-menu-button",MENU_BUTTON_LEFT:"remirror-menu-button-left",MENU_BUTTON_NESTED_LEFT:"remirror-menu-button-nested-left",MENU_BUTTON_NESTED_RIGHT:"remirror-menu-button-nested-right",MENU_BUTTON_RIGHT:"remirror-menu-button-right",MENU_DROPDOWN_LABEL:"remirror-menu-dropdown-label",MENU_GROUP:"remirror-menu-group",MENU_ITEM:"remirror-menu-item",MENU_ITEM_CHECKBOX:"remirror-menu-item-checkbox",MENU_ITEM_COLUMN:"remirror-menu-item-column",MENU_ITEM_RADIO:"remirror-menu-item-radio",MENU_ITEM_ROW:"remirror-menu-item-row",MENU_PANE:"remirror-menu-pane",MENU_PANE_ACTIVE:"remirror-menu-pane-active",MENU_PANE_ICON:"remirror-menu-pane-icon",MENU_PANE_LABEL:"remirror-menu-pane-label",MENU_PANE_SHORTCUT:"remirror-menu-pane-shortcut",POPOVER:"remirror-popover",ROLE:"remirror-role",SEPARATOR:"remirror-separator",TAB:"remirror-tab",TABBABLE:"remirror-tabbable",TABLE_SIZE_EDITOR:"remirror-table-size-editor",TABLE_SIZE_EDITOR_BODY:"remirror-table-size-editor-body",TABLE_SIZE_EDITOR_CELL:"remirror-table-size-editor-cell",TABLE_SIZE_EDITOR_CELL_SELECTED:"remirror-table-size-editor-cell-selected",TABLE_SIZE_EDITOR_FOOTER:"remirror-table-size-editor-footer",TAB_LIST:"remirror-tab-list",TOOLBAR:"remirror-toolbar",TOOLTIP:"remirror-tooltip"}),e_=Object.freeze({__proto__:null,EMOJI_IMAGE:"remirror-emoji-image",EMOJI_POPUP_CHAR:"remirror-emoji-popup-char",EMOJI_POPUP_HIGHLIGHT:"remirror-emoji-popup-highlight",EMOJI_POPUP_HOVERED:"remirror-emoji-popup-hovered",EMOJI_POPUP_ITEM:"remirror-emoji-popup-item",EMOJI_POPUP_NAME:"remirror-emoji-popup-name",EMOJI_POPUP_WRAPPER:"remirror-emoji-popup-wrapper",EMOJI_WRAPPER:"remirror-emoji-wrapper"}),eR=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:"remirror-collapsible-list-item-button",COLLAPSIBLE_LIST_ITEM_CLOSED:"remirror-collapsible-list-item-closed",EDITOR:"remirror-editor",LIST_ITEM_CHECKBOX:"remirror-list-item-checkbox",LIST_ITEM_MARKER_CONTAINER:"remirror-list-item-marker-container",LIST_ITEM_WITH_CUSTOM_MARKER:"remirror-list-item-with-custom-mark",LIST_SPINE:"remirror-list-spine",UL_LIST_CONTENT:"remirror-ul-list-content"}),eD=Object.freeze({__proto__:null,MENTION_ATOM:"remirror-mention-atom",MENTION_ATOM_POPUP_CHAR:"remirror-mention-atom-popup-char",MENTION_ATOM_POPUP_HIGHLIGHT:"remirror-mention-atom-popup-highlight",MENTION_ATOM_POPUP_HOVERED:"remirror-mention-atom-popup-hovered",MENTION_ATOM_POPUP_ITEM:"remirror-mention-atom-popup-item",MENTION_ATOM_POPUP_NAME:"remirror-mention-atom-popup-name",MENTION_ATOM_POPUP_WRAPPER:"remirror-mention-atom-popup-wrapper",MENTION_ATOM_ZERO_ITEMS:"remirror-mention-atom-zero-items",SUGGEST_ATOM:"remirror-suggest-atom"}),eP=Object.freeze({__proto__:null,IS_EMPTY:"remirror-is-empty"}),eI=Object.freeze({__proto__:null,EDITOR:"remirror-editor",POSITIONER:"remirror-positioner",POSITIONER_WIDGET:"remirror-positioner-widget"});function eL(e){return e.replace(/([a-z])([\dA-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function eB(e){return`--rmr-${e.map(eL).join("-")}`}let eV={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},eF="#000000",ej="#ffffff",ez=(0,eN.z)(eF,.75),e$="#7963d2",eU="#bcd263",eH=eV.gray[1],eK="rgba(10,31,68,0.08)",eW="rgba(10,31,68,0.10)",eq="rgba(10,31,68,0.12)",eJ=(0,eN.V)((0,eN.z)(eF,.1),.13),eG={background:ej,border:ez,foreground:eF,muted:eH,primary:e$,secondary:eU,primaryText:"#fff",secondaryText:"#fff",text:"#252103",faded:eJ},eY={...eG,background:(0,eN.J)(ej,.15),border:(0,eN.J)(ez,.15),foreground:(0,eN.J)(eF,.15),muted:(0,eN.J)(eH,.15),primary:(0,eN.J)(e$,.15),secondary:(0,eN.J)(eU,.15),get text(){return(0,eN.D)(this.background)},get primaryText(){return(0,eN.D)(this.primary)},get secondaryText(){return(0,eN.D)(this.secondary)}},eX={...eG,background:(0,eN.J)(ej,.075),border:(0,eN.J)(ez,.075),foreground:(0,eN.J)(eF,.075),muted:(0,eN.J)(eH,.075),primary:(0,eN.J)(e$,.075),secondary:(0,eN.J)(eU,.075),get text(){return(0,eN.D)(this.background)},get primaryText(){return(0,eN.D)(this.primary)},get secondaryText(){return(0,eN.D)(this.secondary)}},eZ={color:{...eG,active:eY,hover:eX,shadow1:eK,shadow2:eW,shadow3:eq,backdrop:(0,eN.z)(eF,.1),outline:(0,eN.z)(e$,.6),table:{default:{border:(0,eN.V)(eF,.8),cell:(0,eN.V)(eF,.4),controller:eV.gray[3]},selected:{border:eV.blue[7],cell:eV.blue[1],controller:eV.blue[5]},preselect:{border:eV.blue[7],cell:(0,eN.V)(eF,.4),controller:eV.blue[5]},predelete:{border:eV.red[7],cell:eV.red[1],controller:eV.red[5]},mark:"#91919196"}},hue:eV,radius:{border:"0.25rem",extra:"0.5rem",circle:"50%"},fontFamily:{default:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif',heading:"inherit",mono:"Menlo, monospace"}
6,fontSize:{0:"12px",1:"14px",2:"16px",3:"20px",4:"24px",5:"32px",6:"48px",7:"64px",8:"96px",default:"16px"},space:{1:"4px",2:"8px",3:"16px",4:"32px",5:"64px",6:"128px",7:"256px",8:"512px"},fontWeight:{bold:"700",default:"400",heading:"700"},letterSpacing:{tight:"-1px",default:"normal",loose:"1px",wide:"3px"},lineHeight:{heading:"1.25em",default:"1.5em"},boxShadow:{1:`0 1px 1px ${eK}`,2:`0 1px 1px ${eW}`,3:`0 1px 1px ${eq}`}};e.s(["P",0,eA,"z",0,e_,"_",0,eR,"U",0,eD,"K",0,eP,"N",0,eI,"V",0,"remirror-theme","r",0,function(e={}){let t=[],r={};for(let[n,o]of Object.entries(e))!function e(n,o){if("string"==typeof o||"number"==typeof o){t.push(`${eB(n)}: ${o};`),r[eB(n)]=o;return}if("object"==typeof o&&o)for(let[t,r]of Object.entries(o))e([...n,t],r)}([n],o);return{css:t.join("\n"),styles:r}},"C",0,eZ],751959);var eQ=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,e1=(e,t,r,n)=>{for(var o,i=n>1?void 0:n?e0(t,r):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&eQ(t,r,i),i},e2=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},e3=(e,t,r)=>(e2(e,t,"read from private field"),r?r.call(e):t.get(e)),e9=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},e4=(e,t,r,n)=>(e2(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),e5=class{constructor(e){e9(this,t,(0,eO.f)()),e9(this,r,[]),e9(this,n,new Map),e9(this,o,[]),e9(this,i,!1),e9(this,s,void 0),e9(this,a,void 0),e9(this,l,void 0),e9(this,c,void 0),this.addListener=(e,r)=>e3(this,t).on(e,r),e4(this,s,e),e4(this,a,e.getActive),e4(this,c,e.getPosition),e4(this,l,e.getID),this.hasChanged=e.hasChanged,this.events=e.events??["state","scroll"]}static create(e){return new e5(e)}static fromPositioner(e,t){return e5.create({...e.basePositioner,...t})}get basePositioner(){return{getActive:e3(this,a),getPosition:e3(this,c),hasChanged:this.hasChanged,events:this.events,getID:e3(this,l)}}onActiveChanged(e){this.recentUpdate=e;let s=e3(this,a).call(this,e);e4(this,r,s),e4(this,n,new Map),e4(this,i,!1),e4(this,o,[]);let l=[];for(let[t,r]of s.entries()){let n=this.getID(r,t);e3(this,o).push(n),l.push({setElement:n=>this.addProps({...e,data:r,element:n},t),id:n,data:r})}e3(this,t).emit("update",l)}getID(e,t){var r;return(null==(r=e3(this,l))?void 0:r.call(this,e,t))??t.toString()}addProps(e,s){if(e3(this,i)||(e3(this,n).set(s,e),e3(this,n).size<e3(this,r).length))return;let a=[];for(let e of e3(this,r).keys()){let t=e3(this,n).get(e);(0,O.l)(t,{code:C.D.INTERNAL,message:"Something went wrong when retrieving the parameters"});let r=e3(this,o)[e];if(!r)return;a.push({position:e3(this,c).call(this,t),element:t.element,id:r})}e3(this,t).emit("done",a)}clone(e){return e5.create({...e3(this,s),...(0,O.U)(e)?e(e3(this,s)):e})}active(e){let t=(0,O.U)(e)?e:()=>e;return this.clone(e=>({getActive:r=>e.getActive(r).filter(t)}))}};function e6(e){let{tr:t,state:r,previousState:n}=e;return!!(!n||t&&function(e,t=te){let{key:r}=(null==e?void 0:e.getMeta(e7))??{};return r===t}
6(t))||(t?(0,q.Cs)(t):!r.doc.eq(n.doc)||!r.selection.eq(n.selection))}function e8(e,t,r={}){let n=t.getBoundingClientRect(),{accountForPadding:o=!1}=r,i=0,s=0,a=0,l=0;if((0,q.yU)(t)&&o){let e=Number.parseFloat((0,q.tE)(t,"padding-left").replace("px","")),r=Number.parseFloat((0,q.tE)(t,"padding-right").replace("px","")),n=Number.parseFloat((0,q.tE)(t,"padding-top").replace("px","")),o=Number.parseFloat((0,q.tE)(t,"padding-bottom").replace("px","")),c=Number.parseFloat((0,q.tE)(t,"border-left").replace("px","")),u=Number.parseFloat((0,q.tE)(t,"border-right").replace("px","")),d=Number.parseFloat((0,q.tE)(t,"border-top").replace("px","")),h=Number.parseFloat((0,q.tE)(t,"border-bottom").replace("px","")),p=t.offsetWidth-t.clientWidth,f=t.offsetHeight-t.clientHeight;i+=e+c+("rtl"===t.dir?p:0),s+=r+u+("rtl"===t.dir?0:p),a+=n+d,l+=o+h+f}let c=new DOMRect(n.left+i,n.top+a,n.width-s,n.height-l);for(let[t,r]of[[e.top,e.left],[e.top,e.right],[e.bottom,e.left],[e.bottom,e.right]])if((0,O.B)(t,c.top,c.bottom)&&(0,O.B)(r,c.left,c.right))return!0;return!1}t=new WeakMap,r=new WeakMap,n=new WeakMap,o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakMap,c=new WeakMap,e5.EMPTY=[];var e7="positionerUpdate",te="__all_positioners__",tt={y:-999999,x:-999999,width:0,height:0},tr={...tt,left:-999999,top:-999999,bottom:-999999,right:-999999},tn={...tt,rect:{...tr,toJSON:()=>tr},visible:!1},to=e5.create({hasChanged:e6,getActive(e){let{state:t}=e;if(!(0,q.Ig)(t)||t.selection.$anchor.depth>2)return e5.EMPTY;let r=(0,q.k0)({predicate:e=>e.type.isBlock,selection:t});return r?[r]:e5.EMPTY},getPosition(e){let{view:t,data:r}=e,n=t.nodeDOM(r.pos);if(!(0,q.yU)(n))return tn;let o=n.getBoundingClientRect(),i=t.dom.getBoundingClientRect(),s=o.height,a=o.width,l=t.dom.scrollLeft+o.left-i.left,c=t.dom.scrollTop+o.top-i.top,u=e8(o,t.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),ti=to.clone(({getActive:e})=>({getActive:t=>{let[r]=e(t);return r&&(0,q.bd)(r.node)&&r.node.type===(0,q.Dm)(t.state.schema)?[r]:e5.EMPTY}})),ts=ti.clone(({getPosition:e})=>({getPosition:t=>({...e(t),width:1})})),ta=ti.clone(({getPosition:e})=>({getPosition:t=>{let{width:r,x:n,y:o,height:i}=e(t);return{...e(t),width:1,x:r+n,rect:new DOMRect(r+n,o,1,i)}}}));function tl(e){return e5.create({hasChanged:e6,getActive:t=>{let{state:r,view:n}=t;if(!e(r)||!(0,q.WZ)(r.selection))return e5.EMPTY;try{let{head:e,anchor:t}=r.selection;return[{from:n.coordsAtPos(t),to:n.coordsAtPos(e)}]}catch{return e5.EMPTY}},getPosition(e){let{element:t,data:r,view:n}=e,{from:o,to:i}=r,s=t.offsetParent??n.dom,a=s.getBoundingClientRect(),l=Math.abs(i.bottom-o.top),c=l>o.bottom-o.top,u=Math.min(o.left,i.left),d=Math.min(o.top,i.top),h=s.scrollLeft+(c?i.left-a.left:u-a.left),p=s.scrollTop+d-a.top,f=c?1:Math.abs(o.left-i.right),m=new DOMRect(c?i.left:u,d,f,l),g=e8(m,n.dom);return{rect:m,y:p,x:h,height:l,width:f,visible:g}}})}var tc=tl(e=>!e.selection.empty),tu=tl(e=>e.selection.empty),td=tl(()=>!0),th=tc.clone(()=>({getActive:e=>{let{state:t,view:r}=e;if(!t.selection.empty)return e5.EMPTY;let n=(0,q.LA)(t);if(!n)return e5.EMPTY;try{return[{from:r.coordsAtPos(n.from),to:r.coordsAtPos(n.to)}]}catch{return e5.EMPTY}}})),tp={selection:tc,cursor:tu,always:td,block:to,emptyBlock:ti,emptyBlockStart:ts,emptyBlockEnd:ta,nearestWord:th},tf=class extends eM.C{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:e})=>{if(e)return this.positioners=[...this.positioners,e],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(t=>t!==e)}}}get name(){return"positioner"}createAttributes(){return{class:eI.EDITOR}}init(){this.onScroll=(0,eT.A)(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(e,t)=>(this.positioner(this.getBaseProps("hover",{hover:t})),!1),contextmenu:(e,t)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:t})),!1)}}onStateUpdate(e){this.positioner({...e,previousState:e.firstUpdate?void 0:e.previousState,event:"state",helpers:this.store.helpers})}createDecorations(e){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return L.q.empty;let t=L.G.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return L.q.create(e.doc,[t])}forceUpdatePositioners(e=te){return({tr:t,dispatch:r})=>(null==r||r(t.setMeta(e7,{key:e})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){let e=document.createElement("span");return e.dataset.id="remirror-positioner-widget",e.setAttribute("role","presentation"),e}triggerPositioner(e,t){e.hasChanged(t)&&e.onActiveChanged({...t,view:this.store.view})}positioner(e){for(let t of this.positioners)t.events.includes(e.event)&&this.triggerPositioner(t,e)}getBaseProps(e,t){let r=this.store.getState(),n=this.store.previousState;return{helpers:this.store.helpers,event:e,firstUpdate:!1,previousState:n,state:r,...t}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};e1([(0,eM.$)()],tf.prototype,"forceUpdatePositioners",1),e1([(0,eM.R)()],tf.prototype,"getPositionerWidget",1),tf=e1([(0,eM.S)({defaultOptions:{scrollDebounce:100}
6,customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],tf),e.s(["O",0,tf,"K",0,tn,"d",0,function(e){return(0,O.Z)(e)?tp[e].clone():(0,O.U)(e)?e().clone():e.clone()},"N",0,e6],96996);var tm=M,tg=class extends tm.Z{get name(){return"text"}createTags(){return[C.p.InlineNode]}createNodeSpec(){return{}}};tg=((e,t)=>{for(var r,n=t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=r(n)||n);return n})([(0,tm.S)({disableExtraAttributes:!0,defaultPriority:C.z.Medium})],tg);var ty={...A.f.defaultOptions,...eC.defaultOptions,...ew.defaultOptions,excludeExtensions:[]},tv=M,tb=M,tw=class extends tb.C{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(e,t)=>({...this.options,empty:(0,q.q1)(t.doc,{ignoreAttributes:!0})}),apply:(e,t,r,n)=>(function(e){let{pluginState:t,extension:r,tr:n,state:o}=e;return n.docChanged?{...r.options,empty:(0,q.q1)(o.doc)}:t})({pluginState:t,tr:e,extension:this,state:n})},props:{decorations:e=>(function(e){let{extension:t,state:r}=e,{empty:n}=t.pluginKey.getState(r),{emptyNodeClass:o,placeholder:i}=t.options;if(!n)return null;let s=[];return r.doc.descendants((e,t)=>{let r=L.G.node(t,t+e.nodeSize,{class:o,"data-placeholder":i});s.push(r)}),L.q.create(r.doc,s)})({state:e,extension:this})}}}onSetOptions(e){let{changes:t}=e;t.placeholder.changed&&this.store.phase>=C.E.EditorView&&this.store.updateAttributes()}};tw=((e,t)=>{for(var r,n=t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=r(n)||n);return n})([(0,tb.S)({defaultOptions:{emptyNodeClass:eP.IS_EMPTY,placeholder:""}})],tw);var tx=e.i(547447),tS=M,tk=e.i(802659),tE=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tC=(e,t,r)=>(tE(e,t,"read from private field"),r?r.call(e):t.get(e)),tO=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},tM=(e,t,r,n)=>(tE(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),tT=class{constructor(){this.portals=new Map,tO(this,u,(0,eO.f)()),this.on=e=>tC(this,u).on("update",e),this.once=e=>{let t=tC(this,u).on("update",r=>{t(),e(r)});return t}}update(){tC(this,u).emit("update",this.portals)}render({Component:e,container:t}){let r=this.portals.get(t);this.portals.set(t,{Component:e,key:(null==r?void 0:r.key)??(0,O.G)()}),this.update()}forceUpdate(){for(let[e,{Component:t}]of this.portals)this.portals.set(e,{Component:t,key:(0,O.G)()})}remove(e){this.portals.delete(e),this.update()}};u=new WeakMap;var tN=e=>{let{portals:t}=e;return E.default.createElement(E.default.Fragment,null,t.map(([e,{Component:t,key:r}])=>(0,tx.createPortal)(E.default.createElement(t,null),e,r)))},tA=class{constructor({getPosition:e,node:t,portalContainer:r,view:n,ReactComponent:o,options:i}){tO(this,d,void 0),tO(this,h,[]),tO(this,p,void 0),tO(this,f,void 0),tO(this,m,void 0),tO(this,g,void 0),tO(this,y,void 0),tO(this,v,!1),tO(this,b,void 0),tO(this,w,void 0),tO(this,x,void 0),tO(this,S,e=>{e&&((0,O.l)(tC(this,w),{code:C.D.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${tC(this,d).type.name}' which doesn't support content.`}),e.append(tC(this,w)))}),this.Component=()=>{let e=tC(this,m);return(0,O.l)(e,{code:C.D.REACT_NODE_VIEW,message:`The custom react node view provided for ${tC(this,d).type.name} doesn't have a valid ReactComponent`}),E.default.createElement(e,{updateAttributes:this.updateAttributes,selected:this.selected,view:tC(this,p),getPosition:tC(this,g),node:tC(this,d),forwardRef:tC(this,S),decorations:tC(this,h)})},this.updateAttributes=e=>{if(!tC(this,p).editable)return;let t=tC(this,g).call(this);if(null==t)return;let r=tC(this,p).state.tr.setNodeMarkup(t,void 0,{...tC(this,d).attrs,...e});tC(this,p).dispatch(r)},(0,O.l)((0,O.U)(e),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),tM(this,d,t),tM(this,p,n),tM(this,f,r),tM(this,m,o),tM(this,g,e),tM(this,y,i),tM(this,x,this.createDom());let{contentDOM:s,wrapper:a}=this.createContentDom()??{};tM(this,b,s??void 0),tM(this,w,a),tC(this,w)&&tC(this,x).append(tC(this,w)),this.setDomAttributes(tC(this,d),tC(this,x)),this.Component.displayName=(0,tk.L)(`${tC(this,d).type.name}NodeView`),this.renderComponent()}static create(e){let{portalContainer:t,ReactComponent:r,options:n}=e;return(e,o,i)=>new tA({options:n,node:e,view:o,getPosition:i,portalContainer:t,ReactComponent:r})}get selected(){return tC(this,v)}get contentDOM(){return tC(this,b)}get dom(){return tC(this,x)}renderComponent(){tC(this,f).render({Component:this.Component,container:tC(this,x)})}createDom(){let{defaultBlockNode:e,defaultInlineNode:t}=tC(this,y),r=tC(this,d).isInline?document.createElement(t):document.createElement(e);return r.classList.add(`${(0,tk.O)(tC(this,d).type.name)}
6-node-view-wrapper`),r}createContentDom(){var e,t;let r;if(tC(this,d).isLeaf)return;let n=null==(t=(e=tC(this,d).type.spec).toDOM)?void 0:t.call(e,tC(this,d));if(!n)return;let{contentDOM:o,dom:i}=I.h.renderSpec(document,n);if((0,q.yU)(i))return r=i,i===o&&((r=document.createElement("span")).classList.add(`${(0,tk.O)(tC(this,d).type.name)}-node-view-content-wrapper`),r.append(o)),(0,q.yU)(o),{wrapper:r,contentDOM:o}}update(e,t){return!!(0,q.XG)({types:tC(this,d).type,node:e})&&(tC(this,d)===e&&tC(this,h)===t||(tC(this,d).sameMarkup(e)||this.setDomAttributes(e,tC(this,x)),tM(this,d,e),tM(this,h,t),this.renderComponent(),!0))}setDomAttributes(e,t){let{toDOM:r}=tC(this,d).type.spec,n=e.attrs;if(r){var o;let t=r(e);if((0,O.Z)(t)||(o=t,(0,q.x8)(o)||(0,O.d)(o)&&(0,q.x8)(o.dom)))return;(0,O.d)(t[1])&&(n=t[1])}for(let[e,r]of(0,O.V)(n))t.setAttribute(e,r)}selectNode(){tM(this,v,!0),tC(this,x)&&tC(this,x).classList.add(C.K),this.renderComponent()}deselectNode(){tM(this,v,!1),tC(this,x)&&tC(this,x).classList.remove(C.K),this.renderComponent()}destroy(){tC(this,f).remove(tC(this,x))}ignoreMutation(e){return"selection"===e.type?!tC(this,d).type.spec.selectable:!tC(this,w)||!tC(this,w).contains(e.target)}stopEvent(e){var t;if(!tC(this,x))return!1;if((0,O.U)(tC(this,y).stopEvent))return tC(this,y).stopEvent({event:e});let r=e.target;if(!(tC(this,x).contains(r)&&!(null==(t=this.contentDOM)?void 0:t.contains(r))))return!1;let n="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!n)return!0;let o=!!tC(this,d).type.spec.draggable,i=P.C.isSelectable(tC(this,d)),s="copy"===e.type,a="paste"===e.type,l="cut"===e.type,c="mousedown"===e.type,u=e.type.startsWith("drag");return!o&&i&&u&&e.preventDefault(),!u&&!n&&!s&&!a&&!l&&(!c||!i)}};d=new WeakMap,h=new WeakMap,p=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,v=new WeakMap,b=new WeakMap,w=new WeakMap,x=new WeakMap,S=new WeakMap;var t_=class extends tS.C{constructor(){super(...arguments),this.portalContainer=new tT}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){let e=(0,O.u)(),t=this.store.managerSettings.nodeViewComponents??{};for(let t of this.store.extensions)t.ReactComponent&&(0,tS.G)(t)&&"ssr"!==t.reactComponentEnvironment&&(e[t.name]=tA.create({options:this.options,ReactComponent:t.ReactComponent,portalContainer:this.portalContainer}));for(let[r,n]of(0,O.V)({...this.options.nodeViewComponents,...t}))e[r]=tA.create({options:this.options,ReactComponent:n,portalContainer:this.portalContainer});return e}};t_=((e,t)=>{for(var r,n=t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=r(n)||n);return n})([(0,tS.S)({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],t_);var tR={...tw.defaultOptions,...t_.defaultOptions},tD=[...tw.staticKeys,...t_.staticKeys],tP=class extends tv.C{get name(){return"react"}onSetOptions(e){let{pickChanged:t}=e;this.getExtension(tw).setOptions(t(["placeholder"]))}createExtensions(){let{emptyNodeClass:e,placeholder:t,defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new tw({emptyNodeClass:e,placeholder:t,priority:C.z.Low}),new t_({defaultBlockNode:r,defaultContentNode:n,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};tP=((e,t)=>{for(var r,n=t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=r(n)||n);return n})([(0,tv.S)({defaultOptions:tR,staticKeys:tD})],tP);var tI=e.i(215160),tL=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},tB=(e,t,r)=>(tL(e,t,"read from private field"),r?r.call(e):t.get(e)),tV=(0,E.createContext)(null);function tF(e){let t=(0,E.useContext)(tV),r=(0,E.useRef)(function(){let[,e]=(0,E.useState)((0,O.u)());return(0,E.useCallback)(()=>{e((0,O.u)())},[])}());(0,O.l)(t,{code:C.D.REACT_PROVIDER_CONTEXT});let{addHandler:n}=t;return(0,E.useEffect)(()=>{let t=e;if(t){if((0,O.d)(t)){let{autoUpdate:e}=t;t=e?()=>r.current():void 0}if((0,O.U)(t))return n("updated",t)}},[n,e]),t}function tj(e,t,r){let n,{getExtension:o}=tF(),i=(0,E.useMemo)(()=>o(e),[e,o]);if(n=(0,O.U)(t)?r?[i,...r]:[i,t]:t?[i,...Object.values(t)]:[],(0,E.useEffect)(()=>{!(0,O.U)(t)&&t&&i.setOptions(t)},n),(0,E.useEffect)(()=>
6{if((0,O.U)(t))return t({addHandler:i.addHandler.bind(i),addCustomHandler:i.addCustomHandler.bind(i),extension:i})},n),!t)return i}function tz(e,t,r){return tj(e,(0,E.useCallback)(({addHandler:e})=>e(t,r),[r,t]))}var[t$,tU]=(0,T.f)(({props:e})=>{let t=e.locale??"en",r=e.i18n??N.X,n=e.supportedLocales??[t],o=r._.bind(r);return{locale:t,i18n:r,supportedLocales:n,t:o}});function tH(e,t={}){let{core:r,react:n,...o}=t;return(0,M.d)(e)?e:M.g.create(()=>[...(0,O.x)(e),new tP(n),...function(e={}){let{content:t,depth:r,getDispatch:n,getState:o,newGroupDelay:i,excludeExtensions:s}=e={...ty,...e},a={};for(let e of s??[])a[e]=!0;let l=[];if(!a.history){let e=new ew({depth:r,getDispatch:n,getState:o,newGroupDelay:i});l.push(e)}return a.doc||l.push(new A.f({content:t})),a.text||l.push(new tg),a.paragraph||l.push(new eC),a.positioner||l.push(new tf),a.gapCursor||l.push(new K),a.events||l.push(new _.f),l}(r)],o)}var tK="object"==typeof tI.default&&tI.default.__esModule&&tI.default.default?tI.default.default:tI.default,tW=class extends M.e{constructor(e){super(e);var t=k;if(t.has(this))throw TypeError("Cannot add the same private member more than once");if(t instanceof WeakSet?t.add(this):t.set(this,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=e=>this.internalGetRootProps(e,null),this.internalGetRootProps=(e,t)=>{this.rootPropsConfig.called=!0;let{refKey:r="ref",ref:n,...o}=e??(0,O.u)();return{[r]:tK(n,this.onRef),key:this.uid,...o,children:t}},this.onRef=e=>{if(e){var t;this.rootPropsConfig.count+=1,(0,O.l)(this.rootPropsConfig.count<=1,{code:C.D.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),tL(this,t=k,"write to private field"),t.set(this,e),this.onRefLoad()}},this.manager.view)return void this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});this.manager.getExtension(tw).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(e){return super.update(e),this}createView(e){return new L.j(null,{state:e,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:e,...t}){let{triggerChange:r=!0,tr:n,transactions:o}=t;if(this.props.state){let{onChange:t}=this.props;(0,O.l)(t,{code:C.D.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),(0,O.l)(r,{code:C.D.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:e,tr:n,transactions:o});return}n||o||(e=e.apply(e.tr.setMeta(C.f,{}))),this.view.updateState(e),r&&(null==o?void 0:o.length)!==0&&this.onChange({state:e,tr:n,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:e,tr:n,transactions:o})}updateControlledState(e,t){this.previousStateOverride=t,e=e.apply(e.tr.setMeta(C.f,{})),this.view.updateState(e),this.manager.onStateUpdate({previousState:this.previousState,state:e}),this.previousStateOverride=void 0}addProsemirrorViewToDom(e,t){"start"===this.props.insertPosition?e.insertBefore(t,e.firstChild):e.append(t)}onRefLoad(){(0,O.l)(tB(this,k),{code:C.D.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});let{autoFocus:e}=this.props;this.addProsemirrorViewToDom(tB(this,k),this.view.dom),e&&this.focus(e),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&tB(this,k)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};k=new WeakMap;var tq="u">typeof document?E.useLayoutEffect:E.useEffect,tJ={doc:!1,selection:!1,storedMark:!1},tG=()=>E.default.createElement("div",{className:eA.EDITOR_WRAPPER,...tF().getRootProps()}),tY=e=>(e.hook(),null);
6e.s(["z",0,function(e){let{children:t,autoRender:r,i18n:n,locale:o,supportedLocales:i,hooks:s=[],...a}=e,l=function(e){var t;let r,n,{manager:o,state:i}=e,{placeholder:s,editable:a}=e;(0,E.useRef)(!0).current&&!(0,O.Y)(s)&&o.getExtension(tP).setOptions({placeholder:s}),(0,E.useEffect)(()=>{null!=s&&o.getExtension(tP).setOptions({placeholder:s})},[s,o]);let[l]=(0,E.useState)(()=>{if(i)return i;let t=o.createEmptyDoc(),[r,n]=(0,O.o)(e.initialContent)?e.initialContent:[e.initialContent??t];return o.createState({content:r,selection:n})}),c=(t={initialEditorState:l,getProps:()=>e},(r=(0,E.useRef)(t)).current=t,(n=(0,E.useMemo)(()=>new tW(r.current),[])).update(t),n);return(0,E.useEffect)(()=>()=>{c.destroy()},[c]),(0,E.useEffect)(()=>{c.onUpdate()},[a,c]),function(e){let t,{state:r}=e.props,n=(0,E.useRef)(!!r),o=(t=(0,E.useRef)(),tq(()=>{t.current=r}),t.current);tq(()=>{let t=r?!0===n.current:!1===n.current;(0,O.l)(t,{code:C.D.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),r&&r!==o&&e.updateControlledState(r,o??void 0)},[r,o,e])}(c),c.frameworkOutput}(a),c=function(e){let[t,r]=(0,E.useState)(()=>Array.from(e.portals.entries()));return(0,E.useEffect)(()=>e.on(e=>{r(Array.from(e.entries()))}),[e]),(0,E.useMemo)(()=>t,[t])}(l.portalContainer),u="start"===r||!0===r||!t&&(0,O.Y)(r),d="end"===r;return E.default.createElement(t$,{i18n:n,locale:o,supportedLocales:i},E.default.createElement(tV.Provider,{value:l},E.default.createElement(tN,{portals:c}),s.map((e,t)=>E.default.createElement(tY,{hook:e,key:t})),u&&E.default.createElement(tG,null),t,d&&E.default.createElement(tG,null)))},"o",0,function(e=!0){return tF({autoUpdate:e}).active},"x",0,function(e=!1){return tF(e?{autoUpdate:!0}:void 0).attrs},"A",0,function(){return tF().chain.new()},"F",0,function(){return tF().commands},"R",0,function(){return tF({autoUpdate:!0}).getState().selection},"r",0,function(){return tF({autoUpdate:!0}).getState()},"S",0,tj,"N",0,function(e,t,r){return tj(e,(0,E.useCallback)(({addCustomHandler:e})=>e(t,r),[r,t]))},"$",0,tz,"Y",0,function(e){let{hasExtension:t}=tF();return(0,E.useMemo)(()=>t(e),[e,t])},"i",0,function(e=!1){return tF(e?{autoUpdate:!0}:void 0).helpers},"W",0,tU,"b",0,function(e){let{getState:t}=tF({autoUpdate:!0}),{$from:r,$to:n}=t().selection;return(0,q.Vb)(r,e,n)},"m",0,function(e={}){let{content:t,document:r,selection:n,extensions:o,...i}=e,s=function(e,t={}){let r=(0,E.useRef)(e),n=(0,E.useRef)(t),[o,i]=(0,E.useState)(()=>tH(e,t));return r.current=e,n.current=t,(0,E.useEffect)(()=>o.addHandler("destroy",()=>{i(()=>tH(r.current,n.current))}),[o]),o}(o??(()=>[]),i),[a,l]=(0,E.useState)(()=>s.createState({selection:n,content:t??s.createEmptyDoc()})),c=(0,E.useCallback)(({state:e})=>{l(e)},[]),u=(0,E.useCallback)(()=>s.output,[s]);return(0,E.useMemo)(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])},"s",0,tF,"Z",0,function(){let{getState:e,helpers:t}=tF({autoUpdate:!0}),{selection:r,doc:n}=e();if(!(0,q.WZ)(r)||r.empty)return;let{from:o,to:i}=r;return t.getTextBetween(o,i,n)},"j",0,function(){let[e,t]=(0,E.useState)(tJ);return tz(M.D,"applyState",(0,E.useCallback)(({tr:e})=>{let r={...tJ};e.docChanged&&(r.doc=!0),e.selectionSet&&(r.selection=!0),e.storedMarksSet&&(r.storedMark=!0),t(r)},[])),e}],709188)},215160,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 2===e.length?o(e[0],e[1])||null:e.slice(1).reduce(function(e,t){return o(e,t)},e[0])||null};var n=new WeakMap;function o(e,t){if(e&&t){var r=n.get(e)||new WeakMap;n.set(e,r);var o=r.get(t)||function(r){i(e,r),i(t,r)};return r.set(t,o),o}return e||t}function i(e,t){"function"==typeof e?e(t):e.current=t}},150506,409432,121247,842685,e=>{var t=e.i(651325),r=Object.defineProperty,n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t)=>{for(var r in t||(t={}))o.call(t,r)&&s(e,r,t[r]);if(n)for(var r of n(t))i.call(t,r)&&s(e,r,t[r]);return e},l="u">typeof document?t.useLayoutEffect:t.useEffect;function c(e){return t=>{if(!e.current)throw Error("`get` called outside of function scope. `get` can only be called within a function.");
6if(!t)return e.current;if("function"!=typeof t)throw TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return t(e.current)}}function u(e){return t=>{if(!e.current)throw Error("`set` called outside of function scope. `set` can only be called within a function.");e.current(e=>a(a({},e),"function"==typeof t?t(e):t))}}e.s(["f",0,function(e,r){var n,o;let i;return n=n=>{let o=(0,t.useRef)(null),i=(0,t.useRef)(),s=null==r?void 0:r(n),[a,l]=(0,t.useState)(()=>e({get:c(o),set:u(i),previousContext:void 0,props:n,state:s})),d=[...Object.values(n),s];return(0,t.useEffect)(()=>{0!==d.length&&l(t=>e({get:c(o),set:u(i),previousContext:t,props:n,state:s}))},d),o.current=a,i.current=l,a},o=i=(0,t.createContext)(null),[e=>{let r=n(e);return t.default.createElement(i.Provider,{value:r},e.children)},(e,r)=>{var n;let i,s=(0,t.useContext)(o),a=(n=s,i=(0,t.useRef)(),l(()=>{i.current=n}),i.current);if(!s)throw Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!e)return s;if("function"!=typeof e)throw TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");let c=e(s);if(!a||!r)return c;let u=e(a);return r(u,c)?u:c},i]}],150506);var d=e.i(960572);let h=new Map;function p(e){return[...Array.isArray(e)?e:[e],"en"]}function f(e,t,r){let n=p(e);return y(()=>v("date",n,r),()=>new Intl.DateTimeFormat(n,r)).format("string"==typeof t?new Date(t):t)}function m(e,t,r){let n=p(e);return y(()=>v("number",n,r),()=>new Intl.NumberFormat(n,r)).format(t)}function g(e,t,r,{offset:n=0,...o}){let i=p(e),s=t?y(()=>v("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):y(()=>v("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[r]??o[s.select(r-n)]??o.other}function y(e,t){let r=e(),n=h.get(r);return n||(n=t(),h.set(r,n)),n}function v(e,t,r){let n=t.join("-");return`${e}-${n}-${JSON.stringify(r)}`}let b=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,w="%__lingui_octothorpe__%",x=(e,t)=>t[e]??t.other;var S=Object.defineProperty;class k{constructor(){var e,t;let r;t={},(r="symbol"!=typeof(e="_events")?e+"":e)in this?S(this,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):this[r]=t}on(e,t){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){let r=this._getListeners(e);if(!r)return;let n=r.indexOf(t);~n&&r.splice(n,1)}emit(e,...t){let r=this._getListeners(e);r&&r.map(e=>e.apply(this,t))}_getListeners(e){let t=this._events[e];return!!Array.isArray(t)&&t}}var E=Object.defineProperty,C=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?E(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};class O extends k{constructor(e){super(),C(this,"_locale",""),C(this,"_locales"),C(this,"_localeData",{}),C(this,"_messages",{}),C(this,"_missing"),C(this,"t",this._.bind(this)),null!=e.missing&&(this._missing=e.missing),null!=e.messages&&this.load(e.messages),null!=e.localeData&&this.loadLocaleData(e.localeData),("string"==typeof e.locale||e.locales)&&this.activate(e.locale??"en",e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,t){let r=this._localeData[e];r?Object.assign(r,t):this._localeData[e]=t}loadLocaleData(e,t){null!=t?this._loadLocaleData(e,t):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,t){let r=this._messages[e];r?Object.assign(r,t):this._messages[e]=t}load(e,t){"string"==typeof e&&"object"==typeof t?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit("change")}loadAndActivate({locale:e,locales:t,messages:r}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=r,this.emit("change")}activate(e,t){this._locale=e,this._locales=t,this.emit("change")}_(e,t,r){var n,o;let i=r?.message;e||(e=""),"string"!=typeof e&&(t=e.values||t,i=e.message,e=e.id);let s=this.messages[e],a=void 0===s,l=this._missing;if(l&&a)return"function"==typeof l?l(this._locale,e):l;
6a&&this.emit("missing",{id:e,locale:this._locale});let c=s||i||e;return"string"==typeof c&&b.test(c)?JSON.parse(`"${c}"`):"string"==typeof c?c:(n=this._locale,o=this._locales,(e={},t)=>{let r=((e,t,r={})=>{let n=t||e,o=e=>"object"==typeof e?e:r[e]||{style:e},i=(e,t)=>{let i=m(n,e,Object.keys(r).length?o("number"):void 0);return t.replace(RegExp(w,"g"),i)};return{plural:(e,t)=>{let{offset:r=0}=t,o=g(n,!1,e,t);return i(e-r,o)},selectordinal:(e,t)=>{let{offset:r=0}=t,o=g(n,!0,e,t);return i(e-r,o)},select:x,number:(e,t)=>m(n,e,o(t)),date:(e,t)=>f(n,e,o(t))}})(n,o,t),i=(t,n=!1)=>Array.isArray(t)?t.reduce((t,o)=>{let s;if("#"===o&&n)return t+w;if("string"==typeof o)return t+o;let[a,l,c]=o,u={};return("plural"===l||"selectordinal"===l||"select"===l?Object.entries(c).forEach(([e,t])=>{u[e]=i(t,"plural"===l||"selectordinal"===l)}):u=c,null==(s=l?(0,r[l])(e[a],u):e[a]))?t:t+s},""):t,s=i(c);return"string"==typeof s&&b.test(s)?(0,d.unraw)(s.trim()):"string"==typeof s?s.trim():s?String(s):""})(t,r?.formats)}date(e,t){return f(this._locales||this._locale,e,t)}number(e,t){return m(this._locales||this._locale,e,t)}}function M(e={}){return new O(e)}let T=M();function N(e,t){return t?"other":1==e?"one":"other"}function A(e,t){return t?"other":0==e||1==e?"one":"other"}function _(e,t){var r=!String(e).split(".")[1];return t?"other":1==e&&r?"one":"other"}function R(e,t){return"other"}function D(e,t){return t?"other":1==e?"one":2==e?"two":"other"}e.s(["I",0,{__proto__:null,date:f,defaultLocale:"en",number:m,plural:g},"X",0,T,"M",0,M],409432),e.s(["_in",0,R,"af",0,N,"ak",0,A,"am",0,function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},"an",0,N,"ar",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},"ars",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},"as",0,function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},"asa",0,N,"ast",0,_,"az",0,function(e,t){var r=String(e).split(".")[0],n=r.slice(-1),o=r.slice(-2),i=r.slice(-3);return t?1==n||2==n||5==n||7==n||8==n||20==o||50==o||70==o||80==o?"one":3==n||4==n||100==i||200==i||300==i||400==i||500==i||600==i||700==i||800==i||900==i?"few":0==r||6==n||40==o||60==o||90==o?"many":"other":1==e?"one":"other"},"be",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?(2==o||3==o)&&12!=i&&13!=i?"few":"other":1==o&&11!=i?"one":o>=2&&o<=4&&(i<12||i>14)?"few":n&&0==o||o>=5&&o<=9||i>=11&&i<=14?"many":"other"},"bem",0,N,"bez",0,N,"bg",0,N,"bho",0,A,"bm",0,R,"bn",0,function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},"bo",0,R,"br",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2),s=n&&r[0].slice(-6);return t?"other":1==o&&11!=i&&71!=i&&91!=i?"one":2==o&&12!=i&&72!=i&&92!=i?"two":(3==o||4==o||9==o)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=e&&n&&0==s?"many":"other"},"brx",0,N,"bs",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&1==s&&11!=a||1==l&&11!=c?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},"ca",0,function(e,t){var r=!String(e).split(".")[1];return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&r?"one":"other"},"ce",0,N,"ceb",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?"other":i&&(1==n||2==n||3==n)||i&&4!=s&&6!=s&&9!=s||!i&&4!=a&&6!=a&&9!=a?"one":"other"},"cgg",0,N,"chr",0,N,"ckb",0,N,"cs",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":1==e&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"},"cy",0,function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},"da",0,function(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e;return t||1!=e&&(o||0!=n&&1!=n)?"other":"one"},"de",0,_,"dsb",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&1==s||1==a?"one":i&&2==s||2==a?"two":i&&(3==s||4==s)||3==a||4==a?"few":"other"},"dv",0,N,"dz",0,R,"ee",0,N,"el",0,N,"en",0,function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?1==i&&11!=s?"one":2==i&&12!=s?"two":3==i&&13!=s?"few":"other":1==e&&n?"one":"other"},"eo",0,N,"es",0,N,"et",0,_,"eu",0,N,"fa",0,function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},"ff",0,function(e,t){return t?"other":e>
6=0&&e<2?"one":"other"},"fi",0,_,"fil",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?1==e?"one":"other":i&&(1==n||2==n||3==n)||i&&4!=s&&6!=s&&9!=s||!i&&4!=a&&6!=a&&9!=a?"one":"other"},"fo",0,N,"fr",0,function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},"fur",0,N,"fy",0,_,"ga",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},"gd",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},"gl",0,_,"gsw",0,N,"gu",0,function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},"guw",0,A,"gv",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&1==i?"one":o&&2==i?"two":o&&(0==s||20==s||40==s||60==s||80==s)?"few":o?"other":"many"},"ha",0,N,"haw",0,N,"he",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":1==e&&o?"one":2==n&&o?"two":o&&(e<0||e>10)&&i&&0==s?"many":"other"},"hi",0,function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},"hr",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&1==s&&11!=a||1==l&&11!=c?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},"hsb",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-2),a=o.slice(-2);return t?"other":i&&1==s||1==a?"one":i&&2==s||2==a?"two":i&&(3==s||4==s)||3==a||4==a?"few":"other"},"hu",0,function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},"hy",0,function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},"ia",0,_,"id",0,R,"ig",0,R,"ii",0,R,"io",0,_,"is",0,function(e,t){var r=String(e).split("."),n=r[0],o=Number(r[0])==e,i=n.slice(-1),s=n.slice(-2);return t?"other":o&&1==i&&11!=s||!o?"one":"other"},"it",0,function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},"iu",0,D,"iw",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1);return t?"other":1==e&&o?"one":2==n&&o?"two":o&&(e<0||e>10)&&i&&0==s?"many":"other"},"ja",0,R,"jbo",0,R,"jgo",0,N,"ji",0,_,"jmc",0,N,"jv",0,R,"jw",0,R,"ka",0,function(e,t){var r=String(e).split(".")[0],n=r.slice(-2);return t?1==r?"one":0==r||n>=2&&n<=20||40==n||60==n||80==n?"many":"other":1==e?"one":"other"},"kab",0,function(e,t){return t?"other":e>=0&&e<2?"one":"other"},"kaj",0,N,"kcg",0,N,"kde",0,R,"kea",0,R,"kk",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1);return t?6==o||9==o||n&&0==o&&0!=e?"many":"other":1==e?"one":"other"},"kkj",0,N,"kl",0,N,"km",0,R,"kn",0,function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},"ko",0,R,"ks",0,N,"ksb",0,N,"ksh",0,function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},"ku",0,N,"kw",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-2),i=n&&r[0].slice(-3),s=n&&r[0].slice(-5),a=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":5==e||5==o?"many":"other":0==e?"zero":1==e?"one":2==o||22==o||42==o||62==o||82==o||n&&0==i&&(s>=1e3&&s<=2e4||4e4==s||6e4==s||8e4==s)||0!=e&&1e5==a?"two":3==o||23==o||43==o||63==o||83==o?"few":1!=e&&(1==o||21==o||41==o||61==o||81==o)?"many":"other"},"ky",0,N,"lag",0,function(e,t){var r=String(e).split(".")[0];return t?"other":0==e?"zero":(0==r||1==r)&&0!=e?"one":"other"},"lb",0,N,"lg",0,N,"lkt",0,R,"ln",0,A,"lo",0,function(e,t){return t&&1==e?"one":"other"},"lt",0,function(e,t){var r=String(e).split("."),n=r[1]||"",o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?"other":1==i&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":0!=n?"many":"other"},"lv",0,function(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&0==s||a>=11&&a<=19||2==o&&l>=11&&l<=19?"zero":1==s&&11!=a||2==o&&1==c&&11!=l||2!=o&&1==c?"one":"other"},"mas",0,N,"mg",0,A,"mgo",0,N,"mk",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?1==s&&11!=a?"one":2==s&&12!=a?"two":(7==s||8==s)&&17!=a&&18!=a?"many":"other":i&&1==s&&11!=a||1==l&&11!=c?"one":"other"},"ml",0,N,"mn",0,N,"mo",0,function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e&&r[0].slice(-2);
6return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||o>=2&&o<=19?"few":"other"},"mr",0,function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},"ms",0,function(e,t){return t&&1==e?"one":"other"},"mt",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":1==e?"one":0==e||n>=2&&n<=10?"few":n>=11&&n<=19?"many":"other"},"my",0,R,"nah",0,N,"naq",0,D,"nb",0,N,"nd",0,N,"ne",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},"nl",0,_,"nn",0,N,"nnh",0,N,"no",0,N,"nqo",0,R,"nr",0,N,"nso",0,A,"ny",0,N,"nyn",0,N,"om",0,N,"or",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},"os",0,N,"osa",0,R,"pa",0,A,"pap",0,N,"pl",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":1==e&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&1!=n&&(0==i||1==i)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"},"prg",0,function(e,t){var r=String(e).split("."),n=r[1]||"",o=n.length,i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":i&&0==s||a>=11&&a<=19||2==o&&l>=11&&l<=19?"zero":1==s&&11!=a||2==o&&1==c&&11!=l||2!=o&&1==c?"one":"other"},"ps",0,N,"pt",0,function(e,t){var r=String(e).split(".")[0];return t?"other":0==r||1==r?"one":"other"},"pt_PT",0,_,"rm",0,N,"ro",0,function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||o>=2&&o<=19?"few":"other"},"rof",0,N,"root",0,R,"ru",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-1),s=n.slice(-2);return t?"other":o&&1==i&&11!=s?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&0==i||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"},"rwk",0,N,"sah",0,R,"saq",0,N,"sc",0,function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},"scn",0,function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},"sd",0,N,"sdh",0,N,"se",0,D,"seh",0,N,"ses",0,R,"sg",0,R,"sh",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&1==s&&11!=a||1==l&&11!=c?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},"shi",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},"si",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"";return t?"other":0==e||1==e||0==n&&1==o?"one":"other"},"sk",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1];return t?"other":1==e&&o?"one":n>=2&&n<=4&&o?"few":o?"other":"many"},"sl",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=n.slice(-2);return t?"other":o&&1==i?"one":o&&2==i?"two":o&&(3==i||4==i)||!o?"few":"other"},"sma",0,D,"smi",0,D,"smj",0,D,"smn",0,D,"sms",0,D,"sn",0,N,"so",0,N,"sq",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e,o=n&&r[0].slice(-1),i=n&&r[0].slice(-2);return t?1==e?"one":4==o&&14!=i?"many":"other":1==e?"one":"other"},"sr",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=n.slice(-2),l=o.slice(-1),c=o.slice(-2);return t?"other":i&&1==s&&11!=a||1==l&&11!=c?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},"ss",0,N,"ssy",0,N,"st",0,N,"su",0,R,"sv",0,function(e,t){var r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?(1==i||2==i)&&11!=s&&12!=s?"one":"other":1==e&&n?"one":"other"},"sw",0,_,"syr",0,N,"ta",0,N,"te",0,N,"teo",0,N,"th",0,R,"ti",0,A,"tig",0,N,"tk",0,function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-1);return t?6==n||9==n||10==e?"few":"other":1==e?"one":"other"},"tl",0,function(e,t){var r=String(e).split("."),n=r[0],o=r[1]||"",i=!r[1],s=n.slice(-1),a=o.slice(-1);return t?1==e?"one":"other":i&&(1==n||2==n||3==n)||i&&4!=s&&6!=s&&9!=s||!i&&4!=a&&6!=a&&9!=a?"one":"other"},"tn",0,N,"to",0,R,"tr",0,N,"ts",0,N,"tzm",0,function(e,t){var r=Number(String(e).split(".")[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},"ug",0,N,"uk",0,function(e,t){var r=String(e).split("."),n=r[0],o=!r[1],i=Number(r[0])==e,s=i&&r[0].slice(-1),a=i&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?3==s&&13!=a?"few":"other":o&&1==l&&11!=c?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&0==l||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"},"ur",0,_,"uz",0,N,"ve",0,N,"vi",0,function(e,t){return t&&1==e?"one":"other"},"vo",0,N,"vun",0,N,"wa",0,A,"wae",0,N,"wo",0,R,"xh",0,N,"xog",0,N,"yi",0,_,"yo",0,R,"yue",0,R,"zh",0,R,"zu",0,function(e,t){return t?"other":e>=0&&e<=1?"one":"other"}],727307);var P=e.i(727307),I=Object.defineProperty,L=Object.getOwnPropertyDescriptor,B=Object.getOwnPropertyNames,V=Object.prototype.hasOwnProperty,F=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text c
6ase"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all c
6ontent within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all c
6ontent within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),j={};((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of B(t))V.call(e,o)||o===r||I(e,o,{get:()=>t[o],enumerable:!(n=L(t,o))||n.enumerable});return})(j,P,"default"),T.loadLocaleData("en",{plurals:j.en}),T.load("en",F),T.activate("en"),e.s([],121247);var z=e.i(91155),$=e.i(350219),U=e.i(812121),H=e.i(964892),K=e.i(713249),W=Object.defineProperty,q=Object.getOwnPropertyDescriptor,J=(e,t,r,n)=>{for(var o,i=n>1?void 0:n?q(t,r):t,s=e.length-1;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&W(t,r,i),i},G=class extends z.Z{get name(){return"doc"}createNodeSpec(e,t){let{docAttributes:r,content:n}=this.options,o=(0,$.u)();if((0,$.d)(r))for(let[e,t]of(0,$.V)(r))o[e]={default:t};else for(let e of r)o[e]={default:null};return{attrs:o,content:n,...t}}setDocAttributes(e){return({tr:t,dispatch:r})=>{if(r){for(let[r,n]of Object.entries(e))t.step(new Z(r,n));r(t)}return!0}}isDefaultDocNode({state:e=this.store.getState(),options:t}={}){return(0,H.q1)(e.doc,t)}};J([(0,z.$)()],G.prototype,"setDocAttributes",1),J([(0,z.R)()],G.prototype,"isDefaultDocNode",1),G=J([(0,z.S)({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:U.z.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],G);var Y="SetDocAttribute",X="RevertSetDocAttribute",Z=class e extends K.Z{static fromJSON(t,r){return new e(r.key,r.value,r.stepType)}key;stepType;value;previous;constructor(e,t,r=Y){super(),this.stepType=r,this.key=e,this.value=t}apply(e){this.previous=e.attrs[this.key];let t={...e.attrs,[this.key]:this.value};return K.r.ok(e.type.create(t,e.content,e.marks))}invert(){return new e(this.key,this.previous,X)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{K.Z.jsonID(Y,Z),K.Z.jsonID(X,Z)}catch(e){if(!e.message.startsWith("Duplicate use of step JSON ID"))throw e}e.s(["f",0,G],842685)},12838,(e,t,r)=>{var n=function(e){var t,r,n;return!!(t=e)&&"object"==typeof t&&(r=e,"[object RegExp]"!==(n=Object.prototype.toString.call(r))&&"[object Date]"!==n&&r.$$typeof!==o)},o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c(Array.isArray(e)?[]:{},e,t):e}function s(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function a(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function l(e,t){try{return t in e}catch(e){return!1}}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=i;var o,u,d=Array.isArray(t);return d!==Array.isArray(e)?i(t,r):d?r.arrayMerge(e,t,r):(u={},(o=r).isMergeableObject(e)&&a(e).forEach(function(t){u[t]=i(e[t],o)}),a(t).forEach(function(r){l(e,r)&&!(Object.hasOwnProperty.call(e,r)&&Object.propertyIsEnumerable.call(e,r))||(l(e,r)&&o.isMergeableObject(t[r])?u[r]=(function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c})(r,o)(e[r],t[r],o):u[r]=i(t[r],o))}),u)}c.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return c(e,r,t)},{})},t.exports=c},835138,(e,t,r)=>{t.exports=e=>{if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},910612,(e,t,r)=>{t.exports=function e(t,r){if(t===r)return!0;
6if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!=o--;){var n,o,i,s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},737467,(e,t,r)=>{var n=e.r(521755);t.exports=function(e){return n(e)||"function"==typeof e||Array.isArray(e)}},521755,(e,t,r)=>{var n=e.r(475608);function o(e){return!0===n(e)&&"[object Object]"===Object.prototype.toString.call(e)}t.exports=function(e){var t,r;return!1!==o(e)&&"function"==typeof(t=e.constructor)&&!1!==o(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")}},475608,(e,t,r)=>{t.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},939139,(e,t,r)=>{var n="u">typeof Reflect?Reflect.construct:void 0,o=Object.defineProperty,i=Error.captureStackTrace;function s(e){void 0!==e&&o(this,"message",{configurable:!0,value:e,writable:!0});var t=this.constructor.name;void 0!==t&&t!==this.name&&o(this,"name",{configurable:!0,value:t,writable:!0}),i(this,this.constructor)}void 0===i&&(i=function(e){var t=Error();o(e,"stack",{configurable:!0,get:function(){var e=t.stack;return o(this,"stack",{configurable:!0,value:e,writable:!0}),e},set:function(t){o(e,"stack",{configurable:!0,value:t,writable:!0})}})}),s.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:s,writable:!0}});var a=function(){function e(e,t){return o(e,"name",{configurable:!0,value:t})}try{var t=function(){};if(e(t,"foo"),"foo"===t.name)return e}catch(e){}}();(t.exports=function(e,t){if(null==t||t===Error)t=s;else if("function"!=typeof t)throw TypeError("super_ should be a function");if("string"==typeof e)r=e,e=void 0!==n?function(){return n(t,arguments,this.constructor)}:function(){t.apply(this,arguments)},void 0!==a&&(a(e,r),r=void 0);else if("function"!=typeof e)throw TypeError("constructor should be either a string or a function");e.super_=e.super=t;var r,o={constructor:{configurable:!0,value:e,writable:!0}};return void 0!==r&&(o.name={configurable:!0,value:r,writable:!0}),e.prototype=Object.create(t.prototype,o),e}).BaseError=s},8011,(e,t,r)=>{var n=e.r(737467);t.exports=function(e,t,r){if(!n(e))return{};"function"==typeof t&&(r=t,t=[]),"string"==typeof t&&(t=[t]);for(var o="function"==typeof r,i=Object.keys(e),s={},a=0;a<i.length;a++){var l=i[a],c=e[l];(!t||-1===t.indexOf(l)&&(!o||r(c,l,e)))&&(s[l]=c)}return s}},856348,(e,t,r)=>{var n=e.r(475608);t.exports=function(e,t){if(!n(e)&&"function"!=typeof e)return{};var r={};if("string"==typeof t)return t in e&&(r[t]=e[t]),r;for(var o=t.length,i=-1;++i<o;){var s=t[i];s in e&&(r[s]=e[s])}return r}},131449,(e,t,r)=>{function n(e,t){if("string"!=typeof e)return[e];var r=[e];"string"==typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],o=t.escape||"___",i=!!t.flat;n.forEach(function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function i(t,i,s){var a=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(a),o+a+o}r.forEach(function(e,n){for(var o,s=0;e!=o;)if(o=e,e=e.replace(t,i),s++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e}),n=n.reverse(),r=r.map(function(t){return n.forEach(function(r){t=t.replace(RegExp("(\\"+o+r+"\\"+o+")","g"),e[0]+"$1"+e[1])}),t})});var s=RegExp("\\"+o+"([0-9]+)\\"+o);return i?r:function e(t,r,n){for(var o,i=[],a=0;o=s.exec(t);){if(a++>1e4)throw Error("Circular references in parenthesis");i.push(t.slice(0,o.index)),i.push(e(r[o[1]],r)),t=t.slice(o.index+o[0].length)}return i.push(t),i}(r[0],r)}function o(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",o=e[0];if(!o)return"";for(var i=RegExp("\\"+n+"([0-9]+)\\"+n),s=0;o!=r;){if(s++>1e4)throw Error("Circular references in "+e);r=o,o=o.replace(i,a)}return o}return e.reduce(function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r},"");function a(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function i(e,t){return Array.isArray(e)?o(e,t):n(e,t)}i.parse=n,i.stringify=o,t.exports=i},774173,e=>{var t=e.i(651325),r=e=>e instanceof Date,n=e=>null==e,o=e=>!n(e)&&!Array.isArray(e)&&"object"==typeof e&&!r(e),i=e=>o(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,s=(e,t)=>e.has(t.substring(0,t.search(/\.\d+(\.|$)/))||t),a="u">typeof window&&void 0!==window.HTMLElement&&"u">typeof document;function l(e){let t,r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{let n;if(!(!(a&&(e instanceof Blob||e instanceof FileList))&&(r||o(e))))return e;if(t=r?[]:{},r||o(n=e.constructor&&e.constructor.prototype)&&n.hasOwnProperty("isPrototypeOf"))for(let r in e)e.hasOwnProperty(r)&&(t[r]=l(e[r]));else t=e}return t}var c=e=>Array.isArray(e)?e.filter(Boolean):[],u=e=>void 0===e,d=(e,t,r)=>{if(!t||!o(e))return r;let i=c(t.split(/[,[\].]+?/)).reduce((e,t)=>
6n(e)?e:e[t],e);return u(i)||i===e?u(e[t])?r:e[t]:i};let h="blur",p="onChange",f="onSubmit",m={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},g=t.default.createContext(null),y=()=>t.default.useContext(g);var v=(e,t,r,n=!0)=>{let o={defaultValues:t._defaultValues};for(let i in e)Object.defineProperty(o,i,{get:()=>("all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!n||"all"),r&&(r[i]=!0),e[i])});return o},b=e=>o(e)&&!Object.keys(e).length,w=(e,t,r,n)=>{r(e);let{name:o,...i}=e;return b(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>t[e]===(!n||"all"))},x=e=>Array.isArray(e)?e:[e],S=(e,t,r)=>!e||!t||e===t||x(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e)));function k(e){let r=t.default.useRef(e);r.current=e,t.default.useEffect(()=>{let t=!e.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{t&&t.unsubscribe()}},[e.disabled])}var E=(e,t,r,n,o)=>"string"==typeof e?(n&&t.watch.add(e),d(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),d(r,e))):(n&&(t.watchAll=!0),r);function C(e){let r=y(),{control:n=r.control,name:o,defaultValue:i,disabled:s,exact:a}=e||{},c=t.default.useRef(o);c.current=o,k({disabled:s,subject:n._subjects.values,next:e=>{S(c.current,e.name,a)&&d(l(E(c.current,n._names,e.values||n._formValues,!1,i)))}});let[u,d]=t.default.useState(n._getWatch(o,i));return t.default.useEffect(()=>n._removeUnmounted()),u}var O=e=>c(e.replace(/["|']|\]/g,"").split(/\.|\[/));function M(e,t,r){let n=-1,i=/^\w*$/.test(t)?[t]:O(t),s=i.length,a=s-1;for(;++n<s;){let t=i[n],s=r;if(n!==a){let r=e[t];
6s=o(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}e[t]=s,e=e[t]}return e}function T(e){let r=y(),{name:n,disabled:o,control:a=r.control,shouldUnregister:c}=e,p=s(a._names.array,n),f=C({control:a,name:n,defaultValue:d(a._formValues,n,d(a._defaultValues,n,e.defaultValue)),exact:!0}),m=function(e){let r=y(),{control:n=r.control,disabled:o,name:i,exact:s}=e||{},[a,l]=t.default.useState(n._formState),c=t.default.useRef(!0),u=t.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=t.default.useRef(i);return d.current=i,k({disabled:o,next:e=>c.current&&S(d.current,e.name,s)&&w(e,u.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),t.default.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),v(a,n,u.current,!1)}({control:a,name:n}),g=t.default.useRef(a.register(n,{...e.rules,value:f}));return g.current=a.register(n,e.rules),t.default.useEffect(()=>{let e=a._options.shouldUnregister||c,t=(e,t)=>{let r=d(a._fields,e);r&&(r._f.mount=t)};if(t(n,!0),e){let e=l(d(a._options.defaultValues,n));M(a._defaultValues,n,e),u(d(a._formValues,n))&&M(a._formValues,n,e)}return()=>
6{(p?e&&!a._state.action:e)?a.unregister(n):t(n,!1)}},[n,a,p,c]),t.default.useEffect(()=>{d(a._fields,n)&&a._updateDisabledField({disabled:o,fields:a._fields,name:n,value:d(a._fields,n)._f.value})},[o,n,a]),{field:{name:n,value:f,..."boolean"==typeof o||"boolean"==typeof m.disabled?{disabled:m.disabled||o}:{},onChange:t.default.useCallback(e=>g.current.onChange({target:{value:i(e),name:n},type:"change"}),[n]),onBlur:t.default.useCallback(()=>g.current.onBlur({target:{value:d(a._formValues,n),name:n},type:h}),[n,a]),ref:e=>{let t=d(a._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:m,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!d(m.errors,n)},isDirty:{enumerable:!0,get:()=>!!d(m.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!d(m.touchedFields,n)},error:{enumerable:!0,get:()=>d(m.errors,n)}})}}var N=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},A=()=>{let e="u"<typeof performance?Date.now():1e3*performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let r=(16*Math.random()+e)%16|0;return("x"==t?r:3&r|8).toString(16)})},_=(e,t,r={})=>r.shouldFocus||u(r.shouldFocus)?r.focusName||`${e}.${u(r.focusIndex)?t:r.focusIndex}.`:"",R=e=>({isOnSubmit:!e||e===f,isOnBlur:"onBlur"===e,isOnChange:e===p,isOnAll:"all"===e,isOnTouch:"onTouched"===e}),D=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));let P=(e,t,r,n)=>{for(let i of r||Object.keys(e)){let r=d(e,i);if(r){let{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n)break;else if(e.ref&&t(e.ref,e.name)&&!n)break}else o(s)&&P(s,t)}}};var I=(e,t,r)=>{let n=c(d(e,r));return M(n,"root",t[r]),M(e,r,n),e},L=e=>"function"==typeof e,B=e=>{if(!a)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},V=e=>"string"==typeof e;let F={value:!1,isValid:!1},j={value:!0,isValid:!0};var z=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!u(e[0].attributes.value)?u(e[0].value)||""===e[0].value?j:{value:e[0].value,isValid:!0}:j:F}return F};let $={isValid:!1,value:null};var U=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,$):$;function H(e,t,r="validate"){if(V(e)||Array.isArray(e)&&e.every(V)||"boolean"==typeof e&&!e)return{type:r,message:V(e)?e:"",ref:t}}var K=e=>!o(e)||e instanceof RegExp?{value:e,message:""}:e,W=async(e,t,r,i,s)=>{let{ref:a,refs:l,required:c,maxLength:h,minLength:p,min:f,max:g,pattern:y,validate:v,name:w,valueAsNumber:x,mount:S,disabled:k}=e._f,E=d(t,w);if(!S||k)return{};let C=l?l[0]:a,O=e=>{i&&C.reportValidity&&(C.setCustomValidity("boolean"==typeof e?"":e||""),C.reportValidity())},M={},T="radio"===a.type,A="checkbox"===a.type,_=(x||"file"===a.type)&&u(a.value)&&u(E)||B(a)&&""===a.value||""===E||Array.isArray(E)&&!E.length,R=N.bind(null,w,r,M),D=(e,t,r,n=m.maxLength,o=m.minLength)=>{let i=e?t:r;M[w]={type:e?n:o,message:i,ref:a,...R(e?n:o,i)}};if(s?!Array.isArray(E)||!E.length:c&&(!(T||A)&&(_||n(E))||"boolean"==typeof E&&!E||A&&!z(l).isValid||T&&!U(l).isValid)){let{value:e,message:t}=V(c)?{value:!!c,message:c}:K(c);if(e&&(M[w]={type:m.required,message:t,ref:C,...R(m.required,t)},!r))return O(t),M}if(!_&&(!n(f)||!n(g))){let e,t,o=K(g),i=K(f);if(n(E)||isNaN(E)){let r=a.valueAsDate||new Date(E),n=e=>new Date(new Date().toDateString()+" "+e),s="time"==a.type,l="week"==a.type;"string"==typeof o.value&&E&&(e=s?n(E)>n(o.value):l?E>o.value:r>new Date(o.value)),"string"==typeof i.value&&E&&(t=s?n(E)<n(i.value):l?E<i.value:r<new Date(i.value))}else{let r=a.valueAsNumber||(E?+E:E);n(o.value)||(e=r>o.value),n(i.value)||(t=r<i.value)}if((e||t)&&(D(!!e,o.message,i.message,m.max,m.min),!r))return O(M[w].message),M}if((h||p)&&!_&&("string"==typeof E||s&&Array.isArray(E))){let e=K(h),t=K(p),o=!n(e.value)&&E.length>+e.value,i=!n(t.value)&&E.length<+t.value;if((o||i)&&(D(o,e.message,t.message),!r))return O(M[w].message),M}if(y&&!_&&"string"==typeof E){let{value:e,message:t}=K(y);if(e instanceof RegExp&&!E.match(e)&&(M[w]={type:m.pattern,message:t,ref:a,...R(m.pattern,t)},!r))return O(t),M}if(v){if(L(v)){let e=H(await v(E,t),C);if(e&&(M[w]={...e,...R(m.validate,e.message)},!r))return O(e.message),M}else if(o(v)){let e={};for(let n in v){if(!b(e)&&!r)break;let o=H(await v[n](E,t),C,n);o&&(e={...o,...R(n,o.message)},O(o.message),r&&(M[w]=e))}if(!b(e)&&(M[w]={ref:C,...e},!r))return M}}return O(!0),M};function q(e,t){return[...e,...x(t)]}var J=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function G(e,t,r){return[...e.slice(0,t),...x(r),...e.slice(t)]}var Y=(e,t,r)=>Array.isArray(e)?(u(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function X(e,t){return[...x(t),...x(e)]}var Z=(e,t)=>u(t)?[]:function(e,t){let r=0,n=[...e];for(let e of t)n.splice(e-r,1),r++;return c(n).length?n:[]}(e,x(t).sort((e,t)=>
6e-t)),Q=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function ee(e,t){let r=Array.isArray(t)?t:/^\w*$/.test(t)?[t]:O(t),n=1===r.length?e:function(e,t){let r=t.slice(0,-1).length,n=0;for(;n<r;)e=u(e)?n++:e[t[n++]];return e}(e,r),i=r.length-1,s=r[i];return n&&delete n[s],0!==i&&(o(n)&&b(n)||Array.isArray(n)&&function(e){for(let t in e)if(e.hasOwnProperty(t)&&!u(e[t]))return!1;return!0}(n))&&ee(e,r.slice(0,-1)),e}var et=(e,t,r)=>(e[t]=r,e);function er(){let e=[];return{get observers(){return e},next:t=>{for(let r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}}var en=e=>n(e)||"object"!=typeof e;function eo(e,t){if(en(e)||en(t))return e===t;if(r(e)&&r(t))return e.getTime()===t.getTime();let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let s of n){let n=e[s];if(!i.includes(s))return!1;if("ref"!==s){let e=t[s];if(r(n)&&r(e)||o(n)&&o(e)||Array.isArray(n)&&Array.isArray(e)?!eo(n,e):n!==e)return!1}}return!0}var ei=e=>B(e)&&e.isConnected,es=e=>{for(let t in e)if(L(e[t]))return!0;return!1};function ea(e,t={}){let r=Array.isArray(e);if(o(e)||r)for(let r in e)Array.isArray(e[r])||o(e[r])&&!es(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ea(e[r],t[r])):n(e[r])||(t[r]=!0);return t}var el=(e,t)=>(function e(t,r,i){let s=Array.isArray(t);if(o(t)||s)for(let s in t)Array.isArray(t[s])||o(t[s])&&!es(t[s])?u(r)||en(i[s])?i[s]=Array.isArray(t[s])?ea(t[s],[]):{...ea(t[s])}:e(t[s],n(r)?{}:r[s],i[s]):i[s]=!eo(t[s],r[s]);return i})(e,t,ea(t)),ec=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>u(e)?e:t?""===e?0/0:e?+e:e:r&&"string"==typeof e?new Date(e):n?n(e):e;function eu(e){let t=e.ref;if(e.refs?!e.refs.every(e=>e.disabled):!t.disabled)return"file"===t.type?t.files:"radio"===t.type?U(e.refs).value:"select-multiple"===t.type?[...t.selectedOptions].map(({value:e})=>e):"checkbox"===t.type?z(e.refs).value:ec(u(t.value)?e.ref.value:t.value,e)}var ed=e=>u(e)?e:e instanceof RegExp?e.source:o(e)?e.value instanceof RegExp?e.value.source:e.value:e;function eh(e,t,r){let n=d(e,r);if(n||/^\w*$/.test(r))return{error:n,name:r};let o=r.split(".");for(;o.length;){let n=o.join("."),i=d(t,n),s=d(e,n);if(i&&!Array.isArray(i)&&r!==n)break;if(s&&s.type)return{name:n,error:s};o.pop()}return{name:r}}let ep={mode:f,reValidateMode:p,shouldFocusError:!0};e.s(["e",0,e=>e.render(T(e)),"p",0,e=>{let{children:r,...n}=e;return t.default.createElement(g.Provider,{value:n},r)},"I",0,N,"g",0,d,"u",0,M,"R",0,T,"v",0,function(e){let r=y(),{control:n=r.control,name:o,keyName:i="id",shouldUnregister:s}=e,[a,c]=t.default.useState(n._getFieldArray(o)),u=t.default.useRef(n._getFieldArray(o).map(A)),h=t.default.useRef(a),p=t.default.useRef(o),f=t.default.useRef(!1);p.current=o,h.current=a,n._names.array.add(o),e.rules&&n.register(o,e.rules),k({next:({values:e,name:t})=>{if(t===p.current||!t){let t=d(e,p.current);Array.isArray(t)&&(c(t),u.current=t.map(A))}},subject:n._subjects.array});let m=t.default.useCallback(e=>{f.current=!0,n._updateFieldArray(o,e)},[n,o]);return t.default.useEffect(()=>{if(n._state.action=!1,D(o,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!R(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([o]).then(e=>{let t=d(e.errors,o),r=d(n._formState.errors,o);(r?!t&&r.type||t&&(r.type!==t.type||r.message!==t.message):t&&t.type)&&(t?M(n._formState.errors,o,t):ee
6(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{let e=d(n._fields,o);e&&e._f&&W(e,n._formValues,"all"===n._options.criteriaMode,n._options.shouldUseNativeValidation,!0).then(e=>!b(e)&&n._subjects.state.next({errors:I(n._formState.errors,e,o)}))}n._subjects.values.next({name:o,values:{...n._formValues}}),n._names.focus&&P(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[a,o,n]),t.default.useEffect(()=>(d(n._formValues,o)||n._updateFieldArray(o),()=>{(n._options.shouldUnregister||s)&&n.unregister(o)}),[o,n,i,s]),{swap:t.default.useCallback((e,t)=>{let r=n._getFieldArray(o);Q(r,e,t),Q(u.current,e,t),m(r),c(r),n._updateFieldArray(o,r,Q,{argA:e,argB:t},!1)},[m,o,n]),move:t.default.useCallback((e,t)=>{let r=n._getFieldArray(o);Y(r,e,t),Y(u.current,e,t),m(r),c(r),n._updateFieldArray(o,r,Y,{argA:e,argB:t},!1)},[m,o,n]),prepend:t.default.useCallback((e,t)=>{let r=x(l(e)),i=X(n._getFieldArray(o),r);n._names.focus=_(o,0,t),u.current=X(u.current,r.map(A)),m(i),c(i),n._updateFieldArray(o,i,X,{argA:J(e)})},[m,o,n]),append:t.default.useCallback((e,t)=>{let r=x(l(e)),i=q(n._getFieldArray(o),r);n._names.focus=_(o,i.length-1,t),u.current=q(u.current,r.map(A)),m(i),c(i),n._updateFieldArray(o,i,q,{argA:J(e)})},[m,o,n]),remove:t.default.useCallback(e=>{let t=Z(n._getFieldArray(o),e);u.current=Z(u.current,e),m(t),c(t),n._updateFieldArray(o,t,Z,{argA:e})},[m,o,n]),insert:t.default.useCallback((e,t,r)=>{let i=x(l(t)),s=G(n._getFieldArray(o),e,i);n._names.focus=_(o,e,r),u.current=G(u.current,e,i.map(A)),m(s),c(s),n._updateFieldArray(o,s,G,{argA:e,argB:J(t)})},[m,o,n]),update:t.default.useCallback((e,t)=>{let r=l(t),i=et(n._getFieldArray(o),e,r);u.current=[...i].map((t,r)=>t&&r!==e?u.current[r]:A()),m(i),c([...i]),n._updateFieldArray(o,i,et,{argA:e,argB:r},!0,!1)},[m,o,n]),replace:t.default.useCallback(e=>{let t=x(l(e));u.current=t.map(A),m([...t]),c([...t]),n._updateFieldArray(o,[...t],e=>e,{},!0,!1)},[m,o,n]),fields:t.default.useMemo(()=>a.map((e,t)=>({...e,[i]:u.current[t]||A()})),[a,i])}},"G",0,function(e={}){let p=t.default.useRef(),f=t.default.useRef(),[m,g]=t.default.useState({isDirty:!1,isValidating:!1,isLoading:L(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:L(e.defaultValues)?void 0:e.defaultValues});p.current||(p.current={...function(e={},t){let p,f={...ep,...e},m={submitCount:0,isDirty:!1,isLoading:L(f.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},g={},y=(o(f.defaultValues)||o(f.values))&&l(f.defaultValues||f.values)||{},v=f.shouldUnregister?{}:l(y),w={action:!1,mount:!1,watch:!1},S={mount:new Set,unMount:new Set,array:new Set,watch:new Set},k=0,C={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},O={values:er(),array:er(),state:er()},T=e.resetOptions&&e.resetOptions.keepDirtyValues,N=R(f.mode),A=R(f.reValidateMode),_="all"===f.criteriaMode,V=async e=>{if(C.isValid||e){let e=f.resolver?b((await $()).errors):await H(g,!0);e!==m.isValid&&O.state.next({isValid:e})}},F=e=>C.isValidating&&O.state.next({isValidating:e}),j=(e,t,r,n)=>{let o=d(g,e);if(o){let i=d(v,e,u(r)?d(y,e):r);u(i)||n&&n.defaultChecked||t?M(v,e,t?i:eu(o._f)):J(e,i),w.mount&&V()}},z=(e,t,r,n,o)=>{let i=!1,s=!1,a={name:e};if(!r||n){C.isDirty&&(s=m.isDirty,m.isDirty=a.isDirty=K(),i=s!==a.isDirty);let r=eo(d(y,e),t);s=d(m.dirtyFields,e),r?ee(m.dirtyFields,e):M(m.dirtyFields,e,!0),a.dirtyFields=m.dirtyFields,i=i||C.dirtyFields&&!r!==s}if(r){let t=d(m.touchedFields,e);t||(M(m.touchedFields,e,r),a.touchedFields=m.touchedFields,i=i||C.touchedFields&&t!==r)}return i&&o&&O.state.next(a),i?a:{}},$=async e=>f.resolver(v,f.context,((e,t,r,n)=>{let o={};for(let r of e){let e=d(t,r);e&&M(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||S.mount,g,f.criteriaMode,f.shouldUseNativeValidation)),U=async e=>{let{errors:t}=await $(e);if(e)for(let r of e){let e=d(t,r);e?M(m.errors,r,e):ee(m.errors,r)}else m.errors=t;return t},H=async(e,t,r={valid:!0})=>{for(let n in e){let o=e[n];if(o){let{_f:e,...n}=o;if(e){let n=S.array.has(e.name),i=await W(o,v,_,f.shouldUseNativeValidation&&!t,n);if(i[e.name]&&(r.valid=!1,t))break;t||(d(i,e.name)?n?I(m.errors,i,e.name):M(m.errors,e.name,i[e.name]):ee(m.errors,e.name))}n&&await H(n,t,r)}}return r.valid},K=(e,t)=>(e&&t&&M(v,e,t),!eo(et(),y)),q=(e,t,r)=>E(e,S,{...w.mount?v:u(t)?y:"string"==typeof e?{[e]:t}:t},r,t),J=(e,t,r={})=>{let o=d(g,e),i=t;if(o){let r=o._f;r&&(r.disabled||M(v,e,ec(t,r)),i=B(r.ref)&&n(t)?"":t,"select-multiple"===r.ref.type?[...r.ref.options].forEac
6h(e=>e.selected=i.includes(e.value)):r.refs?"checkbox"===r.ref.type?r.refs.length>1?r.refs.forEach(e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(i)?!!i.find(t=>t===e.value):i===e.value)):r.refs[0]&&(r.refs[0].checked=!!i):r.refs.forEach(e=>e.checked=e.value===i):"file"===r.ref.type?r.ref.value="":(r.ref.value=i,r.ref.type||O.values.next({name:e,values:{...v}})))}(r.shouldDirty||r.shouldTouch)&&z(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&Q(e)},G=(e,t,n)=>{for(let o in t){let i=t[o],s=`${e}.${o}`,a=d(g,s);!S.array.has(e)&&en(i)&&(!a||a._f)||r(i)?J(s,i,n):G(s,i,n)}},Y=(e,r,o={})=>{let i=d(g,e),s=S.array.has(e),a=l(r);M(v,e,a),s?(O.array.next({name:e,values:{...v}}),(C.isDirty||C.dirtyFields)&&o.shouldDirty&&O.state.next({name:e,dirtyFields:el(y,v),isDirty:K(e,a)})):!i||i._f||n(a)?J(e,a,o):G(e,a,o),D(e,S)&&O.state.next({...m}),O.values.next({name:e,values:{...v}}),w.mount||t()},X=async t=>{let r=t.target,n=r.name,o=!0,s=d(g,n),a=e=>{o=Number.isNaN(e)||e===d(v,n,e)};if(s){var l,c,u,y,w;let R,P,I,L=r.type?eu(s._f):i(t),B=t.type===h||"focusout"===t.type,j=!((I=s._f).mount&&(I.required||I.min||I.max||I.maxLength||I.minLength||I.pattern||I.validate))&&!f.resolver&&!d(m.errors,n)&&!s._f.deps||(l=B,c=d(m.touchedFields,n),u=m.isSubmitted,y=A,!(w=N).isOnAll&&(!u&&w.isOnTouch?!(c||l):(u?y.isOnBlur:w.isOnBlur)?!l:(u?!y.isOnChange:!w.isOnChange)||l)),U=D(n,S,B);M(v,n,L),B?(s._f.onBlur&&s._f.onBlur(t),p&&p(0)):s._f.onChange&&s._f.onChange(t);let K=z(n,L,B,!1),q=!b(K)||U;if(B||O.values.next({name:n,type:t.type,values:{...v}}),j)return C.isValid&&V(),q&&O.state.next({name:n,...U?{}:K});if(!B&&U&&O.state.next({...m}),F(!0),f.resolver){let{errors:e}=await $([n]);if(a(L),o){let t=eh(m.errors,g,n),r=eh(e,g,t.name||n);R=r.error,n=r.name,P=b(e)}}else R=(await W(s,v,_,f.shouldUseNativeValidation))[n],a(L),o&&(R?P=!1:C.isValid&&(P=await H(g,!0)));if(o){s._f.deps&&Q(s._f.deps);var x=n,E=P,T=R;let t=d(m.errors,x),r=C.isValid&&"boolean"==typeof E&&m.isValid!==E;if(e.delayError&&T){let t;t=()=>{M(m.errors,x,T),O.state.next({errors:m.errors})},(p=e=>{clearTimeout(k),k=setTimeout(t,e)})(e.delayError)}else clearTimeout(k),p=null,T?M(m.errors,x,T):ee(m.errors,x);if((T?!eo(t,T):t)||!b(K)||r){let e={...K,...r&&"boolean"==typeof E?{isValid:E}:{},errors:m.errors,name:x};m={...m,...e},O.state.next(e)}F(!1)}}},Z=(e,t)=>{if(d(m.errors,t)&&e.focus)return e.focus(),1},Q=async(e,t={})=>{let r,n,o=x(e);if(F(!0),f.resolver){let t=await U(u(e)?e:o);r=b(t),n=e?!o.some(e=>d(t,e)):r}else e?((n=(await Promise.all(o.map(async e=>{let t=d(g,e);return await H(t&&t._f?{[e]:t}:t)}))).every(Boolean))||m.isValid)&&V():n=r=await H(g);return O.state.next({..."string"!=typeof e||C.isValid&&r!==m.isValid?{}:{name:e},...f.resolver||!e?{isValid:r}:{},errors:m.errors,isValidating:!1}),t.shouldFocus&&!n&&P(g,Z,e?o:S.mount),n},et=e=>{let t={...y,...w.mount?v:{}};return u(e)?t:"string"==typeof e?d(t,e):e.map(e=>d(t,e))},es=(e,t)=>({invalid:!!d((t||m).errors,e),isDirty:!!d((t||m).dirtyFields,e),isTouched:!!d((t||m).touchedFields,e),error:d((t||m).errors,e)}),ea=(e,t,r)=>{let n=(d(g,e,{_f:{}})._f||{}).ref;M(m.errors,e,{...t,ref:n}),O.state.next({name:e,errors:m.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},ef=(e,t={})=>{for(let r of e?x(e):S.mount)S.mount.delete(r),S.array.delete(r),t.keepValue||(ee(g,r),ee(v,r)),t.keepError||ee(m.errors,r),t.keepDirty||ee(m.dirtyFields,r),t.keepTouched||ee(m.touchedFields,r),f.shouldUnregister||t.keepDefaultValue||ee(y,r);O.values.next({values:{...v}}),O.state.next({...m,...!t.keepDirty?{}:{isDirty:K()}}),t.keepIsValid||V()},em=({disabled:e,name:t,field:r,fields:n,value:o})=>{if("boolean"==typeof e){let i=e?void 0:u(o)?eu(r?r._f:d(n,t)._f):o;M(v,t,i),z(t,i,!1,!1,!0)}},eg=(e,t={})=>{let r=d(g,e),n="boolean"==typeof t.disabled;return M(g,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),S.mount.add(e),r?em({field:r,disabled:t.disabled,name:e}):j(e,!0,t.value),{...n?{disabled:t.disabled}:{},...f.progressive?{required:!!t.required,min:ed(t.min),max:ed(t.max),minLength:ed(t.minLength),maxLength:ed(t.maxLength),pattern:ed(t.pattern)}:{}
6,name:e,onChange:X,onBlur:X,ref:n=>{if(n){let o;eg(e,t),r=d(g,e);let i=u(n.value)&&n.querySelectorAll&&n.querySelectorAll("input,select,textarea")[0]||n,s="radio"===(o=i).type||"checkbox"===o.type,a=r._f.refs||[];(s?a.find(e=>e===i):i===r._f.ref)||(M(g,e,{_f:{...r._f,...s?{refs:[...a.filter(ei),i,...Array.isArray(d(y,e))?[{}]:[]],ref:{type:i.type,name:e}}:{ref:i}}}),j(e,!1,void 0,i))}else(r=d(g,e,{}))._f&&(r._f.mount=!1),(f.shouldUnregister||t.shouldUnregister)&&!(s(S.array,e)&&w.action)&&S.unMount.add(e)}}},ey=()=>f.shouldFocusError&&P(g,Z,S.mount),ev=(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let n=l(v);if(O.state.next({isSubmitting:!0}),f.resolver){let{errors:e,values:t}=await $();m.errors=e,n=t}else await H(g);ee(m.errors,"root"),b(m.errors)?(O.state.next({errors:{}}),await e(n,r)):(t&&await t({...m.errors},r),ey(),setTimeout(ey)),O.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:b(m.errors),submitCount:m.submitCount+1,errors:m.errors})},eb=(r,n={})=>{let o=r?l(r):y,i=l(o),s=r&&!b(r)?i:y;if(n.keepDefaultValues||(y=o),!n.keepValues){if(n.keepDirtyValues||T)for(let e of S.mount)d(m.dirtyFields,e)?M(s,e,d(v,e)):Y(e,d(s,e));else{if(a&&u(r))for(let e of S.mount){let t=d(g,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(B(e)){let t=e.closest("form");if(t){t.reset();break}}}}g={}}v=e.shouldUnregister?n.keepDefaultValues?l(y):{}:l(s),O.array.next({values:{...s}}),O.values.next({values:{...s}})}S={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},w.mount||t(),w.mount=!C.isValid||!!n.keepIsValid,w.watch=!!e.shouldUnregister,O.state.next({submitCount:n.keepSubmitCount?m.submitCount:0,isDirty:n.keepDirty?m.isDirty:!!(n.keepDefaultValues&&!eo(r,y)),isSubmitted:!!n.keepIsSubmitted&&m.isSubmitted,dirtyFields:n.keepDirtyValues?m.dirtyFields:n.keepDefaultValues&&r?el(y,r):{},touchedFields:n.keepTouched?m.touchedFields:{},errors:n.keepErrors?m.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&m.isSubmitSuccessful,isSubmitting:!1})},ew=(e,t)=>eb(L(e)?e(v):e,t);return{control:{register:eg,unregister:ef,getFieldState:es,handleSubmit:ev,setError:ea,_executeSchema:$,_getWatch:q,_getDirty:K,_updateValid:V,_removeUnmounted:()=>{for(let e of S.unMount){let t=d(g,e);t&&(t._f.refs?t._f.refs.every(e=>!ei(e)):!ei(t._f.ref))&&ef(e)}S.unMount=new Set},_updateFieldArray:(e,t=[],r,n,o=!0,i=!0)=>{if(n&&r){if(w.action=!0,i&&Array.isArray(d(g,e))){let t=r(d(g,e),n.argA,n.argB);o&&M(g,e,t)}if(i&&Array.isArray(d(m.errors,e))){let t,i=r(d(m.errors,e),n.argA,n.argB);o&&M(m.errors,e,i),c(d(t=m.errors,e)).length||ee(t,e)}if(C.touchedFields&&i&&Array.isArray(d(m.touchedFields,e))){let t=r(d(m.touchedFields,e),n.argA,n.argB);o&&M(m.touchedFields,e,t)}C.dirtyFields&&(m.dirtyFields=el(y,v)),O.state.next({name:e,isDirty:K(e,t),dirtyFields:m.dirtyFields,errors:m.errors,isValid:m.isValid})}else M(v,e,t)},_updateDisabledField:em,_getFieldArray:t=>c(d(w.mount?v:y,t,e.shouldUnregister?d(y,t,[]):[])),_reset:eb,_resetDefaultValues:()=>L(f.defaultValues)&&f.defaultValues().then(e=>{ew(e,f.resetOptions),O.state.next({isLoading:!1})}),_updateFormState:e=>{m={...m,...e}},_disableForm:e=>{"boolean"==typeof e&&(O.state.next({disabled:e}),P(g,t=>{t.disabled=e},0,!1))},_subjects:O,_proxyFormState:C,get _fields(){return g},get _formValues(){return v},get _state(){return w},set _state(e){w=e},get _defaultValues(){return y},get _names(){return S},set _names(e){S=e},get _formState(){return m},set _formState(e){m=e},get _options(){return f},set _options(e){f={...f,...e}}},trigger:Q,register:eg,handleSubmit:ev,watch:(e,t)=>L(e)?O.values.subscribe({next:r=>e(q(void 0,t),r)}):q(e,t,!0),setValue:Y,getValues:et,reset:ew,resetField:(e,t={})=>{d(g,e)&&(u(t.defaultValue)?Y(e,d(y,e)):(Y(e,t.defaultValue),M(y,e,t.defaultValue)),t.keepTouched||ee(m.touchedFields,e),t.keepDirty||(ee(m.dirtyFields,e),m.isDirty=t.defaultValue?K(e,d(y,e)):K()),!t.keepError&&(ee(m.errors,e),C.isValid&&V()),O.state.next({...m}))},clearErrors:e=>{e&&x(e).forEach(e=>ee(m.errors,e)),O.state.next({errors:e?m.errors:{}})},unregister:ef,setError:ea,setFocus:(e,t={})=>{let r=d(g,e),n=r&&r._f;if(n){let e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:es}}(e,()=>g(e=>({...e}))),formState:m});let y=p.current.control;return y._options=e,k({subject:y._subjects.state,next:e=>{w(e,y._proxyFormState,y._updateFormState,!0)&&g({...y._formState})}}),t.default.useEffect(()=>y._disableForm(e.disabled),[y,e.disabled]),t.default.useEffect(()=>{if(y._proxyFormState.isDirty){let e=y._getDirty();e!==m.isDirty&&y._subjects.state.next({isDirty:e})}},[y,m.isDirty]),t.default.useEffect(()=>{e.values&&!eo(e.values,f.current)?(y._reset(e.values,y._options.resetOptions),f.current=e.values):y._resetDefaultValues()},[e.values,y]),t.default.useEffect(()=>
6{y._state.mount||(y._updateValid(),y._state.mount=!0),y._state.watch&&(y._state.watch=!1,y._subjects.state.next({...y._formState})),y._removeUnmounted()}),p.current.formState=v(m,y),p.current},"M",0,y,"h",0,C])},46667,(e,t,r)=>{var n,o;Object.defineProperty(r,"__esModule",{value:!0}),r.errorMessages=r.ErrorType=void 0,(o=n=r.ErrorType||(r.ErrorType={})).MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING",r.errorMessages=new Map([[n.MalformedUnicode,"malformed Unicode character escape sequence"],[n.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[n.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[n.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[n.EndOfString,"malformed escape sequence at end of string"]])},960572,(e,t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.unraw=r.errorMessages=r.ErrorType=void 0;let n=e.r(46667);function o(e,t,r){let o=e.match(/[^a-f0-9]/i)?0/0:parseInt(e,16);if(Number.isNaN(o)||void 0!==r&&r!==e.length)throw SyntaxError(n.errorMessages.get(t));return o}function i(e,t){let r=o(e,n.ErrorType.MalformedUnicode,4);return void 0!==t?String.fromCharCode(r,o(t,n.ErrorType.MalformedUnicode,4)):String.fromCharCode(r)}Object.defineProperty(r,"ErrorType",{enumerable:!0,get:function(){return n.ErrorType}}),Object.defineProperty(r,"errorMessages",{enumerable:!0,get:function(){return n.errorMessages}});let s=new Map([["b","\b"],["f","\f"],["n","\n"],["r","\r"],["t","	"],["v","\v"],["0","\0"]]),a=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function l(e,t=!1){return e.replace(a,function(e,r,a,l,c,u,d,h,p){if(void 0!==r)return"\\";if(void 0!==a)return String.fromCharCode(o(a,n.ErrorType.MalformedHexadecimal,2));if(void 0!==l){if("{"!==l.charAt(0)||"}"!==l.charAt(l.length-1))throw SyntaxError(n.errorMessages.get(n.ErrorType.MalformedUnicode));let e=o(l.slice(1,-1),n.ErrorType.MalformedUnicode);try{return String.fromCodePoint(e)}catch(e){throw e instanceof RangeError?SyntaxError(n.errorMessages.get(n.ErrorType.CodePointLimit)):e}}if(void 0!==c)return i(c,u);if(void 0!==d)return i(d);if("0"===h)return"\0";if(void 0!==h)return function(e,t=!1){if(t)throw SyntaxError(n.errorMessages.get(n.ErrorType.OctalDeprecation));return String.fromCharCode(parseInt(e,8))}(h,!t);if(void 0!==p)return s.get(p)||p;throw SyntaxError(n.errorMessages.get(n.ErrorType.EndOfString))})}r.unraw=l,r.default=l},388132,e=>{var t=e.i(651325),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,r=t.getComputedStyle;if(!e)return[];var n=function(e){return"none"!==r(e).display&&(null===e.parentElement||n(e.parentElement))};return Array.from(e.querySelectorAll('button:not([disabled]):not([tabindex="-1"]),\n       input:not([disabled]):not([tabindex="-1"]),\n       select:not([disabled]):not([tabindex="-1"]),\n       textarea:not([disabled]):not([tabindex="-1"]),\n       a[href],\n       [tabindex]:not([tabindex="-1"])')).filter(function(e){return"hidden"!==r(e).visibility&&n(e)})},n=function(e){switch(e.dataset.focusPriority){case"low":return -1;case"high":return 1;default:return 0}},o=e.i(868532);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s=["children","onClose","tag","preventScroll"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){var n,o,s;n=e,o=t,s=r[t],(o=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=i(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(o))in n?Object.defineProperty(n,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[o]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEac
6h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}e.s(["f",0,function(e){var i=e.children,a=e.onClose,c=e.tag,u=e.preventScroll,d=void 0!==u&&u,h=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,s),p=(0,t.useRef)(null);return(0,t.useLayoutEffect)(function(){var e,t=document.activeElement,o=r(p.current);if(0===o.length?null==(e=p.current)||e.focus({preventScroll:d}):o.reduce(function(e,t){return n(t)>n(e)?t:e}).focus({preventScroll:d}),t)return function(){return t.focus({preventScroll:d})}},[d]),(0,t.useEffect)(function(){var e=function(e){"Escape"===e.key&&a()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[a]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{tabIndex:0,onFocus:function(){var e,t=r(p.current);null==(e=t[t.length-1])||e.focus()}}),(0,o.jsx)(void 0===c?"div":c,l(l({ref:p,tabIndex:-1},h),{},{children:i})),(0,o.jsx)("div",{tabIndex:0,onFocus:function(){var e;null==(e=r(p.current)[0])||e.focus()}})]})}],388132)},999474,e=>{var t=e.i(388132);e.s(["f",()=>t.f])},747218,e=>{var t=e.i(358040),r=e.i(868532);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=["size"];function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){var o,i,s;o=e,i=t,s=r[t],(i=function(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}(i))in o?Object.defineProperty(o,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[i]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}e.s(["f",0,function(e){var n=e.size,i=void 0===n?"1em":n,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,o);return(0,r.jsx)(t.f,s(s({},a),{},{width:i,height:i,viewBox:"0 0 24 24",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.9958 1.06663C15.4226 1.05296 13.907 1.65773 12.7753 2.75068L12.765 2.7608L11.045 4.4708C10.6534 4.86018 10.6515 5.49335 11.0409 5.88501C11.4303 6.27667 12.0634 6.27851 12.4551 5.88913L14.1697 4.1845C14.9236 3.45887 15.9319 3.05746 16.9784 3.06656C18.0272 3.07567 19.0304 3.49635 19.772 4.23798C20.5137 4.97961 20.9344 5.98286 20.9435 7.03165C20.9526 8.0777 20.5515 9.08557 19.8265 9.83934L16.833 12.8329L16.8328 12.833C16.4273 13.2386 15.9393 13.5523 15.4019 13.7528C14.8645 13.9533 14.2903 14.0358 13.7181 13.9949C13.146 13.9539 12.5894 13.7903 12.0861 13.5153C11.5827 13.2403 11.1444 12.8603 10.8008 12.401C10.47 11.9587 9.84333 11.8684 9.40108 12.1992C8.95883 12.53 8.86849 13.1567 9.1993 13.5989C9.71464 14.2879 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9897C14.4334 16.0512 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8554 18.2473 14.2469L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58745 22.9434 7.01427C22.9297 5.44109 22.2987 3.93621 21.1863 2.82377C20.0738 1.71132 18.5689 1.0803 16.9958 1.06663ZM10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.7406
67 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",fill:"currentColor"})}))}],747218)},914167,e=>{var t=e.i(651325),r=e.i(281031),n=e.i(663160),o=e.i(644412),i=e.i(524),s=e.i(868532);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var l=["isUnderlined","maxLines"];function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var u=(0,r.m)(["text-decoration:",";border:1px solid transparent;border-radius:8px;font-weight:600;color:",";&:hover{color:",";text-decoration:underline;}&:active{color:",";}&:focus{text-decoration:underline;","}&:focus:not(:focus-visible){","}","{text-decoration:none;font-size:calc(2em - 12px);margin-left:calc(12px - 0.5em);vertical-align:-0.2em;}",""],function(e){return e.$isUnderlined?"underline":"none"},function(e){return e.theme.colors.getContrast(100)},function(e){return e.theme.colors.brand},function(e){return e.theme.colors.getBrand(130)},n.K.highlight,n.K.clear,o.f,function(e){var t=e.$maxLines;return t&&(0,r.m)(["",""],(0,i.f)(t,"em"))}),d=r.U.a.withConfig({displayName:"A__StyledLink",componentId:"sc-1v70eeh-0"})(["",""],u),h=(0,t.forwardRef)(function(e,t){var r=e.isUnderlined,n=e.maxLines,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,l);return(0,s.jsx)(d,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=a(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({ref:t,$isUnderlined:void 0!==r&&r,$maxLines:n},o))});h.displayName="A",e.s(["A",0,h])}],90074,(e,t,r)=>{var n=e.r(281629);t.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},t.exports.__esModule=!0,t.exports.default=t.exports},174212,(e,t,r)=>{var n=e.r(340353).default;t.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}
6,t.exports.__esModule=!0,t.exports.default=t.exports},281629,(e,t,r)=>{var n=e.r(340353).default,o=e.r(174212);t.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports},340353,(e,t,r)=>{function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}]);
7
8//# debugId=08d799dd-e000-9ad3-5d44-74672ea21aea

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.