@payloadcms/richtext-lexical 4.0.0-internal.293e026 → 4.0.0-internal.2fddfc0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/exports/client/{Field-VYBSMSRY.js → Field-VW7ZGT6K.js} +2 -2
  2. package/dist/exports/client/bundled.css +1 -1
  3. package/dist/exports/client/chunk-4EIYXZ6H.js +12 -0
  4. package/dist/exports/client/chunk-4EIYXZ6H.js.map +7 -0
  5. package/dist/exports/client/index.js +2 -2
  6. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  7. package/dist/field/bundled.css +1 -1
  8. package/dist/field/index.css +3 -0
  9. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  10. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js +160 -0
  11. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js.map +1 -0
  12. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +1 -1
  13. package/dist/packages/@lexical/markdown/MarkdownExport.js +9 -2
  14. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +1 -1
  15. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +1 -1
  16. package/dist/packages/@lexical/markdown/MarkdownImport.js +3 -2
  17. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +1 -1
  18. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +27 -1
  19. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +1 -1
  20. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +88 -4
  21. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +1 -1
  22. package/dist/types/index.d.ts.map +1 -1
  23. package/dist/types/index.js.map +1 -1
  24. package/dist/utilities/fieldsDrawer/index.css +4 -4
  25. package/package.json +6 -6
  26. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  27. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  28. /package/dist/exports/client/{Field-VYBSMSRY.js.map → Field-VW7ZGT6K.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- "use client";import{a as be,c as bt,d as kt,e as _t}from"./chunk-ESITTE3C.js";import{a as Qe}from"./chunk-DBWINSQN.js";import{a as Bo,b as et}from"./chunk-UD4DQ4AK.js";import{a as _r,b as Tr,c as Oe}from"./chunk-5VIL27GI.js";import{a as au}from"./chunk-WSAPGI3Z.js";import{b as Wt,c as zt,d as se,e as wr,f as jo,g as Ho,h as cu,i as uu,k as du,m as pu,p as mu}from"./chunk-LH634DPU.js";import{a as su,b as G}from"./chunk-RJ5MAOKZ.js";function X(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as Cu}from"react/compiler-runtime";import{useLexicalComposerContext as bu}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as ke}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as ku}from"@lexical/utils";import{$getSelection as _u,$isElementNode as pe,$isNodeSelection as Tu,$isRangeSelection as Tt,COMMAND_PRIORITY_LOW as wu,FORMAT_ELEMENT_COMMAND as wt}from"lexical";import{useEffect as Su}from"react";import{jsx as Sr}from"react/jsx-runtime";import"react";var fu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Er=({className:t})=>Sr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Sr("path",{clipRule:"evenodd",d:fu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Nr}from"react/jsx-runtime";import"react";var hu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Lr=({className:t})=>Nr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Nr("path",{clipRule:"evenodd",d:hu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as yr}from"react/jsx-runtime";import"react";var gu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Kt=({className:t})=>yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:yr("path",{clipRule:"evenodd",d:gu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as vr}from"react/jsx-runtime";import"react";var xu="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",Rr=({className:t})=>vr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vr("path",{clipRule:"evenodd",d:xu,fill:"currentColor",fillRule:"evenodd"})});var $=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:d,resolvedFeatures:u,schemaPath:c,unSanitizedEditorConfig:a})=>{let p=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:d,props:o,resolvedFeatures:u,schemaPath:c,unSanitizedEditorConfig:a});return p.sanitizedClientFeatureProps===null&&(p.sanitizedClientFeatureProps=o),p};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var Ir=t=>({type:"dropdown",ChildComponent:Kt,iconOnly:!0,items:t,key:"align",order:30});var Ie=t=>pe(t)?t.getFormatType():t.__format,Mr=[Ir([{ChildComponent:Kt,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="left")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"left")},order:1},{ChildComponent:Er,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="center")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"center")},order:2},{ChildComponent:Rr,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="right")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"right")},order:3},{ChildComponent:Lr,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="justify")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"justify")},order:4}])],Eu=()=>{let t=Cu(3),[e]=bu(),o,n;return t[0]!==e?(o=()=>e.registerCommand(wt,yu,wu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Su(o,n),null},Nu=$({plugins:[{Component:Eu,position:"normal"}],toolbarFixed:{groups:Mr},toolbarInline:{groups:Mr}});function Lu(t){return(pe(t)||ke(t))&&!t.isInline()}function yu(t){let e=_u();if(!Tt(e)&&!Tu(e))return!1;let o=e.getNodes();for(let n of o){let r=ku(n,Lu);r!==null&&r.setFormat(t)}return!0}import{$createQuoteNode as Br,$isQuoteNode as Fr,QuoteNode as $u}from"@lexical/rich-text";import{$setBlocksType as jr}from"@lexical/selection";import{$getSelection as Hr,$isRangeSelection as Au}from"lexical";import{jsx as $r}from"react/jsx-runtime";import"react";var vu="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",Uo=({className:t})=>$r("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:$r("path",{d:vu,fill:"currentColor"})});import{jsx as Ar}from"react/jsx-runtime";import"react";var Ru={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},St=({className:t,size:e=24})=>Ar("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ar("path",{clipRule:"evenodd",d:Ru[e],fill:"currentColor",fillRule:"evenodd"})});var te=t=>({type:"dropdown",ChildComponent:St,items:t,key:"text",order:25});import{$createQuoteNode as Iu,$isQuoteNode as Dr,QuoteNode as Mu}from"@lexical/rich-text";var Or={type:"element",dependencies:[Mu],export:(t,e)=>{if(!Dr(t))return null;let o=e(t).split(`
1
+ "use client";import{a as be,c as bt,d as kt,e as _t}from"./chunk-ESITTE3C.js";import{a as Qe}from"./chunk-DBWINSQN.js";import{a as Bo,b as et}from"./chunk-UD4DQ4AK.js";import{a as _r,b as Tr,c as Oe}from"./chunk-5VIL27GI.js";import{a as au}from"./chunk-WSAPGI3Z.js";import{b as Wt,c as zt,d as se,e as wr,f as jo,g as Ho,h as cu,i as uu,k as du,m as pu,p as mu}from"./chunk-4EIYXZ6H.js";import{a as su,b as G}from"./chunk-RJ5MAOKZ.js";function X(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as Cu}from"react/compiler-runtime";import{useLexicalComposerContext as bu}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as ke}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as ku}from"@lexical/utils";import{$getSelection as _u,$isElementNode as pe,$isNodeSelection as Tu,$isRangeSelection as Tt,COMMAND_PRIORITY_LOW as wu,FORMAT_ELEMENT_COMMAND as wt}from"lexical";import{useEffect as Su}from"react";import{jsx as Sr}from"react/jsx-runtime";import"react";var fu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Er=({className:t})=>Sr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Sr("path",{clipRule:"evenodd",d:fu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Nr}from"react/jsx-runtime";import"react";var hu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Lr=({className:t})=>Nr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Nr("path",{clipRule:"evenodd",d:hu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as yr}from"react/jsx-runtime";import"react";var gu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Kt=({className:t})=>yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:yr("path",{clipRule:"evenodd",d:gu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as vr}from"react/jsx-runtime";import"react";var xu="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",Rr=({className:t})=>vr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vr("path",{clipRule:"evenodd",d:xu,fill:"currentColor",fillRule:"evenodd"})});var $=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:d,resolvedFeatures:u,schemaPath:c,unSanitizedEditorConfig:a})=>{let p=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:d,props:o,resolvedFeatures:u,schemaPath:c,unSanitizedEditorConfig:a});return p.sanitizedClientFeatureProps===null&&(p.sanitizedClientFeatureProps=o),p};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var Ir=t=>({type:"dropdown",ChildComponent:Kt,iconOnly:!0,items:t,key:"align",order:30});var Ie=t=>pe(t)?t.getFormatType():t.__format,Mr=[Ir([{ChildComponent:Kt,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="left")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"left")},order:1},{ChildComponent:Er,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="center")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"center")},order:2},{ChildComponent:Rr,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="right")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"right")},order:3},{ChildComponent:Lr,isActive:({selection:t})=>{if(!Tt(t))return!1;for(let e of t.getNodes()){if((pe(e)||ke(e))&&Ie(e)==="justify")continue;let o=e.getParent();if(!((pe(o)||ke(o))&&Ie(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(wt,"justify")},order:4}])],Eu=()=>{let t=Cu(3),[e]=bu(),o,n;return t[0]!==e?(o=()=>e.registerCommand(wt,yu,wu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Su(o,n),null},Nu=$({plugins:[{Component:Eu,position:"normal"}],toolbarFixed:{groups:Mr},toolbarInline:{groups:Mr}});function Lu(t){return(pe(t)||ke(t))&&!t.isInline()}function yu(t){let e=_u();if(!Tt(e)&&!Tu(e))return!1;let o=e.getNodes();for(let n of o){let r=ku(n,Lu);r!==null&&r.setFormat(t)}return!0}import{$createQuoteNode as Br,$isQuoteNode as Fr,QuoteNode as $u}from"@lexical/rich-text";import{$setBlocksType as jr}from"@lexical/selection";import{$getSelection as Hr,$isRangeSelection as Au}from"lexical";import{jsx as $r}from"react/jsx-runtime";import"react";var vu="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",Uo=({className:t})=>$r("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:$r("path",{d:vu,fill:"currentColor"})});import{jsx as Ar}from"react/jsx-runtime";import"react";var Ru={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},St=({className:t,size:e=24})=>Ar("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ar("path",{clipRule:"evenodd",d:Ru[e],fill:"currentColor",fillRule:"evenodd"})});var te=t=>({type:"dropdown",ChildComponent:St,items:t,key:"text",order:25});import{$createQuoteNode as Iu,$isQuoteNode as Dr,QuoteNode as Mu}from"@lexical/rich-text";var Or={type:"element",dependencies:[Mu],export:(t,e)=>{if(!Dr(t))return null;let o=e(t).split(`
2
2
  `),n=[];for(let r of o)n.push("> "+r);return n.join(`
3
3
  `)},regExp:/^>\s/,replace:(t,e,o,n)=>{if(n){let l=t.getPreviousSibling();if(Dr(l)){l.splice(l.getChildrenSize(),0,[...e]),l.select(0,0),t.remove();return}}let r=Iu();r.append(...e),t.replace(r),r.select(0,0)}};var Pr=[te([{ChildComponent:Uo,isActive:({selection:t})=>{if(!Au(t))return!1;for(let e of t.getNodes())if(!Fr(e)&&!Fr(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Hr();jr(e,()=>Br())})},order:20}])],Du=$({markdownTransformers:[Or],nodes:[$u],slashMenu:{groups:[X([{Icon:Uo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Hr();jr(e,()=>Br())})}}])]},toolbarFixed:{groups:Pr},toolbarInline:{groups:Pr}});import{getTranslation as to}from"@payloadcms/translations";import{jsx as Ur}from"react/jsx-runtime";import"react";var Ou="M10.5 7C11.3284 7 12 7.67157 12 8.5V11.5C12 11.7329 11.9453 11.9527 11.8506 12.1494C12.0473 12.0547 12.2671 12 12.5 12H15.5C16.3284 12 17 12.6716 17 13.5V16.5C17 17.3284 16.3284 18 15.5 18H12.5C12.1151 18 11.7655 17.8535 11.5 17.6152C11.2345 17.8535 10.8849 18 10.5 18H7.5C6.67157 18 6 17.3284 6 16.5V13.5C6 13.1154 6.14578 12.7655 6.38379 12.5C6.14578 12.2345 6 11.8846 6 11.5V8.5C6 7.67157 6.67157 7 7.5 7H10.5ZM12.5 13C12.2239 13 12 13.2239 12 13.5V16.5C12 16.7761 12.2239 17 12.5 17H15.5C15.7761 17 16 16.7761 16 16.5V13.5C16 13.2239 15.7761 13 15.5 13H12.5ZM7.5 13C7.22386 13 7 13.2239 7 13.5V16.5C7 16.7761 7.22386 17 7.5 17H10.5C10.7761 17 11 16.7761 11 16.5V13.5C11 13.2239 10.7761 13 10.5 13H7.5ZM7.5 8C7.22386 8 7 8.22386 7 8.5V11.5C7 11.7761 7.22386 12 7.5 12H10.5C10.7761 12 11 11.7761 11 11.5V8.5C11 8.22386 10.7761 8 10.5 8H7.5ZM17.5 5C18.3284 5 19 5.67157 19 6.5V9.5C19 10.3284 18.3284 11 17.5 11H14.5C13.6716 11 13 10.3284 13 9.5V6.5C13 5.67157 13.6716 5 14.5 5H17.5ZM14.5 6C14.2239 6 14 6.22386 14 6.5V9.5C14 9.77614 14.2239 10 14.5 10H17.5C17.7761 10 18 9.77614 18 9.5V6.5C18 6.22386 17.7761 6 17.5 6H14.5Z",Go=({className:t})=>Ur("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ur("path",{d:Ou,fill:"currentColor"})});import{jsx as Gr}from"react/jsx-runtime";import"react";var Fu="M17 8C18.1046 8 19 8.89543 19 10V14L18.9893 14.2041C18.8938 15.1457 18.1457 15.8938 17.2041 15.9893L17 16H7L6.7959 15.9893C5.78722 15.887 5 15.0357 5 14V10C5 8.89543 5.89543 8 7 8H17ZM7 9C6.44772 9 6 9.44772 6 10V14C6 14.5523 6.44772 15 7 15H17C17.5523 15 18 14.5523 18 14V10C18 9.44772 17.5523 9 17 9H7ZM9 11C9.55228 11 10 11.4477 10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11ZM12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11ZM15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11Z",Vo=({className:t})=>Gr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gr("path",{clipRule:"evenodd",d:Fu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Pu}from"react/jsx-runtime";import"react";function Vr(t,e){let{admin:o,imageAltText:n,imageURL:r}=t,l=o?.images,s,i;if(l?.icon?(s=typeof l.icon=="string"?l.icon:l.icon.url,i=typeof l.icon=="string"?void 0:l.icon.alt):l?.thumbnail?(s=typeof l.thumbnail=="string"?l.thumbnail:l.thumbnail.url,i=typeof l.thumbnail=="string"?void 0:l.thumbnail.alt):(s=r,i=n),!s)return e;let d=i??"Block Image";return()=>Pu("img",{alt:d,className:"lexical-block-custom-image",src:s,style:{maxHeight:20,maxWidth:20}})}import{$parseSerializedNode as el}from"lexical";import{JSOX as Wo}from"jsox";function Jt({propsString:t}){let e={},o="",n=!0;for(let r=0;r<t.length;r++){let l=t[r];if(n)l==="="||l===" "?o&&(l===" "?(e[o]=!0,o=""):n=!1):o+=l;else{let s=Bu(t,r);e[o]=s.value,r=s.newIndex,o="",n=!0}}return o&&(e[o]=!0),e}function Bu(t,e){let o=t[e];return o==='"'?Wr(t,e):o==="'"?Wr(t,e,!0):o==="{"?Hu(t,e):o==="["?ju(t,e):Gu(t,e)}function ju(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="["?o++:t[r]==="]"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Wo.parse(`[${n}]`)}}function Wr(t,e,o=!1){let n="",r=e+1;for(;r<t.length&&(t[r]!==(o?"'":'"')||t[r-1]==="\\");)n+=t[r],r++;return{newIndex:r,value:n}}function Hu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="{"?o++:t[r]==="}"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Uu(n)}}function Uu(t){return t[0]!=="{"?Wo.parse(t):Wo.parse(t.replace(/(\w+):/g,'"$1":'))}function Gu(t,e){let o="",n=e;for(;n<t.length&&t[n]!==" ";)o+=t[n],n++;return{newIndex:n-1,value:o}}function Et({props:t}){let e=[];for(let[o,n]of Object.entries(t))typeof n=="string"?e.push(`${o}="${Vu(n)}"`):typeof n=="number"?e.push(`${o}={${n}}`):typeof n=="boolean"?n&&e.push(`${o}`):n!==null&&typeof n=="object"&&(Array.isArray(n)?e.push(`${o}={[${n.map(r=>JSON.stringify(r,zr)).join(", ")}]}`):e.push(`${o}={${JSON.stringify(n,zr)}}`));return e.join(" ")}function Vu(t){return t.replace(/"/g,"&quot;")}function zr(t,e){return typeof e=="string"?e.replace(/'/g,"\\'"):e}function Xt({isEndOptional:t,lines:e,regexpEndRegex:o,startLineIndex:n,startMatch:r,trimChildren:l}){let s="",i="",d=e.slice(n),u=!1,c=0,a=0,p=null,m=!1,h=0,f=d[0].slice(0,r.index),g=0,_=n;e:for(let[R,b]of d.entries()){let x=l?b.trim():b,C=0;if(l)for(let T=0;T<b.length&&b[T]===" ";T++)C++;let k=0;for(R===0&&(k=(r.index??0)+r[0].length-C);k<x.length;){let T=x[k],I=x[k+1];if(u){if(T==="`"&&h++,h%2===0)if(T==="<"&&I==="/"){if(c--,c<0){i[i.length-1]===`
4
4
  `&&(i=i.slice(0,-1)),_=R;for(let L=k;L<x.length;L++)if(x[L]===">"){g=L+1;break}break e}}else if(T==="/"&&I===">"){if(c--,c<0){i[i.length-1]===`
@@ -57,7 +57,7 @@ ${e.map(lp).join(`
57
57
 
58
58
  `,Us="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Gs="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",f0=new RegExp("^[^"+Gs+"]*["+Us+"]"),h0=new RegExp("^[^"+Us+"]*["+Gs+"]"),g0={bold:O.IS_BOLD,code:O.IS_CODE,highlight:O.IS_HIGHLIGHT,italic:O.IS_ITALIC,strikethrough:O.IS_STRIKETHROUGH,subscript:O.IS_SUBSCRIPT,superscript:O.IS_SUPERSCRIPT,underline:O.IS_UNDERLINE},x0={directionless:O.IS_DIRECTIONLESS,unmergeable:O.IS_UNMERGEABLE},C0={center:O.IS_ALIGN_CENTER,end:O.IS_ALIGN_END,justify:O.IS_ALIGN_JUSTIFY,left:O.IS_ALIGN_LEFT,right:O.IS_ALIGN_RIGHT,start:O.IS_ALIGN_START},b0={[O.IS_ALIGN_CENTER]:"center",[O.IS_ALIGN_END]:"end",[O.IS_ALIGN_JUSTIFY]:"justify",[O.IS_ALIGN_LEFT]:"left",[O.IS_ALIGN_RIGHT]:"right",[O.IS_ALIGN_START]:"start"},k0={normal:O.IS_NORMAL,segmented:O.IS_SEGMENTED,token:O.IS_TOKEN},_0={[O.IS_NORMAL]:"normal",[O.IS_SEGMENTED]:"segmented",[O.IS_TOKEN]:"token"};var Vs={text:({node:t})=>{let e=t.text;return t.format&O.IS_BOLD&&(e=ze("strong",{children:e})),t.format&O.IS_ITALIC&&(e=ze("em",{children:e})),t.format&O.IS_STRIKETHROUGH&&(e=ze("span",{style:{textDecoration:"line-through"},children:e})),t.format&O.IS_UNDERLINE&&(e=ze("span",{style:{textDecoration:"underline"},children:e})),t.format&O.IS_CODE&&(e=ze("code",{children:e})),t.format&O.IS_SUBSCRIPT&&(e=ze("sub",{children:e})),t.format&O.IS_SUPERSCRIPT&&(e=ze("sup",{children:e})),e}};import{jsx as $t}from"react/jsx-runtime";var Ws={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,n=e.fields?.alt||o?.alt||"",r=o.url;if(!o.mimeType.startsWith("image"))return $t("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.sizes||!Object.keys(o.sizes).length)return $t("img",{alt:n,height:o.height,src:r,width:o.width});let l=[];for(let s in o.sizes){let i=o.sizes[s];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let d=i?.url;l.push($t("source",{media:`(max-width: ${i.width}px)`,srcSet:d,type:i.mimeType},s))}return l.push($t("img",{alt:n,height:o?.height,src:r,width:o?.width},"image")),$t("picture",{children:l})}};var ct={...Bs,...Vs,...Ds,...Ms,...Hs,...$s,...As,...Ps,...Fs({}),...Ws,...js};import{jsx as mo,Fragment as T0}from"react/jsx-runtime";import po from"react";function zs(t){if(!!!t?.root?.children?.length)return!1;let o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let n=t?.root?.children[0];if(!n?.children||n?.children?.length===0)o=!0;else if(n?.children?.length===1){let r=n?.children[0];r?.type==="text"&&(r?.text?.length||(o=!0))}}return!o}function w0(t){return e=>{let o={...e,isEditor:!1,isJSXConverter:!0};if(t.Component)return t.Component(o);if(t.html){let n=typeof t.html=="function"?t.html(o):t.html;return mo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function Ks(t){return e=>{if(t.Component){let o={...e,isEditor:!1,isJSXConverter:!0};return t.Component(o)}if(t.Block){let o=e.node,n={childIndex:e.childIndex,converters:e.converters,formData:o.fields??{},isEditor:!1,isJSXConverter:!0,node:o,nodesToJSX:e.nodesToJSX,parent:e.parent};return po.createElement(t.Block,n)}if(t.html){let o={...e,isEditor:!1,isJSXConverter:!0},n=typeof t.html=="function"?t.html(o):t.html;return mo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function S0(t){let e={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object")continue;if(o==="blocks"){e.blocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.blocks[l]=Ks(i))}continue}if(o==="inlineBlocks"){e.inlineBlocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.inlineBlocks[l]=Ks(i))}continue}let r=n;(r.Component||r.html)&&(e[o]=w0(r))}return e}function Js({converters:t,data:e,disableIndent:o,disableTextAlign:n,nodeMap:r}){if(zs(e)){let l=r?S0(r):void 0,s=l?{...t,...l,blocks:{...t.blocks,...l.blocks},inlineBlocks:{...t.inlineBlocks,...l.inlineBlocks}}:t;return Xs({converters:s,disableIndent:o,disableTextAlign:n,nodes:e.root.children,parent:e.root})}return mo(T0,{})}function Xs({converters:t,disableIndent:e,disableTextAlign:o,nodes:n,parent:r}){let l=t.unknown;return n.map((i,d)=>{let u;i.type==="block"?(u=t?.blocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${i?.fields?.blockType} block, but no converter is provided`)):i.type==="inlineBlock"?(u=t?.inlineBlocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${i?.fields?.blockType} inline block, but no converter is provided`)):u=t[i.type];try{!u&&l&&(u=l);let c;u?c=typeof u=="function"?u({childIndex:d,converters:t,node:i,nodesToJSX:m=>Xs({converters:m.converters??t,disableIndent:m.disableIndent??e,disableTextAlign:m.disableTextAlign??o,nodes:m.nodes,parent:m.parent??{...i,parent:r}}),parent:r}):u:c=mo("span",{children:"unknown node"},d);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(i.type))&&"format"in i&&i.format)switch(i.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(i.type))&&"indent"in i&&i.indent&&i.type!=="listitem"&&(a.paddingInlineStart=`${Number(i.indent)*40}px`),po.isValidElement(c)){if(a.textAlign||a.paddingInlineStart){let p={...a,...c?.props?.style??{}};return po.cloneElement(c,{key:d,style:p})}return po.cloneElement(c,{key:d})}return c}catch(c){return console.error("Error converting lexical node to JSX:",c,"node:",i),null}}).filter(Boolean)}function yn({className:t,converters:e,data:o,disableContainer:n,disableIndent:r,disableTextAlign:l,nodeMap:s}){if(!o)return null;let i=e,d={};i?typeof i=="function"?d=i({defaultConverters:ct}):d=i:d=ct;let u=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Js({converters:d,data:o,disableIndent:r,disableTextAlign:l,nodeMap:s});return n?Zs(E0,{children:u}):Zs("div",{className:t??"payload-richtext",children:u})}function qs(){let t=N0(7),[e]=L0(),o;t[0]!==e?(o=()=>e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[n,r]=v0(o),l,s;t[2]!==e?(l=()=>e.registerUpdateListener(d=>{let{editorState:u}=d;r(u.toJSON())}),s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),y0(l,s);let i;return t[5]!==n?(i=Ys("div",{className:"debug-jsx-converter",children:Ys(yn,{converters:ct,data:n})}),t[5]=n,t[6]=i):i=t[6],i}var R0=$({plugins:[{Component:qs,position:"bottom"}]});var H={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",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)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},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)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},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)"},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)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",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)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},I0={text:{"text-red":{css:{color:`light-dark(${H.red[600]}, ${H.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${H.orange[600]}, ${H.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${H.yellow[700]}, ${H.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${H.green[700]}, ${H.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${H.blue[600]}, ${H.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${H.purple[600]}, ${H.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${H.pink[600]}, ${H.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${H.red[400]}, ${H.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${H.orange[400]}, ${H.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${H.yellow[300]}, ${H.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${H.green[400]}, ${H.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${H.blue[400]}, ${H.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${H.purple[400]}, ${H.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${H.pink[400]}, ${H.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as bh}from"lexical";import{jsx as Qs}from"react/jsx-runtime";import"react";var M0="M9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7H7.5C7.22386 7 7 7.22386 7 7.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V14.5C17 14.2239 17.2239 14 17.5 14C17.7761 14 18 14.2239 18 14.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V7.5C6 6.67157 6.67157 6 7.5 6H9.5ZM17.5 6C17.7761 6 18 6.22386 18 6.5V11.5C18 11.7761 17.7761 12 17.5 12C17.2239 12 17 11.7761 17 11.5V7.70703L12.8535 11.8535C12.6583 12.0488 12.3417 12.0488 12.1465 11.8535C11.9512 11.6583 11.9512 11.3417 12.1465 11.1465L16.293 7H12.5C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6H17.5Z",vn=({className:t})=>Qs("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Qs("path",{d:M0,fill:"currentColor"})});import{jsx as F0}from"react/jsx-runtime";import{$applyNodeReplacement as P0}from"lexical";import*as ta from"react";import{DecoratorBlockNode as $0}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as A0}from"@lexical/utils";import{$applyNodeReplacement as D0}from"lexical";function O0(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:ea({relationTo:o,value:e})}:null}var At=class extends $0{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}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")?null:{conversion:O0,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},n=ea(o);return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return A0(o,e?.theme?.relationship),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship",version:2}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function ea(t){return D0(new At({data:t}))}var B0=ta.lazy(()=>import("./RelationshipComponent-YCPAKOL7.js").then(t=>({default:t.RelationshipComponent})));function j0(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Ke({relationTo:o,value:e})}:null}var Ne=class extends At{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")?null:{conversion:j0,priority:2}}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id);let o={relationTo:e.relationTo,value:e.value},n=Ke(o);return n.setFormat(e.format),n}decorate(e,o){return F0(B0,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ke(t){return P0(new Ne({data:t}))}function Rn(t){return t instanceof Ne}import{c as sh}from"react/compiler-runtime";import{jsx as ah}from"react/jsx-runtime";import{useLexicalComposerContext as ch}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as uh}from"@lexical/utils";import{$getPreviousSelection as dh,$getSelection as ph,$isParagraphNode as mh,$isRangeSelection as fh,COMMAND_PRIORITY_EDITOR as hh,createCommand as gh}from"lexical";import{useEffect as xh}from"react";import{c as ra}from"react/compiler-runtime";import{jsx as In}from"react/jsx-runtime";import{useLexicalComposerContext as la}from"@lexical/react/LexicalComposerContext.js";import{toast as q0}from"@payloadcms/ui";import{$getNodeByKey as Q0,COMMAND_PRIORITY_EDITOR as ia}from"lexical";import{useEffect as sa,useState as eh}from"react";import{c as H0}from"react/compiler-runtime";import{jsx as U0}from"react/jsx-runtime";import{useLexicalComposerContext as G0}from"@lexical/react/LexicalComposerContext";import{useListDrawer as V0,useModal as W0}from"@payloadcms/ui";import{$getNodeByKey as oa,$getPreviousSelection as z0,$getRoot as K0,$getSelection as J0,$isRangeSelection as X0,$setSelection as Z0}from"lexical";import{useEffect as Y0,useState as na}from"react";var Dt=t=>{let e=H0(23),[o]=G0(),[n,r]=na(null),[l,s]=na(!1),[i,d,u]=V0(t),{closeDrawer:c,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=u,{modalState:h}=W0(),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let L=J0()??z0();r(L)},e[0]=f):f=e[0];let g=f,_;e[1]!==o||e[2]!==n?(_=()=>{n&&o.update(()=>{if(X0(n)){let{anchor:L,focus:E}=n;oa(L.key)&&oa(E.key)&&Z0(n.clone())}else K0().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=n,e[3]=_):_=e[3];let S=_,R;e[4]!==c?(R=()=>{c()},e[4]=c,e[5]=R):R=e[5];let b=R,x,C;e[6]!==a||e[7]!==h||e[8]!==S||e[9]!==l?(x=()=>{if(!l)return;let L=h[a];L&&!L?.isOpen&&(s(!1),setTimeout(()=>{S()},1))},C=[h,a,S,l],e[6]=a,e[7]=h,e[8]=S,e[9]=l,e[10]=x,e[11]=C):(x=e[10],C=e[11]),Y0(x,C);let k;e[12]!==d?(k=L=>U0(d,{...L,onClick:()=>{g()}}),e[12]=d,e[13]=k):k=e[13];let T;e[14]!==m?(T=()=>{g(),m(),s(!0)},e[14]=m,e[15]=T):T=e[15];let I;return e[16]!==i||e[17]!==b||e[18]!==p||e[19]!==a||e[20]!==k||e[21]!==T?(I={closeListDrawer:b,isListDrawerOpen:p,ListDrawer:i,listDrawerSlug:a,ListDrawerToggler:k,openListDrawer:T},e[16]=i,e[17]=b,e[18]=p,e[19]=a,e[20]=k,e[21]=T,e[22]=I):I=e[22],I};var th=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=Q0(o);r&&r.replace(Ke({relationTo:e,value:n}))}):t.dispatchCommand(Mn,{relationTo:e,value:n})},oh=t=>{let e=ra(14),{enabledCollectionSlugs:o}=t,[n]=la(),[r,l]=eh(null),s=o?.[0],i;e[0]!==o||e[1]!==s?(i={collectionSlugs:o,selectedCollection:s},e[0]=o,e[1]=s,e[2]=i):i=e[2];let{closeListDrawer:d,ListDrawer:u,openListDrawer:c}=Dt(i),a,p;e[3]!==n||e[4]!==c?(a=()=>n.registerCommand(Qe,g=>(l(g?.replace?g?.replace.nodeKey:null),c(),!0),ia),p=[n,c],e[3]=n,e[4]=c,e[5]=a,e[6]=p):(a=e[5],p=e[6]),sa(a,p);let m;e[7]!==d||e[8]!==n||e[9]!==r?(m=g=>{let{collectionSlug:_,doc:S}=g;th({editor:n,relationTo:_,replaceNodeKey:r,value:S.id}),d()},e[7]=d,e[8]=n,e[9]=r,e[10]=m):m=e[10];let h=m,f;return e[11]!==u||e[12]!==h?(f=In(u,{onSelect:h}),e[11]=u,e[12]=h,e[13]=f):f=e[13],f},nh=()=>{let t=ra(3),[e]=la(),o,n;return t[0]!==e?(o=()=>e.registerCommand(Qe,rh,ia),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),sa(o,n),null},aa=({enabledCollectionSlugs:t})=>t?.length?In(oh,{enabledCollectionSlugs:t}):In(nh,{});function rh(){return q0.error("No relationship collections enabled"),!0}import{useConfig as lh,useEntityVisibility as ih}from"@payloadcms/ui";import*as ua from"react";var ca=(t,{disabledCollections:e,enabledCollections:o,uploads:n,visibleSlugs:r})=>{let l=o?.length?new Set(o):null,s=e?.length?new Set(e):null;return t.filter(i=>{let{slug:d,admin:u,upload:c}=i;if(r&&!r.includes(d))return!1;if(n){if(!u?.enableRichTextRelationship||!c)return!1}else if(c||!u?.enableRichTextRelationship)return!1;return!(l&&!l.has(d)||s&&s.has(d))})};var fo=t=>{let{collectionSlugsBlacklist:e,collectionSlugsWhitelist:o,uploads:n=!1}=t||{},{config:{collections:r}}=lh(),{visibleEntities:l}=ih();return ua.useMemo(()=>{let s=ca(r,{disabledCollections:e,enabledCollections:o,uploads:n,visibleSlugs:l?.collections});return{enabledCollections:s,enabledCollectionSlugs:s.map(i=>i.slug)}},[r,l,n,o,e])};var Mn=gh("INSERT_RELATIONSHIP_COMMAND"),da=t=>{let e=sh(8),{clientProps:o}=t,[n]=ch(),r=o?.disabledCollections,l=o?.enabledCollections,s;e[0]!==r||e[1]!==l?(s={collectionSlugsBlacklist:r,collectionSlugsWhitelist:l},e[0]=r,e[1]=l,e[2]=s):s=e[2];let{enabledCollectionSlugs:i}=fo(s),d,u;e[3]!==n?(d=()=>{if(!n.hasNodes([Ne]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return n.registerCommand(Mn,Ch,hh)},u=[n],e[3]=n,e[4]=d,e[5]=u):(d=e[4],u=e[5]),xh(d,u);let c;return e[6]!==i?(c=ah(aa,{enabledCollectionSlugs:i}),e[6]=i,e[7]=c):c=e[7],c};function Ch(t){let e=ph()||dh();if(fh(e)){let o=Ke(t),{focus:n}=e,r=n.getNode();uh(o),mh(r)&&!r.__first&&r.remove()}return!0}var kh=$({nodes:[Ne],plugins:[{Component:da,position:"normal"}],slashMenu:{groups:[X([{Icon:vn,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(Qe,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:vn,isActive:({selection:t})=>{if(!bh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Rn(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(Qe,{replace:!1})}}])]}});import{c as Jh}from"react/compiler-runtime";import{jsx as fe,jsxs as Xh}from"react/jsx-runtime";import{useLexicalComposerContext as Zh}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as _a}from"@lexical/react/useLexicalEditable";import{useScrollInfo as Yh,useThrottledEffect as qh,useTranslation as Qh}from"@payloadcms/ui";import*as Co from"react";import{useMemo as Fn}from"react";import{jsx as _h,jsxs as Th}from"react/jsx-runtime";import{Tooltip as wh,useTranslation as Sh}from"@payloadcms/ui";import{$addUpdateTag as Eh}from"lexical";import{useCallback as pa,useEffect as Nh,useMemo as ma,useRef as Lh,useState as yh}from"react";var $n="toolbar-popup__button",Ot=({active:t=!1,children:e,editor:o,enabled:n=!0,item:r})=>{let{i18n:l}=Sh(),{fieldProps:{featureClientSchemaMap:s,schemaPath:i}}=G(),[d,u]=yh(!1),c=Lh(null);Nh(()=>{c.current?.removeAttribute("data-pressing")},[t]);let a=ma(()=>r.label?typeof r.label=="function"?r.label({featureClientSchemaMap:s,i18n:l,schemaPath:i}):r.label:r.key.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,f=>f.toUpperCase()),[s,l,i,r]),p=ma(()=>[$n,n?"":"disabled",t?"active":"",r.key?`${$n}-${r.key}`:""].filter(Boolean).join(" "),[t,n,r.key]),m=pa(()=>{n&&o.focus(()=>{o.update(()=>{Eh("toolbar")}),r.onSelect?.({editor:o,isActive:t})})},[o,r,t,n]),h=pa(f=>{f.preventDefault(),f.currentTarget.setAttribute("data-pressing","")},[]);return Th("button",{"aria-label":a,className:p,"data-button-key":r.key,disabled:!n,onClick:m,onMouseDown:h,onPointerEnter:()=>u(!0),onPointerLeave:()=>{u(!1),c.current?.removeAttribute("data-pressing")},ref:c,type:"button",children:[_h(wh,{className:`${$n}__tooltip`,show:d,children:a}),e]})};import{c as Dh}from"react/compiler-runtime";import{jsx as ut}from"react/jsx-runtime";import Oh,{useMemo as Fh}from"react";import{useTranslation as Ph}from"@payloadcms/ui";import{jsx as $e,jsxs as fa}from"react/jsx-runtime";import{Button as vh}from"@payloadcms/ui";import{$addUpdateTag as Rh,isDOMNode as Ih}from"lexical";import ho,{useCallback as Mh,useEffect as go,useMemo as ga,useRef as An,useState as Dn}from"react";import{createPortal as $h}from"react-dom";var ha="toolbar-popup__dropdown-item",xa=ho.createContext(null);function Ca({active:t,children:e,editor:o,enabled:n,Icon:r,item:l,itemKey:s,tooltip:i}){let d=ga(()=>[ha,n===!1?"disabled":"",t?"active":"",l?.key?`${ha}-${l.key}`:""].filter(Boolean).join(" "),[n,t,l.key]),u=An(null),c=ho.use(xa);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=c;return go(()=>{u?.current!=null&&a(u)},[u,a]),$e(vh,{"aria-label":i,buttonStyle:"ghost",className:d,disabled:n===!1,extraButtonProps:{"data-item-key":s},icon:r,iconPosition:"left",onClick:()=>{n!==!1&&o.focus(()=>{o.update(()=>{Rh("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:u,tooltip:i,type:"button",children:e})}function Ah({children:t,dropdownKey:e,dropDownRef:o,itemsContainerClassNames:n,onClose:r}){let[l,s]=Dn(),[i,d]=Dn(),u=Mh(p=>{s(m=>m!=null?[...m,p]:[p])},[s]),c=p=>{if(l==null)return;let{key:m}=p;["ArrowDown","ArrowUp","Escape","Tab"].includes(m)&&p.preventDefault(),m==="Escape"||m==="Tab"?r():m==="ArrowUp"?d(h=>{if(h==null)return l[0];let f=l.indexOf(h)-1;return l[f===-1?l.length-1:f]}):m==="ArrowDown"&&d(h=>h==null?l[0]:l[l.indexOf(h)+1])},a=ga(()=>({registerItem:u}),[u]);return go(()=>{l!=null&&i==null&&d(l[0]),i!=null&&i?.current!=null&&i.current.focus()},[l,i]),$e(xa,{value:a,children:$e("div",{className:(n??["toolbar-popup__dropdown-items"]).join(" "),"data-dropdown-key":e,"data-theme":"dark",onKeyDown:c,ref:o,children:t})})}function ba({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:n=!1,dropdownKey:r,Icon:l,itemsContainerClassNames:s,label:i,stopCloseOnClickSelf:d}){let u=An(null),c=An(null),[a,p]=Dn(!1),m=()=>{p(!1),c?.current!=null&&c.current.focus()};go(()=>{let f=c.current,g=u.current;if(a&&f!==null&&g!==null){let{left:_,top:S}=f.getBoundingClientRect(),R=window.scrollY||document.documentElement.scrollTop;g.style.top=`${S+R+f.offsetHeight+5}px`,g.style.left=`${Math.min(_-5,window.innerWidth-g.offsetWidth-20)}px`}},[u,c,a]),go(()=>{let f=c.current;if(f!==null&&a){let g=_=>{let S=_.target;Ih(S)&&(d&&u.current&&u.current.contains(S)||f.contains(S)||p(!1))};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}}},[u,c,a,d]);let h=$h($e(Ah,{dropdownKey:r,dropDownRef:u,itemsContainerClassNames:s,onClose:m,children:o}),document.body);return fa(ho.Fragment,{children:[fa("button",{"aria-label":t,className:e+(a?" active":""),"data-dropdown-key":r,disabled:n,onClick:f=>{f.preventDefault(),p(!a)},onMouseDown:f=>{f.preventDefault()},ref:c,type:"button",children:[l&&$e(l,{}),i&&$e("span",{className:"toolbar-popup__dropdown-label",children:i}),$e("i",{className:"toolbar-popup__dropdown-caret"})]}),a&&$e(ho.Fragment,{children:h})]})}var On="toolbar-popup__dropdown",Bh=t=>{let e=Dh(15),{active:o,anchorElem:n,editor:r,enabled:l,iconOnly:s,item:i}=t,{i18n:d}=Ph(),{fieldProps:u}=G(),{featureClientSchemaMap:c,schemaPath:a}=u;if(i.Component){let m;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i?(m=i?.Component&&ut(i.Component,{active:o,anchorElem:n,editor:r,enabled:l,item:i},i.key),e[0]=o,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=m):m=e[5],m}let p;if(e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==d||e[11]!==s||e[12]!==i||e[13]!==a){let m=i.key,h;i.label&&(m=typeof i.label=="function"?i.label({featureClientSchemaMap:c,i18n:d,schemaPath:a}):i.label),m.length>25?h=m.substring(0,25)+"...":h=m,p=ut(Ca,{active:o,editor:r,enabled:l,Icon:i?.ChildComponent?ut(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:s?m:void 0,children:ut("span",{className:"text",children:h})},i.key),e[6]=o,e[7]=r,e[8]=l,e[9]=c,e[10]=d,e[11]=s,e[12]=i,e[13]=a,e[14]=p}else p=e[14];return p},jh=Oh.memo(Bh),Ft=({anchorElem:t,classNames:e,editor:o,group:n,groupState:r,Icon:l,itemsContainerClassNames:s,label:i})=>{let{items:d,key:u}=n,c=Fh(()=>d?.length?d.map(a=>ut(jh,{active:r.activeItemKeys.includes(a.key),anchorElem:t,editor:o,enabled:r.enabledItemKeys.includes(a.key),iconOnly:n.iconOnly,item:a},a.key)):null,[d,r.activeItemKeys,r.enabledItemKeys,t,o]);return ut(ba,{buttonAriaLabel:`${u} dropdown`,buttonClassName:[On,`${On}-${u}`,...e||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:u,Icon:l,itemsContainerClassNames:[`${On}-items`,...s||[]],label:i,children:c},u)};import{mergeRegister as Hh}from"@lexical/utils";import{$getSelection as Uh}from"lexical";import{useCallback as Gh,useDeferredValue as Vh,useEffect as Wh,useRef as ka,useState as zh}from"react";function Kh(t){let e=new Map,o=new Map;if(!t?.length)return{groupStates:o,itemStates:e};for(let n of t){let r=[];for(let l of n.items)e.set(l.key,{active:!1,enabled:!0}),r.push(l.key);o.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:r})}return{groupStates:o,itemStates:e}}function xo(t,e){let[o,n]=zh(()=>Kh(e)),r=Vh(o),l=G(),s=ka(l);s.current=l;let i=ka(e);i.current=e;let d=wr(),u=Gh(()=>{t.getEditorState().read(()=>{let c=Uh();if(!c)return;let a=i.current;if(!a?.length)return;let p=s.current,m=new Map,h=new Map;for(let f of a){let g=[],_=[],S=[],R=f.type==="dropdown"?f.maxActiveItems??1:void 0;for(let x of f.items){let C=x.isActive?(!R||g.length<R)&&x.isActive({editor:t,editorConfigContext:p,selection:c}):!1,k=x.isEnabled?x.isEnabled({editor:t,editorConfigContext:p,selection:c}):!0;C&&(g.push(x.key),_.push(x)),k&&S.push(x.key),m.set(x.key,{active:C,enabled:k})}let b=f.type==="dropdown"&&f.isEnabled?f.isEnabled({editor:t,editorConfigContext:p,selection:c}):!0;h.set(f.key,{activeItemKeys:g,activeItems:_,enabledGroup:b,enabledItemKeys:S})}n({groupStates:h,itemStates:m})})},[t]);return Wh(()=>{d(u);let c=()=>d(u),a=Hh(t.registerUpdateListener(c));return document.addEventListener("mouseup",c),()=>{a(),document.removeEventListener("mouseup",c)}},[t,d,u]),r}function e5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&fe(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?fe(Ot,{active:t,editor:o,enabled:n,item:r,children:fe(r.ChildComponent,{})},r.key):null}function t5({anchorElem:t,editor:e,editorConfig:o,group:n,index:r,toolbarStates:l}){let{i18n:s}=Qh(),{fieldProps:{featureClientSchemaMap:i,schemaPath:d}}=G(),u=l.groupStates.get(n.key),c=Fn(()=>{if(n.type!=="dropdown")return;let p=u?.activeItems?.[0];return p?p.ChildComponent:n.ChildComponent},[n,u?.activeItems]),a=Fn(()=>{if(n.type!=="dropdown")return;let p=u?.activeItems;if(!p?.length)return;if(p.length>1)return s.t("lexical:general:toolbarItemsActive",{count:p.length});let m=p[0],h=m.key;return m.label&&(h=typeof m.label=="function"?m.label({featureClientSchemaMap:i,i18n:s,schemaPath:d}):m.label),h.length>25&&(h=h.substring(0,25)+"..."),h},[n,u?.activeItems,s,i,d]);return Xh("div",{className:`fixed-toolbar__group fixed-toolbar__group-${n.key}`,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length&&u?fe(Ft,{anchorElem:t,editor:e,group:n,groupState:u,Icon:c,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a}):null,n.type==="buttons"&&n.items.length?n.items.map(p=>{let m=l.itemStates.get(p.key);return fe(e5,{active:m?.active??!1,anchorElem:t,editor:e,enabled:m?.enabled??!0,item:p},p.key)}):null,r<o.features.toolbarFixed?.groups.length-1&&fe("div",{className:"divider"})]},n.key)}function o5({anchorElem:t,clientProps:e,editor:o,editorConfig:n,parentWithFixedToolbar:r}){let l=Co.useRef(null),s=_a(),{y:i}=Yh(),d=xo(o,n?.features?.toolbarFixed?.groups),u=Fn(()=>{if(!r||e?.disableIfParentHasFixedToolbar)return null;let a=r.editorContainerRef.current.previousElementSibling;for(;a;){if(a.classList.contains("fixed-toolbar"))return a;a=a.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,r]);return qh(()=>{if(!u)return;let c=l.current;if(!c)return;let a=c.getBoundingClientRect(),p=u.getBoundingClientRect();if(!(a.bottom<p.top||a.top>p.bottom))c.classList.remove("fixed-toolbar"),c.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),u.classList.remove("fixed-toolbar"),u.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!c.classList.contains("fixed-toolbar--overlapping"))return;c.classList.remove("fixed-toolbar--overlapping"),c.classList.add("fixed-toolbar"),u.classList.remove("fixed-toolbar--hide"),u.classList.add("fixed-toolbar")}},50,[l,u,i]),fe("div",{className:"fixed-toolbar",onFocus:c=>{c.stopPropagation()},ref:l,children:s&&fe(Co.Fragment,{children:n?.features&&n.features?.toolbarFixed?.groups.map((c,a)=>fe(t5,{anchorElem:t,editor:o,editorConfig:n,group:c,index:a,toolbarStates:d},c.key))})})}var Ta=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return Ta(t.parentEditor)}return!1},wa=t=>{let e=Jh(6),{clientProps:o}=t,[n]=Zh(),r=G();if(!_a())return null;let{editorConfig:s}=r,i=o.applyToFocusedEditor&&r.focusedEditor?.editor||n,d=o.applyToFocusedEditor&&r.focusedEditor?.editorConfig||s,u,c;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==r){c=Symbol.for("react.early_return_sentinel");e:{let a=Ta(r);if(o?.disableIfParentHasFixedToolbar&&a){c=null;break e}if(!d?.features?.toolbarFixed?.groups?.length){c=null;break e}u=fe(o5,{anchorElem:document.body,clientProps:o,editor:i,editorConfig:d,parentWithFixedToolbar:a})}e[0]=o,e[1]=i,e[2]=d,e[3]=r,e[4]=u,e[5]=c}else u=e[4],c=e[5];return c!==Symbol.for("react.early_return_sentinel")?c:u};var n5=$({plugins:[{Component:wa,position:"aboveContainer"}]});import{c as r5}from"react/compiler-runtime";import{jsx as Le,jsxs as Na}from"react/jsx-runtime";import{useLexicalComposerContext as l5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as i5}from"@lexical/react/useLexicalEditable";import{mergeRegister as La}from"@lexical/utils";import{$getSelection as ya,$isRangeSelection as Sa,$isTextNode as s5,COMMAND_PRIORITY_LOW as a5,getDOMSelection as va,SELECTION_CHANGE_COMMAND as c5}from"lexical";import{useCallback as ko,useEffect as Pt,useMemo as u5,useRef as Ea,useState as d5}from"react";import"react";import{createPortal as p5}from"react-dom";function Pn(t,e){let o=t.getRangeAt(0),n;if(t.anchorNode===e){let r=e;for(;r.firstElementChild!=null;)r=r.firstElementChild;n=r.getBoundingClientRect()}else n=o.getBoundingClientRect();return n}function bo(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:l=32,horizontalPosition:s="left",specialHandlingForCaret:i=!1,targetRect:d,verticalGap:u=10}=t,c=o.parentElement;if(d===null||c==null){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let a=r.getBoundingClientRect(),p=o.getBoundingClientRect(),m=c.getBoundingClientRect(),h=d.top-a.height-u,f=d.left-l;s==="center"&&(f=d.left+d.width/2-a.width/2);let g=0;return!e&&h<m.top&&!i&&(g=a.height+d.height+u*2,h+=g),s==="center"?f+a.width>m.right?f=m.right-a.width-l:f<m.left&&(f=m.left+l):f+a.width>m.right&&(f=m.right-a.width-l),f-=p.left,r.style.opacity="1",i&&n!==0?(h-=p.bottom-n+a.height-3,r.style.transform=`translate(${f}px, ${h}px) rotate(180deg)`):(h-=p.top,r.style.transform=`translate(${f}px, ${h}px)`),g}function m5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&Le(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?Le(Ot,{active:t,editor:o,enabled:n,item:r,children:Le(r.ChildComponent,{})},r.key):null}function f5({anchorElem:t,editor:e,group:o,index:n,toolbarStates:r}){let{editorConfig:l}=G(),s=r.groupStates.get(o.key),i=u5(()=>o.type!=="dropdown"?void 0:s?.activeItems?.[0]?.ChildComponent??o.ChildComponent,[o,s?.activeItems]);return Na("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${o.key}`,"data-toolbar-group-key":o.key,children:[o.type==="dropdown"&&o.items.length&&s?Le(Ft,{anchorElem:t,editor:e,group:o,groupState:s,Icon:i}):null,o.type==="buttons"&&o.items.length?o.items.map(d=>{let u=r.itemStates.get(d.key);return Le(m5,{active:u?.active??!1,anchorElem:t,editor:e,enabled:u?.enabled??!0,item:d},d.key)}):null,n<l.features.toolbarInline?.groups.length-1&&Le("div",{className:"divider"})]},o.key)}function h5({anchorElem:t,editor:e}){let o=Ea(null),n=Ea(null),{editorConfig:r}=G(),l=xo(e,r?.features?.toolbarInline?.groups),s=ko(()=>{if(o?.current){let c=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),a||(o.current.style.pointerEvents="none")}},[o]),i=ko(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let a=o.current.style.opacity==="0",p=o.current.style.pointerEvents==="none";if(!a||!p){let m=c.clientX,h=c.clientY,f=document.elementFromPoint(m,h);o.current.contains(f)||s()}}},[s]),d=ko(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Pt(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d)}),[o,i,d]);let u=ko(()=>{let c=ya(),a=va(e._window);if(o.current===null)return;let p=t.querySelector(":scope > .link-editor"),m=p!==null&&"style"in p&&p?.style?.opacity==="1",h=e.getRootElement();if(c!==null&&a!==null&&!a.isCollapsed&&h!==null&&h.contains(a.anchorNode)){let f=Pn(a,h),g=bo({alwaysDisplayOnTop:m,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});n.current&&bo({anchorElem:o.current,anchorFlippedOffset:g,floatingElem:n.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else s()},[e,s,t]);return Pt(()=>{let c=t.parentElement,a=()=>{e.getEditorState().read(()=>{u()})};return window.addEventListener("resize",a),c&&c.addEventListener("scroll",a),()=>{window.removeEventListener("resize",a),c&&c.removeEventListener("scroll",a)}},[e,u,t]),Pt(()=>(e.getEditorState().read(()=>{u()}),La(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{u()})}),e.registerCommand(c5,()=>(u(),!1),a5))),[e,u]),Na("div",{className:"inline-toolbar-popup",ref:o,children:[Le("div",{className:"caret",ref:n}),r?.features&&r.features?.toolbarInline?.groups.map((c,a)=>Le(f5,{anchorElem:t,editor:e,group:c,index:a,toolbarStates:l},c.key))]})}function g5(t,e){let o=r5(12),[n,r]=d5(!1),l=i5(),s;o[0]!==t?(s=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let m=ya(),h=va(t._window),f=t.getRootElement();if(h!==null&&(!Sa(m)||f===null||!f.contains(h.anchorNode))){r(!1);return}if(!Sa(m))return;if(m.getTextContent()!==""){let _=m.getNodes(),S=!1;for(let R of _)if(s5(R)){r(!0),S=!0;break}S||r(!1)}else r(!1);let g=m.getTextContent().replace(/\n/g,"");if(!m.isCollapsed()&&g===""){r(!1);return}})},o[0]=t,o[1]=s):s=o[1];let i=s,d,u;o[2]!==i?(d=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),u=[i],o[2]=i,o[3]=d,o[4]=u):(d=o[3],u=o[4]),Pt(d,u);let c,a;if(o[5]!==t||o[6]!==i?(c=()=>La(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&r(!1)})),a=[t,i],o[5]=t,o[6]=i,o[7]=c,o[8]=a):(c=o[7],a=o[8]),Pt(c,a),!n||!l)return null;let p;return o[9]!==e||o[10]!==t?(p=p5(Le(h5,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=p):p=o[11],p}var Ra=t=>{let{anchorElem:e}=t,[o]=l5();return g5(o,e)};var x5=$({plugins:[{Component:Ra,position:"floatingAnchorElem"}]});import{TableCellNode as s2,TableNode as a2,TableRowNode as c2}from"@lexical/table";import{jsx as Ia}from"react/jsx-runtime";import"react";var C5={16:"M7 4h4.5a.5.5 0 0 1 .5.5V6H7zM6 4H4.5a.5.5 0 0 0-.5.5V6h2zm0 3H4v2h2zm0 3H4v1.5a.5.5 0 0 0 .5.5H6zm1 2h4.5a.5.5 0 0 0 .5-.5V10H7zm0-3V7h5v2zM3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5z",24:"M17.204 6.51A2 2 0 0 1 19 8.5V16l-.011.204a2 2 0 0 1-1.785 1.785L17 18H7l-.204-.01a2 2 0 0 1-1.786-1.786L5 16V8.5a2 2 0 0 1 1.796-1.99L7 6.5h10zM6 16a1 1 0 0 0 1 1h2v-2.5H6zm4-1.5V17h7a1 1 0 0 0 .995-.898L18 16v-1.5zm-4-1h3V11H6zm4-2.5v2.5h8V11zM7 7.5a1 1 0 0 0-.995.897L6 8.5V10h3V7.5zm3 2.5h8V8.5a1 1 0 0 0-1-1h-7z"},Bn=({className:t,size:e=24})=>Ia("svg",{className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ia("path",{clipRule:"evenodd",d:C5[e],fill:"currentColor",fillRule:"evenodd"})});import{$createTableCellNode as b5,$createTableNode as k5,$createTableRowNode as _5,$isTableCellNode as Ma,$isTableNode as jn,$isTableRowNode as Hn,TableCellHeaderStates as _o,TableCellNode as T5,TableNode as w5,TableRowNode as S5}from"@lexical/table";import{$isParagraphNode as E5,$isTextNode as N5}from"lexical";var Aa=/^\|(.+)\|\s?$/,L5=/^(\| ?:?-*:? ?)+\|\s?$/,Da=({allTransformers:t})=>({type:"element",dependencies:[w5,S5,T5],export:e=>{if(!jn(e))return null;let o=[];for(let n of e.getChildren()){let r=[];if(!Hn(n))continue;let l=!1;for(let s of n.getChildren())Ma(s)&&(r.push(zt(t,s).replace(/\n/g,"\\n").trim()),s.__headerState===_o.ROW&&(l=!0));o.push(`| ${r.join(" | ")} |`),l&&o.push(`| ${r.map(s=>"---").join(" | ")} |`)}return o.join(`
59
59
  `)},regExp:Aa,replace:(e,o,n)=>{let r=n[0];if(!r)return;if(L5.test(r)){let a=e.getPreviousSibling();if(!a||!jn(a))return;let p=a.getChildren(),m=p[p.length-1];if(!m||!Hn(m))return;m.getChildren().forEach(h=>{Ma(h)&&h.setHeaderStyles(_o.ROW,_o.ROW)}),e.remove();return}let l=$a(r,t);if(l==null)return;let s=[l],i=e.getPreviousSibling(),d=l.length;for(;i&&!(!E5(i)||i.getChildrenSize()!==1);){let a=i.getFirstChild();if(!N5(a))break;let p=$a(a.getTextContent(),t);if(p==null)break;d=Math.max(d,p.length),s.unshift(p);let m=i.getPreviousSibling();i.remove(),i=m}let u=k5();for(let a of s){let p=_5();u.append(p);for(let m=0;m<d;m++)p.append(m<a.length?a[m]:Oa("",t))}let c=e.getPreviousSibling();jn(c)&&y5(c)===d?(c.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}});function y5(t){let e=t.getFirstChild();return Hn(e)?e.getChildrenSize():0}var Oa=(t,e)=>{t=t.replace(/\\n/g,`
60
- `);let o=b5(_o.NO_STATUS);return Wt(t,e,o),o},$a=(t,e)=>{let o=t.match(Aa);return!o||!o[1]?null:o[1].split("|").map(n=>Oa(n,e))};import{c as R5}from"react/compiler-runtime";import{jsx as j,jsxs as ye}from"react/jsx-runtime";import{useLexicalComposerContext as Ua}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as I5}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Ba,$deleteTableColumnAtSelection as M5,$deleteTableRowAtSelection as $5,$getNodeTriplet as A5,$getTableCellNodeFromLexicalNode as ja,$getTableColumnIndexFromTableCellNode as D5,$getTableNodeFromLexicalNodeOrThrow as De,$getTableRowIndexFromTableCellNode as O5,$insertTableColumnAtSelection as F5,$insertTableRowAtSelection as P5,$isTableCellNode as Ga,$isTableSelection as Bt,$mergeCells as B5,$unmergeCell as j5,getTableElement as Un,getTableObserverFromTableElement as Gn,TableCellHeaderStates as Ae,TableCellNode as H5}from"@lexical/table";import{mergeRegister as U5}from"@lexical/utils";import{useScrollInfo as G5}from"@payloadcms/ui";import{$getSelection as wo,$isElementNode as V5,$isRangeSelection as Vn,$isTextNode as W5,$setSelection as z5,COMMAND_PRIORITY_CRITICAL as K5,getDOMSelection as J5,isDOMNode as X5,SELECTION_CHANGE_COMMAND as Z5}from"lexical";import*as Wn from"react";import{useCallback as ue,useEffect as dt,useRef as To,useState as pt}from"react";import{createPortal as Va}from"react-dom";import{jsx as Fa}from"react/jsx-runtime";import"react";var v5={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},Pa=({className:t,size:e=24})=>Fa("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Fa("path",{clipRule:"evenodd",d:v5[e],fill:"currentColor",fillRule:"evenodd"})});function Ha(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function Y5(){let t=wo();if(Vn(t)&&!t.isCollapsed()||Bt(t)&&!t.anchor.is(t.focus)||!Vn(t)&&!Bt(t))return!1;let[e]=A5(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function q5(t){let e=t.getLastDescendant();W5(e)?e.select():V5(e)?e.selectEnd():e!==null&&e.selectNext()}function Q5({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=Ua(),s=To(null),[i,d]=pt(r),[u,c]=pt({columns:1,rows:1}),[a,p]=pt(!1),[m,h]=pt(!1),{y:f}=G5();dt(()=>l.registerMutationListener(H5,w=>{w.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{d(i.getLatest())})},{skipInitialization:!0}),[l,i]),dt(()=>{l.getEditorState().read(()=>{let w=wo();if(Bt(w)){let v=Ha(w);c(Ha(w)),p(v.columns>1||v.rows>1)}h(Y5())})},[l]),dt(()=>{let w=e.current,v=s.current,y=l.getRootElement();if(w!=null&&v!=null&&y!=null){let M=y.getBoundingClientRect(),A=w.getBoundingClientRect();v.style.opacity="1";let D=v.getBoundingClientRect(),F=5,P=A.right+F;if(P+D.width>window.innerWidth||P+D.width>M.right){let J=A.left-D.width-F;P=(J<0?F:J)+window.pageXOffset}v.style.left=`${P+window.pageXOffset}px`;let Y=A.top;if(Y+D.height>window.innerHeight){let J=A.bottom-D.height;Y=J<0?F:J}v.style.top=`${Y}px`}},[e,s,l,f]),dt(()=>{function w(v){s.current!=null&&e.current!=null&&X5(v.target)&&!s.current.contains(v.target)&&!e.current.contains(v.target)&&n(!1)}return window.addEventListener("click",w),()=>window.removeEventListener("click",w)},[n,e]);let g=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i),v=Un(w,l.getElementByKey(w.getKey()));if(v===null)throw new Error("Expected to find tableElement in DOM");let y=Gn(v);y!==null&&y.$clearHighlight(),w.markDirty(),d(i.getLatest())}z5(null)})},[l,i]),_=()=>{l.update(()=>{let w=wo();if(!Bt(w))return;let y=w.getNodes().filter(Ga),M=B5(y);M&&(q5(M),o())})},S=()=>{l.update(()=>{j5()})},R=ue(w=>{l.update(()=>{for(let v=0;v<u.rows;v++)P5(w);o()})},[l,o,u.rows]),b=ue(w=>{l.update(()=>{for(let v=0;v<u.columns;v++)F5(w);o()})},[l,o,u.columns]),x=ue(()=>{l.update(()=>{$5(),o()})},[l,o]),C=ue(()=>{l.update(()=>{De(i).remove(),g(),o()})},[l,i,g,o]),k=ue(()=>{l.update(()=>{M5(),o()})},[l,o]),T=ue(()=>{l.update(()=>{let w=De(i),v=O5(i),[y]=Ba(w,null,null),M=new Set,A=i.getHeaderStyles()^Ae.ROW;if(y[v])for(let D=0;D<y[v].length;D++){let F=y[v][D];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles(A,Ae.ROW)))}g(),o()})},[l,i,g,o]),I=ue(()=>{l.update(()=>{let w=De(i),v=D5(i),[y]=Ba(w,null,null),M=new Set,A=i.getHeaderStyles()^Ae.COLUMN;if(y)for(let D=0;D<y.length;D++){let F=y?.[D]?.[v];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles(A,Ae.COLUMN)))}g(),o()})},[l,i,g,o]),L=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setRowStriping(!w.getRowStriping())}g(),o()})},[l,i,g,o]),E=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setFrozenColumns(w.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),N=null;return t&&(a?N=j("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>_(),type:"button",children:j("span",{className:"text",children:"Merge cells"})}):m&&(N=j("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>S(),type:"button",children:j("span",{className:"text",children:"Unmerge cells"})}))),Va(ye("div",{className:"table-action-menu-dropdown",onClick:w=>{w.stopPropagation()},ref:s,children:[N?ye(Wn.Fragment,{children:[N,j("hr",{})]}):null,j("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>L(),type:"button",children:j("span",{className:"text",children:"Toggle row striping"})}),j("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>E(),type:"button",children:j("span",{className:"text",children:"Toggle first column freeze"})}),j("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>R(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),j("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>R(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),j("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>k(),type:"button",children:j("span",{className:"text",children:"Delete column"})}),j("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>x(),type:"button",children:j("span",{className:"text",children:"Delete row"})}),j("button",{className:"item","data-test-id":"table-delete",onClick:()=>C(),type:"button",children:j("span",{className:"text",children:"Delete table"})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&Ae.ROW)===Ae.ROW?"Remove":"Add"," ","row header"]})}),j("button",{className:"item","data-test-id":"table-column-header",onClick:()=>I(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&Ae.COLUMN)===Ae.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function eg({anchorElem:t,cellMerge:e}){let[o]=Ua(),n=To(null),r=To(null),[l,s]=pt(!1),[i,d]=pt(null),u=ue(()=>{let a=n.current,p=wo(),m=J5(o._window),h=document.activeElement;function f(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),d(null)}if(p==null||a==null)return f();let g=o.getRootElement(),_=null,S=null;if(Vn(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let b=ja(p.anchor.getNode());if(b==null||(S=o.getElementByKey(b.getKey()),S==null||!b.isAttached()))return f();let x=De(b),C=Un(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Gn(C),d(b)}else if(Bt(p)){let b=ja(p.anchor.getNode());if(!Ga(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let x=De(b),C=Un(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Gn(C),S=o.getElementByKey(b.getKey())}else if(!h)return f();if(_===null||S===null)return f();let R=!_||!_.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",R),a.classList.toggle("table-cell-action-button-container--inactive",!R),R){let b=S.getBoundingClientRect(),x=t.getBoundingClientRect(),C=b.top-x.top,k=b.right-x.left;a.style.transform=`translate(${k}px, ${C}px)`}},[o,t]);dt(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(u)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return U5(o.registerUpdateListener(m),o.registerCommand(Z5,m,K5),o.registerRootListener((h,f)=>{f&&f.removeEventListener("pointerup",m),h&&(h.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let c=To(i);return dt(()=>{c.current!==i&&s(!1),c.current=i},[c,i]),j("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&ye(Wn.Fragment,{children:[j("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:j(Pa,{})}),l&&j(Q5,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var Wa=t=>{let e=R5(3),{anchorElem:o}=t,n=I5(),r;return e[0]!==o||e[1]!==n?(r=Va(n?j(eg,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as tg}from"react/compiler-runtime";import{jsx as Eo,jsxs as og}from"react/jsx-runtime";import{useLexicalComposerContext as ng}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as rg}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as lg,$getTableNodeFromLexicalNodeOrThrow as zn,$getTableRowIndexFromTableCellNode as ig,$isTableCellNode as za,$isTableRowNode as sg,getDOMCellFromTarget as ag,getTableElement as cg,TableNode as Ka}from"@lexical/table";import{calculateZoomLevel as Ja,mergeRegister as ug}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Kn,isHTMLElement as dg,SKIP_SCROLL_INTO_VIEW_TAG as Xa}from"lexical";import*as Ya from"react";import{useCallback as jt,useEffect as Jn,useRef as So,useState as mt}from"react";import{createPortal as pg}from"react-dom";var mg=33,Za=92;function fg({editor:t}){let e=So(null),o=So(null),n=So(null),[r,l]=mt(!1),s=G(),i=So(null),[d,u]=mt(null),[c,a]=mt(null),[p,m]=mt(!1),[h,f]=mt(null),g=jt(()=>{a(null),e.current=null,f(null),i.current=null,n.current=null},[]),_=E=>(E.buttons&1)===1;Jn(()=>{let E=new Set;return ug(t.registerMutationListener(Ka,N=>{for(let[w,v]of N)v==="destroyed"?E.delete(w):E.add(w);l(E.size>0)}),t.registerNodeTransform(Ka,N=>{if(N.getColWidths())return N;let w=N.getColumnCount(),v=Za;return N.setColWidths(Array(w).fill(v)),N}))},[t]),Jn(()=>{if(!r)return;let E=y=>{let M=y.target;if(dg(M)){if(h){u({x:y.clientX,y:y.clientY});return}if(m(_(y)),!(o.current&&o.current.contains(M))&&e.current!==M){e.current=M;let A=ag(M);A&&c!==A?t.getEditorState().read(()=>{let D=Kn(A.elem);if(!D)throw new Error("TableCellResizer: Table cell node not found.");let F=zn(D),P=cg(F,t.getElementByKey(F.getKey()));if(!P)throw new Error("TableCellResizer: Table element not found.");e.current=M,n.current=P.getBoundingClientRect(),a(A)},{editor:t}):A==null&&g()}}},N=y=>{m(!0)},w=y=>{m(!1)},v=t.registerRootListener((y,M)=>{M?.removeEventListener("mousemove",E),M?.removeEventListener("mousedown",N),M?.removeEventListener("mouseup",w),y?.addEventListener("mousemove",E),y?.addEventListener("mousedown",N),y?.addEventListener("mouseup",w)});return()=>{v()}},[c,h,t,r,g]);let S=E=>E==="bottom",R=jt(E=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Kn(c.elem);if(!za(N))throw new Error("TableCellResizer: Table cell node not found.");let w=zn(N),v=ig(N),y=w.getChildren(),A=N.getColSpan()===w.getColumnCount()?v:v+N.getRowSpan()-1;if(A>=y.length||A<0)throw new Error("Expected table cell to be inside of table row.");let D=y[A];if(!sg(D))throw new Error("Expected table row");let F=D.getHeight();if(F===void 0){let Y=D.getChildren();F=Math.min(...Y.map(J=>b(J,t)??1/0))}let P=Math.max(F+E,mg);D.setHeight(P)},{tag:Xa})},[c,t]),b=(E,N)=>N.getElementByKey(E.getKey())?.clientHeight,x=(E,N)=>{let w;return N.forEach(v=>{v.forEach((y,M)=>{y.cell===E&&(w=M)})}),w},C=jt(E=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Kn(c.elem);if(!za(N))throw new Error("TableCellResizer: Table cell node not found.");let w=zn(N),[v]=lg(w,null,null),y=x(N,v);if(y===void 0)throw new Error("TableCellResizer: Table column not found.");let M=w.getColWidths();if(!M)return;let A=M[y];if(A===void 0)return;let D=[...M],F=Math.max(A+E,Za);D[y]=F,w.setColWidths(D)},{tag:Xa})},[c,t]),k=jt(E=>{let N=w=>{if(w.preventDefault(),w.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:v,y}=i.current;if(c===null)return;let M=Ja(w.target);if(S(E)){let A=(w.clientY-y)/M;R(A)}else{let A=(w.clientX-v)/M;C(A)}g(),document.removeEventListener("mouseup",N)}};return N},[c,g,C,R]),T=jt(E=>N=>{if(N.preventDefault(),N.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");i.current={x:N.clientX,y:N.clientY},u(i.current),f(E),document.addEventListener("mouseup",k(E))},[c,k]),[I,L]=mt({bottom:null,left:null,right:null,top:null});return Jn(()=>{if(c){let{height:E,left:N,top:w,width:v}=c.elem.getBoundingClientRect(),y=Ja(c.elem),M=10,A={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${M}px`,left:`${window.scrollX+N}px`,top:`${window.scrollY+w+E-M/2}px`,width:`${v}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${E}px`,left:`${window.scrollX+N+v-M/2}px`,top:`${window.scrollY+w}px`,width:`${M}px`}},D=n.current;h&&d&&D&&(S(h)?(A[h].left=`${window.scrollX+D.left}px`,A[h].top=`${window.scrollY+d.y/y}px`,A[h].height="3px",A[h].width=`${D.width}px`):(A[h].top=`${window.scrollY+D.top}px`,A[h].left=`${window.scrollX+d.x/y}px`,A[h].width="3px",A[h].height=`${D.height}px`),A[h].backgroundColor="#adf"),L(A)}else L({bottom:null,left:null,right:null,top:null})},[c,h,d]),Eo("div",{ref:o,children:c!=null&&!p&&og(Ya.Fragment,{children:[Eo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("right"),style:I.right||void 0}),Eo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("bottom"),style:I.bottom||void 0})]})})}var qa=()=>{let t=tg(3),[e]=ng(),o=rg(),n;return t[0]!==e||t[1]!==o?(n=o?pg(Eo(fg,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{c as Tg}from"react/compiler-runtime";import{jsx as Xn,jsxs as wg,Fragment as Sg}from"react/jsx-runtime";import{useLexicalComposerContext as Eg}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as ic}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as Ng,$getTableColumnIndexFromTableCellNode as Lg,$getTableRowIndexFromTableCellNode as yg,$insertTableColumnAtSelection as vg,$insertTableRowAtSelection as Rg,$isTableCellNode as Ig,$isTableNode as tc,getTableElement as Mg,TableNode as $g}from"@lexical/table";import{$findMatchingParent as Ag,mergeRegister as Dg}from"@lexical/utils";import{$getNearestNodeFromDOMNode as oc,isHTMLElement as Og}from"lexical";import{useEffect as nc,useMemo as Fg,useRef as rc,useState as No}from"react";import"react";import{createPortal as Pg}from"react-dom";import{c as bg}from"react/compiler-runtime";import{useEffect as kg,useRef as _g}from"react";var hg="Expected a function",gg=Math.max,xg=Math.min;function Cg(t,e,o){let n,r,l=0,s,i=!1,d=!1,u,c,a,p=!0;if(typeof t!="function")throw new TypeError(hg);e=e||0,typeof o=="object"&&(i=!!o.leading,d="maxWait"in o,u=d?gg(o.maxWait||0,e):u,p="trailing"in o?!!o.trailing:p);function m(C){let k=n,T=s;return n=s=void 0,l=C,c=t.apply(T,k),c}function h(C){return l=C,a=setTimeout(_,e),i?m(C):c}function f(C){let k=C-r,T=C-l,I=e-k;return d?xg(I,u-T):I}function g(C){let k=C-r,T=C-l;return r===void 0||k>=e||k<0||d&&T>=u}function _(){let C=Date.now();if(g(C))return S(C);a=setTimeout(_,f(C))}function S(C){return a=void 0,p&&n?m(C):(n=s=void 0,c)}function R(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function b(){return a===void 0?c:S(Date.now())}function x(){let C=Date.now(),k=g(C);if(n=arguments,s=this,r=C,k){if(a===void 0)return h(r);if(d)return clearTimeout(a),a=setTimeout(_,e),m(r)}return a===void 0&&(a=setTimeout(_,e)),c}return x.cancel=R,x.flush=b,x}var Qa=Cg;function ec(t,e,o){let n=bg(6),r=_g(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=Qa(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),kg(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...u)=>{let c=u;r.current&&r.current(...c)},n[5]=i):i=n[5],i}var lc=16;function Bg({anchorElem:t}){let[e]=Eg(),o=ic(),n=G(),[r,l]=No(!1),[s,i]=No(!1),[d,u]=No(!1),[c,a]=No({}),p=rc(new Set),m=rc(null),h=ec(_=>{let{isOutside:S,tableDOMNode:R}=jg(_,n.editorConfig?.lexical);if(S){l(!1),i(!1);return}if(!R)return;m.current=R;let b=null,x=null,C=null;if(e.getEditorState().read(()=>{let A=oc(R);if(Ig(A)){let D=Ag(A,F=>tc(F));if(!tc(D))return;if(C=Mg(D,e.getElementByKey(D.getKey())),C){let F=D.getChildrenSize(),P=D.getChildAtIndex(0)?.getChildrenSize(),Y=yg(A),J=Lg(A);Y===F-1?b=A:J===P-1&&(x=A)}}},{editor:e}),!C)return;let k=C.parentElement;if(!k)return;let{bottom:T,height:I,left:L,right:E,width:N,y:w}=C.getBoundingClientRect(),v=!1;k&&k.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(v=k.scrollWidth>k.clientWidth);let{left:y,y:M}=t.getBoundingClientRect();b?(i(!1),l(!0),a({height:lc,left:v&&k?k.offsetLeft:L-y,top:T-M+5,width:v&&k?k.offsetWidth:N})):x&&(i(!0),l(!1),a({height:I,left:E-y+5,top:w-M,width:lc}))},50,250),f=Fg(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);nc(()=>{if(d)return document.addEventListener("mousemove",h),()=>{l(!1),i(!1),document.removeEventListener("mousemove",h)}},[d,h]),nc(()=>Dg(e.registerMutationListener($g,_=>{e.getEditorState().read(()=>{let S=!1;for(let[R,b]of _)switch(b){case"created":{p.current.add(R),S=!0;break}case"destroyed":{p.current.delete(R),S=!0;break}default:break}if(S){f.disconnect();for(let R of p.current){let{tableElement:b}=Ng(R);f.observe(b)}u(p.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let g=_=>{e.update(()=>{m.current&&(oc(m.current)?.selectEnd(),_?(Rg(),l(!1)):(vg(),i(!1)))})};return o?wg(Sg,{children:[r&&Xn("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...c},type:"button"}),s&&Xn("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...c},type:"button"})]}):null}function jg(t,e){let o=t.target;if(Og(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function sc(t){let e=Tg(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!ic())return null;let l;return e[0]!==n?(l=Pg(Xn(Bg,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{jsx as qn,jsxs as Vg}from"react/jsx-runtime";import{useLexicalComposerContext as Wg}from"@lexical/react/LexicalComposerContext";import{TablePlugin as zg}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as Kg,TableCellNode as Jg,TableNode as Xg,TableRowNode as Zg}from"@lexical/table";import{mergeRegister as Yg}from"@lexical/utils";import{$getSelection as qg,$isRangeSelection as Qg,$setSelection as e2,COMMAND_PRIORITY_EDITOR as t2,createCommand as o2}from"lexical";import{createContext as n2,use as r2,useCallback as mc,useEffect as fc,useMemo as l2,useRef as i2,useState as Lo}from"react";import*as hc from"react";import{jsx as Q,jsxs as ve}from"react/jsx-runtime";import{useCallback as Zn,useEffect as ac,useRef as Yn,useState as Ht}from"react";import*as dc from"react";import{createPortal as Hg}from"react-dom";var cc=10,uc=7;function Ug(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function Gg(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function pc({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Ht(0),[d,u]=Ht(0),[c,a]=Ht(""),[p,m]=Ht(""),[h,f]=Ht(null),g=Yn(null),_=Yn(null),S=Yn(null),R=s>0?s:c?parseInt(c,10)||0:5,b=d>0?d:p?parseInt(p,10)||0:5;ac(()=>{o||(i(0),u(0),a(""),m(""),f(null))},[o]),ac(()=>{if(!o)return;let L=E=>{if(E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),n()),E.key==="Enter"&&h){E.preventDefault();let N=parseInt(c,10),w=parseInt(p,10);N>0&&w>0&&r(N,w)}};return document.addEventListener("keydown",L,!0),()=>document.removeEventListener("keydown",L,!0)},[o,n,r,h,c,p]);let x=Zn((L,E)=>{L>0&&E>0&&r(L,E)},[r]),C=Zn((L,E)=>{i(L),u(E)},[]),k=Zn(()=>{i(0),u(0)},[]);if(!o||!l||!t)return null;let T=[];for(let L=1;L<=uc;L++)for(let E=1;E<=cc;E++){let N=E<=R&&L<=b,w=E<=s&&L<=d,v="table-grid-popup__cell";N&&w?v+=" table-grid-popup__cell--hover":N&&(v+=" table-grid-popup__cell--selected"),T.push(Q("div",{"aria-label":`${E} columns, ${L} rows`,className:v,onClick:()=>x(E,L),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),x(E,L))},onMouseEnter:()=>C(E,L),role:"button",tabIndex:-1},`${L}-${E}`))}let I=s>0&&d>0;return Hg(ve(dc.Fragment,{children:[Q("div",{className:"table-grid-popup__backdrop",onClick:n}),Q("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:ve("div",{className:"table-grid-popup__content",children:[ve("div",{className:"table-grid-popup__header",children:[ve("div",{className:`table-grid-popup__input-group${h==="cols"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Ug,{})}),Q("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>a(L.target.value),onFocus:()=>f("cols"),placeholder:s>0?String(s):"5",ref:_,type:"number",value:c})]}),Q("span",{className:"table-grid-popup__separator",children:"\xD7"}),ve("div",{className:`table-grid-popup__input-group${h==="rows"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Gg,{})}),Q("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>m(L.target.value),onFocus:()=>f("rows"),placeholder:d>0?String(d):"5",ref:S,type:"number",value:p})]})]}),ve("div",{className:"table-grid-popup__grid",onMouseLeave:k,children:[T,I&&ve("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/cc*100}%)`,top:`calc(${(d-1)/uc*100}%)`},children:[R," \xD7 ",b]})]})]})})]}),t)}var yo=o2("OPEN_EMBED_DRAWER_COMMAND"),gc=n2({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function xc({children:t}){let[e,o]=Lo({cellEditorConfig:null,cellEditorPlugins:null});return qn(gc,{value:l2(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(n,r)=>{o({cellEditorConfig:n,cellEditorPlugins:r})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var Cc=()=>{let[t]=Wg(),e=r2(gc),[o,n]=Lo(!1),[r,l]=Lo(null),s=i2(null),[i,d]=Lo(null);fc(()=>{let a=t.getRootElement();if(a){let p=a.closest(".editor")??null;d(p??a.parentElement)}},[t]),fc(()=>{if(!t.hasNodes([Xg,Zg,Jg]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return Yg(t.registerCommand(yo,()=>{let a=i;if(!a)return!0;let p=a.getBoundingClientRect(),m=null;t.getEditorState().read(()=>{let f=qg();if(Qg(f)){s.current=f.clone();let g=f.anchor.getNode(),_=t.getElementByKey(g.getKey());if(_){let S=_.getBoundingClientRect();S.height>0&&(m={left:S.left-p.left,top:S.bottom-p.top+8})}}});let h=window.getSelection();if(h&&h.rangeCount>0){let g=h.getRangeAt(0).getBoundingClientRect();g.height>0&&(m={left:g.left-p.left,top:g.bottom-p.top+8})}return m||(m={left:0,top:40}),l(m),n(!0),!0},t2))},[e,t,i]);let u=mc(()=>{n(!1)},[]),c=mc((a,p)=>{n(!1),t.focus(),t.update(()=>{s.current&&e2(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(Kg,{columns:String(a),rows:String(p)})},1)},[t]);return Vg(hc.Fragment,{children:[qn(pc,{anchorElem:i,editor:t,isOpen:o,onClose:u,onInsert:c,position:r}),qn(zg,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var u2=$({markdownTransformers:[Da],nodes:[a2,s2,c2],plugins:[{Component:Cc,position:"normal"},{Component:qa,position:"normal"},{Component:Wa,position:"floatingAnchorElem"},{Component:sc,position:"floatingAnchorElem"}],providers:[xc],slashMenu:{groups:[X([{Icon:Bn,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(yo,{})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Bn,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(yo,{})}}])]}});import{$isNodeSelection as z2}from"lexical";import{jsx as bc}from"react/jsx-runtime";import"react";var d2="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",Qn=({className:t})=>bc("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:bc("path",{clipRule:"evenodd",d:d2,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Sc}from"react/jsx-runtime";import Ec from"bson-objectid";import{$applyNodeReplacement as x2}from"lexical";import*as Nc from"react";import p2 from"bson-objectid";function vo(t,e){if(t.hasAttribute("data-lexical-pending-upload-form-id")){let n=t.getAttribute("data-lexical-pending-upload-form-id");if(n!=null)return{node:e({data:{pending:{formID:n,src:t.getAttribute("src")||""}}})}}if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let n=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(n!=null&&r!=null)return{node:e({data:{fields:{},relationTo:r,value:n}})}}return{node:e({data:{pending:{formID:new p2.default().toHexString(),src:t.getAttribute("src")||""}}})}}import{DecoratorBlockNode as m2}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as f2}from"@lexical/utils";import _c from"bson-objectid";import{$applyNodeReplacement as h2}from"lexical";var Ut=class extends m2{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}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:o=>vo(o,kc),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new _c.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=kc({data:o});return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return f2(o,e?.theme?.upload),o}decorate(){return null}exportDOM(){let e=document.createElement("img"),o=this.__data;return o.pending?(e.setAttribute("data-lexical-pending-upload-form-id",String(o?.pending?.formID)),e.setAttribute("src",o?.pending?.src||"")):(e.setAttribute("data-lexical-upload-id",String(o?.value)),e.setAttribute("data-lexical-upload-relation-to",o?.relationTo)),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){let o=this.getWritable();o.__data=e}updateDOM(){return!1}};function kc({data:t}){return t?.id||(t.id=new _c.default().toHexString()),h2(new Ut({data:t}))}import{jsx as Tc}from"react/jsx-runtime";import{ShimmerEffect as g2}from"@payloadcms/ui";var wc=()=>Tc("div",{className:"lexical-upload",children:Tc(g2,{height:"95px",width:"203px"})});var C2=Nc.lazy(()=>import("./component-PHZQBOJE.js").then(t=>({default:t.UploadComponent}))),he=class extends Ut{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:o=>vo(o,ge),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new Ec.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=ge({data:o});return n.setFormat(e.format),n}decorate(e,o){return this.__data.pending?Sc(wc,{}):Sc(C2,{className:o?.theme?.upload??"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ge({data:t}){return t?.id||(t.id=new Ec.default().toHexString()),x2(new he({data:t}))}function ft(t){return t instanceof he}import{c as N2}from"react/compiler-runtime";import{jsx as L2}from"react/jsx-runtime";import{useLexicalComposerContext as y2}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as Fc,$insertNodeToNearestRoot as or,mergeRegister as v2}from"@lexical/utils";import{useBulkUpload as R2,useEffectEvent as I2,useModal as M2}from"@payloadcms/ui";import nr from"bson-objectid";import{$createRangeSelection as $2,$getPreviousSelection as Mc,$getSelection as $c,$isParagraphNode as rr,$isRangeSelection as Ac,$setSelection as A2,COMMAND_PRIORITY_EDITOR as D2,COMMAND_PRIORITY_LOW as Dc,createCommand as O2,DROP_COMMAND as F2,getDOMSelectionFromTarget as P2,isHTMLElement as Oc,PASTE_COMMAND as B2}from"lexical";import{useEffect as j2}from"react";import{c as Lc}from"react/compiler-runtime";import{jsx as er}from"react/jsx-runtime";import{useLexicalComposerContext as yc}from"@lexical/react/LexicalComposerContext.js";import{toast as b2}from"@payloadcms/ui";import{$getNodeByKey as k2,COMMAND_PRIORITY_EDITOR as vc}from"lexical";import{useEffect as Rc,useState as _2}from"react";var T2=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=k2(o);r&&r.replace(ge({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(tr,{fields:null,relationTo:e,value:n})},w2=t=>{let e=Lc(13),{enabledCollectionSlugs:o}=t,[n]=yc(),[r,l]=_2(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:d,openListDrawer:u}=Dt(s),c,a;e[2]!==n||e[3]!==u?(c=()=>n.registerCommand(et,f=>(l(f?.replace?f?.replace.nodeKey:null),u(),!0),vc),a=[n,u],e[2]=n,e[3]=u,e[4]=c,e[5]=a):(c=e[4],a=e[5]),Rc(c,a);let p;e[6]!==i||e[7]!==n||e[8]!==r?(p=f=>{let{collectionSlug:g,doc:_}=f;i(),T2({editor:n,relationTo:g,replaceNodeKey:r,value:_.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=p):p=e[9];let m=p,h;return e[10]!==d||e[11]!==m?(h=er(d,{onSelect:m}),e[10]=d,e[11]=m,e[12]=h):h=e[12],h},S2=()=>{let t=Lc(3),[e]=yc(),o,n;return t[0]!==e?(o=()=>e.registerCommand(et,E2,vc),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Rc(o,n),null},Ic=({enabledCollectionSlugs:t})=>t?.length?er(w2,{enabledCollectionSlugs:t}):er(S2,{});function E2(){return b2.error("No upload collections enabled"),!0}function H2(t){let e=t.target;return!!(Oc(e)&&!e.closest("code, span.editor-image")&&Oc(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function U2(t){let e,o=P2(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var tr=O2("INSERT_UPLOAD_COMMAND"),Pc=t=>{let e=N2(21),{clientProps:o}=t,[n]=y2(),r=o?.disabledCollections,l=o?.enabledCollections,s;e[0]!==r||e[1]!==l?(s={collectionSlugsBlacklist:r,collectionSlugsWhitelist:l,uploads:!0},e[0]=r,e[1]=l,e[2]=s):s=e[2];let{enabledCollectionSlugs:i}=fo(s),{drawerSlug:d,setCollectionSlug:u,setInitialForms:c,setOnCancel:a,setOnSuccess:p,setSelectableCollections:m}=R2(),{isModalOpen:h,openModal:f}=M2(),g;e[3]!==d||e[4]!==n||e[5]!==i||e[6]!==h||e[7]!==f||e[8]!==u||e[9]!==c||e[10]!==a||e[11]!==p||e[12]!==m?(g=x=>{let{files:C}=x;if(C?.length!==0&&(c(k=>[...k??[],...C.map(G2)]),!h(d))){if(!i.length||!i[0])return;u(i[0]),m(i),a(()=>{n.update(V2)}),p(k=>{let T=new Map(k.map(W2));n.update(()=>{for(let I of Fc()){let L=I.node;if(ft(L)){let E=L.getData();if(E?.pending){let N=T.get(E.pending?.formID);N&&L.replace(ge({data:{id:new nr.default().toHexString(),fields:{},relationTo:N.collectionSlug,value:N.doc.id}}))}}}})}),f(d)}},e[3]=d,e[4]=n,e[5]=i,e[6]=h,e[7]=f,e[8]=u,e[9]=c,e[10]=a,e[11]=p,e[12]=m,e[13]=g):g=e[13];let _=I2(g),S;e[14]!==n||e[15]!==_?(S=()=>{if(!n.hasNodes([he]))throw new Error("UploadPlugin: UploadNode not registered on editor");return v2(n.registerNodeTransform(he,x=>{let C=x.getData();if(!C?.pending)return;(async function(){let I=null,L=C?.pending?.src,E=C?.pending?.formID;if(L?.startsWith("data:")){let N=L.match(/data:(image\/[a-zA-Z]+);base64,/),w=N?N[1]:"image/png",v=L.replace(/^data:image\/[a-zA-Z]+;base64,/,""),y=atob(v),M=new Array(y.length);for(let F=0;F<y.length;F++)M[F]=y.charCodeAt(F);let A=new Uint8Array(M);I={alt:void 0,file:new File([A],"pasted-image."+w?.split("/",2)[1],{type:w}),formID:E}}else if(L?.startsWith("http")||L?.startsWith("https")){let w=await(await fetch(L)).blob(),v=L.split("/").pop()||"pasted-image"+w.type.split("/",2)[1];I={alt:void 0,file:new File([w],v,{type:w.type}),formID:E}}I&&_({files:[I]})})()}),n.registerCommand(tr,x=>(n.update(()=>{let C=$c()||Mc();if(Ac(C)){let k=ge({data:{id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}}),{focus:T}=C,I=T.getNode();or(k),rr(I)&&!I.__first&&I.remove()}}),!0),D2),n.registerCommand(B2,x=>{if(!(x instanceof ClipboardEvent))return!1;let C=x.clipboardData;if(!C?.types?.length||C?.types?.includes("text/html"))return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new nr.default().toHexString()})}),k.length?(n.update(()=>{let T=$c()||Mc();if(Ac(T))for(let I of k){let L=ge({data:{pending:{formID:I.formID,src:URL.createObjectURL(I.file)}}}),{focus:E}=T,N=E.getNode();or(L),rr(N)&&!N.__first&&N.remove()}}),_({files:k}),!0):!1},Dc),n.registerCommand(F2,x=>{if(!(x instanceof DragEvent))return!1;let C=x.dataTransfer;if(!C?.types?.length)return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new nr.default().toHexString()})}),k.length?(x.preventDefault(),x.stopPropagation(),n.update(()=>{if(H2(x)){let T=U2(x),I=$2();T!=null&&I.applyDOMRange(T),A2(I);for(let L of k){let E=ge({data:{pending:{formID:L.formID,src:URL.createObjectURL(L.file)}}}),{focus:N}=I,w=N.getNode();or(E),rr(w)&&!w.__first&&w.remove()}}}),_({files:k}),!0):!1},Dc))},e[14]=n,e[15]=_,e[16]=S):S=e[16];let R;e[17]!==n?(R=[n],e[17]=n,e[18]=R):R=e[18],j2(S,R);let b;return e[19]!==i?(b=L2(Ic,{enabledCollectionSlugs:i}),e[19]=i,e[20]=b):b=e[20],b};function G2(t){return{file:t.file,formID:t.formID}}function V2(){for(let t of Fc()){let e=t.node;ft(e)&&e.getData()?.pending&&e.remove()}}function W2(t){return[t.formID,t]}var K2=$({nodes:[he],plugins:[{Component:Pc,position:"normal"}],slashMenu:{groups:[X([{Icon:Qn,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Qn,isActive:({selection:t})=>{if(!z2(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return ft(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]}});import{jsx as lx}from"react/jsx-runtime";import{getFromImportMap as Uc}from"payload/shared";import{useMemo as ix}from"react";import{c as X2}from"react/compiler-runtime";import{jsx as Ro}from"react/jsx-runtime";import{createElement as Z2}from"react";import{ShimmerEffect as Y2,useConfig as q2}from"@payloadcms/ui";import{lazy as Q2,Suspense as ex,useEffect as tx,useState as ox}from"react";var Bc={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",root:"LexicalEditorTheme",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"};var lr={namespace:"lexical",theme:Bc};function jc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let c of l.features){if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null){console.warn("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. Skipping feature.");continue}s.set(c.clientFeatureProps.featureKey,c),i.push(c)}l.features=i,l.features=l.features.sort((c,a)=>c.clientFeatureProps.order-a.clientFeatureProps.order);let d=new Map,u=0;for(let c of l.features){let a=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:d,schemaPath:r,unSanitizedEditorConfig:l}):c.feature;a.key=c.clientFeatureProps.featureKey,a.order=u,d.set(c.clientFeatureProps.featureKey,a),u++}return d}import{deepMerge as J2}from"payload/shared";var Hc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?J2(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function ir(t,e,o,n){return{admin:o,features:Hc(t),lexical:e,resolvedFeatureMap:t,view:n}}var nx=Q2(()=>import("./Field-VYBSMSRY.js").then(t=>({default:t.RichText}))),sr=t=>Ro(jo,{inheritable:!0,views:t.views,children:Ro(rx,{...t})}),rx=t=>{let e=X2(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:d,views:u}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let a=c,p;e[2]!==r?(p=r===void 0?{}:r,e[2]=r,e[3]=p):p=e[3];let m=p,h=i===void 0?lr:i,{currentView:f}=Ho(),g=u?.[f]?.admin??a,_=u?.[f]?.lexical,S;e[4]!==h||e[5]!==_?(S=typeof _=="function"?_(h):_??h,e[4]=h,e[5]=_,e[6]=S):S=e[6];let R=S,{config:b}=q2(),[x,C]=ox(null),k,T;e[7]!==n||e[8]!==b||e[9]!==f||e[10]!==g||e[11]!==R||e[12]!==m||e[13]!==l||e[14]!==s||e[15]!==x||e[16]!==d||e[17]!==u?(k=()=>{if(x&&x.view===f)return;let L=u?.[f],E=L?.filterFeatures?L.filterFeatures(n):n,N=[];for(let v of Object.values(E))!v.clientFeatureProvider||!v.clientFeatureProps||N.push(v.clientFeatureProvider(v.clientFeatureProps));let w=jc({config:b,featureClientImportMap:m,featureClientSchemaMap:l,field:s,schemaPath:d??s.name,unSanitizedEditorConfig:{features:N,lexical:R}});C(ir(w,R,g,f))},T=[g,n,b,m,l,s,x,R,d,f,u],e[7]=n,e[8]=b,e[9]=f,e[10]=g,e[11]=R,e[12]=m,e[13]=l,e[14]=s,e[15]=x,e[16]=d,e[17]=u,e[18]=k,e[19]=T):(k=e[18],T=e[19]),tx(k,T);let I;return e[20]!==x||e[21]!==t?(I=Ro(ex,{fallback:Ro(Y2,{height:"35vh"}),children:x&&Z2(nx,{...t,editorConfig:x,key:x.view})}),e[20]=x,e[21]=t,e[22]=I):I=e[22],I};var sx=t=>{let{featureClientSchemaMap:e={},features:o={},field:n,forceRender:r,importMap:l,path:s,permissions:i,readOnly:d,schemaPath:u}=t,{clientFeatures:c,featureClientImportMap:a}=ix(()=>{let p={},m={},h=Object.entries(o).sort(([,f],[,g])=>f.order-g.order);for(let[f,g]of h){if(p[f]={},g.ClientFeature){let _=Uc({importMap:l,PayloadComponent:g.ClientFeature,schemaPath:"lexical-clientComponent",silent:!0});if(_){let S={...g.clientFeatureProps??{},featureKey:g.key,order:g.order};typeof g.ClientFeature=="object"&&g.ClientFeature.clientProps&&(S.clientProps=g.ClientFeature.clientProps),p[f]={clientFeatureProps:S,clientFeatureProvider:_}}}if(g.componentImports&&typeof g.componentImports=="object")for(let[_,S]of Object.entries(g.componentImports)){let R=Uc({importMap:l,PayloadComponent:S,schemaPath:"lexical-clientComponent",silent:!0});R&&(m[`${f}.${_}`]=R)}}return{clientFeatures:p,featureClientImportMap:m}},[o,l]);return lx(sr,{clientFeatures:c,featureClientImportMap:a,featureClientSchemaMap:e,field:n,forceRender:r,path:s,permissions:i,readOnly:d,schemaPath:u})};function ax(t){return t instanceof HTMLElement}function cx(...t){return t.filter(Boolean).join(" ")}var Io=new WeakMap;function Gc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function Mo(t,e){let o=Io.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Gc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let d=Gc(s);for(let u of n)d!==null&&u([d[0]-i[0],d[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},Io.set(t,o)}return o.listeners.add(e),()=>{ux(t,e)}}function ux(t,e){let o=Io.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(Io.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function dx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function px(t,e){return Mo(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function mx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function fx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as hx}from"react/compiler-runtime";import{jsx as gx}from"react/jsx-runtime";import"react";var xx=()=>{let t=hx(2),{EditButton:e}=be(),o;return t[0]!==e?(o=e?gx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Cx}from"react/compiler-runtime";import{jsx as bx}from"react/jsx-runtime";import"react";var kx=()=>{let t=Cx(2),{RemoveButton:e}=be(),o;return t[0]!==e?(o=e?bx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as _x}from"react/compiler-runtime";import{jsx as Tx}from"react/jsx-runtime";import"react";var wx=()=>{let t=_x(2),{Label:e}=be(),o;return t[0]!==e?(o=e?Tx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Sx}from"react/compiler-runtime";import{jsx as Ex}from"react/jsx-runtime";import"react";var Nx=t=>{let e=Sx(3),{children:o}=t,{InlineBlockContainer:n}=be(),r;return e[0]!==n||e[1]!==o?(r=n?Ex(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as Lx}from"react/jsx-runtime";import"react";var yx=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?Lx(n,{...o,children:e}):null};import{c as vx}from"react/compiler-runtime";import{jsx as Rx}from"react/jsx-runtime";import"react";var Ix=()=>{let t=vx(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?Rx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Mx}from"react/compiler-runtime";import{jsx as $x}from"react/jsx-runtime";import"react";var Ax=()=>{let t=Mx(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?$x(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as Dx}from"qs-esm";var Ox=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let d=Dx({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${d}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(c=>c.json())};var Vc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
60
+ `);let o=b5(_o.NO_STATUS);return Wt(t,e,o),o},$a=(t,e)=>{let o=t.match(Aa);return!o||!o[1]?null:o[1].split("|").map(n=>Oa(n,e))};import{c as R5}from"react/compiler-runtime";import{jsx as j,jsxs as ye}from"react/jsx-runtime";import{useLexicalComposerContext as Ua}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as I5}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Ba,$deleteTableColumnAtSelection as M5,$deleteTableRowAtSelection as $5,$getNodeTriplet as A5,$getTableCellNodeFromLexicalNode as ja,$getTableColumnIndexFromTableCellNode as D5,$getTableNodeFromLexicalNodeOrThrow as De,$getTableRowIndexFromTableCellNode as O5,$insertTableColumnAtSelection as F5,$insertTableRowAtSelection as P5,$isTableCellNode as Ga,$isTableSelection as Bt,$mergeCells as B5,$unmergeCell as j5,getTableElement as Un,getTableObserverFromTableElement as Gn,TableCellHeaderStates as Ae,TableCellNode as H5}from"@lexical/table";import{mergeRegister as U5}from"@lexical/utils";import{useScrollInfo as G5}from"@payloadcms/ui";import{$getSelection as wo,$isElementNode as V5,$isRangeSelection as Vn,$isTextNode as W5,$setSelection as z5,COMMAND_PRIORITY_CRITICAL as K5,getDOMSelection as J5,isDOMNode as X5,SELECTION_CHANGE_COMMAND as Z5}from"lexical";import*as Wn from"react";import{useCallback as ue,useEffect as dt,useRef as To,useState as pt}from"react";import{createPortal as Va}from"react-dom";import{jsx as Fa}from"react/jsx-runtime";import"react";var v5={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},Pa=({className:t,size:e=24})=>Fa("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Fa("path",{clipRule:"evenodd",d:v5[e],fill:"currentColor",fillRule:"evenodd"})});function Ha(t){let e=t.getShape();return{columns:e.toX-e.fromX+1,rows:e.toY-e.fromY+1}}function Y5(){let t=wo();if(Vn(t)&&!t.isCollapsed()||Bt(t)&&!t.anchor.is(t.focus)||!Vn(t)&&!Bt(t))return!1;let[e]=A5(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function q5(t){let e=t.getLastDescendant();W5(e)?e.select():V5(e)?e.selectEnd():e!==null&&e.selectNext()}function Q5({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=Ua(),s=To(null),[i,d]=pt(r),[u,c]=pt({columns:1,rows:1}),[a,p]=pt(!1),[m,h]=pt(!1),{y:f}=G5();dt(()=>l.registerMutationListener(H5,w=>{w.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{d(i.getLatest())})},{skipInitialization:!0}),[l,i]),dt(()=>{l.getEditorState().read(()=>{let w=wo();if(Bt(w)){let v=Ha(w);c(Ha(w)),p(v.columns>1||v.rows>1)}h(Y5())})},[l]),dt(()=>{let w=e.current,v=s.current,y=l.getRootElement();if(w!=null&&v!=null&&y!=null){let M=y.getBoundingClientRect(),A=w.getBoundingClientRect();v.style.opacity="1";let D=v.getBoundingClientRect(),F=5,P=A.right+F;if(P+D.width>window.innerWidth||P+D.width>M.right){let J=A.left-D.width-F;P=(J<0?F:J)+window.pageXOffset}v.style.left=`${P+window.pageXOffset}px`;let Y=A.top;if(Y+D.height>window.innerHeight){let J=A.bottom-D.height;Y=J<0?F:J}v.style.top=`${Y}px`}},[e,s,l,f]),dt(()=>{function w(v){s.current!=null&&e.current!=null&&X5(v.target)&&!s.current.contains(v.target)&&!e.current.contains(v.target)&&n(!1)}return window.addEventListener("click",w),()=>window.removeEventListener("click",w)},[n,e]);let g=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i),v=Un(w,l.getElementByKey(w.getKey()));if(v===null)throw new Error("Expected to find tableElement in DOM");let y=Gn(v);y!==null&&y.$clearHighlight(),w.markDirty(),d(i.getLatest())}z5(null)})},[l,i]),_=()=>{l.update(()=>{let w=wo();if(!Bt(w))return;let y=w.getNodes().filter(Ga),M=B5(y);M&&(q5(M),o())})},S=()=>{l.update(()=>{j5()})},R=ue(w=>{l.update(()=>{for(let v=0;v<u.rows;v++)P5(w);o()})},[l,o,u.rows]),b=ue(w=>{l.update(()=>{for(let v=0;v<u.columns;v++)F5(w);o()})},[l,o,u.columns]),x=ue(()=>{l.update(()=>{$5(),o()})},[l,o]),C=ue(()=>{l.update(()=>{De(i).remove(),g(),o()})},[l,i,g,o]),k=ue(()=>{l.update(()=>{M5(),o()})},[l,o]),T=ue(()=>{l.update(()=>{let w=De(i),v=O5(i),[y]=Ba(w,null,null),M=new Set,A=i.getHeaderStyles()^Ae.ROW;if(y[v])for(let D=0;D<y[v].length;D++){let F=y[v][D];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles(A,Ae.ROW)))}g(),o()})},[l,i,g,o]),I=ue(()=>{l.update(()=>{let w=De(i),v=D5(i),[y]=Ba(w,null,null),M=new Set,A=i.getHeaderStyles()^Ae.COLUMN;if(y)for(let D=0;D<y.length;D++){let F=y?.[D]?.[v];F?.cell&&(M.has(F.cell)||(M.add(F.cell),F.cell.setHeaderStyles(A,Ae.COLUMN)))}g(),o()})},[l,i,g,o]),L=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setRowStriping(!w.getRowStriping())}g(),o()})},[l,i,g,o]),E=ue(()=>{l.update(()=>{if(i.isAttached()){let w=De(i);w&&w.setFrozenColumns(w.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),N=null;return t&&(a?N=j("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>_(),type:"button",children:j("span",{className:"text",children:"Merge cells"})}):m&&(N=j("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>S(),type:"button",children:j("span",{className:"text",children:"Unmerge cells"})}))),Va(ye("div",{className:"table-action-menu-dropdown",onClick:w=>{w.stopPropagation()},ref:s,children:[N?ye(Wn.Fragment,{children:[N,j("hr",{})]}):null,j("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>L(),type:"button",children:j("span",{className:"text",children:"Toggle row striping"})}),j("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>E(),type:"button",children:j("span",{className:"text",children:"Toggle first column freeze"})}),j("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>R(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),j("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>R(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:ye("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),j("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:ye("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>k(),type:"button",children:j("span",{className:"text",children:"Delete column"})}),j("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>x(),type:"button",children:j("span",{className:"text",children:"Delete row"})}),j("button",{className:"item","data-test-id":"table-delete",onClick:()=>C(),type:"button",children:j("span",{className:"text",children:"Delete table"})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&Ae.ROW)===Ae.ROW?"Remove":"Add"," ","row header"]})}),j("button",{className:"item","data-test-id":"table-column-header",onClick:()=>I(),type:"button",children:ye("span",{className:"text",children:[(i.__headerState&Ae.COLUMN)===Ae.COLUMN?"Remove":"Add"," ","column header"]})})]}),document.body)}function eg({anchorElem:t,cellMerge:e}){let[o]=Ua(),n=To(null),r=To(null),[l,s]=pt(!1),[i,d]=pt(null),u=ue(()=>{let a=n.current,p=wo(),m=J5(o._window),h=document.activeElement;function f(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),d(null)}if(p==null||a==null)return f();let g=o.getRootElement(),_=null,S=null;if(Vn(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let b=ja(p.anchor.getNode());if(b==null||(S=o.getElementByKey(b.getKey()),S==null||!b.isAttached()))return f();let x=De(b),C=Un(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Gn(C),d(b)}else if(Bt(p)){let b=ja(p.anchor.getNode());if(!Ga(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let x=De(b),C=Un(x,o.getElementByKey(x.getKey()));if(C===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");_=Gn(C),S=o.getElementByKey(b.getKey())}else if(!h)return f();if(_===null||S===null)return f();let R=!_||!_.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",R),a.classList.toggle("table-cell-action-button-container--inactive",!R),R){let b=S.getBoundingClientRect(),x=t.getBoundingClientRect(),C=b.top-x.top,k=b.right-x.left;a.style.transform=`translate(${k}px, ${C}px)`}},[o,t]);dt(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(u)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return U5(o.registerUpdateListener(m),o.registerCommand(Z5,m,K5),o.registerRootListener((h,f)=>{f&&f.removeEventListener("pointerup",m),h&&(h.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let c=To(i);return dt(()=>{c.current!==i&&s(!1),c.current=i},[c,i]),j("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&ye(Wn.Fragment,{children:[j("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:j(Pa,{})}),l&&j(Q5,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var Wa=t=>{let e=R5(3),{anchorElem:o}=t,n=I5(),r;return e[0]!==o||e[1]!==n?(r=Va(n?j(eg,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as tg}from"react/compiler-runtime";import{jsx as Eo,jsxs as og}from"react/jsx-runtime";import{useLexicalComposerContext as ng}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as rg}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as lg,$getTableNodeFromLexicalNodeOrThrow as zn,$getTableRowIndexFromTableCellNode as ig,$isTableCellNode as za,$isTableRowNode as sg,getDOMCellFromTarget as ag,getTableElement as cg,TableNode as Ka}from"@lexical/table";import{calculateZoomLevel as Ja,mergeRegister as ug}from"@lexical/utils";import{$getNearestNodeFromDOMNode as Kn,isHTMLElement as dg,SKIP_SCROLL_INTO_VIEW_TAG as Xa}from"lexical";import*as Ya from"react";import{useCallback as jt,useEffect as Jn,useRef as So,useState as mt}from"react";import{createPortal as pg}from"react-dom";var mg=33,Za=92;function fg({editor:t}){let e=So(null),o=So(null),n=So(null),[r,l]=mt(!1),s=G(),i=So(null),[d,u]=mt(null),[c,a]=mt(null),[p,m]=mt(!1),[h,f]=mt(null),g=jt(()=>{a(null),e.current=null,f(null),i.current=null,n.current=null},[]),_=E=>(E.buttons&1)===1;Jn(()=>{let E=new Set;return ug(t.registerMutationListener(Ka,N=>{for(let[w,v]of N)v==="destroyed"?E.delete(w):E.add(w);l(E.size>0)}),t.registerNodeTransform(Ka,N=>{if(N.getColWidths())return N;let w=N.getColumnCount(),v=Za;return N.setColWidths(Array(w).fill(v)),N}))},[t]),Jn(()=>{if(!r)return;let E=y=>{let M=y.target;if(dg(M)){if(h){u({x:y.clientX,y:y.clientY});return}if(m(_(y)),!(o.current&&o.current.contains(M))&&e.current!==M){e.current=M;let A=ag(M);A&&c!==A?t.getEditorState().read(()=>{let D=Kn(A.elem);if(!D)throw new Error("TableCellResizer: Table cell node not found.");let F=zn(D),P=cg(F,t.getElementByKey(F.getKey()));if(!P)throw new Error("TableCellResizer: Table element not found.");e.current=M,n.current=P.getBoundingClientRect(),a(A)},{editor:t}):A==null&&g()}}},N=y=>{m(!0)},w=y=>{m(!1)},v=t.registerRootListener((y,M)=>{M?.removeEventListener("mousemove",E),M?.removeEventListener("mousedown",N),M?.removeEventListener("mouseup",w),y?.addEventListener("mousemove",E),y?.addEventListener("mousedown",N),y?.addEventListener("mouseup",w)});return()=>{v()}},[c,h,t,r,g]);let S=E=>E==="bottom",R=jt(E=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Kn(c.elem);if(!za(N))throw new Error("TableCellResizer: Table cell node not found.");let w=zn(N),v=ig(N),y=w.getChildren(),A=N.getColSpan()===w.getColumnCount()?v:v+N.getRowSpan()-1;if(A>=y.length||A<0)throw new Error("Expected table cell to be inside of table row.");let D=y[A];if(!sg(D))throw new Error("Expected table row");let F=D.getHeight();if(F===void 0){let Y=D.getChildren();F=Math.min(...Y.map(J=>b(J,t)??1/0))}let P=Math.max(F+E,mg);D.setHeight(P)},{tag:Xa})},[c,t]),b=(E,N)=>N.getElementByKey(E.getKey())?.clientHeight,x=(E,N)=>{let w;return N.forEach(v=>{v.forEach((y,M)=>{y.cell===E&&(w=M)})}),w},C=jt(E=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let N=Kn(c.elem);if(!za(N))throw new Error("TableCellResizer: Table cell node not found.");let w=zn(N),[v]=lg(w,null,null),y=x(N,v);if(y===void 0)throw new Error("TableCellResizer: Table column not found.");let M=w.getColWidths();if(!M)return;let A=M[y];if(A===void 0)return;let D=[...M],F=Math.max(A+E,Za);D[y]=F,w.setColWidths(D)},{tag:Xa})},[c,t]),k=jt(E=>{let N=w=>{if(w.preventDefault(),w.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:v,y}=i.current;if(c===null)return;let M=Ja(w.target);if(S(E)){let A=(w.clientY-y)/M;R(A)}else{let A=(w.clientX-v)/M;C(A)}g(),document.removeEventListener("mouseup",N)}};return N},[c,g,C,R]),T=jt(E=>N=>{if(N.preventDefault(),N.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");i.current={x:N.clientX,y:N.clientY},u(i.current),f(E),document.addEventListener("mouseup",k(E))},[c,k]),[I,L]=mt({bottom:null,left:null,right:null,top:null});return Jn(()=>{if(c){let{height:E,left:N,top:w,width:v}=c.elem.getBoundingClientRect(),y=Ja(c.elem),M=10,A={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${M}px`,left:`${window.scrollX+N}px`,top:`${window.scrollY+w+E-M/2}px`,width:`${v}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${E}px`,left:`${window.scrollX+N+v-M/2}px`,top:`${window.scrollY+w}px`,width:`${M}px`}},D=n.current;h&&d&&D&&(S(h)?(A[h].left=`${window.scrollX+D.left}px`,A[h].top=`${window.scrollY+d.y/y}px`,A[h].height="3px",A[h].width=`${D.width}px`):(A[h].top=`${window.scrollY+D.top}px`,A[h].left=`${window.scrollX+d.x/y}px`,A[h].width="3px",A[h].height=`${D.height}px`),A[h].backgroundColor="#adf"),L(A)}else L({bottom:null,left:null,right:null,top:null})},[c,h,d]),Eo("div",{ref:o,children:c!=null&&!p&&og(Ya.Fragment,{children:[Eo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("right"),style:I.right||void 0}),Eo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("bottom"),style:I.bottom||void 0})]})})}var qa=()=>{let t=tg(3),[e]=ng(),o=rg(),n;return t[0]!==e||t[1]!==o?(n=o?pg(Eo(fg,{editor:e}),document.body):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{c as Tg}from"react/compiler-runtime";import{jsx as Xn,jsxs as wg,Fragment as Sg}from"react/jsx-runtime";import{useLexicalComposerContext as Eg}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as ic}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as Ng,$getTableColumnIndexFromTableCellNode as Lg,$getTableRowIndexFromTableCellNode as yg,$insertTableColumnAtSelection as vg,$insertTableRowAtSelection as Rg,$isTableCellNode as Ig,$isTableNode as tc,getTableElement as Mg,TableNode as $g}from"@lexical/table";import{$findMatchingParent as Ag,mergeRegister as Dg}from"@lexical/utils";import{$getNearestNodeFromDOMNode as oc,isHTMLElement as Og}from"lexical";import{useEffect as nc,useMemo as Fg,useRef as rc,useState as No}from"react";import"react";import{createPortal as Pg}from"react-dom";import{c as bg}from"react/compiler-runtime";import{useEffect as kg,useRef as _g}from"react";var hg="Expected a function",gg=Math.max,xg=Math.min;function Cg(t,e,o){let n,r,l=0,s,i=!1,d=!1,u,c,a,p=!0;if(typeof t!="function")throw new TypeError(hg);e=e||0,typeof o=="object"&&(i=!!o.leading,d="maxWait"in o,u=d?gg(o.maxWait||0,e):u,p="trailing"in o?!!o.trailing:p);function m(C){let k=n,T=s;return n=s=void 0,l=C,c=t.apply(T,k),c}function h(C){return l=C,a=setTimeout(_,e),i?m(C):c}function f(C){let k=C-r,T=C-l,I=e-k;return d?xg(I,u-T):I}function g(C){let k=C-r,T=C-l;return r===void 0||k>=e||k<0||d&&T>=u}function _(){let C=Date.now();if(g(C))return S(C);a=setTimeout(_,f(C))}function S(C){return a=void 0,p&&n?m(C):(n=s=void 0,c)}function R(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function b(){return a===void 0?c:S(Date.now())}function x(){let C=Date.now(),k=g(C);if(n=arguments,s=this,r=C,k){if(a===void 0)return h(r);if(d)return clearTimeout(a),a=setTimeout(_,e),m(r)}return a===void 0&&(a=setTimeout(_,e)),c}return x.cancel=R,x.flush=b,x}var Qa=Cg;function ec(t,e,o){let n=bg(6),r=_g(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=Qa(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),kg(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...u)=>{let c=u;r.current&&r.current(...c)},n[5]=i):i=n[5],i}var lc=16;function Bg({anchorElem:t}){let[e]=Eg(),o=ic(),n=G(),[r,l]=No(!1),[s,i]=No(!1),[d,u]=No(!1),[c,a]=No({}),p=rc(new Set),m=rc(null),h=ec(_=>{let{isOutside:S,tableDOMNode:R}=jg(_,n.editorConfig?.lexical);if(S){l(!1),i(!1);return}if(!R)return;m.current=R;let b=null,x=null,C=null;if(e.getEditorState().read(()=>{let A=oc(R);if(Ig(A)){let D=Ag(A,F=>tc(F));if(!tc(D))return;if(C=Mg(D,e.getElementByKey(D.getKey())),C){let F=D.getChildrenSize(),P=D.getChildAtIndex(0)?.getChildrenSize(),Y=yg(A),J=Lg(A);Y===F-1?b=A:J===P-1&&(x=A)}}},{editor:e}),!C)return;let k=C.parentElement;if(!k)return;let{bottom:T,height:I,left:L,right:E,width:N,y:w}=C.getBoundingClientRect(),v=!1;k&&k.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(v=k.scrollWidth>k.clientWidth);let{left:y,y:M}=t.getBoundingClientRect();b?(i(!1),l(!0),a({height:lc,left:v&&k?k.offsetLeft:L-y,top:T-M+5,width:v&&k?k.offsetWidth:N})):x&&(i(!0),l(!1),a({height:I,left:E-y+5,top:w-M,width:lc}))},50,250),f=Fg(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);nc(()=>{if(d)return document.addEventListener("mousemove",h),()=>{l(!1),i(!1),document.removeEventListener("mousemove",h)}},[d,h]),nc(()=>Dg(e.registerMutationListener($g,_=>{e.getEditorState().read(()=>{let S=!1;for(let[R,b]of _)switch(b){case"created":{p.current.add(R),S=!0;break}case"destroyed":{p.current.delete(R),S=!0;break}default:break}if(S){f.disconnect();for(let R of p.current){let{tableElement:b}=Ng(R);f.observe(b)}u(p.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let g=_=>{e.update(()=>{m.current&&(oc(m.current)?.selectEnd(),_?(Rg(),l(!1)):(vg(),i(!1)))})};return o?wg(Sg,{children:[r&&Xn("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...c},type:"button"}),s&&Xn("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...c},type:"button"})]}):null}function jg(t,e){let o=t.target;if(Og(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function sc(t){let e=Tg(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!ic())return null;let l;return e[0]!==n?(l=Pg(Xn(Bg,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{jsx as qn,jsxs as Vg}from"react/jsx-runtime";import{useLexicalComposerContext as Wg}from"@lexical/react/LexicalComposerContext";import{TablePlugin as zg}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as Kg,TableCellNode as Jg,TableNode as Xg,TableRowNode as Zg}from"@lexical/table";import{mergeRegister as Yg}from"@lexical/utils";import{$getSelection as qg,$isRangeSelection as Qg,$setSelection as e2,COMMAND_PRIORITY_EDITOR as t2,createCommand as o2}from"lexical";import{createContext as n2,use as r2,useCallback as mc,useEffect as fc,useMemo as l2,useRef as i2,useState as Lo}from"react";import*as hc from"react";import{jsx as Q,jsxs as ve}from"react/jsx-runtime";import{useCallback as Zn,useEffect as ac,useRef as Yn,useState as Ht}from"react";import*as dc from"react";import{createPortal as Hg}from"react-dom";var cc=10,uc=7;function Ug(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),Q("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function Gg(){return ve("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),Q("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function pc({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Ht(0),[d,u]=Ht(0),[c,a]=Ht(""),[p,m]=Ht(""),[h,f]=Ht(null),g=Yn(null),_=Yn(null),S=Yn(null),R=s>0?s:c?parseInt(c,10)||0:5,b=d>0?d:p?parseInt(p,10)||0:5;ac(()=>{o||(i(0),u(0),a(""),m(""),f(null))},[o]),ac(()=>{if(!o)return;let L=E=>{if(E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),n()),E.key==="Enter"&&h){E.preventDefault();let N=parseInt(c,10),w=parseInt(p,10);N>0&&w>0&&r(N,w)}};return document.addEventListener("keydown",L,!0),()=>document.removeEventListener("keydown",L,!0)},[o,n,r,h,c,p]);let x=Zn((L,E)=>{L>0&&E>0&&r(L,E)},[r]),C=Zn((L,E)=>{i(L),u(E)},[]),k=Zn(()=>{i(0),u(0)},[]);if(!o||!l||!t)return null;let T=[];for(let L=1;L<=uc;L++)for(let E=1;E<=cc;E++){let N=E<=R&&L<=b,w=E<=s&&L<=d,v="table-grid-popup__cell";N&&w?v+=" table-grid-popup__cell--hover":N&&(v+=" table-grid-popup__cell--selected"),T.push(Q("div",{"aria-label":`${E} columns, ${L} rows`,className:v,onClick:()=>x(E,L),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),x(E,L))},onMouseEnter:()=>C(E,L),role:"button",tabIndex:-1},`${L}-${E}`))}let I=s>0&&d>0;return Hg(ve(dc.Fragment,{children:[Q("div",{className:"table-grid-popup__backdrop",onClick:n}),Q("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:ve("div",{className:"table-grid-popup__content",children:[ve("div",{className:"table-grid-popup__header",children:[ve("div",{className:`table-grid-popup__input-group${h==="cols"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Ug,{})}),Q("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>a(L.target.value),onFocus:()=>f("cols"),placeholder:s>0?String(s):"5",ref:_,type:"number",value:c})]}),Q("span",{className:"table-grid-popup__separator",children:"\xD7"}),ve("div",{className:`table-grid-popup__input-group${h==="rows"?" table-grid-popup__input-group--focused":""}`,children:[Q("div",{className:"table-grid-popup__input-icon",children:Q(Gg,{})}),Q("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:L=>m(L.target.value),onFocus:()=>f("rows"),placeholder:d>0?String(d):"5",ref:S,type:"number",value:p})]})]}),ve("div",{className:"table-grid-popup__grid",onMouseLeave:k,children:[T,I&&ve("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/cc*100}%)`,top:`calc(${(d-1)/uc*100}%)`},children:[R," \xD7 ",b]})]})]})})]}),t)}var yo=o2("OPEN_EMBED_DRAWER_COMMAND"),gc=n2({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function xc({children:t}){let[e,o]=Lo({cellEditorConfig:null,cellEditorPlugins:null});return qn(gc,{value:l2(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(n,r)=>{o({cellEditorConfig:n,cellEditorPlugins:r})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var Cc=()=>{let[t]=Wg(),e=r2(gc),[o,n]=Lo(!1),[r,l]=Lo(null),s=i2(null),[i,d]=Lo(null);fc(()=>{let a=t.getRootElement();if(a){let p=a.closest(".editor")??null;d(p??a.parentElement)}},[t]),fc(()=>{if(!t.hasNodes([Xg,Zg,Jg]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return Yg(t.registerCommand(yo,()=>{let a=i;if(!a)return!0;let p=a.getBoundingClientRect(),m=null;t.getEditorState().read(()=>{let f=qg();if(Qg(f)){s.current=f.clone();let g=f.anchor.getNode(),_=t.getElementByKey(g.getKey());if(_){let S=_.getBoundingClientRect();S.height>0&&(m={left:S.left-p.left,top:S.bottom-p.top+8})}}});let h=window.getSelection();if(h&&h.rangeCount>0){let g=h.getRangeAt(0).getBoundingClientRect();g.height>0&&(m={left:g.left-p.left,top:g.bottom-p.top+8})}return m||(m={left:0,top:40}),l(m),n(!0),!0},t2))},[e,t,i]);let u=mc(()=>{n(!1)},[]),c=mc((a,p)=>{n(!1),t.focus(),t.update(()=>{s.current&&e2(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(Kg,{columns:String(a),rows:String(p)})},1)},[t]);return Vg(hc.Fragment,{children:[qn(pc,{anchorElem:i,editor:t,isOpen:o,onClose:u,onInsert:c,position:r}),qn(zg,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var u2=$({markdownTransformers:[Da],nodes:[a2,s2,c2],plugins:[{Component:Cc,position:"normal"},{Component:qa,position:"normal"},{Component:Wa,position:"floatingAnchorElem"},{Component:sc,position:"floatingAnchorElem"}],providers:[xc],slashMenu:{groups:[X([{Icon:Bn,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(yo,{})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Bn,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(yo,{})}}])]}});import{$isNodeSelection as z2}from"lexical";import{jsx as bc}from"react/jsx-runtime";import"react";var d2="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",Qn=({className:t})=>bc("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:bc("path",{clipRule:"evenodd",d:d2,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Sc}from"react/jsx-runtime";import Ec from"bson-objectid";import{$applyNodeReplacement as x2}from"lexical";import*as Nc from"react";import p2 from"bson-objectid";function vo(t,e){if(t.hasAttribute("data-lexical-pending-upload-form-id")){let n=t.getAttribute("data-lexical-pending-upload-form-id");if(n!=null)return{node:e({data:{pending:{formID:n,src:t.getAttribute("src")||""}}})}}if(t.hasAttribute("data-lexical-upload-relation-to")&&t.hasAttribute("data-lexical-upload-id")){let n=t.getAttribute("data-lexical-upload-id"),r=t.getAttribute("data-lexical-upload-relation-to");if(n!=null&&r!=null)return{node:e({data:{fields:{},relationTo:r,value:n}})}}return{node:e({data:{pending:{formID:new p2.default().toHexString(),src:t.getAttribute("src")||""}}})}}import{DecoratorBlockNode as m2}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as f2}from"@lexical/utils";import _c from"bson-objectid";import{$applyNodeReplacement as h2}from"lexical";var Ut=class extends m2{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}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:o=>vo(o,kc),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new _c.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=kc({data:o});return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return f2(o,e?.theme?.upload),o}decorate(){return null}exportDOM(){let e=document.createElement("img"),o=this.__data;return o.pending?(e.setAttribute("data-lexical-pending-upload-form-id",String(o?.pending?.formID)),e.setAttribute("src",o?.pending?.src||"")):(e.setAttribute("data-lexical-upload-id",String(o?.value)),e.setAttribute("data-lexical-upload-relation-to",o?.relationTo)),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(e){let o=this.getWritable();o.__data=e}updateDOM(){return!1}};function kc({data:t}){return t?.id||(t.id=new _c.default().toHexString()),h2(new Ut({data:t}))}import{jsx as Tc}from"react/jsx-runtime";import{ShimmerEffect as g2}from"@payloadcms/ui";var wc=()=>Tc("div",{className:"lexical-upload",children:Tc(g2,{height:"95px",width:"203px"})});var C2=Nc.lazy(()=>import("./component-PHZQBOJE.js").then(t=>({default:t.UploadComponent}))),he=class extends Ut{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{img:e=>({conversion:o=>vo(o,ge),priority:0})}}static importJSON(e){e.version===1&&e?.value?.id&&(e.value=e.value.id),e.version===2&&!e?.id&&(e.id=new Ec.default().toHexString(),e.version=3);let o={id:e.id,fields:e.fields,pending:e.pending,relationTo:e.relationTo,value:e.value},n=ge({data:o});return n.setFormat(e.format),n}decorate(e,o){return this.__data.pending?Sc(wc,{}):Sc(C2,{className:o?.theme?.upload??"LexicalEditorTheme__upload",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function ge({data:t}){return t?.id||(t.id=new Ec.default().toHexString()),x2(new he({data:t}))}function ft(t){return t instanceof he}import{c as N2}from"react/compiler-runtime";import{jsx as L2}from"react/jsx-runtime";import{useLexicalComposerContext as y2}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as Fc,$insertNodeToNearestRoot as or,mergeRegister as v2}from"@lexical/utils";import{useBulkUpload as R2,useEffectEvent as I2,useModal as M2}from"@payloadcms/ui";import nr from"bson-objectid";import{$createRangeSelection as $2,$getPreviousSelection as Mc,$getSelection as $c,$isParagraphNode as rr,$isRangeSelection as Ac,$setSelection as A2,COMMAND_PRIORITY_EDITOR as D2,COMMAND_PRIORITY_LOW as Dc,createCommand as O2,DROP_COMMAND as F2,getDOMSelectionFromTarget as P2,isHTMLElement as Oc,PASTE_COMMAND as B2}from"lexical";import{useEffect as j2}from"react";import{c as Lc}from"react/compiler-runtime";import{jsx as er}from"react/jsx-runtime";import{useLexicalComposerContext as yc}from"@lexical/react/LexicalComposerContext.js";import{toast as b2}from"@payloadcms/ui";import{$getNodeByKey as k2,COMMAND_PRIORITY_EDITOR as vc}from"lexical";import{useEffect as Rc,useState as _2}from"react";var T2=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=k2(o);r&&r.replace(ge({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(tr,{fields:null,relationTo:e,value:n})},w2=t=>{let e=Lc(13),{enabledCollectionSlugs:o}=t,[n]=yc(),[r,l]=_2(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:d,openListDrawer:u}=Dt(s),c,a;e[2]!==n||e[3]!==u?(c=()=>n.registerCommand(et,f=>(l(f?.replace?f?.replace.nodeKey:null),u(),!0),vc),a=[n,u],e[2]=n,e[3]=u,e[4]=c,e[5]=a):(c=e[4],a=e[5]),Rc(c,a);let p;e[6]!==i||e[7]!==n||e[8]!==r?(p=f=>{let{collectionSlug:g,doc:_}=f;i(),T2({editor:n,relationTo:g,replaceNodeKey:r,value:_.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=p):p=e[9];let m=p,h;return e[10]!==d||e[11]!==m?(h=er(d,{onSelect:m}),e[10]=d,e[11]=m,e[12]=h):h=e[12],h},S2=()=>{let t=Lc(3),[e]=yc(),o,n;return t[0]!==e?(o=()=>e.registerCommand(et,E2,vc),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Rc(o,n),null},Ic=({enabledCollectionSlugs:t})=>t?.length?er(w2,{enabledCollectionSlugs:t}):er(S2,{});function E2(){return b2.error("No upload collections enabled"),!0}function H2(t){let e=t.target;return!!(Oc(e)&&!e.closest("code, span.editor-image")&&Oc(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function U2(t){let e,o=P2(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var tr=O2("INSERT_UPLOAD_COMMAND"),Pc=t=>{let e=N2(21),{clientProps:o}=t,[n]=y2(),r=o?.disabledCollections,l=o?.enabledCollections,s;e[0]!==r||e[1]!==l?(s={collectionSlugsBlacklist:r,collectionSlugsWhitelist:l,uploads:!0},e[0]=r,e[1]=l,e[2]=s):s=e[2];let{enabledCollectionSlugs:i}=fo(s),{drawerSlug:d,setCollectionSlug:u,setInitialForms:c,setOnCancel:a,setOnSuccess:p,setSelectableCollections:m}=R2(),{isModalOpen:h,openModal:f}=M2(),g;e[3]!==d||e[4]!==n||e[5]!==i||e[6]!==h||e[7]!==f||e[8]!==u||e[9]!==c||e[10]!==a||e[11]!==p||e[12]!==m?(g=x=>{let{files:C}=x;if(C?.length!==0&&(c(k=>[...k??[],...C.map(G2)]),!h(d))){if(!i.length||!i[0])return;u(i[0]),m(i),a(()=>{n.update(V2)}),p(k=>{let T=new Map(k.map(W2));n.update(()=>{for(let I of Fc()){let L=I.node;if(ft(L)){let E=L.getData();if(E?.pending){let N=T.get(E.pending?.formID);N&&L.replace(ge({data:{id:new nr.default().toHexString(),fields:{},relationTo:N.collectionSlug,value:N.doc.id}}))}}}})}),f(d)}},e[3]=d,e[4]=n,e[5]=i,e[6]=h,e[7]=f,e[8]=u,e[9]=c,e[10]=a,e[11]=p,e[12]=m,e[13]=g):g=e[13];let _=I2(g),S;e[14]!==n||e[15]!==_?(S=()=>{if(!n.hasNodes([he]))throw new Error("UploadPlugin: UploadNode not registered on editor");return v2(n.registerNodeTransform(he,x=>{let C=x.getData();if(!C?.pending)return;(async function(){let I=null,L=C?.pending?.src,E=C?.pending?.formID;if(L?.startsWith("data:")){let N=L.match(/data:(image\/[a-zA-Z]+);base64,/),w=N?N[1]:"image/png",v=L.replace(/^data:image\/[a-zA-Z]+;base64,/,""),y=atob(v),M=new Array(y.length);for(let F=0;F<y.length;F++)M[F]=y.charCodeAt(F);let A=new Uint8Array(M);I={alt:void 0,file:new File([A],"pasted-image."+w?.split("/",2)[1],{type:w}),formID:E}}else if(L?.startsWith("http")||L?.startsWith("https")){let w=await(await fetch(L)).blob(),v=L.split("/").pop()||"pasted-image"+w.type.split("/",2)[1];I={alt:void 0,file:new File([w],v,{type:w.type}),formID:E}}I&&_({files:[I]})})()}),n.registerCommand(tr,x=>(n.update(()=>{let C=$c()||Mc();if(Ac(C)){let k=ge({data:{id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}}),{focus:T}=C,I=T.getNode();or(k),rr(I)&&!I.__first&&I.remove()}}),!0),D2),n.registerCommand(B2,x=>{if(!(x instanceof ClipboardEvent))return!1;let C=x.clipboardData;if(!C?.types?.length||C?.types?.includes("text/html"))return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new nr.default().toHexString()})}),k.length?(n.update(()=>{let T=$c()||Mc();if(Ac(T))for(let I of k){let L=ge({data:{pending:{formID:I.formID,src:URL.createObjectURL(I.file)}}}),{focus:E}=T,N=E.getNode();or(L),rr(N)&&!N.__first&&N.remove()}}),_({files:k}),!0):!1},Dc),n.registerCommand(F2,x=>{if(!(x instanceof DragEvent))return!1;let C=x.dataTransfer;if(!C?.types?.length)return!1;let k=[];return C?.files?.length&&Array.from(C.files).forEach(T=>{k.push({alt:"",file:T,formID:new nr.default().toHexString()})}),k.length?(x.preventDefault(),x.stopPropagation(),n.update(()=>{if(H2(x)){let T=U2(x),I=$2();T!=null&&I.applyDOMRange(T),A2(I);for(let L of k){let E=ge({data:{pending:{formID:L.formID,src:URL.createObjectURL(L.file)}}}),{focus:N}=I,w=N.getNode();or(E),rr(w)&&!w.__first&&w.remove()}}}),_({files:k}),!0):!1},Dc))},e[14]=n,e[15]=_,e[16]=S):S=e[16];let R;e[17]!==n?(R=[n],e[17]=n,e[18]=R):R=e[18],j2(S,R);let b;return e[19]!==i?(b=L2(Ic,{enabledCollectionSlugs:i}),e[19]=i,e[20]=b):b=e[20],b};function G2(t){return{file:t.file,formID:t.formID}}function V2(){for(let t of Fc()){let e=t.node;ft(e)&&e.getData()?.pending&&e.remove()}}function W2(t){return[t.formID,t]}var K2=$({nodes:[he],plugins:[{Component:Pc,position:"normal"}],slashMenu:{groups:[X([{Icon:Qn,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]},toolbarFixed:{groups:[_e([{ChildComponent:Qn,isActive:({selection:t})=>{if(!z2(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return ft(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]}});import{jsx as lx}from"react/jsx-runtime";import{getFromImportMap as Uc}from"payload/shared";import{useMemo as ix}from"react";import{c as X2}from"react/compiler-runtime";import{jsx as Ro}from"react/jsx-runtime";import{createElement as Z2}from"react";import{ShimmerEffect as Y2,useConfig as q2}from"@payloadcms/ui";import{lazy as Q2,Suspense as ex,useEffect as tx,useState as ox}from"react";var Bc={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",root:"LexicalEditorTheme",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"};var lr={namespace:"lexical",theme:Bc};function jc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let c of l.features){if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null){console.warn("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. Skipping feature.");continue}s.set(c.clientFeatureProps.featureKey,c),i.push(c)}l.features=i,l.features=l.features.sort((c,a)=>c.clientFeatureProps.order-a.clientFeatureProps.order);let d=new Map,u=0;for(let c of l.features){let a=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:d,schemaPath:r,unSanitizedEditorConfig:l}):c.feature;a.key=c.clientFeatureProps.featureKey,a.order=u,d.set(c.clientFeatureProps.featureKey,a),u++}return d}import{deepMerge as J2}from"payload/shared";var Hc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?J2(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function ir(t,e,o,n){return{admin:o,features:Hc(t),lexical:e,resolvedFeatureMap:t,view:n}}var nx=Q2(()=>import("./Field-VW7ZGT6K.js").then(t=>({default:t.RichText}))),sr=t=>Ro(jo,{inheritable:!0,views:t.views,children:Ro(rx,{...t})}),rx=t=>{let e=X2(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:d,views:u}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let a=c,p;e[2]!==r?(p=r===void 0?{}:r,e[2]=r,e[3]=p):p=e[3];let m=p,h=i===void 0?lr:i,{currentView:f}=Ho(),g=u?.[f]?.admin??a,_=u?.[f]?.lexical,S;e[4]!==h||e[5]!==_?(S=typeof _=="function"?_(h):_??h,e[4]=h,e[5]=_,e[6]=S):S=e[6];let R=S,{config:b}=q2(),[x,C]=ox(null),k,T;e[7]!==n||e[8]!==b||e[9]!==f||e[10]!==g||e[11]!==R||e[12]!==m||e[13]!==l||e[14]!==s||e[15]!==x||e[16]!==d||e[17]!==u?(k=()=>{if(x&&x.view===f)return;let L=u?.[f],E=L?.filterFeatures?L.filterFeatures(n):n,N=[];for(let v of Object.values(E))!v.clientFeatureProvider||!v.clientFeatureProps||N.push(v.clientFeatureProvider(v.clientFeatureProps));let w=jc({config:b,featureClientImportMap:m,featureClientSchemaMap:l,field:s,schemaPath:d??s.name,unSanitizedEditorConfig:{features:N,lexical:R}});C(ir(w,R,g,f))},T=[g,n,b,m,l,s,x,R,d,f,u],e[7]=n,e[8]=b,e[9]=f,e[10]=g,e[11]=R,e[12]=m,e[13]=l,e[14]=s,e[15]=x,e[16]=d,e[17]=u,e[18]=k,e[19]=T):(k=e[18],T=e[19]),tx(k,T);let I;return e[20]!==x||e[21]!==t?(I=Ro(ex,{fallback:Ro(Y2,{height:"35vh"}),children:x&&Z2(nx,{...t,editorConfig:x,key:x.view})}),e[20]=x,e[21]=t,e[22]=I):I=e[22],I};var sx=t=>{let{featureClientSchemaMap:e={},features:o={},field:n,forceRender:r,importMap:l,path:s,permissions:i,readOnly:d,schemaPath:u}=t,{clientFeatures:c,featureClientImportMap:a}=ix(()=>{let p={},m={},h=Object.entries(o).sort(([,f],[,g])=>f.order-g.order);for(let[f,g]of h){if(p[f]={},g.ClientFeature){let _=Uc({importMap:l,PayloadComponent:g.ClientFeature,schemaPath:"lexical-clientComponent",silent:!0});if(_){let S={...g.clientFeatureProps??{},featureKey:g.key,order:g.order};typeof g.ClientFeature=="object"&&g.ClientFeature.clientProps&&(S.clientProps=g.ClientFeature.clientProps),p[f]={clientFeatureProps:S,clientFeatureProvider:_}}}if(g.componentImports&&typeof g.componentImports=="object")for(let[_,S]of Object.entries(g.componentImports)){let R=Uc({importMap:l,PayloadComponent:S,schemaPath:"lexical-clientComponent",silent:!0});R&&(m[`${f}.${_}`]=R)}}return{clientFeatures:p,featureClientImportMap:m}},[o,l]);return lx(sr,{clientFeatures:c,featureClientImportMap:a,featureClientSchemaMap:e,field:n,forceRender:r,path:s,permissions:i,readOnly:d,schemaPath:u})};function ax(t){return t instanceof HTMLElement}function cx(...t){return t.filter(Boolean).join(" ")}var Io=new WeakMap;function Gc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function Mo(t,e){let o=Io.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Gc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let d=Gc(s);for(let u of n)d!==null&&u([d[0]-i[0],d[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},Io.set(t,o)}return o.listeners.add(e),()=>{ux(t,e)}}function ux(t,e){let o=Io.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(Io.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function dx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function px(t,e){return Mo(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function mx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function fx(t,e){return Mo(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as hx}from"react/compiler-runtime";import{jsx as gx}from"react/jsx-runtime";import"react";var xx=()=>{let t=hx(2),{EditButton:e}=be(),o;return t[0]!==e?(o=e?gx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Cx}from"react/compiler-runtime";import{jsx as bx}from"react/jsx-runtime";import"react";var kx=()=>{let t=Cx(2),{RemoveButton:e}=be(),o;return t[0]!==e?(o=e?bx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as _x}from"react/compiler-runtime";import{jsx as Tx}from"react/jsx-runtime";import"react";var wx=()=>{let t=_x(2),{Label:e}=be(),o;return t[0]!==e?(o=e?Tx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Sx}from"react/compiler-runtime";import{jsx as Ex}from"react/jsx-runtime";import"react";var Nx=t=>{let e=Sx(3),{children:o}=t,{InlineBlockContainer:n}=be(),r;return e[0]!==n||e[1]!==o?(r=n?Ex(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as Lx}from"react/jsx-runtime";import"react";var yx=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?Lx(n,{...o,children:e}):null};import{c as vx}from"react/compiler-runtime";import{jsx as Rx}from"react/jsx-runtime";import"react";var Ix=()=>{let t=vx(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?Rx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Mx}from"react/compiler-runtime";import{jsx as $x}from"react/jsx-runtime";import"react";var Ax=()=>{let t=Mx(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?$x(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as Dx}from"qs-esm";var Ox=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let d=Dx({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${d}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(c=>c.json())};var Vc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
61
61
  `)&&!t.language?.length?"```"+t.code+"```":"```"+(t.language||"")+(t.code?`
62
62
  `+t.code:"")+"\n```",import:({children:t,closeMatch:e,openMatch:o})=>{let n=o?.[1];return t.startsWith(`
63
63
  `)&&(t=t.slice(1)),t.endsWith(`
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","React","useMemo","baseClass","useTranslation","useEditorConfigContext","DropDown","DropDownItem","ToolbarItem","t0","$","active","anchorElem","editor","enabled","iconOnly","item","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","Component","t2","_jsx","key","title","croppedTitle","label","length","substring","Icon","ChildComponent","undefined","itemKey","tooltip","children","className","MemoToolbarItem","memo","ToolbarDropdown","classNames","group","groupState","itemsContainerClassNames","items","groupKey","renderedItems","map","activeItemKeys","includes","enabledItemKeys","buttonAriaLabel","buttonClassName","filter","Boolean","join","disabled","enabledGroup","dropdownKey"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React, { useMemo } from 'react'\n\nconst baseClass = 'toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { ToolbarDropdownGroup, ToolbarGroupItem } from '../../types.js'\nimport type { ToolbarGroupState } from '../useToolbarStates.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.css'\nimport { DropDown, DropDownItem } from './DropDown.js'\n\nconst ToolbarItem = ({\n active,\n anchorElem,\n editor,\n enabled,\n iconOnly,\n item,\n}: {\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n iconOnly?: boolean\n item: ToolbarGroupItem\n}) => {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component\n active={active}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabled}\n item={item}\n key={item.key}\n />\n )\n )\n }\n\n let title = item.key\n let croppedTitle = item.key\n if (item.label) {\n title =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (title.length > 25) {\n croppedTitle = title.substring(0, 25) + '...'\n } else {\n croppedTitle = title\n }\n\n return (\n <DropDownItem\n active={active}\n editor={editor}\n enabled={enabled}\n Icon={item?.ChildComponent ? <item.ChildComponent /> : undefined}\n item={item}\n itemKey={item.key}\n key={item.key}\n tooltip={iconOnly ? title : undefined}\n >\n <span className=\"text\">{croppedTitle}</span>\n </DropDownItem>\n )\n}\n\nconst MemoToolbarItem = React.memo(ToolbarItem)\n\nexport const ToolbarDropdown = ({\n anchorElem,\n classNames,\n editor,\n group,\n groupState,\n Icon,\n itemsContainerClassNames,\n label,\n}: {\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n group: ToolbarDropdownGroup\n groupState: ToolbarGroupState\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n}) => {\n const { items, key: groupKey } = group\n\n const renderedItems = useMemo(() => {\n return items?.length\n ? items.map((item) => (\n <MemoToolbarItem\n active={groupState.activeItemKeys.includes(item.key)}\n anchorElem={anchorElem}\n editor={editor}\n enabled={groupState.enabledItemKeys.includes(item.key)}\n iconOnly={group.iconOnly}\n item={item}\n key={item.key}\n />\n ))\n : null\n }, [items, groupState.activeItemKeys, groupState.enabledItemKeys, anchorElem, editor])\n\n return (\n <DropDown\n buttonAriaLabel={`${groupKey} dropdown`}\n buttonClassName={[baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n disabled={!groupState.enabledGroup}\n dropdownKey={groupKey}\n Icon={Icon}\n itemsContainerClassNames={[`${baseClass}-items`, ...(itemsContainerClassNames || [])]}\n key={groupKey}\n label={label}\n >\n {renderedItems}\n </DropDown>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,MAAMC,SAAA,GAAY;AAIlB,SAASC,cAAc,QAAQ;AAK/B,SAASC,sBAAsB,QAAQ;AACvC,OAAO;AACP,SAASC,QAAQ,EAAEC,YAAY,QAAQ;AAEvC,MAAMC,WAAA,GAAcC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW,MAAA;IAAAC,UAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAP,EAcpB;EACC;IAAAQ;EAAA,IAAiBb,cAAA;EACjB;IAAAc,UAAA,EAAAC;EAAA,IAEId,sBAAA;EADU;IAAAe,sBAAA;IAAAC;EAAA,IAAAF,EAAsC;EAAA,IAGhDH,IAAA,CAAAM,SAAA;IAAA,IAAAC,EAAA;IAAA,IAAAb,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAE,UAAA,IAAAF,CAAA,QAAAG,MAAA,IAAAH,CAAA,QAAAI,OAAA,IAAAJ,CAAA,QAAAM,IAAA;MAEAO,EAAA,GAAAP,IAAA,EAAAM,SAAA,IACEE,IAAA,CAACR,IAAA,CAAAM,SAAA;QAAAX,MAAA;QAAAC,UAAA;QAAAC,MAAA;QAAAC,OAAA;QAAAE;MAAA,GAMMA,IAAA,CAAAS,GAAQ;MAAAf,CAAA,MAAAC,MAAA;MAAAD,CAAA,MAAAE,UAAA;MAAAF,CAAA,MAAAG,MAAA;MAAAH,CAAA,MAAAI,OAAA;MAAAJ,CAAA,MAAAM,IAAA;MAAAN,CAAA,MAAAa,EAAA;IAAA;MAAAA,EAAA,GAAAb,CAAA;IAAA;IAAA,OAPjBa,EAOiB;EAAA;EAAA,IAAAA,EAAA;EAAA,IAAAb,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAG,MAAA,IAAAH,CAAA,QAAAI,OAAA,IAAAJ,CAAA,QAAAU,sBAAA,IAAAV,CAAA,SAAAO,IAAA,IAAAP,CAAA,SAAAK,QAAA,IAAAL,CAAA,SAAAM,IAAA,IAAAN,CAAA,SAAAW,UAAA;IAMrB,IAAAK,KAAA,GAAYV,IAAA,CAAAS,GAAA;IACZ,IAAAE,YAAA;IAA2B,IACvBX,IAAA,CAAAY,KAAA;MACFF,KAAA,CAAAA,CAAA,CACEA,MAAA,CAAOV,IAAA,CAAAY,KAAA,KAAe,aAClBZ,IAAA,CAAAY,KAAA;QAAAR,sBAAA;QAAAH,IAAA;QAAAI;MAAA,CAAsD,IACtDL,IAAA,CAAAY,KAAU;IAHhB;IAAA,IAKEF,KAAA,CAAAG,MAAA,KAAe;MACjBF,YAAA,CAAAA,CAAA,CAAeD,KAAA,CAAAI,SAAA,MAAmB,IAAM;IAAxC;MAEAH,YAAA,CAAAA,CAAA,CAAeD,KAAA;IAAf;IAIAH,EAAA,GAAAC,IAAA,CAAAjB,YAAA;MAAAI,MAAA;MAAAE,MAAA;MAAAC,OAAA;MAAAiB,IAAA,EAIQf,IAAA,EAAAgB,cAAA,GAAuBR,IAAA,CAACR,IAAA,CAAAgB,cAAA,IAAmB,IAAAC,SAAM;MAAAjB,IAAA;MAAAkB,OAAA,EAE9ClB,IAAA,CAAAS,GAAA;MAAAU,OAAA,EAEApB,QAAA,GAAWW,KAAA,GAAAO,SAAQ;MAAAG,QAAA,EAE5BZ,IAAA,CAAC;QAAAa,SAAA,EAAe;QAAAD,QAAA,EAAQT;MAAA,C;OAHnBX,IAAA,CAAAS,GAAQ;IAAAf,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAG,MAAA;IAAAH,CAAA,MAAAI,OAAA;IAAAJ,CAAA,MAAAU,sBAAA;IAAAV,CAAA,OAAAO,IAAA;IAAAP,CAAA,OAAAK,QAAA;IAAAL,CAAA,OAAAM,IAAA;IAAAN,CAAA,OAAAW,UAAA;IAAAX,CAAA,OAAAa,EAAA;EAAA;IAAAA,EAAA,GAAAb,CAAA;EAAA;EAAA,OAPfa,EAOe;AAAA,CAMnB;AAEA,MAAMe,eAAA,gBAAkBrC,KAAA,CAAMsC,IAAI,CAAC/B,WAAA;AAEnC,OAAO,MAAMgC,eAAA,GAAkBA,CAAC;EAC9B5B,UAAU;EACV6B,UAAU;EACV5B,MAAM;EACN6B,KAAK;EACLC,UAAU;EACVZ,IAAI;EACJa,wBAAwB;EACxBhB;AAAK,CAUN;EACC,MAAM;IAAEiB,KAAK;IAAEpB,GAAA,EAAKqB;EAAQ,CAAE,GAAGJ,KAAA;EAEjC,MAAMK,aAAA,GAAgB7C,OAAA,CAAQ;IAC5B,OAAO2C,KAAA,EAAOhB,MAAA,GACVgB,KAAA,CAAMG,GAAG,CAAEhC,IAAA,iBACTQ,IAAA,CAACc,eAAA;MACC3B,MAAA,EAAQgC,UAAA,CAAWM,cAAc,CAACC,QAAQ,CAAClC,IAAA,CAAKS,GAAG;MACnDb,UAAA,EAAYA,UAAA;MACZC,MAAA,EAAQA,MAAA;MACRC,OAAA,EAAS6B,UAAA,CAAWQ,eAAe,CAACD,QAAQ,CAAClC,IAAA,CAAKS,GAAG;MACrDV,QAAA,EAAU2B,KAAA,CAAM3B,QAAQ;MACxBC,IAAA,EAAMA;OACDA,IAAA,CAAKS,GAAG,KAGjB;EACN,GAAG,CAACoB,KAAA,EAAOF,UAAA,CAAWM,cAAc,EAAEN,UAAA,CAAWQ,eAAe,EAAEvC,UAAA,EAAYC,MAAA,CAAO;EAErF,oBACEW,IAAA,CAAClB,QAAA;IACC8C,eAAA,EAAiB,GAAGN,QAAA,WAAmB;IACvCO,eAAA,EAAiB,CAAClD,SAAA,EAAW,GAAGA,SAAA,IAAa2C,QAAA,EAAU,E,IAAML,UAAA,IAAc,EAAE,EAAE,CAC5Ea,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;IACRC,QAAA,EAAU,CAACd,UAAA,CAAWe,YAAY;IAClCC,WAAA,EAAab,QAAA;IACbf,IAAA,EAAMA,IAAA;IACNa,wBAAA,EAA0B,CAAC,GAAGzC,SAAA,QAAiB,E,IAAMyC,wBAAA,IAA4B,EAAE,EAAE;IAErFhB,KAAA,EAAOA,KAAA;cAENmB;KAHID,QAAA;AAMX","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","React","useMemo","baseClass","useTranslation","useEditorConfigContext","DropDown","DropDownItem","ToolbarItem","t0","$","active","anchorElem","editor","enabled","iconOnly","item","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","Component","t2","_jsx","title","key","croppedTitle","label","length","substring","Icon","ChildComponent","undefined","itemKey","tooltip","children","className","MemoToolbarItem","memo","ToolbarDropdown","classNames","group","groupState","itemsContainerClassNames","items","groupKey","renderedItems","map","activeItemKeys","includes","enabledItemKeys","buttonAriaLabel","buttonClassName","filter","Boolean","join","disabled","enabledGroup","dropdownKey"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React, { useMemo } from 'react'\n\nconst baseClass = 'toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { ToolbarDropdownGroup, ToolbarGroupItem } from '../../types.js'\nimport type { ToolbarGroupState } from '../useToolbarStates.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.css'\nimport { DropDown, DropDownItem } from './DropDown.js'\n\nconst ToolbarItem = ({\n active,\n anchorElem,\n editor,\n enabled,\n iconOnly,\n item,\n}: {\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n iconOnly?: boolean\n item: ToolbarGroupItem\n}) => {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component\n active={active}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabled}\n item={item}\n key={item.key}\n />\n )\n )\n }\n\n let title = item.key\n let croppedTitle = item.key\n if (item.label) {\n title =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (title.length > 25) {\n croppedTitle = title.substring(0, 25) + '...'\n } else {\n croppedTitle = title\n }\n\n return (\n <DropDownItem\n active={active}\n editor={editor}\n enabled={enabled}\n Icon={item?.ChildComponent ? <item.ChildComponent /> : undefined}\n item={item}\n itemKey={item.key}\n key={item.key}\n tooltip={iconOnly ? title : undefined}\n >\n <span className=\"text\">{croppedTitle}</span>\n </DropDownItem>\n )\n}\n\nconst MemoToolbarItem = React.memo(ToolbarItem)\n\nexport const ToolbarDropdown = ({\n anchorElem,\n classNames,\n editor,\n group,\n groupState,\n Icon,\n itemsContainerClassNames,\n label,\n}: {\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n group: ToolbarDropdownGroup\n groupState: ToolbarGroupState\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n}) => {\n const { items, key: groupKey } = group\n\n const renderedItems = useMemo(() => {\n return items?.length\n ? items.map((item) => (\n <MemoToolbarItem\n active={groupState.activeItemKeys.includes(item.key)}\n anchorElem={anchorElem}\n editor={editor}\n enabled={groupState.enabledItemKeys.includes(item.key)}\n iconOnly={group.iconOnly}\n item={item}\n key={item.key}\n />\n ))\n : null\n }, [items, groupState.activeItemKeys, groupState.enabledItemKeys, anchorElem, editor])\n\n return (\n <DropDown\n buttonAriaLabel={`${groupKey} dropdown`}\n buttonClassName={[baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n disabled={!groupState.enabledGroup}\n dropdownKey={groupKey}\n Icon={Icon}\n itemsContainerClassNames={[`${baseClass}-items`, ...(itemsContainerClassNames || [])]}\n key={groupKey}\n label={label}\n >\n {renderedItems}\n </DropDown>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,MAAMC,SAAA,GAAY;AAIlB,SAASC,cAAc,QAAQ;AAK/B,SAASC,sBAAsB,QAAQ;AACvC,OAAO;AACP,SAASC,QAAQ,EAAEC,YAAY,QAAQ;AAEvC,MAAMC,WAAA,GAAcC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW,MAAA;IAAAC,UAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAP,EAcpB;EACC;IAAAQ;EAAA,IAAiBb,cAAA;EACjB;IAAAc,UAAA,EAAAC;EAAA,IAEId,sBAAA;EADU;IAAAe,sBAAA;IAAAC;EAAA,IAAAF,EAAsC;EAAA,IAGhDH,IAAA,CAAAM,SAAA;IAAA,IAAAC,EAAA;IAAA,IAAAb,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAE,UAAA,IAAAF,CAAA,QAAAG,MAAA,IAAAH,CAAA,QAAAI,OAAA,IAAAJ,CAAA,QAAAM,IAAA;MAEAO,EAAA,GAAAP,IAAA,EAAAM,SAAA,IACEE,IAAA,CAACR,IAAA,CAAAM,SAAA;QAAAX,MAAA;QAAAC,UAAA;QAAAC,MAAA;QAAAC,OAAA;QAAAE;MAAA,GAMMA,IAAA,CAAAA,GAAQ;MAAAN,CAAA,MAAAC,MAAA;MAAAD,CAAA,MAAAE,UAAA;MAAAF,CAAA,MAAAG,MAAA;MAAAH,CAAA,MAAAI,OAAA;MAAAJ,CAAA,MAAAM,IAAA;MAAAN,CAAA,MAAAa,EAAA;IAAA;MAAAA,EAAA,GAAAb,CAAA;IAAA;IAAA,OAPjBa,EAOiB;EAAA;EAAA,IAAAA,EAAA;EAAA,IAAAb,CAAA,QAAAC,MAAA,IAAAD,CAAA,QAAAG,MAAA,IAAAH,CAAA,QAAAI,OAAA,IAAAJ,CAAA,QAAAU,sBAAA,IAAAV,CAAA,SAAAO,IAAA,IAAAP,CAAA,SAAAK,QAAA,IAAAL,CAAA,SAAAM,IAAA,IAAAN,CAAA,SAAAW,UAAA;IAMrB,IAAAI,KAAA,GAAYT,IAAA,CAAAU,GAAA;IACZ,IAAAC,YAAA;IAA2B,IACvBX,IAAA,CAAAY,KAAA;MACFH,KAAA,CAAAA,CAAA,CACEA,MAAA,CAAOT,IAAA,CAAAY,KAAA,KAAe,aAClBZ,IAAA,CAAAY,KAAA;QAAAR,sBAAA;QAAAH,IAAA;QAAAI;MAAA,CAAsD,IACtDL,IAAA,CAAAY,KAAU;IAHhB;IAAA,IAKEH,KAAA,CAAAI,MAAA,KAAe;MACjBF,YAAA,CAAAA,CAAA,CAAeF,KAAA,CAAAK,SAAA,MAAmB,IAAM;IAAxC;MAEAH,YAAA,CAAAA,CAAA,CAAeF,KAAA;IAAf;IAIAF,EAAA,GAAAC,IAAA,CAAAjB,YAAA;MAAAI,MAAA;MAAAE,MAAA;MAAAC,OAAA;MAAAiB,IAAA,EAIQf,IAAA,EAAAgB,cAAA,GAAuBR,IAAA,CAACR,IAAA,CAAAgB,cAAA,IAAmB,IAAAC,SAAM;MAAAjB,IAAA;MAAAkB,OAAA,EAE9ClB,IAAA,CAAAU,GAAA;MAAAS,OAAA,EAEApB,QAAA,GAAWU,KAAA,GAAAQ,SAAQ;MAAAG,QAAA,EAE5BZ,IAAA,CAAC;QAAAa,SAAA,EAAe;QAAAD,QAAA,EAAQT;MAAA,C;OAHnBX,IAAA,CAAAA,GAAQ;IAAAN,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAG,MAAA;IAAAH,CAAA,MAAAI,OAAA;IAAAJ,CAAA,MAAAU,sBAAA;IAAAV,CAAA,OAAAO,IAAA;IAAAP,CAAA,OAAAK,QAAA;IAAAL,CAAA,OAAAM,IAAA;IAAAN,CAAA,OAAAW,UAAA;IAAAX,CAAA,OAAAa,EAAA;EAAA;IAAAA,EAAA,GAAAb,CAAA;EAAA;EAAA,OAPfa,EAOe;AAAA,CAMnB;AAEA,MAAMe,eAAA,gBAAkBrC,KAAA,CAAMsC,IAAI,CAAC/B,WAAA;AAEnC,OAAO,MAAMgC,eAAA,GAAkBA,CAAC;EAC9B5B,UAAU;EACV6B,UAAU;EACV5B,MAAM;EACN6B,KAAK;EACLC,UAAU;EACVZ,IAAI;EACJa,wBAAwB;EACxBhB;AAAK,CAUN;EACC,MAAM;IAAEiB,KAAK;IAAEnB,GAAA,EAAKoB;EAAQ,CAAE,GAAGJ,KAAA;EAEjC,MAAMK,aAAA,GAAgB7C,OAAA,CAAQ;IAC5B,OAAO2C,KAAA,EAAOhB,MAAA,GACVgB,KAAA,CAAMG,GAAG,CAAEhC,IAAA,iBACTQ,IAAA,CAACc,eAAA;MACC3B,MAAA,EAAQgC,UAAA,CAAWM,cAAc,CAACC,QAAQ,CAAClC,IAAA,CAAKU,GAAG;MACnDd,UAAA,EAAYA,UAAA;MACZC,MAAA,EAAQA,MAAA;MACRC,OAAA,EAAS6B,UAAA,CAAWQ,eAAe,CAACD,QAAQ,CAAClC,IAAA,CAAKU,GAAG;MACrDX,QAAA,EAAU2B,KAAA,CAAM3B,QAAQ;MACxBC,IAAA,EAAMA;OACDA,IAAA,CAAKU,GAAG,KAGjB;EACN,GAAG,CAACmB,KAAA,EAAOF,UAAA,CAAWM,cAAc,EAAEN,UAAA,CAAWQ,eAAe,EAAEvC,UAAA,EAAYC,MAAA,CAAO;EAErF,oBACEW,IAAA,CAAClB,QAAA;IACC8C,eAAA,EAAiB,GAAGN,QAAA,WAAmB;IACvCO,eAAA,EAAiB,CAAClD,SAAA,EAAW,GAAGA,SAAA,IAAa2C,QAAA,EAAU,E,IAAML,UAAA,IAAc,EAAE,EAAE,CAC5Ea,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;IACRC,QAAA,EAAU,CAACd,UAAA,CAAWe,YAAY;IAClCC,WAAA,EAAab,QAAA;IACbf,IAAA,EAAMA,IAAA;IACNa,wBAAA,EAA0B,CAAC,GAAGzC,SAAA,QAAiB,E,IAAMyC,wBAAA,IAA4B,EAAE,EAAE;IAErFhB,KAAA,EAAOA,KAAA;cAENmB;KAHID,QAAA;AAMX","ignoreList":[]}