@payloadcms/richtext-lexical 3.55.0-internal.92d1d86 → 3.55.0-internal.a030723
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.
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/index.js +1 -1
- package/dist/exports/client/index.js.map +3 -3
- package/dist/features/textState/feature.client.js +1 -3
- package/dist/features/textState/feature.client.js.map +1 -1
- package/dist/features/textState/feature.server.d.ts.map +1 -1
- package/dist/features/textState/feature.server.js +1 -3
- package/dist/features/textState/feature.server.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/dist/features/textState/i18n.d.ts +0 -3
- package/dist/features/textState/i18n.d.ts.map +0 -1
- package/dist/features/textState/i18n.js +0 -108
- package/dist/features/textState/i18n.js.map +0 -1
|
@@ -31,7 +31,7 @@ ${e.map(Bc).join(`
|
|
|
31
31
|
`)}
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
`},[t,e]),m=ve((k,_)=>{o(x=>{let N=e.length-1,M=e[N];if(M&&M.name===k){if(k==="type")return[...e.slice(0,N),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,N),{...M,count:M.count+1}]}return[...x,{name:k,count:1,value:_}]})},[e,o]);mn(()=>{let k=x=>{if(!r)return;let N=x.key;Hc(x)?m("selectAll",""):fn.has(N)?m("press",x.key):[...N].length>1?m("keydown",x.key):m("type",x.key)},_=x=>{if(!r)return;let N=x.key;!fn.has(N)&&[...N].length>1&&m("keyup",x.key)};return t.registerRootListener((x,N)=>{N!==null&&(N.removeEventListener("keydown",k),N.removeEventListener("keyup",_)),x!==null&&(x.addEventListener("keydown",k),x.addEventListener("keyup",_))})},[t,r,m]),mn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Ao(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Ao(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:x,editorState:N})=>{if(!r)return;let M=N._selection,O=u.current,$=c.current;if(O!==M){if(x.size===0&&_.size===0&&!$){let w=Do(t._window);if(w&&(w.anchorNode==null||w.focusNode==null))return}u.current=M}c.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Ao(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=ve(k=>{r||(k.update(()=>{let _=$c();_.clear();let x=Oc();_.append(Ac().append(x)),x.select()}),o([])),n(_=>!_)},[r]),h=ve(()=>{if(!r)return;let k=Do(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:x,focusNode:N,focusOffset:M}=jc(k),O=a().getRootElement(),$;_!==null&&($=pn(_,O));let I;N!==null&&(I=pn(N,O)),m("snapshot",{anchorNode:_,anchorOffset:x,anchorPath:$,focusNode:N,focusOffset:M,focusPath:I})},[m,r,a]),g=ve(()=>{Fc(p())},[p]),b=ve(()=>{Pc("test.js",p())},[p]);return[Me("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:k=>{f(a()),k.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Me("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{g(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{b(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Me("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var gn=()=>{let t=Mc(3),[e]=Dc(),[o,r]=Uc(e),n;return t[0]!==o||t[1]!==r?(n=$o(hn.Fragment,{children:[Me("p",{children:"HI"}),o,r,Me("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Gc=y({plugins:[{Component:gn,position:"bottom"}]});import{c as Wc}from"react/compiler-runtime";import{jsx as Vc}from"react/jsx-runtime";import{useLexicalComposerContext as Kc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Jc}from"@lexical/react/LexicalTreeView.js";import"react";var xn=()=>{let t=Wc(2),[e]=Kc(),o;return t[0]!==e?(o=Vc(Jc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Xc=y({plugins:[{Component:xn,position:"bottom"}]});import{$isTableSelection as zc}from"@lexical/table";import{$isRangeSelection as Zc,FORMAT_TEXT_COMMAND as Yc}from"lexical";import{jsx as Cn}from"react/jsx-runtime";import"react";var bn=()=>Cn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Cn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var Y=t=>({type:"buttons",items:t,key:"format",order:40});var kn={type:"text-format",format:["bold","italic"],tag:"***"},_n={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},Tn={type:"text-format",format:["bold"],tag:"**"},wn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var En=[Y([{ChildComponent:bn,isActive:({selection:t})=>Zc(t)||zc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Yc,"bold")},order:1}])],qc=y(({featureProviderMap:t})=>{let e=[Tn,wn];return t.get("italic")&&e.push(_n,kn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:En},toolbarInline:{groups:En}}});import{$isTableSelection as eu}from"@lexical/table";import{$isRangeSelection as tu,FORMAT_TEXT_COMMAND as ou}from"lexical";import{jsx as Nn,jsxs as Qc}from"react/jsx-runtime";import"react";var Sn=()=>Qc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Nn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Nn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var Ln={type:"text-format",format:["code"],tag:"`"};var yn=[Y([{ChildComponent:Sn,isActive:({selection:t})=>tu(t)||eu(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(ou,"code")},order:7}])],ru=y({enableFormats:["code"],markdownTransformers:[Ln],toolbarFixed:{groups:yn},toolbarInline:{groups:yn}});import{$isTableSelection as nu}from"@lexical/table";import{$isRangeSelection as lu,FORMAT_TEXT_COMMAND as iu}from"lexical";import{jsx as In}from"react/jsx-runtime";import"react";var Rn=()=>In("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:In("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var vn={type:"text-format",format:["italic"],tag:"*"},Mn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Dn=[Y([{ChildComponent:Rn,isActive:({selection:t})=>lu(t)||nu(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(iu,"italic")},order:2}])],su=y({enableFormats:["italic"],markdownTransformers:[vn,Mn],toolbarFixed:{groups:Dn},toolbarInline:{groups:Dn}});import{$isTableSelection as cu}from"@lexical/table";import{$isRangeSelection as uu,FORMAT_TEXT_COMMAND as du}from"lexical";import{jsx as An,jsxs as au}from"react/jsx-runtime";import"react";var On=()=>au("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[An("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),An("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var $n={type:"text-format",format:["strikethrough"],tag:"~~"};var Fn=[Y([{ChildComponent:On,isActive:({selection:t})=>uu(t)||cu(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(du,"strikethrough")},order:4}])],mu=y({enableFormats:["strikethrough"],markdownTransformers:[$n],toolbarFixed:{groups:Fn},toolbarInline:{groups:Fn}});import{$isTableSelection as pu}from"@lexical/table";import{$isRangeSelection as fu,FORMAT_TEXT_COMMAND as hu}from"lexical";import{jsx as Pn}from"react/jsx-runtime";import"react";var Bn=()=>Pn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var Hn=[Y([{ChildComponent:Bn,isActive:({selection:t})=>fu(t)||pu(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(hu,"subscript")},order:5}])],gu=y({enableFormats:["subscript"],toolbarFixed:{groups:Hn},toolbarInline:{groups:Hn}});import{$isTableSelection as xu}from"@lexical/table";import{$isRangeSelection as Cu,FORMAT_TEXT_COMMAND as bu}from"lexical";import{jsx as jn}from"react/jsx-runtime";import"react";var Un=()=>jn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:jn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Gn=[Y([{ChildComponent:Un,isActive:({selection:t})=>Cu(t)||xu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(bu,"superscript")},order:6}])],ku=y({enableFormats:["superscript"],toolbarFixed:{groups:Gn},toolbarInline:{groups:Gn}});import{$isTableSelection as Tu}from"@lexical/table";import{$isRangeSelection as wu,FORMAT_TEXT_COMMAND as Eu}from"lexical";import{jsx as Wn,jsxs as _u}from"react/jsx-runtime";import"react";var Vn=()=>_u("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Wn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Wn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Kn=[Y([{ChildComponent:Vn,isActive:({selection:t})=>wu(t)||Tu(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Eu,"underline")},order:3}])],Nu=y({enableFormats:["underline"],toolbarFixed:{groups:Kn},toolbarInline:{groups:Kn}});import{jsx as Bo}from"react/jsx-runtime";import{jsx as Su}from"react/jsx-runtime";function Lu(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Jt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Lu(o),r])):{};return Su("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as yu}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Iu}from"@lexical/selection";import{$getNodeByKey as Ru,$getState as vu,$setState as Mu,createState as Du,TextNode as Au}from"lexical";import{useEffect as Ou}from"react";var Fo=new Map;function Jn(t){for(let e in t){let o=t[e],r=Du(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Fo.set(e,{stateConfig:r,stateValues:o})}}function Po(t,e,o){t.update(()=>{Iu(r=>{let n=Fo.get(e);if(!n)throw new Error(`State config for ${e} not found`);Mu(r,n.stateConfig,o)})})}function Xn(){let[t]=yu();return Ou(()=>t.registerMutationListener(Au,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Ru(o),l=t.getElementByKey(o);if(!n||!l)continue;let i=Object.create(null);Fo.forEach((s,u)=>{let c=vu(n,s.stateConfig);if(!c){delete l.dataset[u];return}l.dataset[u]=c;let d=s.stateValues[c]?.css;d&&Object.assign(i,d)}),l.style.cssText="",Object.assign(l.style,i)}})}),[t]),null}var zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Bo(Jt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Po(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Bo(Jt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Bo(Jt,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let n in t.state)Po(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},$u=y(({props:t})=>(Jn(t.state),{plugins:[{Component:Xn,position:"normal"}],toolbarFixed:{groups:zn(t)},toolbarInline:{groups:zn(t)}}));import{$createHeadingNode as Hu,$isHeadingNode as cl,HeadingNode as ju}from"@lexical/rich-text";import{$setBlocksType as Uu}from"@lexical/selection";import{$getSelection as Gu,$isRangeSelection as Wu}from"lexical";import{jsx as Zn}from"react/jsx-runtime";import"react";var Yn=()=>Zn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Zn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as qn}from"react/jsx-runtime";import"react";var Qn=()=>qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as el}from"react/jsx-runtime";import"react";var tl=()=>el("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:el("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as ol}from"react/jsx-runtime";import"react";var rl=()=>ol("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ol("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as nl}from"react/jsx-runtime";import"react";var ll=()=>nl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:nl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as il}from"react/jsx-runtime";import"react";var sl=()=>il("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:il("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Fu,$isHeadingNode as Pu,HeadingNode as Bu}from"@lexical/rich-text";var Ho=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var al=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Bu],export:(n,l)=>{if(!Pu(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Ho(n=>{let l="h"+n[1]?.length;return Fu(l)})}};var ul=t=>{let e=Gu();Uu(e,()=>Hu(t))},dl={h1:Yn,h2:Qn,h3:tl,h4:rl,h5:ll,h6:sl},Vu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[Q(e.map((r,n)=>({ChildComponent:dl[r],isActive:({selection:l})=>{if(!Wu(l))return!1;for(let i of l.getNodes()){if(cl(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(cl(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{ul(r)})},order:n+2})))];return{markdownTransformers:[al(e)],nodes:[ju],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[Z(e.map(r=>({Icon:dl[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{ul(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as sd}from"lexical";import{jsx as ml}from"react/jsx-runtime";import"react";var jo=()=>ml("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ml("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as pl,jsxs as Ku}from"react/jsx-runtime";import"react";var fl=()=>Ku("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[pl("path",{d:"M5 10h10",stroke:"currentColor"}),pl("path",{d:"M10 15V5",stroke:"currentColor"})]});var fe=t=>({type:"dropdown",ChildComponent:fl,items:t,key:"add",order:10});import{addClassNamesToElement as Ju}from"@lexical/utils";import{$applyNodeReplacement as Xu,createCommand as zu,DecoratorNode as Zu}from"lexical";var dt=zu("INSERT_HORIZONTAL_RULE_COMMAND"),ut=class extends Zu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Yu,priority:0})}}static importJSON(e){return hl()}createDOM(e){let o=document.createElement("hr");return Ju(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
|
34
|
+
`},[t,e]),m=ve((k,_)=>{o(x=>{let N=e.length-1,M=e[N];if(M&&M.name===k){if(k==="type")return[...e.slice(0,N),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,N),{...M,count:M.count+1}]}return[...x,{name:k,count:1,value:_}]})},[e,o]);mn(()=>{let k=x=>{if(!r)return;let N=x.key;Hc(x)?m("selectAll",""):fn.has(N)?m("press",x.key):[...N].length>1?m("keydown",x.key):m("type",x.key)},_=x=>{if(!r)return;let N=x.key;!fn.has(N)&&[...N].length>1&&m("keyup",x.key)};return t.registerRootListener((x,N)=>{N!==null&&(N.removeEventListener("keydown",k),N.removeEventListener("keyup",_)),x!==null&&(x.addEventListener("keydown",k),x.addEventListener("keyup",_))})},[t,r,m]),mn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Ao(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Ao(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:x,editorState:N})=>{if(!r)return;let M=N._selection,O=u.current,$=c.current;if(O!==M){if(x.size===0&&_.size===0&&!$){let w=Do(t._window);if(w&&(w.anchorNode==null||w.focusNode==null))return}u.current=M}c.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Ao(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=ve(k=>{r||(k.update(()=>{let _=$c();_.clear();let x=Oc();_.append(Ac().append(x)),x.select()}),o([])),n(_=>!_)},[r]),h=ve(()=>{if(!r)return;let k=Do(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:x,focusNode:N,focusOffset:M}=jc(k),O=a().getRootElement(),$;_!==null&&($=pn(_,O));let I;N!==null&&(I=pn(N,O)),m("snapshot",{anchorNode:_,anchorOffset:x,anchorPath:$,focusNode:N,focusOffset:M,focusPath:I})},[m,r,a]),g=ve(()=>{Fc(p())},[p]),b=ve(()=>{Pc("test.js",p())},[p]);return[Me("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:k=>{f(a()),k.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Me("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{g(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Me("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{b(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Me("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var gn=()=>{let t=Mc(3),[e]=Dc(),[o,r]=Uc(e),n;return t[0]!==o||t[1]!==r?(n=$o(hn.Fragment,{children:[Me("p",{children:"HI"}),o,r,Me("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var Gc=y({plugins:[{Component:gn,position:"bottom"}]});import{c as Wc}from"react/compiler-runtime";import{jsx as Vc}from"react/jsx-runtime";import{useLexicalComposerContext as Kc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Jc}from"@lexical/react/LexicalTreeView.js";import"react";var xn=()=>{let t=Wc(2),[e]=Kc(),o;return t[0]!==e?(o=Vc(Jc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Xc=y({plugins:[{Component:xn,position:"bottom"}]});import{$isTableSelection as zc}from"@lexical/table";import{$isRangeSelection as Zc,FORMAT_TEXT_COMMAND as Yc}from"lexical";import{jsx as Cn}from"react/jsx-runtime";import"react";var bn=()=>Cn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Cn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var Y=t=>({type:"buttons",items:t,key:"format",order:40});var kn={type:"text-format",format:["bold","italic"],tag:"***"},_n={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},Tn={type:"text-format",format:["bold"],tag:"**"},wn={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var En=[Y([{ChildComponent:bn,isActive:({selection:t})=>Zc(t)||zc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Yc,"bold")},order:1}])],qc=y(({featureProviderMap:t})=>{let e=[Tn,wn];return t.get("italic")&&e.push(_n,kn),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:En},toolbarInline:{groups:En}}});import{$isTableSelection as eu}from"@lexical/table";import{$isRangeSelection as tu,FORMAT_TEXT_COMMAND as ou}from"lexical";import{jsx as Nn,jsxs as Qc}from"react/jsx-runtime";import"react";var Sn=()=>Qc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Nn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Nn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var Ln={type:"text-format",format:["code"],tag:"`"};var yn=[Y([{ChildComponent:Sn,isActive:({selection:t})=>tu(t)||eu(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(ou,"code")},order:7}])],ru=y({enableFormats:["code"],markdownTransformers:[Ln],toolbarFixed:{groups:yn},toolbarInline:{groups:yn}});import{$isTableSelection as nu}from"@lexical/table";import{$isRangeSelection as lu,FORMAT_TEXT_COMMAND as iu}from"lexical";import{jsx as In}from"react/jsx-runtime";import"react";var Rn=()=>In("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:In("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var vn={type:"text-format",format:["italic"],tag:"*"},Mn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Dn=[Y([{ChildComponent:Rn,isActive:({selection:t})=>lu(t)||nu(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(iu,"italic")},order:2}])],su=y({enableFormats:["italic"],markdownTransformers:[vn,Mn],toolbarFixed:{groups:Dn},toolbarInline:{groups:Dn}});import{$isTableSelection as cu}from"@lexical/table";import{$isRangeSelection as uu,FORMAT_TEXT_COMMAND as du}from"lexical";import{jsx as An,jsxs as au}from"react/jsx-runtime";import"react";var On=()=>au("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[An("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),An("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var $n={type:"text-format",format:["strikethrough"],tag:"~~"};var Fn=[Y([{ChildComponent:On,isActive:({selection:t})=>uu(t)||cu(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(du,"strikethrough")},order:4}])],mu=y({enableFormats:["strikethrough"],markdownTransformers:[$n],toolbarFixed:{groups:Fn},toolbarInline:{groups:Fn}});import{$isTableSelection as pu}from"@lexical/table";import{$isRangeSelection as fu,FORMAT_TEXT_COMMAND as hu}from"lexical";import{jsx as Pn}from"react/jsx-runtime";import"react";var Bn=()=>Pn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Pn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var Hn=[Y([{ChildComponent:Bn,isActive:({selection:t})=>fu(t)||pu(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(hu,"subscript")},order:5}])],gu=y({enableFormats:["subscript"],toolbarFixed:{groups:Hn},toolbarInline:{groups:Hn}});import{$isTableSelection as xu}from"@lexical/table";import{$isRangeSelection as Cu,FORMAT_TEXT_COMMAND as bu}from"lexical";import{jsx as jn}from"react/jsx-runtime";import"react";var Un=()=>jn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:jn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Gn=[Y([{ChildComponent:Un,isActive:({selection:t})=>Cu(t)||xu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(bu,"superscript")},order:6}])],ku=y({enableFormats:["superscript"],toolbarFixed:{groups:Gn},toolbarInline:{groups:Gn}});import{$isTableSelection as Tu}from"@lexical/table";import{$isRangeSelection as wu,FORMAT_TEXT_COMMAND as Eu}from"lexical";import{jsx as Wn,jsxs as _u}from"react/jsx-runtime";import"react";var Vn=()=>_u("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Wn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Wn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Kn=[Y([{ChildComponent:Vn,isActive:({selection:t})=>wu(t)||Tu(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Eu,"underline")},order:3}])],Nu=y({enableFormats:["underline"],toolbarFixed:{groups:Kn},toolbarInline:{groups:Kn}});import{jsx as Bo}from"react/jsx-runtime";import{jsx as Su}from"react/jsx-runtime";function Lu(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Jt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Lu(o),r])):{};return Su("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as yu}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Iu}from"@lexical/selection";import{$getNodeByKey as Ru,$getState as vu,$setState as Mu,createState as Du,TextNode as Au}from"lexical";import{useEffect as Ou}from"react";var Fo=new Map;function Jn(t){for(let e in t){let o=t[e],r=Du(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Fo.set(e,{stateConfig:r,stateValues:o})}}function Po(t,e,o){t.update(()=>{Iu(r=>{let n=Fo.get(e);if(!n)throw new Error(`State config for ${e} not found`);Mu(r,n.stateConfig,o)})})}function Xn(){let[t]=yu();return Ou(()=>t.registerMutationListener(Au,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=Ru(o),l=t.getElementByKey(o);if(!n||!l)continue;let i=Object.create(null);Fo.forEach((s,u)=>{let c=vu(n,s.stateConfig);if(!c){delete l.dataset[u];return}l.dataset[u]=c;let d=s.stateValues[c]?.css;d&&Object.assign(i,d)}),l.style.cssText="",Object.assign(l.style,i)}})}),[t]),null}var zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Bo(Jt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Po(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Bo(Jt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Bo(Jt,{}),key:"clear-style",label:"Default style",onSelect:({editor:r})=>{for(let n in t.state)Po(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},$u=y(({props:t})=>(Jn(t.state),{plugins:[{Component:Xn,position:"normal"}],toolbarFixed:{groups:zn(t)},toolbarInline:{groups:zn(t)}}));import{$createHeadingNode as Hu,$isHeadingNode as cl,HeadingNode as ju}from"@lexical/rich-text";import{$setBlocksType as Uu}from"@lexical/selection";import{$getSelection as Gu,$isRangeSelection as Wu}from"lexical";import{jsx as Zn}from"react/jsx-runtime";import"react";var Yn=()=>Zn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Zn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as qn}from"react/jsx-runtime";import"react";var Qn=()=>qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as el}from"react/jsx-runtime";import"react";var tl=()=>el("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:el("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as ol}from"react/jsx-runtime";import"react";var rl=()=>ol("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ol("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as nl}from"react/jsx-runtime";import"react";var ll=()=>nl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:nl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as il}from"react/jsx-runtime";import"react";var sl=()=>il("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:il("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Fu,$isHeadingNode as Pu,HeadingNode as Bu}from"@lexical/rich-text";var Ho=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var al=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Bu],export:(n,l)=>{if(!Pu(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Ho(n=>{let l="h"+n[1]?.length;return Fu(l)})}};var ul=t=>{let e=Gu();Uu(e,()=>Hu(t))},dl={h1:Yn,h2:Qn,h3:tl,h4:rl,h5:ll,h6:sl},Vu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[Q(e.map((r,n)=>({ChildComponent:dl[r],isActive:({selection:l})=>{if(!Wu(l))return!1;for(let i of l.getNodes()){if(cl(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(cl(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{ul(r)})},order:n+2})))];return{markdownTransformers:[al(e)],nodes:[ju],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[Z(e.map(r=>({Icon:dl[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{ul(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as sd}from"lexical";import{jsx as ml}from"react/jsx-runtime";import"react";var jo=()=>ml("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ml("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as pl,jsxs as Ku}from"react/jsx-runtime";import"react";var fl=()=>Ku("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[pl("path",{d:"M5 10h10",stroke:"currentColor"}),pl("path",{d:"M10 15V5",stroke:"currentColor"})]});var fe=t=>({type:"dropdown",ChildComponent:fl,items:t,key:"add",order:10});import{addClassNamesToElement as Ju}from"@lexical/utils";import{$applyNodeReplacement as Xu,createCommand as zu,DecoratorNode as Zu}from"lexical";var dt=zu("INSERT_HORIZONTAL_RULE_COMMAND"),ut=class extends Zu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:Yu,priority:0})}}static importJSON(e){return hl()}createDOM(e){let o=document.createElement("hr");return Ju(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
|
|
35
35
|
`}isInline(){return!1}updateDOM(){return!1}};function Yu(){return{node:hl()}}function hl(){return Xu(new ut)}import{$applyNodeReplacement as qu}from"lexical";import"react";var Se=class extends ut{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return mt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function mt(){return qu(new Se)}function Xt(t){return t instanceof Se}var gl={type:"element",dependencies:[Se],export:(t,e)=>Xt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=mt();e&&t.replace(e)}};import{c as Qu}from"react/compiler-runtime";import{useLexicalComposerContext as ed}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as td}from"@lexical/utils";import{$getSelection as od,$isRangeSelection as rd,COMMAND_PRIORITY_EDITOR as nd}from"lexical";import{useEffect as ld}from"react";var xl=()=>{let t=Qu(3),[e]=ed(),o,r;return t[0]!==e?(o=()=>e.registerCommand(dt,id,nd),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),ld(o,r),null};function id(t){let e=od();if(!rd(e))return!1;if(e.focus.getNode()!==null){let r=mt();td(r)}return!0}var ad=y({markdownTransformers:[gl],nodes:[Se],plugins:[{Component:xl,position:"normal"}],slashMenu:{groups:[Z([{Icon:jo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(dt,void 0)}}])]},toolbarFixed:{groups:[fe([{ChildComponent:jo,isActive:({selection:t})=>{if(!sd(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Xt(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(dt,void 0)}}])]}});import{$findMatchingParent as Ll}from"@lexical/utils";import{$isElementNode as _d,INDENT_CONTENT_COMMAND as Td,OUTDENT_CONTENT_COMMAND as wd}from"lexical";import{jsx as zt,jsxs as cd}from"react/jsx-runtime";import"react";var Cl=()=>cd("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[zt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),zt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Zt,jsxs as ud}from"react/jsx-runtime";import"react";var bl=()=>ud("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Zt("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});import{jsx as dd}from"react/jsx-runtime";import{useLexicalComposerContext as md}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as pd}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as fd,mergeRegister as kl}from"@lexical/utils";import{$getSelection as hd,$isElementNode as El,$isRangeSelection as gd,COMMAND_PRIORITY_LOW as _l,INDENT_CONTENT_COMMAND as Tl,KEY_TAB_COMMAND as xd,OUTDENT_CONTENT_COMMAND as Cd,TabNode as bd}from"lexical";import{useEffect as wl}from"react";var Nl=({clientProps:t})=>{let[e]=md(),{disabledNodes:o,disableTabNode:r}=t;return wl(()=>{if(!(!e||!o?.length))return kl(e.registerCommand(Tl,()=>kd(n=>{if(!o.includes(n.getType())){let l=n.getIndent();n.setIndent(l+1)}}),_l),e.registerUpdateListener(({dirtyElements:n,editorState:l})=>{e.update(()=>{for(let[i]of n){let s=l._nodeMap.get(i);El(s)&&o.includes(s.getType())&&s.getIndent()>0&&s.setIndent(0)}})}))},[e,o]),wl(()=>{if(!(!e||!r))return kl(e.registerCommand(xd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?Cd:Tl,void 0)),_l),e.registerNodeTransform(bd,n=>{n.remove()}))},[e,r]),dd(pd,{})};function kd(t){let e=hd();if(!gd(e))return!1;let o=new Set,r=e.getNodes();for(let n=0;n<r.length;n++){let l=r[n],i=l.getKey();if(o.has(i))continue;let s=fd(l,c=>El(c)&&!c.isInline());if(s===null)continue;let u=s.getKey();s.canIndent()&&!o.has(u)&&(o.add(u),t(s))}return o.size>0}var Sl=t=>({type:"buttons",items:t,key:"indent",order:35});var yl=({disabledNodes:t})=>[Sl([{ChildComponent:Cl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Il(n)&&n.getIndent()>0;return o.some(n=>r(n)||!!Ll(n,r))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(wd,void 0)},order:1},{ChildComponent:bl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Il(n)&&!(t??[]).includes(n.getType());return o.some(n=>r(n)||!!Ll(n,r))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Td,void 0)},order:2}])],Ed=y(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Nl,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:yl({disabledNodes:e})},toolbarInline:{groups:yl({disabledNodes:e})}}}),Il=t=>_d(t)&&t.canIndent();import{$findMatchingParent as $m}from"@lexical/utils";import{$getSelection as Zo,$isRangeSelection as ii}from"lexical";import{jsx as Rl}from"react/jsx-runtime";import"react";var vl=()=>Rl("svg",{"aria-hidden":"true",className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rl("path",{d:"M8.5 11.5L11.5 8.5M8.5 7L9.625 5.875C10.868 4.633 12.882 4.633 14.125 5.875C15.368 7.118 15.368 9.133 14.125 10.375L13 11.5M7 8.5L5.746 9.754C4.56 10.94 4.519 12.85 5.652 14.087C6.814 15.354 8.78 15.449 10.058 14.298L11.5 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});import{$isAtNodeEnd as Ml}from"@lexical/selection";function Ve(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?Ml(o)?r:n:Ml(e)?r:n}var Uo=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Od}from"lexical";import{addClassNamesToElement as Nd,isHTMLAnchorElement as Sd}from"@lexical/utils";import Vo from"bson-objectid";import{$applyNodeReplacement as Ld,$createTextNode as Dl,$getSelection as yd,$isElementNode as Al,$isRangeSelection as Wo,createCommand as Id,ElementNode as Rd}from"lexical";var vd=new Set(["http:","https:","mailto:","sms:","tel:"]),ee=class t extends Rd{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:r}){super(r),this.__fields=o,this.__id=e}static clone(e){return new t({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Md,priority:1})}}static importJSON(e){let o=he({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),e.version===2&&!e.id&&(e.id=new Vo.default().toHexString(),e.version=3),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener")),Nd(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e,version:3},r=this.getID();return r&&(o.id=r),o}extractWithChild(e,o,r){if(!Wo(o))return!1;let n=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Al(r)){let n=he({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!vd.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,r){let n=this.__fields?.url,l=this.__fields?.newTab;return n!=null&&n!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=n),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Go(o.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function Md(t){let e=null;if(Sd(t)){let o=t.textContent;o!==null&&o!==""&&(e=he({id:new Vo.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function he({id:t,fields:e}){return Ld(new ee({id:t??new Vo.default().toHexString(),fields:e}))}function J(t){return t instanceof ee}var ae=Id("TOGGLE_LINK_COMMAND");function Ko(t){let e=yd();if(!Wo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Wo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let i=l.getParent();J(i)&&(i.getChildren().forEach(u=>{i.insertBefore(u)}),i.remove())});return}if(o?.length===1){let l=o[0],i=J(l)?l:Dd(l);if(i!==null){i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Dl(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(l=>{let i=l.getParent();if(!(i===n||i===null||Al(l)&&!l.isInline())){if(J(i)){n=i,i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Dl(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}if(i.is(r)||(r=i,n=he({fields:t.fields}),J(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),J(l)){if(l.is(n))return;if(n!==null){let s=l.getChildren();n.append(...s)}l.remove();return}n!==null&&n.append(l)}})}function Dd(t){return Ad(t,e=>J(e))}function Ad(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Go(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let l=new RegExp(o,"g");n=n.replace(l,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let l=new RegExp(o,"g");r=n.replace(l,"").trim()}return r}var Ol={type:"text-match",dependencies:[ee],export:(t,e)=>{if(!J(t))return null;let o=t,{url:r}=o.getFields();return`[${e(o)}](${r})`},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(t,e)=>{let[,o,r]=e,n=he({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),l=Od(o);return l.setFormat(t.getFormat()),n.append(l),t.replace(n),l},trigger:")"};import{$applyNodeReplacement as $d,$isElementNode as Fd}from"lexical";var ge=class t extends ee{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let o=pt({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),o}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:2}}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Fd(r)){let n=pt({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function pt({fields:t}){return $d(new ge({id:"",fields:t}))}function xe(t){return t instanceof ge}import{c as Pd}from"react/compiler-runtime";import{useLexicalComposerContext as Bd}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Hd}from"@lexical/utils";import{$createTextNode as $l,$getSelection as jd,$isElementNode as Pl,$isLineBreakNode as Bl,$isNodeSelection as Ud,$isRangeSelection as Gd,$isTextNode as ft,TextNode as Wd}from"lexical";import{useEffect as Vd}from"react";function Fl(t,e=o=>o){return o=>{let r=t.exec(o);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Hl(t,e){for(let o of e){let r=o(t);if(r!=null)return r}return null}var Kd=/[.,;\s]/;function qt(t){return t!==void 0&&Kd.test(t)}function jl(t){return qt(t[t.length-1])}function Xo(t){return qt(t[0])}function Jd(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Ul(t){let e=t.getPreviousSibling();return Pl(e)&&(e=e.getLastDescendant()),e===null||Bl(e)||ft(e)&&jl(e.getTextContent())}function Gl(t){let e=t.getNextSibling();return Pl(e)&&(e=e.getFirstDescendant()),e===null||Bl(e)||ft(e)&&Xo(e.getTextContent())}function Xd(t,e,o,r){return(t>0?qt(o[t-1]):Ul(r[0]))?e<o.length?qt(o[e]):Gl(r[r.length-1]):!1}function zd(t,e,o){let r=[],n=[],l=[],i=0,s=0,u=[...t];for(;u.length>0;){let c=u[0],a=c.getTextContent().length,p=s;s+a<=e?(r.push(c),i+=a):p>=o?l.push(c):n.push(c),s+=a,u.shift()}return[i,r,n,l]}function Zd(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},l=pt({fields:n});if(t.length===1){let i=t[0],s;if(e===0?[s]=i.splitText(o):[,s]=i.splitText(e,o),s){let u=$l(r.text);u.setFormat(s.getFormat()),u.setDetail(s.getDetail()),u.setStyle(s.getStyle()),l.append(u),s.replace(l)}return i}else if(t.length>1){let i=t[0],s=i.getTextContent().length,u;e===0?u=i:[,u]=i.splitText(e);let c=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=s,h=s+m;if(f<o)if(h<=o)c.push(a);else{let[g,b]=a.splitText(o-f);g&&c.push(g),d=b}s+=m}),u){let a=jd(),p=a?a.getNodes().find(ft):void 0,m=$l(u.getTextContent());return m.setFormat(u.getFormat()),m.setDetail(u.getDetail()),m.setStyle(u.getStyle()),l.append(m,...c),p&&p===u&&(Gd(a)?m.select(a.anchor.offset,a.focus.offset):Ud(a)&&m.select(0,m.getTextContent().length)),u.replace(l),d}}}function Yd(t,e,o){let r=[...t],n=r.map(u=>u.getTextContent()).join(""),l=n,i,s=0;for(;(i=Hl(l,e))!=null&&i!==null;){let u=i.index,c=i.length,d=u+c;if(Xd(s+u,s+d,n,r)){let[p,,m,f]=zd(r,s+u,s+d),h=s+u-p,g=s+d-p,b=Zd(m,h,g,i);r=b?[b,...f]:f,o(i.url,null),s=0}else s+=d;l=l.substring(d)}}function Jo(t,e,o){let r=t.getChildren(),n=r.length;for(let u=0;u<n;u++){let c=r[u];if(!ft(c)||!c.isSimpleText()){Yt(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),i=Hl(l,e);if(i===null||i.text!==l){Yt(t),o(null,t.getFields()?.url??null);return}if(!Ul(t)||!Gl(t)){Yt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==i?.url){let u=t.getFields();u.url=i?.url,t.setFields(u),o(i.url,s??null)}}function qd(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(xe(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Xo(l)||Jd(l,i))&&(r.append(t),Jo(r,e,o),o(null,r.getFields()?.url??null))}xe(n)&&!jl(l)&&(Yt(n),Jo(n,e,o),o(null,n.getFields()?.url??null))}function Yt(t){let e=t.getChildren(),o=e.length;for(let r=o-1;r>=0;r--)t.insertAfter(e[r]);return t.remove(),e.map(r=>r.getLatest())}function Qd(t){let e=[t],o=t.getNextSibling();for(;o!==null&&ft(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function em(t,e,o){let r=Pd(5),n,l;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([ge]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let i=(s,u)=>{o?.(s,u)};return Hd(t.registerNodeTransform(Wd,s=>{let u=s.getParentOrThrow(),c=s.getPreviousSibling();if(xe(u))Jo(u,e,i);else if(!J(u)){if(s.isSimpleText()&&(Xo(s.getTextContent())||!xe(c))){let d=Qd(s);Yd(d,e,i)}qd(s,e,i)}}))},l=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=l):(n=r[3],l=r[4]),Vd(n,l)}var tm=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,om=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,rm=[Fl(tm,t=>t.startsWith("http")?t:`https://${t}`),Fl(om,t=>`mailto:${t}`)],Wl=()=>{let[t]=Bd();return em(t,rm),null};import{jsx as nm}from"react/jsx-runtime";import{ClickableLinkPlugin as lm}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Vl=()=>nm(lm,{});import{jsx as wm}from"react/jsx-runtime";import"react";import{createPortal as Em}from"react-dom";import{jsx as Ce,jsxs as ht,Fragment as sm}from"react/jsx-runtime";import{useLexicalComposerContext as am}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Kl,mergeRegister as Jl}from"@lexical/utils";import{getTranslation as zo}from"@payloadcms/translations";import{CloseMenuIcon as cm,EditIcon as um,ExternalLinkIcon as Xl,formatDrawerSlug as dm,useConfig as mm,useEditDepth as pm,useLocale as fm,useTranslation as hm}from"@payloadcms/ui";import{requests as gm}from"@payloadcms/ui/shared";import{$getSelection as zl,$isLineBreakNode as xm,$isRangeSelection as Zl,COMMAND_PRIORITY_HIGH as Cm,COMMAND_PRIORITY_LOW as Yl,getDOMSelection as bm,KEY_ESCAPE_COMMAND as km,SELECTION_CHANGE_COMMAND as _m}from"lexical";import ql,{useCallback as Ql,useEffect as to,useRef as Tm,useState as De}from"react";function Qt(t,e,o,r=10,n=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let i=e.getBoundingClientRect(),s=o.getBoundingClientRect(),u=l.getBoundingClientRect(),c=t.top-r,d=t.left-n;c<u.top&&(c+=i.height+t.height+r*2),d+i.width>u.right&&(d=u.right-i.width-n),c-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${c}px)`}import{createCommand as im}from"lexical";var eo=im("TOGGLE_LINK_WITH_MODAL_COMMAND");function ei(t){t.preventDefault()}function ti({anchorElem:t}){let[e]=am(),[o,r]=De(),n=Tm(null),[l,i]=De(null),[s,u]=De(null),{fieldProps:{schemaPath:c},uuid:d}=H(),{config:a,getEntityConfig:p}=mm(),{i18n:m,t:f}=hm(),[h,g]=De(),b=pm(),[T,v]=De(!1),[k,_]=De([]),x=fm(),[N,M]=De(!1),O=dm({slug:"lexical-rich-text-link-"+d,depth:b}),{toggleDrawer:$}=de(O),I=Ql(()=>{v(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),M(!1),i(null),u(null),_([]),g(void 0)},[v,i,u,_]),w=Ql(()=>{let C=zl(),E;if(!Zl(C)||!C){I();return}let R=Ve(C);E=e.getElementByKey(R.getKey())?.getBoundingClientRect();let L=Kl(R,J),D=C.getNodes().filter(X=>!xm(X)).find(X=>{let U=Kl(X,J);return L&&!L.is(U)||U&&!U.is(L)});if(L==null||D){I();return}r(L);let S=L.getFields(),F={...S,id:L.getID(),text:L.getTextContent()};if(S?.linkType==="custom")i(S?.url??null),u(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${S?.doc?.relationTo}/${S?.doc?.value}`);let X=S?.doc?.relationTo?p({collectionSlug:S?.doc?.relationTo}):void 0;if(!X)u(S?.label?String(S?.label):null),i(S?.url?String(S?.url):null);else{let U=typeof S.doc?.value=="object"?S.doc.value.id:S.doc?.value,Be=S.doc?.relationTo;if(!U||!Be)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let we=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");u(we),gm.get(`${a.serverURL}${a.routes.api}/${Be}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:x?.code}}).then(async ue=>{if(!ue.ok)throw new Error(`HTTP error! Status: ${ue.status}`);let Rt=await ue.json(),Ee=X?.admin?.useAsTitle||"id",vt=Rt[Ee],He=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${vt}`}).replace(/<[^>]*>?/g,"");u(He)}).catch(()=>{let ue=f("fields:linkedTo",{label:`${zo(X.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");u(ue)})}}g(F),v(!0),_(C?C?.getNodes():[]),xe(L)?M(!0):M(!1);let G=n.current,q=bm(e._window),{activeElement:te}=document;if(G===null)return;let It=e.getRootElement();return q!==null&&It!==null&&It.contains(q.anchorNode)?(E||(E=q.getRangeAt(0).getBoundingClientRect()),E!=null&&(E.y+=40,Qt(E,G,t))):(te==null||te.className!=="link-input")&&(It!==null&&Qt(null,G,t),i(null),u(null)),!0},[e,I,a.routes.admin,a.routes.api,a.serverURL,p,f,m,x?.code,t]);return to(()=>Jl(e.registerCommand(eo,C=>(e.dispatchCommand(ae,C),w(),$(),!0),Yl)),[e,w,$,O]),to(()=>{let C=t.parentElement,E=()=>{e.getEditorState().read(()=>{w()})};return window.addEventListener("resize",E),C?.addEventListener("scroll",E),()=>{window.removeEventListener("resize",E),C?.removeEventListener("scroll",E)}},[t.parentElement,e,w]),to(()=>Jl(e.registerUpdateListener(({editorState:C})=>{C.read(()=>{w()})}),e.registerCommand(_m,()=>(w(),!0),Yl),e.registerCommand(km,()=>T?(I(),!0):!1,Cm)),[e,w,T,I]),to(()=>{e.getEditorState().read(()=>{w()})},[e,w]),ht(ql.Fragment,{children:[Ce("div",{className:"link-editor",ref:n,children:ht("div",{className:"link-input",children:[l&&l.length>0?ht("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ce(Xl,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?ht(sm,{children:[o?.__fields.newTab?Ce(Xl,{}):null,Ce("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&ht(ql.Fragment,{children:[Ce("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),$()},onMouseDown:ei,tabIndex:0,type:"button",children:Ce(um,{})}),!N&&Ce("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(ae,null)},onMouseDown:ei,tabIndex:0,type:"button",children:Ce(cm,{})})]})]})}),Ce(ot,{className:"lexical-link-edit-drawer",data:h,drawerSlug:O,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(C,E)=>{let R=E,L={...R};delete L.text,e.update(()=>{let D=zl(),S=null;if(Zl(D)?S=Ve(D).getParent():k.length&&(S=k[0]?.getParent()??null),S&&xe(S)){let F=he({fields:L});S.replace(F,!0)}}),e.dispatchCommand(ae,{fields:L,selectedNodes:k,text:R.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var oi=t=>{let{anchorElem:e=document.body}=t;return Em(wm(ti,{anchorElem:e}),e)};import{c as Lm}from"react/compiler-runtime";import{useLexicalComposerContext as ym}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Im}from"@lexical/utils";import{$getSelection as Rm,$isElementNode as vm,$isRangeSelection as Mm,COMMAND_PRIORITY_LOW as ni,PASTE_COMMAND as Dm}from"lexical";import{useEffect as Am}from"react";var Nm=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,Sm=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function ri(t){if(!t)return!1;if(t==="https://"||Nm.test(t)||Sm.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var li=t=>{let e=Lm(5),{clientProps:o}=t,[r]=ym(),n,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([ee]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Im(r.registerCommand(ae,i=>i===null?(Ko(null),!0):(i.fields?.linkType||(i.fields.linkType=o.defaultLinkType),i.fields?.url||(i.fields.url=o.defaultLinkURL),Ko(i),!0),ni),r.registerCommand(Dm,i=>{let s=Rm();if(!Mm(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let u=i.clipboardData.getData("text");if(!ri(u))return!1;if(!s.getNodes().some(Om)){let c={doc:null,linkType:"custom",newTab:!1,url:u};return r.dispatchCommand(ae,{fields:c,text:null}),i.preventDefault(),!0}return!1},ni))},l=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=l):(n=e[3],l=e[4]),Am(n,l),null};function Om(t){return vm(t)}var si=[Uo([{ChildComponent:vl,isActive:({selection:t})=>{if(ii(t)){let e=Ve(t);return $m(e,J)!=null}return!1},isEnabled:({selection:t})=>!!(ii(t)&&Zo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(ae,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=Zo()?.getTextContent(),r=Zo()?.getNodes()??[]}),!o?.length)return;let n={doc:null};t.dispatchCommand(eo,{fields:n,selectedNodes:r,text:o})}},order:1}])],Fm=y(({props:t})=>({markdownTransformers:[Ol],nodes:[ee,t?.disableAutoLinks===!0?null:ge].filter(Boolean),plugins:[{Component:li,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Wl,position:"normal"},{Component:Vl,position:"normal"},{Component:oi,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:si},toolbarInline:{groups:si}}));import{$isListNode as Qo,INSERT_CHECK_LIST_COMMAND as pi,ListItemNode as zm,ListNode as Zm}from"@lexical/list";import{$isRangeSelection as Ym}from"lexical";import{jsx as ai,jsxs as Pm}from"react/jsx-runtime";import"react";var Yo=()=>Pm("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ai("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),ai("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Bm}from"react/jsx-runtime";import{ListPlugin as Hm}from"@lexical/react/LexicalListPlugin.js";import"react";var Ke=()=>Bm(Hm,{});function Je(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Wm,ListItemNode as Vm,ListNode as Km}from"@lexical/list";import{$createListItemNode as jm,$createListNode as Um,$isListItemNode as Gm,$isListNode as qo}from"@lexical/list";var ci=4,Xe=t=>(e,o,r)=>{let n=e.getPreviousSibling(),l=e.getNextSibling(),i=jm(t==="check"?r[3]==="x":void 0);if(qo(l)&&l.getListType()===t){let u=l.getFirstChild();u!==null?u.insertBefore(i):l.append(i),e.remove()}else if(qo(n)&&n.getListType()===t)n.append(i),e.remove();else{let u=Um(t,t==="number"?Number(r[2]):void 0);u.append(i),e.replace(u)}i.append(...o),i.select(0,0);let s=Math.floor(r[1].length/ci);s&&i.setIndent(s)},Ae=(t,e,o)=>{let r=[],n=t.getChildren(),l=0;for(let i of n)if(Gm(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(qo(d)){r.push(Ae(d,e,o+1));continue}}let s=" ".repeat(o*ci),u=t.getListType(),c=u==="number"?`${t.getStart()+l}. `:u==="check"?`- [${i.getChecked()?"x":" "}] `:"- ";r.push(s+c+e(i)),l++}return r.join(`
|
|
36
36
|
`)};var ui={type:"element",dependencies:[Km,Vm],export:(t,e)=>Wm(t)?Ae(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:Xe("check")};import{jsx as Jm}from"react/jsx-runtime";import{CheckListPlugin as Xm}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var di=()=>Jm(Xm,{});var mi=[Q([{ChildComponent:Yo,isActive:({selection:t})=>{if(!Ym(t))return!1;for(let e of t.getNodes()){if(Qo(e)&&e.getListType()==="check")continue;let o=e.getParent();if(Qo(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(Qo(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(pi,void 0)},order:12}])],qm=y(({featureProviderMap:t})=>{let e=[{Component:di,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ke,position:"normal"}),{markdownTransformers:[ui],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Zm,zm],plugins:e,slashMenu:{groups:[Je([{Icon:Yo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(pi,void 0)}}])]},toolbarFixed:{groups:mi},toolbarInline:{groups:mi}}});import{$isListNode as tr,INSERT_ORDERED_LIST_COMMAND as gi,ListItemNode as rp,ListNode as np}from"@lexical/list";import{$isRangeSelection as lp}from"lexical";import{jsx as gt,jsxs as Qm}from"react/jsx-runtime";import"react";var er=()=>Qm("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[gt("path",{d:"M5.89284 12.479C5.89284 13.368 5.26284 13.788 4.38084 14.236C3.75084 14.558 3.43584 14.789 3.40784 15.062H5.89984V16H2.06384V15.573C2.06384 14.523 2.92484 13.935 3.66684 13.501C4.38084 13.088 4.75184 12.878 4.75184 12.458C4.75184 12.08 4.52084 11.835 4.06584 11.835C3.58984 11.835 3.30984 12.199 3.28184 12.654H2.11284C2.18984 11.681 2.87584 10.918 4.07284 10.918C5.15784 10.918 5.89284 11.555 5.89284 12.479Z",fill:"currentColor"}),gt("path",{d:"M2.68608 4.535V3.737C3.54008 3.737 3.90408 3.513 4.02308 2.995H4.89108V8H3.68008L3.68008 4.535H2.68608Z",fill:"currentColor"}),gt("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),gt("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),gt("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ep,ListItemNode as tp,ListNode as op}from"@lexical/list";var fi={type:"element",dependencies:[op,tp],export:(t,e)=>ep(t)?Ae(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:Xe("number")};var hi=[Q([{ChildComponent:er,isActive:({selection:t})=>{if(!lp(t))return!1;for(let e of t.getNodes()){if(tr(e)&&e.getListType()==="number")continue;let o=e.getParent();if(tr(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(tr(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(gi,void 0)},order:10}])],ip=y(({featureProviderMap:t})=>({markdownTransformers:[fi],nodes:t.has("orderedList")?[]:[np,rp],plugins:t.has("orderedList")?[]:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:er,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(gi,void 0)}}])]},toolbarFixed:{groups:hi},toolbarInline:{groups:hi}}));import{$isListNode as rr,INSERT_UNORDERED_LIST_COMMAND as bi,ListItemNode as dp,ListNode as mp}from"@lexical/list";import{$isRangeSelection as pp}from"lexical";import{jsx as ze,jsxs as sp}from"react/jsx-runtime";import"react";var or=()=>sp("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ze("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),ze("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ap,ListItemNode as cp,ListNode as up}from"@lexical/list";var xi={type:"element",dependencies:[up,cp],export:(t,e)=>ap(t)?Ae(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:Xe("bullet")};var Ci=[Q([{ChildComponent:or,isActive:({selection:t})=>{if(!pp(t))return!1;for(let e of t.getNodes()){if(rr(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(rr(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(rr(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(bi,void 0)},order:11}])],fp=y({markdownTransformers:[xi],nodes:[mp,dp],plugins:[{Component:Ke,position:"normal"}],slashMenu:{groups:[Je([{Icon:or,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(bi,void 0)}}])]},toolbarFixed:{groups:Ci},toolbarInline:{groups:Ci}});import{jsx as hp}from"react/jsx-runtime";import{addClassNamesToElement as gp}from"@lexical/utils";import{DecoratorNode as xp}from"lexical";import*as ki from"react";var Cp=ki.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),xt=class t extends xp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return bp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return gp(o,"unknownConverted"),o}decorate(){return hp(Cp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function bp({data:t}){return new xt({data:t})}var kp=y(()=>({nodes:[xt]}));import{jsx as _p}from"react/jsx-runtime";import{addClassNamesToElement as Tp}from"@lexical/utils";import{DecoratorNode as wp}from"lexical";import*as _i from"react";var Ep=_i.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Ct=class t extends wp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return Np({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return Tp(o,"unknownConverted"),o}decorate(){return _p(Ep,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function Np({data:t}){return new Ct({data:t})}var Sp=y(()=>({nodes:[Ct]}));import{$setBlocksType as Ei}from"@lexical/selection";import{$createParagraphNode as Ni,$getSelection as Si,$isParagraphNode as Ti,$isRangeSelection as Lp}from"lexical";var wi=[Q([{ChildComponent:nt,isActive:({selection:t})=>{if(!Lp(t))return!1;for(let e of t.getNodes())if(!Ti(e)&&!Ti(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Si();Ei(e,()=>Ni())})},order:1}])],yp=y({slashMenu:{groups:[Z([{Icon:nt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Si();Ei(e,()=>Ni())})}}])]},toolbarFixed:{groups:wi},toolbarInline:{groups:wi}});import{c as zp}from"react/compiler-runtime";import{jsx as Ki}from"react/jsx-runtime";import{useLexicalComposerContext as Zp}from"@lexical/react/LexicalComposerContext";import{useEffect as Yp,useState as qp}from"react";import{jsx as Vi,Fragment as Xp}from"react/jsx-runtime";import"react";import{jsx as Ip}from"react/jsx-runtime";var Li={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Ip("blockquote",{children:o})}};import{jsx as Rp}from"react/jsx-runtime";var yi={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Rp(r,{children:o})}};import{jsx as vp}from"react/jsx-runtime";var Ii={horizontalrule:vp("hr",{})};import{jsx as Mp}from"react/jsx-runtime";var Ri={linebreak:Mp("br",{})};import{jsx as vi}from"react/jsx-runtime";var Mi=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return vi("a",{href:e.fields.url,rel:n,target:l,children:r})},link:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,i=e.fields.url??"";return e.fields.linkType==="internal"&&(t?i=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),i="#")),vi("a",{href:i,rel:n,target:l,children:r})}});import{jsx as Ze,jsxs as Dp,Fragment as Ap}from"react/jsx-runtime";import{v4 as Op}from"uuid";var Di={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return Ze(r,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let r=t.children.some(l=>l.type==="list"),n=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=Op();return Ze("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${r?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:r?n:Dp(Ap,{children:[Ze("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),Ze("label",{htmlFor:l,children:n}),Ze("br",{})]})})}else return Ze("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as nr}from"react/jsx-runtime";var Ai={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?nr("p",{children:o}):nr("p",{children:nr("br",{})})}};var Oi={tab:" "};import{jsx as bt}from"react/jsx-runtime";var $i={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return bt("div",{className:"lexical-table-container",children:bt("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:bt("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.headerState>0?"th":"td",n=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},i=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return bt(r,{className:`lexical-table-cell ${n}`,colSpan:i,rowSpan:s,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return bt("tr",{className:"lexical-table-row",children:o})}};import{jsx as Oe}from"react/jsx-runtime";import"react";var A={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},$p=A.IS_BOLD|A.IS_ITALIC|A.IS_STRIKETHROUGH|A.IS_UNDERLINE|A.IS_CODE|A.IS_SUBSCRIPT|A.IS_SUPERSCRIPT|A.IS_HIGHLIGHT,Fp="\xA0",Pp=`
|
|
37
37
|
|