PageSourceSearch

https://northstowe-education.vercel.app/_next/static/chunks/3f36a0cc-a9f8c54e9c426554.js

js northstowe-education.vercel.app collected 2026-10-03 07:24:39 UTC 187,289 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2186],{36278:(e,t,l)=>{let n;l.r(t),l.d(t,{$createAutoLinkNode:()=>tM,$createBlockNode:()=>ex,$createHorizontalRuleNode:()=>ti,$createInlineBlockNode:()=>r.d,$createLinkNode:()=>tS,$createRelationshipNode:()=>lK,$createUploadNode:()=>nJ,$isAutoLinkNode:()=>tF,$isBlockNode:()=>eb,$isHorizontalRuleNode:()=>ta,$isInlineBlockNode:()=>r.e,$isLinkNode:()=>tE,$isRelationshipNode:()=>lU,$isUploadNode:()=>nz,AlignFeatureClient:()=>q,AutoLinkNode:()=>tI,BlockCollapsible:()=>ra,BlockEditButton:()=>rs,BlockNode:()=>ev,BlockRemoveButton:()=>ru,BlockquoteFeatureClient:()=>en,BlocksFeatureClient:()=>eT,BoldFeatureClient:()=>eO,CAN_USE_DOM:()=>u.d,ChecklistFeatureClient:()=>le,CodeBlockBlockComponent:()=>rb,CodeComponent:()=>rh,DETAIL_TYPE_TO_DETAIL:()=>lL,DOUBLE_LINE_BREAK:()=>ly,DebugJsxConverterFeatureClient:()=>lA,ELEMENT_FORMAT_TO_TYPE:()=>lj,ELEMENT_TYPE_TO_FORMAT:()=>lN,ENABLE_SLASH_MENU_COMMAND:()=>u.k,EditorConfigProvider:()=>d.a,FieldsDrawer:()=>i.a,FixedToolbarFeatureClient:()=>nd,HeadingFeatureClient:()=>e4,HorizontalRuleFeatureClient:()=>tu,HorizontalRuleNode:()=>to,INSERT_BLOCK_COMMAND:()=>ew,INSERT_INLINE_BLOCK_COMMAND:()=>eS,IS_ALL_FORMATTING:()=>lC,IndentFeatureClient:()=>tf,InlineBlockContainer:()=>ri,InlineBlockEditButton:()=>rn,InlineBlockLabel:()=>ro,InlineBlockNode:()=>r.c,InlineBlockRemoveButton:()=>rr,InlineCodeFeatureClient:()=>ez,InlineToolbarFeatureClient:()=>ng,ItalicFeatureClient:()=>eW,LTR_REGEX:()=>lT,LexicalPluginToLexicalFeatureClient:()=>lc,LinkFeatureClient:()=>t0,LinkNode:()=>ty,NON_BREAKING_SPACE:()=>lk,NodeFormat:()=>lb,OrderedListFeatureClient:()=>lr,ParagraphFeatureClient:()=>lg,Point:()=>u.h,RTL_REGEX:()=>lE,Rect:()=>u.m,RelationshipFeatureClient:()=>l2,RelationshipNode:()=>lZ,RenderLexical:()=>rC,RichTextField:()=>n2,RichTextViewProvider:()=>u.f,SlateToLexicalFeatureClient:()=>lf,StrikethroughFeatureClient:()=>eK,SubscriptFeatureClient:()=>eG,SuperscriptFeatureClient:()=>eX,TEXT_MODE_TO_TYPE:()=>lI,TEXT_TYPE_TO_FORMAT:()=>l_,TEXT_TYPE_TO_MODE:()=>lM,TOGGLE_LINK_COMMAND:()=>tT,TableFeatureClient:()=>nF,TestRecorderFeatureClient:()=>eM,TextStateFeatureClient:()=>e2,ToolbarButton:()=>l5,ToolbarDropdown:()=>nr,TreeViewFeatureClient:()=>eF,UnderlineFeatureClient:()=>e$,UnorderedListFeatureClient:()=>ls,UploadFeatureClient:()=>nY,UploadNode:()=>nO,addSwipeDownListener:()=>rl,addSwipeLeftListener:()=>n9,addSwipeRightListener:()=>re,addSwipeUpListener:()=>rt,buildDefaultEditorState:()=>rw,buildEditorState:()=>ry,codeConverterClient:()=>rc,createBlockNode:()=>e6,createClientFeature:()=>K,defaultColors:()=>lB,defaultEditorLexicalConfig:()=>n$,getDOMRangeRect:()=>nc,getEnabledNodes:()=>u.p,getRestPopulateFn:()=>rd,getSelectedNode:()=>tg,isHTMLElement:()=>n5,isPoint:()=>u.i,joinClasses:()=>n3,sanitizeClientEditorConfig:()=>n0,sanitizeClientFeatures:()=>nQ,setFloatingElemPosition:()=>np,setFloatingElemPositionForLinkEditor:()=>tK,slashMenuBasicGroupWithItems:()=>W,toolbarAddDropdownGroupWithItems:()=>te,toolbarFeatureButtonsGroupWithItems:()=>tv,toolbarFormatGroupWithItems:()=>eR,toolbarTextDropdownGroupWithItems:()=>ee,useBlockComponentContext:()=>ef,useEditorConfigContext:()=>d.b,useInlineBlockComponentContext:()=>r.a,useLexicalDocumentDrawer:()=>s.a,useLexicalDrawer:()=>a.a,useLexicalListDrawer:()=>lG,useRichTextView:()=>u.g});var r=l(37339),o=l(64244),i=l(18281),a=l(97207),s=l(98524),u=l(81422),d=l(44416),c=l(80916),p=l(88357),h=l(10070),f=l(1157),m=l(91928),g=l(62548),v=l(46788),x=l(22669),b=l(45290),C=l(2356),k=l(37154),y=l(54485),w=l(62297),S=l(88580),E=l(32496),T=l(77586),_=l(22150),L=l(94194),N=l(54605),j=l(67654),I=l(85772),M=l(99316),F=l(91271),R=l(90801),P=l(9299),A=l(47289),D=l(12625),B=l(30349),H=l(28067),O=l(42579),J=l(26891),z=l(30147),V=l(74352);function W(e){return{items:e,key:"basic",label:e=>{let{i18n:t}=e;return t.t("lexical:general:slashMenuBasicGroupLabel")}}}var Z=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]}),K=e=>t=>{let l={clientFeatureProps:t};if("function"==typeof e)l.feature=l=>{let{config:n,featureClientImportMap:r,featureClientSchemaMap:o,featureProviderMap:i,field:a,resolvedFeatures:s,schemaPath:u,unSanitizedEditorConfig:d}=l,c=e({config:n,featureClientImportMap:r,featureClientSchemaMap:o,featureProviderMap:i,field:a,props:t,resolvedFeatures:s,schemaPath:u,unSanitizedEditorConfig:d});return null===c.sanitizedClientFeatureProps&&(c.sanitizedClientFeatureProps=t),c};else{let n={...e};n.sanitizedClientFeatureProps=t,l.feature=n}return l},U=e=>(0,f.ff4)(e)?e.getFormatType():e.__format,G=[(n=[{ChildComponent:Z,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,f.ff4)(e)||(0,h.D)(e))&&"left"===U(e))continue;let t=e.getParent();if(!(((0,f.ff4)(t)||(0,h.D)(t))&&"left"===U(t)))return!1}return!0},key:"alignLeft",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignLeftLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.fUS,"left")},order:1},{ChildComponent:()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,f.ff4)(e)||(0,h.D)(e))&&"center"===U(e))continue;let t=e.getParent();if(!(((0,f.ff4)(t)||(0,h.D)(t))&&"center"===U(t)))return!1}return!0},key:"alignCenter",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignCenterLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.fUS,"center")},order:2},{ChildComponent:()=>(0,g.jsxs)("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:[(0,g.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,f.ff4)(e)||(0,h.D)(e))&&"right"===U(e))continue;let t=e.getParent();if(!(((0,f.ff4)(t)||(0,h.D)(t))&&"right"===U(t)))return!1}return!0},key:"alignRight",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignRightLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.fUS,"right")},order:3},{ChildComponent:()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]}),isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if(((0,f.ff4)(e)||(0,h.D)(e))&&"justify"===U(e))continue;let t=e.getParent();if(!(((0,f.ff4)(t)||(0,h.D)(t))&&"justify"===U(t)))return!1}return!0},key:"alignJustify",label:e=>{let{i18n:t}=e;return t.t("lexical:align:alignJustifyLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.fUS,"justify")},order:4}],{type:"dropdown",ChildComponent:Z,items:n,key:"align",order:30})],q=K({plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(f.fUS,Y,f.AcJ),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,m.useEffect)(l,n),null},position:"normal"}],toolbarFixed:{groups:G},toolbarInline:{groups:G}});function X(e){return((0,f.ff4)(e)||(0,h.D)(e))&&!e.isInline()}function Y(e){let t=(0,f.vJq)();if(!(0,f.I2P)(t)&&!(0,f.RTZ)(t))return!1;for(let l of t.getNodes()){let t=(0,f.BtT)(l,X);null!==t&&t.setFormat(e)}return!0}var $=()=>(0,g.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{d:"M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",fill:"currentColor"})}),Q=()=>(0,g.jsx)("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:(0,g.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),ee=e=>({type:"dropdown",ChildComponent:Q,items:e,key:"text",order:25}),et={type:"element",dependencies:[v.dJ],export:(e,t)=>{if(!(0,v.jd)(e))return null;let l=t(e).split("\n"),n=[];for(let e of l)n.push("> "+e);return n.join("\n")},regExp:/^>\s/,replace:(e,t,l,n)=>{if(n){let l=e.getPreviousSibling();if((0,v.jd)(l)){l.splice(l.getChildrenSize(),0,[...t]),l.select(0,0),e.remove();return}}let r=(0,v.xi)();r.append(...t),e.replace(r),r.select(0,0)}},el=[ee([{ChildComponent:$,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes())if(!(0,v.jd)(e)&&!(0,v.jd)(e.getParent()))return!1;return!0},key:"blockquote",label:e=>{let{i18n:t}=e;return t.t("lexical:blockquote:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,f.vJq)();(0,x.zI)(e,()=>(0,v.xi)())})},order:20}])],en=K({markdownTransformers:[et],nodes:[v.dJ],slashMenu:{groups:[W([{Icon:$,key:"blockquote",keywords:["quote","blockquote"],label:e=>{let{i18n:t}=e;return t.t("lexical:blockquote:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,f.vJq)();(0,x.zI)(e,()=>(0,v.xi)())})}}])]},toolbarFixed:{groups:el},toolbarInline:{groups:el}}),er=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),(0,g.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),(0,g.jsx)("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]}),eo=()=>(0,g.jsx)("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:(0,g.jsx)("path",{clipRule:"evenodd",d:"M5.33333 6.5C5.11232 6.5 4.90036 6.5878 4.74408 6.74408C4.5878 6.90036 4.5 7.11232 4.5 7.33333V12.1667C4.5 12.3877 4.5878 12.5996 4.74408 12.7559C4.90036 12.9122 5.11232 13 5.33333 13H14.6667C14.8877 13 15.0996 12.9122 15.2559 12.7559C15.4122 12.5996 15.5 12.3877 15.5 12.1667V11.6667C15.5 11.3905 15.7239 11.1667 16 11.1667C16.2761 11.1667 16.5 11.3905 16.5 11.6667V12.1667C16.5 12.6529 16.3068 13.1192 15.963 13.463C15.6192 13.8068 15.1529 14 14.6667 14H5.33333C4.8471 14 4.38079 13.8068 4.03697 13.463C3.69315 13.1192 3.5 12.6529 3.5 12.1667V7.33333C3.5 6.8471 3.69315 6.38079 4.03697 6.03697C4.38079 5.69315 4.8471 5.5 5.33333 5.5H10.3333C10.6095 5.5 10.8333 5.72386 10.8333 6C10.8333 6.27614 10.6095 6.5 10.3333 6.5H5.33333ZM13 6.5C12.7239 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.7239 5.5 13 5.5H16C16.2761 5.5 16.5 5.72386 16.5 6V9C16.5 9.27614 16.2761 9.5 16 9.5C15.7239 9.5 15.5 9.27614 15.5 9V7.20711L13.3536 9.35355C13.1583 9.54882 12.8417 9.54882 12.6464 9.35355C12.4512 9.15829 12.4512 8.84171 12.6464 8.64645L14.7929 6.5H13ZM6.16699 8.33325C6.16699 8.05711 6.39085 7.83325 6.66699 7.83325H11.0003C11.2765 7.83325 11.5003 8.05711 11.5003 8.33325C11.5003 8.60939 11.2765 8.83325 11.0003 8.83325H6.66699C6.39085 8.83325 6.16699 8.60939 6.16699 8.33325ZM6.16699 10.9999C6.16699 10.7238 6.39085 10.4999 6.66699 10.4999H13.3337C13.6098 10.4999 13.8337 10.7238 13.8337 10.9999C13.8337 11.2761 13.6098 11.4999 13.3337 11.4999H6.66699C6.39085 11.4999 6.16699 11.2761 6.16699 10.9999Z",fill:"currentColor",fillRule:"evenodd"})});function ei(e,t){let{admin:l,imageAltText:n,imageURL:r}=e,o=null==l?void 0:l.images,i,a;if((null==o?void 0:o.icon)?(i="string"==typeof o.icon?o.icon:o.icon.url,a="string"==typeof o.icon?void 0:o.icon.alt):(null==o?void 0:o.thumbnail)?(i="string"==typeof o.thumbnail?o.thumbnail:o.thumbnail.url,a="string"==typeof o.thumbnail?void 0:o.thumbnail.alt):(i=r,a=n),!i)return t;let s=null!=a?a:"Block Image";return()=>(0,g.jsx)("img",{alt:s,className:"lexical-block-custom-image",src:i,style:{maxHeight:20,maxWidth:20}})}function ea(e){let{propsString:t}=e,l={},n="",r=!0;for(let e=0;e<t.length;e++){let o=t[e];if(r)"="===o||" "===o?n&&(" "===o?(l[n]=!0,n=""):r=!1):n+=o;else{let o=function(e,t){let l=e[t];return'"'===l?es(e,t):"'"===l?es(e,t,!0):"{"===l?function(e,t){var l;let n=1,r="",o=t+1;for(;o<e.length&&n>0;)"{"===e[o]?n++:"}"===e[o]&&n--,n>0&&(r+=e[o]),o++;return{newIndex:o,value:"{"!==(l=r)[0]?C.Z.parse(l):C.Z.parse(l.replace(/(\w+):/g,'"$1":'))}}(e,t):"["===l?function(e,t){let l=1,n="",r=t+1;for(;r<e.length&&l>0;)"["===e[r]?l++:"]"===e[r]&&l--,l>0&&(n+=e[r]),r++;return{newIndex:r,value:C.Z.parse("[".concat(n,"]"))}}(e,t):function(e,t){let l="",n=t;for(;n<e.length&&" "!==e[n];)l+=e[n],n++;return{newIndex:n-1,value:l}}(e,t)}(t,e);l[n]=o.value,e=o.newIndex,n="",r=!0}}return n&&(l[n]=!0),l}function es(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n="",r=t+1;for(;r<e.length&&(e[r]!==(l?"'":'"')||"\\"===e[r-1]);)n+=e[r],r++;return{newIndex:r,value:n}}function eu(e){let{props:t}=e,l=[];for(let[e,n]of Object.entries(t))"string"==typeof n?l.push("".concat(e,'="').concat(n.replace(/"/g,"&quot;"),'"')):"number"==typeof n?l.push("".concat(e,"={").concat(n,"}")):"boolean"==typeof n?n&&l.push("".concat(e)):null!==n&&"object"==typeof n&&(Array.isArray(n)?l.push("".concat(e,"={[").concat(n.map(e=>JSON.stringify(e,ed)).join(", "),"]}")):l.push("".concat(e,"={").concat(JSON.stringify(n,ed),"}")));return l.join(" ")}function ed(e,t){return"string"==typeof t?t.replace(/'/g,"\\'"):t}function ec(e){let{isEndOptional:t,lines:l,regexpEndRegex:n,startLineIndex:r,startMatch:o,trimChildren:i}=e,a="",s="",u=l.slice(r),d=!1,c=0,p=0,h=null,f=!1,m=0,g=u[0].slice(0,o.index),v=0,x=r;e:for(let[e,r]of u.entries()){var b;let g=i?r.trim():r,C=0;if(i)for(let e=0;e<r.length&&" "===r[e];e++)C++;let k=0;for(0===e&&(k=(null!=(b=o.index)?b:0)+o[0].length-C);k<g.length;){let t=g[k],l=g[k+1];if(d){if("`"===t&&m++,m%2==0)if("<"===t&&"/"===l){if(--c<0){"\n"===s[s.length-1]&&(s=s.slice(0,-1)),x=e;for(let e=k;e<g.length;e++)if(">"===g[e]){v=e+1;break}break e}}else if("/"===t&&">"===l){if(--c<0){"\n"===s[s.length-1]&&(s=s.slice(0,-1)),x=e,v=k+2;break e}}else"<"===t&&"/"!==l&&c++;s+=t}else{if("{"!==t||h?"}"!==t||h?'"'!==t&&"'"!==t||h?t===h&&(h=null):h=t:p--:p++,"/"!==t||">"!==l||0!==p||h){if(">"===t&&0===p&&!h){d=!0,k++;continue}}else{f=!0,x=e,v=k+2;break e}a+=t}k++}if(d?(null==s?void 0:s.length)>0&&e>0&&(s+="\n"):a+="\n",n&&c<0){let t=g.match(n);if((null==t?void 0:t.index)!==void 0){x=e,v=t.index+t[0].length-1;break}}if(e===u.length-1&&!t&&!f)throw Error("End match not found for lines "+l.join("\n")+"\n\n. Start match: "+JSON.stringify(o))}return{afterEndLine:u[x].trim().slice(v),beforeStartLine:g,content:s,endLineIndex:r+x,endlineLastCharIndex:v,propsString:a}}var ep=class extends h.d{static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){var t;1===e.version&&(e={...e,fields:{...e.fields.data},version:2});let l=(t=e.fields,(0,f.pTq)(new ep({fields:{...t,id:(null==t?void 0:t.id)||new k.default().toHexString()}})));return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB7)(l,null==e||null==(t=e.theme)?void 0:t.block),l}decorate(e,t){return null}exportDOM(){let e=document.createElement("div"),t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields(),version:2}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,t){let l=this.getWritable();l.__fields=e,t||l.__cacheBuster++}constructor({cacheBuster:e,fields:t,format:l,key:n}){super(l,n),this.__fields=t,this.__cacheBuster=e||0}},eh=(0,m.createContext)({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ef=()=>m.use(eh),em=e=>{let t=(0,c.c)(4),{Collapsible:l,CustomBlock:n,CustomLabel:r,...o}=e,{BlockDrawer:i,errorCount:a,formSchema:s}=o,u=(0,w.useFormSubmitted)()&&a>0,d=(0,y.a)(),p;t[0]!==l||t[1]!==a||t[2]!==u?(p=e=>{let{children:t,...n}=e;return(0,g.jsx)(l,{errorCount:a,fieldHasErrors:u,...n,children:t})},t[0]=l,t[1]=a,t[2]=u,t[3]=p):p=t[3];let h=p,f={...o,BlockCollapsible:h};return n?(0,g.jsxs)(eh,{value:f,children:[n,(0,g.jsx)(i,{})]}):(0,g.jsx)(h,{children:(0,g.jsx)(w.RenderFields,{fields:s,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!d})})},eg=e=>{var t,l,n,r,o,i,s,u,c,h;let{cacheBuster:v,className:x,CustomBlock:C,CustomLabel:k,formData:j,nodeKey:I}=e,M=(0,w.useFormSubmitted)(),{id:F,collectionSlug:R,globalSlug:P}=(0,w.useDocumentInfo)(),{fieldProps:{featureClientSchemaMap:A,field:D,initialLexicalFormState:B,schemaPath:H},uuid:O}=(0,d.b)(),{fields:J}=(0,w.useDocumentForm)(),z=(0,m.useRef)(new AbortController),V=(0,w.useEditDepth)(),[W,Z]=m.useState(0),{config:K}=(0,S.c)(),U=(0,w.formatDrawerSlug)({slug:"lexical-blocks-create-".concat(O,"-").concat(j.id),depth:V}),{toggleDrawer:G}=(0,a.a)(U),{getDocPreferences:q,setDocFieldPreferences:X}=(0,w.useDocumentInfo)(),[Y]=(0,p.DF)(),$=(0,y.a)(),Q=j.blockType,{getFormState:ee}=(0,w.useServerFunctions)(),et="".concat(H,".lexical_internal_feature.blocks.lexical_blocks.").concat(Q,".fields"),[el,en]=m.useState(()=>{var e;let t=null==B||null==(e=B[j.id])?void 0:e.formState;if(!t)return!1;let l=Object.fromEntries(Object.entries(t).map(e=>{let[t,l]=e;return[t,t in j?{...l,initialValue:j[t],value:j[t]}:l]}));return l.blockName={initialValue:j.blockName,passesCondition:!0,valid:!0,value:j.blockName},l}),er=(0,m.useRef)(!1),eo=(0,m.useRef)(v);(0,m.useEffect)(()=>{er.current?(eo.current!==v&&en(!1),eo.current=v):er.current=!0},[v]);let[ei]=m.useState(()=>(0,N.A)()),[ea,es]=m.useState(()=>{var e,t,l;if(!k)return null!=(l=null==el||null==(t=el._components)||null==(e=t.customComponents)?void 0:e.BlockLabel)?l:void 0}),[eu,ed]=m.useState(()=>{var e,t,l;if(!C)return null!=(l=null==el||null==(t=el._components)||null==(e=t.customComponents)?void 0:e.Block)?l:void 0}),ec=(0,m.useMemo)(()=>C?(0,g.jsx)(C,{className:x,formData:j,isEditor:!0,isJSXConverter:!1,nodeKey:I,useBlockComponentContext:ef}):eu,[C,x,j,I,eu]),ep=(0,m.useMemo)(()=>k?(0,g.jsx)(k,{className:x,formData:j,isEditor:!0,isJSXConverter:!1,nodeKey:I,useBlockComponentContext:ef}):ea,[k,x,j,I,ea]);(0,m.useEffect)(()=>{let e=new AbortController;return j&&!el&&(async()=>{let{state:t}=await ee({id:F,collectionSlug:R,data:j,docPermissions:{fields:!0},docPreferences:await q(),documentFormState:(0,_.KS)(J,{excludeFiles:!0}),globalSlug:P,initialBlockData:j,operation:"update",readOnly:!$,renderAllFields:!0,schemaPath:et,signal:e.signal});if(t){var l,n,r,o,i,a;t.blockName={initialValue:j.blockName,passesCondition:!0,valid:!0,value:j.blockName};let e=(0,L.r)((0,_.KS)(t,{excludeFiles:!0}),!0);Y.update(()=>{let t=(0,f.nsf)(I);t&&eb(t)&&(e.blockType=Q,t.setFields(e,!0))},{tag:f.$c$}),en(t),k||es(null!=(i=null==(n=t._components)||null==(l=n.customComponents)?void 0:l.BlockLabel)?i:void 0),C||ed(null!=(a=null==(o=t._components)||null==(r=o.customComponents)?void 0:r.Block)?a:void 0)}})(),()=>{(0,T.eS)(e)}}
1,[ee,et,$,F,k,C,j,Y,I,el,R,P,q,J,Q]);let[eh,eg]=m.useState(null!=(h=null==B||null==(t=B[j.id])?void 0:t.collapsed)&&h),ev="".concat(H,".lexical_internal_feature.blocks.lexical_blocks.").concat(Q),ex=null==(n=A.blocks)||null==(l=n[ev])?void 0:l[0],eC=ex.blockReferences?"string"==typeof(null==ex||null==(r=ex.blockReferences)?void 0:r[0])?K.blocksMap[null==ex||null==(o=ex.blockReferences)?void 0:o[0]]:null==ex||null==(i=ex.blockReferences)?void 0:i[0]:null==ex||null==(s=ex.blocks)?void 0:s[0],{i18n:ek,t:ey}=(0,E.d)(),ew=(0,m.useCallback)(async e=>{let{formState:t,submit:l}=e;(0,T.eS)(z.current);let n=new AbortController;z.current=n;let{state:r}=await ee({id:F,collectionSlug:R,docPermissions:{fields:!0},docPreferences:await q(),documentFormState:(0,_.KS)(J,{excludeFiles:!0}),formState:t,globalSlug:P,initialBlockFormState:t,operation:"update",readOnly:!$,renderAllFields:!!l,schemaPath:et,signal:n.signal});if(!r)return t;t.blockName&&(r.blockName=t.blockName);let o=(0,L.r)(function(e){let{fields:t}=e;for(let e in t){let l=t[e];Array.isArray(null==l?void 0:l.rows)&&"value"in l&&(l.disableFormData=!0)}return t}({fields:(0,_.KS)(r,{excludeFiles:!0})}),!0);if(setTimeout(()=>{Y.update(()=>{let e=(0,f.nsf)(I);e&&eb(e)&&(o.blockType=Q,e.setFields(o,!0))},{tag:f.$c$})},0),l){var i,a,s,u,d,c;k||es(null!=(d=null==(a=r._components)||null==(i=a.customComponents)?void 0:i.BlockLabel)?d:void 0),C||ed(null!=(c=null==(u=r._components)||null==(s=u.customComponents)?void 0:s.Block)?c:void 0);let e=0;for(let t of Object.values(r))(null==t?void 0:t.valid)===!1&&e++;Z(e)}return r},[ee,F,R,q,P,et,Q,J,$,Y,I,C,k]);(0,m.useEffect)(()=>()=>{(0,T.eS)(z.current)},[]);let eS=(0,m.useCallback)(()=>{Y.update(()=>{var e;null==(e=(0,f.nsf)(I))||e.remove()})},[Y,I]),eE=(null==eC||null==(u=eC.labels)?void 0:u.singular)?(0,b.s)(eC.labels.singular,ek):null==eC?void 0:eC.slug,eT=(0,m.useCallback)(e=>{q().then(t=>{var l,n;let r=null==t||null==(n=t.fields)||null==(l=n[D.name])?void 0:l.collapsed,o=r&&(null==r?void 0:r.length)?r:[];e?o.includes(j.id)||o.push(j.id):o.includes(j.id)&&o.splice(o.indexOf(j.id),1),X(D.name,{collapsed:o,hello:"hi"})})},[q,D.name,X,j.id]),e_=(0,m.useMemo)(()=>()=>(0,g.jsx)(w.Button,{buttonStyle:"icon-label",className:"".concat(x,"__editButton"),disabled:!$,el:"button",icon:"edit",onClick:e=>(e.preventDefault(),e.stopPropagation(),G(),!1),onMouseDown:e=>{e.preventDefault()},round:!0,size:"small",tooltip:ey("lexical:blocks:inlineBlocks:edit",{label:eE})}),[x,$,ey,eE,G]),eL=(0,m.useMemo)(()=>()=>(0,g.jsx)(w.Button,{buttonStyle:"icon-label",className:"".concat(x,"__removeButton"),disabled:!$,icon:"x",onClick:e=>{e.preventDefault(),eS()},round:!0,tooltip:"Remove Block"}),[x,$,eS]),eN=(0,m.useMemo)(()=>e=>{var t;let{Actions:l,children:n,className:r,collapsibleProps:o,disableBlockName:i,editButton:a,errorCount:s,fieldHasErrors:u,Label:d,Pill:c,removeButton:p}=e;return(0,g.jsx)("div",{className:"".concat(x,"__container ").concat(x,"-").concat(Q),children:(0,g.jsx)(w.Collapsible,{className:["".concat(x,"__row"),u?"".concat(x,"__row--has-errors"):"".concat(x,"__row--no-errors"),r].filter(Boolean).join(" "),collapsibleStyle:u?"error":"default",header:(0,g.jsxs)("div",{className:"".concat(x,"__block-header"),children:["u">typeof d?d:"u">typeof ep?ep:(0,g.jsxs)("div",{className:"".concat(x,"__block-label"),children:["u">typeof c?c:(0,g.jsx)(w.Pill,{className:"".concat(x,"__block-pill ").concat(x,"__block-pill-").concat(Q),pillStyle:"white",size:"small",children:null!=eE?eE:Q}),!i&&!(null==eC||null==(t=eC.admin)?void 0:t.disableBlockName)&&(0,g.jsx)(w.SectionTitle,{path:"blockName",readOnly:!$}),u&&(0,g.jsx)(w.ErrorPill,{count:null!=s?s:0,i18n:ek,withMessage:!0})]}),(0,g.jsx)("div",{className:"".concat(x,"__block-actions"),children:"u">typeof l?l:(0,g.jsxs)(g.Fragment,{children:[ec&&!1!==a||!ec&&a?(0,g.jsx)(e_,{}):null,!1!==p&&$?(0,g.jsx)(eL,{}):null]})})]}),isCollapsed:eh,onToggle:e=>{eT(e),eg(e)},...o||{},children:n},0)})},[ec,ep,e_,eL,eE,x,null==eC||null==(c=eC.admin)?void 0:c.disableBlockName,Q,ek,eh,eT,$]),ej=null==j?void 0:j.id,eI=(0,m.useMemo)(()=>()=>{var e;return(0,g.jsx)(w.EditDepthProvider,{children:(0,g.jsx)(w.Drawer,{className:"",slug:U,title:ey("lexical:blocks:inlineBlocks:".concat(ej?"edit":"create"),{label:null!=eE?eE:ey("lexical:blocks:inlineBlocks:label")}),children:el?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(w.RenderFields,{fields:null!=(e=null==eC?void 0:eC.fields)?e:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:et,permissions:!0,readOnly:!$}
1),(0,g.jsx)(w.FormSubmit,{programmaticSubmit:!0,children:ey("fields:saveChanges")})]}):null})})},[el,U,ej,eE,ey,$,null==eC?void 0:eC.fields,et]),eM=(0,m.useMemo)(()=>{var e,t;return el?(0,g.jsx)("div",{"data-block-drawer-slug":U,style:{display:"contents"},children:(0,g.jsx)(w.Form,{beforeSubmit:[async e=>{let{formState:t}=e;return await ew({formState:t,submit:!0})}],el:"div",fields:null!=(e=null==eC?void 0:eC.fields)?e:[],initialState:el,onChange:[ew],onSubmit:(e,t)=>{t.blockType=Q,Y.update(()=>{let e=(0,f.nsf)(I);e&&eb(e)&&e.setFields(t,!0)},{tag:f.$c$}),G()},submitted:M,uuid:ei,children:(0,g.jsx)(em,{baseClass:x,BlockDrawer:eI,Collapsible:eN,CustomBlock:ec,CustomLabel:ep,EditButton:e_,errorCount:W,formSchema:null!=(t=null==eC?void 0:eC.fields)?t:[],initialState:el,nodeKey:I,RemoveButton:eL})})}):null},[eN,eI,ec,ep,Q,U,eL,e_,x,Y,W,G,null==eC?void 0:eC.fields,ei,el,I,ew,M]);return eC?eM:(0,g.jsx)(eN,{disableBlockName:!0,fieldHasErrors:!0,children:(0,g.jsxs)("div",{className:"".concat(x,"-not-found"),children:["Error: Block '",Q,"' not found in the config but exists in the lexical data"]})})},ev=class extends ep{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){1===e.version&&(e={...e,fields:{...e.fields.data},version:2});let t=ex(e.fields);return t.setFormat(e.format),t}decorate(){for(var e,t=arguments.length,l=Array(t),n=0;n<t;n++)l[n]=arguments[n];let[r,o,i,a]=l;return(0,g.jsx)(eg,{cacheBuster:this.getCacheBuster(),className:null!=(e=o.theme.block)?e:"LexicalEditorTheme__block",CustomBlock:i,CustomLabel:a,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ex(e){return(0,f.pTq)(new ev({fields:{...e,id:(null==e?void 0:e.id)||new k.default().toHexString()}}))}function eb(e){return e instanceof ev}function eC(e,t){return l=>{let{editorState:n}=l,r=(0,j.D)({nodes:e});try{r.setEditorState(r.parseEditorState(n))}catch(e){console.error("getLexicalToMarkdown: ERROR parsing editor state",e)}let o="";return r.getEditorState().read(()=>{o=(0,u.c)(t)}),o}}function ek(e,t){return l=>{let{markdown:n}=l,r=(0,j.D)({nodes:e});return r.update(()=>{(0,u.b)(n,t)},{discrete:!0}),r.getEditorState().toJSON()}}function ey(e,t){let l;if(!e.jsx)return null;let n=(l=e.slug.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),{regExpEnd:RegExp("</(".concat(l,")\\s*>|<").concat(l,"[^>]*?/>"),"i"),regExpStart:RegExp("<(".concat(l,")([^>]*?)\\s*(/?)>"),"i")}),o=[];return t?o.push(t=>{var l,o;let{allNodes:i,allTransformers:a}=t;return{type:"text-match",dependencies:[r.c],export:t=>{var l,n,o,s,u;if(!(0,r.e)(t)||(null==(n=t.getFields())||null==(l=n.blockType)?void 0:l.toLowerCase())!==e.slug.toLowerCase())return null;let d=t.getFields(),c=eC(i,a),p=e.jsx.export({fields:d,lexicalToMarkdown:c});if(!1===p)return null;if("string"==typeof p)return p;let h=p.props&&(null==(o=Object.keys(p.props))?void 0:o.length)>0,f=null!=(u=p.props)?u:{};return(null==p||null==(s=p.children)?void 0:s.length)?"<".concat(d.blockType).concat(h?" "+eu({props:f}):"",">").concat(p.children,"</").concat(d.blockType,">"):"<".concat(d.blockType).concat(h?" "+eu({props:f}):"","/>")},getEndIndex:(e,t)=>{let{endlineLastCharIndex:l}=ec({isEndOptional:!1,lines:[e.getTextContent()],regexpEndRegex:n.regExpEnd,startLineIndex:0,startMatch:t,trimChildren:!1});return l},importRegExp:null!=(o=null==(l=e.jsx)?void 0:l.customStartRegex)?o:n.regExpStart,regExp:/___ignoreignoreignore___/g,replace(t,l){var o;let{content:s,propsString:u}=ec({isEndOptional:!1,lines:[t.getTextContent()],regexpEndRegex:n.regExpEnd,startLineIndex:0,startMatch:{...l,index:0},trimChildren:!1});if(!(null==e||null==(o=e.jsx)?void 0:o.import))return;let d=ek(i,a),c=e.jsx.import({children:s,closeMatch:null,htmlToLexical:null,markdownToLexical:d,openMatch:l,props:u?ea({propsString:u}):{}});if(!1===c)return;let p=(0,r.d)({blockType:e.slug,...c});t.replace(p)}}}):o.push(t=>{var l,r,o,i,a;let{allNodes:s,allTransformers:u}=t;return{dependencies:[ev],export:t=>{var l,n,r,o,i,a,d;if(!eb(t)||(null==(n=t.getFields())||null==(l=n.blockType)?void 0:l.toLowerCase())!==e.slug.toLowerCase())return null;
1let c=t.getFields(),p=eC(s,u),h=e.jsx.export({fields:c,lexicalToMarkdown:p});if(!1===h)return null;if("string"==typeof h)return h;let f=h.props&&(null==(r=Object.keys(h.props))?void 0:r.length)>0,m=null!=(i=h.props)?i:{};if(null==h||null==(o=h.children)?void 0:o.length){let t=h.children,l="";if(t.includes("\n"))for(let n of t.split("\n")){let t="";(null==e||null==(d=e.jsx)?void 0:d.doNotTrimChildren)||""===n||(t="  "),t+=n+"\n",l+=t}else l=((null==e||null==(a=e.jsx)?void 0:a.doNotTrimChildren)?"":"  ")+t+"\n";return"<".concat(c.blockType).concat(f?" "+eu({props:m}):"",">\n").concat(l,"</").concat(c.blockType,">")}return"<".concat(c.blockType).concat(f?" "+eu({props:m}):"","/>")},handleImportAfterStartMatch:(null==(l=e.jsx)?void 0:l.customEndRegex)?void 0:t=>{var l,n,r,o,i,a,d,c;let{lines:p,rootNode:h,startLineIndex:m,startMatch:g,transformer:v}=t,x="object"==typeof v.regExpEnd&&"regExp"in v.regExpEnd?v.regExpEnd.regExp:v.regExpEnd,{afterEndLine:b,beforeStartLine:C,content:k,endLineIndex:y,propsString:w}=ec({isEndOptional:v.regExpEnd&&"object"==typeof v.regExpEnd&&"optional"in v.regExpEnd?v.regExpEnd.optional:!v.regExpEnd,lines:p,regexpEndRegex:x,startLineIndex:m,startMatch:g,trimChildren:!1}),S="";if(null==e||null==(l=e.jsx)?void 0:l.doNotTrimChildren)S=k.endsWith("\n")?k.slice(0,-1):k;else if(k.includes("\n")){let e=k.split("\n"),t=0;for(let l of e){if(t++,l.startsWith("  "))S+=l.slice(2);else if(""===l)S+=l;else{S=k.endsWith("\n")?k.slice(0,-1):k;break}S+=t===e.length?"":"\n"}}else S=(k.startsWith("  ")?k.slice(2):k)+"\n";if(!(null==e||null==(n=e.jsx)?void 0:n.import))return[!1,m];let E=ek(s,u),T=e.jsx.import({children:S,closeMatch:null,htmlToLexical:null,markdownToLexical:E,openMatch:g,props:w?ea({propsString:w}):{}});if(!1===T)return[!1,m];let _=ex({blockType:e.slug,...T});if(_){let e=null,t=null;if(null==C?void 0:C.length){let t=null==(e=null!=(i=null==(o=E({markdown:C}))||null==(r=o.root)?void 0:r.children)?i:[])?void 0:e[0];t&&h.append((0,f.GMe)(t))}if(h.append(_),null==b?void 0:b.length){t=null==(d=E({markdown:b}))||null==(a=d.root)?void 0:a.children;let e=h.getChildren()[h.getChildren().length-1],l=null==(c=(0,f.GMe)(t[0]))?void 0:c.getChildren();if(null==l?void 0:l.length)for(let t of l)e.append(t)}}return[!0,y]},regExpEnd:null!=(i=null==(r=e.jsx)?void 0:r.customEndRegex)?i:n.regExpEnd,regExpStart:null!=(a=null==(o=e.jsx)?void 0:o.customStartRegex)?a:n.regExpStart,type:"multiline-element",replace:(t,l,n,r,o)=>{var i,a,d;if(null==e||null==(i=e.jsx)?void 0:i.import){if(!o){let e="";if(l)for(let t of l)e+=t.getTextContent();o=[e]}let i="";i=(null==e||null==(a=e.jsx)?void 0:a.doNotTrimChildren)?o.join("\n"):o.join("\n").trim();let c=null==(d=n[1])?void 0:d.trim(),p=ek(s,u),h=e.jsx.import({children:i,closeMatch:r,htmlToLexical:null,markdownToLexical:p,openMatch:n,props:c?ea({propsString:c}):{}});if(!1===h)return!1;let f=ex({blockType:e.slug,...h});return void(f&&t.append(f))}return!1}}}),o}var ew=(0,f.guI)("INSERT_BLOCK_COMMAND"),eS=(0,f.guI)("INSERT_INLINE_BLOCK_COMMAND"),eE=()=>{let e,t=(0,c.c)(12),[l]=(0,p.DF)(),[n,o]=(0,m.useState)(null),{setCreatedInlineBlock:i,uuid:s}=(0,d.b)(),u=(0,w.useEditDepth)(),h="lexical-inlineBlocks-create-"+s,g;t[0]!==u||t[1]!==h?(g=(0,w.formatDrawerSlug)({slug:h,depth:u}),t[0]=u,t[1]=h,t[2]=g):g=t[2];let v=g,{toggleDrawer:x}=(0,a.a)(v,!0),b;return t[3]!==l||t[4]!==i||t[5]!==n?(b=()=>{if(!l.hasNodes([ev]))throw Error("BlocksPlugin: BlocksNode not registered on editor");return(0,f.Sdt)(l.registerCommand(ew,e=>(l.update(()=>{let t=(0,f.vJq)()||(0,f.S1w)();if((0,f.I2P)(t)){let l=ex(e),{focus:n}=t,r=n.getNode();(0,I.Pe)(l),(0,f.bSg)(r)&&!r.__first&&r.remove()}}),!0),f.jZM),l.registerCommand(eS,e=>{if(n){let t=(0,f.nsf)(n);return!!t&&!!(0,r.e)(t)&&(t.setFields(e),o(null),!0)}let t=(0,r.d)(e);return null==i||i(t),(0,f.H2A)([t]),(0,f.IqF)(t.getParentOrThrow())&&(0,I.cj)(t,f.lJ7).selectEnd(),!0},f.jZM))},t[3]=l,t[4]=i,t[5]=n,t[6]=b):b=t[6],t[7]!==l||t[8]!==i||t[9]!==n||t[10]!==x?(e=[l,i,n,x],t[7]=l,t[8]=i,t[9]=n,t[10]=x,t[11]=e):e=t[11],(0,m.useEffect)(b,e),null},eT=K(e=>{let{config:t,featureClientSchemaMap:l,props:n,schemaPath:o}=e,i="".concat(o,".lexical_internal_feature.blocks.lexical_blocks"),a="".concat(o,".lexical_internal_feature.blocks.lexical_inl
1ine_blocks"),s=l.blocks;if(!s)return{};let u=Object.entries(s).filter(e=>{let[t]=e;return t.startsWith(i+".")&&!t.replace(i+".","").includes(".")}).map(e=>{let[,t]=e;return t[0]}),d=Object.entries(s).filter(e=>{let[t]=e;return t.startsWith(a+".")&&!t.replace(a+".","").includes(".")}).map(e=>{let[,t]=e;return t[0]}),c=u.map(e=>e.blockReferences?"string"==typeof e.blockReferences[0]?t.blocksMap[e.blockReferences[0]]:e.blockReferences[0]:e.blocks[0]).filter(e=>void 0!==e),p=d.map(e=>e.blockReferences?"string"==typeof e.blockReferences[0]?t.blocksMap[e.blockReferences[0]]:e.blockReferences[0]:e.blocks[0]).filter(e=>void 0!==e);return{markdownTransformers:(e=>{let{blocks:t,inlineBlocks:l}=e;if(!(null==t?void 0:t.length)&&!(null==l?void 0:l.length))return[];let n=[];if(null==t?void 0:t.length)for(let e of t){let t=ey(e,!1);t&&(n=n.concat(t))}if(null==l?void 0:l.length)for(let e of l){let t=ey(e,!0);t&&(n=n.concat(t))}return n})({blocks:c,inlineBlocks:p}),nodes:[ev,r.c],plugins:[{Component:eE,position:"normal"}],sanitizedClientFeatureProps:n,slashMenu:{groups:[(null==c?void 0:c.length)?{items:c.map(e=>({Icon:ei(e,er),key:"block-"+e.slug,keywords:["block","blocks",e.slug],label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,b.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(ew,{blockName:"",blockType:e.slug})}})),key:"blocks",label:e=>{let{i18n:t}=e;return t.t("lexical:blocks:label")}}:null,(null==p?void 0:p.length)?{items:p.map(e=>({Icon:eo,key:"inlineBlocks-"+e.slug,keywords:["inlineBlock","inline block",e.slug],label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,b.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(eS,{blockName:"",blockType:e.slug})}})),key:"inlineBlocks",label:e=>{let{i18n:t}=e;return t.t("lexical:blocks:inlineBlocks:label")}}:null].filter(Boolean)},toolbarFixed:{groups:[c.length?{type:"dropdown",ChildComponent:er,items:c.map((e,t)=>({ChildComponent:ei(e,er),isActive:void 0,key:"block-"+e.slug,label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,b.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(ew,{blockName:"",blockType:e.slug})},order:t})),key:"blocks",order:20}:null,(null==p?void 0:p.length)?{type:"dropdown",ChildComponent:eo,items:p.map((e,t)=>({ChildComponent:ei(e,eo),isActive:void 0,key:"inlineBlock-"+e.slug,label:t=>{var l;let{i18n:n}=t;return(null==e||null==(l=e.labels)?void 0:l.singular)?(0,b.s)(e.labels.singular,n):null==e?void 0:e.slug},onSelect:t=>{let{editor:l}=t;l.dispatchCommand(eS,{blockName:"",blockType:e.slug})},order:t})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}}),e_=u.d&&"documentMode"in document?document.documentMode:null,eL=u.d&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);u.d&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),u.d&&"InputEvent"in window&&!e_&&new window.InputEvent("input"),u.d&&/Version\/[\d.].*Safari/.test(navigator.userAgent),u.d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream,u.d&&/Android/.test(navigator.userAgent),u.d&&/Win/.test(navigator.platform),u.d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),u.d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent);var eN=e=>{let t=((e,t)=>{switch(e){case"click":return"      await page.mouse.click(".concat(t.x,", ").concat(t.y,");");case"keydown":return"      await page.keyboard.keydown('".concat(t,"');");case"keyup":return"      await page.keyboard.keyup('".concat(t,"');");case"press":return"      await page.keyboard.press('".concat(t,"');");case"selectAll":return"      await selectAll(page);";case"snapshot":return"      await assertHTMLSnapshot(page);\n      await assertSelection(page, {\n        anchorPath: [".concat(t.anchorPath.toString(),"],\n        anchorOffset: ").concat(t.anchorOffset,",\n        focusPath: [").concat(t.focusPath.toString(),"],\n        focusOffset: ").concat(t.focusOffset,",\n      });\n");case"type":return"      await page.keyboard.type('".concat(t,"');");default:return""}})(e.name,e.value);switch(e.count){case 1:return t;case 2:return[t,t].join("\n");default:return"      await repeat(".concat(e.count,", async () => {\n  ").concat(t,"\n      );")}};function ej(e,t){var l,n;let r=e,o=[];for(;r!==t;)null!=r&&o.unshift(Array.from(null!=(n=null==r||null==(l=r.parentNode)?void 0:l.childNodes)?n:[]).indexOf(r)),r=null==r?void 0:r.parentNode;return o}var eI=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]),eM=K({plugins:[{Component:()=>
1{let e=(0,c.c)(3),[t]=(0,p.DF)(),[l,n]=function(e){let[t,l]=(0,m.useState)([]),[n,r]=(0,m.useState)(!1),[,o]=(0,m.useState)(""),[i,a]=(0,m.useState)(""),s=(0,m.useRef)(null),u=(0,m.useRef)(!1),d=(0,m.useRef)(null),c=(0,m.useCallback)(()=>e,[e]),p=(0,m.useCallback)(()=>{let l=e.getRootElement(),n=(0,f.peL)(e._window);return null!=l&&null!=n&&null!=n.anchorNode&&null!=n.focusNode&&l.contains(n.anchorNode)&&l.contains(n.focusNode)?"\nimport {\n  initializeE2E,\n  assertHTMLSnapshot,\n  assertSelection,\n  repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n  initializeE2E((e2e) => {\n    it('Should pass this test', async () => {\n      const {page} = e2e;\n\n      await page.focus('div[contenteditable=\"true\"]');\n".concat(t.map(eN).join("\n"),"\n    });\n});\n    "):null},[e,t]),h=(0,m.useCallback)((e,n)=>{l(l=>{let r=t.length-1,o=t[r];if(o&&o.name===e){if("type"===e)return[...t.slice(0,r),{...o,value:o.value+n}];if(o.value===n)return[...t.slice(0,r),{...o,count:o.count+1}]}return[...l,{name:e,count:1,value:n}]})},[t,l]);(0,m.useLayoutEffect)(()=>{let t=e=>{if(!n)return;let t=e.key;"a"===e.key.toLowerCase()&&(eL?e.metaKey:e.ctrlKey)?h("selectAll",""):eI.has(t)?h("press",e.key):[...t].length>1?h("keydown",e.key):h("type",e.key)},l=e=>{if(!n)return;let t=e.key;!eI.has(t)&&[...t].length>1&&h("keyup",e.key)};return e.registerRootListener((e,n)=>{null!==n&&(n.removeEventListener("keydown",t),n.removeEventListener("keyup",l)),null!==e&&(e.addEventListener("keydown",t),e.addEventListener("keyup",l))})},[e,n,h]),(0,m.useLayoutEffect)(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),(0,m.useEffect)(()=>{if(t){let e=p();null!==e&&a(e),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,t]),(0,m.useEffect)(()=>e.registerUpdateListener(t=>{let{dirtyElements:l,dirtyLeaves:r,editorState:o}=t;if(!n)return;let i=o._selection,d=s.current,c=u.current;if(d!==i){if(0===r.size&&0===l.size&&!c){let t=(0,f.peL)(e._window);if(t&&(null==t.anchorNode||null==t.focusNode))return}s.current=i}u.current=!1;let h=p();null!==h&&a(h)}),[e,p,n,h]),(0,m.useEffect)(()=>n?e.registerUpdateListener(()=>{let t=e.getRootElement();null!==t&&o(null==t?void 0:t.innerHTML)}):void 0,[e,n]);let v=(0,m.useCallback)(e=>{n||(e.update(()=>{let e=(0,f.NiT)();e.clear();let t=(0,f.sTu)();e.append((0,f.lJ7)().append(t)),t.select()}),l([])),r(e=>!e)},[n]),x=(0,m.useCallback)(()=>{let t;if(!n)return;let l=(0,f.peL)(e._window);if(null===l||null==l.anchorNode||null==l.focusNode)return;let{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:a}=function(e){let{anchorNode:t,focusNode:l}=e,{anchorOffset:n,focusOffset:r}=e;return 0!==n&&n--,0!==r&&r--,{anchorNode:t,anchorOffset:n,focusNode:l,focusOffset:r}}(l),s=c().getRootElement(),u;null!==r&&(u=ej(r,s)),null!==i&&(t=ej(i,s)),h("snapshot",{anchorNode:r,anchorOffset:o,anchorPath:u,focusNode:i,focusOffset:a,focusPath:t})},[h,n,c]),b=(0,m.useCallback)(()=>{(e=>{var t,l;let n=document.createElement("textarea");n.value=e||"",n.style.position="absolute",n.style.opacity="0",null==(t=document.body)||t.appendChild(n),n.focus(),n.select();try{let e=document.execCommand("copy");console.log(e)}catch(e){console.error(e)}null==(l=document.body)||l.removeChild(n)})(p())},[p]),C=(0,m.useCallback)(()=>{var e,t,l;let n;e=p(),(n=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),n.setAttribute("download","test.js"),n.style.display="none",null==(t=document.body)||t.appendChild(n),n.click(),null==(l=document.body)||l.removeChild(n)},[p]);return[(0,g.jsx)("button",{className:"editor-dev-button ".concat(n?"active":""),id:"test-recorder-button",onClick:e=>{v(c()),e.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?(0,g.jsxs)("div",{className:"test-recorder-output",children:[(0,g.jsxs)("div",{className:"test-recorder-toolbar",children:[(0,g.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:e=>{x(),e.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),(0,g.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:e=>{b(),e.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),(0,g.jsx)("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:e=>{C(),e.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),(0,g.jsx)("pre",{id:"test-recorder",ref:d,children:i})]}):null]}(t),r;return e[0]!==l||e[1]!==n?(r=(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("p",{children:"HI"}),l,n,(0,g.jsx)("p",{children:"DONE"})]}),e[0]=l,e[1]=n,e[2]=r):r=e[2],r},position:"bottom"}]}),eF=K({plugins:[{Component:()=>
1{let e=(0,c.c)(2),[t]=(0,p.DF)(),l;return e[0]!==t?(l=(0,g.jsx)(M.G,{editor:t,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"}),e[0]=t,e[1]=l):l=e[1],l},position:"bottom"}]}),eR=e=>({type:"buttons",items:e,key:"format",order:40}),eP={type:"text-format",format:["bold","italic"],tag:"***"},eA={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},eD={type:"text-format",format:["bold"],tag:"**"},eB={type:"text-format",format:["bold"],intraword:!1,tag:"__"},eH=[eR([{ChildComponent:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("bold")},key:"bold",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"bold")},order:1}])],eO=K(e=>{let{featureProviderMap:t}=e,l=[eD,eB];return t.get("italic")&&l.push(eA,eP),{enableFormats:["bold"],markdownTransformers:l,toolbarFixed:{groups:eH},toolbarInline:{groups:eH}}}),eJ=[eR([{ChildComponent:()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),(0,g.jsx)("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("code")},key:"inlineCode",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"code")},order:7}])],ez=K({enableFormats:["code"],markdownTransformers:[{type:"text-format",format:["code"],tag:"`"}],toolbarFixed:{groups:eJ},toolbarInline:{groups:eJ}}),eV=[eR([{ChildComponent:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("italic")},key:"italic",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"italic")},order:2}])],eW=K({enableFormats:["italic"],markdownTransformers:[{type:"text-format",format:["italic"],tag:"*"},{type:"text-format",format:["italic"],intraword:!1,tag:"_"}],toolbarFixed:{groups:eV},toolbarInline:{groups:eV}}),eZ=[eR([{ChildComponent:()=>(0,g.jsxs)("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:[(0,g.jsx)("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.
118C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,g.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("strikethrough")},key:"strikethrough",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"strikethrough")},order:4}])],eK=K({enableFormats:["strikethrough"],markdownTransformers:[{type:"text-format",format:["strikethrough"],tag:"~~"}],toolbarFixed:{groups:eZ},toolbarInline:{groups:eZ}}),eU=[eR([{ChildComponent:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("subscript")},key:"subscript",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"subscript")},order:5}])],eG=K({enableFormats:["subscript"],toolbarFixed:{groups:eU},toolbarInline:{groups:eU}}),eq=[eR([{ChildComponent:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("superscript")},key:"superscript",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"superscript")},order:6}])],eX=K({enableFormats:["superscript"],toolbarFixed:{groups:eq},toolbarInline:{groups:eq}}),eY=[eR([{ChildComponent:()=>(0,g.jsxs)("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:[(0,g.jsx)("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"}),(0,g.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),isActive:e=>{let{selection:t}=e;return!!((0,f.I2P)(t)||(0,F.Ln)(t))&&t.hasFormat("underline")},key:"underline",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.mB,"underline")},order:3}])],e$=K({enableFormats:["underline"],toolbarFixed:{groups:eY},toolbarInline:{groups:eY}}),eQ=e=>{let{css:t}=e,l=t?Object.fromEntries(Object.entries(t).map(e=>{let[t,l]=e;return[t.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),l]})):{};return(0,g.jsx)("span",{style:{...l,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};function e0(e,t,l,n){e.update(()=>{(0,x.Vs)(e=>{let r=t.get(l);if(!r)throw Error("State config for ".concat(l," not found"));(0,f.Chh)(e,r.stateConfig,n)})})}var e1=(e,t)=>{let l=[];for(let n in e.state){let r=e.state[n];for(let e in r){let o=r[e];l.push({ChildComponent:()=>(0,g.jsx)(eQ,{css:o.css}),key:e,label:o.label,onSelect:l=>{let{editor:r}=l;e0(r,t,n,e)}})}}return[{type:"dropdown",ChildComponent:()=>(0,g.jsx)(eQ,{css:{color:"var(--theme-elevation-600)"}}),items:[{ChildComponent:()=>(0,g.jsx)(eQ,{}),key:"clear-style",label:e=>{let{i18n:t}=e;return t.t("lexical:textState:defaultStyle")},onSelect:l=>{let{editor:n}=l;
1for(let l in e.state)e0(n,t,l,void 0)},order:1},...l],key:"textState",order:30}]},e2=K(e=>{let{props:t}=e,l=function(e){let t=new Map;for(let l in e){let n=e[l],r=(0,f.urt)(l,{parse:e=>"string"==typeof e&&Object.keys(n).includes(e)?e:void 0});t.set(l,{stateConfig:r,stateValues:n})}return t}(t.state);return{plugins:[{Component:()=>(function(e){let{stateMap:t}=e,[l]=(0,p.DF)();return(0,m.useEffect)(()=>l.registerMutationListener(f.Ey8,e=>{l.getEditorState().read(()=>{for(let[n,r]of e){if("destroyed"===r)continue;let e=(0,f.nsf)(n),o=l.getElementByKey(n);if(!e||!o)continue;let i=Object.create(null);t.forEach((t,l)=>{var n;let r=(0,f.I8X)(e,t.stateConfig);if(!r)return void delete o.dataset[l];o.dataset[l]=r;let a=null==(n=t.stateValues[r])?void 0:n.css;a&&Object.assign(i,a)}),o.style.cssText="",Object.assign(o.style,i)}})}),[l]),null})({stateMap:l}),position:"normal"}],toolbarFixed:{groups:e1(t,l)},toolbarInline:{groups:e1(t,l)}}}),e6=e=>(t,l,n)=>{let r=e(n);r&&(r.append(...l),t.replace(r),r.select(0,0))},e5=e=>{let t=(0,f.vJq)();(0,x.zI)(t,()=>(0,v.fi)(e))},e3={h1:()=>(0,g.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("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"})}),h2:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),h3:()=>(0,g.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("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"})}),h4:()=>(0,g.jsx)("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:(0,g.jsx)("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"})}),h5:()=>(0,g.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("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"})}),h6:()=>(0,g.jsx)("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:(0,g.jsx)("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"})})},e4=K(e=>{let{props:t}=e,{enabledHeadingSizes:l=["h1","h2","h3","h4","h5","h6"]}=t,n=[ee(l.map((e,t)=>({ChildComponent:e3[e],isActive:t=>{let{selection:l}=t;if(!(0,f.I2P)(l))return!1;for(let t of l.getNodes()){if((0,v.Pi)(t)&&t.getTag()===e)continue;let l=t.getParent();if(!((0,v.Pi)(l)&&l.getTag()===e))return!1}return!0},key:e,label:t=>{let{i18n:l}=t;return l.t("lexical:heading:label",{headingLevel:e.charAt(1)})},onSelect:t=>{let{editor:l}=t;l.update(()=>{e5(e)})},order:t+2})))];return{markdownTransformers:[(e=>{let t=new RegExp("^(".concat(e.map(e=>Number(e.slice(1))).map(e=>"#{".concat(e,"}")).join("|"),")\\s"));return{type:"element",dependencies:[v.jL],export:(e,t)=>{if(!(0,v.Pi)(e))return null;let l=Number(e.getTag().slice(1));return"#".repeat(l)+" "+t(e)},regExp:t,replace:e6(e=>{var t;let l="h"+(null==(t=e[1])?void 0:t.length);return(0,v.fi)(l)})}})(l)],nodes:[v.jL],plugins:[{Component:e7,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:(null==l?void 0:l.length)?[W(l.map(e=>({Icon:e3[e],key:"heading-".concat(e.charAt(1)),keywords:["heading",e],label:t=>{let{i18n:l}=t;return l.t("lexical:heading:label",{headingLevel:e.charAt(1)})},onSelect:t=>{let{editor:l}=t;l.update(()=>{e5(e)})}})))]:[]},toolbarFixed:{groups:(null==l?void 0:l.length)?n:[]},toolbarInline:{groups:(null==l?void 0:l.length)?n:[]}}}),e7=e=>{let t=(0,c.c)(9),{clientProps:l}=e,{enabledHeadingSizes:n}=l,r;t[0]!==n?(r=void 0===n?["h1","h2","h3","h4","h5","h6"]:n,t[0]=n,t[1]=r):r=t[1];let o=r,i;t[2]!==o?(i=o.at(-1),t[2]=o,t[3]=i):i=t[3];let a=i,[s]=(0,p.DF)(),u,d;return t[4]!==s||t[5]!==o||t[6]!==a?(u=()=>{if(!(!a||6===o.length))return s.registerNodeTransform(v.jL,e=>{o.includes(e.getTag())||e.setTag(a)})},d=[s,o,a],t[4]=s,t[5]=o,t[6]=a,t[7]=u,t[8]=d):(u=t[7],d=t[8]),(0,m.useEffect)(u,d),null},e8=()=>(0,g.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})}),e9=()=>(0,g.jsxs)("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M5 10h10",stroke:"currentColor"}),(0,g.jsx)("path",{d:"M10 15V5",stroke:"currentColor"})]}),te=e=>({type:"dropdown",ChildComponent:e9,items:e,key:"add",order:10}),tt=(0,f.guI)("INSERT_HORIZONTAL_RULE_COMMAND"),tl=class extends f.Kp7{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:tn,priority:0})}}static importJSON(e){return tr()}createDOM(e){let t=document.createElement("hr");return(0,f.ZB7)(t,e.theme.hr),t}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}};function tn(){return{node:tr()}}function tr(){return(0,f.pTq)(new tl)}var to=class extends tl{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return ti()}decorate(){return null}exportJSON(){return super.exportJSON()}};function ti(){return(0,f.pTq)(new to)}function ta(e){return e instanceof to}function ts(e){let t=(0,f.vJq)();if(!(0,f.I2P)(t))return!1;if(null!==t.focus.getNode()){let e=ti();(0,I.Pe)(e)}return!0}var tu=K({markdownTransformers:[{type:"element",dependencies:[to],export:(e,t)=>ta(e)?"---":null,regExp:/^---\s*$/,replace:e=>{let t=ti();t&&e.replace(t)}}],nodes:[to],plugins:[{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(tt,ts,f.jZM),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,m.useEffect)(l,n),null},position:"normal"}],slashMenu:{groups:[W([{Icon:e8,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:e=>{let{i18n:t}=e;return t.t("lexical:horizontalRule:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(tt,void 0)}}])]},toolbarFixed:{groups:[te([{ChildComponent:e8,isActive:e=>{let{selection:t}=e;return!!(0,f.RTZ)(t)&&!!t.getNodes().length&&ta(t.getNodes()[0])},key:"horizontalRule",label:e=>{let{i18n:t}=e;return t.t("lexical:horizontalRule:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(tt,void 0)}}])]}}),td=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]}),tc=()=>(0,g.jsxs)("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:[(0,g.jsx)("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]}),tp=e=>{let{clientProps:t}=e,[l]=(0,p.DF)(),{disabledNodes:n,disableTabNode:r}=t;return(0,m.useEffect)(()=>{if(!(!l||!(null==n?void 0:n.length)))return(0,f.Sdt)(l.registerCommand(f.PiT,()=>(function(e){let t=(0,f.vJq)();if(!(0,f.I2P)(t))return!1;let l=new Set,n=t.getNodes();for(let t=0;t<n.length;t++){let r=n[t],o=r.getKey();if(l.has(o))continue;let i=(0,f.BtT)(r,e=>(0,f.ff4)(e)&&!e.isInline());if(null===i)continue;let a=i.getKey();i.canIndent()&&!l.has(a)&&(l.add(a),e(i))}return l.size>0})(e=>{if(!n.includes(e.getType())){let t=e.getIndent();e.setIndent(t+1)}}),f.AcJ),l.registerUpdateListener(e=>{let{dirtyElements:t,editorState:r}=e;l.update(()=>{for(let[e]of t){let t=r._nodeMap.get(e);(0,f.ff4)(t)&&n.includes(t.getType())&&t.getIndent()>0&&t.setIndent(0)}})}))},[l,n]),(0,m.useEffect)(()=>{if(!(!l||!r))return(0,f.Sdt)(l.registerCommand(f.OXk,e=>(e.preventDefault(),l.dispatchCommand(e.shiftKey?f.sik:f.PiT,void 0)),f.AcJ),l.registerNodeTransform(f.MZu,e=>{e.remove()}))},[l,r]),(0,g.jsx)(R.m,{})},th=e=>{let{disabledNodes:t}=e;return[{type:"buttons",items:[{ChildComponent:td,isActive:()=>!1,isEnabled:e=>{var t;let{selection:l}=e,n=null!=(t=null==l?void 0:l.getNodes())?t:[],r=e=>tm(e)&&e.getIndent()>0;return n.some(e=>r(e)||!!(0,f.BtT)(e,r))},key:"indentDecrease",label:e=>{let{i18n:t}=e;return t.t("lexical:indent:decreaseLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.sik,void 0)},order:1},{ChildComponent:tc,isActive:()=>!1,isEnabled:e=>{var l;let{selection:n}=e,r=null!=(l=null==n?void 0:n.getNodes())?l:[],o=e=>tm(e)&&!(null!=t?t:[]).includes(e.getType());return r.some(e=>o(e)||!!(0,f.BtT)(e,o))},key:"indentIncrease",label:e=>{let{i18n:t}=e;return t.t("lexical:indent:increaseLabel")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(f.PiT,void 0)},order:2}],key:"indent",order:35}]},tf=K(e=>{var t;let{props:l}=e,n=null!=(t=l.disabledNodes)?t:[];return{plugins:[{Component:tp,position:"normal"}],sanitizedClientFeatureProps:l,toolbarFixed:{groups:th({disabledNodes:n})},toolbarInline:{groups:th({disabledNodes:n})}}}),tm=e=>(0,f.ff4)(e)&&e.canIndent();function tg(e){let{anchor:t}=e,{focus:l}=e,n=e.anchor.getNode(),r=e.focus.getNode();return n===r?n:e.isBackward()?(0,x.Nx)(l)?n:r:(0,x.Nx)(t)?n:r}var tv=e=>({type:"buttons",items:e,key:"features",order:50});function tx(e){return null!=(e=String(e).trim()).match(/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi)||null!=e.match(/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i)?e:"https://"}var tb=/^(?:[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+)?$/,tC=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/,tk=new Set(["http:","https:","mailto:","sms:","tel:"]),ty=class extends f.fGB{static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:tw,priority:1})}}static importJSON(e){var t,l,n,r,o;let i=tS({}).updateFromJSON(e);return 1===e.version&&"object"==typeof(null==(l=e.fields)||null==(t=l.doc)?void 0:t.value)&&(null==(o=e.fields)||null==(r=o.doc)||null==(n=r.value)?void 0:n.id)&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),2!==e.version||e.id||(e.id=new k.default().toHexString(),e.version=3),i}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){var t,l,n,r,o,i;let a=document.createElement("a");return(null==(t=this.__fields)?void 0:t.linkType)==="custom"&&(a.href=this.sanitizeUrl(null!=(o=this.__fields.url)?o:"")),null!=(i=null==(l=this.__fields)?void 0:l.newTab)&&i&&(a.target="_blank"),(null==(n=this.__fields)?void 0:n.newTab)===!0&&(null==(r=this.__fields)?void 0:r.linkType)==="custom"&&(a.rel=tL(a.rel,"add","noopener")),(0,f.ZB7)(a,e.theme.link),a}exportJSON(){let e=this.getFields();(null==e?void 0:e.linkType)==="internal"?delete e.url:(null==e?void 0:e.linkType)==="custom"&&delete e.doc;let t={...super.exportJSON(),type:"link",fields:e,version:3},l=this.getID();return l&&(t.id=l),t}extractWithChild(e,t,l){if(!(0,f.I2P)(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&t.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],l=this.getParentOrThrow().insertNewAfter(e,t);if((0,f.ff4)(l)){let e=tS({fields:this.__fields});return l.append(e),e}return null}isInline(){return!0}sanitizeUrl(e){try{let t=new URL(e);if(!tk.has(t.protocol))return"about:blank"}catch(e){return"https://"}return e}setFields(e){let t=this.getWritable();return t.__fields=e,t}setID(e){let t=this.getWritable();return t.__id=e,t}updateDOM(e,t,l){var n,r,o,i,a,s,u,d;let c=null==(n=this.__fields)?void 0:n.url,p=null==(r=this.__fields)?void 0:r.newTab;return null!=c&&c!==(null==(o=e.__fields)?void 0:o.url)&&(null==(i=this.__fields)?void 0:i.linkType)==="custom"&&(t.href=c),(null==(a=this.__fields)?void 0:a.linkType)==="internal"&&(null==(s=e.__fields)?void 0:s.linkType)==="custom"&&t.removeAttribute("href"),null==t.rel&&(t.rel=""),p!==(null==(u=e.__fields)?void 0:u.newTab)&&(null!=p&&p?(t.target="_blank",(null==(d=this.__fields)?void 0:d.linkType)==="custom"&&(t.rel=tL(t.rel,"add","noopener"))):(t.removeAttribute("target"),t.rel=tL(t.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}constructor({id:e,fields:t={linkType:"custom",newTab:!1},key:l}){super(l),this.__fields=t,this.__id=e}};function tw(e){let t=null;if((0,f.nYP)(e)){var l;let n=e.textContent;null!==n&&""!==n&&(t=tS({id:new k.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:"_blank"===e.getAttribute("target"),url:null!=(l=e.getAttribute("href"))?l:""}}))}return{node:t}}function tS(e){let{id:t,fields:l}=e;return(0,f.pTq)(new ty({id:null!=t?t:new k.default().toHexString(),fields:l}))}function tE(e){return e instanceof ty}var tT=(0,f.guI)("TOGGLE_LINK_COMMAND");function t_(e){var t;let l=(0,f.vJq)();if(!(0,f.I2P)(l)&&(null===e||!(null==(t=e.selectedNodes)?void 0:t.length)))return;let n=(0,f.I2P)(l)?l.extract():null===e?[]:e.selectedNodes;
1if(null===e){null==n||n.forEach(e=>{let t=e.getParent();tE(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())});return}if((null==n?void 0:n.length)===1){let t=n[0],l=tE(t)?t:function(e){var t=e,l=e=>tE(e);let n=t;for(;null!==n&&!(null===(n=n.getParent())||l(n)););return n}(t);if(null!==l){l.setFields(e.fields),null!=e.text&&e.text!==l.getTextContent()&&(l.append((0,f.sTu)(e.text)),l.getChildren().forEach(e=>{e!==l.getLastChild()&&e.remove()}));return}}let r=null,o=null;null==n||n.forEach(t=>{let l=t.getParent();if(!(l===o||null===l||(0,f.ff4)(t)&&!t.isInline())){if(tE(l)){o=l,l.setFields(e.fields),null!=e.text&&e.text!==l.getTextContent()&&(l.append((0,f.sTu)(e.text)),l.getChildren().forEach(e=>{e!==l.getLastChild()&&e.remove()}));return}if(l.is(r)||(r=l,o=tS({fields:e.fields}),tE(l)?null===t.getPreviousSibling()?l.insertBefore(o):l.insertAfter(o):t.insertBefore(o)),tE(t)){if(t.is(o))return;if(null!==o){let e=t.getChildren();o.append(...e)}t.remove();return}null!==o&&o.append(t)}})}function tL(e,t,l){let n,r="".concat(e);if("add"===t){if(r.includes(l)){let e=RegExp(l,"g");r=r.replace(e,"").trim()}n=0===(r=r.trim()).length?"".concat(l):"".concat(r," ").concat(l)}else{let e=RegExp(l,"g");n=r.replace(e,"").trim()}return n}var tN=(e,t)=>{let[,l,n]=t,r=tS({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),o=(0,f.sTu)(l);return o.setFormat(e.getFormat()),r.append(o),e.replace(r),o},tj=(e=>({type:"text-match",dependencies:[ty],export:(t,l)=>{var n;if(!tE(t))return null;let r=t.getFields(),o;return"internal"===r.linkType?(null==e?void 0:e.internalDocToHref)?o=tx(e.internalDocToHref({linkNode:t.exportJSON()})):(console.warn("Lexical → Markdown converter: found internal link but internalDocToHref is not provided — link will have an empty href"),o=""):o=tx(null!=(n=r.url)?n:""),"[".concat(l(t),"](").concat(o,")")},importRegExp:RegExp('(?<!!)\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s"((?:[^"]*\\\\")*[^"]*)"\\s*)?\\)'),regExp:RegExp('(?<!!)\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s"((?:[^"]*\\\\")*[^"]*)"\\s*)?\\)$'),replace:tN,trigger:")"}))(),tI=class extends ty{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){var t,l,n,r,o;let i=tM({}).updateFromJSON(e);return 1===e.version&&"object"==typeof(null==(l=e.fields)||null==(t=l.doc)?void 0:t.value)&&(null==(o=e.fields)||null==(r=o.doc)||null==(n=r.value)?void 0:n.id)&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),i}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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],l=this.getParentOrThrow().insertNewAfter(e,t);if((0,f.ff4)(l)){let e=tM({fields:this.__fields});return l.append(e),e}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function tM(e){let{fields:t}=e;return(0,f.pTq)(new tI({id:"",fields:t}))}function tF(e){return e instanceof tI}function tR(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return l=>{let n=e.exec(l);return null===n?null:{index:n.index,length:n[0].length,text:n[0],url:t(n[0])}}}function tP(e,t){for(let l of t){let t=l(e);if(null!=t)return t}return null}var tA=/[.,;\s]/;function tD(e){return void 0!==e&&tA.test(e)}function tB(e){return tD(e[e.length-1])}function tH(e){let t=e.getPreviousSibling();return(0,f.ff4)(t)&&(t=t.getLastDescendant()),null===t||(0,f.wH$)(t)||(0,f.kFe)(t)&&tB(t.getTextContent())}function tO(e){let t=e.getNextSibling();return(0,f.ff4)(t)&&(t=t.getFirstDescendant()),null===t||(0,f.wH$)(t)||(0,f.kFe)(t)&&tD(t.getTextContent()[0])}function tJ(e,t,l){var n,r,o,i,a,s,u;let d=e.getChildren(),c=d.length;for(let t=0;t<c;t++){let n=d[t];if(!(0,f.kFe)(n)||!n.isSimpleText()){tz(e),l(null,null!=(o=null==(r=e.getFields())?void 0:r.url)?o:null);return}}let p=e.getTextContent(),h=tP(p,t);if(null===h||h.text!==p){tz(e),l(null,null!=(a=null==(i=e.getFields())?void 0:i.url)?a:null);return}if(!tH(e)||!tO(e)){tz(e),l(null,null!=(u=null==(s=e.getFields())?void 0:s.url)?u:null);return}let m=null==(n=e.getFields())?void 0:n.url;if(m!==(null==h?void 0:h.url)){let t=e.getFields();t.url=null==h?void 0:h.url,e.setFields(t),l(h.url,null!=m?m:null)}}function tz(e){let t=e.getChildren(),l=t.length;for(let n=l-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(e=>e.getLatest())}var tV=[tR(RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-\\w@:%.+~#=]{1,256}\\.[a-zA-Z\\d()]{1,6}\\b([-\\w()@:%+.~#?&/=]*)(?<![-.+():%])"),e=>e.startsWith("http")?e:"https://".concat(e)),tR(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,e=>"mailto:".concat(e))],tW=()=>{let[e]=(0,p.DF)();return function(e,t,l){let n=(0,c.c)(5),r,o;n[0]!==e||n[1]!==t||void 0!==n[2]?(r=()=>{if(!e.hasNodes([tI]))throw Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let l=(e,t)=>
1{};return(0,f.Sdt)(e.registerNodeTransform(f.Ey8,e=>{let n=e.getParentOrThrow(),r=e.getPreviousSibling();tF(n)?tJ(n,t,l):tE(n)||(e.isSimpleText()&&(tD(e.getTextContent()[0])||!tF(r))&&function(e,t,l){let n=[...e],r=n.map(e=>e.getTextContent()).join(""),o=r,i,a=0;for(;null!=(i=tP(o,t))&&null!==i;){var s,u,d;let e=i.index,t=e+i.length;if(s=a+e,u=a+t,d=n,(s>0?!!tD(r[s-1]):!!tH(d[0]))&&(u<r.length?tD(r[u]):tO(d[d.length-1]))){let[r,,o,s]=function(e,t,l){let n=[],r=[],o=[],i=0,a=0,s=[...e];for(;s.length>0;){let e=s[0],u=e.getTextContent().length,d=a;a+u<=t?(n.push(e),i+=u):d>=l?o.push(e):r.push(e),a+=u,s.shift()}return[i,n,r,o]}(n,a+e,a+t),u=function(e,t,l,n){let r=tM({fields:{linkType:"custom",url:n.url,...n.fields}});if(1===e.length){let o=e[0],i;if(0===t?[i]=o.splitText(l):[,i]=o.splitText(t,l),i){let e=(0,f.sTu)(n.text);e.setFormat(i.getFormat()),e.setDetail(i.getDetail()),e.setStyle(i.getStyle()),r.append(e),i.replace(r)}return o}if(e.length>1){let n=e[0],o=n.getTextContent().length,i;0===t?i=n:[,i]=n.splitText(t);let a=[],s;if(e.forEach(e=>{let t=e.getTextContent().length,n=o,r=o+t;if(n<l)if(r<=l)a.push(e);else{let[t,r]=e.splitText(l-n);t&&a.push(t),s=r}o+=t}),i){let e=(0,f.vJq)(),t=e?e.getNodes().find(f.kFe):void 0,l=(0,f.sTu)(i.getTextContent());return l.setFormat(i.getFormat()),l.setDetail(i.getDetail()),l.setStyle(i.getStyle()),r.append(l,...a),t&&t===i&&((0,f.I2P)(e)?l.select(e.anchor.offset,e.focus.offset):(0,f.RTZ)(e)&&l.select(0,l.getTextContent().length)),i.replace(r),s}}}(o,a+e-r,a+t-r,i);n=u?[u,...s]:s,l(i.url,null),a=0}else a+=t;o=o.substring(t)}}(function(e){let t=[e],l=e.getNextSibling();for(;null!==l&&(0,f.kFe)(l)&&l.isSimpleText()&&(t.push(l),!/\s/.test(l.getTextContent()));)l=l.getNextSibling();return t}(e),t,l),!function(e,t,l){var n,r,o,i,a,s,u,d;let c=e.getPreviousSibling(),p=e.getNextSibling(),h=e.getTextContent();if(tF(c)){let n=null!=(r=c.getFields())&&!!r.url&&null!=(s=null==(i=c.getFields())||null==(o=i.url)?void 0:o.startsWith("mailto:"))&&s;(!tD(h[0])||(n?/^\.[a-z]{2,}/i.test(h):/^\.[a-z0-9]+/i.test(h)))&&(c.append(e),tJ(c,t,l),l(null,null!=(u=null==(a=c.getFields())?void 0:a.url)?u:null))}tF(p)&&!tB(h)&&(tz(p),tJ(p,t,l),l(null,null!=(d=null==(n=p.getFields())?void 0:n.url)?d:null))}(e,t,l))}))},o=[e,t,l],n[0]=e,n[1]=t,n[2]=l,n[3]=r,n[4]=o):(r=n[3],o=n[4]),(0,m.useEffect)(r,o)}(e,tV),null},tZ=()=>(0,g.jsx)(P.g,{});function tK(e,t,l){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,o=l.parentElement;if(null===e||null==o){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let i=l.getBoundingClientRect(),a=o.getBoundingClientRect(),s=e.top-n,u=e.left-r;t.style.width="max-content",t.style.maxWidth="none";let d=t.scrollWidth,c=a.right-u,p=u-a.left,h;if(d<=c)h=t.getBoundingClientRect();else{let l=p+e.width,n=p>c,r=Math.min(d,n?l:c);r<d&&(t.style.width="".concat(r,"px"),t.style.maxWidth="".concat(r,"px"),t.offsetHeight),n&&(u=e.right-r),h=t.getBoundingClientRect()}s<a.top&&(s+=h.height+e.height+2*n),u+h.width>a.right&&(u=a.right-h.width-r),s-=i.top,u-=i.left,t.style.opacity="1",t.style.transform="translate(".concat(u,"px, ").concat(s,"px)")}var tU=(0,f.guI)("TOGGLE_LINK_WITH_MODAL_COMMAND");function tG(e){e.preventDefault()}function tq(e){let{anchorElem:t}=e,[l]=(0,p.DF)(),[n,r]=(0,m.useState)(),o=(0,m.useRef)(null),s=(0,m.useRef)(null),[u,c]=(0,m.useState)(null),[h,v]=(0,m.useState)(null),{fieldProps:{schemaPath:x},uuid:C}=(0,d.b)(),k=(0,y.a)(),{config:_,getEntityConfig:L}=(0,S.c)(),{i18n:N,t:j}=(0,E.d)(),[I,M]=(0,m.useState)(),F=(0,w.useEditDepth)(),[R,P]=(0,m.useState)(!1),[A,B]=(0,m.useState)([]),H=(0,w.useLocale)(),[O,J]=(0,m.useState)(!1),z=(0,w.formatDrawerSlug)({slug:"lexical-rich-text-link-"+C,depth:F}),{toggleDrawer:V}=(0,a.a)(z),W=(0,m.useCallback)(()=>{P(!1),o&&o.current&&(o.current.style.opacity="0",o.current.style.transform="translate(-10000px, -10000px)"),J(!1),c(null),v(null),B([]),M(void 0)},[P,c,v,B]),Z=(0,m.useCallback)(()=>{var e,n,i,a,u,d,p,h,m;let g=(0,f.vJq)(),x;if(!(0,f.I2P)(g)||!g)return void W();let C=tg(g);x=null==(e=l.getElementByKey(C.getKey()))?void 0:e.getBoundingClientRect();let k=(0,f.BtT)(C,tE),y=g.getNodes().filter(e=>!(0,f.wH$)(e)).find(e=>{let t=(0,f.BtT)(e,tE);return k&&!k.is(t)||t&&!t.is(k)});if(null==k||y)return void W();r(k);let w=k.getFields(),S={...w,id:k.getID(),text:k.getTextContent()};if((null==w?void 0:w.linkType)==="custom")c(null!=(n=null==w?void 0:w.url)?n:null),v(null);else{c("".concat("/"===_.routes.admin?"":_.routes.admin,"/collections/").concat(null==w||null==(i=w.doc)?void 0:i.relationTo,"/").concat(null==w||null==(a=w.doc)?void 0:a.value));let e=(null==w||null==(u=w.doc)?void 0:u.relationTo)?L({collectionSlug:null==w||null==(d=w.doc)?void 0:d.relationTo}):void 0;if(e){let t="object"==typeof(null==(p=w.doc)?void 0:p.value)?w.doc.value.id:null==(h=w.doc)?void 0:h.value,l=null==(m=w.doc)?void 0:m.relationTo;if(!t||!l)throw Error("Focus link parent is missing doc.value or doc.relationTo");v(j("fields:linkedTo",{label:"".concat((0,b.s)(e.labels.singular,N
1)," - ").concat(j("lexical:link:loadingWithEllipsis",N))}).replace(/<[^>]*>?/g,"")),T.zG.get((0,D.Q)({apiRoute:_.routes.api,path:"/".concat(l,"/").concat(t),serverURL:_.serverURL}),{headers:{"Accept-Language":N.language},params:{depth:0,locale:null==H?void 0:H.code}}).then(async t=>{var l;if(!t.ok)throw Error("HTTP error! Status: ".concat(t.status));let n=(await t.json())[(null==e||null==(l=e.admin)?void 0:l.useAsTitle)||"id"];v(j("fields:linkedTo",{label:"".concat((0,b.s)(e.labels.singular,N)," - ").concat(n)}).replace(/<[^>]*>?/g,""))}).catch(()=>{v(j("fields:linkedTo",{label:"".concat((0,b.s)(e.labels.singular,N)," - ").concat(j("general:untitled",N)," - ID: ").concat(t)}).replace(/<[^>]*>?/g,""))})}else v((null==w?void 0:w.label)?String(null==w?void 0:w.label):null),c((null==w?void 0:w.url)?String(null==w?void 0:w.url):null)}M(S),P(!0),B(g?null==g?void 0:g.getNodes():[]),tF(k)?J(!0):J(!1);let E=o.current,I=(0,f.peL)(l._window),{activeElement:F}=document;if(null===E)return;let R=l.getRootElement();return null!==I&&null!==R&&R.contains(I.anchorNode)?(x||(x=I.getRangeAt(0).getBoundingClientRect()),null!=x&&(x.y+=40,s.current=x)):(null==F||"link-input"!==F.className)&&(null!==R&&tK(null,E,t),c(null),v(null)),!0},[l,W,_.routes.admin,_.routes.api,_.serverURL,L,j,N,null==H?void 0:H.code,t]);return(0,m.useEffect)(()=>(0,f.Sdt)(l.registerCommand(tU,e=>(l.dispatchCommand(tT,e),Z(),V(),!0),f.AcJ)),[l,Z,V,z]),(0,m.useEffect)(()=>{let e=t.parentElement,n=()=>{l.getEditorState().read(()=>{Z()})};return window.addEventListener("resize",n),null==e||e.addEventListener("scroll",n),()=>{window.removeEventListener("resize",n),null==e||e.removeEventListener("scroll",n)}},[t.parentElement,l,Z]),(0,m.useEffect)(()=>(0,f.Sdt)(l.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{Z()})}),l.registerCommand(f.MvL,()=>(Z(),!0),f.AcJ),l.registerCommand(f.Q$N,()=>!!R&&(W(),!0),f.WgU)),[l,Z,R,W]),(0,m.useEffect)(()=>{l.getEditorState().read(()=>{Z()})},[l,Z]),(0,m.useLayoutEffect)(()=>{R&&o.current&&t&&s.current&&tK(s.current,o.current,t)},[u,h,R,t,n]),(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("div",{className:"link-editor",ref:o,children:(0,g.jsxs)("div",{className:"link-input",children:[u&&u.length>0?(0,g.jsxs)("a",{href:u,rel:"noopener noreferrer",target:"_blank",children:[(null==n?void 0:n.__fields.newTab)?(0,g.jsx)(w.ExternalLinkIcon,{}):null,null!=h&&h.length>0?h:u]}):null!=h&&h.length>0?(0,g.jsxs)(g.Fragment,{children:[(null==n?void 0:n.__fields.newTab)?(0,g.jsx)(w.ExternalLinkIcon,{}):null,(0,g.jsx)("span",{className:"link-input__label-pure",children:h})]}):null,k&&(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("button",{"aria-label":"Edit link",className:"link-edit",onClick:e=>{e.preventDefault(),V()},onMouseDown:tG,tabIndex:0,type:"button",children:(0,g.jsx)(w.EditIcon,{})}),!O&&(0,g.jsx)("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{l.dispatchCommand(tT,null)},onMouseDown:tG,tabIndex:0,type:"button",children:(0,g.jsx)(w.CloseMenuIcon,{})})]})]})}),(0,g.jsx)(i.a,{className:"lexical-link-edit-drawer",data:I,drawerSlug:z,drawerTitle:j("fields:editLink"),featureKey:"link",handleDrawerSubmit:(e,t)=>{let n={...t};delete n.text,l.update(()=>{var e,t;let l=(0,f.vJq)(),r=null;if((0,f.I2P)(l)?r=tg(l).getParent():A.length&&(r=null!=(t=null==(e=A[0])?void 0:e.getParent())?t:null),r&&tF(r)){let e=tS({fields:n});r.replace(e,!0)}}),l.dispatchCommand(tT,{fields:n,selectedNodes:A,text:t.text})},schemaPath:x,schemaPathSuffix:"fields"})]})}var tX=e=>{let{anchorElem:t=document.body}=e;return(0,A.createPortal)((0,g.jsx)(tq,{anchorElem:t}),t)},tY=e=>{let t=(0,c.c)(5),{clientProps:l}=e,[n]=(0,p.DF)(),r,o;return t[0]!==l.defaultLinkType||t[1]!==l.defaultLinkURL||t[2]!==n?(r=()=>{if(!n.hasNodes([ty]))throw Error("LinkPlugin: LinkNode not registered on editor");return(0,f.Sdt)(n.registerCommand(tT,e=>{var t,n;return null===e?t_(null):((null==(t=e.fields)?void 0:t.linkType)||(e.fields.linkType=l.defaultLinkType),(null==(n=e.fields)?void 0:n.url)||(e.fields.url=l.defaultLinkURL),t_(e)),!0},f.AcJ),n.registerCommand(f.waI,e=>{let t=(0,f.vJq)();if(!(0,f.I2P)(t)||t.isCollapsed()||!(e instanceof ClipboardEvent)||null==e.clipboardData)return!1;let l=e.clipboardData.getData("text");return!!function(e){if(!e||e.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(e))return!1;if("https://"===e||tb.test(e)||tC.test(e))return!0;try{let t=new URL(e);return!(["ftp:","http:","https:"].includes(t.protocol)&&!t.hostname.includes("."))}catch(e){}return!1}(l)&&!t.getNodes().some(t$)&&(n.dispatchCommand(tT,{fields:{doc:null,linkType:"custom",newTab:!1,url:l},text:null}),e.preventDefault(),!0)},f.AcJ))},o=[l.defaultLinkType,l.defaultLinkURL,n],t[0]=l.defaultLinkType,t[1]=l.defaultLinkURL,t[2]=n,t[3]=r,t[4]=o):(r=t[3],o=t[4]),(0,m.useEffect)(r,o),null};function t$(e){return(0,f.ff4)(e)}var tQ=[tv([{ChildComponent:()=>(0,g.jsx)("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:(0,g.jsx)("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.
1118 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"})}),isActive:e=>{let{selection:t}=e;if((0,f.I2P)(t)){let e=tg(t);return null!=(0,f.BtT)(e,tE)}return!1},isEnabled:e=>{var t,l;let{selection:n}=e;return!!((0,f.I2P)(n)&&(null==(l=(0,f.vJq)())||null==(t=l.getTextContent())?void 0:t.length))},key:"link",label:e=>{let{i18n:t}=e;return t.t("lexical:link:label")},onSelect:e=>{let{editor:t,isActive:l}=e;if(l)t.dispatchCommand(tT,null);else{let e,l=[];if(t.getEditorState().read(()=>{var t,n,r;e=null==(t=(0,f.vJq)())?void 0:t.getTextContent(),l=null!=(r=null==(n=(0,f.vJq)())?void 0:n.getNodes())?r:[]}),!(null==e?void 0:e.length))return;t.dispatchCommand(tU,{fields:{doc:null},selectedNodes:l,text:e})}},order:1}])],t0=K(e=>{let{props:t}=e;return{markdownTransformers:[tj],nodes:[ty,(null==t?void 0:t.disableAutoLinks)===!0?null:tI].filter(Boolean),plugins:[{Component:tY,position:"normal"},(null==t?void 0:t.disableAutoLinks)===!0||(null==t?void 0:t.disableAutoLinks)==="creationOnly"?null:{Component:tW,position:"normal"},{Component:tZ,position:"normal"},{Component:tX,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:tQ},toolbarInline:{groups:tQ}}}),t1=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),(0,g.jsx)("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]}),t2=()=>(0,g.jsx)(H.Q,{});function t6(e,t){return"ordered"===e?!t.has("unorderedList"):"checklist"===e&&!t.has("unorderedList")&&!t.has("orderedList")}function t5(e){return{items:e,key:"lists",label:e=>{let{i18n:t}=e;return t.t("lexical:general:slashMenuListGroupLabel")}}}var t3=e=>(t,l,n)=>{let r=t.getPreviousSibling(),o=t.getNextSibling(),i=(0,B.i)("check"===e?"x"===n[3]:void 0);if((0,B.HY)(o)&&o.getListType()===e){let e=o.getFirstChild();null!==e?e.insertBefore(i):o.append(i),t.remove()}else if((0,B.HY)(r)&&r.getListType()===e)r.append(i),t.remove();else{let l=(0,B.DE)(e,"number"===e?Number(n[2]):void 0);l.append(i),t.replace(l)}i.append(...l),i.select(0,0);let a=Math.floor(n[1].length/4);a&&i.setIndent(a)},t4=(e,t,l)=>{let n=[],r=e.getChildren(),o=0;for(let i of r)if((0,B.Mz)(i)){if(1===i.getChildrenSize()){let e=i.getFirstChild();if((0,B.HY)(e)){n.push(t4(e,t,l+1));continue}}let r=" ".repeat(4*l),a=e.getListType(),s="number"===a?"".concat(e.getStart()+o,". "):"check"===a?"- [".concat(i.getChecked()?"x":" ","] "):"- ";n.push(r+s+t(i)),o++}return n.join("\n")},t7={type:"element",dependencies:[B.v5,B.YW],export:(e,t)=>(0,B.HY)(e)?t4(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:t3("check")},t8=()=>(0,g.jsx)(O.A,{}),t9=[ee([{ChildComponent:t1,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if((0,B.HY)(e)&&"check"===e.getListType())continue;let t=e.getParent();if((0,B.HY)(t)&&"check"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,B.HY)(l)&&"check"===l.getListType()))return!1}return!0},key:"checklist",label:e=>{let{i18n:t}=e;return t.t("lexical:checklist:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.mJ,void 0)},order:12}])],le=K(e=>{let{featureProviderMap:t}=e,l=[{Component:t8,position:"normal"}],n=t6("checklist",t);return n&&l.push({Component:t2,position:"normal"}),{markdownTransformers:[t7],nodes:n?[B.v5,B.YW]:[],plugins:l,slashMenu:{groups:[t5([{Icon:t1,key:"checklist",keywords:["check list","check","checklist","cl"],label:e=>{let{i18n:t}=e;return t.t("lexical:checklist:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.mJ,void 0)}}])]},toolbarFixed:{groups:t9},toolbarInline:{groups:t9}}}),lt=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("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"}),(0,g.jsx)("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"}),(0,g.jsx)("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]}),ll={type:"element",dependencies:[B.v5,B.YW],export:(e,t)=>(0,B.HY)(e)?t4(e,t,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:t3("number")},ln=[ee([{ChildComponent:lt,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if((0,B.HY)(e)&&"number"===e.getListType())continue;let t=e.getParent();if((0,B.HY)(t)&&"number"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,B.HY)(l)&&"number"===l.getListType()))return!1}return!0},key:"orderedList",label:e=>{let{i18n:t}=e;return t.t("lexical:orderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.x,void 0)},order:10}])],lr=K(e=>{let{featureProviderMap:t}=e,l=t6("ordered",t);return{markdownTransformers:[ll],nodes:l?[B.v5,B.YW]:[],plugins:l?[{Component:t2,position:"normal"}]:[],slashMenu:{groups:[t5([{Icon:lt,key:"orderedList",keywords:["ordered list","ol"],label:e=>{let{i18n:t}=e;return t.t("lexical:orderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.x,void 0)}}])]},toolbarFixed:{groups:ln},toolbarInline:{groups:ln}}}),lo=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,g.jsx)("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,g.jsx)("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),(0,g.jsx)("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),(0,g.jsx)("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]}),li={type:"element",dependencies:[B.v5,B.YW],export:(e,t)=>(0,B.HY)(e)?t4(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:t3("bullet")},la=[ee([{ChildComponent:lo,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes()){if((0,B.HY)(e)&&"bullet"===e.getListType())continue;let t=e.getParent();if((0,B.HY)(t)&&"bullet"===t.getListType())continue;let l=null==t?void 0:t.getParent();if(!((0,B.HY)(l)&&"bullet"===l.getListType()))return!1}return!0},key:"unorderedList",label:e=>{let{i18n:t}=e;return t.t("lexical:unorderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.q7,void 0)},order:11}])],ls=K({markdownTransformers:[li],nodes:[B.v5,B.YW],plugins:[{Component:t2,position:"normal"}],slashMenu:{groups:[t5([{Icon:lo,key:"unorderedList",keywords:["unordered list","ul"],label:e=>{let{i18n:t}=e;return t.t("lexical:unorderedList:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(B.q7,void 0)}}])]},toolbarFixed:{groups:la},toolbarInline:{groups:la}}),lu=m.lazy(()=>l.e(2339).then(l.bind(l,12339)).then(e=>({default:e.UnknownConvertedNodeComponent}))),ld=class extends f.Kp7{static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function(e){let{data:t}=e;return(0,f.pTq)(new ld({data:t}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,f.ZB7)(t,"unknownConverted"),t}decorate(){return(0,g.jsx)(lu,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}constructor({data:e,key:t}){super(t),this.__data=e}},lc=K(()=>({nodes:[ld]})),lp=m.lazy(()=>l.e(1604).then(l.bind(l,61604)).then(e=>({default:e.UnknownConvertedNodeComponent}))),lh=class extends f.Kp7{static clone(e){return new this({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return function(e){let{data:t}=e;return(0,f.pTq)(new lh({data:t}))}({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let t=document.createElement("span");return(0,f.ZB7)(t,"unknownConverted"),t}decorate(){return(0,g.jsx)(lp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,t){return!1}constructor({data:e,key:t}){super(t),this.__data=e}},lf=K(()=>({nodes:[lh]})),lm=[ee([{ChildComponent:Q,isActive:e=>{let{selection:t}=e;if(!(0,f.I2P)(t))return!1;for(let e of t.getNodes())if(!(0,f.bSg)(e)&&!(0,f.bSg)(e.getParent()))return!1;return!0},key:"paragraph",label:e=>{let{i18n:t}=e;return t.t("lexical:paragraph:label2")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,f.vJq)();(0,x.zI)(e,()=>(0,f.lJ7)())})},order:1}])],lg=K({slashMenu:{groups:[W([{Icon:Q,key:"paragraph",keywords:["normal","paragraph","p","text"],label:e=>{let{i18n:t}=e;return t.t("lexical:paragraph:label")},onSelect:e=>{let{editor:t}=e;t.update(()=>{let e=(0,f.vJq)();(0,x.zI)(e,()=>(0,f.lJ7)())})}}])]},toolbarFixed:{groups:lm},toolbarInline:{groups:lm}}),lv={horizontalrule:(0,g.jsx)("hr",{})},lx={linebreak:(0,g.jsx)("br",{})},lb={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},lC=lb.IS_BOLD|lb.IS_ITALIC|lb.IS_STRIKETHROUGH|lb.IS_UNDERLINE|lb.IS_CODE|lb.IS_SUBSCRIPT|lb.IS_SUPERSCRIPT|lb.IS_HIGHLIGHT,lk="\xa0",ly="\n\n",lw="֑-߿יִ-﷽ﹰ-ﻼ",lS="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",lE=RegExp("^[^"+lS+"]*["+lw+"]"),lT=RegExp("^[^"+lw+"]*["+lS+"]"),l_={bold:lb.IS_BOLD,code:lb.IS_CODE,highlight:lb.IS_HIGHLIGHT,italic:lb.IS_ITALIC,strikethrough:lb.IS_STRIKETHROUGH,subscript:lb.IS_SUBSCRIPT,superscript:lb.IS_SUPERSCRIPT,underline:lb.IS_UNDERLINE},lL={directionless:lb.IS_DIRECTIONLESS,unmergeable:lb.IS_UNMERGEABLE},lN={center:lb.IS_ALIGN_CENTER,end:lb.IS_ALIGN_END,justify:lb.IS_ALIGN_JUSTIFY,left:lb.IS_ALIGN_LEFT,right:lb.IS_ALIGN_RIGHT,start:lb.IS_ALIGN_START},lj={[lb.IS_ALIGN_CENTER]:"center",[lb.IS_ALIGN_END]:"end",[lb.IS_ALIGN_JUSTIFY]:"justify",[lb.IS_ALIGN_LEFT]:"left",[lb.IS_ALIGN_RIGHT]:"right",[lb.IS_ALIGN_START]:"start"},lI={normal:lb.IS_NORMAL,segmented:lb.IS_SEGMENTED,token:lb.IS_TOKEN},lM={[lb.IS_NORMAL]:"normal",[lb.IS_SEGMENTED]:"segmented",[lb.IS_TOKEN]:"token"},lF={paragraph:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(null==n?void 0:n.length)?(0,g.jsx)("p",{children:n}):(0,g.jsx)("p",{children:(0,g.jsx)("br",{})})},text:e=>{let{node:t}=e,l=t.text;return t.format&lb.IS_BOLD&&(l=(0,g.jsx)("strong",{children:l})),t.format&lb.IS_ITALIC&&(l=(0,g.jsx)("em",{children:l})),t.format&lb.IS_STRIKETHROUGH&&(l=(0,g.jsx)("span",{style:{textDecoration:"line-through"},children:l})),t.format&lb.IS_UNDERLINE&&(l=(0,g.jsx)("span",{style:{textDecoration:"underline"},children:l})),t.format&lb.IS_CODE&&(l=(0,g.jsx)("code",{children:l})),t.format&lb.IS_SUBSCRIPT&&(l=(0,g.jsx)("sub",{children:l})),t.format&lb.IS_SUPERSCRIPT&&(l=(0,g.jsx)("sup",{children:l})),l},...lx,quote:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,g.jsx)("blockquote",{children:n})},table:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,g.jsx)("div",{className:"lexical-table-container",children:(0,g.jsx)("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:(0,g.jsx)("tbody",{children:n})})})},tablecell:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}
1),r=t.headerState>0?"th":"td",o="lexical-table-cell-header-".concat(t.headerState),i={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},a=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return(0,g.jsx)(r,{className:"lexical-table-cell ".concat(o),colSpan:a,rowSpan:s,style:i,children:n})},tablerow:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children});return(0,g.jsx)("tr",{className:"lexical-table-row",children:n})},heading:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.tag;return(0,g.jsx)(r,{children:n})},...lv,list:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.tag;return(0,g.jsx)(r,{className:"list-".concat(null==t?void 0:t.listType),children:n})},listitem:e=>{let{node:t,nodesToJSX:l,parent:n}=e,r=t.children.some(e=>"list"===e.type),o=l({nodes:t.children});if(!("listType"in n)||(null==n?void 0:n.listType)!=="check")return(0,g.jsx)("li",{className:"".concat(r?"nestedListItem":""),style:r?{listStyleType:"none"}:void 0,value:null==t?void 0:t.value,children:o});{let e=(0,N.A)();return(0,g.jsx)("li",{"aria-checked":t.checked?"true":"false",className:"list-item-checkbox".concat(t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked").concat(r?" nestedListItem":""),role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:null==t?void 0:t.value,children:r?o:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("input",{checked:t.checked,id:e,readOnly:!0,type:"checkbox"}),(0,g.jsx)("label",{htmlFor:e,children:o}),(0,g.jsx)("br",{})]})})}},...(e=>{let{internalDocToHref:t}=e;return{autolink:e=>{let{node:t,nodesToJSX:l}=e,n=l({nodes:t.children}),r=t.fields.newTab?"noopener noreferrer":void 0,o=t.fields.newTab?"_blank":void 0;return(0,g.jsx)("a",{href:t.fields.url,rel:r,target:o,children:n})},link:e=>{var l;let{node:n,nodesToJSX:r}=e,o=r({nodes:n.children}),i=n.fields.newTab?"noopener noreferrer":void 0,a=n.fields.newTab?"_blank":void 0,s=null!=(l=n.fields.url)?l:"";return"internal"===n.fields.linkType&&(t?s=t({linkNode:n}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),(0,g.jsx)("a",{href:s,rel:i,target:a,children:o})}}})({}),upload:e=>{var t;let{node:l}=e;if("object"!=typeof l.value)return null;let n=l.value,r=(null==(t=l.fields)?void 0:t.alt)||(null==n?void 0:n.alt)||"",o=n.url;if(!n.mimeType.startsWith("image"))return(0,g.jsx)("a",{href:o,rel:"noopener noreferrer",children:n.filename});if(!n.sizes||!Object.keys(n.sizes).length)return(0,g.jsx)("img",{alt:r,height:n.height,src:o,width:n.width});let i=[];for(let e in n.sizes){let t=n.sizes[e];if(!t||!t.width||!t.height||!t.mimeType||!t.filesize||!t.filename||!t.url)continue;let l=null==t?void 0:t.url;i.push((0,g.jsx)("source",{media:"(max-width: ".concat(t.width,"px)"),srcSet:l,type:t.mimeType},e))}return i.push((0,g.jsx)("img",{alt:r,height:null==n?void 0:n.height,src:o,width:null==n?void 0:n.width},"image")),(0,g.jsx)("picture",{children:i})},tab:"	"};function lR(e){return t=>{if(e.Component){let l={...t,isEditor:!1,isJSXConverter:!0};return e.Component(l)}if(e.Block){var l;let n=t.node,r={childIndex:t.childIndex,converters:t.converters,formData:null!=(l=n.fields)?l:{},isEditor:!1,isJSXConverter:!0,node:n,nodesToJSX:t.nodesToJSX,parent:t.parent};return m.createElement(e.Block,r)}if(e.html){let l={...t,isEditor:!1,isJSXConverter:!0},n="function"==typeof e.html?e.html(l):e.html;return(0,g.jsx)("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function lP(e){let{className:t,converters:l,data:n,disableContainer:r,disableIndent:o,disableTextAlign:i,nodeMap:a}=e;if(!n)return null;let s={};s=l?"function"==typeof l?l({defaultConverters:lF}):l:lF;let u=n&&!Array.isArray(n)&&"object"==typeof n&&"root"in n&&function(e){let{converters:t,data:l,disableIndent:n,disableTextAlign:r,nodeMap:o}=e;if(function(e){var t,l,n,r,o,i,a,s,u,d;if(!(null==e||null==(l=e.root)||null==(t=l.children)?void 0:t.length))return!1;let c=!1;if((null==e||null==(r=e.root)||null==(n=r.children)?void 0:n.length)===1&&(null==e||null==(i=e.root)||null==(o=i.children[0])?void 0:o.type)==="paragraph"){let t=null==e||null==(a=e.root)?void 0:a.children[0];if((null==t?void 0:t.children)&&(null==t||null==(s=t.children)?void 0:s.length)!==0){if((null==t||null==(u=t.children)?void 0:u.length)===1){let e=null==t?void 0:t.children[0];(null==e?void 0:e.type)==="text"&&((null==e||null==(d=e.text)?void 0:d.length)||(c=!0))}}else c=!0}return!c}(l)){let e=o?function(e){let t={};for(let[l,n]of Object.entries(e))if(n&&"object"==typeof n){if("blocks"===l){for(let[e,l]of(t.blocks={},Object.entries(n)))(l.Component||l.Block||l.html)&&(t.blocks[e]=lR(l));continue}if("inlineBlocks"===l){for(let[e,l]of(t.inlineBlocks={},Object.entries(n)))(l.Component||l.Block||l.html)&&(t.inlineBlocks[e]=lR(l));continue}(n.Component||n.html)&&(t[l]=function(e){return t=>{let l={...t,isEditor:!1,isJSXConverter:!0};if(e.Component)return e.Component(l);
1if(e.html){let t="function"==typeof e.html?e.html(l):e.html;return(0,g.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})}return null}}(n))}return t}(o):void 0;return function e(t){let{converters:l,disableIndent:n,disableTextAlign:r,nodes:o,parent:i}=t,a=l.unknown;return o.map((t,o)=>{var s,u,d,c,p,h,f,v;let x;"block"===t.type?(x=null==l||null==(u=l.blocks)?void 0:u[null==t||null==(s=t.fields)?void 0:s.blockType])||a||console.error("Lexical => JSX converter: Blocks converter: found ".concat(null==t||null==(d=t.fields)?void 0:d.blockType," block, but no converter is provided")):"inlineBlock"===t.type?(x=null==l||null==(p=l.inlineBlocks)?void 0:p[null==t||null==(c=t.fields)?void 0:c.blockType])||a||console.error("Lexical => JSX converter: Inline Blocks converter: found ".concat(null==t||null==(h=t.fields)?void 0:h.blockType," inline block, but no converter is provided")):x=l[t.type];try{let s;!x&&a&&(x=a),s=x?"function"==typeof x?x({childIndex:o,converters:l,node:t,nodesToJSX:o=>{var a,s,u,d;return e({converters:null!=(a=o.converters)?a:l,disableIndent:null!=(s=o.disableIndent)?s:n,disableTextAlign:null!=(u=o.disableTextAlign)?u:r,nodes:o.nodes,parent:null!=(d=o.parent)?d:{...t,parent:i}})},parent:i}):x:(0,g.jsx)("span",{children:"unknown node"},o);let u={};if(!r&&(!Array.isArray(r)||!(null==r?void 0:r.includes(t.type)))&&"format"in t&&t.format)switch(t.format){case"center":u.textAlign="center";break;case"end":case"right":u.textAlign="right";break;case"justify":u.textAlign="justify";break;case"left":break;case"start":u.textAlign="left"}if(!n&&(!Array.isArray(n)||!(null==n?void 0:n.includes(t.type)))&&"indent"in t&&t.indent&&"listitem"!==t.type&&(u.paddingInlineStart="".concat(40*Number(t.indent),"px")),m.isValidElement(s)){if(u.textAlign||u.paddingInlineStart){let e={...u,...null!=(v=null==s||null==(f=s.props)?void 0:f.style)?v:{}};return m.cloneElement(s,{key:o,style:e})}return m.cloneElement(s,{key:o})}return s}catch(e){return console.error("Error converting lexical node to JSX:",e,"node:",t),null}}).filter(Boolean)}({converters:e?{...t,...e,blocks:{...t.blocks,...e.blocks},inlineBlocks:{...t.inlineBlocks,...e.inlineBlocks}}:t,disableIndent:n,disableTextAlign:r,nodes:l.root.children,parent:l.root})}return(0,g.jsx)(g.Fragment,{})}({converters:s,data:n,disableIndent:o,disableTextAlign:i,nodeMap:a});return r?(0,g.jsx)(g.Fragment,{children:u}):(0,g.jsx)("div",{className:null!=t?t:"payload-richtext",children:u})}var lA=K({plugins:[{Component:function(){let e,t=(0,c.c)(7),[l]=(0,p.DF)(),n;t[0]!==l?(n=()=>l.getEditorState().toJSON(),t[0]=l,t[1]=n):n=t[1];let[r,o]=(0,m.useState)(n),i,a;return t[2]!==l?(i=()=>l.registerUpdateListener(e=>{let{editorState:t}=e;o(t.toJSON())}),a=[l],t[2]=l,t[3]=i,t[4]=a):(i=t[3],a=t[4]),(0,m.useEffect)(i,a),t[5]!==r?(e=(0,g.jsx)("div",{className:"debug-jsx-converter",children:(0,g.jsx)(lP,{converters:lF,data:r})}),t[5]=r,t[6]=e):e=t[6],e},position:"bottom"}]}),lD={blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717
1)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"}},lB={text:{"text-red":{css:{color:"light-dark(".concat(lD.red[600],", ").concat(lD.red[400],")")},label:"Red"},"text-orange":{css:{color:"light-dark(".concat(lD.orange[600],", ").concat(lD.orange[400],")")},label:"Orange"},"text-yellow":{css:{color:"light-dark(".concat(lD.yellow[700],", ").concat(lD.yellow[300],")")},label:"Yellow"},"text-green":{css:{color:"light-dark(".concat(lD.green[700],", ").concat(lD.green[400],")")},label:"Green"},"text-blue":{css:{color:"light-dark(".concat(lD.blue[600],", ").concat(lD.blue[400],")")},label:"Blue"},"text-purple":{css:{color:"light-dark(".concat(lD.purple[600],", ").concat(lD.purple[400],")")},label:"Purple"},"text-pink":{css:{color:"light-dark(".concat(lD.pink[600],", ").concat(lD.pink[400],")")},label:"Pink"}},background:{"bg-red":{css:{"background-color":"light-dark(".concat(lD.red[400],", ").concat(lD.red[600],")")},label:"Red"},"bg-orange":{css:{"background-color":"light-dark(".concat(lD.orange[400],", ").concat(lD.orange[600],")")},label:"Orange"},"bg-yellow":{css:{"background-color":"light-dark(".concat(lD.yellow[300],", ").concat(lD.yellow[700],")")},label:"Yellow"},"bg-green":{css:{"background-color":"light-dark(".concat(lD.green[400],", ").concat(lD.green[700],")")},label:"Green"},"bg-blue":{css:{"background-color":"light-dark(".concat(lD.blue[400],", ").concat(lD.blue[600],")")},label:"Blue"},"bg-purple":{css:{"background-color":"light-dark(".concat(lD.purple[400],", ").concat(lD.purple[600],")")},label:"Purple"},"bg-pink":{css:{"background-color":"light-dark(".concat(lD.pink[400],", ").concat(lD.pink[600],")")},label:"Pink"}}},lH=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("g",{clipPath:"url(#clip0_4397_10817)",children:(0,g.jsx)("path",{d:"M7.75 12.25L15.25 4.75M15.25 4.75H11.5M15.25 4.75V8.5M13 11.5V13.75C13 14.5784 12.3284 15.25 11.5 15.25H6.25C5.42157 15.25 4.75 14.5784 4.75 13.75V8.5C4.75 7.67157 5.42157 7 6.25 7H8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,g.jsx)("defs",{children:(0,g.jsx)("clipPath",{id:"clip0_4397_10817",children:(0,g.jsx)("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});function lO(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:lz({relationTo:l,value:t})}:null}var lJ=class extends h.d{static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-relationship-relationTo")&&e.hasAttribute("data-lexical-relationship-id")?{conversion:lO,priority:2}:null}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id);let l=lz({relationTo:e.relationTo,value:e.value});return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB7)(l,null==e||null==(t=e.theme)?void 0:t.relationship),l}decorate(e,t){return null}exportDOM(){var e,t,l,n,r;let o=document.createElement("div");o.setAttribute("data-lexical-relationship-id",String("object"==typeof(null==(e=this.__data)?void 0:e.value)?null==(l=this.__data)||null==(t=l.value)?void 0:t.id:null==(n=this.__data)?void 0:n.value)),o.setAttribute("data-lexical-relationship-relationTo",null==(r=this.__data)?void 0:r.relationTo);let i=document.createTextNode(this.getTextContent());return o.append(i),{element:o}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){var e,t,l,n,r;return"".concat(null==(e=this.__data)?void 0:e.relationTo," relation to ").concat("object"==typeof(null==(t=this.__data)?void 0:t.value)?null==(n=this.__data)||null==(l=n.value)?void 0:l.id:null==(r=this.__data)?void 0:r.value)}setData(e){this.getWritable().__data=e}constructor({data:e,format:t,key:l}){super(t,l),this.__data=e}};function lz(e){return(0,f.pTq)(new lJ({data:e}))}var lV=m.lazy(()=>l.e(5927).then(l.bind(l,35927)).then(e=>({default:e.RelationshipComponent})));function lW(e){let t=e.getAttribute("data-lexical-relationship-id"),l=e.getAttribute("data-lexical-relationship-relationTo");return null!=t&&null!=l?{node:lK({relationTo:l,value:t})}:null}var lZ=class extends lJ{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>e.hasAttribute("data-lexical-relationship-relationTo")&&e.hasAttribute("data-lexical-relationship-id")?{conversion:lW,priority:2}:null}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id);let l=lK({relationTo:e.relationTo,value:e.value});return l.setFormat(e.format),l}decorate(e,t){var l;return(0,g.jsx)(lV,{className:null!=(l=t.theme.relationship)?l:"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function lK(e){return(0,f.pTq)(new lZ({data:e}))}function lU(e){return e instanceof lZ}var lG=e=>{let t,l,n,r=(0,c.c)(23),[o]=(0,p.DF)(),[i,a]=(0,m.useState)(null),[s,u]=(0,m.useState)(!1),[d,h,v]=(0,w.useListDrawer)(e),{closeDrawer:x,drawerSlug:b,isDrawerOpen:C,openDrawer:k}=v,{modalState:y}=(0,w.useModal)(),S;r[0]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{var e;a(null!=(e=(0,f.vJq)())?e:(0,f.S1w)())},r[0]=S):S=r[0];let E=S,T;r[1]!==o||r[2]!==i?(T=()=>{i&&o.update(()=>{if((0,f.I2P)(i)){let{anchor:e,focus:t}=i;(0,f.nsf)(e.key)&&(0,f.nsf)(t.key)&&(0,f.n1P)(i.clone())}else(0,f.NiT)().selectEnd()},{discrete:!0,skipTransforms:!0})},r[1]=o,r[2]=i,r[3]=T):T=r[3];let _=T,L;r[4]!==x?(L=()=>{x()},r[4]=x,r[5]=L):L=r[5];let N=L,j,I;return r[6]!==b||r[7]!==y||r[8]!==_||r[9]!==s?(j=()=>
1{if(!s)return;let e=y[b];!e||(null==e?void 0:e.isOpen)||(u(!1),setTimeout(()=>{_()},1))},I=[y,b,_,s],r[6]=b,r[7]=y,r[8]=_,r[9]=s,r[10]=j,r[11]=I):(j=r[10],I=r[11]),(0,m.useEffect)(j,I),r[12]!==h?(t=e=>(0,g.jsx)(h,{...e,onClick:()=>{E()}}),r[12]=h,r[13]=t):t=r[13],r[14]!==k?(l=()=>{E(),k(),u(!0)},r[14]=k,r[15]=l):l=r[15],r[16]!==d||r[17]!==N||r[18]!==C||r[19]!==b||r[20]!==t||r[21]!==l?(n={closeListDrawer:N,isListDrawerOpen:C,ListDrawer:d,listDrawerSlug:b,ListDrawerToggler:t,openListDrawer:l},r[16]=d,r[17]=N,r[18]=C,r[19]=b,r[20]=t,r[21]=l,r[22]=n):n=r[22],n},lq=e=>{let t,l=(0,c.c)(14),{enabledCollectionSlugs:n}=e,[r]=(0,p.DF)(),[i,a]=(0,m.useState)(null),s=null==n?void 0:n[0],u;l[0]!==n||l[1]!==s?(u={collectionSlugs:n,selectedCollection:s},l[0]=n,l[1]=s,l[2]=u):u=l[2];let{closeListDrawer:d,ListDrawer:h,openListDrawer:v}=lG(u),x,b;l[3]!==r||l[4]!==v?(x=()=>r.registerCommand(o.a,e=>(a((null==e?void 0:e.replace)?null==e?void 0:e.replace.nodeKey:null),v(),!0),f.jZM),b=[r,v],l[3]=r,l[4]=v,l[5]=x,l[6]=b):(x=l[5],b=l[6]),(0,m.useEffect)(x,b),l[7]!==d||l[8]!==r||l[9]!==i?(t=e=>{let{collectionSlug:t,doc:l}=e;(e=>{let{editor:t,relationTo:l,replaceNodeKey:n,value:r}=e;n?t.update(()=>{let e=(0,f.nsf)(n);e&&e.replace(lK({relationTo:l,value:r}))}):t.dispatchCommand(l0,{relationTo:l,value:r})})({editor:r,relationTo:t,replaceNodeKey:i,value:l.id}),d()},l[7]=d,l[8]=r,l[9]=i,l[10]=t):t=l[10];let C=t,k;return l[11]!==h||l[12]!==C?(k=(0,g.jsx)(h,{onSelect:C}),l[11]=h,l[12]=C,l[13]=k):k=l[13],k},lX=()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(o.a,l$,f.jZM),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,m.useEffect)(l,n),null},lY=e=>{let{enabledCollectionSlugs:t}=e;return(null==t?void 0:t.length)?(0,g.jsx)(lq,{enabledCollectionSlugs:t}):(0,g.jsx)(lX,{})};function l$(){return w.toast.error("No relationship collections enabled"),!0}var lQ=e=>{let{collectionSlugsBlacklist:t,collectionSlugsWhitelist:l,uploads:n=!1}=e||{},{config:{collections:r}}=(0,S.c)(),{visibleEntities:o}=(0,w.useEntityVisibility)();return m.useMemo(()=>{let e=[],i=[],a=l?new Set(l):null,s=t?new Set(t):null;for(let t of r){let{slug:l,admin:{enableRichTextRelationship:r},upload:u}=t;if(null==o?void 0:o.collections.includes(l)){if(n){if(!r||!u)continue}else if(u||!r)continue;a&&!a.has(l)||s&&s.has(l)||(e.push(l),i.push(t))}}return{enabledCollections:i,enabledCollectionSlugs:e}},[r,o,n,l,t])},l0=(0,f.guI)("INSERT_RELATIONSHIP_COMMAND");function l1(e){let t=(0,f.vJq)()||(0,f.S1w)();if((0,f.I2P)(t)){let l=lK(e),{focus:n}=t,r=n.getNode();(0,I.Pe)(l),(0,f.bSg)(r)&&!r.__first&&r.remove()}return!0}var l2=K({nodes:[lZ],plugins:[{Component:e=>{let t,l=(0,c.c)(8),{clientProps:n}=e,[r]=(0,p.DF)(),o=null==n?void 0:n.disabledCollections,i=null==n?void 0:n.enabledCollections,a;l[0]!==o||l[1]!==i?(a={collectionSlugsBlacklist:o,collectionSlugsWhitelist:i},l[0]=o,l[1]=i,l[2]=a):a=l[2];let{enabledCollectionSlugs:s}=lQ(a),u,d;return l[3]!==r?(u=()=>{if(!r.hasNodes([lZ]))throw Error("RelationshipPlugin: RelationshipNode not registered on editor");return r.registerCommand(l0,l1,f.jZM)},d=[r],l[3]=r,l[4]=u,l[5]=d):(u=l[4],d=l[5]),(0,m.useEffect)(u,d),l[6]!==s?(t=(0,g.jsx)(lY,{enabledCollectionSlugs:s}),l[6]=s,l[7]=t):t=l[7],t},position:"normal"}],slashMenu:{groups:[W([{Icon:lH,key:"relationship",keywords:["relationship","relation","rel"],label:e=>{let{i18n:t}=e;return t.t("lexical:relationship:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(o.a,{replace:!1})}}])]},toolbarFixed:{groups:[te([{ChildComponent:lH,isActive:e=>{let{selection:t}=e;return!!(0,f.RTZ)(t)&&!!t.getNodes().length&&lU(t.getNodes()[0])},key:"relationship",label:e=>{let{i18n:t}=e;return t.t("lexical:relationship:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(o.a,{replace:!1})}}])]}}),l6="toolbar-popup__button",l5=e=>{let t=(0,c.c)(14),{active:l,children:n,editor:r,enabled:o,item:i}=e,a=void 0!==l&&l,s=void 0===o||o,u=s?"":"disabled",d=a?"active":"",p=i.key?"".concat(l6,"-").concat(i.key):"",h;t[0]!==u||t[1]!==d||t[2]!==p?(h=[l6,u,d,p].filter(Boolean),t[0]=u,t[1]=d,t[2]=p,t[3]=h):h=t[3];let f=h.join(" "),m;t[4]!==a||t[5]!==r||t[6]!==s||t[7]!==i?(m=()=>{s&&r.focus(()=>{var e;r.update(l3),null==(e=i.onSelect)||e.call(i,{editor:r,isActive:a})})},t[4]=a,t[5]=r,t[6]=s,t[7]=i,t[8]=m):m=t[8];let v=m,x;return t[9]!==n||t[10]!==f||t[11]!==v||t[12]!==i.key?(x=(0,g.jsx)("button",{className:f,"data-button-key":i.key,onClick:v,onMouseDown:l4,type:"button",children:n}),t[9]=n,t[10]=f,t[11]=v,t[12]=i.key,t[13]=x):x=t[13],x};function l3(){(0,f.JAT)("toolbar")}function l4(e){e.preventDefault()}var l7="toolbar-popup__dropdown-item",l8=m.createContext(null);function l9(e){let{active:t,children:l,editor:n,enabled:r,Icon:o,item:i,itemKey:a,tooltip:s}=e,u=(0,m.useMemo)(()=>
1[l7,!1===r?"disabled":"",t?"active":"",(null==i?void 0:i.key)?"".concat(l7,"-").concat(i.key):""].filter(Boolean).join(" "),[r,t,i.key]),d=(0,m.useRef)(null),c=m.use(l8);if(null===c)throw Error("DropDownItem must be used within a DropDown");let{registerItem:p}=c;return(0,m.useEffect)(()=>{(null==d?void 0:d.current)!=null&&p(d)},[d,p]),(0,g.jsx)(w.Button,{"aria-label":s,buttonStyle:"none",className:u,disabled:!1===r,extraButtonProps:{"data-item-key":a},icon:o,iconPosition:"left",iconStyle:"none",onClick:()=>{!1!==r&&n.focus(()=>{var e;n.update(()=>{(0,f.JAT)("toolbar")}),null==(e=i.onSelect)||e.call(i,{editor:n,isActive:t})})},onMouseDown:e=>{e.preventDefault()},ref:d,tooltip:s,type:"button",children:l})}function ne(e){let{children:t,dropDownRef:l,itemsContainerClassNames:n,onClose:r}=e,[o,i]=(0,m.useState)(),[a,s]=(0,m.useState)(),u=(0,m.useCallback)(e=>{i(t=>null!=t?[...t,e]:[e])},[i]),d=(0,m.useMemo)(()=>({registerItem:u}),[u]);return(0,m.useEffect)(()=>{null!=o&&null==a&&s(o[0]),null!=a&&(null==a?void 0:a.current)!=null&&a.current.focus()},[o,a]),(0,g.jsx)(l8,{value:d,children:(0,g.jsx)("div",{className:(null!=n?n:["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:e=>{if(null==o)return;let{key:t}=e;["ArrowDown","ArrowUp","Escape","Tab"].includes(t)&&e.preventDefault(),"Escape"===t||"Tab"===t?r():"ArrowUp"===t?s(e=>{if(null==e)return o[0];let t=o.indexOf(e)-1;return o[-1===t?o.length-1:t]}):"ArrowDown"===t&&s(e=>null==e?o[0]:o[o.indexOf(e)+1])},ref:l,children:t})})}function nt(e){let{buttonAriaLabel:t,buttonClassName:l,children:n,disabled:r=!1,dropdownKey:o,Icon:i,itemsContainerClassNames:a,label:s,stopCloseOnClickSelf:u}=e,d=(0,m.useRef)(null),c=(0,m.useRef)(null),[p,h]=(0,m.useState)(!1);(0,m.useEffect)(()=>{let e=c.current,t=d.current;if(p&&null!==e&&null!==t){let{left:l,top:n}=e.getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop;t.style.top="".concat(n+r+e.offsetHeight+5,"px"),t.style.left="".concat(Math.min(l-5,window.innerWidth-t.offsetWidth-20),"px")}},[d,c,p]),(0,m.useEffect)(()=>{let e=c.current;if(null!==e&&p){let t=t=>{let l=t.target;(0,f.vAA)(l)&&(u&&d.current&&d.current.contains(l)||e.contains(l)||h(!1))};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}},[d,c,p,u]);let v=(0,A.createPortal)((0,g.jsx)(ne,{dropDownRef:d,itemsContainerClassNames:a,onClose:()=>{h(!1),(null==c?void 0:c.current)!=null&&c.current.focus()},children:n}),document.body);return(0,g.jsxs)(m.Fragment,{children:[(0,g.jsxs)("button",{"aria-label":t,className:l+(p?" active":""),"data-dropdown-key":o,disabled:r,onClick:e=>{e.preventDefault(),h(!p)},onMouseDown:e=>{e.preventDefault()},ref:c,type:"button",children:[i&&(0,g.jsx)(i,{}),s&&(0,g.jsx)("span",{className:"toolbar-popup__dropdown-label",children:s}),(0,g.jsx)("i",{className:"toolbar-popup__dropdown-caret"})]}),p&&(0,g.jsx)(m.Fragment,{children:v})]})}var nl="toolbar-popup__dropdown",nn=m.memo(e=>{let t,l=(0,c.c)(14),{active:n,anchorElem:r,editor:o,enabled:i,item:a}=e,{i18n:s}=(0,E.d)(),{fieldProps:u}=(0,d.b)(),{featureClientSchemaMap:p,schemaPath:h}=u;if(a.Component){let e;return l[0]!==n||l[1]!==r||l[2]!==o||l[3]!==i||l[4]!==a?(e=(null==a?void 0:a.Component)&&(0,g.jsx)(a.Component,{active:n,anchorElem:r,editor:o,enabled:i,item:a},a.key),l[0]=n,l[1]=r,l[2]=o,l[3]=i,l[4]=a,l[5]=e):e=l[5],e}if(l[6]!==n||l[7]!==o||l[8]!==i||l[9]!==p||l[10]!==s||l[11]!==a||l[12]!==h){let e=a.key,r;a.label&&(e="function"==typeof a.label?a.label({featureClientSchemaMap:p,i18n:s,schemaPath:h}):a.label),r=e.length>25?e.substring(0,25)+"...":e,t=(0,g.jsx)(l9,{active:n,editor:o,enabled:i,Icon:(null==a?void 0:a.ChildComponent)?(0,g.jsx)(a.ChildComponent,{}):void 0,item:a,itemKey:a.key,tooltip:e,children:(0,g.jsx)("span",{className:"text",children:r})},a.key),l[6]=n,l[7]=o,l[8]=i,l[9]=p,l[10]=s,l[11]=a,l[12]=h,l[13]=t}else t=l[13];return t}),nr=e=>{let{anchorElem:t,classNames:l,editor:n,group:r,groupState:o,Icon:i,itemsContainerClassNames:a,label:s}=e,{items:u,key:d}=r,c=(0,m.useMemo)(()=>(null==u?void 0:u.length)?u.map(e=>
1(0,g.jsx)(nn,{active:o.activeItemKeys.includes(e.key),anchorElem:t,editor:n,enabled:o.enabledItemKeys.includes(e.key),item:e},e.key)):null,[u,o.activeItemKeys,o.enabledItemKeys,t,n]);return(0,g.jsx)(nt,{buttonAriaLabel:"".concat(d," dropdown"),buttonClassName:[nl,"".concat(nl,"-").concat(d),...l||[]].filter(Boolean).join(" "),disabled:!o.enabledGroup,dropdownKey:d,Icon:i,itemsContainerClassNames:["".concat(nl,"-items"),...a||[]],label:s,children:c},d)};function no(e,t){let[l,n]=(0,m.useState)(()=>(function(e){let t=new Map,l=new Map;if(!(null==e?void 0:e.length))return{groupStates:l,itemStates:t};for(let n of e){let e=[];for(let l of n.items)t.set(l.key,{active:!1,enabled:!0}),e.push(l.key);l.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:e})}return{groupStates:l,itemStates:t}})(t)),r=(0,m.useDeferredValue)(l),o=(0,d.b)(),i=(0,m.useRef)(o);i.current=o;let a=(0,m.useRef)(t);a.current=t;let s=(0,u.e)(),c=(0,m.useCallback)(()=>{e.getEditorState().read(()=>{let t=(0,f.vJq)();if(!t)return;let l=a.current;if(!(null==l?void 0:l.length))return;let r=i.current,o=new Map,s=new Map;for(let n of l){var u;let l=[],i=[],a=[],d="dropdown"===n.type?null!=(u=n.maxActiveItems)?u:1:void 0;for(let s of n.items){let n=!!s.isActive&&(!d||l.length<d)&&s.isActive({editor:e,editorConfigContext:r,selection:t}),u=!s.isEnabled||s.isEnabled({editor:e,editorConfigContext:r,selection:t});n&&(l.push(s.key),i.push(s)),u&&a.push(s.key),o.set(s.key,{active:n,enabled:u})}let c="dropdown"!==n.type||!n.isEnabled||n.isEnabled({editor:e,editorConfigContext:r,selection:t});s.set(n.key,{activeItemKeys:l,activeItems:i,enabledGroup:c,enabledItemKeys:a})}n({groupStates:s,itemStates:o})})},[e]);return(0,m.useEffect)(()=>{s(c);let t=()=>s(c),l=(0,f.Sdt)(e.registerUpdateListener(t));return document.addEventListener("mouseup",t),()=>{l(),document.removeEventListener("mouseup",t)}},[e,s,c]),r}function ni(e){let{active:t,anchorElem:l,editor:n,enabled:r,item:o}=e;return o.Component?(null==o?void 0:o.Component)&&(0,g.jsx)(o.Component,{anchorElem:l,editor:n,item:o},o.key):o.ChildComponent?(0,g.jsx)(l5,{active:t,editor:n,enabled:r,item:o,children:(0,g.jsx)(o.ChildComponent,{})},o.key):null}function na(e){var t;let{anchorElem:l,editor:n,editorConfig:r,group:o,index:i,toolbarStates:a}=e,{i18n:s}=(0,E.d)(),{fieldProps:{featureClientSchemaMap:u,schemaPath:c}}=(0,d.b)(),p=a.groupStates.get(o.key),h=(0,m.useMemo)(()=>{var e;if("dropdown"!==o.type)return;let t=null==p||null==(e=p.activeItems)?void 0:e[0];return t?t.ChildComponent:o.ChildComponent},[o,null==p?void 0:p.activeItems]),f=(0,m.useMemo)(()=>{if("dropdown"!==o.type)return;let e=null==p?void 0:p.activeItems;if(!(null==e?void 0:e.length))return;if(e.length>1)return s.t("lexical:general:toolbarItemsActive",{count:e.length});let t=e[0],l=t.key;return t.label&&(l="function"==typeof t.label?t.label({featureClientSchemaMap:u,i18n:s,schemaPath:c}):t.label),l.length>25&&(l=l.substring(0,25)+"..."),l},[o,null==p?void 0:p.activeItems,s,u,c]);return(0,g.jsxs)("div",{className:"fixed-toolbar__group fixed-toolbar__group-".concat(o.key),"data-toolbar-group-key":o.key,children:["dropdown"===o.type&&o.items.length&&p?(0,g.jsx)(nr,{anchorElem:l,editor:n,group:o,groupState:p,Icon:h,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:f}):null,"buttons"===o.type&&o.items.length?o.items.map(e=>{var t,r;let o=a.itemStates.get(e.key);return(0,g.jsx)(ni,{active:null!=(t=null==o?void 0:o.active)&&t,anchorElem:l,editor:n,enabled:null==(r=null==o?void 0:o.enabled)||r,item:e},e.key)}):null,i<(null==(t=r.features.toolbarFixed)?void 0:t.groups.length)-1&&(0,g.jsx)("div",{className:"divider"})]},o.key)}function ns(e){var t,l,n,r;let{anchorElem:o,clientProps:i,editor:a,editorConfig:s,parentWithFixedToolbar:u}=e,d=m.useRef(null),c=(0,y.a)(),{y:p}=(0,w.useScrollInfo)(),h=no(a,null==s||null==(l=s.features)||null==(t=l.toolbarFixed)?void 0:t.groups),f=(0,m.useMemo)(()=>{if(!u||(null==i?void 0:i.disableIfParentHasFixedToolbar))return null;let e=u.editorContainerRef.current.previousElementSibling;for(;e;){if(e.classList.contains("fixed-toolbar"))return e;e=e.previousElementSibling}return null},[null==i?void 0:i.disableIfParentHasFixedToolbar,u]);return(0,w.useThrottledEffect)(()=>
1{if(!f)return;let e=d.current;if(!e)return;let t=e.getBoundingClientRect(),l=f.getBoundingClientRect();if(t.bottom<l.top||t.top>l.bottom){if(!e.classList.contains("fixed-toolbar--overlapping"))return;e.classList.remove("fixed-toolbar--overlapping"),e.classList.add("fixed-toolbar"),f.classList.remove("fixed-toolbar--hide"),f.classList.add("fixed-toolbar")}else e.classList.remove("fixed-toolbar"),e.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),f.classList.remove("fixed-toolbar"),f.classList.add("fixed-toolbar","fixed-toolbar--hide")},50,[d,f,p]),(0,g.jsx)("div",{className:"fixed-toolbar",onFocus:e=>{e.stopPropagation()},ref:d,children:c&&(0,g.jsx)(m.Fragment,{children:(null==s?void 0:s.features)&&(null==(r=s.features)||null==(n=r.toolbarFixed)?void 0:n.groups.map((e,t)=>(0,g.jsx)(na,{anchorElem:o,editor:a,editorConfig:s,group:e,index:t,toolbarStates:h},e.key)))})})}var nu=e=>{var t,l;if(null==(t=e.parentEditor)?void 0:t.editorConfig){if(null==(l=e.parentEditor)?void 0:l.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return e.parentEditor;if(e.parentEditor)return nu(e.parentEditor)}return!1},nd=K({plugins:[{Component:e=>{var t,l,n,r,o;let i=(0,c.c)(6),{clientProps:a}=e,[s]=(0,p.DF)(),u=(0,d.b)();if(!(0,y.a)())return null;let{editorConfig:h}=u,f=a.applyToFocusedEditor&&(null==(t=u.focusedEditor)?void 0:t.editor)||s,m=a.applyToFocusedEditor&&(null==(l=u.focusedEditor)?void 0:l.editorConfig)||h,v,x;if(i[0]!==a||i[1]!==f||i[2]!==m||i[3]!==u){x=Symbol.for("react.early_return_sentinel");e:{let e=nu(u);if((null==a?void 0:a.disableIfParentHasFixedToolbar)&&e||!(null==m||null==(o=m.features)||null==(r=o.toolbarFixed)||null==(n=r.groups)?void 0:n.length)){x=null;break e}v=(0,g.jsx)(ns,{anchorElem:document.body,clientProps:a,editor:f,editorConfig:m,parentWithFixedToolbar:e})}i[0]=a,i[1]=f,i[2]=m,i[3]=u,i[4]=v,i[5]=x}else v=i[4],x=i[5];return x!==Symbol.for("react.early_return_sentinel")?x:v},position:"aboveContainer"}]});function nc(e,t){let l=e.getRangeAt(0),n;if(e.anchorNode===t){let e=t;for(;null!=e.firstElementChild;)e=e.firstElementChild;n=e.getBoundingClientRect()}else n=l.getBoundingClientRect();return n}function np(e){let{alwaysDisplayOnTop:t=!1,anchorElem:l,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:o=32,horizontalPosition:i="left",specialHandlingForCaret:a=!1,targetRect:s,verticalGap:u=10}=e,d=l.parentElement;if(null===s||null==d){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let c=r.getBoundingClientRect(),p=l.getBoundingClientRect(),h=d.getBoundingClientRect(),f=s.top-c.height-u,m=s.left-o;"center"===i&&(m=s.left+s.width/2-c.width/2);let g=0;return t||!(f<h.top)||a||(f+=g=c.height+s.height+2*u),"center"===i?m+c.width>h.right?m=h.right-c.width-o:m<h.left&&(m=h.left+o):m+c.width>h.right&&(m=h.right-c.width-o),m-=p.left,r.style.opacity="1",a&&0!==n?(f-=p.bottom-n+c.height-3,r.style.transform="translate(".concat(m,"px, ").concat(f,"px) rotate(180deg)")):(f-=p.top,r.style.transform="translate(".concat(m,"px, ").concat(f,"px)")),g}function nh(e){let{active:t,anchorElem:l,editor:n,enabled:r,item:o}=e;return o.Component?(null==o?void 0:o.Component)&&(0,g.jsx)(o.Component,{anchorElem:l,editor:n,item:o},o.key):o.ChildComponent?(0,g.jsx)(l5,{active:t,editor:n,enabled:r,item:o,children:(0,g.jsx)(o.ChildComponent,{})},o.key):null}function nf(e){var t;let{anchorElem:l,editor:n,group:r,index:o,toolbarStates:i}=e,{editorConfig:a}=(0,d.b)(),s=i.groupStates.get(r.key),u=(0,m.useMemo)(()=>{var e,t,l;return"dropdown"!==r.type?void 0:null!=(l=null==s||null==(t=s.activeItems)||null==(e=t[0])?void 0:e.ChildComponent)?l:r.ChildComponent},[r,null==s?void 0:s.activeItems]);return(0,g.jsxs)("div",{className:"inline-toolbar-popup__group inline-toolbar-popup__group-".concat(r.key),"data-toolbar-group-key":r.key,children:["dropdown"===r.type&&r.items.length&&s?(0,g.jsx)(nr,{anchorElem:l,editor:n,group:r,groupState:s,Icon:u}):null,"buttons"===r.type&&r.items.length?r.items.map(e=>{var t,r;let o=i.itemStates.get(e.key);return(0,g.jsx)(nh,{active:null!=(t=null==o?void 0:o.active)&&t,anchorElem:l,editor:n,enabled:null==(r=null==o?void 0:o.enabled)||r,item:e},e.key)}):null,o<(null==(t=a.features.toolbarInline)?void 0:t.groups.length)-1&&(0,g.jsx)("div",{className:"divider"})]},r.key)}function nm(e){var t,l,n,r;let{anchorElem:o,editor:i}=e,a=(0,m.useRef)(null),s=(0,m.useRef)(null),{editorConfig:u}=(0,d.b)(),c=no(i,null==u||null==(l=u.features)||null==(t=l.toolbarInline)?void 0:t.groups),p=(0,m.useCallback)(()=>
1{if(null==a?void 0:a.current){let e="0"===a.current.style.opacity,t="none"===a.current.style.pointerEvents;e||(a.current.style.opacity="0"),t||(a.current.style.pointerEvents="none")}},[a]),h=(0,m.useCallback)(e=>{if((null==a?void 0:a.current)&&(1===e.buttons||3===e.buttons)){let t="0"===a.current.style.opacity,l="none"===a.current.style.pointerEvents;if(!t||!l){let t=e.clientX,l=e.clientY,n=document.elementFromPoint(t,l);a.current.contains(n)||p()}}},[p]),v=(0,m.useCallback)(()=>{(null==a?void 0:a.current)&&("1"!==a.current.style.opacity&&(a.current.style.opacity="1"),"auto"!==a.current.style.pointerEvents&&(a.current.style.pointerEvents="auto"))},[]);(0,m.useEffect)(()=>(document.addEventListener("mousemove",h),document.addEventListener("mouseup",v),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",v)}),[a,h,v]);let x=(0,m.useCallback)(()=>{var e;let t=(0,f.vJq)(),l=(0,f.peL)(i._window);if(null===a.current)return;let n=o.querySelector(":scope > .link-editor"),r=null!==n&&"style"in n&&(null==n||null==(e=n.style)?void 0:e.opacity)==="1",u=i.getRootElement();if(null!==t&&null!==l&&!l.isCollapsed&&null!==u&&u.contains(l.anchorNode)){let e=nc(l,u),t=np({alwaysDisplayOnTop:r,anchorElem:o,floatingElem:a.current,horizontalPosition:"center",targetRect:e});s.current&&np({anchorElem:a.current,anchorFlippedOffset:t,floatingElem:s.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:e,verticalGap:8})}else p()},[i,p,o]);return(0,m.useEffect)(()=>{let e=o.parentElement,t=()=>{i.getEditorState().read(()=>{x()})};return window.addEventListener("resize",t),e&&e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),e&&e.removeEventListener("scroll",t)}},[i,x,o]),(0,m.useEffect)(()=>(i.getEditorState().read(()=>{x()}),(0,f.Sdt)(i.registerUpdateListener(e=>{let{editorState:t}=e;t.read(()=>{x()})}),i.registerCommand(f.MvL,()=>(x(),!1),f.AcJ))),[i,x]),(0,g.jsxs)("div",{className:"inline-toolbar-popup",ref:a,children:[(0,g.jsx)("div",{className:"caret",ref:s}),(null==u?void 0:u.features)&&(null==(r=u.features)||null==(n=r.toolbarInline)?void 0:n.groups.map((e,t)=>(0,g.jsx)(nf,{anchorElem:o,editor:i,group:e,index:t,toolbarStates:c},e.key)))]})}var ng=K({plugins:[{Component:e=>{let{anchorElem:t}=e,[l]=(0,p.DF)();return function(e,t){let l,n,r,o=(0,c.c)(12),[i,a]=(0,m.useState)(!1),s=(0,y.a)(),u;o[0]!==e?(u=()=>{e.getEditorState().read(()=>{if(e.isComposing())return;let t=(0,f.vJq)(),l=(0,f.peL)(e._window),n=e.getRootElement();if(null!==l&&(!(0,f.I2P)(t)||null===n||!n.contains(l.anchorNode)))return void a(!1);if(!(0,f.I2P)(t))return;if(""!==t.getTextContent()){let e=t.getNodes(),l=!1;for(let t of e)if((0,f.kFe)(t)){a(!0),l=!0;break}l||a(!1)}else a(!1);let r=t.getTextContent().replace(/\n/g,"");if(!t.isCollapsed()&&""===r)return void a(!1)})},o[0]=e,o[1]=u):u=o[1];let d=u,p,h;return(o[2]!==d?(p=()=>(document.addEventListener("selectionchange",d),document.addEventListener("mouseup",d),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("mouseup",d)}),h=[d],o[2]=d,o[3]=p,o[4]=h):(p=o[3],h=o[4]),(0,m.useEffect)(p,h),o[5]!==e||o[6]!==d?(l=()=>(0,f.Sdt)(e.registerUpdateListener(()=>{d()}),e.registerRootListener(()=>{null===e.getRootElement()&&a(!1)})),n=[e,d],o[5]=e,o[6]=d,o[7]=l,o[8]=n):(l=o[7],n=o[8]),(0,m.useEffect)(l,n),i&&s)?(o[9]!==t||o[10]!==e?(r=(0,A.createPortal)((0,g.jsx)(nm,{anchorElem:t,editor:e}),t),o[9]=t,o[10]=e,o[11]=r):r=o[11],r):null}(l,t)},position:"floatingAnchorElem"}]}),nv=()=>(0,g.jsx)("svg",{className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{clipRule:"evenodd",d:"M5.33333 4.5C4.8731 4.5 4.5 4.8731 4.5 5.33333V7.5H9.5V4.5H5.33333ZM5.33333 3.5C4.32081 3.5 3.5 4.32081 3.5 5.33333V14.6667C3.5 15.6792 4.32081 16.5 5.33333 16.5H14.6667C15.6792 16.5 16.5 15.6792 16.5 14.6667V5.33333C16.5 4.32081 15.6792 3.5 14.6667 3.5H5.33333ZM10.5 4.5V7.5H15.5V5.33333C15.5 4.8731 15.1269 4.5 14.6667 4.5H10.5ZM15.5 8.5H10.5V11.5H15.5V8.5ZM15.5 12.5H10.5V15.5H14.6667C15.1269 15.5 15.5 15.1269 15.5 14.6667V12.5ZM9.5 15.5V12.5H4.5V14.6667C4.5 15.1269 4.8731 15.5 5.33333 15.5H9.5ZM4.5 11.5H9.5V8.5H4.5V11.5Z",fill:"currentColor",fillRule:"evenodd"})}),nx=/^\|(.+)\|\s?$/,nb=/^(\| ?:?-*:? ?)+\|\s?$/,nC=(e,t)=>
1{e=e.replace(/\\n/g,"\n");let l=(0,F.np)(F.o5.NO_STATUS);return(0,u.b)(e,t,l),l},nk=(e,t)=>{let l=e.match(nx);return l&&l[1]?l[1].split("|").map(e=>nC(e,t)):null},ny=()=>(0,g.jsxs)("svg",{fill:"none",height:"18",viewBox:"0 0 20 20",width:"18",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M5 11C5.55228 11 6 10.5523 6 10C6 9.44772 5.55228 9 5 9C4.44772 9 4 9.44772 4 10C4 10.5523 4.44772 11 5 11Z",fill:"currentColor"}),(0,g.jsx)("path",{d:"M10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}),(0,g.jsx)("path",{d:"M15 11C15.5523 11 16 10.5523 16 10C16 9.44772 15.5523 9 15 9C14.4477 9 14 9.44772 14 10C14 10.5523 14.4477 11 15 11Z",fill:"currentColor"})]});function nw(e){let t=e.getShape();return{columns:t.toX-t.fromX+1,rows:t.toY-t.fromY+1}}function nS(e){let{cellMerge:t,contextRef:l,onClose:n,setIsMenuOpen:r,tableCellNode:o}=e,[i]=(0,p.DF)(),a=(0,m.useRef)(null),[s,u]=(0,m.useState)(o),[d,c]=(0,m.useState)({columns:1,rows:1}),[h,v]=(0,m.useState)(!1),[x,b]=(0,m.useState)(!1),{y:C}=(0,w.useScrollInfo)();(0,m.useEffect)(()=>i.registerMutationListener(F.B9,e=>{"updated"===e.get(s.getKey())&&i.getEditorState().read(()=>{u(s.getLatest())})},{skipInitialization:!0}),[i,s]),(0,m.useEffect)(()=>{i.getEditorState().read(()=>{let e=(0,f.vJq)();if((0,F.Ln)(e)){let t=nw(e);c(nw(e)),v(t.columns>1||t.rows>1)}b(function(){let e=(0,f.vJq)();if((0,f.I2P)(e)&&!e.isCollapsed()||(0,F.Ln)(e)&&!e.anchor.is(e.focus)||!(0,f.I2P)(e)&&!(0,F.Ln)(e))return!1;let[t]=(0,F.be)(e.anchor);return t.__colSpan>1||t.__rowSpan>1}())})},[i]),(0,m.useEffect)(()=>{let e=l.current,t=a.current,n=i.getRootElement();if(null!=e&&null!=t&&null!=n){let l=n.getBoundingClientRect(),r=e.getBoundingClientRect();t.style.opacity="1";let o=t.getBoundingClientRect(),i=r.right+5;if(i+o.width>window.innerWidth||i+o.width>l.right){let e=r.left-o.width-5;i=(e<0?5:e)+window.pageXOffset}t.style.left="".concat(i+window.pageXOffset,"px");let a=r.top;if(a+o.height>window.innerHeight){let e=r.bottom-o.height;a=e<0?5:e}t.style.top="".concat(a,"px")}},[l,a,i,C]),(0,m.useEffect)(()=>{function e(e){null!=a.current&&null!=l.current&&(0,f.vAA)(e.target)&&!a.current.contains(e.target)&&!l.current.contains(e.target)&&r(!1)}return window.addEventListener("click",e),()=>window.removeEventListener("click",e)},[r,l]);let k=(0,m.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s),t=(0,F.SZ)(e,i.getElementByKey(e.getKey()));if(null===t)throw Error("Expected to find tableElement in DOM");let l=(0,F.xp)(t);null!==l&&l.$clearHighlight(),e.markDirty(),u(s.getLatest())}(0,f.n1P)(null)})},[i,s]),y=(0,m.useCallback)(e=>{i.update(()=>{for(let t=0;t<d.rows;t++)(0,F.zC)(e);n()})},[i,n,d.rows]),S=(0,m.useCallback)(e=>{i.update(()=>{for(let t=0;t<d.columns;t++)(0,F.JW)(e);
1n()})},[i,n,d.columns]),E=(0,m.useCallback)(()=>{i.update(()=>{(0,F.Hv)(),n()})},[i,n]),T=(0,m.useCallback)(()=>{i.update(()=>{(0,F.sJ)(s).remove(),k(),n()})},[i,s,k,n]),_=(0,m.useCallback)(()=>{i.update(()=>{(0,F.NL)(),n()})},[i,n]),L=(0,m.useCallback)(()=>{i.update(()=>{let e=(0,F.sJ)(s),t=(0,F.pA)(s),[l]=(0,F.tV)(e,null,null),r=new Set,o=s.getHeaderStyles()^F.o5.ROW;if(l[t])for(let e=0;e<l[t].length;e++){let n=l[t][e];(null==n?void 0:n.cell)&&(r.has(n.cell)||(r.add(n.cell),n.cell.setHeaderStyles(o,F.o5.ROW)))}k(),n()})},[i,s,k,n]),N=(0,m.useCallback)(()=>{i.update(()=>{let e=(0,F.sJ)(s),t=(0,F.Ze)(s),[l]=(0,F.tV)(e,null,null),r=new Set,o=s.getHeaderStyles()^F.o5.COLUMN;if(l)for(let e=0;e<l.length;e++){var i;let n=null==l||null==(i=l[e])?void 0:i[t];(null==n?void 0:n.cell)&&(r.has(n.cell)||(r.add(n.cell),n.cell.setHeaderStyles(o,F.o5.COLUMN)))}k(),n()})},[i,s,k,n]),j=(0,m.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s);e&&e.setRowStriping(!e.getRowStriping())}k(),n()})},[i,s,k,n]),I=(0,m.useCallback)(()=>{i.update(()=>{if(s.isAttached()){let e=(0,F.sJ)(s);e&&e.setFrozenColumns(+(0===e.getFrozenColumns()))}k(),n()})},[i,s,k,n]),M=null;return t&&(h?M=(0,g.jsx)("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>void i.update(()=>{let e,t=(0,f.vJq)();if(!(0,F.Ln)(t))return;let l=t.getNodes().filter(F.Xx),r=(0,F.ur)(l);r&&(e=r.getLastDescendant(),(0,f.kFe)(e)?e.select():(0,f.ff4)(e)?e.selectEnd():null!==e&&e.selectNext(),n())}),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Merge cells"})}):x&&(M=(0,g.jsx)("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>void i.update(()=>{(0,F.GA)()}),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Unmerge cells"})}))),(0,A.createPortal)((0,g.jsxs)("div",{className:"table-action-menu-dropdown",onClick:e=>{e.stopPropagation()},ref:a,children:[M?(0,g.jsxs)(m.Fragment,{children:[M,(0,g.jsx)("hr",{})]}):null,(0,g.jsx)("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>j(),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Toggle Row Striping"})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>I(),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Toggle First Column Freeze"})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>y(!1),type:"button",children:(0,g.jsxs)("span",{className:"text",children:["Insert ",1===d.rows?"row":"".concat(d.rows," rows")," above"]})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>y(!0),type:"button",children:(0,g.jsxs)("span",{className:"text",children:["Insert ",1===d.rows?"row":"".concat(d.rows," rows")," below"]})}),(0,g.jsx)("hr",{}),(0,g.jsx)("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>S(!1),type:"button",children:(0,g.jsxs)("span",{className:"text",children:["Insert ",1===d.columns?"column":"".concat(d.columns," columns")," ","left"]})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>S(!0),type:"button",children:(0,g.jsxs)("span",{className:"text",children:["Insert ",1===d.columns?"column":"".concat(d.columns," columns")," ","right"]})}),(0,g.jsx)("hr",{}),(0,g.jsx)("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>_(),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Delete column"})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>E(),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Delete row"})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-delete",onClick:()=>T(),type:"button",children:(0,g.jsx)("span",{className:"text",children:"Delete table"})}),(0,g.jsx)("hr",{}),(0,g.jsx)("button",{className:"item","data-test-id":"table-row-header",onClick:()=>L(),type:"button",children:(0,g.jsxs)("span",{className:"text",children:[(s.__headerState&F.o5.ROW)===F.o5.ROW?"Remove":"Add"," ","row header"]})}),(0,g.jsx)("button",{className:"item","data-test-id":"table-column-header",onClick:()=>N(),type:"button",children:(0,g.jsxs)("span",{className:"text",children:[(s.__headerState&F.o5.COLUMN)===F.o5.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function nE(e){let{anchorElem:t,cellMerge:l}=e,[n]=(0,p.DF)(),r=(0,m.useRef)(null),o=(0,m.useRef)(null),[i,a]=(0,m.useState)(!1),[s,u]=(0,m.useState)(null),d=(0,m.useCallback)(()=>{let e=r.current,l=(0,f.vJq)(),o=(0,f.peL)(n._window),i=document.activeElement;function a(){e&&(e.classList.remove("table-cell-action-button-container--active"),e.classList.add("table-cell-action-button-container--inactive")),u(null)}if(null==l||null==e)return a();let s=n.getRootElement(),d=null,c=null;if((0,f.I2P)(l)&&null!==s&&null!==o&&s.contains(o.anchorNode)){let e=(0,F.zp)(l.anchor.getNode());if(null==e||null==(c=n.getElementByKey(e.getKey()))||!e.isAttached())return a();let t=(0,F.sJ)(e),r=(0,F.SZ)(t,n.getElementByKey(t.getKey()));if(null===r)throw Error("TableActionMenu: Expected to find tableElement in DOM");d=(0,F.xp)(r),u(e)}else if((0,F.Ln)(l)){let e=(0,F.zp)(l.anchor.getNode());if(!(0,F.Xx)(e))throw Error("TableSelection anchorNode must be a TableCellNode");let t=(0,F.sJ)(e),r=(0,F.SZ)(t,n.getElementByKey(t.getKey()));if(null===r)throw Error("TableActionMenu: Expected to find tableElement in DOM");d=(0,F.xp)(r),c=n.getElementByKey(e.getKey())}else if(!i)return a();if(null===d||null===c)return a();let p=!d||!d.isSelecting;if(e.classList.toggle("table-cell-action-button-container--active",p),e.classList.toggle("table-cell-action-button-container--inactive",!p),p){let l=c.getBoundingClientRect(),n=t.getBoundingClientRect(),r=l.top-n.top,o=l.right-n.left;e.style.transform="translate(".concat(o,"px, ").concat(r,"px)")}},[n,t]);(0,m.useEffect)(()=>{let e,t=()=>{e=void 0,n.getEditorState().read(d)},l=()=>(void 0===e&&(e=setTimeout(t,0)),!1);return(0,f.Sdt)(n.registerUpdateListener(l),n.registerCommand(f.MvL,l,f.da8),n.registerRootListener((e,t)=>
1{t&&t.removeEventListener("pointerup",l),e&&(e.addEventListener("pointerup",l),l())}),()=>clearTimeout(e))});let c=(0,m.useRef)(s);return(0,m.useEffect)(()=>{c.current!==s&&a(!1),c.current=s},[c,s]),(0,g.jsx)("div",{className:"table-cell-action-button-container",ref:r,children:null!=s&&(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("button",{className:"table-cell-action-button",onClick:e=>{e.stopPropagation(),a(!i)},ref:o,type:"button",children:(0,g.jsx)(ny,{})}),i&&(0,g.jsx)(nS,{cellMerge:l,contextRef:o,onClose:()=>a(!1),setIsMenuOpen:a,tableCellNode:s})]})})}function nT(e){let{editor:t}=e,l=(0,m.useRef)(null),n=(0,m.useRef)(null),r=(0,m.useRef)(null),[o,i]=(0,m.useState)(!1),a=(0,d.b)(),s=(0,m.useRef)(null),[u,c]=(0,m.useState)(null),[p,h]=(0,m.useState)(null),[v,x]=(0,m.useState)(!1),[b,C]=(0,m.useState)(null),k=(0,m.useCallback)(()=>{h(null),l.current=null,C(null),s.current=null,r.current=null},[]);(0,m.useEffect)(()=>{let e=new Set;return(0,f.Sdt)(t.registerMutationListener(F.HA,t=>{for(let[l,n]of t)"destroyed"===n?e.delete(l):e.add(l);i(e.size>0)}),t.registerNodeTransform(F.HA,e=>{if(e.getColWidths())return e;let t=e.getColumnCount();return e.setColWidths(Array(t).fill(92)),e}))},[t]),(0,m.useEffect)(()=>{if(!o)return;let e=e=>{let o=e.target;if((0,f.sby)(o)){if(b)return void c({x:e.clientX,y:e.clientY});if(x((1&e.buttons)==1),!(n.current&&n.current.contains(o))&&l.current!==o){l.current=o;let e=(0,F.cn)(o);e&&p!==e?t.getEditorState().read(()=>{let n=(0,f.xL4)(e.elem);if(!n)throw Error("TableCellResizer: Table cell node not found.");let i=(0,F.sJ)(n),a=(0,F.SZ)(i,t.getElementByKey(i.getKey()));if(!a)throw Error("TableCellResizer: Table element not found.");l.current=o,r.current=a.getBoundingClientRect(),h(e)},{editor:t}):null==e&&k()}}},i=e=>{x(!0)},a=e=>{x(!1)},s=t.registerRootListener((t,l)=>{null==l||l.removeEventListener("mousemove",e),null==l||l.removeEventListener("mousedown",i),null==l||l.removeEventListener("mouseup",a),null==t||t.addEventListener("mousemove",e),null==t||t.addEventListener("mousedown",i),null==t||t.addEventListener("mouseup",a)});return()=>{s()}},[p,b,t,o,k]);let y=(0,m.useCallback)(e=>{if(!p)throw Error("TableCellResizer: Expected active cell.");t.update(()=>{let l=(0,f.xL4)(p.elem);if(!(0,F.Xx)(l))throw Error("TableCellResizer: Table cell node not found.");let n=(0,F.sJ)(l),r=(0,F.pA)(l),o=n.getChildren(),i=l.getColSpan()===n.getColumnCount()?r:r+l.getRowSpan()-1;if(i>=o.length||i<0)throw Error("Expected table cell to be inside of table row.");let a=o[i];if(!(0,F.RN)(a))throw Error("Expected table row");let s=a.getHeight();void 0===s&&(s=Math.min(...a.getChildren().map(e=>{var l;return null!=(l=w(e,t))?l:1/0})));let u=Math.max(s+e,33);a.setHeight(u)},{tag:f.OQi})},[p,t]),w=(e,t)=>{var l;return null==(l=t.getElementByKey(e.getKey()))?void 0:l.clientHeight},S=(0,m.useCallback)(e=>{if(!p)throw Error("TableCellResizer: Expected active cell.");t.update(()=>{let t,l=(0,f.xL4)(p.elem);if(!(0,F.Xx)(l))throw Error("TableCellResizer: Table cell node not found.");let n=(0,F.sJ)(l),[r]=(0,F.tV)(n,null,null),o=(r.forEach(e=>{e.forEach((e,n)=>{e.cell===l&&(t=n)})}),t);if(void 0===o)throw Error("TableCellResizer: Table column not found.");let i=n.getColWidths();if(!i)return;let a=i[o];if(void 0===a)return;let s=[...i],u=Math.max(a+e,92);s[o]=u,n.setColWidths(s)},{tag:f.OQi})},[p,t]),E=(0,m.useCallback)(e=>{let t=l=>{if(l.preventDefault(),l.stopPropagation(),!p)throw Error("TableCellResizer: Expected active cell.");if(s.current){let{x:n,y:r}=s.current;if(null===p)return;let o=(0,I.OV)(l.target);"bottom"===e?y((l.clientY-r)/o):S((l.clientX-n)/o),k(),document.removeEventListener("mouseup",t)}};return t},[p,k,S,y]),T=(0,m.useCallback)(e=>t=>{if(t.preventDefault(),t.stopPropagation(),!p)throw Error("TableCellResizer: Expected active cell.");s.current={x:t.clientX,y:t.clientY},c(s.current),C(e),document.addEventListener("mouseup",E(e))},[p,E]),[_,L]=(0,m.useState)({bottom:null,left:null,right:null,top:null});return(0,m.useEffect)(()=>{if(p){let{height:e,left:t,top:l,width:n}=p.elem.getBoundingClientRect(),o=(0,I.OV)(p.elem),i={bottom:{backgroundColor:"none",cursor:"row-resize",height:"".concat(10,"px"),left:"".concat(window.scrollX+t,"px"),top:"".concat(window.scrollY+l+e-5,"px"),width:"".concat(n,"px")},right:{backgroundColor:"none",cursor:"col-resize",height:"".concat(e,"px"),left:"".concat(window.scrollX+t+n-5,"px"),top:"".concat(window.scrollY+l,"px"),width:"".concat(10,"px")}},a=r.current;b&&u&&a&&("bottom"===b?(i[b].left="".concat(window.scrollX+a.left,"px"),i[b].top="".concat(window.scrollY+u.y/o,"px"),i[b].height="3px",i[b].width="".concat(a.width,"px")):(i[b].top="".concat(window.scrollY+a.top,"px"),i[b].left="".concat(window.scrollX+u.x/o,"px"),i[b].width="3px",i[b].height="".concat(a.height,"px")),i[b].backgroundColor="#adf"),L(i)}else L({bottom:null,left:null,right:null,top:null})},[p,b,u]),(0,g.jsx)("div",{ref:n,children:null!=p&&!v&&(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("div",{className:"".concat(a.editorConfig.lexical.theme.tableCellResizer," TableCellResizer__ui"),onMouseDown:T("right"),style:_.right||void 0}),(0,g.jsx)("div",{className:"".concat(a.editorConfig.lexical.theme.tableCellResizer," TableCellResizer__ui"),onMouseDown:T("bottom"),style:_.bottom||void 0})]})})}var n_=Math.max,nL=Math.min,nN=function(e,t,l){let n,r,o=0,i,a=!1,s=!1,u,d,c,p=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){let l=n,r=i;return n=i=void 0,o=t,d=e.apply(r,l)}function f(e){let l=e-r,n=e-o;return void 0===r||l>=t||l<0||s&&n>=u}function m(){let e,l,n,i=Date.now();if(f(i))return g(i);c=setTimeout(m,(e=i-r,l=i-o,n=t-e,s?nL(n,u-l):n))}function g(e){return c=void 0,p&&n?h(e):(n=i=void 0,d)}function v(){let e=Date.now(),l=f(e);
1if(n=arguments,i=this,r=e,l){if(void 0===c){var u;return o=u=r,c=setTimeout(m,t),a?h(u):d}if(s)return clearTimeout(c),c=setTimeout(m,t),h(r)}return void 0===c&&(c=setTimeout(m,t)),d}return t=t||0,"object"==typeof l&&(a=!!l.leading,u=(s="maxWait"in l)?n_(l.maxWait||0,t):u,p="trailing"in l?!!l.trailing:p),v.cancel=function(){void 0!==c&&clearTimeout(c),o=0,n=r=i=c=void 0},v.flush=function(){return void 0===c?d:g(Date.now())},v};function nj(e){var t;let l,n,r,o,i,{anchorElem:a}=e,[s]=(0,p.DF)(),u=(0,y.a)(),h=(0,d.b)(),[v,x]=(0,m.useState)(!1),[b,C]=(0,m.useState)(!1),[k,w]=(0,m.useState)(!1),[S,E]=(0,m.useState)({}),T=(0,m.useRef)(new Set),_=(0,m.useRef)(null),L=(t=e=>{var t;let{isOutside:l,tableDOMNode:n}=function(e,t){let l=e.target;if(!(0,f.sby)(l))return{isOutside:!0,tableDOMNode:null};{let e=l.closest("td.".concat(t.theme.tableCell,", th.").concat(t.theme.tableCell));return{isOutside:!(e||l.closest("button.".concat(t.theme.tableAddRows))||l.closest("button.".concat(t.theme.tableAddColumns))||l.closest("div.".concat(t.theme.tableCellResizer))),tableDOMNode:e}}}(e,null==(t=h.editorConfig)?void 0:t.lexical);if(l){x(!1),C(!1);return}if(!n)return;_.current=n;let r=null,o=null,i=null;if(s.getEditorState().read(()=>{let e=(0,f.xL4)(n);if((0,F.Xx)(e)){let l=(0,f.BtT)(e,e=>(0,F.TX)(e));if(!(0,F.TX)(l))return;if(i=(0,F.SZ)(l,s.getElementByKey(l.getKey()))){var t;let n=l.getChildrenSize(),i=null==(t=l.getChildAtIndex(0))?void 0:t.getChildrenSize(),a=(0,F.pA)(e),s=(0,F.Ze)(e);a===n-1?r=e:s===i-1&&(o=e)}}},{editor:s}),!i)return;let u=i.parentElement;if(!u)return;let{bottom:d,height:c,left:p,right:m,width:g,y:v}=i.getBoundingClientRect(),b=!1;u&&u.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(b=u.scrollWidth>u.clientWidth);let{left:k,y:y}=a.getBoundingClientRect();r?(C(!1),x(!0),E({height:20,left:b&&u?u.offsetLeft:p-k,top:d-y+5,width:b&&u?u.offsetWidth:g})):o&&(C(!0),x(!1),E({height:c,left:m-k+5,top:v-y,width:20}))},n=(0,c.c)(6),r=(0,m.useRef)(null),n[0]!==t||250!==n[1]||50!==n[2]?(o=()=>(r.current=nN(t,50,{maxWait:250}),()=>{var e;null==(e=r.current)||e.cancel()}),i=[t,50,250],n[0]=t,n[1]=250,n[2]=50,n[3]=o,n[4]=i):(o=n[3],i=n[4]),(0,m.useEffect)(o,i),n[5]===Symbol.for("react.memo_cache_sentinel")?(l=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];r.current&&r.current(...t)},n[5]=l):l=n[5],l),N=(0,m.useMemo)(()=>new ResizeObserver(()=>{x(!1),C(!1)}),[]);(0,m.useEffect)(()=>{if(k)return document.addEventListener("mousemove",L),()=>{x(!1),C(!1),document.removeEventListener("mousemove",L)}},[k,L]),(0,m.useEffect)(()=>(0,f.Sdt)(s.registerMutationListener(F.HA,e=>{s.getEditorState().read(()=>{let t=!1;for(let[l,n]of e)switch(n){case"created":T.current.add(l),t=!0;break;case"destroyed":T.current.delete(l),t=!0}if(t){for(let e of(N.disconnect(),T.current)){let{tableElement:t}=(0,F.cl)(e);N.observe(t)}w(T.current.size>0)}},{editor:s})},{skipInitialization:!1})),[s,N]);let j=e=>{s.update(()=>{var t;_.current&&(null==(t=(0,f.xL4)(_.current))||t.selectEnd(),e?((0,F.zC)(),x(!1)):((0,F.JW)(),C(!1)))})};return u?(0,g.jsxs)(g.Fragment,{children:[v&&(0,g.jsx)("button",{"aria-label":"Add Row",className:h.editorConfig.lexical.theme.tableAddRows,onClick:()=>j(!0),style:{...S},type:"button"}),b&&(0,g.jsx)("button",{"aria-label":"Add Column",className:h.editorConfig.lexical.theme.tableAddColumns,onClick:()=>j(!1),style:{...S},type:"button"})]}):null}var nI=(0,f.guI)("OPEN_EMBED_DRAWER_COMMAND"),nM=(0,m.createContext)({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}}),nF=K({markdownTransformers:[e=>{let{allTransformers:t}=e;return{type:"element",dependencies:[F.HA,F.py,F.B9],export:e=>{if(!(0,F.TX)(e))return null;let l=[];for(let n of e.getChildren()){let e=[];
1if(!(0,F.RN)(n))continue;let r=!1;for(let l of n.getChildren())(0,F.Xx)(l)&&(e.push((0,u.c)(t,l).replace(/\n/g,"\\n").trim()),l.__headerState===F.o5.ROW&&(r=!0));l.push("| ".concat(e.join(" | ")," |")),r&&l.push("| ".concat(e.map(e=>"---").join(" | ")," |"))}return l.join("\n")},regExp:nx,replace:(e,l,n)=>{let r=n[0];if(!r)return;if(nb.test(r)){let t=e.getPreviousSibling();if(!t||!(0,F.TX)(t))return;let l=t.getChildren(),n=l[l.length-1];if(!n||!(0,F.RN)(n))return;n.getChildren().forEach(e=>{(0,F.Xx)(e)&&e.setHeaderStyles(F.o5.ROW,F.o5.ROW)}),e.remove();return}let o=nk(r,t);if(null==o)return;let i=[o],a=e.getPreviousSibling(),s=o.length;for(;a&&!(!(0,f.bSg)(a)||1!==a.getChildrenSize());){let e=a.getFirstChild();if(!(0,f.kFe)(e))break;let l=nk(e.getTextContent(),t);if(null==l)break;s=Math.max(s,l.length),i.unshift(l);let n=a.getPreviousSibling();a.remove(),a=n}let u=(0,F.pK)();for(let e of i){let l=(0,F.hx)();u.append(l);for(let n=0;n<s;n++)l.append(n<e.length?e[n]:nC("",t))}let d=e.getPreviousSibling();(0,F.TX)(d)&&function(e){let t=e.getFirstChild();return(0,F.RN)(t)?t.getChildrenSize():0}(d)===s?(d.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}}}],nodes:[F.HA,F.B9,F.py],plugins:[{Component:()=>{let e,t,l,n=(0,c.c)(16),[r]=(0,p.DF)(),o=(0,m.use)(nM),s=(0,w.useEditDepth)(),{fieldProps:u,uuid:h}=(0,d.b)(),{schemaPath:v}=u,x="lexical-table-create-"+h,b;n[0]!==s||n[1]!==x?(b=(0,w.formatDrawerSlug)({slug:x,depth:s}),n[0]=s,n[1]=x,n[2]=b):b=n[2];let C=b,{toggleDrawer:k}=(0,a.a)(C,!0),y;return n[3]!==r||n[4]!==k?(y=()=>{if(!r.hasNodes([F.HA,F.py,F.B9]))throw Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return(0,f.Sdt)(r.registerCommand(nI,()=>{let e=null;return r.getEditorState().read(()=>{let t=(0,f.vJq)();(0,f.I2P)(t)&&(e=t)}),e&&k(),!0},f.jZM))},n[3]=r,n[4]=k,n[5]=y):y=n[5],n[6]!==o||n[7]!==r||n[8]!==k?(e=[o,r,k],n[6]=o,n[7]=r,n[8]=k,n[9]=e):e=n[9],(0,m.useEffect)(y,e),n[10]!==r?(t=(e,t)=>{t.columns&&t.rows&&r.dispatchCommand(F.Ng,{columns:String(t.columns),rows:String(t.rows)})},n[10]=r,n[11]=t):t=n[11],n[12]!==C||n[13]!==v||n[14]!==t?(l=(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)(i.a,{drawerSlug:C,drawerTitle:"Create Table",featureKey:"experimental_table",handleDrawerSubmit:t,schemaPath:v,schemaPathSuffix:"fields"}
1),(0,g.jsx)(J.A,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]}),n[12]=C,n[13]=v,n[14]=t,n[15]=l):l=n[15],l},position:"normal"},{Component:()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l=(0,y.a)(),n;return e[0]!==t||e[1]!==l?(n=l?(0,A.createPortal)((0,g.jsx)(nT,{editor:t}),document.body):null,e[0]=t,e[1]=l,e[2]=n):n=e[2],n},position:"normal"},{Component:e=>{let t=(0,c.c)(3),{anchorElem:l}=e,n=(0,y.a)(),r;return t[0]!==l||t[1]!==n?(r=(0,A.createPortal)(n?(0,g.jsx)(nE,{anchorElem:null!=l?l:document.body,cellMerge:!0}):null,null!=l?l:document.body),t[0]=l,t[1]=n,t[2]=r):r=t[2],r},position:"floatingAnchorElem"},{Component:function(e){let t,l=(0,c.c)(2),{anchorElem:n}=e,r=void 0===n?document.body:n;return(0,y.a)()?(l[0]!==r?(t=(0,A.createPortal)((0,g.jsx)(nj,{anchorElem:r}),r),l[0]=r,l[1]=t):t=l[1],t):null},position:"floatingAnchorElem"}],providers:[function(e){let{children:t}=e,[l,n]=(0,m.useState)({cellEditorConfig:null,cellEditorPlugins:null});return(0,g.jsx)(nM,{value:(0,m.useMemo)(()=>({cellEditorConfig:l.cellEditorConfig,cellEditorPlugins:l.cellEditorPlugins,set:(e,t)=>{n({cellEditorConfig:e,cellEditorPlugins:t})}}),[l.cellEditorConfig,l.cellEditorPlugins]),children:t})}],slashMenu:{groups:[W([{Icon:nv,key:"table",keywords:["table"],label:"Table",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(nI,{})}}])]},toolbarFixed:{groups:[te([{ChildComponent:nv,key:"table",label:"Table",onSelect:e=>{let{editor:t}=e;t.dispatchCommand(nI,{})}}])]}}),nR=()=>(0,g.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"none",focu
1sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,g.jsx)("path",{d:"M14.6667 4H5.33333C4.59695 4 4 4.59695 4 5.33333V14.6667C4 15.403 4.59695 16 5.33333 16H14.6667C15.403 16 16 15.403 16 14.6667V5.33333C16 4.59695 15.403 4 14.6667 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,g.jsx)("path",{d:"M7.99984 9.33366C8.73622 9.33366 9.33317 8.73671 9.33317 8.00033C9.33317 7.26395 8.73622 6.66699 7.99984 6.66699C7.26346 6.66699 6.6665 7.26395 6.6665 8.00033C6.6665 8.73671 7.26346 9.33366 7.99984 9.33366Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,g.jsx)("path",{d:"M16 11.9995L13.9427 9.94214C13.6926 9.69218 13.3536 9.55176 13 9.55176C12.6464 9.55176 12.3074 9.69218 12.0573 9.94214L6 15.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});function nP(e,t){if(e.hasAttribute("data-lexical-pending-upload-form-id")){let l=e.getAttribute("data-lexical-pending-upload-form-id");if(null!=l)return{node:t({data:{pending:{formID:l,src:e.getAttribute("src")||""}}})}}if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let l=e.getAttribute("data-lexical-upload-id"),n=e.getAttribute("data-lexical-upload-relation-to");if(null!=l&&null!=n)return{node:t({data:{fields:{},relationTo:n,value:l}})}}return{node:t({data:{pending:{formID:new k.default().toHexString(),src:e.getAttribute("src")||""}}})}}var nA=class extends h.d{static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"upload"}static importDOM(){return{img:e=>({conversion:e=>nP(e,nD),priority:0})}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id),2!==e.version||(null==e?void 0:e.id)||(e.id=new k.default().toHexString(),e.version=3);let l=nD({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return l.setFormat(e.format),l}static isInline(){return!1}createDOM(e){var t;let l=document.createElement("div");return(0,f.ZB7)(l,null==e||null==(t=e.theme)?void 0:t.upload),l}decorate(){return null}exportDOM(){var e,t;let l=document.createElement("img"),n=this.__data;return n.pending?(l.setAttribute("data-lexical-pending-upload-form-id",String(null==n||null==(e=n.pending)?void 0:e.formID)),l.setAttribute("src",(null==n||null==(t=n.pending)?void 0:t.src)||"")):(l.setAttribute("data-lexical-upload-id",String(null==n?void 0:n.value)),l.setAttribute("data-lexical-upload-relation-to",null==n?void 0:n.relationTo)),{element:l}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){this.getWritable().__data=e}updateDOM(){return!1}constructor({data:e,format:t,key:l}){super(t,l),this.__data=e}};function nD(e){let{data:t}=e;return(null==t?void 0:t.id)||(t.id=new k.default().toHexString()),(0,f.pTq)(new nA({data:t}))}var nB=()=>(0,g.jsx)("div",{className:"lexical-upload",children:(0,g.jsx)(S.f,{height:"95px",width:"203px"})}),nH=m.lazy(()=>l.e(4431).then(l.bind(l,84431)).then(e=>({default:e.UploadComponent}))),nO=class extends nA{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:e=>nP(e,nJ),priority:0})}}static importJSON(e){var t;1===e.version&&(null==e||null==(t=e.value)?void 0:t.id)&&(e.value=e.value.id),2!==e.version||(null==e?void 0:e.id)||(e.id=new k.default().toHexString(),e.version=3);let l=nJ({data:{id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value}});return l.setFormat(e.format),l}decorate(e,t){var l,n;return this.__data.pending?(0,g.jsx)(nB,{}):(0,g.jsx)(nH,{className:null!=(n=null==t||null==(l=t.theme)?void 0:l.upload)?n:"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function nJ(e){let{data:t}=e;return(null==t?void 0:t.id)||(t.id=new k.default().toHexString()),(0,f.pTq)(new nO({data:t}))}function nz(e){return e instanceof nO}var nV=e=>
1{let t,l=(0,c.c)(13),{enabledCollectionSlugs:n}=e,[r]=(0,p.DF)(),[o,a]=(0,m.useState)(null),s;l[0]!==n?(s={collectionSlugs:n,uploads:!0},l[0]=n,l[1]=s):s=l[1];let{closeListDrawer:u,ListDrawer:d,openListDrawer:h}=lG(s),v,x;l[2]!==r||l[3]!==h?(v=()=>r.registerCommand(i.b,e=>(a((null==e?void 0:e.replace)?null==e?void 0:e.replace.nodeKey:null),h(),!0),f.jZM),x=[r,h],l[2]=r,l[3]=h,l[4]=v,l[5]=x):(v=l[4],x=l[5]),(0,m.useEffect)(v,x),l[6]!==u||l[7]!==r||l[8]!==o?(t=e=>{let{collectionSlug:t,doc:l}=e;u(),(e=>{let{editor:t,relationTo:l,replaceNodeKey:n,value:r}=e;n?t.update(()=>{let e=(0,f.nsf)(n);e&&e.replace(nJ({data:{fields:null,relationTo:l,value:r}}))}):t.dispatchCommand(nU,{fields:null,relationTo:l,value:r})})({editor:r,relationTo:t,replaceNodeKey:o,value:l.id})},l[6]=u,l[7]=r,l[8]=o,l[9]=t):t=l[9];let b=t,C;return l[10]!==d||l[11]!==b?(C=(0,g.jsx)(d,{onSelect:b}),l[10]=d,l[11]=b,l[12]=C):C=l[12],C},nW=()=>{let e=(0,c.c)(3),[t]=(0,p.DF)(),l,n;return e[0]!==t?(l=()=>t.registerCommand(i.b,nK,f.jZM),n=[t],e[0]=t,e[1]=l,e[2]=n):(l=e[1],n=e[2]),(0,m.useEffect)(l,n),null},nZ=e=>{let{enabledCollectionSlugs:t}=e;return(null==t?void 0:t.length)?(0,g.jsx)(nV,{enabledCollectionSlugs:t}):(0,g.jsx)(nW,{})};function nK(){return w.toast.error("No upload collections enabled"),!0}var nU=(0,f.guI)("INSERT_UPLOAD_COMMAND");function nG(e){return{file:e.file,formID:e.formID}}function nq(){for(let t of(0,I.YF)()){var e;let l=t.node;nz(l)&&(null==(e=l.getData())?void 0:e.pending)&&l.remove()}}function nX(e){return[e.formID,e]}var nY=K({nodes:[nO],plugins:[{Component:e=>{let t,l,n=(0,c.c)(21),{clientProps:r}=e,[o]=(0,p.DF)(),i=null==r?void 0:r.disabledCollections,a=null==r?void 0:r.enabledCollections,s;n[0]!==i||n[1]!==a?(s={collectionSlugsBlacklist:i,collectionSlugsWhitelist:a,uploads:!0},n[0]=i,n[1]=a,n[2]=s):s=n[2];let{enabledCollectionSlugs:u}=lQ(s),{drawerSlug:d,setCollectionSlug:h,setInitialForms:v,setOnCancel:x,setOnSuccess:b,setSelectableCollections:C}=(0,w.useBulkUpload)(),{isModalOpen:y,openModal:S}=(0,w.useModal)(),E;n[3]!==d||n[4]!==o||n[5]!==u||n[6]!==y||n[7]!==S||n[8]!==h||n[9]!==v||n[10]!==x||n[11]!==b||n[12]!==C?(E=e=>{let{files:t}=e;if((null==t?void 0:t.length)!==0&&(v(e=>[...null!=e?e:[],...t.map(nG)]),!y(d))){if(!u.length||!u[0])return;h(u[0]),C(u),x(()=>{o.update(nq)}),b(e=>{let t=new Map(e.map(nX));o.update(()=>{for(let l of(0,I.YF)()){let n=l.node;if(nz(n)){let l=n.getData();if(null==l?void 0:l.pending){var e;let r=t.get(null==(e=l.pending)?void 0:e.formID);r&&n.replace(nJ({data:{id:new k.default().toHexString(),fields:{},relationTo:r.collectionSlug,value:r.doc.id}}))}}}})}),S(d)}},n[3]=d,n[4]=o,n[5]=u,n[6]=y,n[7]=S,n[8]=h,n[9]=v,n[10]=x,n[11]=b,n[12]=C,n[13]=E):E=n[13];let T=(0,w.useEffectEvent)(E),_;return n[14]!==o||n[15]!==T?(_=()=>{if(!o.hasNodes([nO]))throw Error("UploadPlugin: UploadNode not registered on editor");return(0,f.Sdt)(o.registerNodeTransform(nO,e=>{let t=e.getData();(null==t?void 0:t.pending)&&async function(){var e,l;let n=null,r=null==t||null==(e=t.pending)?void 0:e.src,o=null==t||null==(l=t.pending)?void 0:l.formID;if(null==r?void 0:r.startsWith("data:")){let e=r.match(/data:(image\/[a-zA-Z]+);base64,/),t=e?e[1]:"image/png",l=atob(r.replace(/^data:image\/[a-zA-Z]+;base64,/,"")),i=Array(l.length);for(let e=0;e<l.length;e++)i[e]=l.charCodeAt(e);n={alt:void 0,file:new File([new Uint8Array(i)],"pasted-image."+(null==t?void 0:t.split("/",2)[1]),{type:t}),formID:o}}else if((null==r?void 0:r.startsWith("http"))||(null==r?void 0:r.startsWith("https"))){let e=await (await fetch(r)).blob(),t=r.split("/").pop()||"pasted-image"+e.type.split("/",2)[1];n={alt:void 0,file:new File([e],t,{type:e.type}),formID:o}}n&&T({files:[n]})}()}),o.registerCommand(nU,e=>(o.update(()=>{let t=(0,f.vJq)()||(0,f.S1w)();if((0,f.I2P)(t)){let l=nJ({data:{id:e.id,fields:e.fields,relationTo:e.relationTo,value:e.value}}),{focus:n}=t,r=n.getNode();(0,I.Pe)(l),(0,f.bSg)(r)&&!r.__first&&r.remove()}}),!0),f.jZM),o.registerCommand(f.waI,e=>{var t,l,n;if(!(e instanceof ClipboardEvent))return!1;let r=e.clipboardData;if(!(null==r||null==(t=r.types)?void 0:t.length)||(null==r||null==(l=r.types)?void 0:l.includes("text/html")))return!1;let i=[];return(null==r||null==(n=r.files)?void 0:n.length)&&Array.from(r.files).forEac
1h(e=>{i.push({alt:"",file:e,formID:new k.default().toHexString()})}),!!i.length&&(o.update(()=>{let e=(0,f.vJq)()||(0,f.S1w)();if((0,f.I2P)(e))for(let t of i){let l=nJ({data:{pending:{formID:t.formID,src:URL.createObjectURL(t.file)}}}),{focus:n}=e,r=n.getNode();(0,I.Pe)(l),(0,f.bSg)(r)&&!r.__first&&r.remove()}}),T({files:i}),!0)},f.AcJ),o.registerCommand(f.Sr4,e=>{var t,l;if(!(e instanceof DragEvent))return!1;let n=e.dataTransfer;if(!(null==n||null==(t=n.types)?void 0:t.length))return!1;let r=[];return(null==n||null==(l=n.files)?void 0:l.length)&&Array.from(n.files).forEach(e=>{r.push({alt:"",file:e,formID:new k.default().toHexString()})}),!!r.length&&(e.preventDefault(),e.stopPropagation(),o.update(()=>{if(function(e){let t=e.target;return!!((0,f.sby)(t)&&!t.closest("code, span.editor-image")&&(0,f.sby)(t.parentElement)&&t.parentElement.closest("div.ContentEditable__root"))}(e)){let t=function(e){let t,l=(0,f.OSq)(e.target);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&null!==l)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}(e),l=(0,f.uTE)();for(let e of(null!=t&&l.applyDOMRange(t),(0,f.n1P)(l),r)){let t=nJ({data:{pending:{formID:e.formID,src:URL.createObjectURL(e.file)}}}),{focus:n}=l,r=n.getNode();(0,I.Pe)(t),(0,f.bSg)(r)&&!r.__first&&r.remove()}}}),T({files:r}),!0)},f.AcJ))},n[14]=o,n[15]=T,n[16]=_):_=n[16],n[17]!==o?(t=[o],n[17]=o,n[18]=t):t=n[18],(0,m.useEffect)(_,t),n[19]!==u?(l=(0,g.jsx)(nZ,{enabledCollectionSlugs:u}),n[19]=u,n[20]=l):l=n[20],l},position:"normal"}],slashMenu:{groups:[W([{Icon:nR,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:e=>{let{i18n:t}=e;return t.t("lexical:upload:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(i.b,{replace:!1})}}])]},toolbarFixed:{groups:[te([{ChildComponent:nR,isActive:e=>{let{selection:t}=e;return!!(0,f.RTZ)(t)&&!!t.getNodes().length&&nz(t.getNodes()[0])},key:"upload",label:e=>{let{i18n:t}=e;return t.t("lexical:upload:label")},onSelect:e=>{let{editor:t}=e;t.dispatchCommand(i.b,{replace:!1})}}])]}}),n$={namespace:"lexical",theme:{block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"}},nQ=e=>{let t={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},l={};
1if(e.forEach(e=>{var t;"toolbarFixed"===e.key&&(null==(t=e.sanitizedClientFeatureProps)?void 0:t.customGroups)&&(l={...l,...e.sanitizedClientFeatureProps.customGroups})}),!(null==e?void 0:e.size))return t;for(let n of(e.forEach(e=>{var l,n,r,o,i,a,s,u,d,c,p,h,f,m,g,v;if((null==(l=e.providers)?void 0:l.length)&&(t.providers=t.providers.concat(e.providers)),(null==(n=e.enableFormats)?void 0:n.length)&&t.enabledFormats.push(...e.enableFormats),null==(r=e.nodes)?void 0:r.length)for(let l of e.nodes)t.nodes.push(l);if((null==(o=e.plugins)?void 0:o.length)&&e.plugins.forEach((l,n)=>{var r;null==(r=t.plugins)||r.push({clientProps:e.sanitizedClientFeatureProps,Component:l.Component,key:e.key+n,position:l.position})}),null==(a=e.toolbarInline)||null==(i=a.groups)?void 0:i.length)for(let l of e.toolbarInline.groups){let e=t.toolbarInline.groups.find(e=>e.key===l.key);e?t.toolbarInline.groups=t.toolbarInline.groups.filter(e=>e.key!==l.key):e={...l,items:[]},(null==l||null==(p=l.items)?void 0:p.length)&&(e.items=e.items.concat(l.items)),null==(h=t.toolbarInline)||h.groups.push(e)}if(null==(u=e.toolbarFixed)||null==(s=u.groups)?void 0:s.length)for(let l of e.toolbarFixed.groups){let e=t.toolbarFixed.groups.find(e=>e.key===l.key);e?t.toolbarFixed.groups=t.toolbarFixed.groups.filter(e=>e.key!==l.key):e={...l,items:[]},(null==l||null==(f=l.items)?void 0:f.length)&&(e.items=e.items.concat(l.items)),null==(m=t.toolbarFixed)||m.groups.push(e)}if(null==(d=e.slashMenu)?void 0:d.groups)for(let l of((null==(g=e.slashMenu.dynamicGroups)?void 0:g.length)&&(t.slashMenu.dynamicGroups=t.slashMenu.dynamicGroups.concat(e.slashMenu.dynamicGroups)),e.slashMenu.groups)){let e=t.slashMenu.groups.find(e=>e.key===l.key);e?t.slashMenu.groups=t.slashMenu.groups.filter(e=>e.key!==l.key):e={...l,items:[]},(null==l||null==(v=l.items)?void 0:v.length)&&(e.items=e.items.concat(l.items)),t.slashMenu.groups.push(e)}if(null==(c=e.markdownTransformers)?void 0:c.length)for(let l of e.markdownTransformers)"function"==typeof l?t.markdownTransformers.push(l({allNodes:t.nodes,allTransformers:t.markdownTransformers})):t.markdownTransformers.push(l);t.enabledFeatures.push(e.key)}),Object.keys(l).length>0&&(t.toolbarFixed.groups=t.toolbarFixed.groups.map(e=>{let t=l[e.key];return t?z(e,t):e})),t.toolbarInline.groups.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order),t.toolbarFixed.groups.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order),t.toolbarInline.groups))n.items.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order);for(let e of t.toolbarFixed.groups)e.items.sort((e,t)=>e.order&&t.order?e.order-t.order:e.order?-1:+!!t.order);return t};function n0(e,t,l,n){return{admin:l,features:nQ(e),lexical:t,resolvedFeatureMap:e,view:n}}var n1=(0,m.lazy)(()=>Promise.all([l.e(9010),l.e(4390)]).then(l.bind(l,44390)).then(e=>({default:e.RichText}))),n2=e=>(0,g.jsx)(u.f,{inheritable:!0,views:e.views,children:(0,g.jsx)(n6,{...e})}),n6=e=>{var t,l,n;let r,o=(0,c.c)(23),{admin:i,clientFeatures:a,featureClientImportMap:s,featureClientSchemaMap:d,field:p,lexicalEditorConfig:h,schemaPath:f,views:v}=e,x;o[0]!==i?(x=void 0===i?{}:i,o[0]=i,o[1]=x):x=o[1];let b=x,C;o[2]!==s?(C=void 0===s?{}:s,o[2]=s,o[3]=C):C=o[3];let k=C,y=void 0===h?n$:h,{currentView:w}=(0,u.g)(),E=null!=(n=null==v||null==(t=v[w])?void 0:t.admin)?n:b,T=null==v||null==(l=v[w])?void 0:l.lexical,_;o[4]!==y||o[5]!==T?(_="function"==typeof T?T(y):null!=T?T:y,o[4]=y,o[5]=T,o[6]=_):_=o[6];let L=_,{config:N}=(0,S.c)(),[j,I]=(0,m.useState)(null),M,F;return o[7]!==a||o[8]!==N||o[9]!==w||o[10]!==E||o[11]!==L||o[12]!==k||o[13]!==d||o[14]!==p||o[15]!==j||o[16]!==f||o[17]!==v?(M=()=>{if(j&&j.view===w)return;let e=null==v?void 0:v[w],t=(null==e?void 0:e.filterFeatures)?e.filterFeatures(a):a,l=[];for(let e of Object.values(t))e.clientFeatureProvider&&l.push(e.clientFeatureProvider(e.clientFeatureProps));I(n0(function(e){let{config:t,featureClientImportMap:l,featureClientSchemaMap:n,field:r,schemaPath:o,unSanitizedEditorConfig:i}=e,a=new Map;for(let e of i.features){var s,u,d;if(!(null==e||null==(s=e.clientFeatureProps)?void 0:s.featureKey)||(null==e||null==(u=e.clientFeatureProps)?void 0:u.order)===void 0||(null==e||null==(d=e.clientFeatureProps)?void 0:d.order)===null)throw Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");a.set(e.clientFeatureProps.featureKey,e)}i.features=i.features.sort((e,t)=>
1e.clientFeatureProps.order-t.clientFeatureProps.order);let c=new Map,p=0;for(let e of i.features){let s="function"==typeof e.feature?e.feature({config:t,featureClientImportMap:l,featureClientSchemaMap:n,featureProviderMap:a,field:r,resolvedFeatures:c,schemaPath:o,unSanitizedEditorConfig:i}):e.feature;s.key=e.clientFeatureProps.featureKey,s.order=p,c.set(e.clientFeatureProps.featureKey,s),p++}return c}({config:N,featureClientImportMap:k,featureClientSchemaMap:d,field:p,schemaPath:null!=f?f:p.name,unSanitizedEditorConfig:{features:l,lexical:L}}),L,E,w))},F=[E,a,N,k,d,p,j,L,f,w,v],o[7]=a,o[8]=N,o[9]=w,o[10]=E,o[11]=L,o[12]=k,o[13]=d,o[14]=p,o[15]=j,o[16]=f,o[17]=v,o[18]=M,o[19]=F):(M=o[18],F=o[19]),(0,m.useEffect)(M,F),o[20]!==j||o[21]!==e?(r=(0,g.jsx)(m.Suspense,{fallback:(0,g.jsx)(S.f,{height:"35vh"}),children:j&&(0,m.createElement)(n1,{...e,editorConfig:j,key:j.view})}),o[20]=j,o[21]=e,o[22]=r):r=o[22],r};function n5(e){return e instanceof HTMLElement}function n3(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter(Boolean).join(" ")}var n4=new WeakMap;function n7(e){let t=e.changedTouches[0];return void 0===t?null:[t.clientX,t.clientY]}function n8(e,t){let l=n4.get(e);if(void 0===l){let t=new Set,n=e=>{void 0!==l&&(l.start=n7(e))},r=e=>{if(void 0===l)return;let{start:n}=l;if(null===n)return;let r=n7(e);for(let l of t)null!==r&&l([r[0]-n[0],r[1]-n[1]],e)};e.addEventListener("touchstart",n),e.addEventListener("touchend",r),l={handleTouchend:r,handleTouchstart:n,listeners:t,start:null},n4.set(e,l)}return l.listeners.add(t),()=>{!function(e,t){let l=n4.get(e);if(void 0===l)return;let{listeners:n}=l;n.delete(t),0===n.size&&(n4.delete(e),e.removeEventListener("touchstart",l.handleTouchstart),e.removeEventListener("touchend",l.handleTouchend))}(e,t)}}function n9(e,t){return n8(e,(e,l)=>{let[n,r]=e;n<0&&-n>Math.abs(r)&&t(n,l)})}function re(e,t){return n8(e,(e,l)=>{let[n,r]=e;n>0&&n>Math.abs(r)&&t(n,l)})}function rt(e,t){return n8(e,(e,l)=>{let[n,r]=e;r<0&&-r>Math.abs(n)&&t(n,l)})}function rl(e,t){return n8(e,(e,l)=>{let[n,r]=e;r>0&&r>Math.abs(n)&&t(n,l)})}var rn=()=>{let e=(0,c.c)(2),{EditButton:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,g.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},rr=()=>{let e=(0,c.c)(2),{RemoveButton:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,g.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},ro=()=>{let e=(0,c.c)(2),{Label:t}=(0,r.a)(),l;return e[0]!==t?(l=t?(0,g.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},ri=e=>{let t=(0,c.c)(3),{children:l}=e,{InlineBlockContainer:n}=(0,r.a)(),o;return t[0]!==n||t[1]!==l?(o=n?(0,g.jsx)(n,{children:l}):null,t[0]=n,t[1]=l,t[2]=o):o=t[2],o},ra=e=>{let{children:t,...l}=e,{BlockCollapsible:n}=ef();return n?(0,g.jsx)(n,{...l,children:t}):null},rs=()=>{let e=(0,c.c)(2),{EditButton:t}=ef(),l;return e[0]!==t?(l=t?(0,g.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},ru=()=>{let e=(0,c.c)(2),{RemoveButton:t}=ef(),l;return e[0]!==t?(l=t?(0,g.jsx)(t,{}):null,e[0]=t,e[1]=l):l=e[1],l},rd=e=>{let{apiURL:t,depth:l,draft:n,locale:r}=e;return async e=>{let{id:o,collectionSlug:i,select:a}=e,s=(0,V.A)({depth:null!=l?l:0,draft:null!=n&&n,locale:r,select:a},{addQueryPrefix:!0});return await fetch("".concat(t,"/").concat(i,"/").concat(o).concat(s),{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(e=>e.json())}},rc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:e=>{var t;let{fields:l}=e;return l.code.includes("\n")||(null==(t=l.language)?void 0:t.length)?"```"+(l.language||"")+(l.code?"\n"+l.code:"")+"\n```":"```"+l.code+"```"},import:e=>{var t;let{children:l,closeMatch:n,openMatch:r}=e,o=null==r?void 0:r[1];return l.startsWith("\n")&&(l=l.slice(1)),l.endsWith("\n")&&(l=l.slice(0,-1)),n&&!l.includes("\n")&&(null==r||null==(t=r.input)?void 0:t.trim())!=="```"+o?{code:o+((null==l?void 0:l.length)?l:""),language:""}:{code:l,language:o}}},rp={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug
1:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"},rh=e=>{let{autoComplete:t,field:l,forceRender:n,languages:r=rp,path:o,permissions:i,readOnly:a,renderedBlocks:s,schemaPath:u,typescript:d,validate:c}=e,p=(0,w.useFormFields)(e=>{let[t]=e;return t.language}),h=(null==p?void 0:p.value)||(null==p?void 0:p.initialValue)||"typescript",f=(0,m.useId)(),v=r[h],x=(0,m.useMemo)(()=>({...l,type:"code",admin:{...l.admin,editorOptions:{},editorProps:{defaultPath:"ts"===h?"file-".concat(l.name,"-").concat(f,".tsx"):void 0},language:h}}),[l,h,f]),b="".concat(l.name,"-").concat(h,"-").concat(v);return x&&(0,g.jsx)(w.CodeField,{autoComplete:t,field:x,forceRender:n,onMount:(e,t)=>{var l,n;t.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),t.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),t.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:t.languages.typescript.JsxEmit.React,moduleResolution:t.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:null==d?void 0:d.paths,reactNamespace:"React",target:t.languages.typescript.ScriptTarget[null!=(l=null==d?void 0:d.target)?l:"ESNext"],typeRoots:null!=(n=null==d?void 0:d.typeRoots)?n:["node_modules/@types"]}),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!(null==d?void 0:d.enableSemanticValidation),noSyntaxValidation:!1}),(async()=>(null==d?void 0:d.fetchTypes)&&Array.isArray(d.fetchTypes)&&d.fetchTypes.length>0&&await Promise.all(d.fetchTypes.map(async e=>{let l=await (await fetch(e.url)).text();t.languages.typescript.typescriptDefaults.addExtraLib(l,e.filePath)})))()},path:o,permissions:i,readOnly:a,renderedBlocks:s,schemaPath:u,validate:c},b)},rf=()=>(0,g.jsx)("svg",{fill:"none",height:"12",viewBox:"0 0 15 12",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{d:"M11.3738 8.62598L14.0404 5.95931L11.3738 3.29264M3.37376 3.29264L0.707092 5.95931L3.37376 8.62598M9.04043 0.625977L5.70709 11.2926",stroke:"currentColor",strokeLinecap:"square"})}),rm=()=>(0,g.jsx)("svg",{fill:"none",height:"15",viewBox:"0 0 15 15",width:"15",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{d:"M7.16667 13.8333V9.83333M7.16667 9.83333L9.16667 11.8333M7.16667 9.83333L5.16667 11.8333M7.16667 4.5V0.5M7.16667 4.5L9.16667 2.5M7.16667 4.5L5.16667 2.5M1.83333 7.16667H0.5M5.83333 7.16667H4.5M9.83333 7.16667H8.5M13.8333 7.16667H12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),rg=()=>{let{toggle:e}=(0,w.useCollapsible)();return(0,g.jsx)("button",{className:"code-block-collapse-button",onClick:e,type:"button",children:(0,g.jsx)(rm,{})})},rv=()=>{let{isCollapsed:e,toggle:t}=(0,w.useCollapsible)(),{t:l}=(0,E.d)();return e?(0,g.jsxs)("button",{className:"code-block-floating-collapse-button",onClick:t,type:"button",children:[(0,g.jsx)("span",{children:l("general:collapse")}),(0,g.jsx)(rm,{})]}):null},rx="payload-richtext-code-block",rb=e=>{var t;let{languages:l}=e,n=l||rp,{BlockCollapsible:r,formSchema:o,RemoveButton:i}=ef(),{setModified:a}=(0,w.useForm)(),{t:s}=(0,E.d)(),{codeField:u}=(0,w.useFormFields)(e=>{let[t]=e;return{codeField:null==t?void 0:t.code}}),{selectedLanguageField:d,setSelectedLanguage:c}=(0,w.useFormFields)(e=>{let[t,l]=e;return{selectedLanguageField:null==t?void 0:t.language,setSelectedLanguage:e=>{l({type:"UPDATE",path:"language",value:e}),a(!0)}}}),p=n[null==d?void 0:d.value],h=(0,y.a)(),f=m.useMemo(()=>Object.entries(n).map(e=>{let[t,l]=e;return{name:"".concat(t," ").concat(l),Component:(0,g.jsx)(w.PopupList.Button,{active:!1,disabled:!1,onClick:()=>{c(t)},children:(0,g.jsx)("span",{className:"".concat(rx,"__language-code"),"data-language":t,children:l})})}}),[n,c]);return(0,g.jsx)(r,{Actions:(0,g.jsxs)("div",{className:"".concat(rx,"__actions"),children:[(0,g.jsx)(w.Combobox,{button:(0,g.jsxs)("div",{className:"".concat(rx,"__language-selector-button"),"data-selected-language":null==d?void 0:d.value,children:[(0,g.jsx)("span",{children:p}),(0,g.jsx)(w.ChevronIcon,{className:"".concat(rx,"__chevron")})]}),buttonType:"custom",className:"".concat(rx,"__language-selector"),disabled:!h,entries:f,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:s("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),(0,g.jsx)(w.CopyToClipboard,{value:null!=(t=null==u?void 0:u.value)?t:""}),(0,g.jsx)(rg,{}),h&&(0,g.jsx)(i,{})]}),className:rx,collapsibleProps:{AfterCollapsible:(0,g.jsx)(rv,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:(0,g.jsx)("div",{className:"".concat(rx,"__pill"),children:(0,g.jsx)(rf,{})}),children:(0,g.jsx)(w.RenderFields,{fields:o,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!h})})},rC=e=>{var t;
1let l=(0,c.c)(9),{field:n,initialValue:r,Loading:o,path:i,schemaPath:a,setValue:s,value:u}=e,[d,p]=m.useState(null),h=(0,w.useServerFunctions)(),{_internal_renderField:f}=h,[v,x]=a.split(".",2),b=null!=(t=null!=i?i:n&&"name"in n?null==n?void 0:n.name:"")?t:"",C;l[0]!==f||l[1]!==n||l[2]!==r||l[3]!==i||l[4]!==a?(C=()=>{!async function(){let{Field:e}=await f({field:{...n||{},type:"richText",admin:{...(null==n?void 0:n.admin)||{},hidden:!1}},initialValue:null!=r?r:void 0,path:i,schemaPath:a});p(e)}()},l[0]=f,l[1]=n,l[2]=r,l[3]=i,l[4]=a,l[5]=C):C=l[5];let k=C,y=(0,m.useRef)(!1),E,T;if(l[6]!==k?(E=()=>{y.current||(y.current=!0,k())},T=[k],l[6]=k,l[7]=E,l[8]=T):(E=l[7],T=l[8]),(0,m.useEffect)(E,T),!d)return"u">typeof o?o:(0,g.jsx)(S.f,{});let _={...h,getFormState:async e=>h.getFormState({...e,collectionSlug:"collection"===v?x:void 0,globalSlug:"global"===v?x:void 0})};return typeof u>"u"&&!s?(0,g.jsx)(w.ServerFunctionsContext,{value:{..._},children:(0,g.jsx)(w.FieldPathContext,{value:b,children:d},b)}):(0,g.jsx)(w.ServerFunctionsContext,{value:{..._},children:(0,g.jsx)(w.FieldPathContext,{value:b,children:(0,g.jsx)(w.FieldContext,{value:{disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:u,path:b,setValue:null!=s?s:rk,showError:!1,value:u},children:d})},b)})};function rk(){}function ry(e){let{nodes:t,text:l}=e,n={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return l&&n.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:l,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),(null==t?void 0:t.length)&&n.root.children.push(...t),n}var rw=ry}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.