rj-editor 1.1.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -5
- package/dist/components/RJTextEditor.d.ts +2 -1
- package/dist/components/global/spin-indicator/SpinIndicator.d.ts +6 -0
- package/dist/components/rj-text-editor/ImageUploadContext.d.ts +8 -0
- package/dist/components/rj-text-editor/RJEditorImageUploadContext.d.ts +4 -0
- package/dist/components/rj-text-editor/RJTextEditor.types.d.ts +7 -1
- package/dist/components/rj-text-editor/RJTextEditorContent.d.ts +6 -1
- package/dist/components/rj-text-editor/createInitialConfig.d.ts +1 -1
- package/dist/components/rj-text-editor/footer/EditorFooter.d.ts +13 -0
- package/dist/components/rj-text-editor/footer/index.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/rj-editor.css +1 -1
- package/dist/rj-editor.js +4482 -1836
- package/dist/rj-editor.umd.cjs +57 -2
- package/dist/types/RJEditorFooterItem.d.ts +1 -0
- package/dist/types/RJEditorFooterStats.d.ts +11 -0
- package/dist/types/RJEditorTranslations.d.ts +12 -0
- package/dist/types/RJTextEditorFooterRender.d.ts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/utils/helpers/countTextCharacters.d.ts +1 -0
- package/dist/utils/helpers/countTextWords.d.ts +1 -0
- package/dist/utils/helpers/index.d.ts +2 -0
- package/package.json +3 -3
package/dist/rj-editor.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const RJ_EDITOR_STYLE_ID = "rj-editor-style";
|
|
2
|
-
const RJ_EDITOR_CSS = ":root{--rj-color-text:#111827;--rj-color-muted:#526070;--rj-color-subtle:#8a94a6;--rj-color-page-bg:#f5f7fb;--rj-color-surface:#fff;--rj-color-surface-soft:#f8fafc;--rj-color-border:#d9dde5;--rj-color-brand:#3167c8;--rj-color-brand-strong:#1f4f9a;--rj-color-brand-soft:#eef4ff;--rj-color-brand-tint:#eaf2ff;--rj-color-link:#2563eb;--rj-color-focus:#7aa7f7;--rj-color-table-border:#cbd5e1;--rj-color-table-header-bg:#f1f5f9;--rj-color-image-border:#94a3b8;--rj-shadow-image:0 .875rem 2rem #0f172a2e;--rj-color-inline-code-bg:#2a2828;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff24;--rj-color-code-bg:#0b0c0e;--rj-color-code-header-bg:#111214;--rj-color-code-border:#34363a;--rj-color-code-text:#ededed;--rj-color-code-muted:#a1a1aa;--rj-color-code-keyword:#c678dd;--rj-color-code-string:#98c379;--rj-color-code-number:#d19a66;--rj-color-code-comment:#7f848e;--rj-color-code-function:#61afef;--rj-color-code-operator:#56b6c2;--rj-color-code-tag:#e06c75;--rj-color-danger:#dc2626;--rj-color-danger-soft:#fce1e13f;--rj-color-danger-border:#fca5a5;--rj-color-inverse-bg:#101827;--rj-color-inverse-text:#dbeafe;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#7aa7f738;--rj-editor-floating-shadow:0 .75rem 1.75rem #0f172a24;--rj-editor-modal-overlay:#0f172a6b;--rj-editor-modal-shadow:0 1.5rem 4rem #0f172a38;color:var(--rj-color-text);background:var(--rj-color-page-bg);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:1rem;line-height:1.5}[data-rj-editor-theme=light]{--rj-color-text:#111827;--rj-color-muted:#526070;--rj-color-subtle:#8a94a6;--rj-color-page-bg:#f5f7fb;--rj-color-surface:#fff;--rj-color-surface-soft:#f8fafc;--rj-color-border:#d9dde5;--rj-color-brand:#3167c8;--rj-color-brand-strong:#1f4f9a;--rj-color-brand-soft:#eef4ff;--rj-color-brand-tint:#eaf2ff;--rj-color-link:#2563eb;--rj-color-focus:#7aa7f7;--rj-color-table-border:#cbd5e1;--rj-color-table-header-bg:#f1f5f9;--rj-color-image-border:#94a3b8;--rj-shadow-image:0 .875rem 2rem #0f172a2e;--rj-color-inline-code-bg:#2a2828;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff24;--rj-color-code-bg:#0b0c0e;--rj-color-code-header-bg:#111214;--rj-color-code-border:#34363a;--rj-color-code-text:#ededed;--rj-color-code-muted:#a1a1aa;--rj-color-code-keyword:#c678dd;--rj-color-code-string:#98c379;--rj-color-code-number:#d19a66;--rj-color-code-comment:#7f848e;--rj-color-code-function:#61afef;--rj-color-code-operator:#56b6c2;--rj-color-code-tag:#e06c75;--rj-color-danger:#dc2626;--rj-color-danger-soft:#fce1e13f;--rj-color-danger-border:#fca5a5;--rj-color-inverse-bg:#101827;--rj-color-inverse-text:#dbeafe;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#7aa7f738;--rj-editor-floating-shadow:0 .75rem 1.75rem #0f172a24;--rj-editor-modal-overlay:#0f172a6b;--rj-editor-modal-shadow:0 1.5rem 4rem #0f172a38;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-rj-editor-theme=dark]{--rj-color-text:#ededed;--rj-color-muted:#b0b0b0;--rj-color-subtle:#898989;--rj-color-page-bg:#151515;--rj-color-surface:#1b1b1b;--rj-color-surface-soft:#232323;--rj-color-border:#414141;--rj-color-brand:#b8b8b8;--rj-color-brand-strong:#d4d4d4;--rj-color-brand-soft:#292929;--rj-color-brand-tint:#303030;--rj-color-link:#d0d0d0;--rj-color-focus:#a8a8a8;--rj-color-table-border:#484848;--rj-color-table-header-bg:#292929;--rj-color-image-border:#686868;--rj-shadow-image:0 .875rem 2rem #00000061;--rj-color-inline-code-bg:#101010;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff29;--rj-color-code-bg:#0b0b0b;--rj-color-code-header-bg:#141414;--rj-color-code-border:#404040;--rj-color-code-text:#ededed;--rj-color-code-muted:#949494;--rj-color-code-keyword:#d7d7d7;--rj-color-code-string:#b8b8b8;--rj-color-code-number:#c9c9c9;--rj-color-code-comment:#777;--rj-color-code-function:#e1e1e1;--rj-color-code-operator:#a6a6a6;--rj-color-code-tag:#c2c2c2;--rj-color-danger:#f87171;--rj-color-danger-soft:#f871711f;--rj-color-danger-border:#985050;--rj-color-inverse-bg:#ededed;--rj-color-inverse-text:#1b1b1b;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#bebebe33;--rj-editor-floating-shadow:0 .75rem 1.75rem #00000061;--rj-editor-modal-overlay:#00000094;--rj-editor-modal-shadow:0 1.5rem 4rem #0000007a;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}._wrapper_se0k7_1{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.375rem;align-items:center;gap:.125rem;width:100%;height:2.125rem;padding:0 .5rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1;display:inline-flex}._wrapper_se0k7_1:focus-within{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .125rem #7aa7f72e}._wrapper_se0k7_1._disabled_se0k7_23{cursor:not-allowed;opacity:.55}._affix_se0k7_28{color:var(--rj-editor-muted-text,#526070);cursor:text;font:inherit;-webkit-user-select:none;user-select:none;flex:none}._affix_se0k7_28 svg{width:1rem!important;height:1rem!important}._affix_se0k7_28 svg path{stroke:var(--rj-editor-muted-text,#526070)}._input_se0k7_43{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.375rem;outline:none;width:100%;height:2.125rem;padding:0 .5rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1}._inputAffix_se0k7_58{box-shadow:none;background:0 0;border:0;border-radius:0;flex:auto;width:100%;min-width:0;height:100%;padding:0}._input_se0k7_43:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .125rem #7aa7f72e}._inputAffix_se0k7_58:focus{box-shadow:none;border-color:#0000}._input_se0k7_43:disabled{cursor:not-allowed;opacity:.55}._overlay_qjax1_1{background:var(--rj-editor-modal-overlay,#0f172a6b);z-index:1200;justify-content:center;align-items:center;padding:1.5rem;display:flex;position:fixed;inset:0}._modal_qjax1_12{background:var(--rj-editor-bg,#fff);box-shadow:var(--rj-editor-modal-shadow,0 1.5rem 4rem #0f172a38);color:var(--rj-editor-text,#111827);min-width:min(26.25rem,100vw - 3rem);max-width:calc(100vw - 3rem);max-height:min(45rem,100vh - 3rem);width:var(--rj-modal-width,26.25rem);border-radius:.5rem;overflow:hidden}._header_qjax1_24{border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:move;-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;padding:.875rem 1.125rem;display:flex}._title_qjax1_34{margin:0;font-family:system-ui,sans-serif;font-size:1rem;font-weight:700;line-height:1.3}._closeButton_qjax1_42{color:var(--rj-editor-muted-text,#526070);cursor:pointer;cursor:pointer;background:0 0;border:0;border-radius:.375rem;justify-content:center;align-items:center;width:1.875rem;height:1.875rem;padding:0;display:inline-flex}._closeButton_qjax1_42:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);color:var(--rj-editor-text,#111827)}._body_qjax1_65{max-height:calc(100vh - 11.375rem);padding:1.125rem;overflow:auto}._footer_qjax1_71{border-top:.0625rem solid var(--rj-editor-border,#d9dde5);justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1.125rem;display:flex}._button_qjax1_80{border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.5rem;justify-content:center;align-items:center;min-width:4.75rem;height:2.125rem;padding:0 .875rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1;display:inline-flex}._cancelButton_qjax1_96{background:var(--rj-editor-toolbar-button-bg,#fff);color:var(--rj-editor-text,#111827)}._cancelButton_qjax1_96:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}._okButton_qjax1_106{background:var(--rj-color-brand,#3167c8);border-color:var(--rj-color-brand,#3167c8);color:var(--rj-color-white,#fff)}._okButton_qjax1_106:hover{background:var(--rj-color-brand-strong,#1f4f9a);border-color:var(--rj-color-brand-strong,#1f4f9a)}._button_qjax1_80:disabled{cursor:not-allowed;opacity:.5}.rj-editor-image-border-radius-input{width:4.375rem}.rj-editor-image-edit-form{gap:.5rem;display:grid}.rj-editor-image-edit-form label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-image-edit-form input,.rj-editor-image-edit-form textarea{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;width:100%;padding:.5625rem .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-image-edit-form input{height:2.375rem}.rj-editor-image-edit-form textarea{resize:vertical;min-height:6rem}.rj-editor-image-edit-form input:focus,.rj-editor-image-edit-form textarea:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-link-form{gap:.75rem;display:grid}.rj-editor-link-field{gap:.375rem;display:grid}.rj-editor-link-field label,.rj-editor-link-checkbox{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-link-field input{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;height:2.25rem;padding:0 .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-link-field input:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-link-checkbox{align-items:center;gap:.5rem;width:fit-content;display:inline-flex}.rj-editor-link-checkbox input{accent-color:var(--rj-color-brand,#3167c8);width:1rem;height:1rem}.rj-editor-youtube-form{gap:.75rem;display:grid}.rj-editor-youtube-field{gap:.375rem;display:grid}.rj-editor-youtube-field label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-youtube-field input{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;width:100%;height:2.375rem;padding:.5625rem .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-youtube-field input:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-youtube-error{color:var(--rj-editor-danger,#dc2626);margin:0;font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.35}.rj-editor-toolbar{background:var(--rj-editor-toolbar-bg,#f8fafc);border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);flex-direction:column;display:flex}.rj-editor-toolbar-tabs{border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);justify-content:space-between;align-items:center;gap:.25rem;padding:.375rem .5rem;display:flex}.rj-editor-toolbar-tabs-list{flex-wrap:wrap;align-items:center;gap:.25rem;display:flex}.rj-editor-toolbar-tabs-list button{background:0 0;border:.0625rem solid #0000;border-bottom:0;border-radius:.5rem .5rem 0 0;min-width:auto;height:2rem;padding:0 .875rem}.rj-editor-toolbar-tabs-list button:hover,.rj-editor-toolbar-tabs-list button.is-active{background:var(--rj-editor-toolbar-button-bg,#fff);border-color:var(--rj-editor-border,#d9dde5)}.rj-editor-toolbar-fullscreen{flex:none}.rj-editor-toolbar-panel{flex-wrap:wrap;align-items:center;gap:.375rem;min-height:3.125rem;padding:.5rem;display:flex}.rj-editor-toolbar-panel--home,.rj-editor-toolbar-panel--image{flex-flow:column;align-items:stretch;gap:.5rem}.rj-editor-toolbar-row{flex-wrap:wrap;flex:none;align-items:center;gap:.375rem;padding-bottom:.0625rem;display:flex}.rj-editor-equation-toolbar{flex-flow:wrap;align-items:stretch}.rj-editor-equation-ribbon{flex-wrap:wrap;align-items:stretch;gap:.5rem;width:100%;display:flex}.rj-editor-equation-ribbon-group{flex:none;align-items:center;min-width:0;display:inline-flex}.rj-editor-equation-ribbon-group--symbols{max-width:26.875rem}.rj-editor-equation-ribbon-group--structures{flex:26.25rem}.rj-editor-equation-tools{align-items:center;gap:.375rem;display:inline-flex}.rj-editor-equation-primary{flex-direction:column;gap:.125rem;min-width:4.625rem!important;height:3.875rem!important;padding:.375rem .625rem!important}.rj-editor-equation-primary-icon{color:var(--rj-color-brand,#3167c8);font-family:Georgia,Times New Roman,serif;font-size:1.875rem;font-weight:700;line-height:1}.rj-editor-equation-mode-stack{gap:.25rem;display:grid}.rj-editor-equation-mode-stack button{min-width:4rem;height:1.75rem}.rj-editor-equation-symbol-palette{gap:.125rem;display:grid}.rj-editor-equation-symbol-row{gap:.125rem;display:flex}.rj-editor-equation-symbol-row button{border-radius:.1875rem;min-width:1.75rem;height:1.75rem;padding:0 .375rem;font-family:Georgia,Times New Roman,serif;font-size:1rem}.rj-editor-equation-structures{flex-wrap:wrap;align-items:center;gap:.375rem;display:flex}.rj-editor-equation-structure{flex-direction:column;gap:.25rem;min-width:5rem!important;height:3.875rem!important;padding:.375rem .625rem!important}.rj-editor-equation-structure small{color:var(--rj-editor-muted-text,#526070);align-items:center;gap:.125rem;font-family:system-ui,sans-serif;font-size:.625rem;font-weight:600;line-height:1;display:inline-flex}.rj-editor-equation-structure small svg{width:.75rem!important;height:.75rem!important}.rj-editor-equation-math-preview{justify-content:center;align-items:center;min-width:2.125rem;min-height:1.5rem;display:inline-flex}.rj-editor-equation-math-preview .rj-editor-equation-render{font-family:Georgia,Times New Roman,serif;font-size:1.25rem;font-weight:600}.rj-editor-equation-gallery{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 1rem 2.375rem #0f172a2e);scrollbar-width:thin;border-radius:.5rem;min-width:23.75rem;max-height:32.5rem;padding:.625rem;overflow:auto}.rj-editor-equation-gallery-title{color:var(--rj-editor-muted-text,#526070);margin-bottom:.5rem;font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:700}.rj-editor-equation-gallery-grid{grid-template-columns:repeat(3,minmax(6rem,1fr));gap:.5rem;display:grid}.rj-editor-equation-gallery-grid button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.375rem;flex-direction:column;justify-content:center;align-items:center;gap:.375rem;min-height:4.75rem;padding:.5rem;display:flex}.rj-editor-equation-gallery-grid button:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-equation-gallery-grid small{color:var(--rj-editor-muted-text,#526070);text-align:center;font-family:system-ui,sans-serif;font-size:.6875rem;font-weight:600;line-height:1.2}.rj-editor-equation-gallery-section{background:linear-gradient(180deg, var(--rj-editor-toolbar-bg,#f8fafc), var(--rj-editor-toolbar-button-bg,#fff));color:var(--rj-editor-muted-text,#526070);border-radius:.25rem;grid-column:1/-1;padding:.3125rem .375rem;font-size:.75rem;font-weight:700}.rj-editor-equation-gallery-grid .rj-editor-equation-math-preview{min-height:2.125rem}.rj-editor-equation-gallery-grid .rj-editor-equation-math-preview .rj-editor-equation-render{font-size:1.125rem}.rj-editor-toolbar-group{white-space:nowrap;flex-wrap:nowrap;flex:none;align-items:center;gap:.375rem;display:inline-flex}.rj-editor-toolbar-group button svg{min-width:1rem;min-height:1rem}.rj-editor-toolbar button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.5rem;justify-content:center;align-items:center;min-width:2.125rem;height:2.125rem;padding:0 .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1;display:inline-flex}.rj-editor-toolbar--clear-btn{color:var(--rj-editor-danger,#dc2626)!important}.rj-editor-toolbar--clear-btn svg path{stroke:var(--rj-editor-danger,#dc2626)}.rj-editor-toolbar button:hover:not(:disabled),.rj-editor-toolbar button.is-active,.rj-editor-toolbar select:hover,.rj-editor-toolbar input[type=color]:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-toolbar .rj-editor-toolbar--clear-btn:hover:not(:disabled){background:var(--rj-editor-danger-bg,#fee2e2);border-color:var(--rj-editor-danger-border,#fca5a5);color:var(--rj-editor-danger,#dc2626)}.rj-editor-toolbar input[type=color]{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;height:2.125rem}.rj-editor-toolbar-select{border-radius:.5rem;min-width:5.75rem;height:2.125rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1}.rj-editor-toolbar-select .ant-select-selector{font:inherit;align-items:center;min-height:2.125rem;display:flex;border-radius:.5rem!important}.rj-editor-toolbar-select .ant-select-selection-item,.rj-editor-toolbar-select .ant-select-selection-placeholder{font:inherit}.rj-editor-toolbar-select .ant-select-arrow{color:var(--rj-editor-muted-text,#526070);align-items:center;display:inline-flex}.rj-editor-toolbar-select .ant-select-suffix{align-items:center;width:1.25rem;height:1.25rem;display:inline-flex}.rj-editor-toolbar-select-font{min-width:9.25rem}.rj-editor-toolbar-select-crop{min-width:7.25rem}.rj-editor-image-width-input{width:5.25rem}.rj-editor-toolbar input[type=color]{cursor:pointer;width:2.375rem;padding:.1875rem}.rj-editor-toolbar button:disabled{cursor:not-allowed;opacity:.45}.rj-editor-color-button{min-width:2.625rem}.rj-editor-color-button svg{filter:drop-shadow(0 0 .0625rem #fff)!important}.rj-editor-text-color-mark{flex-direction:column;align-items:center;gap:.125rem;font-weight:700;line-height:1;display:inline-flex}.rj-editor-text-color-line{border-radius:62.4375rem;width:1.125rem;height:.1875rem;display:block}.rj-editor-background-color-mark{border:.0625rem solid var(--rj-editor-border,#d9dde5);border-radius:.25rem;justify-content:center;align-items:center;min-width:1.75rem;max-width:1.875rem;height:1.375rem;padding:0 .25rem;font-size:.75rem;font-weight:700;display:inline-flex}.rj-editor-background-color-mark.is-none{background:linear-gradient(135deg, transparent 45%, var(--rj-editor-focus-border,#7aa7f7) 47%, var(--rj-editor-focus-border,#7aa7f7) 53%, transparent 55%), var(--rj-editor-toolbar-button-bg,#fff)}.rj-editor-color-menu-item{color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;align-items:center;gap:.5rem;width:100%;min-width:7.5rem;padding:.125rem 0;display:flex}.rj-editor-spacing-menu-item{color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;width:100%;min-width:6rem;padding:.125rem 0}.rj-editor-color-menu-input{cursor:pointer;width:1.75rem;height:1.375rem;margin-left:auto;padding:0}.rj-editor-color-swatch,.rj-editor-color-none{border:.0625rem solid var(--rj-editor-border,#d9dde5);border-radius:.25rem;width:1.125rem;height:1.125rem;display:inline-flex}.rj-editor-color-none{background:linear-gradient(135deg, transparent 43%, #ef4444 46%, #ef4444 54%, transparent 57%), var(--rj-editor-toolbar-button-bg,#fff)}.rj-editor-toolbar button svg{width:1.125rem;height:1.125rem}.rj-editor-toolbar-divider{background:var(--rj-editor-border,#d9dde5);width:.0625rem;height:1.375rem;margin:0 .125rem}.rj-editor-table-icon span{border:.09375rem solid;border-radius:.125rem}.rj-editor-table-menu{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 .75rem 1.75rem #0f172a24);border-radius:.5rem;gap:.625rem;min-width:16.25rem;padding:.75rem;display:grid}.rj-editor-table-menu-title{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.875rem;font-weight:700;line-height:1.2}.rj-editor-table-grid{grid-template-columns:repeat(10,1.125rem);gap:.3125rem;display:grid}.rj-editor-table-grid button{background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.125rem;width:1.125rem;min-width:1.125rem;height:1.125rem;padding:0}.rj-editor-table-grid button:hover,.rj-editor-table-grid button.is-selected{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-table-menu-divider{background:var(--rj-editor-border,#d9dde5);height:.0625rem;margin:.125rem -.75rem}.rj-editor-table-menu-row{grid-template-columns:1fr 4.75rem;align-items:center;gap:.625rem;display:grid}.rj-editor-table-menu-row label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:500;line-height:1.2}.rj-editor{border:.0625rem solid var(--rj-editor-border,#d9dde5);background:var(--rj-editor-bg,#fff);color:var(--rj-editor-text,#111827);text-align:left;border-radius:.5rem;transition:border-color .2s,box-shadow .2s;overflow:hidden}.rj-editor[data-rj-editor-theme=dark]{accent-color:var(--rj-color-brand,#b8b8b8)}.rj-editor[data-rj-editor-theme=dark] ::selection{color:#fff;background:#555}.rj-editor-hidden-file-input{display:none!important}.ant-form-item-has-error .rj-editor{border-color:var(--rj-editor-error-border,#ff4d4f);box-shadow:0 0 0 .125rem var(--rj-editor-error-shadow,#ff4d4f1a)}.ant-form-item-has-warning .rj-editor{border-color:var(--rj-editor-warning-border,#faad14);box-shadow:0 0 0 .125rem var(--rj-editor-warning-shadow,#faad141a)}.ant-form-item-has-error .rj-editor .rj-editor-toolbar-select .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-toolbar-select .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-border,#d9dde5)!important;box-shadow:none!important}.ant-form-item-has-error .rj-editor .rj-editor-toolbar-select.ant-select-focused .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-toolbar-select.ant-select-focused .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-focused.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-focused.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-focus-border,#7aa7f7)!important;box-shadow:0 0 0 .125rem var(--rj-editor-focus-ring,#7aa7f738)!important}.ant-form-item-has-error .rj-editor .rj-editor-code-block-language-select .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-code-block-language-select .ant-select-selector,.rj-editor .rj-editor-code-block-language-select.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-code-block-language-select.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-code-border,#34363a)!important;box-shadow:none!important}.rj-editor--fullscreen{z-index:1000;border-radius:0;flex-direction:column;display:flex;position:fixed;inset:0}.rj-editor-body{flex:auto;min-height:0;position:relative}.rj-editor-input{outline:none;min-height:13.75rem;padding:1.125rem}.rj-editor--fullscreen .rj-editor-input{height:100%;min-height:0;overflow:auto}.rj-editor-placeholder{color:var(--rj-editor-placeholder,#8a94a6);pointer-events:none;-webkit-user-select:none;user-select:none;position:absolute;top:1.125rem;left:1.125rem}.rj-editor-paragraph{margin:0 0 .75rem}.rj-editor-paragraph:last-child{margin-bottom:0}.rj-editor-text-bold{font-weight:700}.rj-editor-text-code{background:var(--rj-editor-inline-code-bg,#2a2828);border:.0625rem solid var(--rj-editor-inline-code-border,#ffffff24);color:var(--rj-editor-inline-code-text,#ededed);white-space:pre-wrap;border-radius:.375rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.92em;line-height:1.35}.rj-editor-code-block{background:var(--rj-editor-code-bg,#0b0c0e);border:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-text,#ededed);scrollbar-color:var(--rj-editor-code-border,#34363a) transparent;scrollbar-width:thin;tab-size:2;white-space:pre;border-radius:.5rem;outline:none;min-height:7rem;margin:.75rem 0;padding:3.625rem 1rem 1.125rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.8125rem;line-height:1.65;display:block;position:relative;overflow:auto}.rj-editor-code-block:before{background:var(--rj-editor-code-header-bg,#111214);border-bottom:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);content:\">_ \" attr(data-language);align-items:center;height:2.625rem;padding:0 .875rem;font-family:inherit;font-size:.75rem;display:flex;position:absolute;top:0;left:0;right:0}.rj-editor-code-block-actions{z-index:20;align-items:center;gap:.3125rem;width:11.875rem;display:inline-flex;position:absolute}.rj-editor-code-block-language-select{flex:auto;min-width:0}.rj-editor-code-block-language-select.ant-select .ant-select-selector{background-color:var(--rj-editor-code-header-bg,#111214)!important;border-color:var(--rj-editor-code-border,#34363a)!important;color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-select .ant-select-selection-item,.rj-editor-code-block-language-select .ant-select-arrow,.rj-editor-code-block-language-select .ant-select-suffix{color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-popup{border:.0625rem solid var(--rj-editor-code-border,#34363a);background:var(--rj-editor-code-header-bg,#111214)!important}.rj-editor-code-block-language-popup .ant-select-item{color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-popup .ant-select-item-option-active,.rj-editor-code-block-language-popup .ant-select-item-option-selected{background:#303030!important}.rj-editor-code-block-actions button{background:var(--rj-editor-code-header-bg,#111214);border:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);cursor:pointer;border-radius:.375rem;flex:0 0 1.75rem;justify-content:center;align-items:center;height:1.75rem;padding:0;display:inline-flex}.rj-editor-code-block-actions button:hover,.rj-editor-code-block-actions button.is-copied{color:var(--rj-editor-code-text,#ededed);background:#303030;border-color:#787878}.rj-editor-code-block-actions button svg{width:1rem;height:1rem}.rj-editor-code-block-export{background:var(--rj-editor-code-bg,#0b0c0e);border:.0625rem solid var(--rj-editor-code-border,#34363a);border-radius:.5rem;max-width:100%;margin:.75rem 0;overflow:hidden}.rj-editor-code-block-export-header{background:var(--rj-editor-code-header-bg,#111214);border-bottom:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);justify-content:space-between;align-items:center;height:2.625rem;padding:0 .5rem 0 .875rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.75rem;display:flex}.rj-editor-code-block-export-copy{color:var(--rj-editor-code-muted,#a1a1aa);cursor:pointer;background:0 0;border:.0625rem solid #0000;border-radius:.375rem;justify-content:center;align-items:center;width:1.75rem;height:1.75rem;padding:0;display:inline-flex}.rj-editor-code-block-export-copy:hover,.rj-editor-code-block-export-copy.is-copied{color:var(--rj-editor-code-text,#ededed);background:#303030;border-color:#787878}.rj-editor-code-block-export-copy svg{width:1rem;height:1rem}.rj-editor-code-block.rj-editor-code-block--exported{border:0;border-radius:0;min-height:4.375rem;margin:0;padding:1rem}.rj-editor-code-block.rj-editor-code-block--exported:before{content:none;display:none}.rj-editor-code-token-comment{color:var(--rj-editor-code-comment,#7f848e)}.rj-editor-code-token-atrule,.rj-editor-code-token-keyword,.rj-editor-code-token-important{color:var(--rj-editor-code-keyword,#c678dd)}.rj-editor-code-token-attr,.rj-editor-code-token-char,.rj-editor-code-token-inserted,.rj-editor-code-token-regex,.rj-editor-code-token-selector,.rj-editor-code-token-string{color:var(--rj-editor-code-string,#98c379)}.rj-editor-code-token-boolean,.rj-editor-code-token-constant,.rj-editor-code-token-number,.rj-editor-code-token-symbol{color:var(--rj-editor-code-number,#d19a66)}.rj-editor-code-token-class,.rj-editor-code-token-class-name,.rj-editor-code-token-function{color:var(--rj-editor-code-function,#61afef)}.rj-editor-code-token-builtin,.rj-editor-code-token-entity,.rj-editor-code-token-operator,.rj-editor-code-token-property,.rj-editor-code-token-punctuation,.rj-editor-code-token-url,.rj-editor-code-token-variable{color:var(--rj-editor-code-operator,#56b6c2)}.rj-editor-code-token-deleted,.rj-editor-code-token-tag{color:var(--rj-editor-code-tag,#e06c75)}.rj-editor-text-italic{font-style:italic}.rj-editor-text-strikethrough{text-decoration:line-through}.rj-editor-text-subscript{vertical-align:sub;font-size:.75em}.rj-editor-text-superscript{vertical-align:super;font-size:.75em}.rj-editor-text-underline{text-decoration:underline}.rj-editor-input a{color:var(--rj-editor-link,#2563eb);text-decoration:underline}.rj-editor-input hr{border:0;border-top:.0625rem solid var(--rj-editor-border,#d9dde5);margin:1rem 0}.rj-editor-equation-node{display:inline}.rj-editor-equation{cursor:pointer;scrollbar-width:thin;vertical-align:middle;border-radius:.375rem;min-width:0;max-width:100%;padding:.125rem .25rem;display:inline-flex;overflow-x:auto}.rj-editor-equation--block{justify-content:center;width:100%;margin:.625rem 0;padding:.5rem;display:flex;overflow-x:auto}.rj-editor-equation-editor{flex-direction:column;align-items:center;gap:.5rem;min-width:0;max-width:100%;display:inline-flex}.rj-editor-equation-editor input:not(.rj-editor-equation-slot-input){background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border:.0625rem solid var(--rj-editor-focus-border,#7aa7f7);color:var(--rj-editor-text,#111827);resize:none;text-align:center;border-radius:.25rem;outline:none;min-width:16.25rem;min-height:2.125rem;padding:.25rem .5rem;font-family:Georgia,Times New Roman,serif;font-size:1.125rem;font-weight:500;line-height:1.25}.rj-editor-equation-editor input::placeholder,.rj-editor-equation-content.is-empty{color:var(--rj-editor-placeholder,#8a94a6)}.rj-editor-equation-visual-editor{align-items:center;min-width:0;min-height:2.125rem;display:inline-flex}.rj-editor-equation-visual,.rj-editor-equation-render{vertical-align:middle;justify-content:center;align-items:center;gap:.25rem;min-width:0;max-width:100%;font-family:Georgia,Times New Roman,serif;font-size:1.25rem;font-style:italic;line-height:1.15;display:inline-flex}.rj-editor-equation-visual{min-height:2.125rem}.rj-editor-equation-render-slot{text-align:center;text-overflow:ellipsis;min-width:.625rem;max-width:8.75rem;display:inline-block;overflow:hidden}.rj-editor-equation-nested{align-items:center;min-width:0;display:inline-flex}.rj-editor-equation-insert-point{appearance:none;cursor:text;background:0 0;border:0;border-radius:.125rem;flex:0 0 .5rem;align-self:stretch;width:.5rem;min-height:1.5rem;margin:0 -.125rem;padding:0;display:inline-flex;position:relative}.rj-editor-equation-insert-point:after{background:var(--rj-editor-focus-border,#7aa7f7);content:\"\";opacity:0;border-radius:.125rem;width:.125rem;transition:opacity .12s;position:absolute;top:.1875rem;bottom:.1875rem;left:50%;transform:translate(-50%)}.rj-editor-equation-insert-point:hover:after,.rj-editor-equation-insert-point.is-active:after{opacity:1}.rj-editor-equation-slot-input{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border:.0625rem dashed var(--rj-editor-focus-border,#7aa7f7);color:var(--rj-editor-text,#111827);box-sizing:border-box;text-align:center;text-overflow:clip;border-radius:.25rem;outline:none;flex:none;width:auto;min-width:1.375rem;max-width:9.375rem;min-height:1.5rem;padding:.0625rem .3125rem;font-family:Georgia,Times New Roman,serif;font-size:1.125rem;font-style:italic;font-weight:600;line-height:1.2;overflow:hidden}.rj-editor-equation-editor .rj-editor-equation-slot-input{width:auto;min-width:1.375rem;min-height:1.5rem;padding:.0625rem .3125rem;font-size:1.125rem}.rj-editor-equation-slot-input:focus{box-shadow:0 0 0 .125rem var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-style:solid}.rj-editor-equation-slot-input::placeholder{color:var(--rj-editor-muted-text,#526070)}.rj-editor-equation-slot-input--limit,.rj-editor-equation-slot-input--script,.rj-editor-equation-slot-input--small,.rj-editor-equation-slot-input--root-index,.rj-editor-equation-editor .rj-editor-equation-slot-input--limit,.rj-editor-equation-editor .rj-editor-equation-slot-input--script,.rj-editor-equation-editor .rj-editor-equation-slot-input--small,.rj-editor-equation-editor .rj-editor-equation-slot-input--root-index{min-width:1.125rem;min-height:1.125rem;padding:.0625rem .25rem;font-size:.8125rem}.rj-editor-equation-slot-input--small{min-width:1.125rem}.rj-editor-equation-slot-input--matrix{min-width:1.375rem}.rj-editor-equation-visual--fraction,.rj-editor-equation-render--fraction{place-items:center;gap:.125rem;min-width:0;display:inline-grid}.rj-editor-equation-fraction-line,.rj-editor-equation-render-line{background:var(--rj-editor-text,#111827);width:100%;height:.125rem;display:block}.rj-editor-equation-visual--fraction-inline,.rj-editor-equation-render--fraction-inline,.rj-editor-equation-visual--row,.rj-editor-equation-render--row{flex-wrap:nowrap;align-items:center;gap:.125rem;min-width:0;display:inline-flex}.rj-editor-equation-visual--script,.rj-editor-equation-render--script{vertical-align:middle;align-items:center;gap:.125rem}.rj-editor-equation-script-stack,.rj-editor-equation-render-script-stack{place-items:center;gap:.0625rem;line-height:1;display:inline-grid}.rj-editor-equation-visual--script.has-superscript:not(.has-subscript) .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-superscript:not(.has-subscript) .rj-editor-equation-render-script-stack{transform:translateY(-.4375rem)}.rj-editor-equation-visual--script.has-subscript:not(.has-superscript) .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-subscript:not(.has-superscript) .rj-editor-equation-render-script-stack{transform:translateY(.4375rem)}.rj-editor-equation-visual--script.has-superscript.has-subscript .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-superscript.has-subscript .rj-editor-equation-render-script-stack{transform:translateY(-.0625rem)}.rj-editor-equation-render-script-stack{font-size:.68em}.rj-editor-equation-visual--root,.rj-editor-equation-render--root{align-items:flex-start;gap:0}.rj-editor-equation-root-symbol,.rj-editor-equation-render-root-symbol{font-size:1.875rem;font-style:normal;line-height:1}.rj-editor-equation-radicand,.rj-editor-equation-render-radicand{border-top:.125rem solid var(--rj-editor-text,#111827);margin-top:.125rem;padding:.125rem .25rem 0;display:inline-flex}.rj-editor-equation-slot-input--root-index,.rj-editor-equation-render-root-index{align-self:flex-start;margin-right:-.125rem}.rj-editor-equation-render-root-index{font-size:.62em}.rj-editor-equation-limits,.rj-editor-equation-render-limits{place-items:center;gap:.0625rem;line-height:1;display:inline-grid}.rj-editor-equation-render-limits span:first-child,.rj-editor-equation-render-limits span:last-child{font-size:.62em}.rj-editor-equation-large-symbol,.rj-editor-equation-render-large-symbol{font-size:2.125rem;font-style:normal;line-height:.9}.rj-editor-equation-function-name{font-style:normal;font-weight:600}.rj-editor-equation-bracket,.rj-editor-equation-render-bracket,.rj-editor-equation-matrix-bracket,.rj-editor-equation-render-matrix-bracket{font-size:2.125rem;font-style:normal;line-height:1}.rj-editor-equation-visual--accent,.rj-editor-equation-render--accent{justify-items:center;gap:0;display:inline-grid}.rj-editor-equation-accent-mark,.rj-editor-equation-render-accent-mark{font-size:1.125rem;line-height:.7}.rj-editor-equation-matrix-grid,.rj-editor-equation-render-matrix-grid{gap:.25rem .5rem;display:inline-grid}.rj-editor-equation-render-matrix-grid span{text-align:center;min-width:1.5rem}.rj-editor-equation.is-selected{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-equation-content,.rj-editor-equation-content math{max-width:100%}.rj-editor-equation-content .katex-display{margin:0}.rj-editor-image-node{margin:.75rem 0;display:block}.rj-editor-youtube-node{clear:both;margin:1rem 0;display:block}.rj-editor-youtube{aspect-ratio:16/9;background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.5rem;width:100%;max-width:45rem;overflow:hidden}.rj-editor-youtube.is-selected{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-youtube iframe{border:0;width:100%;height:100%;display:block}.rj-editor-image-frame{width:100%;display:flex;position:relative}.rj-editor-image-frame--wrap-square{width:auto;max-width:100%;display:block}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--left{float:left;margin:.25rem 1rem .625rem 0}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--right{float:right;margin:.25rem 0 .625rem 1rem}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--center,.rj-editor-image-frame--wrap-top-bottom{clear:both;width:100%;display:flex}.rj-editor-image-frame--left{justify-content:flex-start}.rj-editor-image-frame--center{justify-content:center}.rj-editor-image-frame--right{justify-content:flex-end}.rj-editor-image{width:100%;max-width:100%;height:auto;display:block}.rj-editor-image-box{transform-origin:50%;flex-direction:column;display:inline-flex;position:relative}.rj-editor-image-rotator{transform:rotate(var(--rj-image-rotation,0deg));transform-origin:50%;width:100%;display:block}.rj-editor-image-box.is-quarter-turn{display:block}.rj-editor-image-box.is-quarter-turn .rj-editor-image-rotator{transform:translate(-50%, -50%) rotate(var(--rj-image-rotation,0deg));position:absolute;top:50%;left:50%}.rj-editor-image-box.is-quarter-turn .rj-editor-image-link,.rj-editor-image-box.is-quarter-turn .rj-editor-image{width:100%;max-width:none;height:100%}.rj-editor-image-box.is-quarter-turn .rj-editor-image-caption{width:100%;position:absolute;top:100%;left:0}.rj-editor-image-box.has-border .rj-editor-image{border:.0625rem solid var(--rj-editor-image-border,#94a3b8)}.rj-editor-image-box.has-shadow .rj-editor-image{box-shadow:var(--rj-editor-image-shadow,0 .875rem 2rem #0f172a2e)}.rj-editor-image-link{display:block}.rj-editor-image-caption{color:var(--rj-editor-muted-text,#64748b);text-align:center;margin-top:.375rem;font-family:system-ui,sans-serif;font-size:.75rem;font-weight:500;line-height:1.35;display:block}.rj-editor-image-frame.is-selected .rj-editor-image-box{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-image-floating-toolbar{background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 .75rem 1.75rem #0f172a24);z-index:1005;border-radius:.5rem;align-items:center;gap:.25rem;padding:.25rem;display:inline-flex;position:absolute}.rj-editor-image-floating-toolbar button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.375rem;justify-content:center;align-items:center;min-width:1.75rem;height:1.75rem;padding:0 .4375rem;font-family:system-ui,sans-serif;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.rj-editor-image-floating-toolbar button svg{width:1.25rem;height:1.25rem}.rj-editor-image-floating-toolbar button:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-image-resize-handle{background:var(--rj-editor-focus-border,#7aa7f7);border:.125rem solid var(--rj-editor-bg,#fff);touch-action:none;z-index:2;border-radius:62.4375rem;width:.75rem;height:.75rem;position:absolute;transform:translate(-50%,-50%)}.rj-editor-image-resize-handle--left{cursor:ew-resize;top:50%;left:0}.rj-editor-image-resize-handle--right{cursor:ew-resize;top:50%;left:100%}.rj-editor-image-resize-handle--top{cursor:ns-resize;top:0;left:50%}.rj-editor-image-resize-handle--bottom{cursor:ns-resize;top:100%;left:50%}.rj-editor-image-resize-handle--top-left{cursor:nwse-resize;top:0;left:0}.rj-editor-image-resize-handle--top-right{cursor:nesw-resize;top:0;left:100%}.rj-editor-image-resize-handle--bottom-right{cursor:nwse-resize;top:100%;left:100%}.rj-editor-image-resize-handle--bottom-left{cursor:nesw-resize;top:100%;left:0}.rj-editor-table-scrollable-wrapper{max-width:100%;margin:.75rem 0;overflow-x:auto}.rj-editor-table{border-collapse:collapse;table-layout:fixed;width:100%}.rj-editor-table-cell,.rj-editor-table-cell-header{border:.0625rem solid var(--rj-editor-table-border,#cbd5e1);box-sizing:border-box;vertical-align:top;min-width:5rem;height:2rem;padding:.5rem .625rem}.rj-editor-table-cell .rj-editor-paragraph,.rj-editor-table-cell-header .rj-editor-paragraph{min-height:1.25rem;margin:0;line-height:1.25rem}.rj-editor-table-cell-header{background:var(--rj-editor-table-header-bg,#f1f5f9);font-weight:700}.rj-editor-table-cell-selected{background:var(--rj-editor-table-selected-bg,#eaf2ff);outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:-.125rem}.rj-editor-list-ol,.rj-editor-list-ul{margin:0 0 .75rem 1.5rem;padding:0}.rj-editor-list-item{margin:.25rem 0}\n/*$vite$:1*/";
|
|
2
|
+
const RJ_EDITOR_CSS = ":root{--rj-color-text:#111827;--rj-color-muted:#526070;--rj-color-subtle:#8a94a6;--rj-color-page-bg:#f5f7fb;--rj-color-surface:#fff;--rj-color-surface-soft:#f8fafc;--rj-color-border:#d9dde5;--rj-color-brand:#3167c8;--rj-color-brand-strong:#1f4f9a;--rj-color-brand-soft:#eef4ff;--rj-color-brand-tint:#eaf2ff;--rj-color-link:#2563eb;--rj-color-focus:#7aa7f7;--rj-color-table-border:#cbd5e1;--rj-color-table-header-bg:#f1f5f9;--rj-color-image-border:#94a3b8;--rj-shadow-image:0 .875rem 2rem #0f172a2e;--rj-color-inline-code-bg:#2a2828;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff24;--rj-color-code-bg:#0b0c0e;--rj-color-code-header-bg:#111214;--rj-color-code-border:#34363a;--rj-color-code-text:#ededed;--rj-color-code-muted:#a1a1aa;--rj-color-code-keyword:#c678dd;--rj-color-code-string:#98c379;--rj-color-code-number:#d19a66;--rj-color-code-comment:#7f848e;--rj-color-code-function:#61afef;--rj-color-code-operator:#56b6c2;--rj-color-code-tag:#e06c75;--rj-color-danger:#dc2626;--rj-color-danger-soft:#fce1e13f;--rj-color-danger-border:#fca5a5;--rj-color-inverse-bg:#101827;--rj-color-inverse-text:#dbeafe;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#7aa7f738;--rj-editor-floating-shadow:0 .75rem 1.75rem #0f172a24;--rj-editor-modal-overlay:#0f172a6b;--rj-editor-modal-shadow:0 1.5rem 4rem #0f172a38;color:var(--rj-color-text);background:var(--rj-color-page-bg);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:1rem;line-height:1.5}[data-rj-editor-theme=light]{--rj-color-text:#111827;--rj-color-muted:#526070;--rj-color-subtle:#8a94a6;--rj-color-page-bg:#f5f7fb;--rj-color-surface:#fff;--rj-color-surface-soft:#f8fafc;--rj-color-border:#d9dde5;--rj-color-brand:#3167c8;--rj-color-brand-strong:#1f4f9a;--rj-color-brand-soft:#eef4ff;--rj-color-brand-tint:#eaf2ff;--rj-color-link:#2563eb;--rj-color-focus:#7aa7f7;--rj-color-table-border:#cbd5e1;--rj-color-table-header-bg:#f1f5f9;--rj-color-image-border:#94a3b8;--rj-shadow-image:0 .875rem 2rem #0f172a2e;--rj-color-inline-code-bg:#2a2828;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff24;--rj-color-code-bg:#0b0c0e;--rj-color-code-header-bg:#111214;--rj-color-code-border:#34363a;--rj-color-code-text:#ededed;--rj-color-code-muted:#a1a1aa;--rj-color-code-keyword:#c678dd;--rj-color-code-string:#98c379;--rj-color-code-number:#d19a66;--rj-color-code-comment:#7f848e;--rj-color-code-function:#61afef;--rj-color-code-operator:#56b6c2;--rj-color-code-tag:#e06c75;--rj-color-danger:#dc2626;--rj-color-danger-soft:#fce1e13f;--rj-color-danger-border:#fca5a5;--rj-color-inverse-bg:#101827;--rj-color-inverse-text:#dbeafe;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#7aa7f738;--rj-editor-floating-shadow:0 .75rem 1.75rem #0f172a24;--rj-editor-modal-overlay:#0f172a6b;--rj-editor-modal-shadow:0 1.5rem 4rem #0f172a38;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-rj-editor-theme=dark]{--rj-color-text:#ededed;--rj-color-muted:#b0b0b0;--rj-color-subtle:#898989;--rj-color-page-bg:#151515;--rj-color-surface:#1b1b1b;--rj-color-surface-soft:#232323;--rj-color-border:#414141;--rj-color-brand:#b8b8b8;--rj-color-brand-strong:#d4d4d4;--rj-color-brand-soft:#292929;--rj-color-brand-tint:#303030;--rj-color-link:#d0d0d0;--rj-color-focus:#a8a8a8;--rj-color-table-border:#484848;--rj-color-table-header-bg:#292929;--rj-color-image-border:#686868;--rj-shadow-image:0 .875rem 2rem #00000061;--rj-color-inline-code-bg:#101010;--rj-color-inline-code-text:#ededed;--rj-color-inline-code-border:#ffffff29;--rj-color-code-bg:#0b0b0b;--rj-color-code-header-bg:#141414;--rj-color-code-border:#404040;--rj-color-code-text:#ededed;--rj-color-code-muted:#949494;--rj-color-code-keyword:#d7d7d7;--rj-color-code-string:#b8b8b8;--rj-color-code-number:#c9c9c9;--rj-color-code-comment:#777;--rj-color-code-function:#e1e1e1;--rj-color-code-operator:#a6a6a6;--rj-color-code-tag:#c2c2c2;--rj-color-danger:#f87171;--rj-color-danger-soft:#f871711f;--rj-color-danger-border:#985050;--rj-color-inverse-bg:#ededed;--rj-color-inverse-text:#1b1b1b;--rj-color-white:#fff;--rj-editor-bg:var(--rj-color-surface);--rj-editor-border:var(--rj-color-border);--rj-editor-text:var(--rj-color-text);--rj-editor-placeholder:var(--rj-color-subtle);--rj-editor-toolbar-bg:var(--rj-color-surface-soft);--rj-editor-toolbar-button-bg:var(--rj-color-surface);--rj-editor-toolbar-button-active-bg:var(--rj-color-brand-tint);--rj-editor-link:var(--rj-color-link);--rj-editor-focus-border:var(--rj-color-focus);--rj-editor-table-border:var(--rj-color-table-border);--rj-editor-table-header-bg:var(--rj-color-table-header-bg);--rj-editor-table-selected-bg:var(--rj-color-brand-tint);--rj-editor-image-border:var(--rj-color-image-border);--rj-editor-image-shadow:var(--rj-shadow-image);--rj-editor-inline-code-bg:var(--rj-color-inline-code-bg);--rj-editor-inline-code-text:var(--rj-color-inline-code-text);--rj-editor-inline-code-border:var(--rj-color-inline-code-border);--rj-editor-code-bg:var(--rj-color-code-bg);--rj-editor-code-header-bg:var(--rj-color-code-header-bg);--rj-editor-code-border:var(--rj-color-code-border);--rj-editor-code-text:var(--rj-color-code-text);--rj-editor-code-muted:var(--rj-color-code-muted);--rj-editor-code-keyword:var(--rj-color-code-keyword);--rj-editor-code-string:var(--rj-color-code-string);--rj-editor-code-number:var(--rj-color-code-number);--rj-editor-code-comment:var(--rj-color-code-comment);--rj-editor-code-function:var(--rj-color-code-function);--rj-editor-code-operator:var(--rj-color-code-operator);--rj-editor-code-tag:var(--rj-color-code-tag);--rj-editor-muted-text:var(--rj-color-muted);--rj-editor-danger:var(--rj-color-danger);--rj-editor-danger-bg:var(--rj-color-danger-soft);--rj-editor-danger-border:var(--rj-color-danger-border);--rj-editor-focus-ring:#bebebe33;--rj-editor-floating-shadow:0 .75rem 1.75rem #00000061;--rj-editor-modal-overlay:#00000094;--rj-editor-modal-shadow:0 1.5rem 4rem #0000007a;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}._wrapper_se0k7_1{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.375rem;align-items:center;gap:.125rem;width:100%;height:2.125rem;padding:0 .5rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1;display:inline-flex}._wrapper_se0k7_1:focus-within{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .125rem #7aa7f72e}._wrapper_se0k7_1._disabled_se0k7_23{cursor:not-allowed;opacity:.55}._affix_se0k7_28{color:var(--rj-editor-muted-text,#526070);cursor:text;font:inherit;-webkit-user-select:none;user-select:none;flex:none}._affix_se0k7_28 svg{width:1rem!important;height:1rem!important}._affix_se0k7_28 svg path{stroke:var(--rj-editor-muted-text,#526070)}._input_se0k7_43{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.375rem;outline:none;width:100%;height:2.125rem;padding:0 .5rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1}._inputAffix_se0k7_58{box-shadow:none;background:0 0;border:0;border-radius:0;flex:auto;width:100%;min-width:0;height:100%;padding:0}._input_se0k7_43:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .125rem #7aa7f72e}._inputAffix_se0k7_58:focus{box-shadow:none;border-color:#0000}._input_se0k7_43:disabled{cursor:not-allowed;opacity:.55}._overlay_qjax1_1{background:var(--rj-editor-modal-overlay,#0f172a6b);z-index:1200;justify-content:center;align-items:center;padding:1.5rem;display:flex;position:fixed;inset:0}._modal_qjax1_12{background:var(--rj-editor-bg,#fff);box-shadow:var(--rj-editor-modal-shadow,0 1.5rem 4rem #0f172a38);color:var(--rj-editor-text,#111827);min-width:min(26.25rem,100vw - 3rem);max-width:calc(100vw - 3rem);max-height:min(45rem,100vh - 3rem);width:var(--rj-modal-width,26.25rem);border-radius:.5rem;overflow:hidden}._header_qjax1_24{border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:move;-webkit-user-select:none;user-select:none;justify-content:space-between;align-items:center;padding:.875rem 1.125rem;display:flex}._title_qjax1_34{margin:0;font-family:system-ui,sans-serif;font-size:1rem;font-weight:700;line-height:1.3}._closeButton_qjax1_42{color:var(--rj-editor-muted-text,#526070);cursor:pointer;cursor:pointer;background:0 0;border:0;border-radius:.375rem;justify-content:center;align-items:center;width:1.875rem;height:1.875rem;padding:0;display:inline-flex}._closeButton_qjax1_42:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);color:var(--rj-editor-text,#111827)}._body_qjax1_65{max-height:calc(100vh - 11.375rem);padding:1.125rem;overflow:auto}._footer_qjax1_71{border-top:.0625rem solid var(--rj-editor-border,#d9dde5);justify-content:flex-end;align-items:center;gap:.5rem;padding:.75rem 1.125rem;display:flex}._button_qjax1_80{border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.5rem;justify-content:center;align-items:center;min-width:4.75rem;height:2.125rem;padding:0 .875rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:600;line-height:1;display:inline-flex}._cancelButton_qjax1_96{background:var(--rj-editor-toolbar-button-bg,#fff);color:var(--rj-editor-text,#111827)}._cancelButton_qjax1_96:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}._okButton_qjax1_106{background:var(--rj-color-brand,#3167c8);border-color:var(--rj-color-brand,#3167c8);color:var(--rj-color-white,#fff)}._okButton_qjax1_106:hover{background:var(--rj-color-brand-strong,#1f4f9a);border-color:var(--rj-color-brand-strong,#1f4f9a)}._button_qjax1_80:disabled{cursor:not-allowed;opacity:.5}.rj-editor-image-border-radius-input{width:4.375rem}.rj-editor-image-edit-form{gap:.5rem;display:grid}.rj-editor-image-edit-form label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-image-edit-form input,.rj-editor-image-edit-form textarea{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;width:100%;padding:.5625rem .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-image-edit-form input{height:2.375rem}.rj-editor-image-edit-form textarea{resize:vertical;min-height:6rem}.rj-editor-image-edit-form input:focus,.rj-editor-image-edit-form textarea:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-link-form{gap:.75rem;display:grid}.rj-editor-link-field{gap:.375rem;display:grid}.rj-editor-link-field label,.rj-editor-link-checkbox{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-link-field input{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;height:2.25rem;padding:0 .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-link-field input:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-link-checkbox{align-items:center;gap:.5rem;width:fit-content;display:inline-flex}.rj-editor-link-checkbox input{accent-color:var(--rj-color-brand,#3167c8);width:1rem;height:1rem}.rj-editor-youtube-form{gap:.75rem;display:grid}.rj-editor-youtube-field{gap:.375rem;display:grid}.rj-editor-youtube-field label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.25}.rj-editor-youtube-field input{background:var(--rj-editor-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;outline:none;width:100%;height:2.375rem;padding:.5625rem .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.35}.rj-editor-youtube-field input:focus{border-color:var(--rj-editor-focus-border,#7aa7f7);box-shadow:0 0 0 .1875rem var(--rj-editor-focus-ring,#7aa7f738)}.rj-editor-youtube-error{color:var(--rj-editor-danger,#dc2626);margin:0;font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:600;line-height:1.35}.rj-editor-toolbar{background:var(--rj-editor-toolbar-bg,#f8fafc);border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);flex-direction:column;display:flex}.rj-editor-toolbar-tabs{border-bottom:.0625rem solid var(--rj-editor-border,#d9dde5);justify-content:space-between;align-items:center;gap:.25rem;padding:.375rem .5rem;display:flex}.rj-editor-toolbar-tabs-list{flex-wrap:wrap;align-items:center;gap:.25rem;display:flex}.rj-editor-toolbar-tabs-list button{background:0 0;border:.0625rem solid #0000;border-bottom:0;border-radius:.5rem .5rem 0 0;min-width:auto;height:2rem;padding:0 .875rem}.rj-editor-toolbar-tabs-list button:hover,.rj-editor-toolbar-tabs-list button.is-active{background:var(--rj-editor-toolbar-button-bg,#fff);border-color:var(--rj-editor-border,#d9dde5)}.rj-editor-toolbar-fullscreen{flex:none}.rj-editor-toolbar-panel{flex-wrap:wrap;align-items:center;gap:.375rem;min-height:3.125rem;padding:.5rem;display:flex}.rj-editor-toolbar-panel--home,.rj-editor-toolbar-panel--image{flex-flow:column;align-items:stretch;gap:.5rem}.rj-editor-toolbar-row{flex-wrap:wrap;flex:none;align-items:center;gap:.375rem;padding-bottom:.0625rem;display:flex}.rj-editor-equation-toolbar{flex-flow:wrap;align-items:stretch}.rj-editor-equation-ribbon{flex-wrap:wrap;align-items:stretch;gap:.5rem;width:100%;display:flex}.rj-editor-equation-ribbon-group{flex:none;align-items:center;min-width:0;display:inline-flex}.rj-editor-equation-ribbon-group--symbols{max-width:26.875rem}.rj-editor-equation-ribbon-group--structures{flex:26.25rem}.rj-editor-equation-tools{align-items:center;gap:.375rem;display:inline-flex}.rj-editor-equation-primary{flex-direction:column;gap:.125rem;min-width:4.625rem!important;height:3.875rem!important;padding:.375rem .625rem!important}.rj-editor-equation-primary-icon{color:var(--rj-color-brand,#3167c8);font-family:Georgia,Times New Roman,serif;font-size:1.875rem;font-weight:700;line-height:1}.rj-editor-equation-mode-stack{gap:.25rem;display:grid}.rj-editor-equation-mode-stack button{min-width:4rem;height:1.75rem}.rj-editor-equation-symbol-palette{gap:.125rem;display:grid}.rj-editor-equation-symbol-row{gap:.125rem;display:flex}.rj-editor-equation-symbol-row button{border-radius:.1875rem;min-width:1.75rem;height:1.75rem;padding:0 .375rem;font-family:Georgia,Times New Roman,serif;font-size:1rem}.rj-editor-equation-structures{flex-wrap:wrap;align-items:center;gap:.375rem;display:flex}.rj-editor-equation-structure{flex-direction:column;gap:.25rem;min-width:5rem!important;height:3.875rem!important;padding:.375rem .625rem!important}.rj-editor-equation-structure small{color:var(--rj-editor-muted-text,#526070);align-items:center;gap:.125rem;font-family:system-ui,sans-serif;font-size:.625rem;font-weight:600;line-height:1;display:inline-flex}.rj-editor-equation-structure small svg{width:.75rem!important;height:.75rem!important}.rj-editor-equation-math-preview{justify-content:center;align-items:center;min-width:2.125rem;min-height:1.5rem;display:inline-flex}.rj-editor-equation-math-preview .rj-editor-equation-render{font-family:Georgia,Times New Roman,serif;font-size:1.25rem;font-weight:600}.rj-editor-equation-gallery{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 1rem 2.375rem #0f172a2e);scrollbar-width:thin;border-radius:.5rem;min-width:23.75rem;max-height:32.5rem;padding:.625rem;overflow:auto}.rj-editor-equation-gallery-title{color:var(--rj-editor-muted-text,#526070);margin-bottom:.5rem;font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:700}.rj-editor-equation-gallery-grid{grid-template-columns:repeat(3,minmax(6rem,1fr));gap:.5rem;display:grid}.rj-editor-equation-gallery-grid button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.375rem;flex-direction:column;justify-content:center;align-items:center;gap:.375rem;min-height:4.75rem;padding:.5rem;display:flex}.rj-editor-equation-gallery-grid button:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-equation-gallery-grid small{color:var(--rj-editor-muted-text,#526070);text-align:center;font-family:system-ui,sans-serif;font-size:.6875rem;font-weight:600;line-height:1.2}.rj-editor-equation-gallery-section{background:linear-gradient(180deg, var(--rj-editor-toolbar-bg,#f8fafc), var(--rj-editor-toolbar-button-bg,#fff));color:var(--rj-editor-muted-text,#526070);border-radius:.25rem;grid-column:1/-1;padding:.3125rem .375rem;font-size:.75rem;font-weight:700}.rj-editor-equation-gallery-grid .rj-editor-equation-math-preview{min-height:2.125rem}.rj-editor-equation-gallery-grid .rj-editor-equation-math-preview .rj-editor-equation-render{font-size:1.125rem}.rj-editor-toolbar-group{white-space:nowrap;flex-wrap:nowrap;flex:none;align-items:center;gap:.375rem;display:inline-flex}.rj-editor-toolbar-group button svg{min-width:1rem;min-height:1rem}.rj-editor-toolbar button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.5rem;justify-content:center;align-items:center;min-width:2.125rem;height:2.125rem;padding:0 .625rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1;display:inline-flex}.rj-editor-toolbar--clear-btn{color:var(--rj-editor-danger,#dc2626)!important}.rj-editor-toolbar--clear-btn svg path{stroke:var(--rj-editor-danger,#dc2626)}.rj-editor-toolbar button:hover:not(:disabled),.rj-editor-toolbar button.is-active,.rj-editor-toolbar select:hover,.rj-editor-toolbar input[type=color]:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-toolbar .rj-editor-toolbar--clear-btn:hover:not(:disabled){background:var(--rj-editor-danger-bg,#fee2e2);border-color:var(--rj-editor-danger-border,#fca5a5);color:var(--rj-editor-danger,#dc2626)}.rj-editor-toolbar input[type=color]{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);border-radius:.5rem;height:2.125rem}.rj-editor-toolbar-select{border-radius:.5rem;min-width:5.75rem;height:2.125rem;font-family:system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1}.rj-editor-toolbar-select .ant-select-selector{font:inherit;align-items:center;min-height:2.125rem;display:flex;border-radius:.5rem!important}.rj-editor-toolbar-select .ant-select-selection-item,.rj-editor-toolbar-select .ant-select-selection-placeholder{font:inherit}.rj-editor-toolbar-select .ant-select-arrow{color:var(--rj-editor-muted-text,#526070);align-items:center;display:inline-flex}.rj-editor-toolbar-select .ant-select-suffix{align-items:center;width:1.25rem;height:1.25rem;display:inline-flex}.rj-editor-toolbar-select-font{min-width:9.25rem}.rj-editor-toolbar-select-crop{min-width:7.25rem}.rj-editor-image-width-input{width:5.25rem}.rj-editor-toolbar input[type=color]{cursor:pointer;width:2.375rem;padding:.1875rem}.rj-editor-toolbar button:disabled{cursor:not-allowed;opacity:.45}.rj-editor-color-button{min-width:2.625rem}.rj-editor-color-button svg{filter:drop-shadow(0 0 .0625rem #fff)!important}.rj-editor-text-color-mark{flex-direction:column;align-items:center;gap:.125rem;font-weight:700;line-height:1;display:inline-flex}.rj-editor-text-color-line{border-radius:62.4375rem;width:1.125rem;height:.1875rem;display:block}.rj-editor-background-color-mark{border:.0625rem solid var(--rj-editor-border,#d9dde5);border-radius:.25rem;justify-content:center;align-items:center;min-width:1.75rem;max-width:1.875rem;height:1.375rem;padding:0 .25rem;font-size:.75rem;font-weight:700;display:inline-flex}.rj-editor-background-color-mark.is-none{background:linear-gradient(135deg, transparent 45%, var(--rj-editor-focus-border,#7aa7f7) 47%, var(--rj-editor-focus-border,#7aa7f7) 53%, transparent 55%), var(--rj-editor-toolbar-button-bg,#fff)}.rj-editor-color-menu-item{color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;align-items:center;gap:.5rem;width:100%;min-width:7.5rem;padding:.125rem 0;display:flex}.rj-editor-spacing-menu-item{color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;width:100%;min-width:6rem;padding:.125rem 0}.rj-editor-color-menu-input{cursor:pointer;width:1.75rem;height:1.375rem;margin-left:auto;padding:0}.rj-editor-color-swatch,.rj-editor-color-none{border:.0625rem solid var(--rj-editor-border,#d9dde5);border-radius:.25rem;width:1.125rem;height:1.125rem;display:inline-flex}.rj-editor-color-none{background:linear-gradient(135deg, transparent 43%, #ef4444 46%, #ef4444 54%, transparent 57%), var(--rj-editor-toolbar-button-bg,#fff)}.rj-editor-toolbar button svg{width:1.125rem;height:1.125rem}.rj-editor-toolbar-divider{background:var(--rj-editor-border,#d9dde5);width:.0625rem;height:1.375rem;margin:0 .125rem}.rj-editor-table-icon span{border:.09375rem solid;border-radius:.125rem}.rj-editor-table-menu{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 .75rem 1.75rem #0f172a24);border-radius:.5rem;gap:.625rem;min-width:16.25rem;padding:.75rem;display:grid}.rj-editor-table-menu-title{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.875rem;font-weight:700;line-height:1.2}.rj-editor-table-grid{grid-template-columns:repeat(10,1.125rem);gap:.3125rem;display:grid}.rj-editor-table-grid button{background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.125rem;width:1.125rem;min-width:1.125rem;height:1.125rem;padding:0}.rj-editor-table-grid button:hover,.rj-editor-table-grid button.is-selected{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-table-menu-divider{background:var(--rj-editor-border,#d9dde5);height:.0625rem;margin:.125rem -.75rem}.rj-editor-table-menu-row{grid-template-columns:1fr 4.75rem;align-items:center;gap:.625rem;display:grid}.rj-editor-table-menu-row label{color:var(--rj-editor-text,#111827);font-family:system-ui,sans-serif;font-size:.8125rem;font-weight:500;line-height:1.2}.rj-editor-footer{background:var(--rj-editor-toolbar-bg,#f8fafc);border-top:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-muted-text,#526070);align-items:center;gap:.75rem;min-height:2.125rem;padding:.375rem .75rem;font-size:.75rem;font-weight:500;line-height:1.2;display:flex;overflow:hidden}.rj-editor-footer-items{flex-wrap:wrap;align-items:center;gap:.375rem .875rem;width:100%;min-width:0;display:flex}.rj-editor-footer-item{white-space:nowrap;flex:none;align-items:center;gap:.25rem;display:inline-flex}.rj-editor-footer-item-value{color:var(--rj-editor-text,#111827);font-weight:600}.rj-editor-footer-spacer{flex:auto;min-width:.5rem}.rj-editor{border:.0625rem solid var(--rj-editor-border,#d9dde5);background:var(--rj-editor-bg,#fff);color:var(--rj-editor-text,#111827);text-align:left;border-radius:.5rem;transition:border-color .2s,box-shadow .2s;overflow:hidden}.rj-editor[data-rj-editor-theme=dark]{accent-color:var(--rj-color-brand,#b8b8b8)}.rj-editor[data-rj-editor-theme=dark] ::selection{color:#fff;background:#555}.rj-editor-hidden-file-input{display:none!important}.ant-form-item-has-error .rj-editor{border-color:var(--rj-editor-error-border,#ff4d4f);box-shadow:0 0 0 .125rem var(--rj-editor-error-shadow,#ff4d4f1a)}.ant-form-item-has-warning .rj-editor{border-color:var(--rj-editor-warning-border,#faad14);box-shadow:0 0 0 .125rem var(--rj-editor-warning-shadow,#faad141a)}.ant-form-item-has-error .rj-editor .rj-editor-toolbar-select .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-toolbar-select .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-border,#d9dde5)!important;box-shadow:none!important}.ant-form-item-has-error .rj-editor .rj-editor-toolbar-select.ant-select-focused .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-toolbar-select.ant-select-focused .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-focused.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-toolbar-select.ant-select-focused.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-focus-border,#7aa7f7)!important;box-shadow:0 0 0 .125rem var(--rj-editor-focus-ring,#7aa7f738)!important}.ant-form-item-has-error .rj-editor .rj-editor-code-block-language-select .ant-select-selector,.ant-form-item-has-warning .rj-editor .rj-editor-code-block-language-select .ant-select-selector,.rj-editor .rj-editor-code-block-language-select.ant-select-status-error .ant-select-selector,.rj-editor .rj-editor-code-block-language-select.ant-select-status-warning .ant-select-selector{border-color:var(--rj-editor-code-border,#34363a)!important;box-shadow:none!important}.rj-editor--fullscreen{z-index:1000;border-radius:0;flex-direction:column;display:flex;position:fixed;inset:0}.rj-editor-body{flex:auto;min-height:0;position:relative}.rj-editor-input{outline:none;min-height:13.75rem;padding:1.125rem}.rj-editor--fullscreen .rj-editor-input{height:100%;min-height:0;overflow:auto}.rj-editor-placeholder{color:var(--rj-editor-placeholder,#8a94a6);pointer-events:none;-webkit-user-select:none;user-select:none;position:absolute;top:1.125rem;left:1.125rem}.rj-editor-paragraph{margin:0 0 .75rem}.rj-editor-paragraph:last-child{margin-bottom:0}.rj-editor-text-bold{font-weight:700}.rj-editor-text-code{background:var(--rj-editor-inline-code-bg,#2a2828);border:.0625rem solid var(--rj-editor-inline-code-border,#ffffff24);color:var(--rj-editor-inline-code-text,#ededed);white-space:pre-wrap;border-radius:.375rem;padding:.125rem .375rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.92em;line-height:1.35}.rj-editor-code-block{background:var(--rj-editor-code-bg,#0b0c0e);border:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-text,#ededed);scrollbar-color:var(--rj-editor-code-border,#34363a) transparent;scrollbar-width:thin;tab-size:2;white-space:pre;border-radius:.5rem;outline:none;min-height:7rem;margin:.75rem 0;padding:3.625rem 1rem 1.125rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.8125rem;line-height:1.65;display:block;position:relative;overflow:auto}.rj-editor-code-block:before{background:var(--rj-editor-code-header-bg,#111214);border-bottom:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);content:\">_ \" attr(data-language);align-items:center;height:2.625rem;padding:0 .875rem;font-family:inherit;font-size:.75rem;display:flex;position:absolute;top:0;left:0;right:0}.rj-editor-code-block-actions{z-index:20;align-items:center;gap:.3125rem;width:11.875rem;display:inline-flex;position:absolute}.rj-editor-code-block-language-select{flex:auto;min-width:0}.rj-editor-code-block-language-select.ant-select .ant-select-selector{background-color:var(--rj-editor-code-header-bg,#111214)!important;border-color:var(--rj-editor-code-border,#34363a)!important;color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-select .ant-select-selection-item,.rj-editor-code-block-language-select .ant-select-arrow,.rj-editor-code-block-language-select .ant-select-suffix{color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-popup{border:.0625rem solid var(--rj-editor-code-border,#34363a);background:var(--rj-editor-code-header-bg,#111214)!important}.rj-editor-code-block-language-popup .ant-select-item{color:var(--rj-editor-code-text,#ededed)!important}.rj-editor-code-block-language-popup .ant-select-item-option-active,.rj-editor-code-block-language-popup .ant-select-item-option-selected{background:#303030!important}.rj-editor-code-block-actions button{background:var(--rj-editor-code-header-bg,#111214);border:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);cursor:pointer;border-radius:.375rem;flex:0 0 1.75rem;justify-content:center;align-items:center;height:1.75rem;padding:0;display:inline-flex}.rj-editor-code-block-actions button:hover,.rj-editor-code-block-actions button.is-copied{color:var(--rj-editor-code-text,#ededed);background:#303030;border-color:#787878}.rj-editor-code-block-actions button svg{width:1rem;height:1rem}.rj-editor-code-block-export{background:var(--rj-editor-code-bg,#0b0c0e);border:.0625rem solid var(--rj-editor-code-border,#34363a);border-radius:.5rem;max-width:100%;margin:.75rem 0;overflow:hidden}.rj-editor-code-block-export-header{background:var(--rj-editor-code-header-bg,#111214);border-bottom:.0625rem solid var(--rj-editor-code-border,#34363a);color:var(--rj-editor-code-muted,#a1a1aa);justify-content:space-between;align-items:center;height:2.625rem;padding:0 .5rem 0 .875rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.75rem;display:flex}.rj-editor-code-block-export-copy{color:var(--rj-editor-code-muted,#a1a1aa);cursor:pointer;background:0 0;border:.0625rem solid #0000;border-radius:.375rem;justify-content:center;align-items:center;width:1.75rem;height:1.75rem;padding:0;display:inline-flex}.rj-editor-code-block-export-copy:hover,.rj-editor-code-block-export-copy.is-copied{color:var(--rj-editor-code-text,#ededed);background:#303030;border-color:#787878}.rj-editor-code-block-export-copy svg{width:1rem;height:1rem}.rj-editor-code-block.rj-editor-code-block--exported{border:0;border-radius:0;min-height:4.375rem;margin:0;padding:1rem}.rj-editor-code-block.rj-editor-code-block--exported:before{content:none;display:none}.rj-editor-code-token-comment{color:var(--rj-editor-code-comment,#7f848e)}.rj-editor-code-token-atrule,.rj-editor-code-token-keyword,.rj-editor-code-token-important{color:var(--rj-editor-code-keyword,#c678dd)}.rj-editor-code-token-attr,.rj-editor-code-token-char,.rj-editor-code-token-inserted,.rj-editor-code-token-regex,.rj-editor-code-token-selector,.rj-editor-code-token-string{color:var(--rj-editor-code-string,#98c379)}.rj-editor-code-token-boolean,.rj-editor-code-token-constant,.rj-editor-code-token-number,.rj-editor-code-token-symbol{color:var(--rj-editor-code-number,#d19a66)}.rj-editor-code-token-class,.rj-editor-code-token-class-name,.rj-editor-code-token-function{color:var(--rj-editor-code-function,#61afef)}.rj-editor-code-token-builtin,.rj-editor-code-token-entity,.rj-editor-code-token-operator,.rj-editor-code-token-property,.rj-editor-code-token-punctuation,.rj-editor-code-token-url,.rj-editor-code-token-variable{color:var(--rj-editor-code-operator,#56b6c2)}.rj-editor-code-token-deleted,.rj-editor-code-token-tag{color:var(--rj-editor-code-tag,#e06c75)}.rj-editor-text-italic{font-style:italic}.rj-editor-text-strikethrough{text-decoration:line-through}.rj-editor-text-subscript{vertical-align:sub;font-size:.75em}.rj-editor-text-superscript{vertical-align:super;font-size:.75em}.rj-editor-text-underline{text-decoration:underline}.rj-editor-input a{color:var(--rj-editor-link,#2563eb);text-decoration:underline}.rj-editor-input hr{border:0;border-top:.0625rem solid var(--rj-editor-border,#d9dde5);margin:1rem 0}.rj-editor-equation-node{display:inline}.rj-editor-equation{cursor:pointer;scrollbar-width:thin;vertical-align:middle;border-radius:.375rem;min-width:0;max-width:100%;padding:.125rem .25rem;display:inline-flex;overflow-x:auto}.rj-editor-equation--block{justify-content:center;width:100%;margin:.625rem 0;padding:.5rem;display:flex;overflow-x:auto}.rj-editor-equation-editor{flex-direction:column;align-items:center;gap:.5rem;min-width:0;max-width:100%;display:inline-flex}.rj-editor-equation-editor input:not(.rj-editor-equation-slot-input){background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border:.0625rem solid var(--rj-editor-focus-border,#7aa7f7);color:var(--rj-editor-text,#111827);resize:none;text-align:center;border-radius:.25rem;outline:none;min-width:16.25rem;min-height:2.125rem;padding:.25rem .5rem;font-family:Georgia,Times New Roman,serif;font-size:1.125rem;font-weight:500;line-height:1.25}.rj-editor-equation-editor input::placeholder,.rj-editor-equation-content.is-empty{color:var(--rj-editor-placeholder,#8a94a6)}.rj-editor-equation-visual-editor{align-items:center;min-width:0;min-height:2.125rem;display:inline-flex}.rj-editor-equation-visual,.rj-editor-equation-render{vertical-align:middle;justify-content:center;align-items:center;gap:.25rem;min-width:0;max-width:100%;font-family:Georgia,Times New Roman,serif;font-size:1.25rem;font-style:italic;line-height:1.15;display:inline-flex}.rj-editor-equation-visual{min-height:2.125rem}.rj-editor-equation-render-slot{text-align:center;text-overflow:ellipsis;min-width:.625rem;max-width:8.75rem;display:inline-block;overflow:hidden}.rj-editor-equation-nested{align-items:center;min-width:0;display:inline-flex}.rj-editor-equation-insert-point{appearance:none;cursor:text;background:0 0;border:0;border-radius:.125rem;flex:0 0 .5rem;align-self:stretch;width:.5rem;min-height:1.5rem;margin:0 -.125rem;padding:0;display:inline-flex;position:relative}.rj-editor-equation-insert-point:after{background:var(--rj-editor-focus-border,#7aa7f7);content:\"\";opacity:0;border-radius:.125rem;width:.125rem;transition:opacity .12s;position:absolute;top:.1875rem;bottom:.1875rem;left:50%;transform:translate(-50%)}.rj-editor-equation-insert-point:hover:after,.rj-editor-equation-insert-point.is-active:after{opacity:1}.rj-editor-equation-slot-input{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border:.0625rem dashed var(--rj-editor-focus-border,#7aa7f7);color:var(--rj-editor-text,#111827);box-sizing:border-box;text-align:center;text-overflow:clip;border-radius:.25rem;outline:none;flex:none;width:auto;min-width:1.375rem;max-width:9.375rem;min-height:1.5rem;padding:.0625rem .3125rem;font-family:Georgia,Times New Roman,serif;font-size:1.125rem;font-style:italic;font-weight:600;line-height:1.2;overflow:hidden}.rj-editor-equation-editor .rj-editor-equation-slot-input{width:auto;min-width:1.375rem;min-height:1.5rem;padding:.0625rem .3125rem;font-size:1.125rem}.rj-editor-equation-slot-input:focus{box-shadow:0 0 0 .125rem var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-style:solid}.rj-editor-equation-slot-input::placeholder{color:var(--rj-editor-muted-text,#526070)}.rj-editor-equation-slot-input--limit,.rj-editor-equation-slot-input--script,.rj-editor-equation-slot-input--small,.rj-editor-equation-slot-input--root-index,.rj-editor-equation-editor .rj-editor-equation-slot-input--limit,.rj-editor-equation-editor .rj-editor-equation-slot-input--script,.rj-editor-equation-editor .rj-editor-equation-slot-input--small,.rj-editor-equation-editor .rj-editor-equation-slot-input--root-index{min-width:1.125rem;min-height:1.125rem;padding:.0625rem .25rem;font-size:.8125rem}.rj-editor-equation-slot-input--small{min-width:1.125rem}.rj-editor-equation-slot-input--matrix{min-width:1.375rem}.rj-editor-equation-visual--fraction,.rj-editor-equation-render--fraction{place-items:center;gap:.125rem;min-width:0;display:inline-grid}.rj-editor-equation-fraction-line,.rj-editor-equation-render-line{background:var(--rj-editor-text,#111827);width:100%;height:.125rem;display:block}.rj-editor-equation-visual--fraction-inline,.rj-editor-equation-render--fraction-inline,.rj-editor-equation-visual--row,.rj-editor-equation-render--row{flex-wrap:nowrap;align-items:center;gap:.125rem;min-width:0;display:inline-flex}.rj-editor-equation-visual--script,.rj-editor-equation-render--script{vertical-align:middle;align-items:center;gap:.125rem}.rj-editor-equation-script-stack,.rj-editor-equation-render-script-stack{place-items:center;gap:.0625rem;line-height:1;display:inline-grid}.rj-editor-equation-visual--script.has-superscript:not(.has-subscript) .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-superscript:not(.has-subscript) .rj-editor-equation-render-script-stack{transform:translateY(-.4375rem)}.rj-editor-equation-visual--script.has-subscript:not(.has-superscript) .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-subscript:not(.has-superscript) .rj-editor-equation-render-script-stack{transform:translateY(.4375rem)}.rj-editor-equation-visual--script.has-superscript.has-subscript .rj-editor-equation-script-stack,.rj-editor-equation-render--script.has-superscript.has-subscript .rj-editor-equation-render-script-stack{transform:translateY(-.0625rem)}.rj-editor-equation-render-script-stack{font-size:.68em}.rj-editor-equation-visual--root,.rj-editor-equation-render--root{align-items:flex-start;gap:0}.rj-editor-equation-root-symbol,.rj-editor-equation-render-root-symbol{font-size:1.875rem;font-style:normal;line-height:1}.rj-editor-equation-radicand,.rj-editor-equation-render-radicand{border-top:.125rem solid var(--rj-editor-text,#111827);margin-top:.125rem;padding:.125rem .25rem 0;display:inline-flex}.rj-editor-equation-slot-input--root-index,.rj-editor-equation-render-root-index{align-self:flex-start;margin-right:-.125rem}.rj-editor-equation-render-root-index{font-size:.62em}.rj-editor-equation-limits,.rj-editor-equation-render-limits{place-items:center;gap:.0625rem;line-height:1;display:inline-grid}.rj-editor-equation-render-limits span:first-child,.rj-editor-equation-render-limits span:last-child{font-size:.62em}.rj-editor-equation-large-symbol,.rj-editor-equation-render-large-symbol{font-size:2.125rem;font-style:normal;line-height:.9}.rj-editor-equation-function-name{font-style:normal;font-weight:600}.rj-editor-equation-bracket,.rj-editor-equation-render-bracket,.rj-editor-equation-matrix-bracket,.rj-editor-equation-render-matrix-bracket{font-size:2.125rem;font-style:normal;line-height:1}.rj-editor-equation-visual--accent,.rj-editor-equation-render--accent{justify-items:center;gap:0;display:inline-grid}.rj-editor-equation-accent-mark,.rj-editor-equation-render-accent-mark{font-size:1.125rem;line-height:.7}.rj-editor-equation-matrix-grid,.rj-editor-equation-render-matrix-grid{gap:.25rem .5rem;display:inline-grid}.rj-editor-equation-render-matrix-grid span{text-align:center;min-width:1.5rem}.rj-editor-equation.is-selected{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-equation-content,.rj-editor-equation-content math{max-width:100%}.rj-editor-equation-content .katex-display{margin:0}.rj-editor-image-node{margin:.75rem 0;display:block}.rj-editor-youtube-node{clear:both;margin:1rem 0;display:block}.rj-editor-youtube{aspect-ratio:16/9;background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);cursor:pointer;border-radius:.5rem;width:100%;max-width:45rem;overflow:hidden}.rj-editor-youtube.is-selected{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-youtube iframe{border:0;width:100%;height:100%;display:block}.rj-editor-image-frame{width:100%;display:flex;position:relative}.rj-editor-image-frame--wrap-square{width:auto;max-width:100%;display:block}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--left{float:left;margin:.25rem 1rem .625rem 0}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--right{float:right;margin:.25rem 0 .625rem 1rem}.rj-editor-image-frame--wrap-square.rj-editor-image-frame--center,.rj-editor-image-frame--wrap-top-bottom{clear:both;width:100%;display:flex}.rj-editor-image-frame--left{justify-content:flex-start}.rj-editor-image-frame--center{justify-content:center}.rj-editor-image-frame--right{justify-content:flex-end}.rj-editor-image{width:100%;max-width:100%;height:auto;display:block}.rj-editor-image-box{transform-origin:50%;flex-direction:column;display:inline-flex;position:relative}.rj-editor-image-rotator{transform:rotate(var(--rj-image-rotation,0deg));transform-origin:50%;width:100%;display:block}.rj-editor-image-box.is-quarter-turn{display:block}.rj-editor-image-box.is-quarter-turn .rj-editor-image-rotator{transform:translate(-50%, -50%) rotate(var(--rj-image-rotation,0deg));position:absolute;top:50%;left:50%}.rj-editor-image-box.is-quarter-turn .rj-editor-image-link,.rj-editor-image-box.is-quarter-turn .rj-editor-image{width:100%;max-width:none;height:100%}.rj-editor-image-box.is-quarter-turn .rj-editor-image-caption{width:100%;position:absolute;top:100%;left:0}.rj-editor-image-box.has-border .rj-editor-image{border:.0625rem solid var(--rj-editor-image-border,#94a3b8)}.rj-editor-image-box.has-shadow .rj-editor-image{box-shadow:var(--rj-editor-image-shadow,0 .875rem 2rem #0f172a2e)}.rj-editor-image-link{display:block}.rj-editor-image-caption{color:var(--rj-editor-muted-text,#64748b);text-align:center;margin-top:.375rem;font-family:system-ui,sans-serif;font-size:.75rem;font-weight:500;line-height:1.35;display:block}.rj-editor-image-frame.is-selected .rj-editor-image-box{outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:.125rem}.rj-editor-image-floating-toolbar{background:var(--rj-editor-toolbar-bg,#f8fafc);border:.0625rem solid var(--rj-editor-border,#d9dde5);box-shadow:var(--rj-editor-floating-shadow,0 .75rem 1.75rem #0f172a24);z-index:1005;border-radius:.5rem;align-items:center;gap:.25rem;padding:.25rem;display:inline-flex;position:absolute}.rj-editor-image-floating-toolbar button{background:var(--rj-editor-toolbar-button-bg,#fff);border:.0625rem solid var(--rj-editor-border,#d9dde5);color:var(--rj-editor-text,#111827);cursor:pointer;border-radius:.375rem;justify-content:center;align-items:center;min-width:1.75rem;height:1.75rem;padding:0 .4375rem;font-family:system-ui,sans-serif;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.rj-editor-image-floating-toolbar button svg{width:1.25rem;height:1.25rem}.rj-editor-image-floating-toolbar button:hover{background:var(--rj-editor-toolbar-button-active-bg,#eaf2ff);border-color:var(--rj-editor-focus-border,#7aa7f7)}.rj-editor-image-resize-handle{background:var(--rj-editor-focus-border,#7aa7f7);border:.125rem solid var(--rj-editor-bg,#fff);touch-action:none;z-index:2;border-radius:62.4375rem;width:.75rem;height:.75rem;position:absolute;transform:translate(-50%,-50%)}.rj-editor-image-resize-handle--left{cursor:ew-resize;top:50%;left:0}.rj-editor-image-resize-handle--right{cursor:ew-resize;top:50%;left:100%}.rj-editor-image-resize-handle--top{cursor:ns-resize;top:0;left:50%}.rj-editor-image-resize-handle--bottom{cursor:ns-resize;top:100%;left:50%}.rj-editor-image-resize-handle--top-left{cursor:nwse-resize;top:0;left:0}.rj-editor-image-resize-handle--top-right{cursor:nesw-resize;top:0;left:100%}.rj-editor-image-resize-handle--bottom-right{cursor:nwse-resize;top:100%;left:100%}.rj-editor-image-resize-handle--bottom-left{cursor:nesw-resize;top:100%;left:0}.rj-editor-table-scrollable-wrapper{max-width:100%;margin:.75rem 0;overflow-x:auto}.rj-editor-table{border-collapse:collapse;table-layout:fixed;width:100%}.rj-editor-table-cell,.rj-editor-table-cell-header{border:.0625rem solid var(--rj-editor-table-border,#cbd5e1);box-sizing:border-box;vertical-align:top;min-width:5rem;height:2rem;padding:.5rem .625rem}.rj-editor-table-cell .rj-editor-paragraph,.rj-editor-table-cell-header .rj-editor-paragraph{min-height:1.25rem;margin:0;line-height:1.25rem}.rj-editor-table-cell-header{background:var(--rj-editor-table-header-bg,#f1f5f9);font-weight:700}.rj-editor-table-cell-selected{background:var(--rj-editor-table-selected-bg,#eaf2ff);outline:.125rem solid var(--rj-editor-focus-border,#7aa7f7);outline-offset:-.125rem}.rj-editor-list-ol,.rj-editor-list-ul{margin:0 0 .75rem 1.5rem;padding:0}.rj-editor-list-item{margin:.25rem 0}\n/*$vite$:1*/";
|
|
3
3
|
function injectRJEditorStyle() {
|
|
4
4
|
if (typeof document === "undefined" || document.getElementById(RJ_EDITOR_STYLE_ID)) return;
|
|
5
5
|
const style = document.createElement("style");
|
|
@@ -8,4 +8,59 @@ function injectRJEditorStyle() {
|
|
|
8
8
|
document.head.appendChild(style);
|
|
9
9
|
}
|
|
10
10
|
injectRJEditorStyle();
|
|
11
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`lexical`),require(`katex`),require(`katex/contrib/mhchem`),require(`@lexical/html`),require(`@lexical/react/LexicalComposer`),require(`antd`),require(`react`),require(`react-redux`),require(`@reduxjs/toolkit`),require(`react/jsx-runtime`),require(`@lexical/link`),require(`@lexical/list`),require(`@lexical/table`),require(`@lexical/code`),require(`@lexical/react/LexicalComposerContext`),require(`@lexical/react/useLexicalNodeSelection`),require(`@lexical/react/LexicalAutoFocusPlugin`),require(`@lexical/react/LexicalContentEditable`),require(`@lexical/react/LexicalErrorBoundary`),require(`@lexical/react/LexicalHistoryPlugin`),require(`@lexical/react/LexicalLinkPlugin`),require(`@lexical/react/LexicalListPlugin`),require(`@lexical/react/LexicalOnChangePlugin`),require(`@lexical/react/LexicalRichTextPlugin`),require(`@lexical/react/LexicalTablePlugin`),require(`@lexical/selection`),require(`@lexical/utils`),require(`react-dom`)):typeof define==`function`&&define.amd?define(`exports.lexical.katex.katex/contrib/mhchem.@lexical/html.@lexical/react/LexicalComposer.antd.react.react-redux.@reduxjs/toolkit.react/jsx-runtime.@lexical/link.@lexical/list.@lexical/table.@lexical/code.@lexical/react/LexicalComposerContext.@lexical/react/useLexicalNodeSelection.@lexical/react/LexicalAutoFocusPlugin.@lexical/react/LexicalContentEditable.@lexical/react/LexicalErrorBoundary.@lexical/react/LexicalHistoryPlugin.@lexical/react/LexicalLinkPlugin.@lexical/react/LexicalListPlugin.@lexical/react/LexicalOnChangePlugin.@lexical/react/LexicalRichTextPlugin.@lexical/react/LexicalTablePlugin.@lexical/selection.@lexical/utils.react-dom`.split(`.`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.RJEditor={},e.Lexical,e.katex,e.katex,e.Lexical,e.Lexical,e.antd,e.React,e.ReactRedux,e.RTK,e.jsxRuntime,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.ReactDOM))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var ee=Object.create,te=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,re=Object.getOwnPropertyNames,ie=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty,oe=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=re(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ae.call(e,s)&&s!==n&&te(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ne(t,s))||r.enumerable});return e},k=(e,t,n)=>(n=e==null?{}:ee(ie(e)),oe(t||!e||!e.__esModule?te(n,`default`,{value:e,enumerable:!0}):n,e));n=k(n,1),s=k(s,1);function se(e){return typeof e!=`string`}function A(e,t){let[n,...r]=t.split(`>`);if(r.length>0){let t=A(e,n);return se(t)?A(t,r.join(`>`)):``}switch(e.kind){case`accent`:case`bracket`:case`text`:return`value`in e&&t===`${e.kind}.value`?e.value:``;case`fraction`:return t===`fraction.denominator`?e.denominator:t===`fraction.numerator`?e.numerator:``;case`function`:return t===`function.argument`?e.argument:``;case`integral`:return t===`integral.body`?e.body:t===`integral.lower`?e.lower||``:t===`integral.upper`?e.upper||``:t===`integral.variable`?e.variable:``;case`largeOperator`:return t===`largeOperator.body`?e.body:t===`largeOperator.lower`?e.lower||``:t===`largeOperator.upper`&&e.upper||``;case`limit`:return t===`limit.body`?e.body:t===`limit.target`?e.target:``;case`matrix`:{let[,,n,r]=t.split(`.`),i=Number(n),a=Number(r);return e.cells[i]?.[a]||``}case`operator`:return t===`operator.value`?e.value:``;case`root`:return t===`root.index`?e.index||``:t===`root.value`?e.value:``;case`row`:{let[,,n]=t.split(`.`),r=Number(n);return e.items[r]||``}case`script`:return t===`script.base`?e.base:t===`script.subscript`?e.subscript||``:t===`script.superscript`&&e.superscript||``;default:return``}}function ce(e){let t=e.split(`>`),n=t.at(-1)?.match(/^row\.insert\.(\d+)$/);return n?{insertIndex:Number(n[1]),rowSlotId:t.slice(0,-1).join(`>`)}:null}function le(e){return typeof e!=`string`}function ue(e,t,n){return le(e)?j(e,t,n):e}function j(e,t,n){let[r,...i]=t.split(`>`);if(i.length>0){let t=i.join(`>`);return j(e,r,ue(de(e,r),t,n))}switch(e.kind){case`accent`:return t===`accent.value`?{...e,value:n}:e;case`bracket`:return t===`bracket.value`?{...e,value:n}:e;case`fraction`:return t===`fraction.denominator`?{...e,denominator:n}:t===`fraction.numerator`?{...e,numerator:n}:e;case`function`:return t===`function.argument`?{...e,argument:n}:e;case`integral`:return t===`integral.body`?{...e,body:n}:t===`integral.lower`?{...e,lower:n}:t===`integral.upper`?{...e,upper:n}:t===`integral.variable`?{...e,variable:n}:e;case`largeOperator`:return t===`largeOperator.body`?{...e,body:n}:t===`largeOperator.lower`?{...e,lower:n}:t===`largeOperator.upper`?{...e,upper:n}:e;case`limit`:return t===`limit.body`?{...e,body:n}:t===`limit.target`?{...e,target:n}:e;case`matrix`:{let[,,r,i]=t.split(`.`),a=Number(r),o=Number(i);return Number.isNaN(a)||Number.isNaN(o)||!e.cells[a]?e:{...e,cells:e.cells.map((e,t)=>t===a?e.map((e,t)=>t===o?n:e):e)}}case`operator`:return t===`operator.value`&&typeof n==`string`?{...e,value:n}:e;case`row`:{let[,,r]=t.split(`.`),i=Number(r);return!le(n)||Number.isNaN(i)?e:{...e,items:e.items.map((e,t)=>t===i?n:e)}}case`root`:return t===`root.index`?{...e,index:n}:t===`root.value`?{...e,value:n}:e;case`script`:return t===`script.base`?{...e,base:n}:t===`script.subscript`?{...e,subscript:n}:t===`script.superscript`?{...e,superscript:n}:e;case`text`:return t===`text.value`&&typeof n==`string`?{...e,value:n}:e;default:return e}}function de(e,t){switch(e.kind){case`accent`:case`bracket`:case`text`:return`value`in e&&t===`${e.kind}.value`?e.value:``;case`fraction`:return t===`fraction.denominator`?e.denominator:t===`fraction.numerator`?e.numerator:``;case`function`:return t===`function.argument`?e.argument:``;case`integral`:return t===`integral.body`?e.body:t===`integral.lower`?e.lower||``:t===`integral.upper`?e.upper||``:t===`integral.variable`?e.variable:``;case`largeOperator`:return t===`largeOperator.body`?e.body:t===`largeOperator.lower`?e.lower||``:t===`largeOperator.upper`&&e.upper||``;case`limit`:return t===`limit.body`?e.body:t===`limit.target`?e.target:``;case`matrix`:{let[,,n,r]=t.split(`.`),i=Number(n),a=Number(r);return e.cells[i]?.[a]||``}case`operator`:return t===`operator.value`?e.value:``;case`root`:return t===`root.index`?e.index||``:t===`root.value`?e.value:``;case`row`:{let[,,n]=t.split(`.`),r=Number(n);return e.items[r]||``}case`script`:return t===`script.base`?e.base:t===`script.subscript`?e.subscript||``:t===`script.superscript`&&e.superscript||``;default:return``}}function M(e){return{kind:`text`,value:e}}function fe(e,t,n){if(typeof e==`string`){let r=Math.max(0,Math.min(n?.start??e.length,e.length)),i=Math.max(r,Math.min(n?.end??r,e.length));return`${e.slice(0,r)}${t}${e.slice(i)}`}if(e.kind===`row`){let n=e.items.at(-1);return n?.kind===`text`&&typeof n.value==`string`?{...e,items:[...e.items.slice(0,-1),{...n,value:`${n.value}${t}`}]}:{...e,items:[...e.items,M(t)]}}return{items:[e,M(t)],kind:`row`}}function pe(e,t,n,r){let i=ce(t);if(i){let t=i.rowSlotId?A(e,i.rowSlotId):e;if(typeof t!=`string`&&t.kind===`row`){let r=Math.max(0,Math.min(i.insertIndex,t.items.length)),a=M(n),o={...t,items:[...t.items.slice(0,r),a,...t.items.slice(r)]};return{activeSlotId:[i.rowSlotId,`row.items.${r}>text.value`].filter(Boolean).join(`>`),model:i.rowSlotId?j(e,i.rowSlotId,o):o,selection:{end:n.length,start:n.length}}}}let a=A(e,t),o=typeof a==`string`?Math.max(0,Math.min(r?.start??a.length,a.length)):n.length;return{activeSlotId:t,model:j(e,t,fe(a,n,r)),selection:{end:o+n.length,start:o+n.length}}}function me(e,t,n){return typeof t==`number`&&e<t?t:typeof n==`number`&&e>n?n:e}async function he(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}if(typeof document>`u`)return;let t=document.createElement(`textarea`);t.setAttribute(`aria-hidden`,`true`),t.style.position=`fixed`,t.style.opacity=`0`,t.value=e,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}var ge=`rj-equation-model:`;function _e(e){return e.startsWith(ge)}function ve(e){if(!_e(e))return null;try{return JSON.parse(decodeURIComponent(e.slice(ge.length)))}catch{return null}}function ye(e){return`${ge}${encodeURIComponent(JSON.stringify(e))}`}var be={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`};function xe(e){return e.replace(/[&"'<>]/g,e=>be[e])}function Se(e,t){if(!t||e===``)return e;let n=e.endsWith(`.`),[r,i]=e.split(`.`),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,` `);return typeof i==`string`?`${a}.${i}`:n?`${a}.`:a}function Ce(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function N(e,t){return`${e.replace(/\bMOD\b/g,Ce()?`CMD`:`CTRL`)} | ${t}`}function P(e){switch(e.kind){case`accent`:case`bracket`:case`text`:return`${e.kind}.value`;case`fraction`:return`fraction.numerator`;case`function`:return`function.argument`;case`integral`:return e.upper===void 0?e.lower===void 0?`integral.body`:`integral.lower`:`integral.upper`;case`largeOperator`:return`largeOperator.upper`;case`limit`:return`limit.target`;case`matrix`:return`matrix.cells.0.0`;case`operator`:return`operator.value`;case`row`:return e.items[0]?`row.items.0>${P(e.items[0])}`:``;case`root`:return e.index===void 0?`root.value`:`root.index`;case`script`:return e.position===`before`?e.superscript===void 0?`script.subscript`:`script.superscript`:`script.base`;default:return``}}var we=/^[a-zA-Z0-9_-]{11}$/;function Te(e){let t=e.trim();if(we.test(t))return t;try{let e=new URL(t),n=e.hostname.replace(/^www\./,``);if(n===`youtu.be`){let t=e.pathname.split(`/`).filter(Boolean)[0];return t&&we.test(t)?t:null}if(n===`youtube.com`||n===`m.youtube.com`||n===`youtube-nocookie.com`){let t=e.searchParams.get(`v`);if(t&&we.test(t))return t;let[,n,r]=e.pathname.split(`/`);if([`embed`,`live`,`shorts`].includes(n)&&r&&we.test(r))return r}}catch{return null}return null}function Ee(e){return{kind:`text`,value:e}}function De(e,t,n){if(typeof e==`string`){let r=Math.max(0,Math.min(n?.start??e.length,e.length)),i=Math.max(r,Math.min(n?.end??r,e.length)),a=e.slice(0,r),o=e.slice(i);return{items:[a?Ee(a):null,t,o?Ee(o):null].filter(Boolean),kind:`row`}}if(e.kind===`row`){let n=e.items.at(-1),r=n?.kind===`text`&&typeof n.value==`string`&&!n.value.trim();return{...e,items:r?[...e.items.slice(0,-1),t]:[...e.items,t]}}return{items:[e,t],kind:`row`}}function Oe(e,t){if(!t)return e.kind===`row`?e:null;let n=A(e,t);return typeof n!=`string`&&n.kind===`row`?n:null}function ke(e){let t=e.split(`>`);return t.at(-1)===`text.value`?t.slice(0,-1).join(`>`):null}function Ae(e,t){return e?`${e}>${t}`:t}function je(e,t,n,r){if(typeof t==`string`&&!t.trim())return Ae(e,`row.items.0>${P(n)}`);if(typeof t==`string`)return Ae(e,`row.items.${r?.start&&r.start>0?1:0}>${P(n)}`);if(typeof t!=`string`&&t.kind===`row`){let r=t.items.at(-1);return Ae(e,`row.items.${r?.kind===`text`&&typeof r.value==`string`&&!r.value.trim()?t.items.length-1:t.items.length}>${P(n)}`)}return Ae(e,`row.items.1>${P(n)}`)}function Me(e,t,n,r){let i=ce(t);if(i){let t=Oe(e,i.rowSlotId);if(!t)return{activeSlotId:P(n),model:e};let r=Math.max(0,Math.min(i.insertIndex,t.items.length)),a={...t,items:[...t.items.slice(0,r),n,...t.items.slice(r)]};return{activeSlotId:Ae(i.rowSlotId,`row.items.${r}>${P(n)}`),model:i.rowSlotId?j(e,i.rowSlotId,a):a}}let a=ke(t),o=A(e,t),s=De(o,n,r);return a===null?{activeSlotId:je(t,o,n,r),model:j(e,t,s)}:{activeSlotId:je(a,o,n,r),model:a?j(e,a,s):s}}function Ne(e,t,n){let r=e.replace(/,/g,`.`).replace(/\s/g,``),i=``,a=!1,o=0;for(let e of r){if(/\d/.test(e)){if(a){if(o>=t)continue;o+=1}i+=e;continue}!n&&e===`.`&&!a&&(a=!0,i+=e)}return i}var F=[`#FFFFFF`,`#FEF3C7`,`#DBEAFE`,`#DCFCE7`,`#FCE7F3`,`#EDE9FE`,`#E5E7EB`],Pe=`rj-editor-equation-insert`,Fe=[`Arial`,`Georgia`,`Inter`,`Times New Roman`,`Trebuchet MS`,`Verdana`],Ie=[`0.5rem`,`0.5625rem`,`0.6875rem`,`0.75rem`,`0.875rem`,`1rem`,`1.125rem`,`1.25rem`,`1.5rem`,`2rem`,`3rem`,`4.5rem`],I={alignment:``,backgroundColor:``,canRedo:!1,canUndo:!1,fontFamily:void 0,fontSize:void 0,isEquationSelected:!1,isBold:!1,isCode:!1,isImageSelected:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1,isInTable:!1,lineHeight:void 0,listType:void 0,selectedImageAlignment:void 0,selectedImageAltText:void 0,selectedImageAspectRatioLocked:void 0,selectedImageBorderEnabled:void 0,selectedImageBorderRadius:void 0,selectedImageCaption:void 0,selectedImageHeight:void 0,selectedImageKey:void 0,selectedImageLinkUrl:void 0,selectedImageObjectFit:void 0,selectedImageRotation:void 0,selectedImageShadowEnabled:void 0,selectedImageTextWrap:void 0,selectedImageWidth:void 0,selectedEquation:void 0,selectedEquationDisplayMode:void 0,selectedEquationKey:void 0,selectedTableCellsCount:0,tableCellBackgroundColor:``,tableCellVerticalAlign:void 0,tableHasMergedCell:!1,textColor:``},Le=(0,t.createCommand)(`INSERT_CODE_BLOCK_COMMAND`),Re=(0,t.createCommand)(`INSERT_EQUATION_COMMAND`),ze=(0,t.createCommand)(`INSERT_IMAGE_COMMAND`),Be=(0,t.createCommand)(`INSERT_YOUTUBE_COMMAND`),Ve=[`1`,`1.15`,`1.5`,`2`,`2.5`,`3`],He=`rj-editor:open-link-modal`,Ue=[`#111827`,`#dc2626`,`#2563eb`,`#059669`,`#9333ea`,`#ca8a04`];function We(e){return e.trim().replace(/^['"]|['"]$/g,``).toLowerCase()}function Ge(e){if(!e)return;let t=e.split(`,`).map(We);return Fe.find(e=>t.includes(We(e)))}function Ke(e){return e.trim().toLowerCase()}function qe(e){if(!e)return;let t=Ke(e);return Ie.find(e=>Ke(e)===t)}var Je=16;function L(e){let t=e/Je;return`${Number(t.toFixed(6))}rem`}var Ye={borderCollapse:`collapse`,tableLayout:`fixed`,width:`100%`},Xe={border:`0.0625rem solid var(--rj-editor-table-border, #cbd5e1)`,minWidth:`5rem`,padding:`0.5rem 0.625rem`},Ze=`rgb(242, 243, 245)`,Qe=`var(--rj-editor-table-header-bg, #f1f5f9)`,$e=`[data-rj-editor-content="true"]`,et=`pre.rj-editor-code-block`;function tt(e){let t=`http://www.w3.org/2000/svg`,n=e.createElementNS(t,`svg`),r=e.createElementNS(t,`path`);return n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`fill`,`none`),n.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`d`,`M5 15C4.06812 15 3.60218 15 3.23463 14.8478C2.74458 14.6448 2.35523 14.2554 2.15224 13.7654C2 13.3978 2 12.9319 2 12V5.2C2 4.0799 2 3.51984 2.21799 3.09202C2.40973 2.71569 2.71569 2.40973 3.09202 2.21799C3.51984 2 4.0799 2 5.2 2H12C12.9319 2 13.3978 2 13.7654 2.15224C14.2554 2.35523 14.6448 2.74458 14.8478 3.23463C15 3.60218 15 4.06812 15 5M12.2 22H18.8C19.9201 22 20.4802 22 20.908 21.782C21.2843 21.5903 21.5903 21.2843 21.782 20.908C22 20.4802 22 19.9201 22 18.8V12.2C22 11.0799 22 10.5198 21.782 10.092C21.5903 9.71569 21.2843 9.40973 20.908 9.21799C20.4802 9 19.9201 9 18.8 9H12.2C11.0799 9 10.5198 9 10.092 9.21799C9.71569 9.40973 9.40973 9.71569 9.21799 10.092C9 10.5198 9 11.0799 9 12.2V18.8C9 19.9201 9 20.4802 9.21799 20.908C9.40973 21.2843 9.71569 21.5903 10.092 21.782C10.5198 22 11.0799 22 12.2 22Z`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`stroke-width`,`2`),n.append(r),n}function nt(e){e.querySelectorAll(et).forEach(t=>{if(!(t instanceof HTMLElement)||t.closest(`[data-rj-editor-code-block="true"]`))return;let n=e.createElement(`div`),r=e.createElement(`div`),i=e.createElement(`span`),a=e.createElement(`button`);n.className=`rj-editor-code-block-export`,n.setAttribute(`data-rj-editor-code-block`,`true`),r.className=`rj-editor-code-block-export-header`,i.className=`rj-editor-code-block-export-language`,i.textContent=`>_ ${t.getAttribute(`data-language`)||`plain`}`,a.className=`rj-editor-code-block-export-copy`,a.setAttribute(`aria-label`,`Copy code`),a.setAttribute(`data-rj-editor-code-copy`,`true`),a.setAttribute(`title`,`Copy code`),a.setAttribute(`type`,`button`),a.append(tt(e)),t.classList.add(`rj-editor-code-block--exported`),t.replaceWith(n),r.append(i,a),n.append(r,t)})}function rt(e,t){Object.entries(t).forEach(([t,n])=>{typeof n==`string`&&e.style.setProperty(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),n)})}function it(e,t,n){n===`square`&&t===`left`&&(e.style.float=`left`,e.style.margin=`0.25rem 1rem 0.625rem 0`),n===`square`&&t===`right`&&(e.style.float=`right`,e.style.margin=`0.25rem 0 0.625rem 1rem`),n!==`square`&&t===`center`&&(e.style.marginLeft=`auto`,e.style.marginRight=`auto`),n!==`square`&&t===`right`&&(e.style.marginLeft=`auto`,e.style.marginRight=`0`),n!==`square`&&t===`left`&&(e.style.marginLeft=`0`,e.style.marginRight=`auto`)}function at(e,t){let n=e.createElement(`span`);return n.className=`rj-editor-image-caption`,n.textContent=t,n.style.color=`var(--rj-editor-muted-text, #64748b)`,n.style.display=`block`,n.style.font=`500 0.75rem/1.35 system-ui, sans-serif`,n.style.marginTop=`0.375rem`,n.style.textAlign=`center`,n.style.width=`100%`,n}function ot(e,t,n){let r=n?.trim();if(!r)return t;let i=e.createElement(`a`);return i.href=r,i.rel=`noreferrer`,i.target=`_blank`,i.style.color=`inherit`,i.style.display=`block`,i.style.textDecoration=`none`,t.replaceWith(i),i.append(t),i}function st(e){return Array.from(e.querySelectorAll(`img[data-text-wrap="square"], [data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)).some(e=>{let t=e;return t.style.float===`left`||t.style.float===`right`})}function ct(e){if(!st(e)||e.body.children.length===1&&e.body.firstElementChild?.matches($e))return;let t=e.createElement(`div`);t.className=`rj-editor-content`,t.setAttribute(`data-rj-editor-content`,`true`),t.style.display=`flow-root`,t.style.width=`100%`,t.append(...Array.from(e.body.childNodes)),e.body.append(t)}function lt(e,t){let n=t.getAttribute(`data-caption`)?.trim();if(!n)return!1;let r=t.getAttribute(`data-alignment`),i=t.getAttribute(`data-text-wrap`),a=e.createElement(`span`);return a.setAttribute(`data-rj-image-caption-wrapper`,`true`),a.style.display=`block`,a.style.maxWidth=`100%`,a.style.width=t.style.width||`fit-content`,it(a,r,i),t.style.float=``,t.style.margin=`0`,t.style.width=`100%`,t.replaceWith(a),a.append(ot(e,t,t.getAttribute(`data-link-url`)),at(e,n)),!0}function ut(e){return(Number(e||0)%360+360)%360}function dt(e,t,n){let r=t.getAttribute(`data-rj-image-node-key`),i=ut(t.getAttribute(`data-rotation`));if(!r||i!==90&&i!==270)return!1;let a=(n?.getElementByKey(r))?.querySelector(`.rj-editor-image-rotator`);if(!(a instanceof HTMLElement))return!1;let o=a.getBoundingClientRect(),s=a.offsetWidth,c=a.offsetHeight;if(!o.width||!o.height||!s||!c)return!1;let l=t.getAttribute(`data-alignment`),u=t.getAttribute(`data-caption`)?.trim(),d=t.getAttribute(`data-link-url`),f=t.getAttribute(`data-text-wrap`),p=e.createElement(`span`),m=e.createElement(`span`);return m.setAttribute(`data-rj-image-rotation-wrapper`,`true`),m.style.display=`block`,m.style.height=L(Math.ceil(o.height)),m.style.maxWidth=`100%`,m.style.position=`relative`,m.style.width=L(Math.ceil(o.width)),it(m,l,f),p.style.display=`block`,p.style.height=L(Math.ceil(o.height)),p.style.position=`relative`,p.style.width=L(Math.ceil(o.width)),t.style.display=`block`,t.style.float=``,t.style.height=L(c),t.style.left=`50%`,t.style.margin=`0`,t.style.maxWidth=`none`,t.style.position=`absolute`,t.style.top=`50%`,t.style.transform=`translate(-50%, -50%) rotate(${i}deg)`,t.style.transformOrigin=`center`,t.style.width=L(s),t.replaceWith(m),p.append(ot(e,t,d)),m.append(p),u&&m.append(at(e,u)),!0}function ft(e,t){if(!e.trim()||typeof DOMParser>`u`)return e;let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`table`).forEach(e=>{e.classList.add(`rj-editor-table`),rt(e,Ye)}),n.querySelectorAll(`td, th`).forEach(e=>{let t=e,n=e.tagName.toLowerCase()===`th`,r=t.style.backgroundColor===Ze;t.classList.add(n?`rj-editor-table-cell-header`:`rj-editor-table-cell`),rt(t,Xe),t.style.verticalAlign||(t.style.verticalAlign=`top`),n&&(!t.style.backgroundColor||r)&&(t.style.backgroundColor=Qe,t.style.fontWeight=`700`)}),n.querySelectorAll(`img[data-alignment]`).forEach(e=>{let r=e,i=r.getAttribute(`data-alignment`),a=r.getAttribute(`data-text-wrap`);dt(n,r,t)||(r.style.display=`block`,r.style.maxWidth=`100%`,it(r,i,a),lt(n,r)||ot(n,r,r.getAttribute(`data-link-url`)))}),nt(n),ct(n),n.body.innerHTML}function pt(e,t){return typeof e!=`number`||Number.isNaN(e)?``:Se(String(e),t)}var mt=1200,ht=700;function gt(){return document.fullscreenElement?new Promise(e=>{let t=()=>{window.clearTimeout(n),document.removeEventListener(`fullscreenchange`,t),e()},n=window.setTimeout(t,mt);document.addEventListener(`fullscreenchange`,t,{once:!0})}):Promise.resolve()}function _t(){return new Promise(e=>{window.setTimeout(e,ht)})}async function vt(e){if(e){if(document.fullscreenElement)try{let e=gt();await document.exitFullscreen(),await e,await _t()}catch{}e.ownerDocument.defaultView?.focus(),e.click()}}function yt(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>{n(r.error)}),r.addEventListener(`load`,()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`File could not be converted to base64.`))}),r.readAsDataURL(e)})}var bt=!1;function xt(){bt||typeof document>`u`||(bt=!0,document.addEventListener(`click`,async e=>{let t=e.target,n=t instanceof Element?t.closest(`[data-rj-editor-code-copy="true"]`):null;if(!(n instanceof HTMLButtonElement))return;let r=n.closest(`[data-rj-editor-code-block="true"]`)?.querySelector(`pre.rj-editor-code-block`);r instanceof HTMLElement&&(e.preventDefault(),await he(r.textContent||``),n.classList.add(`is-copied`),n.setAttribute(`aria-label`,`Copied`),n.setAttribute(`title`,`Copied`),window.setTimeout(()=>{n.classList.remove(`is-copied`),n.setAttribute(`aria-label`,`Copy code`),n.setAttribute(`title`,`Copy code`)},1600))}))}function R(e,t=`□`){return e&&typeof e!=`string`?Dt(e):`<span class="rj-editor-equation-render-slot">${xe(e?.trim()||t)}</span>`}function St(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function Ct(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function wt(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}function Tt(e){return[`rj-editor-equation-render`,`rj-editor-equation-render--script`,e.position===`before`?`rj-editor-equation-render--prescript`:``,e.superscript===void 0?``:`has-superscript`,e.subscript===void 0?``:`has-subscript`].filter(Boolean).join(` `)}function Et(e){let t=`<span class="rj-editor-equation-render-matrix-grid" style="grid-template-columns: repeat(${Math.max(...e.cells.map(e=>e.length),1)}, minmax(1.75rem, auto));">${e.cells.flatMap(e=>e.map(e=>`<span>${R(e)}</span>`)).join(``)}</span>`;return e.bracket===`none`?t:e.bracket===`determinant`?`<span class="rj-editor-equation-render-matrix-bracket">|</span>${t}<span class="rj-editor-equation-render-matrix-bracket">|</span>`:e.bracket===`round`?`<span class="rj-editor-equation-render-matrix-bracket">(</span>${t}<span class="rj-editor-equation-render-matrix-bracket">)</span>`:`<span class="rj-editor-equation-render-matrix-bracket">[</span>${t}<span class="rj-editor-equation-render-matrix-bracket">]</span>`}function Dt(e){switch(e.kind){case`accent`:return`<span class="rj-editor-equation-render rj-editor-equation-render--accent"><span class="rj-editor-equation-render-accent-mark">${{bar:`¯`,dot:`˙`,doubleDot:`¨`,hat:`ˆ`,vector:`⃗`}[e.accent]}</span>${R(e.value,`x`)}</span>`;case`bracket`:{let[t,n]=St(e.bracket);return`<span class="rj-editor-equation-render rj-editor-equation-render--bracket"><span class="rj-editor-equation-render-bracket">${xe(t)}</span>${R(e.value,`x`)}<span class="rj-editor-equation-render-bracket">${xe(n)}</span></span>`}case`fraction`:return e.variant===`linear`||e.variant===`skewed`?`<span class="rj-editor-equation-render rj-editor-equation-render--fraction-inline"><span>${R(e.numerator)}</span><span>${e.variant===`skewed`?`⁄`:`/`}</span><span>${R(e.denominator)}</span></span>`:`<span class="rj-editor-equation-render rj-editor-equation-render--fraction"><span>${R(e.numerator)}</span><span class="rj-editor-equation-render-line"></span><span>${R(e.denominator)}</span></span>`;case`function`:return`<span class="rj-editor-equation-render rj-editor-equation-render--function"><span>${e.functionName}</span><span>(</span>${R(e.argument,`x`)}<span>)</span></span>`;case`integral`:return`<span class="rj-editor-equation-render rj-editor-equation-render--integral"><span class="rj-editor-equation-render-limits"><span>${e.upper===void 0?``:R(e.upper,`b`)}</span><span class="rj-editor-equation-render-large-symbol">${wt(e.variant)}</span><span>${e.lower===void 0?``:R(e.lower,`a`)}</span></span>${R(e.body,`f(x)`)}<span>d</span>${R(e.variable,`x`)}</span>`;case`largeOperator`:return`<span class="rj-editor-equation-render rj-editor-equation-render--large-operator"><span class="rj-editor-equation-render-limits"><span>${e.upper===void 0?``:R(e.upper,`n`)}</span><span class="rj-editor-equation-render-large-symbol">${Ct(e.operator)}</span><span>${e.lower===void 0?``:R(e.lower,`i=1`)}</span></span>${R(e.body,`i`)}</span>`;case`limit`:return`<span class="rj-editor-equation-render rj-editor-equation-render--limit"><span class="rj-editor-equation-render-limits"><span>lim</span><span>${R(e.target,`x→0`)}</span></span>${R(e.body,`f(x)`)}</span>`;case`matrix`:return`<span class="rj-editor-equation-render rj-editor-equation-render--matrix">${Et(e)}</span>`;case`operator`:return`<span class="rj-editor-equation-render">${xe(e.value||`□`)}</span>`;case`root`:return`<span class="rj-editor-equation-render rj-editor-equation-render--root">${e.index===void 0?``:`<span class="rj-editor-equation-render-root-index">${R(e.index,`n`)}</span>`}<span class="rj-editor-equation-render-root-symbol">√</span><span class="rj-editor-equation-render-radicand">${R(e.value,`x`)}</span></span>`;case`script`:return e.position===`before`?`<span class="${Tt(e)}"><span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${R(e.superscript,`n`)}</span>`}${e.subscript===void 0?``:`<span>${R(e.subscript,`1`)}</span>`}</span>${R(e.base,`Y`)}</span>`:`<span class="${Tt(e)}">${R(e.base,`x`)}<span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${R(e.superscript,`2`)}</span>`}${e.subscript===void 0?``:`<span>${R(e.subscript,`i`)}</span>`}</span></span>`;case`text`:return`<span class="rj-editor-equation-render">${R(e.value,`□`)}</span>`;case`row`:return`<span class="rj-editor-equation-render rj-editor-equation-render--row">${e.items.map(Dt).join(``)}</span>`;default:return``}}function Ot(e,t){let r=ve(e);return r?Dt(r):n.default.renderToString(e,{displayMode:t===`block`,output:`mathml`,strict:!1,throwOnError:!1,trust:!1})}function kt(e,n){let r=new DOMParser().parseFromString(n||``,`text/html`),a=r.body.querySelector(`[data-rj-editor-content="true"]`);r.body.querySelectorAll(`[data-rj-editor-code-block="true"]`).forEach(e=>{let t=e.querySelector(`pre.rj-editor-code-block`);if(!t){e.remove();return}t.classList.remove(`rj-editor-code-block--exported`),e.replaceWith(t)}),a&&r.body.children.length===1&&r.body.replaceChildren(...Array.from(a.childNodes));let o=(0,i.$generateNodesFromDOM)(e,r),s=(0,t.$getRoot)();if(s.clear(),o.length>0){s.append(...o);return}s.append((0,t.$createParagraphNode)())}var At=(0,l.createSlice)({name:`toolbar`,initialState:I,reducers:{setCanRedo(e,t){e.canRedo=t.payload},setCanUndo(e,t){e.canUndo=t.payload},setTextFormats(e,t){e.isBold=t.payload.isBold,e.isCode=t.payload.isCode,e.isItalic=t.payload.isItalic,e.isStrikethrough=t.payload.isStrikethrough,e.isSubscript=t.payload.isSubscript,e.isSuperscript=t.payload.isSuperscript,e.isUnderline=t.payload.isUnderline},setStyleFormats(e,t){e.backgroundColor=t.payload.backgroundColor,e.fontFamily=t.payload.fontFamily,e.fontSize=t.payload.fontSize,e.lineHeight=t.payload.lineHeight,e.textColor=t.payload.textColor},setBlockFormats(e,t){e.alignment=t.payload.alignment,e.listType=t.payload.listType},setTableFormats(e,t){e.isInTable=t.payload.isInTable,e.selectedTableCellsCount=t.payload.selectedTableCellsCount,e.tableCellBackgroundColor=t.payload.tableCellBackgroundColor,e.tableCellVerticalAlign=t.payload.tableCellVerticalAlign,e.tableHasMergedCell=t.payload.tableHasMergedCell},setEquationFormats(e,t){e.isEquationSelected=t.payload.isEquationSelected,e.selectedEquation=t.payload.selectedEquation,e.selectedEquationDisplayMode=t.payload.selectedEquationDisplayMode,e.selectedEquationKey=t.payload.selectedEquationKey},setImageFormats(e,t){e.isImageSelected=t.payload.isImageSelected,e.selectedImageAlignment=t.payload.selectedImageAlignment,e.selectedImageAltText=t.payload.selectedImageAltText,e.selectedImageAspectRatioLocked=t.payload.selectedImageAspectRatioLocked,e.selectedImageBorderEnabled=t.payload.selectedImageBorderEnabled,e.selectedImageBorderRadius=t.payload.selectedImageBorderRadius,e.selectedImageCaption=t.payload.selectedImageCaption,e.selectedImageHeight=t.payload.selectedImageHeight,e.selectedImageKey=t.payload.selectedImageKey,e.selectedImageLinkUrl=t.payload.selectedImageLinkUrl,e.selectedImageObjectFit=t.payload.selectedImageObjectFit,e.selectedImageRotation=t.payload.selectedImageRotation,e.selectedImageShadowEnabled=t.payload.selectedImageShadowEnabled,e.selectedImageTextWrap=t.payload.selectedImageTextWrap,e.selectedImageWidth=t.payload.selectedImageWidth}}}),{setBlockFormats:jt,setCanRedo:Mt,setCanUndo:Nt,setEquationFormats:Pt,setImageFormats:Ft,setStyleFormats:z,setTableFormats:It,setTextFormats:Lt}=At.actions,Rt=At.reducer,zt=()=>(0,l.configureStore)({reducer:{toolbar:Rt}});zt();var B=c.useDispatch.withTypes(),V=c.useSelector.withTypes(),Bt={alerts:{imageSizeLimit:`Image size must be 5MB or less.`,onlyImages:`Only image files can be uploaded.`},common:{cancel:`Cancel`,close:`Close`,insert:`Insert`,moreColors:`More colors`,none:`None`,optional:`Optional`,save:`Save`},modal:{closeAriaLabel:`Close modal`},placeholders:{editor:`Write your article here...`},toolbar:{alignment:{center:`Align center`,justify:`Align justify`,left:`Align left`,right:`Align right`},codeBlock:{code:`Code`,codePlaceholder:`Write or paste code here...`,copied:`Copied`,copy:`Copy code`,language:`Language`},fullscreen:{close:`Exit fullscreen`,open:`Open fullscreen`},history:{redo:`Redo`,undo:`Undo`},image:{alignCenter:`Align image center`,alignLeft:`Align image left`,alignRight:`Align image right`,alt:`Alt text`,altPlaceholder:`Describe this image`,border:`Border`,borderRadius:`Image border radius`,caption:`Caption`,captionPlaceholder:`Image caption`,cropMode:`Image crop mode`,delete:`Delete image`,editAlt:`Edit alt text`,editCaption:`Edit caption`,editLink:`Edit image link`,fitContain:`Contain`,fitCover:`Cover`,fitFill:`Fill`,link:`Link`,linkPlaceholder:`https://example.com`,replace:`Replace image`,rotateLeft:`Rotate left`,rotateRight:`Rotate right`,shadow:`Shadow`,squareWrap:`Square`,topBottomWrap:`Top and Bottom`,width:`Image width`},insert:{codeBlock:`Code block`,equation:`Equation`,horizontalLine:`Horizontal line`,image:`Image`,link:`Link`,table:`Table`,youtube:`YouTube`},link:{openInNewTab:`Open in new tab`,text:`Text`,textPlaceholder:`Link text`,title:`Title`,titlePlaceholder:`Optional`,url:`URL`,urlPlaceholder:`https://example.com`},list:{bullet:`Bulleted list`,numbered:`Numbered list`,remove:`Remove list`},spacing:{default:`Default`,lineAndParagraph:`Line and paragraph spacing`},shortcuts:{backgroundColor:`Background color`,bold:`Bold`,bulletList:`Bulleted list`,clearFormatting:`Clear formatting`,decreaseIndent:`Decrease indent`,fontFamily:`Font family`,fontSize:`Font size`,increaseIndent:`Increase indent`,italic:`Italic`,link:`Insert link`,numberedList:`Numbered list`,redo:`Redo`,removeList:`Remove list`,spacing:`Line spacing`,strikethrough:`Strikethrough`,subscript:`Subscript`,superscript:`Superscript`,textColor:`Text color`,underline:`Underline`,undo:`Undo`},style:{backgroundColor:`Background color`,clearFormatting:`Clear formatting`,fontFamily:`Font family`,fontFamilyPlaceholder:`Font`,fontSize:`Font size`,fontSizePlaceholder:`Size`,textColor:`Text color`},table:{alignBottom:`Align cell content to bottom`,alignMiddle:`Align cell content to middle`,alignTop:`Align cell content to top`,background:`Table cell background`,columns:`Columns`,deleteColumn:`Delete column`,deleteRow:`Delete row`,deleteTable:`Delete table`,headerColumn:`Header col`,headerRow:`Header row`,header:`Header`,insertColumnLeft:`Insert column left`,insertColumnRight:`Insert column right`,insertRowAbove:`Insert row above`,insertRowBelow:`Insert row below`,insertTable:`Insert table`,insertTableSize:`{columns}x{rows} Table`,mergeCells:`Merge`,columnLeft:`Col ←`,columnRight:`Col →`,rowAbove:`Row ↑`,rowBelow:`Row ↓`,column:`Col`,row:`Row`,rows:`Rows`,unmergeCell:`Unmerge`},tabs:{equation:`Equation`,home:`Home`,image:`Image`,insert:`Insert`,layout:`Layout`,table:`Table`},textFormat:{bold:`Bold`,code:`Inline code`,italic:`Italic`,strikethrough:`Strikethrough`,subscript:`Subscript`,superscript:`Superscript`,underline:`Underline`},youtube:{invalidUrl:`YouTube link or video ID is invalid.`,title:`Title`,titlePlaceholder:`Optional`,url:`YouTube URL`,urlPlaceholder:`https://www.youtube.com/watch?v=...`}}};function Vt(e){return!e||typeof e!=`object`?e:Array.isArray(e)?e.map(e=>Vt(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Vt(t)]))}function Ht(e,...t){return t.reduce((e,t)=>(t&&Object.entries(t).forEach(([t,n])=>{let r=e[t];if(n&&typeof n==`object`&&!Array.isArray(n)&&r&&typeof r==`object`){e[t]=Ht(r,n);return}e[t]=n}),e),Vt(e))}var Ut=Ht(Bt,{alerts:{imageSizeLimit:`Размер изображения должен быть не больше 5MB.`,onlyImages:`Можно загружать только изображения.`},common:{cancel:`Отмена`,close:`Закрыть`,insert:`Вставить`,moreColors:`Больше цветов`,none:`Нет`,optional:`Необязательно`,save:`Сохранить`},modal:{closeAriaLabel:`Закрыть модальное окно`},placeholders:{editor:`Напишите текст здесь...`},toolbar:{codeBlock:{code:`Код`,codePlaceholder:`Напишите или вставьте код здесь...`,copied:`Скопировано`,copy:`Копировать код`,language:`Язык`},fullscreen:{close:`Выйти из полноэкранного режима`,open:`Открыть на весь экран`},image:{border:`Граница`,caption:`Подпись`,captionPlaceholder:`Подпись к изображению`,cropMode:`Режим обрезки изображения`,delete:`Удалить изображение`,replace:`Заменить изображение`,shadow:`Тень`},insert:{codeBlock:`Блок кода`,equation:`Формула`,horizontalLine:`Горизонтальная линия`,image:`Изображение`,link:`Ссылка`,table:`Таблица`},link:{openInNewTab:`Открывать в новой вкладке`,text:`Текст`,textPlaceholder:`Текст ссылки`,titlePlaceholder:`Необязательно`},table:{columns:`Столбцы`,headerColumn:`Заголовок столбца`,headerRow:`Заголовок строки`,insertTable:`Вставить таблицу`,insertTableSize:`Таблица {columns}x{rows}`,mergeCells:`Объединить`,rows:`Строки`,unmergeCell:`Разделить`},youtube:{invalidUrl:`Ссылка YouTube или video ID неверны.`,titlePlaceholder:`Необязательно`}}}),Wt=Ht(Bt,{alerts:{imageSizeLimit:`Rasm hajmi 5MB yoki undan kichik bo‘lishi kerak.`,onlyImages:`Faqat rasm fayllarini yuklash mumkin.`},common:{cancel:`Bekor qilish`,close:`Yopish`,insert:`Qo‘shish`,moreColors:`Ko‘proq ranglar`,none:`Yo‘q`,optional:`Ixtiyoriy`,save:`Saqlash`},modal:{closeAriaLabel:`Modalni yopish`},placeholders:{editor:`Maqolangizni shu yerga yozing...`},toolbar:{codeBlock:{code:`Kod`,codePlaceholder:`Kodni shu yerga yozing yoki joylang...`,copied:`Nusxalandi`,copy:`Kodni nusxalash`,language:`Dasturlash tili`},fullscreen:{close:`To‘liq ekrandan chiqish`,open:`To‘liq ekranda ochish`},history:{redo:`Qaytarish`,undo:`Bekor qilish`},image:{alt:`Muqobil matn`,altPlaceholder:`Rasmni tasvirlab yozing`,border:`Chegara`,borderRadius:`Rasm burchak radiusi`,caption:`Izoh`,captionPlaceholder:`Rasm osti yozuvi`,cropMode:`Rasm ko‘rinish rejimi`,delete:`Rasmni o‘chirish`,editAlt:`Muqobil matnni tahrirlash`,editCaption:`Izohni tahrirlash`,editLink:`Rasm linkini tahrirlash`,fitContain:`Sig‘dirish`,fitCover:`Qoplash`,fitFill:`To‘ldirish`,replace:`Rasmni almashtirish`,rotateLeft:`Chapga aylantirish`,rotateRight:`O‘ngga aylantirish`,shadow:`Soya`,squareWrap:`Yonidan matn`,topBottomWrap:`Yuqori va pastdan`,width:`Rasm kengligi`},insert:{codeBlock:`Kod bloki`,equation:`Formula`,horizontalLine:`Gorizontal chiziq`,image:`Rasm`,table:`Jadval`},link:{openInNewTab:`Yangi tabda ochish`,text:`Matn`,textPlaceholder:`Link matni`,titlePlaceholder:`Ixtiyoriy`},list:{bullet:`Nuqtali ro‘yxat`,numbered:`Raqamli ro‘yxat`,remove:`Ro‘yxatni olib tashlash`},spacing:{default:`Standart`,lineAndParagraph:`Qator va paragraf oralig‘i`},shortcuts:{backgroundColor:`Orqa fon rangi`,bold:`Qalin`,bulletList:`Nuqtali ro‘yxat`,clearFormatting:`Formatni tozalash`,decreaseIndent:`Chekinishni kamaytirish`,fontFamily:`Shrift`,fontSize:`O‘lcham`,increaseIndent:`Chekinishni oshirish`,italic:`Kursiv`,link:`Link qo‘shish`,numberedList:`Raqamli ro‘yxat`,redo:`Qaytarish`,removeList:`Ro‘yxatni olib tashlash`,spacing:`Qator oralig‘i`,strikethrough:`Ustidan chizish`,subscript:`Pastki indeks`,superscript:`Yuqori indeks`,textColor:`Matn rangi`,underline:`Tagiga chizish`,undo:`Bekor qilish`},style:{backgroundColor:`Orqa fon rangi`,clearFormatting:`Formatni tozalash`,fontFamily:`Shrift oilasi`,fontFamilyPlaceholder:`Shrift`,fontSize:`Shrift o‘lchami`,fontSizePlaceholder:`O‘lcham`,textColor:`Matn rangi`},table:{alignBottom:`Katak matnini pastga tekislash`,alignMiddle:`Katak matnini o‘rtaga tekislash`,alignTop:`Katak matnini yuqoriga tekislash`,background:`Katak orqa fon rangi`,columns:`Ustunlar`,deleteColumn:`Ustunni o‘chirish`,deleteRow:`Qatorni o‘chirish`,deleteTable:`Jadvalni o‘chirish`,headerColumn:`Sarlavha ustuni`,headerRow:`Sarlavha qatori`,header:`Sarlavha`,insertColumnLeft:`Chapga ustun qo‘shish`,insertColumnRight:`O‘ngga ustun qo‘shish`,insertRowAbove:`Yuqoriga qator qo‘shish`,insertRowBelow:`Pastga qator qo‘shish`,insertTable:`Jadval qo‘shish`,insertTableSize:`{columns}x{rows} jadval`,mergeCells:`Birlashtirish`,columnLeft:`Ustun ←`,columnRight:`Ustun →`,rowAbove:`Qator ↑`,rowBelow:`Qator ↓`,column:`Ustun`,row:`Qator`,rows:`Qatorlar`,unmergeCell:`Ajratish`},tabs:{equation:`Formula`,home:`Asosiy`,image:`Rasm`,insert:`Qo‘shish`,layout:`Joylashuv`,table:`Jadval`},textFormat:{bold:`Qalin`,code:`Inline kod`,italic:`Kursiv`,strikethrough:`Ustidan chizish`,subscript:`Pastki indeks`,superscript:`Yuqori indeks`,underline:`Tagiga chizish`},youtube:{invalidUrl:`YouTube link yoki video ID noto‘g‘ri.`,titlePlaceholder:`Ixtiyoriy`}}}),Gt=s.default.createContext(Wt),Kt={en:Bt,ru:Ut,uz:Wt};function qt({children:e,locale:t=`uz`,locales:n,translations:r}){let i=s.default.useMemo(()=>Ht(Kt[t]||Bt,n?.[t],r),[t,n,r]);return(0,u.jsx)(Gt.Provider,{value:i,children:e})}function H(){return s.default.useContext(Gt)}var Jt={algorithm:o.theme.defaultAlgorithm,token:{colorPrimary:`#3167c8`}},Yt={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#202020`,colorBgElevated:`#252525`,colorBorder:`#444444`,colorBorderSecondary:`#383838`,colorFillSecondary:`#2d2d2d`,colorFillTertiary:`#292929`,colorPrimary:`#b8b8b8`,colorPrimaryActive:`#d8d8d8`,colorPrimaryHover:`#cecece`,colorText:`#ededed`,colorTextPlaceholder:`#8d8d8d`,colorTextQuaternary:`#777777`,colorTextSecondary:`#b5b5b5`,colorTextTertiary:`#999999`}};function Xt(e){return e===`dark`?Yt:Jt}var Zt=s.default.createContext(`light`);function Qt(){return s.default.useContext(Zt)}function U(e){let t=e?.trim().toLowerCase();if(t===`dark`||t===`only dark`)return`dark`;if(t===`light`||t===`only light`)return`light`}function $t(){if(typeof document>`u`||typeof window>`u`)return`light`;let e=document.documentElement,t=U(e.dataset.rjEditorTheme)||U(e.dataset.colorScheme)||U(e.dataset.theme)||U(e.getAttribute(`color-scheme`));if(t)return t;let n=window.getComputedStyle(e).colorScheme,r=document.querySelector(`meta[name="color-scheme"]`)?.content;return U(n)||U(r)||(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)}function en(e){let[t,n]=s.default.useState(()=>$t());return s.default.useEffect(()=>{if(e!==`auto`)return;let t=()=>n($t()),r=window.matchMedia(`(prefers-color-scheme: dark)`),i=new MutationObserver(t),a=new MutationObserver(t),o=window.requestAnimationFrame(t);return r.addEventListener(`change`,t),i.observe(document.documentElement,{attributeFilter:[`class`,`color-scheme`,`data-color-scheme`,`data-rj-editor-theme`,`data-theme`,`style`],attributes:!0}),a.observe(document.head,{attributeFilter:[`content`],attributes:!0,childList:!0,subtree:!0}),()=>{window.cancelAnimationFrame(o),r.removeEventListener(`change`,t),i.disconnect(),a.disconnect()}},[e]),e===`auto`?t:e}var tn=`□`,nn=`x + y = z`;function rn(e,t,n){let r=Array.from(e||t||tn).length,i=n?.includes(`rj-editor-equation-slot-input--limit`)||n?.includes(`rj-editor-equation-slot-input--matrix`)||n?.includes(`rj-editor-equation-slot-input--root-index`)||n?.includes(`rj-editor-equation-slot-input--script`)||n?.includes(`rj-editor-equation-slot-input--small`),a=i?2:2.5,o=i?5:11;return`calc(${Math.min(Math.max(r+1,a),o)}ch + 0.25rem)`}function an(e){return[`rj-editor-equation-visual`,`rj-editor-equation-visual--script`,e.position===`before`?`rj-editor-equation-visual--prescript`:``,e.superscript===void 0?``:`has-superscript`,e.subscript===void 0?``:`has-subscript`].filter(Boolean).join(` `)}function on(e){e.stopPropagation()}function sn(e){let t=e.selectionStart??e.value.length;return{end:e.selectionEnd??t,start:t}}function cn({className:e,inputRef:t,onActiveSlotChange:n,onSlotSelectionChange:r,onSlotChange:i,placeholder:a=tn,slotId:o,value:s}){let c=e=>{on(e),n(o),r(o,sn(e.currentTarget))};return(0,u.jsx)(`input`,{"aria-label":`Equation field`,className:[`rj-editor-equation-slot-input`,e||``].filter(Boolean).join(` `),onChange:e=>{i(o,e.target.value),r(o,sn(e.currentTarget))},onClick:c,onFocus:c,onKeyDown:on,onKeyUp:c,onMouseDown:on,onSelect:c,placeholder:a,ref:t,size:Math.max(1,Math.min(Array.from(s||a).length+1,12)),style:{width:rn(s,a,e)},type:`text`,value:s})}function ln(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function un(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function dn(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}var fn=s.default.memo(function e({activeSlotId:t,activeSlotSelection:n,model:r,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:c=``}){let l=s.default.useRef({}),d=s.default.useCallback(e=>t=>{l.current[e]=t},[]);s.default.useLayoutEffect(()=>{let e=l.current[t];if(!e)return;document.activeElement!==e&&e.focus();let r=Math.max(0,Math.min(n?.start??e.value.length,e.value.length)),i=Math.max(r,Math.min(n?.end??r,e.value.length));(e.selectionStart!==r||e.selectionEnd!==i)&&e.setSelectionRange(r,i)},[t,n,r]);let f=s.default.useCallback(e=>{let n=`${c}row.insert.${e}`;return(0,u.jsx)(`button`,{"aria-label":`Insert equation item`,className:[`rj-editor-equation-insert-point`,t===n?`is-active`:``].filter(Boolean).join(` `),onClick:e=>{e.preventDefault(),e.stopPropagation(),i(n)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},type:`button`},n)},[t,i,c]),p=s.default.useCallback((r,s,l,f=tn)=>{let p=`${c}${r}`;return s&&typeof s!=`string`?(0,u.jsx)(`span`,{className:`rj-editor-equation-nested`,children:(0,u.jsx)(e,{activeSlotId:t,activeSlotSelection:n,model:s,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:`${p}>`})},p):(0,u.jsx)(cn,{className:l,inputRef:d(p),onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,placeholder:f,slotId:p,value:s||``},p)},[t,n,i,a,o,d,c]);if(r.kind===`accent`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--accent`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-accent-mark`,children:{bar:`¯`,dot:`˙`,doubleDot:`¨`,hat:`ˆ`,vector:`⃗`}[r.accent]}),p(`accent.value`,r.value)]});if(r.kind===`bracket`){let[e,t]=ln(r.bracket);return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--bracket`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-bracket`,children:e}),p(`bracket.value`,r.value),(0,u.jsx)(`span`,{className:`rj-editor-equation-bracket`,children:t})]})}if(r.kind===`fraction`)return r.variant===`linear`||r.variant===`skewed`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--fraction-inline`,children:[p(`fraction.numerator`,r.numerator),(0,u.jsx)(`span`,{children:r.variant===`skewed`?`⁄`:`/`}),p(`fraction.denominator`,r.denominator)]}):(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--fraction`,children:[p(`fraction.numerator`,r.numerator),(0,u.jsx)(`span`,{className:`rj-editor-equation-fraction-line`}),p(`fraction.denominator`,r.denominator)]});if(r.kind===`function`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--function`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-function-name`,children:r.functionName}),(0,u.jsx)(`span`,{children:`(`}),p(`function.argument`,r.argument,void 0,`x`),(0,u.jsx)(`span`,{children:`)`})]});if(r.kind===`integral`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--integral`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[r.upper===void 0?(0,u.jsx)(`span`,{}):p(`integral.upper`,r.upper,`rj-editor-equation-slot-input--limit`,`b`),(0,u.jsx)(`span`,{className:`rj-editor-equation-large-symbol`,children:dn(r.variant)}),r.lower===void 0?(0,u.jsx)(`span`,{}):p(`integral.lower`,r.lower,`rj-editor-equation-slot-input--limit`,`a`)]}),p(`integral.body`,r.body,void 0,`f(x)`),(0,u.jsx)(`span`,{children:`d`}),p(`integral.variable`,r.variable,`rj-editor-equation-slot-input--small`,`x`)]});if(r.kind===`largeOperator`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--large-operator`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[p(`largeOperator.upper`,r.upper,`rj-editor-equation-slot-input--limit`,`n`),(0,u.jsx)(`span`,{className:`rj-editor-equation-large-symbol`,children:un(r.operator)}),p(`largeOperator.lower`,r.lower,`rj-editor-equation-slot-input--limit`,`i=1`)]}),p(`largeOperator.body`,r.body,void 0,`i`)]});if(r.kind===`limit`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--limit`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-function-name`,children:`lim`}),p(`limit.target`,r.target,`rj-editor-equation-slot-input--limit`,`x→0`)]}),p(`limit.body`,r.body,void 0,`f(x)`)]});if(r.kind===`matrix`){let e=(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-grid`,style:{gridTemplateColumns:`repeat(${Math.max(...r.cells.map(e=>e.length),1)}, minmax(1.75rem, auto))`},children:r.cells.flatMap((e,t)=>e.map((e,n)=>p(`matrix.cells.${t}.${n}`,e,`rj-editor-equation-slot-input--matrix`)))});if(r.bracket===`none`)return(0,u.jsx)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--matrix`,children:e});let[t,n]=r.bracket===`determinant`?[`|`,`|`]:r.bracket===`round`?[`(`,`)`]:[`[`,`]`];return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--matrix`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-bracket`,children:t}),e,(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-bracket`,children:n})]})}return r.kind===`operator`?(0,u.jsx)(`span`,{className:`rj-editor-equation-visual`,children:p(`operator.value`,r.value)}):r.kind===`root`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--root`,children:[r.index===void 0?null:p(`root.index`,r.index,`rj-editor-equation-slot-input--root-index`,`n`),(0,u.jsx)(`span`,{className:`rj-editor-equation-root-symbol`,children:`√`}),(0,u.jsx)(`span`,{className:`rj-editor-equation-radicand`,children:p(`root.value`,r.value,void 0,`x`)})]}):r.kind===`script`?r.position===`before`?(0,u.jsxs)(`span`,{className:an(r),children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-script-stack`,children:[r.superscript===void 0?null:p(`script.superscript`,r.superscript,`rj-editor-equation-slot-input--script`,`n`),r.subscript===void 0?null:p(`script.subscript`,r.subscript,`rj-editor-equation-slot-input--script`,`1`)]}),p(`script.base`,r.base,void 0,`Y`)]}):(0,u.jsxs)(`span`,{className:an(r),children:[p(`script.base`,r.base,void 0,`x`),(0,u.jsxs)(`span`,{className:`rj-editor-equation-script-stack`,children:[r.superscript===void 0?null:p(`script.superscript`,r.superscript,`rj-editor-equation-slot-input--script`,`2`),r.subscript===void 0?null:p(`script.subscript`,r.subscript,`rj-editor-equation-slot-input--script`,`i`)]})]}):r.kind===`row`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--row`,children:[f(0),r.items.map((r,l)=>(0,u.jsxs)(s.default.Fragment,{children:[(0,u.jsx)(e,{activeSlotId:t,activeSlotSelection:n,model:r,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:`${c}row.items.${l}>`}),f(l+1)]},`${c}row.items.${l}`))]}):(0,u.jsx)(`span`,{className:`rj-editor-equation-visual`,children:p(`text.value`,r.value,void 0,c?tn:nn)})});function pn(e,n){let r=(0,t.$getNodeByKey)(e);vn(r)&&n(r)}var mn=s.default.memo(function({displayMode:e,equation:n,nodeKey:r}){let[i]=(0,h.useLexicalComposerContext)(),a=B(),o=s.default.useRef(``),c=s.default.useRef({}),l=s.default.useRef(null),[d,f]=s.default.useState(``),[p,m]=s.default.useState(),[_,v,y]=(0,g.useLexicalNodeSelection)(r),b=s.default.useMemo(()=>ve(n),[n]),x=s.default.useMemo(()=>n.trim()?Ot(n,e):``,[e,n]),S=s.default.useMemo(()=>!b&&!/[\\{}_^]/.test(n),[n,b]),C=s.default.useCallback(t=>{i.update(()=>{pn(r,e=>{vn(e)&&e.setEquation(t)})}),a(Pt({isEquationSelected:!0,selectedEquation:t,selectedEquationDisplayMode:e,selectedEquationKey:r}))},[a,e,i,r]),w=s.default.useCallback((e,t)=>{o.current=e,t&&(c.current[e]=t),f(e),m(t)},[]),T=s.default.useCallback((e,t)=>{c.current[e]=t,w(e,t)},[w]),E=s.default.useCallback(e=>{C(ye(e))},[C]),D=s.default.useCallback((e,t)=>{b&&E(j(b,e,t))},[b,E]),O=s.default.useCallback(()=>{y(),v(!0),b&&w(o.current||P(b)),a(Pt({isEquationSelected:!0,selectedEquation:n,selectedEquationDisplayMode:e,selectedEquationKey:r})),window.requestAnimationFrame(()=>{l.current?.focus()})},[y,a,e,n,b,r,w,v]);return s.default.useEffect(()=>{!_||!b||o.current||w(P(b))},[b,_,w]),s.default.useEffect(()=>{if(!_)return;let e=i.registerCommand(t.KEY_DELETE_COMMAND,e=>e.target instanceof HTMLInputElement?!1:(e.preventDefault(),i.update(()=>{pn(r,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW),n=i.registerCommand(t.KEY_BACKSPACE_COMMAND,e=>e.target instanceof HTMLInputElement?!1:(e.preventDefault(),i.update(()=>{pn(r,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[i,_,r]),s.default.useEffect(()=>{if(!_)return;let e=e=>{let t=e.detail;if(!t)return;let r=ve(t);if(r){if(b){let e=o.current||P(b),t=Me(b,e,r,c.current[e]);w(t.activeSlotId),E(t.model);return}w(P(r)),E(r);return}if(b){let e=o.current||P(b),n=pe(b,e,t,c.current[e]);w(n.activeSlotId,n.selection),E(n.model);return}let i=l.current;if(!i){C(`${n}${t}`);return}let a=i.selectionStart??i.value.length,s=i.selectionEnd??a,u=`${i.value.slice(0,a)}${t}${i.value.slice(s)}`,d=a+t.length;C(u),window.requestAnimationFrame(()=>{i.focus(),i.setSelectionRange(d,d)})};return window.addEventListener(Pe,e),()=>{window.removeEventListener(Pe,e)}},[n,b,_,w,E,C]),(0,u.jsx)(`span`,{className:[`rj-editor-equation`,`rj-editor-equation--${e}`,_?`is-selected`:``].filter(Boolean).join(` `),"data-display-mode":e,"data-equation":n,onClick:e=>{e.preventDefault(),e.stopPropagation(),O()},role:`button`,tabIndex:-1,children:_?(0,u.jsxs)(`span`,{className:`rj-editor-equation-editor`,children:[b?(0,u.jsx)(fn,{activeSlotId:d||P(b),activeSlotSelection:p,model:b,onActiveSlotChange:w,onSlotSelectionChange:T,onSlotChange:D}):S?(0,u.jsx)(`input`,{"aria-label":`Formula value`,onChange:e=>C(e.target.value),onClick:e=>{e.stopPropagation()},onFocus:()=>{w(``)},onKeyDown:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},placeholder:`x + y = z`,ref:l,type:`text`,value:n}):(0,u.jsx)(`span`,{className:`rj-editor-equation-visual-editor`,dangerouslySetInnerHTML:{__html:x}}),n.trim()&&S?(0,u.jsx)(`span`,{className:`rj-editor-equation-content`,dangerouslySetInnerHTML:{__html:x}}):null]}):(0,u.jsx)(`span`,{className:[`rj-editor-equation-content`,n.trim()?``:`is-empty`].filter(Boolean).join(` `),dangerouslySetInnerHTML:{__html:x||`<span>Formula qo‘shing</span>`}})})});function hn(e){let t=e.getAttribute(`data-equation`);return t?{node:_n({displayMode:e.getAttribute(`data-display-mode`)===`inline`?`inline`:`block`,equation:t})}:null}var gn=class e extends t.DecoratorNode{__displayMode;__equation;static clone(t){return new e(t.__equation,t.__displayMode,t.__key)}static getType(){return`equation`}static importDOM(){return{div:e=>e.hasAttribute(`data-equation`)?{conversion:hn,priority:1}:null,span:e=>e.hasAttribute(`data-equation`)?{conversion:hn,priority:1}:null}}static importJSON(e){return _n({displayMode:e.displayMode,equation:e.equation})}constructor(e,t=`block`,n){super(n),this.__equation=e,this.__displayMode=t}createDOM(e){let t=document.createElement(`span`);return t.className=e.theme.equation||`rj-editor-equation-node`,t}decorate(){return(0,u.jsx)(mn,{displayMode:this.__displayMode,equation:this.__equation,nodeKey:this.__key})}exportDOM(){let e=this.__displayMode===`inline`?document.createElement(`span`):document.createElement(`div`);e.setAttribute(`data-equation`,this.__equation),e.setAttribute(`data-display-mode`,this.__displayMode);try{e.innerHTML=Ot(this.__equation,this.__displayMode)}catch{e.textContent=this.__equation}return{element:e}}exportJSON(){return{displayMode:this.__displayMode,equation:this.__equation,type:`equation`,version:1}}getDisplayMode(){return this.getLatest().__displayMode}getEquation(){return this.getLatest().__equation}getTextContent(){return this.__equation}isInline(){return this.getLatest().__displayMode===`inline`}setDisplayMode(e){let t=this.getWritable();return t.__displayMode=e,t}setEquation(e){let t=this.getWritable();return t.__equation=e,t}updateDOM(){return!1}};function _n({displayMode:e=`block`,equation:t}){return new gn(t,e)}function vn(e){return e instanceof gn}var yn=[`b`,`code`,`em`,`font`,`i`,`mark`,`s`,`span`,`strong`,`sub`,`sup`,`u`];function bn(e){let t=[],n=e.style.backgroundColor,r=e.style.color||e.getAttribute(`color`)||``,i=Ge(e.style.fontFamily||e.getAttribute(`face`)||``),a=qe(e.style.fontSize),o=e.style.lineHeight;return n&&t.push(`background-color: ${n}`),r&&t.push(`color: ${r}`),i&&t.push(`font-family: ${i}`),a&&t.push(`font-size: ${a}`),o&&t.push(`line-height: ${o}`),t.join(`; `)}function xn(e,t){return e?t?`${e}; ${t}`:e:t}function Sn(e){return e?{...e,conversion:n=>{let r=e.conversion(n);if(!r)return r;let i=r.forChild,a=bn(n),o=n.tagName.toLowerCase()===`code`;return!a&&!o?r:{...r,forChild:(e,n)=>{let r=i?i(e,n):e;return(0,t.$isTextNode)(r)&&(a&&r.setStyle(xn(r.getStyle(),a)),o&&!r.hasFormat(`code`)&&r.toggleFormat(`code`)),r}}}}:null}function Cn(e,t){return t.setDetail(e.getDetail()),t.setFormat(e.getFormat()),t.setMode(e.getMode()),t.setStyle(e.getStyle()),t}var wn=class e extends t.TextNode{static clone(t){return new e(t.__text,t.__key)}static getType(){return`extended-text`}static importDOM(){let e=t.TextNode.importDOM();if(!e)return null;let n={...e};return yn.forEach(t=>{let r=e[t];r&&(n[t]=e=>Sn(r(e)))}),n}static importJSON(e){return Tn(e.text).updateFromJSON(e)}constructor(e=``,t){super(e,t)}exportJSON(){return{...super.exportJSON(),type:`extended-text`,version:1}}};function Tn(e=``){return new wn(e)}function En(e){return Cn(e,Tn(e.getTextContent()))}function Dn(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 10H6M21 6H3M21 14H3M18 18H6`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function On(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M16 10H3M20 6H3M20 14H3M16 18H3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function kn(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H8M21 6H4M21 14H4M21 18H8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function An(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function jn(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M8.54661 19.7675C10.9457 20.8319 13.8032 20.7741 16.2502 19.3613C20.3157 17.0141 21.7086 11.8156 19.3614 7.75008L19.1114 7.31706M4.63851 16.2502C2.2913 12.1847 3.68424 6.98619 7.74972 4.63898C10.1967 3.22621 13.0542 3.16841 15.4533 4.23277M2.49341 16.3338L5.22546 17.0659L5.95751 14.3338M18.0426 9.6659L18.7747 6.93385L21.5067 7.6659`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Mn=100,Nn=2e3,Pn=10,Fn=32,In=42,Ln=340,Rn=12,zn=[`top-left`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`];function W(e,n){let r=(0,t.$getNodeByKey)(e);K(r)&&n(r)}function Bn(e,t){let n=t?.getBoundingClientRect();if(!n)return{x:8,y:8};let r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(8,n.width-Ln-8),o=Math.max(8,n.height-In-8),s=r+Rn,c=i+Rn;return{x:Math.min(Math.max(s,8),a),y:Math.max(c>o?i-In-Rn:c,8)}}function Vn({alignment:e,altText:n,aspectRatioLocked:r,borderEnabled:i,borderRadius:a,caption:o,height:c,linkUrl:l,nodeKey:d,objectFit:f,rotation:p,shadowEnabled:m,src:_,textWrap:v,width:y}){let[b]=(0,h.useLexicalComposerContext)(),x=H(),S=B(),[C,w,T]=(0,g.useLexicalNodeSelection)(d),E=s.default.useRef(null),D=s.default.useRef(null),O=s.default.useRef(null),[ee,te]=s.default.useState({x:0,y:0}),[ne,re]=s.default.useState(0),[ie,ae]=s.default.useState(1),oe=(p%360+360)%360,k=oe===90||oe===270,se=v===`square`&&e!==`center`;s.default.useEffect(()=>{let e=D.current?.parentElement;if(!e)return;let t=()=>{re(e.getBoundingClientRect().width)};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)};let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]),s.default.useEffect(()=>{if(!C)return;let e=b.registerCommand(t.KEY_DELETE_COMMAND,e=>(e.preventDefault(),b.update(()=>{W(d,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW),n=b.registerCommand(t.KEY_BACKSPACE_COMMAND,e=>(e.preventDefault(),b.update(()=>{W(d,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[b,C,d]);let A=e=>{b.update(()=>{W(d,t=>{K(t)&&t.setAlignment(e)})})},ce=e=>{b.update(()=>{W(d,t=>{K(t)&&t.setWidth(Math.min(Mn,Math.max(Pn,e)))})})},le=(e,t)=>{b.update(()=>{W(d,n=>{K(n)&&(n.setWidth(Math.min(Mn,Math.max(Pn,e))),n.setHeight(t===void 0?void 0:Math.min(Nn,Math.max(Fn,t))))})}),w(!0)},ue=(e,t)=>{e.preventDefault(),e.stopPropagation(),w(!0);let n=D.current?.getBoundingClientRect(),r=D.current?.parentElement?.getBoundingClientRect()||n,i=O.current?.getBoundingClientRect();if(!r?.width||!i?.width||!i?.height)return;let a=e.clientX,o=e.clientY,s=y,l=c??i.height,u=i.width/i.height,d=e=>{let n=e.clientX-a,c=e.clientY-o,d=t.includes(`right`)?n:t.includes(`left`)?-n:0,f=t.includes(`bottom`)?c:t.includes(`top`)?-c:0;if(e.shiftKey){let e=Math.abs(d)>=Math.abs(f*u)?d:f*u,t=i.width+e;le(s+e/r.width*100,t/u);return}le(d===0?s:s+d/r.width*100,f===0?l:l+f)},f=()=>{window.removeEventListener(`pointermove`,d),window.removeEventListener(`pointerup`,f),b.focus(),window.requestAnimationFrame(()=>{w(!0)})};window.addEventListener(`pointermove`,d),window.addEventListener(`pointerup`,f)},j=()=>{b.update(()=>{W(d,e=>{e?.remove()})})},de=async e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(!t.type.startsWith(`image/`)){window.alert(x.alerts.onlyImages);return}if(t.size>5242880){window.alert(x.alerts.imageSizeLimit);return}let n=await yt(t);b.update(()=>{W(d,e=>{K(e)&&(e.setSrc(n),e.setAltText(t.name))})})},M=ne>0?ne*y/100:void 0,fe=c??(M?M/ie:void 0),pe=k&&fe?fe:void 0,me=k&&M?M:void 0,he={"--rj-image-rotated-aspect-ratio":`1 / ${ie}`,height:me?L(me):void 0,width:k&&pe?L(pe):se?`100%`:`${y}%`},ge=se?{maxWidth:`100%`,width:k&&pe?L(pe):`${y}%`}:void 0,_e=(0,u.jsx)(`img`,{alt:n,className:`rj-editor-image`,draggable:!1,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&ae(t.naturalWidth/t.naturalHeight)},ref:O,src:_,style:{borderRadius:a,height:c?L(c):void 0,objectFit:f}}),ve={"--rj-image-rotation":`${p}deg`,height:k&&fe?L(fe):void 0,width:k&&M?L(M):void 0};return(0,u.jsxs)(`span`,{className:[`rj-editor-image-frame`,`rj-editor-image-frame--${e}`,`rj-editor-image-frame--wrap-${v}`,C?`is-selected`:``].filter(Boolean).join(` `),ref:D,style:ge,children:[C?(0,u.jsxs)(`span`,{className:`rj-editor-image-floating-toolbar`,onClick:e=>{e.stopPropagation()},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},style:{left:ee.x,top:ee.y},children:[(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.alignLeft,onClick:()=>A(`left`),type:`button`,children:(0,u.jsx)(On,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.alignCenter,onClick:()=>A(`center`),type:`button`,children:(0,u.jsx)(Dn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.alignRight,onClick:()=>A(`right`),type:`button`,children:(0,u.jsx)(kn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{onClick:()=>ce(25),type:`button`,children:`25%`}),(0,u.jsx)(`button`,{onClick:()=>ce(50),type:`button`,children:`50%`}),(0,u.jsx)(`button`,{onClick:()=>ce(100),type:`button`,children:`100%`}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.replace,onClick:()=>void vt(E.current),type:`button`,children:(0,u.jsx)(jn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,onClick:j,type:`button`,children:(0,u.jsx)(An,{"aria-hidden":`true`})})]}):null,(0,u.jsxs)(`span`,{className:[`rj-editor-image-box`,i?`has-border`:``,m?`has-shadow`:``,r?`is-aspect-ratio-locked`:``,k?`is-quarter-turn`:``].filter(Boolean).join(` `),onClick:t=>{t.preventDefault(),t.stopPropagation(),T(),w(!0),te(Bn(t,D.current)),S(Ft({isImageSelected:!0,selectedImageAlignment:e,selectedImageAltText:n,selectedImageAspectRatioLocked:r,selectedImageBorderEnabled:i,selectedImageBorderRadius:a,selectedImageCaption:o,selectedImageHeight:c,selectedImageKey:d,selectedImageLinkUrl:l,selectedImageObjectFit:f,selectedImageRotation:p,selectedImageShadowEnabled:m,selectedImageTextWrap:v,selectedImageWidth:y}))},style:he,children:[(0,u.jsx)(`span`,{className:`rj-editor-image-rotator`,style:ve,children:l?(0,u.jsx)(`a`,{className:`rj-editor-image-link`,href:l,rel:`noreferrer`,target:`_blank`,children:_e}):_e}),o?(0,u.jsx)(`span`,{className:`rj-editor-image-caption`,children:o}):null,C?(0,u.jsx)(u.Fragment,{children:zn.map(e=>(0,u.jsx)(`span`,{"aria-hidden":`true`,className:[`rj-editor-image-resize-handle`,`rj-editor-image-resize-handle--${e}`].join(` `),onPointerDown:t=>ue(t,e)},e))}):null]}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:de,ref:E,type:`file`})]})}function Hn(e){return e===`square`||e===`around`?`square`:`top-bottom`}function Un(e){return e===`left`||e===`right`||e===`center`?e:`center`}function Wn(e){return e===`cover`||e===`fill`||e===`contain`?e:`contain`}function G(e){let t=Number.parseFloat(e||``);return Number.isFinite(t)?t:void 0}function Gn(e){let t=G(e.getAttribute(`data-width`));if(t!==void 0)return t;let n=e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`),r=G(n?.style.width);if(r!==void 0&&n?.style.width.includes(`%`))return r;let i=G(e.style.width);return i!==void 0&&e.style.width.includes(`%`)?i:100}function Kn(e){let t=e.getAttribute(`data-alignment`);if(t)return Un(t);let n=e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e;return n.style.float===`left`?`left`:n.style.float===`right`||n.style.marginLeft===`auto`&&[`0`,`0rem`].includes(n.style.marginRight)?`right`:[`0`,`0rem`].includes(n.style.marginLeft)&&n.style.marginRight===`auto`?`left`:`center`}function qn(e){let t=e.getAttribute(`data-text-wrap`);return t?Hn(t):(e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e).style.float?`square`:`top-bottom`}function Jn(e){return e.getAttribute(`data-caption`)||e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)?.querySelector(`.rj-editor-image-caption`)?.textContent||``}function Yn(e){return e.getAttribute(`data-link-url`)||e.closest(`a`)?.href||``}function Xn(e){if(!(e instanceof HTMLImageElement))return null;let t=e.getAttribute(`src`);return t?{node:$n({alignment:Kn(e),altText:e.getAttribute(`alt`)||``,aspectRatioLocked:e.getAttribute(`data-aspect-ratio-locked`)!==`false`,borderEnabled:!!e.style.border,borderRadius:G(e.style.borderRadius)||0,caption:Jn(e),height:G(e.getAttribute(`data-height`))||G(e.style.height),linkUrl:Yn(e),objectFit:Wn(e.getAttribute(`data-object-fit`)||e.style.objectFit),rotation:G(e.getAttribute(`data-rotation`))||0,shadowEnabled:!!e.style.boxShadow,src:t,textWrap:qn(e),width:Gn(e)})}:null}function Zn(e){let t=e.querySelector(`img`);return t?Xn(t):null}var Qn=class e extends t.DecoratorNode{__alignment;__aspectRatioLocked;__altText;__borderEnabled;__borderRadius;__caption;__height;__linkUrl;__objectFit;__rotation;__shadowEnabled;__src;__textWrap;__width;static clone(t){return new e(t.__src,t.__altText,t.__width,t.__alignment,t.__caption,t.__height,t.__linkUrl,t.__objectFit,t.__textWrap,t.__borderRadius,t.__borderEnabled,t.__shadowEnabled,t.__rotation,t.__aspectRatioLocked,t.__key)}static getType(){return`image`}static importDOM(){return{a:e=>!(e instanceof HTMLAnchorElement)||!e.querySelector(`img`)?null:{conversion:Zn,priority:2},img:()=>({conversion:Xn,priority:0}),span:e=>!(e instanceof HTMLElement)||e.getAttribute(`data-rj-image-caption-wrapper`)!==`true`&&e.getAttribute(`data-rj-image-rotation-wrapper`)!==`true`?null:{conversion:Zn,priority:2}}}static importJSON(e){return $n({alignment:e.alignment,altText:e.altText,aspectRatioLocked:e.aspectRatioLocked,borderEnabled:e.borderEnabled,borderRadius:e.borderRadius,caption:e.caption,height:e.height,linkUrl:e.linkUrl,objectFit:e.objectFit,rotation:e.rotation,shadowEnabled:e.shadowEnabled,src:e.src,textWrap:Hn(e.textWrap),width:e.width})}constructor(e,t=``,n=100,r=`center`,i=``,a,o=``,s=`contain`,c=`top-bottom`,l=0,u=!1,d=!1,f=0,p=!0,m){super(m),this.__src=e,this.__altText=t,this.__width=n,this.__alignment=r,this.__caption=i,this.__height=a,this.__linkUrl=o,this.__objectFit=s,this.__textWrap=c,this.__borderRadius=l,this.__borderEnabled=u,this.__shadowEnabled=d,this.__rotation=f,this.__aspectRatioLocked=p}createDOM(e){let t=document.createElement(`span`);return t.className=e.theme.image||`rj-editor-image-node`,t}decorate(){return(0,u.jsx)(Vn,{alignment:this.__alignment,altText:this.__altText,aspectRatioLocked:this.__aspectRatioLocked,borderEnabled:this.__borderEnabled,borderRadius:this.__borderRadius,caption:this.__caption,height:this.__height,linkUrl:this.__linkUrl,nodeKey:this.__key,objectFit:this.__objectFit,rotation:this.__rotation,shadowEnabled:this.__shadowEnabled,src:this.__src,textWrap:this.__textWrap,width:this.__width})}exportDOM(){let e=document.createElement(`img`);return e.setAttribute(`src`,this.__src),this.__altText&&e.setAttribute(`alt`,this.__altText),e.setAttribute(`data-alignment`,this.__alignment),e.setAttribute(`data-caption`,this.__caption),e.setAttribute(`data-height`,this.__height?String(this.__height):``),e.setAttribute(`data-link-url`,this.__linkUrl),e.setAttribute(`data-object-fit`,this.__objectFit),e.setAttribute(`data-rj-image-node-key`,this.__key),e.setAttribute(`data-rotation`,String(this.__rotation)),e.setAttribute(`data-text-wrap`,this.__textWrap),e.setAttribute(`data-width`,String(this.__width)),e.setAttribute(`data-aspect-ratio-locked`,String(this.__aspectRatioLocked)),e.style.display=`block`,e.style.borderRadius=L(this.__borderRadius),e.style.maxWidth=`100%`,e.style.objectFit=this.__objectFit,e.style.transform=`rotate(${this.__rotation}deg)`,e.style.width=`${this.__width}%`,this.__textWrap===`square`&&this.__alignment===`left`&&(e.style.float=`left`,e.style.margin=`0.25rem 1rem 0.625rem 0`),this.__textWrap===`square`&&this.__alignment===`right`&&(e.style.float=`right`,e.style.margin=`0.25rem 0 0.625rem 1rem`),this.__textWrap!==`square`&&this.__alignment===`center`&&(e.style.marginLeft=`auto`,e.style.marginRight=`auto`),this.__textWrap!==`square`&&this.__alignment===`right`&&(e.style.marginLeft=`auto`,e.style.marginRight=`0`),this.__textWrap!==`square`&&this.__alignment===`left`&&(e.style.marginLeft=`0`,e.style.marginRight=`auto`),this.__borderEnabled&&(e.style.border=`0.0625rem solid var(--rj-editor-image-border, #94a3b8)`),this.__shadowEnabled&&(e.style.boxShadow=`var(--rj-editor-image-shadow, 0 0.875rem 2rem rgb(15 23 42 / 18%))`),this.__height&&(e.style.height=L(this.__height)),{element:e}}exportJSON(){return{alignment:this.__alignment,aspectRatioLocked:this.__aspectRatioLocked,altText:this.__altText,borderEnabled:this.__borderEnabled,borderRadius:this.__borderRadius,caption:this.__caption,height:this.__height,linkUrl:this.__linkUrl,objectFit:this.__objectFit,rotation:this.__rotation,shadowEnabled:this.__shadowEnabled,src:this.__src,textWrap:this.__textWrap,type:`image`,version:1,width:this.__width}}getAlignment(){return this.getLatest().__alignment}getAltText(){return this.getLatest().__altText}getAspectRatioLocked(){return this.getLatest().__aspectRatioLocked}getBorderEnabled(){return this.getLatest().__borderEnabled}getBorderRadius(){return this.getLatest().__borderRadius}getCaption(){return this.getLatest().__caption}getLinkUrl(){return this.getLatest().__linkUrl}getHeight(){return this.getLatest().__height}getObjectFit(){return this.getLatest().__objectFit}getRotation(){return this.getLatest().__rotation}getShadowEnabled(){return this.getLatest().__shadowEnabled}getSrc(){return this.getLatest().__src}getTextWrap(){return this.getLatest().__textWrap}getWidth(){return this.getLatest().__width}setAlignment(e){let t=this.getWritable();return t.__alignment=e,t}setAltText(e){let t=this.getWritable();return t.__altText=e,t}setAspectRatioLocked(e){let t=this.getWritable();return t.__aspectRatioLocked=e,t}setBorderEnabled(e){let t=this.getWritable();return t.__borderEnabled=e,t}setBorderRadius(e){let t=this.getWritable();return t.__borderRadius=e,t}setCaption(e){let t=this.getWritable();return t.__caption=e,t}setLinkUrl(e){let t=this.getWritable();return t.__linkUrl=e,t}setHeight(e){let t=this.getWritable();return t.__height=e,t}setObjectFit(e){let t=this.getWritable();return t.__objectFit=e,t}setRotation(e){let t=this.getWritable();return t.__rotation=e,t}setShadowEnabled(e){let t=this.getWritable();return t.__shadowEnabled=e,t}setSrc(e){let t=this.getWritable();return t.__src=e,t}setTextWrap(e){let t=this.getWritable();return t.__textWrap=e,t}setWidth(e){let t=this.getWritable();return t.__width=e,t}getTextContent(){return this.__altText}isInline(){return!1}updateDOM(){return!1}};function $n({alignment:e,aspectRatioLocked:t,altText:n,borderEnabled:r,borderRadius:i,caption:a,height:o,linkUrl:s,objectFit:c,rotation:l,shadowEnabled:u,src:d,textWrap:f,width:p}){return new Qn(d,n,p,e,a,o,s,c,f,i,r,u,l,t)}function K(e){return e instanceof Qn}function er(e){let n=(0,t.$getNodeByKey)(e);ar(n)&&n.remove()}var tr=s.default.memo(function({nodeKey:e,title:n,videoId:r}){let[i]=(0,h.useLexicalComposerContext)(),[a,o,c]=(0,g.useLexicalNodeSelection)(e),l=n||`YouTube video`;return s.default.useEffect(()=>{if(!a)return;let n=i.registerCommand(t.KEY_DELETE_COMMAND,t=>(t.preventDefault(),i.update(()=>er(e)),!0),t.COMMAND_PRIORITY_LOW),r=i.registerCommand(t.KEY_BACKSPACE_COMMAND,t=>(t.preventDefault(),i.update(()=>er(e)),!0),t.COMMAND_PRIORITY_LOW);return()=>{n(),r()}},[i,a,e]),(0,u.jsx)(`div`,{className:[`rj-editor-youtube`,a?`is-selected`:``].filter(Boolean).join(` `),onClick:e=>{e.preventDefault(),e.stopPropagation(),c(),o(!0)},role:`presentation`,children:(0,u.jsx)(`iframe`,{allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,loading:`lazy`,referrerPolicy:`strict-origin-when-cross-origin`,src:`https://www.youtube-nocookie.com/embed/${r}`,title:l})})});function nr(e){let t=Te(e.getAttribute(`data-youtube-video-id`)||e.getAttribute(`src`)||``);return t?{node:ir({title:e.getAttribute(`title`)||``,videoId:t})}:null}var rr=class e extends t.DecoratorNode{__title;__videoId;static clone(t){return new e(t.__videoId,t.__title,t.__key)}static getType(){return`youtube`}static importDOM(){return{iframe:e=>Te(e.getAttribute(`src`)||``)?{conversion:nr,priority:1}:null}}static importJSON(e){return ir({title:e.title,videoId:e.videoId})}constructor(e,t=``,n){super(n),this.__videoId=e,this.__title=t}createDOM(e){let t=document.createElement(`div`);return t.className=e.theme.youtube||`rj-editor-youtube-node`,t}decorate(){return(0,u.jsx)(tr,{nodeKey:this.__key,title:this.__title,videoId:this.__videoId})}exportDOM(){let e=document.createElement(`div`),t=document.createElement(`iframe`);return e.className=`rj-editor-youtube`,e.style.aspectRatio=`16 / 9`,e.style.background=`var(--rj-editor-toolbar-bg, #f8fafc)`,e.style.border=`0.0625rem solid var(--rj-editor-border, #d9dde5)`,e.style.borderRadius=`0.5rem`,e.style.maxWidth=`45rem`,e.style.overflow=`hidden`,e.style.width=`100%`,t.setAttribute(`allow`,`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`),t.setAttribute(`allowfullscreen`,`true`),t.setAttribute(`data-youtube-video-id`,this.__videoId),t.setAttribute(`loading`,`lazy`),t.setAttribute(`referrerpolicy`,`strict-origin-when-cross-origin`),t.setAttribute(`src`,`https://www.youtube-nocookie.com/embed/${this.__videoId}`),t.setAttribute(`title`,this.__title||`YouTube video`),t.style.border=`0`,t.style.display=`block`,t.style.height=`100%`,t.style.width=`100%`,e.append(t),{element:e}}exportJSON(){return{title:this.__title,type:`youtube`,version:1,videoId:this.__videoId}}getTextContent(){return`https://www.youtube.com/watch?v=${this.__videoId}`}getTitle(){return this.getLatest().__title}getVideoId(){return this.getLatest().__videoId}isInline(){return!1}setTitle(e){let t=this.getWritable();return t.__title=e,t}updateDOM(){return!1}};function ir({title:e=``,videoId:t}){return new rr(t,e)}function ar(e){return e instanceof rr}var or={code:`rj-editor-code-block`,codeHighlight:{atrule:`rj-editor-code-token-atrule`,attr:`rj-editor-code-token-attr`,"attr-name":`rj-editor-code-token-attr`,"attr-value":`rj-editor-code-token-string`,boolean:`rj-editor-code-token-boolean`,builtin:`rj-editor-code-token-builtin`,char:`rj-editor-code-token-char`,class:`rj-editor-code-token-class`,"class-name":`rj-editor-code-token-class-name`,comment:`rj-editor-code-token-comment`,constant:`rj-editor-code-token-constant`,deleted:`rj-editor-code-token-deleted`,entity:`rj-editor-code-token-entity`,function:`rj-editor-code-token-function`,important:`rj-editor-code-token-important`,inserted:`rj-editor-code-token-inserted`,keyword:`rj-editor-code-token-keyword`,namespace:`rj-editor-code-token-namespace`,number:`rj-editor-code-token-number`,operator:`rj-editor-code-token-operator`,prolog:`rj-editor-code-token-comment`,property:`rj-editor-code-token-property`,punctuation:`rj-editor-code-token-punctuation`,regex:`rj-editor-code-token-regex`,selector:`rj-editor-code-token-selector`,string:`rj-editor-code-token-string`,symbol:`rj-editor-code-token-symbol`,tag:`rj-editor-code-token-tag`,url:`rj-editor-code-token-url`,variable:`rj-editor-code-token-variable`},paragraph:`rj-editor-paragraph`,text:{bold:`rj-editor-text-bold`,code:`rj-editor-text-code`,italic:`rj-editor-text-italic`,strikethrough:`rj-editor-text-strikethrough`,subscript:`rj-editor-text-subscript`,superscript:`rj-editor-text-superscript`,underline:`rj-editor-text-underline`},list:{ol:`rj-editor-list-ol`,ul:`rj-editor-list-ul`,listitem:`rj-editor-list-item`},equation:`rj-editor-equation-node`,image:`rj-editor-image-node`,youtube:`rj-editor-youtube-node`,table:`rj-editor-table`,tableCell:`rj-editor-table-cell`,tableCellHeader:`rj-editor-table-cell-header`,tableCellSelected:`rj-editor-table-cell-selected`,tableRow:`rj-editor-table-row`,tableScrollableWrapper:`rj-editor-table-scrollable-wrapper`,tableSelection:`rj-editor-table-selection`};function sr({defaultValue:e,namespace:n,value:r}){return{namespace:n,nodes:[m.CodeNode,m.CodeHighlightNode,wn,{replace:t.TextNode,with:En,withKlass:wn},gn,Qn,rr,d.LinkNode,f.ListNode,f.ListItemNode,p.TableCellNode,p.TableNode,p.TableRowNode],onError(e){throw e},editorState:r||e?t=>kt(t,r||e||``):void 0,theme:or}}function cr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M5 15C4.06812 15 3.60218 15 3.23463 14.8478C2.74458 14.6448 2.35523 14.2554 2.15224 13.7654C2 13.3978 2 12.9319 2 12V5.2C2 4.0799 2 3.51984 2.21799 3.09202C2.40973 2.71569 2.71569 2.40973 3.09202 2.21799C3.51984 2 4.0799 2 5.2 2H12C12.9319 2 13.3978 2 13.7654 2.15224C14.2554 2.35523 14.6448 2.74458 14.8478 3.23463C15 3.60218 15 4.06812 15 5M12.2 22H18.8C19.9201 22 20.4802 22 20.908 21.782C21.2843 21.5903 21.5903 21.2843 21.782 20.908C22 20.4802 22 19.9201 22 18.8V12.2C22 11.0799 22 10.5198 21.782 10.092C21.5903 9.71569 21.2843 9.40973 20.908 9.21799C20.4802 9 19.9201 9 18.8 9H12.2C11.0799 9 10.5198 9 10.092 9.21799C9.71569 9.40973 9.40973 9.71569 9.21799 10.092C9 10.5198 9 11.0799 9 12.2V18.8C9 19.9201 9 20.4802 9.21799 20.908C9.40973 21.2843 9.71569 21.5903 10.092 21.782C10.5198 22 11.0799 22 12.2 22Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function lr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 9L12 15L18 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var ur=190,q=8,dr=(0,m.getCodeLanguageOptions)().map(([e,t])=>({label:t,value:e})),fr={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#181818`,colorBgElevated:`#202020`,colorBorder:`#4a4a4a`,colorFillSecondary:`#303030`,colorPrimary:`#b8b8b8`,colorText:`#ededed`,colorTextPlaceholder:`#8f8f8f`,colorTextSecondary:`#b8b8b8`}};function pr({editor:e,language:n,nodeKey:r}){let i=H(),a=s.default.useRef(null),[c,l]=s.default.useState(!1),[d,f]=s.default.useState({left:0,top:0,visible:!1}),p=s.default.useCallback(()=>{let t=e.getElementByKey(r),n=e.getRootElement()?.closest(`.rj-editor-body`);if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)){f(e=>e.visible?{...e,visible:!1}:e);return}let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),s=a.current?.getBoundingClientRect().width||ur,c=Math.max(q,i.width-s-q),l=o.right-i.left-s-q,u={left:Math.min(Math.max(l,q),c),top:Math.max(o.top-i.top+q,q),visible:!0};f(e=>e.left===u.left&&e.top===u.top&&e.visible===u.visible?e:u)},[e,r]);s.default.useEffect(()=>{let t=window.requestAnimationFrame(p),n=e.getElementByKey(r),i=e.getRootElement()?.closest(`.rj-editor-body`),o=typeof ResizeObserver>`u`?null:new ResizeObserver(p);return n&&o?.observe(n),i&&o?.observe(i),a.current&&o?.observe(a.current),window.addEventListener(`resize`,p),document.addEventListener(`scroll`,p,!0),()=>{window.cancelAnimationFrame(t),o?.disconnect(),window.removeEventListener(`resize`,p),document.removeEventListener(`scroll`,p,!0)}},[e,r,p]),s.default.useEffect(()=>{if(!c)return;let e=window.setTimeout(()=>l(!1),1600);return()=>window.clearTimeout(e)},[c]);let h=async()=>{let n=``;e.getEditorState().read(()=>{let e=(0,t.$getNodeByKey)(r);(0,m.$isCodeNode)(e)&&(n=e.getTextContent())}),await he(n),l(!0)};return d.visible?(0,u.jsxs)(`div`,{className:`rj-editor-code-block-actions`,contentEditable:!1,onMouseDown:e=>e.stopPropagation(),ref:a,style:{left:d.left,top:d.top},children:[(0,u.jsx)(o.ConfigProvider,{theme:fr,children:(0,u.jsx)(o.Select,{suffixIcon:(0,u.jsx)(lr,{}),"aria-label":i.toolbar.codeBlock.language,className:`rj-editor-code-block-language-select`,classNames:{popup:{root:`rj-editor-code-block-language-popup`}},onChange:n=>{e.update(()=>{let e=(0,t.$getNodeByKey)(r);(0,m.$isCodeNode)(e)&&e.setLanguage(n)})},options:dr,popupMatchSelectWidth:!1,size:`small`,value:n})}),(0,u.jsx)(`button`,{"aria-label":c?i.toolbar.codeBlock.copied:i.toolbar.codeBlock.copy,className:c?`is-copied`:void 0,onClick:()=>void h(),title:c?i.toolbar.codeBlock.copied:i.toolbar.codeBlock.copy,type:`button`,children:(0,u.jsx)(cr,{"aria-hidden":`true`})})]}):null}function mr(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.key===r?.key&&e.language===r.language})}function hr(){let[e]=(0,h.useLexicalComposerContext)(),[n,r]=s.default.useState([]);return s.default.useEffect(()=>{let n=()=>{let e=(0,t.$nodesOfType)(m.CodeNode).map(e=>({key:e.getKey(),language:e.getLanguage()||`plain`}));r(t=>mr(t,e)?t:e)};return e.getEditorState().read(n),e.registerUpdateListener(({editorState:e})=>{e.read(n)})},[e]),n.map(t=>(0,u.jsx)(pr,{editor:e,language:t.language,nodeKey:t.key},t.key))}function gr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H3M21 18H3M21 6H3M21 14H3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function _r({editor:e}){let n=H(),r=V(e=>e.toolbar.alignment),i=r===``||r===`start`?`left`:r===`end`?`right`:r;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.left,"aria-pressed":i===`left`,className:i===`left`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`left`),title:N(`MOD+SHIFT+L`,n.toolbar.alignment.left),type:`button`,children:(0,u.jsx)(On,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.center,"aria-pressed":i===`center`,className:i===`center`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`center`),title:N(`MOD+SHIFT+C`,n.toolbar.alignment.center),type:`button`,children:(0,u.jsx)(Dn,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.right,"aria-pressed":i===`right`,className:i===`right`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`right`),title:N(`MOD+SHIFT+R`,n.toolbar.alignment.right),type:`button`,children:(0,u.jsx)(kn,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.justify,"aria-pressed":i===`justify`,className:i===`justify`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`justify`),title:N(`MOD+SHIFT+J`,n.toolbar.alignment.justify),type:`button`,children:(0,u.jsx)(gr,{})})]})}function J(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`})}function vr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 9H16.5C18.9853 9 21 11.0147 21 13.5C21 15.9853 18.9853 18 16.5 18H12M7 13L3 9L7 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function yr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9H7.5C5.01472 9 3 11.0147 3 13.5C3 15.9853 5.01472 18 7.5 18H12M17 13L21 9L17 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function br({editor:e}){let n=H(),{canRedo:r,canUndo:i}=V(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.undo,disabled:!i,onClick:()=>e.dispatchCommand(t.UNDO_COMMAND,void 0),title:N(`MOD+Z`,n.toolbar.shortcuts.undo),type:`button`,children:(0,u.jsx)(vr,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.redo,disabled:!r,onClick:()=>e.dispatchCommand(t.REDO_COMMAND,void 0),title:N(`MOD+Y`,n.toolbar.shortcuts.redo),type:`button`,children:(0,u.jsx)(yr,{})})]})}function xr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9.25H12M21 4H3M21 14.75H12M21 20H3M4.28 8.56L8.14667 11.46C8.43616 11.6771 8.5809 11.7857 8.63266 11.9188C8.678 12.0353 8.678 12.1647 8.63266 12.2812C8.5809 12.4143 8.43616 12.5229 8.14667 12.74L4.28 15.64C3.86802 15.949 3.66203 16.1035 3.48961 16.0999C3.33956 16.0968 3.19885 16.0264 3.10632 15.9082C3 15.7725 3 15.515 3 15V9.2C3 8.68503 3 8.42754 3.10632 8.29175C3.19885 8.17358 3.33956 8.10323 3.48961 8.10011C3.66203 8.09652 3.86802 8.25102 4.28 8.56Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Sr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 4H3M21 20H3M12 9.25H3M12 14.75H3M19.72 8.46L15.8533 11.36C15.5638 11.5771 15.4191 11.6857 15.3673 11.8188C15.322 11.9353 15.322 12.0647 15.3673 12.1812C15.4191 12.3143 15.5638 12.4229 15.8533 12.64L19.72 15.54C20.132 15.849 20.338 16.0035 20.5104 15.9999C20.6604 15.9968 20.8012 15.9264 20.8937 15.8082C21 15.6725 21 15.415 21 14.9V9.1C21 8.58503 21 8.32754 20.8937 8.19175C20.8012 8.07358 20.6604 8.00323 20.5104 8.00011C20.338 7.99652 20.132 8.15102 19.72 8.46Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Cr(){let[e]=(0,h.useLexicalComposerContext)(),n=H();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.increaseIndent,onClick:()=>e.dispatchCommand(t.INDENT_CONTENT_COMMAND,void 0),title:N(`MOD+]`,n.toolbar.shortcuts.increaseIndent),type:`button`,children:(0,u.jsx)(xr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.decreaseIndent,onClick:()=>e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),title:N(`MOD+[`,n.toolbar.shortcuts.decreaseIndent),type:`button`,children:(0,u.jsx)(Sr,{"aria-hidden":`true`})})]})}function wr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 5.00001L10 5.00001M21 19L10 19M21 12L12 12M6 5.00001C5.5 5.00004 5.32843 5.00001 4.5 5.00001C3.67157 5.00001 3.5 4.99999 3 5.00001M6 19C5.5 19 5.32843 19 4.5 19C3.67157 19 3.5 19 3 19M11 8C9 10 7 12 7 12M7 12C7 12 5 10 3 8M7 12C7 12 9 14 11 16M7 12C7 12 5 14 3 16`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Tr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 12L9 12M21 6L9 6M21 18L9 18M5 12C5 12.5523 4.55228 13 4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11C4.55228 11 5 11.4477 5 12ZM5 6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6C3 5.44772 3.44772 5 4 5C4.55228 5 5 5.44772 5 6ZM5 18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18C3 17.4477 3.44772 17 4 17C4.55228 17 5 17.4477 5 18Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Er(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 5.00001L10 5.00001M21 19L10 19M21 12L10 12M6 5.00001C5.5 5.00004 5.32843 5.00001 4.5 5.00001C3.67157 5.00001 3.5 4.99999 3 5.00001M6 19C5.5 19 5.32843 19 4.5 19C3.67157 19 3.5 19 3 19M6 12C5.5 12 5.32843 12 4.5 12C3.67157 12 3.5 12 3 12`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Dr({editor:e}){let t=H(),n=V(e=>e.toolbar.listType);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.bullet,"aria-pressed":n===`bullet`,className:n===`bullet`?`is-active`:void 0,onClick:()=>e.dispatchCommand(f.INSERT_UNORDERED_LIST_COMMAND,void 0),title:N(`MOD+SHIFT+8`,t.toolbar.shortcuts.bulletList),type:`button`,children:(0,u.jsx)(Tr,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.numbered,"aria-pressed":n===`number`,className:n===`number`?`is-active`:void 0,onClick:()=>e.dispatchCommand(f.INSERT_ORDERED_LIST_COMMAND,void 0),title:N(`MOD+SHIFT+7`,t.toolbar.shortcuts.numberedList),type:`button`,children:(0,u.jsx)(Er,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.remove,"aria-pressed":n===void 0?void 0:!1,onClick:()=>e.dispatchCommand(f.REMOVE_LIST_COMMAND,void 0),title:t.toolbar.shortcuts.removeList,type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(wr,{})})]})}function Or(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H13M21 6H13M21 14H13M21 18H13M6 20L6 4M9 17L6 20L3 17M9 7L6 4L3 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Y(e,n){e.focus(()=>{e.update(()=>{let e=(0,t.$getSelection)();(0,t.$isRangeSelection)(e)&&(0,E.$patchStyleText)(e,n)})})}function kr(e){e.update(()=>{let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e))return;(0,E.$patchStyleText)(e,{"background-color":null,color:null,"font-family":null,"font-size":null,"line-height":null}),[`bold`,`capitalize`,`code`,`highlight`,`italic`,`lowercase`,`strikethrough`,`subscript`,`superscript`,`underline`,`uppercase`].forEach(t=>{e.hasFormat(t)&&e.formatText(t)}),e.setFormat(0),(0,f.$isListNode)((0,D.$getNearestNodeOfType)(e.anchor.getNode(),f.ListNode))&&(0,f.$removeList)(),(0,E.$setBlocksType)((0,t.$getSelection)(),t.$createParagraphNode,(e,t)=>{t.setFormat(``),t.setIndent(0),t.setDirection(null)});let n=(0,t.$getSelection)();(0,t.$isRangeSelection)(n)&&n.getNodes().forEach(e=>{let n=e.getTopLevelElement();(0,t.$isElementNode)(n)&&(n.setFormat(``),n.setIndent(0),n.setDirection(null))})})}function Ar(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=B(),r=V(e=>e.toolbar),i=t=>{Y(e,{"line-height":t||null}),n(z({...r,lineHeight:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`default`,label:(0,u.jsx)(`button`,{className:`rj-editor-spacing-menu-item`,onClick:()=>i(void 0),type:`button`,children:t.toolbar.spacing.default})},{type:`divider`},...Ve.map(e=>({key:e,label:(0,u.jsx)(`button`,{className:`rj-editor-spacing-menu-item`,onClick:()=>i(e),type:`button`,children:e})}))]},trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.spacing.lineAndParagraph,className:r.lineHeight?`is-active`:void 0,title:t.toolbar.shortcuts.spacing,type:`button`,children:(0,u.jsx)(Or,{"aria-hidden":`true`})})})}function jr(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M2 12C2 17.5228 6.47715 22 12 22C13.6569 22 15 20.6569 15 19V18.5C15 18.0356 15 17.8034 15.0257 17.6084C15.2029 16.2622 16.2622 15.2029 17.6084 15.0257C17.8034 15 18.0356 15 18.5 15H19C20.6569 15 22 13.6569 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M7 13C7.55228 13 8 12.5523 8 12C8 11.4477 7.55228 11 7 11C6.44772 11 6 11.4477 6 12C6 12.5523 6.44772 13 7 13Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M16 9C16.5523 9 17 8.55228 17 8C17 7.44772 16.5523 7 16 7C15.4477 7 15 7.44772 15 8C15 8.55228 15.4477 9 16 9Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6C9.44772 6 9 6.44772 9 7C9 7.55228 9.44772 8 10 8Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Mr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),[n,r]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),c=B(),l=V(e=>e.toolbar),d=l.backgroundColor,f=t=>{Y(e,{"background-color":t||null}),c(z({...l,backgroundColor:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{f(``),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},...F.map(e=>({key:e,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{f(e),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:e}}),e]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:d||F[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:e=>{f(e.target.value),a(e.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:d||F[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{Y(e,{"background-color":i})}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.backgroundColor,className:`rj-editor-color-button`,title:t.toolbar.shortcuts.backgroundColor,type:`button`,children:(0,u.jsx)(`span`,{className:d?`rj-editor-background-color-mark`:`rj-editor-background-color-mark is-none`,style:d?{backgroundColor:d}:void 0,children:(0,u.jsx)(jr,{})})})})}function Nr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 6L6 18M6 6L18 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Pr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=B();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.clearFormatting,onClick:()=>{kr(e),n(Lt({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(z({backgroundColor:I.backgroundColor,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight,textColor:I.textColor})),n(jt({alignment:I.alignment,listType:I.listType}))},title:N(`MOD+\\`,t.toolbar.shortcuts.clearFormatting),type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(Nr,{})})}function Fr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=B(),r=V(e=>e.toolbar);return(0,u.jsx)(o.Select,{"aria-label":t.toolbar.style.fontFamily,className:`rj-editor-toolbar-select rj-editor-toolbar-select-font`,onChange:(t=``)=>{Y(e,{"font-family":t||null}),n(z({...r,fontFamily:t}))},options:Fe.map(e=>({label:e,value:e})),placeholder:t.toolbar.style.fontFamilyPlaceholder,popupMatchSelectWidth:!1,size:`small`,title:t.toolbar.shortcuts.fontFamily,value:r.fontFamily==``?void 0:r.fontFamily,suffixIcon:(0,u.jsx)(lr,{})})}function Ir(e){let t=Number.parseFloat(e);return Number.isFinite(t)?String(Number((t*16).toFixed(2))):e}function Lr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=B(),r=V(e=>e.toolbar);return(0,u.jsx)(o.Select,{"aria-label":t.toolbar.style.fontSize,className:`rj-editor-toolbar-select`,onChange:(t=``)=>{Y(e,{"font-size":t||null}),n(z({...r,fontSize:t}))},options:Ie.map(e=>({label:Ir(e),value:e})),placeholder:t.toolbar.style.fontSizePlaceholder,popupMatchSelectWidth:!1,size:`small`,title:t.toolbar.shortcuts.fontSize,value:r.fontSize==``?void 0:r.fontSize,suffixIcon:(0,u.jsx)(lr,{})})}function Rr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),[n,r]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),c=B(),l=V(e=>e.toolbar),d=l.textColor,f=t=>{Y(e,{color:t||null}),c(z({...l,textColor:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{f(``),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},...Ue.map(e=>({key:e,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{f(e),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:e}}),e]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:d||Ue[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:e=>{f(e.target.value),a(e.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:d||Ue[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{Y(e,{color:i})}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.textColor,className:`rj-editor-color-button`,title:t.toolbar.shortcuts.textColor,type:`button`,children:(0,u.jsxs)(`span`,{className:`rj-editor-text-color-mark`,children:[`A`,(0,u.jsx)(`span`,{className:`rj-editor-text-color-line`,style:{backgroundColor:d||`currentColor`}})]})})})}function zr(){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Fr,{}),(0,u.jsx)(Lr,{}),(0,u.jsx)(Rr,{}),(0,u.jsx)(Mr,{}),(0,u.jsx)(Pr,{})]})}function Br(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 16C6 18.2091 7.79086 20 10 20H14C16.2091 20 18 18.2091 18 16C18 13.7909 16.2091 12 14 12M18 8C18 5.79086 16.2091 4 14 4H10C7.79086 4 6 5.79086 6 8M3 12H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Vr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 12H14C16.2091 12 18 10.2091 18 8C18 5.79086 16.2091 4 14 4H6V12ZM6 12H15C17.2091 12 19 13.7909 19 16C19 18.2091 17.2091 20 15 20H6V12Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Hr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M17 17L22 12L17 7M7 7L2 12L7 17M14 3L10 21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ur(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M19 4H10M14 20H5M15 4L9 20`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Wr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 5L13 15M13 5L3 15M21 19.0001H17C17 17.5001 17.44 17.0001 18.5 16.5001C19.56 16.0001 21 15.3301 21 14.0001C21 13.5301 20.83 13.0701 20.52 12.7101C20.1999 12.3476 19.7649 12.1061 19.2879 12.026C18.811 11.9459 18.321 12.0321 17.9 12.2701C17.48 12.5101 17.16 12.8901 17 13.3401`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Gr(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 19L13 9M13 19L3 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M17 6.20449C17.824 4.52464 20.0058 4.6741 20.7484 6.20449C20.907 6.53145 21 6.92143 21 7.37007C21 10.428 17 8.60237 17 11.301C17 12.4597 17 11.8301 17 12H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Kr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 4V11C18 14.3137 15.3137 17 12 17C8.68629 17 6 14.3137 6 11V4M4 21H20`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function qr(){let[e]=(0,h.useLexicalComposerContext)(),n=H(),{isBold:r,isCode:i,isItalic:a,isStrikethrough:o,isSubscript:s,isSuperscript:c,isUnderline:l}=V(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.bold,"aria-pressed":r,className:r?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`bold`),title:N(`MOD+B`,n.toolbar.shortcuts.bold),type:`button`,children:(0,u.jsx)(Vr,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.italic,"aria-pressed":a,className:a?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`italic`),title:N(`MOD+I`,n.toolbar.shortcuts.italic),type:`button`,children:(0,u.jsx)(Ur,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.underline,"aria-pressed":l,className:l?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`underline`),title:N(`MOD+U`,n.toolbar.shortcuts.underline),type:`button`,children:(0,u.jsx)(Kr,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.strikethrough,"aria-pressed":o,className:o?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`strikethrough`),title:N(`MOD+SHIFT+X`,n.toolbar.shortcuts.strikethrough),type:`button`,children:(0,u.jsx)(Br,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.code,"aria-pressed":i,className:i?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`code`),title:n.toolbar.textFormat.code,type:`button`,children:(0,u.jsx)(Hr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.subscript,"aria-pressed":s,className:s?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`subscript`),title:N(`MOD+=`,n.toolbar.shortcuts.subscript),type:`button`,children:(0,u.jsx)(Wr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.superscript,"aria-pressed":c,className:c?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`superscript`),title:N(`MOD+SHIFT+=`,n.toolbar.shortcuts.superscript),type:`button`,children:(0,u.jsx)(Gr,{"aria-hidden":`true`})})]})}function Jr({editor:e}){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel rj-editor-toolbar-panel--home`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(br,{editor:e}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(qr,{}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Ar,{}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(_r,{editor:e}),(0,u.jsx)(J,{})]})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(zr,{}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Dr,{editor:e}),(0,u.jsx)(J,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(Cr,{})})]})]})}function Yr(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9.25H15M21 4H3M21 14.75H15M21 20H3M4.6 16H9.4C9.96005 16 10.2401 16 10.454 15.891C10.6422 15.7951 10.7951 15.6422 10.891 15.454C11 15.2401 11 14.9601 11 14.4V9.6C11 9.03995 11 8.75992 10.891 8.54601C10.7951 8.35785 10.6422 8.20487 10.454 8.10899C10.2401 8 9.96005 8 9.4 8H4.6C4.03995 8 3.75992 8 3.54601 8.10899C3.35785 8.20487 3.20487 8.35785 3.10899 8.54601C3 8.75992 3 9.03995 3 9.6V14.4C3 14.9601 3 15.2401 3.10899 15.454C3.20487 15.6422 3.35785 15.7951 3.54601 15.891C3.75992 16 4.03995 16 4.6 16Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Xr(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 4H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 20H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`rect`,{x:`3`,y:`8`,width:`8`,height:`8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`})]})}var X={wrapper:`_wrapper_se0k7_1`,disabled:`_disabled_se0k7_23`,affix:`_affix_se0k7_28`,input:`_input_se0k7_43`,inputAffix:`_inputAffix_se0k7_58`};function Zr({className:e,decimalScale:t=2,defaultValue:n,integerOnly:r=!1,locale:i=!1,max:a,min:o,onBlur:c,onChange:l,prefix:d,suffix:f,value:p,...m}){let h=s.default.useRef(null),g=typeof p==`number`,[_,v]=s.default.useState(!1),[y,b]=s.default.useState(()=>pt(g?p:n,i)),x=g&&!_?pt(p,i):y,S=e=>{let n=Ne(e.target.value,t,r),s=Se(n,i),c=Number(n);b(s),n!==``&&n!==`.`&&Number.isFinite(c)&&l?.(me(c,o,a))},C=e=>{v(!1);let t=x.replace(/\s/g,``),n=Number(t);if(t===``||t===`.`||!Number.isFinite(n))b(``);else{let e=me(n,o,a);b(pt(e,i)),l?.(e)}c?.(e)},w=e=>{let t=h.current;if(!t)return;t.focus();let n=e===`start`?0:t.value.length;t.setSelectionRange(n,n)},T=(0,u.jsx)(`input`,{...m,className:[X.input,d||f?X.inputAffix:``,d||f?``:e].filter(Boolean).join(` `),inputMode:r?`numeric`:`decimal`,onBlur:C,onChange:S,onFocus:e=>{v(!0),m.onFocus?.(e)},ref:h,type:`text`,value:x});return!d&&!f?T:(0,u.jsxs)(`span`,{className:[X.wrapper,m.disabled?X.disabled:``,e].filter(Boolean).join(` `),children:[d?(0,u.jsx)(`span`,{className:X.affix,onMouseDown:e=>{e.preventDefault(),w(`start`)},children:d}):null,T,f?(0,u.jsx)(`span`,{className:X.affix,onMouseDown:e=>{e.preventDefault(),w(`end`)},children:f}):null]})}var Z={overlay:`_overlay_qjax1_1`,modal:`_modal_qjax1_12`,header:`_header_qjax1_24`,title:`_title_qjax1_34`,closeButton:`_closeButton_qjax1_42`,body:`_body_qjax1_65`,footer:`_footer_qjax1_71`,button:`_button_qjax1_80`,cancelButton:`_cancelButton_qjax1_96`,okButton:`_okButton_qjax1_106`};function Qr({cancelText:e,children:t,okText:n,onCancel:r,onOk:i,open:a,title:o,width:c=420}){let l=H(),d=Qt(),f=s.default.useRef(null),p=s.default.useRef({x:0,y:0}),[m,h]=s.default.useState(null);if(s.default.useEffect(()=>{if(!a)return;let e=e=>{if(e.key===`Escape`){r();return}e.key===`Enter`&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!(e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),i())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[r,i,a]),!a||typeof document>`u`)return null;let g=document.fullscreenElement||document.body,_=(e,t)=>{let n=f.current?.getBoundingClientRect(),r=n?.width||c,i=n?.height||0,a=Math.max(8,window.innerWidth-r-8),o=Math.max(8,window.innerHeight-i-8);return{x:Math.min(Math.max(e,8),a),y:Math.min(Math.max(t,8),o)}};return(0,O.createPortal)((0,u.jsx)(`div`,{className:Z.overlay,"data-rj-editor-theme":d,onMouseDown:e=>{e.target===e.currentTarget&&r()},role:`presentation`,children:(0,u.jsxs)(`div`,{"aria-modal":`true`,className:Z.modal,ref:f,role:`dialog`,style:{"--rj-modal-width":L(c),left:m?L(m.x):void 0,position:m?`fixed`:void 0,top:m?L(m.y):void 0},children:[(0,u.jsxs)(`div`,{className:Z.header,onPointerDown:e=>{if(e.button!==0)return;let t=f.current?.getBoundingClientRect();t&&(e.currentTarget.setPointerCapture(e.pointerId),p.current={x:e.clientX-t.left,y:e.clientY-t.top},h(_(t.left,t.top)))},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&h(_(e.clientX-p.current.x,e.clientY-p.current.y))},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},children:[o?(0,u.jsx)(`h2`,{className:Z.title,children:o}):(0,u.jsx)(`span`,{}),(0,u.jsx)(`button`,{"aria-label":l.modal.closeAriaLabel,className:Z.closeButton,onClick:r,onPointerDown:e=>{e.stopPropagation()},type:`button`,children:(0,u.jsx)(Nr,{"aria-hidden":`true`})})]}),(0,u.jsx)(`div`,{className:Z.body,children:t}),i?(0,u.jsxs)(`div`,{className:Z.footer,children:[(0,u.jsx)(`button`,{className:`${Z.button} ${Z.cancelButton}`,onClick:r,type:`button`,children:e||l.common.close}),(0,u.jsx)(`button`,{className:`${Z.button} ${Z.okButton}`,onClick:i,type:`button`,children:n||l.common.save})]}):null]})}),g)}function $r(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function ei(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(K);return K(n)?n:null}function ti(){let e=ei();return{isImageSelected:!!e,selectedImageAlignment:e?.getAlignment(),selectedImageAltText:e?.getAltText(),selectedImageAspectRatioLocked:e?.getAspectRatioLocked(),selectedImageBorderEnabled:e?.getBorderEnabled(),selectedImageBorderRadius:e?.getBorderRadius(),selectedImageCaption:e?.getCaption(),selectedImageHeight:e?.getHeight(),selectedImageKey:e?.getKey(),selectedImageLinkUrl:e?.getLinkUrl(),selectedImageObjectFit:e?.getObjectFit(),selectedImageRotation:e?.getRotation(),selectedImageShadowEnabled:e?.getShadowEnabled(),selectedImageTextWrap:e?.getTextWrap(),selectedImageWidth:e?.getWidth()}}function Q(e,t){e.update(()=>{let e=ei();e&&t(e)}),e.focus()}function ni(e,n,r){e.update(()=>{let e=(0,t.$getNodeByKey)(n);K(e)&&r(e)}),e.focus()}function ri(e,t){Q(e,e=>{e.setAlignment(t)})}function ii(e,t){Q(e,e=>{e.setWidth(t)})}function ai(e,n){Q(e,e=>{e.setTextWrap(n),n===`square`&&e.getAlignment()===`center`&&e.setAlignment(`left`);let r=e.getParent();r&&!(0,t.$isRootOrShadowRoot)(r)&&r.insertBefore(e)})}function oi(e){Q(e,e=>{e.remove()})}function si(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 5.00802C13.6667 4.84146 5 7.20666 5 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}function ci(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M2 10C2 10 4.00498 7.26822 5.63384 5.63824C7.26269 4.00827 9.5136 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.89691 21 4.43511 18.2543 3.35177 14.5M8 10H2V4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function li(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10C21 10 18.995 7.26822 17.3662 5.63824C15.7373 4.00827 13.4864 3 11 3C6.02944 3 2 7.02944 2 12C2 16.9706 6.02944 21 11 21C15.1031 21 18.5649 18.2543 19.6482 14.5M15 10H21V4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ui(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=s.default.useRef(null),{isImageSelected:r,selectedImageAlignment:i,selectedImageAltText:a,selectedImageBorderEnabled:c,selectedImageBorderRadius:l,selectedImageCaption:f,selectedImageKey:p,selectedImageLinkUrl:m,selectedImageObjectFit:g,selectedImageRotation:_,selectedImageShadowEnabled:v,selectedImageTextWrap:y,selectedImageWidth:b}=V(e=>e.toolbar),[x,S]=s.default.useState(null),[C,w]=s.default.useState(``),T=s.default.useMemo(()=>[{label:t.toolbar.image.fitContain,value:`contain`},{label:t.toolbar.image.fitCover,value:`cover`},{label:t.toolbar.image.fitFill,value:`fill`}],[t]),E=s.default.useMemo(()=>({alt:{label:t.toolbar.image.alt,placeholder:t.toolbar.image.altPlaceholder,title:t.toolbar.image.editAlt},caption:{label:t.toolbar.image.caption,placeholder:t.toolbar.image.captionPlaceholder,title:t.toolbar.image.editCaption},link:{label:t.toolbar.image.link,placeholder:t.toolbar.image.linkPlaceholder,title:t.toolbar.image.editLink}}),[t]),D=e=>{let t={alt:a||``,caption:f||``,link:m||``};S(e),w(t[e])},O=()=>{S(null),w(``),e.focus()};return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel rj-editor-toolbar-panel--image`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignLeft,className:i===`left`?`is-active`:void 0,disabled:!r,onClick:()=>ri(e,`left`),type:`button`,children:(0,u.jsx)(On,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignCenter,className:i===`center`?`is-active`:void 0,disabled:!r,onClick:()=>ri(e,`center`),type:`button`,children:(0,u.jsx)(Dn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignRight,className:i===`right`?`is-active`:void 0,disabled:!r,onClick:()=>ri(e,`right`),type:`button`,children:(0,u.jsx)(kn,{"aria-hidden":`true`})}),(0,u.jsx)($r,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Zr,{"aria-label":t.toolbar.image.width,className:`rj-editor-image-width-input`,max:100,min:10,decimalScale:3,suffix:`%`,onChange:t=>ii(e,t),value:b||100}),[25,50,100].map(t=>(0,u.jsxs)(`button`,{className:b===t?`is-active`:void 0,disabled:!r,onClick:()=>ii(e,t),type:`button`,children:[t,`%`]},t)),(0,u.jsx)($r,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{disabled:!r,onClick:()=>D(`alt`),type:`button`,children:t.toolbar.image.alt}),(0,u.jsx)(`button`,{className:f?`is-active`:void 0,disabled:!r,onClick:()=>D(`caption`),type:`button`,children:t.toolbar.image.caption}),(0,u.jsx)(`button`,{className:m?`is-active`:void 0,disabled:!r,onClick:()=>D(`link`),type:`button`,children:t.toolbar.image.link}),(0,u.jsx)($r,{})]})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{className:c?`is-active`:void 0,disabled:!r,onClick:()=>Q(e,e=>{e.setBorderEnabled(!e.getBorderEnabled())}),type:`button`,children:t.toolbar.image.border}),(0,u.jsx)(Zr,{"aria-label":t.toolbar.image.borderRadius,className:`rj-editor-image-border-radius-input`,integerOnly:!0,max:64,min:0,prefix:(0,u.jsx)(si,{}),onChange:t=>Q(e,e=>e.setBorderRadius(t)),value:l||0}),(0,u.jsx)(`button`,{className:v?`is-active`:void 0,disabled:!r,onClick:()=>Q(e,e=>{e.setShadowEnabled(!e.getShadowEnabled())}),type:`button`,children:t.toolbar.image.shadow}),(0,u.jsx)($r,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(o.Select,{"aria-label":t.toolbar.image.cropMode,className:`rj-editor-toolbar-select rj-editor-toolbar-select-crop`,disabled:!r,onChange:t=>Q(e,e=>e.setObjectFit(t)),options:T,size:`small`,suffixIcon:(0,u.jsx)(lr,{}),value:g||`contain`}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.topBottomWrap,className:y===`top-bottom`?`is-active`:void 0,disabled:!r,onClick:()=>ai(e,`top-bottom`),title:t.toolbar.image.topBottomWrap,type:`button`,children:(0,u.jsx)(Xr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.squareWrap,className:y===`square`?`is-active`:void 0,disabled:!r,onClick:()=>ai(e,`square`),title:t.toolbar.image.squareWrap,type:`button`,children:(0,u.jsx)(Yr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateLeft,disabled:!r,onClick:()=>Q(e,e=>e.setRotation((_||0)-90)),type:`button`,children:(0,u.jsx)(ci,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateRight,disabled:!r,onClick:()=>Q(e,e=>e.setRotation((_||0)+90)),type:`button`,children:(0,u.jsx)(li,{})}),(0,u.jsx)($r,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.replace,disabled:!r,onClick:()=>{vt(n.current)},type:`button`,children:(0,u.jsx)(jn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,disabled:!r,onClick:()=>oi(e),type:`button`,children:(0,u.jsx)(An,{"aria-hidden":`true`})}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:async n=>{let r=n.target.files?.[0];if(n.target.value=``,!r)return;if(!r.type.startsWith(`image/`)){window.alert(t.alerts.onlyImages);return}if(r.size>5242880){window.alert(t.alerts.imageSizeLimit);return}let i=await yt(r);Q(e,e=>{e.setSrc(i),e.setAltText(r.name)})},ref:n,type:`file`})]})]}),(0,u.jsx)(Qr,{okText:t.common.save,onCancel:O,onOk:()=>{if(!x||!p){O();return}let t=C.trim();ni(e,p,e=>{if(x===`alt`){e.setAltText(t);return}if(x===`caption`){e.setCaption(t);return}e.setLinkUrl(t?(0,d.formatUrl)(t):``)}),S(null),w(``)},open:!!x,title:x?E[x].title:void 0,children:x?(0,u.jsxs)(`div`,{className:`rj-editor-image-edit-form`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-image-edit-input`,children:E[x].label}),x===`caption`?(0,u.jsx)(`textarea`,{autoFocus:!0,id:`rj-editor-image-edit-input`,onChange:e=>w(e.target.value),placeholder:E[x].placeholder,rows:4,value:C}):(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-image-edit-input`,onChange:e=>w(e.target.value),placeholder:E[x].placeholder,type:x===`link`?`url`:`text`,value:C})]}):null})]})}function di(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function fi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M16 18L22 12L16 6M8 6L2 12L8 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function pi(){let[e]=(0,h.useLexicalComposerContext)(),t=H();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.codeBlock,onClick:()=>{e.dispatchCommand(Le,{language:`plain`}),window.requestAnimationFrame(()=>e.focus())},onMouseDown:e=>e.preventDefault(),title:t.toolbar.insert.codeBlock,type:`button`,children:(0,u.jsx)(fi,{"aria-hidden":`true`})})}function mi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M4.27209 20.7279L10.8686 14.1314C11.2646 13.7354 11.4627 13.5373 11.691 13.4632C11.8918 13.3979 12.1082 13.3979 12.309 13.4632C12.5373 13.5373 12.7354 13.7354 13.1314 14.1314L19.6839 20.6839M14 15L16.8686 12.1314C17.2646 11.7354 17.4627 11.5373 17.691 11.4632C17.8918 11.3979 18.1082 11.3979 18.309 11.4632C18.5373 11.5373 18.7354 11.7354 19.1314 12.1314L22 15M10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9ZM6.8 21H17.2C18.8802 21 19.7202 21 20.362 20.673C20.9265 20.3854 21.3854 19.9265 21.673 19.362C22 18.7202 22 17.8802 22 16.2V7.8C22 6.11984 22 5.27976 21.673 4.63803C21.3854 4.07354 20.9265 3.6146 20.362 3.32698C19.7202 3 18.8802 3 17.2 3H6.8C5.11984 3 4.27976 3 3.63803 3.32698C3.07354 3.6146 2.6146 4.07354 2.32698 4.63803C2 5.27976 2 6.11984 2 7.8V16.2C2 17.8802 2 18.7202 2.32698 19.362C2.6146 19.9265 3.07354 20.3854 3.63803 20.673C4.27976 21 5.11984 21 6.8 21Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function hi(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=s.default.useRef(null);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.image,onClick:()=>{vt(n.current)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.image,type:`button`,children:(0,u.jsx)(mi,{})}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:async n=>{let r=n.target.files?.[0];if(n.target.value=``,!r){e.focus();return}if(!r.type.startsWith(`image/`)){window.alert(t.alerts.onlyImages),e.focus();return}if(r.size>5242880){window.alert(t.alerts.imageSizeLimit),e.focus();return}let i=await yt(r);e.dispatchCommand(ze,{altText:r.name,src:i}),e.focus()},ref:n,type:`file`})]})}function gi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21.1525 10.8999L12.1369 19.9156C10.0866 21.9658 6.7625 21.9658 4.71225 19.9156C2.662 17.8653 2.662 14.5412 4.71225 12.4909L13.7279 3.47532C15.0947 2.10849 17.3108 2.10849 18.6776 3.47532C20.0444 4.84216 20.0444 7.05823 18.6776 8.42507L10.0156 17.0871C9.33213 17.7705 8.22409 17.7705 7.54068 17.0871C6.85726 16.4037 6.85726 15.2957 7.54068 14.6123L15.1421 7.01086`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var _i=`noreferrer`;function vi({enableShortcutListener:e=!0,showButton:n=!0}){let[r]=(0,h.useLexicalComposerContext)(),i=H(),[a,o]=s.default.useState(!1),[c,l]=s.default.useState(``),[f,p]=s.default.useState(``),[m,g]=s.default.useState(``),[_,v]=s.default.useState(!0),y=s.default.useCallback(()=>{o(!1),r.focus()},[r]),b=s.default.useCallback(()=>{let e=``;r.getEditorState().read(()=>{let n=(0,t.$getSelection)();(0,t.$isRangeSelection)(n)&&(e=n.getTextContent())}),l(e),p(``),g(``),v(!0),o(!0)},[r]);return s.default.useEffect(()=>{if(!e)return;let t=()=>b();return window.addEventListener(He,t),()=>{window.removeEventListener(He,t)}},[e,b]),(0,u.jsxs)(u.Fragment,{children:[n?(0,u.jsx)(`button`,{"aria-label":i.toolbar.insert.link,onClick:b,onMouseDown:e=>{e.preventDefault()},title:N(`MOD+K`,i.toolbar.shortcuts.link),type:`button`,children:(0,u.jsx)(gi,{})}):null,(0,u.jsx)(Qr,{okText:i.common.insert,onCancel:y,onOk:()=>{let e=m.trim();if(!e){r.focus();return}let n={rel:_i,target:_?`_blank`:null,title:f.trim()||null,url:(0,d.formatUrl)(e)};r.focus(()=>{r.update(()=>{let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e))return;let r=c.trim();if(e.isCollapsed()){let i=(0,d.$createLinkNode)(n.url,{rel:n.rel,target:n.target,title:n.title});i.append((0,t.$createTextNode)(r||n.url)),e.insertNodes([i]),i.selectEnd();return}r&&r!==e.getTextContent()&&e.insertText(r),(0,d.$toggleLink)(n)})}),o(!1)},open:a,title:i.toolbar.insert.link,children:(0,u.jsxs)(`div`,{className:`rj-editor-link-form`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-url`,children:i.toolbar.link.url}),(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-link-url`,onChange:e=>g(e.target.value),placeholder:i.toolbar.link.urlPlaceholder,type:`text`,value:m})]}),(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-text`,children:i.toolbar.link.text}),(0,u.jsx)(`input`,{id:`rj-editor-link-text`,onChange:e=>l(e.target.value),placeholder:i.toolbar.link.textPlaceholder,type:`text`,value:c})]}),(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-title`,children:i.toolbar.link.title}),(0,u.jsx)(`input`,{id:`rj-editor-link-title`,onChange:e=>p(e.target.value),placeholder:i.toolbar.link.titlePlaceholder,type:`text`,value:f})]}),(0,u.jsxs)(`label`,{className:`rj-editor-link-checkbox`,children:[(0,u.jsx)(`input`,{checked:_,onChange:e=>v(e.target.checked),type:`checkbox`}),i.toolbar.link.openInNewTab]})]})})]})}function yi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 12H21M12 3V21M7.8 3H16.2C17.8802 3 18.7202 3 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C21 5.27976 21 6.11984 21 7.8V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V7.8C3 6.11984 3 5.27976 3.32698 4.63803C3.6146 4.07354 4.07354 3.6146 4.63803 3.32698C5.27976 3 6.11984 3 7.8 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var bi=1,xi=20,Si=8,Ci=10;function wi({onTableInserted:e}){let[t]=(0,h.useLexicalComposerContext)(),n=H(),r=s.default.useId(),i=s.default.useId(),[a,c]=s.default.useState(!1),[l,d]=s.default.useState(3),[f,m]=s.default.useState(3),[g,_]=s.default.useState(3),[v,y]=s.default.useState(3),[b,x]=s.default.useState(!0),S=(n=l,r=f)=>{t.dispatchCommand(p.INSERT_TABLE_COMMAND,{columns:String(r),includeHeaders:b?{columns:!1,rows:!0}:!1,rows:String(n)}),c(!1),e?.(),t.focus()};return(0,u.jsx)(o.Dropdown,{dropdownRender:()=>(0,u.jsxs)(`div`,{className:`rj-editor-table-menu`,children:[(0,u.jsx)(`div`,{className:`rj-editor-table-menu-title`,children:n.toolbar.table.insertTableSize.replace(`{columns}`,String(v)).replace(`{rows}`,String(g))}),(0,u.jsx)(`div`,{className:`rj-editor-table-grid`,onMouseLeave:()=>{_(l),y(f)},children:Array.from({length:Si}).map((e,t)=>(0,u.jsx)(s.default.Fragment,{children:Array.from({length:Ci}).map((e,r)=>{let i=t+1,a=r+1,o=i<=g&&a<=v;return(0,u.jsx)(`button`,{"aria-label":n.toolbar.table.insertTableSize.replace(`{columns}`,String(a)).replace(`{rows}`,String(i)),className:o?`is-selected`:void 0,onClick:()=>S(i,a),onMouseEnter:()=>{_(i),y(a)},type:`button`},`${t}-${r}`)})},t))}),(0,u.jsx)(`div`,{className:`rj-editor-table-menu-divider`}),(0,u.jsxs)(`div`,{className:`rj-editor-table-menu-row`,children:[(0,u.jsx)(`label`,{htmlFor:r,children:n.toolbar.table.rows}),(0,u.jsx)(Zr,{id:r,integerOnly:!0,max:xi,min:bi,onChange:d,value:l})]}),(0,u.jsxs)(`div`,{className:`rj-editor-table-menu-row`,children:[(0,u.jsx)(`label`,{htmlFor:i,children:n.toolbar.table.columns}),(0,u.jsx)(Zr,{id:i,integerOnly:!0,max:xi,min:bi,onChange:m,value:f})]}),(0,u.jsx)(o.Checkbox,{checked:b,onChange:e=>{x(e.target.checked)},children:n.toolbar.table.headerRow}),(0,u.jsx)(o.Button,{block:!0,onClick:()=>S(),size:`small`,type:`primary`,children:n.toolbar.table.insertTable})]}),onOpenChange:e=>{c(e),_(l),y(f)},open:a,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":n.toolbar.table.insertTable,className:a?`is-active`:void 0,onMouseDown:e=>{e.preventDefault()},title:n.toolbar.insert.table,type:`button`,children:(0,u.jsx)(yi,{})})})}function Ti(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M21.5813 7.19989C21.4733 6.76846 21.2534 6.37318 20.9438 6.05395C20.6341 5.73473 20.2457 5.50287 19.8178 5.3818C18.2542 5 12 5 12 5C12 5 5.74578 5 4.18222 5.41816C3.75429 5.53923 3.36588 5.77109 3.05623 6.09031C2.74659 6.40954 2.52666 6.80482 2.41868 7.23625C2.13253 8.82303 1.99255 10.4327 2.00052 12.0451C1.99032 13.6696 2.1303 15.2916 2.41868 16.8903C2.53773 17.3083 2.76258 17.6886 3.0715 17.9943C3.38043 18.3 3.76299 18.5209 4.18222 18.6357C5.74578 19.0538 12 19.0538 12 19.0538C12 19.0538 18.2542 19.0538 19.8178 18.6357C20.2457 18.5146 20.6341 18.2827 20.9438 17.9635C21.2534 17.6443 21.4733 17.249 21.5813 16.8176C21.8653 15.2427 22.0052 13.6453 21.9995 12.0451C22.0097 10.4206 21.8697 8.79862 21.5813 7.19989Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M9.75 9.46533C9.75 8.98805 9.75 8.74941 9.84974 8.61618C9.93666 8.50008 10.0697 8.42744 10.2144 8.4171C10.3804 8.40525 10.5811 8.53429 10.9826 8.79239L14.9254 11.3271C15.2738 11.551 15.448 11.663 15.5082 11.8054C15.5607 11.9298 15.5607 12.0702 15.5082 12.1946C15.448 12.337 15.2738 12.449 14.9254 12.6729L10.9826 15.2076C10.5811 15.4657 10.3804 15.5948 10.2144 15.5829C10.0697 15.5726 9.93666 15.4999 9.84974 15.3838C9.75 15.2506 9.75 15.012 9.75 14.5347V9.46533Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Ei(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),[n,r]=s.default.useState(!1),[i,a]=s.default.useState(``),[o,c]=s.default.useState(``),[l,d]=s.default.useState(``);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.youtube,onClick:()=>{a(``),c(``),d(``),r(!0)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.youtube,type:`button`,children:(0,u.jsx)(Ti,{"aria-hidden":`true`})}),(0,u.jsx)(Qr,{okText:t.common.insert,onCancel:()=>{r(!1),d(``),e.focus()},onOk:()=>{let n=Te(o);if(!n){d(t.toolbar.youtube.invalidUrl);return}e.dispatchCommand(Be,{title:i.trim(),videoId:n}),r(!1),d(``),e.focus()},open:n,title:t.toolbar.insert.youtube,children:(0,u.jsxs)(`div`,{className:`rj-editor-youtube-form`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-youtube-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-youtube-url`,children:t.toolbar.youtube.url}),(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-youtube-url`,onChange:e=>{c(e.target.value),d(``)},placeholder:t.toolbar.youtube.urlPlaceholder,type:`text`,value:o})]}),(0,u.jsxs)(`div`,{className:`rj-editor-youtube-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-youtube-title`,children:t.toolbar.youtube.title}),(0,u.jsx)(`input`,{id:`rj-editor-youtube-title`,onChange:e=>a(e.target.value),placeholder:t.toolbar.youtube.titlePlaceholder,type:`text`,value:i})]}),l?(0,u.jsx)(`p`,{className:`rj-editor-youtube-error`,children:l}):null]})})]})}function Di({onTableInserted:e}){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(wi,{onTableInserted:e}),(0,u.jsx)(vi,{enableShortcutListener:!1}),(0,u.jsx)(di,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(hi,{}),(0,u.jsx)(Ei,{}),(0,u.jsx)(pi,{})]})]})}function Oi(){return(0,u.jsx)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`})}function ki(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M15.9997 11L1.9997 11M9.9997 4L7.9997 2M13.9997 22L1.9997 22M21.9997 16C21.9997 17.1046 21.1043 18 19.9997 18C18.8951 18 17.9997 17.1046 17.9997 16C17.9997 14.8954 19.9997 13 19.9997 13C19.9997 13 21.9997 14.8954 21.9997 16ZM8.9997 3L15.8683 9.86863C16.2643 10.2646 16.4624 10.4627 16.5365 10.691C16.6018 10.8918 16.6018 11.1082 16.5365 11.309C16.4624 11.5373 16.2643 11.7354 15.8683 12.1314L11.2624 16.7373C10.4704 17.5293 10.0744 17.9253 9.61773 18.0737C9.21605 18.2042 8.78335 18.2042 8.38166 18.0737C7.92501 17.9253 7.52899 17.5293 6.73696 16.7373L3.26244 13.2627C2.4704 12.4707 2.07439 12.0747 1.92601 11.618C1.7955 11.2163 1.7955 10.7837 1.92601 10.382C2.07439 9.92531 2.47041 9.52929 3.26244 8.73726L8.9997 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ai(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 14H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 18H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function ji(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 14H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Mi(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 6H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Ni(){let e=(0,t.$getSelection)();return(0,t.$isRangeSelection)(e)?e.anchor.getNode():(0,p.$isTableSelection)(e)?(0,t.$getNodeByKey)(e.anchor.key):null}function Pi(){let e=(0,t.$getSelection)();if((0,p.$isTableSelection)(e)){let t=e.getNodes().filter(p.$isTableCellNode);return Array.from(new Map(t.map(e=>[e.getKey(),e])).values())}let n=Ni(),r=n?(0,D.$getNearestNodeOfType)(n,p.TableCellNode):null;return r?[r]:[]}function Fi(){let e=(0,t.$getSelection)();if((0,p.$isTableSelection)(e)){let n=(0,t.$getNodeByKey)(e.tableKey);return(0,p.$isTableNode)(n)?n:null}let n=Ni();return n?(0,D.$getNearestNodeOfType)(n,p.TableNode):null}function Ii(){let e=Pi(),t=e[0];return{isInTable:e.length>0,selectedTableCellsCount:e.length,tableCellBackgroundColor:t?.getBackgroundColor()||``,tableCellVerticalAlign:t?.getVerticalAlign(),tableHasMergedCell:e.some(e=>e.getColSpan()>1||e.getRowSpan()>1)}}function $(e,t){e.update(t),e.focus()}function Li(e,t){$(e,()=>{(0,p.$insertTableRowAtSelection)(t)})}function Ri(e,t){$(e,()=>{(0,p.$insertTableColumnAtSelection)(t)})}function zi(e){$(e,()=>{(0,p.$deleteTableRowAtSelection)()})}function Bi(e){$(e,()=>{(0,p.$deleteTableColumnAtSelection)()})}function Vi(e){$(e,()=>{let e=Fi();if(!e)return;let n=(0,t.$createParagraphNode)();e.insertAfter(n),e.remove(),n.select(),(0,t.$getRoot)().getChildrenSize()===0&&(0,t.$getRoot)().append((0,t.$createParagraphNode)())})}function Hi(e){$(e,()=>{let e=Pi();e.length>1&&(0,p.$mergeCells)(e)})}function Ui(e){$(e,()=>{(0,p.$unmergeCell)()})}function Wi(e,t){$(e,()=>{Pi().forEach(e=>{e.setBackgroundColor(t)})})}function Gi(e,t){$(e,()=>{Pi().forEach(e=>{e.setVerticalAlign(t)})})}function Ki(e){$(e,()=>{let e=Pi()[0];if(!e)return;let[,t]=(0,p.$getNodeTriplet)(e);t.getChildren().forEach(e=>{(0,p.$isTableCellNode)(e)&&e.toggleHeaderStyle(p.TableCellHeaderStates.ROW)})})}function qi(e){$(e,()=>{let e=Pi()[0],t=Fi(),n=e?(0,p.$getTableCellNodeRect)(e):null;if(!e||!t||!n)return;let[r]=(0,p.$computeTableMapSkipCellCheck)(t,null,null),i=new Set;r.forEach(e=>{e.forEach(({cell:e,startColumn:t})=>{t<=n.columnIndex&&t+e.getColSpan()>n.columnIndex&&!i.has(e.getKey())&&(i.add(e.getKey()),e.toggleHeaderStyle(p.TableCellHeaderStates.COLUMN))})})})}function Ji(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),[n,r]=(0,s.useState)(!1),[i,a]=(0,s.useState)(null),{isInTable:c,tableCellBackgroundColor:l,tableCellVerticalAlign:d}=V(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.Dropdown,{disabled:!c,menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{Wi(e,null),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},{type:`divider`},...F.map(t=>({key:t,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{Wi(e,t),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:t}}),t]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:l||F[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:t=>{Wi(e,t.target.value),a(t.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:l||F[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{Wi(e,i)}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.background,className:l?`is-active`:void 0,disabled:!c,onMouseDown:e=>{e.preventDefault()},type:`button`,children:(0,u.jsx)(ki,{"aria-hidden":`true`})})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignTop,className:d===`top`?`is-active`:void 0,disabled:!c,onClick:()=>Gi(e,`top`),type:`button`,children:(0,u.jsx)(Mi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignMiddle,className:d===`middle`?`is-active`:void 0,disabled:!c,onClick:()=>Gi(e,`middle`),type:`button`,children:(0,u.jsx)(ji,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignBottom,className:d===`bottom`?`is-active`:void 0,disabled:!c,onClick:()=>Gi(e,`bottom`),type:`button`,children:(0,u.jsx)(Ai,{"aria-hidden":`true`})})]})}function Yi(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=!V(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnLeft,disabled:n,onClick:()=>Ri(e,!1),type:`button`,children:t.toolbar.table.columnLeft}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnRight,disabled:n,onClick:()=>Ri(e,!0),type:`button`,children:t.toolbar.table.columnRight})]})}function Xi(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=!V(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.deleteRow,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>zi(e),type:`button`,children:[(0,u.jsx)(An,{"aria-hidden":`true`}),`\xA0`,t.toolbar.table.row]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.deleteColumn,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>Bi(e),type:`button`,children:[(0,u.jsx)(An,{"aria-hidden":`true`}),`\xA0`,t.toolbar.table.column]}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.deleteTable,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>Vi(e),type:`button`,children:(0,u.jsx)(An,{"aria-hidden":`true`})})]})}function Zi(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function Qi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M9 7L4 12L9 17M15 7L20 12L15 17`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function $i(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M7 15L12 20L17 15M7 9L12 4L17 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ea(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),{isInTable:n}=V(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.headerRow,disabled:!n,onClick:()=>Ki(e),type:`button`,title:t.toolbar.table.headerRow,children:[(0,u.jsx)(Qi,{}),` \xA0 `,t.toolbar.table.header]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.header,disabled:!n,onClick:()=>qi(e),type:`button`,title:t.toolbar.table.headerColumn,children:[(0,u.jsx)($i,{}),` \xA0 `,t.toolbar.table.header]})]})}function ta(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),{isInTable:n,selectedTableCellsCount:r,tableHasMergedCell:i}=V(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.mergeCells,disabled:!n||r<2,onClick:()=>Hi(e),type:`button`,children:t.toolbar.table.mergeCells}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.unmergeCell,disabled:!n||!i,onClick:()=>Ui(e),type:`button`,children:t.toolbar.table.unmergeCell})]})}function na(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=!V(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowAbove,disabled:n,onClick:()=>Li(e,!1),type:`button`,children:t.toolbar.table.rowAbove}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowBelow,disabled:n,onClick:()=>Li(e,!0),type:`button`,children:t.toolbar.table.rowBelow})]})}function ra(){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(na,{}),(0,u.jsx)(Zi,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Yi,{}),(0,u.jsx)(Zi,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(ta,{}),(0,u.jsx)(Zi,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Ji,{}),(0,u.jsx)(Zi,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(ea,{}),(0,u.jsx)(Zi,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(Xi,{})})]})}function ia(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(vn);return vn(n)?n:null}function aa(){let e=ia();return{isEquationSelected:!!e,selectedEquation:e?.getEquation(),selectedEquationDisplayMode:e?.getDisplayMode(),selectedEquationKey:e?.getKey()}}function oa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M8 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M8 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V16M21 8V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H16M21 16V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H16`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function sa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M2.99986 8H3.19986C4.88002 8 5.7201 8 6.36183 7.67302C6.92632 7.3854 7.38526 6.92646 7.67288 6.36197C7.99986 5.72024 7.99986 4.88016 7.99986 3.2V3M2.99986 16H3.19986C4.88002 16 5.7201 16 6.36183 16.327C6.92632 16.6146 7.38526 17.0735 7.67288 17.638C7.99986 18.2798 7.99986 19.1198 7.99986 20.8V21M15.9999 3V3.2C15.9999 4.88016 15.9999 5.72024 16.3268 6.36197C16.6145 6.92646 17.0734 7.3854 17.6379 7.67302C18.2796 8 19.1197 8 20.7999 8H20.9999M15.9999 21V20.8C15.9999 19.1198 15.9999 18.2798 16.3268 17.638C16.6145 17.0735 17.0734 16.6146 17.6379 16.327C18.2796 16 19.1197 16 20.7999 16H20.9999`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var ca=[{value:`home`},{value:`insert`},{value:`equation`},{value:`image`},{value:`table`}];function la({isFullscreen:e,onToggleFullscreen:n}){let[r]=(0,h.useLexicalComposerContext)(),i=H(),[a,o]=s.default.useState(`home`),c=B(),l=V(e=>e.toolbar.isEquationSelected),d=V(e=>e.toolbar.isImageSelected),p=V(e=>e.toolbar.isInTable),m=l?`equation`:d?`image`:a===`table`&&!p||a===`image`&&!d||a===`equation`&&!l?`home`:a,g=ca.filter(e=>(e.value!==`table`||p)&&(e.value!==`equation`||l)&&(e.value!==`image`||d));return s.default.useEffect(()=>{let e=()=>{let e=(0,t.$getSelection)(),n=aa(),r=ti(),i=Ii();if(c(Pt(n)),c(Ft(r)),c(It(i)),!(0,t.$isRangeSelection)(e))return;let a=e.anchor.getNode(),o=a.getTopLevelElementOrThrow(),s=(0,D.$getNearestNodeOfType)(a,f.ListNode);c(Lt({isBold:e.hasFormat(`bold`),isCode:e.hasFormat(`code`),isItalic:e.hasFormat(`italic`),isStrikethrough:e.hasFormat(`strikethrough`),isSubscript:e.hasFormat(`subscript`),isSuperscript:e.hasFormat(`superscript`),isUnderline:e.hasFormat(`underline`)})),c(z({backgroundColor:(0,E.$getSelectionStyleValueForProperty)(e,`background-color`,``),fontFamily:Ge((0,E.$getSelectionStyleValueForProperty)(e,`font-family`,``)),fontSize:qe((0,E.$getSelectionStyleValueForProperty)(e,`font-size`,``)),lineHeight:(0,E.$getSelectionStyleValueForProperty)(e,`line-height`,``)||void 0,textColor:(0,E.$getSelectionStyleValueForProperty)(e,`color`,``)})),c(jt({alignment:o.getFormatType(),listType:(0,f.$isListNode)(s)?s.getListType():void 0}))},n=r.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(r.getEditorState().read(e),!1),t.COMMAND_PRIORITY_LOW),i=r.registerUpdateListener(({editorState:t})=>{t.read(e)}),a=r.registerCommand(t.CAN_UNDO_COMMAND,e=>(c(Nt(e)),!1),t.COMMAND_PRIORITY_LOW),o=r.registerCommand(t.CAN_REDO_COMMAND,e=>(c(Mt(e)),!1),t.COMMAND_PRIORITY_LOW);return()=>{n(),i(),a(),o()}},[c,r]),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar`,"aria-label":`Editor toolbar`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-tabs`,children:[(0,u.jsx)(`div`,{className:`rj-editor-toolbar-tabs-list`,role:`tablist`,children:g.map(e=>(0,u.jsx)(`button`,{"aria-selected":m===e.value,className:m===e.value?`is-active`:void 0,onClick:()=>{o(e.value),window.requestAnimationFrame(()=>{r.focus()})},onMouseDown:e=>{e.preventDefault()},role:`tab`,type:`button`,children:i.toolbar.tabs[e.value]},e.value))}),(0,u.jsx)(`button`,{"aria-label":e?i.toolbar.fullscreen.close:i.toolbar.fullscreen.open,className:`rj-editor-toolbar-fullscreen`,onClick:n,type:`button`,children:e?(0,u.jsx)(sa,{"aria-hidden":`true`}):(0,u.jsx)(oa,{"aria-hidden":`true`})})]}),m===`home`?(0,u.jsx)(Jr,{editor:r}):null,m===`image`?(0,u.jsx)(ui,{}):null,m===`insert`?(0,u.jsx)(Di,{onTableInserted:()=>o(`table`)}):null,m===`table`?(0,u.jsx)(ra,{}):null,m===`layout`?(0,u.jsx)(Oi,{}):null,(0,u.jsx)(vi,{showButton:!1})]})}function ua(){let[e]=(0,h.useLexicalComposerContext)();return(0,s.useEffect)(()=>e.registerCommand(Re,e=>{let n=_n(e);(0,D.$insertNodeToNearestRoot)(n),e.displayMode!==`inline`&&n.insertAfter((0,t.$createParagraphNode)());let r=(0,t.$createNodeSelection)();return r.add(n.getKey()),(0,t.$setSelection)(r),!0},t.COMMAND_PRIORITY_EDITOR),[e]),null}function da(){let[e]=(0,h.useLexicalComposerContext)();return s.default.useEffect(()=>{let n=(0,m.registerCodeHighlighting)(e),r=e.registerCommand(Le,({code:e=``,language:n})=>{let r=(0,m.$createCodeNode)(n);return e&&r.append((0,t.$createTextNode)(e)),(0,D.$insertNodeToNearestRoot)(r),r.insertAfter((0,t.$createParagraphNode)()),r.selectEnd(),!0},t.COMMAND_PRIORITY_EDITOR),i=e.registerUpdateListener(({editorState:n})=>{let r=!1;n.read(()=>{r=(0,m.$isCodeNode)((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();(0,m.$isCodeNode)(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{i(),n(),r()}},[e]),null}function fa(e,t){let n=new Map;return Array.from(e||[]).forEach(e=>{e.type.startsWith(`image/`)&&n.set(`${e.name}-${e.size}-${e.lastModified}`,e)}),Array.from(t||[]).forEach(e=>{if(e.kind!==`file`||!e.type.startsWith(`image/`))return;let t=e.getAsFile();t&&n.set(`${t.name}-${t.size}-${t.lastModified}`,t)}),Array.from(n.values())}async function pa(e,t){if(e.size>5242880)return window.alert(t),null;let n=await yt(e);return{altText:e.name,src:n}}function ma(){let[e]=(0,h.useLexicalComposerContext)(),n=H();return(0,s.useEffect)(()=>{let r=async t=>{for(let r of t){let t=await pa(r,n.alerts.imageSizeLimit);t&&e.dispatchCommand(ze,t)}},i=e.registerCommand(ze,e=>{let n=$n(e);return(0,D.$insertNodeToNearestRoot)(n),n.insertAfter((0,t.$createParagraphNode)()),!0},t.COMMAND_PRIORITY_EDITOR),a=e.registerCommand(t.PASTE_COMMAND,e=>{if(!(e instanceof ClipboardEvent))return!1;let t=fa(e.clipboardData?.files,e.clipboardData?.items);return t.length===0?!1:(e.preventDefault(),r(t),!0)},t.COMMAND_PRIORITY_LOW),o=e.registerCommand(t.DRAGOVER_COMMAND,e=>fa(e.dataTransfer?.files,e.dataTransfer?.items).length===0?!1:(e.preventDefault(),!0),t.COMMAND_PRIORITY_LOW),s=e.registerCommand(t.DROP_COMMAND,e=>{let t=fa(e.dataTransfer?.files,e.dataTransfer?.items);return t.length===0?!1:(e.preventDefault(),r(t),!0)},t.COMMAND_PRIORITY_LOW);return()=>{i(),a(),o(),s()}},[e,n.alerts.imageSizeLimit]),null}function ha(e){return e.metaKey||e.ctrlKey}function ga(e){return e instanceof HTMLElement?[`INPUT`,`SELECT`,`TEXTAREA`].includes(e.tagName):!1}function _a(){let[e]=(0,h.useLexicalComposerContext)(),n=B();return(0,s.useEffect)(()=>{let r=()=>{kr(e),n(Lt({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(z({backgroundColor:I.backgroundColor,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight,textColor:I.textColor})),n(jt({alignment:I.alignment,listType:I.listType}))};return e.registerCommand(t.KEY_DOWN_COMMAND,n=>{if(!ha(n)||n.altKey||ga(n.target))return!1;let i=n.key.toLowerCase(),a=n.shiftKey;return i===`b`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`bold`),!0):i===`i`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`italic`),!0):i===`u`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`underline`),!0):i===`x`&&a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`strikethrough`),!0):n.key===`=`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`subscript`),!0):(n.key===`=`||n.key===`+`)&&a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`superscript`),!0):i===`z`&&!a?(n.preventDefault(),e.dispatchCommand(t.UNDO_COMMAND,void 0),!0):i===`z`&&a||i===`y`?(n.preventDefault(),e.dispatchCommand(t.REDO_COMMAND,void 0),!0):i===`k`&&!a?(n.preventDefault(),window.dispatchEvent(new CustomEvent(He)),!0):n.key===`7`&&a?(n.preventDefault(),e.dispatchCommand(f.INSERT_ORDERED_LIST_COMMAND,void 0),!0):n.key===`8`&&a?(n.preventDefault(),e.dispatchCommand(f.INSERT_UNORDERED_LIST_COMMAND,void 0),!0):n.key===`[`&&!a?(n.preventDefault(),e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),!0):n.key===`]`&&!a?(n.preventDefault(),e.dispatchCommand(t.INDENT_CONTENT_COMMAND,void 0),!0):n.key===`\\`&&!a?(n.preventDefault(),r(),!0):a?i===`l`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`left`),!0):i===`c`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`center`),!0):i===`r`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`right`),!0):i===`j`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`justify`),!0):!1:!1},t.COMMAND_PRIORITY_CRITICAL)},[n,e]),null}function va(e){return(0,p.$isTableNode)(e)||K(e)||ar(e)}function ya(){let[e]=(0,h.useLexicalComposerContext)();return(0,s.useEffect)(()=>e.registerUpdateListener(({editorState:n})=>{let r=!1,i=null;n.read(()=>{let e=(0,t.$getRoot)().getChildren();r=va(e.at(-1));for(let t=0;t<e.length-1;t+=1)if(va(e[t])&&va(e[t+1])){i=e[t].getKey();break}}),!(!r&&!i)&&e.update(()=>{if(i){let e=(0,t.$getRoot)().getChildren().find(e=>e.getKey()===i);if(va(e)){e.insertAfter((0,t.$createParagraphNode)());return}}let e=(0,t.$getRoot)().getLastChild();va(e)&&e.insertAfter((0,t.$createParagraphNode)())})}),[e]),null}function ba(){let[e]=(0,h.useLexicalComposerContext)();return(0,s.useEffect)(()=>{let n=e.registerCommand(Be,e=>{let n=ir(e),r=(0,t.$createParagraphNode)();return(0,D.$insertNodeToNearestRoot)(n),n.insertAfter(r),r.select(),!0},t.COMMAND_PRIORITY_EDITOR),r=e.registerUpdateListener(({editorState:n})=>{let r=!1;n.read(()=>{r=ar((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();ar(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{n(),r()}},[e]),null}function xa(e,t,n){n&&e.read(()=>{n(ft((0,i.$generateHtmlFromNodes)(t),t),JSON.stringify(e.toJSON()),e)})}function Sa({lastHtmlRef:e,value:t}){let[n]=(0,h.useLexicalComposerContext)();return s.default.useEffect(()=>{t===void 0||t===e.current||n.update(()=>{kt(n,t),e.current=t})},[n,e,t]),null}function Ca({autofocus:e,className:t,editorRef:n,id:r,isFullscreen:a,onBlur:o,onChange:c,onFocus:l,onToggleFullscreen:d,placeholder:f,theme:p,value:m}){let h=H(),g=s.default.useRef(m);return(0,u.jsxs)(`div`,{className:[`rj-editor`,a?`rj-editor--fullscreen`:``,t].filter(Boolean).join(` `),"data-rj-editor-theme":p,id:r,onBlur:o,onFocus:l,ref:n,children:[(0,u.jsx)(la,{isFullscreen:a,onToggleFullscreen:d}),(0,u.jsxs)(`div`,{className:`rj-editor-body`,children:[(0,u.jsx)(w.RichTextPlugin,{contentEditable:(0,u.jsx)(v.ContentEditable,{className:`rj-editor-input`}),ErrorBoundary:y.LexicalErrorBoundary,placeholder:(0,u.jsx)(`div`,{className:`rj-editor-placeholder`,children:f===void 0?h.placeholders.editor:f})}),(0,u.jsx)(b.HistoryPlugin,{}),(0,u.jsx)(da,{}),(0,u.jsx)(ua,{}),(0,u.jsx)(ma,{}),(0,u.jsx)(_a,{}),(0,u.jsx)(ba,{}),(0,u.jsx)(x.LinkPlugin,{}),(0,u.jsx)(S.ListPlugin,{}),(0,u.jsx)(T.TablePlugin,{}),(0,u.jsx)(ya,{}),(0,u.jsx)(hr,{}),(0,u.jsx)(Sa,{lastHtmlRef:g,value:m}),(0,u.jsx)(C.OnChangePlugin,{onChange:(e,t)=>{e.read(()=>{g.current=ft((0,i.$generateHtmlFromNodes)(t),t)}),xa(e,t,c)}}),e?(0,u.jsx)(_.AutoFocusPlugin,{}):null]})]})}function wa({autofocus:e=!1,className:t,defaultValue:n,id:r,locale:i=`en`,locales:l,namespace:d=`RJEditor`,onBlur:f,onChange:p,onFocus:m,placeholder:h,translations:g,theme:_=`auto`,value:v}){let y=s.default.useMemo(()=>zt(),[]),b=s.default.useRef(null),[x,S]=s.default.useState(!1),C=en(_),w=s.default.useMemo(()=>Xt(C),[C]),T=sr({defaultValue:n,namespace:d,value:v});s.default.useEffect(()=>{let e=()=>{S(document.fullscreenElement===b.current)};return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e)}},[]);let E=async()=>{if(document.fullscreenElement===b.current){await document.exitFullscreen();return}await b.current?.requestFullscreen()},D=s.default.useCallback(e=>document.fullscreenElement||b.current||e?.parentElement||document.body,[]);return(0,u.jsx)(c.Provider,{store:y,children:(0,u.jsx)(qt,{locale:i,locales:l,translations:g,children:(0,u.jsx)(Zt.Provider,{value:C,children:(0,u.jsx)(o.ConfigProvider,{getPopupContainer:D,theme:w,children:(0,u.jsx)(a.LexicalComposer,{initialConfig:T,children:(0,u.jsx)(Ca,{autofocus:e,className:t,editorRef:b,id:r,isFullscreen:x,onBlur:f,onChange:p,onFocus:m,onToggleFullscreen:E,placeholder:h,theme:C,value:v})})})})})})}xt(),e.RJEditorI18nProvider=qt,e.RJTextEditor=wa,e.enTranslations=Bt,e.mergeTranslations=Ht,e.ruTranslations=Ut,e.useRJEditorI18n=H,e.uzTranslations=Wt});
|
|
11
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`lexical`),require(`katex`),require(`katex/contrib/mhchem`),require(`@lexical/html`),require(`@lexical/react/LexicalComposer`),require(`antd`),require(`react`),require(`react-redux`),require(`@reduxjs/toolkit`),require(`react/jsx-runtime`),require(`@lexical/link`),require(`@lexical/list`),require(`@lexical/table`),require(`@lexical/utils`),require(`@lexical/react/LexicalComposerContext`),require(`@lexical/react/useLexicalNodeSelection`),require(`@lexical/react/LexicalAutoFocusPlugin`),require(`@lexical/react/LexicalContentEditable`),require(`@lexical/react/LexicalErrorBoundary`),require(`@lexical/react/LexicalHistoryPlugin`),require(`@lexical/react/LexicalLinkPlugin`),require(`@lexical/react/LexicalListPlugin`),require(`@lexical/react/LexicalOnChangePlugin`),require(`@lexical/react/LexicalRichTextPlugin`),require(`@lexical/react/LexicalTablePlugin`),require(`@lexical/selection`),require(`react-dom`)):typeof define==`function`&&define.amd?define(`exports.lexical.katex.katex/contrib/mhchem.@lexical/html.@lexical/react/LexicalComposer.antd.react.react-redux.@reduxjs/toolkit.react/jsx-runtime.@lexical/link.@lexical/list.@lexical/table.@lexical/utils.@lexical/react/LexicalComposerContext.@lexical/react/useLexicalNodeSelection.@lexical/react/LexicalAutoFocusPlugin.@lexical/react/LexicalContentEditable.@lexical/react/LexicalErrorBoundary.@lexical/react/LexicalHistoryPlugin.@lexical/react/LexicalLinkPlugin.@lexical/react/LexicalListPlugin.@lexical/react/LexicalOnChangePlugin.@lexical/react/LexicalRichTextPlugin.@lexical/react/LexicalTablePlugin.@lexical/selection.react-dom`.split(`.`),t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.RJEditor={},e.Lexical,e.katex,e.katex,e.Lexical,e.Lexical,e.antd,e.React,e.ReactRedux,e.RTK,e.jsxRuntime,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.Lexical,e.ReactDOM))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var O=Object.create,k=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty,ie=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=te(t),a=0,o=i.length,s;a<o;a++)s=i[a],!re.call(e,s)&&s!==n&&k(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ee(t,s))||r.enumerable});return e},ae=(e,t,n)=>(n=e==null?{}:O(ne(e)),ie(t||!e||!e.__esModule?k(n,`default`,{value:e,enumerable:!0}):n,e));n=ae(n,1);let A=ae(s,1);s=ae(s);function oe(e){return typeof e!=`string`}function j(e,t){let[n,...r]=t.split(`>`);if(r.length>0){let t=j(e,n);return oe(t)?j(t,r.join(`>`)):``}switch(e.kind){case`accent`:case`bracket`:case`text`:return`value`in e&&t===`${e.kind}.value`?e.value:``;case`fraction`:return t===`fraction.denominator`?e.denominator:t===`fraction.numerator`?e.numerator:``;case`function`:return t===`function.argument`?e.argument:``;case`integral`:return t===`integral.body`?e.body:t===`integral.lower`?e.lower||``:t===`integral.upper`?e.upper||``:t===`integral.variable`?e.variable:``;case`largeOperator`:return t===`largeOperator.body`?e.body:t===`largeOperator.lower`?e.lower||``:t===`largeOperator.upper`&&e.upper||``;case`limit`:return t===`limit.body`?e.body:t===`limit.target`?e.target:``;case`matrix`:{let[,,n,r]=t.split(`.`),i=Number(n),a=Number(r);return e.cells[i]?.[a]||``}case`operator`:return t===`operator.value`?e.value:``;case`root`:return t===`root.index`?e.index||``:t===`root.value`?e.value:``;case`row`:{let[,,n]=t.split(`.`),r=Number(n);return e.items[r]||``}case`script`:return t===`script.base`?e.base:t===`script.subscript`?e.subscript||``:t===`script.superscript`&&e.superscript||``;default:return``}}function M(e){let t=e.split(`>`),n=t.at(-1)?.match(/^row\.insert\.(\d+)$/);return n?{insertIndex:Number(n[1]),rowSlotId:t.slice(0,-1).join(`>`)}:null}function se(e){return typeof e!=`string`}function ce(e,t,n){return se(e)?N(e,t,n):e}function N(e,t,n){let[r,...i]=t.split(`>`);if(i.length>0){let t=i.join(`>`);return N(e,r,ce(le(e,r),t,n))}switch(e.kind){case`accent`:return t===`accent.value`?{...e,value:n}:e;case`bracket`:return t===`bracket.value`?{...e,value:n}:e;case`fraction`:return t===`fraction.denominator`?{...e,denominator:n}:t===`fraction.numerator`?{...e,numerator:n}:e;case`function`:return t===`function.argument`?{...e,argument:n}:e;case`integral`:return t===`integral.body`?{...e,body:n}:t===`integral.lower`?{...e,lower:n}:t===`integral.upper`?{...e,upper:n}:t===`integral.variable`?{...e,variable:n}:e;case`largeOperator`:return t===`largeOperator.body`?{...e,body:n}:t===`largeOperator.lower`?{...e,lower:n}:t===`largeOperator.upper`?{...e,upper:n}:e;case`limit`:return t===`limit.body`?{...e,body:n}:t===`limit.target`?{...e,target:n}:e;case`matrix`:{let[,,r,i]=t.split(`.`),a=Number(r),o=Number(i);return Number.isNaN(a)||Number.isNaN(o)||!e.cells[a]?e:{...e,cells:e.cells.map((e,t)=>t===a?e.map((e,t)=>t===o?n:e):e)}}case`operator`:return t===`operator.value`&&typeof n==`string`?{...e,value:n}:e;case`row`:{let[,,r]=t.split(`.`),i=Number(r);return!se(n)||Number.isNaN(i)?e:{...e,items:e.items.map((e,t)=>t===i?n:e)}}case`root`:return t===`root.index`?{...e,index:n}:t===`root.value`?{...e,value:n}:e;case`script`:return t===`script.base`?{...e,base:n}:t===`script.subscript`?{...e,subscript:n}:t===`script.superscript`?{...e,superscript:n}:e;case`text`:return t===`text.value`&&typeof n==`string`?{...e,value:n}:e;default:return e}}function le(e,t){switch(e.kind){case`accent`:case`bracket`:case`text`:return`value`in e&&t===`${e.kind}.value`?e.value:``;case`fraction`:return t===`fraction.denominator`?e.denominator:t===`fraction.numerator`?e.numerator:``;case`function`:return t===`function.argument`?e.argument:``;case`integral`:return t===`integral.body`?e.body:t===`integral.lower`?e.lower||``:t===`integral.upper`?e.upper||``:t===`integral.variable`?e.variable:``;case`largeOperator`:return t===`largeOperator.body`?e.body:t===`largeOperator.lower`?e.lower||``:t===`largeOperator.upper`&&e.upper||``;case`limit`:return t===`limit.body`?e.body:t===`limit.target`?e.target:``;case`matrix`:{let[,,n,r]=t.split(`.`),i=Number(n),a=Number(r);return e.cells[i]?.[a]||``}case`operator`:return t===`operator.value`?e.value:``;case`root`:return t===`root.index`?e.index||``:t===`root.value`?e.value:``;case`row`:{let[,,n]=t.split(`.`),r=Number(n);return e.items[r]||``}case`script`:return t===`script.base`?e.base:t===`script.subscript`?e.subscript||``:t===`script.superscript`&&e.superscript||``;default:return``}}function ue(e){return{kind:`text`,value:e}}function de(e,t,n){if(typeof e==`string`){let r=Math.max(0,Math.min(n?.start??e.length,e.length)),i=Math.max(r,Math.min(n?.end??r,e.length));return`${e.slice(0,r)}${t}${e.slice(i)}`}if(e.kind===`row`){let n=e.items.at(-1);return n?.kind===`text`&&typeof n.value==`string`?{...e,items:[...e.items.slice(0,-1),{...n,value:`${n.value}${t}`}]}:{...e,items:[...e.items,ue(t)]}}return{items:[e,ue(t)],kind:`row`}}function fe(e,t,n,r){let i=M(t);if(i){let t=i.rowSlotId?j(e,i.rowSlotId):e;if(typeof t!=`string`&&t.kind===`row`){let r=Math.max(0,Math.min(i.insertIndex,t.items.length)),a=ue(n),o={...t,items:[...t.items.slice(0,r),a,...t.items.slice(r)]};return{activeSlotId:[i.rowSlotId,`row.items.${r}>text.value`].filter(Boolean).join(`>`),model:i.rowSlotId?N(e,i.rowSlotId,o):o,selection:{end:n.length,start:n.length}}}}let a=j(e,t),o=typeof a==`string`?Math.max(0,Math.min(r?.start??a.length,a.length)):n.length;return{activeSlotId:t,model:N(e,t,de(a,n,r)),selection:{end:o+n.length,start:o+n.length}}}function P(e,t,n){return typeof t==`number`&&e<t?t:typeof n==`number`&&e>n?n:e}async function pe(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}if(typeof document>`u`)return;let t=document.createElement(`textarea`);t.setAttribute(`aria-hidden`,`true`),t.style.position=`fixed`,t.style.opacity=`0`,t.value=e,document.body.append(t),t.select(),document.execCommand(`copy`),t.remove()}function me(e){return Array.from(e.replace(/\n/g,``)).length}function he(e){let t=e.replace(/\u00a0/g,` `).trim();return t?t.split(/\s+/).length:0}var ge=`rj-equation-model:`;function _e(e){return e.startsWith(ge)}function ve(e){if(!_e(e))return null;try{return JSON.parse(decodeURIComponent(e.slice(ge.length)))}catch{return null}}function ye(e){return`${ge}${encodeURIComponent(JSON.stringify(e))}`}var be={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`};function xe(e){return e.replace(/[&"'<>]/g,e=>be[e])}function Se(e,t){if(!t||e===``)return e;let n=e.endsWith(`.`),[r,i]=e.split(`.`),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,` `);return typeof i==`string`?`${a}.${i}`:n?`${a}.`:a}function Ce(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function F(e,t){return`${e.replace(/\bMOD\b/g,Ce()?`CMD`:`CTRL`)} | ${t}`}function I(e){switch(e.kind){case`accent`:case`bracket`:case`text`:return`${e.kind}.value`;case`fraction`:return`fraction.numerator`;case`function`:return`function.argument`;case`integral`:return e.upper===void 0?e.lower===void 0?`integral.body`:`integral.lower`:`integral.upper`;case`largeOperator`:return`largeOperator.upper`;case`limit`:return`limit.target`;case`matrix`:return`matrix.cells.0.0`;case`operator`:return`operator.value`;case`row`:return e.items[0]?`row.items.0>${I(e.items[0])}`:``;case`root`:return e.index===void 0?`root.value`:`root.index`;case`script`:return e.position===`before`?e.superscript===void 0?`script.subscript`:`script.superscript`:`script.base`;default:return``}}var we=/^[a-zA-Z0-9_-]{11}$/;function Te(e){let t=e.trim();if(we.test(t))return t;try{let e=new URL(t),n=e.hostname.replace(/^www\./,``);if(n===`youtu.be`){let t=e.pathname.split(`/`).filter(Boolean)[0];return t&&we.test(t)?t:null}if(n===`youtube.com`||n===`m.youtube.com`||n===`youtube-nocookie.com`){let t=e.searchParams.get(`v`);if(t&&we.test(t))return t;let[,n,r]=e.pathname.split(`/`);if([`embed`,`live`,`shorts`].includes(n)&&r&&we.test(r))return r}}catch{return null}return null}function Ee(e){return{kind:`text`,value:e}}function De(e,t,n){if(typeof e==`string`){let r=Math.max(0,Math.min(n?.start??e.length,e.length)),i=Math.max(r,Math.min(n?.end??r,e.length)),a=e.slice(0,r),o=e.slice(i);return{items:[a?Ee(a):null,t,o?Ee(o):null].filter(Boolean),kind:`row`}}if(e.kind===`row`){let n=e.items.at(-1),r=n?.kind===`text`&&typeof n.value==`string`&&!n.value.trim();return{...e,items:r?[...e.items.slice(0,-1),t]:[...e.items,t]}}return{items:[e,t],kind:`row`}}function Oe(e,t){if(!t)return e.kind===`row`?e:null;let n=j(e,t);return typeof n!=`string`&&n.kind===`row`?n:null}function ke(e){let t=e.split(`>`);return t.at(-1)===`text.value`?t.slice(0,-1).join(`>`):null}function Ae(e,t){return e?`${e}>${t}`:t}function je(e,t,n,r){if(typeof t==`string`&&!t.trim())return Ae(e,`row.items.0>${I(n)}`);if(typeof t==`string`)return Ae(e,`row.items.${r?.start&&r.start>0?1:0}>${I(n)}`);if(typeof t!=`string`&&t.kind===`row`){let r=t.items.at(-1);return Ae(e,`row.items.${r?.kind===`text`&&typeof r.value==`string`&&!r.value.trim()?t.items.length-1:t.items.length}>${I(n)}`)}return Ae(e,`row.items.1>${I(n)}`)}function Me(e,t,n,r){let i=M(t);if(i){let t=Oe(e,i.rowSlotId);if(!t)return{activeSlotId:I(n),model:e};let r=Math.max(0,Math.min(i.insertIndex,t.items.length)),a={...t,items:[...t.items.slice(0,r),n,...t.items.slice(r)]};return{activeSlotId:Ae(i.rowSlotId,`row.items.${r}>${I(n)}`),model:i.rowSlotId?N(e,i.rowSlotId,a):a}}let a=ke(t),o=j(e,t),s=De(o,n,r);return a===null?{activeSlotId:je(t,o,n,r),model:N(e,t,s)}:{activeSlotId:je(a,o,n,r),model:a?N(e,a,s):s}}function Ne(e,t,n){let r=e.replace(/,/g,`.`).replace(/\s/g,``),i=``,a=!1,o=0;for(let e of r){if(/\d/.test(e)){if(a){if(o>=t)continue;o+=1}i+=e;continue}!n&&e===`.`&&!a&&(a=!0,i+=e)}return i}var Pe=[`#FFFFFF`,`#FEF3C7`,`#DBEAFE`,`#DCFCE7`,`#FCE7F3`,`#EDE9FE`,`#E5E7EB`],Fe=`rj-editor-equation-insert`,Ie=[`Arial`,`Georgia`,`Inter`,`Times New Roman`,`Trebuchet MS`,`Verdana`],Le=[`0.5rem`,`0.5625rem`,`0.6875rem`,`0.75rem`,`0.875rem`,`1rem`,`1.125rem`,`1.25rem`,`1.5rem`,`2rem`,`3rem`,`4.5rem`],L={alignment:``,backgroundColor:``,canRedo:!1,canUndo:!1,fontFamily:void 0,fontSize:void 0,isEquationSelected:!1,isBold:!1,isCode:!1,isImageSelected:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1,isInTable:!1,lineHeight:void 0,listType:void 0,selectedImageAlignment:void 0,selectedImageAltText:void 0,selectedImageAspectRatioLocked:void 0,selectedImageBorderEnabled:void 0,selectedImageBorderRadius:void 0,selectedImageCaption:void 0,selectedImageHeight:void 0,selectedImageKey:void 0,selectedImageLinkUrl:void 0,selectedImageObjectFit:void 0,selectedImageRotation:void 0,selectedImageShadowEnabled:void 0,selectedImageTextWrap:void 0,selectedImageWidth:void 0,selectedEquation:void 0,selectedEquationDisplayMode:void 0,selectedEquationKey:void 0,selectedTableCellsCount:0,tableCellBackgroundColor:``,tableCellVerticalAlign:void 0,tableHasMergedCell:!1,textColor:``},Re=(0,t.createCommand)(`INSERT_CODE_BLOCK_COMMAND`),ze=(0,t.createCommand)(`INSERT_EQUATION_COMMAND`),Be=(0,t.createCommand)(`INSERT_IMAGE_COMMAND`),Ve=(0,t.createCommand)(`INSERT_YOUTUBE_COMMAND`),He=[`1`,`1.15`,`1.5`,`2`,`2.5`,`3`],Ue=`rj-editor:open-link-modal`,We=[`#111827`,`#dc2626`,`#2563eb`,`#059669`,`#9333ea`,`#ca8a04`];function Ge(e){return e.trim().replace(/^['"]|['"]$/g,``).toLowerCase()}function Ke(e){if(!e)return;let t=e.split(`,`).map(Ge);return Ie.find(e=>t.includes(Ge(e)))}function qe(e){return e.trim().toLowerCase()}function Je(e){if(!e)return;let t=qe(e);return Le.find(e=>qe(e)===t)}var Ye=16;function R(e){let t=e/Ye;return`${Number(t.toFixed(6))}rem`}var Xe={borderCollapse:`collapse`,tableLayout:`fixed`,width:`100%`},Ze={border:`0.0625rem solid var(--rj-editor-table-border, #cbd5e1)`,minWidth:`5rem`,padding:`0.5rem 0.625rem`},Qe=`rgb(242, 243, 245)`,$e=`var(--rj-editor-table-header-bg, #f1f5f9)`,et=`[data-rj-editor-content="true"]`,tt=`pre.rj-editor-code-block`;function nt(e){let t=`http://www.w3.org/2000/svg`,n=e.createElementNS(t,`svg`),r=e.createElementNS(t,`path`);return n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`fill`,`none`),n.setAttribute(`viewBox`,`0 0 24 24`),r.setAttribute(`d`,`M5 15C4.06812 15 3.60218 15 3.23463 14.8478C2.74458 14.6448 2.35523 14.2554 2.15224 13.7654C2 13.3978 2 12.9319 2 12V5.2C2 4.0799 2 3.51984 2.21799 3.09202C2.40973 2.71569 2.71569 2.40973 3.09202 2.21799C3.51984 2 4.0799 2 5.2 2H12C12.9319 2 13.3978 2 13.7654 2.15224C14.2554 2.35523 14.6448 2.74458 14.8478 3.23463C15 3.60218 15 4.06812 15 5M12.2 22H18.8C19.9201 22 20.4802 22 20.908 21.782C21.2843 21.5903 21.5903 21.2843 21.782 20.908C22 20.4802 22 19.9201 22 18.8V12.2C22 11.0799 22 10.5198 21.782 10.092C21.5903 9.71569 21.2843 9.40973 20.908 9.21799C20.4802 9 19.9201 9 18.8 9H12.2C11.0799 9 10.5198 9 10.092 9.21799C9.71569 9.40973 9.40973 9.71569 9.21799 10.092C9 10.5198 9 11.0799 9 12.2V18.8C9 19.9201 9 20.4802 9.21799 20.908C9.40973 21.2843 9.71569 21.5903 10.092 21.782C10.5198 22 11.0799 22 12.2 22Z`),r.setAttribute(`stroke`,`currentColor`),r.setAttribute(`stroke-linecap`,`round`),r.setAttribute(`stroke-linejoin`,`round`),r.setAttribute(`stroke-width`,`2`),n.append(r),n}function rt(e){e.querySelectorAll(tt).forEach(t=>{if(!(t instanceof HTMLElement)||t.closest(`[data-rj-editor-code-block="true"]`))return;let n=e.createElement(`div`),r=e.createElement(`div`),i=e.createElement(`span`),a=e.createElement(`button`);n.className=`rj-editor-code-block-export`,n.setAttribute(`data-rj-editor-code-block`,`true`),r.className=`rj-editor-code-block-export-header`,i.className=`rj-editor-code-block-export-language`,i.textContent=`>_ ${t.getAttribute(`data-language`)||`plain`}`,a.className=`rj-editor-code-block-export-copy`,a.setAttribute(`aria-label`,`Copy code`),a.setAttribute(`data-rj-editor-code-copy`,`true`),a.setAttribute(`title`,`Copy code`),a.setAttribute(`type`,`button`),a.append(nt(e)),t.classList.add(`rj-editor-code-block--exported`),t.replaceWith(n),r.append(i,a),n.append(r,t)})}function it(e,t){Object.entries(t).forEach(([t,n])=>{typeof n==`string`&&e.style.setProperty(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),n)})}function at(e,t,n){n===`square`&&t===`left`&&(e.style.float=`left`,e.style.margin=`0.25rem 1rem 0.625rem 0`),n===`square`&&t===`right`&&(e.style.float=`right`,e.style.margin=`0.25rem 0 0.625rem 1rem`),n!==`square`&&t===`center`&&(e.style.marginLeft=`auto`,e.style.marginRight=`auto`),n!==`square`&&t===`right`&&(e.style.marginLeft=`auto`,e.style.marginRight=`0`),n!==`square`&&t===`left`&&(e.style.marginLeft=`0`,e.style.marginRight=`auto`)}function ot(e,t){let n=e.createElement(`span`);return n.className=`rj-editor-image-caption`,n.textContent=t,n.style.color=`var(--rj-editor-muted-text, #64748b)`,n.style.display=`block`,n.style.font=`500 0.75rem/1.35 system-ui, sans-serif`,n.style.marginTop=`0.375rem`,n.style.textAlign=`center`,n.style.width=`100%`,n}function st(e,t,n){let r=n?.trim();if(!r)return t;let i=e.createElement(`a`);return i.href=r,i.rel=`noreferrer`,i.target=`_blank`,i.style.color=`inherit`,i.style.display=`block`,i.style.textDecoration=`none`,t.replaceWith(i),i.append(t),i}function ct(e){return Array.from(e.querySelectorAll(`img[data-text-wrap="square"], [data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)).some(e=>{let t=e;return t.style.float===`left`||t.style.float===`right`})}function lt(e){if(!ct(e)||e.body.children.length===1&&e.body.firstElementChild?.matches(et))return;let t=e.createElement(`div`);t.className=`rj-editor-content`,t.setAttribute(`data-rj-editor-content`,`true`),t.style.display=`flow-root`,t.style.width=`100%`,t.append(...Array.from(e.body.childNodes)),e.body.append(t)}function ut(e,t){let n=t.getAttribute(`data-caption`)?.trim();if(!n)return!1;let r=t.getAttribute(`data-alignment`),i=t.getAttribute(`data-text-wrap`),a=e.createElement(`span`);return a.setAttribute(`data-rj-image-caption-wrapper`,`true`),a.style.display=`block`,a.style.maxWidth=`100%`,a.style.width=t.style.width||`fit-content`,at(a,r,i),t.style.float=``,t.style.margin=`0`,t.style.width=`100%`,t.replaceWith(a),a.append(st(e,t,t.getAttribute(`data-link-url`)),ot(e,n)),!0}function dt(e){return(Number(e||0)%360+360)%360}function ft(e,t,n){let r=t.getAttribute(`data-rj-image-node-key`),i=dt(t.getAttribute(`data-rotation`));if(!r||i!==90&&i!==270)return!1;let a=(n?.getElementByKey(r))?.querySelector(`.rj-editor-image-rotator`);if(!(a instanceof HTMLElement))return!1;let o=a.getBoundingClientRect(),s=a.offsetWidth,c=a.offsetHeight;if(!o.width||!o.height||!s||!c)return!1;let l=t.getAttribute(`data-alignment`),u=t.getAttribute(`data-caption`)?.trim(),d=t.getAttribute(`data-link-url`),f=t.getAttribute(`data-text-wrap`),p=e.createElement(`span`),m=e.createElement(`span`);return m.setAttribute(`data-rj-image-rotation-wrapper`,`true`),m.style.display=`block`,m.style.height=R(Math.ceil(o.height)),m.style.maxWidth=`100%`,m.style.position=`relative`,m.style.width=R(Math.ceil(o.width)),at(m,l,f),p.style.display=`block`,p.style.height=R(Math.ceil(o.height)),p.style.position=`relative`,p.style.width=R(Math.ceil(o.width)),t.style.display=`block`,t.style.float=``,t.style.height=R(c),t.style.left=`50%`,t.style.margin=`0`,t.style.maxWidth=`none`,t.style.position=`absolute`,t.style.top=`50%`,t.style.transform=`translate(-50%, -50%) rotate(${i}deg)`,t.style.transformOrigin=`center`,t.style.width=R(s),t.replaceWith(m),p.append(st(e,t,d)),m.append(p),u&&m.append(ot(e,u)),!0}function pt(e,t){if(!e.trim()||typeof DOMParser>`u`)return e;let n=new DOMParser().parseFromString(e,`text/html`);return n.querySelectorAll(`table`).forEach(e=>{e.classList.add(`rj-editor-table`),it(e,Xe)}),n.querySelectorAll(`td, th`).forEach(e=>{let t=e,n=e.tagName.toLowerCase()===`th`,r=t.style.backgroundColor===Qe;t.classList.add(n?`rj-editor-table-cell-header`:`rj-editor-table-cell`),it(t,Ze),t.style.verticalAlign||(t.style.verticalAlign=`top`),n&&(!t.style.backgroundColor||r)&&(t.style.backgroundColor=$e,t.style.fontWeight=`700`)}),n.querySelectorAll(`img[data-alignment]`).forEach(e=>{let r=e,i=r.getAttribute(`data-alignment`),a=r.getAttribute(`data-text-wrap`);ft(n,r,t)||(r.style.display=`block`,r.style.maxWidth=`100%`,at(r,i,a),ut(n,r)||st(n,r,r.getAttribute(`data-link-url`)))}),rt(n),lt(n),n.body.innerHTML}function mt(e,t){return typeof e!=`number`||Number.isNaN(e)?``:Se(String(e),t)}var ht=1200,gt=700;function _t(){return document.fullscreenElement?new Promise(e=>{let t=()=>{window.clearTimeout(n),document.removeEventListener(`fullscreenchange`,t),e()},n=window.setTimeout(t,ht);document.addEventListener(`fullscreenchange`,t,{once:!0})}):Promise.resolve()}function vt(){return new Promise(e=>{window.setTimeout(e,gt)})}async function yt(e){if(e){if(document.fullscreenElement)try{let e=_t();await document.exitFullscreen(),await e,await vt()}catch{}e.ownerDocument.defaultView?.focus(),e.click()}}function bt(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`error`,()=>{n(r.error)}),r.addEventListener(`load`,()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`File could not be converted to base64.`))}),r.readAsDataURL(e)})}var xt=!1;function St(){xt||typeof document>`u`||(xt=!0,document.addEventListener(`click`,async e=>{let t=e.target,n=t instanceof Element?t.closest(`[data-rj-editor-code-copy="true"]`):null;if(!(n instanceof HTMLButtonElement))return;let r=n.closest(`[data-rj-editor-code-block="true"]`)?.querySelector(`pre.rj-editor-code-block`);r instanceof HTMLElement&&(e.preventDefault(),await pe(r.textContent||``),n.classList.add(`is-copied`),n.setAttribute(`aria-label`,`Copied`),n.setAttribute(`title`,`Copied`),window.setTimeout(()=>{n.classList.remove(`is-copied`),n.setAttribute(`aria-label`,`Copy code`),n.setAttribute(`title`,`Copy code`)},1600))}))}function z(e,t=`□`){return e&&typeof e!=`string`?Ot(e):`<span class="rj-editor-equation-render-slot">${xe(e?.trim()||t)}</span>`}function Ct(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function wt(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function Tt(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}function Et(e){return[`rj-editor-equation-render`,`rj-editor-equation-render--script`,e.position===`before`?`rj-editor-equation-render--prescript`:``,e.superscript===void 0?``:`has-superscript`,e.subscript===void 0?``:`has-subscript`].filter(Boolean).join(` `)}function Dt(e){let t=`<span class="rj-editor-equation-render-matrix-grid" style="grid-template-columns: repeat(${Math.max(...e.cells.map(e=>e.length),1)}, minmax(1.75rem, auto));">${e.cells.flatMap(e=>e.map(e=>`<span>${z(e)}</span>`)).join(``)}</span>`;return e.bracket===`none`?t:e.bracket===`determinant`?`<span class="rj-editor-equation-render-matrix-bracket">|</span>${t}<span class="rj-editor-equation-render-matrix-bracket">|</span>`:e.bracket===`round`?`<span class="rj-editor-equation-render-matrix-bracket">(</span>${t}<span class="rj-editor-equation-render-matrix-bracket">)</span>`:`<span class="rj-editor-equation-render-matrix-bracket">[</span>${t}<span class="rj-editor-equation-render-matrix-bracket">]</span>`}function Ot(e){switch(e.kind){case`accent`:return`<span class="rj-editor-equation-render rj-editor-equation-render--accent"><span class="rj-editor-equation-render-accent-mark">${{bar:`¯`,dot:`˙`,doubleDot:`¨`,hat:`ˆ`,vector:`⃗`}[e.accent]}</span>${z(e.value,`x`)}</span>`;case`bracket`:{let[t,n]=Ct(e.bracket);return`<span class="rj-editor-equation-render rj-editor-equation-render--bracket"><span class="rj-editor-equation-render-bracket">${xe(t)}</span>${z(e.value,`x`)}<span class="rj-editor-equation-render-bracket">${xe(n)}</span></span>`}case`fraction`:return e.variant===`linear`||e.variant===`skewed`?`<span class="rj-editor-equation-render rj-editor-equation-render--fraction-inline"><span>${z(e.numerator)}</span><span>${e.variant===`skewed`?`⁄`:`/`}</span><span>${z(e.denominator)}</span></span>`:`<span class="rj-editor-equation-render rj-editor-equation-render--fraction"><span>${z(e.numerator)}</span><span class="rj-editor-equation-render-line"></span><span>${z(e.denominator)}</span></span>`;case`function`:return`<span class="rj-editor-equation-render rj-editor-equation-render--function"><span>${e.functionName}</span><span>(</span>${z(e.argument,`x`)}<span>)</span></span>`;case`integral`:return`<span class="rj-editor-equation-render rj-editor-equation-render--integral"><span class="rj-editor-equation-render-limits"><span>${e.upper===void 0?``:z(e.upper,`b`)}</span><span class="rj-editor-equation-render-large-symbol">${Tt(e.variant)}</span><span>${e.lower===void 0?``:z(e.lower,`a`)}</span></span>${z(e.body,`f(x)`)}<span>d</span>${z(e.variable,`x`)}</span>`;case`largeOperator`:return`<span class="rj-editor-equation-render rj-editor-equation-render--large-operator"><span class="rj-editor-equation-render-limits"><span>${e.upper===void 0?``:z(e.upper,`n`)}</span><span class="rj-editor-equation-render-large-symbol">${wt(e.operator)}</span><span>${e.lower===void 0?``:z(e.lower,`i=1`)}</span></span>${z(e.body,`i`)}</span>`;case`limit`:return`<span class="rj-editor-equation-render rj-editor-equation-render--limit"><span class="rj-editor-equation-render-limits"><span>lim</span><span>${z(e.target,`x→0`)}</span></span>${z(e.body,`f(x)`)}</span>`;case`matrix`:return`<span class="rj-editor-equation-render rj-editor-equation-render--matrix">${Dt(e)}</span>`;case`operator`:return`<span class="rj-editor-equation-render">${xe(e.value||`□`)}</span>`;case`root`:return`<span class="rj-editor-equation-render rj-editor-equation-render--root">${e.index===void 0?``:`<span class="rj-editor-equation-render-root-index">${z(e.index,`n`)}</span>`}<span class="rj-editor-equation-render-root-symbol">√</span><span class="rj-editor-equation-render-radicand">${z(e.value,`x`)}</span></span>`;case`script`:return e.position===`before`?`<span class="${Et(e)}"><span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${z(e.superscript,`n`)}</span>`}${e.subscript===void 0?``:`<span>${z(e.subscript,`1`)}</span>`}</span>${z(e.base,`Y`)}</span>`:`<span class="${Et(e)}">${z(e.base,`x`)}<span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${z(e.superscript,`2`)}</span>`}${e.subscript===void 0?``:`<span>${z(e.subscript,`i`)}</span>`}</span></span>`;case`text`:return`<span class="rj-editor-equation-render">${z(e.value,`□`)}</span>`;case`row`:return`<span class="rj-editor-equation-render rj-editor-equation-render--row">${e.items.map(Ot).join(``)}</span>`;default:return``}}function kt(e,t){let r=ve(e);return r?Ot(r):n.default.renderToString(e,{displayMode:t===`block`,output:`mathml`,strict:!1,throwOnError:!1,trust:!1})}function At(e,n){let r=new DOMParser().parseFromString(n||``,`text/html`),a=r.body.querySelector(`[data-rj-editor-content="true"]`);r.body.querySelectorAll(`[data-rj-editor-code-block="true"]`).forEach(e=>{let t=e.querySelector(`pre.rj-editor-code-block`);if(!t){e.remove();return}t.classList.remove(`rj-editor-code-block--exported`),e.replaceWith(t)}),a&&r.body.children.length===1&&r.body.replaceChildren(...Array.from(a.childNodes));let o=(0,i.$generateNodesFromDOM)(e,r),s=(0,t.$getRoot)();if(s.clear(),o.length>0){s.append(...o);return}s.append((0,t.$createParagraphNode)())}var jt=(0,l.createSlice)({name:`toolbar`,initialState:L,reducers:{setCanRedo(e,t){e.canRedo=t.payload},setCanUndo(e,t){e.canUndo=t.payload},setTextFormats(e,t){e.isBold=t.payload.isBold,e.isCode=t.payload.isCode,e.isItalic=t.payload.isItalic,e.isStrikethrough=t.payload.isStrikethrough,e.isSubscript=t.payload.isSubscript,e.isSuperscript=t.payload.isSuperscript,e.isUnderline=t.payload.isUnderline},setStyleFormats(e,t){e.backgroundColor=t.payload.backgroundColor,e.fontFamily=t.payload.fontFamily,e.fontSize=t.payload.fontSize,e.lineHeight=t.payload.lineHeight,e.textColor=t.payload.textColor},setBlockFormats(e,t){e.alignment=t.payload.alignment,e.listType=t.payload.listType},setTableFormats(e,t){e.isInTable=t.payload.isInTable,e.selectedTableCellsCount=t.payload.selectedTableCellsCount,e.tableCellBackgroundColor=t.payload.tableCellBackgroundColor,e.tableCellVerticalAlign=t.payload.tableCellVerticalAlign,e.tableHasMergedCell=t.payload.tableHasMergedCell},setEquationFormats(e,t){e.isEquationSelected=t.payload.isEquationSelected,e.selectedEquation=t.payload.selectedEquation,e.selectedEquationDisplayMode=t.payload.selectedEquationDisplayMode,e.selectedEquationKey=t.payload.selectedEquationKey},setImageFormats(e,t){e.isImageSelected=t.payload.isImageSelected,e.selectedImageAlignment=t.payload.selectedImageAlignment,e.selectedImageAltText=t.payload.selectedImageAltText,e.selectedImageAspectRatioLocked=t.payload.selectedImageAspectRatioLocked,e.selectedImageBorderEnabled=t.payload.selectedImageBorderEnabled,e.selectedImageBorderRadius=t.payload.selectedImageBorderRadius,e.selectedImageCaption=t.payload.selectedImageCaption,e.selectedImageHeight=t.payload.selectedImageHeight,e.selectedImageKey=t.payload.selectedImageKey,e.selectedImageLinkUrl=t.payload.selectedImageLinkUrl,e.selectedImageObjectFit=t.payload.selectedImageObjectFit,e.selectedImageRotation=t.payload.selectedImageRotation,e.selectedImageShadowEnabled=t.payload.selectedImageShadowEnabled,e.selectedImageTextWrap=t.payload.selectedImageTextWrap,e.selectedImageWidth=t.payload.selectedImageWidth}}}),{setBlockFormats:Mt,setCanRedo:Nt,setCanUndo:Pt,setEquationFormats:Ft,setImageFormats:It,setStyleFormats:B,setTableFormats:Lt,setTextFormats:Rt}=jt.actions,zt=jt.reducer,Bt=()=>(0,l.configureStore)({reducer:{toolbar:zt}});Bt();var V=c.useDispatch.withTypes(),H=c.useSelector.withTypes(),Vt={alerts:{imageUploadFailed:`Image upload failed.`,imageSizeLimit:`Image size must be 5MB or less.`,onlyImages:`Only image files can be uploaded.`},common:{cancel:`Cancel`,close:`Close`,insert:`Insert`,moreColors:`More colors`,none:`None`,optional:`Optional`,save:`Save`},footer:{characters:`characters`,editing:`Editing`,focus:`Focus`,fullscreen:`Fullscreen`,language:`Language`,selected:`Selected`,statusBar:`Editor status`,words:`words`,zoom:`Zoom`},modal:{closeAriaLabel:`Close modal`},placeholders:{editor:`Write your article here...`},toolbar:{alignment:{center:`Align center`,justify:`Align justify`,left:`Align left`,right:`Align right`},codeBlock:{code:`Code`,codePlaceholder:`Write or paste code here...`,copied:`Copied`,copy:`Copy code`,language:`Language`},fullscreen:{close:`Exit fullscreen`,open:`Open fullscreen`},history:{redo:`Redo`,undo:`Undo`},image:{alignCenter:`Align image center`,alignLeft:`Align image left`,alignRight:`Align image right`,alt:`Alt text`,altPlaceholder:`Describe this image`,border:`Border`,borderRadius:`Image border radius`,caption:`Caption`,captionPlaceholder:`Image caption`,cropMode:`Image crop mode`,delete:`Delete image`,editAlt:`Edit alt text`,editCaption:`Edit caption`,editLink:`Edit image link`,fitContain:`Contain`,fitCover:`Cover`,fitFill:`Fill`,link:`Link`,linkPlaceholder:`https://example.com`,replace:`Replace image`,rotateLeft:`Rotate left`,rotateRight:`Rotate right`,shadow:`Shadow`,squareWrap:`Square`,topBottomWrap:`Top and Bottom`,width:`Image width`},insert:{codeBlock:`Code block`,equation:`Equation`,horizontalLine:`Horizontal line`,image:`Image`,link:`Link`,table:`Table`,youtube:`YouTube`},link:{openInNewTab:`Open in new tab`,text:`Text`,textPlaceholder:`Link text`,title:`Title`,titlePlaceholder:`Optional`,url:`URL`,urlPlaceholder:`https://example.com`},list:{bullet:`Bulleted list`,numbered:`Numbered list`,remove:`Remove list`},spacing:{default:`Default`,lineAndParagraph:`Line and paragraph spacing`},shortcuts:{backgroundColor:`Background color`,bold:`Bold`,bulletList:`Bulleted list`,clearFormatting:`Clear formatting`,decreaseIndent:`Decrease indent`,fontFamily:`Font family`,fontSize:`Font size`,increaseIndent:`Increase indent`,italic:`Italic`,link:`Insert link`,numberedList:`Numbered list`,redo:`Redo`,removeList:`Remove list`,spacing:`Line spacing`,strikethrough:`Strikethrough`,subscript:`Subscript`,superscript:`Superscript`,textColor:`Text color`,underline:`Underline`,undo:`Undo`},style:{backgroundColor:`Background color`,clearFormatting:`Clear formatting`,fontFamily:`Font family`,fontFamilyPlaceholder:`Font`,fontSize:`Font size`,fontSizePlaceholder:`Size`,textColor:`Text color`},table:{alignBottom:`Align cell content to bottom`,alignMiddle:`Align cell content to middle`,alignTop:`Align cell content to top`,background:`Table cell background`,columns:`Columns`,deleteColumn:`Delete column`,deleteRow:`Delete row`,deleteTable:`Delete table`,headerColumn:`Header col`,headerRow:`Header row`,header:`Header`,insertColumnLeft:`Insert column left`,insertColumnRight:`Insert column right`,insertRowAbove:`Insert row above`,insertRowBelow:`Insert row below`,insertTable:`Insert table`,insertTableSize:`{columns}x{rows} Table`,mergeCells:`Merge`,columnLeft:`Col ←`,columnRight:`Col →`,rowAbove:`Row ↑`,rowBelow:`Row ↓`,column:`Col`,row:`Row`,rows:`Rows`,unmergeCell:`Unmerge`},tabs:{equation:`Equation`,home:`Home`,image:`Image`,insert:`Insert`,layout:`Layout`,table:`Table`},textFormat:{bold:`Bold`,code:`Inline code`,italic:`Italic`,strikethrough:`Strikethrough`,subscript:`Subscript`,superscript:`Superscript`,underline:`Underline`},youtube:{invalidUrl:`YouTube link or video ID is invalid.`,title:`Title`,titlePlaceholder:`Optional`,url:`YouTube URL`,urlPlaceholder:`https://www.youtube.com/watch?v=...`}}};function Ht(e){return!e||typeof e!=`object`?e:Array.isArray(e)?e.map(e=>Ht(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Ht(t)]))}function Ut(e,...t){return t.reduce((e,t)=>(t&&Object.entries(t).forEach(([t,n])=>{let r=e[t];if(n&&typeof n==`object`&&!Array.isArray(n)&&r&&typeof r==`object`){e[t]=Ut(r,n);return}e[t]=n}),e),Ht(e))}var Wt=Ut(Vt,{alerts:{imageUploadFailed:`Не удалось загрузить изображение.`,imageSizeLimit:`Размер изображения должен быть не больше 5MB.`,onlyImages:`Можно загружать только изображения.`},common:{cancel:`Отмена`,close:`Закрыть`,insert:`Вставить`,moreColors:`Больше цветов`,none:`Нет`,optional:`Необязательно`,save:`Сохранить`},footer:{characters:`символов`,editing:`Редактирование`,focus:`Фокус`,fullscreen:`Полный экран`,language:`Язык`,selected:`Выделено`,statusBar:`Статус редактора`,words:`слов`,zoom:`Масштаб`},modal:{closeAriaLabel:`Закрыть модальное окно`},placeholders:{editor:`Напишите текст здесь...`},toolbar:{codeBlock:{code:`Код`,codePlaceholder:`Напишите или вставьте код здесь...`,copied:`Скопировано`,copy:`Копировать код`,language:`Язык`},fullscreen:{close:`Выйти из полноэкранного режима`,open:`Открыть на весь экран`},image:{border:`Граница`,caption:`Подпись`,captionPlaceholder:`Подпись к изображению`,cropMode:`Режим обрезки изображения`,delete:`Удалить изображение`,replace:`Заменить изображение`,shadow:`Тень`},insert:{codeBlock:`Блок кода`,equation:`Формула`,horizontalLine:`Горизонтальная линия`,image:`Изображение`,link:`Ссылка`,table:`Таблица`},link:{openInNewTab:`Открывать в новой вкладке`,text:`Текст`,textPlaceholder:`Текст ссылки`,titlePlaceholder:`Необязательно`},table:{columns:`Столбцы`,headerColumn:`Заголовок столбца`,headerRow:`Заголовок строки`,insertTable:`Вставить таблицу`,insertTableSize:`Таблица {columns}x{rows}`,mergeCells:`Объединить`,rows:`Строки`,unmergeCell:`Разделить`},youtube:{invalidUrl:`Ссылка YouTube или video ID неверны.`,titlePlaceholder:`Необязательно`}}}),Gt=Ut(Vt,{alerts:{imageUploadFailed:`Rasmni yuklashda xatolik yuz berdi.`,imageSizeLimit:`Rasm hajmi 5MB yoki undan kichik bo‘lishi kerak.`,onlyImages:`Faqat rasm fayllarini yuklash mumkin.`},common:{cancel:`Bekor qilish`,close:`Yopish`,insert:`Qo‘shish`,moreColors:`Ko‘proq ranglar`,none:`Yo‘q`,optional:`Ixtiyoriy`,save:`Saqlash`},footer:{characters:`belgi`,editing:`Tahrirlash`,focus:`Fokus`,fullscreen:`To‘liq ekran`,language:`Til`,selected:`Tanlangan`,statusBar:`Editor holati`,words:`so‘z`,zoom:`Masshtab`},modal:{closeAriaLabel:`Modalni yopish`},placeholders:{editor:`Maqolangizni shu yerga yozing...`},toolbar:{codeBlock:{code:`Kod`,codePlaceholder:`Kodni shu yerga yozing yoki joylang...`,copied:`Nusxalandi`,copy:`Kodni nusxalash`,language:`Dasturlash tili`},fullscreen:{close:`To‘liq ekrandan chiqish`,open:`To‘liq ekranda ochish`},history:{redo:`Qaytarish`,undo:`Bekor qilish`},image:{alt:`Muqobil matn`,altPlaceholder:`Rasmni tasvirlab yozing`,border:`Chegara`,borderRadius:`Rasm burchak radiusi`,caption:`Izoh`,captionPlaceholder:`Rasm osti yozuvi`,cropMode:`Rasm ko‘rinish rejimi`,delete:`Rasmni o‘chirish`,editAlt:`Muqobil matnni tahrirlash`,editCaption:`Izohni tahrirlash`,editLink:`Rasm linkini tahrirlash`,fitContain:`Sig‘dirish`,fitCover:`Qoplash`,fitFill:`To‘ldirish`,replace:`Rasmni almashtirish`,rotateLeft:`Chapga aylantirish`,rotateRight:`O‘ngga aylantirish`,shadow:`Soya`,squareWrap:`Yonidan matn`,topBottomWrap:`Yuqori va pastdan`,width:`Rasm kengligi`},insert:{codeBlock:`Kod bloki`,equation:`Formula`,horizontalLine:`Gorizontal chiziq`,image:`Rasm`,table:`Jadval`},link:{openInNewTab:`Yangi tabda ochish`,text:`Matn`,textPlaceholder:`Link matni`,titlePlaceholder:`Ixtiyoriy`},list:{bullet:`Nuqtali ro‘yxat`,numbered:`Raqamli ro‘yxat`,remove:`Ro‘yxatni olib tashlash`},spacing:{default:`Standart`,lineAndParagraph:`Qator va paragraf oralig‘i`},shortcuts:{backgroundColor:`Orqa fon rangi`,bold:`Qalin`,bulletList:`Nuqtali ro‘yxat`,clearFormatting:`Formatni tozalash`,decreaseIndent:`Chekinishni kamaytirish`,fontFamily:`Shrift`,fontSize:`O‘lcham`,increaseIndent:`Chekinishni oshirish`,italic:`Kursiv`,link:`Link qo‘shish`,numberedList:`Raqamli ro‘yxat`,redo:`Qaytarish`,removeList:`Ro‘yxatni olib tashlash`,spacing:`Qator oralig‘i`,strikethrough:`Ustidan chizish`,subscript:`Pastki indeks`,superscript:`Yuqori indeks`,textColor:`Matn rangi`,underline:`Tagiga chizish`,undo:`Bekor qilish`},style:{backgroundColor:`Orqa fon rangi`,clearFormatting:`Formatni tozalash`,fontFamily:`Shrift oilasi`,fontFamilyPlaceholder:`Shrift`,fontSize:`Shrift o‘lchami`,fontSizePlaceholder:`O‘lcham`,textColor:`Matn rangi`},table:{alignBottom:`Katak matnini pastga tekislash`,alignMiddle:`Katak matnini o‘rtaga tekislash`,alignTop:`Katak matnini yuqoriga tekislash`,background:`Katak orqa fon rangi`,columns:`Ustunlar`,deleteColumn:`Ustunni o‘chirish`,deleteRow:`Qatorni o‘chirish`,deleteTable:`Jadvalni o‘chirish`,headerColumn:`Sarlavha ustuni`,headerRow:`Sarlavha qatori`,header:`Sarlavha`,insertColumnLeft:`Chapga ustun qo‘shish`,insertColumnRight:`O‘ngga ustun qo‘shish`,insertRowAbove:`Yuqoriga qator qo‘shish`,insertRowBelow:`Pastga qator qo‘shish`,insertTable:`Jadval qo‘shish`,insertTableSize:`{columns}x{rows} jadval`,mergeCells:`Birlashtirish`,columnLeft:`Ustun ←`,columnRight:`Ustun →`,rowAbove:`Qator ↑`,rowBelow:`Qator ↓`,column:`Ustun`,row:`Qator`,rows:`Qatorlar`,unmergeCell:`Ajratish`},tabs:{equation:`Formula`,home:`Asosiy`,image:`Rasm`,insert:`Qo‘shish`,layout:`Joylashuv`,table:`Jadval`},textFormat:{bold:`Qalin`,code:`Inline kod`,italic:`Kursiv`,strikethrough:`Ustidan chizish`,subscript:`Pastki indeks`,superscript:`Yuqori indeks`,underline:`Tagiga chizish`},youtube:{invalidUrl:`YouTube link yoki video ID noto‘g‘ri.`,titlePlaceholder:`Ixtiyoriy`}}}),Kt=A.default.createContext(Gt),qt={en:Vt,ru:Wt,uz:Gt};function Jt({children:e,locale:t=`uz`,locales:n,translations:r}){let i=A.default.useMemo(()=>Ut(qt[t]||Vt,n?.[t],r),[t,n,r]);return(0,u.jsx)(Kt.Provider,{value:i,children:e})}function U(){return A.default.useContext(Kt)}var Yt={algorithm:o.theme.defaultAlgorithm,token:{colorPrimary:`#3167c8`}},Xt={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#202020`,colorBgElevated:`#252525`,colorBorder:`#444444`,colorBorderSecondary:`#383838`,colorFillSecondary:`#2d2d2d`,colorFillTertiary:`#292929`,colorPrimary:`#b8b8b8`,colorPrimaryActive:`#d8d8d8`,colorPrimaryHover:`#cecece`,colorText:`#ededed`,colorTextPlaceholder:`#8d8d8d`,colorTextQuaternary:`#777777`,colorTextSecondary:`#b5b5b5`,colorTextTertiary:`#999999`}};function Zt(e){return e===`dark`?Xt:Yt}var Qt=A.default.createContext(`light`);function $t(){return A.default.useContext(Qt)}function en(e){let t=e?.trim().toLowerCase();if(t===`dark`||t===`only dark`)return`dark`;if(t===`light`||t===`only light`)return`light`}function tn(e){if(!e)return;let t=en(e.dataset.rjEditorTheme)||en(e.dataset.colorScheme)||en(e.dataset.theme)||en(e.getAttribute(`color-scheme`));if(t)return t;if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`}function nn(e){return e?en(window.getComputedStyle(e).colorScheme):void 0}function rn(){if(typeof document>`u`||typeof window>`u`)return`light`;let e=document.documentElement,t=document.body,n=tn(e)||tn(t);if(n)return n;let r=document.querySelector(`meta[name="color-scheme"]`)?.content;return nn(e)||nn(t)||en(r)||(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)}function an(e){let[t,n]=A.default.useState(()=>rn());return A.default.useEffect(()=>{if(e!==`auto`)return;let t=()=>n(rn()),r=window.matchMedia(`(prefers-color-scheme: dark)`),i=new MutationObserver(t),a=new MutationObserver(t),o=new MutationObserver(t),s=window.requestAnimationFrame(t),c=[`class`,`color-scheme`,`data-color-scheme`,`data-rj-editor-theme`,`data-theme`,`style`];return r.addEventListener(`change`,t),i.observe(document.documentElement,{attributeFilter:c,attributes:!0}),document.body&&a.observe(document.body,{attributeFilter:c,attributes:!0}),o.observe(document.head,{attributeFilter:[`content`],attributes:!0,childList:!0,subtree:!0}),()=>{window.cancelAnimationFrame(s),r.removeEventListener(`change`,t),i.disconnect(),a.disconnect(),o.disconnect()}},[e]),e===`auto`?t:e}var on=Symbol.for(`preact-signals`);function sn(){if(G>1)return void G--;let e,t=!1;for(function(){let e=dn;for(dn=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();ln!==void 0;){let n=ln;for(ln=void 0,fn++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&vn(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(fn=0,G--,t)throw e}function cn(e){if(G>0)return e();mn=++pn,G++;try{return e()}finally{sn()}}var W,ln;function un(e){let t=W;W=void 0;try{return e()}finally{W=t}}var dn,G=0,fn=0,pn=0,mn=0,hn=0;function gn(e){if(W===void 0)return;let t=e.n;return t===void 0||t.t!==W?(t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},W.s!==void 0&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t):void 0}function K(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function _n(e,t){return new K(e,t)}function vn(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function yn(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function bn(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function xn(e,t){K.call(this,void 0),this.x=e,this.s=void 0,this.g=hn-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Sn(e,t){return new xn(e,t)}function Cn(e){let t=e.m;if(e.m=void 0,typeof t==`function`){G++;let n=W;W=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,wn(e),t}finally{W=n,sn()}}}function wn(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Cn(e)}function Tn(e){if(W!==this)throw Error(`Out-of-order effect`);bn(this),W=e,this.f&=-2,8&this.f&&wn(this),sn()}function En(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function q(e,t){let n=new En(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Dn(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=_n(i===void 0?e[r]:i)}return n}K.prototype.brand=on,K.prototype.h=function(){return!0},K.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?un(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},K.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&un(()=>{var e;(e=this.Z)==null||e.call(this)}))}},K.prototype.subscribe=function(e){return q(()=>{let t=this.value,n=W;W=void 0;try{e(t)}finally{W=n}},{name:`sub`})},K.prototype.valueOf=function(){return this.value},K.prototype.toString=function(){return this.value+``},K.prototype.toJSON=function(){return this.value},K.prototype.peek=function(){let e=W;W=void 0;try{return this.value}finally{W=e}},Object.defineProperty(K.prototype,`value`,{get(){let e=gn(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(fn>100)throw Error(`Cycle detected`);(function(e){G!==0&&fn===0&&e.l!==mn&&(e.l=mn,dn={S:e,v:e.v,i:e.i,o:dn})})(this),this.v=e,this.i++,hn++,G++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{sn()}}}}),xn.prototype=new K,xn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===hn))return!0;if(this.g=hn,this.f|=1,this.i>0&&!vn(this))return this.f&=-2,!0;let e=W;try{yn(this),W=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return W=e,bn(this),this.f&=-2,!0},xn.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}K.prototype.S.call(this,e)},xn.prototype.U=function(e){if(this.t!==void 0&&(K.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},xn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(xn.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=gn(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),En.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},En.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Cn(this),yn(this),G++;let e=W;return W=this,Tn.bind(this,e)},En.prototype.N=function(){2&this.f||(this.f|=2,this.u=ln,ln=this)},En.prototype.d=function(){this.f|=8,1&this.f||wn(this)},En.prototype.dispose=function(){this.d()},(0,t.defineExtension)({build:(e,t,n)=>Dn(t),config:(0,t.safeCast)({defaultSelection:`rootEnd`,disabled:!1}),name:`@lexical/extension/AutoFocus`,register(e,t,n){let r=n.getOutput();return q(()=>r.disabled.value?void 0:e.registerRootListener(t=>{e.focus(()=>{let e=document.activeElement;t===null||e!==null&&t.contains(e)||t.focus({preventScroll:!0})},{defaultSelection:r.defaultSelection.peek()})}))}});function On(){let e=(0,t.$getRoot)(),n=(0,t.$getSelection)(),r=(0,t.$createParagraphNode)();e.clear(),e.append(r),n!==null&&r.select(),(0,t.$isRangeSelection)(n)&&(n.format=0)}function kn(e,n=On){return e.registerCommand(t.CLEAR_EDITOR_COMMAND,t=>(e.update(n),!0),t.COMMAND_PRIORITY_EDITOR)}(0,t.defineExtension)({build:(e,t,n)=>Dn(t),config:(0,t.safeCast)({$onClear:On}),name:`@lexical/extension/ClearEditor`,register(e,t,n){let{$onClear:r}=n.getOutput();return q(()=>kn(e,r.value))}});function An(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var jn=(0,t.createState)(`format`,{parse:e=>typeof e==`number`?e:0}),Mn=class extends t.DecoratorNode{$config(){return this.config(`decorator-text`,{extends:t.DecoratorNode,stateConfigs:[{flat:!0,stateConfig:jn}]})}getFormat(){return(0,t.$getState)(this,jn)}getFormatFlags(e,n){return(0,t.toggleTextFormatType)(this.getFormat(),e,n)}hasFormat(e){let n=t.TEXT_TYPE_TO_FORMAT[e];return(this.getFormat()&n)!==0}setFormat(e){return(0,t.$setState)(this,jn,e)}toggleFormat(e){let n=(0,t.toggleTextFormatType)(this.getFormat(),e,null);return this.setFormat(n)}isInline(){return!0}createDOM(){return document.createElement(`span`)}updateDOM(){return!1}};function Nn(e){return e instanceof Mn}(0,t.defineExtension)({name:`@lexical/extension/DecoratorText`,nodes:()=>[Mn],register:(e,n,r)=>e.registerCommand(t.FORMAT_TEXT_COMMAND,e=>{let n=(0,t.$getSelection)();if((0,t.$isNodeSelection)(n)||(0,t.$isRangeSelection)(n))for(let t of n.getNodes())Nn(t)&&t.toggleFormat(e);return!1},t.COMMAND_PRIORITY_LOW)});function Pn(e,t){let n;return _n(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Fn=(0,t.defineExtension)({build:e=>Pn(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`});function J(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function In(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)n[e]=In(n[e],r[e]);return e}return t}var Ln=0,Rn=1,zn=2,Bn=3,Vn=4,Hn=5,Un=6,Wn=7;function Gn(e){return e.id===Ln}function Kn(e){return e.id===zn}function qn(e){return function(e){return e.id===Rn}(e)||J(305,String(e.id),String(Rn)),Object.assign(e,{id:zn})}var Jn=new Set,Yn=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Ln}}mergeConfigs(){let e=this.extension.config||{},n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):t.shallowMergeConfig;for(let t of this.configs)e=n(e,t);return e}init(e){let t=this.state;Kn(t)||J(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:Bn,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:Vn,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==Vn&&J(307,String(t.id),String(Hn)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:Hn,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==Hn&&J(308,String(n.id),String(Hn));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:Un})}(n),()=>{let e=this.state;e.id!==Wn&&J(309,String(n.id),String(Wn)),this.state=function(e){return Object.assign(e,{id:Hn})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==Un&&J(310,String(t.id),String(Un)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:Wn})}(t),n}getSignal(){return this._signal===void 0&&J(311),this._signal}getInitResult(){this.extension.init===void 0&&J(312,this.extension.name);let e=this.state;return function(e){return e.id>=Vn}(e)||J(313,String(e.id),String(Vn)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=Bn}(e)||J(314,String(e.id),String(Bn)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&J(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&J(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=Wn}(e)||J(316,String(e.id),String(Wn)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Jn}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=Hn})(e)||J(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Xn={tag:t.HISTORY_MERGE_TAG};function Zn(){let e=(0,t.$getRoot)();e.isEmpty()&&e.append((0,t.$createParagraphNode)())}var Qn=(0,t.defineExtension)({config:(0,t.safeCast)({setOptions:Xn,updateOptions:Xn}),init:({$initialEditorState:e=Zn})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:n,setOptions:r},i){let a=i.getInitResult();if(!a.initialized){a.initialized=!0;let{$initialEditorState:i}=a;if((0,t.$isEditorState)(i))e.setEditorState(i,r);else if(typeof i==`function`)e.update(()=>{i(e)},n);else if(i&&(typeof i==`string`||typeof i==`object`)){let t=e.parseEditorState(i);e.setEditorState(t,r)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[t.RootNode,t.TextNode,t.LineBreakNode,t.TabNode,t.ParagraphNode]}),$n=Symbol.for(`@lexical/extension/LexicalBuilder`);function er(){}function tr(e){throw e}function nr(e){return Array.isArray(e)?e:[e]}var rr=`0.44.0+prod.esm`,ir=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=rr,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[nr(Qn)];for(let e of t)n.push(nr(e));return new e(n)}static maybeFromEditor(t){let n=t[$n];return n&&(n.PACKAGE_VERSION!==rr&&J(292,n.PACKAGE_VERSION,rr),n instanceof e||J(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&J(294),n}constructEditor(){let{$initialEditorState:e,onError:n,...r}=this.buildCreateEditorArgs(),i=Object.assign((0,t.createEditor)({...r,...n?{onError:e=>{n(e,i)}}:{}}),{[$n]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=er;function n(){try{e()}finally{e=er}}let r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return e=(0,t.mergeRegister)(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&J(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&J(296);let[t]=nr(e);typeof t.name!=`string`&&J(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&J(298,t.name),!n){n=new Yn(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&J(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&J(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=nr(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(Kn(i))return;let a=n.extension.name;var o;Gn(i)||J(300,a,r||`[unknown]`),Gn(o=i)||J(304,String(o.id),String(Ln)),i=Object.assign(o,{id:Rn}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=qn(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Gn(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&J(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let n=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],a=r.signal;for(let t of n){let n=t.register(e,a);n&&i.push(n)}for(let t of n){let n=t.afterRegistration(e);n&&i.push(n)}return(0,t.mergeRegister)(...i)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of An(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&J(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&In(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=tr,e}};function ar(e,t){let n=ir.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var or=new Set,sr=(0,t.defineExtension)({build(e,n,r){let i=r.getDependency(Fn).output,a=_n({watchedNodeKeys:new Map}),o=Pn(()=>{},()=>q(()=>{let e=o.peek(),{watchedNodeKeys:n}=a.value,r,s=!1;i.value.read(()=>{if((0,t.$getSelection)())for(let[i,a]of n.entries()){if(a.size===0){n.delete(i);continue}let o=(0,t.$getNodeByKey)(i),c=o&&o.isSelected()||!1;s||=c!==(!!e&&e.has(i)),c&&(r||=new Set,r.add(i))}}),!s&&r&&e&&r.size===e.size||(o.value=r)}));return{watchNodeKey:function(e){let t=Sn(()=>(o.value||or).has(e)),{watchedNodeKeys:n}=a.peek(),r=n.get(e),i=r!==void 0;return r||=new Set,r.add(t),i||(n.set(e,r),a.value={watchedNodeKeys:n}),t}}},dependencies:[Fn],name:`@lexical/extension/NodeSelection`}),cr=(0,t.createCommand)(`INSERT_HORIZONTAL_RULE_COMMAND`),lr=class e extends t.DecoratorNode{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return dr().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:ur,priority:0})}}exportDOM(){return{element:document.createElement(`hr`)}}createDOM(e){let n=document.createElement(`hr`);return(0,t.addClassNamesToElement)(n,e.theme.hr),n}getTextContent(){return`
|
|
12
|
+
`}isInline(){return!1}updateDOM(){return!1}};function ur(){return{node:dr()}}function dr(){return(0,t.$create)(lr)}function fr(e){return e instanceof lr}(0,t.defineExtension)({dependencies:[Fn,sr],name:`@lexical/extension/HorizontalRule`,nodes:()=>[lr],register(e,n,r){let{watchNodeKey:i}=r.getDependency(sr).output,a=_n({nodeSelections:new Map}),o=e._config.theme.hrSelected??`selected`;return(0,t.mergeRegister)(e.registerCommand(cr,e=>{let n=(0,t.$getSelection)();return(0,t.$isRangeSelection)(n)?(n.focus.getNode()!==null&&(0,m.$insertNodeToNearestRoot)(dr()),!0):!1},t.COMMAND_PRIORITY_EDITOR),e.registerCommand(t.CLICK_COMMAND,e=>{if((0,t.isDOMNode)(e.target)){let n=(0,t.$getNodeFromDOMNode)(e.target);if(fr(n))return function(e,n=!1){let r=(0,t.$getSelection)(),i=e.isSelected(),a=e.getKey(),o;n&&(0,t.$isNodeSelection)(r)?o=r:(o=(0,t.$createNodeSelection)(),(0,t.$setSelection)(o)),i?o.delete(a):o.add(a)}(n,e.shiftKey),!0}return!1},t.COMMAND_PRIORITY_LOW),e.registerMutationListener(lr,(t,n)=>{cn(()=>{let n=!1,{nodeSelections:r}=a.peek();for(let[a,o]of t.entries())if(o===`destroyed`)r.delete(a),n=!0;else{let t=r.get(a),o=e.getElementByKey(a);t?t.domNode.value=o:(n=!0,r.set(a,{domNode:_n(o),selectedSignal:i(a)}))}n&&(a.value={nodeSelections:r})})}),q(()=>{let e=[];for(let{domNode:n,selectedSignal:r}of a.value.nodeSelections.values())e.push(q(()=>{let e=n.value;e&&(r.value?(0,t.addClassNamesToElement)(e,o):(0,t.removeClassNamesFromElement)(e,o))}));return(0,t.mergeRegister)(...e)}))}}),(0,t.defineExtension)({build:(e,t)=>Dn({inheritEditableFromParent:t.inheritEditableFromParent}),config:(0,t.safeCast)({$getParentEditor:function(){let e=(0,t.$getEditor)();return ir.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},name:`@lexical/extension/NestedEditor`,register:(e,t,n)=>q(()=>{let t=e._parentEditor;if(t&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(t.isEditable()),t.registerEditableListener(e.setEditable.bind(e))})}),(0,t.defineExtension)({build:(e,t,n)=>Dn(t),config:(0,t.safeCast)({disabled:!1,onReposition:void 0}),name:`@lexical/utils/SelectionAlwaysOnDisplay`,register:(e,t,n)=>{let r=n.getOutput();return q(()=>{if(!r.disabled.value)return(0,m.selectionAlwaysOnDisplay)(e,r.onReposition.value)})}});function pr(e){return e.canBeEmpty()}function mr(e,n,r=pr){return(0,t.mergeRegister)(e.registerCommand(t.KEY_TAB_COMMAND,n=>{let r=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(r))return!1;n.preventDefault();let i=function(e){if(e.getNodes().filter(e=>(0,t.$isBlockElementNode)(e)&&e.canIndent()).length>0)return!0;let n=e.anchor,r=e.focus,i=r.isBefore(n)?r:n,a=(0,m.$getNearestBlockElementAncestorOrThrow)(i.getNode());if(a.canIndent()){let e=a.getKey(),n=(0,t.$createRangeSelection)();if(n.anchor.set(e,0,`element`),n.focus.set(e,0,`element`),n=(0,t.$normalizeSelection__EXPERIMENTAL)(n),n.anchor.is(i))return!0}return!1}(r)?n.shiftKey?t.OUTDENT_CONTENT_COMMAND:t.INDENT_CONTENT_COMMAND:t.INSERT_TAB_COMMAND;return e.dispatchCommand(i,void 0)},t.COMMAND_PRIORITY_EDITOR),e.registerCommand(t.INDENT_CONTENT_COMMAND,()=>{let e=typeof n==`number`?n:n?n.peek():null;if(!(0,t.$isRangeSelection)((0,t.$getSelection)()))return!1;let i=typeof r==`function`?r:r.peek();return(0,m.$handleIndentAndOutdent)(t=>{if(i(t)){let n=t.getIndent()+1;(!e||n<e)&&t.setIndent(n)}})},t.COMMAND_PRIORITY_CRITICAL))}(0,t.defineExtension)({build:(e,t,n)=>Dn(t),config:(0,t.safeCast)({$canIndent:pr,disabled:!1,maxIndent:null}),name:`@lexical/extension/TabIndentation`,register(e,t,n){let{disabled:r,maxIndent:i,$canIndent:a}=n.getOutput();return q(()=>{if(!r.value)return mr(e,i,a)})}});function hr(e,n){let r=e;for(let i=(0,t.$getSiblingCaret)(e,n);i&&(Pr(i.origin)||(0,t.$isTabNode)(i.origin));i=i.getAdjacentCaret())r=i.origin;return r}function gr(e){return hr(e,`previous`)}function _r(e,n){for(let r of e.childNodes){if((0,t.isHTMLElement)(r)&&r.tagName===n)return!0;_r(r,n)}return!1}var vr=`data-language`,yr=`data-highlight-language`,br=`data-theme`,xr=class e extends t.ElementNode{__language;__theme;__isSyntaxHighlightSupported;static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let n=document.createElement(`code`);(0,t.addClassNamesToElement)(n,e.theme.code),n.setAttribute(`spellcheck`,`false`);let r=this.getLanguage();r&&(n.setAttribute(vr,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(yr,r));let i=this.getTheme();i&&n.setAttribute(br,i);let a=this.getStyle();return a&&(0,t.setDOMStyleFromCSS)(n.style,a),n}updateDOM(e,n,r){let i=this.__language,a=e.__language;i?i!==a&&n.setAttribute(vr,i):a&&n.removeAttribute(vr);let o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&a?o&&i?i!==a&&n.setAttribute(yr,i):n.removeAttribute(yr):o&&i&&n.setAttribute(yr,i);let s=this.__theme,c=e.__theme;s?s!==c&&n.setAttribute(br,s):c&&n.removeAttribute(br);let l=this.__style,u=e.__style;return l!==u&&(0,t.setDOMStyleFromCSS)(n.style,l,u),!1}exportDOM(e){let n=document.createElement(`pre`);(0,t.addClassNamesToElement)(n,e._config.theme.code),n.setAttribute(`spellcheck`,`false`);let r=this.getLanguage();r&&(n.setAttribute(vr,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(yr,r));let i=this.getTheme();i&&n.setAttribute(br,i);let a=this.getStyle();return a&&(0,t.setDOMStyleFromCSS)(n.style,a),{element:n}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||_r(e,`BR`))?{conversion:wr,priority:1}:null,div:()=>({conversion:Tr,priority:1}),pre:()=>({conversion:wr,priority:0}),table:e=>kr(e)?{conversion:Er,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&kr(n)?{conversion:Dr,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&kr(t)?{conversion:Dr,priority:3}:null}}}static importJSON(e){return Sr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,n=!0){if(!ar((0,t.$getEditor)(),`@lexical/code`)){let t=Ar(e);if(t)return t}let{anchor:r,focus:i}=e,a=(r.isBefore(i)?r:i).getNode();if((0,t.$isTextNode)(a)){let e=gr(a),n=[];for(;;)if((0,t.$isTabNode)(e))n.push((0,t.$createTabNode)()),e=e.getNextSibling();else{if(!Pr(e))break;{let t=0,r=e.getTextContent(),i=e.getTextContentSize();for(;t<i&&r[t]===` `;)t++;if(t!==0&&n.push(Nr(` `.repeat(t))),t!==i)break;e=e.getNextSibling()}}let i=a.splitText(r.offset)[0],o=r.offset===0?0:1,s=i.getIndexWithinParent()+o,c=a.getParentOrThrow(),l=[(0,t.$createLineBreakNode)(),...n];c.splice(s,0,l);let u=n[n.length-1];u?u.select():r.offset===0?i.selectPrevious():i.getNextSibling().selectNext(0,0)}if(Cr(a)){let{offset:n}=e.anchor;a.splice(n,0,[(0,t.$createLineBreakNode)()]),a.select(n+1,n+1)}return null}canIndent(){return!1}collapseAtStart(){let e=(0,t.$createParagraphNode)();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function Sr(e,n){return(0,t.$create)(xr).setLanguage(e).setTheme(n)}function Cr(e){return e instanceof xr}function wr(e){return{node:Sr(e.getAttribute(vr))}}function Tr(e){let t=e,n=Or(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(Or(t))return!0;t=t.parentElement}return!1}(t)?{node:n?Sr():null}:{node:null}}function Er(){return{node:Sr()}}function Dr(){return{node:null}}function Or(e){return e.style.fontFamily.match(`monospace`)!==null}function kr(e){return e.classList.contains(`js-file-line-container`)}function Ar(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type===`element`){let e=n.getNode();if(Cr(e)){let r=e.getChildrenSize();if(r>=2&&n.offset===r){let n=e.getLastChild();if((0,t.$isLineBreakNode)(n)&&(0,t.$isLineBreakNode)(n.getPreviousSibling())){let n=(0,t.$createParagraphNode)();return e.splice(r-2,2,[]).insertAfter(n,!1),n.select(),n}}}}return null}var jr=class e extends t.TextNode{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let n=super.createDOM(e);return(0,t.addClassNamesToElement)(n,Mr(e.theme,this.__highlightType)),n}updateDOM(e,n,r){let i=super.updateDOM(e,n,r),a=Mr(r.theme,e.__highlightType),o=Mr(r.theme,this.__highlightType);return a!==o&&(a&&(0,t.removeClassNamesFromElement)(n,a),o&&(0,t.addClassNamesToElement)(n,o)),i}static importJSON(e){return Nr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Sr()}};function Mr(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Nr(e=``,n){return(0,t.$applyNodeReplacement)(new jr(e,n))}function Pr(e){return e instanceof jr}(0,t.defineExtension)({name:`@lexical/code`,nodes:()=>[xr,jr],register:e=>e.registerCommand(t.KEY_ENTER_COMMAND,e=>{let n=(0,t.$getSelection)();return!(!(0,t.$isRangeSelection)(n)||!Ar(n))&&(e.preventDefault(),!0)},t.COMMAND_PRIORITY_LOW)});var Fr=`□`,Ir=`x + y = z`;function Lr(e,t,n){let r=Array.from(e||t||Fr).length,i=n?.includes(`rj-editor-equation-slot-input--limit`)||n?.includes(`rj-editor-equation-slot-input--matrix`)||n?.includes(`rj-editor-equation-slot-input--root-index`)||n?.includes(`rj-editor-equation-slot-input--script`)||n?.includes(`rj-editor-equation-slot-input--small`),a=i?2:2.5,o=i?5:11;return`calc(${Math.min(Math.max(r+1,a),o)}ch + 0.25rem)`}function Rr(e){return[`rj-editor-equation-visual`,`rj-editor-equation-visual--script`,e.position===`before`?`rj-editor-equation-visual--prescript`:``,e.superscript===void 0?``:`has-superscript`,e.subscript===void 0?``:`has-subscript`].filter(Boolean).join(` `)}function zr(e){e.stopPropagation()}function Br(e){let t=e.selectionStart??e.value.length;return{end:e.selectionEnd??t,start:t}}function Vr({className:e,inputRef:t,onActiveSlotChange:n,onSlotSelectionChange:r,onSlotChange:i,placeholder:a=Fr,slotId:o,value:s}){let c=e=>{zr(e),n(o),r(o,Br(e.currentTarget))};return(0,u.jsx)(`input`,{"aria-label":`Equation field`,className:[`rj-editor-equation-slot-input`,e||``].filter(Boolean).join(` `),onChange:e=>{i(o,e.target.value),r(o,Br(e.currentTarget))},onClick:c,onFocus:c,onKeyDown:zr,onKeyUp:c,onMouseDown:zr,onSelect:c,placeholder:a,ref:t,size:Math.max(1,Math.min(Array.from(s||a).length+1,12)),style:{width:Lr(s,a,e)},type:`text`,value:s})}function Hr(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function Ur(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function Wr(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}var Gr=A.default.memo(function e({activeSlotId:t,activeSlotSelection:n,model:r,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:s=``}){let c=A.default.useRef({}),l=A.default.useCallback(e=>t=>{c.current[e]=t},[]);A.default.useLayoutEffect(()=>{let e=c.current[t];if(!e)return;document.activeElement!==e&&e.focus();let r=Math.max(0,Math.min(n?.start??e.value.length,e.value.length)),i=Math.max(r,Math.min(n?.end??r,e.value.length));(e.selectionStart!==r||e.selectionEnd!==i)&&e.setSelectionRange(r,i)},[t,n,r]);let d=A.default.useCallback(e=>{let n=`${s}row.insert.${e}`;return(0,u.jsx)(`button`,{"aria-label":`Insert equation item`,className:[`rj-editor-equation-insert-point`,t===n?`is-active`:``].filter(Boolean).join(` `),onClick:e=>{e.preventDefault(),e.stopPropagation(),i(n)},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},type:`button`},n)},[t,i,s]),f=A.default.useCallback((r,c,d,f=Fr)=>{let p=`${s}${r}`;return c&&typeof c!=`string`?(0,u.jsx)(`span`,{className:`rj-editor-equation-nested`,children:(0,u.jsx)(e,{activeSlotId:t,activeSlotSelection:n,model:c,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:`${p}>`})},p):(0,u.jsx)(Vr,{className:d,inputRef:l(p),onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,placeholder:f,slotId:p,value:c||``},p)},[t,n,i,a,o,l,s]);if(r.kind===`accent`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--accent`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-accent-mark`,children:{bar:`¯`,dot:`˙`,doubleDot:`¨`,hat:`ˆ`,vector:`⃗`}[r.accent]}),f(`accent.value`,r.value)]});if(r.kind===`bracket`){let[e,t]=Hr(r.bracket);return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--bracket`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-bracket`,children:e}),f(`bracket.value`,r.value),(0,u.jsx)(`span`,{className:`rj-editor-equation-bracket`,children:t})]})}if(r.kind===`fraction`)return r.variant===`linear`||r.variant===`skewed`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--fraction-inline`,children:[f(`fraction.numerator`,r.numerator),(0,u.jsx)(`span`,{children:r.variant===`skewed`?`⁄`:`/`}),f(`fraction.denominator`,r.denominator)]}):(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--fraction`,children:[f(`fraction.numerator`,r.numerator),(0,u.jsx)(`span`,{className:`rj-editor-equation-fraction-line`}),f(`fraction.denominator`,r.denominator)]});if(r.kind===`function`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--function`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-function-name`,children:r.functionName}),(0,u.jsx)(`span`,{children:`(`}),f(`function.argument`,r.argument,void 0,`x`),(0,u.jsx)(`span`,{children:`)`})]});if(r.kind===`integral`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--integral`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[r.upper===void 0?(0,u.jsx)(`span`,{}):f(`integral.upper`,r.upper,`rj-editor-equation-slot-input--limit`,`b`),(0,u.jsx)(`span`,{className:`rj-editor-equation-large-symbol`,children:Wr(r.variant)}),r.lower===void 0?(0,u.jsx)(`span`,{}):f(`integral.lower`,r.lower,`rj-editor-equation-slot-input--limit`,`a`)]}),f(`integral.body`,r.body,void 0,`f(x)`),(0,u.jsx)(`span`,{children:`d`}),f(`integral.variable`,r.variable,`rj-editor-equation-slot-input--small`,`x`)]});if(r.kind===`largeOperator`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--large-operator`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[f(`largeOperator.upper`,r.upper,`rj-editor-equation-slot-input--limit`,`n`),(0,u.jsx)(`span`,{className:`rj-editor-equation-large-symbol`,children:Ur(r.operator)}),f(`largeOperator.lower`,r.lower,`rj-editor-equation-slot-input--limit`,`i=1`)]}),f(`largeOperator.body`,r.body,void 0,`i`)]});if(r.kind===`limit`)return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--limit`,children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-limits`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-function-name`,children:`lim`}),f(`limit.target`,r.target,`rj-editor-equation-slot-input--limit`,`x→0`)]}),f(`limit.body`,r.body,void 0,`f(x)`)]});if(r.kind===`matrix`){let e=(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-grid`,style:{gridTemplateColumns:`repeat(${Math.max(...r.cells.map(e=>e.length),1)}, minmax(1.75rem, auto))`},children:r.cells.flatMap((e,t)=>e.map((e,n)=>f(`matrix.cells.${t}.${n}`,e,`rj-editor-equation-slot-input--matrix`)))});if(r.bracket===`none`)return(0,u.jsx)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--matrix`,children:e});let[t,n]=r.bracket===`determinant`?[`|`,`|`]:r.bracket===`round`?[`(`,`)`]:[`[`,`]`];return(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--matrix`,children:[(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-bracket`,children:t}),e,(0,u.jsx)(`span`,{className:`rj-editor-equation-matrix-bracket`,children:n})]})}return r.kind===`operator`?(0,u.jsx)(`span`,{className:`rj-editor-equation-visual`,children:f(`operator.value`,r.value)}):r.kind===`root`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--root`,children:[r.index===void 0?null:f(`root.index`,r.index,`rj-editor-equation-slot-input--root-index`,`n`),(0,u.jsx)(`span`,{className:`rj-editor-equation-root-symbol`,children:`√`}),(0,u.jsx)(`span`,{className:`rj-editor-equation-radicand`,children:f(`root.value`,r.value,void 0,`x`)})]}):r.kind===`script`?r.position===`before`?(0,u.jsxs)(`span`,{className:Rr(r),children:[(0,u.jsxs)(`span`,{className:`rj-editor-equation-script-stack`,children:[r.superscript===void 0?null:f(`script.superscript`,r.superscript,`rj-editor-equation-slot-input--script`,`n`),r.subscript===void 0?null:f(`script.subscript`,r.subscript,`rj-editor-equation-slot-input--script`,`1`)]}),f(`script.base`,r.base,void 0,`Y`)]}):(0,u.jsxs)(`span`,{className:Rr(r),children:[f(`script.base`,r.base,void 0,`x`),(0,u.jsxs)(`span`,{className:`rj-editor-equation-script-stack`,children:[r.superscript===void 0?null:f(`script.superscript`,r.superscript,`rj-editor-equation-slot-input--script`,`2`),r.subscript===void 0?null:f(`script.subscript`,r.subscript,`rj-editor-equation-slot-input--script`,`i`)]})]}):r.kind===`row`?(0,u.jsxs)(`span`,{className:`rj-editor-equation-visual rj-editor-equation-visual--row`,children:[d(0),r.items.map((r,c)=>(0,u.jsxs)(A.default.Fragment,{children:[(0,u.jsx)(e,{activeSlotId:t,activeSlotSelection:n,model:r,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:`${s}row.items.${c}>`}),d(c+1)]},`${s}row.items.${c}`))]}):(0,u.jsx)(`span`,{className:`rj-editor-equation-visual`,children:f(`text.value`,r.value,void 0,s?Fr:Ir)})});function Kr(e,n){let r=(0,t.$getNodeByKey)(e);Zr(r)&&n(r)}var qr=A.default.memo(function({displayMode:e,equation:n,nodeKey:r}){let[i]=(0,h.useLexicalComposerContext)(),a=V(),o=A.default.useRef(``),s=A.default.useRef({}),c=A.default.useRef(null),[l,d]=A.default.useState(``),[f,p]=A.default.useState(),[m,_,v]=(0,g.useLexicalNodeSelection)(r),y=A.default.useMemo(()=>ve(n),[n]),b=A.default.useMemo(()=>n.trim()?kt(n,e):``,[e,n]),x=A.default.useMemo(()=>!y&&!/[\\{}_^]/.test(n),[n,y]),S=A.default.useCallback(t=>{i.update(()=>{Kr(r,e=>{Zr(e)&&e.setEquation(t)})}),a(Ft({isEquationSelected:!0,selectedEquation:t,selectedEquationDisplayMode:e,selectedEquationKey:r}))},[a,e,i,r]),C=A.default.useCallback((e,t)=>{o.current=e,t&&(s.current[e]=t),d(e),p(t)},[]),w=A.default.useCallback((e,t)=>{s.current[e]=t,C(e,t)},[C]),T=A.default.useCallback(e=>{S(ye(e))},[S]),E=A.default.useCallback((e,t)=>{y&&T(N(y,e,t))},[y,T]),D=A.default.useCallback(()=>{v(),_(!0),y&&C(o.current||I(y)),a(Ft({isEquationSelected:!0,selectedEquation:n,selectedEquationDisplayMode:e,selectedEquationKey:r})),window.requestAnimationFrame(()=>{c.current?.focus()})},[v,a,e,n,y,r,C,_]);return A.default.useEffect(()=>{!m||!y||o.current||C(I(y))},[y,m,C]),A.default.useEffect(()=>{if(!m)return;let e=i.registerCommand(t.KEY_DELETE_COMMAND,e=>e.target instanceof HTMLInputElement?!1:(e.preventDefault(),i.update(()=>{Kr(r,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW),n=i.registerCommand(t.KEY_BACKSPACE_COMMAND,e=>e.target instanceof HTMLInputElement?!1:(e.preventDefault(),i.update(()=>{Kr(r,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[i,m,r]),A.default.useEffect(()=>{if(!m)return;let e=e=>{let t=e.detail;if(!t)return;let r=ve(t);if(r){if(y){let e=o.current||I(y),t=Me(y,e,r,s.current[e]);C(t.activeSlotId),T(t.model);return}C(I(r)),T(r);return}if(y){let e=o.current||I(y),n=fe(y,e,t,s.current[e]);C(n.activeSlotId,n.selection),T(n.model);return}let i=c.current;if(!i){S(`${n}${t}`);return}let a=i.selectionStart??i.value.length,l=i.selectionEnd??a,u=`${i.value.slice(0,a)}${t}${i.value.slice(l)}`,d=a+t.length;S(u),window.requestAnimationFrame(()=>{i.focus(),i.setSelectionRange(d,d)})};return window.addEventListener(Fe,e),()=>{window.removeEventListener(Fe,e)}},[n,y,m,C,T,S]),(0,u.jsx)(`span`,{className:[`rj-editor-equation`,`rj-editor-equation--${e}`,m?`is-selected`:``].filter(Boolean).join(` `),"data-display-mode":e,"data-equation":n,onClick:e=>{e.preventDefault(),e.stopPropagation(),D()},role:`button`,tabIndex:-1,children:m?(0,u.jsxs)(`span`,{className:`rj-editor-equation-editor`,children:[y?(0,u.jsx)(Gr,{activeSlotId:l||I(y),activeSlotSelection:f,model:y,onActiveSlotChange:C,onSlotSelectionChange:w,onSlotChange:E}):x?(0,u.jsx)(`input`,{"aria-label":`Formula value`,onChange:e=>S(e.target.value),onClick:e=>{e.stopPropagation()},onFocus:()=>{C(``)},onKeyDown:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},placeholder:`x + y = z`,ref:c,type:`text`,value:n}):(0,u.jsx)(`span`,{className:`rj-editor-equation-visual-editor`,dangerouslySetInnerHTML:{__html:b}}),n.trim()&&x?(0,u.jsx)(`span`,{className:`rj-editor-equation-content`,dangerouslySetInnerHTML:{__html:b}}):null]}):(0,u.jsx)(`span`,{className:[`rj-editor-equation-content`,n.trim()?``:`is-empty`].filter(Boolean).join(` `),dangerouslySetInnerHTML:{__html:b||`<span>Formula qo‘shing</span>`}})})});function Jr(e){let t=e.getAttribute(`data-equation`);return t?{node:Xr({displayMode:e.getAttribute(`data-display-mode`)===`inline`?`inline`:`block`,equation:t})}:null}var Yr=class e extends t.DecoratorNode{__displayMode;__equation;static clone(t){return new e(t.__equation,t.__displayMode,t.__key)}static getType(){return`equation`}static importDOM(){return{div:e=>e.hasAttribute(`data-equation`)?{conversion:Jr,priority:1}:null,span:e=>e.hasAttribute(`data-equation`)?{conversion:Jr,priority:1}:null}}static importJSON(e){return Xr({displayMode:e.displayMode,equation:e.equation})}constructor(e,t=`block`,n){super(n),this.__equation=e,this.__displayMode=t}createDOM(e){let t=document.createElement(`span`);return t.className=e.theme.equation||`rj-editor-equation-node`,t}decorate(){return(0,u.jsx)(qr,{displayMode:this.__displayMode,equation:this.__equation,nodeKey:this.__key})}exportDOM(){let e=this.__displayMode===`inline`?document.createElement(`span`):document.createElement(`div`);e.setAttribute(`data-equation`,this.__equation),e.setAttribute(`data-display-mode`,this.__displayMode);try{e.innerHTML=kt(this.__equation,this.__displayMode)}catch{e.textContent=this.__equation}return{element:e}}exportJSON(){return{displayMode:this.__displayMode,equation:this.__equation,type:`equation`,version:1}}getDisplayMode(){return this.getLatest().__displayMode}getEquation(){return this.getLatest().__equation}getTextContent(){return this.__equation}isInline(){return this.getLatest().__displayMode===`inline`}setDisplayMode(e){let t=this.getWritable();return t.__displayMode=e,t}setEquation(e){let t=this.getWritable();return t.__equation=e,t}updateDOM(){return!1}};function Xr({displayMode:e=`block`,equation:t}){return new Yr(t,e)}function Zr(e){return e instanceof Yr}var Qr=[`b`,`code`,`em`,`font`,`i`,`mark`,`s`,`span`,`strong`,`sub`,`sup`,`u`];function $r(e){let t=[],n=e.style.backgroundColor,r=e.style.color||e.getAttribute(`color`)||``,i=Ke(e.style.fontFamily||e.getAttribute(`face`)||``),a=Je(e.style.fontSize),o=e.style.lineHeight;return n&&t.push(`background-color: ${n}`),r&&t.push(`color: ${r}`),i&&t.push(`font-family: ${i}`),a&&t.push(`font-size: ${a}`),o&&t.push(`line-height: ${o}`),t.join(`; `)}function ei(e,t){return e?t?`${e}; ${t}`:e:t}function ti(e){return e?{...e,conversion:n=>{let r=e.conversion(n);if(!r)return r;let i=r.forChild,a=$r(n),o=n.tagName.toLowerCase()===`code`;return!a&&!o?r:{...r,forChild:(e,n)=>{let r=i?i(e,n):e;return(0,t.$isTextNode)(r)&&(a&&r.setStyle(ei(r.getStyle(),a)),o&&!r.hasFormat(`code`)&&r.toggleFormat(`code`)),r}}}}:null}function ni(e,t){return t.setDetail(e.getDetail()),t.setFormat(e.getFormat()),t.setMode(e.getMode()),t.setStyle(e.getStyle()),t}var ri=class e extends t.TextNode{static clone(t){return new e(t.__text,t.__key)}static getType(){return`extended-text`}static importDOM(){let e=t.TextNode.importDOM();if(!e)return null;let n={...e};return Qr.forEach(t=>{let r=e[t];r&&(n[t]=e=>ti(r(e)))}),n}static importJSON(e){return ii(e.text).updateFromJSON(e)}constructor(e=``,t){super(e,t)}exportJSON(){return{...super.exportJSON(),type:`extended-text`,version:1}}};function ii(e=``){return new ri(e)}function ai(e){return ni(e,ii(e.getTextContent()))}function oi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 10H6M21 6H3M21 14H3M18 18H6`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function si(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M16 10H3M20 6H3M20 14H3M16 18H3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ci(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H8M21 6H4M21 14H4M21 18H8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function li(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var ui=A.default.createContext(bt);function di(){return A.default.useContext(ui)}function fi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M8.54661 19.7675C10.9457 20.8319 13.8032 20.7741 16.2502 19.3613C20.3157 17.0141 21.7086 11.8156 19.3614 7.75008L19.1114 7.31706M4.63851 16.2502C2.2913 12.1847 3.68424 6.98619 7.74972 4.63898C10.1967 3.22621 13.0542 3.16841 15.4533 4.23277M2.49341 16.3338L5.22546 17.0659L5.95751 14.3338M18.0426 9.6659L18.7747 6.93385L21.5067 7.6659`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var pi=100,mi=2e3,hi=10,gi=32,_i=42,vi=340,yi=12,bi=[`top-left`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`];function xi(e,n){let r=(0,t.$getNodeByKey)(e);Y(r)&&n(r)}function Si(e,t){let n=t?.getBoundingClientRect();if(!n)return{x:8,y:8};let r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(8,n.width-vi-8),o=Math.max(8,n.height-_i-8),s=r+yi,c=i+yi;return{x:Math.min(Math.max(s,8),a),y:Math.max(c>o?i-_i-yi:c,8)}}function Ci({alignment:e,altText:n,aspectRatioLocked:r,borderEnabled:i,borderRadius:a,caption:o,height:s,linkUrl:c,nodeKey:l,objectFit:d,rotation:f,shadowEnabled:p,src:m,textWrap:_,width:v}){let[y]=(0,h.useLexicalComposerContext)(),b=U(),x=di(),S=V(),[C,w,T]=(0,g.useLexicalNodeSelection)(l),E=A.default.useRef(null),D=A.default.useRef(null),O=A.default.useRef(null),[k,ee]=A.default.useState({x:0,y:0}),[te,ne]=A.default.useState(0),[re,ie]=A.default.useState(1),[ae,oe]=A.default.useState(!1),j=(f%360+360)%360,M=j===90||j===270,se=_===`square`&&e!==`center`;A.default.useEffect(()=>{let e=D.current?.parentElement;if(!e)return;let t=()=>{ne(e.getBoundingClientRect().width)};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>{window.removeEventListener(`resize`,t)};let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[]),A.default.useEffect(()=>{if(!C)return;let e=y.registerCommand(t.KEY_DELETE_COMMAND,e=>(e.preventDefault(),y.update(()=>{xi(l,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW),n=y.registerCommand(t.KEY_BACKSPACE_COMMAND,e=>(e.preventDefault(),y.update(()=>{xi(l,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[y,C,l]);let ce=e=>{y.update(()=>{xi(l,t=>{Y(t)&&t.setAlignment(e)})})},N=e=>{y.update(()=>{xi(l,t=>{Y(t)&&t.setWidth(Math.min(pi,Math.max(hi,e)))})})},le=(e,t)=>{y.update(()=>{xi(l,n=>{Y(n)&&(n.setWidth(Math.min(pi,Math.max(hi,e))),n.setHeight(t===void 0?void 0:Math.min(mi,Math.max(gi,t))))})}),w(!0)},ue=(e,t)=>{e.preventDefault(),e.stopPropagation(),w(!0);let n=D.current?.getBoundingClientRect(),r=D.current?.parentElement?.getBoundingClientRect()||n,i=O.current?.getBoundingClientRect();if(!r?.width||!i?.width||!i?.height)return;let a=e.clientX,o=e.clientY,c=v,l=s??i.height,u=i.width/i.height,d=e=>{let n=e.clientX-a,s=e.clientY-o,d=t.includes(`right`)?n:t.includes(`left`)?-n:0,f=t.includes(`bottom`)?s:t.includes(`top`)?-s:0;if(e.shiftKey){let e=Math.abs(d)>=Math.abs(f*u)?d:f*u,t=i.width+e;le(c+e/r.width*100,t/u);return}le(d===0?c:c+d/r.width*100,f===0?l:l+f)},f=()=>{window.removeEventListener(`pointermove`,d),window.removeEventListener(`pointerup`,f),y.focus(),window.requestAnimationFrame(()=>{w(!0)})};window.addEventListener(`pointermove`,d),window.addEventListener(`pointerup`,f)},de=()=>{y.update(()=>{xi(l,e=>{e?.remove()})})},fe=async e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(!t.type.startsWith(`image/`)){window.alert(b.alerts.onlyImages);return}if(t.size>5242880){window.alert(b.alerts.imageSizeLimit);return}let n=``;try{oe(!0),n=await x(t)}catch(e){console.error(e),window.alert(b.alerts.imageUploadFailed);return}finally{oe(!1)}y.update(()=>{xi(l,e=>{Y(e)&&(e.setSrc(n),e.setAltText(t.name))})})},P=te>0?te*v/100:void 0,pe=s??(P?P/re:void 0),me=M&&pe?pe:void 0,he=M&&P?P:void 0,ge={"--rj-image-rotated-aspect-ratio":`1 / ${re}`,height:he?R(he):void 0,width:M&&me?R(me):se?`100%`:`${v}%`},_e=se?{maxWidth:`100%`,width:M&&me?R(me):`${v}%`}:void 0,ve=(0,u.jsx)(`img`,{alt:n,className:`rj-editor-image`,draggable:!1,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&ie(t.naturalWidth/t.naturalHeight)},ref:O,src:m,style:{borderRadius:a,height:s?R(s):void 0,objectFit:d}}),ye={"--rj-image-rotation":`${f}deg`,height:M&&pe?R(pe):void 0,width:M&&P?R(P):void 0};return(0,u.jsxs)(`span`,{className:[`rj-editor-image-frame`,`rj-editor-image-frame--${e}`,`rj-editor-image-frame--wrap-${_}`,C?`is-selected`:``].filter(Boolean).join(` `),ref:D,style:_e,children:[C?(0,u.jsxs)(`span`,{className:`rj-editor-image-floating-toolbar`,onClick:e=>{e.stopPropagation()},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},style:{left:k.x,top:k.y},children:[(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.alignLeft,onClick:()=>ce(`left`),type:`button`,children:(0,u.jsx)(si,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.alignCenter,onClick:()=>ce(`center`),type:`button`,children:(0,u.jsx)(oi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.alignRight,onClick:()=>ce(`right`),type:`button`,children:(0,u.jsx)(ci,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{onClick:()=>N(25),type:`button`,children:`25%`}),(0,u.jsx)(`button`,{onClick:()=>N(50),type:`button`,children:`50%`}),(0,u.jsx)(`button`,{onClick:()=>N(100),type:`button`,children:`100%`}),(0,u.jsx)(`button`,{"aria-busy":ae,"aria-label":b.toolbar.image.replace,disabled:ae,onClick:()=>void yt(E.current),type:`button`,children:(0,u.jsx)(fi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,onClick:de,type:`button`,children:(0,u.jsx)(li,{"aria-hidden":`true`})})]}):null,(0,u.jsxs)(`span`,{className:[`rj-editor-image-box`,i?`has-border`:``,p?`has-shadow`:``,r?`is-aspect-ratio-locked`:``,M?`is-quarter-turn`:``].filter(Boolean).join(` `),onClick:t=>{t.preventDefault(),t.stopPropagation(),T(),w(!0),ee(Si(t,D.current)),S(It({isImageSelected:!0,selectedImageAlignment:e,selectedImageAltText:n,selectedImageAspectRatioLocked:r,selectedImageBorderEnabled:i,selectedImageBorderRadius:a,selectedImageCaption:o,selectedImageHeight:s,selectedImageKey:l,selectedImageLinkUrl:c,selectedImageObjectFit:d,selectedImageRotation:f,selectedImageShadowEnabled:p,selectedImageTextWrap:_,selectedImageWidth:v}))},style:ge,children:[(0,u.jsx)(`span`,{className:`rj-editor-image-rotator`,style:ye,children:c?(0,u.jsx)(`a`,{className:`rj-editor-image-link`,href:c,rel:`noreferrer`,target:`_blank`,children:ve}):ve}),o?(0,u.jsx)(`span`,{className:`rj-editor-image-caption`,children:o}):null,C?(0,u.jsx)(u.Fragment,{children:bi.map(e=>(0,u.jsx)(`span`,{"aria-hidden":`true`,className:[`rj-editor-image-resize-handle`,`rj-editor-image-resize-handle--${e}`].join(` `),onPointerDown:t=>ue(t,e)},e))}):null]}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:fe,ref:E,type:`file`})]})}function wi(e){return e===`square`||e===`around`?`square`:`top-bottom`}function Ti(e){return e===`left`||e===`right`||e===`center`?e:`center`}function Ei(e){return e===`cover`||e===`fill`||e===`contain`?e:`contain`}function Di(e){let t=Number.parseFloat(e||``);return Number.isFinite(t)?t:void 0}function Oi(e){let t=Di(e.getAttribute(`data-width`));if(t!==void 0)return t;let n=e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`),r=Di(n?.style.width);if(r!==void 0&&n?.style.width.includes(`%`))return r;let i=Di(e.style.width);return i!==void 0&&e.style.width.includes(`%`)?i:100}function ki(e){let t=e.getAttribute(`data-alignment`);if(t)return Ti(t);let n=e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e;return n.style.float===`left`?`left`:n.style.float===`right`||n.style.marginLeft===`auto`&&[`0`,`0rem`].includes(n.style.marginRight)?`right`:[`0`,`0rem`].includes(n.style.marginLeft)&&n.style.marginRight===`auto`?`left`:`center`}function Ai(e){let t=e.getAttribute(`data-text-wrap`);return t?wi(t):(e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e).style.float?`square`:`top-bottom`}function ji(e){return e.getAttribute(`data-caption`)||e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)?.querySelector(`.rj-editor-image-caption`)?.textContent||``}function Mi(e){return e.getAttribute(`data-link-url`)||e.closest(`a`)?.href||``}function Ni(e){if(!(e instanceof HTMLImageElement))return null;let t=e.getAttribute(`src`);return t?{node:Ii({alignment:ki(e),altText:e.getAttribute(`alt`)||``,aspectRatioLocked:e.getAttribute(`data-aspect-ratio-locked`)!==`false`,borderEnabled:!!e.style.border,borderRadius:Di(e.style.borderRadius)||0,caption:ji(e),height:Di(e.getAttribute(`data-height`))||Di(e.style.height),linkUrl:Mi(e),objectFit:Ei(e.getAttribute(`data-object-fit`)||e.style.objectFit),rotation:Di(e.getAttribute(`data-rotation`))||0,shadowEnabled:!!e.style.boxShadow,src:t,textWrap:Ai(e),width:Oi(e)})}:null}function Pi(e){let t=e.querySelector(`img`);return t?Ni(t):null}var Fi=class e extends t.DecoratorNode{__alignment;__aspectRatioLocked;__altText;__borderEnabled;__borderRadius;__caption;__height;__linkUrl;__objectFit;__rotation;__shadowEnabled;__src;__textWrap;__width;static clone(t){return new e(t.__src,t.__altText,t.__width,t.__alignment,t.__caption,t.__height,t.__linkUrl,t.__objectFit,t.__textWrap,t.__borderRadius,t.__borderEnabled,t.__shadowEnabled,t.__rotation,t.__aspectRatioLocked,t.__key)}static getType(){return`image`}static importDOM(){return{a:e=>!(e instanceof HTMLAnchorElement)||!e.querySelector(`img`)?null:{conversion:Pi,priority:2},img:()=>({conversion:Ni,priority:0}),span:e=>!(e instanceof HTMLElement)||e.getAttribute(`data-rj-image-caption-wrapper`)!==`true`&&e.getAttribute(`data-rj-image-rotation-wrapper`)!==`true`?null:{conversion:Pi,priority:2}}}static importJSON(e){return Ii({alignment:e.alignment,altText:e.altText,aspectRatioLocked:e.aspectRatioLocked,borderEnabled:e.borderEnabled,borderRadius:e.borderRadius,caption:e.caption,height:e.height,linkUrl:e.linkUrl,objectFit:e.objectFit,rotation:e.rotation,shadowEnabled:e.shadowEnabled,src:e.src,textWrap:wi(e.textWrap),width:e.width})}constructor(e,t=``,n=100,r=`center`,i=``,a,o=``,s=`contain`,c=`top-bottom`,l=0,u=!1,d=!1,f=0,p=!0,m){super(m),this.__src=e,this.__altText=t,this.__width=n,this.__alignment=r,this.__caption=i,this.__height=a,this.__linkUrl=o,this.__objectFit=s,this.__textWrap=c,this.__borderRadius=l,this.__borderEnabled=u,this.__shadowEnabled=d,this.__rotation=f,this.__aspectRatioLocked=p}createDOM(e){let t=document.createElement(`span`);return t.className=e.theme.image||`rj-editor-image-node`,t}decorate(){return(0,u.jsx)(Ci,{alignment:this.__alignment,altText:this.__altText,aspectRatioLocked:this.__aspectRatioLocked,borderEnabled:this.__borderEnabled,borderRadius:this.__borderRadius,caption:this.__caption,height:this.__height,linkUrl:this.__linkUrl,nodeKey:this.__key,objectFit:this.__objectFit,rotation:this.__rotation,shadowEnabled:this.__shadowEnabled,src:this.__src,textWrap:this.__textWrap,width:this.__width})}exportDOM(){let e=document.createElement(`img`);return e.setAttribute(`src`,this.__src),this.__altText&&e.setAttribute(`alt`,this.__altText),e.setAttribute(`data-alignment`,this.__alignment),e.setAttribute(`data-caption`,this.__caption),e.setAttribute(`data-height`,this.__height?String(this.__height):``),e.setAttribute(`data-link-url`,this.__linkUrl),e.setAttribute(`data-object-fit`,this.__objectFit),e.setAttribute(`data-rj-image-node-key`,this.__key),e.setAttribute(`data-rotation`,String(this.__rotation)),e.setAttribute(`data-text-wrap`,this.__textWrap),e.setAttribute(`data-width`,String(this.__width)),e.setAttribute(`data-aspect-ratio-locked`,String(this.__aspectRatioLocked)),e.style.display=`block`,e.style.borderRadius=R(this.__borderRadius),e.style.maxWidth=`100%`,e.style.objectFit=this.__objectFit,e.style.transform=`rotate(${this.__rotation}deg)`,e.style.width=`${this.__width}%`,this.__textWrap===`square`&&this.__alignment===`left`&&(e.style.float=`left`,e.style.margin=`0.25rem 1rem 0.625rem 0`),this.__textWrap===`square`&&this.__alignment===`right`&&(e.style.float=`right`,e.style.margin=`0.25rem 0 0.625rem 1rem`),this.__textWrap!==`square`&&this.__alignment===`center`&&(e.style.marginLeft=`auto`,e.style.marginRight=`auto`),this.__textWrap!==`square`&&this.__alignment===`right`&&(e.style.marginLeft=`auto`,e.style.marginRight=`0`),this.__textWrap!==`square`&&this.__alignment===`left`&&(e.style.marginLeft=`0`,e.style.marginRight=`auto`),this.__borderEnabled&&(e.style.border=`0.0625rem solid var(--rj-editor-image-border, #94a3b8)`),this.__shadowEnabled&&(e.style.boxShadow=`var(--rj-editor-image-shadow, 0 0.875rem 2rem rgb(15 23 42 / 18%))`),this.__height&&(e.style.height=R(this.__height)),{element:e}}exportJSON(){return{alignment:this.__alignment,aspectRatioLocked:this.__aspectRatioLocked,altText:this.__altText,borderEnabled:this.__borderEnabled,borderRadius:this.__borderRadius,caption:this.__caption,height:this.__height,linkUrl:this.__linkUrl,objectFit:this.__objectFit,rotation:this.__rotation,shadowEnabled:this.__shadowEnabled,src:this.__src,textWrap:this.__textWrap,type:`image`,version:1,width:this.__width}}getAlignment(){return this.getLatest().__alignment}getAltText(){return this.getLatest().__altText}getAspectRatioLocked(){return this.getLatest().__aspectRatioLocked}getBorderEnabled(){return this.getLatest().__borderEnabled}getBorderRadius(){return this.getLatest().__borderRadius}getCaption(){return this.getLatest().__caption}getLinkUrl(){return this.getLatest().__linkUrl}getHeight(){return this.getLatest().__height}getObjectFit(){return this.getLatest().__objectFit}getRotation(){return this.getLatest().__rotation}getShadowEnabled(){return this.getLatest().__shadowEnabled}getSrc(){return this.getLatest().__src}getTextWrap(){return this.getLatest().__textWrap}getWidth(){return this.getLatest().__width}setAlignment(e){let t=this.getWritable();return t.__alignment=e,t}setAltText(e){let t=this.getWritable();return t.__altText=e,t}setAspectRatioLocked(e){let t=this.getWritable();return t.__aspectRatioLocked=e,t}setBorderEnabled(e){let t=this.getWritable();return t.__borderEnabled=e,t}setBorderRadius(e){let t=this.getWritable();return t.__borderRadius=e,t}setCaption(e){let t=this.getWritable();return t.__caption=e,t}setLinkUrl(e){let t=this.getWritable();return t.__linkUrl=e,t}setHeight(e){let t=this.getWritable();return t.__height=e,t}setObjectFit(e){let t=this.getWritable();return t.__objectFit=e,t}setRotation(e){let t=this.getWritable();return t.__rotation=e,t}setShadowEnabled(e){let t=this.getWritable();return t.__shadowEnabled=e,t}setSrc(e){let t=this.getWritable();return t.__src=e,t}setTextWrap(e){let t=this.getWritable();return t.__textWrap=e,t}setWidth(e){let t=this.getWritable();return t.__width=e,t}getTextContent(){return this.__altText}isInline(){return!1}updateDOM(){return!1}};function Ii({alignment:e,aspectRatioLocked:t,altText:n,borderEnabled:r,borderRadius:i,caption:a,height:o,linkUrl:s,objectFit:c,rotation:l,shadowEnabled:u,src:d,textWrap:f,width:p}){return new Fi(d,n,p,e,a,o,s,c,f,i,r,u,l,t)}function Y(e){return e instanceof Fi}function Li(e){let n=(0,t.$getNodeByKey)(e);Hi(n)&&n.remove()}var Ri=A.default.memo(function({nodeKey:e,title:n,videoId:r}){let[i]=(0,h.useLexicalComposerContext)(),[a,o,s]=(0,g.useLexicalNodeSelection)(e),c=n||`YouTube video`;return A.default.useEffect(()=>{if(!a)return;let n=i.registerCommand(t.KEY_DELETE_COMMAND,t=>(t.preventDefault(),i.update(()=>Li(e)),!0),t.COMMAND_PRIORITY_LOW),r=i.registerCommand(t.KEY_BACKSPACE_COMMAND,t=>(t.preventDefault(),i.update(()=>Li(e)),!0),t.COMMAND_PRIORITY_LOW);return()=>{n(),r()}},[i,a,e]),(0,u.jsx)(`div`,{className:[`rj-editor-youtube`,a?`is-selected`:``].filter(Boolean).join(` `),onClick:e=>{e.preventDefault(),e.stopPropagation(),s(),o(!0)},role:`presentation`,children:(0,u.jsx)(`iframe`,{allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`,allowFullScreen:!0,loading:`lazy`,referrerPolicy:`strict-origin-when-cross-origin`,src:`https://www.youtube-nocookie.com/embed/${r}`,title:c})})});function zi(e){let t=Te(e.getAttribute(`data-youtube-video-id`)||e.getAttribute(`src`)||``);return t?{node:Vi({title:e.getAttribute(`title`)||``,videoId:t})}:null}var Bi=class e extends t.DecoratorNode{__title;__videoId;static clone(t){return new e(t.__videoId,t.__title,t.__key)}static getType(){return`youtube`}static importDOM(){return{iframe:e=>Te(e.getAttribute(`src`)||``)?{conversion:zi,priority:1}:null}}static importJSON(e){return Vi({title:e.title,videoId:e.videoId})}constructor(e,t=``,n){super(n),this.__videoId=e,this.__title=t}createDOM(e){let t=document.createElement(`div`);return t.className=e.theme.youtube||`rj-editor-youtube-node`,t}decorate(){return(0,u.jsx)(Ri,{nodeKey:this.__key,title:this.__title,videoId:this.__videoId})}exportDOM(){let e=document.createElement(`div`),t=document.createElement(`iframe`);return e.className=`rj-editor-youtube`,e.style.aspectRatio=`16 / 9`,e.style.background=`var(--rj-editor-toolbar-bg, #f8fafc)`,e.style.border=`0.0625rem solid var(--rj-editor-border, #d9dde5)`,e.style.borderRadius=`0.5rem`,e.style.maxWidth=`45rem`,e.style.overflow=`hidden`,e.style.width=`100%`,t.setAttribute(`allow`,`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share`),t.setAttribute(`allowfullscreen`,`true`),t.setAttribute(`data-youtube-video-id`,this.__videoId),t.setAttribute(`loading`,`lazy`),t.setAttribute(`referrerpolicy`,`strict-origin-when-cross-origin`),t.setAttribute(`src`,`https://www.youtube-nocookie.com/embed/${this.__videoId}`),t.setAttribute(`title`,this.__title||`YouTube video`),t.style.border=`0`,t.style.display=`block`,t.style.height=`100%`,t.style.width=`100%`,e.append(t),{element:e}}exportJSON(){return{title:this.__title,type:`youtube`,version:1,videoId:this.__videoId}}getTextContent(){return`https://www.youtube.com/watch?v=${this.__videoId}`}getTitle(){return this.getLatest().__title}getVideoId(){return this.getLatest().__videoId}isInline(){return!1}setTitle(e){let t=this.getWritable();return t.__title=e,t}updateDOM(){return!1}};function Vi({title:e=``,videoId:t}){return new Bi(t,e)}function Hi(e){return e instanceof Bi}var Ui={code:`rj-editor-code-block`,codeHighlight:{atrule:`rj-editor-code-token-atrule`,attr:`rj-editor-code-token-attr`,"attr-name":`rj-editor-code-token-attr`,"attr-value":`rj-editor-code-token-string`,boolean:`rj-editor-code-token-boolean`,builtin:`rj-editor-code-token-builtin`,char:`rj-editor-code-token-char`,class:`rj-editor-code-token-class`,"class-name":`rj-editor-code-token-class-name`,comment:`rj-editor-code-token-comment`,constant:`rj-editor-code-token-constant`,deleted:`rj-editor-code-token-deleted`,entity:`rj-editor-code-token-entity`,function:`rj-editor-code-token-function`,important:`rj-editor-code-token-important`,inserted:`rj-editor-code-token-inserted`,keyword:`rj-editor-code-token-keyword`,namespace:`rj-editor-code-token-namespace`,number:`rj-editor-code-token-number`,operator:`rj-editor-code-token-operator`,prolog:`rj-editor-code-token-comment`,property:`rj-editor-code-token-property`,punctuation:`rj-editor-code-token-punctuation`,regex:`rj-editor-code-token-regex`,selector:`rj-editor-code-token-selector`,string:`rj-editor-code-token-string`,symbol:`rj-editor-code-token-symbol`,tag:`rj-editor-code-token-tag`,url:`rj-editor-code-token-url`,variable:`rj-editor-code-token-variable`},paragraph:`rj-editor-paragraph`,text:{bold:`rj-editor-text-bold`,code:`rj-editor-text-code`,italic:`rj-editor-text-italic`,strikethrough:`rj-editor-text-strikethrough`,subscript:`rj-editor-text-subscript`,superscript:`rj-editor-text-superscript`,underline:`rj-editor-text-underline`},list:{ol:`rj-editor-list-ol`,ul:`rj-editor-list-ul`,listitem:`rj-editor-list-item`},equation:`rj-editor-equation-node`,image:`rj-editor-image-node`,youtube:`rj-editor-youtube-node`,table:`rj-editor-table`,tableCell:`rj-editor-table-cell`,tableCellHeader:`rj-editor-table-cell-header`,tableCellSelected:`rj-editor-table-cell-selected`,tableRow:`rj-editor-table-row`,tableScrollableWrapper:`rj-editor-table-scrollable-wrapper`,tableSelection:`rj-editor-table-selection`};function Wi({defaultValue:e,namespace:n,value:r}){return{namespace:n,nodes:[xr,jr,ri,{replace:t.TextNode,with:ai,withKlass:ri},Yr,Fi,Bi,d.LinkNode,f.ListNode,f.ListItemNode,p.TableCellNode,p.TableNode,p.TableRowNode],onError(e){throw e},editorState:r||e?t=>At(t,r||e||``):void 0,theme:Ui}}function Gi({children:e,onImageUpload:t}){return(0,u.jsx)(ui.Provider,{value:t||bt,children:e})}function Ki(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 9L12 15L18 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function qi(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M5 15C4.06812 15 3.60218 15 3.23463 14.8478C2.74458 14.6448 2.35523 14.2554 2.15224 13.7654C2 13.3978 2 12.9319 2 12V5.2C2 4.0799 2 3.51984 2.21799 3.09202C2.40973 2.71569 2.71569 2.40973 3.09202 2.21799C3.51984 2 4.0799 2 5.2 2H12C12.9319 2 13.3978 2 13.7654 2.15224C14.2554 2.35523 14.6448 2.74458 14.8478 3.23463C15 3.60218 15 4.06812 15 5M12.2 22H18.8C19.9201 22 20.4802 22 20.908 21.782C21.2843 21.5903 21.5903 21.2843 21.782 20.908C22 20.4802 22 19.9201 22 18.8V12.2C22 11.0799 22 10.5198 21.782 10.092C21.5903 9.71569 21.2843 9.40973 20.908 9.21799C20.4802 9 19.9201 9 18.8 9H12.2C11.0799 9 10.5198 9 10.092 9.21799C9.71569 9.40973 9.40973 9.71569 9.21799 10.092C9 10.5198 9 11.0799 9 12.2V18.8C9 19.9201 9 20.4802 9.21799 20.908C9.40973 21.2843 9.71569 21.5903 10.092 21.782C10.5198 22 11.0799 22 12.2 22Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Ji=190,Yi=8,Xi=[{label:`Plain Text`,value:`plain`},{label:`C`,value:`c`},{label:`C++`,value:`cpp`},{label:`CSS`,value:`css`},{label:`HTML`,value:`html`},{label:`Java`,value:`java`},{label:`JavaScript`,value:`js`},{label:`Markdown`,value:`markdown`},{label:`Objective-C`,value:`objc`},{label:`PowerShell`,value:`powershell`},{label:`Python`,value:`py`},{label:`Rust`,value:`rust`},{label:`SQL`,value:`sql`},{label:`Swift`,value:`swift`},{label:`TypeScript`,value:`typescript`},{label:`XML`,value:`xml`}],Zi={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#181818`,colorBgElevated:`#202020`,colorBorder:`#4a4a4a`,colorFillSecondary:`#303030`,colorPrimary:`#b8b8b8`,colorText:`#ededed`,colorTextPlaceholder:`#8f8f8f`,colorTextSecondary:`#b8b8b8`}};function Qi({editor:e,language:n,nodeKey:r}){let i=U(),a=A.default.useRef(null),[s,c]=A.default.useState(!1),[l,d]=A.default.useState({left:0,top:0,visible:!1}),f=A.default.useCallback(()=>{let t=e.getElementByKey(r),n=e.getRootElement()?.closest(`.rj-editor-body`);if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)){d(e=>e.visible?{...e,visible:!1}:e);return}let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),s=a.current?.getBoundingClientRect().width||Ji,c=Math.max(Yi,i.width-s-Yi),l=o.right-i.left-s-Yi,u={left:Math.min(Math.max(l,Yi),c),top:Math.max(o.top-i.top+Yi,Yi),visible:!0};d(e=>e.left===u.left&&e.top===u.top&&e.visible===u.visible?e:u)},[e,r]);A.default.useEffect(()=>{let t=window.requestAnimationFrame(f),n=e.getElementByKey(r),i=e.getRootElement()?.closest(`.rj-editor-body`),o=typeof ResizeObserver>`u`?null:new ResizeObserver(f);return n&&o?.observe(n),i&&o?.observe(i),a.current&&o?.observe(a.current),window.addEventListener(`resize`,f),document.addEventListener(`scroll`,f,!0),()=>{window.cancelAnimationFrame(t),o?.disconnect(),window.removeEventListener(`resize`,f),document.removeEventListener(`scroll`,f,!0)}},[e,r,f]),A.default.useEffect(()=>{if(!s)return;let e=window.setTimeout(()=>c(!1),1600);return()=>window.clearTimeout(e)},[s]);let p=async()=>{let n=``;e.getEditorState().read(()=>{let e=(0,t.$getNodeByKey)(r);Cr(e)&&(n=e.getTextContent())}),await pe(n),c(!0)};return l.visible?(0,u.jsxs)(`div`,{className:`rj-editor-code-block-actions`,contentEditable:!1,onMouseDown:e=>e.stopPropagation(),ref:a,style:{left:l.left,top:l.top},children:[(0,u.jsx)(o.ConfigProvider,{theme:Zi,children:(0,u.jsx)(o.Select,{suffixIcon:(0,u.jsx)(Ki,{}),"aria-label":i.toolbar.codeBlock.language,className:`rj-editor-code-block-language-select`,classNames:{popup:{root:`rj-editor-code-block-language-popup`}},onChange:n=>{e.update(()=>{let e=(0,t.$getNodeByKey)(r);Cr(e)&&e.setLanguage(n)})},options:Xi,popupMatchSelectWidth:!1,size:`small`,value:n})}),(0,u.jsx)(`button`,{"aria-label":s?i.toolbar.codeBlock.copied:i.toolbar.codeBlock.copy,className:s?`is-copied`:void 0,onClick:()=>void p(),title:s?i.toolbar.codeBlock.copied:i.toolbar.codeBlock.copy,type:`button`,children:(0,u.jsx)(qi,{"aria-hidden":`true`})})]}):null}function $i(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.key===r?.key&&e.language===r.language})}function ea(){let[e]=(0,h.useLexicalComposerContext)(),[n,r]=A.default.useState([]);return A.default.useEffect(()=>{let n=()=>{let e=(0,t.$nodesOfType)(xr).map(e=>({key:e.getKey(),language:e.getLanguage()||`plain`}));r(t=>$i(t,e)?t:e)};return e.getEditorState().read(n),e.registerUpdateListener(({editorState:e})=>{e.read(n)})},[e]),n.map(t=>(0,u.jsx)(Qi,{editor:e,language:t.language,nodeKey:t.key},t.key))}function ta(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H3M21 18H3M21 6H3M21 14H3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function na({editor:e}){let n=U(),r=H(e=>e.toolbar.alignment),i=r===``||r===`start`?`left`:r===`end`?`right`:r;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.left,"aria-pressed":i===`left`,className:i===`left`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`left`),title:F(`MOD+SHIFT+L`,n.toolbar.alignment.left),type:`button`,children:(0,u.jsx)(si,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.center,"aria-pressed":i===`center`,className:i===`center`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`center`),title:F(`MOD+SHIFT+C`,n.toolbar.alignment.center),type:`button`,children:(0,u.jsx)(oi,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.right,"aria-pressed":i===`right`,className:i===`right`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`right`),title:F(`MOD+SHIFT+R`,n.toolbar.alignment.right),type:`button`,children:(0,u.jsx)(ci,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.alignment.justify,"aria-pressed":i===`justify`,className:i===`justify`?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`justify`),title:F(`MOD+SHIFT+J`,n.toolbar.alignment.justify),type:`button`,children:(0,u.jsx)(ta,{})})]})}function ra(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`})}function ia(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 9H16.5C18.9853 9 21 11.0147 21 13.5C21 15.9853 18.9853 18 16.5 18H12M7 13L3 9L7 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function aa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9H7.5C5.01472 9 3 11.0147 3 13.5C3 15.9853 5.01472 18 7.5 18H12M17 13L21 9L17 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function oa({editor:e}){let n=U(),{canRedo:r,canUndo:i}=H(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.undo,disabled:!i,onClick:()=>e.dispatchCommand(t.UNDO_COMMAND,void 0),title:F(`MOD+Z`,n.toolbar.shortcuts.undo),type:`button`,children:(0,u.jsx)(ia,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.redo,disabled:!r,onClick:()=>e.dispatchCommand(t.REDO_COMMAND,void 0),title:F(`MOD+Y`,n.toolbar.shortcuts.redo),type:`button`,children:(0,u.jsx)(aa,{})})]})}function sa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9.25H12M21 4H3M21 14.75H12M21 20H3M4.28 8.56L8.14667 11.46C8.43616 11.6771 8.5809 11.7857 8.63266 11.9188C8.678 12.0353 8.678 12.1647 8.63266 12.2812C8.5809 12.4143 8.43616 12.5229 8.14667 12.74L4.28 15.64C3.86802 15.949 3.66203 16.1035 3.48961 16.0999C3.33956 16.0968 3.19885 16.0264 3.10632 15.9082C3 15.7725 3 15.515 3 15V9.2C3 8.68503 3 8.42754 3.10632 8.29175C3.19885 8.17358 3.33956 8.10323 3.48961 8.10011C3.66203 8.09652 3.86802 8.25102 4.28 8.56Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ca(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 4H3M21 20H3M12 9.25H3M12 14.75H3M19.72 8.46L15.8533 11.36C15.5638 11.5771 15.4191 11.6857 15.3673 11.8188C15.322 11.9353 15.322 12.0647 15.3673 12.1812C15.4191 12.3143 15.5638 12.4229 15.8533 12.64L19.72 15.54C20.132 15.849 20.338 16.0035 20.5104 15.9999C20.6604 15.9968 20.8012 15.9264 20.8937 15.8082C21 15.6725 21 15.415 21 14.9V9.1C21 8.58503 21 8.32754 20.8937 8.19175C20.8012 8.07358 20.6604 8.00323 20.5104 8.00011C20.338 7.99652 20.132 8.15102 19.72 8.46Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function la(){let[e]=(0,h.useLexicalComposerContext)(),n=U();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.increaseIndent,onClick:()=>e.dispatchCommand(t.INDENT_CONTENT_COMMAND,void 0),title:F(`MOD+]`,n.toolbar.shortcuts.increaseIndent),type:`button`,children:(0,u.jsx)(sa,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.decreaseIndent,onClick:()=>e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),title:F(`MOD+[`,n.toolbar.shortcuts.decreaseIndent),type:`button`,children:(0,u.jsx)(ca,{"aria-hidden":`true`})})]})}function ua(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 5.00001L10 5.00001M21 19L10 19M21 12L12 12M6 5.00001C5.5 5.00004 5.32843 5.00001 4.5 5.00001C3.67157 5.00001 3.5 4.99999 3 5.00001M6 19C5.5 19 5.32843 19 4.5 19C3.67157 19 3.5 19 3 19M11 8C9 10 7 12 7 12M7 12C7 12 5 10 3 8M7 12C7 12 9 14 11 16M7 12C7 12 5 14 3 16`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function da(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 12L9 12M21 6L9 6M21 18L9 18M5 12C5 12.5523 4.55228 13 4 13C3.44772 13 3 12.5523 3 12C3 11.4477 3.44772 11 4 11C4.55228 11 5 11.4477 5 12ZM5 6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6C3 5.44772 3.44772 5 4 5C4.55228 5 5 5.44772 5 6ZM5 18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18C3 17.4477 3.44772 17 4 17C4.55228 17 5 17.4477 5 18Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function fa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 5.00001L10 5.00001M21 19L10 19M21 12L10 12M6 5.00001C5.5 5.00004 5.32843 5.00001 4.5 5.00001C3.67157 5.00001 3.5 4.99999 3 5.00001M6 19C5.5 19 5.32843 19 4.5 19C3.67157 19 3.5 19 3 19M6 12C5.5 12 5.32843 12 4.5 12C3.67157 12 3.5 12 3 12`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function pa({editor:e}){let t=U(),n=H(e=>e.toolbar.listType);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.bullet,"aria-pressed":n===`bullet`,className:n===`bullet`?`is-active`:void 0,onClick:()=>e.dispatchCommand(f.INSERT_UNORDERED_LIST_COMMAND,void 0),title:F(`MOD+SHIFT+8`,t.toolbar.shortcuts.bulletList),type:`button`,children:(0,u.jsx)(da,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.numbered,"aria-pressed":n===`number`,className:n===`number`?`is-active`:void 0,onClick:()=>e.dispatchCommand(f.INSERT_ORDERED_LIST_COMMAND,void 0),title:F(`MOD+SHIFT+7`,t.toolbar.shortcuts.numberedList),type:`button`,children:(0,u.jsx)(fa,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.list.remove,"aria-pressed":n===void 0?void 0:!1,onClick:()=>e.dispatchCommand(f.REMOVE_LIST_COMMAND,void 0),title:t.toolbar.shortcuts.removeList,type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(ua,{})})]})}function ma(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10H13M21 6H13M21 14H13M21 18H13M6 20L6 4M9 17L6 20L3 17M9 7L6 4L3 7`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ha(e,n){e.focus(()=>{e.update(()=>{let e=(0,t.$getSelection)();(0,t.$isRangeSelection)(e)&&(0,E.$patchStyleText)(e,n)})})}function ga(e){e.update(()=>{let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e))return;(0,E.$patchStyleText)(e,{"background-color":null,color:null,"font-family":null,"font-size":null,"line-height":null}),[`bold`,`capitalize`,`code`,`highlight`,`italic`,`lowercase`,`strikethrough`,`subscript`,`superscript`,`underline`,`uppercase`].forEach(t=>{e.hasFormat(t)&&e.formatText(t)}),e.setFormat(0),(0,f.$isListNode)((0,m.$getNearestNodeOfType)(e.anchor.getNode(),f.ListNode))&&(0,f.$removeList)(),(0,E.$setBlocksType)((0,t.$getSelection)(),t.$createParagraphNode,(e,t)=>{t.setFormat(``),t.setIndent(0),t.setDirection(null)});let n=(0,t.$getSelection)();(0,t.$isRangeSelection)(n)&&n.getNodes().forEach(e=>{let n=e.getTopLevelElement();(0,t.$isElementNode)(n)&&(n.setFormat(``),n.setIndent(0),n.setDirection(null))})})}function _a(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V(),r=H(e=>e.toolbar),i=t=>{ha(e,{"line-height":t||null}),n(B({...r,lineHeight:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`default`,label:(0,u.jsx)(`button`,{className:`rj-editor-spacing-menu-item`,onClick:()=>i(void 0),type:`button`,children:t.toolbar.spacing.default})},{type:`divider`},...He.map(e=>({key:e,label:(0,u.jsx)(`button`,{className:`rj-editor-spacing-menu-item`,onClick:()=>i(e),type:`button`,children:e})}))]},trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.spacing.lineAndParagraph,className:r.lineHeight?`is-active`:void 0,title:t.toolbar.shortcuts.spacing,type:`button`,children:(0,u.jsx)(ma,{"aria-hidden":`true`})})})}function va(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M2 12C2 17.5228 6.47715 22 12 22C13.6569 22 15 20.6569 15 19V18.5C15 18.0356 15 17.8034 15.0257 17.6084C15.2029 16.2622 16.2622 15.2029 17.6084 15.0257C17.8034 15 18.0356 15 18.5 15H19C20.6569 15 22 13.6569 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M7 13C7.55228 13 8 12.5523 8 12C8 11.4477 7.55228 11 7 11C6.44772 11 6 11.4477 6 12C6 12.5523 6.44772 13 7 13Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M16 9C16.5523 9 17 8.55228 17 8C17 7.44772 16.5523 7 16 7C15.4477 7 15 7.44772 15 8C15 8.55228 15.4477 9 16 9Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M10 8C10.5523 8 11 7.55228 11 7C11 6.44772 10.5523 6 10 6C9.44772 6 9 6.44772 9 7C9 7.55228 9.44772 8 10 8Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function ya(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,A.useState)(!1),[i,a]=(0,A.useState)(null),s=V(),c=H(e=>e.toolbar),l=c.backgroundColor,d=t=>{ha(e,{"background-color":t||null}),s(B({...c,backgroundColor:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{d(``),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},...Pe.map(e=>({key:e,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{d(e),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:e}}),e]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:l||Pe[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:e=>{d(e.target.value),a(e.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:l||Pe[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{ha(e,{"background-color":i})}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.backgroundColor,className:`rj-editor-color-button`,title:t.toolbar.shortcuts.backgroundColor,type:`button`,children:(0,u.jsx)(`span`,{className:l?`rj-editor-background-color-mark`:`rj-editor-background-color-mark is-none`,style:l?{backgroundColor:l}:void 0,children:(0,u.jsx)(va,{})})})})}function ba(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 6L6 18M6 6L18 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function xa(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.clearFormatting,onClick:()=>{ga(e),n(Rt({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(B({backgroundColor:L.backgroundColor,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight,textColor:L.textColor})),n(Mt({alignment:L.alignment,listType:L.listType}))},title:F(`MOD+\\`,t.toolbar.shortcuts.clearFormatting),type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(ba,{})})}function Sa(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V(),r=H(e=>e.toolbar);return(0,u.jsx)(o.Select,{"aria-label":t.toolbar.style.fontFamily,className:`rj-editor-toolbar-select rj-editor-toolbar-select-font`,onChange:(t=``)=>{ha(e,{"font-family":t||null}),n(B({...r,fontFamily:t}))},options:Ie.map(e=>({label:e,value:e})),placeholder:t.toolbar.style.fontFamilyPlaceholder,popupMatchSelectWidth:!1,size:`small`,title:t.toolbar.shortcuts.fontFamily,value:r.fontFamily==``?void 0:r.fontFamily,suffixIcon:(0,u.jsx)(Ki,{})})}function Ca(e){let t=Number.parseFloat(e);return Number.isFinite(t)?String(Number((t*16).toFixed(2))):e}function wa(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V(),r=H(e=>e.toolbar);return(0,u.jsx)(o.Select,{"aria-label":t.toolbar.style.fontSize,className:`rj-editor-toolbar-select`,onChange:(t=``)=>{ha(e,{"font-size":t||null}),n(B({...r,fontSize:t}))},options:Le.map(e=>({label:Ca(e),value:e})),placeholder:t.toolbar.style.fontSizePlaceholder,popupMatchSelectWidth:!1,size:`small`,title:t.toolbar.shortcuts.fontSize,value:r.fontSize==``?void 0:r.fontSize,suffixIcon:(0,u.jsx)(Ki,{})})}function Ta(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,A.useState)(!1),[i,a]=(0,A.useState)(null),s=V(),c=H(e=>e.toolbar),l=c.textColor,d=t=>{ha(e,{color:t||null}),s(B({...c,textColor:t}))};return(0,u.jsx)(o.Dropdown,{menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{d(``),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},...We.map(e=>({key:e,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{d(e),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:e}}),e]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:l||We[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:e=>{d(e.target.value),a(e.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:l||We[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{ha(e,{color:i})}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.textColor,className:`rj-editor-color-button`,title:t.toolbar.shortcuts.textColor,type:`button`,children:(0,u.jsxs)(`span`,{className:`rj-editor-text-color-mark`,children:[`A`,(0,u.jsx)(`span`,{className:`rj-editor-text-color-line`,style:{backgroundColor:l||`currentColor`}})]})})})}function Ea(){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Sa,{}),(0,u.jsx)(wa,{}),(0,u.jsx)(Ta,{}),(0,u.jsx)(ya,{}),(0,u.jsx)(xa,{})]})}function Da(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 16C6 18.2091 7.79086 20 10 20H14C16.2091 20 18 18.2091 18 16C18 13.7909 16.2091 12 14 12M18 8C18 5.79086 16.2091 4 14 4H10C7.79086 4 6 5.79086 6 8M3 12H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Oa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M6 12H14C16.2091 12 18 10.2091 18 8C18 5.79086 16.2091 4 14 4H6V12ZM6 12H15C17.2091 12 19 13.7909 19 16C19 18.2091 17.2091 20 15 20H6V12Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ka(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M17 17L22 12L17 7M7 7L2 12L7 17M14 3L10 21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Aa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M19 4H10M14 20H5M15 4L9 20`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ja(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 5L13 15M13 5L3 15M21 19.0001H17C17 17.5001 17.44 17.0001 18.5 16.5001C19.56 16.0001 21 15.3301 21 14.0001C21 13.5301 20.83 13.0701 20.52 12.7101C20.1999 12.3476 19.7649 12.1061 19.2879 12.026C18.811 11.9459 18.321 12.0321 17.9 12.2701C17.48 12.5101 17.16 12.8901 17 13.3401`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ma(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 19L13 9M13 19L3 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M17 6.20449C17.824 4.52464 20.0058 4.6741 20.7484 6.20449C20.907 6.53145 21 6.92143 21 7.37007C21 10.428 17 8.60237 17 11.301C17 12.4597 17 11.8301 17 12H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Na(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 4V11C18 14.3137 15.3137 17 12 17C8.68629 17 6 14.3137 6 11V4M4 21H20`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Pa(){let[e]=(0,h.useLexicalComposerContext)(),n=U(),{isBold:r,isCode:i,isItalic:a,isStrikethrough:o,isSubscript:s,isSuperscript:c,isUnderline:l}=H(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.bold,"aria-pressed":r,className:r?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`bold`),title:F(`MOD+B`,n.toolbar.shortcuts.bold),type:`button`,children:(0,u.jsx)(Oa,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.italic,"aria-pressed":a,className:a?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`italic`),title:F(`MOD+I`,n.toolbar.shortcuts.italic),type:`button`,children:(0,u.jsx)(Aa,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.underline,"aria-pressed":l,className:l?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`underline`),title:F(`MOD+U`,n.toolbar.shortcuts.underline),type:`button`,children:(0,u.jsx)(Na,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.strikethrough,"aria-pressed":o,className:o?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`strikethrough`),title:F(`MOD+SHIFT+X`,n.toolbar.shortcuts.strikethrough),type:`button`,children:(0,u.jsx)(Da,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.code,"aria-pressed":i,className:i?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`code`),title:n.toolbar.textFormat.code,type:`button`,children:(0,u.jsx)(ka,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.subscript,"aria-pressed":s,className:s?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`subscript`),title:F(`MOD+=`,n.toolbar.shortcuts.subscript),type:`button`,children:(0,u.jsx)(ja,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.textFormat.superscript,"aria-pressed":c,className:c?`is-active`:void 0,onClick:()=>e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`superscript`),title:F(`MOD+SHIFT+=`,n.toolbar.shortcuts.superscript),type:`button`,children:(0,u.jsx)(Ma,{"aria-hidden":`true`})})]})}function Fa({editor:e}){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel rj-editor-toolbar-panel--home`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(oa,{editor:e}),(0,u.jsx)(ra,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Pa,{}),(0,u.jsx)(ra,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(_a,{}),(0,u.jsx)(ra,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(na,{editor:e}),(0,u.jsx)(ra,{})]})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Ea,{}),(0,u.jsx)(ra,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(pa,{editor:e}),(0,u.jsx)(ra,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(la,{})})]})]})}function Ia(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 9.25H15M21 4H3M21 14.75H15M21 20H3M4.6 16H9.4C9.96005 16 10.2401 16 10.454 15.891C10.6422 15.7951 10.7951 15.6422 10.891 15.454C11 15.2401 11 14.9601 11 14.4V9.6C11 9.03995 11 8.75992 10.891 8.54601C10.7951 8.35785 10.6422 8.20487 10.454 8.10899C10.2401 8 9.96005 8 9.4 8H4.6C4.03995 8 3.75992 8 3.54601 8.10899C3.35785 8.20487 3.20487 8.35785 3.10899 8.54601C3 8.75992 3 9.03995 3 9.6V14.4C3 14.9601 3 15.2401 3.10899 15.454C3.20487 15.6422 3.35785 15.7951 3.54601 15.891C3.75992 16 4.03995 16 4.6 16Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function La(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 4H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 20H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`rect`,{x:`3`,y:`8`,width:`8`,height:`8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinejoin:`round`})]})}var Ra={wrapper:`_wrapper_se0k7_1`,disabled:`_disabled_se0k7_23`,affix:`_affix_se0k7_28`,input:`_input_se0k7_43`,inputAffix:`_inputAffix_se0k7_58`};function za({className:e,decimalScale:t=2,defaultValue:n,integerOnly:r=!1,locale:i=!1,max:a,min:o,onBlur:s,onChange:c,prefix:l,suffix:d,value:f,...p}){let m=A.default.useRef(null),h=typeof f==`number`,[g,_]=A.default.useState(!1),[v,y]=A.default.useState(()=>mt(h?f:n,i)),b=h&&!g?mt(f,i):v,x=e=>{let n=Ne(e.target.value,t,r),s=Se(n,i),l=Number(n);y(s),n!==``&&n!==`.`&&Number.isFinite(l)&&c?.(P(l,o,a))},S=e=>{_(!1);let t=b.replace(/\s/g,``),n=Number(t);if(t===``||t===`.`||!Number.isFinite(n))y(``);else{let e=P(n,o,a);y(mt(e,i)),c?.(e)}s?.(e)},C=e=>{let t=m.current;if(!t)return;t.focus();let n=e===`start`?0:t.value.length;t.setSelectionRange(n,n)},w=(0,u.jsx)(`input`,{...p,className:[Ra.input,l||d?Ra.inputAffix:``,l||d?``:e].filter(Boolean).join(` `),inputMode:r?`numeric`:`decimal`,onBlur:S,onChange:x,onFocus:e=>{_(!0),p.onFocus?.(e)},ref:m,type:`text`,value:b});return!l&&!d?w:(0,u.jsxs)(`span`,{className:[Ra.wrapper,p.disabled?Ra.disabled:``,e].filter(Boolean).join(` `),children:[l?(0,u.jsx)(`span`,{className:Ra.affix,onMouseDown:e=>{e.preventDefault(),C(`start`)},children:l}):null,w,d?(0,u.jsx)(`span`,{className:Ra.affix,onMouseDown:e=>{e.preventDefault(),C(`end`)},children:d}):null]})}var X={overlay:`_overlay_qjax1_1`,modal:`_modal_qjax1_12`,header:`_header_qjax1_24`,title:`_title_qjax1_34`,closeButton:`_closeButton_qjax1_42`,body:`_body_qjax1_65`,footer:`_footer_qjax1_71`,button:`_button_qjax1_80`,cancelButton:`_cancelButton_qjax1_96`,okButton:`_okButton_qjax1_106`};function Ba({cancelText:e,children:t,okText:n,onCancel:r,onOk:i,open:a,title:o,width:s=420}){let c=U(),l=$t(),d=A.default.useRef(null),f=A.default.useRef({x:0,y:0}),[p,m]=A.default.useState(null);if(A.default.useEffect(()=>{if(!a)return;let e=e=>{if(e.key===`Escape`){r();return}e.key===`Enter`&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!(e.target instanceof HTMLTextAreaElement)&&(e.preventDefault(),i())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[r,i,a]),!a||typeof document>`u`)return null;let h=document.fullscreenElement||document.body,g=(e,t)=>{let n=d.current?.getBoundingClientRect(),r=n?.width||s,i=n?.height||0,a=Math.max(8,window.innerWidth-r-8),o=Math.max(8,window.innerHeight-i-8);return{x:Math.min(Math.max(e,8),a),y:Math.min(Math.max(t,8),o)}};return(0,D.createPortal)((0,u.jsx)(`div`,{className:X.overlay,"data-rj-editor-theme":l,onMouseDown:e=>{e.target===e.currentTarget&&r()},role:`presentation`,children:(0,u.jsxs)(`div`,{"aria-modal":`true`,className:X.modal,ref:d,role:`dialog`,style:{"--rj-modal-width":R(s),left:p?R(p.x):void 0,position:p?`fixed`:void 0,top:p?R(p.y):void 0},children:[(0,u.jsxs)(`div`,{className:X.header,onPointerDown:e=>{if(e.button!==0)return;let t=d.current?.getBoundingClientRect();t&&(e.currentTarget.setPointerCapture(e.pointerId),f.current={x:e.clientX-t.left,y:e.clientY-t.top},m(g(t.left,t.top)))},onPointerMove:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&m(g(e.clientX-f.current.x,e.clientY-f.current.y))},onPointerUp:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},children:[o?(0,u.jsx)(`h2`,{className:X.title,children:o}):(0,u.jsx)(`span`,{}),(0,u.jsx)(`button`,{"aria-label":c.modal.closeAriaLabel,className:X.closeButton,onClick:r,onPointerDown:e=>{e.stopPropagation()},type:`button`,children:(0,u.jsx)(ba,{"aria-hidden":`true`})})]}),(0,u.jsx)(`div`,{className:X.body,children:t}),i?(0,u.jsxs)(`div`,{className:X.footer,children:[(0,u.jsx)(`button`,{className:`${X.button} ${X.cancelButton}`,onClick:r,type:`button`,children:e||c.common.close}),(0,u.jsx)(`button`,{className:`${X.button} ${X.okButton}`,onClick:i,type:`button`,children:n||c.common.save})]}):null]})}),h)}function Va(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function Ha(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(Y);return Y(n)?n:null}function Ua(){let e=Ha();return{isImageSelected:!!e,selectedImageAlignment:e?.getAlignment(),selectedImageAltText:e?.getAltText(),selectedImageAspectRatioLocked:e?.getAspectRatioLocked(),selectedImageBorderEnabled:e?.getBorderEnabled(),selectedImageBorderRadius:e?.getBorderRadius(),selectedImageCaption:e?.getCaption(),selectedImageHeight:e?.getHeight(),selectedImageKey:e?.getKey(),selectedImageLinkUrl:e?.getLinkUrl(),selectedImageObjectFit:e?.getObjectFit(),selectedImageRotation:e?.getRotation(),selectedImageShadowEnabled:e?.getShadowEnabled(),selectedImageTextWrap:e?.getTextWrap(),selectedImageWidth:e?.getWidth()}}function Z(e,t){e.update(()=>{let e=Ha();e&&t(e)}),e.focus()}function Wa(e,n,r){e.update(()=>{let e=(0,t.$getNodeByKey)(n);Y(e)&&r(e)}),e.focus()}function Ga(e,t){Z(e,e=>{e.setAlignment(t)})}function Ka(e,t){Z(e,e=>{e.setWidth(t)})}function qa(e,n){Z(e,e=>{e.setTextWrap(n),n===`square`&&e.getAlignment()===`center`&&e.setAlignment(`left`);let r=e.getParent();r&&!(0,t.$isRootOrShadowRoot)(r)&&r.insertBefore(e)})}function Ja(e){Z(e,e=>{e.remove()})}function Ya(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M18 5.00802C13.6667 4.84146 5 7.20666 5 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}function Xa(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M2 10C2 10 4.00498 7.26822 5.63384 5.63824C7.26269 4.00827 9.5136 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21C7.89691 21 4.43511 18.2543 3.35177 14.5M8 10H2V4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Za(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21 10C21 10 18.995 7.26822 17.3662 5.63824C15.7373 4.00827 13.4864 3 11 3C6.02944 3 2 7.02944 2 12C2 16.9706 6.02944 21 11 21C15.1031 21 18.5649 18.2543 19.6482 14.5M15 10H21V4`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Qa(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=di(),r=A.default.useRef(null),{isImageSelected:i,selectedImageAlignment:a,selectedImageAltText:s,selectedImageBorderEnabled:c,selectedImageBorderRadius:l,selectedImageCaption:f,selectedImageKey:p,selectedImageLinkUrl:m,selectedImageObjectFit:g,selectedImageRotation:_,selectedImageShadowEnabled:v,selectedImageTextWrap:y,selectedImageWidth:b}=H(e=>e.toolbar),[x,S]=A.default.useState(null),[C,w]=A.default.useState(``),[T,E]=A.default.useState(!1),D=A.default.useMemo(()=>[{label:t.toolbar.image.fitContain,value:`contain`},{label:t.toolbar.image.fitCover,value:`cover`},{label:t.toolbar.image.fitFill,value:`fill`}],[t]),O=A.default.useMemo(()=>({alt:{label:t.toolbar.image.alt,placeholder:t.toolbar.image.altPlaceholder,title:t.toolbar.image.editAlt},caption:{label:t.toolbar.image.caption,placeholder:t.toolbar.image.captionPlaceholder,title:t.toolbar.image.editCaption},link:{label:t.toolbar.image.link,placeholder:t.toolbar.image.linkPlaceholder,title:t.toolbar.image.editLink}}),[t]),k=e=>{let t={alt:s||``,caption:f||``,link:m||``};S(e),w(t[e])},ee=()=>{S(null),w(``),e.focus()};return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel rj-editor-toolbar-panel--image`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignLeft,className:a===`left`?`is-active`:void 0,disabled:!i,onClick:()=>Ga(e,`left`),type:`button`,children:(0,u.jsx)(si,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignCenter,className:a===`center`?`is-active`:void 0,disabled:!i,onClick:()=>Ga(e,`center`),type:`button`,children:(0,u.jsx)(oi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignRight,className:a===`right`?`is-active`:void 0,disabled:!i,onClick:()=>Ga(e,`right`),type:`button`,children:(0,u.jsx)(ci,{"aria-hidden":`true`})}),(0,u.jsx)(Va,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(za,{"aria-label":t.toolbar.image.width,className:`rj-editor-image-width-input`,max:100,min:10,decimalScale:3,suffix:`%`,onChange:t=>Ka(e,t),value:b||100}),[25,50,100].map(t=>(0,u.jsxs)(`button`,{className:b===t?`is-active`:void 0,disabled:!i,onClick:()=>Ka(e,t),type:`button`,children:[t,`%`]},t)),(0,u.jsx)(Va,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{disabled:!i,onClick:()=>k(`alt`),type:`button`,children:t.toolbar.image.alt}),(0,u.jsx)(`button`,{className:f?`is-active`:void 0,disabled:!i,onClick:()=>k(`caption`),type:`button`,children:t.toolbar.image.caption}),(0,u.jsx)(`button`,{className:m?`is-active`:void 0,disabled:!i,onClick:()=>k(`link`),type:`button`,children:t.toolbar.image.link}),(0,u.jsx)(Va,{})]})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{className:c?`is-active`:void 0,disabled:!i,onClick:()=>Z(e,e=>{e.setBorderEnabled(!e.getBorderEnabled())}),type:`button`,children:t.toolbar.image.border}),(0,u.jsx)(za,{"aria-label":t.toolbar.image.borderRadius,className:`rj-editor-image-border-radius-input`,integerOnly:!0,max:64,min:0,prefix:(0,u.jsx)(Ya,{}),onChange:t=>Z(e,e=>e.setBorderRadius(t)),value:l||0}),(0,u.jsx)(`button`,{className:v?`is-active`:void 0,disabled:!i,onClick:()=>Z(e,e=>{e.setShadowEnabled(!e.getShadowEnabled())}),type:`button`,children:t.toolbar.image.shadow}),(0,u.jsx)(Va,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(o.Select,{"aria-label":t.toolbar.image.cropMode,className:`rj-editor-toolbar-select rj-editor-toolbar-select-crop`,disabled:!i,onChange:t=>Z(e,e=>e.setObjectFit(t)),options:D,size:`small`,suffixIcon:(0,u.jsx)(Ki,{}),value:g||`contain`}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.topBottomWrap,className:y===`top-bottom`?`is-active`:void 0,disabled:!i,onClick:()=>qa(e,`top-bottom`),title:t.toolbar.image.topBottomWrap,type:`button`,children:(0,u.jsx)(La,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.squareWrap,className:y===`square`?`is-active`:void 0,disabled:!i,onClick:()=>qa(e,`square`),title:t.toolbar.image.squareWrap,type:`button`,children:(0,u.jsx)(Ia,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateLeft,disabled:!i,onClick:()=>Z(e,e=>e.setRotation((_||0)-90)),type:`button`,children:(0,u.jsx)(Xa,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateRight,disabled:!i,onClick:()=>Z(e,e=>e.setRotation((_||0)+90)),type:`button`,children:(0,u.jsx)(Za,{})}),(0,u.jsx)(Va,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.replace,"aria-busy":T,disabled:!i||T,onClick:()=>{yt(r.current)},type:`button`,children:(0,u.jsx)(fi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,disabled:!i,onClick:()=>Ja(e),type:`button`,children:(0,u.jsx)(li,{"aria-hidden":`true`})}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:async r=>{let i=r.target.files?.[0];if(r.target.value=``,!i)return;if(!i.type.startsWith(`image/`)){window.alert(t.alerts.onlyImages);return}if(i.size>5242880){window.alert(t.alerts.imageSizeLimit);return}let a=``;try{E(!0),a=await n(i)}catch(e){console.error(e),window.alert(t.alerts.imageUploadFailed);return}finally{E(!1)}Z(e,e=>{e.setSrc(a),e.setAltText(i.name)})},ref:r,type:`file`})]})]}),(0,u.jsx)(Ba,{okText:t.common.save,onCancel:ee,onOk:()=>{if(!x||!p){ee();return}let t=C.trim();Wa(e,p,e=>{if(x===`alt`){e.setAltText(t);return}if(x===`caption`){e.setCaption(t);return}e.setLinkUrl(t?(0,d.formatUrl)(t):``)}),S(null),w(``)},open:!!x,title:x?O[x].title:void 0,children:x?(0,u.jsxs)(`div`,{className:`rj-editor-image-edit-form`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-image-edit-input`,children:O[x].label}),x===`caption`?(0,u.jsx)(`textarea`,{autoFocus:!0,id:`rj-editor-image-edit-input`,onChange:e=>w(e.target.value),placeholder:O[x].placeholder,rows:4,value:C}):(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-image-edit-input`,onChange:e=>w(e.target.value),placeholder:O[x].placeholder,type:x===`link`?`url`:`text`,value:C})]}):null})]})}function $a(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function eo(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M16 18L22 12L16 6M8 6L2 12L8 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function to(){let[e]=(0,h.useLexicalComposerContext)(),t=U();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.codeBlock,onClick:()=>{e.dispatchCommand(Re,{language:`plain`}),window.requestAnimationFrame(()=>e.focus())},onMouseDown:e=>e.preventDefault(),title:t.toolbar.insert.codeBlock,type:`button`,children:(0,u.jsx)(eo,{"aria-hidden":`true`})})}function no(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M4.27209 20.7279L10.8686 14.1314C11.2646 13.7354 11.4627 13.5373 11.691 13.4632C11.8918 13.3979 12.1082 13.3979 12.309 13.4632C12.5373 13.5373 12.7354 13.7354 13.1314 14.1314L19.6839 20.6839M14 15L16.8686 12.1314C17.2646 11.7354 17.4627 11.5373 17.691 11.4632C17.8918 11.3979 18.1082 11.3979 18.309 11.4632C18.5373 11.5373 18.7354 11.7354 19.1314 12.1314L22 15M10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9ZM6.8 21H17.2C18.8802 21 19.7202 21 20.362 20.673C20.9265 20.3854 21.3854 19.9265 21.673 19.362C22 18.7202 22 17.8802 22 16.2V7.8C22 6.11984 22 5.27976 21.673 4.63803C21.3854 4.07354 20.9265 3.6146 20.362 3.32698C19.7202 3 18.8802 3 17.2 3H6.8C5.11984 3 4.27976 3 3.63803 3.32698C3.07354 3.6146 2.6146 4.07354 2.32698 4.63803C2 5.27976 2 6.11984 2 7.8V16.2C2 17.8802 2 18.7202 2.32698 19.362C2.6146 19.9265 3.07354 20.3854 3.63803 20.673C4.27976 21 5.11984 21 6.8 21Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var ro=(0,s.createContext)({});function io(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=io(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ao(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=io(e))&&(r&&(r+=` `),r+=t);return r}var oo={aliceblue:`9ehhb`,antiquewhite:`9sgk7`,aqua:`1ekf`,aquamarine:`4zsno`,azure:`9eiv3`,beige:`9lhp8`,bisque:`9zg04`,black:`0`,blanchedalmond:`9zhe5`,blue:`73`,blueviolet:`5e31e`,brown:`6g016`,burlywood:`8ouiv`,cadetblue:`3qba8`,chartreuse:`4zshs`,chocolate:`87k0u`,coral:`9yvyo`,cornflowerblue:`3xael`,cornsilk:`9zjz0`,crimson:`8l4xo`,cyan:`1ekf`,darkblue:`3v`,darkcyan:`rkb`,darkgoldenrod:`776yz`,darkgray:`6mbhl`,darkgreen:`jr4`,darkgrey:`6mbhl`,darkkhaki:`7ehkb`,darkmagenta:`5f91n`,darkolivegreen:`3bzfz`,darkorange:`9yygw`,darkorchid:`5z6x8`,darkred:`5f8xs`,darksalmon:`9441m`,darkseagreen:`5lwgf`,darkslateblue:`2th1n`,darkslategray:`1ugcv`,darkslategrey:`1ugcv`,darkturquoise:`14up`,darkviolet:`5rw7n`,deeppink:`9yavn`,deepskyblue:`11xb`,dimgray:`442g9`,dimgrey:`442g9`,dodgerblue:`16xof`,firebrick:`6y7tu`,floralwhite:`9zkds`,forestgreen:`1cisi`,fuchsia:`9y70f`,gainsboro:`8m8kc`,ghostwhite:`9pq0v`,goldenrod:`8j4f4`,gold:`9zda8`,gray:`50i2o`,green:`pa8`,greenyellow:`6senj`,grey:`50i2o`,honeydew:`9eiuo`,hotpink:`9yrp0`,indianred:`80gnw`,indigo:`2xcoy`,ivory:`9zldc`,khaki:`9edu4`,lavenderblush:`9ziet`,lavender:`90c8q`,lawngreen:`4vk74`,lemonchiffon:`9zkct`,lightblue:`6s73a`,lightcoral:`9dtog`,lightcyan:`8s1rz`,lightgoldenrodyellow:`9sjiq`,lightgray:`89jo3`,lightgreen:`5nkwg`,lightgrey:`89jo3`,lightpink:`9z6wx`,lightsalmon:`9z2ii`,lightseagreen:`19xgq`,lightskyblue:`5arju`,lightslategray:`4nwk9`,lightslategrey:`4nwk9`,lightsteelblue:`6wau6`,lightyellow:`9zlcw`,lime:`1edc`,limegreen:`1zcxe`,linen:`9shk6`,magenta:`9y70f`,maroon:`4zsow`,mediumaquamarine:`40eju`,mediumblue:`5p`,mediumorchid:`79qkz`,mediumpurple:`5r3rv`,mediumseagreen:`2d9ip`,mediumslateblue:`4tcku`,mediumspringgreen:`1di2`,mediumturquoise:`2uabw`,mediumvioletred:`7rn9h`,midnightblue:`z980`,mintcream:`9ljp6`,mistyrose:`9zg0x`,moccasin:`9zfzp`,navajowhite:`9zest`,navy:`3k`,oldlace:`9wq92`,olive:`50hz4`,olivedrab:`472ub`,orange:`9z3eo`,orangered:`9ykg0`,orchid:`8iu3a`,palegoldenrod:`9bl4a`,palegreen:`5yw0o`,paleturquoise:`6v4ku`,palevioletred:`8k8lv`,papayawhip:`9zi6t`,peachpuff:`9ze0p`,peru:`80oqn`,pink:`9z8wb`,plum:`8nba5`,powderblue:`6wgdi`,purple:`4zssg`,rebeccapurple:`3zk49`,red:`9y6tc`,rosybrown:`7cv4f`,royalblue:`2jvtt`,saddlebrown:`5fmkz`,salmon:`9rvci`,sandybrown:`9jn1c`,seagreen:`1tdnb`,seashell:`9zje6`,sienna:`6973h`,silver:`7ir40`,skyblue:`5arjf`,slateblue:`45e4t`,slategray:`4e100`,slategrey:`4e100`,snow:`9zke2`,springgreen:`1egv`,steelblue:`2r1kk`,tan:`87yx8`,teal:`pds`,thistle:`8ggk8`,tomato:`9yqfb`,turquoise:`2j4r4`,violet:`9b10u`,wheat:`9ld4j`,white:`9zldr`,whitesmoke:`9lhpx`,yellow:`9zl6o`,yellowgreen:`61fzm`},Q=Math.round;function so(e,t){let n=e.replace(/^[^(]*\((.*)/,`$1`).replace(/\).*/,``).match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||``,e);return n[3]?r[3]=n[3].includes(`%`)?r[3]/100:r[3]:r[3]=1,r}var co=(e,t,n)=>n===0?e:e/100;function lo(e,t){let n=t||255;return e>n?n:e<0?0:e}var uo=class e{isValid=!0;r=0;g=0;b=0;a=1;_h;_hsl_s;_hsv_s;_l;_v;_max;_min;_brightness;constructor(t){function n(e){return e[0]in t&&e[1]in t&&e[2]in t}if(t)if(typeof t==`string`){let e=t.trim();function n(t){return e.startsWith(t)}if(/^#?[A-F\d]{3,8}$/i.test(e))this.fromHexString(e);else if(n(`rgb`))this.fromRgbString(e);else if(n(`hsl`))this.fromHslString(e);else if(n(`hsv`)||n(`hsb`))this.fromHsvString(e);else{let t=oo[e.toLowerCase()];t&&this.fromHexString(parseInt(t,36).toString(16).padStart(6,`0`))}}else if(t instanceof e)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._hsl_s=t._hsl_s,this._hsv_s=t._hsv_s,this._l=t._l,this._v=t._v;else if(n(`rgb`))this.r=lo(t.r),this.g=lo(t.g),this.b=lo(t.b),this.a=typeof t.a==`number`?lo(t.a,1):1;else if(n(`hsl`))this.fromHsl(t);else if(n(`hsv`))this.fromHsv(t);else throw Error(`@ant-design/fast-color: unsupported input `+JSON.stringify(t))}setR(e){return this._sc(`r`,e)}setG(e){return this._sc(`g`,e)}setB(e){return this._sc(`b`,e)}setA(e){return this._sc(`a`,e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(this._h===void 0){let e=this.getMax()-this.getMin();e===0?this._h=0:this._h=Q(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){return this.getHSVSaturation()}getHSVSaturation(){if(this._hsv_s===void 0){let e=this.getMax()-this.getMin();e===0?this._hsv_s=0:this._hsv_s=e/this.getMax()}return this._hsv_s}getHSLSaturation(){if(this._hsl_s===void 0){let e=this.getMax()-this.getMin();if(e===0)this._hsl_s=0;else{let t=this.getLightness();this._hsl_s=e/255/(1-Math.abs(2*t-1))}}return this._hsl_s}getLightness(){return this._l===void 0&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return this._v===void 0&&(this._v=this.getMax()/255),this._v}getBrightness(){return this._brightness===void 0&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:Q(i(`r`)),g:Q(i(`g`)),b:Q(i(`b`)),a:Q(i(`a`)*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>Q((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r(`r`),g:r(`g`),b:r(`b`),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e=`#`,t=(this.r||0).toString(16);e+=t.length===2?t:`0`+t;let n=(this.g||0).toString(16);e+=n.length===2?n:`0`+n;let r=(this.b||0).toString(16);if(e+=r.length===2?r:`0`+r,typeof this.a==`number`&&this.a>=0&&this.a<1){let t=Q(this.a*255).toString(16);e+=t.length===2?t:`0`+t}return e}toHsl(){return{h:this.getHue(),s:this.getHSLSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=Q(this.getHSLSaturation()*100),n=Q(this.getLightness()*100);return this.a===1?`hsl(${e},${t}%,${n}%)`:`hsla(${e},${t}%,${n}%,${this.a})`}toHsv(){return{h:this.getHue(),s:this.getHSVSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${this.a})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=lo(t,n),r}_c(e){return new this.constructor(e)}getMax(){return this._max===void 0&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return this._min===void 0&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace(`#`,``);function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){let i=(e%360+360)%360;if(this._h=i,this._hsl_s=t,this._l=n,this.a=typeof r==`number`?r:1,t<=0){let e=Q(n*255);this.r=e,this.g=e,this.b=e;return}let a=0,o=0,s=0,c=i/60,l=(1-Math.abs(2*n-1))*t,u=l*(1-Math.abs(c%2-1));c>=0&&c<1?(a=l,o=u):c>=1&&c<2?(a=u,o=l):c>=2&&c<3?(o=l,s=u):c>=3&&c<4?(o=u,s=l):c>=4&&c<5?(a=u,s=l):c>=5&&c<6&&(a=l,s=u);let d=n-l/2;this.r=Q((a+d)*255),this.g=Q((o+d)*255),this.b=Q((s+d)*255)}fromHsv({h:e,s:t,v:n,a:r}){let i=(e%360+360)%360;this._h=i,this._hsv_s=t,this._v=n,this.a=typeof r==`number`?r:1;let a=Q(n*255);if(this.r=a,this.g=a,this.b=a,t<=0)return;let o=i/60,s=Math.floor(o),c=o-s,l=Q(n*(1-t)*255),u=Q(n*(1-t*c)*255),d=Q(n*(1-t*(1-c))*255);switch(s){case 0:this.g=d,this.b=l;break;case 1:this.r=u,this.b=l;break;case 2:this.r=l,this.b=d;break;case 3:this.r=l,this.g=u;break;case 4:this.r=d,this.g=l;break;default:this.g=l,this.b=u;break}}fromHsvString(e){let t=so(e,co);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){let t=so(e,co);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){let t=so(e,(e,t)=>t.includes(`%`)?Q(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}},fo=2,po=.16,mo=.05,ho=.05,go=.15,_o=5,vo=4,yo=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function bo(e,t,n){let r;return r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-fo*t:Math.round(e.h)+fo*t:n?Math.round(e.h)+fo*t:Math.round(e.h)-fo*t,r<0?r+=360:r>=360&&(r-=360),r}function xo(e,t,n){if(e.h===0&&e.s===0)return e.s;let r;return r=n?e.s-po*t:t===vo?e.s+po:e.s+mo*t,r>1&&(r=1),n&&t===_o&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function So(e,t,n){let r;return r=n?e.v+ho*t:e.v-go*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Co(e,t={}){let n=[],r=new uo(e),i=r.toHsv();for(let e=_o;e>0;--e){let t=new uo({h:bo(i,e,!0),s:xo(i,e,!0),v:So(i,e,!0)});n.push(t)}n.push(r);for(let e=1;e<=vo;e+=1){let t=new uo({h:bo(i,e),s:xo(i,e),v:So(i,e)});n.push(t)}return t.theme===`dark`?yo.map(({index:e,amount:r})=>new uo(t.backgroundColor||`#141414`).mix(n[e],r).toHexString()):n.map(e=>e.toHexString())}var wo=[`#fff1f0`,`#ffccc7`,`#ffa39e`,`#ff7875`,`#ff4d4f`,`#f5222d`,`#cf1322`,`#a8071a`,`#820014`,`#5c0011`];wo.primary=wo[5];var To=[`#fff2e8`,`#ffd8bf`,`#ffbb96`,`#ff9c6e`,`#ff7a45`,`#fa541c`,`#d4380d`,`#ad2102`,`#871400`,`#610b00`];To.primary=To[5];var Eo=[`#fff7e6`,`#ffe7ba`,`#ffd591`,`#ffc069`,`#ffa940`,`#fa8c16`,`#d46b08`,`#ad4e00`,`#873800`,`#612500`];Eo.primary=Eo[5];var Do=[`#fffbe6`,`#fff1b8`,`#ffe58f`,`#ffd666`,`#ffc53d`,`#faad14`,`#d48806`,`#ad6800`,`#874d00`,`#613400`];Do.primary=Do[5];var Oo=[`#feffe6`,`#ffffb8`,`#fffb8f`,`#fff566`,`#ffec3d`,`#fadb14`,`#d4b106`,`#ad8b00`,`#876800`,`#614700`];Oo.primary=Oo[5];var ko=[`#fcffe6`,`#f4ffb8`,`#eaff8f`,`#d3f261`,`#bae637`,`#a0d911`,`#7cb305`,`#5b8c00`,`#3f6600`,`#254000`];ko.primary=ko[5];var Ao=[`#f6ffed`,`#d9f7be`,`#b7eb8f`,`#95de64`,`#73d13d`,`#52c41a`,`#389e0d`,`#237804`,`#135200`,`#092b00`];Ao.primary=Ao[5];var jo=[`#e6fffb`,`#b5f5ec`,`#87e8de`,`#5cdbd3`,`#36cfc9`,`#13c2c2`,`#08979c`,`#006d75`,`#00474f`,`#002329`];jo.primary=jo[5];var Mo=[`#e6f4ff`,`#bae0ff`,`#91caff`,`#69b1ff`,`#4096ff`,`#1677ff`,`#0958d9`,`#003eb3`,`#002c8c`,`#001d66`];Mo.primary=Mo[5];var No=[`#f0f5ff`,`#d6e4ff`,`#adc6ff`,`#85a5ff`,`#597ef7`,`#2f54eb`,`#1d39c4`,`#10239e`,`#061178`,`#030852`];No.primary=No[5];var Po=[`#f9f0ff`,`#efdbff`,`#d3adf7`,`#b37feb`,`#9254de`,`#722ed1`,`#531dab`,`#391085`,`#22075e`,`#120338`];Po.primary=Po[5];var Fo=[`#fff0f6`,`#ffd6e7`,`#ffadd2`,`#ff85c0`,`#f759ab`,`#eb2f96`,`#c41d7f`,`#9e1068`,`#780650`,`#520339`];Fo.primary=Fo[5];var Io=[`#a6a6a6`,`#999999`,`#8c8c8c`,`#808080`,`#737373`,`#666666`,`#404040`,`#1a1a1a`,`#000000`,`#000000`];Io.primary=Io[5];var Lo=[`#2a1215`,`#431418`,`#58181c`,`#791a1f`,`#a61d24`,`#d32029`,`#e84749`,`#f37370`,`#f89f9a`,`#fac8c3`];Lo.primary=Lo[5];var Ro=[`#2b1611`,`#441d12`,`#592716`,`#7c3118`,`#aa3e19`,`#d84a1b`,`#e87040`,`#f3956a`,`#f8b692`,`#fad4bc`];Ro.primary=Ro[5];var zo=[`#2b1d11`,`#442a11`,`#593815`,`#7c4a15`,`#aa6215`,`#d87a16`,`#e89a3c`,`#f3b765`,`#f8cf8d`,`#fae3b7`];zo.primary=zo[5];var Bo=[`#2b2111`,`#443111`,`#594214`,`#7c5914`,`#aa7714`,`#d89614`,`#e8b339`,`#f3cc62`,`#f8df8b`,`#faedb5`];Bo.primary=Bo[5];var Vo=[`#2b2611`,`#443b11`,`#595014`,`#7c6e14`,`#aa9514`,`#d8bd14`,`#e8d639`,`#f3ea62`,`#f8f48b`,`#fafab5`];Vo.primary=Vo[5];var Ho=[`#1f2611`,`#2e3c10`,`#3e4f13`,`#536d13`,`#6f9412`,`#8bbb11`,`#a9d134`,`#c9e75d`,`#e4f88b`,`#f0fab5`];Ho.primary=Ho[5];var Uo=[`#162312`,`#1d3712`,`#274916`,`#306317`,`#3c8618`,`#49aa19`,`#6abe39`,`#8fd460`,`#b2e58b`,`#d5f2bb`];Uo.primary=Uo[5];var Wo=[`#112123`,`#113536`,`#144848`,`#146262`,`#138585`,`#13a8a8`,`#33bcb7`,`#58d1c9`,`#84e2d8`,`#b2f1e8`];Wo.primary=Wo[5];var Go=[`#111a2c`,`#112545`,`#15325b`,`#15417e`,`#1554ad`,`#1668dc`,`#3c89e8`,`#65a9f3`,`#8dc5f8`,`#b7dcfa`];Go.primary=Go[5];var Ko=[`#131629`,`#161d40`,`#1c2755`,`#203175`,`#263ea0`,`#2b4acb`,`#5273e0`,`#7f9ef3`,`#a8c1f8`,`#d2e0fa`];Ko.primary=Ko[5];var qo=[`#1a1325`,`#24163a`,`#301c4d`,`#3e2069`,`#51258f`,`#642ab5`,`#854eca`,`#ab7ae0`,`#cda8f0`,`#ebd7fa`];qo.primary=qo[5];var Jo=[`#291321`,`#40162f`,`#551c3b`,`#75204f`,`#a02669`,`#cb2b83`,`#e0529c`,`#f37fb7`,`#f8a8cc`,`#fad2e3`];Jo.primary=Jo[5];var Yo=[`#151515`,`#1f1f1f`,`#2d2d2d`,`#393939`,`#494949`,`#5a5a5a`,`#6a6a6a`,`#7b7b7b`,`#888888`,`#969696`];Yo.primary=Yo[5];function Xo(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function Zo(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}var Qo=`data-rc-order`,$o=`data-rc-priority`,es=`rc-util-key`,ts=new Map;function ns({mark:e}={}){return e?e.startsWith(`data-`)?e:`data-${e}`:es}function rs(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function is(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function as(e){return Array.from((ts.get(e)||e).children).filter(e=>e.tagName===`STYLE`)}function os(e,t={}){if(!Xo())return null;let{csp:n,prepend:r,priority:i=0}=t,a=is(r),o=a===`prependQueue`,s=document.createElement(`style`);s.setAttribute(Qo,a),o&&i&&s.setAttribute($o,`${i}`),n?.nonce&&(s.nonce=n?.nonce),s.innerHTML=e;let c=rs(t),{firstChild:l}=c;if(r){if(o){let e=(t.styles||as(c)).filter(e=>[`prepend`,`prependQueue`].includes(e.getAttribute(Qo))?i>=Number(e.getAttribute($o)||0):!1);if(e.length)return c.insertBefore(s,e[e.length-1].nextSibling),s}c.insertBefore(s,l)}else c.appendChild(s);return s}function ss(e,t={}){let{styles:n}=t;return n||=as(rs(t)),n.find(n=>n.getAttribute(ns(t))===e)}function cs(e,t){let n=ts.get(e);if(!n||!Zo(document,n)){let n=os(``,t),{parentNode:r}=n;ts.set(e,r),e.removeChild(n)}}function ls(e,t,n={}){let r=rs(n),i=as(r),a={...n,styles:i};cs(r,a);let o=ss(t,a);if(o)return a.csp?.nonce&&o.nonce!==a.csp?.nonce&&(o.nonce=a.csp?.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;let s=os(e,a);return s.setAttribute(ns(a),t),s}function us(e){return e?.getRootNode?.()}function ds(e){return us(e)instanceof ShadowRoot}function fs(e){return ds(e)?us(e):null}var ps={},ms=[],hs=e=>{ms.push(e)};function gs(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){let e=ms.reduce((e,t)=>t(e??``,`warning`),t);e&&console.error(`Warning: ${e}`)}}function _s(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){let e=ms.reduce((e,t)=>t(e??``,`note`),t);e&&console.warn(`Note: ${e}`)}}function vs(){ps={}}function ys(e,t,n){!t&&!ps[n]&&(e(!1,n),ps[n]=!0)}function bs(e,t){ys(gs,e,t)}function xs(e,t){ys(_s,e,t)}bs.preMessage=hs,bs.resetWarned=vs,bs.noteOnce=xs;function Ss(e){return e.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Cs(e,t){bs(e,`[@ant-design/icons] ${t}`)}function ws(e){return typeof e==`object`&&typeof e.name==`string`&&typeof e.theme==`string`&&(typeof e.icon==`object`||typeof e.icon==`function`)}function Ts(e={}){return Object.keys(e).reduce((t,n)=>{let r=e[n];switch(n){case`class`:t.className=r,delete t.class;break;default:delete t[n],t[Ss(n)]=r}return t},{})}function Es(e,t,n){return n?s.default.createElement(e.tag,{key:t,...Ts(e.attrs),...n},(e.children||[]).map((n,r)=>Es(n,`${t}-${e.tag}-${r}`))):s.default.createElement(e.tag,{key:t,...Ts(e.attrs)},(e.children||[]).map((n,r)=>Es(n,`${t}-${e.tag}-${r}`)))}function Ds(e){return Co(e)[0]}function Os(e){return e?Array.isArray(e)?e:[e]:[]}var ks=`
|
|
13
|
+
.anticon {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
color: inherit;
|
|
17
|
+
font-style: normal;
|
|
18
|
+
line-height: 0;
|
|
19
|
+
text-align: center;
|
|
20
|
+
text-transform: none;
|
|
21
|
+
vertical-align: -0.125em;
|
|
22
|
+
text-rendering: optimizeLegibility;
|
|
23
|
+
-webkit-font-smoothing: antialiased;
|
|
24
|
+
-moz-osx-font-smoothing: grayscale;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.anticon > * {
|
|
28
|
+
line-height: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.anticon svg {
|
|
32
|
+
display: inline-block;
|
|
33
|
+
vertical-align: inherit;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.anticon::before {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.anticon .anticon-icon {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.anticon[tabindex] {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.anticon-spin {
|
|
49
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
50
|
+
animation: loadingCircle 1s infinite linear;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@-webkit-keyframes loadingCircle {
|
|
54
|
+
100% {
|
|
55
|
+
-webkit-transform: rotate(360deg);
|
|
56
|
+
transform: rotate(360deg);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes loadingCircle {
|
|
61
|
+
100% {
|
|
62
|
+
-webkit-transform: rotate(360deg);
|
|
63
|
+
transform: rotate(360deg);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`,As=e=>{let{csp:t,prefixCls:n,layer:r}=(0,s.useContext)(ro),i=ks;n&&(i=i.replace(/anticon/g,n)),r&&(i=`@layer ${r} {\n${i}\n}`),(0,s.useEffect)(()=>{let n=e.current,a=fs(n);ls(i,`@ant-design-icons`,{prepend:!r,csp:t,attachTo:a})},[])},js={primaryColor:`#333`,secondaryColor:`#E6E6E6`,calculated:!1};function Ms({primaryColor:e,secondaryColor:t}){js.primaryColor=e,js.secondaryColor=t||Ds(e),js.calculated=!!t}function Ns(){return{...js}}var Ps=e=>{let{icon:t,className:n,onClick:r,style:i,primaryColor:a,secondaryColor:o,...c}=e,l=s.useRef(null),u=js;if(a&&(u={primaryColor:a,secondaryColor:o||Ds(a)}),As(l),Cs(ws(t),`icon should be icon definiton, but got ${t}`),!ws(t))return null;let d=t;return d&&typeof d.icon==`function`&&(d={...d,icon:d.icon(u.primaryColor,u.secondaryColor)}),Es(d.icon,`svg-${d.name}`,{className:n,onClick:r,style:i,"data-icon":d.name,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,...c,ref:l})};Ps.displayName=`IconReact`,Ps.getTwoToneColors=Ns,Ps.setTwoToneColors=Ms;function Fs(e){let[t,n]=Os(e);return Ps.setTwoToneColors({primaryColor:t,secondaryColor:n})}function Is(){let e=Ps.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}function Ls(){return Ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ls.apply(this,arguments)}Fs(Mo.primary);var Rs=s.forwardRef((e,t)=>{let{className:n,icon:r,spin:i,rotate:a,tabIndex:o,onClick:c,twoToneColor:l,...u}=e,{prefixCls:d=`anticon`,rootClassName:f}=s.useContext(ro),p=ao(f,d,{[`${d}-${r.name}`]:!!r.name,[`${d}-spin`]:!!i||r.name===`loading`},n),m=o;m===void 0&&c&&(m=-1);let h=a?{msTransform:`rotate(${a}deg)`,transform:`rotate(${a}deg)`}:void 0,[g,_]=Os(l);return s.createElement(`span`,Ls({role:`img`,"aria-label":r.name},u,{ref:t,tabIndex:m,onClick:c,className:p}),s.createElement(Ps,{icon:r,primaryColor:g,secondaryColor:_,style:h}))});Rs.getTwoToneColor=Is,Rs.setTwoToneColor=Fs,process.env.NODE_ENV!==`production`&&(Rs.displayName=`AntdIcon`);var zs={icon:{tag:`svg`,attrs:{viewBox:`0 0 1024 1024`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z`}}]},name:`loading`,theme:`outlined`};function Bs(){return Bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bs.apply(this,arguments)}var Vs=s.forwardRef((e,t)=>s.createElement(Rs,Bs({},e,{ref:t,icon:zs})));process.env.NODE_ENV!==`production`&&(Vs.displayName=`LoadingOutlined`);function Hs({size:e=24,className:t}){return(0,u.jsx)(Vs,{className:t,style:{fontSize:e},spin:!0})}function Us(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=di(),r=A.default.useRef(null),[i,a]=A.default.useState(!1);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.image,"aria-busy":i,disabled:i,onClick:()=>{yt(r.current)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.image,type:`button`,children:i?(0,u.jsx)(Hs,{}):(0,u.jsx)(no,{})}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:async r=>{let i=r.target.files?.[0];if(r.target.value=``,!i){e.focus();return}if(!i.type.startsWith(`image/`)){window.alert(t.alerts.onlyImages),e.focus();return}if(i.size>5242880){window.alert(t.alerts.imageSizeLimit),e.focus();return}let o;try{a(!0),o=await n(i)}catch(n){console.error(n),window.alert(t.alerts.imageUploadFailed),e.focus();return}finally{a(!1)}e.dispatchCommand(Be,{altText:i.name,src:o}),e.focus()},ref:r,type:`file`})]})}function Ws(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M21.1525 10.8999L12.1369 19.9156C10.0866 21.9658 6.7625 21.9658 4.71225 19.9156C2.662 17.8653 2.662 14.5412 4.71225 12.4909L13.7279 3.47532C15.0947 2.10849 17.3108 2.10849 18.6776 3.47532C20.0444 4.84216 20.0444 7.05823 18.6776 8.42507L10.0156 17.0871C9.33213 17.7705 8.22409 17.7705 7.54068 17.0871C6.85726 16.4037 6.85726 15.2957 7.54068 14.6123L15.1421 7.01086`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Gs=`noreferrer`;function Ks({enableShortcutListener:e=!0,showButton:n=!0}){let[r]=(0,h.useLexicalComposerContext)(),i=U(),[a,o]=A.default.useState(!1),[s,c]=A.default.useState(``),[l,f]=A.default.useState(``),[p,m]=A.default.useState(``),[g,_]=A.default.useState(!0),v=A.default.useCallback(()=>{o(!1),r.focus()},[r]),y=A.default.useCallback(()=>{let e=``;r.getEditorState().read(()=>{let n=(0,t.$getSelection)();(0,t.$isRangeSelection)(n)&&(e=n.getTextContent())}),c(e),f(``),m(``),_(!0),o(!0)},[r]);return A.default.useEffect(()=>{if(!e)return;let t=()=>y();return window.addEventListener(Ue,t),()=>{window.removeEventListener(Ue,t)}},[e,y]),(0,u.jsxs)(u.Fragment,{children:[n?(0,u.jsx)(`button`,{"aria-label":i.toolbar.insert.link,onClick:y,onMouseDown:e=>{e.preventDefault()},title:F(`MOD+K`,i.toolbar.shortcuts.link),type:`button`,children:(0,u.jsx)(Ws,{})}):null,(0,u.jsx)(Ba,{okText:i.common.insert,onCancel:v,onOk:()=>{let e=p.trim();if(!e){r.focus();return}let n={rel:Gs,target:g?`_blank`:null,title:l.trim()||null,url:(0,d.formatUrl)(e)};r.focus(()=>{r.update(()=>{let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e))return;let r=s.trim();if(e.isCollapsed()){let i=(0,d.$createLinkNode)(n.url,{rel:n.rel,target:n.target,title:n.title});i.append((0,t.$createTextNode)(r||n.url)),e.insertNodes([i]),i.selectEnd();return}r&&r!==e.getTextContent()&&e.insertText(r),(0,d.$toggleLink)(n)})}),o(!1)},open:a,title:i.toolbar.insert.link,children:(0,u.jsxs)(`div`,{className:`rj-editor-link-form`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-url`,children:i.toolbar.link.url}),(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-link-url`,onChange:e=>m(e.target.value),placeholder:i.toolbar.link.urlPlaceholder,type:`text`,value:p})]}),(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-text`,children:i.toolbar.link.text}),(0,u.jsx)(`input`,{id:`rj-editor-link-text`,onChange:e=>c(e.target.value),placeholder:i.toolbar.link.textPlaceholder,type:`text`,value:s})]}),(0,u.jsxs)(`div`,{className:`rj-editor-link-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-link-title`,children:i.toolbar.link.title}),(0,u.jsx)(`input`,{id:`rj-editor-link-title`,onChange:e=>f(e.target.value),placeholder:i.toolbar.link.titlePlaceholder,type:`text`,value:l})]}),(0,u.jsxs)(`label`,{className:`rj-editor-link-checkbox`,children:[(0,u.jsx)(`input`,{checked:g,onChange:e=>_(e.target.checked),type:`checkbox`}),i.toolbar.link.openInNewTab]})]})})]})}function qs(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M3 12H21M12 3V21M7.8 3H16.2C17.8802 3 18.7202 3 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C21 5.27976 21 6.11984 21 7.8V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V7.8C3 6.11984 3 5.27976 3.32698 4.63803C3.6146 4.07354 4.07354 3.6146 4.63803 3.32698C5.27976 3 6.11984 3 7.8 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Js=1,Ys=20,Xs=8,Zs=10;function Qs({onTableInserted:e}){let[t]=(0,h.useLexicalComposerContext)(),n=U(),r=A.default.useId(),i=A.default.useId(),[a,s]=A.default.useState(!1),[c,l]=A.default.useState(3),[d,f]=A.default.useState(3),[m,g]=A.default.useState(3),[_,v]=A.default.useState(3),[y,b]=A.default.useState(!0),x=(n=c,r=d)=>{t.dispatchCommand(p.INSERT_TABLE_COMMAND,{columns:String(r),includeHeaders:y?{columns:!1,rows:!0}:!1,rows:String(n)}),s(!1),e?.(),t.focus()};return(0,u.jsx)(o.Dropdown,{dropdownRender:()=>(0,u.jsxs)(`div`,{className:`rj-editor-table-menu`,children:[(0,u.jsx)(`div`,{className:`rj-editor-table-menu-title`,children:n.toolbar.table.insertTableSize.replace(`{columns}`,String(_)).replace(`{rows}`,String(m))}),(0,u.jsx)(`div`,{className:`rj-editor-table-grid`,onMouseLeave:()=>{g(c),v(d)},children:Array.from({length:Xs}).map((e,t)=>(0,u.jsx)(A.default.Fragment,{children:Array.from({length:Zs}).map((e,r)=>{let i=t+1,a=r+1,o=i<=m&&a<=_;return(0,u.jsx)(`button`,{"aria-label":n.toolbar.table.insertTableSize.replace(`{columns}`,String(a)).replace(`{rows}`,String(i)),className:o?`is-selected`:void 0,onClick:()=>x(i,a),onMouseEnter:()=>{g(i),v(a)},type:`button`},`${t}-${r}`)})},t))}),(0,u.jsx)(`div`,{className:`rj-editor-table-menu-divider`}),(0,u.jsxs)(`div`,{className:`rj-editor-table-menu-row`,children:[(0,u.jsx)(`label`,{htmlFor:r,children:n.toolbar.table.rows}),(0,u.jsx)(za,{id:r,integerOnly:!0,max:Ys,min:Js,onChange:l,value:c})]}),(0,u.jsxs)(`div`,{className:`rj-editor-table-menu-row`,children:[(0,u.jsx)(`label`,{htmlFor:i,children:n.toolbar.table.columns}),(0,u.jsx)(za,{id:i,integerOnly:!0,max:Ys,min:Js,onChange:f,value:d})]}),(0,u.jsx)(o.Checkbox,{checked:y,onChange:e=>{b(e.target.checked)},children:n.toolbar.table.headerRow}),(0,u.jsx)(o.Button,{block:!0,onClick:()=>x(),size:`small`,type:`primary`,children:n.toolbar.table.insertTable})]}),onOpenChange:e=>{s(e),g(c),v(d)},open:a,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":n.toolbar.table.insertTable,className:a?`is-active`:void 0,onMouseDown:e=>{e.preventDefault()},title:n.toolbar.insert.table,type:`button`,children:(0,u.jsx)(qs,{})})})}function $s(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M21.5813 7.19989C21.4733 6.76846 21.2534 6.37318 20.9438 6.05395C20.6341 5.73473 20.2457 5.50287 19.8178 5.3818C18.2542 5 12 5 12 5C12 5 5.74578 5 4.18222 5.41816C3.75429 5.53923 3.36588 5.77109 3.05623 6.09031C2.74659 6.40954 2.52666 6.80482 2.41868 7.23625C2.13253 8.82303 1.99255 10.4327 2.00052 12.0451C1.99032 13.6696 2.1303 15.2916 2.41868 16.8903C2.53773 17.3083 2.76258 17.6886 3.0715 17.9943C3.38043 18.3 3.76299 18.5209 4.18222 18.6357C5.74578 19.0538 12 19.0538 12 19.0538C12 19.0538 18.2542 19.0538 19.8178 18.6357C20.2457 18.5146 20.6341 18.2827 20.9438 17.9635C21.2534 17.6443 21.4733 17.249 21.5813 16.8176C21.8653 15.2427 22.0052 13.6453 21.9995 12.0451C22.0097 10.4206 21.8697 8.79862 21.5813 7.19989Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,u.jsx)(`path`,{d:`M9.75 9.46533C9.75 8.98805 9.75 8.74941 9.84974 8.61618C9.93666 8.50008 10.0697 8.42744 10.2144 8.4171C10.3804 8.40525 10.5811 8.53429 10.9826 8.79239L14.9254 11.3271C15.2738 11.551 15.448 11.663 15.5082 11.8054C15.5607 11.9298 15.5607 12.0702 15.5082 12.1946C15.448 12.337 15.2738 12.449 14.9254 12.6729L10.9826 15.2076C10.5811 15.4657 10.3804 15.5948 10.2144 15.5829C10.0697 15.5726 9.93666 15.4999 9.84974 15.3838C9.75 15.2506 9.75 15.012 9.75 14.5347V9.46533Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function ec(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=A.default.useState(!1),[i,a]=A.default.useState(``),[o,s]=A.default.useState(``),[c,l]=A.default.useState(``);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.youtube,onClick:()=>{a(``),s(``),l(``),r(!0)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.youtube,type:`button`,children:(0,u.jsx)($s,{"aria-hidden":`true`})}),(0,u.jsx)(Ba,{okText:t.common.insert,onCancel:()=>{r(!1),l(``),e.focus()},onOk:()=>{let n=Te(o);if(!n){l(t.toolbar.youtube.invalidUrl);return}e.dispatchCommand(Ve,{title:i.trim(),videoId:n}),r(!1),l(``),e.focus()},open:n,title:t.toolbar.insert.youtube,children:(0,u.jsxs)(`div`,{className:`rj-editor-youtube-form`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-youtube-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-youtube-url`,children:t.toolbar.youtube.url}),(0,u.jsx)(`input`,{autoFocus:!0,id:`rj-editor-youtube-url`,onChange:e=>{s(e.target.value),l(``)},placeholder:t.toolbar.youtube.urlPlaceholder,type:`text`,value:o})]}),(0,u.jsxs)(`div`,{className:`rj-editor-youtube-field`,children:[(0,u.jsx)(`label`,{htmlFor:`rj-editor-youtube-title`,children:t.toolbar.youtube.title}),(0,u.jsx)(`input`,{id:`rj-editor-youtube-title`,onChange:e=>a(e.target.value),placeholder:t.toolbar.youtube.titlePlaceholder,type:`text`,value:i})]}),c?(0,u.jsx)(`p`,{className:`rj-editor-youtube-error`,children:c}):null]})})]})}function tc({onTableInserted:e}){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Qs,{onTableInserted:e}),(0,u.jsx)(Ks,{enableShortcutListener:!1}),(0,u.jsx)($a,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Us,{}),(0,u.jsx)(ec,{}),(0,u.jsx)(to,{})]})]})}function nc(){return(0,u.jsx)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`})}function rc(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M15.9997 11L1.9997 11M9.9997 4L7.9997 2M13.9997 22L1.9997 22M21.9997 16C21.9997 17.1046 21.1043 18 19.9997 18C18.8951 18 17.9997 17.1046 17.9997 16C17.9997 14.8954 19.9997 13 19.9997 13C19.9997 13 21.9997 14.8954 21.9997 16ZM8.9997 3L15.8683 9.86863C16.2643 10.2646 16.4624 10.4627 16.5365 10.691C16.6018 10.8918 16.6018 11.1082 16.5365 11.309C16.4624 11.5373 16.2643 11.7354 15.8683 12.1314L11.2624 16.7373C10.4704 17.5293 10.0744 17.9253 9.61773 18.0737C9.21605 18.2042 8.78335 18.2042 8.38166 18.0737C7.92501 17.9253 7.52899 17.5293 6.73696 16.7373L3.26244 13.2627C2.4704 12.4707 2.07439 12.0747 1.92601 11.618C1.7955 11.2163 1.7955 10.7837 1.92601 10.382C2.07439 9.92531 2.47041 9.52929 3.26244 8.73726L8.9997 3Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ic(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 14H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 18H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function ac(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 14H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function oc(e){return(0,u.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:[(0,u.jsx)(`path`,{d:`M3 6H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`}),(0,u.jsx)(`path`,{d:`M3 10H21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})]})}function sc(){let e=(0,t.$getSelection)();return(0,t.$isRangeSelection)(e)?e.anchor.getNode():(0,p.$isTableSelection)(e)?(0,t.$getNodeByKey)(e.anchor.key):null}function cc(){let e=(0,t.$getSelection)();if((0,p.$isTableSelection)(e)){let t=e.getNodes().filter(p.$isTableCellNode);return Array.from(new Map(t.map(e=>[e.getKey(),e])).values())}let n=sc(),r=n?(0,m.$getNearestNodeOfType)(n,p.TableCellNode):null;return r?[r]:[]}function lc(){let e=(0,t.$getSelection)();if((0,p.$isTableSelection)(e)){let n=(0,t.$getNodeByKey)(e.tableKey);return(0,p.$isTableNode)(n)?n:null}let n=sc();return n?(0,m.$getNearestNodeOfType)(n,p.TableNode):null}function uc(){let e=cc(),t=e[0];return{isInTable:e.length>0,selectedTableCellsCount:e.length,tableCellBackgroundColor:t?.getBackgroundColor()||``,tableCellVerticalAlign:t?.getVerticalAlign(),tableHasMergedCell:e.some(e=>e.getColSpan()>1||e.getRowSpan()>1)}}function $(e,t){e.update(t),e.focus()}function dc(e,t){$(e,()=>{(0,p.$insertTableRowAtSelection)(t)})}function fc(e,t){$(e,()=>{(0,p.$insertTableColumnAtSelection)(t)})}function pc(e){$(e,()=>{(0,p.$deleteTableRowAtSelection)()})}function mc(e){$(e,()=>{(0,p.$deleteTableColumnAtSelection)()})}function hc(e){$(e,()=>{let e=lc();if(!e)return;let n=(0,t.$createParagraphNode)();e.insertAfter(n),e.remove(),n.select(),(0,t.$getRoot)().getChildrenSize()===0&&(0,t.$getRoot)().append((0,t.$createParagraphNode)())})}function gc(e){$(e,()=>{let e=cc();e.length>1&&(0,p.$mergeCells)(e)})}function _c(e){$(e,()=>{(0,p.$unmergeCell)()})}function vc(e,t){$(e,()=>{cc().forEach(e=>{e.setBackgroundColor(t)})})}function yc(e,t){$(e,()=>{cc().forEach(e=>{e.setVerticalAlign(t)})})}function bc(e){$(e,()=>{let e=cc()[0];if(!e)return;let[,t]=(0,p.$getNodeTriplet)(e);t.getChildren().forEach(e=>{(0,p.$isTableCellNode)(e)&&e.toggleHeaderStyle(p.TableCellHeaderStates.ROW)})})}function xc(e){$(e,()=>{let e=cc()[0],t=lc(),n=e?(0,p.$getTableCellNodeRect)(e):null;if(!e||!t||!n)return;let[r]=(0,p.$computeTableMapSkipCellCheck)(t,null,null),i=new Set;r.forEach(e=>{e.forEach(({cell:e,startColumn:t})=>{t<=n.columnIndex&&t+e.getColSpan()>n.columnIndex&&!i.has(e.getKey())&&(i.add(e.getKey()),e.toggleHeaderStyle(p.TableCellHeaderStates.COLUMN))})})})}function Sc(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,A.useState)(!1),[i,a]=(0,A.useState)(null),{isInTable:s,tableCellBackgroundColor:c,tableCellVerticalAlign:l}=H(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.Dropdown,{disabled:!s,menu:{items:[{key:`none`,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{vc(e,null),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},{type:`divider`},...Pe.map(t=>({key:t,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{vc(e,t),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:t}}),t]})})),{type:`divider`},{key:`more-colors`,label:(0,u.jsxs)(`label`,{className:`rj-editor-color-menu-item`,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,u.jsx)(`span`,{className:`rj-editor-color-swatch`,style:{backgroundColor:c||Pe[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:t=>{vc(e,t.target.value),a(t.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:c||Pe[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{vc(e,i)}),a(null))},open:n,trigger:[`click`],children:(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.background,className:c?`is-active`:void 0,disabled:!s,onMouseDown:e=>{e.preventDefault()},type:`button`,children:(0,u.jsx)(rc,{"aria-hidden":`true`})})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignTop,className:l===`top`?`is-active`:void 0,disabled:!s,onClick:()=>yc(e,`top`),type:`button`,children:(0,u.jsx)(oc,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignMiddle,className:l===`middle`?`is-active`:void 0,disabled:!s,onClick:()=>yc(e,`middle`),type:`button`,children:(0,u.jsx)(ac,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignBottom,className:l===`bottom`?`is-active`:void 0,disabled:!s,onClick:()=>yc(e,`bottom`),type:`button`,children:(0,u.jsx)(ic,{"aria-hidden":`true`})})]})}function Cc(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=!H(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnLeft,disabled:n,onClick:()=>fc(e,!1),type:`button`,children:t.toolbar.table.columnLeft}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnRight,disabled:n,onClick:()=>fc(e,!0),type:`button`,children:t.toolbar.table.columnRight})]})}function wc(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=!H(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.deleteRow,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>pc(e),type:`button`,children:[(0,u.jsx)(li,{"aria-hidden":`true`}),`\xA0`,t.toolbar.table.row]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.deleteColumn,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>mc(e),type:`button`,children:[(0,u.jsx)(li,{"aria-hidden":`true`}),`\xA0`,t.toolbar.table.column]}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.deleteTable,className:`rj-editor-toolbar--clear-btn`,disabled:n,onClick:()=>hc(e),type:`button`,children:(0,u.jsx)(li,{"aria-hidden":`true`})})]})}function Tc(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function Ec(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M9 7L4 12L9 17M15 7L20 12L15 17`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Dc(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M7 15L12 20L17 15M7 9L12 4L17 9`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Oc(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),{isInTable:n}=H(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.headerRow,disabled:!n,onClick:()=>bc(e),type:`button`,title:t.toolbar.table.headerRow,children:[(0,u.jsx)(Ec,{}),` \xA0 `,t.toolbar.table.header]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.header,disabled:!n,onClick:()=>xc(e),type:`button`,title:t.toolbar.table.headerColumn,children:[(0,u.jsx)(Dc,{}),` \xA0 `,t.toolbar.table.header]})]})}function kc(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),{isInTable:n,selectedTableCellsCount:r,tableHasMergedCell:i}=H(e=>e.toolbar);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.mergeCells,disabled:!n||r<2,onClick:()=>gc(e),type:`button`,children:t.toolbar.table.mergeCells}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.unmergeCell,disabled:!n||!i,onClick:()=>_c(e),type:`button`,children:t.toolbar.table.unmergeCell})]})}function Ac(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=!H(e=>e.toolbar.isInTable);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowAbove,disabled:n,onClick:()=>dc(e,!1),type:`button`,children:t.toolbar.table.rowAbove}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowBelow,disabled:n,onClick:()=>dc(e,!0),type:`button`,children:t.toolbar.table.rowBelow})]})}function jc(){return(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Ac,{}),(0,u.jsx)(Tc,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Cc,{}),(0,u.jsx)(Tc,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(kc,{}),(0,u.jsx)(Tc,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Sc,{}),(0,u.jsx)(Tc,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Oc,{}),(0,u.jsx)(Tc,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(wc,{})})]})}function Mc(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(Zr);return Zr(n)?n:null}function Nc(){let e=Mc();return{isEquationSelected:!!e,selectedEquation:e?.getEquation(),selectedEquationDisplayMode:e?.getDisplayMode(),selectedEquationKey:e?.getKey()}}function Pc(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M8 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M8 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V16M21 8V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H16M21 16V16.2C21 17.8802 21 18.7202 20.673 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7202 21 17.8802 21 16.2 21H16`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Fc(e){return(0,u.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,...e,children:(0,u.jsx)(`path`,{d:`M2.99986 8H3.19986C4.88002 8 5.7201 8 6.36183 7.67302C6.92632 7.3854 7.38526 6.92646 7.67288 6.36197C7.99986 5.72024 7.99986 4.88016 7.99986 3.2V3M2.99986 16H3.19986C4.88002 16 5.7201 16 6.36183 16.327C6.92632 16.6146 7.38526 17.0735 7.67288 17.638C7.99986 18.2798 7.99986 19.1198 7.99986 20.8V21M15.9999 3V3.2C15.9999 4.88016 15.9999 5.72024 16.3268 6.36197C16.6145 6.92646 17.0734 7.3854 17.6379 7.67302C18.2796 8 19.1197 8 20.7999 8H20.9999M15.9999 21V20.8C15.9999 19.1198 15.9999 18.2798 16.3268 17.638C16.6145 17.0735 17.0734 16.6146 17.6379 16.327C18.2796 16 19.1197 16 20.7999 16H20.9999`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}var Ic=[{value:`home`},{value:`insert`},{value:`equation`},{value:`image`},{value:`table`}];function Lc({isFullscreen:e,onToggleFullscreen:n}){let[r]=(0,h.useLexicalComposerContext)(),i=U(),[a,o]=A.default.useState(`home`),s=V(),c=H(e=>e.toolbar.isEquationSelected),l=H(e=>e.toolbar.isImageSelected),d=H(e=>e.toolbar.isInTable),p=c?`equation`:l?`image`:a===`table`&&!d||a===`image`&&!l||a===`equation`&&!c?`home`:a,g=Ic.filter(e=>(e.value!==`table`||d)&&(e.value!==`equation`||c)&&(e.value!==`image`||l));return A.default.useEffect(()=>{let e=()=>{let e=(0,t.$getSelection)(),n=Nc(),r=Ua(),i=uc();if(s(Ft(n)),s(It(r)),s(Lt(i)),!(0,t.$isRangeSelection)(e))return;let a=e.anchor.getNode(),o=a.getTopLevelElementOrThrow(),c=(0,m.$getNearestNodeOfType)(a,f.ListNode);s(Rt({isBold:e.hasFormat(`bold`),isCode:e.hasFormat(`code`),isItalic:e.hasFormat(`italic`),isStrikethrough:e.hasFormat(`strikethrough`),isSubscript:e.hasFormat(`subscript`),isSuperscript:e.hasFormat(`superscript`),isUnderline:e.hasFormat(`underline`)})),s(B({backgroundColor:(0,E.$getSelectionStyleValueForProperty)(e,`background-color`,``),fontFamily:Ke((0,E.$getSelectionStyleValueForProperty)(e,`font-family`,``)),fontSize:Je((0,E.$getSelectionStyleValueForProperty)(e,`font-size`,``)),lineHeight:(0,E.$getSelectionStyleValueForProperty)(e,`line-height`,``)||void 0,textColor:(0,E.$getSelectionStyleValueForProperty)(e,`color`,``)})),s(Mt({alignment:o.getFormatType(),listType:(0,f.$isListNode)(c)?c.getListType():void 0}))},n=r.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(r.getEditorState().read(e),!1),t.COMMAND_PRIORITY_LOW),i=r.registerUpdateListener(({editorState:t})=>{t.read(e)}),a=r.registerCommand(t.CAN_UNDO_COMMAND,e=>(s(Pt(e)),!1),t.COMMAND_PRIORITY_LOW),o=r.registerCommand(t.CAN_REDO_COMMAND,e=>(s(Nt(e)),!1),t.COMMAND_PRIORITY_LOW);return()=>{n(),i(),a(),o()}},[s,r]),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar`,"aria-label":`Editor toolbar`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-tabs`,children:[(0,u.jsx)(`div`,{className:`rj-editor-toolbar-tabs-list`,role:`tablist`,children:g.map(e=>(0,u.jsx)(`button`,{"aria-selected":p===e.value,className:p===e.value?`is-active`:void 0,onClick:()=>{o(e.value),window.requestAnimationFrame(()=>{r.focus()})},onMouseDown:e=>{e.preventDefault()},role:`tab`,type:`button`,children:i.toolbar.tabs[e.value]},e.value))}),(0,u.jsx)(`button`,{"aria-label":e?i.toolbar.fullscreen.close:i.toolbar.fullscreen.open,className:`rj-editor-toolbar-fullscreen`,onClick:n,type:`button`,children:e?(0,u.jsx)(Fc,{"aria-hidden":`true`}):(0,u.jsx)(Pc,{"aria-hidden":`true`})})]}),p===`home`?(0,u.jsx)(Fa,{editor:r}):null,p===`image`?(0,u.jsx)(Qa,{}):null,p===`insert`?(0,u.jsx)(tc,{onTableInserted:()=>o(`table`)}):null,p===`table`?(0,u.jsx)(jc,{}):null,p===`layout`?(0,u.jsx)(nc,{}):null,(0,u.jsx)(Ks,{showButton:!1})]})}function Rc(){let[e]=(0,h.useLexicalComposerContext)();return(0,A.useEffect)(()=>e.registerCommand(ze,e=>{let n=Xr(e);(0,m.$insertNodeToNearestRoot)(n),e.displayMode!==`inline`&&n.insertAfter((0,t.$createParagraphNode)());let r=(0,t.$createNodeSelection)();return r.add(n.getKey()),(0,t.$setSelection)(r),!0},t.COMMAND_PRIORITY_EDITOR),[e]),null}function zc(){let[e]=(0,h.useLexicalComposerContext)();return A.default.useEffect(()=>{let n=e.registerCommand(Re,({code:e=``,language:n})=>{let r=Sr(n);return e&&r.append((0,t.$createTextNode)(e)),(0,m.$insertNodeToNearestRoot)(r),r.insertAfter((0,t.$createParagraphNode)()),r.selectEnd(),!0},t.COMMAND_PRIORITY_EDITOR),r=e.registerUpdateListener(({editorState:n})=>{let r=!1;n.read(()=>{r=Cr((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();Cr(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{r(),n()}},[e]),null}function Bc(e,t){let n=new Map;return Array.from(e||[]).forEach(e=>{e.type.startsWith(`image/`)&&n.set(`${e.name}-${e.size}-${e.lastModified}`,e)}),Array.from(t||[]).forEach(e=>{if(e.kind!==`file`||!e.type.startsWith(`image/`))return;let t=e.getAsFile();t&&n.set(`${t.name}-${t.size}-${t.lastModified}`,t)}),Array.from(n.values())}async function Vc(e,t,n){if(e.size>5242880)return window.alert(t),null;let r=await n(e);return{altText:e.name,src:r}}function Hc(){let[e]=(0,h.useLexicalComposerContext)(),n=U(),r=di();return(0,A.useEffect)(()=>{let i=async t=>{for(let i of t){let t=null;try{t=await Vc(i,n.alerts.imageSizeLimit,r)}catch(e){console.error(e),window.alert(n.alerts.imageUploadFailed)}t&&e.dispatchCommand(Be,t)}},a=e.registerCommand(Be,e=>{let n=Ii(e);return(0,m.$insertNodeToNearestRoot)(n),n.insertAfter((0,t.$createParagraphNode)()),!0},t.COMMAND_PRIORITY_EDITOR),o=e.registerCommand(t.PASTE_COMMAND,e=>{if(!(e instanceof ClipboardEvent))return!1;let t=Bc(e.clipboardData?.files,e.clipboardData?.items);return t.length===0?!1:(e.preventDefault(),i(t),!0)},t.COMMAND_PRIORITY_LOW),s=e.registerCommand(t.DRAGOVER_COMMAND,e=>Bc(e.dataTransfer?.files,e.dataTransfer?.items).length===0?!1:(e.preventDefault(),!0),t.COMMAND_PRIORITY_LOW),c=e.registerCommand(t.DROP_COMMAND,e=>{let t=Bc(e.dataTransfer?.files,e.dataTransfer?.items);return t.length===0?!1:(e.preventDefault(),i(t),!0)},t.COMMAND_PRIORITY_LOW);return()=>{a(),o(),s(),c()}},[e,n.alerts.imageSizeLimit,n.alerts.imageUploadFailed,r]),null}function Uc(e){return e.metaKey||e.ctrlKey}function Wc(e){return e instanceof HTMLElement?[`INPUT`,`SELECT`,`TEXTAREA`].includes(e.tagName):!1}function Gc(){let[e]=(0,h.useLexicalComposerContext)(),n=V();return(0,A.useEffect)(()=>{let r=()=>{ga(e),n(Rt({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(B({backgroundColor:L.backgroundColor,fontFamily:L.fontFamily,fontSize:L.fontSize,lineHeight:L.lineHeight,textColor:L.textColor})),n(Mt({alignment:L.alignment,listType:L.listType}))};return e.registerCommand(t.KEY_DOWN_COMMAND,n=>{if(!Uc(n)||n.altKey||Wc(n.target))return!1;let i=n.key.toLowerCase(),a=n.shiftKey;return i===`b`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`bold`),!0):i===`i`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`italic`),!0):i===`u`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`underline`),!0):i===`x`&&a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`strikethrough`),!0):n.key===`=`&&!a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`subscript`),!0):(n.key===`=`||n.key===`+`)&&a?(n.preventDefault(),e.dispatchCommand(t.FORMAT_TEXT_COMMAND,`superscript`),!0):i===`z`&&!a?(n.preventDefault(),e.dispatchCommand(t.UNDO_COMMAND,void 0),!0):i===`z`&&a||i===`y`?(n.preventDefault(),e.dispatchCommand(t.REDO_COMMAND,void 0),!0):i===`k`&&!a?(n.preventDefault(),window.dispatchEvent(new CustomEvent(Ue)),!0):n.key===`7`&&a?(n.preventDefault(),e.dispatchCommand(f.INSERT_ORDERED_LIST_COMMAND,void 0),!0):n.key===`8`&&a?(n.preventDefault(),e.dispatchCommand(f.INSERT_UNORDERED_LIST_COMMAND,void 0),!0):n.key===`[`&&!a?(n.preventDefault(),e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),!0):n.key===`]`&&!a?(n.preventDefault(),e.dispatchCommand(t.INDENT_CONTENT_COMMAND,void 0),!0):n.key===`\\`&&!a?(n.preventDefault(),r(),!0):a?i===`l`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`left`),!0):i===`c`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`center`),!0):i===`r`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`right`),!0):i===`j`?(n.preventDefault(),e.dispatchCommand(t.FORMAT_ELEMENT_COMMAND,`justify`),!0):!1:!1},t.COMMAND_PRIORITY_CRITICAL)},[n,e]),null}function Kc(e){return(0,p.$isTableNode)(e)||Y(e)||Hi(e)}function qc(){let[e]=(0,h.useLexicalComposerContext)();return(0,A.useEffect)(()=>e.registerUpdateListener(({editorState:n})=>{let r=!1,i=null;n.read(()=>{let e=(0,t.$getRoot)().getChildren();r=Kc(e.at(-1));for(let t=0;t<e.length-1;t+=1)if(Kc(e[t])&&Kc(e[t+1])){i=e[t].getKey();break}}),!(!r&&!i)&&e.update(()=>{if(i){let e=(0,t.$getRoot)().getChildren().find(e=>e.getKey()===i);if(Kc(e)){e.insertAfter((0,t.$createParagraphNode)());return}}let e=(0,t.$getRoot)().getLastChild();Kc(e)&&e.insertAfter((0,t.$createParagraphNode)())})}),[e]),null}function Jc(){let[e]=(0,h.useLexicalComposerContext)();return(0,A.useEffect)(()=>{let n=e.registerCommand(Ve,e=>{let n=Vi(e),r=(0,t.$createParagraphNode)();return(0,m.$insertNodeToNearestRoot)(n),n.insertAfter(r),r.select(),!0},t.COMMAND_PRIORITY_EDITOR),r=e.registerUpdateListener(({editorState:n})=>{let r=!1;n.read(()=>{r=Hi((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();Hi(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{n(),r()}},[e]),null}var Yc=[`words`,`characters`,`selection`,`language`,`mode`,`zoom`],Xc={characters:0,isSelectionCollapsed:!0,selectedCharacters:0,selectedWords:0,words:0};function Zc(e,t){return e.characters===t.characters&&e.isSelectionCollapsed===t.isSelectionCollapsed&&e.selectedCharacters===t.selectedCharacters&&e.selectedWords===t.selectedWords&&e.words===t.words}function Qc(e,t,n){return e===`words`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{className:`rj-editor-footer-item-value`,children:t.words}),(0,u.jsx)(`span`,{children:n.footer.words})]}):e===`characters`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{className:`rj-editor-footer-item-value`,children:t.characters}),(0,u.jsx)(`span`,{children:n.footer.characters})]}):e===`selection`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{children:n.footer.selected}),(0,u.jsxs)(`span`,{className:`rj-editor-footer-item-value`,children:[t.selectedWords,`/`,t.selectedCharacters]})]}):e===`language`?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{children:n.footer.language}),(0,u.jsx)(`span`,{className:`rj-editor-footer-item-value`,children:t.language})]}):e===`mode`?(0,u.jsx)(`span`,{className:`rj-editor-footer-item-value`,children:t.isFullscreen?n.footer.fullscreen:t.isFocused?n.footer.focus:n.footer.editing}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{children:n.footer.zoom}),(0,u.jsxs)(`span`,{className:`rj-editor-footer-item-value`,children:[t.zoom,`%`]})]})}var $c=A.default.memo(function({customFooter:e,isFocused:n,isFullscreen:r,items:i,language:a,zoom:o}){let[s]=(0,h.useLexicalComposerContext)(),c=U(),[l,d]=A.default.useState(Xc),f=A.default.useCallback(()=>{s.getEditorState().read(()=>{let e=(0,t.$getRoot)().getTextContent(),n=(0,t.$getSelection)(),r=(0,t.$isRangeSelection)(n)?n.getTextContent():``,i={characters:me(e),isSelectionCollapsed:!(0,t.$isRangeSelection)(n)||n.isCollapsed(),selectedCharacters:me(r),selectedWords:he(r),words:he(e)};d(e=>Zc(e,i)?e:i)})},[s]);A.default.useEffect(()=>(f(),s.registerUpdateListener(()=>{f()})),[s,f]),A.default.useEffect(()=>s.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(f(),!1),t.COMMAND_PRIORITY_LOW),[s,f]);let p=A.default.useMemo(()=>({...l,isFocused:n,isFullscreen:r,language:a,zoom:o}),[n,r,a,l,o]);if(e)return(0,u.jsx)(`footer`,{"aria-label":c.footer.statusBar,className:`rj-editor-footer`,children:e(p)});let m=i?.length?i:Yc;return(0,u.jsx)(`footer`,{"aria-label":c.footer.statusBar,className:`rj-editor-footer`,children:(0,u.jsx)(`div`,{className:`rj-editor-footer-items`,children:m.map((e,t)=>(0,u.jsxs)(A.default.Fragment,{children:[t>0&&e===`mode`?(0,u.jsx)(`span`,{className:`rj-editor-footer-spacer`}):null,(0,u.jsx)(`span`,{className:`rj-editor-footer-item`,"data-rj-editor-footer-item":e,children:Qc(e,p,c)})]},`${e}-${t}`))})})});function el(e,t,n){n&&e.read(()=>{n(pt((0,i.$generateHtmlFromNodes)(t),t),JSON.stringify(e.toJSON()),e)})}function tl({lastHtmlRef:e,value:t}){let[n]=(0,h.useLexicalComposerContext)();return A.default.useEffect(()=>{t===void 0||t===e.current||n.update(()=>{At(n,t),e.current=t})},[n,e,t]),null}function nl({autofocus:e,className:t,editorRef:n,footer:r,footerItems:a,footerLanguageLabel:o,footerZoom:s,id:c,isFullscreen:l,onBlur:d,onChange:f,onFocus:p,onToggleFullscreen:m,placeholder:h,showFooter:g,theme:E,value:D}){let O=U(),k=A.default.useRef(D),[ee,te]=A.default.useState(!1);return(0,u.jsxs)(`div`,{className:[`rj-editor`,l?`rj-editor--fullscreen`:``,t].filter(Boolean).join(` `),"data-rj-editor-theme":E,id:c,onBlur:e=>{let t=e.relatedTarget;e.currentTarget.contains(t)||te(!1),d?.(e)},onFocus:e=>{te(!0),p?.(e)},ref:n,children:[(0,u.jsx)(Lc,{isFullscreen:l,onToggleFullscreen:m}),(0,u.jsxs)(`div`,{className:`rj-editor-body`,children:[(0,u.jsx)(w.RichTextPlugin,{contentEditable:(0,u.jsx)(v.ContentEditable,{className:`rj-editor-input`}),ErrorBoundary:y.LexicalErrorBoundary,placeholder:(0,u.jsx)(`div`,{className:`rj-editor-placeholder`,children:h===void 0?O.placeholders.editor:h})}),(0,u.jsx)(b.HistoryPlugin,{}),(0,u.jsx)(zc,{}),(0,u.jsx)(Rc,{}),(0,u.jsx)(Hc,{}),(0,u.jsx)(Gc,{}),(0,u.jsx)(Jc,{}),(0,u.jsx)(x.LinkPlugin,{}),(0,u.jsx)(S.ListPlugin,{}),(0,u.jsx)(T.TablePlugin,{}),(0,u.jsx)(qc,{}),(0,u.jsx)(ea,{}),(0,u.jsx)(tl,{lastHtmlRef:k,value:D}),(0,u.jsx)(C.OnChangePlugin,{onChange:(e,t)=>{e.read(()=>{k.current=pt((0,i.$generateHtmlFromNodes)(t),t)}),el(e,t,f)}}),e?(0,u.jsx)(_.AutoFocusPlugin,{}):null]}),g?(0,u.jsx)($c,{customFooter:r,isFocused:ee,isFullscreen:l,items:a,language:o,zoom:s}):null]})}function rl({autofocus:e=!1,className:t,defaultValue:n,footer:r,footerItems:i,footerLanguageLabel:s,footerZoom:l=100,id:d,locale:f=`en`,locales:p,namespace:m=`RJEditor`,onBlur:h,onChange:g,onFocus:_,onUpload:v,placeholder:y,showFooter:b=!1,translations:x,theme:S=`auto`,value:C}){let w=A.default.useMemo(()=>Bt(),[]),T=A.default.useRef(null),[E,D]=A.default.useState(!1),O=an(S),k=A.default.useMemo(()=>Zt(O),[O]),ee=Wi({defaultValue:n,namespace:m,value:C});A.default.useEffect(()=>{let e=()=>{D(document.fullscreenElement===T.current)};return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e)}},[]);let te=async()=>{if(document.fullscreenElement===T.current){await document.exitFullscreen();return}await T.current?.requestFullscreen()},ne=A.default.useCallback(e=>document.fullscreenElement||T.current||e?.parentElement||document.body,[]);return(0,u.jsx)(c.Provider,{store:w,children:(0,u.jsx)(Jt,{locale:f,locales:p,translations:x,children:(0,u.jsx)(Qt.Provider,{value:O,children:(0,u.jsx)(o.ConfigProvider,{getPopupContainer:ne,theme:k,children:(0,u.jsx)(a.LexicalComposer,{initialConfig:ee,children:(0,u.jsx)(Gi,{onImageUpload:v,children:(0,u.jsx)(nl,{autofocus:e,className:t,editorRef:T,footer:r,footerItems:i,footerLanguageLabel:s||il(f),footerZoom:l,id:d,isFullscreen:E,onBlur:h,onChange:g,onFocus:_,onToggleFullscreen:te,placeholder:y,showFooter:b,theme:O,value:C})})})})})})})}function il(e){return e===`uz`?`O‘zbek`:e===`ru`?`Русский`:e===`en`?`English`:e}St(),e.RJEditorI18nProvider=Jt,e.RJTextEditor=rl,e.enTranslations=Vt,e.mergeTranslations=Ut,e.ruTranslations=Wt,e.useRJEditorI18n=U,e.uzTranslations=Gt});
|