rj-editor 1.1.8 → 1.3.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.
@@ -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-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*/";
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:#3a3a3a;--rj-color-table-header-bg:#252525;--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-input code:not(.rj-editor-code-block){background:var(--rj-editor-inline-code-current-bg,var(--rj-editor-inline-code-bg,#2a2828));border:.0625rem solid var(--rj-editor-inline-code-border,#ffffff24);color:var(--rj-editor-inline-code-current-text,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-input a code:not(.rj-editor-code-block),.rj-editor-input code:not(.rj-editor-code-block) a{--rj-editor-inline-code-current-text:var(--rj-editor-link,#2563eb)}.rj-editor-input code:not(.rj-editor-code-block) .rj-editor-text-code{border-radius:inherit;color:inherit;font:inherit;line-height:inherit;white-space:inherit;background:0 0;border:0;padding:0}.rj-editor-input pre.rj-editor-code-block code{color:inherit;font:inherit;line-height:inherit;background:0 0;border:0;border-radius:0;padding:0}.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-rj-code-title);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;justify-content:space-between;align-items:center;gap:.625rem;max-width:calc(100% - 1rem);display:flex;position:absolute}.rj-editor-code-block-title-control{background:var(--rj-editor-code-header-bg,#111214);color:var(--rj-editor-code-muted,#a1a1aa);flex:auto;align-items:center;gap:.75rem;min-width:0;height:1.75rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.75rem;display:inline-flex}.rj-editor-code-block-title-control input{color:inherit;font:inherit;text-overflow:ellipsis;background:0 0;border:0;outline:0;flex:auto;min-width:0;padding:0}.rj-editor-code-block-title-control input:focus{color:var(--rj-editor-code-text,#ededed)}.rj-editor-code-block-action-controls{flex:none;justify-content:flex-end;align-items:center;gap:.3125rem;min-width:0;display:inline-flex}.rj-editor-code-block-language-select{flex:0 0 clamp(9rem,26vw,15.625rem);width:clamp(9rem,26vw,15.625rem);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-selection-search-input,.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-completion{z-index:25;background:#181818;border:.0625rem solid #34363a;border-radius:.5rem;gap:.125rem;min-width:11.25rem;max-height:14.375rem;padding:.25rem;display:grid;position:absolute;overflow:auto;box-shadow:0 .75rem 1.75rem #0000003d}.rj-editor-code-completion button{color:#ededed;cursor:pointer;text-align:left;white-space:nowrap;background:0 0;border:0;border-radius:.375rem;min-height:1.875rem;padding:.375rem .625rem;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:.75rem;line-height:1.35}.rj-editor-code-completion button:hover,.rj-editor-code-completion button.is-active{color:#fff;background:#303030}.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:.0625rem solid var(--rj-editor-table-border,#cbd5e1);border-collapse:separate;border-spacing:0;table-layout:fixed;border-radius:.75rem;width:100%;overflow:hidden}.rj-editor-table-cell,.rj-editor-table-cell-header{border:0;border-bottom:.0625rem solid var(--rj-editor-table-border,#cbd5e1);border-right:.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-row:last-child .rj-editor-table-cell,.rj-editor-table-row:last-child .rj-editor-table-cell-header,.rj-editor-table tr:last-child .rj-editor-table-cell,.rj-editor-table tr:last-child .rj-editor-table-cell-header{border-bottom:0}.rj-editor-table-cell:last-child,.rj-editor-table-cell-header:last-child{border-right:0}.rj-editor-table tr:first-child .rj-editor-table-cell:first-child,.rj-editor-table tr:first-child .rj-editor-table-cell-header:first-child{border-top-left-radius:.75rem}.rj-editor-table tr:first-child .rj-editor-table-cell:last-child,.rj-editor-table tr:first-child .rj-editor-table-cell-header:last-child{border-top-right-radius:.75rem}.rj-editor-table tr:last-child .rj-editor-table-cell:first-child,.rj-editor-table tr:last-child .rj-editor-table-cell-header:first-child{border-bottom-left-radius:.75rem}.rj-editor-table tr:last-child .rj-editor-table-cell:last-child,.rj-editor-table tr:last-child .rj-editor-table-cell-header:last-child{border-bottom-right-radius:.75rem}.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,67 @@ 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,k=Object.defineProperty,te=Object.getOwnPropertyDescriptor,ne=Object.getOwnPropertyNames,re=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,ae=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ne(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ie.call(e,s)&&s!==n&&k(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=te(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:ee(re(e)),ae(t||!e||!e.__esModule?k(n,`default`,{value:e,enumerable:!0}):n,e));n=A(n,1),s=A(s,1);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 se(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 ce(e){return typeof e!=`string`}function le(e,t,n){return ce(e)?M(e,t,n):e}function M(e,t,n){let[r,...i]=t.split(`>`);if(i.length>0){let t=i.join(`>`);return M(e,r,le(ue(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!ce(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 ue(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 N(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,N(t)]}}return{items:[e,N(t)],kind:`row`}}function fe(e,t,n,r){let i=se(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=N(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?M(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:M(e,t,de(a,n,r)),selection:{end:o+n.length,start:o+n.length}}}function pe(e,t,n){return typeof t==`number`&&e<t?t:typeof n==`number`&&e>n?n:e}async function me(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 he(e){return Array.from(e.replace(/\n/g,``)).length}function ge(e){let t=e.replace(/\u00a0/g,` `).trim();return t?t.split(/\s+/).length:0}var _e=`rj-equation-model:`;function ve(e){return e.startsWith(_e)}function ye(e){if(!ve(e))return null;try{return JSON.parse(decodeURIComponent(e.slice(_e.length)))}catch{return null}}function be(e){return`${_e}${encodeURIComponent(JSON.stringify(e))}`}var xe={"&":`&amp;`,'"':`&quot;`,"'":`&#39;`,"<":`&lt;`,">":`&gt;`};function Se(e){return e.replace(/[&"'<>]/g,e=>xe[e])}function Ce(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 we(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function P(e,t){return`${e.replace(/\bMOD\b/g,we()?`CMD`:`CTRL`)} | ${t}`}function F(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>${F(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 Te=/^[a-zA-Z0-9_-]{11}$/;function Ee(e){let t=e.trim();if(Te.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&&Te.test(t)?t:null}if(n===`youtube.com`||n===`m.youtube.com`||n===`youtube-nocookie.com`){let t=e.searchParams.get(`v`);if(t&&Te.test(t))return t;let[,n,r]=e.pathname.split(`/`);if([`embed`,`live`,`shorts`].includes(n)&&r&&Te.test(r))return r}}catch{return null}return null}function De(e){return{kind:`text`,value:e}}function Oe(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?De(a):null,t,o?De(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 ke(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 Ae(e){let t=e.split(`>`);return t.at(-1)===`text.value`?t.slice(0,-1).join(`>`):null}function je(e,t){return e?`${e}>${t}`:t}function Me(e,t,n,r){if(typeof t==`string`&&!t.trim())return je(e,`row.items.0>${F(n)}`);if(typeof t==`string`)return je(e,`row.items.${r?.start&&r.start>0?1:0}>${F(n)}`);if(typeof t!=`string`&&t.kind===`row`){let r=t.items.at(-1);return je(e,`row.items.${r?.kind===`text`&&typeof r.value==`string`&&!r.value.trim()?t.items.length-1:t.items.length}>${F(n)}`)}return je(e,`row.items.1>${F(n)}`)}function Ne(e,t,n,r){let i=se(t);if(i){let t=ke(e,i.rowSlotId);if(!t)return{activeSlotId:F(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:je(i.rowSlotId,`row.items.${r}>${F(n)}`),model:i.rowSlotId?M(e,i.rowSlotId,a):a}}let a=Ae(t),o=j(e,t),s=Oe(o,n,r);return a===null?{activeSlotId:Me(t,o,n,r),model:M(e,t,s)}:{activeSlotId:Me(a,o,n,r),model:a?M(e,a,s):s}}function Pe(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 Fe=[`#FFFFFF`,`#FEF3C7`,`#DBEAFE`,`#DCFCE7`,`#FCE7F3`,`#EDE9FE`,`#E5E7EB`],Ie=`rj-editor-equation-insert`,Le=[`Arial`,`Georgia`,`Inter`,`Times New Roman`,`Trebuchet MS`,`Verdana`],Re=[`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:``},ze=(0,t.createCommand)(`INSERT_CODE_BLOCK_COMMAND`),Be=(0,t.createCommand)(`INSERT_EQUATION_COMMAND`),Ve=(0,t.createCommand)(`INSERT_IMAGE_COMMAND`),He=(0,t.createCommand)(`INSERT_YOUTUBE_COMMAND`),Ue=[`1`,`1.15`,`1.5`,`2`,`2.5`,`3`],We=`rj-editor:open-link-modal`,Ge=[`#111827`,`#dc2626`,`#2563eb`,`#059669`,`#9333ea`,`#ca8a04`];function Ke(e){return e.trim().replace(/^['"]|['"]$/g,``).toLowerCase()}function qe(e){if(!e)return;let t=e.split(`,`).map(Ke);return Le.find(e=>t.includes(Ke(e)))}function Je(e){return e.trim().toLowerCase()}function Ye(e){if(!e)return;let t=Je(e);return Re.find(e=>Je(e)===t)}var Xe=16;function L(e){let t=e/Xe;return`${Number(t.toFixed(6))}rem`}var Ze={borderCollapse:`collapse`,tableLayout:`fixed`,width:`100%`},Qe={border:`0.0625rem solid var(--rj-editor-table-border, #cbd5e1)`,minWidth:`5rem`,padding:`0.5rem 0.625rem`},$e=`rgb(242, 243, 245)`,et=`var(--rj-editor-table-header-bg, #f1f5f9)`,tt=`[data-rj-editor-content="true"]`,nt=`pre.rj-editor-code-block`;function rt(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 it(e){e.querySelectorAll(nt).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(rt(e)),t.classList.add(`rj-editor-code-block--exported`),t.replaceWith(n),r.append(i,a),n.append(r,t)})}function at(e,t){Object.entries(t).forEach(([t,n])=>{typeof n==`string`&&e.style.setProperty(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),n)})}function ot(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 st(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 ct(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 lt(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 ut(e){if(!lt(e)||e.body.children.length===1&&e.body.firstElementChild?.matches(tt))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 dt(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`,ot(a,r,i),t.style.float=``,t.style.margin=`0`,t.style.width=`100%`,t.replaceWith(a),a.append(ct(e,t,t.getAttribute(`data-link-url`)),st(e,n)),!0}function ft(e){return(Number(e||0)%360+360)%360}function pt(e,t,n){let r=t.getAttribute(`data-rj-image-node-key`),i=ft(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)),ot(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(ct(e,t,d)),m.append(p),u&&m.append(st(e,u)),!0}function mt(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`),at(e,Ze)}),n.querySelectorAll(`td, th`).forEach(e=>{let t=e,n=e.tagName.toLowerCase()===`th`,r=t.style.backgroundColor===$e;t.classList.add(n?`rj-editor-table-cell-header`:`rj-editor-table-cell`),at(t,Qe),t.style.verticalAlign||(t.style.verticalAlign=`top`),n&&(!t.style.backgroundColor||r)&&(t.style.backgroundColor=et,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`);pt(n,r,t)||(r.style.display=`block`,r.style.maxWidth=`100%`,ot(r,i,a),dt(n,r)||ct(n,r,r.getAttribute(`data-link-url`)))}),it(n),ut(n),n.body.innerHTML}function ht(e,t){return typeof e!=`number`||Number.isNaN(e)?``:Ce(String(e),t)}var gt=1200,_t=700;function vt(){return document.fullscreenElement?new Promise(e=>{let t=()=>{window.clearTimeout(n),document.removeEventListener(`fullscreenchange`,t),e()},n=window.setTimeout(t,gt);document.addEventListener(`fullscreenchange`,t,{once:!0})}):Promise.resolve()}function yt(){return new Promise(e=>{window.setTimeout(e,_t)})}async function bt(e){if(e){if(document.fullscreenElement)try{let e=vt();await document.exitFullscreen(),await e,await yt()}catch{}e.ownerDocument.defaultView?.focus(),e.click()}}function xt(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 St=!1;function Ct(){St||typeof document>`u`||(St=!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 me(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`?kt(e):`<span class="rj-editor-equation-render-slot">${Se(e?.trim()||t)}</span>`}function wt(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function Tt(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function Et(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}function Dt(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 Ot(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 kt(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]=wt(e.bracket);return`<span class="rj-editor-equation-render rj-editor-equation-render--bracket"><span class="rj-editor-equation-render-bracket">${Se(t)}</span>${R(e.value,`x`)}<span class="rj-editor-equation-render-bracket">${Se(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">${Et(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">${Tt(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">${Ot(e)}</span>`;case`operator`:return`<span class="rj-editor-equation-render">${Se(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="${Dt(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="${Dt(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(kt).join(``)}</span>`;default:return``}}function At(e,t){let r=ye(e);return r?kt(r):n.default.renderToString(e,{displayMode:t===`block`,output:`mathml`,strict:!1,throwOnError:!1,trust:!1})}function jt(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 Mt=(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:Nt,setCanRedo:Pt,setCanUndo:Ft,setEquationFormats:It,setImageFormats:Lt,setStyleFormats:z,setTableFormats:Rt,setTextFormats:zt}=Mt.actions,Bt=Mt.reducer,Vt=()=>(0,l.configureStore)({reducer:{toolbar:Bt}});Vt();var B=c.useDispatch.withTypes(),V=c.useSelector.withTypes(),Ht={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`},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 Ut(e){return!e||typeof e!=`object`?e:Array.isArray(e)?e.map(e=>Ut(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Ut(t)]))}function Wt(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]=Wt(r,n);return}e[t]=n}),e),Ut(e))}var Gt=Wt(Ht,{alerts:{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:`Необязательно`}}}),Kt=Wt(Ht,{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`},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`}}}),qt=s.default.createContext(Kt),Jt={en:Ht,ru:Gt,uz:Kt};function Yt({children:e,locale:t=`uz`,locales:n,translations:r}){let i=s.default.useMemo(()=>Wt(Jt[t]||Ht,n?.[t],r),[t,n,r]);return(0,u.jsx)(qt.Provider,{value:i,children:e})}function H(){return s.default.useContext(qt)}var Xt={algorithm:o.theme.defaultAlgorithm,token:{colorPrimary:`#3167c8`}},Zt={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 Qt(e){return e===`dark`?Zt:Xt}var $t=s.default.createContext(`light`);function en(){return s.default.useContext($t)}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 tn(e){if(!e)return;let t=U(e.dataset.rjEditorTheme)||U(e.dataset.colorScheme)||U(e.dataset.theme)||U(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?U(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)||U(r)||(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)}function an(e){let[t,n]=s.default.useState(()=>rn());return s.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=`□`,sn=`x + y = z`;function cn(e,t,n){let r=Array.from(e||t||on).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 ln(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 un(e){e.stopPropagation()}function dn(e){let t=e.selectionStart??e.value.length;return{end:e.selectionEnd??t,start:t}}function fn({className:e,inputRef:t,onActiveSlotChange:n,onSlotSelectionChange:r,onSlotChange:i,placeholder:a=on,slotId:o,value:s}){let c=e=>{un(e),n(o),r(o,dn(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,dn(e.currentTarget))},onClick:c,onFocus:c,onKeyDown:un,onKeyUp:c,onMouseDown:un,onSelect:c,placeholder:a,ref:t,size:Math.max(1,Math.min(Array.from(s||a).length+1,12)),style:{width:cn(s,a,e)},type:`text`,value:s})}function pn(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function mn(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function hn(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}var gn=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=on)=>{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)(fn,{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]=pn(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:hn(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:mn(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:ln(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:ln(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?on:sn)})});function _n(e,n){let r=(0,t.$getNodeByKey)(e);Sn(r)&&n(r)}var vn=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(()=>ye(n),[n]),x=s.default.useMemo(()=>n.trim()?At(n,e):``,[e,n]),S=s.default.useMemo(()=>!b&&!/[\\{}_^]/.test(n),[n,b]),C=s.default.useCallback(t=>{i.update(()=>{_n(r,e=>{Sn(e)&&e.setEquation(t)})}),a(It({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(be(e))},[C]),D=s.default.useCallback((e,t)=>{b&&E(M(b,e,t))},[b,E]),O=s.default.useCallback(()=>{y(),v(!0),b&&w(o.current||F(b)),a(It({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(F(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(()=>{_n(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(()=>{_n(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=ye(t);if(r){if(b){let e=o.current||F(b),t=Ne(b,e,r,c.current[e]);w(t.activeSlotId),E(t.model);return}w(F(r)),E(r);return}if(b){let e=o.current||F(b),n=fe(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(Ie,e),()=>{window.removeEventListener(Ie,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)(gn,{activeSlotId:d||F(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 yn(e){let t=e.getAttribute(`data-equation`);return t?{node:xn({displayMode:e.getAttribute(`data-display-mode`)===`inline`?`inline`:`block`,equation:t})}:null}var bn=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:yn,priority:1}:null,span:e=>e.hasAttribute(`data-equation`)?{conversion:yn,priority:1}:null}}static importJSON(e){return xn({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)(vn,{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=At(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 xn({displayMode:e=`block`,equation:t}){return new bn(t,e)}function Sn(e){return e instanceof bn}var Cn=[`b`,`code`,`em`,`font`,`i`,`mark`,`s`,`span`,`strong`,`sub`,`sup`,`u`];function wn(e){let t=[],n=e.style.backgroundColor,r=e.style.color||e.getAttribute(`color`)||``,i=qe(e.style.fontFamily||e.getAttribute(`face`)||``),a=Ye(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 Tn(e,t){return e?t?`${e}; ${t}`:e:t}function En(e){return e?{...e,conversion:n=>{let r=e.conversion(n);if(!r)return r;let i=r.forChild,a=wn(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(Tn(r.getStyle(),a)),o&&!r.hasFormat(`code`)&&r.toggleFormat(`code`)),r}}}}:null}function Dn(e,t){return t.setDetail(e.getDetail()),t.setFormat(e.getFormat()),t.setMode(e.getMode()),t.setStyle(e.getStyle()),t}var On=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 Cn.forEach(t=>{let r=e[t];r&&(n[t]=e=>En(r(e)))}),n}static importJSON(e){return kn(e.text).updateFromJSON(e)}constructor(e=``,t){super(e,t)}exportJSON(){return{...super.exportJSON(),type:`extended-text`,version:1}}};function kn(e=``){return new On(e)}function An(e){return Dn(e,kn(e.getTextContent()))}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:`M18 10H6M21 6H3M21 14H3M18 18H6`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Mn(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 Nn(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 Pn(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 Fn(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 In=100,Ln=2e3,Rn=10,zn=32,Bn=42,Vn=340,Hn=12,Un=[`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 Wn(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-Vn-8),o=Math.max(8,n.height-Bn-8),s=r+Hn,c=i+Hn;return{x:Math.min(Math.max(s,8),a),y:Math.max(c>o?i-Bn-Hn:c,8)}}function Gn({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,k]=s.default.useState({x:0,y:0}),[te,ne]=s.default.useState(0),[re,ie]=s.default.useState(1),ae=(p%360+360)%360,A=ae===90||ae===270,oe=v===`square`&&e!==`center`;s.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()}},[]),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 j=e=>{b.update(()=>{W(d,t=>{K(t)&&t.setAlignment(e)})})},se=e=>{b.update(()=>{W(d,t=>{K(t)&&t.setWidth(Math.min(In,Math.max(Rn,e)))})})},ce=(e,t)=>{b.update(()=>{W(d,n=>{K(n)&&(n.setWidth(Math.min(In,Math.max(Rn,e))),n.setHeight(t===void 0?void 0:Math.min(Ln,Math.max(zn,t))))})}),w(!0)},le=(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;ce(s+e/r.width*100,t/u);return}ce(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)},M=()=>{b.update(()=>{W(d,e=>{e?.remove()})})},ue=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 xt(t);b.update(()=>{W(d,e=>{K(e)&&(e.setSrc(n),e.setAltText(t.name))})})},N=te>0?te*y/100:void 0,de=c??(N?N/re:void 0),fe=A&&de?de:void 0,pe=A&&N?N:void 0,me={"--rj-image-rotated-aspect-ratio":`1 / ${re}`,height:pe?L(pe):void 0,width:A&&fe?L(fe):oe?`100%`:`${y}%`},he=oe?{maxWidth:`100%`,width:A&&fe?L(fe):`${y}%`}:void 0,ge=(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:_,style:{borderRadius:a,height:c?L(c):void 0,objectFit:f}}),_e={"--rj-image-rotation":`${p}deg`,height:A&&de?L(de):void 0,width:A&&N?L(N):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:he,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:()=>j(`left`),type:`button`,children:(0,u.jsx)(Mn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.alignCenter,onClick:()=>j(`center`),type:`button`,children:(0,u.jsx)(jn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.alignRight,onClick:()=>j(`right`),type:`button`,children:(0,u.jsx)(Nn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{onClick:()=>se(25),type:`button`,children:`25%`}),(0,u.jsx)(`button`,{onClick:()=>se(50),type:`button`,children:`50%`}),(0,u.jsx)(`button`,{onClick:()=>se(100),type:`button`,children:`100%`}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.replace,onClick:()=>void bt(E.current),type:`button`,children:(0,u.jsx)(Fn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":x.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,onClick:M,type:`button`,children:(0,u.jsx)(Pn,{"aria-hidden":`true`})})]}):null,(0,u.jsxs)(`span`,{className:[`rj-editor-image-box`,i?`has-border`:``,m?`has-shadow`:``,r?`is-aspect-ratio-locked`:``,A?`is-quarter-turn`:``].filter(Boolean).join(` `),onClick:t=>{t.preventDefault(),t.stopPropagation(),T(),w(!0),k(Wn(t,D.current)),S(Lt({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:me,children:[(0,u.jsx)(`span`,{className:`rj-editor-image-rotator`,style:_e,children:l?(0,u.jsx)(`a`,{className:`rj-editor-image-link`,href:l,rel:`noreferrer`,target:`_blank`,children:ge}):ge}),o?(0,u.jsx)(`span`,{className:`rj-editor-image-caption`,children:o}):null,C?(0,u.jsx)(u.Fragment,{children:Un.map(e=>(0,u.jsx)(`span`,{"aria-hidden":`true`,className:[`rj-editor-image-resize-handle`,`rj-editor-image-resize-handle--${e}`].join(` `),onPointerDown:t=>le(t,e)},e))}):null]}),(0,u.jsx)(`input`,{accept:`image/*`,className:`rj-editor-hidden-file-input`,onChange:ue,ref:E,type:`file`})]})}function Kn(e){return e===`square`||e===`around`?`square`:`top-bottom`}function qn(e){return e===`left`||e===`right`||e===`center`?e:`center`}function Jn(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 Yn(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 Xn(e){let t=e.getAttribute(`data-alignment`);if(t)return qn(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 Zn(e){let t=e.getAttribute(`data-text-wrap`);return t?Kn(t):(e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e).style.float?`square`:`top-bottom`}function Qn(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 $n(e){return e.getAttribute(`data-link-url`)||e.closest(`a`)?.href||``}function er(e){if(!(e instanceof HTMLImageElement))return null;let t=e.getAttribute(`src`);return t?{node:rr({alignment:Xn(e),altText:e.getAttribute(`alt`)||``,aspectRatioLocked:e.getAttribute(`data-aspect-ratio-locked`)!==`false`,borderEnabled:!!e.style.border,borderRadius:G(e.style.borderRadius)||0,caption:Qn(e),height:G(e.getAttribute(`data-height`))||G(e.style.height),linkUrl:$n(e),objectFit:Jn(e.getAttribute(`data-object-fit`)||e.style.objectFit),rotation:G(e.getAttribute(`data-rotation`))||0,shadowEnabled:!!e.style.boxShadow,src:t,textWrap:Zn(e),width:Yn(e)})}:null}function tr(e){let t=e.querySelector(`img`);return t?er(t):null}var nr=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:tr,priority:2},img:()=>({conversion:er,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:tr,priority:2}}}static importJSON(e){return rr({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:Kn(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)(Gn,{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 rr({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 nr(d,n,p,e,a,o,s,c,f,i,r,u,l,t)}function K(e){return e instanceof nr}function ir(e){let n=(0,t.$getNodeByKey)(e);lr(n)&&n.remove()}var ar=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(()=>ir(e)),!0),t.COMMAND_PRIORITY_LOW),r=i.registerCommand(t.KEY_BACKSPACE_COMMAND,t=>(t.preventDefault(),i.update(()=>ir(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 or(e){let t=Ee(e.getAttribute(`data-youtube-video-id`)||e.getAttribute(`src`)||``);return t?{node:cr({title:e.getAttribute(`title`)||``,videoId:t})}:null}var sr=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=>Ee(e.getAttribute(`src`)||``)?{conversion:or,priority:1}:null}}static importJSON(e){return cr({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)(ar,{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 cr({title:e=``,videoId:t}){return new sr(t,e)}function lr(e){return e instanceof sr}var ur={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 dr({defaultValue:e,namespace:n,value:r}){return{namespace:n,nodes:[m.CodeNode,m.CodeHighlightNode,On,{replace:t.TextNode,with:An,withKlass:On},bn,nr,sr,d.LinkNode,f.ListNode,f.ListItemNode,p.TableCellNode,p.TableNode,p.TableRowNode],onError(e){throw e},editorState:r||e?t=>jt(t,r||e||``):void 0,theme:ur}}function fr(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 pr(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 mr=190,q=8,hr=(0,m.getCodeLanguageOptions)().map(([e,t])=>({label:t,value:e})),gr={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#181818`,colorBgElevated:`#202020`,colorBorder:`#4a4a4a`,colorFillSecondary:`#303030`,colorPrimary:`#b8b8b8`,colorText:`#ededed`,colorTextPlaceholder:`#8f8f8f`,colorTextSecondary:`#b8b8b8`}};function _r({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||mr,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 me(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:gr,children:(0,u.jsx)(o.Select,{suffixIcon:(0,u.jsx)(pr,{}),"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:hr,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)(fr,{"aria-hidden":`true`})})]}):null}function vr(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 yr(){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=>vr(t,e)?t:e)};return e.getEditorState().read(n),e.registerUpdateListener(({editorState:e})=>{e.read(n)})},[e]),n.map(t=>(0,u.jsx)(_r,{editor:e,language:t.language,nodeKey:t.key},t.key))}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:`M21 10H3M21 18H3M21 6H3M21 14H3`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function xr({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:P(`MOD+SHIFT+L`,n.toolbar.alignment.left),type:`button`,children:(0,u.jsx)(Mn,{})}),(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:P(`MOD+SHIFT+C`,n.toolbar.alignment.center),type:`button`,children:(0,u.jsx)(jn,{})}),(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:P(`MOD+SHIFT+R`,n.toolbar.alignment.right),type:`button`,children:(0,u.jsx)(Nn,{})}),(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:P(`MOD+SHIFT+J`,n.toolbar.alignment.justify),type:`button`,children:(0,u.jsx)(br,{})})]})}function J(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`})}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:`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 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:`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 wr({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:P(`MOD+Z`,n.toolbar.shortcuts.undo),type:`button`,children:(0,u.jsx)(Sr,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.redo,disabled:!r,onClick:()=>e.dispatchCommand(t.REDO_COMMAND,void 0),title:P(`MOD+Y`,n.toolbar.shortcuts.redo),type:`button`,children:(0,u.jsx)(Cr,{})})]})}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 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 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 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 Dr(){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:P(`MOD+]`,n.toolbar.shortcuts.increaseIndent),type:`button`,children:(0,u.jsx)(Tr,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.decreaseIndent,onClick:()=>e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),title:P(`MOD+[`,n.toolbar.shortcuts.decreaseIndent),type:`button`,children:(0,u.jsx)(Er,{"aria-hidden":`true`})})]})}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 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 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:`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 Ar(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 jr({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:P(`MOD+SHIFT+8`,t.toolbar.shortcuts.bulletList),type:`button`,children:(0,u.jsx)(kr,{})}),(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:P(`MOD+SHIFT+7`,t.toolbar.shortcuts.numberedList),type:`button`,children:(0,u.jsx)(Ar,{})}),(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)(Or,{})})]})}function Mr(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 Nr(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 Pr(){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`},...Ue.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)(Mr,{"aria-hidden":`true`})})})}function Fr(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 Ir(){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]})},...Fe.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||Fe[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||Fe[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)(Fr,{})})})})}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:`M18 6L6 18M6 6L18 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Rr(){let[e]=(0,h.useLexicalComposerContext)(),t=H(),n=B();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.clearFormatting,onClick:()=>{Nr(e),n(zt({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(Nt({alignment:I.alignment,listType:I.listType}))},title:P(`MOD+\\`,t.toolbar.shortcuts.clearFormatting),type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(Lr,{})})}function zr(){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:Le.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)(pr,{})})}function Br(e){let t=Number.parseFloat(e);return Number.isFinite(t)?String(Number((t*16).toFixed(2))):e}function Vr(){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:Re.map(e=>({label:Br(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)(pr,{})})}function Hr(){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]})},...Ge.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||Ge[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||Ge[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 Ur(){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(zr,{}),(0,u.jsx)(Vr,{}),(0,u.jsx)(Hr,{}),(0,u.jsx)(Ir,{}),(0,u.jsx)(Rr,{})]})}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:`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 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:`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 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:`M17 17L22 12L17 7M7 7L2 12L7 17M14 3L10 21`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function qr(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 Jr(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 Yr(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 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:`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 Zr(){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:P(`MOD+B`,n.toolbar.shortcuts.bold),type:`button`,children:(0,u.jsx)(Gr,{})}),(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:P(`MOD+I`,n.toolbar.shortcuts.italic),type:`button`,children:(0,u.jsx)(qr,{})}),(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:P(`MOD+U`,n.toolbar.shortcuts.underline),type:`button`,children:(0,u.jsx)(Xr,{})}),(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:P(`MOD+SHIFT+X`,n.toolbar.shortcuts.strikethrough),type:`button`,children:(0,u.jsx)(Wr,{"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)(Kr,{"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:P(`MOD+=`,n.toolbar.shortcuts.subscript),type:`button`,children:(0,u.jsx)(Jr,{"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:P(`MOD+SHIFT+=`,n.toolbar.shortcuts.superscript),type:`button`,children:(0,u.jsx)(Yr,{"aria-hidden":`true`})})]})}function Qr({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)(wr,{editor:e}),(0,u.jsx)(J,{})]}),(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)(Pr,{}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(xr,{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)(Ur,{}),(0,u.jsx)(J,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(jr,{editor:e}),(0,u.jsx)(J,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(Dr,{})})]})]})}function $r(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 ei(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 ti({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(()=>ht(g?p:n,i)),x=g&&!_?ht(p,i):y,S=e=>{let n=Pe(e.target.value,t,r),s=Ce(n,i),c=Number(n);b(s),n!==``&&n!==`.`&&Number.isFinite(c)&&l?.(pe(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=pe(n,o,a);b(ht(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 ni({cancelText:e,children:t,okText:n,onCancel:r,onOk:i,open:a,title:o,width:c=420}){let l=H(),d=en(),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)(Lr,{"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 ri(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function ii(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(K);return K(n)?n:null}function ai(){let e=ii();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=ii();e&&t(e)}),e.focus()}function oi(e,n,r){e.update(()=>{let e=(0,t.$getNodeByKey)(n);K(e)&&r(e)}),e.focus()}function si(e,t){Q(e,e=>{e.setAlignment(t)})}function ci(e,t){Q(e,e=>{e.setWidth(t)})}function li(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 ui(e){Q(e,e=>{e.remove()})}function di(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 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:`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 pi(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 mi(){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:()=>si(e,`left`),type:`button`,children:(0,u.jsx)(Mn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignCenter,className:i===`center`?`is-active`:void 0,disabled:!r,onClick:()=>si(e,`center`),type:`button`,children:(0,u.jsx)(jn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignRight,className:i===`right`?`is-active`:void 0,disabled:!r,onClick:()=>si(e,`right`),type:`button`,children:(0,u.jsx)(Nn,{"aria-hidden":`true`})}),(0,u.jsx)(ri,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(ti,{"aria-label":t.toolbar.image.width,className:`rj-editor-image-width-input`,max:100,min:10,decimalScale:3,suffix:`%`,onChange:t=>ci(e,t),value:b||100}),[25,50,100].map(t=>(0,u.jsxs)(`button`,{className:b===t?`is-active`:void 0,disabled:!r,onClick:()=>ci(e,t),type:`button`,children:[t,`%`]},t)),(0,u.jsx)(ri,{})]}),(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)(ri,{})]})]}),(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)(ti,{"aria-label":t.toolbar.image.borderRadius,className:`rj-editor-image-border-radius-input`,integerOnly:!0,max:64,min:0,prefix:(0,u.jsx)(di,{}),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)(ri,{})]}),(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)(pr,{}),value:g||`contain`}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.topBottomWrap,className:y===`top-bottom`?`is-active`:void 0,disabled:!r,onClick:()=>li(e,`top-bottom`),title:t.toolbar.image.topBottomWrap,type:`button`,children:(0,u.jsx)(ei,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.squareWrap,className:y===`square`?`is-active`:void 0,disabled:!r,onClick:()=>li(e,`square`),title:t.toolbar.image.squareWrap,type:`button`,children:(0,u.jsx)($r,{"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)(fi,{})}),(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)(pi,{})}),(0,u.jsx)(ri,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.replace,disabled:!r,onClick:()=>{bt(n.current)},type:`button`,children:(0,u.jsx)(Fn,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,disabled:!r,onClick:()=>ui(e),type:`button`,children:(0,u.jsx)(Pn,{"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 xt(r);Q(e,e=>{e.setSrc(i),e.setAltText(r.name)})},ref:n,type:`file`})]})]}),(0,u.jsx)(ni,{okText:t.common.save,onCancel:O,onOk:()=>{if(!x||!p){O();return}let t=C.trim();oi(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 hi(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}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:`M16 18L22 12L16 6M8 6L2 12L8 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function _i(){let[e]=(0,h.useLexicalComposerContext)(),t=H();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.codeBlock,onClick:()=>{e.dispatchCommand(ze,{language:`plain`}),window.requestAnimationFrame(()=>e.focus())},onMouseDown:e=>e.preventDefault(),title:t.toolbar.insert.codeBlock,type:`button`,children:(0,u.jsx)(gi,{"aria-hidden":`true`})})}function vi(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 yi(){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:()=>{bt(n.current)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.image,type:`button`,children:(0,u.jsx)(vi,{})}),(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 xt(r);e.dispatchCommand(Ve,{altText:r.name,src:i}),e.focus()},ref:n,type:`file`})]})}function bi(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 xi=`noreferrer`;function Si({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(We,t),()=>{window.removeEventListener(We,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:P(`MOD+K`,i.toolbar.shortcuts.link),type:`button`,children:(0,u.jsx)(bi,{})}):null,(0,u.jsx)(ni,{okText:i.common.insert,onCancel:y,onOk:()=>{let e=m.trim();if(!e){r.focus();return}let n={rel:xi,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 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:`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 wi=1,Ti=20,Ei=8,Di=10;function Oi({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:Ei}).map((e,t)=>(0,u.jsx)(s.default.Fragment,{children:Array.from({length:Di}).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)(ti,{id:r,integerOnly:!0,max:Ti,min:wi,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)(ti,{id:i,integerOnly:!0,max:Ti,min:wi,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)(Ci,{})})})}function ki(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 Ai(){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)(ki,{"aria-hidden":`true`})}),(0,u.jsx)(ni,{okText:t.common.insert,onCancel:()=>{r(!1),d(``),e.focus()},onOk:()=>{let n=Ee(o);if(!n){d(t.toolbar.youtube.invalidUrl);return}e.dispatchCommand(He,{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 ji({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)(Oi,{onTableInserted:e}),(0,u.jsx)(Si,{enableShortcutListener:!1}),(0,u.jsx)(hi,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(yi,{}),(0,u.jsx)(Ai,{}),(0,u.jsx)(_i,{})]})]})}function Mi(){return(0,u.jsx)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`})}function Ni(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 Pi(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 Fi(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 Ii(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 Li(){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 Ri(){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=Li(),r=n?(0,D.$getNearestNodeOfType)(n,p.TableCellNode):null;return r?[r]:[]}function zi(){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=Li();return n?(0,D.$getNearestNodeOfType)(n,p.TableNode):null}function Bi(){let e=Ri(),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 Vi(e,t){$(e,()=>{(0,p.$insertTableRowAtSelection)(t)})}function Hi(e,t){$(e,()=>{(0,p.$insertTableColumnAtSelection)(t)})}function Ui(e){$(e,()=>{(0,p.$deleteTableRowAtSelection)()})}function Wi(e){$(e,()=>{(0,p.$deleteTableColumnAtSelection)()})}function Gi(e){$(e,()=>{let e=zi();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 Ki(e){$(e,()=>{let e=Ri();e.length>1&&(0,p.$mergeCells)(e)})}function qi(e){$(e,()=>{(0,p.$unmergeCell)()})}function Ji(e,t){$(e,()=>{Ri().forEach(e=>{e.setBackgroundColor(t)})})}function Yi(e,t){$(e,()=>{Ri().forEach(e=>{e.setVerticalAlign(t)})})}function Xi(e){$(e,()=>{let e=Ri()[0];if(!e)return;let[,t]=(0,p.$getNodeTriplet)(e);t.getChildren().forEach(e=>{(0,p.$isTableCellNode)(e)&&e.toggleHeaderStyle(p.TableCellHeaderStates.ROW)})})}function Zi(e){$(e,()=>{let e=Ri()[0],t=zi(),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 Qi(){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:()=>{Ji(e,null),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},{type:`divider`},...Fe.map(t=>({key:t,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{Ji(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||Fe[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:t=>{Ji(e,t.target.value),a(t.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:l||Fe[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{Ji(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)(Ni,{"aria-hidden":`true`})})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignTop,className:d===`top`?`is-active`:void 0,disabled:!c,onClick:()=>Yi(e,`top`),type:`button`,children:(0,u.jsx)(Ii,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignMiddle,className:d===`middle`?`is-active`:void 0,disabled:!c,onClick:()=>Yi(e,`middle`),type:`button`,children:(0,u.jsx)(Fi,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignBottom,className:d===`bottom`?`is-active`:void 0,disabled:!c,onClick:()=>Yi(e,`bottom`),type:`button`,children:(0,u.jsx)(Pi,{"aria-hidden":`true`})})]})}function $i(){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:()=>Hi(e,!1),type:`button`,children:t.toolbar.table.columnLeft}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnRight,disabled:n,onClick:()=>Hi(e,!0),type:`button`,children:t.toolbar.table.columnRight})]})}function ea(){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:()=>Ui(e),type:`button`,children:[(0,u.jsx)(Pn,{"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:()=>Wi(e),type:`button`,children:[(0,u.jsx)(Pn,{"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:()=>Gi(e),type:`button`,children:(0,u.jsx)(Pn,{"aria-hidden":`true`})})]})}function ta(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}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:`M9 7L4 12L9 17M15 7L20 12L15 17`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function ra(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 ia(){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:()=>Xi(e),type:`button`,title:t.toolbar.table.headerRow,children:[(0,u.jsx)(na,{}),` \xA0 `,t.toolbar.table.header]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.header,disabled:!n,onClick:()=>Zi(e),type:`button`,title:t.toolbar.table.headerColumn,children:[(0,u.jsx)(ra,{}),` \xA0 `,t.toolbar.table.header]})]})}function aa(){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:()=>Ki(e),type:`button`,children:t.toolbar.table.mergeCells}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.unmergeCell,disabled:!n||!i,onClick:()=>qi(e),type:`button`,children:t.toolbar.table.unmergeCell})]})}function oa(){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:()=>Vi(e,!1),type:`button`,children:t.toolbar.table.rowAbove}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowBelow,disabled:n,onClick:()=>Vi(e,!0),type:`button`,children:t.toolbar.table.rowBelow})]})}function sa(){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)(oa,{}),(0,u.jsx)(ta,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)($i,{}),(0,u.jsx)(ta,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(aa,{}),(0,u.jsx)(ta,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Qi,{}),(0,u.jsx)(ta,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(ia,{}),(0,u.jsx)(ta,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(ea,{})})]})}function ca(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(Sn);return Sn(n)?n:null}function la(){let e=ca();return{isEquationSelected:!!e,selectedEquation:e?.getEquation(),selectedEquationDisplayMode:e?.getDisplayMode(),selectedEquationKey:e?.getKey()}}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:`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 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:`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 fa=[{value:`home`},{value:`insert`},{value:`equation`},{value:`image`},{value:`table`}];function pa({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=fa.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=la(),r=ai(),i=Bi();if(c(It(n)),c(Lt(r)),c(Rt(i)),!(0,t.$isRangeSelection)(e))return;let a=e.anchor.getNode(),o=a.getTopLevelElementOrThrow(),s=(0,D.$getNearestNodeOfType)(a,f.ListNode);c(zt({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:qe((0,E.$getSelectionStyleValueForProperty)(e,`font-family`,``)),fontSize:Ye((0,E.$getSelectionStyleValueForProperty)(e,`font-size`,``)),lineHeight:(0,E.$getSelectionStyleValueForProperty)(e,`line-height`,``)||void 0,textColor:(0,E.$getSelectionStyleValueForProperty)(e,`color`,``)})),c(Nt({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(Ft(e)),!1),t.COMMAND_PRIORITY_LOW),o=r.registerCommand(t.CAN_REDO_COMMAND,e=>(c(Pt(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)(da,{"aria-hidden":`true`}):(0,u.jsx)(ua,{"aria-hidden":`true`})})]}),m===`home`?(0,u.jsx)(Qr,{editor:r}):null,m===`image`?(0,u.jsx)(mi,{}):null,m===`insert`?(0,u.jsx)(ji,{onTableInserted:()=>o(`table`)}):null,m===`table`?(0,u.jsx)(sa,{}):null,m===`layout`?(0,u.jsx)(Mi,{}):null,(0,u.jsx)(Si,{showButton:!1})]})}function ma(){let[e]=(0,h.useLexicalComposerContext)();return(0,s.useEffect)(()=>e.registerCommand(Be,e=>{let n=xn(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 ha(){let[e]=(0,h.useLexicalComposerContext)();return s.default.useEffect(()=>{let n=(0,m.registerCodeHighlighting)(e),r=e.registerCommand(ze,({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 ga(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 _a(e,t){if(e.size>5242880)return window.alert(t),null;let n=await xt(e);return{altText:e.name,src:n}}function va(){let[e]=(0,h.useLexicalComposerContext)(),n=H();return(0,s.useEffect)(()=>{let r=async t=>{for(let r of t){let t=await _a(r,n.alerts.imageSizeLimit);t&&e.dispatchCommand(Ve,t)}},i=e.registerCommand(Ve,e=>{let n=rr(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=ga(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=>ga(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=ga(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 ya(e){return e.metaKey||e.ctrlKey}function ba(e){return e instanceof HTMLElement?[`INPUT`,`SELECT`,`TEXTAREA`].includes(e.tagName):!1}function xa(){let[e]=(0,h.useLexicalComposerContext)(),n=B();return(0,s.useEffect)(()=>{let r=()=>{Nr(e),n(zt({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(Nt({alignment:I.alignment,listType:I.listType}))};return e.registerCommand(t.KEY_DOWN_COMMAND,n=>{if(!ya(n)||n.altKey||ba(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(We)),!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 Sa(e){return(0,p.$isTableNode)(e)||K(e)||lr(e)}function Ca(){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=Sa(e.at(-1));for(let t=0;t<e.length-1;t+=1)if(Sa(e[t])&&Sa(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(Sa(e)){e.insertAfter((0,t.$createParagraphNode)());return}}let e=(0,t.$getRoot)().getLastChild();Sa(e)&&e.insertAfter((0,t.$createParagraphNode)())})}),[e]),null}function wa(){let[e]=(0,h.useLexicalComposerContext)();return(0,s.useEffect)(()=>{let n=e.registerCommand(He,e=>{let n=cr(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=lr((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();lr(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{n(),r()}},[e]),null}var Ta=[`words`,`characters`,`selection`,`language`,`mode`,`zoom`],Ea={characters:0,isSelectionCollapsed:!0,selectedCharacters:0,selectedWords:0,words:0};function Da(e,t){return e.characters===t.characters&&e.isSelectionCollapsed===t.isSelectionCollapsed&&e.selectedCharacters===t.selectedCharacters&&e.selectedWords===t.selectedWords&&e.words===t.words}function Oa(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 ka=s.default.memo(function({customFooter:e,isFocused:n,isFullscreen:r,items:i,language:a,zoom:o}){let[c]=(0,h.useLexicalComposerContext)(),l=H(),[d,f]=s.default.useState(Ea),p=s.default.useCallback(()=>{c.getEditorState().read(()=>{let e=(0,t.$getRoot)().getTextContent(),n=(0,t.$getSelection)(),r=(0,t.$isRangeSelection)(n)?n.getTextContent():``,i={characters:he(e),isSelectionCollapsed:!(0,t.$isRangeSelection)(n)||n.isCollapsed(),selectedCharacters:he(r),selectedWords:ge(r),words:ge(e)};f(e=>Da(e,i)?e:i)})},[c]);s.default.useEffect(()=>(p(),c.registerUpdateListener(()=>{p()})),[c,p]),s.default.useEffect(()=>c.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(p(),!1),t.COMMAND_PRIORITY_LOW),[c,p]);let m=s.default.useMemo(()=>({...d,isFocused:n,isFullscreen:r,language:a,zoom:o}),[n,r,a,d,o]);if(e)return(0,u.jsx)(`footer`,{"aria-label":l.footer.statusBar,className:`rj-editor-footer`,children:e(m)});let g=i?.length?i:Ta;return(0,u.jsx)(`footer`,{"aria-label":l.footer.statusBar,className:`rj-editor-footer`,children:(0,u.jsx)(`div`,{className:`rj-editor-footer-items`,children:g.map((e,t)=>(0,u.jsxs)(s.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:Oa(e,m,l)})]},`${e}-${t}`))})})});function Aa(e,t,n){n&&e.read(()=>{n(mt((0,i.$generateHtmlFromNodes)(t),t),JSON.stringify(e.toJSON()),e)})}function ja({lastHtmlRef:e,value:t}){let[n]=(0,h.useLexicalComposerContext)();return s.default.useEffect(()=>{t===void 0||t===e.current||n.update(()=>{jt(n,t),e.current=t})},[n,e,t]),null}function Ma({autofocus:e,className:t,editorRef:n,footer:r,footerItems:a,footerLanguageLabel:o,footerZoom:c,id:l,isFullscreen:d,onBlur:f,onChange:p,onFocus:m,onToggleFullscreen:h,placeholder:g,showFooter:E,theme:D,value:O}){let ee=H(),k=s.default.useRef(O),[te,ne]=s.default.useState(!1);return(0,u.jsxs)(`div`,{className:[`rj-editor`,d?`rj-editor--fullscreen`:``,t].filter(Boolean).join(` `),"data-rj-editor-theme":D,id:l,onBlur:e=>{let t=e.relatedTarget;e.currentTarget.contains(t)||ne(!1),f?.(e)},onFocus:e=>{ne(!0),m?.(e)},ref:n,children:[(0,u.jsx)(pa,{isFullscreen:d,onToggleFullscreen:h}),(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:g===void 0?ee.placeholders.editor:g})}),(0,u.jsx)(b.HistoryPlugin,{}),(0,u.jsx)(ha,{}),(0,u.jsx)(ma,{}),(0,u.jsx)(va,{}),(0,u.jsx)(xa,{}),(0,u.jsx)(wa,{}),(0,u.jsx)(x.LinkPlugin,{}),(0,u.jsx)(S.ListPlugin,{}),(0,u.jsx)(T.TablePlugin,{}),(0,u.jsx)(Ca,{}),(0,u.jsx)(yr,{}),(0,u.jsx)(ja,{lastHtmlRef:k,value:O}),(0,u.jsx)(C.OnChangePlugin,{onChange:(e,t)=>{e.read(()=>{k.current=mt((0,i.$generateHtmlFromNodes)(t),t)}),Aa(e,t,p)}}),e?(0,u.jsx)(_.AutoFocusPlugin,{}):null]}),E?(0,u.jsx)(ka,{customFooter:r,isFocused:te,isFullscreen:d,items:a,language:o,zoom:c}):null]})}function Na({autofocus:e=!1,className:t,defaultValue:n,footer:r,footerItems:i,footerLanguageLabel:l,footerZoom:d=100,id:f,locale:p=`en`,locales:m,namespace:h=`RJEditor`,onBlur:g,onChange:_,onFocus:v,placeholder:y,showFooter:b=!1,translations:x,theme:S=`auto`,value:C}){let w=s.default.useMemo(()=>Vt(),[]),T=s.default.useRef(null),[E,D]=s.default.useState(!1),O=an(S),ee=s.default.useMemo(()=>Qt(O),[O]),k=dr({defaultValue:n,namespace:h,value:C});s.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=s.default.useCallback(e=>document.fullscreenElement||T.current||e?.parentElement||document.body,[]);return(0,u.jsx)(c.Provider,{store:w,children:(0,u.jsx)(Yt,{locale:p,locales:m,translations:x,children:(0,u.jsx)($t.Provider,{value:O,children:(0,u.jsx)(o.ConfigProvider,{getPopupContainer:ne,theme:ee,children:(0,u.jsx)(a.LexicalComposer,{initialConfig:k,children:(0,u.jsx)(Ma,{autofocus:e,className:t,editorRef:T,footer:r,footerItems:i,footerLanguageLabel:l||Pa(p),footerZoom:d,id:f,isFullscreen:E,onBlur:g,onChange:_,onFocus:v,onToggleFullscreen:te,placeholder:y,showFooter:b,theme:O,value:C})})})})})})}function Pa(e){return e===`uz`?`O‘zbek`:e===`ru`?`Русский`:e===`en`?`English`:e}Ct(),e.RJEditorI18nProvider=Yt,e.RJTextEditor=Na,e.enTranslations=Ht,e.mergeTranslations=Wt,e.ruTranslations=Gt,e.useRJEditorI18n=H,e.uzTranslations=Kt});
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,A=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,ne=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),re=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=j(t),a=0,o=i.length,s;a<o;a++)s=i[a],!te.call(e,s)&&s!==n&&k(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=A(t,s))||r.enumerable});return e},ie=(e,t,n)=>(n=e==null?{}:O(ee(e)),re(t||!e||!e.__esModule?k(n,`default`,{value:e,enumerable:!0}):n,e));n=ie(n,1);let M=ie(s,1);s=ie(s);function ae(e){return typeof e!=`string`}function N(e,t){let[n,...r]=t.split(`>`);if(r.length>0){let t=N(e,n);return ae(t)?N(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 oe(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)?le(e,t,n):e}function le(e,t,n){let[r,...i]=t.split(`>`);if(i.length>0){let t=i.join(`>`);return le(e,r,ce(ue(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 ue(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 de(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,de(t)]}}return{items:[e,de(t)],kind:`row`}}function pe(e,t,n,r){let i=oe(t);if(i){let t=i.rowSlotId?N(e,i.rowSlotId):e;if(typeof t!=`string`&&t.kind===`row`){let r=Math.max(0,Math.min(i.insertIndex,t.items.length)),a=de(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?le(e,i.rowSlotId,o):o,selection:{end:n.length,start:n.length}}}}let a=N(e,t),o=typeof a==`string`?Math.max(0,Math.min(r?.start??a.length,a.length)):n.length;return{activeSlotId:t,model:le(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()}function ge(e){return Array.from(e.replace(/\n/g,``)).length}function _e(e){let t=e.replace(/\u00a0/g,` `).trim();return t?t.split(/\s+/).length:0}var ve=`rj-equation-model:`;function ye(e){return e.startsWith(ve)}function be(e){if(!ye(e))return null;try{return JSON.parse(decodeURIComponent(e.slice(ve.length)))}catch{return null}}function xe(e){return`${ve}${encodeURIComponent(JSON.stringify(e))}`}var Se={"&":`&amp;`,'"':`&quot;`,"'":`&#39;`,"<":`&lt;`,">":`&gt;`};function Ce(e){return e.replace(/[&"'<>]/g,e=>Se[e])}function we(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 Te(){return typeof navigator>`u`?!1:/Mac|iPhone|iPad|iPod/i.test(navigator.platform)}function P(e,t){return`${e.replace(/\bMOD\b/g,Te()?`CMD`:`CTRL`)} | ${t}`}function F(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>${F(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 Ee=/^[a-zA-Z0-9_-]{11}$/;function De(e){let t=e.trim();if(Ee.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&&Ee.test(t)?t:null}if(n===`youtube.com`||n===`m.youtube.com`||n===`youtube-nocookie.com`){let t=e.searchParams.get(`v`);if(t&&Ee.test(t))return t;let[,n,r]=e.pathname.split(`/`);if([`embed`,`live`,`shorts`].includes(n)&&r&&Ee.test(r))return r}}catch{return null}return null}function Oe(e){return{kind:`text`,value:e}}function ke(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?Oe(a):null,t,o?Oe(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 Ae(e,t){if(!t)return e.kind===`row`?e:null;let n=N(e,t);return typeof n!=`string`&&n.kind===`row`?n:null}function je(e){let t=e.split(`>`);return t.at(-1)===`text.value`?t.slice(0,-1).join(`>`):null}function Me(e,t){return e?`${e}>${t}`:t}function Ne(e,t,n,r){if(typeof t==`string`&&!t.trim())return Me(e,`row.items.0>${F(n)}`);if(typeof t==`string`)return Me(e,`row.items.${r?.start&&r.start>0?1:0}>${F(n)}`);if(typeof t!=`string`&&t.kind===`row`){let r=t.items.at(-1);return Me(e,`row.items.${r?.kind===`text`&&typeof r.value==`string`&&!r.value.trim()?t.items.length-1:t.items.length}>${F(n)}`)}return Me(e,`row.items.1>${F(n)}`)}function Pe(e,t,n,r){let i=oe(t);if(i){let t=Ae(e,i.rowSlotId);if(!t)return{activeSlotId:F(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:Me(i.rowSlotId,`row.items.${r}>${F(n)}`),model:i.rowSlotId?le(e,i.rowSlotId,a):a}}let a=je(t),o=N(e,t),s=ke(o,n,r);return a===null?{activeSlotId:Ne(t,o,n,r),model:le(e,t,s)}:{activeSlotId:Ne(a,o,n,r),model:a?le(e,a,s):s}}function Fe(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 Ie=[`#FFFFFF`,`#FEF3C7`,`#DBEAFE`,`#DCFCE7`,`#FCE7F3`,`#EDE9FE`,`#E5E7EB`],Le=`rj-editor-equation-insert`,Re=[`Arial`,`Georgia`,`Inter`,`Times New Roman`,`Trebuchet MS`,`Verdana`],ze=[`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:``},Be=(0,t.createCommand)(`INSERT_CODE_BLOCK_COMMAND`),Ve=(0,t.createCommand)(`INSERT_EQUATION_COMMAND`),He=(0,t.createCommand)(`INSERT_IMAGE_COMMAND`),Ue=(0,t.createCommand)(`INSERT_YOUTUBE_COMMAND`),We=[`1`,`1.15`,`1.5`,`2`,`2.5`,`3`],Ge=`rj-editor:open-link-modal`,Ke=[`#111827`,`#dc2626`,`#2563eb`,`#059669`,`#9333ea`,`#ca8a04`];function qe(e){return e.trim().replace(/^['"]|['"]$/g,``).toLowerCase()}function Je(e){if(!e)return;let t=e.split(`,`).map(qe);return Re.find(e=>t.includes(qe(e)))}function Ye(e){return e.trim().toLowerCase()}function Xe(e){if(!e)return;let t=Ye(e);return ze.find(e=>Ye(e)===t)}var Ze=16;function L(e){let t=e/Ze;return`${Number(t.toFixed(6))}rem`}var Qe={border:`0.0625rem solid #cbd5e1`,borderCollapse:`separate`,borderRadius:`0.75rem`,borderSpacing:`0`,overflow:`hidden`,tableLayout:`fixed`,width:`100%`},$e={border:`0`,borderBottom:`0.0625rem solid #cbd5e1`,borderRight:`0.0625rem solid #cbd5e1`,boxSizing:`border-box`,height:`2rem`,minWidth:`5rem`,padding:`0.5rem 0.625rem`,verticalAlign:`top`},et={margin:`0.75rem 0`,maxWidth:`100%`,overflowX:`auto`},tt=`rgb(242, 243, 245)`,nt=`#cbd5e1`,rt=`#f1f5f9`,it=`#eaf2ff`,at=`#3a3a3a`,ot=`#252525`,st=`#303030`,ct=`[data-rj-editor-content="true"]`,lt=`pre.rj-editor-code-block`,ut=`data-rj-code-title`,dt=`data-rj-code-custom-title`,ft=`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace`,pt={background:`#0b0c0e`,border:`0.0625rem solid #34363a`,borderRadius:`0.5rem`,margin:`0.75rem 0`,maxWidth:`100%`,overflow:`hidden`},mt={alignItems:`center`,background:`#111214`,borderBottom:`0.0625rem solid #34363a`,color:`#a1a1aa`,display:`flex`,fontFamily:ft,fontSize:`0.75rem`,height:`2.625rem`,justifyContent:`space-between`,padding:`0 0.5rem 0 0.875rem`},ht={alignItems:`center`,background:`transparent`,border:`0.0625rem solid transparent`,borderRadius:`0.375rem`,color:`#a1a1aa`,cursor:`pointer`,display:`inline-flex`,height:`1.75rem`,justifyContent:`center`,padding:`0`,width:`1.75rem`},gt={background:`#0b0c0e`,border:`0`,borderRadius:`0`,color:`#ededed`,display:`block`,fontFamily:ft,fontSize:`0.8125rem`,lineHeight:`1.65`,margin:`0`,minHeight:`4.375rem`,outline:`none`,overflow:`auto`,padding:`1rem`,scrollbarColor:`#34363a transparent`,scrollbarWidth:`thin`,tabSize:`2`,whiteSpace:`pre`},_t={height:`1rem`,width:`1rem`},vt={margin:`0 0 0.75rem`},yt={lineHeight:`1.25rem`,margin:`0`,minHeight:`1.25rem`},bt={"rj-editor-list-ol":{margin:`0 0 0.75rem 1.5rem`,padding:`0`},"rj-editor-list-ul":{margin:`0 0 0.75rem 1.5rem`,padding:`0`}},xt={margin:`0.25rem 0`},St={border:`0`,borderTop:`0.0625rem solid #d9dde5`,margin:`1rem 0`},Ct={"rj-editor-text-bold":{fontWeight:`700`},"rj-editor-text-italic":{fontStyle:`italic`},"rj-editor-text-subscript":{fontSize:`0.75em`,verticalAlign:`sub`},"rj-editor-text-superscript":{fontSize:`0.75em`,verticalAlign:`super`}},wt={background:`#2a2828`,border:`0.0625rem solid rgb(255 255 255 / 14%)`,borderRadius:`0.375rem`,color:`#ededed`,fontFamily:ft,fontSize:`0.92em`,lineHeight:`1.35`,padding:`0.125rem 0.375rem`,whiteSpace:`pre-wrap`},Tt={"rj-editor-code-token-comment":{color:`#7f848e`},"rj-editor-code-token-atrule":{color:`#c678dd`},"rj-editor-code-token-keyword":{color:`#c678dd`},"rj-editor-code-token-namespace":{color:`#c678dd`},"rj-editor-code-token-important":{color:`#c678dd`},"rj-editor-code-token-attr":{color:`#98c379`},"rj-editor-code-token-char":{color:`#98c379`},"rj-editor-code-token-inserted":{color:`#98c379`},"rj-editor-code-token-regex":{color:`#98c379`},"rj-editor-code-token-selector":{color:`#98c379`},"rj-editor-code-token-string":{color:`#98c379`},"rj-editor-code-token-boolean":{color:`#d19a66`},"rj-editor-code-token-constant":{color:`#d19a66`},"rj-editor-code-token-number":{color:`#d19a66`},"rj-editor-code-token-symbol":{color:`#d19a66`},"rj-editor-code-token-class":{color:`#61afef`},"rj-editor-code-token-class-name":{color:`#61afef`},"rj-editor-code-token-function":{color:`#61afef`},"rj-editor-code-token-builtin":{color:`#56b6c2`},"rj-editor-code-token-entity":{color:`#56b6c2`},"rj-editor-code-token-operator":{color:`#56b6c2`},"rj-editor-code-token-property":{color:`#56b6c2`},"rj-editor-code-token-punctuation":{color:`#56b6c2`},"rj-editor-code-token-url":{color:`#56b6c2`},"rj-editor-code-token-variable":{color:`#56b6c2`},"rj-editor-code-token-deleted":{color:`#e06c75`},"rj-editor-code-token-tag":{color:`#e06c75`}},Et=`#2563eb`,Dt={color:Et,textDecoration:`underline`},Ot={"rj-editor-equation-render":{alignItems:`center`,display:`inline-flex`,fontFamily:`Georgia, 'Times New Roman', serif`,fontSize:`1.25rem`,fontStyle:`italic`,gap:`0.25rem`,justifyContent:`center`,lineHeight:`1.15`,maxWidth:`100%`,minWidth:`0`,verticalAlign:`middle`},"rj-editor-equation-render-slot":{display:`inline-block`,maxWidth:`8.75rem`,minWidth:`0.625rem`,overflow:`hidden`,textAlign:`center`,textOverflow:`ellipsis`},"rj-editor-equation-render--fraction":{alignItems:`center`,display:`inline-grid`,gap:`0.125rem`,justifyItems:`center`,minWidth:`0`},"rj-editor-equation-render-line":{background:`#111827`,display:`block`,height:`0.125rem`,width:`100%`},"rj-editor-equation-render--fraction-inline":{alignItems:`center`,display:`inline-flex`,flexWrap:`nowrap`,gap:`0.125rem`,minWidth:`0`},"rj-editor-equation-render--row":{alignItems:`center`,display:`inline-flex`,flexWrap:`nowrap`,gap:`0.125rem`,minWidth:`0`},"rj-editor-equation-render--script":{alignItems:`center`,gap:`0.125rem`,verticalAlign:`middle`},"rj-editor-equation-render-script-stack":{alignItems:`center`,display:`inline-grid`,fontSize:`0.68em`,gap:`0.0625rem`,justifyItems:`center`,lineHeight:`1`},"rj-editor-equation-render--root":{alignItems:`flex-start`,gap:`0`},"rj-editor-equation-render-root-symbol":{fontSize:`1.875rem`,fontStyle:`normal`,lineHeight:`1`},"rj-editor-equation-render-radicand":{borderTop:`0.125rem solid #111827`,display:`inline-flex`,marginTop:`0.125rem`,padding:`0.125rem 0.25rem 0`},"rj-editor-equation-render-root-index":{alignSelf:`flex-start`,fontSize:`0.62em`,marginRight:`-0.125rem`},"rj-editor-equation-render-limits":{alignItems:`center`,display:`inline-grid`,gap:`0.0625rem`,justifyItems:`center`,lineHeight:`1`},"rj-editor-equation-render-large-symbol":{fontSize:`2.125rem`,fontStyle:`normal`,lineHeight:`0.9`},"rj-editor-equation-render-bracket":{fontSize:`2.125rem`,fontStyle:`normal`,lineHeight:`1`},"rj-editor-equation-render-matrix-bracket":{fontSize:`2.125rem`,fontStyle:`normal`,lineHeight:`1`},"rj-editor-equation-render--accent":{display:`inline-grid`,gap:`0`,justifyItems:`center`},"rj-editor-equation-render-accent-mark":{fontSize:`1.125rem`,lineHeight:`0.7`},"rj-editor-equation-render-matrix-grid":{display:`inline-grid`,gap:`0.25rem 0.5rem`}},kt={"--rj-editor-bg":`#ffffff`,"--rj-editor-border":`#d9dde5`,"--rj-editor-code-bg":`#0b0c0e`,"--rj-editor-code-border":`#34363a`,"--rj-editor-code-comment":`#7f848e`,"--rj-editor-code-function":`#61afef`,"--rj-editor-code-header-bg":`#111214`,"--rj-editor-code-keyword":`#c678dd`,"--rj-editor-code-muted":`#a1a1aa`,"--rj-editor-code-number":`#d19a66`,"--rj-editor-code-operator":`#56b6c2`,"--rj-editor-code-string":`#98c379`,"--rj-editor-code-tag":`#e06c75`,"--rj-editor-code-text":`#ededed`,"--rj-editor-focus-border":`#7aa7f7`,"--rj-editor-image-border":`#94a3b8`,"--rj-editor-image-shadow":`0 0.875rem 2rem rgb(15 23 42 / 18%)`,"--rj-editor-inline-code-bg":`#2a2828`,"--rj-editor-inline-code-border":`rgb(255 255 255 / 14%)`,"--rj-editor-inline-code-text":`#ededed`,"--rj-editor-link":Et,"--rj-editor-muted-text":`#64748b`,"--rj-editor-table-border":nt,"--rj-editor-table-header-bg":rt,"--rj-editor-table-selected-bg":it,"--rj-editor-text":`#111827`,"--rj-editor-toolbar-bg":`#f8fafc`,"--rj-editor-toolbar-button-active-bg":`#eaf2ff`};function At(e){let t=e?.trim().toLowerCase();return t===`dark`||t===`only dark`?`dark`:t===`light`||t===`only light`?`light`:null}function jt(e){let t=e?.getRootElement()?.closest(`[data-rj-editor-theme]`);return At(t?.dataset.rjEditorTheme)||(globalThis.document===void 0?`light`:At(globalThis.document.documentElement.dataset.rjEditorTheme)||At(globalThis.document.body?.dataset.rjEditorTheme)||`light`)}function Mt(e){return e===`dark`?{border:at,headerBg:ot,selectedBg:st}:{border:nt,headerBg:rt,selectedBg:it}}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),R(n,_t),n}function Pt(e){e.querySelectorAll(lt).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(n,pt),r.className=`rj-editor-code-block-export-header`,R(r,mt),i.className=`rj-editor-code-block-export-language`,i.textContent=`>_ ${t.getAttribute(ut)||t.getAttribute(dt)||t.getAttribute(`data-language`)||`plain`}`,i.style.minWidth=`0`,i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,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`),R(a,ht),a.append(Nt(e)),t.classList.add(`rj-editor-code-block--exported`),R(t,gt),t.replaceWith(n),r.append(i,a),n.append(r,t)})}function Ft(e){e.querySelectorAll(`.rj-editor-paragraph`).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=!!e.closest(`td, th`);R(e,t?yt:vt),!t&&!e.nextElementSibling&&(e.style.marginBottom=`0`),z(e,`rj-editor-paragraph`)}),e.querySelectorAll(`a`).forEach(e=>{e instanceof HTMLElement&&Kt(e,Dt)}),e.querySelectorAll(`hr`).forEach(e=>{e instanceof HTMLElement&&R(e,St)})}function It(e){Object.entries(Ct).forEach(([t,n])=>{e.querySelectorAll(`.${t}`).forEach(e=>{e instanceof HTMLElement&&(R(e,n),z(e,t))})}),e.querySelectorAll(`.rj-editor-text-underline, .rj-editor-text-strikethrough`).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=new Set((e.style.textDecorationLine||``).split(/\s+/).filter(Boolean));e.classList.contains(`rj-editor-text-underline`)&&t.add(`underline`),e.classList.contains(`rj-editor-text-strikethrough`)&&t.add(`line-through`),e.style.textDecorationLine=Array.from(t).join(` `),z(e,`rj-editor-text-underline`),z(e,`rj-editor-text-strikethrough`)})}function Lt(e){Object.entries(bt).forEach(([t,n])=>{e.querySelectorAll(`.${t}`).forEach(e=>{e instanceof HTMLElement&&(R(e,n),z(e,t))})}),e.querySelectorAll(`.rj-editor-list-item`).forEach(e=>{e instanceof HTMLElement&&(R(e,xt),z(e,`rj-editor-list-item`))})}function Rt(e,t){let n=Mt(t);e.querySelectorAll(`.rj-editor-table-scrollable-wrapper`).forEach(e=>{e instanceof HTMLElement&&(R(e,et),z(e,`rj-editor-table-scrollable-wrapper`))}),e.querySelectorAll(`table`).forEach(e=>{e.classList.add(`rj-editor-table`),R(e,Qe),e.style.border=`0.0625rem solid ${n.border}`,z(e,`rj-editor-table`)}),e.querySelectorAll(`table`).forEach(e=>{let t=Array.from(e.rows);t.forEach((e,r)=>{let i=Array.from(e.cells);i.forEach((e,a)=>{let o=e.tagName.toLowerCase()===`th`,s=o?`rj-editor-table-cell-header`:`rj-editor-table-cell`,c=e.style.backgroundColor===tt;e.classList.add(s),R(e,$e),e.style.borderBottom=r===t.length-1?`0`:`0.0625rem solid ${n.border}`,e.style.borderRight=a===i.length-1?`0`:`0.0625rem solid ${n.border}`,e.style.borderRadius=`0`,r===0&&a===0&&(e.style.borderTopLeftRadius=`0.75rem`),r===0&&a===i.length-1&&(e.style.borderTopRightRadius=`0.75rem`),r===t.length-1&&a===0&&(e.style.borderBottomLeftRadius=`0.75rem`),r===t.length-1&&a===i.length-1&&(e.style.borderBottomRightRadius=`0.75rem`),o&&(!e.style.backgroundColor||c)&&(e.style.backgroundColor=n.headerBg,e.style.fontWeight=`700`),e.classList.contains(`rj-editor-table-cell-selected`)&&(e.style.background=n.selectedBg,e.style.outline=`0.125rem solid #7aa7f7`,e.style.outlineOffset=`-0.125rem`,z(e,`rj-editor-table-cell-selected`)),z(e,s)}),z(e,`rj-editor-table-row`)})}),e.querySelectorAll(`.rj-editor-table-selection`).forEach(e=>{e.remove()})}function zt(e){e.querySelectorAll(`.rj-editor-equation-render--script.has-superscript:not(.has-subscript) .rj-editor-equation-render-script-stack`).forEach(e=>{e instanceof HTMLElement&&(e.style.transform=`translateY(-0.4375rem)`)}),e.querySelectorAll(`.rj-editor-equation-render--script.has-subscript:not(.has-superscript) .rj-editor-equation-render-script-stack`).forEach(e=>{e instanceof HTMLElement&&(e.style.transform=`translateY(0.4375rem)`)}),e.querySelectorAll(`.rj-editor-equation-render--script.has-superscript.has-subscript .rj-editor-equation-render-script-stack`).forEach(e=>{e instanceof HTMLElement&&(e.style.transform=`translateY(-0.0625rem)`)}),e.querySelectorAll(`.rj-editor-equation-render-limits`).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=e.firstElementChild,n=e.lastElementChild;t instanceof HTMLElement&&(t.style.fontSize=`0.62em`),n instanceof HTMLElement&&(n.style.fontSize=`0.62em`)}),e.querySelectorAll(`.rj-editor-equation-render-matrix-grid > span`).forEach(e=>{e instanceof HTMLElement&&(e.style.minWidth=`1.5rem`,e.style.textAlign=`center`)}),Object.entries(Ot).forEach(([t,n])=>{e.querySelectorAll(`.${t}`).forEach(e=>{e instanceof HTMLElement&&(R(e,n),z(e,t))})}),e.querySelectorAll(`.has-superscript, .has-subscript`).forEach(e=>{e instanceof HTMLElement&&(z(e,`has-superscript`),z(e,`has-subscript`))}),e.querySelectorAll(`[class]`).forEach(e=>{e instanceof HTMLElement&&Array.from(e.classList).filter(e=>e.startsWith(`rj-editor-equation-render`)).forEach(t=>z(e,t))})}function Bt(e){e.querySelectorAll(`code`).forEach(e=>{if(!(e instanceof HTMLElement)||e.closest(lt)||e.matches(lt))return;let t=e.style.background||e.style.backgroundColor;Kt(e,wt),Ht(e),Ut(e),t&&!e.style.background&&(e.style.background=t),e.querySelectorAll(`span`).forEach(t=>{t instanceof HTMLElement&&(Wt(e,t)||Vt(t)&&t.replaceWith(...Array.from(t.childNodes)))})}),e.querySelectorAll(`.rj-editor-text-code`).forEach(e=>{e instanceof HTMLElement&&(e.closest(lt)||(e.closest(`code`)||R(e,wt),e.classList.remove(`rj-editor-text-code`),e.className||e.removeAttribute(`class`)))}),Object.entries(Tt).forEach(([t,n])=>{e.querySelectorAll(`.${t}`).forEach(e=>{e instanceof HTMLElement&&(R(e,n),e.classList.remove(t),e.className||e.removeAttribute(`class`))})})}function Vt(e){return Array.from(e.attributes).every(e=>[`class`,`style`,`data-lexical-text`].includes(e.name))}function Ht(e){let t=Array.from(e.querySelectorAll(`*`)).find(t=>!Wt(e,t)&&(t.style.backgroundColor||t.style.color));t&&(t.style.backgroundColor&&(e.style.background=t.style.backgroundColor),t.style.color&&(e.style.color=t.style.color))}function Ut(e){(e.closest(`a`)||e.querySelector(`a`))&&((!e.style.color||Gt(e.style.color))&&(e.style.color=Et),e.querySelectorAll(`a`).forEach(e=>{e instanceof HTMLElement&&(e.style.color=Et)}))}function Wt(e,t){let n=t.closest(`a`);return!!n&&!n.contains(e)}function Gt(e){let t=e.replace(/\s+/g,``).toLowerCase();return t===`#ededed`||t===`rgb(237,237,237)`}function R(e,t){Object.entries(t).forEach(([t,n])=>{typeof n==`string`&&e.style.setProperty(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),n)})}function Kt(e,t){Object.entries(t).forEach(([t,n])=>{if(typeof n!=`string`)return;let r=t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),i=r===`background`&&`backgroundColor`in e.style&&!!e.style.backgroundColor;!e.style.getPropertyValue(r)&&!i&&e.style.setProperty(r,n)})}function z(e,t){e.classList.remove(t),e.className||e.removeAttribute(`class`)}function qt(e,t,n){let r=Mt(n);return e===`--rj-editor-table-border`?r.border:e===`--rj-editor-table-header-bg`?r.headerBg:e===`--rj-editor-table-selected-bg`?r.selectedBg:kt[e]||t.trim()}function Jt(e){let t=e.indexOf(`,`);return t===-1?{fallback:``,name:e.trim()}:{fallback:e.slice(t+1).trim(),name:e.slice(0,t).trim()}}function Yt(e,t){let n=``,r=0;for(;r<e.length;){let i=e.indexOf(`var(`,r);if(i===-1){n+=e.slice(r);break}n+=e.slice(r,i);let a=1,o=i+4;for(;o<e.length;o+=1){let t=e[o];if(t===`(`&&(a+=1),t===`)`&&--a,a===0)break}if(a!==0){n+=e.slice(i);break}let{fallback:s,name:c}=Jt(e.slice(i+4,o));n+=qt(c,s,t),r=o+1}return n}function Xt(e,t){e.querySelectorAll(`[style]`).forEach(e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&Array.from(e.style).forEach(n=>{let r=e.style.getPropertyValue(n);r.includes(`var(`)&&e.style.setProperty(n,Yt(r,t))})})}function Zt(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 Qt(e,t){let n=e.createElement(`span`);return n.className=`rj-editor-image-caption`,n.textContent=t,n.style.color=`#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 $t(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 en(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 tn(e){if(!en(e)||e.body.children.length===1&&e.body.firstElementChild?.matches(ct))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 nn(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`,Zt(a,r,i),t.style.float=``,t.style.margin=`0`,t.style.width=`100%`,t.replaceWith(a),a.append($t(e,t,t.getAttribute(`data-link-url`)),Qt(e,n)),!0}function rn(e){return(Number(e||0)%360+360)%360}function an(e,t,n){let r=t.getAttribute(`data-rj-image-node-key`),i=rn(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)),Zt(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($t(e,t,d)),m.append(p),u&&m.append(Qt(e,u)),!0}function on(e,t){if(!e.trim()||typeof DOMParser>`u`)return e;let n=new DOMParser().parseFromString(e,`text/html`),r=jt(t);return Rt(n,r),n.querySelectorAll(`img[data-alignment]`).forEach(e=>{let r=e,i=r.getAttribute(`data-alignment`),a=r.getAttribute(`data-text-wrap`);an(n,r,t)||(r.style.display=`block`,r.style.maxWidth=`100%`,Zt(r,i,a),nn(n,r)||$t(n,r,r.getAttribute(`data-link-url`)))}),Ft(n),It(n),Lt(n),zt(n),Bt(n),Pt(n),tn(n),Xt(n,r),n.body.innerHTML}function sn(e,t){return typeof e!=`number`||Number.isNaN(e)?``:we(String(e),t)}var cn=1200,ln=700;function un(){return document.fullscreenElement?new Promise(e=>{let t=()=>{window.clearTimeout(n),document.removeEventListener(`fullscreenchange`,t),e()},n=window.setTimeout(t,cn);document.addEventListener(`fullscreenchange`,t,{once:!0})}):Promise.resolve()}function dn(){return new Promise(e=>{window.setTimeout(e,ln)})}async function fn(e){if(e){if(document.fullscreenElement)try{let e=un();await document.exitFullscreen(),await e,await dn()}catch{}e.ownerDocument.defaultView?.focus(),e.click()}}function pn(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 mn=!1;function hn(){mn||typeof document>`u`||(mn=!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 B(e,t=`□`){return e&&typeof e!=`string`?xn(e):`<span class="rj-editor-equation-render-slot">${Ce(e?.trim()||t)}</span>`}function gn(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function _n(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function vn(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}function yn(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 bn(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>${B(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 xn(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>${B(e.value,`x`)}</span>`;case`bracket`:{let[t,n]=gn(e.bracket);return`<span class="rj-editor-equation-render rj-editor-equation-render--bracket"><span class="rj-editor-equation-render-bracket">${Ce(t)}</span>${B(e.value,`x`)}<span class="rj-editor-equation-render-bracket">${Ce(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>${B(e.numerator)}</span><span>${e.variant===`skewed`?`⁄`:`/`}</span><span>${B(e.denominator)}</span></span>`:`<span class="rj-editor-equation-render rj-editor-equation-render--fraction"><span>${B(e.numerator)}</span><span class="rj-editor-equation-render-line"></span><span>${B(e.denominator)}</span></span>`;case`function`:return`<span class="rj-editor-equation-render rj-editor-equation-render--function"><span>${e.functionName}</span><span>(</span>${B(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?``:B(e.upper,`b`)}</span><span class="rj-editor-equation-render-large-symbol">${vn(e.variant)}</span><span>${e.lower===void 0?``:B(e.lower,`a`)}</span></span>${B(e.body,`f(x)`)}<span>d</span>${B(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?``:B(e.upper,`n`)}</span><span class="rj-editor-equation-render-large-symbol">${_n(e.operator)}</span><span>${e.lower===void 0?``:B(e.lower,`i=1`)}</span></span>${B(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>${B(e.target,`x→0`)}</span></span>${B(e.body,`f(x)`)}</span>`;case`matrix`:return`<span class="rj-editor-equation-render rj-editor-equation-render--matrix">${bn(e)}</span>`;case`operator`:return`<span class="rj-editor-equation-render">${Ce(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">${B(e.index,`n`)}</span>`}<span class="rj-editor-equation-render-root-symbol">√</span><span class="rj-editor-equation-render-radicand">${B(e.value,`x`)}</span></span>`;case`script`:return e.position===`before`?`<span class="${yn(e)}"><span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${B(e.superscript,`n`)}</span>`}${e.subscript===void 0?``:`<span>${B(e.subscript,`1`)}</span>`}</span>${B(e.base,`Y`)}</span>`:`<span class="${yn(e)}">${B(e.base,`x`)}<span class="rj-editor-equation-render-script-stack">${e.superscript===void 0?``:`<span>${B(e.superscript,`2`)}</span>`}${e.subscript===void 0?``:`<span>${B(e.subscript,`i`)}</span>`}</span></span>`;case`text`:return`<span class="rj-editor-equation-render">${B(e.value,`□`)}</span>`;case`row`:return`<span class="rj-editor-equation-render rj-editor-equation-render--row">${e.items.map(xn).join(``)}</span>`;default:return``}}function Sn(e,t){let r=be(e);return r?xn(r):n.default.renderToString(e,{displayMode:t===`block`,output:`mathml`,strict:!1,throwOnError:!1,trust:!1})}var Cn=`data-rj-code-title`,wn=`data-rj-code-custom-title`;function Tn(e){return e.querySelector(`.rj-editor-code-block-export-language`)?.textContent?.replace(/^>_\s*/,``).trim()||``}function En(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}if(t.classList.remove(`rj-editor-code-block--exported`),t.removeAttribute(`style`),!t.getAttribute(Cn)){let n=Tn(e);n&&(t.setAttribute(Cn,n),n!==(t.getAttribute(`data-language`)||`plain`)&&t.setAttribute(wn,n))}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 Dn=(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:On,setCanRedo:kn,setCanUndo:An,setEquationFormats:jn,setImageFormats:Mn,setStyleFormats:Nn,setTableFormats:Pn,setTextFormats:Fn}=Dn.actions,In=Dn.reducer,Ln=()=>(0,l.configureStore)({reducer:{toolbar:In}});Ln();var V=c.useDispatch.withTypes(),H=c.useSelector.withTypes(),Rn={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`,title:`Code block title`},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 zn(e){return!e||typeof e!=`object`?e:Array.isArray(e)?e.map(e=>zn(e)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,zn(t)]))}function Bn(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]=Bn(r,n);return}e[t]=n}),e),zn(e))}var Vn=Bn(Rn,{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:`Язык`,title:`Название блока кода`},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:`Необязательно`}}}),Hn=Bn(Rn,{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`,title:`Kod bloki nomi`},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`}}}),Un=M.default.createContext(Hn),Wn={en:Rn,ru:Vn,uz:Hn};function Gn({children:e,locale:t=`uz`,locales:n,translations:r}){let i=M.default.useMemo(()=>Bn(Wn[t]||Rn,n?.[t],r),[t,n,r]);return(0,u.jsx)(Un.Provider,{value:i,children:e})}function U(){return M.default.useContext(Un)}var Kn={algorithm:o.theme.defaultAlgorithm,token:{colorPrimary:`#3167c8`}},qn={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 Jn(e){return e===`dark`?qn:Kn}var Yn=M.default.createContext(`light`);function Xn(){return M.default.useContext(Yn)}function Zn(e){let t=e?.trim().toLowerCase();if(t===`dark`||t===`only dark`)return`dark`;if(t===`light`||t===`only light`)return`light`}function Qn(e){if(!e)return;let t=Zn(e.dataset.rjEditorTheme)||Zn(e.dataset.colorScheme)||Zn(e.dataset.theme)||Zn(e.getAttribute(`color-scheme`));if(t)return t;if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`}function $n(e){return e?Zn(window.getComputedStyle(e).colorScheme):void 0}function er(){if(typeof document>`u`||typeof window>`u`)return`light`;let e=document.documentElement,t=document.body,n=Qn(e)||Qn(t);if(n)return n;let r=document.querySelector(`meta[name="color-scheme"]`)?.content;return $n(e)||$n(t)||Zn(r)||(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)}function tr(e){let[t,n]=M.default.useState(()=>er());return M.default.useEffect(()=>{if(e!==`auto`)return;let t=()=>n(er()),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 nr=Symbol.for(`preact-signals`);function rr(){if(cr>1)return void cr--;let e,t=!1;for(function(){let e=sr;for(sr=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();ar!==void 0;){let n=ar;for(ar=void 0,lr++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&hr(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(lr=0,cr--,t)throw e}function ir(e){if(cr>0)return e();dr=++ur,cr++;try{return e()}finally{rr()}}var W,ar;function or(e){let t=W;W=void 0;try{return e()}finally{W=t}}var sr,cr=0,lr=0,ur=0,dr=0,fr=0;function pr(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 G(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 mr(e,t){return new G(e,t)}function hr(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 gr(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 _r(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 vr(e,t){G.call(this,void 0),this.x=e,this.s=void 0,this.g=fr-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function yr(e,t){return new vr(e,t)}function br(e){let t=e.m;if(e.m=void 0,typeof t==`function`){cr++;let n=W;W=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,xr(e),t}finally{W=n,rr()}}}function xr(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,br(e)}function Sr(e){if(W!==this)throw Error(`Out-of-order effect`);_r(this),W=e,this.f&=-2,8&this.f&&xr(this),rr()}function Cr(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 wr(e,t){let n=new Cr(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Tr(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=mr(i===void 0?e[r]:i)}return n}G.prototype.brand=nr,G.prototype.h=function(){return!0},G.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?or(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},G.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&&or(()=>{var e;(e=this.Z)==null||e.call(this)}))}},G.prototype.subscribe=function(e){return wr(()=>{let t=this.value,n=W;W=void 0;try{e(t)}finally{W=n}},{name:`sub`})},G.prototype.valueOf=function(){return this.value},G.prototype.toString=function(){return this.value+``},G.prototype.toJSON=function(){return this.value},G.prototype.peek=function(){let e=W;W=void 0;try{return this.value}finally{W=e}},Object.defineProperty(G.prototype,`value`,{get(){let e=pr(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(lr>100)throw Error(`Cycle detected`);(function(e){cr!==0&&lr===0&&e.l!==dr&&(e.l=dr,sr={S:e,v:e.v,i:e.i,o:sr})})(this),this.v=e,this.i++,fr++,cr++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{rr()}}}}),vr.prototype=new G,vr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===fr))return!0;if(this.g=fr,this.f|=1,this.i>0&&!hr(this))return this.f&=-2,!0;let e=W;try{gr(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,_r(this),this.f&=-2,!0},vr.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)}G.prototype.S.call(this,e)},vr.prototype.U=function(e){if(this.t!==void 0&&(G.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)}},vr.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(vr.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=pr(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Cr.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()}},Cr.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,br(this),gr(this),cr++;let e=W;return W=this,Sr.bind(this,e)},Cr.prototype.N=function(){2&this.f||(this.f|=2,this.u=ar,ar=this)},Cr.prototype.d=function(){this.f|=8,1&this.f||xr(this)},Cr.prototype.dispose=function(){this.d()},(0,t.defineExtension)({build:(e,t,n)=>Tr(t),config:(0,t.safeCast)({defaultSelection:`rootEnd`,disabled:!1}),name:`@lexical/extension/AutoFocus`,register(e,t,n){let r=n.getOutput();return wr(()=>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 Er(){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 Dr(e,n=Er){return e.registerCommand(t.CLEAR_EDITOR_COMMAND,t=>(e.update(n),!0),t.COMMAND_PRIORITY_EDITOR)}(0,t.defineExtension)({build:(e,t,n)=>Tr(t),config:(0,t.safeCast)({$onClear:Er}),name:`@lexical/extension/ClearEditor`,register(e,t,n){let{$onClear:r}=n.getOutput();return wr(()=>Dr(e,r.value))}});function Or(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var kr=(0,t.createState)(`format`,{parse:e=>typeof e==`number`?e:0}),Ar=class extends t.DecoratorNode{$config(){return this.config(`decorator-text`,{extends:t.DecoratorNode,stateConfigs:[{flat:!0,stateConfig:kr}]})}getFormat(){return(0,t.$getState)(this,kr)}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,kr,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 jr(e){return e instanceof Ar}(0,t.defineExtension)({name:`@lexical/extension/DecoratorText`,nodes:()=>[Ar],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())jr(t)&&t.toggleFormat(e);return!1},t.COMMAND_PRIORITY_LOW)});function Mr(e,t){let n;return mr(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Nr=(0,t.defineExtension)({build:e=>Mr(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`});function K(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 Pr(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]=Pr(n[e],r[e]);return e}return t}var Fr=0,Ir=1,Lr=2,Rr=3,zr=4,Br=5,Vr=6,Hr=7;function Ur(e){return e.id===Fr}function Wr(e){return e.id===Lr}function Gr(e){return function(e){return e.id===Ir}(e)||K(305,String(e.id),String(Ir)),Object.assign(e,{id:Lr})}var Kr=new Set,qr=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Fr}}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;Wr(t)||K(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:Rr,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:zr,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==zr&&K(307,String(t.id),String(Br)),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:Br,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==Br&&K(308,String(n.id),String(Br));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:Vr})}(n),()=>{let e=this.state;e.id!==Hr&&K(309,String(n.id),String(Hr)),this.state=function(e){return Object.assign(e,{id:Br})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==Vr&&K(310,String(t.id),String(Vr)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:Hr})}(t),n}getSignal(){return this._signal===void 0&&K(311),this._signal}getInitResult(){this.extension.init===void 0&&K(312,this.extension.name);let e=this.state;return function(e){return e.id>=zr}(e)||K(313,String(e.id),String(zr)),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>=Rr}(e)||K(314,String(e.id),String(Rr)),{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&&K(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&K(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=Hr}(e)||K(316,String(e.id),String(Hr)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Kr}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>=Br})(e)||K(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Jr={tag:t.HISTORY_MERGE_TAG};function Yr(){let e=(0,t.$getRoot)();e.isEmpty()&&e.append((0,t.$createParagraphNode)())}var Xr=(0,t.defineExtension)({config:(0,t.safeCast)({setOptions:Jr,updateOptions:Jr}),init:({$initialEditorState:e=Yr})=>({$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]}),Zr=Symbol.for(`@lexical/extension/LexicalBuilder`);function Qr(){}function $r(e){throw e}function ei(e){return Array.isArray(e)?e:[e]}var ti=`0.44.0+prod.esm`,ni=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=ti,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[ei(Xr)];for(let e of t)n.push(ei(e));return new e(n)}static maybeFromEditor(t){let n=t[Zr];return n&&(n.PACKAGE_VERSION!==ti&&K(292,n.PACKAGE_VERSION,ti),n instanceof e||K(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&K(294),n}constructEditor(){let{$initialEditorState:e,onError:n,...r}=this.buildCreateEditorArgs(),i=Object.assign((0,t.createEditor)({...r,...n?{onError:e=>{n(e,i)}}:{}}),{[Zr]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=Qr;function n(){try{e()}finally{e=Qr}}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&&K(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&&K(296);let[t]=ei(e);typeof t.name!=`string`&&K(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&K(298,t.name),!n){n=new qr(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&K(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&K(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=ei(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(Wr(i))return;let a=n.extension.name;var o;Ur(i)||K(300,a,r||`[unknown]`),Ur(o=i)||K(304,String(o.id),String(Fr)),i=Object.assign(o,{id:Ir}),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=Gr(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Ur(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&&K(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 Or(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&K(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&&Pr(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||=$r,e}};function ri(e,t){let n=ni.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var ii=new Set,ai=(0,t.defineExtension)({build(e,n,r){let i=r.getDependency(Nr).output,a=mr({watchedNodeKeys:new Map}),o=Mr(()=>{},()=>wr(()=>{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=yr(()=>(o.value||ii).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:[Nr],name:`@lexical/extension/NodeSelection`}),oi=(0,t.createCommand)(`INSERT_HORIZONTAL_RULE_COMMAND`),si=class e extends t.DecoratorNode{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return li().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:ci,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 ci(){return{node:li()}}function li(){return(0,t.$create)(si)}function ui(e){return e instanceof si}(0,t.defineExtension)({dependencies:[Nr,ai],name:`@lexical/extension/HorizontalRule`,nodes:()=>[si],register(e,n,r){let{watchNodeKey:i}=r.getDependency(ai).output,a=mr({nodeSelections:new Map}),o=e._config.theme.hrSelected??`selected`;return(0,t.mergeRegister)(e.registerCommand(oi,e=>{let n=(0,t.$getSelection)();return(0,t.$isRangeSelection)(n)?(n.focus.getNode()!==null&&(0,m.$insertNodeToNearestRoot)(li()),!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(ui(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(si,(t,n)=>{ir(()=>{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:mr(o),selectedSignal:i(a)}))}n&&(a.value={nodeSelections:r})})}),wr(()=>{let e=[];for(let{domNode:n,selectedSignal:r}of a.value.nodeSelections.values())e.push(wr(()=>{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)=>Tr({inheritEditableFromParent:t.inheritEditableFromParent}),config:(0,t.safeCast)({$getParentEditor:function(){let e=(0,t.$getEditor)();return ni.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)=>wr(()=>{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)=>Tr(t),config:(0,t.safeCast)({disabled:!1,onReposition:void 0}),name:`@lexical/utils/SelectionAlwaysOnDisplay`,register:(e,t,n)=>{let r=n.getOutput();return wr(()=>{if(!r.disabled.value)return(0,m.selectionAlwaysOnDisplay)(e,r.onReposition.value)})}});function di(e){return e.canBeEmpty()}function fi(e,n,r=di){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)=>Tr(t),config:(0,t.safeCast)({$canIndent:di,disabled:!1,maxIndent:null}),name:`@lexical/extension/TabIndentation`,register(e,t,n){let{disabled:r,maxIndent:i,$canIndent:a}=n.getOutput();return wr(()=>{if(!r.value)return fi(e,i,a)})}});function pi(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 mi(e,n){let r=e;for(let i=(0,t.$getSiblingCaret)(e,n);i&&(J(i.origin)||(0,t.$isTabNode)(i.origin));i=i.getAdjacentCaret())r=i.origin;return r}function hi(e){return mi(e,`previous`)}function gi(e){return mi(e,`next`)}function _i(e){let n=hi(e),r=gi(e),i=n;for(;i!==null;){if(J(i)){let e=(0,t.getTextDirection)(i.getTextContent());if(e!==null)return e}if(i===r)break;i=i.getNextSibling()}let a=n.getParent();if((0,t.$isElementNode)(a)){let e=a.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function vi(e,n){let r=null,i=null,a=e,o=n,s=e.getTextContent();for(;;){if(o===0){if(a=a.getPreviousSibling(),a===null)break;if(J(a)||(0,t.$isTabNode)(a)||(0,t.$isLineBreakNode)(a)||pi(167),(0,t.$isLineBreakNode)(a)){r={node:a,offset:1};break}o=Math.max(0,a.getTextContentSize()-1),s=a.getTextContent()}else o--;let e=s[o];J(a)&&e!==` `&&(i={node:a,offset:o})}if(i!==null)return i;let c=null;if(n<e.getTextContentSize())J(e)&&(c=e.getTextContent()[n]);else{let t=e.getNextSibling();J(t)&&(c=t.getTextContent()[0])}if(c!==null&&c!==` `)return r;{let i=function(e,n){let r=e,i=n,a=e.getTextContent(),o=e.getTextContentSize();for(;;){if(!J(r)||i===o){if(r=r.getNextSibling(),r===null||(0,t.$isLineBreakNode)(r))return null;J(r)&&(i=0,a=r.getTextContent(),o=r.getTextContentSize())}if(J(r)){if(a[i]!==` `)return{node:r,offset:i};i++}}}(e,n);return i===null?r:i}}function yi(e){let n=gi(e);return(0,t.$isLineBreakNode)(n)&&pi(168),n}var bi=`javascript`;function xi(e,n){for(let r of e.childNodes){if((0,t.isHTMLElement)(r)&&r.tagName===n)return!0;xi(r,n)}return!1}var Si=`data-language`,Ci=`data-highlight-language`,wi=`data-theme`,Ti=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(Si,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ci,r));let i=this.getTheme();i&&n.setAttribute(wi,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(Si,i):a&&n.removeAttribute(Si);let o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&a?o&&i?i!==a&&n.setAttribute(Ci,i):n.removeAttribute(Ci):o&&i&&n.setAttribute(Ci,i);let s=this.__theme,c=e.__theme;s?s!==c&&n.setAttribute(wi,s):c&&n.removeAttribute(wi);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(Si,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(Ci,r));let i=this.getTheme();i&&n.setAttribute(wi,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)||xi(e,`BR`))?{conversion:Di,priority:1}:null,div:()=>({conversion:Oi,priority:1}),pre:()=>({conversion:Di,priority:0}),table:e=>Mi(e)?{conversion:ki,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&Mi(n)?{conversion:Ai,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&Mi(t)?{conversion:Ai,priority:3}:null}}}static importJSON(e){return Ei().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(!ri((0,t.$getEditor)(),`@lexical/code`)){let t=Ni(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=hi(a),n=[];for(;;)if((0,t.$isTabNode)(e))n.push((0,t.$createTabNode)()),e=e.getNextSibling();else{if(!J(e))break;{let t=0,r=e.getTextContent(),i=e.getTextContentSize();for(;t<i&&r[t]===` `;)t++;if(t!==0&&n.push(Ii(` `.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(q(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 Ei(e,n){return(0,t.$create)(Ti).setLanguage(e).setTheme(n)}function q(e){return e instanceof Ti}function Di(e){return{node:Ei(e.getAttribute(Si))}}function Oi(e){let t=e,n=ji(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(ji(t))return!0;t=t.parentElement}return!1}(t)?{node:n?Ei():null}:{node:null}}function ki(){return{node:Ei()}}function Ai(){return{node:null}}function ji(e){return e.style.fontFamily.match(`monospace`)!==null}function Mi(e){return e.classList.contains(`js-file-line-container`)}function Ni(e){let{anchor:n}=e;if(e.isCollapsed()&&n.type===`element`){let e=n.getNode();if(q(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 Pi=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,Fi(e.theme,this.__highlightType)),n}updateDOM(e,n,r){let i=super.updateDOM(e,n,r),a=Fi(r.theme,e.__highlightType),o=Fi(r.theme,this.__highlightType);return a!==o&&(a&&(0,t.removeClassNamesFromElement)(n,a),o&&(0,t.addClassNamesToElement)(n,o)),i}static importJSON(e){return Ii().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 Ei()}};function Fi(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Ii(e=``,n){return(0,t.$applyNodeReplacement)(new Pi(e,n))}function J(e){return e instanceof Pi}var Li=(0,t.defineExtension)({name:`@lexical/code`,nodes:()=>[Ti,Pi],register:e=>e.registerCommand(t.KEY_ENTER_COMMAND,e=>{let n=(0,t.$getSelection)();return!(!(0,t.$isRangeSelection)(n)||!Ni(n))&&(e.preventDefault(),!0)},t.COMMAND_PRIORITY_LOW)}),Ri=`□`,zi=`x + y = z`;function Bi(e,t,n){let r=Array.from(e||t||Ri).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 Vi(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 Hi(e){e.stopPropagation()}function Ui(e){let t=e.selectionStart??e.value.length;return{end:e.selectionEnd??t,start:t}}function Wi({className:e,inputRef:t,onActiveSlotChange:n,onSlotSelectionChange:r,onSlotChange:i,placeholder:a=Ri,slotId:o,value:s}){let c=e=>{Hi(e),n(o),r(o,Ui(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,Ui(e.currentTarget))},onClick:c,onFocus:c,onKeyDown:Hi,onKeyUp:c,onMouseDown:Hi,onSelect:c,placeholder:a,ref:t,size:Math.max(1,Math.min(Array.from(s||a).length+1,12)),style:{width:Bi(s,a,e)},type:`text`,value:s})}function Gi(e){return e===`absolute`?[`|`,`|`]:e===`angle`?[`⟨`,`⟩`]:e===`brace`?[`{`,`}`]:e===`ceiling`?[`⌈`,`⌉`]:e===`doubleAbsolute`?[`‖`,`‖`]:e===`floor`?[`⌊`,`⌋`]:e===`square`?[`[`,`]`]:[`(`,`)`]}function Ki(e){return{intersection:`⋂`,product:`∏`,summation:`∑`,union:`⋃`}[e]}function qi(e){return{contour:`∮`,double:`∫∫`,single:`∫`,triple:`∫∫∫`}[e||`single`]}var Ji=M.default.memo(function e({activeSlotId:t,activeSlotSelection:n,model:r,onActiveSlotChange:i,onSlotSelectionChange:a,onSlotChange:o,slotPrefix:s=``}){let c=M.default.useRef({}),l=M.default.useCallback(e=>t=>{c.current[e]=t},[]);M.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=M.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=M.default.useCallback((r,c,d,f=Ri)=>{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)(Wi,{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]=Gi(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:qi(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:Ki(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:Vi(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:Vi(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)(M.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?Ri:zi)})});function Yi(e,n){let r=(0,t.$getNodeByKey)(e);ea(r)&&n(r)}var Xi=M.default.memo(function({displayMode:e,equation:n,nodeKey:r}){let[i]=(0,h.useLexicalComposerContext)(),a=V(),o=M.default.useRef(``),s=M.default.useRef({}),c=M.default.useRef(null),[l,d]=M.default.useState(``),[f,p]=M.default.useState(),[m,_,v]=(0,g.useLexicalNodeSelection)(r),y=M.default.useMemo(()=>be(n),[n]),b=M.default.useMemo(()=>n.trim()?Sn(n,e):``,[e,n]),x=M.default.useMemo(()=>!y&&!/[\\{}_^]/.test(n),[n,y]),S=M.default.useCallback(t=>{i.update(()=>{Yi(r,e=>{ea(e)&&e.setEquation(t)})}),a(jn({isEquationSelected:!0,selectedEquation:t,selectedEquationDisplayMode:e,selectedEquationKey:r}))},[a,e,i,r]),C=M.default.useCallback((e,t)=>{o.current=e,t&&(s.current[e]=t),d(e),p(t)},[]),w=M.default.useCallback((e,t)=>{s.current[e]=t,C(e,t)},[C]),T=M.default.useCallback(e=>{S(xe(e))},[S]),E=M.default.useCallback((e,t)=>{y&&T(le(y,e,t))},[y,T]),D=M.default.useCallback(()=>{v(),_(!0),y&&C(o.current||F(y)),a(jn({isEquationSelected:!0,selectedEquation:n,selectedEquationDisplayMode:e,selectedEquationKey:r})),window.requestAnimationFrame(()=>{c.current?.focus()})},[v,a,e,n,y,r,C,_]);return M.default.useEffect(()=>{!m||!y||o.current||C(F(y))},[y,m,C]),M.default.useEffect(()=>{if(!m)return;let e=i.registerCommand(t.KEY_DELETE_COMMAND,e=>e.target instanceof HTMLInputElement?!1:(e.preventDefault(),i.update(()=>{Yi(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(()=>{Yi(r,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[i,m,r]),M.default.useEffect(()=>{if(!m)return;let e=e=>{let t=e.detail;if(!t)return;let r=be(t);if(r){if(y){let e=o.current||F(y),t=Pe(y,e,r,s.current[e]);C(t.activeSlotId),T(t.model);return}C(F(r)),T(r);return}if(y){let e=o.current||F(y),n=pe(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(Le,e),()=>{window.removeEventListener(Le,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)(Ji,{activeSlotId:l||F(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 Zi(e){let t=e.getAttribute(`data-equation`);return t?{node:$i({displayMode:e.getAttribute(`data-display-mode`)===`inline`?`inline`:`block`,equation:t})}:null}var Qi=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:Zi,priority:1}:null,span:e=>e.hasAttribute(`data-equation`)?{conversion:Zi,priority:1}:null}}static importJSON(e){return $i({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)(Xi,{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=Sn(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 $i({displayMode:e=`block`,equation:t}){return new Qi(t,e)}function ea(e){return e instanceof Qi}var ta=`data-rj-code-title`,na=`data-rj-code-custom-title`,ra=80;function ia(e){return e?.trim().slice(0,ra)||void 0}function aa(e,t){return ia(e)||t||`plain`}function oa(e,t,n){let r=ia(t);e.setAttribute(ta,aa(r,n)),r?e.setAttribute(na,r):e.removeAttribute(na)}function sa(e){return ia(e.getAttribute(`data-rj-code-custom-title`)||e.getAttribute(`data-rj-code-title`)||e.getAttribute(`data-title`))}function ca(e){return e?{...e,priority:Math.min((e.priority||0)+1,4),conversion:t=>{let n=e.conversion(t);if(!n)return n;let r=n.node,i=sa(t),a={...n};return!Array.isArray(r)&&q(r)&&(a.node=ma(r).setTitle(i)),a}}:null}var la=class e extends Ti{__title;static clone(t){return new e(t.__language,t.__title,t.__key)}static getType(){return`extended-code`}static importDOM(){let e=Ti.importDOM();return e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,e=>ca(t(e))])):null}static importJSON(e){return ua().updateFromJSON(e)}constructor(e,t,n){super(e,n),this.__title=ia(t)}afterCloneFrom(e){super.afterCloneFrom(e),this.__title=e.__title}createDOM(e){let t=super.createDOM(e);return oa(t,this.getTitle(),this.getLanguage()),t}updateDOM(e,t,n){let r=e.__title!==this.__title||e.__language!==this.__language,i=super.updateDOM(e,t,n);return r&&oa(t,this.getTitle(),this.getLanguage()),i}exportDOM(e){let t=super.exportDOM(e);return t.element instanceof HTMLElement&&oa(t.element,this.getTitle(),this.getLanguage()),t}updateFromJSON(e){return super.updateFromJSON(e).setTitle(e.codeBlockTitle)}exportJSON(){return{...super.exportJSON(),codeBlockTitle:this.getTitle(),type:`extended-code`,version:1}}setTitle(e){let t=this.getWritable();return t.__title=ia(e),t}getTitle(){return this.getLatest().__title}getDisplayTitle(){return aa(this.getTitle(),this.getLanguage())}};function ua(e,n){return(0,t.$applyNodeReplacement)(new la(e,n))}function da(e){return e instanceof la}function fa(e){return da(e)?e.getTitle():void 0}function pa(e){return da(e)?e.getDisplayTitle():aa(void 0,e.getLanguage())}function ma(e){let t=new la(e.getLanguage(),fa(e));return t.setTheme(e.getTheme()),t.setStyle(e.getStyle()),t}var ha=[`b`,`code`,`em`,`font`,`i`,`mark`,`s`,`span`,`strong`,`sub`,`sup`,`u`];function ga(e){let t=[],n=e.style.backgroundColor,r=e.style.color||e.getAttribute(`color`)||``,i=Je(e.style.fontFamily||e.getAttribute(`face`)||``),a=Xe(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 _a(e,t){return e?t?`${e}; ${t}`:e:t}function va(e){return e?{...e,conversion:n=>{let r=e.conversion(n);if(!r)return r;let i=r.forChild,a=ga(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(_a(r.getStyle(),a)),o&&!r.hasFormat(`code`)&&r.toggleFormat(`code`)),r}}}}:null}function ya(e,t){return t.setDetail(e.getDetail()),t.setFormat(e.getFormat()),t.setMode(e.getMode()),t.setStyle(e.getStyle()),t}var ba=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 ha.forEach(t=>{let r=e[t];r&&(n[t]=e=>va(r(e)))}),n}static importJSON(e){return xa(e.text).updateFromJSON(e)}constructor(e=``,t){super(e,t)}exportJSON(){return{...super.exportJSON(),type:`extended-text`,version:1}}};function xa(e=``){return new ba(e)}function Sa(e){return ya(e,xa(e.getTextContent()))}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:`M18 10H6M21 6H3M21 14H3M18 18H6`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function wa(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 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 10H8M21 6H4M21 14H4M21 18H8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ea(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 Da=M.default.createContext(pn);function Oa(){return M.default.useContext(Da)}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:`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 Aa=100,ja=2e3,Ma=10,Na=32,Pa=42,Fa=340,Ia=12,La=[`top-left`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`];function Ra(e,n){let r=(0,t.$getNodeByKey)(e);eo(r)&&n(r)}function za(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-Fa-8),o=Math.max(8,n.height-Pa-8),s=r+Ia,c=i+Ia;return{x:Math.min(Math.max(s,8),a),y:Math.max(c>o?i-Pa-Ia:c,8)}}function Ba({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=Oa(),S=V(),[C,w,T]=(0,g.useLexicalNodeSelection)(l),E=M.default.useRef(null),D=M.default.useRef(null),O=M.default.useRef(null),[k,A]=M.default.useState({x:0,y:0}),[j,ee]=M.default.useState(0),[te,ne]=M.default.useState(1),[re,ie]=M.default.useState(!1),ae=(f%360+360)%360,N=ae===90||ae===270,oe=_===`square`&&e!==`center`;M.default.useEffect(()=>{let e=D.current?.parentElement;if(!e)return;let t=()=>{ee(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()}},[]),M.default.useEffect(()=>{if(!C)return;let e=y.registerCommand(t.KEY_DELETE_COMMAND,e=>(e.preventDefault(),y.update(()=>{Ra(l,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW),n=y.registerCommand(t.KEY_BACKSPACE_COMMAND,e=>(e.preventDefault(),y.update(()=>{Ra(l,e=>{e?.remove()})}),!0),t.COMMAND_PRIORITY_LOW);return()=>{e(),n()}},[y,C,l]);let se=e=>{y.update(()=>{Ra(l,t=>{eo(t)&&t.setAlignment(e)})})},ce=e=>{y.update(()=>{Ra(l,t=>{eo(t)&&t.setWidth(Math.min(Aa,Math.max(Ma,e)))})})},le=(e,t)=>{y.update(()=>{Ra(l,n=>{eo(n)&&(n.setWidth(Math.min(Aa,Math.max(Ma,e))),n.setHeight(t===void 0?void 0:Math.min(ja,Math.max(Na,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(()=>{Ra(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{ie(!0),n=await x(t)}catch(e){console.error(e),window.alert(b.alerts.imageUploadFailed);return}finally{ie(!1)}y.update(()=>{Ra(l,e=>{eo(e)&&(e.setSrc(n),e.setAltText(t.name))})})},pe=j>0?j*v/100:void 0,me=s??(pe?pe/te:void 0),he=N&&me?me:void 0,ge=N&&pe?pe:void 0,_e={"--rj-image-rotated-aspect-ratio":`1 / ${te}`,height:ge?L(ge):void 0,width:N&&he?L(he):oe?`100%`:`${v}%`},ve=oe?{maxWidth:`100%`,width:N&&he?L(he):`${v}%`}:void 0,ye=(0,u.jsx)(`img`,{alt:n,className:`rj-editor-image`,draggable:!1,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&ne(t.naturalWidth/t.naturalHeight)},ref:O,src:m,style:{borderRadius:a,height:s?L(s):void 0,objectFit:d}}),be={"--rj-image-rotation":`${f}deg`,height:N&&me?L(me):void 0,width:N&&pe?L(pe):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:ve,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:()=>se(`left`),type:`button`,children:(0,u.jsx)(wa,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.alignCenter,onClick:()=>se(`center`),type:`button`,children:(0,u.jsx)(Ca,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":b.toolbar.image.alignRight,onClick:()=>se(`right`),type:`button`,children:(0,u.jsx)(Ta,{"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-busy":re,"aria-label":b.toolbar.image.replace,disabled:re,onClick:()=>void fn(E.current),type:`button`,children:(0,u.jsx)(ka,{"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)(Ea,{"aria-hidden":`true`})})]}):null,(0,u.jsxs)(`span`,{className:[`rj-editor-image-box`,i?`has-border`:``,p?`has-shadow`:``,r?`is-aspect-ratio-locked`:``,N?`is-quarter-turn`:``].filter(Boolean).join(` `),onClick:t=>{t.preventDefault(),t.stopPropagation(),T(),w(!0),A(za(t,D.current)),S(Mn({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:_e,children:[(0,u.jsx)(`span`,{className:`rj-editor-image-rotator`,style:be,children:c?(0,u.jsx)(`a`,{className:`rj-editor-image-link`,href:c,rel:`noreferrer`,target:`_blank`,children:ye}):ye}),o?(0,u.jsx)(`span`,{className:`rj-editor-image-caption`,children:o}):null,C?(0,u.jsx)(u.Fragment,{children:La.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 Va(e){return e===`square`||e===`around`?`square`:`top-bottom`}function Ha(e){return e===`left`||e===`right`||e===`center`?e:`center`}function Ua(e){return e===`cover`||e===`fill`||e===`contain`?e:`contain`}function Wa(e){let t=Number.parseFloat(e||``);return Number.isFinite(t)?t:void 0}function Ga(e){let t=Wa(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=Wa(n?.style.width);if(r!==void 0&&n?.style.width.includes(`%`))return r;let i=Wa(e.style.width);return i!==void 0&&e.style.width.includes(`%`)?i:100}function Ka(e){let t=e.getAttribute(`data-alignment`);if(t)return Ha(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 qa(e){let t=e.getAttribute(`data-text-wrap`);return t?Va(t):(e.closest(`[data-rj-image-caption-wrapper="true"], [data-rj-image-rotation-wrapper="true"]`)||e).style.float?`square`:`top-bottom`}function Ja(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 Ya(e){return e.getAttribute(`data-link-url`)||e.closest(`a`)?.href||``}function Xa(e){if(!(e instanceof HTMLImageElement))return null;let t=e.getAttribute(`src`);return t?{node:$a({alignment:Ka(e),altText:e.getAttribute(`alt`)||``,aspectRatioLocked:e.getAttribute(`data-aspect-ratio-locked`)!==`false`,borderEnabled:!!e.style.border,borderRadius:Wa(e.style.borderRadius)||0,caption:Ja(e),height:Wa(e.getAttribute(`data-height`))||Wa(e.style.height),linkUrl:Ya(e),objectFit:Ua(e.getAttribute(`data-object-fit`)||e.style.objectFit),rotation:Wa(e.getAttribute(`data-rotation`))||0,shadowEnabled:!!e.style.boxShadow,src:t,textWrap:qa(e),width:Ga(e)})}:null}function Za(e){let t=e.querySelector(`img`);return t?Xa(t):null}var Qa=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:Za,priority:2},img:()=>({conversion:Xa,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:Za,priority:2}}}static importJSON(e){return $a({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:Va(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)(Ba,{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 #94a3b8`),this.__shadowEnabled&&(e.style.boxShadow=`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 $a({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 Qa(d,n,p,e,a,o,s,c,f,i,r,u,l,t)}function eo(e){return e instanceof Qa}function to(e){let n=(0,t.$getNodeByKey)(e);oo(n)&&n.remove()}var no=M.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 M.default.useEffect(()=>{if(!a)return;let n=i.registerCommand(t.KEY_DELETE_COMMAND,t=>(t.preventDefault(),i.update(()=>to(e)),!0),t.COMMAND_PRIORITY_LOW),r=i.registerCommand(t.KEY_BACKSPACE_COMMAND,t=>(t.preventDefault(),i.update(()=>to(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 ro(e){let t=De(e.getAttribute(`data-youtube-video-id`)||e.getAttribute(`src`)||``);return t?{node:ao({title:e.getAttribute(`title`)||``,videoId:t})}:null}var io=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=>De(e.getAttribute(`src`)||``)?{conversion:ro,priority:1}:null}}static importJSON(e){return ao({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)(no,{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=`#f8fafc`,e.style.border=`0.0625rem solid #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 ao({title:e=``,videoId:t}){return new io(t,e)}function oo(e){return e instanceof io}var so={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 co({defaultValue:e,namespace:n,value:r}){return{namespace:n,nodes:[Ti,Pi,la,{replace:Ti,with:ma,withKlass:la},ba,{replace:t.TextNode,with:Sa,withKlass:ba},Qi,Qa,io,d.LinkNode,f.ListNode,f.ListItemNode,p.TableCellNode,p.TableNode,p.TableRowNode],onError(e){throw e},editorState:r||e?t=>En(t,r||e||``):void 0,theme:so}}function lo({children:e,onImageUpload:t}){return(0,u.jsx)(Da.Provider,{value:t||pn,children:e})}function uo(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 fo(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 po=250,mo=8,ho=48,go=80,_o=[{label:`Plain Text`,value:`plain`},{label:`Terminal`,value:`terminal`},{label:`JSON`,value:`json`},{label:`Bash`,value:`bash`},{label:`Shell`,value:`shell`},{label:`PNPM`,value:`pnpm`},{label:`NPM`,value:`npm`},{label:`Yarn`,value:`yarn`},{label:`Bun`,value:`bun`},{label:`C`,value:`c`},{label:`C++`,value:`cpp`},{label:`CSS`,value:`css`},{label:`Diff`,value:`diff`},{label:`Dockerfile`,value:`dockerfile`},{label:`HTML`,value:`html`},{label:`Java`,value:`java`},{label:`JavaScript`,value:`js`},{label:`JSX`,value:`jsx`},{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:`TSX`,value:`tsx`},{label:`XML`,value:`xml`},{label:`YAML`,value:`yaml`}],vo={algorithm:o.theme.darkAlgorithm,token:{colorBgContainer:`#181818`,colorBgElevated:`#202020`,colorBorder:`#4a4a4a`,colorFillSecondary:`#303030`,colorPrimary:`#b8b8b8`,colorText:`#ededed`,colorTextPlaceholder:`#8f8f8f`,colorTextSecondary:`#b8b8b8`}};function yo(e){return e.trim().slice(0,ho)||`plain`}function bo(e){return e.trim().slice(0,go)}function xo({displayTitle:e,editor:n,language:r,nodeKey:i,title:a}){let s=U(),c=M.default.useRef(null),l=M.default.useRef(!1),[d,f]=M.default.useState(!1),[p,m]=M.default.useState(!1),[h,g]=M.default.useState({displayTitle:e,nodeKey:i,title:a,value:e}),[_,v]=M.default.useState({left:0,top:0,visible:!1,width:po}),y=M.default.useCallback(()=>{let e=n.getElementByKey(i),t=n.getRootElement()?.closest(`.rj-editor-body`);if(!(e instanceof HTMLElement)||!(t instanceof HTMLElement)){v(e=>e.visible?{...e,visible:!1}:e);return}let r=t.getBoundingClientRect(),a=e.getBoundingClientRect(),o=Math.max(po,a.width-mo*2),s={left:Math.max(a.left-r.left+mo,mo),top:Math.max(a.top-r.top+mo,mo),visible:!0,width:Math.min(o,r.width-mo*2)};v(e=>e.left===s.left&&e.top===s.top&&e.visible===s.visible&&e.width===s.width?e:s)},[n,i]),b=p&&h.nodeKey===i?h.value:e;M.default.useEffect(()=>{let e=window.requestAnimationFrame(y),t=n.getElementByKey(i),r=n.getRootElement()?.closest(`.rj-editor-body`),a=typeof ResizeObserver>`u`?null:new ResizeObserver(y);return t&&a?.observe(t),r&&a?.observe(r),c.current&&a?.observe(c.current),window.addEventListener(`resize`,y),document.addEventListener(`scroll`,y,!0),()=>{window.cancelAnimationFrame(e),a?.disconnect(),window.removeEventListener(`resize`,y),document.removeEventListener(`scroll`,y,!0)}},[n,i,y]),M.default.useEffect(()=>{if(!d)return;let e=window.setTimeout(()=>f(!1),1600);return()=>window.clearTimeout(e)},[d]);let x=async()=>{let e=``;n.getEditorState().read(()=>{let n=(0,t.$getNodeByKey)(i);q(n)&&(e=n.getTextContent())}),await he(e),f(!0)},S=e=>{let r=yo(e);n.update(()=>{let e=(0,t.$getNodeByKey)(i);q(e)&&e.setLanguage(r)})},C=e=>{let a=bo(e);g({displayTitle:a||r,nodeKey:i,title:a||void 0,value:a||r}),n.update(()=>{let e=(0,t.$getNodeByKey)(i);if(da(e)){e.setTitle(a);return}if(q(e)){let t=ua(e.getLanguage(),a);t.setTheme(e.getTheme()),t.setStyle(e.getStyle()),e.replace(t,!0)}})};return _.visible?(0,u.jsxs)(`div`,{className:`rj-editor-code-block-actions`,contentEditable:!1,onMouseDown:e=>e.stopPropagation(),ref:c,style:{left:_.left,top:_.top,width:_.width},children:[(0,u.jsxs)(`label`,{className:`rj-editor-code-block-title-control`,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`>_`}),(0,u.jsx)(`input`,{"aria-label":s.toolbar.codeBlock.title,onBlur:()=>{if(l.current){l.current=!1,m(!1);return}C(b),m(!1)},onChange:t=>{g({displayTitle:e,nodeKey:i,title:a,value:t.target.value})},onFocus:()=>{m(!0),g({displayTitle:e,nodeKey:i,title:a,value:e})},onKeyDown:t=>{t.stopPropagation(),t.key===`Enter`&&(t.preventDefault(),t.currentTarget.blur()),t.key===`Escape`&&(t.preventDefault(),l.current=!0,m(!1),g({displayTitle:e,nodeKey:i,title:a,value:e}),t.currentTarget.blur())},title:s.toolbar.codeBlock.title,type:`text`,value:b})]}),(0,u.jsxs)(`div`,{className:`rj-editor-code-block-action-controls`,children:[(0,u.jsx)(o.ConfigProvider,{theme:vo,children:(0,u.jsx)(o.Select,{suffixIcon:(0,u.jsx)(uo,{}),"aria-label":s.toolbar.codeBlock.language,className:`rj-editor-code-block-language-select`,classNames:{popup:{root:`rj-editor-code-block-language-popup`}},filterOption:(e,t)=>String(t?.label||t?.value||``).toLowerCase().includes(e.toLowerCase()),onChange:e=>S(e),options:_o,popupMatchSelectWidth:!1,showSearch:!0,size:`small`,value:r})}),(0,u.jsx)(`button`,{"aria-label":d?s.toolbar.codeBlock.copied:s.toolbar.codeBlock.copy,className:d?`is-copied`:void 0,onClick:()=>void x(),title:d?s.toolbar.codeBlock.copied:s.toolbar.codeBlock.copy,type:`button`,children:(0,u.jsx)(fo,{"aria-hidden":`true`})})]})]}):null}function So(e,n=[]){return q(e)&&n.push(e),(0,t.$isElementNode)(e)&&e.getChildren().forEach(e=>{So(e,n)}),n}function Co(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.displayTitle===r?.displayTitle&&e.key===r.key&&e.language===r.language&&e.title===r.title})}function wo(){let[e]=(0,h.useLexicalComposerContext)(),[n,r]=M.default.useState([]);return M.default.useEffect(()=>{let n=()=>{let e=So((0,t.$getRoot)()).map(e=>({displayTitle:pa(e),key:e.getKey(),language:e.getLanguage()||`plain`,title:fa(e)}));r(t=>Co(t,e)?t:e)};return e.getEditorState().read(n),e.registerUpdateListener(({editorState:e})=>{e.read(n)})},[e]),n.map(t=>(0,u.jsx)(xo,{editor:e,displayTitle:t.displayTitle,language:t.language,nodeKey:t.key,title:t.title},t.key))}function To(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 Eo({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:P(`MOD+SHIFT+L`,n.toolbar.alignment.left),type:`button`,children:(0,u.jsx)(wa,{})}),(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:P(`MOD+SHIFT+C`,n.toolbar.alignment.center),type:`button`,children:(0,u.jsx)(Ca,{})}),(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:P(`MOD+SHIFT+R`,n.toolbar.alignment.right),type:`button`,children:(0,u.jsx)(Ta,{})}),(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:P(`MOD+SHIFT+J`,n.toolbar.alignment.justify),type:`button`,children:(0,u.jsx)(To,{})})]})}function Do(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`})}function Oo(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 ko(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 Ao({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:P(`MOD+Z`,n.toolbar.shortcuts.undo),type:`button`,children:(0,u.jsx)(Oo,{})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.history.redo,disabled:!r,onClick:()=>e.dispatchCommand(t.REDO_COMMAND,void 0),title:P(`MOD+Y`,n.toolbar.shortcuts.redo),type:`button`,children:(0,u.jsx)(ko,{})})]})}function jo(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 Mo(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 No(){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:P(`MOD+]`,n.toolbar.shortcuts.increaseIndent),type:`button`,children:(0,u.jsx)(jo,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":n.toolbar.shortcuts.decreaseIndent,onClick:()=>e.dispatchCommand(t.OUTDENT_CONTENT_COMMAND,void 0),title:P(`MOD+[`,n.toolbar.shortcuts.decreaseIndent),type:`button`,children:(0,u.jsx)(Mo,{"aria-hidden":`true`})})]})}function Po(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 Fo(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 Io(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 Lo({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:P(`MOD+SHIFT+8`,t.toolbar.shortcuts.bulletList),type:`button`,children:(0,u.jsx)(Fo,{})}),(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:P(`MOD+SHIFT+7`,t.toolbar.shortcuts.numberedList),type:`button`,children:(0,u.jsx)(Io,{})}),(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)(Po,{})})]})}function Ro(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 zo(e,n){e.focus(()=>{e.update(()=>{let e=(0,t.$getSelection)();(0,t.$isRangeSelection)(e)&&(0,E.$patchStyleText)(e,n)})})}function Bo(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 Vo(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V(),r=H(e=>e.toolbar),i=t=>{zo(e,{"line-height":t||null}),n(Nn({...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`},...We.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)(Ro,{"aria-hidden":`true`})})})}function Ho(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 Uo(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(null),s=V(),c=H(e=>e.toolbar),l=c.backgroundColor,d=t=>{zo(e,{"background-color":t||null}),s(Nn({...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]})},...Ie.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||Ie[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||Ie[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{zo(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)(Ho,{})})})})}function Wo(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 Go(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=V();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.style.clearFormatting,onClick:()=>{Bo(e),n(Fn({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(Nn({backgroundColor:I.backgroundColor,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight,textColor:I.textColor})),n(On({alignment:I.alignment,listType:I.listType}))},title:P(`MOD+\\`,t.toolbar.shortcuts.clearFormatting),type:`button`,className:`rj-editor-toolbar--clear-btn`,children:(0,u.jsx)(Wo,{})})}function Ko(){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=``)=>{zo(e,{"font-family":t||null}),n(Nn({...r,fontFamily:t}))},options:Re.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)(uo,{})})}function qo(e){let t=Number.parseFloat(e);return Number.isFinite(t)?String(Number((t*16).toFixed(2))):e}function Jo(){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=``)=>{zo(e,{"font-size":t||null}),n(Nn({...r,fontSize:t}))},options:ze.map(e=>({label:qo(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)(uo,{})})}function Yo(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(null),s=V(),c=H(e=>e.toolbar),l=c.textColor,d=t=>{zo(e,{color:t||null}),s(Nn({...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]})},...Ke.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||Ke[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||Ke[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{zo(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 Xo(){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ko,{}),(0,u.jsx)(Jo,{}),(0,u.jsx)(Yo,{}),(0,u.jsx)(Uo,{}),(0,u.jsx)(Go,{})]})}function Zo(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 Qo(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 $o(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 es(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 ts(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 ns(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 rs(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 is(){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:P(`MOD+B`,n.toolbar.shortcuts.bold),type:`button`,children:(0,u.jsx)(Qo,{})}),(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:P(`MOD+I`,n.toolbar.shortcuts.italic),type:`button`,children:(0,u.jsx)(es,{})}),(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:P(`MOD+U`,n.toolbar.shortcuts.underline),type:`button`,children:(0,u.jsx)(rs,{})}),(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:P(`MOD+SHIFT+X`,n.toolbar.shortcuts.strikethrough),type:`button`,children:(0,u.jsx)(Zo,{"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)($o,{"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:P(`MOD+=`,n.toolbar.shortcuts.subscript),type:`button`,children:(0,u.jsx)(ts,{"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:P(`MOD+SHIFT+=`,n.toolbar.shortcuts.superscript),type:`button`,children:(0,u.jsx)(ns,{"aria-hidden":`true`})})]})}function as({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)(Ao,{editor:e}),(0,u.jsx)(Do,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(is,{}),(0,u.jsx)(Do,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Vo,{}),(0,u.jsx)(Do,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Eo,{editor:e}),(0,u.jsx)(Do,{})]})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-row`,children:[(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Xo,{}),(0,u.jsx)(Do,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Lo,{editor:e}),(0,u.jsx)(Do,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(No,{})})]})]})}function os(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 ss(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 cs={wrapper:`_wrapper_se0k7_1`,disabled:`_disabled_se0k7_23`,affix:`_affix_se0k7_28`,input:`_input_se0k7_43`,inputAffix:`_inputAffix_se0k7_58`};function ls({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=M.default.useRef(null),h=typeof f==`number`,[g,_]=M.default.useState(!1),[v,y]=M.default.useState(()=>sn(h?f:n,i)),b=h&&!g?sn(f,i):v,x=e=>{let n=Fe(e.target.value,t,r),s=we(n,i),l=Number(n);y(s),n!==``&&n!==`.`&&Number.isFinite(l)&&c?.(me(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=me(n,o,a);y(sn(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:[cs.input,l||d?cs.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:[cs.wrapper,p.disabled?cs.disabled:``,e].filter(Boolean).join(` `),children:[l?(0,u.jsx)(`span`,{className:cs.affix,onMouseDown:e=>{e.preventDefault(),C(`start`)},children:l}):null,w,d?(0,u.jsx)(`span`,{className:cs.affix,onMouseDown:e=>{e.preventDefault(),C(`end`)},children:d}):null]})}var Y={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 us({cancelText:e,children:t,okText:n,onCancel:r,onOk:i,open:a,title:o,width:s=420}){let c=U(),l=Xn(),d=M.default.useRef(null),f=M.default.useRef({x:0,y:0}),[p,m]=M.default.useState(null);if(M.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:Y.overlay,"data-rj-editor-theme":l,onMouseDown:e=>{e.target===e.currentTarget&&r()},role:`presentation`,children:(0,u.jsxs)(`div`,{"aria-modal":`true`,className:Y.modal,ref:d,role:`dialog`,style:{"--rj-modal-width":L(s),left:p?L(p.x):void 0,position:p?`fixed`:void 0,top:p?L(p.y):void 0},children:[(0,u.jsxs)(`div`,{className:Y.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:Y.title,children:o}):(0,u.jsx)(`span`,{}),(0,u.jsx)(`button`,{"aria-label":c.modal.closeAriaLabel,className:Y.closeButton,onClick:r,onPointerDown:e=>{e.stopPropagation()},type:`button`,children:(0,u.jsx)(Wo,{"aria-hidden":`true`})})]}),(0,u.jsx)(`div`,{className:Y.body,children:t}),i?(0,u.jsxs)(`div`,{className:Y.footer,children:[(0,u.jsx)(`button`,{className:`${Y.button} ${Y.cancelButton}`,onClick:r,type:`button`,children:e||c.common.close}),(0,u.jsx)(`button`,{className:`${Y.button} ${Y.okButton}`,onClick:i,type:`button`,children:n||c.common.save})]}):null]})}),h)}function ds(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function fs(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(eo);return eo(n)?n:null}function ps(){let e=fs();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 X(e,t){e.update(()=>{let e=fs();e&&t(e)}),e.focus()}function ms(e,n,r){e.update(()=>{let e=(0,t.$getNodeByKey)(n);eo(e)&&r(e)}),e.focus()}function hs(e,t){X(e,e=>{e.setAlignment(t)})}function gs(e,t){X(e,e=>{e.setWidth(t)})}function _s(e,n){X(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 vs(e){X(e,e=>{e.remove()})}function ys(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 bs(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 xs(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 Ss(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=Oa(),r=M.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]=M.default.useState(null),[C,w]=M.default.useState(``),[T,E]=M.default.useState(!1),D=M.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=M.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])},A=()=>{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:()=>hs(e,`left`),type:`button`,children:(0,u.jsx)(wa,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignCenter,className:a===`center`?`is-active`:void 0,disabled:!i,onClick:()=>hs(e,`center`),type:`button`,children:(0,u.jsx)(Ca,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.alignRight,className:a===`right`?`is-active`:void 0,disabled:!i,onClick:()=>hs(e,`right`),type:`button`,children:(0,u.jsx)(Ta,{"aria-hidden":`true`})}),(0,u.jsx)(ds,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(ls,{"aria-label":t.toolbar.image.width,className:`rj-editor-image-width-input`,max:100,min:10,decimalScale:3,suffix:`%`,onChange:t=>gs(e,t),value:b||100}),[25,50,100].map(t=>(0,u.jsxs)(`button`,{className:b===t?`is-active`:void 0,disabled:!i,onClick:()=>gs(e,t),type:`button`,children:[t,`%`]},t)),(0,u.jsx)(ds,{})]}),(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)(ds,{})]})]}),(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:()=>X(e,e=>{e.setBorderEnabled(!e.getBorderEnabled())}),type:`button`,children:t.toolbar.image.border}),(0,u.jsx)(ls,{"aria-label":t.toolbar.image.borderRadius,className:`rj-editor-image-border-radius-input`,integerOnly:!0,max:64,min:0,prefix:(0,u.jsx)(ys,{}),onChange:t=>X(e,e=>e.setBorderRadius(t)),value:l||0}),(0,u.jsx)(`button`,{className:v?`is-active`:void 0,disabled:!i,onClick:()=>X(e,e=>{e.setShadowEnabled(!e.getShadowEnabled())}),type:`button`,children:t.toolbar.image.shadow}),(0,u.jsx)(ds,{})]}),(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=>X(e,e=>e.setObjectFit(t)),options:D,size:`small`,suffixIcon:(0,u.jsx)(uo,{}),value:g||`contain`}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.topBottomWrap,className:y===`top-bottom`?`is-active`:void 0,disabled:!i,onClick:()=>_s(e,`top-bottom`),title:t.toolbar.image.topBottomWrap,type:`button`,children:(0,u.jsx)(ss,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.squareWrap,className:y===`square`?`is-active`:void 0,disabled:!i,onClick:()=>_s(e,`square`),title:t.toolbar.image.squareWrap,type:`button`,children:(0,u.jsx)(os,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateLeft,disabled:!i,onClick:()=>X(e,e=>e.setRotation((_||0)-90)),type:`button`,children:(0,u.jsx)(bs,{})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.rotateRight,disabled:!i,onClick:()=>X(e,e=>e.setRotation((_||0)+90)),type:`button`,children:(0,u.jsx)(xs,{})}),(0,u.jsx)(ds,{})]}),(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:()=>{fn(r.current)},type:`button`,children:(0,u.jsx)(ka,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.image.delete,className:`rj-editor-toolbar--clear-btn`,disabled:!i,onClick:()=>vs(e),type:`button`,children:(0,u.jsx)(Ea,{"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)}X(e,e=>{e.setSrc(a),e.setAltText(i.name)})},ref:r,type:`file`})]})]}),(0,u.jsx)(us,{okText:t.common.save,onCancel:A,onOk:()=>{if(!x||!p){A();return}let t=C.trim();ms(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 Cs(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}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:`M16 18L22 12L16 6M8 6L2 12L8 18`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Ts(){let[e]=(0,h.useLexicalComposerContext)(),t=U();return(0,u.jsx)(`button`,{"aria-label":t.toolbar.insert.codeBlock,onClick:()=>{e.dispatchCommand(Be,{language:`plain`}),window.requestAnimationFrame(()=>e.focus())},onMouseDown:e=>e.preventDefault(),title:t.toolbar.insert.codeBlock,type:`button`,children:(0,u.jsx)(ws,{"aria-hidden":`true`})})}function Es(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 Ds=(0,s.createContext)({});function Os(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=Os(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function ks(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Os(e))&&(r&&(r+=` `),r+=t);return r}var As={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`},Z=Math.round;function js(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 Ms=(e,t,n)=>n===0?e:e/100;function Ns(e,t){let n=t||255;return e>n?n:e<0?0:e}var Ps=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=As[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=Ns(t.r),this.g=Ns(t.g),this.b=Ns(t.b),this.a=typeof t.a==`number`?Ns(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=Z(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:Z(i(`r`)),g:Z(i(`g`)),b:Z(i(`b`)),a:Z(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=>Z((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=Z(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=Z(this.getHSLSaturation()*100),n=Z(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]=Ns(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=Z(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=Z((a+d)*255),this.g=Z((o+d)*255),this.b=Z((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=Z(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=Z(n*(1-t)*255),u=Z(n*(1-t*c)*255),d=Z(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=js(e,Ms);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){let t=js(e,Ms);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){let t=js(e,(e,t)=>t.includes(`%`)?Z(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}},Fs=2,Is=.16,Ls=.05,Rs=.05,zs=.15,Bs=5,Vs=4,Hs=[{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 Us(e,t,n){let r;return r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-Fs*t:Math.round(e.h)+Fs*t:n?Math.round(e.h)+Fs*t:Math.round(e.h)-Fs*t,r<0?r+=360:r>=360&&(r-=360),r}function Ws(e,t,n){if(e.h===0&&e.s===0)return e.s;let r;return r=n?e.s-Is*t:t===Vs?e.s+Is:e.s+Ls*t,r>1&&(r=1),n&&t===Bs&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function Gs(e,t,n){let r;return r=n?e.v+Rs*t:e.v-zs*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Ks(e,t={}){let n=[],r=new Ps(e),i=r.toHsv();for(let e=Bs;e>0;--e){let t=new Ps({h:Us(i,e,!0),s:Ws(i,e,!0),v:Gs(i,e,!0)});n.push(t)}n.push(r);for(let e=1;e<=Vs;e+=1){let t=new Ps({h:Us(i,e),s:Ws(i,e),v:Gs(i,e)});n.push(t)}return t.theme===`dark`?Hs.map(({index:e,amount:r})=>new Ps(t.backgroundColor||`#141414`).mix(n[e],r).toHexString()):n.map(e=>e.toHexString())}var qs=[`#fff1f0`,`#ffccc7`,`#ffa39e`,`#ff7875`,`#ff4d4f`,`#f5222d`,`#cf1322`,`#a8071a`,`#820014`,`#5c0011`];qs.primary=qs[5];var Js=[`#fff2e8`,`#ffd8bf`,`#ffbb96`,`#ff9c6e`,`#ff7a45`,`#fa541c`,`#d4380d`,`#ad2102`,`#871400`,`#610b00`];Js.primary=Js[5];var Ys=[`#fff7e6`,`#ffe7ba`,`#ffd591`,`#ffc069`,`#ffa940`,`#fa8c16`,`#d46b08`,`#ad4e00`,`#873800`,`#612500`];Ys.primary=Ys[5];var Xs=[`#fffbe6`,`#fff1b8`,`#ffe58f`,`#ffd666`,`#ffc53d`,`#faad14`,`#d48806`,`#ad6800`,`#874d00`,`#613400`];Xs.primary=Xs[5];var Zs=[`#feffe6`,`#ffffb8`,`#fffb8f`,`#fff566`,`#ffec3d`,`#fadb14`,`#d4b106`,`#ad8b00`,`#876800`,`#614700`];Zs.primary=Zs[5];var Qs=[`#fcffe6`,`#f4ffb8`,`#eaff8f`,`#d3f261`,`#bae637`,`#a0d911`,`#7cb305`,`#5b8c00`,`#3f6600`,`#254000`];Qs.primary=Qs[5];var $s=[`#f6ffed`,`#d9f7be`,`#b7eb8f`,`#95de64`,`#73d13d`,`#52c41a`,`#389e0d`,`#237804`,`#135200`,`#092b00`];$s.primary=$s[5];var ec=[`#e6fffb`,`#b5f5ec`,`#87e8de`,`#5cdbd3`,`#36cfc9`,`#13c2c2`,`#08979c`,`#006d75`,`#00474f`,`#002329`];ec.primary=ec[5];var tc=[`#e6f4ff`,`#bae0ff`,`#91caff`,`#69b1ff`,`#4096ff`,`#1677ff`,`#0958d9`,`#003eb3`,`#002c8c`,`#001d66`];tc.primary=tc[5];var nc=[`#f0f5ff`,`#d6e4ff`,`#adc6ff`,`#85a5ff`,`#597ef7`,`#2f54eb`,`#1d39c4`,`#10239e`,`#061178`,`#030852`];nc.primary=nc[5];var rc=[`#f9f0ff`,`#efdbff`,`#d3adf7`,`#b37feb`,`#9254de`,`#722ed1`,`#531dab`,`#391085`,`#22075e`,`#120338`];rc.primary=rc[5];var ic=[`#fff0f6`,`#ffd6e7`,`#ffadd2`,`#ff85c0`,`#f759ab`,`#eb2f96`,`#c41d7f`,`#9e1068`,`#780650`,`#520339`];ic.primary=ic[5];var ac=[`#a6a6a6`,`#999999`,`#8c8c8c`,`#808080`,`#737373`,`#666666`,`#404040`,`#1a1a1a`,`#000000`,`#000000`];ac.primary=ac[5];var oc=[`#2a1215`,`#431418`,`#58181c`,`#791a1f`,`#a61d24`,`#d32029`,`#e84749`,`#f37370`,`#f89f9a`,`#fac8c3`];oc.primary=oc[5];var sc=[`#2b1611`,`#441d12`,`#592716`,`#7c3118`,`#aa3e19`,`#d84a1b`,`#e87040`,`#f3956a`,`#f8b692`,`#fad4bc`];sc.primary=sc[5];var cc=[`#2b1d11`,`#442a11`,`#593815`,`#7c4a15`,`#aa6215`,`#d87a16`,`#e89a3c`,`#f3b765`,`#f8cf8d`,`#fae3b7`];cc.primary=cc[5];var lc=[`#2b2111`,`#443111`,`#594214`,`#7c5914`,`#aa7714`,`#d89614`,`#e8b339`,`#f3cc62`,`#f8df8b`,`#faedb5`];lc.primary=lc[5];var uc=[`#2b2611`,`#443b11`,`#595014`,`#7c6e14`,`#aa9514`,`#d8bd14`,`#e8d639`,`#f3ea62`,`#f8f48b`,`#fafab5`];uc.primary=uc[5];var dc=[`#1f2611`,`#2e3c10`,`#3e4f13`,`#536d13`,`#6f9412`,`#8bbb11`,`#a9d134`,`#c9e75d`,`#e4f88b`,`#f0fab5`];dc.primary=dc[5];var fc=[`#162312`,`#1d3712`,`#274916`,`#306317`,`#3c8618`,`#49aa19`,`#6abe39`,`#8fd460`,`#b2e58b`,`#d5f2bb`];fc.primary=fc[5];var pc=[`#112123`,`#113536`,`#144848`,`#146262`,`#138585`,`#13a8a8`,`#33bcb7`,`#58d1c9`,`#84e2d8`,`#b2f1e8`];pc.primary=pc[5];var mc=[`#111a2c`,`#112545`,`#15325b`,`#15417e`,`#1554ad`,`#1668dc`,`#3c89e8`,`#65a9f3`,`#8dc5f8`,`#b7dcfa`];mc.primary=mc[5];var hc=[`#131629`,`#161d40`,`#1c2755`,`#203175`,`#263ea0`,`#2b4acb`,`#5273e0`,`#7f9ef3`,`#a8c1f8`,`#d2e0fa`];hc.primary=hc[5];var gc=[`#1a1325`,`#24163a`,`#301c4d`,`#3e2069`,`#51258f`,`#642ab5`,`#854eca`,`#ab7ae0`,`#cda8f0`,`#ebd7fa`];gc.primary=gc[5];var _c=[`#291321`,`#40162f`,`#551c3b`,`#75204f`,`#a02669`,`#cb2b83`,`#e0529c`,`#f37fb7`,`#f8a8cc`,`#fad2e3`];_c.primary=_c[5];var vc=[`#151515`,`#1f1f1f`,`#2d2d2d`,`#393939`,`#494949`,`#5a5a5a`,`#6a6a6a`,`#7b7b7b`,`#888888`,`#969696`];vc.primary=vc[5];function yc(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function bc(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 xc=`data-rc-order`,Sc=`data-rc-priority`,Cc=`rc-util-key`,wc=new Map;function Tc({mark:e}={}){return e?e.startsWith(`data-`)?e:`data-${e}`:Cc}function Ec(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function Dc(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function Oc(e){return Array.from((wc.get(e)||e).children).filter(e=>e.tagName===`STYLE`)}function kc(e,t={}){if(!yc())return null;let{csp:n,prepend:r,priority:i=0}=t,a=Dc(r),o=a===`prependQueue`,s=document.createElement(`style`);s.setAttribute(xc,a),o&&i&&s.setAttribute(Sc,`${i}`),n?.nonce&&(s.nonce=n?.nonce),s.innerHTML=e;let c=Ec(t),{firstChild:l}=c;if(r){if(o){let e=(t.styles||Oc(c)).filter(e=>[`prepend`,`prependQueue`].includes(e.getAttribute(xc))?i>=Number(e.getAttribute(Sc)||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 Ac(e,t={}){let{styles:n}=t;return n||=Oc(Ec(t)),n.find(n=>n.getAttribute(Tc(t))===e)}function jc(e,t){let n=wc.get(e);if(!n||!bc(document,n)){let n=kc(``,t),{parentNode:r}=n;wc.set(e,r),e.removeChild(n)}}function Mc(e,t,n={}){let r=Ec(n),i=Oc(r),a={...n,styles:i};jc(r,a);let o=Ac(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=kc(e,a);return s.setAttribute(Tc(a),t),s}function Nc(e){return e?.getRootNode?.()}function Pc(e){return Nc(e)instanceof ShadowRoot}function Fc(e){return Pc(e)?Nc(e):null}var Ic={},Lc=[],Rc=e=>{Lc.push(e)};function zc(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){let e=Lc.reduce((e,t)=>t(e??``,`warning`),t);e&&console.error(`Warning: ${e}`)}}function Bc(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){let e=Lc.reduce((e,t)=>t(e??``,`note`),t);e&&console.warn(`Note: ${e}`)}}function Vc(){Ic={}}function Hc(e,t,n){!t&&!Ic[n]&&(e(!1,n),Ic[n]=!0)}function Uc(e,t){Hc(zc,e,t)}function Wc(e,t){Hc(Bc,e,t)}Uc.preMessage=Rc,Uc.resetWarned=Vc,Uc.noteOnce=Wc;function Gc(e){return e.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Kc(e,t){Uc(e,`[@ant-design/icons] ${t}`)}function qc(e){return typeof e==`object`&&typeof e.name==`string`&&typeof e.theme==`string`&&(typeof e.icon==`object`||typeof e.icon==`function`)}function Jc(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[Gc(n)]=r}return t},{})}function Yc(e,t,n){return n?s.default.createElement(e.tag,{key:t,...Jc(e.attrs),...n},(e.children||[]).map((n,r)=>Yc(n,`${t}-${e.tag}-${r}`))):s.default.createElement(e.tag,{key:t,...Jc(e.attrs)},(e.children||[]).map((n,r)=>Yc(n,`${t}-${e.tag}-${r}`)))}function Xc(e){return Ks(e)[0]}function Zc(e){return e?Array.isArray(e)?e:[e]:[]}var Qc=`
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
+ `,$c=e=>{let{csp:t,prefixCls:n,layer:r}=(0,s.useContext)(Ds),i=Qc;n&&(i=i.replace(/anticon/g,n)),r&&(i=`@layer ${r} {\n${i}\n}`),(0,s.useEffect)(()=>{let n=e.current,a=Fc(n);Mc(i,`@ant-design-icons`,{prepend:!r,csp:t,attachTo:a})},[])},el={primaryColor:`#333`,secondaryColor:`#E6E6E6`,calculated:!1};function tl({primaryColor:e,secondaryColor:t}){el.primaryColor=e,el.secondaryColor=t||Xc(e),el.calculated=!!t}function nl(){return{...el}}var rl=e=>{let{icon:t,className:n,onClick:r,style:i,primaryColor:a,secondaryColor:o,...c}=e,l=s.useRef(null),u=el;if(a&&(u={primaryColor:a,secondaryColor:o||Xc(a)}),$c(l),Kc(qc(t),`icon should be icon definiton, but got ${t}`),!qc(t))return null;let d=t;return d&&typeof d.icon==`function`&&(d={...d,icon:d.icon(u.primaryColor,u.secondaryColor)}),Yc(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})};rl.displayName=`IconReact`,rl.getTwoToneColors=nl,rl.setTwoToneColors=tl;function il(e){let[t,n]=Zc(e);return rl.setTwoToneColors({primaryColor:t,secondaryColor:n})}function al(){let e=rl.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}function ol(){return ol=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},ol.apply(this,arguments)}il(tc.primary);var sl=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(Ds),p=ks(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,_]=Zc(l);return s.createElement(`span`,ol({role:`img`,"aria-label":r.name},u,{ref:t,tabIndex:m,onClick:c,className:p}),s.createElement(rl,{icon:r,primaryColor:g,secondaryColor:_,style:h}))});sl.getTwoToneColor=al,sl.setTwoToneColor=il,process.env.NODE_ENV!==`production`&&(sl.displayName=`AntdIcon`);var cl={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 ll(){return ll=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},ll.apply(this,arguments)}var ul=s.forwardRef((e,t)=>s.createElement(sl,ll({},e,{ref:t,icon:cl})));process.env.NODE_ENV!==`production`&&(ul.displayName=`LoadingOutlined`);function dl({size:e=24,className:t}){return(0,u.jsx)(ul,{className:t,style:{fontSize:e},spin:!0})}function fl(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),n=Oa(),r=M.default.useRef(null),[i,a]=M.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:()=>{fn(r.current)},onMouseDown:e=>{e.preventDefault()},title:t.toolbar.insert.image,type:`button`,children:i?(0,u.jsx)(dl,{}):(0,u.jsx)(Es,{})}),(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(He,{altText:i.name,src:o}),e.focus()},ref:r,type:`file`})]})}function pl(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 ml=`noreferrer`;function hl({enableShortcutListener:e=!0,showButton:n=!0}){let[r]=(0,h.useLexicalComposerContext)(),i=U(),[a,o]=M.default.useState(!1),[s,c]=M.default.useState(``),[l,f]=M.default.useState(``),[p,m]=M.default.useState(``),[g,_]=M.default.useState(!0),v=M.default.useCallback(()=>{o(!1),r.focus()},[r]),y=M.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 M.default.useEffect(()=>{if(!e)return;let t=()=>y();return window.addEventListener(Ge,t),()=>{window.removeEventListener(Ge,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:P(`MOD+K`,i.toolbar.shortcuts.link),type:`button`,children:(0,u.jsx)(pl,{})}):null,(0,u.jsx)(us,{okText:i.common.insert,onCancel:v,onOk:()=>{let e=p.trim();if(!e){r.focus();return}let n={rel:ml,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 gl(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 _l=1,vl=20,yl=8,bl=10;function xl({onTableInserted:e}){let[t]=(0,h.useLexicalComposerContext)(),n=U(),r=M.default.useId(),i=M.default.useId(),[a,s]=M.default.useState(!1),[c,l]=M.default.useState(3),[d,f]=M.default.useState(3),[m,g]=M.default.useState(3),[_,v]=M.default.useState(3),[y,b]=M.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:yl}).map((e,t)=>(0,u.jsx)(M.default.Fragment,{children:Array.from({length:bl}).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)(ls,{id:r,integerOnly:!0,max:vl,min:_l,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)(ls,{id:i,integerOnly:!0,max:vl,min:_l,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)(gl,{})})})}function Sl(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 Cl(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=M.default.useState(!1),[i,a]=M.default.useState(``),[o,s]=M.default.useState(``),[c,l]=M.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)(Sl,{"aria-hidden":`true`})}),(0,u.jsx)(us,{okText:t.common.insert,onCancel:()=>{r(!1),l(``),e.focus()},onOk:()=>{let n=De(o);if(!n){l(t.toolbar.youtube.invalidUrl);return}e.dispatchCommand(Ue,{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 wl({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)(xl,{onTableInserted:e}),(0,u.jsx)(hl,{enableShortcutListener:!1}),(0,u.jsx)(Cs,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(fl,{}),(0,u.jsx)(Cl,{}),(0,u.jsx)(Ts,{})]})]})}function Tl(){return(0,u.jsx)(`div`,{className:`rj-editor-toolbar-panel`,role:`tabpanel`})}function El(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 Dl(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 Ol(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 kl(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 Al(){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 jl(){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=Al(),r=n?(0,m.$getNearestNodeOfType)(n,p.TableCellNode):null;return r?[r]:[]}function Ml(){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=Al();return n?(0,m.$getNearestNodeOfType)(n,p.TableNode):null}function Nl(){let e=jl(),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 Q(e,t){e.update(t),e.focus()}function Pl(e,t){Q(e,()=>{(0,p.$insertTableRowAtSelection)(t)})}function Fl(e,t){Q(e,()=>{(0,p.$insertTableColumnAtSelection)(t)})}function Il(e){Q(e,()=>{(0,p.$deleteTableRowAtSelection)()})}function Ll(e){Q(e,()=>{(0,p.$deleteTableColumnAtSelection)()})}function Rl(e){Q(e,()=>{let e=Ml();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 zl(e){Q(e,()=>{let e=jl();e.length>1&&(0,p.$mergeCells)(e)})}function Bl(e){Q(e,()=>{(0,p.$unmergeCell)()})}function Vl(e,t){Q(e,()=>{jl().forEach(e=>{e.setBackgroundColor(t)})})}function Hl(e,t){Q(e,()=>{jl().forEach(e=>{e.setVerticalAlign(t)})})}function Ul(e){Q(e,()=>{let e=jl()[0];if(!e)return;let[,t]=(0,p.$getNodeTriplet)(e);t.getChildren().forEach(e=>{(0,p.$isTableCellNode)(e)&&e.toggleHeaderStyle(p.TableCellHeaderStates.ROW)})})}function Wl(e){Q(e,()=>{let e=jl()[0],t=Ml(),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 Gl(){let[e]=(0,h.useLexicalComposerContext)(),t=U(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.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:()=>{Vl(e,null),r(!1)},type:`button`,children:[(0,u.jsx)(`span`,{className:`rj-editor-color-none`}),t.common.none]})},{type:`divider`},...Ie.map(t=>({key:t,label:(0,u.jsxs)(`button`,{className:`rj-editor-color-menu-item`,onClick:()=>{Vl(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||Ie[0]}}),t.common.moreColors,(0,u.jsx)(`input`,{"aria-label":t.common.moreColors,className:`rj-editor-color-menu-input`,onChange:t=>{Vl(e,t.target.value),a(t.target.value),r(!0)},onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),type:`color`,value:c||Ie[0]})]})}]},onOpenChange:t=>{r(t),!t&&i&&(window.setTimeout(()=>{Vl(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)(El,{"aria-hidden":`true`})})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignTop,className:l===`top`?`is-active`:void 0,disabled:!s,onClick:()=>Hl(e,`top`),type:`button`,children:(0,u.jsx)(kl,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignMiddle,className:l===`middle`?`is-active`:void 0,disabled:!s,onClick:()=>Hl(e,`middle`),type:`button`,children:(0,u.jsx)(Ol,{"aria-hidden":`true`})}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.alignBottom,className:l===`bottom`?`is-active`:void 0,disabled:!s,onClick:()=>Hl(e,`bottom`),type:`button`,children:(0,u.jsx)(Dl,{"aria-hidden":`true`})})]})}function Kl(){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:()=>Fl(e,!1),type:`button`,children:t.toolbar.table.columnLeft}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertColumnRight,disabled:n,onClick:()=>Fl(e,!0),type:`button`,children:t.toolbar.table.columnRight})]})}function ql(){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:()=>Il(e),type:`button`,children:[(0,u.jsx)(Ea,{"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:()=>Ll(e),type:`button`,children:[(0,u.jsx)(Ea,{"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:()=>Rl(e),type:`button`,children:(0,u.jsx)(Ea,{"aria-hidden":`true`})})]})}function Jl(){return(0,u.jsx)(`span`,{className:`rj-editor-toolbar-divider`,"aria-hidden":`true`})}function Yl(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 Xl(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 Zl(){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:()=>Ul(e),type:`button`,title:t.toolbar.table.headerRow,children:[(0,u.jsx)(Yl,{}),` \xA0 `,t.toolbar.table.header]}),(0,u.jsxs)(`button`,{"aria-label":t.toolbar.table.header,disabled:!n,onClick:()=>Wl(e),type:`button`,title:t.toolbar.table.headerColumn,children:[(0,u.jsx)(Xl,{}),` \xA0 `,t.toolbar.table.header]})]})}function Ql(){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:()=>zl(e),type:`button`,children:t.toolbar.table.mergeCells}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.unmergeCell,disabled:!n||!i,onClick:()=>Bl(e),type:`button`,children:t.toolbar.table.unmergeCell})]})}function $l(){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:()=>Pl(e,!1),type:`button`,children:t.toolbar.table.rowAbove}),(0,u.jsx)(`button`,{"aria-label":t.toolbar.table.insertRowBelow,disabled:n,onClick:()=>Pl(e,!0),type:`button`,children:t.toolbar.table.rowBelow})]})}function eu(){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)($l,{}),(0,u.jsx)(Jl,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Kl,{}),(0,u.jsx)(Jl,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Ql,{}),(0,u.jsx)(Jl,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Gl,{}),(0,u.jsx)(Jl,{})]}),(0,u.jsxs)(`div`,{className:`rj-editor-toolbar-group`,children:[(0,u.jsx)(Zl,{}),(0,u.jsx)(Jl,{})]}),(0,u.jsx)(`div`,{className:`rj-editor-toolbar-group`,children:(0,u.jsx)(ql,{})})]})}function tu(){let e=(0,t.$getSelection)();if(!(0,t.$isNodeSelection)(e))return null;let n=e.getNodes().find(ea);return ea(n)?n:null}function nu(){let e=tu();return{isEquationSelected:!!e,selectedEquation:e?.getEquation(),selectedEquationDisplayMode:e?.getDisplayMode(),selectedEquationKey:e?.getKey()}}function ru(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 iu(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 au=[{value:`home`},{value:`insert`},{value:`equation`},{value:`image`},{value:`table`}];function ou({isFullscreen:e,onToggleFullscreen:n}){let[r]=(0,h.useLexicalComposerContext)(),i=U(),[a,o]=M.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=au.filter(e=>(e.value!==`table`||d)&&(e.value!==`equation`||c)&&(e.value!==`image`||l));return M.default.useEffect(()=>{let e=()=>{let e=(0,t.$getSelection)(),n=nu(),r=ps(),i=Nl();if(s(jn(n)),s(Mn(r)),s(Pn(i)),!(0,t.$isRangeSelection)(e))return;let a=e.anchor.getNode(),o=a.getTopLevelElementOrThrow(),c=(0,m.$getNearestNodeOfType)(a,f.ListNode);s(Fn({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(Nn({backgroundColor:(0,E.$getSelectionStyleValueForProperty)(e,`background-color`,``),fontFamily:Je((0,E.$getSelectionStyleValueForProperty)(e,`font-family`,``)),fontSize:Xe((0,E.$getSelectionStyleValueForProperty)(e,`font-size`,``)),lineHeight:(0,E.$getSelectionStyleValueForProperty)(e,`line-height`,``)||void 0,textColor:(0,E.$getSelectionStyleValueForProperty)(e,`color`,``)})),s(On({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(An(e)),!1),t.COMMAND_PRIORITY_LOW),o=r.registerCommand(t.CAN_REDO_COMMAND,e=>(s(kn(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)(iu,{"aria-hidden":`true`}):(0,u.jsx)(ru,{"aria-hidden":`true`})})]}),p===`home`?(0,u.jsx)(as,{editor:r}):null,p===`image`?(0,u.jsx)(Ss,{}):null,p===`insert`?(0,u.jsx)(wl,{onTableInserted:()=>o(`table`)}):null,p===`table`?(0,u.jsx)(eu,{}):null,p===`layout`?(0,u.jsx)(Tl,{}):null,(0,u.jsx)(hl,{showButton:!1})]})}function su(){let[e]=(0,h.useLexicalComposerContext)();return(0,M.useEffect)(()=>e.registerCommand(Ve,e=>{let n=$i(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}var cu=[`pnpm`,`npm`,`yarn`,`bun`,`terminal`],lu=`data-rj-code-title`,uu=`data-rj-code-custom-title`,du=[`[data-line]`,`[data-highlighted-line]`,`.line`,`.code-line`].join(`, `);function fu(e){return e instanceof HTMLElement&&e.innerText?e.innerText:e.textContent||``}function pu(e){let t=[e.getAttribute(`data-language`),e.getAttribute(`data-lang`)].find(Boolean);return[e.className,e.querySelector(`code`)?.className].find(e=>/(?:^|\s)language-[a-z0-9-]+(?:\s|$)/i.test(e||``))?.match(/(?:^|\s)language-([a-z0-9-]+)/i)?.[1]||t||`plain`}function mu(e){let t=Array.from(e.querySelectorAll(du));return t.length>1?t.map(e=>fu(e).replace(/\u00a0/g,` `)).join(`
67
+ `).replace(/\n+$/g,``):fu(e).replace(/\u00a0/g,` `).replace(/^\n+|\n+$/g,``)}function hu(e,t){let n=fu(e).toLowerCase().replace(t.toLowerCase(),``);return!!e.querySelector(`button, [role="tab"], [role="tablist"]`)||cu.some(e=>n.includes(e))}function gu(e){let t=e.parentElement;for(;t&&t!==t.ownerDocument.body&&!(t.querySelectorAll(`pre`).length>1);){if(hu(t,fu(e)))return t;t=t.parentElement}return e}function _u(e,t){return fu(e).toLowerCase().includes(`terminal`)?`terminal`:pu(t)}function vu(e,t,n){let r=t.getAttribute(uu)||t.getAttribute(lu)||t.getAttribute(`data-title`)||t.getAttribute(`data-filename`);if(r)return r;let i=fu(e).toLowerCase(),a=fu(t).toLowerCase(),o=i.replace(a,``);return cu.find(e=>o.includes(e))||n}function yu(e,t,n){let r=e.createElement(`pre`),i=_u(n,t),a=vu(n,t,i);return r.setAttribute(`data-language`,i),r.setAttribute(lu,a),a!==i&&r.setAttribute(uu,a),r.textContent=mu(t),r}function bu(e){if(!e.trim()||typeof DOMParser>`u`)return null;let t=new DOMParser().parseFromString(e,`text/html`),n=Array.from(t.querySelectorAll(`pre`));return n.length===0?null:(n.forEach(e=>{let n=e,r=gu(n),i=yu(t,n,r);r.replaceWith(i)}),t.body.innerHTML)}function xu(){let[e]=(0,h.useLexicalComposerContext)();return M.default.useEffect(()=>{let n=e.registerCommand(Be,({code:e=``,language:n,title:r})=>{let i=ua(n,r);return e&&i.append((0,t.$createTextNode)(e)),(0,m.$insertNodeToNearestRoot)(i),i.insertAfter((0,t.$createParagraphNode)()),i.selectEnd(),!0},t.COMMAND_PRIORITY_EDITOR),r=e.registerCommand(t.PASTE_COMMAND,n=>{let r=(n instanceof ClipboardEvent?n.clipboardData:null)?.getData(`text/html`),a=r?bu(r):null;return a?(n.preventDefault(),e.update(()=>{let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n))return;let r=(0,i.$generateNodesFromDOM)(e,new DOMParser().parseFromString(a,`text/html`));n.insertNodes(r)},{tag:t.PASTE_TAG}),!0):!1},t.COMMAND_PRIORITY_HIGH),a=e.registerUpdateListener(({editorState:n})=>{let r=!1;n.read(()=>{r=q((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();q(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{a(),r(),n()}},[e]),null}var Su=8,Cu=1,wu={codeNodeKey:``,items:[],left:0,prefix:``,selectedIndex:0,top:0,visible:!1},Tu={bun:`terminal`,javascript:`js`,node:`js`,npm:`terminal`,pnpm:`terminal`,shell:`terminal`,sh:`terminal`,terminal:`terminal`,text:`plain`,ts:`typescript`,yarn:`terminal`},Eu={bash:[`alias`,`case`,`cd`,`chmod`,`cp`,`curl`,`do`,`done`,`echo`,`elif`,`else`,`export`,`fi`,`for`,`function`,`grep`,`if`,`mkdir`,`mv`,`npm`,`npx`,`pnpm`,`then`,`while`,`yarn`],css:[`align-items`,`background`,`border`,`color`,`display`,`flex`,`font-size`,`gap`,`grid`,`height`,`justify-content`,`margin`,`padding`,`position`,`width`],html:[`article`,`aside`,`button`,`class`,`div`,`footer`,`header`,`href`,`img`,`input`,`main`,`nav`,`section`,`span`,`type`],java:[`abstract`,`boolean`,`class`,`extends`,`final`,`implements`,`import`,`interface`,`new`,`private`,`protected`,`public`,`return`,`static`,`void`],js:`async.await.break.case.catch.class.const.continue.default.else.export.false.finally.for.function.if.import.let.new.null.return.switch.this.throw.true.try.typeof.undefined.var.while`.split(`.`),json:[`false`,`null`,`true`],markdown:[`blockquote`,`code`,`heading`,`image`,`link`,`list`,`table`],powershell:[`cd`,`Copy-Item`,`ForEach-Object`,`Get-ChildItem`,`Get-Content`,`if`,`Import-Module`,`New-Item`,`Set-Location`,`Where-Object`],py:[`as`,`async`,`await`,`class`,`def`,`elif`,`else`,`except`,`False`,`finally`,`for`,`from`,`if`,`import`,`in`,`lambda`,`None`,`return`,`self`,`True`,`try`,`while`],rust:[`async`,`await`,`enum`,`fn`,`impl`,`let`,`match`,`mod`,`mut`,`pub`,`return`,`self`,`struct`,`trait`,`use`],sql:[`ALTER`,`CREATE`,`DELETE`,`FROM`,`GROUP BY`,`INSERT`,`JOIN`,`ORDER BY`,`SELECT`,`UPDATE`,`VALUES`,`WHERE`],terminal:[`bun`,`bun add`,`bun install`,`cd`,`mkdir`,`npm`,`npm install`,`npm run build`,`npm run dev`,`npx`,`pnpm`,`pnpm add`,`pnpm create`,`pnpm dev`,`pnpm install`,`yarn`,`yarn add`],typescript:`abstract.async.await.break.catch.class.const.declare.else.enum.export.extends.false.finally.for.function.if.implements.import.interface.let.new.null.private.protected.public.readonly.return.satisfies.type.undefined`.split(`.`),yaml:[`apiVersion`,`containers`,`env`,`image`,`kind`,`metadata`,`name`,`services`,`spec`,`version`]};Eu.jsx=[...Eu.js,`Fragment`,`props`,`React`,`useCallback`,`useEffect`,`useMemo`,`useRef`,`useState`],Eu.tsx=[...Eu.typescript,`Fragment`,`React`,`useCallback`,`useEffect`,`useMemo`,`useRef`,`useState`],Eu.xml=Eu.html,Eu.dockerfile=[`ADD`,`ARG`,`CMD`,`COPY`,`ENTRYPOINT`,`ENV`,`EXPOSE`,`FROM`,`LABEL`,`RUN`,`USER`,`WORKDIR`];function Du(e){let t=(e||`plain`).trim().toLowerCase();return Tu[t]||t}function Ou(e){let t=e.anchor.getNode();if(q(t))return t;let n=t.getParent();return q(n)?n:null}function ku(e,t){let n=t.anchor,r=n.getNode(),i=e.getChildren(),a=0;if(n.type===`element`&&r.is(e)){for(let e=0;e<n.offset;e+=1)a+=i[e]?.getTextContentSize()||0;return a}for(let e of i){if(e.is(r))return a+n.offset;a+=e.getTextContentSize()}return a}function Au(e,t){let n=e.slice(0,t);return/[A-Za-z_$@./-][\w$@./:-]*$/.exec(n)?.[0]||``}function ju(e,t){if(![`js`,`jsx`,`tsx`,`typescript`].includes(t))return[];let n=new Set,r=/\b(?:const|let|var|function|class|interface|type|enum)\s+([A-Za-z_$][\w$]*)/g,i;for(;(i=r.exec(e))!==null;)n.add(i[1]);return Array.from(n)}function Mu(e){return e===`plain`?[]:Eu[e]||[]}function Nu(e){let t=e.prefix.toLowerCase(),n=[...ju(e.text,e.language),...Mu(e.language)],r=new Set;return n.filter(e=>{let n=e.toLowerCase(),i=n.startsWith(t)&&n!==t&&!r.has(n);return r.add(n),i}).slice(0,Su)}function Pu(){let e=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(e)||!e.isCollapsed())return null;let n=Ou(e);if(!n)return null;let r=e.anchor.getNode();if(!(0,t.$isTextNode)(r)&&!r.is(n))return null;let i=ku(n,e),a=n.getTextContent(),o=Au(a,i);return o.length<Cu?null:{codeNode:n,language:Du(n.getLanguage()),offset:i,prefix:o,text:a}}function Fu(e){let t=window.getSelection();if(!t||t.rangeCount===0)return null;let n=t.getRangeAt(0).getBoundingClientRect(),r=e.getBoundingClientRect(),i=e.getBoundingClientRect(),a=n.width||n.height?n:i;return{left:Math.max(8,a.left-r.left),top:Math.max(8,a.bottom-r.top+6)}}function Iu(e){return e.key.length===1&&(e.metaKey||e.ctrlKey||e.altKey)}function Lu(e,t){return e.visible===t.visible&&e.codeNodeKey===t.codeNodeKey&&e.left===t.left&&e.prefix===t.prefix&&e.selectedIndex===t.selectedIndex&&e.top===t.top&&e.items.length===t.items.length&&e.items.every((e,n)=>e===t.items[n])}function Ru(e,n){let r=e.slice(n.length);if(!r)return;let i=(0,t.$getSelection)();(0,t.$isRangeSelection)(i)&&i.isCollapsed()&&i.insertText(r)}function zu(e){return q(e)||q(e?.getParent())}function Bu(){let[e]=(0,h.useLexicalComposerContext)(),[n,r]=M.default.useState(wu),i=M.default.useRef(n),a=M.default.useCallback(()=>{let t=wu;e.getEditorState().read(()=>{let n=Pu();if(!n)return;let r=e.getRootElement()?.closest(`.rj-editor-body`),i=r instanceof HTMLElement?Fu(r):null;if(!i)return;let a=Nu(n);a.length!==0&&(t={codeNodeKey:n.codeNode.getKey(),items:a,left:i.left,prefix:n.prefix,selectedIndex:0,top:i.top,visible:!0})}),r(e=>Lu(e,t)?e:t)},[e]),o=M.default.useCallback((n,i)=>{e.update(()=>{let e=(0,t.$getSelection)();zu((0,t.$isRangeSelection)(e)?e.anchor.getNode():null)&&Ru(n,i)}),r(wu)},[e]);return M.default.useEffect(()=>{i.current=n},[n]),M.default.useEffect(()=>{let n=e.registerUpdateListener(()=>{a()}),s=e.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(a(),!1),t.COMMAND_PRIORITY_HIGH),c=e.registerCommand(t.KEY_DOWN_COMMAND,e=>{let t=i.current;if(!t.visible)return!1;if(Iu(e))return r(wu),!1;if(e.key===`Escape`)return e.preventDefault(),r(wu),!0;if(e.key===`ArrowDown`||e.key===`ArrowUp`)return e.preventDefault(),r(t=>{if(!t.visible)return t;let n=e.key===`ArrowDown`?1:-1,r=(t.selectedIndex+n+t.items.length)%t.items.length;return{...t,selectedIndex:r}}),!0;if(e.key===`Enter`||e.key===`Tab`){e.preventDefault();let n=t.items[t.selectedIndex];return n&&o(n,t.prefix),!0}return!1},t.COMMAND_PRIORITY_HIGH);return()=>{c(),s(),n()}},[e,o,a]),n.visible?(0,u.jsx)(`div`,{className:`rj-editor-code-completion`,contentEditable:!1,onMouseDown:e=>e.preventDefault(),style:{left:n.left,top:n.top},children:n.items.map((e,t)=>(0,u.jsx)(`button`,{className:t===n.selectedIndex?`is-active`:void 0,onClick:()=>o(e,n.prefix),onMouseEnter:()=>{r(e=>e.visible?{...e,selectedIndex:t}:e)},type:`button`,children:e},e))}):null}var Vu=ie(ne(((e,t)=>{var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++n}),e.__id},clone:function e(t,n){n||={};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a||={};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i,globalThis.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],ee=w.slice(0,D),te=w.slice(D+j.length),ne=C+w.length;d&&ne>d.reach&&(d.reach=ne);var re=S.prev;ee&&(re=l(t,re,ee),C+=ee.length),u(t,re,T);var ie=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,re,ie),te&&l(t,S,te),T>1){var M={cause:f+`,`+m,reach:ne};s(e,t,n,S.prev,C,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),globalThis.Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},globalThis.Prism.languages.markup.tag.inside[`attr-value`].inside.entity=globalThis.Prism.languages.markup.entity,globalThis.Prism.languages.markup.doctype.inside[`internal-subset`].inside=globalThis.Prism.languages.markup,globalThis.Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(globalThis.Prism.languages.markup.tag,`addInlined`,{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:globalThis.Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:globalThis.Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},globalThis.Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(globalThis.Prism.languages.markup.tag,`addAttribute`,{value:function(e,t){globalThis.Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:globalThis.Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),globalThis.Prism.languages.html=globalThis.Prism.languages.markup,globalThis.Prism.languages.mathml=globalThis.Prism.languages.markup,globalThis.Prism.languages.svg=globalThis.Prism.languages.markup,globalThis.Prism.languages.xml=globalThis.Prism.languages.extend(`markup`,{}),globalThis.Prism.languages.ssml=globalThis.Prism.languages.xml,globalThis.Prism.languages.atom=globalThis.Prism.languages.xml,globalThis.Prism.languages.rss=globalThis.Prism.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;globalThis.Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},globalThis.Prism.languages.css.atrule.inside.rest=globalThis.Prism.languages.css;var n=globalThis.Prism.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(globalThis.Prism),globalThis.Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},globalThis.Prism.languages.javascript=globalThis.Prism.languages.extend(`clike`,{"class-name":[globalThis.Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),globalThis.Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,globalThis.Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:globalThis.Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:globalThis.Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),globalThis.Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:globalThis.Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),globalThis.Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),globalThis.Prism.languages.markup&&(globalThis.Prism.languages.markup.tag.addInlined(`script`,`javascript`),globalThis.Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),globalThis.Prism.languages.js=globalThis.Prism.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}globalThis.Prism.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),globalThis.Prism.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=globalThis.Prism.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
68
+ `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),globalThis.Prism.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;globalThis.Prism.fileHighlight=function(){f||=(console.warn("globalThis.Prism.fileHighlight is deprecated. Use `globalThis.Prism.plugins.fileHighlight.highlight` instead."),!0),globalThis.Prism.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);globalThis.Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},globalThis.Prism.languages.javascript=globalThis.Prism.languages.extend(`clike`,{"class-name":[globalThis.Prism.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),globalThis.Prism.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,globalThis.Prism.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:globalThis.Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:globalThis.Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:globalThis.Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),globalThis.Prism.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:globalThis.Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),globalThis.Prism.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),globalThis.Prism.languages.markup&&(globalThis.Prism.languages.markup.tag.addInlined(`script`,`javascript`),globalThis.Prism.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),globalThis.Prism.languages.js=globalThis.Prism.languages.javascript,globalThis.Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},globalThis.Prism.languages.markup.tag.inside[`attr-value`].inside.entity=globalThis.Prism.languages.markup.entity,globalThis.Prism.languages.markup.doctype.inside[`internal-subset`].inside=globalThis.Prism.languages.markup,globalThis.Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(globalThis.Prism.languages.markup.tag,`addInlined`,{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:globalThis.Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:globalThis.Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},globalThis.Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(globalThis.Prism.languages.markup.tag,`addAttribute`,{value:function(e,t){globalThis.Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:globalThis.Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),globalThis.Prism.languages.html=globalThis.Prism.languages.markup,globalThis.Prism.languages.mathml=globalThis.Prism.languages.markup,globalThis.Prism.languages.svg=globalThis.Prism.languages.markup,globalThis.Prism.languages.xml=globalThis.Prism.languages.extend(`markup`,{}),globalThis.Prism.languages.ssml=globalThis.Prism.languages.xml,globalThis.Prism.languages.atom=globalThis.Prism.languages.xml,globalThis.Prism.languages.rss=globalThis.Prism.languages.xml,(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;globalThis.Prism.languages.markdown=globalThis.Prism.languages.extend(`markup`,{}),globalThis.Prism.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:globalThis.Prism.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:globalThis.Prism.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:globalThis.Prism.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(e){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(t){e!==t&&(globalThis.Prism.languages.markdown[e].inside.content.inside[t]=globalThis.Prism.languages.markdown[t])})}),globalThis.Prism.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),globalThis.Prism.hooks.add(`wrap`,function(e){if(e.type===`code-block`){for(var t=``,n=0,r=e.classes.length;n<r;n++){var i=e.classes[n],a=/language-(.+)/.exec(i);if(a){t=a[1];break}}var o=globalThis.Prism.languages[t];if(o)e.content=globalThis.Prism.highlight(l(e.content),o,t);else if(t&&t!==`none`&&globalThis.Prism.plugins.autoloader){var s=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);e.attributes.id=s,globalThis.Prism.plugins.autoloader.loadLanguages(t,function(){var e=document.getElementById(s);e&&(e.innerHTML=globalThis.Prism.highlight(e.textContent,globalThis.Prism.languages[t],t))})}}});var o=RegExp(globalThis.Prism.languages.markup.tag.pattern.source,`gi`),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;function l(e){var t=e.replace(o,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?c(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):s[t]||e}),t}globalThis.Prism.languages.md=globalThis.Prism.languages.markdown})(globalThis.Prism),globalThis.Prism.languages.c=globalThis.Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),globalThis.Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),globalThis.Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},globalThis.Prism.languages.c.string],char:globalThis.Prism.languages.c.char,comment:globalThis.Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:globalThis.Prism.languages.c}}}}),globalThis.Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete globalThis.Prism.languages.c.boolean,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;globalThis.Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},globalThis.Prism.languages.css.atrule.inside.rest=globalThis.Prism.languages.css;var n=globalThis.Prism.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(globalThis.Prism),globalThis.Prism.languages.objectivec=globalThis.Prism.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete globalThis.Prism.languages.objectivec[`class-name`],globalThis.Prism.languages.objc=globalThis.Prism.languages.objectivec,globalThis.Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var t=globalThis.Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(globalThis.Prism),globalThis.Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},globalThis.Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=globalThis.Prism.languages.python,globalThis.Prism.languages.py=globalThis.Prism.languages.python,(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),globalThis.Prism.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},globalThis.Prism.languages.rust[`closure-params`].inside.rest=globalThis.Prism.languages.rust,globalThis.Prism.languages.rust.attribute.inside.string=globalThis.Prism.languages.rust.string})(globalThis.Prism),globalThis.Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},globalThis.Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=globalThis.Prism.languages.swift}),(function(e){globalThis.Prism.languages.typescript=globalThis.Prism.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),globalThis.Prism.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete globalThis.Prism.languages.typescript.parameter,delete globalThis.Prism.languages.typescript[`literal-property`];var t=globalThis.Prism.languages.extend(`typescript`,{});delete t[`class-name`],globalThis.Prism.languages.typescript[`class-name`].inside=t,globalThis.Prism.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),globalThis.Prism.languages.ts=globalThis.Prism.languages.typescript})(globalThis.Prism),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};globalThis.Prism.languages.java=globalThis.Prism.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[globalThis.Prism.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),globalThis.Prism.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),globalThis.Prism.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(globalThis.Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});globalThis.Prism.languages.cpp=globalThis.Prism.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),globalThis.Prism.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),globalThis.Prism.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:globalThis.Prism.languages.cpp}}}}),globalThis.Prism.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),globalThis.Prism.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:globalThis.Prism.languages.extend(`cpp`,{})}}),globalThis.Prism.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},globalThis.Prism.languages.cpp[`base-clause`])})(globalThis.Prism);function Hu(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(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
69
+ ?|
70
+ |(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,`PREFIXES`,{value:t})})(globalThis.Prism);var $=globalThis.Prism||window.Prism;function Uu(e){let t=function(e){let t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e)||e;try{return!!t&&$.languages.hasOwnProperty(t)}catch{return!1}}async function Wu(e,t,n){}function Gu(e){return typeof e==`string`?e:Array.isArray(e)?e.map(Gu).join(``):Gu(e.content)}function Ku(e,t){let n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent(),i=$.tokenize(r,$.languages[n?`diff`:t]);return n&&(i=function(e,t){let n=t,r=$.languages[n],i={tokens:e},a=$.languages.diff.PREFIXES;for(let e of i.tokens){if(typeof e==`string`||!(e.type in a)||!Array.isArray(e.content))continue;let t=e.type,n=0,i=()=>(n++,new $.Token(`prefix`,a[t],t.replace(/^(\w+).*/,`$1`))),o=e.content.filter(e=>typeof e==`string`||e.type!==`prefix`),s=e.content.length-o.length,c=$.tokenize(Gu(o),r);c.unshift(i());let l=/\r\n|\n/g,u=e=>{let t=[];l.lastIndex=0;let r,a=0;for(;n<s&&(r=l.exec(e));){let n=r.index+r[0].length;t.push(e.slice(a,n)),a=n,t.push(i())}if(t.length!==0)return a<e.length&&t.push(e.slice(a)),t},d=e=>{for(let t=0;t<e.length&&n<s;t++){let n=e[t];if(typeof n==`string`){let r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if(typeof n.content==`string`){let e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(c),n<s&&c.push(i()),e.content=c}return i.tokens}(i,n[1])),qu(i)}function qu(e,n){let r=[];for(let i of e)if(typeof i==`string`){let e=i.split(/(\n|\t)/),a=e.length;for(let i=0;i<a;i++){let a=e[i];a===`
71
+ `||a===`\r
72
+ `?r.push((0,t.$createLineBreakNode)()):a===` `?r.push((0,t.$createTabNode)()):a.length>0&&r.push(Ii(a,n))}}else{let{content:e,alias:t}=i;typeof e==`string`?r.push(...qu([e],i.type===`prefix`&&typeof t==`string`?t:i.type)):Array.isArray(e)&&r.push(...qu(e,i.type===`unchanged`?void 0:i.type))}return r}var Ju={$tokenize(e,t){return Ku(e,t||this.defaultLanguage)},defaultLanguage:bi,tokenize(e,t){return $.tokenize(e,$.languages[t||``]||$.languages[this.defaultLanguage])}};function Yu(e,n,r,i){let a=i.getParent();q(a)?Zu(e,n,r,a):J(i)&&i.replace((0,t.$createTextNode)(i.__text))}function Xu(e,n){let r=n.getElementByKey(e.getKey());if(r===null)return;let i=e.getChildren(),a=i.length;if(a===r.__cachedChildrenLength)return;r.__cachedChildrenLength=a;let o=`1`,s=1;for(let e=0;e<a;e++)(0,t.$isLineBreakNode)(i[e])&&(o+=`
73
+ `+ ++s);r.setAttribute(`data-gutter`,o)}function Zu(e,n,r,i){let{nodesCurrentlyHighlighting:a}=r,o=i.getKey();if(i.getLanguage()===void 0&&i.setLanguage(n.defaultLanguage),!Uu(i.getLanguage()||n.defaultLanguage))return i.getIsSyntaxHighlightSupported()&&i.setIsSyntaxHighlightSupported(!1),void Wu();i.getIsSyntaxHighlightSupported()||i.setIsSyntaxHighlightSupported(!0),a.has(o)||(a.add(o),r.didTransform||(r.didTransform=!0,(0,t.$onUpdate)(()=>{r.didTransform=!1,a.clear()})),function(e,n){let r=(0,t.$getNodeByKey)(e);if(!q(r)||!r.isAttached())return;let i=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(i))return void n();let a=i.anchor,o=a.offset,s=a.type===`element`&&(0,t.$isLineBreakNode)(r.getChildAtIndex(a.offset-1)),c=0;if(s||(c=o+a.getNode().getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),n()){if(s)return void a.getNode().select(o,o);r.getChildren().some(e=>{let n=(0,t.$isTextNode)(e);if(n||(0,t.$isLineBreakNode)(e)){let t=e.getTextContentSize();if(n&&t>=c)return e.select(c,c),!0;c-=t}return!1})}}(o,()=>{let e=(0,t.$getNodeByKey)(o);if(!q(e)||!e.isAttached())return!1;let r=e.getLanguage()||n.defaultLanguage,a=n.$tokenize(e,r),{from:s,to:c,nodesForReplacement:l}=function(e,t){let n=0;for(;n<e.length&&Qu(e[n],t[n]);)n++;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o++,!Qu(e[r-o],t[i-o])){o--;break}let s=n,c=r-o;return{from:s,nodesForReplacement:t.slice(n,i-o),to:c}}(e.getChildren(),a);return!(s===c&&!l.length)&&(i.splice(s,c-s,l),!0)}))}function Qu(e,n){return J(e)&&J(n)&&e.__text===n.__text&&e.__highlightType===n.__highlightType||(0,t.$isTabNode)(e)&&(0,t.$isTabNode)(n)||(0,t.$isLineBreakNode)(e)&&(0,t.$isLineBreakNode)(n)}function $u(e){if(!(0,t.$isRangeSelection)(e))return!1;let n=e.anchor.getNode(),r=q(n)?n:n.getParent(),i=e.focus.getNode(),a=q(i)?i:i.getParent();return q(r)&&r.is(a)}function ed(e){let n=e.getNodes(),r=[];if(n.length===1&&q(n[0]))return r;let i=[];for(let e=0;e<n.length;e++){let a=n[e];J(a)||(0,t.$isTabNode)(a)||(0,t.$isLineBreakNode)(a)||Hu(169),(0,t.$isLineBreakNode)(a)?i.length>0&&(r.push(i),i=[]):i.push(a)}if(i.length>0){let n=e.isBackward()?e.anchor:e.focus,a=(0,t.$createPoint)(i[0].getKey(),0,`text`);n.is(a)||r.push(i)}return r}function td(e){let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n)||!$u(n))return!1;let r=ed(n),i=r.length;if(i===0&&n.isCollapsed())return e===t.INDENT_CONTENT_COMMAND&&n.insertNodes([(0,t.$createTabNode)()]),!0;if(i===0&&e===t.INDENT_CONTENT_COMMAND&&n.getTextContent()===`
74
+ `){let e=(0,t.$createTabNode)(),r=(0,t.$createLineBreakNode)(),i=n.isBackward()?`previous`:`next`;return n.insertNodes([e,r]),(0,t.$setSelectionFromCaretRange)((0,t.$getCaretRangeInDirection)((0,t.$getCaretRange)((0,t.$getTextPointCaret)(e,`next`,0),(0,t.$normalizeCaret)((0,t.$getSiblingCaret)(r,`next`))),i)),!0}for(let a=0;a<i;a++){let i=r[a];if(i.length>0){let r=i[0];if(a===0&&(r=hi(r)),e===t.INDENT_CONTENT_COMMAND){let e=(0,t.$createTabNode)();if(r.insertBefore(e),a===0){let i=n.isBackward()?`focus`:`anchor`,a=(0,t.$createPoint)(r.getKey(),0,`text`);n[i].is(a)&&n[i].set(e.getKey(),0,`text`)}}else (0,t.$isTabNode)(r)&&r.remove()}}return!0}function nd(e,n){let r=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(r))return!1;let{anchor:i,focus:a}=r,o=i.offset,s=a.offset,c=i.getNode(),l=a.getNode(),u=e===t.KEY_ARROW_UP_COMMAND;if(!$u(r)||!J(c)&&!(0,t.$isTabNode)(c)||!J(l)&&!(0,t.$isTabNode)(l))return!1;if(!n.altKey){if(r.isCollapsed()){let e=c.getParentOrThrow();if(u&&o===0&&c.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),n.preventDefault(),!0}else if(!u&&o===c.getTextContentSize()&&c.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),n.preventDefault(),!0}return!1}let d,f;if(c.isBefore(l)?(d=hi(c),f=gi(l)):(d=hi(l),f=gi(c)),d==null||f==null)return!1;let p=d.getNodesBetween(f);for(let e=0;e<p.length;e++){let n=p[e];if(!J(n)&&!(0,t.$isTabNode)(n)&&!(0,t.$isLineBreakNode)(n))return!1}n.preventDefault(),n.stopPropagation();let m=u?d.getPreviousSibling():f.getNextSibling();if(!(0,t.$isLineBreakNode)(m))return!0;let h=u?m.getPreviousSibling():m.getNextSibling();if(h==null)return!0;let g=(J(h)||(0,t.$isTabNode)(h)||(0,t.$isLineBreakNode)(h)?u?hi(h):gi(h):null)??h;return m.remove(),p.forEach(e=>e.remove()),e===t.KEY_ARROW_UP_COMMAND?(p.forEach(e=>g.insertBefore(e)),g.insertBefore(m)):(g.insertAfter(m),g=m,p.forEach(e=>{g.insertAfter(e),g=e})),r.setTextNodeRange(c,o,l,s),!0}function rd(e,n){let r=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(r))return!1;let{anchor:i,focus:a}=r,o=i.getNode(),s=a.getNode(),c=e===t.MOVE_TO_START;if(!$u(r)||!J(o)&&!(0,t.$isTabNode)(o)||!J(s)&&!(0,t.$isTabNode)(s))return!1;let l=s;if(_i(l)===`rtl`?!c:c){let e=vi(l,a.offset);if(e!==null){let{node:n,offset:i}=e;(0,t.$isLineBreakNode)(n)?n.selectNext(0,0):r.setTextNodeRange(n,i,n,i)}else l.getParentOrThrow().selectStart()}else yi(l).select();return n.preventDefault(),n.stopPropagation(),!0}function id(e,n){if(!e.hasNodes([Ti,Pi]))throw Error(`CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor`);n??=Ju;let r=[];!0!==e._headless&&r.push(e.registerMutationListener(Ti,n=>{e.getEditorState().read(()=>{for(let[r,i]of n)if(i!==`destroyed`){let n=(0,t.$getNodeByKey)(r);n!==null&&Xu(n,e)}})},{skipInitialization:!1}));let i={didTransform:!1,nodesCurrentlyHighlighting:new Set};return r.push(e.registerNodeTransform(Ti,Zu.bind(null,e,n,i)),e.registerNodeTransform(t.TextNode,Yu.bind(null,e,n,i)),e.registerNodeTransform(Pi,Yu.bind(null,e,n,i)),e.registerCommand(t.KEY_TAB_COMMAND,n=>{let r=function(e){let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n)||!$u(n))return null;let r=e?t.OUTDENT_CONTENT_COMMAND:t.INDENT_CONTENT_COMMAND,i=e?t.OUTDENT_CONTENT_COMMAND:t.INSERT_TAB_COMMAND,a=n.anchor,o=n.focus;if(a.is(o))return i;let s=ed(n);if(s.length!==1)return r;let c=s[0],l,u;c.length===0&&Hu(285),n.isBackward()?(l=o,u=a):(l=a,u=o);let d=hi(c[0]),f=gi(c[0]),p=(0,t.$createPoint)(d.getKey(),0,`text`),m=(0,t.$createPoint)(f.getKey(),f.getTextContentSize(),`text`);return l.isBefore(p)||m.isBefore(u)?r:p.isBefore(l)||u.isBefore(m)?i:r}(n.shiftKey);return r!==null&&(n.preventDefault(),e.dispatchCommand(r,void 0),!0)},t.COMMAND_PRIORITY_LOW),e.registerCommand(t.INSERT_TAB_COMMAND,()=>!!$u((0,t.$getSelection)())&&((0,t.$insertNodes)([(0,t.$createTabNode)()]),!0),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.INDENT_CONTENT_COMMAND,e=>td(t.INDENT_CONTENT_COMMAND),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.OUTDENT_CONTENT_COMMAND,e=>td(t.OUTDENT_CONTENT_COMMAND),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ARROW_UP_COMMAND,e=>{let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n)||!$u(n))return!1;let r=(0,t.$getRoot)().getFirstDescendant(),{anchor:i}=n,a=i.getNode();return(!r||!a||r.getKey()!==a.getKey())&&nd(t.KEY_ARROW_UP_COMMAND,e)},t.COMMAND_PRIORITY_LOW),e.registerCommand(t.KEY_ARROW_DOWN_COMMAND,e=>{let n=(0,t.$getSelection)();if(!(0,t.$isRangeSelection)(n)||!$u(n))return!1;let r=(0,t.$getRoot)().getLastDescendant(),{anchor:i}=n,a=i.getNode();return(!r||!a||r.getKey()!==a.getKey())&&nd(t.KEY_ARROW_DOWN_COMMAND,e)},t.COMMAND_PRIORITY_LOW),e.registerCommand(t.MOVE_TO_START,e=>rd(t.MOVE_TO_START,e),t.COMMAND_PRIORITY_LOW),e.registerCommand(t.MOVE_TO_END,e=>rd(t.MOVE_TO_END,e),t.COMMAND_PRIORITY_LOW)),(0,t.mergeRegister)(...r)}(0,t.defineExtension)({build:(e,t)=>Tr(t),config:(0,t.safeCast)({disabled:!1,tokenizer:Ju}),dependencies:[Li],name:`@lexical/code-prism`,register:(e,t,n)=>{let r=n.getOutput();return wr(()=>{if(!r.disabled.value)return id(e,r.tokenizer.value)})}}),(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};globalThis.Prism.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=globalThis.Prism.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=globalThis.Prism.languages.bash[i[o]];globalThis.Prism.languages.sh=globalThis.Prism.languages.bash,globalThis.Prism.languages.shell=globalThis.Prism.languages.bash})(globalThis.Prism),(function(e){var t=`\\\\[\\r\\n](?:\\s|\\\\[\\r\\n]|#.*(?!.))*(?![\\s#]|\\\\[\\r\\n])`,n=`(?:[ \\t]+(?![ \\t])(?:<SP_BS>)?|<SP_BS>)`.replace(/<SP_BS>/g,function(){return t}),r=`"(?:[^"\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*"|'(?:[^'\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*'`,i=`--[\\w-]+=(?:<STR>|(?!["'])(?:[^\\s\\\\]|\\\\.)+)`.replace(/<STR>/g,function(){return r}),a={pattern:RegExp(r),greedy:!0},o={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function s(e,t){return e=e.replace(/<OPT>/g,function(){return i}).replace(/<SP>/g,function(){return n}),RegExp(e,t)}globalThis.Prism.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:s(`(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*`,`i`),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[a,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:s(`(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b`,`i`),lookbehind:!0,greedy:!0},{pattern:s(`(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \\t\\\\]+<SP>)AS`,`i`),lookbehind:!0,greedy:!0},{pattern:s(`(^ONBUILD<SP>)\\w+`,`i`),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:o,string:a,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:o},globalThis.Prism.languages.dockerfile=globalThis.Prism.languages.docker})(globalThis.Prism),globalThis.Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},globalThis.Prism.languages.webmanifest=globalThis.Prism.languages.json,(function(e){var t=e.util.clone(globalThis.Prism.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,globalThis.Prism.languages.jsx=globalThis.Prism.languages.extend(`markup`,t),globalThis.Prism.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),globalThis.Prism.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,globalThis.Prism.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,globalThis.Prism.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,globalThis.Prism.languages.jsx.tag.inside.comment=t.comment,globalThis.Prism.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:globalThis.Prism.languages.jsx}},globalThis.Prism.languages.jsx.tag),globalThis.Prism.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:globalThis.Prism.languages.jsx}}},globalThis.Prism.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=!1;if(typeof r!=`string`&&(r.type===`tag`&&r.content[0]&&r.content[0].type===`tag`?r.content[0].content[0].content===`</`?t.length>0&&t[t.length-1].tagName===o(r.content[0].content[1])&&t.pop():r.content[r.content.length-1].content===`/>`||t.push({tagName:o(r.content[0].content[1]),openedBraces:0}):t.length>0&&r.type===`punctuation`&&r.content===`{`?t[t.length-1].openedBraces++:t.length>0&&t[t.length-1].openedBraces>0&&r.type===`punctuation`&&r.content===`}`?t[t.length-1].openedBraces--:i=!0),(i||typeof r==`string`)&&t.length>0&&t[t.length-1].openedBraces===0){var a=o(r);n<e.length-1&&(typeof e[n+1]==`string`||e[n+1].type===`plain-text`)&&(a+=o(e[n+1]),e.splice(n+1,1)),n>0&&(typeof e[n-1]==`string`||e[n-1].type===`plain-text`)&&(a=o(e[n-1])+a,e.splice(n-1,1),n--),e[n]=new globalThis.Prism.Token(`plain-text`,a,null,a)}r.content&&typeof r.content!=`string`&&s(r.content)}};globalThis.Prism.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||s(e.tokens)})})(globalThis.Prism),(function(e){var t=e.util.clone(globalThis.Prism.languages.typescript);globalThis.Prism.languages.tsx=globalThis.Prism.languages.extend(`jsx`,t),delete globalThis.Prism.languages.tsx.parameter,delete globalThis.Prism.languages.tsx[`literal-property`];var n=globalThis.Prism.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(globalThis.Prism),(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}globalThis.Prism.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},globalThis.Prism.languages.yml=globalThis.Prism.languages.yaml})(globalThis.Prism);var ad={bun:`bash`,dockerfile:`docker`,npm:`bash`,pnpm:`bash`,shell:`bash`,terminal:`bash`,yarn:`bash`};function od(){let e=globalThis;e.Prism=Vu.default,Object.entries(ad).forEach(([e,t])=>{let n=Vu.default.languages[t];n&&!Vu.default.languages[e]&&(Vu.default.languages[e]=n)})}function sd(){let[e]=(0,h.useLexicalComposerContext)();return M.default.useEffect(()=>(od(),id(e)),[e]),null}function cd(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 ld(e,t,n){if(e.size>5242880)return window.alert(t),null;let r=await n(e);return{altText:e.name,src:r}}function ud(){let[e]=(0,h.useLexicalComposerContext)(),n=U(),r=Oa();return(0,M.useEffect)(()=>{let i=async t=>{for(let i of t){let t=null;try{t=await ld(i,n.alerts.imageSizeLimit,r)}catch(e){console.error(e),window.alert(n.alerts.imageUploadFailed)}t&&e.dispatchCommand(He,t)}},a=e.registerCommand(He,e=>{let n=$a(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=cd(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=>cd(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=cd(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}var dd=`pre.rj-editor-code-block`,fd=`.rj-editor-text-code`,pd=`--rj-editor-inline-code-current-bg`,md=`--rj-editor-inline-code-current-text`;function hd(e){return e.classList.contains(`rj-editor-text-code`)||!!e.querySelector(fd)}function gd(e,t){return Array.from(e.querySelectorAll(`*`)).find(e=>e.style[t])?.style[t]}function _d(e,t,n){if(n){e.style.setProperty(t,n);return}e.style.removeProperty(t)}function vd(e){e?.querySelectorAll(`code`).forEach(e=>{e.closest(dd)||hd(e)&&(_d(e,pd,gd(e,`backgroundColor`)),_d(e,md,gd(e,`color`)))})}function yd(){let[e]=(0,h.useLexicalComposerContext)(),t=M.default.useRef(null),n=M.default.useCallback(()=>{t.current!==null&&window.cancelAnimationFrame(t.current),t.current=window.requestAnimationFrame(()=>{t.current=null,vd(e.getRootElement())})},[e]);return M.default.useEffect(()=>(n(),()=>{t.current!==null&&window.cancelAnimationFrame(t.current)}),[n]),M.default.useEffect(()=>e.registerUpdateListener(n),[e,n]),null}function bd(e){return e.metaKey||e.ctrlKey}function xd(e){return e instanceof HTMLElement?[`INPUT`,`SELECT`,`TEXTAREA`].includes(e.tagName):!1}function Sd(){let[e]=(0,h.useLexicalComposerContext)(),n=V();return(0,M.useEffect)(()=>{let r=()=>{Bo(e),n(Fn({isBold:!1,isCode:!1,isItalic:!1,isStrikethrough:!1,isSubscript:!1,isSuperscript:!1,isUnderline:!1})),n(Nn({backgroundColor:I.backgroundColor,fontFamily:I.fontFamily,fontSize:I.fontSize,lineHeight:I.lineHeight,textColor:I.textColor})),n(On({alignment:I.alignment,listType:I.listType}))};return e.registerCommand(t.KEY_DOWN_COMMAND,n=>{if(!bd(n)||n.altKey||xd(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(Ge)),!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 Cd(e){return(0,p.$isTableNode)(e)||eo(e)||oo(e)}function wd(){let[e]=(0,h.useLexicalComposerContext)();return(0,M.useEffect)(()=>e.registerUpdateListener(({editorState:n})=>{let r=!1,i=null;n.read(()=>{let e=(0,t.$getRoot)().getChildren();r=Cd(e.at(-1));for(let t=0;t<e.length-1;t+=1)if(Cd(e[t])&&Cd(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(Cd(e)){e.insertAfter((0,t.$createParagraphNode)());return}}let e=(0,t.$getRoot)().getLastChild();Cd(e)&&e.insertAfter((0,t.$createParagraphNode)())})}),[e]),null}function Td(){let[e]=(0,h.useLexicalComposerContext)();return(0,M.useEffect)(()=>{let n=e.registerCommand(Ue,e=>{let n=ao(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=oo((0,t.$getRoot)().getLastChild())}),r&&e.update(()=>{let e=(0,t.$getRoot)().getLastChild();oo(e)&&e.insertAfter((0,t.$createParagraphNode)())})});return()=>{n(),r()}},[e]),null}var Ed=[`words`,`characters`,`selection`,`language`,`mode`,`zoom`],Dd={characters:0,isSelectionCollapsed:!0,selectedCharacters:0,selectedWords:0,words:0};function Od(e,t){return e.characters===t.characters&&e.isSelectionCollapsed===t.isSelectionCollapsed&&e.selectedCharacters===t.selectedCharacters&&e.selectedWords===t.selectedWords&&e.words===t.words}function kd(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 Ad=M.default.memo(function({customFooter:e,isFocused:n,isFullscreen:r,items:i,language:a,zoom:o}){let[s]=(0,h.useLexicalComposerContext)(),c=U(),[l,d]=M.default.useState(Dd),f=M.default.useCallback(()=>{s.getEditorState().read(()=>{let e=(0,t.$getRoot)().getTextContent(),n=(0,t.$getSelection)(),r=(0,t.$isRangeSelection)(n)?n.getTextContent():``,i={characters:ge(e),isSelectionCollapsed:!(0,t.$isRangeSelection)(n)||n.isCollapsed(),selectedCharacters:ge(r),selectedWords:_e(r),words:_e(e)};d(e=>Od(e,i)?e:i)})},[s]);M.default.useEffect(()=>(f(),s.registerUpdateListener(()=>{f()})),[s,f]),M.default.useEffect(()=>s.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>(f(),!1),t.COMMAND_PRIORITY_LOW),[s,f]);let p=M.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:Ed;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)(M.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:kd(e,p,c)})]},`${e}-${t}`))})})});function jd(e,t,n){n&&e.read(()=>{n(on((0,i.$generateHtmlFromNodes)(t),t),JSON.stringify(e.toJSON()),e)})}function Md({lastHtmlRef:e,value:t}){let[n]=(0,h.useLexicalComposerContext)();return M.default.useEffect(()=>{t===void 0||t===e.current||n.update(()=>{En(n,t),e.current=t})},[n,e,t]),null}function Nd({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=M.default.useRef(D),[A,j]=M.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)||j(!1),d?.(e)},onFocus:e=>{j(!0),p?.(e)},ref:n,children:[(0,u.jsx)(ou,{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)(xu,{}),(0,u.jsx)(sd,{}),(0,u.jsx)(Bu,{}),(0,u.jsx)(su,{}),(0,u.jsx)(ud,{}),(0,u.jsx)(yd,{}),(0,u.jsx)(Sd,{}),(0,u.jsx)(Td,{}),(0,u.jsx)(x.LinkPlugin,{}),(0,u.jsx)(S.ListPlugin,{}),(0,u.jsx)(T.TablePlugin,{}),(0,u.jsx)(wd,{}),(0,u.jsx)(wo,{}),(0,u.jsx)(Md,{lastHtmlRef:k,value:D}),(0,u.jsx)(C.OnChangePlugin,{onChange:(e,t)=>{e.read(()=>{k.current=on((0,i.$generateHtmlFromNodes)(t),t)}),jd(e,t,f)}}),e?(0,u.jsx)(_.AutoFocusPlugin,{}):null]}),g?(0,u.jsx)(Ad,{customFooter:r,isFocused:A,isFullscreen:l,items:a,language:o,zoom:s}):null]})}function Pd({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=M.default.useMemo(()=>Ln(),[]),T=M.default.useRef(null),[E,D]=M.default.useState(!1),O=tr(S),k=M.default.useMemo(()=>Jn(O),[O]),A=co({defaultValue:n,namespace:m,value:C});M.default.useEffect(()=>{let e=()=>{D(document.fullscreenElement===T.current)};return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e)}},[]);let j=async()=>{if(document.fullscreenElement===T.current){await document.exitFullscreen();return}await T.current?.requestFullscreen()},ee=M.default.useCallback(e=>document.fullscreenElement||T.current||e?.parentElement||document.body,[]);return(0,u.jsx)(c.Provider,{store:w,children:(0,u.jsx)(Gn,{locale:f,locales:p,translations:x,children:(0,u.jsx)(Yn.Provider,{value:O,children:(0,u.jsx)(o.ConfigProvider,{getPopupContainer:ee,theme:k,children:(0,u.jsx)(a.LexicalComposer,{initialConfig:A,children:(0,u.jsx)(lo,{onImageUpload:v,children:(0,u.jsx)(Nd,{autofocus:e,className:t,editorRef:T,footer:r,footerItems:i,footerLanguageLabel:s||Fd(f),footerZoom:l,id:d,isFullscreen:E,onBlur:h,onChange:g,onFocus:_,onToggleFullscreen:j,placeholder:y,showFooter:b,theme:O,value:C})})})})})})})}function Fd(e){return e===`uz`?`O‘zbek`:e===`ru`?`Русский`:e===`en`?`English`:e}hn(),e.RJEditorI18nProvider=Gn,e.RJTextEditor=Pd,e.enTranslations=Rn,e.mergeTranslations=Bn,e.ruTranslations=Vn,e.useRJEditorI18n=U,e.uzTranslations=Hn});