@lexical/code 0.36.2-nightly.20250930.0 → 0.36.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/utils"),t=require("lexical");function n(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.`)}require("prismjs"),require("prismjs/components/prism-clike"),require("prismjs/components/prism-javascript"),require("prismjs/components/prism-markup"),require("prismjs/components/prism-markdown"),require("prismjs/components/prism-c"),require("prismjs/components/prism-css"),require("prismjs/components/prism-objectivec"),require("prismjs/components/prism-sql"),require("prismjs/components/prism-powershell"),require("prismjs/components/prism-python"),require("prismjs/components/prism-rust"),require("prismjs/components/prism-swift"),require("prismjs/components/prism-typescript"),require("prismjs/components/prism-java"),require("prismjs/components/prism-cpp");const r="javascript";function i(t,n){for(const r of t.childNodes){if(e.isHTMLElement(r)&&r.tagName===n)return!0;i(r,n)}return!1}const o="data-language",s="data-highlight-language",a="data-theme";class g extends t.ElementNode{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new g(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");e.addClassNamesToElement(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(o,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(s,r));const i=this.getTheme();i&&n.setAttribute(a,i);const g=this.getStyle();return g&&n.setAttribute("style",g),n}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(o,r):i&&t.removeAttribute(o);const g=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?g&&r?r!==i&&t.setAttribute(s,r):t.removeAttribute(s):g&&r&&t.setAttribute(s,r);const l=this.__theme,u=e.__theme;l?l!==u&&t.setAttribute(a,l):u&&t.removeAttribute(a);const c=this.__style,p=e.__style;return c?c!==p&&t.setAttribute("style",c):p&&t.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");e.addClassNamesToElement(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(o,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(s,r));const i=this.getTheme();i&&n.setAttribute(a,i);const g=this.getStyle();return g&&n.setAttribute("style",g),{element:n}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||i(e,"BR"))?{conversion:c,priority:1}:null,div:()=>({conversion:p,priority:1}),pre:()=>({conversion:c,priority:0}),table:e=>N(e)?{conversion:d,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&N(n)?{conversion:f,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&N(t)?{conversion:f,priority:3}:null}}}static importJSON(e){return l().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){const r=this.getChildren(),i=r.length;if(i>=2&&"\n"===r[i-1].getTextContent()&&"\n"===r[i-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const e=t.$createParagraphNode();return this.insertAfter(e,n),e}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if(t.$isTextNode(a)){let e=O(a);const n=[];for(;;)if(t.$isTabNode(e))n.push(t.$createTabNode()),e=e.getNextSibling();else{if(!x(e))break;{let t=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;t<i&&" "===r[t];)t++;if(0!==t&&n.push(T(" ".repeat(t))),t!==i)break;e=e.getNextSibling()}}const r=a.splitText(o.offset)[0],i=0===o.offset?0:1,s=r.getIndexWithinParent()+i,g=a.getParentOrThrow(),l=[t.$createLineBreakNode(),...n];g.splice(s,0,l);const u=n[n.length-1];u?u.select():0===o.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(u(a)){const{offset:n}=e.anchor;a.splice(n,0,[t.$createLineBreakNode()]),a.select(n+1,n+1)}return null}canIndent(){return!1}collapseAtStart(){const e=t.$createParagraphNode();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function l(e,n){return t.$create(g).setLanguage(e).setTheme(n)}function u(e){return e instanceof g}function c(e){return{node:l(e.getAttribute(o))}}function p(e){const t=e,n=h(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(h(t))return!0;t=t.parentElement}return!1}(t)?{node:n?l():null}:{node:null}}function d(){return{node:l()}}function f(){return{node:null}}function h(e){return null!==e.style.fontFamily.match("monospace")}function N(e){return e.classList.contains("js-file-line-container")}class m extends t.TextNode{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new m(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=_(t.theme,this.__highlightType);return e.addClassNamesToElement(n,r),n}updateDOM(t,n,r){const i=super.updateDOM(t,n,r),o=_(r.theme,t.__highlightType),s=_(r.theme,this.__highlightType);return o!==s&&(o&&e.removeClassNamesFromElement(n,o),s&&e.addClassNamesToElement(n,s)),i}static importJSON(e){return T().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return l()}}function _(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function T(e="",n){return t.$applyNodeReplacement(new m(e,n))}function x(e){return e instanceof m}function C(n,r){let i=n;for(let o=t.$getSiblingCaret(n,r);o&&(x(o.origin)||t.$isTabNode(o.origin));o=e.$getAdjacentCaret(o))i=o.origin;return i}function O(e){return C(e,"previous")}function S(e){return C(e,"next")}function y(e,r){let i=null,o=null,s=e,a=r,g=e.getTextContent();for(;;){if(0===a){if(s=s.getPreviousSibling(),null===s)break;if(x(s)||t.$isTabNode(s)||t.$isLineBreakNode(s)||n(167),t.$isLineBreakNode(s)){i={node:s,offset:1};break}a=Math.max(0,s.getTextContentSize()-1),g=s.getTextContent()}else a--;const e=g[a];x(s)&&" "!==e&&(o={node:s,offset:a})}if(null!==o)return o;let l=null;if(r<e.getTextContentSize())x(e)&&(l=e.getTextContent()[r]);else{const t=e.getNextSibling();x(t)&&(l=t.getTextContent()[0])}if(null!==l&&" "!==l)return i;{const n=function(e,n){let r=e,i=n,o=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!x(r)||i===s){if(r=r.getNextSibling(),null===r||t.$isLineBreakNode(r))return null;x(r)&&(i=0,o=r.getTextContent(),s=r.getTextContentSize())}if(x(r)){if(" "!==o[i])return{node:r,offset:i};i++}}}(e,r);return null!==n?n:i}}function $(e){const r=S(e);return t.$isLineBreakNode(r)&&n(168),r}const A=t.defineExtension({name:"@lexical/code",nodes:[g,m]});!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const b=globalThis.Prism||window.Prism,L={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},M={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function E(e){return M[e]||e}function v(e){return"string"==typeof e?e:Array.isArray(e)?e.map(v).join(""):v(e.content)}function D(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=b.tokenize(r,b.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=b.languages[n],i={tokens:e},o=b.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in o)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new b.Token("prefix",o[t],t.replace(/^(\w+).*/,"$1"))),s=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),a=e.content.length-s.length,g=b.tokenize(v(s),r);g.unshift(i());const l=/\r\n|\n/g,u=e=>{const t=[];l.lastIndex=0;let r,o=0;for(;n<a&&(r=l.exec(e));){const n=r.index+r[0].length;t.push(e.slice(o,n)),o=n,t.push(i())}if(0!==t.length)return o<e.length&&t.push(e.slice(o)),t},c=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?c(n.content):c([n.content])}};c(g),n<a&&g.push(i()),e.content=g}return i.tokens}(i,n[1])),R(i)}function R(e,n){const r=[];for(const i of e)if("string"==typeof i){const e=i.split(/(\n|\t)/),o=e.length;for(let i=0;i<o;i++){const o=e[i];"\n"===o||"\r\n"===o?r.push(t.$createLineBreakNode()):"\t"===o?r.push(t.$createTabNode()):o.length>0&&r.push(T(o,n))}}else{const{content:e,alias:t}=i;"string"==typeof e?r.push(...R([e],"prefix"===i.type&&"string"==typeof t?t:i.type)):Array.isArray(e)&&r.push(...R(e,"unchanged"===i.type?void 0:i.type))}return r}const k={$tokenize(e,t){return D(e,t||this.defaultLanguage)},defaultLanguage:r,tokenize(e,t){return b.tokenize(e,b.languages[t||""]||b.languages[this.defaultLanguage])}};function P(e,n,r){const i=e.getParent();u(i)?B(i,n,r):x(e)&&e.replace(t.$createTextNode(e.__text))}function I(e,n){const r=n.getElementByKey(e.getKey());if(null===r)return;const i=e.getChildren(),o=i.length;if(o===r.__cachedChildrenLength)return;r.__cachedChildrenLength=o;let s="1",a=1;for(let e=0;e<o;e++)t.$isLineBreakNode(i[e])&&(s+="\n"+ ++a);r.setAttribute("data-gutter",s)}const w=new Set;function B(e,n,r){const i=e.getKey();void 0===e.getLanguage()&&e.setLanguage(r.defaultLanguage);const o=e.getLanguage()||r.defaultLanguage;if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&b.languages.hasOwnProperty(n)}catch(e){return!1}}(o))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(e,t,n){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),w.has(i)||(w.add(i),n.update((()=>{!function(e,n){const r=t.$getNodeByKey(e);if(!u(r)||!r.isAttached())return;const i=t.$getSelection();if(!t.$isRangeSelection(i))return void n();const o=i.anchor,s=o.offset,a="element"===o.type&&t.$isLineBreakNode(r.getChildAtIndex(o.offset-1));let g=0;if(!a){const e=o.getNode();g=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}if(!n())return;if(a)return void o.getNode().select(s,s);r.getChildren().some((e=>{const n=t.$isTextNode(e);if(n||t.$isLineBreakNode(e)){const t=e.getTextContentSize();if(n&&t>=g)return e.select(g,g),!0;g-=t}return!1}))}(i,(()=>{const n=t.$getNodeByKey(i);if(!u(n)||!n.isAttached())return!1;const o=n.getLanguage()||r.defaultLanguage,s=r.$tokenize(n,o),a=function(e,t){let n=0;for(;n<e.length&&j(e[n],t[n]);)n++;const r=e.length,i=t.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!j(e[r-s],t[i-s])){s--;break}const a=n,g=r-s,l=t.slice(n,i-s);return{from:a,nodesForReplacement:l,to:g}}(n.getChildren(),s),{from:g,to:l,nodesForReplacement:c}=a;return!(g===l&&!c.length)&&(e.splice(g,l-g,c),!0)}))}),{onUpdate:()=>{w.delete(i)},skipTransforms:!0}))}function j(e,n){return x(e)&&x(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||t.$isTabNode(e)&&t.$isTabNode(n)||t.$isLineBreakNode(e)&&t.$isLineBreakNode(n)}function H(e){if(!t.$isRangeSelection(e))return!1;const n=e.anchor.getNode(),r=u(n)?n:n.getParent(),i=e.focus.getNode(),o=u(i)?i:i.getParent();return u(r)&&r.is(o)}function F(e){const r=e.getNodes(),i=[];if(1===r.length&&u(r[0]))return i;let o=[];for(let e=0;e<r.length;e++){const s=r[e];x(s)||t.$isTabNode(s)||t.$isLineBreakNode(s)||n(169),t.$isLineBreakNode(s)?o.length>0&&(i.push(o),o=[]):o.push(s)}if(o.length>0){const n=e.isBackward()?e.anchor:e.focus,r=t.$createPoint(o[0].getKey(),0,"text");n.is(r)||i.push(o)}return i}function q(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!H(n))return!1;const r=F(n),i=r.length;if(0===i&&n.isCollapsed())return e===t.INDENT_CONTENT_COMMAND&&n.insertNodes([t.$createTabNode()]),!0;if(0===i&&e===t.INDENT_CONTENT_COMMAND&&"\n"===n.getTextContent()){const e=t.$createTabNode(),r=t.$createLineBreakNode(),i=n.isBackward()?"previous":"next";return n.insertNodes([e,r]),t.$setSelectionFromCaretRange(t.$getCaretRangeInDirection(t.$getCaretRange(t.$getTextPointCaret(e,"next",0),t.$normalizeCaret(t.$getSiblingCaret(r,"next"))),i)),!0}for(let o=0;o<i;o++){const i=r[o];if(i.length>0){let r=i[0];if(0===o&&(r=O(r)),e===t.INDENT_CONTENT_COMMAND){const e=t.$createTabNode();if(r.insertBefore(e),0===o){const i=n.isBackward()?"focus":"anchor",o=t.$createPoint(r.getKey(),0,"text");n[i].is(o)&&n[i].set(e.getKey(),0,"text")}}else t.$isTabNode(r)&&r.remove()}}return!0}function z(e,n){const r=t.$getSelection();if(!t.$isRangeSelection(r))return!1;const{anchor:i,focus:o}=r,s=i.offset,a=o.offset,g=i.getNode(),l=o.getNode(),u=e===t.KEY_ARROW_UP_COMMAND;if(!H(r)||!x(g)&&!t.$isTabNode(g)||!x(l)&&!t.$isTabNode(l))return!1;if(!n.altKey){if(r.isCollapsed()){const e=g.getParentOrThrow();if(u&&0===s&&null===g.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),n.preventDefault(),!0}else if(!u&&s===g.getTextContentSize()&&null===g.getNextSibling()){if(null===e.getNextSibling())return e.selectNext(),n.preventDefault(),!0}}return!1}let c,p;if(g.isBefore(l)?(c=O(g),p=S(l)):(c=O(l),p=S(g)),null==c||null==p)return!1;const d=c.getNodesBetween(p);for(let e=0;e<d.length;e++){const n=d[e];if(!x(n)&&!t.$isTabNode(n)&&!t.$isLineBreakNode(n))return!1}n.preventDefault(),n.stopPropagation();const f=u?c.getPreviousSibling():p.getNextSibling();if(!t.$isLineBreakNode(f))return!0;const h=u?f.getPreviousSibling():f.getNextSibling();if(null==h)return!0;const N=x(h)||t.$isTabNode(h)||t.$isLineBreakNode(h)?u?O(h):S(h):null;let m=null!=N?N:h;return f.remove(),d.forEach((e=>e.remove())),e===t.KEY_ARROW_UP_COMMAND?(d.forEach((e=>m.insertBefore(e))),m.insertBefore(f)):(m.insertAfter(f),m=f,d.forEach((e=>{m.insertAfter(e),m=e}))),r.setTextNodeRange(g,s,l,a),!0}function W(e,n){const r=t.$getSelection();if(!t.$isRangeSelection(r))return!1;const{anchor:i,focus:o}=r,s=i.getNode(),a=o.getNode(),g=e===t.MOVE_TO_START;if(!H(r)||!x(s)&&!t.$isTabNode(s)||!x(a)&&!t.$isTabNode(a))return!1;if(g){const e=y(a,o.offset);if(null!==e){const{node:n,offset:i}=e;t.$isLineBreakNode(n)?n.selectNext(0,0):r.setTextNodeRange(n,i,n,i)}else a.getParentOrThrow().selectStart()}else{$(a).select()}return n.preventDefault(),n.stopPropagation(),!0}const K=O,Y=S,U=$,J=y;exports.$createCodeHighlightNode=T,exports.$createCodeNode=l,exports.$getEndOfCodeInLine=$,exports.$getFirstCodeNodeOfLine=O,exports.$getLastCodeNodeOfLine=S,exports.$getStartOfCodeInLine=y,exports.$isCodeHighlightNode=x,exports.$isCodeNode=u,exports.CODE_LANGUAGE_FRIENDLY_NAME_MAP=L,exports.CODE_LANGUAGE_MAP=M,exports.CodeExtension=A,exports.CodeHighlightNode=m,exports.CodeNode=g,exports.DEFAULT_CODE_LANGUAGE=r,exports.PrismTokenizer=k,exports.getCodeLanguageOptions=function(){const e=[];for(const[t,n]of Object.entries(L))e.push([t,n]);return e},exports.getCodeLanguages=()=>Object.keys(b.languages).filter((e=>"function"!=typeof b.languages[e])).sort(),exports.getCodeThemeOptions=function(){return[]},exports.getDefaultCodeLanguage=()=>r,exports.getEndOfCodeInLine=U,exports.getFirstCodeNodeOfLine=K,exports.getLanguageFriendlyName=function(e){const t=E(e);return L[t]||t},exports.getLastCodeNodeOfLine=Y,exports.getStartOfCodeInLine=J,exports.normalizeCodeLang=E,exports.normalizeCodeLanguage=E,exports.registerCodeHighlighting=function(r,i){if(!r.hasNodes([g,m]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==i&&(i=k);const o=[];return!0!==r._headless&&o.push(r.registerMutationListener(g,(e=>{r.update((()=>{for(const[n,i]of e)if("destroyed"!==i){const e=t.$getNodeByKey(n);null!==e&&I(e,r)}}))}),{skipInitialization:!1})),o.push(r.registerNodeTransform(g,(e=>B(e,r,i))),r.registerNodeTransform(t.TextNode,(e=>P(e,r,i))),r.registerNodeTransform(m,(e=>P(e,r,i))),r.registerCommand(t.KEY_TAB_COMMAND,(e=>{const i=function(e){const r=t.$getSelection();if(!t.$isRangeSelection(r)||!H(r))return null;const i=e?t.OUTDENT_CONTENT_COMMAND:t.INDENT_CONTENT_COMMAND,o=e?t.OUTDENT_CONTENT_COMMAND:t.INSERT_TAB_COMMAND,s=r.anchor,a=r.focus;if(s.is(a))return o;const g=F(r);if(1!==g.length)return i;const l=g[0];let u,c;0===l.length&&n(285),r.isBackward()?(u=a,c=s):(u=s,c=a);const p=O(l[0]),d=S(l[0]),f=t.$createPoint(p.getKey(),0,"text"),h=t.$createPoint(d.getKey(),d.getTextContentSize(),"text");return u.isBefore(f)||h.isBefore(c)?i:f.isBefore(u)||c.isBefore(h)?o:i}(e.shiftKey);return null!==i&&(e.preventDefault(),r.dispatchCommand(i,void 0),!0)}),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.INSERT_TAB_COMMAND,(()=>!!H(t.$getSelection())&&(t.$insertNodes([t.$createTabNode()]),!0)),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.INDENT_CONTENT_COMMAND,(e=>q(t.INDENT_CONTENT_COMMAND)),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.OUTDENT_CONTENT_COMMAND,(e=>q(t.OUTDENT_CONTENT_COMMAND)),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.KEY_ARROW_UP_COMMAND,(e=>{const n=t.$getSelection();if(!t.$isRangeSelection(n))return!1;const{anchor:r}=n,i=r.getNode();return!!H(n)&&(n.isCollapsed()&&0===r.offset&&null===i.getPreviousSibling()&&u(i.getParentOrThrow())?(e.preventDefault(),!0):z(t.KEY_ARROW_UP_COMMAND,e))}),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.KEY_ARROW_DOWN_COMMAND,(e=>{const n=t.$getSelection();if(!t.$isRangeSelection(n))return!1;const{anchor:r}=n,i=r.getNode();return!!H(n)&&(n.isCollapsed()&&r.offset===i.getTextContentSize()&&null===i.getNextSibling()&&u(i.getParentOrThrow())?(e.preventDefault(),!0):z(t.KEY_ARROW_DOWN_COMMAND,e))}),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.MOVE_TO_START,(e=>W(t.MOVE_TO_START,e)),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.MOVE_TO_END,(e=>W(t.MOVE_TO_END,e)),t.COMMAND_PRIORITY_LOW)),e.mergeRegister(...o)};
9
+ "use strict";var e=require("@lexical/utils"),t=require("lexical");function n(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.`)}require("prismjs"),require("prismjs/components/prism-clike"),require("prismjs/components/prism-javascript"),require("prismjs/components/prism-markup"),require("prismjs/components/prism-markdown"),require("prismjs/components/prism-c"),require("prismjs/components/prism-css"),require("prismjs/components/prism-objectivec"),require("prismjs/components/prism-sql"),require("prismjs/components/prism-powershell"),require("prismjs/components/prism-python"),require("prismjs/components/prism-rust"),require("prismjs/components/prism-swift"),require("prismjs/components/prism-typescript"),require("prismjs/components/prism-java"),require("prismjs/components/prism-cpp");const r="javascript";function i(t,n){for(const r of t.childNodes){if(e.isHTMLElement(r)&&r.tagName===n)return!0;i(r,n)}return!1}const o="data-language",s="data-highlight-language",a="data-theme";class g extends t.ElementNode{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new g(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");e.addClassNamesToElement(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(o,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(s,r));const i=this.getTheme();i&&n.setAttribute(a,i);const g=this.getStyle();return g&&n.setAttribute("style",g),n}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(o,r):i&&t.removeAttribute(o);const g=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?g&&r?r!==i&&t.setAttribute(s,r):t.removeAttribute(s):g&&r&&t.setAttribute(s,r);const l=this.__theme,u=e.__theme;l?l!==u&&t.setAttribute(a,l):u&&t.removeAttribute(a);const c=this.__style,p=e.__style;return c?c!==p&&t.setAttribute("style",c):p&&t.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");e.addClassNamesToElement(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(o,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(s,r));const i=this.getTheme();i&&n.setAttribute(a,i);const g=this.getStyle();return g&&n.setAttribute("style",g),{element:n}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||i(e,"BR"))?{conversion:c,priority:1}:null,div:()=>({conversion:p,priority:1}),pre:()=>({conversion:c,priority:0}),table:e=>N(e)?{conversion:d,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&N(n)?{conversion:f,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&N(t)?{conversion:f,priority:3}:null}}}static importJSON(e){return l().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){const r=this.getChildren(),i=r.length;if(i>=2&&"\n"===r[i-1].getTextContent()&&"\n"===r[i-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const e=t.$createParagraphNode();return this.insertAfter(e,n),e}const{anchor:o,focus:s}=e,a=(o.isBefore(s)?o:s).getNode();if(t.$isTextNode(a)){let e=O(a);const n=[];for(;;)if(t.$isTabNode(e))n.push(t.$createTabNode()),e=e.getNextSibling();else{if(!x(e))break;{let t=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;t<i&&" "===r[t];)t++;if(0!==t&&n.push(T(" ".repeat(t))),t!==i)break;e=e.getNextSibling()}}const r=a.splitText(o.offset)[0],i=0===o.offset?0:1,s=r.getIndexWithinParent()+i,g=a.getParentOrThrow(),l=[t.$createLineBreakNode(),...n];g.splice(s,0,l);const u=n[n.length-1];u?u.select():0===o.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(u(a)){const{offset:n}=e.anchor;a.splice(n,0,[t.$createLineBreakNode()]),a.select(n+1,n+1)}return null}canIndent(){return!1}collapseAtStart(){const e=t.$createParagraphNode();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}}function l(e,n){return t.$create(g).setLanguage(e).setTheme(n)}function u(e){return e instanceof g}function c(e){return{node:l(e.getAttribute(o))}}function p(e){const t=e,n=h(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(h(t))return!0;t=t.parentElement}return!1}(t)?{node:n?l():null}:{node:null}}function d(){return{node:l()}}function f(){return{node:null}}function h(e){return null!==e.style.fontFamily.match("monospace")}function N(e){return e.classList.contains("js-file-line-container")}class m extends t.TextNode{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new m(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=_(t.theme,this.__highlightType);return e.addClassNamesToElement(n,r),n}updateDOM(t,n,r){const i=super.updateDOM(t,n,r),o=_(r.theme,t.__highlightType),s=_(r.theme,this.__highlightType);return o!==s&&(o&&e.removeClassNamesFromElement(n,o),s&&e.addClassNamesToElement(n,s)),i}static importJSON(e){return T().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return l()}}function _(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function T(e="",n){return t.$applyNodeReplacement(new m(e,n))}function x(e){return e instanceof m}function C(n,r){let i=n;for(let o=t.$getSiblingCaret(n,r);o&&(x(o.origin)||t.$isTabNode(o.origin));o=e.$getAdjacentCaret(o))i=o.origin;return i}function O(e){return C(e,"previous")}function S(e){return C(e,"next")}function y(e,r){let i=null,o=null,s=e,a=r,g=e.getTextContent();for(;;){if(0===a){if(s=s.getPreviousSibling(),null===s)break;if(x(s)||t.$isTabNode(s)||t.$isLineBreakNode(s)||n(167),t.$isLineBreakNode(s)){i={node:s,offset:1};break}a=Math.max(0,s.getTextContentSize()-1),g=s.getTextContent()}else a--;const e=g[a];x(s)&&" "!==e&&(o={node:s,offset:a})}if(null!==o)return o;let l=null;if(r<e.getTextContentSize())x(e)&&(l=e.getTextContent()[r]);else{const t=e.getNextSibling();x(t)&&(l=t.getTextContent()[0])}if(null!==l&&" "!==l)return i;{const n=function(e,n){let r=e,i=n,o=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!x(r)||i===s){if(r=r.getNextSibling(),null===r||t.$isLineBreakNode(r))return null;x(r)&&(i=0,o=r.getTextContent(),s=r.getTextContentSize())}if(x(r)){if(" "!==o[i])return{node:r,offset:i};i++}}}(e,r);return null!==n?n:i}}function $(e){const r=S(e);return t.$isLineBreakNode(r)&&n(168),r}const A=t.defineExtension({name:"@lexical/code",nodes:[g,m]});!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const b=globalThis.Prism||window.Prism,L={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},M={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function E(e){return M[e]||e}function v(e){return"string"==typeof e?e:Array.isArray(e)?e.map(v).join(""):v(e.content)}function D(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=b.tokenize(r,b.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=b.languages[n],i={tokens:e},o=b.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in o)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new b.Token("prefix",o[t],t.replace(/^(\w+).*/,"$1"))),s=e.content.filter(e=>"string"==typeof e||"prefix"!==e.type),a=e.content.length-s.length,g=b.tokenize(v(s),r);g.unshift(i());const l=/\r\n|\n/g,u=e=>{const t=[];l.lastIndex=0;let r,o=0;for(;n<a&&(r=l.exec(e));){const n=r.index+r[0].length;t.push(e.slice(o,n)),o=n,t.push(i())}if(0!==t.length)return o<e.length&&t.push(e.slice(o)),t},c=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?c(n.content):c([n.content])}};c(g),n<a&&g.push(i()),e.content=g}return i.tokens}(i,n[1])),R(i)}function R(e,n){const r=[];for(const i of e)if("string"==typeof i){const e=i.split(/(\n|\t)/),o=e.length;for(let i=0;i<o;i++){const o=e[i];"\n"===o||"\r\n"===o?r.push(t.$createLineBreakNode()):"\t"===o?r.push(t.$createTabNode()):o.length>0&&r.push(T(o,n))}}else{const{content:e,alias:t}=i;"string"==typeof e?r.push(...R([e],"prefix"===i.type&&"string"==typeof t?t:i.type)):Array.isArray(e)&&r.push(...R(e,"unchanged"===i.type?void 0:i.type))}return r}const k={$tokenize(e,t){return D(e,t||this.defaultLanguage)},defaultLanguage:r,tokenize(e,t){return b.tokenize(e,b.languages[t||""]||b.languages[this.defaultLanguage])}};function P(e,n,r){const i=e.getParent();u(i)?B(i,n,r):x(e)&&e.replace(t.$createTextNode(e.__text))}function I(e,n){const r=n.getElementByKey(e.getKey());if(null===r)return;const i=e.getChildren(),o=i.length;if(o===r.__cachedChildrenLength)return;r.__cachedChildrenLength=o;let s="1",a=1;for(let e=0;e<o;e++)t.$isLineBreakNode(i[e])&&(s+="\n"+ ++a);r.setAttribute("data-gutter",s)}const w=new Set;function B(e,n,r){const i=e.getKey();void 0===e.getLanguage()&&e.setLanguage(r.defaultLanguage);const o=e.getLanguage()||r.defaultLanguage;if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&b.languages.hasOwnProperty(n)}catch(e){return!1}}(o))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),w.has(i)||(w.add(i),n.update(()=>{!function(e,n){const r=t.$getNodeByKey(e);if(!u(r)||!r.isAttached())return;const i=t.$getSelection();if(!t.$isRangeSelection(i))return void n();const o=i.anchor,s=o.offset,a="element"===o.type&&t.$isLineBreakNode(r.getChildAtIndex(o.offset-1));let g=0;if(!a){const e=o.getNode();g=s+e.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)}if(!n())return;if(a)return void o.getNode().select(s,s);r.getChildren().some(e=>{const n=t.$isTextNode(e);if(n||t.$isLineBreakNode(e)){const t=e.getTextContentSize();if(n&&t>=g)return e.select(g,g),!0;g-=t}return!1})}(i,()=>{const n=t.$getNodeByKey(i);if(!u(n)||!n.isAttached())return!1;const o=n.getLanguage()||r.defaultLanguage,s=r.$tokenize(n,o),a=function(e,t){let n=0;for(;n<e.length&&j(e[n],t[n]);)n++;const r=e.length,i=t.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!j(e[r-s],t[i-s])){s--;break}const a=n,g=r-s,l=t.slice(n,i-s);return{from:a,nodesForReplacement:l,to:g}}(n.getChildren(),s),{from:g,to:l,nodesForReplacement:c}=a;return!(g===l&&!c.length)&&(e.splice(g,l-g,c),!0)})},{onUpdate:()=>{w.delete(i)},skipTransforms:!0}))}function j(e,n){return x(e)&&x(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||t.$isTabNode(e)&&t.$isTabNode(n)||t.$isLineBreakNode(e)&&t.$isLineBreakNode(n)}function H(e){if(!t.$isRangeSelection(e))return!1;const n=e.anchor.getNode(),r=u(n)?n:n.getParent(),i=e.focus.getNode(),o=u(i)?i:i.getParent();return u(r)&&r.is(o)}function F(e){const r=e.getNodes(),i=[];if(1===r.length&&u(r[0]))return i;let o=[];for(let e=0;e<r.length;e++){const s=r[e];x(s)||t.$isTabNode(s)||t.$isLineBreakNode(s)||n(169),t.$isLineBreakNode(s)?o.length>0&&(i.push(o),o=[]):o.push(s)}if(o.length>0){const n=e.isBackward()?e.anchor:e.focus,r=t.$createPoint(o[0].getKey(),0,"text");n.is(r)||i.push(o)}return i}function q(e){const n=t.$getSelection();if(!t.$isRangeSelection(n)||!H(n))return!1;const r=F(n),i=r.length;if(0===i&&n.isCollapsed())return e===t.INDENT_CONTENT_COMMAND&&n.insertNodes([t.$createTabNode()]),!0;if(0===i&&e===t.INDENT_CONTENT_COMMAND&&"\n"===n.getTextContent()){const e=t.$createTabNode(),r=t.$createLineBreakNode(),i=n.isBackward()?"previous":"next";return n.insertNodes([e,r]),t.$setSelectionFromCaretRange(t.$getCaretRangeInDirection(t.$getCaretRange(t.$getTextPointCaret(e,"next",0),t.$normalizeCaret(t.$getSiblingCaret(r,"next"))),i)),!0}for(let o=0;o<i;o++){const i=r[o];if(i.length>0){let r=i[0];if(0===o&&(r=O(r)),e===t.INDENT_CONTENT_COMMAND){const e=t.$createTabNode();if(r.insertBefore(e),0===o){const i=n.isBackward()?"focus":"anchor",o=t.$createPoint(r.getKey(),0,"text");n[i].is(o)&&n[i].set(e.getKey(),0,"text")}}else t.$isTabNode(r)&&r.remove()}}return!0}function z(e,n){const r=t.$getSelection();if(!t.$isRangeSelection(r))return!1;const{anchor:i,focus:o}=r,s=i.offset,a=o.offset,g=i.getNode(),l=o.getNode(),u=e===t.KEY_ARROW_UP_COMMAND;if(!H(r)||!x(g)&&!t.$isTabNode(g)||!x(l)&&!t.$isTabNode(l))return!1;if(!n.altKey){if(r.isCollapsed()){const e=g.getParentOrThrow();if(u&&0===s&&null===g.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),n.preventDefault(),!0}else if(!u&&s===g.getTextContentSize()&&null===g.getNextSibling()){if(null===e.getNextSibling())return e.selectNext(),n.preventDefault(),!0}}return!1}let c,p;if(g.isBefore(l)?(c=O(g),p=S(l)):(c=O(l),p=S(g)),null==c||null==p)return!1;const d=c.getNodesBetween(p);for(let e=0;e<d.length;e++){const n=d[e];if(!x(n)&&!t.$isTabNode(n)&&!t.$isLineBreakNode(n))return!1}n.preventDefault(),n.stopPropagation();const f=u?c.getPreviousSibling():p.getNextSibling();if(!t.$isLineBreakNode(f))return!0;const h=u?f.getPreviousSibling():f.getNextSibling();if(null==h)return!0;const N=x(h)||t.$isTabNode(h)||t.$isLineBreakNode(h)?u?O(h):S(h):null;let m=null!=N?N:h;return f.remove(),d.forEach(e=>e.remove()),e===t.KEY_ARROW_UP_COMMAND?(d.forEach(e=>m.insertBefore(e)),m.insertBefore(f)):(m.insertAfter(f),m=f,d.forEach(e=>{m.insertAfter(e),m=e})),r.setTextNodeRange(g,s,l,a),!0}function W(e,n){const r=t.$getSelection();if(!t.$isRangeSelection(r))return!1;const{anchor:i,focus:o}=r,s=i.getNode(),a=o.getNode(),g=e===t.MOVE_TO_START;if(!H(r)||!x(s)&&!t.$isTabNode(s)||!x(a)&&!t.$isTabNode(a))return!1;if(g){const e=y(a,o.offset);if(null!==e){const{node:n,offset:i}=e;t.$isLineBreakNode(n)?n.selectNext(0,0):r.setTextNodeRange(n,i,n,i)}else a.getParentOrThrow().selectStart()}else{$(a).select()}return n.preventDefault(),n.stopPropagation(),!0}const K=O,Y=S,U=$,J=y;exports.$createCodeHighlightNode=T,exports.$createCodeNode=l,exports.$getEndOfCodeInLine=$,exports.$getFirstCodeNodeOfLine=O,exports.$getLastCodeNodeOfLine=S,exports.$getStartOfCodeInLine=y,exports.$isCodeHighlightNode=x,exports.$isCodeNode=u,exports.CODE_LANGUAGE_FRIENDLY_NAME_MAP=L,exports.CODE_LANGUAGE_MAP=M,exports.CodeExtension=A,exports.CodeHighlightNode=m,exports.CodeNode=g,exports.DEFAULT_CODE_LANGUAGE=r,exports.PrismTokenizer=k,exports.getCodeLanguageOptions=function(){const e=[];for(const[t,n]of Object.entries(L))e.push([t,n]);return e},exports.getCodeLanguages=()=>Object.keys(b.languages).filter(e=>"function"!=typeof b.languages[e]).sort(),exports.getCodeThemeOptions=function(){return[]},exports.getDefaultCodeLanguage=()=>r,exports.getEndOfCodeInLine=U,exports.getFirstCodeNodeOfLine=K,exports.getLanguageFriendlyName=function(e){const t=E(e);return L[t]||t},exports.getLastCodeNodeOfLine=Y,exports.getStartOfCodeInLine=J,exports.normalizeCodeLang=E,exports.normalizeCodeLanguage=E,exports.registerCodeHighlighting=function(r,i){if(!r.hasNodes([g,m]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==i&&(i=k);const o=[];return!0!==r._headless&&o.push(r.registerMutationListener(g,e=>{r.update(()=>{for(const[n,i]of e)if("destroyed"!==i){const e=t.$getNodeByKey(n);null!==e&&I(e,r)}})},{skipInitialization:!1})),o.push(r.registerNodeTransform(g,e=>B(e,r,i)),r.registerNodeTransform(t.TextNode,e=>P(e,r,i)),r.registerNodeTransform(m,e=>P(e,r,i)),r.registerCommand(t.KEY_TAB_COMMAND,e=>{const i=function(e){const r=t.$getSelection();if(!t.$isRangeSelection(r)||!H(r))return null;const i=e?t.OUTDENT_CONTENT_COMMAND:t.INDENT_CONTENT_COMMAND,o=e?t.OUTDENT_CONTENT_COMMAND:t.INSERT_TAB_COMMAND,s=r.anchor,a=r.focus;if(s.is(a))return o;const g=F(r);if(1!==g.length)return i;const l=g[0];let u,c;0===l.length&&n(285),r.isBackward()?(u=a,c=s):(u=s,c=a);const p=O(l[0]),d=S(l[0]),f=t.$createPoint(p.getKey(),0,"text"),h=t.$createPoint(d.getKey(),d.getTextContentSize(),"text");return u.isBefore(f)||h.isBefore(c)?i:f.isBefore(u)||c.isBefore(h)?o:i}(e.shiftKey);return null!==i&&(e.preventDefault(),r.dispatchCommand(i,void 0),!0)},t.COMMAND_PRIORITY_LOW),r.registerCommand(t.INSERT_TAB_COMMAND,()=>!!H(t.$getSelection())&&(t.$insertNodes([t.$createTabNode()]),!0),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.INDENT_CONTENT_COMMAND,e=>q(t.INDENT_CONTENT_COMMAND),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.OUTDENT_CONTENT_COMMAND,e=>q(t.OUTDENT_CONTENT_COMMAND),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.KEY_ARROW_UP_COMMAND,e=>{const n=t.$getSelection();if(!t.$isRangeSelection(n))return!1;const{anchor:r}=n,i=r.getNode();return!!H(n)&&(n.isCollapsed()&&0===r.offset&&null===i.getPreviousSibling()&&u(i.getParentOrThrow())?(e.preventDefault(),!0):z(t.KEY_ARROW_UP_COMMAND,e))},t.COMMAND_PRIORITY_LOW),r.registerCommand(t.KEY_ARROW_DOWN_COMMAND,e=>{const n=t.$getSelection();if(!t.$isRangeSelection(n))return!1;const{anchor:r}=n,i=r.getNode();return!!H(n)&&(n.isCollapsed()&&r.offset===i.getTextContentSize()&&null===i.getNextSibling()&&u(i.getParentOrThrow())?(e.preventDefault(),!0):z(t.KEY_ARROW_DOWN_COMMAND,e))},t.COMMAND_PRIORITY_LOW),r.registerCommand(t.MOVE_TO_START,e=>W(t.MOVE_TO_START,e),t.COMMAND_PRIORITY_LOW),r.registerCommand(t.MOVE_TO_END,e=>W(t.MOVE_TO_END,e),t.COMMAND_PRIORITY_LOW)),e.mergeRegister(...o)};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{isHTMLElement as t,addClassNamesToElement as e,removeClassNamesFromElement as n,$getAdjacentCaret as r,mergeRegister as i}from"@lexical/utils";import{ElementNode as o,$createParagraphNode as s,$isTextNode as l,$isTabNode as u,$createTabNode as c,$createLineBreakNode as g,$create as a,TextNode as p,$applyNodeReplacement as f,$getSiblingCaret as h,$isLineBreakNode as d,defineExtension as m,$createTextNode as y,$getNodeByKey as x,$getSelection as _,$isRangeSelection as S,$createPoint as v,INDENT_CONTENT_COMMAND as T,OUTDENT_CONTENT_COMMAND as b,INSERT_TAB_COMMAND as C,$setSelectionFromCaretRange as N,$getCaretRangeInDirection as j,$getCaretRange as w,$getTextPointCaret as k,$normalizeCaret as A,KEY_ARROW_UP_COMMAND as P,MOVE_TO_START as L,KEY_TAB_COMMAND as O,COMMAND_PRIORITY_LOW as H,$insertNodes as z,KEY_ARROW_DOWN_COMMAND as E,MOVE_TO_END as B}from"lexical";import"prismjs";import"prismjs/components/prism-clike.js";import"prismjs/components/prism-javascript.js";import"prismjs/components/prism-markup.js";import"prismjs/components/prism-markdown.js";import"prismjs/components/prism-c.js";import"prismjs/components/prism-css.js";import"prismjs/components/prism-objectivec.js";import"prismjs/components/prism-sql.js";import"prismjs/components/prism-powershell.js";import"prismjs/components/prism-python.js";import"prismjs/components/prism-rust.js";import"prismjs/components/prism-swift.js";import"prismjs/components/prism-typescript.js";import"prismjs/components/prism-java.js";import"prismjs/components/prism-cpp.js";function D(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const F="javascript",I=()=>F;function M(e,n){for(const r of e.childNodes){if(t(r)&&r.tagName===n)return!0;M(r,n)}return!1}const J="data-language",R="data-highlight-language",K="data-theme";class $ extends o{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new $(t.__language,t.__key)}constructor(t,e){super(e),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");e(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(J,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(R,r));const i=this.getTheme();i&&n.setAttribute(K,i);const o=this.getStyle();return o&&n.setAttribute("style",o),n}updateDOM(t,e,n){const r=this.__language,i=t.__language;r?r!==i&&e.setAttribute(J,r):i&&e.removeAttribute(J);const o=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&e.setAttribute(R,r):e.removeAttribute(R):o&&r&&e.setAttribute(R,r);const s=this.__theme,l=t.__theme;s?s!==l&&e.setAttribute(K,s):l&&e.removeAttribute(K);const u=this.__style,c=t.__style;return u?u!==c&&e.setAttribute("style",u):c&&e.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");e(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(J,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(R,r));const i=this.getTheme();i&&n.setAttribute(K,i);const o=this.getStyle();return o&&n.setAttribute("style",o),{element:n}}static importDOM(){return{code:t=>null!=t.textContent&&(/\r?\n/.test(t.textContent)||M(t,"BR"))?{conversion:U,priority:1}:null,div:()=>({conversion:X,priority:1}),pre:()=>({conversion:U,priority:0}),table:t=>Y(t)?{conversion:Q,priority:3}:null,td:t=>{const e=t,n=e.closest("table");return e.classList.contains("js-file-line")||n&&Y(n)?{conversion:G,priority:3}:null},tr:t=>{const e=t.closest("table");return e&&Y(e)?{conversion:G,priority:3}:null}}}static importJSON(t){return W().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,e=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const t=s();return this.insertAfter(t,e),t}const{anchor:i,focus:o}=t,a=(i.isBefore(o)?i:o).getNode();if(l(a)){let t=it(a);const e=[];for(;;)if(u(t))e.push(c()),t=t.getNextSibling();else{if(!nt(t))break;{let n=0;const r=t.getTextContent(),i=t.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&e.push(et(" ".repeat(n))),n!==i)break;t=t.getNextSibling()}}const n=a.splitText(i.offset)[0],r=0===i.offset?0:1,o=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[g(),...e];s.splice(o,0,l);const p=e[e.length-1];p?p.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(q(a)){const{offset:e}=t.anchor;a.splice(e,0,[g()]),a.select(e+1,e+1)}return null}canIndent(){return!1}collapseAtStart(){const t=s();return this.getChildren().forEach((e=>t.append(e))),this.replace(t),!0}setLanguage(t){const e=this.getWritable();return e.__language=t||void 0,e}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const e=this.getWritable();return e.__isSyntaxHighlightSupported=t,e}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const e=this.getWritable();return e.__theme=t||void 0,e}getTheme(){return this.getLatest().__theme}}function W(t,e){return a($).setLanguage(t).setTheme(e)}function q(t){return t instanceof $}function U(t){return{node:W(t.getAttribute(J))}}function X(t){const e=t,n=V(e);return n||function(t){let e=t.parentElement;for(;null!==e;){if(V(e))return!0;e=e.parentElement}return!1}(e)?{node:n?W():null}:{node:null}}function Q(){return{node:W()}}function G(){return{node:null}}function V(t){return null!==t.style.fontFamily.match("monospace")}function Y(t){return t.classList.contains("js-file-line-container")}class Z extends p{__highlightType;constructor(t="",e,n){super(t,n),this.__highlightType=e}static getType(){return"code-highlight"}static clone(t){return new Z(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const e=this.getWritable();return e.__highlightType=t||void 0,e}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=tt(t.theme,this.__highlightType);return e(n,r),n}updateDOM(t,r,i){const o=super.updateDOM(t,r,i),s=tt(i.theme,t.__highlightType),l=tt(i.theme,this.__highlightType);return s!==l&&(s&&n(r,s),l&&e(r,l)),o}static importJSON(t){return et().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return W()}}function tt(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function et(t="",e){return f(new Z(t,e))}function nt(t){return t instanceof Z}function rt(t,e){let n=t;for(let i=h(t,e);i&&(nt(i.origin)||u(i.origin));i=r(i))n=i.origin;return n}function it(t){return rt(t,"previous")}function ot(t){return rt(t,"next")}function st(t,e){let n=null,r=null,i=t,o=e,s=t.getTextContent();for(;;){if(0===o){if(i=i.getPreviousSibling(),null===i)break;if(nt(i)||u(i)||d(i)||D(167),d(i)){n={node:i,offset:1};break}o=Math.max(0,i.getTextContentSize()-1),s=i.getTextContent()}else o--;const t=s[o];nt(i)&&" "!==t&&(r={node:i,offset:o})}if(null!==r)return r;let l=null;if(e<t.getTextContentSize())nt(t)&&(l=t.getTextContent()[e]);else{const e=t.getNextSibling();nt(e)&&(l=e.getTextContent()[0])}if(null!==l&&" "!==l)return n;{const r=function(t,e){let n=t,r=e,i=t.getTextContent(),o=t.getTextContentSize();for(;;){if(!nt(n)||r===o){if(n=n.getNextSibling(),null===n||d(n))return null;nt(n)&&(r=0,i=n.getTextContent(),o=n.getTextContentSize())}if(nt(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(t,e);return null!==r?r:n}}function lt(t){const e=ot(t);return d(e)&&D(168),e}const ut=m({name:"@lexical/code",nodes:[$,Z]});!function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach((function(n){var r=e[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),t.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(t.languages.diff,"PREFIXES",{value:e})}(Prism);const ct=globalThis.Prism||window.Prism,gt={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},at={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function pt(t){return at[t]||t}function ft(t){const e=pt(t);return gt[e]||e}const ht=()=>Object.keys(ct.languages).filter((t=>"function"!=typeof ct.languages[t])).sort();function dt(){const t=[];for(const[e,n]of Object.entries(gt))t.push([e,n]);return t}function mt(){return[]}function yt(t){return"string"==typeof t?t:Array.isArray(t)?t.map(yt).join(""):yt(t.content)}function xt(t,e){const n=/^diff-([\w-]+)/i.exec(e),r=t.getTextContent();let i=ct.tokenize(r,ct.languages[n?"diff":e]);return n&&(i=function(t,e){const n=e,r=ct.languages[n],i={tokens:t},o=ct.languages.diff.PREFIXES;for(const t of i.tokens){if("string"==typeof t||!(t.type in o)||!Array.isArray(t.content))continue;const e=t.type;let n=0;const i=()=>(n++,new ct.Token("prefix",o[e],e.replace(/^(\w+).*/,"$1"))),s=t.content.filter((t=>"string"==typeof t||"prefix"!==t.type)),l=t.content.length-s.length,u=ct.tokenize(yt(s),r);u.unshift(i());const c=/\r\n|\n/g,g=t=>{const e=[];c.lastIndex=0;let r,o=0;for(;n<l&&(r=c.exec(t));){const n=r.index+r[0].length;e.push(t.slice(o,n)),o=n,e.push(i())}if(0!==e.length)return o<t.length&&e.push(t.slice(o)),e},a=t=>{for(let e=0;e<t.length&&n<l;e++){const n=t[e];if("string"==typeof n){const r=g(n);r&&(t.splice(e,1,...r),e+=r.length-1)}else if("string"==typeof n.content){const t=g(n.content);t&&(n.content=t)}else Array.isArray(n.content)?a(n.content):a([n.content])}};a(u),n<l&&u.push(i()),t.content=u}return i.tokens}(i,n[1])),_t(i)}function _t(t,e){const n=[];for(const r of t)if("string"==typeof r){const t=r.split(/(\n|\t)/),i=t.length;for(let r=0;r<i;r++){const i=t[r];"\n"===i||"\r\n"===i?n.push(g()):"\t"===i?n.push(c()):i.length>0&&n.push(et(i,e))}}else{const{content:t,alias:e}=r;"string"==typeof t?n.push(..._t([t],"prefix"===r.type&&"string"==typeof e?e:r.type)):Array.isArray(t)&&n.push(..._t(t,"unchanged"===r.type?void 0:r.type))}return n}const St={$tokenize(t,e){return xt(t,e||this.defaultLanguage)},defaultLanguage:F,tokenize(t,e){return ct.tokenize(t,ct.languages[e||""]||ct.languages[this.defaultLanguage])}};function vt(t,e,n){const r=t.getParent();q(r)?Ct(r,e,n):nt(t)&&t.replace(y(t.__text))}function Tt(t,e){const n=e.getElementByKey(t.getKey());if(null===n)return;const r=t.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let o="1",s=1;for(let t=0;t<i;t++)d(r[t])&&(o+="\n"+ ++s);n.setAttribute("data-gutter",o)}const bt=new Set;function Ct(t,e,n){const r=t.getKey();void 0===t.getLanguage()&&t.setLanguage(n.defaultLanguage);const i=t.getLanguage()||n.defaultLanguage;if(!function(t){const e=function(t){const e=/^diff-([\w-]+)/i.exec(t);return e?e[1]:null}(t),n=e||t;try{return!!n&&ct.languages.hasOwnProperty(n)}catch(t){return!1}}(i))return t.getIsSyntaxHighlightSupported()&&t.setIsSyntaxHighlightSupported(!1),void async function(t,e,n){}();t.getIsSyntaxHighlightSupported()||t.setIsSyntaxHighlightSupported(!0),bt.has(r)||(bt.add(r),e.update((()=>{!function(t,e){const n=x(t);if(!q(n)||!n.isAttached())return;const r=_();if(!S(r))return void e();const i=r.anchor,o=i.offset,s="element"===i.type&&d(n.getChildAtIndex(i.offset-1));let u=0;if(!s){const t=i.getNode();u=o+t.getPreviousSiblings().reduce(((t,e)=>t+e.getTextContentSize()),0)}if(!e())return;if(s)return void i.getNode().select(o,o);n.getChildren().some((t=>{const e=l(t);if(e||d(t)){const n=t.getTextContentSize();if(e&&n>=u)return t.select(u,u),!0;u-=n}return!1}))}(r,(()=>{const e=x(r);if(!q(e)||!e.isAttached())return!1;const i=e.getLanguage()||n.defaultLanguage,o=n.$tokenize(e,i),s=function(t,e){let n=0;for(;n<t.length&&Nt(t[n],e[n]);)n++;const r=t.length,i=e.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!Nt(t[r-s],e[i-s])){s--;break}const l=n,u=r-s,c=e.slice(n,i-s);return{from:l,nodesForReplacement:c,to:u}}(e.getChildren(),o),{from:l,to:u,nodesForReplacement:c}=s;return!(l===u&&!c.length)&&(t.splice(l,u-l,c),!0)}))}),{onUpdate:()=>{bt.delete(r)},skipTransforms:!0}))}function Nt(t,e){return nt(t)&&nt(e)&&t.__text===e.__text&&t.__highlightType===e.__highlightType||u(t)&&u(e)||d(t)&&d(e)}function jt(t){if(!S(t))return!1;const e=t.anchor.getNode(),n=q(e)?e:e.getParent(),r=t.focus.getNode(),i=q(r)?r:r.getParent();return q(n)&&n.is(i)}function wt(t){const e=t.getNodes(),n=[];if(1===e.length&&q(e[0]))return n;let r=[];for(let t=0;t<e.length;t++){const i=e[t];nt(i)||u(i)||d(i)||D(169),d(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const e=t.isBackward()?t.anchor:t.focus,i=v(r[0].getKey(),0,"text");e.is(i)||n.push(r)}return n}function kt(t){const e=_();if(!S(e)||!jt(e))return!1;const n=wt(e),r=n.length;if(0===r&&e.isCollapsed())return t===T&&e.insertNodes([c()]),!0;if(0===r&&t===T&&"\n"===e.getTextContent()){const t=c(),n=g(),r=e.isBackward()?"previous":"next";return e.insertNodes([t,n]),N(j(w(k(t,"next",0),A(h(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=it(n)),t===T){const t=c();if(n.insertBefore(t),0===i){const r=e.isBackward()?"focus":"anchor",i=v(n.getKey(),0,"text");e[r].is(i)&&e[r].set(t.getKey(),0,"text")}}else u(n)&&n.remove()}}return!0}function At(t,e){const n=_();if(!S(n))return!1;const{anchor:r,focus:i}=n,o=r.offset,s=i.offset,l=r.getNode(),c=i.getNode(),g=t===P;if(!jt(n)||!nt(l)&&!u(l)||!nt(c)&&!u(c))return!1;if(!e.altKey){if(n.isCollapsed()){const t=l.getParentOrThrow();if(g&&0===o&&null===l.getPreviousSibling()){if(null===t.getPreviousSibling())return t.selectPrevious(),e.preventDefault(),!0}else if(!g&&o===l.getTextContentSize()&&null===l.getNextSibling()){if(null===t.getNextSibling())return t.selectNext(),e.preventDefault(),!0}}return!1}let a,p;if(l.isBefore(c)?(a=it(l),p=ot(c)):(a=it(c),p=ot(l)),null==a||null==p)return!1;const f=a.getNodesBetween(p);for(let t=0;t<f.length;t++){const e=f[t];if(!nt(e)&&!u(e)&&!d(e))return!1}e.preventDefault(),e.stopPropagation();const h=g?a.getPreviousSibling():p.getNextSibling();if(!d(h))return!0;const m=g?h.getPreviousSibling():h.getNextSibling();if(null==m)return!0;const y=nt(m)||u(m)||d(m)?g?it(m):ot(m):null;let x=null!=y?y:m;return h.remove(),f.forEach((t=>t.remove())),t===P?(f.forEach((t=>x.insertBefore(t))),x.insertBefore(h)):(x.insertAfter(h),x=h,f.forEach((t=>{x.insertAfter(t),x=t}))),n.setTextNodeRange(l,o,c,s),!0}function Pt(t,e){const n=_();if(!S(n))return!1;const{anchor:r,focus:i}=n,o=r.getNode(),s=i.getNode(),l=t===L;if(!jt(n)||!nt(o)&&!u(o)||!nt(s)&&!u(s))return!1;if(l){const t=st(s,i.offset);if(null!==t){const{node:e,offset:r}=t;d(e)?e.selectNext(0,0):n.setTextNodeRange(e,r,e,r)}else s.getParentOrThrow().selectStart()}else{lt(s).select()}return e.preventDefault(),e.stopPropagation(),!0}function Lt(t,e){if(!t.hasNodes([$,Z]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==e&&(e=St);const n=[];return!0!==t._headless&&n.push(t.registerMutationListener($,(e=>{t.update((()=>{for(const[n,r]of e)if("destroyed"!==r){const e=x(n);null!==e&&Tt(e,t)}}))}),{skipInitialization:!1})),n.push(t.registerNodeTransform($,(n=>Ct(n,t,e))),t.registerNodeTransform(p,(n=>vt(n,t,e))),t.registerNodeTransform(Z,(n=>vt(n,t,e))),t.registerCommand(O,(e=>{const n=function(t){const e=_();if(!S(e)||!jt(e))return null;const n=t?b:T,r=t?b:C,i=e.anchor,o=e.focus;if(i.is(o))return r;const s=wt(e);if(1!==s.length)return n;const l=s[0];let u,c;0===l.length&&D(285),e.isBackward()?(u=o,c=i):(u=i,c=o);const g=it(l[0]),a=ot(l[0]),p=v(g.getKey(),0,"text"),f=v(a.getKey(),a.getTextContentSize(),"text");return u.isBefore(p)||f.isBefore(c)?n:p.isBefore(u)||c.isBefore(f)?r:n}(e.shiftKey);return null!==n&&(e.preventDefault(),t.dispatchCommand(n,void 0),!0)}),H),t.registerCommand(C,(()=>!!jt(_())&&(z([c()]),!0)),H),t.registerCommand(T,(t=>kt(T)),H),t.registerCommand(b,(t=>kt(b)),H),t.registerCommand(P,(t=>{const e=_();if(!S(e))return!1;const{anchor:n}=e,r=n.getNode();return!!jt(e)&&(e.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&q(r.getParentOrThrow())?(t.preventDefault(),!0):At(P,t))}),H),t.registerCommand(E,(t=>{const e=_();if(!S(e))return!1;const{anchor:n}=e,r=n.getNode();return!!jt(e)&&(e.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&q(r.getParentOrThrow())?(t.preventDefault(),!0):At(E,t))}),H),t.registerCommand(L,(t=>Pt(L,t)),H),t.registerCommand(B,(t=>Pt(B,t)),H)),i(...n)}const Ot=it,Ht=ot,zt=lt,Et=st;export{et as $createCodeHighlightNode,W as $createCodeNode,lt as $getEndOfCodeInLine,it as $getFirstCodeNodeOfLine,ot as $getLastCodeNodeOfLine,st as $getStartOfCodeInLine,nt as $isCodeHighlightNode,q as $isCodeNode,gt as CODE_LANGUAGE_FRIENDLY_NAME_MAP,at as CODE_LANGUAGE_MAP,ut as CodeExtension,Z as CodeHighlightNode,$ as CodeNode,F as DEFAULT_CODE_LANGUAGE,St as PrismTokenizer,dt as getCodeLanguageOptions,ht as getCodeLanguages,mt as getCodeThemeOptions,I as getDefaultCodeLanguage,zt as getEndOfCodeInLine,Ot as getFirstCodeNodeOfLine,ft as getLanguageFriendlyName,Ht as getLastCodeNodeOfLine,Et as getStartOfCodeInLine,pt as normalizeCodeLang,pt as normalizeCodeLanguage,Lt as registerCodeHighlighting};
9
+ import{isHTMLElement as t,addClassNamesToElement as e,removeClassNamesFromElement as n,$getAdjacentCaret as r,mergeRegister as i}from"@lexical/utils";import{ElementNode as o,$createParagraphNode as s,$isTextNode as l,$isTabNode as u,$createTabNode as c,$createLineBreakNode as g,$create as a,TextNode as p,$applyNodeReplacement as f,$getSiblingCaret as h,$isLineBreakNode as d,defineExtension as m,$createTextNode as y,$getNodeByKey as x,$getSelection as _,$isRangeSelection as S,$createPoint as v,INDENT_CONTENT_COMMAND as T,OUTDENT_CONTENT_COMMAND as b,INSERT_TAB_COMMAND as C,$setSelectionFromCaretRange as N,$getCaretRangeInDirection as j,$getCaretRange as w,$getTextPointCaret as k,$normalizeCaret as A,KEY_ARROW_UP_COMMAND as P,MOVE_TO_START as L,KEY_TAB_COMMAND as O,COMMAND_PRIORITY_LOW as H,$insertNodes as z,KEY_ARROW_DOWN_COMMAND as E,MOVE_TO_END as B}from"lexical";import"prismjs";import"prismjs/components/prism-clike.js";import"prismjs/components/prism-javascript.js";import"prismjs/components/prism-markup.js";import"prismjs/components/prism-markdown.js";import"prismjs/components/prism-c.js";import"prismjs/components/prism-css.js";import"prismjs/components/prism-objectivec.js";import"prismjs/components/prism-sql.js";import"prismjs/components/prism-powershell.js";import"prismjs/components/prism-python.js";import"prismjs/components/prism-rust.js";import"prismjs/components/prism-swift.js";import"prismjs/components/prism-typescript.js";import"prismjs/components/prism-java.js";import"prismjs/components/prism-cpp.js";function D(t,...e){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",t);for(const t of e)r.append("v",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const F="javascript",I=()=>F;function M(e,n){for(const r of e.childNodes){if(t(r)&&r.tagName===n)return!0;M(r,n)}return!1}const J="data-language",R="data-highlight-language",K="data-theme";class $ extends o{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new $(t.__language,t.__key)}constructor(t,e){super(e),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");e(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(J,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(R,r));const i=this.getTheme();i&&n.setAttribute(K,i);const o=this.getStyle();return o&&n.setAttribute("style",o),n}updateDOM(t,e,n){const r=this.__language,i=t.__language;r?r!==i&&e.setAttribute(J,r):i&&e.removeAttribute(J);const o=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&e.setAttribute(R,r):e.removeAttribute(R):o&&r&&e.setAttribute(R,r);const s=this.__theme,l=t.__theme;s?s!==l&&e.setAttribute(K,s):l&&e.removeAttribute(K);const u=this.__style,c=t.__style;return u?u!==c&&e.setAttribute("style",u):c&&e.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");e(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(J,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(R,r));const i=this.getTheme();i&&n.setAttribute(K,i);const o=this.getStyle();return o&&n.setAttribute("style",o),{element:n}}static importDOM(){return{code:t=>null!=t.textContent&&(/\r?\n/.test(t.textContent)||M(t,"BR"))?{conversion:U,priority:1}:null,div:()=>({conversion:X,priority:1}),pre:()=>({conversion:U,priority:0}),table:t=>Y(t)?{conversion:Q,priority:3}:null,td:t=>{const e=t,n=e.closest("table");return e.classList.contains("js-file-line")||n&&Y(n)?{conversion:G,priority:3}:null},tr:t=>{const e=t.closest("table");return e&&Y(e)?{conversion:G,priority:3}:null}}}static importJSON(t){return W().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,e=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const t=s();return this.insertAfter(t,e),t}const{anchor:i,focus:o}=t,a=(i.isBefore(o)?i:o).getNode();if(l(a)){let t=it(a);const e=[];for(;;)if(u(t))e.push(c()),t=t.getNextSibling();else{if(!nt(t))break;{let n=0;const r=t.getTextContent(),i=t.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&e.push(et(" ".repeat(n))),n!==i)break;t=t.getNextSibling()}}const n=a.splitText(i.offset)[0],r=0===i.offset?0:1,o=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[g(),...e];s.splice(o,0,l);const p=e[e.length-1];p?p.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(q(a)){const{offset:e}=t.anchor;a.splice(e,0,[g()]),a.select(e+1,e+1)}return null}canIndent(){return!1}collapseAtStart(){const t=s();return this.getChildren().forEach(e=>t.append(e)),this.replace(t),!0}setLanguage(t){const e=this.getWritable();return e.__language=t||void 0,e}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const e=this.getWritable();return e.__isSyntaxHighlightSupported=t,e}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const e=this.getWritable();return e.__theme=t||void 0,e}getTheme(){return this.getLatest().__theme}}function W(t,e){return a($).setLanguage(t).setTheme(e)}function q(t){return t instanceof $}function U(t){return{node:W(t.getAttribute(J))}}function X(t){const e=t,n=V(e);return n||function(t){let e=t.parentElement;for(;null!==e;){if(V(e))return!0;e=e.parentElement}return!1}(e)?{node:n?W():null}:{node:null}}function Q(){return{node:W()}}function G(){return{node:null}}function V(t){return null!==t.style.fontFamily.match("monospace")}function Y(t){return t.classList.contains("js-file-line-container")}class Z extends p{__highlightType;constructor(t="",e,n){super(t,n),this.__highlightType=e}static getType(){return"code-highlight"}static clone(t){return new Z(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const e=this.getWritable();return e.__highlightType=t||void 0,e}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=tt(t.theme,this.__highlightType);return e(n,r),n}updateDOM(t,r,i){const o=super.updateDOM(t,r,i),s=tt(i.theme,t.__highlightType),l=tt(i.theme,this.__highlightType);return s!==l&&(s&&n(r,s),l&&e(r,l)),o}static importJSON(t){return et().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return W()}}function tt(t,e){return e&&t&&t.codeHighlight&&t.codeHighlight[e]}function et(t="",e){return f(new Z(t,e))}function nt(t){return t instanceof Z}function rt(t,e){let n=t;for(let i=h(t,e);i&&(nt(i.origin)||u(i.origin));i=r(i))n=i.origin;return n}function it(t){return rt(t,"previous")}function ot(t){return rt(t,"next")}function st(t,e){let n=null,r=null,i=t,o=e,s=t.getTextContent();for(;;){if(0===o){if(i=i.getPreviousSibling(),null===i)break;if(nt(i)||u(i)||d(i)||D(167),d(i)){n={node:i,offset:1};break}o=Math.max(0,i.getTextContentSize()-1),s=i.getTextContent()}else o--;const t=s[o];nt(i)&&" "!==t&&(r={node:i,offset:o})}if(null!==r)return r;let l=null;if(e<t.getTextContentSize())nt(t)&&(l=t.getTextContent()[e]);else{const e=t.getNextSibling();nt(e)&&(l=e.getTextContent()[0])}if(null!==l&&" "!==l)return n;{const r=function(t,e){let n=t,r=e,i=t.getTextContent(),o=t.getTextContentSize();for(;;){if(!nt(n)||r===o){if(n=n.getNextSibling(),null===n||d(n))return null;nt(n)&&(r=0,i=n.getTextContent(),o=n.getTextContentSize())}if(nt(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(t,e);return null!==r?r:n}}function lt(t){const e=ot(t);return d(e)&&D(168),e}const ut=m({name:"@lexical/code",nodes:[$,Z]});!function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(n){var r=e[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),t.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:e})}(Prism);const ct=globalThis.Prism||window.Prism,gt={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},at={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function pt(t){return at[t]||t}function ft(t){const e=pt(t);return gt[e]||e}const ht=()=>Object.keys(ct.languages).filter(t=>"function"!=typeof ct.languages[t]).sort();function dt(){const t=[];for(const[e,n]of Object.entries(gt))t.push([e,n]);return t}function mt(){return[]}function yt(t){return"string"==typeof t?t:Array.isArray(t)?t.map(yt).join(""):yt(t.content)}function xt(t,e){const n=/^diff-([\w-]+)/i.exec(e),r=t.getTextContent();let i=ct.tokenize(r,ct.languages[n?"diff":e]);return n&&(i=function(t,e){const n=e,r=ct.languages[n],i={tokens:t},o=ct.languages.diff.PREFIXES;for(const t of i.tokens){if("string"==typeof t||!(t.type in o)||!Array.isArray(t.content))continue;const e=t.type;let n=0;const i=()=>(n++,new ct.Token("prefix",o[e],e.replace(/^(\w+).*/,"$1"))),s=t.content.filter(t=>"string"==typeof t||"prefix"!==t.type),l=t.content.length-s.length,u=ct.tokenize(yt(s),r);u.unshift(i());const c=/\r\n|\n/g,g=t=>{const e=[];c.lastIndex=0;let r,o=0;for(;n<l&&(r=c.exec(t));){const n=r.index+r[0].length;e.push(t.slice(o,n)),o=n,e.push(i())}if(0!==e.length)return o<t.length&&e.push(t.slice(o)),e},a=t=>{for(let e=0;e<t.length&&n<l;e++){const n=t[e];if("string"==typeof n){const r=g(n);r&&(t.splice(e,1,...r),e+=r.length-1)}else if("string"==typeof n.content){const t=g(n.content);t&&(n.content=t)}else Array.isArray(n.content)?a(n.content):a([n.content])}};a(u),n<l&&u.push(i()),t.content=u}return i.tokens}(i,n[1])),_t(i)}function _t(t,e){const n=[];for(const r of t)if("string"==typeof r){const t=r.split(/(\n|\t)/),i=t.length;for(let r=0;r<i;r++){const i=t[r];"\n"===i||"\r\n"===i?n.push(g()):"\t"===i?n.push(c()):i.length>0&&n.push(et(i,e))}}else{const{content:t,alias:e}=r;"string"==typeof t?n.push(..._t([t],"prefix"===r.type&&"string"==typeof e?e:r.type)):Array.isArray(t)&&n.push(..._t(t,"unchanged"===r.type?void 0:r.type))}return n}const St={$tokenize(t,e){return xt(t,e||this.defaultLanguage)},defaultLanguage:F,tokenize(t,e){return ct.tokenize(t,ct.languages[e||""]||ct.languages[this.defaultLanguage])}};function vt(t,e,n){const r=t.getParent();q(r)?Ct(r,e,n):nt(t)&&t.replace(y(t.__text))}function Tt(t,e){const n=e.getElementByKey(t.getKey());if(null===n)return;const r=t.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let o="1",s=1;for(let t=0;t<i;t++)d(r[t])&&(o+="\n"+ ++s);n.setAttribute("data-gutter",o)}const bt=new Set;function Ct(t,e,n){const r=t.getKey();void 0===t.getLanguage()&&t.setLanguage(n.defaultLanguage);const i=t.getLanguage()||n.defaultLanguage;if(!function(t){const e=function(t){const e=/^diff-([\w-]+)/i.exec(t);return e?e[1]:null}(t),n=e||t;try{return!!n&&ct.languages.hasOwnProperty(n)}catch(t){return!1}}(i))return t.getIsSyntaxHighlightSupported()&&t.setIsSyntaxHighlightSupported(!1),void async function(){}();t.getIsSyntaxHighlightSupported()||t.setIsSyntaxHighlightSupported(!0),bt.has(r)||(bt.add(r),e.update(()=>{!function(t,e){const n=x(t);if(!q(n)||!n.isAttached())return;const r=_();if(!S(r))return void e();const i=r.anchor,o=i.offset,s="element"===i.type&&d(n.getChildAtIndex(i.offset-1));let u=0;if(!s){const t=i.getNode();u=o+t.getPreviousSiblings().reduce((t,e)=>t+e.getTextContentSize(),0)}if(!e())return;if(s)return void i.getNode().select(o,o);n.getChildren().some(t=>{const e=l(t);if(e||d(t)){const n=t.getTextContentSize();if(e&&n>=u)return t.select(u,u),!0;u-=n}return!1})}(r,()=>{const e=x(r);if(!q(e)||!e.isAttached())return!1;const i=e.getLanguage()||n.defaultLanguage,o=n.$tokenize(e,i),s=function(t,e){let n=0;for(;n<t.length&&Nt(t[n],e[n]);)n++;const r=t.length,i=e.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!Nt(t[r-s],e[i-s])){s--;break}const l=n,u=r-s,c=e.slice(n,i-s);return{from:l,nodesForReplacement:c,to:u}}(e.getChildren(),o),{from:l,to:u,nodesForReplacement:c}=s;return!(l===u&&!c.length)&&(t.splice(l,u-l,c),!0)})},{onUpdate:()=>{bt.delete(r)},skipTransforms:!0}))}function Nt(t,e){return nt(t)&&nt(e)&&t.__text===e.__text&&t.__highlightType===e.__highlightType||u(t)&&u(e)||d(t)&&d(e)}function jt(t){if(!S(t))return!1;const e=t.anchor.getNode(),n=q(e)?e:e.getParent(),r=t.focus.getNode(),i=q(r)?r:r.getParent();return q(n)&&n.is(i)}function wt(t){const e=t.getNodes(),n=[];if(1===e.length&&q(e[0]))return n;let r=[];for(let t=0;t<e.length;t++){const i=e[t];nt(i)||u(i)||d(i)||D(169),d(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const e=t.isBackward()?t.anchor:t.focus,i=v(r[0].getKey(),0,"text");e.is(i)||n.push(r)}return n}function kt(t){const e=_();if(!S(e)||!jt(e))return!1;const n=wt(e),r=n.length;if(0===r&&e.isCollapsed())return t===T&&e.insertNodes([c()]),!0;if(0===r&&t===T&&"\n"===e.getTextContent()){const t=c(),n=g(),r=e.isBackward()?"previous":"next";return e.insertNodes([t,n]),N(j(w(k(t,"next",0),A(h(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=it(n)),t===T){const t=c();if(n.insertBefore(t),0===i){const r=e.isBackward()?"focus":"anchor",i=v(n.getKey(),0,"text");e[r].is(i)&&e[r].set(t.getKey(),0,"text")}}else u(n)&&n.remove()}}return!0}function At(t,e){const n=_();if(!S(n))return!1;const{anchor:r,focus:i}=n,o=r.offset,s=i.offset,l=r.getNode(),c=i.getNode(),g=t===P;if(!jt(n)||!nt(l)&&!u(l)||!nt(c)&&!u(c))return!1;if(!e.altKey){if(n.isCollapsed()){const t=l.getParentOrThrow();if(g&&0===o&&null===l.getPreviousSibling()){if(null===t.getPreviousSibling())return t.selectPrevious(),e.preventDefault(),!0}else if(!g&&o===l.getTextContentSize()&&null===l.getNextSibling()){if(null===t.getNextSibling())return t.selectNext(),e.preventDefault(),!0}}return!1}let a,p;if(l.isBefore(c)?(a=it(l),p=ot(c)):(a=it(c),p=ot(l)),null==a||null==p)return!1;const f=a.getNodesBetween(p);for(let t=0;t<f.length;t++){const e=f[t];if(!nt(e)&&!u(e)&&!d(e))return!1}e.preventDefault(),e.stopPropagation();const h=g?a.getPreviousSibling():p.getNextSibling();if(!d(h))return!0;const m=g?h.getPreviousSibling():h.getNextSibling();if(null==m)return!0;const y=nt(m)||u(m)||d(m)?g?it(m):ot(m):null;let x=null!=y?y:m;return h.remove(),f.forEach(t=>t.remove()),t===P?(f.forEach(t=>x.insertBefore(t)),x.insertBefore(h)):(x.insertAfter(h),x=h,f.forEach(t=>{x.insertAfter(t),x=t})),n.setTextNodeRange(l,o,c,s),!0}function Pt(t,e){const n=_();if(!S(n))return!1;const{anchor:r,focus:i}=n,o=r.getNode(),s=i.getNode(),l=t===L;if(!jt(n)||!nt(o)&&!u(o)||!nt(s)&&!u(s))return!1;if(l){const t=st(s,i.offset);if(null!==t){const{node:e,offset:r}=t;d(e)?e.selectNext(0,0):n.setTextNodeRange(e,r,e,r)}else s.getParentOrThrow().selectStart()}else{lt(s).select()}return e.preventDefault(),e.stopPropagation(),!0}function Lt(t,e){if(!t.hasNodes([$,Z]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==e&&(e=St);const n=[];return!0!==t._headless&&n.push(t.registerMutationListener($,e=>{t.update(()=>{for(const[n,r]of e)if("destroyed"!==r){const e=x(n);null!==e&&Tt(e,t)}})},{skipInitialization:!1})),n.push(t.registerNodeTransform($,n=>Ct(n,t,e)),t.registerNodeTransform(p,n=>vt(n,t,e)),t.registerNodeTransform(Z,n=>vt(n,t,e)),t.registerCommand(O,e=>{const n=function(t){const e=_();if(!S(e)||!jt(e))return null;const n=t?b:T,r=t?b:C,i=e.anchor,o=e.focus;if(i.is(o))return r;const s=wt(e);if(1!==s.length)return n;const l=s[0];let u,c;0===l.length&&D(285),e.isBackward()?(u=o,c=i):(u=i,c=o);const g=it(l[0]),a=ot(l[0]),p=v(g.getKey(),0,"text"),f=v(a.getKey(),a.getTextContentSize(),"text");return u.isBefore(p)||f.isBefore(c)?n:p.isBefore(u)||c.isBefore(f)?r:n}(e.shiftKey);return null!==n&&(e.preventDefault(),t.dispatchCommand(n,void 0),!0)},H),t.registerCommand(C,()=>!!jt(_())&&(z([c()]),!0),H),t.registerCommand(T,t=>kt(T),H),t.registerCommand(b,t=>kt(b),H),t.registerCommand(P,t=>{const e=_();if(!S(e))return!1;const{anchor:n}=e,r=n.getNode();return!!jt(e)&&(e.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&q(r.getParentOrThrow())?(t.preventDefault(),!0):At(P,t))},H),t.registerCommand(E,t=>{const e=_();if(!S(e))return!1;const{anchor:n}=e,r=n.getNode();return!!jt(e)&&(e.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&q(r.getParentOrThrow())?(t.preventDefault(),!0):At(E,t))},H),t.registerCommand(L,t=>Pt(L,t),H),t.registerCommand(B,t=>Pt(B,t),H)),i(...n)}const Ot=it,Ht=ot,zt=lt,Et=st;export{et as $createCodeHighlightNode,W as $createCodeNode,lt as $getEndOfCodeInLine,it as $getFirstCodeNodeOfLine,ot as $getLastCodeNodeOfLine,st as $getStartOfCodeInLine,nt as $isCodeHighlightNode,q as $isCodeNode,gt as CODE_LANGUAGE_FRIENDLY_NAME_MAP,at as CODE_LANGUAGE_MAP,ut as CodeExtension,Z as CodeHighlightNode,$ as CodeNode,F as DEFAULT_CODE_LANGUAGE,St as PrismTokenizer,dt as getCodeLanguageOptions,ht as getCodeLanguages,mt as getCodeThemeOptions,I as getDefaultCodeLanguage,zt as getEndOfCodeInLine,Ot as getFirstCodeNodeOfLine,ft as getLanguageFriendlyName,Ht as getLastCodeNodeOfLine,Et as getStartOfCodeInLine,pt as normalizeCodeLang,pt as normalizeCodeLanguage,Lt as registerCodeHighlighting};
package/package.json CHANGED
@@ -8,12 +8,12 @@
8
8
  "code"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.36.2-nightly.20250930.0",
11
+ "version": "0.36.2",
12
12
  "main": "LexicalCode.js",
13
13
  "types": "index.d.ts",
14
14
  "dependencies": {
15
- "@lexical/utils": "0.36.2-nightly.20250930.0",
16
- "lexical": "0.36.2-nightly.20250930.0",
15
+ "@lexical/utils": "0.36.2",
16
+ "lexical": "0.36.2",
17
17
  "prismjs": "^1.30.0"
18
18
  },
19
19
  "repository": {