@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
2 lines • 2.56 MB
JavaScript
/*! For license information please see 239.js.LICENSE.txt */
(self.webpackChunkSelfCommunityReactUI=self.webpackChunkSelfCommunityReactUI||[]).push([[239],{81998:(e,t,n)=>{"use strict";var r=n(93053),i=n(73515),o=n(9476),a=n(93181);function s(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function l(e,t=a.$getSelection()){return null==t&&s(166),a.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?"":r.$generateHtmlFromNodes(e,t)}function c(e,t=a.$getSelection()){return null==t&&s(166),a.$isRangeSelection(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(f(e,t))}function u(e,t,n){e.dispatchCommand(a.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:t,selection:n})||n.insertNodes(t)}function d(e,t,n,r=[]){let o=null===t||n.isSelected(t);const l=a.$isElementNode(n)&&n.excludeFromCopy("html");let c=n;if(null!==t){let e=a.$cloneWithProperties(n);e=a.$isTextNode(e)&&null!==t?i.$sliceSelectedTextNodeContent(t,e):e,c=e}const u=a.$isElementNode(c)?c.getChildren():[],f=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&s(58,n.name),a.$isElementNode(e)){const e=t.children;Array.isArray(e)||s(59,n.name)}return t}(c);if(a.$isTextNode(c)){const e=c.__text;e.length>0?f.text=e:o=!1}for(let r=0;r<u.length;r++){const i=u[r],s=d(e,t,i,f.children);!o&&a.$isElementNode(n)&&s&&n.extractWithChild(i,t,"clone")&&(o=!0)}if(o&&!l)r.push(f);else if(Array.isArray(f.children))for(let e=0;e<f.children.length;e++){const t=f.children[e];r.push(t)}return o}function f(e,t){const n=[],r=a.$getRoot().getChildren();for(let i=0;i<r.length;i++)d(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function h(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=a.$parseSerializedNode(r);a.$isTextNode(o)&&i.$addNodeStyle(o),t.push(o)}return t}let p=null;function m(e,t,n){if(void 0===n){const t=a.getDOMSelection(e._window);if(!t)return!1;const r=t.anchorNode,i=t.focusNode;if(null!==r&&null!==i&&!a.isSelectionWithinEditor(e,r,i))return!1;const o=a.$getSelection();if(null===o)return!1;n=v(o)}t.preventDefault();const r=t.clipboardData;return null!==r&&(y(r,n),!0)}const g=[["text/html",l],["application/x-lexical-editor",c]];function v(e=a.$getSelection()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=a.$getEditor();for(const[r,i]of g){const o=i(n,e);null!==o&&(t[r]=o)}}return t}function y(e,t){for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}t.$generateJSONFromSelectedNodes=f,t.$generateNodesFromSerializedNodes=h,t.$getClipboardDataFromSelection=v,t.$getHtmlContent=l,t.$getLexicalContent=c,t.$insertDataTransferForPlainText=function(e,t){const n=e.getData("text/plain")||e.getData("text/uri-list");null!=n&&t.insertRawText(n)},t.$insertDataTransferForRichText=function(e,t,n){const i=e.getData("application/x-lexical-editor");if(i)try{const e=JSON.parse(i);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return u(n,h(e.nodes),t)}catch(e){}const o=e.getData("text/html"),s=e.getData("text/plain");if(o&&s!==o)try{const e=(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(o),"text/html");return u(n,r.$generateNodesFromDOM(n,e),t)}catch(e){}const l=s||e.getData("text/uri-list");if(null!=l)if(a.$isRangeSelection(t)){const e=l.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=a.$getSelection();if(a.$isRangeSelection(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([a.$createTabNode()]):n.insertText(r)}}}else t.insertRawText(l)},t.$insertGeneratedNodes=u,t.copyToClipboard=async function(e,t,n){if(null!==p)return!1;if(null!==t)return new Promise(((r,i)=>{e.update((()=>{r(m(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,s=window.document,l=a.getDOMSelection(i);if(null===r||null===l)return!1;const c=s.createElement("span");c.style.cssText="position: fixed; top: -1000px;",c.append(s.createTextNode("#")),r.append(c);const u=new Range;return u.setStart(c,0),u.setEnd(c,1),l.removeAllRanges(),l.addRange(u),new Promise(((t,r)=>{const i=e.registerCommand(a.COPY_COMMAND,(r=>(o.objectKlassEquals(r,ClipboardEvent)&&(i(),null!==p&&(window.clearTimeout(p),p=null),t(m(e,r,n))),!0)),a.COMMAND_PRIORITY_CRITICAL);p=window.setTimeout((()=>{i(),p=null,t(!1)}),50),s.execCommand("copy"),c.remove()}))},t.setLexicalClipboardDataTransfer=y},59239:(e,t,n)=>{"use strict";var r=n(93181);t.registerDragonSupport=function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const i=e.getRootElement();if(document.activeElement!==i)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const i=t.payload;if(i&&"makeChanges"===i.functionId){const t=i.args;if(t){const[i,o,a,s,l,c]=t;e.update((()=>{const e=r.$getSelection();if(r.$isRangeSelection(e)){const t=e.anchor;let c=t.getNode(),u=0,d=0;if(r.$isTextNode(c)&&i>=0&&o>=0&&(u=i,d=i+o,e.setTextNodeRange(c,u,c,d)),u===d&&""===a||(e.insertRawText(a),c=t.getNode()),r.$isTextNode(c)){u=s,d=s+l;const t=c.getTextContentSize();u=u>t?t:u,d=d>t?t:d,e.setTextNodeRange(c,u,c,d)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}},13673:(e,t,n)=>{"use strict";var r=n(9476),i=n(93181);function o(e,t){let n=Date.now(),r=0;return(o,a,s,l,c,u)=>{const d=Date.now();if(u.has("historic"))return r=0,n=d,2;const f=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const a=t._selection,s=e._selection;if(o)return 1;if(!(i.$isRangeSelection(a)&&i.$isRangeSelection(s)&&s.isCollapsed()&&a.isCollapsed()))return 0;const l=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||i.$isRootNode(n)||o.push(n)}return o}(t,n,r);if(0===l.length)return 0;if(l.length>1){const n=t._nodeMap,r=n.get(a.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&i.$isTextNode(r)&&1===r.__text.length&&1===a.anchor.offset?2:0}const c=l[0],u=e._nodeMap.get(c.__key);if(!i.$isTextNode(u)||!i.$isTextNode(c)||u.__mode!==c.__mode)return 0;const d=u.__text,f=c.__text;if(d===f)return 0;const h=a.anchor,p=s.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const m=h.offset,g=p.offset,v=f.length-d.length;return 1===v&&g===m-1?2:-1===v&&g===m+1?3:-1===v&&g===m?4:0}(o,a,l,c,e.isComposing()),h=(()=>{const h=null===s||s.editor===e,p=u.has("history-push");if(!p&&h&&u.has("history-merge"))return 0;if(null===o)return 1;const m=a._selection;return l.size>0||c.size>0?!1===p&&0!==f&&f===r&&d<n+t&&h||1===l.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),a=t._selection,s=n._selection;return!(i.$isRangeSelection(a)&&i.$isRangeSelection(s)&&"element"===a.anchor.type&&"element"===a.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!i.$isTextNode(r)||!i.$isTextNode(o)||r.__parent!==o.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(l)[0],o,a)?0:1:null!==m?0:2})();return n=d,r=f,h}}function a(e){e.undoStack=[],e.redoStack=[],e.current=null}t.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}},t.registerHistory=function(e,t,n){const s=o(e,n);return r.mergeRegister(e.registerCommand(i.UNDO_COMMAND,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,a=r.pop();null!==o&&(n.push(o),e.dispatchCommand(i.CAN_REDO_COMMAND,!0)),0===r.length&&e.dispatchCommand(i.CAN_UNDO_COMMAND,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.REDO_COMMAND,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(i.CAN_UNDO_COMMAND,!0));const a=n.pop();0===n.length&&e.dispatchCommand(i.CAN_REDO_COMMAND,!1),t.current=a||null,a&&a.editor.setEditorState(a.editorState,{tag:"historic"})}}(e,t),!0)),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.CLEAR_EDITOR_COMMAND,(()=>(a(t),!1)),i.COMMAND_PRIORITY_EDITOR),e.registerCommand(i.CLEAR_HISTORY_COMMAND,(()=>(a(t),e.dispatchCommand(i.CAN_REDO_COMMAND,!1),e.dispatchCommand(i.CAN_UNDO_COMMAND,!1),!0)),i.COMMAND_PRIORITY_EDITOR),e.registerUpdateListener((({editorState:n,prevEditorState:r,dirtyLeaves:o,dirtyElements:a,tags:l})=>{const c=t.current,u=t.redoStack,d=t.undoStack,f=null===c?null:c.editorState;if(null!==c&&n===f)return;const h=s(r,n,c,o,a,l);if(1===h)0!==u.length&&(t.redoStack=[],e.dispatchCommand(i.CAN_REDO_COMMAND,!1)),null!==c&&(d.push({...c}),e.dispatchCommand(i.CAN_UNDO_COMMAND,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}},93053:(e,t,n)=>{"use strict";var r=n(73515),i=n(9476),o=n(93181);function a(e,t,n,s=null){let l=null===s||t.isSelected(s);const c=o.$isElementNode(t)&&t.excludeFromCopy("html");let u=t;if(null!==s){let e=o.$cloneWithProperties(t);e=o.$isTextNode(e)&&null!==s?r.$sliceSelectedTextNodeContent(s,e):e,u=e}const d=o.$isElementNode(u)?u.getChildren():[],f=e._nodes.get(u.getType());let h;h=f&&void 0!==f.exportDOM?f.exportDOM(e,u):u.exportDOM(e);const{element:p,after:m}=h;if(!p)return!1;const g=document.createDocumentFragment();for(let n=0;n<d.length;n++){const r=d[n],i=a(e,r,g,s);!l&&o.$isElementNode(t)&&i&&t.extractWithChild(r,s,"html")&&(l=!0)}if(l&&!c){if((i.isHTMLElement(p)||o.isDocumentFragment(p))&&p.append(g),n.append(p),m){const e=m.call(u,p);e&&(o.isDocumentFragment(p)?p.replaceChildren(e):p.replaceWith(e))}}else n.append(g);return l}const s=new Set(["STYLE","SCRIPT"]);function l(e,t,n,r,a=new Map,c){let u=[];if(s.has(e.nodeName))return u;let d=null;const f=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),h=f?f(e):null;let p=null;if(null!==h){p=h.after;const t=h.node;if(d=Array.isArray(t)?t[t.length-1]:t,null!==d){for(const[,e]of a)if(d=e(d,c),!d)break;d&&u.push(...Array.isArray(t)?t:[d])}null!=h.forChild&&a.set(e.nodeName,h.forChild)}const m=e.childNodes;let g=[];const v=(null==d||!o.$isRootOrShadowRoot(d))&&(null!=d&&o.$isBlockElementNode(d)||r);for(let e=0;e<m.length;e++)g.push(...l(m[e],t,n,v,new Map(a),d));return null!=p&&(g=p(g)),i.isBlockDomNode(e)&&(g=function(e,t,n){const r=e.style.textAlign,i=[];let a=[];for(let e=0;e<t.length;e++){const s=t[e];if(o.$isBlockElementNode(s))r&&!s.getFormat()&&s.setFormat(r),i.push(s);else if(a.push(s),e===t.length-1||e<t.length-1&&o.$isBlockElementNode(t[e+1])){const e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,g,v?()=>{const e=new o.ArtificialNode__DO_NOT_USE;return n.push(e),e}:o.$createParagraphNode)),null==d?g.length>0?u=u.concat(g):i.isBlockDomNode(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&o.isInlineDomNode(e.nextSibling)&&o.isInlineDomNode(e.previousSibling)}(e)&&(u=u.concat(o.$createLineBreakNode())):o.$isElementNode(d)&&d.append(...g),u}t.$generateHtmlFromNodes=function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),i=o.$getRoot().getChildren();for(let n=0;n<i.length;n++)a(e,i[n],r,t);return r.innerHTML},t.$generateNodesFromDOM=function(e,t){const n=t.body?t.body.childNodes:[];let r=[];const i=[];for(let t=0;t<n.length;t++){const o=n[t];if(!s.has(o.nodeName)){const t=l(o,e,i,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof o.ArtificialNode__DO_NOT_USE&&t.insertAfter(o.$createLineBreakNode());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(i),r}},71761:(e,t,n)=>{"use strict";var r=n(9476),i=n(93181);const o=new Set(["http:","https:","mailto:","sms:","tel:"]);class a extends i.ElementNode{static getType(){return"link"}static clone(e){return new a(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),r.addClassNamesToElement(t,e.theme.link),t}updateDOM(e,t,n){if(r.isHTMLAnchorElement(t)){const n=this.__url,r=this.__target,i=this.__rel,o=this.__title;n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),i!==e.__rel&&(i?t.rel=i:t.removeAttribute("rel")),o!==e.__title&&(o?t.title=o:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:s,priority:1})}}static importJSON(e){return l().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{const t=new URL(e);if(!o.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=l(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!i.$isRangeSelection(t))return!1;const r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function s(e){let t=null;if(r.isHTMLAnchorElement(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=l(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function l(e="",t){return i.$applyNodeReplacement(new a(e,t))}function c(e){return e instanceof a}class u extends a{constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new u(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return d().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(i.$isElementNode(n)){const e=d(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function d(e="",t){return i.$applyNodeReplacement(new u(e,t))}function f(e){return e instanceof u}const h=i.createCommand("TOGGLE_LINK_COMMAND");function p(e,t){if("element"===e.type){const n=e.getNode();return i.$isElementNode(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function m(e,t={}){const{target:n,title:o}=t,a=void 0===t.rel?"noreferrer":t.rel,s=i.$getSelection();if(!i.$isRangeSelection(s))return;const u=s.extract();if(null===e)return void u.forEach((e=>{const t=r.$findMatchingParent(e,(e=>!f(e)&&c(e)));if(t){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));const d=new Set,h=t=>{d.has(t.getKey())||(d.add(t.getKey()),t.setURL(e),void 0!==n&&t.setTarget(n),void 0!==a&&t.setRel(a),void 0!==o&&t.setTitle(o))};if(1===u.length){const e=v(u[0],c);if(null!==e)return h(e)}!function(e){const t=i.$getSelection();if(!i.$isRangeSelection(t))return e();const n=i.$normalizeSelection__EXPERIMENTAL(t),r=n.isBackward(),o=p(n.anchor,r?-1:0),a=p(n.focus,r?0:-1);if(e(),o||a){const e=i.$getSelection();if(i.$isRangeSelection(e)){const t=e.clone();if(o){const e=o.getParent();e&&t.anchor.set(e.getKey(),o.getIndexWithinParent()+(r?1:0),"element")}if(a){const e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+(r?0:1),"element")}i.$setSelection(i.$normalizeSelection__EXPERIMENTAL(t))}}}((()=>{let t=null;for(const r of u){if(!r.isAttached())continue;const s=v(r,c);if(s){h(s);continue}if(i.$isElementNode(r)){if(!r.isInline())continue;if(c(r)){if(!(f(r)||null!==t&&t.getParentOrThrow().isParentOf(r))){h(r),t=r;continue}for(const e of r.getChildren())r.insertBefore(e);r.remove();continue}}const u=r.getPreviousSibling();c(u)&&u.is(t)?u.append(r):(t=l(e,{rel:a,target:n,title:o}),r.insertAfter(t),t.append(r))}}))}const g=m;function v(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}t.$createAutoLinkNode=d,t.$createLinkNode=l,t.$isAutoLinkNode=f,t.$isLinkNode=c,t.$toggleLink=m,t.AutoLinkNode=u,t.LinkNode=a,t.TOGGLE_LINK_COMMAND=h,t.toggleLink=g},88759:(e,t,n)=>{"use strict";var r=n(9476),i=n(93181),o=n(73515);function a(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function s(e){let t=1,n=e.getParent();for(;null!=n;){if(M(n)){const e=n.getParent();if(L(e)){t++,n=e.getParent();continue}a(40)}return t}return t}function l(e){let t=e.getParent();L(t)||a(40);let n=t;for(;null!==n;)n=n.getParent(),L(n)&&(t=n);return t}function c(e){let t=[];const n=e.getChildren().filter(M);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();L(i)?t=t.concat(c(i)):t.push(r)}return t}function u(e){return M(e)&&L(e.getFirstChild())}function d(e){return P().append(e)}function f(e,t){return M(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function h(e){const t=i.$getSelection();if(null!==t){let n=t.getNodes();if(i.$isRangeSelection(t)){const r=t.getStartEndPoints();null===r&&a(143);const[o]=r,s=o.getNode(),l=s.getParent();if(i.$isRootOrShadowRoot(s)){const e=s.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=i.$createParagraphNode();s.append(e),n=e.select().getNodes()}}else if(f(s,n)){const t=N(e);if(i.$isRootOrShadowRoot(l)){s.replace(t);const e=P();i.$isElementNode(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(M(s)){const e=s.getParentOrThrow();p(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const o=n[t];if(!i.$isElementNode(o)||!o.isEmpty()||M(o)||r.has(o.getKey())){if(i.$isLeafNode(o)){let t=o.getParent();for(;null!=t;){const n=t.getKey();if(L(t)){if(!r.has(n)){const i=N(e);p(i,t.getChildren()),t.replace(i),r.add(n)}break}{const o=t.getParent();if(i.$isRootOrShadowRoot(o)&&!r.has(n)){r.add(n),m(t,e);break}t=o}}}}else m(o,e)}}}function p(e,t){e.splice(e.getChildrenSize(),0,t)}function m(e,t){if(L(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=P();let o;if(p(i,e.getChildren()),L(n)&&t===n.getListType())n.append(i),L(r)&&t===r.getListType()&&(p(n,r.getChildren()),r.remove()),o=n;else if(L(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=N(t);n.append(i),e.replace(n),o=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),o}function g(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&u(n)&&u(r)&&(g(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function v(){const e=i.$getSelection();if(i.$isRangeSelection(e)){const t=new Set,n=e.getNodes(),o=e.anchor.getNode();if(f(o,n))t.add(l(o));else for(let e=0;e<n.length;e++){const o=n[e];if(i.$isLeafNode(o)){const e=r.$getNearestNodeOfType(o,k);null!=e&&t.add(l(e))}}for(const n of t){let t=n;const r=c(n);for(const n of r){const r=i.$createParagraphNode().setTextStyle(e.style).setTextFormat(e.format);p(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&i.$setPointFromCaret(e.anchor,i.$normalizeCaret(i.$getChildCaret(r,"next"))),n.__key===e.focus.key&&i.$setPointFromCaret(e.focus,i.$normalizeCaret(i.$getChildCaret(r,"next"))),n.remove()}n.remove()}}}function y(e){const t=new Set;if(u(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(u(r)&&u(i)){const n=i.getFirstChild();if(L(n)){n.append(e);const i=r.getFirstChild();L(i)&&(p(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(u(r)){const t=r.getFirstChild();if(L(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(u(i)){const t=i.getFirstChild();L(t)&&t.append(e)}else if(L(n)){const t=P().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=N(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function b(e){if(u(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(L(n?n.getParent():void 0)&&M(n)&&L(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=P(),o=N(r);i.append(o),e.getPreviousSiblings().forEach((e=>o.append(e)));const a=P(),s=N(r);a.append(s),p(s,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(a),n.replace(e)}}}function w(){const e=i.$getSelection();if(!i.$isRangeSelection(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!M(t)||0!==t.getChildrenSize())return!1;const n=l(t),r=t.getParent();L(r)||a(40);const o=r.getParent();let s;if(i.$isRootOrShadowRoot(o))s=i.$createParagraphNode(),n.insertAfter(s);else{if(!M(o))return!1;s=P(),o.insertAfter(s)}s.setTextStyle(e.style).setTextFormat(e.format).select();const c=t.getNextSiblings();if(c.length>0){const e=N(r.getListType());if(M(s)){const t=P();t.append(e),s.insertAfter(t)}else s.insertAfter(e);e.append(...c)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!M(e)&&!L(e))break;t=e}t.remove()}(t),!0}function S(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function E(e,t,n){const r=o.getStyleObjectFromCSS(t.__textStyle);for(const t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(const t in o.getStyleObjectFromCSS(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}class k extends i.ElementNode{static getType(){return"listitem"}static clone(e){return new k(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();L(n)&&"check"===n.getListType()&&_(t,this,null),t.value=this.__value,C(t,e.theme,this);const r=this.__style;return r&&(t.style.cssText=r),E(t,this,null),t}updateDOM(e,t,n){const r=this.getParent();L(r)&&"check"===r.getListType()&&_(t,this,e),t.value=this.__value,C(t,n.theme,this);const i=e.__style,o=this.__style;return i!==o&&(""===o?t.removeAttribute("style"):t.style.cssText=o),E(t,this,e),!1}static transform(){return e=>{if(M(e)||a(144),null==e.__checked)return;const t=e.getParent();L(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:T,priority:0})}}static importJSON(e){return P().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config);t.style.textAlign=this.getFormatType();const n=this.getDirection();return n&&(t.dir=n),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(i.$isElementNode(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(M(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!L(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=N(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(i.$isElementNode(e)||a(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(L(n)||a(39),M(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=N(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&u(t)&&u(n)&&(g(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=P().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=i.$createParagraphNode();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),o=M(r);if(1===n.getChildrenSize())if(o)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,o=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return L(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;M(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&a(117),(e=Math.floor(e))>=0||a(199);let t=this.getIndent();for(;t!==e;)t<e?(y(this),t++):(b(this),t--);return this}canInsertAfter(e){return M(e)}canReplaceWith(e){return M(e)}canMergeWith(e){return M(e)||i.$isParagraphNode(e)}extractWithChild(e,t){if(!i.$isRangeSelection(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return N("bullet")}canMergeWhenEmpty(){return!0}}function C(e,t,n){const i=[],o=[],a=t.list,s=a?a.listitem:void 0;let l;if(a&&a.nested&&(l=a.nested.listitem),void 0!==s&&i.push(...S(s)),a){const e=n.getParent(),t=L(e)&&"check"===e.getListType(),r=n.getChecked();t&&!r||o.push(a.listitemUnchecked),t&&r||o.push(a.listitemChecked),t&&i.push(r?a.listitemChecked:a.listitemUnchecked)}if(void 0!==l){const e=S(l);n.getChildren().some((e=>L(e)))?i.push(...e):o.push(...e)}o.length>0&&r.removeClassNamesFromElement(e,...o),i.length>0&&r.addClassNamesToElement(e,...i)}function _(e,t,n,r){L(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function T(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return x(t);const t=e.getAttribute("aria-checked");return{node:P("true"===t||"false"!==t&&void 0)}}function x(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:P(e.hasAttribute("checked"))}}function P(e){return i.$applyNodeReplacement(new k(void 0,e))}function M(e){return e instanceof k}class O extends i.ElementNode{static getType(){return"list"}static clone(e){const t=e.__listType||D[e.__tag];return new O(t,e.__start,e.__key)}constructor(e="number",t=1,n){super(n);const r=D[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,A(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(A(t,n.theme,this),!1)}static transform(){return e=>{L(e)||a(163),function(e){const t=e.getNextSibling();L(t)&&e.getListType()===t.getListType()&&g(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())M(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),L(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:R,priority:0}),ul:()=>({conversion:R,priority:0})}}static importJSON(e){return N().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return r.isHTMLElement(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){const t=n[e];M(t)||(r===n&&(r=[...n]),r[e]=P().append(!i.$isElementNode(t)||L(t)||t.isInline()?t:i.$createTextNode(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return M(e)}}function A(e,t,n){const i=[],o=[],a=t.list;if(void 0!==a){const e=a[`${n.__tag}Depth`]||[],t=s(n)-1,r=t%e.length,l=e[r],c=a[n.__tag];let u;const d=a.nested,f=a.checklist;if(void 0!==d&&d.list&&(u=d.list),void 0!==c&&i.push(c),void 0!==f&&"check"===n.__listType&&i.push(f),void 0!==l){i.push(...S(l));for(let t=0;t<e.length;t++)t!==r&&o.push(n.__tag+t)}if(void 0!==u){const e=S(u);t>1?i.push(...e):o.push(...e)}}o.length>0&&r.removeClassNamesFromElement(e,...o),i.length>0&&r.addClassNamesToElement(e,...i)}function I(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(M(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{L(e)&&t.push(d(e))}))}else t.push(d(r))}return t}function R(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=N("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(r.isHTMLElement(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?N("check"):N("bullet")),{after:I,node:n}}const D={ol:"number",ul:"bullet"};function N(e="number",t=1){return i.$applyNodeReplacement(new O(e,t))}function L(e){return e instanceof O}const $=i.createCommand("INSERT_UNORDERED_LIST_COMMAND"),F=i.createCommand("INSERT_ORDERED_LIST_COMMAND"),j=i.createCommand("INSERT_CHECK_LIST_COMMAND"),B=i.createCommand("REMOVE_LIST_COMMAND");t.$createListItemNode=P,t.$createListNode=N,t.$getListDepth=s,t.$handleListInsertParagraph=w,t.$insertList=h,t.$isListItemNode=M,t.$isListNode=L,t.$removeList=v,t.INSERT_CHECK_LIST_COMMAND=j,t.INSERT_ORDERED_LIST_COMMAND=F,t.INSERT_UNORDERED_LIST_COMMAND=$,t.ListItemNode=k,t.ListNode=O,t.REMOVE_LIST_COMMAND=B,t.insertList=function(e,t){e.update((()=>h(t)))},t.registerList=function(e){const t=r.mergeRegister(e.registerCommand(F,(()=>(h("number"),!0)),i.COMMAND_PRIORITY_LOW),e.registerCommand($,(()=>(h("bullet"),!0)),i.COMMAND_PRIORITY_LOW),e.registerCommand(B,(()=>(v(),!0)),i.COMMAND_PRIORITY_LOW),e.registerCommand(i.INSERT_PARAGRAPH_COMMAND,(()=>w()),i.COMMAND_PRIORITY_LOW),e.registerNodeTransform(k,(e=>{const t=e.getFirstChild();if(t){if(i.$isTextNode(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=i.$getSelection();i.$isRangeSelection(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(i.TextNode,(e=>{const t=e.getParent();if(M(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})));return t},t.removeList=function(e){e.update((()=>v()))}},34515:(e,t,n)=>{"use strict";var r=n(71761),i=n(23449),o=n(9476),a=n(93181),s=n(8156);function l(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}const c=/[.,;\s]/;function u(e){return c.test(e)}function d(e){return u(e[e.length-1])}function f(e){return u(e[0])}function h(e){let t=e.getPreviousSibling();return a.$isElementNode(t)&&(t=t.getLastDescendant()),null===t||a.$isLineBreakNode(t)||a.$isTextNode(t)&&d(t.getTextContent())}function p(e){let t=e.getNextSibling();return a.$isElementNode(t)&&(t=t.getFirstDescendant()),null===t||a.$isLineBreakNode(t)||a.$isTextNode(t)&&f(t.getTextContent())}function m(e,t,n,r){return!!(e>0?u(n[e-1]):h(r[0]))&&(t<n.length?u(n[t]):p(r[r.length-1]))}function g(e,t,n){const r=[],i=[],o=[];let a=0,s=0;const l=[...e];for(;l.length>0;){const e=l[0],c=e.getTextContent().length,u=s;s+c<=t?(r.push(e),a+=c):u>=n?o.push(e):i.push(e),s+=c,l.shift()}return[a,r,i,o]}function v(e,t,n,i){const o=r.$createAutoLinkNode(i.url,i.attributes);if(1===e.length){let r,s=e[0];0===t?[r,s]=s.splitText(n):[,r,s]=s.splitText(t,n);const l=a.$createTextNode(i.text);return l.setFormat(r.getFormat()),l.setDetail(r.getDetail()),l.setStyle(r.getStyle()),o.append(l),r.replace(o),s}if(e.length>1){const r=e[0];let i,s=r.getTextContent().length;0===t?i=r:[,i]=r.splitText(t);const l=[];let c;for(let t=1;t<e.length;t++){const r=e[t],i=r.getTextContent().length,o=s;if(o<n)if(s+i<=n)l.push(r);else{const[e,t]=r.splitText(n-o);l.push(e),c=t}s+=i}const u=a.$getSelection(),d=u?u.getNodes().find(a.$isTextNode):void 0,f=a.$createTextNode(i.getTextContent());return f.setFormat(i.getFormat()),f.setDetail(i.getDetail()),f.setStyle(i.getStyle()),o.append(f,...l),d&&d===i&&(a.$isRangeSelection(u)?f.select(u.anchor.offset,u.focus.offset):a.$isNodeSelection(u)&&f.select(0,f.getTextContent().length)),i.replace(o),c}}function y(e,t,n){const r=e.getChildren(),i=r.length;for(let t=0;t<i;t++){const i=r[t];if(!a.$isTextNode(i)||!i.isSimpleText())return b(e),void n(null,e.getURL())}const o=e.getTextContent(),s=l(o,t);if(null===s||s.text!==o)return b(e),void n(null,e.getURL());if(!h(e)||!p(e))return b(e),void n(null,e.getURL());const c=e.getURL();if(c!==s.url&&(e.setURL(s.url),n(s.url,c)),s.attributes){const t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,t));const r=e.getTarget();r!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,r))}}function b(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map((e=>e.getLatest()))}function w(e,t,n){s.useEffect((()=>{e.hasNodes([r.AutoLinkNode])||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const i=(e,t)=>{n&&n(e,t)};return o.mergeRegister(e.registerNodeTransform(a.TextNode,(e=>{const n=e.getParentOrThrow(),o=e.getPreviousSibling();if(r.$isAutoLinkNode(n)&&!n.getIsUnlinked())y(n,t,i);else if(!r.$isLinkNode(n)){if(e.isSimpleText()&&(f(e.getTextContent())||!r.$isAutoLinkNode(o))){const n=function(e){const t=[e];let n=e.getNextSibling();for(;null!==n&&a.$isTextNode(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e);!function(e,t,n){let r=[...e];const i=r.map((e=>e.getTextContent())).join("");let o,a=i,s=0;for(;(o=l(a,t))&&null!==o;){const e=o.index,t=e+o.length;if(m(s+e,s+t,i,r)){const[i,,a,l]=g(r,s+e,s+t),c=v(a,s+e-i,s+t-i,o);r=c?[c,...l]:l,n(o.url,null),s=0}else s+=t;a=a.substring(t)}}(n,t,i)}!function(e,t,n){const i=e.getPreviousSibling(),o=e.getNextSibling(),a=e.getTextContent();var s;!r.$isAutoLinkNode(i)||i.getIsUnlinked()||f(a)&&(s=a,!(i.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(s):/^\.[a-zA-Z0-9]{1,}/.test(s)))||(i.append(e),y(i,t,n),n(null,i.getURL())),!r.$isAutoLinkNode(o)||o.getIsUnlinked()||d(a)||(b(o),y(o,t,n),n(null,o.getURL()))}(e,t,i)}})),e.registerCommand(r.TOGGLE_LINK_COMMAND,(e=>{const t=a.$getSelection();return!(null!==e||!a.$isRangeSelection(t)||(t.extract().forEach((e=>{const t=e.getParent();if(r.$isAutoLinkNode(t))return t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty(),!0})),1))}),a.COMMAND_PRIORITY_LOW))}),[e,t,n])}t.AutoLinkPlugin=function({matchers:e,onChange:t}){const[n]=i.useLexicalComposerContext();return w(n,e,t),null},t.createLinkMatcherWithRegExp=function(e,t=(e=>e)){return n=>{const r=e.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}},89122:(e,t,n)=>{"use strict";var r=n(23449),i=n(93181),o=n(8156),a=n(25276);const s="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,l=s?o.useLayoutEffect:o.useEffect,c={tag:"history-merge"};t.LexicalComposer=function({initialConfig:e,children:t}){const n=o.useMemo((()=>{const{theme:t,namespace:n,nodes:o,onError:a,editorState:l,html:u}=e,d=r.createLexicalComposerContext(null,t),f=i.createEditor({editable:e.editable,html:u,namespace:n,nodes:o,onError:e=>a(e,f),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=i.$getRoot();if(t.isEmpty()){const n=i.$createParagraphNode();t.append(n);const r=s?document.activeElement:null;(null!==i.$getSelection()||null!==r&&r===e.getRootElement())&&n.select()}}),c);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,c);break}case"object":e.setEditorState(t,c);break;case"function":e.update((()=>{i.$getRoot().isEmpty()&&t(e)}),c)}}(f,l),[f,d]}),[]);return l((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),a.jsx(r.LexicalComposerContext.Provider,{value:n,children:t})}},23449:(e,t,n)=>{"use strict";var r=n(8156);const i=r.createContext(null);t.LexicalComposerContext=i,t.createLexicalComposerContext=function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}},t.useLexicalComposerContext=function(){const e=r.useContext(i);return null==e&&function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}},79526:(e,t,n)=>{"use strict";var r=n(23449),i=n(8156),o=n(25276),a=n(33178),s=n(9476);const l="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect,c=i.forwardRef((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:a,ariaErrorMessage:s,ariaExpanded:c,ariaInvalid:u,ariaLabel:d,ariaLabelledBy:f,ariaMultiline:h,ariaOwns:p,ariaRequired:m,autoCapitalize:g,className:v,id:y,role:b="textbox",spellCheck:w=!0,style:S,tabIndex:E,"data-testid":k,...C},_){const[T,x]=i.useState(e.isEditable()),P=i.useCallback((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),M=i.useMemo((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(_,P)),[P,_]);return l((()=>(x(e.isEditable()),e.registerEditableListener((e=>{x(e)})))),[e]),o.jsx("div",{"aria-activedescendant":T?t:void 0,"aria-autocomplete":T?n:"none","aria-controls":T?r:void 0,"aria-describedby":a,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":T&&"combobox"===b?!!c:void 0,...null!=u?{"aria-invalid":u}:{},"aria-label":d,"aria-labelledby":f,"aria-multiline":h,"aria-owns":T?p:void 0,"aria-readonly":!T||void 0,"aria-required":m,autoCapitalize:g,className:v,contentEditable:T,"data-testid":k,id:y,ref:M,role:T?b:void 0,spellCheck:w,style:S,tabIndex:E,...C})}));function u(e){return e.getEditorState().read(a.$canShowPlaceholderCurry(e.isComposing()))}const d=i.forwardRef((function(e,t){const{placeholder:n,...i}=e,[a]=r.useLexicalComposerContext();return o.jsxs(o.Fragment,{children:[o.jsx(c,{editor:a,...i,ref:t}),null!=n&&o.jsx(f,{editor:a,content:n})]})}));function f({content:e,editor:t}){const n=function(e){const[t,n]=i.useState((()=>u(e)));return l((()=>{function t(){const t=u(e);n(t)}return t(),s.mergeRegister(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,a]=i.useState(t.isEditable());if(i.useLayoutEffect((()=>(a(t.isEditable()),t.registerEditableListener((e=>{a(e)})))),[t]),!n)return null;let c=null;return"function"==typeof e?c=e(r):null!==e&&(c=e),null===c?null:o.jsx("div",{"aria-hidden":!0,children:c})}t.ContentEditable=d},87921:(e,t,n)=>{"use strict";var r=n(93181);class i extends r.DecoratorNode{constructor(e,t){super(t),this.__format=e||""}exportJSON(){return{...super.exportJSON(),format:this.__format||""}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||"")}canIndent(){return!1}createDOM(){return document.createElement("div")}updateDOM(){return!1}setFormat(e){const t=this.getWritable();return t.__format=e,t}isInline(){return!1}}t.$isDecoratorBlockNode=function(e){return e instanceof i},t.DecoratorBlockNode=i},73767:(e,t,n)=>{"use strict";var r=n(8156),i=n(25276),o=function(e){var t=Object.create(null);if(e)for(var n in e)t[n]=e[n];return t.default=e,t}(r);function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}var s={error:null},l=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).state=s,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,a(t,n),r.getDerivedStateFromError=function(e){return{error:e}};var i=r.prototype;return i.reset=function(){this.setState(s)},i.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},i.componentDidUpdate=function(e,t){var n,r,i,o,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(i=e.resetKeys)&&(i=[]),void 0===(o=s)&&(o=[]),i.length!==o.length||i.some((function(e,t){return!Object.is(e,o[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},i.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,i=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(o.isValidElement(i))return i;if("function"==typeof n)return n(a);if(r)return o.createElement(r,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(o.Component);t.LexicalErrorBoundary=function({children:e,onError:t}){return i.jsx(l,{fallback:i.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}},38787:(e,t,n)=>{"use strict";var r=n(23449),i=n(13673),o=n(8156);t.createEmptyHistoryState=i.createEmptyHistoryState,t.HistoryPlugin=function({delay:e,externalHistoryState:t}){const[n]=r.useLexicalComposerContext();return function(e,t,n=1e3){const r=o.useMemo((()=>t||i.createEmptyHistoryState()),[t]);o.useEffect((()=>i.registerHistory(e,r,n)),[n,e,r])}(n,t,e),null}},80161:(e,t,n)=>{"use strict";var r=n(23449),i=n(68954),o=n(9476),a=n(93181),s=n(8156),l=n(25276);const c=a.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function u({nodeKey:e}){const[t]=r.useLexicalComposerContext(),[n,l,c]=i.useLexicalNodeSelection(e);return s.useEffect((()=>o.mergeRegister(t.registerCommand(a.CLICK_COMMAND,(r=>{const i=t.getElementByKey(e);return r.target===i&&(r.shiftKey||c(),l(!n),!0)}),a.COMMAND_PRIORITY_LOW))),[c,t,n,e,l]),s.useEffect((()=>{const r=t.getElementByKey(e),i=t._config.theme.hrSelected??"selected";null!==r&&(n?o.addClassNamesToElement(r,i):o.removeClassNamesFromElement(r,i))}),[t,n,e]),null}class d extends a.DecoratorNode{static getType(){return"horizontalrule"}static clone(e){return new d(e.__key)}static importJSON(e){return h().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:f,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return o.addClassNamesToElement(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return l.jsx(u,{nodeKey:this.__key})}}function f(){return{node:h()}}function h(){return a.$applyNodeReplacement(new d)}t.$createHorizontalRuleNode=h,t.$isHorizontalRuleNode=function(e){return e instanceof d},t.HorizontalRuleNode=d,t.INSERT_HORIZONTAL_RULE_COMMAND=c},19837:(e,t,n)=>{"use strict";var r=n(71761),i=n(23449),o=n(9476),a=n(93181),s=n(8156);t.LinkPlugin=function({validateUrl:e,attributes:t}){const[n]=i.useLexicalComposerContext();return s.useEffect((()=>{if(!n.hasNodes([r.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return o.mergeRegister(n.registerCommand(r.TOGGLE_LINK_COMMAND,(n=>{if(null===n)return r.$toggleLink(n),!0;if("string"==typeof n)return!(void 0!==e&&!e(n)||(r.$toggleLink(n,t),0));{const{url:e,target:i,rel:o,title:a}=n;return r.$toggleLink(e,{...t,rel:o,target:i,title:a}),!0}}),a.COMMAND_PRIORITY_LOW),void 0!==e?n.registerCommand(a.PASTE_COMMAND,(i=>{const s=a.$getSelection();if(!a.$isRangeSelection(s)||s.isCollapsed()||!o.objectKlassEquals(i,ClipboardEvent))return!1;if(null===i.clipboardData)return!1;const l=i.clipboardData.getData("text");return!!e(l)&&!s.getNodes().some((e=>a.$isElementNode(e)))&&(n.dispatchCommand(r.TOGGLE_LINK_COMMAND,{...t,url:l}),i.preventDefault(),!0)}),a.COMMAND_PRIORITY_LOW):()=>{})}),[n,e,t]),null}},6401:(e,t,n)=>{"use strict";var r=n(88759),i=n(23449),o=n(8156);t.ListPlugin=function(){const[e]=i.useLexicalComposerContext();return o.useEffect((()=>{if(!e.hasNodes([r.ListNode,r.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[e]),function(e){o.useEffect((()=>r.registerList(e)),[e])}(e),null}},2426:(e,t,n)=>{"use strict";var r=n(23449),i=n(8156);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;t.OnChangePlugin=function({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[i]=r.useLexicalComposerContext();return o((()=>{if(n)return i.registerUpdateListener((({editorState:r,dirtyElements:o,dirtyLeaves:a,prevEditorState:s,tags:l})=>{t&&0===o.size&&0===a.size||e&&l.has("history-merge")||s.isEmpty()||n(r,i,l)}))}),[i,e,t,n]),null}},29369:(e,t,n)=>{"use strict";var r=n(23449),i=n(8156);const o="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?i.useLayoutEffect:i.useEffect;function a(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}t.useLexicalEditable=function(){return function(e){const[t]=r.useLexicalComposerContext(),n=i.useMemo((()=>e(t)),[t,e]),[a,s]=i.useState((()=>n.initialValueFn())),l=i.useRef(a);return o((()=>{const{initialValueFn:e,subscribe:t}=n,r=e();return l.current!==r&&(l.current=r,s(r)),t((e=>{l.current=e,s(e)}))}),[n,e]),a}(a)}},68954:(e,t,n)=>{"use strict";var r=n(23449),i=n(93181),o=n(8156);function a(e,t){return e.getEditorState().read((()=>{const e=i.$getNodeByKey(t);return null!==e&&e.isSelected()}))}t.useLexicalNodeSelection=function(e){const[t]=r.useLexicalComposerContext(),[n,s]=o.useState(